Repository navigation
feat(audit): explain outbound message delivery - #123709
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 11:42 PM ET / August 17, 2026, 03:42 UTC. ClawSweeper reviewWhat this changesAdds opt-in, execution-scoped receipts that explain queued, platform-started, terminal, and suppressed outbound-message outcomes through audit run inspection. Merge readinessKeep open: current main does not contain the delivery-receipt implementation, but merge requires an explicit maintainer decision on its new retention and operator-read visibility boundary. Priority: P2 Review scores
Verification
How this fits togetherOutbound messages move from agent or channel requests through durable delivery and a channel transport. The audit subsystem records redacted lifecycle receipts and presents them through run inspection. flowchart LR
A[Agent or channel request] --> B[Durable outbound queue]
B --> C[Channel platform send]
C --> D[Terminal delivery settlement]
B --> E[Progress receipt store]
D --> F[Audit event ledger]
E --> G[Run inspection]
F --> G
Decision needed
Why: This is an intentional privacy, retention, and authorization-scope choice that source review cannot make on behalf of product owners. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch deliberately expands retained diagnostic provenance visible to operator-read callers, so its privacy and authorization boundary needs owner acceptance. PR surfaceSource +2076, Tests +1524, Docs +80, Generated +32, Other +281. Total +3993 across 80 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the default-off, redacted owner-native design only after the audit/privacy owner explicitly accepts the 30-day and 200,000-row retention plus existing operator-read visibility; otherwise narrow that boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a new opt-in diagnostic capability; the supplied deterministic QA scenario is a validation path rather than a bug reproduction. Is this the best way to solve the issue? Unclear: the owner-native, exact-binding design and focused QA coverage are plausible, but the retention and access contract remains a maintainer decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 992a88b7281b. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (27 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
C04 terminal disposition: The exact-head hosted review identified a valid released-reader compatibility issue: The immutable C04 packet explicitly forbids adding a table or schema change and requires returning to COORD for a storage/schema or public-compatibility decision. I am therefore not bypassing the packet by implementing that table. Maintainer/COORD direction is needed to choose between (1) authorizing a companion table and downgrade proof, (2) accepting the rollback incompatibility explicitly, or (3) revising the lifecycle persistence contract. The PR remains draft, open, unmerged, and without automerge. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What problem this solves
Operators need a redacted, exact-execution explanation for outbound message custody, platform-send progress, terminal delivery, policy denial, and intentional suppression. This PR records those facts at their owning boundaries without changing delivery authorization or exposing message content, platform identifiers, targets, URLs, callbacks, credentials, or external identities.
R5 frozen-main integration
Revision 5 performs the packet's single linear refresh onto frozen target
5dc4cf602bc5e263e83cd16a12bb1e100544f4c3(tree236e2a7994cd5829c4e9f6f68799b2e4bb87222f). It does not substitute a newer main, create a merge commit, replacement branch, or replacement PR.Current main moved outbound terminal completion into centralized settlement and recovery ownership. The composed result preserves that owner while keeping C04's audit contract:
sentreceipt;unknown_after_sendin durable queue custody and emits no premature terminal receipt;The R5 conflict-delta regression first failed on the rebased pre-fix tree: live identityless delivery emitted
queued,platform_started, and prematureunknown; recovery emitted another terminal for the same durable identity. The owner fix removes those premature terminal writes and proves recovery emits at most one terminal receipt.Hosted review then exposed a second owner violation:
runIdis non-unique, but run-only terminal rows were projected as exact execution receipts. The failing-before regression uses two contexts with the same run ID. The fix carries the immutable admission token through channel, durable delivery, queue/recovery, and message-tool owners, revalidates its exact context/execution/run tuple against the authoritative admission row inside the synchronous write transaction, and stores only the exact binding. Unbound run-only activity appears in neither exact execution.Storage and privacy contract
outbound_message_progressremains a same-version additive companion, lazily ensured only by an opted-in progress write. Its nullable exact-binding columns are lazily added for predecessor databases.audit_events; exact terminal binding lives in the lazy companionoutbound_message_execution_bindings. Queued and platform-started facts live only inoutbound_message_progress; there is no semantic dual write.5dc4cf602bc5e263e83cd16a12bb1e100544f4c3opens and uses the candidate schema-v9 database, sees only its compatible terminal fact, and the candidate subsequently reopens with integrity and all expected stages.Exact-head proof
Exact pushed head:
cd8476583acc62a1b3d960b684dc5d4d47728ddd(treecfe10749010ef97b98642690ff5a78858f7d5a30).5473719e573…found no P0/P1 issue and TruffleHog was clean. Exact-tip autoreview after the mechanical cleanup is also clean: no P0/P1, TruffleHog clean, correctness confidence 0.99.tbx_01m06tndwpt58nm4mckfvkv3ed/coral-krill-8546, run 31989799157: wrapper exit 0 after 1,197,316 ms command / 1,199,008 ms total; lease stopped.cef77d1a…that latest main restored, and an untouched Codex side-question mock that received no call. The directly attributable follow-up callback assertion found on predecessor headd599f8f…was fixed, focused-tested, pushed, and passed on this head.Deterministic QA Channel proof
Fresh exact-head
message-delivery-decision-inspectionrun with mock OpenAI andqa-channel: 1 passed, 0 failed, 0 skipped.1, platform-started1, delivered1;Artifacts:
.artifacts/qa-e2e/suite-mswn5j1c-a35a8108/qa-suite-summary.json, SHA-256d434ce05a565da734e5ce3772ab8a71631269e5de27cb662c0ae2fd227432e6f;00cd639a27dcf079346b94bb33b7aa1f456ea243bbabc2c842d2c9c1ef8062a5;398a7a333431d2f58d7cdc5512fd8d7f84181380e31603168b51c0d01c838c24.No live Telegram credential was used.
QA restart convergence repair
The deterministic proof exposed a current-main registry issue unrelated to receipt semantics: persisted plugin records intentionally omit build-only package versions and are rehydrated in a different property insertion order, while the control-plane fingerprint used raw
JSON.stringify. Every restart therefore looked like plugin inventory drift and failed closed.The canonical inventory fingerprint uses shared stable recursive serialization and ignores only package-build metadata that the durable registry intentionally drops. Tests prove doctor-contract content and
bundledDiststill change the fingerprint. This is the owner fix; no retry or fallback masks the drift.Evidence map and best-fix judgment
This remains the best fix: authoritative facts are recorded once at their lifecycle owners and exact attribution requires a host-validated admission binding. Consumer inference from non-unique run correlation, dual writes, a schema bump, runtime fallback, or retries would weaken exactly-once ownership or upgrade safety.
Hosted review reconciliation
Hosted ClawSweeper durable comment
5295331940reviewed exact headcd8476583acc62a1b3d960b684dc5d4d47728ddd, found no concrete implementation finding, and rated the patch 4/6. Its sole rank-up move asks maintainers to accept or reject the retained provenance andoperator.readcontract. The immutable released R5 packet already supplies that maintainer decision: it explicitly accepts the default-off 30-day / 200,000-row owner contract and instructs this worker not to reopen it without an implementation mismatch. Exact binding, privacy, downgrade, lazy-storage, and reader-scope proof found no such mismatch, so no additional code or policy change is made here.Production versus test LOC
Whole PR from the frozen target: 80 files,
+4305/-312(net+3993). Judged split: test/QA support+1924/-64; docs/generated/baseline+153/-41; production and other owner code+2228/-207. Positive production growth implements the approved message-audit capability plus the exact host-bound execution binding required to prevent cross-execution receipt disclosure; regression and executable QA proof account for most remaining growth.PR remains Ready for review, open, unmerged, and without automerge. Hosted ClawSweeper is the only ClawSweeper lane; local ClawSweeper was never run.