Skip to content

Share table capabilities and migrate claim fields in retained stores - #2646

Merged
11 commits merged into
mainfrom
next/mi-field-directives
Oct 23, 2026
Merged

11 commits merged into
mainfrom
next/mi-field-directives

Conversation

@trissim

@trissim trissim commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

The FailedTurnEvidence carry uses one rebuild for both renamed columns. Reviewer branch origin/next/failure-reason is merged, including ab91e5d7ce05649a27e6ceeebc6fbbb701461e4b. Both owned carries return root-relative Paths for #2691's Carried.rewritten contract. Pair with #2691 in the integration batch; no registry compatibility aliases were introduced.

Python and the retained stores now use three distinct names for three distinct facts: claimed_identity, resource_scope, and claim_generation. The old WireName("admission") overrides are deleted, along with the related generation/epoch/counter aliases. tools/cutover/carry_claim_fields.py carries the predecessor format once; the production codec understands only the current declarations.

The same PR shares the twelve WITHOUT ROWID declarations through WithoutRowid, the two fixed singleton keys through SingletonRow, and the compatible plain turn/item declarations through TurnItem. FieldCodec and TypedTable remain the field and SQL owners.

Stored format change

The carry selects each retired key from its declaring class. ValueDecoder, FieldPlan and the existing representation classes own traversal; the carry-side shape dispatcher is deleted. RetiredClaimFields is the shared capability inherited by both carries and used by the physical JSONL boundary. It does not infer whether an admission value is an identity, a scope, or a generation by inspecting its shape. Family/union selection uses the existing codec. Opaque provider JSON and message text are not recursively searched. A record containing both old and new spellings is refused.

