Skip to content

Reply only to DMs that opened the Claude answer, not mid-turn arrivals - #3594

Closed
trissim wants to merge 19 commits into
mainfrom
work/slot-activity--dm-final
Closed

trissim wants to merge 19 commits into
mainfrom
work/slot-activity--dm-final

Conversation

@trissim

@trissim trissim commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Status — source checkpoint, NOT accepted

19 commits on current main; 36 files, +1,075/-288 at ad6a75278efa444d08a6e96a1a96d39711415d95. Rebased onto 208275fba57c7b38be566546eb9347aa21759db2; exact remote head verified. No behavioral, installed, or twelve-directive acceptance is claimed.

Still open: Claude promptId reuse requires occurrence identity and a one-shot retained-row carry/rekey. The crash-asserting reused-prompt control is still wrong and must be replaced with the real retirement/wake case. B's twelve-directive result remains unproved.

Claude answers-linking: open dependency on the tools/call _meta capture at connector.py:802 (claude-code). The free model-supplied source_turn was deleted. Explicit received-original answers remain available; no newest-turn inference substitutes for missing provenance.

P958's urgent installed-worker repair now takes priority under codex-greentext. Slot-activity retains this unfinished source and its clean checkout; this is not a delivery or abandonment of the remaining A2 repair.

What changed

Delivery and answer ownership

Before: process-local reply sender sets, newest-row inference, cursor reconstruction, a TurnDelivery forwarding wrapper, and model-supplied external turn identity.

After: existing ExternalTurn/ExternalTurnInput retain exact opening references; DeliveredInput carries its source directly; Messaging remains the ordinary Message.answers writer. Destination types exclude automatic channel sends. All active reply windows retire through their declared family and index rather than limit=1 or full-history decoding.

Deleted: Bus.delivered_unanswered, ReadCursor.read_sql, TurnDelivery, RuntimeUpdate.in_turn, newest-row answering, newest-only retirement, and every branch-added TYPE_CHECKING import.

Reader and dependency repairs

BusReader.answering owns its observing connection; Messaging no longer passes a BusSnapshot to a sqlite3.Connection API. Capture/read ownership is outside the source-turn loop.

HistoricalNativeAnswers joins retained coordination proof to bounded NativeTranscript reading, above both low-level readers. It no longer inherits the whole TranscriptSource traversal family; that family's dead answered_inputs default is gone. InputAnswerRead owns the one empty-request guard. The native join rejects a mismatched source message ID.

NoNativeInput represents a parent chain with no input. The complete-entry requirement remains on NativeRecord; tracked-user behavior moved to the existing RecordedEntry ancestor. Native projection asks the record whether an input identity was reported instead of asking a generic RecordedEntry for a nonexistent message attribute.

ExternalTurn.store avoids an UPDATE when reply-window state is unchanged.

External wire boundaries

PromptRecord unifies supported Claude prompt shapes, but promptId-only identity is still incomplete on legal reuse after turn_duration. This is explicitly not marked fixed.

Codex ClientId has missing, foreign and bus members decoded at ingress. Bus prefix formatting and completion behavior belong to BusClientId, not consumer string surgery. Historical PublishedPage remains non-confirming.

Narration and one-record publication

NarrationTranscript is visible assistant progress, but inherits non-answering and non-DM-final behavior. ModelOutput still closes admission. AgentTextTranscript owns shared category/import behavior; NoticeTranscript retains its non-conversation import behavior and own category declaration.

AssistantBlock contributes typed events separately from activity/tool updates. AssistantRecord finishes their tuple once: narration plus a real answer no longer compete for the same record UUID. Redacted thinking contributes an empty existing ThinkingTranscript marker so it closes opening admission without exposing hidden content.

The existing twelve-directive thinking case already uses the real Claude decoder. Added unrun variants cover narration+final in one record and hidden thinking before incoming directives. No duplicate direct-ThinkingTranscript control was added.

Review findings at the current checkpoint

Latest b42 review State
1: BusSnapshot passed to Connection API Source repaired through BusReader.answering; actual send control unrun.
2: reusable promptId / stopped-window crash / later text credited backward OPEN: occurrence key, retained-row carry and replacement control remain.
3: free SendTool.source_turn Removed. Trusted external MCP call identity is the explicit integration-owned dependency above.
4: dead TranscriptSource answer inheritance/default Removed.
5: unchanged reply-window writes Store owner writes only on state change.
6: duplicated empty-reference guards One guard on InputAnswerRead.read.
Native NoneAbsence and missing message member NoNativeInput plus record-owned input reporting; latest checker run still owed by integration.
Native schema/pin Rebuilt generated schema and pin; one actual copied journal carried with unchanged row data.

Earlier A/B review artifacts remain under /home/ts/.cache/agent-scratch/claude-code/reviews/3594-{8fe4807a0,897f0efcd,b42c8ab30}.md. Older source acceptances do not approve this head.

