Skip to content

P244: derive the commander matrix and red cutover gate from declarations - #1992

Merged
trissim merged 9 commits into
mainfrom
feat/p244-parity-gate
Oct 20, 2026
Merged

trissim merged 9 commits into
mainfrom
feat/p244-parity-gate

Conversation

@trissim

@trissim trissim commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

P244 first working checkpoint — unfinished, do not merge

Stacked on feat/shared-plan-claims (#1928 / 1220a91), with current installed main 6a0f5e9 integrated normally. No push to #1928 in this turn.

ParityPhase is now declared in plan_phases.py. Cutover.after is exactly (RecordPlanePhase, ReviewQueuePhase, ControlPlanePhase, ParityPhase). ParityPhase.done derives from every registered ParityRow.compare result. All comparisons are explicitly unverified today, so the gate stays red. No completion boolean or parallel result store exists.

The row declarations are the only editable owner of number/capability/current/native/phase attribution. python -m agent_comms.commander_parity renders the matrix; --plan plans/commander-native-plan.md renders the full document without modifying the source. The Markdown is checked against that generated output. No ParityMatrix.read, environment/HOME rewrite, path-overridden config, patch file or evidence report was added.

Generated matrix diff

  • Removed the hand-maintained phase/status column, including its misleading done entry. Phases render from actual phase classes and are attribution, not completion prerequisites.
  • Preserved all 34 capabilities. Installed main had two row33 entries: order progress and the newer multi-commander capability. Existing progress keeps33; multi-commander now has unique34. No capability was silently dropped.
  • Native references reflect peer-owned load/growth/decision/momentum/time implementations. Their presence is not a behavioral pass. Momentum still requires prediction/outcome persistence; its current cadence candidate is partial. Timing classification remains unverified.
  • Matrix descriptors are summarized; full phase acceptance prose remains below the generated table.

Actual application and checks

Read-only Core opened the real commander history (262 retained orders): every row unverified; ParityPhase.done=False; Cutover.ready=False; Cutover.after includes parity. No original order, source session, uncertain input or runtime state was changed.

10 focused tests passed: exact generated-plan equality, all-row completion aggregation, Markdown not used as runtime input, phase/view behavior and the import-cycle regressions. Controlled matching comparisons in the aggregation test are not claimed as workflow parity. Initial test invocation lacked its scratch parent; after creating it, all10 passed. Existing pytest timeout-config warning remains.

Ruff/Black pass for the new package. Focused mypy reports only the inherited plan_phases.py ProblemOrder.serves finding (also on the base); no new type increase. Existing refactor-audit AST parser: before383 production/485 tests/37 tools; after386/486/37; zero parse omissions. ParityRow owns discovery, matrix output and row aggregation; ParityPhase delegates to it. No dynamic-reference behavioral proof is inferred from AST.

Both ratchets versus the stacked base1220a914f exit0, no positive keys. This range includes newly integrated main commits and their existing budgets; this is NOT permission to hide the main-relative result:

Own checkpoint diff:503 added /39 removed across seven files. This is a useful red-gate checkpoint, not finished parity.

Remaining work

Real per-row native/current comparisons are not implemented. The copied-root runner has NOT been recreated with environment tricks. Existing root defect is commander/order.py:51-54's import-time CONFIG/COMMANDER/ME/COMMS; the shared fix is the existing #1912 CommanderContext owner, not a second root-selection mechanism. No failing dependency branch has been merged here. No source budget was authorized or inserted. P244 is not delivered, merged or installed.

Assumed: this PR remains stacked until #1928 lands, then should retarget main. The canonical P244 checkout path does not exist because the existing P1 checkout was reused; Core's order body writer supplies the immutable identity from that retained P244 order for this draft, without creating another checkout or changing custody.

Agent-Comms-Order: b4c95cbf68d7

@trissim

trissim commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Resumed after installed-main restart

Pushed67bbee079. Merged installed mainb793c7325 normally; no history rewrite, merge to main or installation. Checkout is clean.

Concrete repair

PlanPhase.serving reads phase identity through every ProblemOrder, but serves was declared only on CheckedProblemOrder. Unordered/folded findings lacked the field, causing an AttributeError (and the inherited mypy error). Moved the existing default-omitting field to its actual base owner. Deleted the subclass declaration; no getattr fallback, alias, extra field store or discriminator. The existing ServeTodo operation now handles an unordered finding through the same typed field.

Existing refactor-audit AST inventory:386 production/488 test/38 tool modules, zero omissions. The stored phase declaration is now exactly one, ProblemOrder.serves at todos.py1115. All eight related order subclasses inherit it, including DroppedProblemOrder's multiple-inheritance path. Distinct command/input fields in ServeTodo/CommsOrderServeTool remain declarations of their own operation payloads, not extra order state. Judge.serves is an unrelated verdict quote. Before/after enumeration includes declarations, inheritance and all .serves consumers; arbitrary dynamic codec resolution is not claimed proved statically.

This batch adds no production lines (four added/four removed across the field move and later metadata corrections). Adds34 test lines. Existing FieldCodec still owns default omission and decoding. The new actual-store checks cover an unordered finding through PlanIdle, serving it via CommsOrderServeTool, and preserving the closed cutover gate. Unordered/folded/checked defaults remain omitted on wire and explicit phase choices round-trip through ProblemOrder.

Results

  • 12 focused tests passed (plan phases, parity declarations, dependency/import order); existing pytest timeout-configuration warning remains.
  • Actual retained read: 263 orders. Read the actual PlanIdle path without calling enforcement or starting providers: ready/unordered phase record_plane. Cutover.ready=false, ParityPhase.done=false, all34 rows unverified. Original records were read only.
  • Latest full checks were atbb06adcdb, before the final three native-owner description changes. Main-relative src1/tools0. Sole positive key SourceLines16→613 (+597). No introduced strict findings; phase/work-dispatch type-error counts0. This remains unfinished.
  • Stacked tools0; stacked src timed out at180s and has no completed result. Not reported as a pass. Initial src-only PYTHONPATH commands failed importing audit because this checkout's submodule is unpopulated. Measured checks borrowed main's existing exact pinned audit revision2b1015751e1d411cdefdab9aacebc92aa5e230fb read-only through PYTHONPATH; no scanner substitute, clone, install or submodule mutation.
  • pi-cn-load's P253 update is reflected in rows17/28 (reporting-only CommanderLoad, no ForkNow/fork policy) and18 (Repo.main_changes→MergeGrowth.read). Markdown exactly matches generation at final67bbee079. Their136-commit comparison is useful peer evidence, not independent full-row acceptance. Row32 remains unverified.

Remaining: real per-row comparisons/copy-root runner and source-growth replacement/deletion. Inspected the shared context owner's newer#1967; did not introduce another root selector or consume an incomplete dependency in this checkpoint. CheckRoot historical claim closure is still separate from cleanup-only#1995. Nothing here establishes that protocol repair, complete parity, a successful shadow session or installed acceptance.

Receipts: /home/ts/.cache/agent-scratch/pi-plan-claims/p244-resume/result.json. Generated test fixtures retired after checking for active borrowers. Total owned scratch352KiB. No provider input or UNKNOWN replay.

trissim added a commit that referenced this pull request Oct 19, 2026
…l plane

The story and the commander page follow the switch; they never gated it. Parity joins this list when #1992 lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim force-pushed the feat/shared-plan-claims branch 2 times, most recently from e3dc64f to ba9a323 Compare October 19, 2026 23:04
@trissim

trissim commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

First live row — pushed 4f12247 at 20:37:50

1/34 rows verified in the live run: row17, reporting-only load and live forks. The all-row command exits1 because the other33 comparisons remain unverified. This does not open Cutover or write a permanent passing status.

Actual installed CLI agent-comms-commander capacity ran through its real main, configured commander claude-code, and /home/ts/.agent-comms. Current and native output both:

load 222 (37 open orders, 8 overdue, 1692 unjudged edits), 1 live forks ['merger']

The installed CLI already delegates measurement to the native commander.capacity.Load.of. A Python return observer records that actual returned object during the CLI run; it does not replace the command, measurement, state or reply. Its typed fields decode once through FieldCodec, and the candidate compares every rendered field and fork against that real native measurement. This avoids pretending that new edits arriving between independent fleet reads are parity failures. The earlier independent-read experiment correctly failed on 1585 vs1589 unjudged edits and did not count as verified.

  • Actual native owner: /home/ts/code/projects/agent-comms/src/agent_comms/commander/capacity.py.
  • Entire old commander state directory unchanged across this run (FileRevision comparison).
  • No HOME/environment rewriting, copied-root override, provider input or original-session replay. -I ensures the installed half imports installed source rather than the candidate's PYTHONPATH.
  • Corrected stale row declarations naming the nonexistent CommanderLoad module. Existing Load owns the reporting work. Row28's additional self-report comparison remains explicitly unverified; it is not counted a second time.
  • Added python -m agent_comms.commander_parity --verify: row declarations choose their workflows, comparison types compute their result, JSON output is derived. No hand-maintained pass list or matrix status. Generated matrix still matches its declarations.
  • 14 focused tests passed. They include field/fork mismatch and old-state-write refusal, existing cutover fail-closed checks, matrix generation and task dependencies. One pre-existing pytest timeout-setting warning remains.
  • Before inventory used the existing canonical refactor-audit Package over production, tests and tools, no parse omissions. The profile callback resolves the installed Load.of code object at runtime; static inventory is not claimed to prove that dynamic binding. The actual installed command exercised it.

Assumed: this is one live reporting comparison, not all-row parity, full shadow-run acceptance, scheduler/fork policy delivery, or installed P244. Runtime cutover evidence still refuses until the full comparison work is accepted. P244 remains draft while33 rows are unfinished; SourceLines alone is not a blocker under ruling3617. No merge-main or format-only/budget-only commit.

Receipts: /home/ts/.cache/agent-scratch/pi-plan-claims/p244-live/ (comparison JSON, stderr, tests and AST inventory). Prior CheckRoot work is now reused and real-copy verified by P269 at55d08593b; it is not counted as another completed matrix row here.

@trissim
trissim force-pushed the feat/p244-parity-gate branch 2 times, most recently from d862882 to 30f2235 Compare October 20, 2026 01:15
@trissim
trissim force-pushed the feat/shared-plan-claims branch 3 times, most recently from 63ed6ca to 21f5780 Compare October 20, 2026 01:44
@trissim
trissim force-pushed the feat/p244-parity-gate branch from 30f2235 to a712e08 Compare October 20, 2026 02:03
@trissim
trissim marked this pull request as ready for review October 20, 2026 02:08
Copilot AI balanced review requested due to automatic review settings October 20, 2026 02:08

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.

@trissim

trissim commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review at a214932, rebased onto requested main15ba6edce. Final 23 tests passed under timeout300, launched in the background. Separate final ratchets: tools0; src1 solely permitted SourceLines+763, no introduced findings. Required snapshots now use existing FileRevision.from_stat; missing observations surface as errors rather than nullable copies or swallowed failures. IMPORTANT: this is a fail-closed gate checkpoint, NOT full parity acceptance. Only the previously demonstrated load-report comparison has live proof (1/34); 33 remain unfinished and cutover stays blocked. The latest combined validation call was interrupted: source receipt was retained, live.json was not; that uncertain live invocation was not retried. Merger owns rehearsal/install. Receipts: /home/ts/.cache/agent-scratch/pi-plan-claims/p244-ready/{final-tests.log,final-tests.exit,final-src.json,final-tools.json}. No installation or P244 completion claimed.

@trissim
trissim changed the base branch from feat/shared-plan-claims to main October 20, 2026 02:12
@trissim
trissim force-pushed the feat/p244-parity-gate branch from a214932 to 6ee1708 Compare October 20, 2026 02:12
@trissim

trissim commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

After #1928 landed: retargeted this PR to main and rebased onto installed16ecfb5c6, keeping main’s phase/merged-order implementations and dropping superseded intermediate changes. New pushed head6ee1708a57345642c7aabc018e5b64be1176f001 is ready and MERGEABLE. Exact-head background timeout300 check:22 tests passed. Separate src/tools ratchets both0 against16ecfb5c6, positive deltas{} and introduced findings{}. Scope remains the fail-closed gate checkpoint: only1/34 prior live comparisons proved,33 unfinished; no full parity or cutover authorization. Original ready event was before22:10. Receipts: /home/ts/.cache/agent-scratch/pi-plan-claims/p244-ready/post216-{src.json,tools.json,tests.log}.

@trissim
trissim merged commit 16ce54d into main Oct 20, 2026
0 of 3 checks passed
trissim added a commit that referenced this pull request Oct 20, 2026
@trissim
trissim deleted the feat/p244-parity-gate branch October 20, 2026 02:32
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