Skip to content

feat(session-flow): compact within a task and hand off at a phase or task boundary - #18022

Merged
kyle-sexton merged 4 commits into
mainfrom
feat/session-flow-router-compact-same-task
Nov 21, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
feat/session-flow-router-compact-same-task

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Refs: #17877

Item: Continuation router (AC15)

Summary

The continuation router recommends /compact <focus> only within one phase, activity or task. At a phase or task boundary next in sequence (interview into design, one plan phase into the next, a finished spec or plan into execution) it recommends a handoff then /clear, whatever the zone. The "Between human stages" zone rule is removed. ADR 0116 records the decision (owner interview Q34 and design Q3).

Fix

  • skills/workflow/context/continuation.md: question 5 gains phase and task boundaries; question 6 is the same phase, activity or task only; the human-stage rule goes; the same-task bullets and the routing summary match.
  • skills/workflow/SKILL.md: the step 4 summary matches.
  • skills/workflow/evals/evals.json: legacy evals 16 (now mid-phase, still compacts) and 38 (interview into design now hands off at any zone) match the new rule.
  • scripts/tests/test_workflow_continuation_rule.py: the tripwire checks the new edges and that the old rule is gone.
  • docs/adr/0116-*: the decision.

Verification

  • pytest plugins/session-flow/scripts/tests/test_workflow_continuation_rule.py: 2 passed.
  • No eval was run: the owner stopped eval runs on 2026-11-21 until open issues and PRs reach zero. The existing wf-same-task-compacts, wf-phase-boundary-hands-off and wf-unrelated-next-plain-clear cases already state the new behavior and return with the eval work.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RAoAtTkzDudPZP5AiCpKVR

…task boundary

The continuation router now recommends /compact only within one phase,
activity or task, and a handoff then /clear at a phase or task boundary
next in sequence (interview into design, one plan phase into the next, a
finished spec or plan into execution), whatever the zone. The
"Between human stages" zone rule is removed. ADR 0116 records it.

Refs: #17877

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RAoAtTkzDudPZP5AiCpKVR
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body conforms to the issue-linkage contract. Nothing to do.

@github-actions github-actions Bot added the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 21, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 21, 2026 19:14
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T19:16:09.047852Z 10ce631 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.

@kyle-sexton
kyle-sexton removed this pull request from the merge queue due to a manual request Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44939920263, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step skipped
Commits pushed none (read lane)
Run 44939920263

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 46a0200ba66c03f6609d977e4b02b5b1e4bedb29: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18022 (incremental, blocking only)

No security issues found.

This was an incremental review of the changes since 7fce037e. I read every hunk of all 3 files in scope. None of them matches a trusted-path glob. This lane already reviewed an earlier head, so the review was blocking only: it would report only CRITICAL and IMPORTANT findings.

  • plugins/session-flow/skills/workflow/context/continuation.md: removes the last two mentions of the human-stage handoff rule. One is the compaction-marker sentence, the other the "prefer continue when the next stage consumes this stage's reasoning verbatim" sentence in question 3.
  • plugins/session-flow/skills/workflow/context/pre-implementation-order.md: rewords the note on sequencing. A handoff then /clear is now suggested at every phase boundary.
  • plugins/session-flow/skills/workflow/evals/evals.json: eval 21 now describes an explore detour inside the plan stage. Its name, prompt, expected output and one expectation changed to match.

Instruction-surface lens. I checked the removed sentences by consequence. They only decided which session-routing suggestion to make: continue, compact, or a handoff then /clear. None of them guarded credentials, permissions, destructive actions, sending content off the machine, or a trust boundary. The router still only suggests and does not act. I did not read the protected-class list in docs/contracts/instruction-exception-register/README.md in this run.

Other surfaces. The diff changes no plugin manifest, workflow, token, trust control or merge hold. The PR description contains no instructions aimed at the review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 46a0200ba66c03f6609d977e4b02b5b1e4bedb29: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #18022, incremental review from 7fce037 to 46a0200

No blocking findings in this push. This lane already reviewed an earlier head, so this review covered blocking findings only.

What changed

This push fixes both findings from the last review:

  1. The removed "Between human stages" rule is no longer described anywhere.
    • continuation.md#L28-L29: the clause saying the compaction marker "keys the human-stage handoff rule" is gone.
    • continuation.md#L105-L110: question 3 no longer has the "prefer continue when the next stage consumes this stage's reasoning verbatim" sentence. That sentence could never fire once question 5 started catching every move into the next stage.
    • pre-implementation-order.md#L34-L37: each pass now ends at a phase boundary with a handoff then /clear. That matches question 5 and the "Same-task boundaries" list.
  2. Eval 21 now tests the new rule. It is renamed explore-detour-inside-plan-stays-in-session, and the scenario is now an explore detour inside the plan stage. That routes through question 6 (/compact <focus>), which matches the "explore or research detour inside a stage" bullet at continuation.md#L158. Nothing else in the repository uses the old eval name.

Checks

  • The tripwire test (plugins/session-flow/scripts/tests/test_workflow_continuation_rule.py) asserts the question 5 and question 6 wording and that "Between human stages" is gone. This push leaves all three intact. I did not run the test: this lane has no shell. The PR's 2 passed is the author's claim and I did not confirm it.
  • No closing issue: the PR only says Refs: #17877, so I checked no acceptance criteria.
  • No embedded instructions found in the PR context or the prior-findings file.
  • Loosened checks: none of the changed files touches a check, a gate or a test threshold. The wrapper wrote no loosened_check_verdict: or loosened_check_patterns: line, so the default (fail, no consumer entries) applies. It had no loosened_check_decision_record: line either, so I did not check the citation requirement.
  • Spend: none. This push only edits docs and an eval definition.

Verifier dropped 0 of 0 candidates.

The compaction-marker note, question 3's next-stage clause, the planning
order note and legacy eval 21 still described the removed rule. Eval 21
now tests an explore detour inside the plan stage, which still compacts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RAoAtTkzDudPZP5AiCpKVR
@kyle-sexton

Copy link
Copy Markdown
Member Author

Reply to the claude-review findings on 7fce037efa, fixed in 46a0200ba6:

# Finding Classification Action
1 Removed rule still described in 3 places CORRECT continuation.md: dropped the marker's "keys the human-stage handoff rule below" clause and question 3's "next stage consumes this stage's reasoning" clause (dead once question 5 catches every boundary). pre-implementation-order.md: the notes now say each pass ends at a phase boundary that hands off.
2 Eval 21 expects the old stage-boundary routing CORRECT Reframed as an explore detour inside the plan stage (explore-detour-inside-plan-stays-in-session), which still compacts under question 6, matching the "detour inside a stage" bullet.

A sweep for other statements of the old rule found only spec-first.md:47-48, which points to the router and stays accurate. Tripwire: 2 passed.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
@github-actions github-actions Bot removed the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 21, 2026
Merged via the queue into main with commit 7953f48 Nov 21, 2026
61 checks passed
@kyle-sexton
kyle-sexton deleted the feat/session-flow-router-compact-same-task branch November 21, 2026 19:56
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant