Skip to content

test(api): prove resume stays closed on a real store (M4 row 3) - #453

Merged
mergify[bot] merged 3 commits into
mainfrom
claude/m4-row3-resume-closed
Oct 5, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
claude/m4-row3-resume-closed

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Dieser PR fügt einen Test hinzu, der auf einer echten Datenbank beweist, dass "resume" in v1.5.0 geschlossen bleibt. Ohne API-Token kommt 401, mit API-Token und fehlendem, falschem oder gültigem Verdict-Token immer 409. Zustand, Journal, Claims, Runs und Starts bleiben unverändert, auch nach dem Neuöffnen der Datenbank; am Verhalten ändert sich nichts.

Report

  • Flake fix: observedAt normalised, run 37269346495 (commit 1e3843e; without_clock strips wall-clock observedAt from the runtime-limits snapshot; prepush lane exit 0, log /tmp/prepush-rc.log).

What changed (2 files, +132/-2): new test api::tests::resume_closed_tests::resume_remains_closed_for_every_verdict_and_preserves_runtime_state (src-tauri/src/api/tests/resume_closed_tests.rs), plus a test-helper change in api.rs: the FakeBackend::control_continuous delegates to native_store when set (otherwise the old canned error). No production code touched. Characterization of matrix row 3, Option A (resume stays closed).

The test covers: 401 without API token (also with only a verdict token); 409 with absent / wrong / current verdict token and the fail-closed message; direct Store::control_continuous(.., "resume") returns the fail-closed error; fingerprint of control row, journal, claims, runs and launch rows plus context cursor and continuousScheduler/launchIntent (both false) unchanged; same after reopening the database and booting a new server.

Evidence

  • Base: origin/main 4419432 (PR feat(api): audit planning refusals and writes (M4-R19-08) #444 merged, api lane free). Head f2ba7e4.
  • cargo test --bin projecta resume_remains_closed -> exit 0
  • bash scripts/ci/gates.sh lane prepush at f2ba7e4 -> exit 0 (log /tmp/row3-prepush.log on the server)
  • bash scripts/ci/red-first.sh --plan -> count=1, specs=1
  • Red-first: the test does not exist at the merge base (missing = red); trailer Test-First: <path>::<name>. It is a characterization test, so it is green by construction on the unchanged behaviour.

Architecture drift: no new findings.

NICHT ABGEDECKT: #[cfg(windows)] tests and the Windows half (runs in the merge queue); GUI; real main.rs ApiBackend (the test uses the store through the fake's delegation, the route and store code are the production ones); no real worker/launch process.

Review: done, see disposition.

Review disposition

Tier A (api seam, test helper). Reviewers: kimi-k3:cloud and glm-5.2:cloud (Ollama, via scripts/review/run-local.sh); the author family is Claude. Reviewed candidate f2ba7e4; fixes in 5a40bd8. Driver cross-checked every finding against the code.

ID Reviewer Severity Where Decision
F1 kimi-k3 medium api.rs:3253-3258, resume_closed_tests.rs:6 Confirmed: fake fallback text equalled the store's, so the route proof did not show the store in the path. Accepted, 5a40bd8: fallback now fake backend without a store: resume is fail-closed (still 409), so assert_closed fails when the store leaves the path.
F2 kimi-k3 medium api.rs:3253-3258 Rejected: no other test reaches control_continuous through a store-backed fake (planning_access_tests.rs:254 returns 403 before the backend; api.rs:4129 uses a store-less fake). Production main.rs:2923 already delegates the same way. Non-resume actions are out of this package (resume-only characterization).
F3 kimi-k3 low resume_closed_tests.rs:81-83 Rejected: test-only seed, deterministic defaults() policy, no apostrophes; a migration that changes columns should fail loudly.
F4 kimi-k3 low resume_closed_tests.rs:9-22 Half accepted, 5a40bd8: continuous_goals and continuous_root_policies added to the state fingerprint. NULL concat refuted: continuous_events.detail is NOT NULL (store/continuous.rs:170).
F5 kimi-k3 low resume_closed_tests.rs:1-2 Accepted, 5a40bd8: module doc narrowed to a paused project and verdict-token variants.
F6 glm-5.2 low api.rs:3247 Accepted, 5a40bd8: comment on the sync block_on constraint (same pattern as the neighbouring fakes).

Verdicts: kimi-k3 approve with conditions (F1 addressed, F2 rejected with reason); glm-5.2 approve. Architecture drift: none (existing fake-delegation pattern reused).

Evidence at 5a40bd8: cargo test --bin projecta resume_remains_closed -> exit 0; pre-push hook (gates.sh lane prepush) -> exit 0, push verified with git ls-remote; bash scripts/ci/red-first.sh --plan -> exit 0, count=2.

🤖 Generated with Claude Code

Resume answers 401 without the API token and 409 with an absent, wrong or
current verdict token. The direct store call fails closed, and control state,
journal cursor, claims, runs, launches and runtime capabilities stay the same,
also after reopening the database. The test fake delegates control to its
native store when one is set; no production behaviour changes.

Test-First: src-tauri/src/api/tests/resume_closed_tests.rs::resume_remains_closed_for_every_verdict_and_preserves_runtime_state

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Cuarroc
Cuarroc marked this pull request as ready for review October 5, 2026 05:10
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

… pr453)

The fake's no-store fallback now words its refusal differently from the
store's, so the route assertions fail when the store leaves the path.
The state fingerprint also covers goals and root policies; the module
doc is narrowed to what the test presents.

Test-First: src-tauri/src/api/tests/resume_closed_tests.rs::api::tests::resume_closed_tests::resume_remains_closed_for_every_verdict_and_preserves_runtime_state

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Cuarroc Cuarroc added the review-ok Pipeline: review disposition complete, no open high finding label Oct 5, 2026
@Cuarroc

Cuarroc commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 7 minutes 42 seconds in the queue, including 7 minutes 27 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • gates (linux)

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = gates (linux)
  • check-success = gates (windows)
All conditions

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued and removed queued labels Oct 5, 2026
Host admission samples the clock on every read, so the runtime-state
snapshot differed by one second whenever a boundary passed between reads
(merge queue run 37269346495). Strip observedAt before comparing; the
closed-resume and unchanged-state assertions are untouched.

Regression-For: f2ba7e4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mergify mergify Bot removed the dequeued label Oct 5, 2026
@Cuarroc Cuarroc added review-ok Pipeline: review disposition complete, no open high finding and removed review-ok Pipeline: review disposition complete, no open high finding labels Oct 5, 2026
@Cuarroc

Cuarroc commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify mergify Bot added the queued label Oct 5, 2026
@mergify mergify Bot mentioned this pull request Oct 5, 2026
12 tasks done
@mergify
mergify Bot merged commit 09d6c07 into main Oct 5, 2026
11 checks passed
@mergify
mergify Bot deleted the claude/m4-row3-resume-closed branch October 5, 2026 06:41
@mergify

mergify Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 12 minutes 6 seconds in the queue, including 11 minutes 49 seconds running CI.

Required conditions to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-ok Pipeline: review disposition complete, no open high finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant