Skip to content

feat(playbooks): require human approval at checkpoints - #1090

Open
BastiHu wants to merge 1 commit into
feat/playbooks-789-331968a7from
feat/playbooks-790-integrated-331968a7
Open

BastiHu wants to merge 1 commit into
feat/playbooks-789-331968a7from
feat/playbooks-790-integrated-331968a7

Conversation

@BastiHu

@BastiHu BastiHu commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #790.

Checkpoints use one existing Inbox Exchange in chat and Inbox, including Answered history. Migration 071 stores only its pointer and the submitted summary. The dedicated checkpoint table, RPCs and 30-second retry are gone. Revisiting work requires approval again.

The Inbox, migration and gate verification passed 105 tests plus 11 browser tests. The final checkpoint port passed 50 store tests, including skipped checkpoints and late answers. Earlier tested head · Earlier stack verification.

Before and after

Before After
Checkpoint before Checkpoint after

December re-review

Current layer commit.

One approval request in chat and Inbox

The recording follows the open “Pear Lantern second review visit” checkpoint from the owner conversation into Inbox. Expanding the request there shows the same summary and the Approve and Decline controls. The request remained open during this recording at 05b8a3f359.

1090-chat-inbox.mp4

Original evidence comment.

Additional live recording on a4e77e840b before the final rebase.

./1090-checkpoint-approval.mp4

Historical submission and tests on earlier commits

The following records the original submission. The December re-review section above tracks current evidence.

Problem

A playbook could advance past work that needed a person's approval. Closes #790.

What changed

Steps may declare approval: required. Attempting to leave such a step with a work summary creates one durable request and keeps the pointer in place. The same request appears in Inbox and the owner's chat; Owners and Collaborators can answer once, while Viewers can only read it. Changed work and revisits require fresh approval. Assignment of unchanged work preserves it.

Answers survive restart and notify the owner with stable delivery IDs. Explicit cancellation and owner archive/delete close pending requests. Scoped client reads reach the existing server authorization filters. Migration 063 follows cancellation migration 062. This PR is stacked on #1089 (cancellation), following #1088. Progress follows in #1091.

UI changes

One shared approval card serves Inbox and owner chat. Library step previews mark approval requirements. Captain browser smoke verified the new approval-required label in the library preview; the screenshot is included below. Live approval-card interaction captures remain outstanding.

See the screenshot pair above.

Live testing

Focused tests cover request reuse, stale answers, permission refusals, notification restart/retry, final-step completion, and cancellation closure. Browser tests cover decline reasons and Viewer/offline refusal. Captain review added failing-first owner-lifecycle closure coverage and a scoped-client read regression.

Combined validation at bc432f7c64040976df0400625870a4b235a8e81b: check:changed passed: 568 tests across 43 files, all 36 affected package typechecks, 17 React compiler cases across 12 selected files, format, lint, Knip, and GraphQL. Captain browser smoke verified the approval-required library preview, Inbox loading, a completed free Replay turn, and restoration of that transcript after an at-rest server restart. Replay exercises provider rendering; it does not verify the Playbook approval flow. Detailed report: artifacts/test-reports/feat-playbooks-next-integrated-331968a7/bc432f7c6.md. Real-model checkpoint flow and multi-device live answers remain unrun while the earlier paid-model authorization request is pending. No live deployment was performed.

Upstream impact

Only the measured agent context budget changes outside J5-owned code; FORK.md cases 2 and 110 record it. Existing sharing guards, command permissions, and read revisions are reused.

Checklist

  • One concern: human approval checkpoints
  • Behavioral tests cover gating, permissions, persistence, and lifecycle closure
  • Live testing: exercised and unexercised paths stated above
  • Upstream-owned files recorded in FORK.md
  • Upstream product: existing mechanisms reused; no new divergence
  • Surfaces: web/desktop card, shared permissions, MCP recovery, library previews; mobile progress is in the next layer
  • Product and user docs updated

Implemented with GPT-6 Astra in the Codex harness and a J5 Crew.

1090-checkpoint-approval.mp4

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Dec 1, 2026 7:21pm UTC

Request Review

@Jacksondr5

Copy link
Copy Markdown
Owner

Direction for the whole stack, before the full review, is in this comment on #1086. We'll review once the stack is rebased onto j5/main after #1205.

