Skip to content

docs: codify id-immutability invariant in AGENTS.md - #192

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-03_agents-id-invariant
Sep 7, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-03_agents-id-invariant

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Adds Key Design Principle #6 to AGENTS.md, paired with the revert in #191:

Message ids are NEVER reused or duplicated — within a session, a raw content-hash id and a ref number (mNNNNN) denote exactly one message forever. No ref-slot reclamation/recycling of any kind; capacity pressure is resolved by widening REF_WIDTH, never by recycling numbers.

Rationale recorded inline: hosts persist refs across turns and summaries cite tags in rendered text — the model can cite any number it has ever seen, so a re-issued number silently misattributes on decompress (wrong content, not an error). Also formalizes the existing "GC-free" principle (#4) as it applies to the ref map.

Same invariant is being added to the host repos' AGENTS.md (billion-context, billion-context-pi) so hosts treat it as a kernel contract.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-03_agents-id-invariant (6b6f269)

Option A — Install from npm PR tag (recommended)

In your adapter project:

npm install acp-kernel@pr-192

Each push to this PR publishes a new version under the pr-192 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf acp-kernel-pr192.tgz
npm install ./package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 ework agent · qwen3.8-27b

Reviewed PR #192 (docs-only: AGENTS.md +10 lines, adds Key Design Principle #6). Verdict: LGTM — approve.

Verified against the code:

Duplicate screening: no other open/closed issue or PR codifies this invariant or edits the principles list. #191 is the complementary code change, not a duplicate.

Non-blocking notes:

  1. Merge ordering — fix: reclaim dead message refs, reuse exhausted capacity, classify boundary failures (billion-context#386) #176's reclamation code (pruneDeadRefs + wrap-around reuse in refs.ts/compress.ts/rebuild.ts/sync.ts) is still on master because Revert "fix: reclaim dead message refs, reuse exhausted capacity (#176)" — ref slot reuse is unsafe #191 hasn't landed. Merging docs: codify id-immutability invariant in AGENTS.md #192 alone would leave AGENTS.md asserting an invariant master currently violates, and the closing line "was reverted (Revert "fix: reclaim dead message refs, reuse exhausted capacity (#176)" — ref slot reuse is unsafe #191)" would read as done before the revert ships. Recommend landing Revert "fix: reclaim dead message refs, reuse exhausted capacity (#176)" — ref slot reuse is unsafe #191 first or concurrently.
  2. (Optional) The closing line hardcodes PR numbers fix: reclaim dead message refs, reuse exhausted capacity, classify boundary failures (billion-context#386) #176/Revert "fix: reclaim dead message refs, reuse exhausted capacity (#176)" — ref slot reuse is unsafe #191 into a standing section — fine for traceability; soften only if you want the doc to stand alone without GitHub context.

Still needs a second-agent sign-off and a human merge per repo policy (Agents don't merge). Happy to take the second review or tweak wording if you want the notes addressed.

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