Skip to content

Let existing owners dispatch inbox inputs and encode compact JSON - #2692

Merged
3 commits merged into
mainfrom
next/owned-dispatch
Oct 23, 2026
Merged

3 commits merged into
mainfrom
next/owned-dispatch

Conversation

@trissim

@trissim trissim commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Inbox records previously called forwarding methods that called back into InputForwarding. TurnInboxReceiver and all six inbox/prompt deliver_to implementations are deleted. InputForwarding now declares the operations through existing MroDispatch; it consumes the most-specific handler because PreparedSession inherits UnwrittenPrompt and must prepare an idle session without sending a prompt. PreparedSession now lives with the prompt states rather than the native preparation launcher. TurnInbox declares its admitted item type.

FieldCodec.compact owns compact JSON layout. All 34 existing compact dumps/dump calls across 26 files use it, preserving each caller's encoded value, Unicode, key-order and NaN settings. It serializes the already encoded value; it does not walk the value through declaration encoding again. The one stdout dump becomes stdout.write(compact(...)), retaining its newline and flush. No store schema changes.

Removed forwarding sites at base f966a53: agent_backend.py:139 (receiver protocol), :189 (abstract delivery), :207 (InputRequest), :221 (SendNow), :236 (UseSettings), :246 (ClearQueue); prompt_state.py:67 (UnwrittenPrompt); native_session_prepare.py:35 (PreparedSession). The send/preparation algorithms now belong to InputForwarding.original_prompt and prepare_session. Single-operation selection at turn_inputs.py:95 uses the existing MroDispatch.handlers_for lookup directly; no narrowed consume_handlers override or second dispatch registry remains.

Removed compact-layout copies at base f966a53: working_memory_labels.py:47; selected_write_plan.py:223,:273; context_store.py:189; typed_table.py:275; acp_extension.py:402,:574; response_acknowledgement.py:20; cli_bridges/shared.py:802; connector_store.py:69; fresh_private_session.py:36; retained_task_facts.py:249; goal_attempts.py:601; selected_source_batch.py:88; assignment_states.py:366; context_segments/optional_awareness.py:182; audience_manifest.py:46; context_segments/wake.py:97,:102,:120,:151; turn_context.py:821,:1009,:1120; context_segments/awareness.py:23; context_segments/partner_activity.py:60; context_segments/relationships.py:26; pi_helper.py:98; threads.py:336; exporting.py:45; nk_foreground.py:119; private_sidecar.py:221,:370; goals.py:474. The single implementation is field_codec.py:1356. OwnedDispatchPhase now allows that canonical implementation and rejects compact-layout copies elsewhere, including single-quoted spellings missed by the old pattern.

Source ownership was traced with the existing NRA original class/consumer inventory (762 Core/paired-Toad/dependency modules; 6410 original classes; 8 local/conditional classes unprojected). The compact edits used NRA's original module syntax index on the selected files. The fleet integrator owns the combined touched-test run.

Shared hunks with #2667: agent_backend.py removes only inbox delivery and types its queue; turn_inputs.py changes dispatch and moves the send/preparation algorithms; private_sidecar.py changes only compact layout. Keep #2667's BusyInputPolicy and typed Pi streaming behavior when combining. plan_phases.py changes only OwnedDispatch evidence. The commander owns the separate WireOrigin.matches_sql fix in the merge batch.

Assumed: inbox inputs satisfy TurnInboxItem; the pinned native request contract stays unchanged; the integrator combines the shared hunks with #2667.

Latest source fixes: TurnInboxItem is declared before TurnInbox, so the queue names its actual type rather than a quoted spelling. Forwarding directly selects its most-specific declared handler, deleting the incompatible consume_handlers override. Compact JSON calls and imports in audience_manifest.py/response_acknowledgement.py are wrapped. The saved hosted findings at 9c517cf included tools/cutover/carry_dead_turns.py from the combined base; this branch does not edit that owner. The integrator runs the batch checks.

@trissim
trissim marked this pull request as ready for review October 23, 2026 08:41
Copilot AI balanced review requested due to automatic review settings October 23, 2026 08:41

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

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

debt-tools at 1696857, every finding:

grew LintFindings:tools/cutover/thread_name_owners.py +11
grew NoneAbsence:tools/cutover/thread_name_owners.py +1
grew Unformatted:tools/cutover/carry_dead_turns.py +1
grew Unformatted:tools/cutover/thread_name_owners.py +1
introduced NoneAbsence:tools/cutover/thread_name_owners.py at lines [51]

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

debt-src at 1696857, every finding:

grew FamilyFlattened:src/agent_comms/publisher.py +1
grew FamilyFlattened:src/agent_comms/response_conversation.py +1
grew FunctionLocalImport:src/agent_comms/coordination_tables/executions.py +1
grew FunctionLocalImport:src/agent_comms/phase_evidence.py +1
grew LintFindings:src/agent_comms/agent_backend.py +1
grew LintFindings:src/agent_comms/coordination_snapshot.py +1
grew LintFindings:src/agent_comms/coordination_tables/executions.py +3
grew LintFindings:src/agent_comms/coordination_tables/responses.py +2
grew LintFindings:src/agent_comms/external_transcript.py +1
grew LintFindings:src/agent_comms/messages.py +1
grew LintFindings:src/agent_comms/phase_evidence.py +1
grew LintFindings:src/agent_comms/pi_commands.py +1
grew LintFindings:src/agent_comms/private_sidecar.py +3
grew LintFindings:src/agent_comms/publisher.py +1
grew LintFindings:src/agent_comms/response_conversation.py +3
grew LintFindings:src/agent_comms/selected_claim.py +1
grew LintFindings:src/agent_comms/turn_context.py +1
grew LintFindings:src/agent_comms/working_memory_worker.py +1
grew NoneAbsence:src/agent_comms/pi_commands.py +1
grew NoneAbsence:src/agent_comms/pi_events.py +2
grew TypeErrors:src/agent_comms/coordination_response.py +1
grew TypeErrors:src/agent_comms/coordination_snapshot.py +1
grew TypeErrors:src/agent_comms/wake.py +2
grew Unformatted:src/agent_comms/annotation_disclosure.py +1
grew Unformatted:src/agent_comms/audience_manifest.py +1
grew Unformatted:src/agent_comms/phase_evidence.py +1
introduced NoneAbsence:src/agent_comms/pi_commands.py at lines [188]
introduced NoneAbsence:src/agent_comms/pi_events.py at lines [62, 66]
introduced NoneAbsence:src/agent_comms/private_sidecar.py at lines [373, 387]

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