Actual evidence and limits

  • Cold processes import shared/turn_lease in both orders and print ok, including after rebase. dm-review-narration-rebase-push.log contains the verified push and full diff stat.
  • Full retained Python map: 588 Core, 11 hooks, 539 tests, 30 tools; zero parse omissions at 1128230. Narration extension: 588 Core and 283 Toad modules, zero omissions, with the existing AgentTextTranscript renderer. Dynamic bindings and external harness behavior are not proved by that map.
  • Native preparation: ./stack/native/prepare-pi-native --update-pins --python <existing runtime python> exited 0; Node syntax and generated package checks ran. NativeBuildInputs.require_pinned printed pin ok before the rebase. Final-head archive pin acceptance remains the merger's obligation.
  • One real native proof journal copied by SQLite backup. The first carry attempt correctly refused without maintenance. Through the existing maintenance holder on the COPY, NativeInputProof.reconcile_at changed the schema, preserved 1/1 rows byte-for-value, and NativeContextJournal.schema_differs returned False. No original journal was changed. Receipts: dm-review-native-proof-carry.log and dm-review-native-proof-held-carry.log; unchanged-row digest f5ced3a534d8b32b4d52f609ce14132196dba5d085e900e2e3cdb811e2843ae0.
  • Compiled affected fixture files and ran git diff --check. No author pytest, ratchet, provider input, merge or auto-merge change. Integration owns combined controls, source typing/debt, the private MCP capture, real carry chain and installed qualification.
  • Native-preparation scratch was /home/ts/.cache/agent-scratch/slot-activity/native-prep-39470; the preparation cleaned its intermediate packages. The 40 KiB journal-copy evidence remains at native-proof-carry-39470 pending acceptance. The prepared native artifact is linked only from this development checkout, not installed as the live runtime.

Assumed

  • No assumption that Claude supplies an actual call ID in _meta; the raw integration-owned capture decides that.
  • Cold imports and one journal carry do not prove automatic sends, all stored schemas, native startup or installed UI behavior.
  • Existing external positions and Toad's retained page cursors must survive the occurrence-key repair. No store reset or runtime legacy lookup is authorized as a shortcut.

A reusable promptId is not a turn identity; the wire's number plate is still awaiting its proper chassis.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 06:50

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 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
trissim enabled auto-merge October 29, 2026 06:50
@trissim
trissim force-pushed the work/slot-activity--dm-final branch from d3d52dc to f58fd02 Compare October 29, 2026 06:51
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

debt-src at f9ada9a, every finding:

grew BannedVocabulary:src/agent_comms/external_transcript.py +1
grew BannedVocabulary:src/agent_comms/transcript_events.py +1
::warning file=src/agent_comms/cli_bridges/claude_protocol.py::LintFindings +4 (warns, never blocks)
::warning file=src/agent_comms/cli_bridges/codex_protocol.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/cli_bridges/shared.py::LintFindings +5 (warns, never blocks)
::warning file=src/agent_comms/external_transcript.py::LintFindings +5 (warns, never blocks)
::warning file=src/agent_comms/harness_delivery_states.py::LintFindings +2 (warns, never blocks)
::warning file=src/agent_comms/historical_native_inputs.py::LintFindings +5 (warns, never blocks)
::warning file=src/agent_comms/messaging.py::LintFindings +2 (warns, never blocks)
::warning file=src/agent_comms/native_input_record.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/native_runtime_input.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/native_transcript.py::LintFindings +3 (warns, never blocks)
::warning file=src/agent_comms/private_send_rules.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/runtime_updates.py::LintFindings +2 (warns, never blocks)
::warning file=src/agent_comms/tools.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/turn_digests.py::LintFindings +3 (warns, never blocks)
::warning file=src/agent_comms/turn_item.py::LintFindings +2 (warns, never blocks)
::warning file=src/agent_comms/turn_lease.py::LintFindings +1 (warns, never blocks)
::warning file=src/agent_comms/turn_item.py::Unformatted +1 (warns, never blocks)
found BannedVocabulary:src/agent_comms/external_transcript.py at src/agent_comms/external_transcript.py:94
found BannedVocabulary:src/agent_comms/transcript_events.py at src/agent_comms/transcript_events.py:376
introduced BannedVocabulary:src/agent_comms/external_transcript.py at lines [94]
introduced BannedVocabulary:src/agent_comms/transcript_events.py at lines [376]
introduced NoneAbsence:src/agent_comms/cli_bridges/codex_protocol.py at lines [206]
introduced NoneAbsence:src/agent_comms/native_entries.py at lines [111, 116]
introduced NoneAbsence:src/agent_comms/native_transcript.py at lines [205]

@trissim
trissim force-pushed the work/slot-activity--dm-final branch from ad0610c to 68838ad Compare October 29, 2026 07:26
@trissim
trissim added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 29, 2026
@trissim

trissim commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Closed: 17 of its 19 commits landed patch-equivalent through #3581 (799855d; git cherry origin/main shows them as '-'). The one live change left is ad6a752 (thinking text goes out as AssistantTranscript and finishes the record once per block, claude_protocol.py:480-485 on main). slot-activity is told to carry it alone as a fresh 3-file PR off main. The native pin commit e924f2c is stale.

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