Skip to content

P904: share source-owned queue UI across native, channel and mailbox - #1317

Closed
trissim wants to merge 9 commits into
mainfrom
work/message-state--P904--toad
Closed

trissim wants to merge 9 commits into
mainfrom
work/message-state--P904--toad

Conversation

@trissim

@trissim trissim commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

9 commits; 28 files, +774/-115 against current fetched main. Current ToAD head: d92ac585eb8a27fd3772de2a9606a12b3344c683. P904 paired Core overhaul: OpenHCSDev/agent-comms#3572 at 0dd3db428d1b9a2d257a1152edcdf96109aee9f3 (19 commits, 88 files, +2461/-935). Root37432 explicitly resumed source work; both existing branches include fresh main by ordinary merges. Locks unchanged. Neither PR is armed.

One existing ConversationSubmissions consumer and Prompt.QueueSummary row now serve native input, channel/DM and CLI mailbox composers. One shared inspection screen exposes their different real authorities. Source checkpoint only: no installed/UI success is claimed. Keep unarmed for root's matched qualification.

Current send-back — root37634, still open

The previous exception/source correction did not delete duplicate queue scope/availability/action decisions in AgentPresentation and QueueSource. That is my incomplete repair, not a delivery. Items1–5 remain: one QueueSource hierarchy; declared confirmed/unconfirmed/refused action outcomes instead of QueueActionRefused and catch arms; one shared stale-binding check; no PreparedPageSource queue identity; empty details owned by EmptyCheckedNotifications; and a control pressing the actual Clear action. None is claimed fixed by this head.

d92ac58 only migrates the existing common-queue control's DisplayOutcomes import to Core's shared read_basis owner. Both sources are pushed and clean; Core's debt-src is running, native-scripts skipped while its PR remains draft/unarmed. No author tests/app/provider run. The earlier sections below describe source checkpoints, not approval of this send-back.

Queue action/source correction — root37432

Latest correction:27999b1ba plus55b055b93;10 files,+190/-33, followed by two corrected uncertainty messages on the same PR. These are source checkpoints, not whole P904 delivery.

  • Error boundary: QueueInspection.apply_action and ConversationSubmissions._send_now report stale source/agent identity and return before the action, outside the try. They catch only ACP RequestError and the dedicated QueueActionRefused. AgentPresentation, NativeQueueSource, ReadOnlyQueueSource and the controller's delayed scope check use that deliberate refusal type. Unrelated ValueError escapes instead of being dressed up as a normal queue failure.
  • Backend result: AgentController.clear_queue preserves whether the actual request produced a result; NativeQueueSource refuses to dismiss inspection when it did not. Send-now and clear report missing confirmation rather than assuming a refused request had no side effect. No uncertain action is replayed.
  • Source lifetime: PreparedPageSource(ReadOnlyQueueSource) supplies the capability itself, replacing a fresh ReadOnlyQueueSource allocation on every property read. Its docstring is restored as the first statement. WirePageBuffer still returns its real retained WireSource; native/mailbox source and subscription lifetimes are unchanged.
  • Empty feedback: CheckedNotifications.from_notifications selects the explicit EmptyCheckedNotifications case for a matched empty result. That case says no recipient feedback; an observed title takes its actual first recipient directly. A missing original still yields no matched result. The one-item join and falsey text fallback are deleted.

Authored four UNRUN controls in tests/textual/test_queue_action_boundary.py: real source retirement/stable replacement identity; real agent replacement and stale send-now; unsupported refusal with draft retained and unexpected ValueError escaping; actual child/official-ACP RequestError returning through the inspection boundary with exactly one request and no retry. tests/support/peers/refuses_queue.py is an external protocol peer, not a mocked product owner or provider. Existing common-queue controls use QueueActionRefused. A wire-message control now goes through the same typed empty projection.

