S2: bound final MCP responses with private lossless artifact receipts #802
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
toasterson/Anima!802
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/s2-bounded-tool-artifacts-20261019"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current exact head:
c37f3cf4a5f3e7fb62cec3fe17f837883e26342a. Current mainb083a89ad8224c844a3db37e38167e21184aa163merged normally, with no history rewrite. Focused main repair #805 is a dependency, addressing only introduced Q1/Q2 fixture lifecycle calls and the Q4 denial expectation. Human order: #805 → #802 → #803 → #804.Exact-head Solstice failure at55edd630 was one S2 test assertion assuming process_id was the first JSON object key. The fix compares exact decoded head/tail source bytes, preserves the complete hash/byte/handle assertions, and passes both default JSON ordering and explicit serde_json/preserve_order. No artifact-production behavior changed in this follow-up.
Local final-head validation: cargo check -p anima-server --lib PASS; artifact suite5 including real PostgreSQL PASS; explicit preserve_order regression1 PASS. The external wrapper was edited during its first execution, producing an error after all Rust commands completed; original exit2 receipt is retained, final clean-source/diff verification completed separately, and future wrappers are immutable copies. See pr-802-refresh-verification.json; no failed Rust test was relabelled green.
Local receipt log SHA256
f4be37418f8e33862b86aa7ceed68a7b5218bbd5fbb4920a04bc230ea9d24d1c. Exact-head remote CI/review remains a distinct operator gate. No merge/deployment/live recovery by this agent.Model-session MCP results now fit Akh A3's transport budget without changing routine PAT/operator reads. Only authenticated non-local session kinds with a persisted Akh dispatch default to an 8192-byte final serialized JSON-RPC boundary (configurable4096..8192); PAT calls keep their existing behavior, with an optional separate64KiB..8MiB cap. Default PAT list pages stay direct, and Q4's PAT64KiB default/1MiB whole-archive contract remains reachable through the actual dispatcher.
Akh-dispatched non-local sessions receive real handler pages: direct WI description/authorized section bytes, stable thread message/content pages, and archive UTF8 or native after_seq transcript pages. Mutable-source hashes prevent concatenating changed versions; collection cursors survive timestamp ties. Default Akh list_work_items pages cap at10 rows; ACP/local sessions keep their existing list/full-read shapes. PAT detail retains its full-state default shape plus additive read_windows; optional page selection is explicit. Full query/memory pagination remains S4; the safe read prerequisite here still fetches/hashes source text.
An oversized fallback commits the complete exact original as hashed chunks before returning decoded tool-text head/tail excerpts and an exact-owner read_tool_output reference. Handles, error state and receipt/request-ID binding survive. Owner quota pressure evicts that owner's oldest artifacts under its advisory lock; surviving expiry is immutable. The bounded minute sweep also converges a configurable global soft cap and publishes aggregate byte/count/eviction metrics. Reads suggest narrower pages on persistence failure; mutation failures retain the warning against replaying a possibly completed operation. Default unbounded PAT calls allocate no artifacts.
Dependencies: Q4 #799 at76cbc9c55528c864a9542d9abeb60a2d3ccafd2a is integrated by an ordinary local merge (no history rewrite). Its transcript regression now tests both role paths through handle_request. Akh #676 provides the complementary final ToolResult/native bounds; this producer uses distinct anima_tool_output_ref and never invents a runtime job ID. D1 #798's exact-WI detail restriction is preserved for model tokens; watch for session-token denials after rollout. No scheduler feedback pagination was added: generic MCP feedback results cross this boundary, while mandatory dispatch briefs retain Q2's refusal behavior.
Storage: PostgreSQL preserves atomic owner/scope/bytes publication without a cross-store protocol. Per-owner cap128MiB, maximum seven-day availability subject to earlier quota/global eviction; global soft cap defaults8GiB. Dedup intentionally includes request ID so different JSON-RPC receipts stay distinct. Retrieval limits are upper bounds reduced for metadata/escaping; tiny limits advance a whole Unicode scalar. Contract and configuration: docs/ai/contracts/mcp-tool-artifact-v1.md, with the token refinement also in transcript-read-v1.md.
Validation: focused MCP suite152 passed, including full-schema disposable PostgreSQL artifact/owner/eviction/range/PAT tests, direct-page/source-pin/ACL tests and merged Q4 transcript tests. The previously broken Docker-gated mcp_work_item_pagination_test passes both tests on Colima, including205-row/tied-timestamp/concurrent-insert traversal. All-target anima-server Clippy with -D warnings, diff check, shell syntax and Solstice dry-run pass. Final full library/exact pushed-head receipts are recorded in patches-anima.md.
CI coverage correction: mcp_work_item_pagination_test was missing from the nightly build and job lists; both are added, plus the new direct-read PG job. Existing artifact/transcript jobs remain. Other touched central integration suites use explicit disposable PG rather than require_docker skipping and already have nightly jobs. Commit-mode CI does not execute the nightly DB pool; local explicit PG/Docker evidence is separate from Solstice exact-head CI. Independent re-review and genuine Solstice receipts remain pending. No merge, deployment or live recovery.
Producer evidence remains E05's sanitized measured nested-output shapes and the read-only source/digest census: merged Akh #394 was already present in the observed service/runtime sources, while historical producer provenance remains unknown. Tests contain no historical private prompts.
Round2 follow-up headee277438f40a0fcdef474f9d94c53c6dc9508175: auth carries server-loaded SessionKind plus EXISTS(akh_session_dispatches); both are required. A production-auth PostgreSQL fixture covers Akh, ACP runner and local pickup, proving full local get_work_item and50-row ACP/local lists. FOR SHARE holds a parent lease through each range; an eviction concurrency fixture proves the writer waits and reads complete. Migration164 adds owner/age index without changing161's checksum. Direct pages fit up to4096 source bytes against actual serialized escaping, model transcript tails honour tail_bytes (zero starts0; explicit offsets win), and every non-read mutation scope retains the no-replay warning. Focused154 MCP tests including3PG, full565lib/8ignored, real Docker pagination2 and all-target Clippy pass. Exact pushed-head PG/Docker rerun is active.
Constructor compatibility follow-up: D1#798 and S1#801 land before #802 in the agreed order. Their new MCP fixture constructors therefore now receive session_kind=None and akh_dispatched=false inside #802, through ordinary dependency merges93e4a000 and a normal follow-upccfb5b52. Sites: src/mcp/context_diagnostics.rs, src/central_cleanup.rs, tests/central_session_retirement.rs. These are test fixture changes; production S2 boundary/lease/pagination logic is unchanged from Fable-approved
ee277438. Current head55edd630b97ef713e138dd90b43e66a1c0c9b3b8. Exact focused reruns at this head await safe disk headroom; prioree277438receipts remain separate evidence. The final merged-tree remote nightly branch includes these committed changes, rather than validation-only repairs. No force push/main merge/deployment.Current final head3ec13eca079455da6c1a0b807cc751527183dbd8 carries the updated Akh#67580464684ecc2b9afb7c9978aab8841d14dc55971 provenance pin through ordinary #801→#802→#803 dependency merges. The final validation branch is validation/anima-qseries-nightly-v2-20261019 at exact #803headf8f860c6962936813a024533e386f4523f5f873b; every commit is reachable from a PR head. No new Anima wire/attestation logic changed for this pin. Remote nightly exact-head receipts and safe-headroom focused reruns remain pending.
Integration refresh (2026-10-19): normal main/dependency merge commits, no force push. Main is
8d3eb5855f. This head also includes refreshed #801 so the agreed merge order cannot repeat the same insertion conflict; its diff narrows as predecessors land. Shell/Rust syntax, diff and predecessor-ancestry checks pass. No fresh local cargo check: available disk headroom above the 31.25 GiB floor was smaller than the last measured owned compile target. Exact new-head CI is the gate; prior receipts remain prior-head evidence.17030d469b' into fix/s2-bounded-tool-artifacts-20261019 93e4a000967b777d8659' into fix/s2-bounded-tool-artifacts-20261019 25ce440ff265cb3f97' into fix/s2-bounded-tool-artifacts-20261019 24aee59ceea0b2f2fa40' into fix/s2-bounded-tool-artifacts-20261019toasterson referenced this pull request2026-10-19 20:52:41 +00:00