Skip to content

fix: preserve covered prefixes and reject ambiguous compaction ownership - #456

Closed
100yenadmin wants to merge 5 commits into
mainfrom
codex/eva-lcm-admission-v3
Closed

100yenadmin wants to merge 5 commits into
mainfrom
codex/eva-lcm-admission-v3

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Problem and behavior

Compaction can reject a contiguous new leaf when a retained summary already covers the leading part of the logical conversation but the lifecycle frontier is stale. Source mapping and publication must use the same ownership domain; widening only publication is insufficient.

This change credits only a proven retained leading prefix, leaves original leaf lineage unchanged, and publishes new source occurrences once. Explicit conversation ownership remains authoritative. Ambiguous legacy ownership, duplicate claims, missing coverage, or inadmissible potentially emitted summary lineage reject publication without advancing the frontier.

The ownership check conservatively validates all current uncondensed roots that could be emitted, independently of token-budget prediction. This can refuse compaction for an invalid legacy root even when one particular cap would omit it. It does not delete, reassign, or silently repair that history.

Refs #247. This is a bounded replacement implementation; contributor PR #397 remains preserved. This PR does not close #247 or claim retained-session recovery, release acceptance, or a deployed repair.

Validation

  • The retained-leading-prefix product regression fails on unmodified main 7fb19f8d3518080c8d07408a2a28c3c66c15c51b.
  • At f063c8f3be4b3f0037e930d539c58ba33d73a918, PYTHONPATH=<pinned-Hermes-checkout> python -m pytest -q tests/test_issue_247_multisession_publication.py: 9 passed. The file exercises atomic refusal, exact leading-prefix credit, rollover, mixed below/above-frontier duplicate claims, conflicting blank legacy bindings, and capped emitted-root ownership.
  • Independent semantic review of the original surface plus targeted corrections passed. This is source review, not the protected exact-head release/merge receipt.
  • The canonical Hermes tool-result shape completes five ordinary compaction publications on both baseline and candidate, reducing the synthetic context from 51 to 26 messages. A prior fixture using name instead of Hermes's tool_name was corrected; it is not counted as a product defect.
  • Exact-head CI passes on Python 3.11–3.14, lint and workflow-lint. The existing contiguous-frontier focused file also passes all 11 tests.
  • A complete retained-session copy still refuses normal host compaction without changing its active context or losing original data. The isolated ledger-prefix proof does not establish retained-session recovery. Release qualification remains incomplete.

No schema migration, provider-routing change, host protocol, native fallback, or historical re-summarization is introduced. Existing original messages and summary nodes remain stored.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@100yenadmin

Copy link
Copy Markdown
Member Author

Thanks for this bounded attempt at #247. That issue is now closed, and the underlying publication_invariant_conflict mechanism across compaction boundaries was fixed on main in v0.24.0 (#484, together with #462), with further occurrence-projection work in v0.24.1 (#510/#515). Closing as superseded. If ambiguous legacy ownership still blocks publication on current main, please open a fresh issue with a v0.24.1 reproduction and a PR against main.

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.

fix: publication_invariant_conflict breaks compression on multi-session conversations (v0.22.0 regression)

1 participant