Skip to content

v0.21.7 — Revert + corrected output-error catch

Choose a tag to compare

@TheArchitectit TheArchitectit released this 19 Aug 11:25
· 20 commits to master since this release

v0.21.7 — Revert + corrected output-error catch

Hotfix — reverts the Phase H.1 regression introduced in v0.21.5/v0.21.6

v0.21.5 and v0.21.6 are DEPRECATED. Upgrade to v0.21.7.

Bug

Phase H.1 (v0.21.6) added a guard in context-handler.ts that called piCompactWouldNoop(ctx) — the predicate for pi's durable ctx.compact() path — before evaluateGate consumed the forceCompactNextGate flag. When the session was small (the exact scenario Phase H targeted: a 32k-context model truncating below the input threshold), piCompactWouldNoop returned true, so the guard cleared the flag and returned early, suppressing the live-trim pipeline entirely. The default compaction path (buildLiveTrimView in liveTrim.ts) never calls ctx.compact(), so the durable-path predicate was irrelevant — it guarded nothing it needed to and broke the one thing Phase H was built to fix.

Result: small-context models entered an infinite truncation loop ("compact never").

Fix

  • Full revert of the v0.21.5/v0.21.6 sprint to the v0.21.4 baseline (39584739).
  • Cherry-picked the audit-verified correct phases (A–G + H) back, without the H.1 guard.
  • The Phase H output-error catch trips compaction on stopReason: "length" via a one-shot forceCompactNextGate flag consumed by gateCheck.ts evaluateGate — the correct and sufficient mechanism.
  • Safety valves already in place (live-trim null-cut return, thrashGuard, 2s debounce, fallbackCompaction) handle every edge the H.1 guard tried (and failed) to cover.

Threshold normalization (Phases A–G, kept)

  • A: COMPACT_TIERS folded to a fraction map (low 0.5 / medium 0.6 / high 0.7 / ultra 0.7 / mega 0.75)
  • B: DEFAULT_CONTEXT_WINDOW named constant (env MEGACOMPACT_DEFAULT_CONTEXT_WINDOW, 200_000, display-seed only)
  • C: umbrella-OFF DEFER now also returns +Infinity when the window is unknown (LTS correctness)
  • D: autoCompactCheck takes a required threshold param (footgun closure)
  • E: DEFAULT_SAVED_GOAL seeds the saved goal
  • F: DEFAULT_FAST_GATE_PCT_CUSTOM = 70 (pure refactor)
  • G: test rewrites for the new tier map

Dashboard rule compliance

  • MEGACOMPACT_OUTPUT_ERROR_COMPACT added to the Settings → Compaction group (default ON)
  • MEGACOMPACT_DEFAULT_CONTEXT_WINDOW added to EXCLUDED_SETTINGS (display-seed only, never a firing gate)

Cross-system impact

git diff 39584739..HEAD -- src/vector-cortex/ src/memory.ts src/recall.ts src/engine.ts src/store/ → 0 lines. No vector-cortex, memory, recall, engine, or store code was touched.

Device-side verify

pi update --extensions
# open a 32k-context model session, drive to ~77% context, trigger output truncation
# compaction should fire on the NEXT context event; no "Nothing to compact" error