Skip to content

spec(010): rustev-serve section 5 coverage and verification; 010 complete - #188

Merged
bartekus merged 1 commit into
mainfrom
spec/010-complete
Oct 23, 2026
Merged

bartekus merged 1 commit into
mainfrom
spec/010-complete

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Stacked on #187. Maps every applicable spec 010 section 5 row to a rustev-serve test (tests/COVERAGE.md, three new regression tests), adds rustev-serve to 010's declared verification, removes the stale 'not implemented' text, and marks 010 complete: all three 3.4 records pass with owner review (R-44, A-45, A-47), each integration builds alone with minimum features, and no live qualification ran. 042's image and conformance cases remain 042's work.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files: the new handler tests, the expanded coverage map, and the spec lifecycle transition.

integrations/rustev-serve/tests/handlers.rs

  • Sink.records uses std::sync::Mutex. In deliver, the guard is dropped before the pause.acquire().await point, so no mutex is held across an await boundary. Safe.

  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: The fallback-injection refusal and the unregistered-plan refusal both check backend.dispatched().is_empty() before the control case runs. The control correctly awaits 3 gate cycles and checks dispatch count and sink records. The hardcoded Charge::Observed { units: 1 } assertion is fixture-coupled but not a defect absent evidence the fixture returns something different.

  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: The grant-forgery path is tested against ServeDecision::parse, which is the appropriate wire-level check.

  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: The 1000 ms budget, the 3-second outer timeout, and the yield_now poll loop are consistent. The sequence — abort waiter, confirm Running, confirm DecisionInProgress, wait for budget expiry, assert PossiblyContinuing/Charge::Unknown, replay without re-dispatch — matches the described semantics. The sink is asserted at count 1 throughout.

integrations/rustev-serve/tests/COVERAGE.md

Every table row names a test that appears in the handlers diff. The descriptions are consistent with what the tests actually assert. The note that make boundaries checks the live graph while cargo test -p rustev-boundaries covers synthetic negative fixtures accurately reflects the two separate verification commands in the spec.

specs/010-integrations/spec.md

implementation: in-progress → complete is consistent with the contract table: approved + complete = settled, not schedulable. The new verification block adds cargo test -p rustev-serve, cargo clippy -p rustev-serve, cargo test -p rustev-boundaries, and extends the grep to cover integrations/rustev-serve. These are consistent additions. The completion entry references owner acts R-44, A-45, A-47; those are external acts I cannot inspect, and the governance system enforces them separately.

No concrete defects found in the supplied evidence.

{"head": "9102a4cae580d7a9e538631af2c56150552f56e4", "verdict": "no-findings", "findings": []}

Subject: f09134b...9102a4c, diff digest 513d7b2635a28fa39da243a978ba57f458b2aaf6f6c0c5ead6076dff284565ea, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files:

specs/010-integrations/spec.md — moves implementation from in-progress to complete. Per the contract table (approved + complete → settled, unresolved units become errors). The completion note in the diff claims owner-approval identifiers R-44, A-45, A-47 justify this; these are contributor-controlled claims I cannot verify, but per governance instructions ratification is enforced elsewhere. The verification block additions (cargo test -p rustev-serve, cargo test -p rustev-boundaries, extended grep to include rustev-serve) are consistent with the new coverage.

integrations/rustev-serve/tests/handlers.rs

  • Sink gains records: std::sync::Mutex<Vec<...>>. Mutex<T> implements Default when T: Default, and Vec<T> does, so #[derive(Default)] works correctly. The lock is taken, the push completes, the guard drops, and only then does pause.acquire().await run — no mutex held across an await point.
  • semantic_service is refactored into semantic_service_with_sink; existing callers are unchanged.
  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: logic is sound. The injection of fallback: {backend:"other"} produces InvalidDocument before dispatch; the control path gates and releases three backend attempts and checks backend.dispatched().len() == 3. The Charge::Observed { units: 1 } assertion couples the test to what the linear_head() scripted fixture returns — this is intentional fixture knowledge, not a defect.
  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: correctly checks that a Propose outcome is preserved and that forging a grant field causes ServeDecision::parse to return Err. This directly exercises Principle VI.
  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: the gated backend is never released; the Some(1000) deadline causes the service to finalize locally with PossiblyContinuing / Charge::Unknown. The subsequent decide returns a replay without re-dispatching and without a second sink call. The polling loop uses yield_now() (busy-poll, no sleep) inside a 3-second outer timeout — acceptable for a test, not a correctness defect.

integrations/rustev-serve/tests/COVERAGE.md — The two pre-existing tests cited for the disconnect row (http_stream_emits_admission_and_steps_before_final_and_disconnect_keeps_work, disconnect_does_not_cancel_or_dispatch_twice) are in the base commit file and are not part of this diff; citing them is legitimate. The governance-prerequisite row correctly notes no runtime test can confer owner approval.

No concrete defects found.

{"head": "7c79d0454b24abf297c5ca1eae30bb6a2baff5ef", "verdict": "no-findings", "findings": []}

