Skip to content

fix: retain exact reads through agent compaction - #13

Merged
jalehman merged 2 commits into
masterfrom
lore-b74.15/exact-read-retention
Aug 8, 2026
Merged

fix: retain exact reads through agent compaction#13
jalehman merged 2 commits into
masterfrom
lore-b74.15/exact-read-retention

Conversation

@jalehman

@jalehman jalehman commented Aug 8, 2026

Copy link
Copy Markdown

What

Preserve exact successful read results through bounded provider-context compaction, and require source-bound ingestion skills to stage each update immediately after its sole exact baseline read.

Why

Production Terra canary job 2796 batched several large get_page calls. The existing uniform per-round projection removed every exact page body and content hash from provider-visible context, so the agent could not freeze a CAS-guarded proposal even though the durable tool ledger remained complete. The job failed safely with no writes, but it could not make progress.

Changes

  • Optimize exact read retention within byte caps
  • Derive mutation identity from assistant calls
  • Project mismatched tool-result identities safely
  • Keep durable tool history immutable
  • Serialize baseline reads and proposal staging
  • Add focused compaction and skill regressions

Testing

  • bun test test/ai/tool-loop-context-exact-results.test.ts test/granola-meeting-ingestion-skill.test.ts test/github-project-ingestion-skill.test.ts test/gmail-thread-ingestion-skill.test.ts — 59 pass
  • bun run verify — 31/31 pass
  • TypeScript — clean
  • Autoreview — clean
  • Independent thermonuclear review — clean

@jalehman

jalehman commented Aug 8, 2026

Copy link
Copy Markdown
Author

Exact-head CI assessment for f0498405fcd0afa7cb34a564e8890442a9f50612:

  • Passed: Tier 1, Tier 2, JSONB parity, verify, serial tests, cache, gitleaks, semgrep, and both slow focused jobs.
  • Local changed-path proof: 59 focused tests passed; repository verify 31/31 passed; TypeScript, autoreview, and independent strict review clean.
  • Broad shards 4, 5, 7, 9, and 10 failed. Every concrete failure reproduces in the deployed-base push run 31238867746 for 5b909037: stale handler expectations, existing PGLite/extract/source-state failures, stale global skill-conformance headings, and replace-page-text-operation.test.ts:138. Shard 4 later hit its 15-minute timeout after reporting that same base failure.
  • None of the failed tests or stack locations touch the compactor, its focused test, or the three changed ingestion skills.

The hosted suite remains red at its inherited baseline; the exact changed contracts and meaningful gates are green.

@jalehman
jalehman merged commit 8864bf6 into master Aug 8, 2026
16 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant