Repository navigation
perf(runtime): reduce status and control read pressure - #1013
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
Recommendation: APPROVE
Author review submitted as COMMENT, as requested. I found no material correctness, isolation, cancellation, or maintainability defect in the complete three-file change.
Reviewed base 45f56984971d5fee83533831bde4ab9bcec86dd9 → head 9a4b472a103ae3b999ce47b831fb543c10d66ffb. The CI merge revision 81beee1e25e6669c3b19bea8770928ba618b0a29 has the identical Git tree b62bee45d8a6bef19226e033e99bd81cae6228a5 as the reviewed head.
Code and contract assessment
- Canonical owner and callers: the existing
RunEngine→DatabaseRunStateStore::load_run_status_snapshotpath remains the owner. I traced HTTP status, Edge callback/interaction admission, WebSocket interaction checks, and terminal/cancellation recovery consumers. The authenticated HTTP entrypoint passes the authenticated owner through to the store; the metadata helper and every facts-query branch constrain bothuser_idandrun_id. Missing/foreign metadata returns before querying events. Existing session checks in downstream callback consumers remain intact. - Ordering and accounting: the three ascending LIMIT-1 branches retain earliest-per-type selection; the outer chronological order preserves first-field binding precedence in the shared converter. The descending accounting branches select the latest finalized row ahead of any finished row, by presence before decoding. Therefore malformed selected accounting still errors, while an unselected malformed finished row is not decoded. Finalized-without-
datadoes not authorize fallback. The forced composite index and unique owner/run/event-index key both exist in the canonical schema. - Recovery, errors, and cancellation: the metadata projection only substitutes NULL for the unused checkpoint body; snapshot conversion and Explain intent read metadata/events. Executable recovery claims still use the full projection. Both status queries have a cancellation-safe checkout; the combined query releases it after fetch completion and before JSON decoding. Query/cancellation failures leave the existing guard armed to close the physical connection. Errors propagate instead of becoming a successful empty status.
- I/O, cost, and complexity: existing runs now use two business SELECTs, with at most four returned payloads; missing/foreign runs use one. Five per-type probes are still performed, including the finished probe when finalized exists. LIMIT/forced indexing does not prove constant physical scan work or end-to-end latency improvement. The two reads still have no atomic snapshot, as the contract explicitly states. No cache, new authority, transaction, lock order, or retry loop was added. Superseded serial readers/constants and their substring-only test were removed, and the SQL-capture fixture was reused.
Validation and boundaries
- Local isolated checkout:
cargo fmt --all -- --check,git diff --check, andcargo test --locked -p astra-services --lib runs::testspassed (193 passed, 0 failed, 68 ignored). The initial offline build lacked a cached locked dependency; the normal locked build fetched dependencies and completed. Source worktrees remained clean. - Inspected actual CI logs for services/turn-core/plan and online core-services: 5,447 offline tests and 468 online tests passed, including all 193
runs::testsoffline cases and all 25runs_db_batch_itcontracts. These are observed CI results, not a local DB rerun. - The new public-store contracts exercise counted SQL, checkpoint omission and retention, repeated/partial bindings, latest/finalized precedence, missing/foreign ownership, empty selected facts, selected/unselected corruption, and reads through an independent pool. Both ran and passed in CI. Existing shared-guard cancellation/retry tests also passed. Direct interruption of this new UNION query is not separately fault-injected.
- Reviewed the 1,000-session capacity extension: it checks cross-pool identity/cursor results with 100 owners and 32 total connections. I did not independently rerun this opt-in probe, ThreadSanitizer, or EXPLAIN ANALYZE; PR-body reports of those are author evidence. This probe does not prove four Server processes or 1,000 live agent loops.
CI and publication provenance
Current target main exposes 15 required contexts, all pinned to GitHub Actions app 15368. Complete check pagination returned 38/38 head checks and no additional page; legacy commit statuses are empty. Four workflow runs were enumerated through the terminal page: Test Suite 38742233764, static checks 38742233907, PR title 38742233833, and optional live regression 38742234068.
Required contexts: 12 success, 3 scope-excluded/skipped, no failure or pending required context. Successes are Check PR title, check, Test: astra-runtime, the five protected Test: astra-cli labels, Test: online (core), Test: online (integration), Test: turn-core + services + plan, and Test: macOS workspace coordination. The skipped contexts are Test: core crates + bridge hooks, web (typecheck, test, build), and Astra SDK (typecheck, test+coverage, build). Their exclusions match the exact three changed paths, scope-job logs, and a local classifier rerun. The successful online-integration label also had RUN_TESTS=false; the five CLI labels gate one successful shared executable run, not five independent test runs.
Both repository/inherited ruleset pages were checked. Active branch ruleset 12590607 adds creation/non-fast-forward restrictions, no additional check contexts; 22300573 applies to release tags. The full branch-protection endpoint returns 403 for this integration, so the current required context/app mapping comes from the branch endpoint, corroborated by Mergify's protection summary; this is not a claim to have read every administrative protection setting.
Optional live regression remains 6/8: recovered-validation measured 88,661 ms against 45,000 ms (its hard quality judge passed), and fanout reported InfraVerificationUnavailable for its judge. I inspected the case definitions, logs, and relevant status consumers; neither failure establishes a defect in this diff. The latency failure remains unresolved, not reclassified as a pass or proven unrelated.
Immediately before publication at 2026-10-15 14:10 UTC, revalidated the exact base/head, open/unmerged state, target branch contexts/rulesets, all check pages, authenticated author XuPeng-SH, and all review/comment collections. There were no existing review bodies or original inline anchors to duplicate.
Requested reviewer configuration: GPT-6 Astra / xhigh; backend model/effort identifiers are not exposed to this review agent. No product edits, CI reruns, deployment, shared/production-service access, provider calls, or merge were performed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Recommendation: APPROVE
This author COMMENT reviews current head d8899b7dffb39ac13d0354a6efa7d492b3d8dc5b against base 45f56984971d5fee83533831bde4ab9bcec86dd9. It supersedes the code assessment in review 5534512021, which remains anchored to 9a4b472a103ae3b999ce47b831fb543c10d66ffb. I inspected the complete three-file base-to-head change and the intervening commit. No material correctness, isolation, cancellation, or maintainability defect found.
Source assessment
- The new status SQL selects positions before payloads. MIN preserves earliest-per-type bindings; COALESCE of the two MAX values preserves latest-finalized precedence even when finished is newer. NULL represents absence; zero is a valid selected position. An empty aggregate joins to no rows. Both the aggregate and payload lookup bind the same owner/run, and the unique owner/run/event-index key limits selected payloads to four. There is no cross-owner or cross-run join based solely on a globally interpreted index.
- The store entrypoint retains the metadata-first ownership check, one connection at a time, and the existing snapshot converter. The converter preserves chronological first-field binding precedence and accounting data. Selected malformed JSON remains an error; unselected same-type/history/finished corruption is not decoded. A present finalized row without data still suppresses finished fallback.
- The checkpoint-free metadata projection changes only the unused checkpoint body. Explain intent still comes from canonical run-start evidence; executable recovery continues using the full projection. The metadata helper and combined facts read use the existing cancellation-safe guard: interrupted/error exchanges close their checkout, and successful fetches release before decoding. No new transaction, write, retry owner, cache, or lock order is introduced.
- I rechecked the shared path through authenticated HTTP status, RunEngine, lifecycle status/terminal recovery, Edge callback admission, and WebSocket interactions. Their owner/session and execution-generation checks remain intact. No separate CLI/Server status authority was added.
- This replaces both the original serial readers and the superseded UNION/forced-index implementation. The static query reduces builder duplication and retains two business SELECTs for existing runs, one for missing/foreign runs. The aggregate/join can still perform history-dependent physical scans; four returned payloads and fewer round trips do not establish constant database work or universal latency improvement. The storage contract correctly retains the non-atomic two-read semantics.
Tests and limits
- Local isolated checkout at this exact head:
cargo fmt --all -- --check,git diff --check, andcargo test --locked --offline -p astra-services --lib runs::testspassed: 193 passed, 0 failed, 68 ignored. Source worktrees remained clean. - Current offline services CI: 5,447 passed, including the 193 run-store tests. Current online core-services CI: 469 passed, including all 26/26 runs_db_batch_it contracts. Its merge revision
1cab3466b625db8f279a241a0b4910ce3b2a158bhas the same tree as the reviewed head:14c4eb450700cc1ea18140e38af3e017956ccd3f. - The public-store tests assert SQL counts, checkpoint omission/retention, missing/foreign owners, partial/repeated bindings, finalized/finished ordering, absent data, and corruption behavior. The new boundary test covers accounting/binding at index zero and later same-type corruption; it passed in current DB CI.
- Reviewed the capacity extension covering empty and populated facts through one/four independent pools, 100 owners/1,000 sessions, 32 total connections, identity/cursor/content assertions and latency samples. I did not independently rerun capacity, ThreadSanitizer, EXPLAIN, the reported controlled A/B, or the scripted HTTP journeys; those PR-body measurements remain author evidence. The capacity fixture is not a four-Server or 1,000-live-loop test. Direct interruption of this specific aggregate query is not separately fault-injected.
- Current live CI ran this head and passed 8/8 in 169,515 ms, including recovered validation and fanout judging. I read its logs without rerunning provider calls. The earlier head's failures are historical; this pass alone does not prove a causal latency fix.
Current CI/review provenance
Immediately before publication at 2026-10-15 15:43:17 UTC, I revalidated the exact head/base, latest main, open/non-draft/conflict-free state, authenticated author XuPeng-SH, current rules and complete check/workflow pages. The sole existing substantive review is 5534512021, whose commit anchor and body cover the old head; there are no inline original anchors, unresolved threads, or duplicate current-head reviews.
The target exposes 15 required contexts, each pinned to GitHub Actions app 15368: 12 successes and 3 proven scope exclusions (core crates/bridge hooks, Web, SDK). Scope logs and a local classifier run match the exact three changed paths. The successful online-integration label had its heavy work excluded; five CLI labels certify one shared execution. All applicable code checks, including lint and live regression, succeeded. Complete pagination found 40/40 checks, six successful workflow runs (including two title runs and the superseded-run controller), and zero legacy statuses, with empty next pages.
Repository/inherited rulesets were re-read: branch ruleset 12590607 adds creation/non-fast-forward restrictions; 22300573 applies to release tags. Full branch protection returns 403 to this integration; required contexts/app IDs are visible through the branch endpoint and corroborated by Mergify. GitHub reports conflict-free but mergeable_state=blocked; the protection summary still requires native review approval. This author COMMENT is a substantive recommendation, not a native approving review.
Requested configuration: GPT-6 Astra / xhigh; backend model/effort metadata is not exposed to this agent. No product edits, remote CI reruns, deployment, shared/production-service access, or paid API calls were performed during review.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Recommendation: APPROVE
This author COMMENT reviews base 45f56984971d5fee83533831bde4ab9bcec86dd9 → current head 57feddc34827003245facdba1cbb158ffb92704d. I reviewed all 16 changed files and the relevant callers, including the control-read queue and fanout verification added since review 5535850036. No material correctness, isolation, cancellation, or maintainability defect found. The previous recommendations remain anchored to their older SHAs.
- Status selection and recovery: the status query selects earliest binding positions and latest finalized accounting (falling back to finished only if finalized is absent), then joins at most four owner/run-scoped payloads. Index zero remains valid. The entrypoint omits checkpoint bodies, retains metadata-first existence/ownership checks, releases successful checkouts before decoding, and propagates selected corruption. Executable recovery retains its separate full projection. HTTP, interaction/callback, terminal-repair and recovery consumers retain their owner/session checks.
- Batch identity and database work: the positional batch performs database equality on both owner and run, preserving collation semantics and duplicate request positions. The independent bound run-ID predicate limits candidate scans; ordinal validation rejects malformed/duplicate/missing positions. Missing rows return None, individual decode failures remain per-position errors, and transport failures fail the batch. Reusing
RUN_CONTROL_COLUMNSand the existing decoder avoids a second control representation. The existing checkout guard prevents an interrupted SQL exchange from being returned for reuse. - Concurrency and cost: ControlReads bounds each batch to 128 requests, workers to four, outstanding requests to 8,192 globally/4,096 per owner, and retained key bytes. Owner-rotating dispatch, removal of cancelled requests, released queue nodes, and explicit timeout/panic/error cleanup prevent one owner from retaining an unbounded backlog. No mutex spans an await. Batch membership freezes before SQL; later arrivals cannot consume an earlier observation. Idle queues issue no SQL. The 25 ms collection window is measured from enqueue time; the three-second query/four-second caller budgets are separate.
- Authority and recovery: RunEngine's observation path uses the queue only for the initial fresh control read. Ancestor lookup/cancellation precedence remain intact. The watcher still fences session/generation changes, delivers cancellation, and advances input watermarks. Read errors do not clear a paused run; recovery leaves uncertain runs for retry. Lease/provider/action admission remains separately owned. This is not a new execution grant or cross-process cache.
- Fanout proof: typed ID/title selectors select a receipt; the verifier then independently checks its request agreement, canonical group/title/parent/work-unit projections, unique slots and exact authoritative children. Generated IDs and independently chosen titles match the production producer/default-title behavior. Missing proof remains unavailable; contradictions and ambiguous launches fail. Exact model/result digest, adoption and finalization proof remain in force. All five case-selector migrations and the shared judger caller were checked. The child fixture now creates distinct cancellation bindings.
Validation:
- Local isolated checkout: formatting and diff checks passed; all 613/613 harness tests passed, including generated/explicit IDs, independent/default titles, ambiguous starts, contradictory/missing projections and existing negative custody cases.
CARGO_INCREMENTAL=0 cargo test --locked --offline -p astra-services --libalso passed: 1,778 passed, 0 failed, 90 ignored. Both source checkouts remained clean. - The local targeted runtime build stopped before tests because its temporary incremental cache exhausted disk (
No space left on device); only that review-owned cache was removed. This is not reported as a local runtime test pass. - Inspected current runtime CI: 5,962 passed, including all five new queue tests for fresh observations, 1,000 owners, staggering/idle behavior, cancellation/caps, fairness and failure recovery.
- Current online services CI: 470 passed, including 27/27 runs_db_batch_it tests. The new batch contract covers owner isolation, duplicate/collated keys, missing rows, cross-pool changes, per-slot corruption, limits and EXPLAIN ANALYZE of the emitted production SELECT against unrelated history. All three status snapshot contracts passed.
- Current online runtime CI passed the 1,000-owner/session watcher test with remote cancellation, generation change, pause and input-watermark updates. Online integration ran and passed 283 tests. These are observed CI results; I did not access a shared database or independently rerun DB/TSan/capacity/A-B probes.
- Two status SELECTs/four returned payloads do not imply constant physical history-scan work or an atomic snapshot. Control batching reduces round trips at the cost of collection latency; it is not a universal latency improvement. The capacity fixture is not 1,000 live LLM loops.
Optional live evidence: current run 38781934900 checked out this exact head and passed 8/8, including fanout in 38.06 s with its required judge accepted. The earlier 29dfbd66 run genuinely failed fanout with BehaviorContractViolation, adoption proven=False, and unreported judge diagnostics. Its safe output does not prove the exact failed predicate or a model verdict; the current pass does not establish a causal performance fix. Artifact metadata was available, but the returned archive download URLs gave HTTP 403, so this assessment relies on the source and actual job logs, not a claimed archive-byte inspection.
Publication provenance:
Immediately before publication at 2026-10-15 18:21:30 UTC, Revalidated open/non-draft/unmerged state, unchanged head/base/latest main, authenticated author XuPeng-SH, complete check/status/review pages and original anchors. Two substantive reviews exist on older SHAs; there is no current-head duplicate or inline review thread.
The current target requires 15 contexts, all GitHub Actions app 15368: 13 success and two verified scope exclusions. Successes: Check PR title, check, Test: core crates + bridge hooks, Test: astra-runtime, all five protected Test: astra-cli labels, Test: online (core), Test: online (integration), Test: turn-core + services + plan, and Test: macOS workspace coordination. Web and Astra SDK are skipped consistently with the scope logs and local classifier. The five CLI labels certify one successful shared executable run. Full pagination returned 40 checks, zero legacy statuses and six workflow runs: five successful, plus the superseded title run cancelled before the successful replacement. No applicable code check is failed or pending.
CI's merge commit eda0fd99c21bba17cc87688c1244986079179a10 has the same tree as the reviewed head, be78ff75c1ede8b0d2b1abaa437768ad78e96e70. Workflow head repository/SHA, app provenance and checkout logs were checked. Active branch ruleset 12590607 adds creation/non-fast-forward restrictions; 22300573 applies to tags. Full branch protection remains HTTP 403 to this integration; the required context/app mapping is visible through the branch endpoint and corroborated by Mergify. Native review approval remains unmet; this author COMMENT is a recommendation.
Requested configuration: GPT-6 Astra / xhigh; backend model/effort identifiers are not exposed to this agent. No secondary agent/model was used. No product edits, remote CI reruns, deployment, shared/production access, paid API calls or merge were performed in this continuation.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Recommendation: APPROVE
Author COMMENT for base 45f56984971d5fee83533831bde4ab9bcec86dd9 → head aef8ffadab78867a4657d88a61b24d77830a07d2. No material defect found in the reviewed changes. The complete PR remains 16 files; since review 5537943863, only execution_capture.rs and the harness README changed (+93/-6). I reviewed that complete delta and its producer/consumer paths, and reconciled the unchanged storage/runtime assessment with current-head CI. Prior reviews remain anchored to their original SHAs.
- Rejection authority: the transcript join preserves the producer's typed disposition while keeping the previous
okmapping unchanged. The canonical transcript writer derives status fromToolCallRecord::canonical_terminal_event_type; this is not an inference from error prose. Existing exact session/run/call identity, sequence and complete-coverage checks still run before selection. - Launch selection and contradictory evidence: the new branch excludes only producer-typed
Rejectedattempts from fanout launch candidates. It rejectsstartedorexecuted:truecontradictions and preserves explicitexecuted:nullas verification-unavailable. It uses the existing canonical receipt readers, including the first complete JSON line before display guidance, rather than adding a second parser. Opaque executed failures remain unavailable; they are not silently skipped. Successful launch selection still requires an unambiguous receipt, request/projection agreement, exact parent/child/model/slot identity, result digest, adoption and ordered finalization. - Other consumers remain strict: rejected attempts stay in
tools(), so tool-count/predicate evaluation still observes them. Semantic judge evidence retains all parent requests with their outcomes. The new branch is confined toagent_fanout(action=start)selection; it does not alteragent.spawnpredicates or turn rejection into a successful execution. - Database, concurrency, isolation and recovery: the status/control implementation is byte-identical to the previously reviewed head. Status reads still use checkpoint-free metadata and at most four owner/run-scoped selected payloads, with selected corruption propagated and the existing non-atomic two-read semantics. Control batching retains database identity equality, positional results and per-row errors. The queue retains 128-request batches, four workers, global/owner/key bounds, enqueue-based collection deadlines, cancellation/panic cleanup and fresh observations. Session/generation fencing, ancestor controls, lease/provider/action authority and recovery retry ownership remain unchanged. This commit adds no I/O, task, lock, retry owner or shared state. Reduced round trips remain distinct from physical scan work and latency; the 25 ms collection cost is still explicit.
Validation:
- Exact-head isolated local run:
cargo fmt --all -- --check,git diff --check, andCARGO_INCREMENTAL=0 cargo test --locked --offline -p astra-test-harness --libpassed: 613 passed, zero failed/ignored. Source checkout remained clean. - The expanded existing custody fixture exercises ten rejection/failure cases with both ID and title selectors, including opaque rejection, references to the existing group, execution contradictions, first-line JSON plus guidance, explicit unknown execution and opaque executed failure. It preserves two correlated calls and both authoritative children. Existing ambiguity, foreign-session, missing/duplicate identity, partial capture, digest and finalization negatives remain.
- Inspected current logs: core/bridge CI passed 3,923 + 129 tests; runtime CI passed 5,962 tests, including all five queue tests. Online services passed 470, including the batch identity/corruption/scan contract and all three status contracts. Online runtime passed 92, including the 1,000-watcher cross-pool journey; online integration passed 283. These are current CI results, not local DB reruns. I did not independently rerun TSan, capacity/A-B measurements or paid live trials.
Optional live failure remains unresolved: run 38786442753 checked out this exact head and finished 7/8, with flash_missing_child_model_fail_closed reporting BehaviorContractViolation. Its case observed one failed-outcome call matching the requested spawn action/model policy, but not result status=failed; neither expected error-kind branch matched. The first branch did observe executed:false. Zero-child and text checks passed. Same-model fanout passed in 28.86 s, including its hard judge.
This is a real result-contract failure, not a judge outage or a passing test. The safe diagnostics do not disclose the unexpected result status/error kind or prove its cause. The unchanged tool-count/result parsing and preserved outcome mapping do not identify a regression from this rejection-selection patch; no concrete changed-code defect was established. The earlier head's 8/8 result is historical, not evidence that this head's failure passed.
Publication provenance at 2026-10-15 19:05:00 UTC: revalidated exact head/base/latest main, open/non-draft/unmerged state, authenticated author XuPeng-SH, all review bodies/commit anchors and original inline-thread collections. Three prior substantive reviews cover older SHAs; no current-head duplicate or inline thread exists.
Current main exposes 15 required contexts, all pinned to GitHub Actions app 15368: 13 success, with Web and Astra SDK the only two verified scope exclusions. Scope-job logs and the local classifier agree. Successes include title, check, core/bridge, runtime, all five protected CLI labels, both online labels, services/turn-core/plan and macOS coordination. Five CLI labels certify one shared executable run. Full pagination found 40 checks, zero legacy statuses, and six workflow runs: four success, one superseded title cancellation and the failed optional live run. No required context is failed or pending.
CI merge revision 3ce83cf52642f5fd2bc475842f4dee7c822aafff and the reviewed head share Git tree 2d92edaa148c5708814659f661399ec02a7d6fab. App/workflow/head-repository provenance and actual checkout logs were checked. Active branch ruleset 12590607 adds creation/non-fast-forward restrictions; 22300573 applies to release tags. Full branch protection returns 403; required contexts/app IDs are visible through the branch endpoint and corroborated by Mergify. This author COMMENT does not satisfy native approving-review requirements.
Requested reviewer configuration: GPT-6 Astra / xhigh; backend model/effort metadata is not exposed to this agent. No secondary reviewer/model, product edit, remote CI rerun, deployment, shared/production access, paid API call, protection change or merge was performed in this continuation.
## Summary CLI strict recall compares Astra session identity with Memoria record ownership even when UC or connected personal accounts use distinct namespaces. Explicit close also races detached extraction, and process-local governance cannot recover a partial archive/purge after restart or a lost response. This completes the remaining owner/finalization work from #996 after #997: - Strict recall carries fresh Server attestation of both identities and session; CLI validates that attestation and every row before admitting content or tracking a working ID. - CLI exit and explicit close use the canonical Server-owned memory lifecycle. Exit preserves resumability and cannot fall back to local purge after an unsuccessful handoff. - A durable owner/session journal freezes extraction inputs, uncertain write payloads, consolidation plans and stage receipts. Database leases and the existing Session fence coordinate separate server instances. Missed handoffs recover from immutable canonical context; purge waits for execution settlement and verified final-turn freshness, and removes only captured working IDs. - Required failures retain source state and retry with bounded backoff. Optional reflection/scene retries reuse completed episode and purge stages. Current authority is resolved for each operation; queued input/credentials are not exposed through the owner-only status endpoint. Session deletion removes queued journal inputs. ## Related issue Refs #996. This is the remaining implementation after #997; the issue should remain open until the matched backend protocol is available and the changes have been reviewed together. **Backend dependency:** [matrixorigin/memoria#310](matrixorigin/memoria#310). Deploy Memoria's dedicated idempotent-store endpoint before enabling this Astra image. The endpoint's owner/branch/key primary-key arbitration is needed to safely replay a request after its response is lost; vector similarity deduplication cannot provide that guarantee. Old backends fail before a write and never authorize cleanup. Neither PR should be merged automatically. ## Change type - [x] Bug fix - [x] Documentation - [x] Test ## User and compatibility impact **Database rollout:** this adds fresh schema contract `2026-10-14-v102`. Astra rejects older completion markers and does not migrate databases automatically. Existing deployments require an operator-owned database rollout/preservation plan; this PR performs no reset. Upgrading only the image is insufficient. Adds authenticated `POST /sessions/{session_id}/memory/finalize` and `GET /sessions/{session_id}/memory/status`. A queue acknowledgment is not a confirmed archive. CLI retains its five-second exit budget; extraction/finalization retain 20/60-second attempt budgets. Worker leases last 90 seconds, polling every two seconds with concurrency two and retry backoff from five seconds to 16 minutes. Strict session recall adds a `memory_scope` envelope and requires a matched Server for the updated CLI. UC, connected personal and explicitly enabled self-hosted owners remain separate from Astra session authorization. Consent revocation/disconnect stops future remote operations without promising remote erasure. Astra Session deletion removes queued inputs; Memoria's retention and explicit deletion govern remote records. ## Architecture and complexity delta - Canonical owner extended: existing Session lifecycle, context coordinator and memory extraction/governance algorithms. One new owner/session work journal stores retry checkpoints, not a second session/context or memory authority. - Existing implementations/callers searched: CLI startup/cleanup, memory proxy and authority resolver, extraction runner/service, turn finalization, explicit close, write fence, context heads and deletion catalog. - Superseded paths removed: untracked close-time governance task and its process-local coordination. The managed background recovery task participates in Server cancellation/shutdown. Remote CLI maintenance now queues canonical Server work. - Direct/in-process providers retain the same governance algorithm and ordinary transport contract. Only bounded destructive working cleanup holds the Session fence across network I/O; optional reads, writes and reflection use short preparation/checkpoint transactions. ## Verification Current head: `40cbadd5`, based on main `7375abe0`. Targeted E2E Clippy, formatting and whitespace checks passed locally. The repaired handoff/resume regression passed real database CI and integration passed 295/295; the optional live harness also passed 8/8. All current test and static-check workflows have passed. At `26271bdc`, core-services passed 481/481 and core-runtime passed 104/104, including the memory regressions; earlier evidence below applies to its recorded commits/runs. Passed locally on rebased main (synthetic fixtures; designated isolated MatrixOne): - `make format-check` - `cargo test -p astra-memoria --lib` (19 tests) - `cargo test -p astra-services --test session_memory_lifecycle_db_it -- --ignored --test-threads=1` (3 tests on fresh v102; rerun of the freshly built test binary passed) - `cargo test -p astra-services --test schema_assertions core_schema_catalog_matches_live_idempotent_bootstrap -- --ignored --test-threads=1` (1 test; idempotent fresh bootstrap, generated catalog, rejection of unsupported old marker) - `cargo test -p astra-runtime --lib session_memory::durable::tests -- --ignored --test-threads=1` (4 tests before the schema-version follow-up; local package debug=0) - `cargo test -p astra-cli --lib cli::session::session_startup::tests::cli_ -- --test-threads=1` (7 tests; local runtime/CLI package debug=0) - Fresh CLI test binary: `browser_identity_services_replace_generation_and_private_skill_cache` and `escape_browser_login_restores_memory_and_external_discovery` (2 tests) - `cargo clippy -p astra-memoria -p astra-services -p astra-runtime -p astra-cli -p astra-thin-client --all-targets -- -D warnings`; CLI all-target recheck after fixture updates - `python3 scripts/schema/test_schema_inventory.py` (47 tests) - `git diff --check` The first CI run exposed a missing schema inventory classification and stale login-maintenance mocks; this follow-up classifies the journal and aligns those fixtures with Server handoff. The positive owner fixture now contains a real working-memory entry rather than arbitrary text. An unrelated macOS PTY timing case also failed on that head; terminal-reader code is unchanged. Updated-head CI is rerunning and must pass before the draft becomes ready. A full repository `make check` was not completed locally; the relevant all-target Rust checks are listed above. No online/live provider tests were enabled locally. Public entrypoints and unhappy paths: authenticated exit/close/status; unauthenticated finalization; valid UC/personal/local owner namespaces and foreign identity/owner/session; unsuccessful/malformed queue acknowledgments without purge; lost episode/scene/delete receipts; optional-stage retries without re-archive; stale final-turn watermark; unsupported backend retaining working memory; lease takeover and old worker rejection; canonical-context recovery after missed handoff. Database verification uses newly created isolated local MatrixOne databases and synthetic identities. No QA/production mutation or live model calls. CI's runtime online lane explicitly designates its isolated database for the shared test guard. Rebased on current upstream `main` at `89dcde88`. Host review used the open-code-review delegate skill: all 28 selected code/build files reviewed; all four documentation changes also read; 0 skipped, 100% change coverage. ## Final checklist - [x] Tests added at the owning layer, including public entrypoints and failures. - [x] Public/design/configuration and test documentation updated. - [x] Diff checked for credentials, private URLs, customer data and generated files. - [x] Conventional Commit-style title. ### Review follow-up: explicit Memoria branch scope Memoria #310 now derives keyed receipt identity from the resolved storage branch and freezes its routed store/table across embedding. Astra's durable HTTP adapter explicitly selects main for archive/working writes, typed/strict reads and exact-ID cleanup, matching its deterministic main-scoped receipt verification. Normal direct memory tools retain their existing checkout behavior. The loopback/MatrixOne durable lifecycle regressions now enforce the main selector in write bodies and read/delete queries. This branch also includes current main (`d2d44040`, #1006), including the upstream live-harness model/cache configuration and child-answer verification changes. Format checks and live-harness workflow contract tests pass (6 passed, 2 optional skips). Runtime all-target Clippy passes with warnings denied against this combined source tree. The updated online durable lifecycle regressions are executing in CI; full CI is still running. Follow-up review covered all 5 changed Rust files across Astra and Memoria (100%, zero skips); both accompanying protocol/design document changes were also read. ### Live harness follow-up: missing configured model The missing-model case required `invalid_request` without constraining how the model was selected. The canonical admission contract distinguishes an unknown configured name (`model_selection_invalid` / `invalid_request`) from an unknown Offering ID (`model_offering_not_found` / `tool_unavailable`). The probe now supplies an explicit fixed configured-name request and additionally verifies its policy mode, selector kind and requested name in canonical execution evidence. The failed result, exact error kind, no-child and no-fallback assertions remain required. The previous head's deterministic checks and four durable memory DB/loopback regressions passed. One rerun also passed the recovered-validation quality case, while the ambiguous missing-model assertion failed again. This follow-up changes only that fixture; it does not change runtime admission, quality thresholds or CI gates. YAML/JSON parsing, diff and format checks pass. All 47 strict case-loading tests pass. The live regression on `c653517` passed 8/8 cases. The stricter fixture also required updating the synthetic baseline in `shipped_rejection_cases_reject_extra_attempts_with_different_outcomes`; `5c9a3cd` supplies the complete fixed-name request and adds a negative Offering-ID-selector control, while retaining the extra-attempt rejection checks. The complete Harness library suite passes serially: 607/607, zero skipped. The initial default parallel local run hit six process/readiness timeout tests; the original timeouts were retained. All-target Harness Clippy passes with warnings denied. Full CI on `5c9a3cd` passes (40 successful checks), including the 8/8 live regression, core + Server-hooks shard, online memory regressions and CLI inventory/aggregates. Follow-up review covered both changed files (2/2, 100%, zero skips). ### Review follow-up: missing journal and complete inventory Commits `b56f26f7` and `94228684` address both new recovery findings: - Explicit close now ensures the owned journal row exists inside the canonical close transaction before recording finalization intent. A failed first bounded handoff can no longer produce a successfully closed session that recovery never discovers. The new database regression starts with committed canonical context and no journal, closes through `DatabaseSessionService`, reconstructs the store after restart, and recovers the final extraction and governance intent. - Finalization now uses a complete inventory mode in the shared HTTP typed-list implementation. It follows cursor pages under the existing ten-second read budget, accepts up to 4096 memories only with explicit pagination completion, and rejects overflow, invalid/missing/repeated cursor evidence, duplicate rows, and failed pages before freezing a plan. Ordinary typed recall retains its top-k behavior. Every page preserves the owner/session/type scope and the durable `main` branch. - HTTP regressions cover 501 rows, exact-bound completion, overflow, malformed pagination, repeated data, foreign ownership, and later-page failure. Database/HTTP regressions cover the final working receipt on either page and verify overflow leaves the plan unset, working memory retained, and maintenance pending without archive or delete calls. The new 501-row database regression also exposed a journal read defect: MatrixOne's default `CAST(state_json AS CHAR)` truncates at 65535 characters. All five journal read paths now decode the native JSON column via SQLx, with its JSON feature explicitly enabled. An additional database regression round-trips a large multibyte input through close, status, claim, fenced reload, and canonical recovery lookup. No schema change is required. Validation for this follow-up at `94228684`: - Local: all five isolated MatrixOne lifecycle regressions pass, including absent-journal close/restart and the large multibyte journal round-trip; formatting, diff checks, and all 47 schema inventory tests pass. The task-owned local database was removed afterward. - Exact-head CI: all eight added regression tests pass (four HTTP pagination tests, two durable runtime database tests, and two lifecycle database tests). Runtime offline tests, online core-runtime/core-services checks, and all six Static Checks jobs pass. - Full exact-head Test Suite: **28/28 jobs passed** ([run](https://github.com/matrixorigin/Astra/actions/runs/38672051447)). Static Checks: **6/6 jobs passed** ([run](https://github.com/matrixorigin/Astra/actions/runs/38672051457)). - The optional live harness first stopped in model-availability preflight with zero executed cases and a registered-but-inactive model. Attempt 2 is running (currently building Server/CLI/harness), with configuration and assertions unchanged ([run](https://github.com/matrixorigin/Astra/actions/runs/38672048150)). This optional lane is not yet verified as passing. - Incremental review covered all seven code/configuration files, zero skipped (100%); the memory design documentation was also reviewed and updated. ### Review follow-up: preserve confirmed working receipts Commit `a059246d` addresses [the stale-cleanup receipt review](#1005 (comment)). Before this fix, a cleanup read could replace a confirmed new working receipt with a stale ID from the first 16 backend rows. A successful deletion with a lost response could then leave completed extraction permanently unable to finalize. The typed-read adapter now preserves receipt identity once the current generation has prepared its working write. Pre-write observations can still update the previous generation's receipt, while frozen-plan reads retain their existing behavior. The fix reuses the existing durable write checkpoint; it adds no journal fields or alternate lifecycle. Two MatrixOne/loopback regressions exercise the canonical extraction writer and actual stale cleanup, acknowledged/lost delete responses, extraction settlement, owned explicit close, three restart-style claims, plan reconciliation, and final governance cleanup. The lost-response scenario places all 16 stale snapshots ahead of the confirmed hash-derived receipt in the backend list. The happy control uses one stale snapshot to stay within the existing one-second best-effort cleanup budget. Model inference uses the supported rule fallback, with no paid-provider dependency. Validation at `a059246d`: - Local runtime library/test compilation (`cargo check -p astra-runtime --lib --tests`), formatting, and diff checks pass. - [Online core-runtime](https://github.com/matrixorigin/Astra/actions/runs/38698235410/job/116299887310): **98/98 tests pass**, including both added close/restart regressions. The job log explicitly records each new test as PASS. - [Complete Test Suite](https://github.com/matrixorigin/Astra/actions/runs/38698235410): **28/28 jobs pass**, including CLI, integration, and macOS terminal checks. [Static Checks](https://github.com/matrixorigin/Astra/actions/runs/38698235321): **6/6 jobs pass**. - [Optional live harness](https://github.com/matrixorigin/Astra/actions/runs/38698232207) stopped during `glm-5.3` preflight, with zero executed cases; Server readiness and the DeepSeek status check succeeded. This lane is not passing, and its published diagnostics do not identify the underlying GLM failure. - Incremental review: 2/2 code files reviewed, zero skipped (100%); the memory design documentation was also reviewed and updated. ### Integration follow-up: latest main - Commit `a4bc6653` merges main `b091b23b` into this branch and resolves both harness conflicts without rewriting previous commits. - Preserve main's strict fixed-model admission policy, rejected/unexecuted result checks, no-child guarantee, and failure controls. Retain the configured-name versus Offering ID prompt distinction and extend the selector negative control to all three shipped model-rejection cases. Extra spawn attempts use a valid fixed-model request. - The Memoria durable finalization fixes, including confirmed working receipt preservation, remain intact. - Local validation on this commit: harness library **611/611 passed**; harness CI script suite **13 passed, 5 Linux-only skips** on macOS; runtime `cargo check -p astra-runtime --lib --tests`, workspace Rust formatting, and diff whitespace checks passed. - New GitHub CI is pending. Results recorded above apply to their explicitly identified earlier commits/runs. ### Diagnostic follow-up: child adoption failure reasons Commit `c683db37` follows a rebase onto latest main `45f56984` (including #1012). Existing Memoria changes are preserved. - The canonical child custody verifier now returns closed reason codes for failed conditions and unavailable evidence. The deterministic grader, semantic-evidence admission and safe progress projection share that verifier. Existing verdicts and failure classifications are preserved. - CI summaries distinguish child lifecycle/count, fanout group/slot/identity, repeated versus unsuccessful starts, model selection, result/digest consistency, parent finalization order, missing physical execution, and invalid or incomplete result windows. Public artifacts contain fixed codes only; no raw child results, arguments, identities, expected values, or provider error bodies. - The Python summary consumer validates the same 42-code vocabulary and rejects unknown codes, incompatible status/reason pairs, and additional payload fields. Existing progress records remain supported. - Validation on this exact commit: harness library **612/612 passed**, including **21 producer fault/control scenarios**; targeted harness Clippy with warnings denied passed; harness CI script tests **15 passed / 5 Linux-only skips** on macOS; workspace formatting and diff checks passed. - This adds diagnosis, not certification that the previous live fanout failure is fixed. A new normal PR CI run must reproduce or clear it with the more precise evidence. No performance gate or case acceptance criterion was changed. ### Rebase follow-up: main b95f234 - Rebased onto latest main `b95f2341` (#1013), resolving harness conflicts while preserving upstream explicit ID/title fanout selectors, pre-execution rejection handling, receipt-identity checks, and bounded tool-outcome diagnostics. Adapted the existing typed reason codes and fixtures to those canonical checks; the safe producer and consumer share 47 reason codes. - Confirmed the Memoria session-memory implementation is unchanged from the prior PR head. - Exact-head validation: harness library **614/614 passed**; targeted harness Clippy with warnings denied, workspace Rust formatting, and diff checks passed. Harness CI script tests: **15 passed / 5 Linux-only skips** on macOS. - New normal PR CI is pending; this update does not claim the live regression has passed. ### Review follow-up: close during a resumed admitted turn Commit `32f1149f` addresses [the latest P2 finding](#1005 (comment)). - Explicit close now reuses the existing Session-fenced execution-slot idle proof before preserving a prior generation's maintenance completion. An already-admitted follow-up invalidates the old plan even if its canonical watermark has not advanced. Late publication and canonical recovery remain discoverable through the existing journal and worker. - No new lifecycle state, schema, or migration. Idle repeated closes preserve stage receipts and completion; already-consolidated closed sessions continue rejecting new publications. - Added a real MatrixOne regression through actual Run admission, canonical writer reservation/commit, and the owned Session close service. It covers successful exit finalization, close before a resumed turn publishes/commits, rejection of early destructive work, normal late handoff and missed-handoff recovery after restart, final settlement, and repeated completed idle closes. - Local validation: integration-target compilation, targeted service library/integration-test Clippy with warnings denied, workspace formatting, and diff checks passed. The local database engine is unavailable, so database execution used the existing isolated MatrixOne CI lane. [Core-services job 116795821909](https://github.com/matrixorigin/Astra/actions/runs/38845746558/job/116795821909) passed **477/477**, with all **6/6 journal DB regressions** explicitly PASS, including `close_during_resumed_turn_recovers_after_prior_exit_finalization`. That regression exercised both normal late publication and missed-handoff canonical recovery, followed by completed repeated-close controls. Remaining PR checks are still running. ### Review follow-up: canonical settlement after terminal slot release Addresses [the remaining settlement-window review](#1005 (comment)). Terminal Run persistence releases the execution slot before canonical context commit. The shared memory idle check now also checks the coordinator's existing live writer/reservation expiry columns, using database time and current reads under the existing Session fence. Explicit close resets prior exit completion while either execution or canonical settlement remains outstanding; destructive checkpoints use the same guard. No new lifecycle state or schema is introduced. Repeated close after settlement still preserves receipts. The new `close_after_terminal_slot_release_waits_for_canonical_commit` database regression reproduces prior successful exit finalization followed by an admitted turn with a missed handoff, terminal status/slot release, close, then canonical commit. It asserts that the slot is empty and the old canonical watermark is still present before close, verifies pending work and rejection of early cleanup, then verifies restarted recovery through turn 2 and idempotent repeated close. The earlier occupied-slot cases now also commit terminal status before canonical context, matching production order. All cases additionally reject cleanup after commit while writer authority remains live. Validation at `0adda4c2`: - `cargo clippy -p astra-services --lib --test session_memory_lifecycle_db_it -- -D warnings`: passed (with the existing local debug-profile overrides). - `cargo fmt --all --check` and `git diff --check`: passed. - Local MatrixOne/Docker is unavailable. [Normal PR core-services CI](https://github.com/matrixorigin/Astra/actions/runs/38859768037/job/116839203868) passed **478/478 tests**, including `close_after_terminal_slot_release_waits_for_canonical_commit` and all **7/7 journal database cases**. This regression requires no live provider/model. Other CI checks are still running. ### Main rebase: preserve durable handoff and sole post-loop dispatch Rebased onto main `7375abe0`, retaining the merged runtime/storage latency improvements and sandbox fixes. The harness conflict resolutions preserve the existing typed child-proof diagnostics and fail-closed case without changing their content. Main now gives Server a sole detached post-loop memory-dispatch owner. The integration preserves that ownership while still publishing this PR's bounded durable input before terminal completion. Finalization always performs the bounded preparation, then defers dispatch when the host owns post-loop settlement. Skipping preparation together with dispatch would leave the post-loop worker without its durable input; dispatching in both places would undo main's ownership fix. The new ignored MatrixOne regression `post_loop_owner_preserves_durable_handoff_before_dispatch` calls actual turn finalization with the post-loop-owner host and a durable service. It requires the owner/session journal input and fingerprint to be persisted before return, while extraction remains unrequested and no memory backend write has occurred. Existing direct-dispatch and deferred-owner tests remain in place. Validation: `cargo check -p astra-runtime --lib --tests`, `cargo clippy -p astra-runtime --lib --tests -p astra-services --test session_memory_lifecycle_db_it -- -D warnings`, `cargo fmt --all --check` and `git diff --check` passed locally (using the existing local debug-profile overrides). The runtime database regressions share one test-only isolated-database guard module, preserving Clippy duplicate-module enforcement. Normal PR CI has restarted for `26271bdc`; the new database regression is not claimed as locally executed. ### CI follow-up: wait for canonical context after terminal settlement At `26271bdc`, ordinary unit-test shards and the three core online shards passed. [Integration CI](https://github.com/matrixorigin/Astra/actions/runs/38869788360/job/116871693438) ran 295 tests with 294 passing; `e2e_matrix_execution_handoff_resume_reaches_provider_http` observed canonical `completed_turn=0` while expecting 1. The failed online-core aggregate reflects that integration failure rather than additional failing test suites. Merged main #999 moved `run_settlement_finished` into the atomic terminal transaction, which precedes canonical context commit. The E2E test was still treating that event as a canonical-commit barrier. It now polls the actual owner/session context watermark under a 15-second deadline before retaining the original exact-turn assertion. A missing commit still fails by timeout and an unexpected higher turn still fails the assertion. No product acceptance condition is weakened. Validation at `40cbadd5`: `cargo clippy -p astra-runtime --features e2e-hooks --test system_matrix_http_e2e -- -D warnings`, `cargo fmt --all --check` and `git diff --check` passed (using the existing local debug-profile overrides). [The normal PR integration rerun](https://github.com/matrixorigin/Astra/actions/runs/38874422974/job/116886451691) passed **295/295 tests**, with an explicit PASS for `e2e_matrix_execution_handoff_resume_reaches_provider_http`. Baseline memory regression evidence at `26271bdc`: [core-services 481/481](https://github.com/matrixorigin/Astra/actions/runs/38869788360/job/116871693462), including the terminal-slot-release regression, and [core-runtime 104/104](https://github.com/matrixorigin/Astra/actions/runs/38869788360/job/116871693406), including the pre-terminal durable-handoff/post-loop-dispatch regression. The separate [optional live harness run](https://github.com/matrixorigin/Astra/actions/runs/38869785427/job/116871492386) completed 8 cases, 7 passing. Its failed fanout case passed root exit, successful fanout-tool count, two-child count and child-adoption proof; its hard semantic judge reported `assessment=unavailable` / `InfraVerificationUnavailable`. Model preflight passed. The retained safe artifact does not distinguish input preparation, judge invocation or response-parsing errors, so it does not establish a model-quality failure. No model selection, grading threshold or fail-closed behavior is changed by this test synchronization fix. Current-head CI follow-up: [optional live harness run 38874421050](https://github.com/matrixorigin/Astra/actions/runs/38874421050) completed **8/8 passed**, with no failed, cancelled or unavailable cases. The prior unavailable semantic assessment did not recur. No grading or model change was required for this rerun. Integration passed **295/295**, including the original failing recovery case; all test and static-check workflows have passed. Approved-by: XuPeng-SH <[email protected]>
Summary
Reduce database work for shared run status and active control observations across CLI/Edge and Server.
Related issue
Follow-up to #1012. This milestone reduces reads; it does not reduce retained rows or finish every session-storage optimization.
Change type
User and compatibility impact
No product command, response, configuration, database schema or migration change. Status preserves earliest binding precedence and latest-finalized accounting precedence, including selected/unselected corruption behavior. The metadata and event reads retain their existing non-atomic semantics. Recovery still loads the stored checkpoint. The harness criterion is now
fanout_group: {kind: id|title, value: ...}; all five repository cases are updated, and scalar strings are deliberately not supported. A title is independent of an ID. Canonically matching receipts remain ambiguous even when their request metadata differs. Missing identity evidence is unavailable; known contradictions fail the proof.Control reads trade a short collection window for fewer requests. Overload and storage failures remain errors; observations never grant execution authority. Existing lease renewal, provider/action fences, generation checks and ancestor controls retain their owners.
Architecture and complexity delta
Verification
cargo fmt --all -- --check,git diff --check: pass.EXPLAIN ANALYZE FORCE EXECUTE; one request scans one base row, 128 mixed positional requests scan two matching base rows. Duplicate, missing, wrong-owner and case-variant semantics match point reads. The same new test linked to the verified pre-fix production library fails at the physical-work assertion: one lookup scans 528 rows.57feddc34: 1/1 passed, 35.847 seconds including capture/judging (root duration 25.841 seconds). One real launch, two real children, structural identity/adoption proof and the unchanged hard LLM judge all pass. Root provider usage coverage is 5/5; its reported cache read is 47,744 tokens. The unaffected cache/recovered-validation journeys reuse prior29dfbd666evidence; they are not claimed as three new runs. Harness exit is zero, the published summary is complete/successful, and the isolated owned Server exited.Case::from_path. Six counterfactual probes against an unchanged real execution archive, using the current typed criterion, produce the expected results: title, independent explicit ID/title and generated-ID selection pass; contradictory or empty IDs fail; missing projections remain verification-unavailable. This is archive replay, not a new model run.startedplus guidance, and opaque executed failure do not pass. Existing replay ambiguity is unchanged. The same rejected-call counterexample fails on pre-fix57feddc34. These are deterministic evidence-boundary tests, not new provider trials. The existing fixture exercises ten rejection/failure rows with both ID and title selectors while retaining every call for other consumers.gpt-6.1-sol/xhighdesign and final overall review accepted the final source committed asaef8ffada(whole-PR fingerprint79169105d12646f33daae707b1273f635c28340822fe77c5df94f3e881ce5f88):accepted=true,validation_complete=true, no unresolved material blockers. Review reconciles unchanged DB/runtime/live evidence with the rejection correction, new counterexamples, static analysis and actual race checks.Unchanged status-method A/B evidence: 1,000 identities, 100 owners, 32 connections, one/four independent pools and three alternating pairs; median wall time decreased 40.4–51.1%. These are independent pools, not four Server processes. Historical status-milestone live CI ran 8/8 cases; it is not eight cases rerun against the final correction.
Limits
Candidate-row scan reduction is distinct from physical bytes, index work and latency. Lease renewals, event writes, inference/tool accounting, ancestor reads and durable attachment polling remain separate costs. No deployment-wide QPS, retained-storage reduction or 1,000-full-loop capacity claim. The pre-rejection-fix head
57feddc34completed remote CI without a failed check, including the optional live harness. That evidence and its fresh local fanout run remain applicable to unchanged positive execution paths; the current rejection correction has new deterministic checks and race validation, not a new provider trial. Replacement-head CI remains pending. This does not claim to fix provider/judge availability.CI failure diagnostics
The
aef8ffadalive CI run completed 7/8. The unavailable-child-model negative control observed one rejected request and zero children, but its expected result status/error category did not match. Its safe artifact retained only predicate counts, so the actual historical rejection category cannot be recovered or attributed to a schema/model/runtime defect from that artifact.The current change adds bounded observations to the existing tool-count diagnostic: canonical disposition and success, recognized body status/error category, explicit execution fact, counts and omitted calls. Unknown strings become
other; raw tool arguments, result bodies and error prose stay private. The final summary step now prints failed-case analysis to the job console as well as Markdown/JSON. Attribution is qualified by the captured facts; criteria, thresholds and runtime admission are unchanged.Validation for this diagnostic change: all 614 harness unit tests, all 17 manual-harness Python tests, warnings-denied all-target Clippy, formatting and diff checks passed. Public Rust evaluator/observer → actual Python summary replay verifies the unchanged real archive passes, a controlled argument rejection fails with useful printed attribution, and an unknown secret-shaped tag fails without leaking its value across console, Markdown, JSON or safe progress. This controlled replay reproduces the CI predicate pattern, not its unobserved historical cause.
gpt-6.1-sol / xhighindependently reviewed the six-file correction.Before the diagnostic edit, fresh clean
aef8ffadabinaries ran the original missing-model case nine times across fresh local databases: 9/9 passed withinvalid_request / model_selection_invalid, no child execution. The full unchanged CI list passed locally 8/8 in 115.575 seconds; a bounded six-repeat diagnostic passed 6/6 in 61.991 seconds. These results do not resolve the historical CI discrepancy or replace replacement-head CI.This correction is net +292 physical lines: implementation +118, tests +167, documentation +7. Whole-PR totals are implementation +524, tests +1,301, documentation +44 (net +1,869), with no case-configuration net increase. No runtime/store/schema change or additional database/provider call is introduced by the diagnostic projection. The pre-diagnostic head still has the known failed live check; replacement-head CI is pending, not claimed green.
Final checklist