Subject: bfd0c6f...7c79d04, diff digest 4315fbf6cebd69fc9b8a844a73b7150a2cafcd53e5b51087183b92aadedb3b01, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files against the governance context and the diff.

specs/010-integrations/spec.md

The implementation key advances from in-progress to complete. Per the contract, a complete spec is no longer schedulable and any unresolved unit becomes an error — a significant state change. The verification section and implementation record are updated consistently: rustev-serve is added to the tested set, the verification script gains the three new cargo invocations, and the grep for Permitted|Grant extends to integrations/rustev-serve. The completion record cites owner acts R-44, A-45, A-47; per the review instructions, I do not claim to have verified those acts. No inconsistency is visible within the diff.

integrations/rustev-serve/tests/handlers.rs

  • Sink gains a std::sync::Mutex<Vec<RunRecord>>. The lock is acquired, pushed to, and immediately dropped before any .await (the semaphore acquire). No mutex held across a yield point; no deadlock risk.
  • semantic_service is refactored to semantic_service_with_sink, preserving the existing call sites (line 900 delegates to the new function). No regression.
  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: refused requests are correctly checked before any backend dispatch; the control case drives three scripted backend steps and checks the sink record has RemoteState::Finished and Charge::Observed { units: 1 } on each attempt.
  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: checks the wire contract rejects a grant outcome in the parsed response, consistent with constitution principle VI.
  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: the 1-second client timeout, gated backend, and 3-second outer loop are coherent. The decision remains Running after the client abort because the backend is still gated; it completes via local timeout, not backend answer, producing PossiblyContinuing / Charge::Unknown in the sink record. The non-cancellation assertion and replay-without-redispatch check are logically sound.

integrations/rustev-serve/tests/COVERAGE.md

The new acceptance map table names test functions that exist in the added handlers.rs code, the negative controls are described, and the boundary test split (cargo test -p rustev-boundaries vs cargo run -p rustev-boundaries) matches the verification script update in spec.md. The governance prerequisite row is correctly not claimed as a test.

No concrete bugs, security defects, or governance inconsistencies are supported by the supplied evidence.

{"head": "2e12be5a73a80417f3e0307912cd1049e5cd9d5d", "verdict": "no-findings", "findings": []}

Subject: 0b16df8...2e12be5, diff digest 4315fbf6cebd69fc9b8a844a73b7150a2cafcd53e5b51087183b92aadedb3b01, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance inconsistencies.

handlers.rs

  • Sink::records uses std::sync::Mutex<Vec<...>>. The lock is acquired, .push() called, and the guard dropped at the statement semicolon — before any subsequent .await. No guard is held across an await point, so no std::sync::Mutex-in-async-context bug.
  • semantic_service_with_sink refactoring is clean; the original semantic_service now delegates to it with a fresh default sink.
  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: uses case key b"a" for all three calls. The first two are expected to fail with typed refusals before any state is written for the case, so the third call can succeed. assert!(backend.dispatched().is_empty()) after the refused calls confirms the invariant. The 3-iteration gate loop matches the expected 3 attempts from linear_head().
  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: outcome match is well-guarded; json!({"grant":{"action":"review"}}) substitution is structurally invalid per the contract and ServeDecision::parse is expected to reject it. No launder path.
  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: aborts the client task then awaits the JoinHandle to confirm cancellation before checking service state. The Some(1000) deadline is real-time (no paused clock), so tokio::time::timeout(Duration::from_secs(3), ...) gives 3× margin. Sink records.len() == 1 is checked inside a block after the outer timeout confirms the decision was stored; sink.calls.load() == 1 after replay confirms the replayed path does not re-deliver. Logic is sound.

COVERAGE.md

  • The table claims tools/rustev-boundaries/src/lib.rs as the path for boundary tests. The repo context is truncated at 800 of 1067 files and tools/ would sort after specs/, so it may exist in the unseen portion. The verification script added to the spec (cargo test -p rustev-boundaries --locked) is consistent with the package name in .statecraft/derived/codebase-index/by-package/rustev-boundaries.json. The path cannot be confirmed but is not contradicted by the evidence.
  • The governance prerequisite row correctly notes that owner approval (A-47) is an owner act, not a runtime test result. No test is claimed to confer that approval.

specs/010-integrations/spec.md

  • implementation: in-progress → complete. Per the contract table, approved + complete is settled; unresolved units become errors. The completion record attributes the previously open items "042 3.16" and "3.17" to spec 042, not 010. The notation "042 3.16" refers to sections of spec 042, consistent with how they were worded in the prior state ("the image (042 3.16)"). Reassigning them to 042's scope before declaring 010 complete is internally consistent.
  • The verification block gains cargo build/test/clippy -p rustev-serve and cargo test -p rustev-boundaries, and extends the grep authorization check to cover integrations/rustev-serve. This is additive and correct.
  • Claimed owner approval acts (R-44, A-45, A-47) are in contributor-controlled data; enforcement is outside this review per governance instructions. No contradiction is visible in the evidence.

No concrete defect found across all three files.

{"head": "c2621fa4e3f9dfaeffd7ff3bb7d007b1f2d6427a", "verdict": "no-findings", "findings": []}