@BastiHu
BastiHu force-pushed the feat/playbooks-790-integrated-331968a7 branch from 2e509e1 to eb3dc9f Compare November 24, 2026 11:00
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from f6032ac to 7078f14 Compare November 24, 2026 11:00
@BastiHu

BastiHu commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Jacksondr5, Checkpoints use one existing Inbox Exchange in chat and Inbox, including Answered history. Migration 064 stores only its pointer and the submitted summary. The dedicated checkpoint table, RPCs and 30-second retry are gone. Revisiting work requires approval again. The Inbox, migration and gate verification passed 105 tests plus 11 browser tests. The final checkpoint port passed 50 store tests, including skipped checkpoints and late answers. Commit · Stack-wide response and outstanding evidence.

@Jacksondr5

Copy link
Copy Markdown
Owner
  • Blocking: a reworded summary replaces the approval request. PlaybookStore.ts:1226-1244. The checkpoint is an ordinary Inbox Exchange, but a retry with different wording closes that Exchange and opens a new one: while pending, a person answering the first card is refused; after approval, the approval is thrown away and a new request opens. Live, Haiku reworded its summary after a Collaborator approved, and the run needed a second approval. Playbooks: approval checkpoints #790 says neither should happen. Fix: keep one Exchange per visit to the step and ignore the summary once it exists. Approved → the move proceeds; pending → approval_pending; no request, or declined → a summary is required and opens one. An agent that wants to update its summary can add a follow-up to the open ask (regarding), as with any ask. Also drop "Submitting a different summary opens a fresh request" from the user guide.
  • Product decision on revisions: a checkpoint blocks moves only. Please drop both revision refusals (PlaybookStore.ts:1139-1149 and :1159-1177) and the doc line "Revisions must keep each required checkpoint". A revision already needs the person's ask or approval.
  • Viewers: AC19 says a Viewer sees the request. Live, a Viewer doesn't, which is the Inbox's existing rule for ordinary asks too. Please drop that clause rather than special-casing checkpoints.
  • Nit: any human reply other than exactly "approve" closes the request as declined (PlaybookRequests.ts:42). Reject an unrecognized reply instead.
  • Nit: every open thread's chat now subscribes to the environment's open-Inbox list, where only Captain chats did before (AdjudicationDock.tsx). Answering also bumps both the playbook and Inbox revisions. Please keep the Captain condition (or enable it from run progress), and let request changes follow the Inbox revision only.
  • Evidence: before/after, and a short video of the approval flow in chat and the Inbox.

@BastiHu
BastiHu force-pushed the feat/playbooks-790-integrated-331968a7 branch from 62d133f to a63d143 Compare November 30, 2026 13:48
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from 5fa0a6d to fd0e151 Compare November 30, 2026 13:48
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from fd0e151 to 8717303 Compare November 30, 2026 13:50
@BastiHu
BastiHu force-pushed the feat/playbooks-790-integrated-331968a7 branch from a63d143 to 0dda2c4 Compare November 30, 2026 13:50
@github-actions github-actions Bot added size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). size:XL 500-999 effective changed lines (test files excluded in mixed PRs). and removed size:XL 500-999 effective changed lines (test files excluded in mixed PRs). size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Nov 30, 2026
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from 8717303 to e402487 Compare November 30, 2026 16:15
@BastiHu
BastiHu force-pushed the feat/playbooks-790-integrated-331968a7 branch from 0dda2c4 to 49b7d46 Compare November 30, 2026 16:15
@BastiHu

BastiHu commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

One approval request in chat and Inbox

The recording follows the open “Pear Lantern second review visit” checkpoint from the owner conversation into Inbox. Expanding the request there shows the same summary and the Approve and Decline controls. The request remained open during this recording at 05b8a3f359.

1090-chat-inbox.mp4

@BastiHu
BastiHu force-pushed the feat/playbooks-790-integrated-331968a7 branch from 49b7d46 to e97f253 Compare December 1, 2026 19:20
@BastiHu
BastiHu force-pushed the feat/playbooks-789-331968a7 branch from e402487 to 7f52842 Compare December 1, 2026 19:20

This branch was successfully deployed

1 active deployment
Preview — e97f2536 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants