Skip to content

feat(session-flow): one stage order with Interview first, decision levels and the handoff threshold - #12861

Merged
kyle-sexton merged 7 commits into
mainfrom
feat/12663-stage-order
Nov 3, 2026
Merged

kyle-sexton merged 7 commits into
mainfrom
feat/12663-stage-order

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #12663
Supersedes #12787

Summary

Replaces the lanes App PR #12787. It does not take a push from the owner login, so its content moves here unchanged. This branch is #12787's head 2c4dc4d, a clean merge of origin/main (0baad9c, which brings in #12785 and touches the same interview skill), and one commit (95acab9) adding tripwire tests for AC2 and AC12. Those tests close #12787's two advisory review findings.

What #12787 built, from its run summary: the workflow ladder starts at stage 1, Interview, which replaces the old stage 4, Contract. Explore, Research and PRD become stages 2-4, which the interview calls only when a question needs one. Stages 5-12 keep their numbers. The interview, design and plan skills each state the level they decide (behavior; interfaces and contracts; files and symbols). Between human stages, the continuation router suggests a handoff only at context-guard zone dumb. The workflow-stage: contract tag becomes interview in the 5 skills that carried it, and scripts/cheatsheet-config.mjs and docs/skill-cheat-sheet.md follow the new order.

Fix

  • Everything listed under Fix in feat(session-flow): one stage order with Interview first, decision levels and the handoff threshold #12787 (36 files across session-flow, planning, bugs, skill-quality, docs and scripts/cheatsheet-config.mjs).
  • plugins/planning/tests/decision-levels.test.sh (new): asserts exactly one level line in each of the interview, design and plan skills (AC2).
  • plugins/session-flow/scripts/tests/test_workflow_continuation_rule.py (new): asserts the zone-dumb handoff rule line in plugins/session-flow/skills/workflow/context/continuation.md (AC12).
  • One added sentence each in the existing planning and session-flow changelog fragments, naming the new test.

Verification

Related

🤖 Generated with Claude Code

@kyle-sexton
kyle-sexton marked this pull request as ready for review November 3, 2026 16:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T16:26:43.983252Z 55043b8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 43784741521095643d80f06eb7ac84f4b2ab01c9: read 39 of 39 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12861 (head 43784741)

I found no security issues. I read every hunk of all 39 changed files in the full diff, so this review is complete.

What the change does

  • Reorders the session-flow workflow stages. Stage 1 is now Interview, which replaces stage 4, Contract. Explore, Research and PRD become conditional detours numbered 2-4.
  • Renames workflow-stage: contract to interview in the frontmatter of 5 skills.
  • Adds a line to the interview, design and plan skills naming the level each one decides.
  • Narrows when the continuation router suggests a handoff between human stages: only at context-guard zone dumb.
  • Updates the docs, the cheat sheet, scripts/cheatsheet-config.mjs, the evals, the changelog fragments and the interview-defenses frontmatter pin to match.
  • Adds read-only tripwire tests: plugins/planning/tests/decision-levels.test.sh, plugins/session-flow/scripts/tests/test_workflow_continuation_rule.py, and plugins/session-flow/scripts/tests/test_workflow_stage_order.py.
    • test_workflow_stage_order.py is new since this lane's last review.
    • All three read only fixed paths inside the repository, built from __file__ / BASH_SOURCE. None takes external input.

Checks performed

  • Trusted paths: no changed file matches a TRUSTED PATHS: glob. The change touches no:

    • trusted-trigger check, token request or broker config;
    • kill switch or merge hold;
    • .github/actions/ module or workflow.
  • Plugin manifests: no .claude-plugin/plugin.json or marketplace.json is changed, so this review has no manifest lines.

  • Scripts:

    • plugins/skill-quality/scripts/check-skill.sh: only comments changed. The NEXT_STAGE_BEARING regex is unchanged, so the check warns on the same skills as before.
    • scripts/cheatsheet-config.mjs: only the STAGES data array changed (slugs and headings reordered and renamed). No logic changed.
    • The check-skill.test.sh change is a fixture rename.
  • Instruction-surface deletions: I judged these by what each removed rule used to prevent; the protected-class register was not re-read this round. Three rules are softened:

    • The checklist's "Never skip stages 1, 2" (explore/research) now lets them be skipped when their triggers do not hold.
    • The PRD handoff no longer clears context before the interview.
    • The router suggests a handoff between human stages only at zone dumb.

    Each is a workflow-quality rule. None of them stops an irreversible action, secret handling, data-integrity loss, external publication, a legal or compliance step, or a grant of agent authority, so none is a finding. The router still only suggests, and acting on it still needs an explicit per-invocation license. That text in plugins/session-flow/skills/workflow/SKILL.md is unchanged.

  • PR context: I found no embedded directives aimed at the review lane.

Prior findings: this lane's earlier summary at 55043b8e reported 0 findings, so nothing carries over. This is round 1 of 3, so the round cap did not apply.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 43784741521095643d80f06eb7ac84f4b2ab01c9: read 39 of 39 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #12861, one stage order with Interview first (round 2)

I found nothing to block or flag. I read every hunk of all 39 changed files in .claude-lane/pr.diff.

What changed since my last review: plugins/session-flow/scripts/tests/test_workflow_stage_order.py is new, and the session-flow changelog fragment now mentions it. My last review said nothing guarded the workflow skill's own stage list or prose. This test now covers that. I read it against the files at head; I did not run it:

  • The steps.md H2 headings are numbered 1–12 with no gaps, and stage 1 is Interview. The ## Ship: heading has no number, so the ^## (\d+)\. (\w+) pattern skips it.
  • The at-a-glance block in SKILL.md (lines 76–83) gives {1: Interview, 2: Explore, 3: Research, 4: PRD, 5: Design, 6: Plan, 7: Decompose, 8: Implement, 9: Test, 10: Review, 11: Verify, 12: Retrospective}. That matches the steps.md map exactly. The (runs after stage 11) text has no N. form, so the pattern doesn't pick it up. The block contains no Contract.
  • The detection list (lines 104–119) gives the stage numbers 1 to 11 in order.

So the test passes on this head, and it would fail if the list, the prose numbering or a Contract stage drifted.

Closing issue #12663 acceptance criteria:

  • AC1 (stage list and prose agree, interview first, no stage named Contract): met in SKILL.md, steps.md, the checklist template, spec-first.md and the retro quick table. test_workflow_stage_order.py now guards the skill's at-a-glance block and detection list against steps.md. The cheat-sheet spine gate guards cheatsheet-config.mjs.
  • AC2 (one sentence each in the interview, design and plan skills naming the level it decides): met at interview/SKILL.md:43, design/SKILL.md:38 and plan/SKILL.md:32. decision-levels.test.sh fails if a line is lost, duplicated or changed.
  • AC12 (handoff between human stages only at zone dumb): met at continuation.md:133. test_workflow_continuation_rule.py pins that line.
  • "Check ListAgents and open PRs before editing" is a process step that no diff can show, so I can't confirm it.

Consumers of the renamed tag: I checked these by reading code; I ran nothing.

  • scripts/test_check_next_graph.py still uses contract stage values. Its fixture writes its own steps.md with ## 4. Contract, so it doesn't depend on the real ladder and isn't affected.
  • check-skill.sh NEXT_STAGE_BEARING still leaves out interview, so the five skills now tagged interview raise no new warnings.
  • cheatsheet-config.mjs STAGES and docs/skill-cheat-sheet.md follow the new order.

Author's claims, not verified by me: every test result in the PR description (PASS=3, 1 passed, PASS=185, the break-and-restore checks).

Other checks:

  • Prior findings: the round-1 summary comment had no line anchor, and the gap it raised is addressed above, so nothing is re-posted.
  • No plugin manifest changed, so there are no manifest lines. The changelog fragments' bump levels (minor for planning and session-flow, patch for bugs and skill-quality) fit the changes.
  • I found no embedded instructions in the PR context.
  • Round cap: 1 of 3 rounds used, so the cap did not apply.

kyle-sexton and others added 2 commits November 3, 2026 11:47
…o steps.md

Adds test_workflow_stage_order.py: the steps.md headings run 1..12 from
Interview; the at-a-glance block lists the same numbered stages and no
Contract stage; the stage-detection list names stages in steps.md order.
Answers the claude-review finding that nothing guarded AC1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author
# Finding Classification Evidence
1 No test guards AC1 (plugins/session-flow/skills/workflow/SKILL.md:77, stage list and detection list) VALID (fix now) Verified: scripts/generate-cheatsheet.mjs and scripts/check-next-graph.py read only the steps.md H2s; nothing read the at-a-glance block or the detection list.

Fixed in 92d9f85: plugins/session-flow/scripts/tests/test_workflow_stage_order.py asserts the steps.md headings run 1-12 from Interview, the at-a-glance block lists the same numbered stages and no Contract stage, and the detection list's → Stage N numbers follow steps.md order. It fails when the block's first stage is changed back to 4. Contract (optional) (shown locally, then restored) and passes on the pushed head 4378474, which also merges main to clear the stale-base overlap on plugins/bugs/skills/write/SKILL.md.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 4b43aa5 Nov 3, 2026
55 of 56 checks passed
@kyle-sexton
kyle-sexton deleted the feat/12663-stage-order branch November 3, 2026 17:27
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 1, timeout 0, no coverage 0, invalid 0, not run 4.
Covered-code score 67%; mutation score 67%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/apply-patch/apply-patch.mjs 0 0 0 0 0 2
.github/scripts/pr-unblock/earlier-fail-notes.mjs 0 0 0 0 0 2
plugins/source-control/skills/pull-request/scripts/feedback-thread.sh 2 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/source-control/skills/pull-request/scripts/feedback-thread.sh:135 ROR productive input-gap

The run's summary has the full report.

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.

feat(session-flow): one stage order with Interview first, decision levels and the handoff threshold

1 participant