Skip to content

test: reproduce the two remaining context continuity failures in #4290 - #4291

Closed
joelteply wants to merge 2 commits into
canaryfrom
test/context-continuity-regressions
Closed

joelteply wants to merge 2 commits into
canaryfrom
test/context-continuity-regressions

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Reproduction tests for the two review findings on #4290, based on ac5e17e. This is stacked onto that PR's branch so its owner can adopt the tests alongside the implementation fix.

  • A user follow-up after request/action/result must not make the completed action disposable.
  • When the evidence bundle exceeds the available capacity, fitting must explicitly refuse rather than silently drop it.

Extends the existing test module and uses the existing HeuristicInferenceAdapter; no new harness or production code. These assertions are expected to fail against the current implementation. Native execution has been started but is not yet complete; no passing test claim. They are synthetic deterministic reproductions, not a captured live persona turn, and not sufficient alone to prove end-to-end continuity.

Keep draft until the owning implementation fixes these cases and validates the actual outbound request. The live capture/request IDs are still requested from M5. This PR must not be merged as an independent red-test change to canary.

joelteply and others added 2 commits September 20, 2026 20:59
…sation fill is 30s × THIS node's measured prefill rate, and it may never cost her the record of her own last act

PART 1 — THE INSTANCE (card 7d044c91)

`latency_fill_cap = PREFILL_TARGET_SECONDS * CONSERVATIVE_PREFILL_TOKENS_PER_S`
— a constant times a constant, 30 × 500, a flat 15,000-token conversation fill
on every machine in the fleet.

Measured live on the M5 tonight:
  delib.fill.latency_capped persona=Aiko   window_budget=56227 cap=15000
  delib.fill.latency_capped persona=Benchy window_budget=47440 cap=15000
Aiko holds a 67,072-token lane and is handed 15,000 of conversation — 27% of her
own context. And the 500 t/s the cap assumed is fiction here:
`inference.prefill.complete` measured `ingest_tok_per_s` of 70, 90 and 92 on the
M5, ~25 on the IntelMac. So the constant was 5–20× optimistic and the 30-second
target it exists to protect was really ~187 s. The cap failed its own stated
purpose on every machine while taking her context away.

The tokens-per-second half is now MEASURED — `prefill_rate::latency_fill_cap`,
on the same rate-source ladder #4283 established for decode: fresh, else stale
(the record survives a reboot), else the slowest rate any model on this box
holds, and only with nothing ever measured a named floor
(`UNMEASURED_FILL_FLOOR_TOKENS` = the substrate's own bootstrap working set).
`PREFILL_TARGET_SECONDS` stays as the LATENCY INTENT — the one chosen number,
and a real product decision. The probe now carries `rate_source`,
`measured_prefill_tps`, `target_seconds` and `derived_cap`, so a clip is never
again invisible.

PART 1b — WHAT THE CLIP IS ALLOWED TO COST HER

The assembly under the cap is sophisticated; a crude cap on top of it throws the
mind into chaos. The drop is already recency-ordered (oldest first, whole
messages, cluster-aligned, with stimulus / room updates / latest result held in
typed slots outside the eviction range) — but HOW FAR it reaches was decided by
cost alone, and a tight fill budget walks it right up to the run at the end: her
act, its result, and the turn that asked for it. That run is the evidence she
already did the thing. Lose it and she re-issues the act —
`persona.act.repeat_short_circuited` ("identical act already satisfied this
turn"), then `persona.act.no_deliverable_yet`, then an hour with zero writes
that reads as a lazy persona.

So: `fit_messages` holds that run out of the drop whenever the budget can hold
it at all (when it cannot, nothing can save it and the ordinary drop stands —
a trimmed prompt beats a 500 that mutes her for the tick), the cap is floored at
what the evidence costs so that refusal is satisfiable, and the receipt says
what the clip DID shed, in kind and amount (`shed_messages`, `shed_tokens`,
`shed_own_moves`, `shed_move_results`, `kept_recent_move_*`).

PART 2 — THE RATCHET (source_hygiene::derived_bounds)

Four defects of one shape in one night: the 768-token output floor that ended
turns inside the reasoning channel (#4194), the KV cache type defaulting to f16,
the flat 10 s page-wedge bound sized from the M5's 0.1 s (#4287), and this one.
Each a static number standing in for a measurement the substrate already takes.

The de-hardcode guard in `cognition::context_budget` could not catch this class:
it cannot see a PRODUCT (both halves of 30 × 500 were individually exempted, in
good faith), and its vocabulary stops at size while this class hides in time and
rate units. The new rule asks that a bound on a live path be derived or carry a
`derived-or-floor: <why>` justification, and ratchets at the current count (159)
the way `unwrap_justification` and `production_reachability` do.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Both continuity regression tests are present in merged #4290, verified from its diff. Closing this stacked draft as absorbed; no separate merge needed.

@joelteply joelteply closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant