Repository navigation
Stop repeated goal/store work without stale goal publication - #3613
Merged
Merged
Conversation
trissim
force-pushed
the
work/slot-activity--P958
branch
from
October 29, 2026 19:46
55536ef to
47b6743
Compare
|
debt-src at 9f1fb15, every finding: |
trissim
marked this pull request as ready for review
October 29, 2026 20:02
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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
force-pushed
the
work/slot-activity--P958
branch
from
October 29, 2026 20:29
47b6743 to
be366d0
Compare
trissim
force-pushed
the
work/slot-activity--P958
branch
from
October 30, 2026 01:59
1c46410 to
f465403
Compare
trissim
force-pushed
the
work/slot-activity--P958
branch
from
October 30, 2026 03:11
f465403 to
f1de66e
Compare
trissim
force-pushed
the
work/slot-activity--P958
branch
from
October 30, 2026 04:10
f1de66e to
e8921ba
Compare
# Conflicts: # src/agent_comms/maintenance_barrier.py # src/agent_comms/owner_launch.py
# Conflicts: # src/agent_comms/child_process.py
# Conflicts: # src/agent_comms/store_files.py
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.
Summary — pushed source checkpoint, NOT complete or performance-qualified
Core source head c0ddfb5, pushed and matched by git ls-remote, includes fetched main d683810.
git diff --stat origin/main...HEAD: 109 files, +1738/-1034. Correction29: 11 files, +65/-65; main integration was clean and pushed separately at 45724f2. Historical correction28 001b608: 13 files, +186/-128. Prior StoreContention.reader conflict resolution still preserves main's LendingConnection retirement AND P958's check_same_thread parameter and per-acquisition timeout.Matched production companion: OpenHCSDev/toad#1363, head bcc8ce70b9cf78f64d0c9136e9ff0e4288d0caa8, remote readback matches; cumulative 3 files, +6/-21. The former fixture companion #1346 is merged. This pair remains subject to root review; no independently landable or installed claim.
Backend query and response ownership
Before: AgentBackend.inspect's NativeQuery/PiResponseData annotations hid imports under TYPE_CHECKING. The direct cycle went through input/inbox records declared inside AgentBackend. Compact then guessed compaction attributes on the response base; TurnRunner similarly assumed a context response.
After:
Bounded final import evidence parsed 638 Core modules. No cycle returns to AgentBackend, PiCommand, turn_inbox, native_turn_context or maintenance_barrier in the literal top-level graph. Existing pi_payloads/agent_events/acp_failure cycles remain visible: pi_payloads imports the events module after its payload declarations; this is not claimed to be an acyclic whole repository. Guarded/function-local imports, dynamic binding and external dependency graphs are explicitly outside that graph. No product import probe was run.
Physical maintenance witnesses
Before: MaintenanceBarrier._read returned None for an absent physical file, and _read_witness separately interpreted marker/state/target absence. The original incomplete-witness path ALREADY refused; no claim that this repairs an old permissive return.
After: MaintenanceWitness shares the same private-file/size/codec/error decoder on MaintenanceMarker and HoldTarget; MaintenanceState inherits it. NoMaintenanceWitness owns absent-file answers. Marker and state methods enforce pairing; missing either enabled witness still raises the same RelationViolationError. An absent target leaves the valid state unchanged; stale target generations/nonces retain their existing behavior. Both absent marker and state still mean never-enabled READY, without reading a leftover target. Malformed/inaccessible/private-file errors remain refusals, and physical revision consistency is still checked under the original lock. The observations dictionary remains unchanged, not turned into another style-only cleanup.
One SQLite reader lifetime
SQLiteStorage.opened_reader and its per-call lifecycle are deleted. Whole src/tests/tools name search is empty. ReadableStore inherits SQLiteReader; RegistryStore/InputDispositions retain their coordinator reader, and optional-awareness, CliBridge, working-memory and inherited carry consumers reuse that reader.
Outer acquisitions apply the requested StoreContention. An already-active same-PID transaction is borrowed BEFORE stat/absence/revision/retirement and does not begin or roll back another transaction. Forks cannot borrow a parent's handle. Replacement/unlink is observed by the next outer acquisition. Query-only, current journal mode, privacy/schema checks and permit attestation remain.
Main's newly merged LendingConnection owns cursors until connection retirement. This merge changes the actual reader connection class and therefore needs root's affected reader execution, not an assertion that earlier reader controls qualify the merged class.
RoomAllocation retains RoomLedger. RoomLedger._open_reader accepts/forwards keyword-only check_same_thread while retaining mode=rw, WriterOwnedFile schema carry, query-only, contention and close-on-error. DocumentBytes retains MissingFile plus empty bytes on genuine absence, without creating the path.
Goal projection and wake ownership
ToolEnd/StreamSettled rebuilding and source-revision/publication mirrors are deleted. A requested sync always reads fresh Goals.goal_changed; equality with the complete successfully delivered GoalSessionPublication snapshot is the sole suppression authority. ACP publishes that acquired snapshot.
The shared root watcher captures registry once and selects actual attached goal owners against their existing published snapshots. Goal wait/attempt commits request goal projection independently of inbox drains. Unrelated registry phase/row writes do not globally wake session inbox observers. Startup uses DrainedSession.wake_observer; original idle unobserved-input error handling remains. Goal publication failure is not a diagnostic for nonexistent input.
Coarse commit paths are NOT complete execution revisions. Requested projections still read selected activity/room claims, expiry and process liveness. Clock expiry or process death alone makes no filesystem commit; no spontaneous subscription or polling substitute is claimed.
Session identity and Toad consumers
AcpSessionId survives scheduler/callback/session-effects/runtime/fixture paths; foreign ACP/SDK strings decode at their actual ingress through FieldCodec. RuntimeConnection routes the retained ThreadIncarnation, not an invented ACP attachment. RuntimeProxy separately retains the actual AcpSessionId. Toad context inspection supplies the retained ReadableStore and owner incarnation; its request-only AgentController uses RuntimeConnection and deletes the unused 12-line OwnerRequestContext wrapper.
ConfigOptions authentication observation previously could run while bind_owner awaited redeal before PublishedSession existed. Redeal now precedes acquisition; acquisition and publication have no intervening await. Exact unknown-session refusal remains. This source race is NOT a proved explanation of both Toad settlement timeouts.
Correction28 — startup has no fabricated attachment
Before: StartOwnerRuntimeRequest.bind wrapped its thread name in AcpSessionId solely because the shared context required a session before startup had attached one.
After:
Correction29 — declaration owners replace five guarded dependencies
Before: pi_payloads imported Comms/Thread/NativeAttestation under TYPE_CHECKING only to forward Comms, extract owner.incarnation and ask conflicts. TurnInboxItem refused through InputForwarding with a wrong TurnSession annotation while its caller actually held NativeSession. Three measured-segment members repeated tokens/sha256/utf8_bytes, and recorded_public_text built a whole manifest for every digest lookup.
After:
conflicts(NativeSessionSnapshot) -> boolcontract at pi_payloads.py:1172. NativeAttestation inherits it at native_attestation.py:41; both payload conflict consumers take the contract. Existing pending/known/observed/lost meanings and refusal defaults remain distinct.Source evidence: before-map via NRA parses 1,868 modules across Core src/tests/tools and allocated Toad src/tests, no caught/skipped parse errors. After-map enumerates the changed owner declarations/fields/imports and syntax-compiles 11 Python files, exit 0. Whole-tree name search finds no item.refuse/inputs.refuse/old input refusal implementations. Reflection, dynamic imports, MRO and FieldCodec execution remain unproved. Initial scan launches failed before parsing (missing NRA .venv, then missing metaclass_registry in bare Python); the existing shared environment completed the source map. An earlier install-interrupted AST call returned UNKNOWN, produced no observed output file and was not replayed as an input.
Evidence and qualification
Root acceptance remains worker <15% CPU with at least two agents streaming and <50 registry-lock opens/10 seconds. Baseline: 84–95% CPU and 686 registry-lock opens/10 s. AFTER remains unmeasured. Neither source validity nor fewer event rebuilds completes that acceptance.
Assumed: syntax and static caller searches do not establish dynamic import/MRO execution, exception parity, SQLite contention behavior, installed two-agent performance or the cause of Toad settlement timeouts. Existing late module cycles remain disclosed; the five new guarded imports are removed structurally, not runtime-qualified. Untouched untracked src/agent_comms/skills/refactor-audit remains preserved. #3594 completion belongs to claude-code's existing fork and is not duplicated here.
Evidence: /home/ts/.cache/agent-scratch/slot-activity/p958-correction29-{source-map,after-syntax,main-sync,publish,hosted-debt}.log; historical p958-correction28-{ast-syntax,commit-merge,merged-syntax,publish}.log. Prior p958-contract-* and p958-toad-contract-* source evidence retained.