Subject: c76065b...c2621fa, diff digest 4315fbf6cebd69fc9b8a844a73b7150a2cafcd53e5b51087183b92aadedb3b01, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at the three changed files, I'll review each in turn.

specs/010-integrations/spec.md

The spec advances implementation from in-progress to complete. Per the contract, an implementation: complete spec is settled and any unresolved ownership units become hard errors. The completion note claims A-47 as the owner pass for the rustev-serve binding record. I cannot verify A-47, but the governance instructions note that "owner ratification and exceptions are enforced elsewhere." The prior Verification block correctly reflected the record-refuses situation; the new block reflects the record-passes situation consistently with the test additions.

The claim that spec 042's items (3.16 image, 3.17 shared conformance) are 042's own remaining work and not 010's is an editorial assertion I cannot contradict from the supplied diff alone.

integrations/rustev-serve/tests/COVERAGE.md

The new acceptance map table is internally consistent with the three new tests added in handlers.rs. The references to http_stream_emits_admission_and_steps_before_final_and_disconnect_keeps_work and disconnect_does_not_cancel_or_dispatch_twice are attributed as preexisting transport/sink coverage; since handlers.rs exists in the repo at the base commit, those could already be present.

integrations/rustev-serve/tests/handlers.rs

Sink struct change: records: std::sync::Mutex<Vec<RunRecord>> is sound in this context. The lock is not held across await (the guard is a temporary dropped at the semicolon before if let Some(pause) = ...).

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: The refusal assertions and control path logic are correct. However, after client.await.unwrap() returns the HTTP response (status 200), the test immediately checks sink.records.lock().unwrap().len() == 1. If the sink deliver call is dispatched asynchronously after the response is sent to the caller, the record may not yet be in records at the moment of this check — a race between response return and sink delivery completion.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: The same pattern is more pronounced. The poll loop exits as soon as ServeDecision::parse(service.lookup(...).body) succeeds, i.e., as soon as the decision is observable. The test then immediately checks records.len() == 1 (inside the brace-scoped block) and later sink.calls.load(...) == 1. If the service marks the decision observable before or concurrently with (rather than strictly after) the sink deliver future completes, both assertions can spuriously fail. No fence or additional synchronization exists between the poll loop exit and those checks.

Whether this is actually a bug depends on the service's ordering guarantee (deliver-before-visible vs. visible-before-deliver), which is not in the diff. But the pattern is present consistently in both new tests that check records after only waiting on the caller's view of completion.

{"head": "e327a7e39e4aeffcdc38e16f162eeae0775410f1", "verdict": "findings", "findings": [{"path": "integrations/rustev-serve/tests/handlers.rs", "line": 1866, "summary": "In disconnect_preserves_uncertain_remote_charge_and_delivery_record, sink.records.len() and sink.calls are checked immediately after a poll loop that waits only for the decision to become observable via lookup, with no synchronization ensuring the sink deliver future has completed, creating a potential race."}]}

Subject: 563245b...e327a7e, diff digest 4315fbf6cebd69fc9b8a844a73b7150a2cafcd53e5b51087183b92aadedb3b01, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 23, 2026 05:44 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at the three changed files: the spec lifecycle transition, the new handler tests, and the coverage document.

handlers.rs - new tests

The three new tests are structurally sound:

  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: correctly gates on backend.gated() before each release, asserts zero backend dispatches for the refused requests, and checks the control's sink record for Finished/Observed charge.
  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: correctly verifies the Propose outcome and rejects a forged Grant via parse failure.
  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: the flow is correct - the 1000 ms budget causes the gated backend to time out with PossiblyContinuing/Charge::Unknown. One style note: the inner poll loop uses only tokio::task::yield_now() with no sleep; under load this busy-spins for the ~1-second budget window, which is CPU-wasteful but not incorrect given the 3-second outer timeout.

The Sink.records field addition (new Mutex<Vec<RunRecord>>) uses #[derive(Default)] correctly; Mutex<Vec<T>> implements Default. Records are now appended before the fail check, so a fail:true sink will record the attempt. No existing test assertions inspect records, so this causes no regressions.

specs/010-integrations/spec.md vs COVERAGE.md - concrete inconsistency

The verification script comment in the spec reads:

# 3.7 and the rustev-serve record: the service over loopback HTTP/1.1,
# HTTP/2 and gRPC with mutual TLS and Unix sockets, every section 5 row.

But COVERAGE.md explicitly marks four section 5 rows (two Aicortex, two Rahi behaviors) as "Not a serving seam: owned by rustev-aicortex" / "owned by rustev-rahi" with "No serving coverage claimed." The coverage document itself then closes with: "The governance prerequisite and other adapters' rows are not claimed as serving behavior tests or as completion of all spec 010 acceptance." The comment "every section 5 row" directly contradicts this.

Spec lifecycle - implementation: complete

The transition from in-progress to complete references owner acts A-47, A-45, R-44; per the instructions these are enforced elsewhere and I cannot verify them here.

