fix(context): recover SDK compaction failures through archive-linked fresh sessions #495

Merged
karsten merged 1 commit from fix/native-compaction-handover into main 2026-11-15 11:02:00 +00:00
Owner

Goal

Close the missing bridge between automatic SDK compaction failures and the host archive-linked handover. No byte/token gate, extra summary retry, working-turn replay or invented authority.

  • Persist content-free native failure receipts using public SDK custom metadata; successful compaction supersedes failure. Intentional extension cancellation and operator cancellation are distinct.
  • Adopt a real native failure once at the settled host boundary. Archive the complete original evidence and seed a fresh session with archive/checkpoint references. This path calls neither the failed native summarizer nor an additional summary model.
  • Keep prepared recovery, genuine holds, disabled policies and independent continuation authorization intact. Failed working turns remain failed; no blind replay.

Validation

Six new tests pass: native receipts persist across reopen; intentional cancellation is not failure; archive linkage, exact original evidence, no summary retries, no effect replay; actual assessed remaining work reaches fresh context; policy boundaries retained. Existing 54 focused tests passed. Full suite before rebase: 2619 pass, 1 existing optional skip, 0 failures. Rebased exact-head full suite is running. Typecheck/build pass. Independent review PASS.

Minerva's hook change is a separate shared GitOps PR: it emits this receipt only for real incomplete automatic summaries, never for manual/backoff/operator cancellation. Activation and live behavioral verification remain separate.

## Goal Close the missing bridge between automatic SDK compaction failures and the host archive-linked handover. No byte/token gate, extra summary retry, working-turn replay or invented authority. - Persist content-free native failure receipts using public SDK custom metadata; successful compaction supersedes failure. Intentional extension cancellation and operator cancellation are distinct. - Adopt a real native failure once at the settled host boundary. Archive the complete original evidence and seed a fresh session with archive/checkpoint references. This path calls neither the failed native summarizer nor an additional summary model. - Keep prepared recovery, genuine holds, disabled policies and independent continuation authorization intact. Failed working turns remain failed; no blind replay. ## Validation Six new tests pass: native receipts persist across reopen; intentional cancellation is not failure; archive linkage, exact original evidence, no summary retries, no effect replay; actual assessed remaining work reaches fresh context; policy boundaries retained. Existing 54 focused tests passed. Full suite before rebase: 2619 pass, 1 existing optional skip, 0 failures. Rebased exact-head full suite is running. Typecheck/build pass. Independent review PASS. Minerva's hook change is a separate shared GitOps PR: it emits this receipt only for real incomplete automatic summaries, never for manual/backoff/operator cancellation. Activation and live behavioral verification remain separate.
fix(context): recover failed SDK compaction through archive-linked handover
All checks were successful
decision-interface-ci / full-validation (pull_request) Successful in 3m27s
a536994e4d
Author
Owner

Post-merge installation/behavior evidence (not business completion):

  • Release 0.1.338, source 6006278b6e, digest sha256:8c6a9929f35f7410cbda4dc8892e42a4d1b7da392b93f60cd66b560f9d41eb5a is verified in the running Minerva container; compiled native receipt and host recovery paths are present. Promotion used the normal owner/GitOps path; application reports Synced/Healthy.
  • Real installed hook + local model compaction passed: 9,894 input / 481 output tokens, complete checkpoint, original entries retained, working model retained, configured output capacity 8,192 (no artificial 1,536 clamp).
  • Separate isolated installed Core + SDK + Minerva hook fault test exercised the REAL automatic threshold-compaction flow (not a manually emitted SDK event). Synthetic provider transport returned a truncated summary. Result: exactly one original fixture effect, one archive-linked fresh session, one remaining tool action that actually loaded/checked the linked archive, one summary attempt and no retry/replay. Existing independent admission was represented by a deterministic fixture decision; this is not a claim of real business assessment accuracy. The API-source variant correctly did not autonomously continue.
  • Five ordinary native sessions subsequently showed real successful compactions and further tool results after compaction, including reads/bash/dispatch. Some tools reported errors; no task/business success is inferred.

No production ledger edits, forced pod deletion, model switch, blanket unpause or replay of uncertain effects was used. Historical retained inputs and the separate assessment-blocked business execution remain to reconcile.

Post-merge installation/behavior evidence (not business completion): - Release 0.1.338, source 6006278b6e5306352266c1847f0c8e1921692379, digest sha256:8c6a9929f35f7410cbda4dc8892e42a4d1b7da392b93f60cd66b560f9d41eb5a is verified in the running Minerva container; compiled native receipt and host recovery paths are present. Promotion used the normal owner/GitOps path; application reports Synced/Healthy. - Real installed hook + local model compaction passed: 9,894 input / 481 output tokens, complete checkpoint, original entries retained, working model retained, configured output capacity 8,192 (no artificial 1,536 clamp). - Separate isolated installed Core + SDK + Minerva hook fault test exercised the REAL automatic threshold-compaction flow (not a manually emitted SDK event). Synthetic provider transport returned a truncated summary. Result: exactly one original fixture effect, one archive-linked fresh session, one remaining tool action that actually loaded/checked the linked archive, one summary attempt and no retry/replay. Existing independent admission was represented by a deterministic fixture decision; this is not a claim of real business assessment accuracy. The API-source variant correctly did not autonomously continue. - Five ordinary native sessions subsequently showed real successful compactions and further tool results after compaction, including reads/bash/dispatch. Some tools reported errors; no task/business success is inferred. No production ledger edits, forced pod deletion, model switch, blanket unpause or replay of uncertain effects was used. Historical retained inputs and the separate assessment-blocked business execution remain to reconcile.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!495
No description provided.