Source evidence:10 changed Python files compiled in memory; both diff checks pass. NRA before/after maps cover3,652/3,654 modules and16,783/16,786 classes, zero parse omissions, with committed integration snapshots and owned-file hashes. Final two message literals have targeted source reproof. No product import, pytest, environment build, native/provider run or application verification by the author. Root owns the combined controls and actual saved-view/native-action acceptance, including stale revision, UNKNOWN, drafts, active updates and tab return.

Captured page/viewer integration

The actual prepared BUS page supplies its captured DisplayIdentity to ReadNotifications; native transcript pages remain NoDisplaySelection. SourceNotifications reads retained prepared pages, not the agent tab name or cleared pending paint evidence. CheckedNotifications consumes Core's one filtered projection and distinguishes matched empty feedback from an absent original. WirePage.source is nonnullable; existing NothingRead owns the unread placeholder and empty-read transition without inventing a source.

Core's root-owned P883 boundary is required: root applied the explicit OperatorReader/ReadNotifications patch at272e90641687b1bc3057e9fd03b393e2cf689e2b. This branch must be qualified against that actual combination, not the older standalone Core member API. Root source-approved87d's viewer checkpoint. Its run10 was12/14; the two foreign-source fixture failures were corrected using the real live-only page owner. This is not an installed/UI pass. tests/textual/test_common_queue.py, test_message_notifications.py and test_wire_source.py retain the real private-wire/page/viewer/raw-read controls, still unrun on this final pair.

Before / after

Before: native supplied its submission owner; mailbox/channel/DM factories omitted it and MessagePrompt suppressed the entire queue renderer. Removing suppression alone would read an unrelated pending ACP projection or fail on the missing owner. Send-now on an unbound connection silently did nothing.

After:

  • OperationalSessionSources(NativeQueueSource) borrows the actual ACP queue attachment. MailboxSessionSources(BusQueueSource, OperationalSessionSources) composes the read-only BUS capability ahead of native operations. WireSource(BusQueueSource) supplies channel/DM authority through its actual page source.
  • ConversationSubmissions remains the sole consumer. It derives BUS entries from the already visible fragments and their existing checked notification projections; entries retain the original ReadNotifications / ReadRecordedNotifications source request and original message reference. No ACP ID conversion, membership store, queue ledger or direct SQL.
  • All operational factories supply that owner. Prompt renders its source's summary through the existing QueueSummary. The previous native-only formatting and blanket mailbox/channel suppression are deleted.
  • QueueInspection is shared. Native clear/send-now delegates to the existing controller, checking the captured source, binding and queue scope. BUS controls are visibly unavailable and invocation refuses explicitly. The old Agent.send_now -> owner.send_bound_now forwarding and unbound no-op are deleted.
  • Queue updates follow existing attachment publications, notification/viewport subscriptions and transport-state transitions. No timer, journal polling, acknowledgement or read-marker write.
  • GoalEdit was the one non-conversation caller of ChannelPrompt. It now uses DraftPrompt, which owns the legitimate no-queue editing behavior; mention completion and save handling are unchanged. This is not the goal pause/retry latency repair.

What the row means

Native: Submitting is outstanding local intent, Queued is actual producer acceptance, Restored remains read-only. Inspection retains original input IDs and actual scope/revision.

BUS: visible-message delivery evidence, not an ACP queue or a complete inbox count. Summaries show up to three visible messages and their leading actual recipient label. Inspection explicitly discloses partial coverage, original root/sequence/message ID, leading recipient identity, existing proof/details and independent answer reference. Existing transport pending/blocked state is shown; no retry permission is invented.

Slicing this presentation alone does not bound assignment acquisition. Paired Core now implements the separate recipient cut before expensive claim/proof/harness/reply/activity acquisition, capped at100 recipients per original, with exact frozen cursor/viewer scope and retained independent replies. Frozen audiences remain untouched. No measured improvement or combined acceptance is claimed. Captured source/incarnation self-read subtraction is implemented; complete arrival/disposition presentation and the ordinary/following proof notification consumer remain unfinished P904 work.

Capability contract and related controls