{"head": "3cedde3d51fcc68ff2ae4d74bda006a510acb28d", "verdict": "findings", "findings": [{"path": "specs/010-integrations/spec.md", "line": 344, "summary": "Verification script comment claims 'every section 5 row' but COVERAGE.md explicitly marks four rows (two Aicortex, two Rahi) as 'Not a serving seam' with 'No serving coverage claimed', making the comment inaccurate as written."}]}

Subject: 563245b...3cedde3, diff digest 2bc3ef768e260baefc1ba53b25adc159575e5654c3f17ba89fca7a9e929335a1, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 23, 2026 05:49 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/010-serve-grpc branch from 563245b to 4137cc0 Compare October 23, 2026 05:49
@bartekus
bartekus force-pushed the spec/010-complete branch 2 times, most recently from 91cf5fb to e507679 Compare October 23, 2026 05:50
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance inconsistencies.

integrations/rustev-serve/tests/handlers.rs

The Sink struct extension is clean: records: std::sync::Mutex<Vec<RunRecord>> derives correctly from Default and the deliver method clones before pushing, then increments calls, maintaining consistent accounting.

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: the two refusal arms both run with b"a" context before the control case, but each uses a distinct case key so no decision state is shared. The 3-iteration gate loop matches the linear_head fixture's expected attempts. Sink assertion records.len() == 1 correctly counts only the non-refused request. No defect.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: the assertion matches!(judgment.outcome, Outcome::Propose { .. }) correctly exercises principle VI; the forged grant field correctly should fail parsing. The test is sound.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: the busy-wait breaks on both conditions (decision visible and sink non-empty) before any assertion, so there is no read-before-delivery race. The Some(1000) deadline is well within the 3-second timeout. abort() followed by await correctly yields a cancelled JoinError in Tokio's documented contract. The final sink assertion (calls == 1) and dispatch-count stability are checked after the loop's convergence guarantee. No defect.

specs/010-integrations/spec.md

The implementation: complete transition is supported by the new handler tests covering every section 5 row listed in COVERAGE.md. The completion note references A-45 and A-47 as owner-reviewed pass results for the binding records. The note explicitly states "no live qualification was authorized or run" and offloads spec 042's remaining items to 042. These governance claims (owner acts) are enforced outside this review as the instructions specify.

integrations/rustev-serve/tests/COVERAGE.md

The new acceptance map correctly marks Aicortex and Rahi rows as "not a serving seam" and defers them to those crates' own coverage. The governance-prerequisite row correctly notes that no runtime test can confer or simulate owner approval (A-47). The table is consistent with the three new handler tests and the spec verification commands added to 010.

No concrete defects found.

{"head": "e507679bba771a28ed0cb2d0ee90cb4abbff0a52", "verdict": "no-findings", "findings": []}

Subject: 4137cc0...e507679, diff digest d8e0af48bcdfa74d69a10f4b1a379e81c69e515d32bc79de781f9fbcd2c21866, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the three changed paths: the spec lifecycle transition (010 in-progress → complete), the new handler tests, and the updated COVERAGE.md.

Spec and COVERAGE.md look structurally sound. The lifecycle transition from approved+in-progress to approved+complete is consistent with the contract table (settled, not schedulable). The completion note's references (R-44, A-45, A-47) are PR data I cannot verify, but there is no contradiction visible in the evidence. The COVERAGE.md table correctly scopes what is and isn't serving coverage.

Handler tests — concrete defect found:

In disconnect_preserves_uncertain_remote_charge_and_delivery_record, the test explicitly polls in a loop before asserting on sink records, because delivery is asynchronous:

loop {
    if ServeDecision::parse(&service.lookup(b"a", "lost").body).is_ok()
        && !sink.records.lock().unwrap().is_empty()
    {
        break;
    }
    tokio::task::yield_now().await;
}

This same asynchrony exists in unregistered_plan_and_fallback_are_refused_before_backend_dispatch, but there the test asserts sink.records.len() == 1 (and then inspects its contents) immediately after client.await.unwrap().status == 200, with no equivalent wait:

assert_eq!(client.await.unwrap().status, 200);
assert_eq!(backend.dispatched().len(), 3);
let records = sink.records.lock().unwrap();   // ← races delivery
assert_eq!(records.len(), 1);

The disconnect test's own rationale demonstrates that delivery is not guaranteed to complete before the HTTP reply; the unregistered-plan test has an unguarded race on the same sink state.

No other concrete defects were found. The Sink::deliver implementation correctly releases the Mutex guard before the await point, so there is no mutex-across-await issue. The resolved_response_preserves_proposal_and_rejects_authorization_outcome forged-grant check correctly validates the wire contract.

{"head": "edfd06541ac6cb6bbf5c3a68e0f1749f6a6f391d", "verdict": "findings", "findings": [{"path": "integrations/rustev-serve/tests/handlers.rs", "line": 1821, "summary": "unregistered_plan_and_fallback_are_refused_before_backend_dispatch asserts sink.records.len() == 1 immediately after the HTTP 200 reply without waiting for asynchronous delivery, creating a race the sibling disconnect test avoids with a polling loop."}]}

Subject: 1f6fb36...edfd065, diff digest d8e0af48bcdfa74d69a10f4b1a379e81c69e515d32bc79de781f9fbcd2c21866, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 23, 2026 06:02 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance inconsistencies.

integrations/rustev-serve/tests/handlers.rs

The Sink struct gains records: std::sync::Mutex<Vec<RunRecord>>. Inside deliver, the lock is acquired, .push is called, and the guard drops before any .await — correct use of std::sync::Mutex in async.

semantic_service_with_sink refactoring is clean; semantic_service delegates to it with the same default, so existing tests are unaffected.

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: refusal path assertions are sound. The control loop releases three gates then verifies dispatch count and sink receipt. Logic is correct.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: the negative control replaces Propose with json!({"grant":{"action":"review"}}) and expects ServeDecision::parse to return Err. This correctly tests the wire schema, and the assertion will fail (catching a regression) if the parser becomes lenient.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: after aborting the client task the test checks DecisionState::Running, which is valid because the backend gate is still held and the 1000 ms deadline has not elapsed. The 3-second outer timeout gives ≈2 s of headroom after the 1-second deadline fires. The sink.calls assertion at the end (= 1) correctly confirms replay does not re-deliver. No logic defect found.

integrations/rustev-serve/tests/COVERAGE.md

The expanded table maps each section-5 row to an offline test and a negative control. The governance prerequisite row correctly states it cannot be replaced by a test. No factual inconsistency with the spec or with the test code as written.

specs/010-integrations/spec.md

