Skip to content

Give schedule consent one phase and bind it to the review - #765

Merged
sambitcreate merged 13 commits into
feature/sm-serve-chat-recoveryfrom
feature/sm-serve-schedule-consent
Nov 6, 2026
Merged

sambitcreate merged 13 commits into
feature/sm-serve-chat-recoveryfrom
feature/sm-serve-schedule-consent

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Replaces the active and firstWrite booleans with one phase, adds the first behavioral tests for the guard, and records the triage of the remaining cli-native entries.

  • Inventory: C15, plus dispositions for the rest in the worksheet
  • Context: no caller in src produces consent now that the model-facing tool is retired, so these fixes harden the guard that remains.

Defects fixed:

  • A save trusted whatever its file held after consent.
  • New-task consent could be replayed until it expired, in the same scheduler or a new one.

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-machines and .memory changed, so the iOS and Android suites were not run.

Worksheet: docs/state-machines/serve-daemon.md.

CI note: Desktop build and diagnostics failed on 09f48d7 while 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

sambitcreate and others added 5 commits November 4, 2026 20:07
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>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 active and firstWrite with 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.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread packages/cli/src/schedules.ts Resolved
sambitcreate and others added 7 commits November 4, 2026 20:35
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>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread packages/cli/src/schedules.ts Resolved
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>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 unlinkSync and 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.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

@sambitcreate
sambitcreate merged commit 741a95d into feature/sm-serve-chat-recovery Nov 6, 2026
45 of 47 checks passed
@sambitcreate
sambitcreate deleted the feature/sm-serve-schedule-consent branch November 6, 2026 07:48
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