Repository navigation
Give schedule consent one phase and bind it to the review - #765
sambitcreate merged 13 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A save read its file after consent without comparing it to what was reviewed, and new-task consent stayed valid until expiry because only the retired producer removed its receipt. No caller in src produces consent today, so this hardens the guard that remains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The in-memory spent list covers one scheduler. Separate offline commands build their own, so a receipt left on disk could be replayed through a new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
Receipt use is not durably one-shot across a crash, and the new suite does not exercise the phase transition this PR centers.
Reviewed changes Reviewed the complete schedule-consent change across all 7 files.
- Consent state — Replaces
activeandfirstWritewith a terminal three-phase command context and adds per-scheduler receipt tracking plus end-of-command cleanup. - Review binding — Compares a consented save file with the proposal that was reviewed and rechecks task or environment state at publication boundaries.
- Behavioral coverage — Adds built-artifact tests for substitution, reuse, expiry, cancellation, changed authority, changed tasks, and pre-publication revocation.
- State-machine record — Documents C15 and records dispositions for the remaining CLI-native inventory in the worksheet and project memory.
⚠️ The follow-on phase has no behavioral coverage
Every consented path in the new suite performs only one task-store write: the scheduler is never started, the new save is disabled, and pause is itself a single write. The assignment to follow_on can therefore be removed without making these tests fail, leaving the central phase transition and its rollback behavior unprotected.
Technical details
# Exercise the two-write consent phase
## Affected sites
- packages/cli/src/schedules.ts:51 — the new `first_write` to `follow_on` transition is not reached by a two-write command in the added suite
- packages/cli/tests/schedule-consent.test.mjs:31 — the consented new task is disabled and the service is not started, so scheduling never performs `updateRuntime`
- packages/cli/tests/schedule-consent.test.mjs:88 — revocation is injected before the first durable task write, not between the first and follow-on writes
## Required outcome
- Add a behavioral case that drives an approved save or resume through both task-store publications and independently verifies the follow-on check, including rollback or refusal when consent or authority changes between those writes.@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The receipt survived until the command returned, so a process that died after publishing left it for a new scheduler to replay. It is now removed just before the first write publishes. Adds coverage of the follow-on phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
First-write receipt consumption can still ignore a concurrent revocation.
Reviewed changes Reviewed the durable-consumption fix and phase tests added since the prior Pullfrog review.
- Consumed receipts before publication — Removed the approval receipt immediately before the first task-store write so a crash after publication cannot leave reusable consent.
- Covered phase behavior — Added behavioral cases that replay from a fresh scheduler after publication and exercise follow-on writes against changed task and environment state.
- Updated state-machine records — Documented the new consumption boundary and corrected the Lane D approval note after merging the evolving base branch.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
Forced removal hid a receipt deleted just after the last check, so the write still published. A missing receipt now stops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the receipt-consumption race fix added since the prior Pullfrog review.
- Closed the revocation race — Replaced forced receipt removal with
unlinkSyncand made a missing receipt cancel the mutation before publication. - Added boundary coverage — Added a behavioral test that deletes the receipt after its final read but before consumption and verifies the task remains unchanged.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
741a95d
into
feature/sm-serve-chat-recovery

Replaces the
activeandfirstWritebooleans with onephase, adds the first behavioral tests for the guard, and records the triage of the remainingcli-nativeentries.srcproduces consent now that the model-facing tool is retired, so these fixes harden the guard that remains.Defects fixed:
savetrusted whatever its file held after consent.Deferred or blocked: C18 and C19 wait on the subagent upgrade branch, C05 on #733, and C12, C16, C28 and C32 on P6.
Shared contracts: no persistence, wire-format, protocol revision, telemetry, network or runtime-flag change. Nothing outside
packages/cli,docs/state-machinesand.memorychanged, so the iOS and Android suites were not run.Worksheet:
docs/state-machines/serve-daemon.md.CI note:
Desktop build and diagnosticsfailed on09f48d7while downloading Electron (HTTP 504 from github.com, run 41952312113). No product code ran. One full rerun passed all 24 checks on the same head.🤖 Generated with Claude Code