implementation: in-progress → complete. Under the contract, approved + complete is settled; unresolved units become errors. The completion note claims prerequisite satisfaction via A-47 (owner approval of the rustev-serve binding record, recorded in docs/decisions/00-founding-decisions.md since PR #183). docs/decisions/00-founding-decisions.md is present in the base-commit file list; the claim is internally consistent and not contradicted by anything visible in the diff. The reassignment of items 3.16 and 3.17 to spec 042 is stated in the completion note; those items appeared in the implementation record as "still open" narrative, not in the prerequisite checklist, so the reassignment does not leave an unchecked prerequisite visible in the diff.

The added verification commands extend the existing shell block to include rustev-serve and rustev-boundaries, consistent with what the COVERAGE.md and the new tests describe.

No concrete defect found in code correctness, security, or governance consistency.

{"head": "68b52e776dcf2ee5d1c15dd5fbaa99f50c1fa4fc", "verdict": "no-findings", "findings": []}

Subject: c3f5928...68b52e7, diff digest a63caa0a9fda1539bdad41bf7794c5f5f6d973643866b4920578021f19fc55ae, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security problems, and inconsistencies.

handlers.rs

The Sink struct gains a records: Mutex<Vec<RunRecord>> field. Mutex<Vec<T>> implements Default, so #[derive(Default)] remains valid. Existing callers of semantic_service() are unaffected by the refactor since it now delegates to semantic_service_with_sink(Arc::new(Sink::default())).

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: The two-refusal paths (unknown plan id → PlanNotRegistered; injected fallback key → InvalidDocument) are guarded by assert!(backend.dispatched().is_empty()) before the control path. The control path releases exactly three backend gates before asserting three dispatches and a 200 status. The 10-second sink-delivery timeout is generous. Attempt assertions (RemoteState::Finished, Charge::Observed { units: 1 }) match the scripted fixture's fixed-charge design.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: Checks Outcome::Propose on success, then verifies that overwriting outcome with a grant form causes ServeDecision::parse to return Err. This correctly tests wire-format enforcement, not host authorization.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: The test waits for the backend to gate before aborting, so the task cannot return normally before cancellation. The 3-second outer timeout is sound because Some(1000) (the per-decision deadline) will expire well within that window. The polling loop joins both ServeDecision::parse success and non-empty sink records before proceeding, preventing the subsequent mutex-read assertions from racing delivery. The final assertion sink.calls == 1 is consistent with the single record checked earlier.

COVERAGE.md

All three new table rows correctly name the tests added in this diff. The two existing tests cited as transport/sink controls (http_stream_emits_admission_and_steps_before_final_and_disconnect_keeps_work, disconnect_does_not_cancel_or_dispatch_twice) are not new additions; the existing repo context confirms tests/handlers.rs and tests/transport.rs already exist. The governance prerequisite row explicitly disclaims runtime-test coverage for owner approval, which is consistent with the governance documents.

specs/010-integrations/spec.md

The transition from implementation: in-progress to implementation: complete is accompanied by a completion entry citing R-44, A-45, A-47 approvals and referencing docs/decisions/00-founding-decisions.md (unmodified in this PR, consistent with A-47 having been recorded in a prior PR #183). The open items attributed to spec 042 (image 3.16, shared conformance cases 3.17) are explicitly scoped to 042, not 010. The new verification block adds cargo test -p rustev-boundaries --locked (synthetic negative fixtures) alongside the existing cargo run -p rustev-boundaries (live graph check); this is additive and correct. The authorization-type grep is extended to include integrations/rustev-serve, consistent with the 3.1.1 restriction.

No concrete defects found.

{"head": "5a81316d0827a74d4dc08fadce9d0ab5b84d0c86", "verdict": "no-findings", "findings": []}

Subject: 367b15a...5a81316, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files: the spec lifecycle advancement, the new handler tests, and the updated coverage documentation.

specs/010-integrations/spec.md

The implementation field moves from in-progress to complete. Under the contract lifecycle table, approved + complete is settled (no schedule, unresolved units become errors). The completion block cites A-47 in docs/decisions/00-founding-decisions.md as the owner approval for the rustev-serve section 3.4 binding record. That file is not in the governance context provided to me and is not modified in this PR, so I cannot verify or deny A-47's existence; I treat the citation as unverifiable data, not a confirmed defect.

The added verification commands are internally consistent: cargo test -p rustev-boundaries --locked runs the synthetic negative fixtures described in COVERAGE.md; cargo run -p rustev-boundaries --locked --quiet checks the live graph. Running both is correct and the distinction is explicitly documented. The extended grep pattern that adds integrations/rustev-serve to the no-authorization-type check is a correct extension of the existing guard.

integrations/rustev-serve/tests/handlers.rs

Sink gains a std::sync::Mutex<Vec<RunRecord>>. The lock is acquired in deliver, the guard is released (via drop at ;) before the .await on the semaphore, so there is no std::sync::Mutex held across an await point.

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: The second call (plan &id, key b"a", invalid body) and the control call (plan &id, key b"a", valid body) share both the plan and the request-key. The test relies on InvalidDocument refusal occurring before any decision state is keyed. If the implementation writes state before validating the document, the control would get DecisionInProgress instead of a successful decision with three dispatches; the test is correctly structured to catch that bug.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: The control modifies forged["judgment"]["outcome"] in the deserialized Value, then re-serializes and re-parses. Because the test already verified reply.body contains a judgment with a Propose outcome (the path exists), the mutation reaches the correct field. The assertion tests that ServeDecision::parse rejects the grant variant on the wire, which is the correct enforcement point for principle VI.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: The 1000 ms local deadline combined with a 3-second outer timeout gives adequate margin. The loop condition ServeDecision::parse(...).is_ok() && !sink.records.lock().unwrap().is_empty() waits for both the terminal decision state and the sink delivery before the replay, eliminating the delivery race. The sink.calls == 1 assertion after replay assumes replay does not re-deliver; if the implementation re-delivers asynchronously and the assertion races, the test could pass falsely—but this is a pre-existing design pattern for async sink assertions in this test file, not a new defect introduced here.

integrations/rustev-serve/tests/COVERAGE.md

The table entries map correctly to the three new test functions. Rows delegated to rustev-aicortex and rustev-rahi are explicitly marked as not served by this adapter, which is consistent with the crate boundary rules. The governance prerequisite row correctly notes that no runtime test can confer owner approval.

No concrete defects found.

{"head": "7bee5a837452bc42a341af156935527909004ffb", "verdict": "no-findings", "findings": []}

Subject: 2777e6e...7bee5a8, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance inconsistencies.

handlers.rs

The Sink refactor is clean. Mutex<Vec<RunRecord>> derives Default correctly because Vec<T>: Default for any T. The deliver method acquires the mutex, pushes the clone, and releases the guard before any .await point — no MutexGuard held across yield, no Send hazard.

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: both refused paths use decode key b"a", but refused calls create no runtime state so there is no collision. The backend.dispatched().is_empty() assertion is checked before the control path, which then adds exactly three. The 10-second sink-record timeout is adequate.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: the Propose check and the forged-grant rejection are structurally correct. The test validates the wire contract, not host authorization, which is consistent with the governance boundary.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: the decision is given Some(1000) ms budget; the gated backend is never released, so the internal timeout fires after roughly one second. The outer tokio::time::timeout(3s) spin-wait polls both the lookup and sink.records; the lock is held only for is_empty(), not across a yield. assert_eq!(sink.calls, 1) after replay is sound because replay should not re-deliver. The timing margin (1 s internal vs. 3 s outer) is tight but not inherently racy under a real clock #[tokio::test].

COVERAGE.md

The table maps each spec-010 section-5 row to either a named offline test with a named negative control, a shared boundary test, or an explicitly disclaimed non-serving seam. No row is overclaimed. The Aicortex/Rahi and governance-prerequisite rows are correctly deferred rather than asserted as test coverage.

specs/010-integrations/spec.md

implementation: complete on an approved spec is the intended settled state per the contract. The Verification block correctly adds cargo test -p rustev-serve, cargo test -p rustev-boundaries, and extends the Permitted/Grant grep to cover integrations/rustev-serve. The completion record references A-47 in docs/decisions/00-founding-decisions.md (present at the base commit per REPO CONTEXT); that file is not modified in this PR, consistent with "since #183" meaning the approval decision was recorded in a prior merge. No contradiction is visible in the supplied evidence.

No concrete defects found.

{"head": "ff56044487f338ac09cb50d78cc45c657438535d", "verdict": "no-findings", "findings": []}

Subject: 2cb84a9...ff56044, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance consistency.

handlers.rs

The Sink struct gains a std::sync::Mutex<Vec<RunRecord>> for record capture. The lock is acquired, the push completes, and the lock is dropped before any await in deliver — no async hold, correct.

semantic_service is split into semantic_service + semantic_service_with_sink; the refactor is clean and all prior call sites are unchanged.

unregistered_plan_and_fallback_are_refused_before_backend_dispatch: the unregistered-plan path passes "unknown" as the plan id (correctly refused before dispatch); the injected-fallback path uses the registered id but mutates the body to add "fallback" (refused as InvalidDocument). The assert!(backend.dispatched().is_empty()) check is placed before the control arm, so it covers both refused paths. The sink-delivery wait uses a tokio::time::timeout around a yield loop, avoiding a permanent hang.

resolved_response_preserves_proposal_and_rejects_authorization_outcome: verifies a Propose outcome is accepted at the wire layer, then that replacing the outcome with {"grant":{"action":"review"}} causes ServeDecision::parse to return Err. This is a wire-contract check (Principle VI), not a host-authorization check — consistent with the COVERAGE.md description.

disconnect_preserves_uncertain_remote_charge_and_delivery_record: the test relies on Some(1000) (a real-time budget) expiring while the backend is gated and the client task is aborted. After abort the decision continues internally; the inner loop waits for both a parseable ServeDecision and a non-empty sink.records before making Charge::Unknown / RemoteState::PossiblyContinuing assertions, preventing the race. The replay arm checks sink.calls == 1 and backend.dispatched().len() unchanged. No bugs found.

COVERAGE.md

The table accurately attributes rows not exercisable at the serving seam (Aicortex freshness/observation rows, Rahi timeout/digest rows) to those crates with explicit "No serving coverage claimed." The governance-prerequisite row correctly notes that no runtime test can confer owner approval. Consistent with what the tests actually exercise.

specs/010-integrations/spec.md

implementation advances from in-progress to complete. Per the contract, this removes the spec from the schedulable set and makes unresolved units errors. The completion record cites owner approval A-47; I cannot inspect docs/decisions/00-founding-decisions.md from the supplied context, so I make no finding about whether that entry exists — that enforcement is external. The verification block additions (cargo test -p rustev-serve --locked, cargo test -p rustev-boundaries --locked, and extending the grep pattern to cover integrations/rustev-serve) are consistent with the added coverage and the boundary rules in AGENTS.md.

No concrete defects found across any of the three files.

{"head": "8810df5df906a7053e46506b0e1334ba90d727d9", "verdict": "no-findings", "findings": []}

Subject: ba715bd...8810df5, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and spec-governance inconsistencies.

integrations/rustev-serve/tests/handlers.rs

The Sink struct gains a std::sync::Mutex<Vec<RunRecord>> field. The deliver implementation acquires the lock, calls .push(), and releases it before the first await point (pause.acquire().await), so no std::sync::Mutex is held across an async yield — correct for Tokio use.

The three new tests are internally consistent:

  • unregistered_plan_and_fallback_are_refused_before_backend_dispatch: refuses the unregistered plan and the injected-fallback body before any backend dispatch, then lets a valid request complete 3 gated attempts. The 10-second timeout waiting for sink delivery is reasonable.
  • resolved_response_preserves_proposal_and_rejects_authorization_outcome: confirms the wire shape of a Propose outcome and that substituting a grant fails deserialization — correctly tests the wire contract, not host authorization.
  • disconnect_preserves_uncertain_remote_charge_and_delivery_record: aborts the client while the backend is gated, waits for the 1000 ms deadline to expire (ending local waiting, not the in-flight attempt), then asserts PossiblyContinuing/Charge::Unknown in the delivered record and that a subsequent decide returns the replayed result without re-dispatch. Logic is coherent.

semantic_service_with_sink refactoring is straightforward and the original semantic_service delegates to it correctly.

integrations/rustev-serve/tests/COVERAGE.md

The new acceptance-map table maps each spec-010 section-5 row to a concrete test or an explicit "not a serving seam" exclusion with no serving coverage claimed. The boundary-test rows correctly distinguish cargo test -p rustev-boundaries (synthetic negative fixtures) from cargo run -p rustev-boundaries (live graph). No internal contradictions.

specs/010-integrations/spec.md

implementation: in-progress → implementation: complete. Under the contract table, approved + complete makes the spec non-schedulable with unresolved units treated as errors. The implementation record cites owner approvals R-44, A-45, A-47, and states all section-3.4 binding records have been reviewed. The verification block is updated with the three new rustev-serve commands and extends the Permitted/Grant grep to include integrations/rustev-serve. These additions are internally consistent with the completion claim.

No concrete defects found in the supplied evidence.

{"head": "fc7333d2234dad91b6f8edebab9a2a1ce4fb807a", "verdict": "no-findings", "findings": []}

Subject: 928c6b9...fc7333d, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

Base automatically changed from impl/010-serve-grpc to main October 23, 2026 11:31
@bartekus
bartekus enabled auto-merge (squash) October 23, 2026 11:31
@github-actions

Copy link
Copy Markdown

AI review (findings)

Review

integrations/rustev-serve/tests/handlers.rs

The three new tests are structurally sound:

  • Sink::records uses std::sync::Mutex. The lock guard is dropped before any .await point in deliver, so there is no async-blocking concern.
  • Abort/cancel pattern in disconnect_preserves_uncertain_remote_charge_and_delivery_record is correct: the JoinHandle is aborted before being awaited, and the expected JoinError::is_cancelled() follows.
  • The spin-loop in the disconnect test (yield_now) polls without holding the mutex across .await; each closure invocation acquires and releases the lock atomically.
  • semantic_service_with_sink refactor is non-breaking; semantic_service now delegates to it.

No defects found in the test code.

integrations/rustev-serve/tests/COVERAGE.md

The acceptance-map table is consistent with the three new tests and their documented negative controls. Attribution of Aicortex/Rahi rows to those crates and of the governance prerequisite to the binding-record review is correct.

No defects found.

specs/010-integrations/spec.md

Finding: The implementation record retains an unedited sentence that says "Still open: the image (042 3.16) and the shared conformance cases (3.17)." The completion note added immediately below (line ~449) claims those items are "042's own remaining work, not 010's," but that characterisation conflicts directly with the "Still open" language inside 010's own record. Under implementation: complete, any unresolved unit in a spec is an error rather than a warning; leaving "still open" language in place creates an internal contradiction that will be read by both humans and tooling as admitting outstanding work in this spec. If 3.16 and 3.17 truly belong to spec 042 and not to 010, the "Still open" sentence in 010's record should be removed or updated to say they are transferred to 042.

{"head": "b5f7941a678b8f66daae0bc33e78ca538eaa9035", "verdict": "findings", "findings": [{"path": "specs/010-integrations/spec.md", "line": 449, "summary": "Implementation record retains 'Still open: the image (042 3.16) and the shared conformance cases (3.17)' while the spec is simultaneously marked implementation: complete; the completion note's claim that these belong to spec 042 directly contradicts the 'still open' language in the same record."}]}

Subject: 4e2cc8e...b5f7941, diff digest 9e445dfa18b9525e3d4b9100d2f3224338d7b5ce5f645a2b7576640ab8b3461c, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 23, 2026 11:34 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and inconsistencies.

COVERAGE.md — The new acceptance-map table is internally consistent with the tests added in handlers.rs. The boundary-test paths cited (tools/rustev-boundaries/src/lib.rs) are not visible in the truncated repo listing, but REPO CONTEXT was truncated; I cannot confirm absence. The claim "owner approval A-47" is a governance claim inside the PR diff (not from the governance context) and cannot be verified here; owner ratification is enforced elsewhere.

handlers.rs — Three new tests and the semantic_service_with_sink refactor:

  1. semantic_service_with_sink — correct extraction; the original semantic_service now delegates to it with the default sink. No logic changed.

  2. Sink.deliver — acquires std::sync::Mutex guard, pushes, then drops the guard before any .await point (self.calls.fetch_add, then pause.acquire().await). The guard does not cross an await, so there is no Send violation.

  3. unregistered_plan_and_fallback_are_refused_before_backend_dispatch — refusal assertions occur before the control dispatch; backend.dispatched().is_empty() is checked after both refusals and before the spawn, so no race. The sink-record wait uses a 10-second tokio::time::timeout against a runtime_fixtures::until poll — timing margin looks adequate.

  4. resolved_response_preserves_proposal_and_rejects_authorization_outcome — correctly tests (a) that the live service returns a Propose outcome, and (b) that schema-level forgery of a grant is rejected by ServeDecision::parse. The COVERAGE.md accurately describes this as a wire-contract check, not host-authorization enforcement.

  5. disconnect_preserves_uncertain_remote_charge_and_delivery_record — the decision is given Some(1000) (1 s budget). The outer loop times out after 3 s waiting for PossiblyContinuing + sink delivery, which is workable if budget units are milliseconds. The mutex guard is never held across an .await. sink.calls is checked after the replay to confirm no second delivery. Structurally sound.

specs/010-integrations/spec.md — implementation: in-progress → implementation: complete. Per the contract table, approved + complete makes the spec settled (unresolved units become errors, not warnings), which matches the intent: all applicable section 5 rows now have offline tests and negative controls. The residual 042 items (3.16 image, 3.17 conformance) are correctly attributed to spec 042, not 010. The completion note's owner-approval citations (R-44, A-45, A-47) are PR-diff claims and cannot be verified here, but no contradiction with the governance documents is visible in the supplied evidence.

No concrete defects found.

{"head": "bcdc70f6624667cbd1853a2ef8cd384f0765b8d4", "verdict": "no-findings", "findings": []}

Subject: 4e2cc8e...bcdc70f, diff digest 78e73d8b484c3a8f5f502a791af64acf5d5d447c963b7d3abe51d17eea33373e, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus merged commit 2f752c2 into main Oct 23, 2026
31 checks passed
@bartekus
bartekus deleted the spec/010-complete branch October 23, 2026 12:04
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.

1 participant