Skip to content

solve-engine 2.44.0

Latest

Choose a tag to compare

@LiamRiddell LiamRiddell released this 27 Oct 02:09
9d3d7a2

The first release to npm since 2.40.0. Versions 2.41.0, 2.42.0 and 2.43.0 were prepared on main and never published, so this one carries all of them: 265 changes by the changelog's count, 66 of them minor. The full list is in the changelog, in packages/engine/CHANGELOG.md; this note covers what a reader or a host will notice.

What changes by default

today, tomorrow, yesterday and the relative days now name a day, at local midnight, so they show as a date with no time of day. now is still the instant, and a span shorter than a day (2 hours ago) is unchanged. At noon on Wednesday 11 March 2026 in London:

line before now
today Wednesday, March 11, 2026, 12:00:00 PM Wednesday, March 11, 2026
next friday Friday, March 13, 2026, 12:00:00 PM Friday, March 13, 2026
today + 3 weeks Wednesday, April 1, 2026, 12:00:00 PM Wednesday, April 1, 2026
days until 25 december 288.50 days 289 days
tomorrow - today 24:00 1 day

To keep the old reading, build the engine with date: { relativeDays: "now" }. A line that used today as "this instant" should say now, and today + 2 hours is now two o'clock in the morning, so it should say now + 2 hours. The changelog entry for 2.44.0 sets out the upgrade in full.

What an engine can read now

The engine reads more of what people write. Each line is a result the engine gives:

2000 kcal in kJ                      = 8,368.00 kJ
3000 mAh * 3.7 V                     = 11.10 Wh
20 knots in km/h                     = 37.04 km/h
120 mmHg in kPa                      = 16.00 kPa
9.81 m/s^2 * 3 s                     = 29.43 m/s
100 W / 20 V                         = 5.00 A
35 mpg imperial in l/100km           = 8.07 l/100km
1 metric cup in ml                   = 250.00 ml
4000px at 300 dpi                    = 13.33 in
15 percent of 60                     = 9
50 increased by 20%                  = 60
PT1H30M                              = 90 minutes
2026-01-31 + P1M1D                   = Sunday, March 1, 2026
[1 km, 500 m] * 2                    = [2.00 km, 1.00 km]
take home on £50,000 in Scotland     = £38,023.55
fe80::1                              = fe80::1
  • Dates and time. Spoken relative dates (3 days ago, end of month, noon, this friday), a date with a time of day (2026-01-04 14:30), time difference between London and New York on 20 March 2027, a name for every place in the time zone database, a configurable weekend and first day of the week, and a time in another zone that is a real time and so computes.
  • Units and money. Everyday units, speed, acceleration and frequency in unit algebra, a bracketed list that carries one unit, each currency shown to its own places, currency read the way it is written (100 €, A$100), and a price index chosen by the amount's currency, from 1913 for US dollars.
  • Notes. A variable named in several words (hourly rate = $50), named scenarios (line 3 under bull), goal seek that searches negative inputs and takes a range, and ans for the line above.
  • Other languages. A German or French engine reads the decimal comma, and an answer's words follow the locale.

For hosts

  • engine.formatValue(value) writes a result in the engine's own zone and locale, and await engine.settle() waits for live values.
  • A failed document line keeps its error code and where in the line it failed. Every error code is catalogued, exported and documented on a generated page.
  • A misconfiguration is named when the engine is built (an unknown option or setting, a package with no name), and strict, onPackageError and getRegisteredPackages() report a package that failed to register.
  • A note has a work budget (vm.maxLineRunsPerPass) and a ceiling on what it keeps (vm.maxRetainedElements), and a live-data resolver runs at most six fetches at once.
  • as converters, token categories and the query cache a plugin function reads now belong to one engine, so two engines in a process no longer see each other's packages.
  • The testing kit gains toResolveTo, settled() and expectDocument.

The boundary: the one default this note calls out is date.relativeDays, above, and the old reading is one setting away. The changelog lists the other changes by version for a host that wants to check its own use.

Verification

  • docs/src/data/testStats.json records 37,970 tests in 892 suites, and 3,158 documented examples that the documentation specs evaluate against the engine.
  • The repository's checks (Node 22, 24 and 26, dates in three time zones, the packed-tarball install, and the documentation and playground builds) were red on main from 8 to 26 October, on new dependency advisories and three specs that read the real clock across London's change of clocks (fixed in #916), and then on Node 26 alone, where an idle socket left by a spec that reached a live service failed an unrelated suite (fixed in #921). They pass on main at the commit this release is cut from.
  • The publish job runs npm run verify:ci, the packed-tarball install and the bundled-consumer contract again before anything reaches npm.