QueueSource now declares its existing scope/action methods; concrete native/read-only capabilities implement them and mailbox MRO still resolves read-only operations first. Scope/agent returns, source/submission access and shared inspection action callbacks are typed. A source lacking an action can no longer masquerade as the base and fail on the first menu click; unsupported BUS actions still refuse explicitly.

Five existing UI journey waits now derive their expected title from CheckedNotifications rather than copying old full-audience Delivered45/45/zero-read prose. Two redundant hard-coded title assertions are removed; the same tests retain equality against the actual Core summary owner, working/error state and the real title layout-update counter. These are unrun controls, not a UI result.

P872/P883 actual operation contract — checkpoint 3

Root's actual1302+1317 combination caught MessageQueueEntry.reference still asking the UI transport envelope for its payload's references. It now derives request.operation.references[0]; notification controls likewise use the actual operation, and the historical control checks RecordedNotificationRead directly. Zero .request.references uses remain across owned source/tests/tools. No isinstance chain, fallback, mirrored references or cached second source identity.

Checkout-caller owns the shared Core declaration: #3566 at04dce31fca2f7be33b15b42abbb8f7eb860677d4 moves the references tuple onto existing frozen NotificationRead and deletes the Live copy; Recorded inherits it. That field belongs there, not on the transport envelope. I did not copy that absent unlanded Core module into my older branch or edit the owner's worktree. The actual1302 integration already rewrites observation_shutdown's old constructor; it stays with that owner. Qualification requires root's actual combined pair, not imports against the old standalone3572 API.

All3 changed consumer/control files compile in memory and diff checks pass. The extended NRA map includes actual root integration source/tests/tools as well as both owned trees (3,641 modules, zero parse omissions, per-file hashes/revisions; not an atomic snapshot of concurrent root edits). No author test, product import, codec, UI or provider run.

Controls and evidence

Authored UNRUN real-private-wire/observer/UI controls in tests/textual/test_common_queue.py: channel/DM factory wiring, exact original-reference/root preservation, common visible row, explicit read-only actions, shared inspection, draft preservation, source-subscription refresh, and mailbox MRO/owner injection. Existing native queue/request/start controls remain relevant; no product monkeypatch or provider input was added.

Source-only checks: the first19 changed Python files and the subsequent7 contract/control files compiled in memory, git diff --check passed. Existing NRA ModuleSyntaxIndex corpus extended across changed producer/consumer contracts and DeliveredOutcome/MonitorEvidence producers; paired source/tests/tools inventory retained with per-file hashes and zero parse omissions. Rebased onto fetched ToAD main and pushed; git ls-remote matched head. No product imports, codecs, pytest, provider, native/UI run, environment build or installation was executed by this unit.

Root owes the combined focused selection and real saved DM/channel/CLI/native journey, including open/hidden/reopened/tab return, actual clear/send-now, changing proof before final answer, stale scopes, drafts/mentions, UNKNOWN exclusion and human read marks. No delivery acceptance requested at this checkpoint.

one queue row
three sources
none of them gets a counterfeit ACP passport

Assumed: Core's existing notification source/subscription/proof owners, extended by the paired recipient-window checkpoint, remain authoritative. This PR does not independently qualify their timing or performance. Root owns the single combined qualification; neither PR is armed and whole P904 is not delivered.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 02:52

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 added a commit that referenced this pull request Oct 29, 2026
historical_sessions keeps #1302's TranscriptPageRead import beside the
shared notification reads; message_notifications takes #1317's read, which
passes the captured display to ReadNotifications(display=...), the field
the Core carrier (agent-comms #3566) now declares. Loads and imports
against the carrier's Core source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK
@trissim

trissim commented Oct 29, 2026

Copy link
Copy Markdown
Author

Batched into #1319 (batch/integ-20261029-toad), paired with agent-comms #3566. It lands with the batch; no separate runs.

@trissim

trissim commented Oct 30, 2026

Copy link
Copy Markdown
Author

Superseded: all 8 unmerged patches are carried in #1319 (integration of #1302 and #1317, paired with agent-comms#3566). Nothing lost.

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