Retained store Rewrite
registry.json in the root and every catalogued archive admissions → claims; publication uses RegistryStore, including its private guard
goal-private/goal_attempts.sqlite3, FailedTurnEvidence One rebuild: SQL admission → claim_generation and retired reason labels → declared failure; includes Reviewer commit ab91e5d
coordination.sqlite3, NativeRuntimeInput SQL column sent_owner_admission_generation → sent_owner_claimed_generation
coordination.sqlite3, CurrentNativeCursor SQL column owner_admission_generation → owner_claimed_generation
input_dispositions.sqlite3, typed attempt JSON StoredInput's admission → claim_generation; HumanInputOrigin's admission → claimed_identity; nested ClaimedIdentity's admission_generation → claimed_generation
bus.sqlite3, typed claim-transition JSON AcquiringClaim's admission → resource_scope; RecordedScope's owner_admission_generation → owner_claimed_generation
turns/*.json ActiveTurn's admission_generation → claimed_generation
owner-restart-queue/**/*.json OwnerRestartSelection's admission_generation → claimed_generation; states and attempts remain unchanged
selected-write-plans/*.json admission_epoch → claim_epoch
Every declared SQLite JSON column / JsonDocument that contains those records The same declaration-derived walk also handles ClaimedIdentity, TurnFence, SelectedWriteBinding, QueuedInputContext and the live ACP scope records if nested in an owned stored record; no second file/column roster
The history archive catalogue Existing CarryCatalogSource.carried_registry reseals rewritten snapshots

RootFile discovers the actual files and TypedTable discovers the row/column declarations. The three renamed SQL columns are rebuilt through TypedTable.rebuild. Installation maintenance encloses publication, runtime mutation triggers are restored, and SQLite checks references before commit. Dry runs read snapshots and do not rewrite stores. A second run has no old keys to carry.

DeclaredFailures explicitly precedes ClaimFields. Its single FailedTurnEvidence.rebuild supplies both the retired reason-to-failure expression and admission-to-claim_generation expression, including roots with either old column alone. The retired-column mapping is inherited from RetiredClaimFields, not copied. ClaimFields then precedes FinishedTurns, DeadTurns, OwnerRequests, TurnOwner and ContextRequestKey; the latter registry readers cannot decode admissions after this production rename. OwnerRequests already precedes BusHistory. The old JSONL reader remains isolated in tools: its current conversion uses the same typed key walk, while its reverse template still proves the original physical JSONL bytes. The missed acquiring.claim_scope consumer in carry_bus_history is migrated to resource_scope.

Ownership and exclusions

  • typed_table.py:2173 owns WITHOUT ROWID; twelve concrete tables inherit it and delete their local option. typed_table.py:2180 owns the fixed singleton key; ContextStoreInfo and SnapshotMeta inherit it.
  • turn_item.py:9 owns the plain turn/item pair and its key; runtime update/item consumers and EarlierItems inherit it. ExternalPageRow retains its different keyed pair. DraftRow retains its pair because inserting a base would move a stored column.
  • The prior source trace separated identity, recorded resource scope and generation consumers rather than merging their erased AST shapes. The declarations and constructor/attribute consumers now use those distinct names. All fifteen source/test paths from superseded Store claim-scope fields under their own names, with their carry #2655 are covered, using this per-type map instead of its blanket claim_scope name.
  • SchemaMeta has exactly one ddl_digest, so nothing was factored. Revisioned remains excluded: revision>0 and revision > 0 differ in stored SQL. OwnerIncarnation and Addressed remain with their plans.
  • The capability-only checkpoints preserved the complete 77-table / 239-object DDL dump byte-for-byte. The later stored-key order explicitly authorizes the three SQL column renames above, so an empty final DDL diff is no longer the claim.

Evidence and remaining execution

Before the global stop, the capability changes passed 51 table/schema tests and 98 singleton/item tests. Those results predate the claim migration and later main merges; they are not results for this head. The new carry has not been executed locally. The single integrator owns the next touched-test run, including the existing bus-history conversion/read-back tests, input/claim/registry tests, turn carries and table/schema tests. The installed affected path is not claimed here.

Earlier source evidence is retained in /home/ts/.cache/agent-scratch/mi-field-directives-source.json, mi-field-without-rowid-source.json, and mi-field-claim-consumers.txt; the prior DDL snapshots are mi-field-ddl-before.json, mi-field-ddl-singleton.json, and mi-field-ddl-claims.json. No new census was run after the stop.

Every remaining admission hit under src

Path:line Reason kept
commander/rules/plain-reporting.md:11 Tristan's quoted instruction rejecting the old vocabulary
plan_phases.py:636 The guard searches for the forbidden WireName spelling; Backend owns this file
storage_room.py:228 General storage-selection docstring, not a field or stored key
todos.py:1250 The refused-vocabulary expression must contain the word it refuses
skills/refactor-audit/SKILL.md:84 Pinned skill's description of an audit rule
skills/refactor-audit/references/patterns/identity.md:22 Historical counter example
skills/refactor-audit/references/patterns/implementation.md:512,526,532 Historical bad-code example and its field-group explanation
skills/refactor-audit/references/patterns/membership.md:76 Historical example filename
skills/refactor-audit/references/patterns/over-time.md:197,236 Historical wire-codec findings and their deletion
skills/refactor-audit/tests/fixtures/wire-identity/coding-before.py:14 and coding-after.py:14 Pinned audit fixture methods
skills/refactor-audit/tests/test_audit_regressions.py:123 Pinned audit regression name

NoExactCopies replacement design (Backend files untouched)

  1. Declare each maintenance fact's determining class and complete consumer family at a pinned source head.
  2. Resolve declarations, bindings and inheritance/MRO through NRA without erasing names, attributes or literals.
  3. Require every related consumer to reach the owning method/field and require replaced competing implementations to be absent.
  4. Preserve distinct required answers; unresolved dynamic edges produce unreadable evidence, never success.
  5. Report source ownership separately from codec, SQL and actual application results; passing unrelated tests or having unique erased shapes cannot complete a phase.

Assumed: the installer holds maintenance and stops predecessor writers; predecessor/current records use the declared formats; uncertain input records are transformed without any replay. Mixed old/new fields are refused, not resolved by guessing. The integrator must establish execution results for this head.

# Conflicts:
#	src/agent_comms/acp_extension.py
#	src/agent_comms/context_store.py
#	tests/test_acp_queue_contract.py
@trissim
trissim marked this pull request as ready for review October 23, 2026 08:01
Copilot AI balanced review requested due to automatic review settings October 23, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

debt-src at b6714aa, every finding:

grew FunctionLocalImport:src/agent_comms/child_process.py +1
grew FunctionLocalImport:src/agent_comms/pi_commands.py +1
grew LintFindings:src/agent_comms/messages.py +1
grew LintFindings:src/agent_comms/native_child.py +1
grew LintFindings:src/agent_comms/schedule_rules.py +1
grew LintFindings:src/agent_comms/task_sources.py +1
grew TypeErrors:src/agent_comms/child_process.py +3
grew TypeErrors:src/agent_comms/native_child.py +2

@trissim
trissim marked this pull request as draft October 23, 2026 08:04
@trissim trissim changed the title Share table capabilities and separate claim identity fields Share table capabilities and migrate claim fields in retained stores Oct 23, 2026
@trissim
trissim marked this pull request as ready for review October 23, 2026 08:28
@trissim
trissim marked this pull request as draft October 23, 2026 08:31
@trissim
trissim marked this pull request as ready for review October 23, 2026 08:46
trissim added a commit that referenced this pull request Oct 23, 2026
acp_extension.py keeps main's recipient_lookup/incarnation.lookup check over
#2646's claimed_identity field name. private_sidecar.py keeps only the
TYPE_CHECKING import; Annotated and Literal are unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trissim added a commit that referenced this pull request Oct 23, 2026
The batch dedupe and #2646 each deleted a different copy of Platform in
selected_write_plan.py, leaving none. selected_tool_broker.py imported
Platform twice; native_runtime_input.py kept DurableTables and
SharedFileTables after #2646 stopped using them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim trissim closed this pull request by merging all changes into main in 05fcdfe Oct 23, 2026
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.

2 participants