Skip to content

v0.8.8 — nested dedup grants and solver hardening

Choose a tag to compare

@tiagoschmitt tiagoschmitt released this 17 Aug 17:34
· 16 commits to main since this release

The dedup idiom shipped in 0.8.7 only granted its facts when the const sat at the function's top level — in real code it lives inside the if-branch right before the constructor call. The call-site collector now scans all declarations in the enclosing function (nested blocks included, nested functions excluded; block scoping keeps the per-name grant safe).

if (overrides) {
  const rulesDeduped = [...new Map(projectRates.map((m) => [m.key, m])).values()];
  new FeeCalculator(rulesDeduped, { ... });   // uniqueBy ✓ PROVED — nested too
}

Underneath it, a second bug: a truthiness path condition (if (overrides)) translates as a non-Bool, passed construction and blew up inside the solver as invalid argument. Assumptions are now sort-checked before asserting, and check() itself treats a rejected assertion as an unknown result with a reason — an uncaught throw there used to kill entire shards.

328 core tests.