Repository navigation
Key context requests by the incarnation, not its name (ContextRequestKeyPhase) - #2659
Merged
Merged
Conversation
…KeyPhase) ContextRequest was indexed on (thread_name, thread_birth), and newest() filtered on the current name (IDEN-6). After a rename, latest() missed every earlier request, returned AbsentContext and restarted the turn counter at 1; paging fanned out over every alias in the registry to paper over it, then re-resolved each row's owner to check the fan-out. A recorded incarnation's identity is its birth: RecordedThreadIncarnation compares and hashes wire_birth, and its lookup is a hash of that birth. The table now keys on thread_birth alone; append and every read require a recorded incarnation. The thread_name column, the alias fan-out, the post-page owner recheck and the registry snapshot threaded into paging only to feed that fan-out are gone. Carry: tools/cutover/carry_context_request_key.py rebuilds the table through its declaration (the generated name column cannot be derived away), keeping every row and id. On a copy of the live store: 51355 rows, identical id/identity/versions/size digest before and after, second dry run reports 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-tools at 233ea6b, every finding: |
|
debt-src at 233ea6b, every finding: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ContextRequestKeyPhase (REMAINING-SLOP-PLAN 4.2, IDEN-6).
ContextRequest was keyed on (thread_name, thread_birth) and
newest()filtered on the current name, so after a renamelatest()returned AbsentContext and the turn counter restarted at 1. Paging covered for it by fanning out over every registry alias, then re-resolving each row's owner.A recorded incarnation's identity is its birth:
RecordedThreadIncarnationcompares and hasheswire_birth(thread_identity.py:146-152), andlookupis a hash of that birth. The table now keys onthread_birthalone.Deleted: the
thread_namegenerated column and its index, the alias fan-out (recorded_namesin paging), the post-page owner recheck, and the RegistrySnapshot threaded throughpageonly to feed the fan-out.Carry:
tools/cutover/carry_context_request_key.py, run byagent-comms install. DurableTables cannot derive a dropped generated column (derive_schemarefuses: "ContextStore differs from its declaration"), so the step rebuilds the table throughContextRequest.rebuild.Proof on a copy of the live store (51355 rows):
Tests: context tests (
test_claim_bus_read,test_context_manifest_deltas,test_context_source_inspection,test_turn_context_wire,test_unreadable_history_observation): 44 passed.Phase evidence: no
thread_namein src/agent_comms/context_store.py.Overlap: #2646 (MI, SingletonRow) touches the same import lines in context_store.py. Whoever lands second resolves two lines.
🤖 Generated with Claude Code