Skip to content

fix: preserve ingestion proposal inventory through compaction - #15

Merged
jalehman merged 5 commits into
masterfrom
lore-b74.20/unique-proposal-inventory
Aug 8, 2026
Merged

fix: preserve ingestion proposal inventory through compaction#15
jalehman merged 5 commits into
masterfrom
lore-b74.20/unique-proposal-inventory

Conversation

@jalehman

@jalehman jalehman commented Aug 8, 2026

Copy link
Copy Markdown

What

Make staged ingestion proposals keep one ordered, unique page inventory across context compaction and validate create/update effects against current source state before any proposal fragment is frozen.

Why

Long-running ingestion agents could forget earlier staged pages after compaction, restage duplicate slugs, or classify an existing page as a create. That left otherwise recoverable ingestion attempts with no actionable path forward.

Changes

  • Freeze ordered proposal inventory atomically
  • Validate effects against current pages
  • Preserve frozen inventory through compaction
  • Reject soft-deleted targets before staging
  • Keep malformed agent data out of prompts
  • Share one inventory validation contract

Changes walkthrough

File Change
src/core/ingestion-proposal-contract.ts Canonical inventory types and validation
src/core/ingestion-proposal-context-policy.ts Safe compaction projection and summaries
src/core/minions/agent-job-proposals.ts Atomic freeze and live effect checks
src/core/ai/tool-loop-context.ts Generic typed context-policy hooks
src/core/ai/gateway.ts Compose proposal context policy
skills/*-ingestion/SKILL.md Require repeated inventory and repairs
test/ Runtime, compaction, and adversarial regressions

Testing

  • bun run typecheck
  • AI compaction/OpenAI suites: 37 passed
  • Runtime, E2E, and skill suites: 156 passed
  • JSONB, newline, diff, PII, export, and route guards
  • Autoreview: clean, no actionable findings
  • Thermonuclear review: clean after contract extraction
  • Full local gate exposed an unchanged extract-atoms-page-discovery intra-file timeout; the exact test passes alone and this branch does not modify that test or extraction implementation. Hosted CI remains required for the exact PR head.

@jalehman

jalehman commented Aug 8, 2026

Copy link
Copy Markdown
Author

Hosted CI comparison for exact head f65a599:

  • All non-matrix gates passed: verify, serial tests, gitleaks, semgrep, JSONB parity, Tier 1, Tier 2, and both slow suites.
  • Current master run 31244771235 at exact base 6e4fb03 fails the same matrix shard set: 4, 5, 7, 9, 10.
  • Shards 7, 9, and 10 match master exactly: same tests, assertions/errors, received values, and counts.
  • Shard 5 matches master exactly: the same 11 failures, including the same extract-atoms timeout cascade.
  • Shard 4 reproduced all five master skill-conformance failures, then exceeded the 15-minute job ceiling before a final suite summary. No new assertion signature appeared, and this PR changes no shard-4 test file.

The repository-wide sharding and state-isolation defects are tracked separately as Lore lore-b74.22. Focused changed-path proof remains 193/193 tests passing, typecheck clean, and both strict reviews clean.

@jalehman
jalehman merged commit 2b02ad8 into master Aug 8, 2026
28 of 40 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