Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
18290b9
docs(session-flow): document retired rules and the handoff size parts
kyle-sexton Nov 7, 2026
55aed8d
Merge branch 'main' into docs/13847-retired-rules
kyle-sexton Nov 7, 2026
0c51adc
feat(session-flow): retire goal amendments and trail lines with a reason
kyle-sexton Nov 7, 2026
05335fb
chore(session-flow): add the changelog fragment for handoff retirement
kyle-sexton Nov 7, 2026
5bc6c5b
docs(session-flow): say only size findings report the size parts
kyle-sexton Nov 7, 2026
9826a66
feat(session-flow): retire questions and decisions by id, and retire …
kyle-sexton Nov 7, 2026
d677ec3
fix(session-flow): point at every question and decision retirement
kyle-sexton Nov 7, 2026
9104ef8
feat(session-flow): fold late events into a handoff with amend
kyle-sexton Nov 7, 2026
3046339
fix(session-flow): keep save_point.py executable
kyle-sexton Nov 7, 2026
305f9b6
test(session-flow): generate shape-3 predecessors in the resume harness
kyle-sexton Nov 7, 2026
c194fb6
fix(session-flow): resolve retire refs by exact entry text in the res…
kyle-sexton Nov 7, 2026
91cc19a
fix(session-flow): refuse an amend append to an absent section
kyle-sexton Nov 7, 2026
9b91e99
docs(adr): bound the handoff core by relevance and amend late events
kyle-sexton Nov 7, 2026
f187592
fix(session-flow): require a reason line when a question or decision …
kyle-sexton Nov 7, 2026
3cf6b63
Merge remote-tracking branch 'origin/feat/13847-handoff-retire-ids' i…
kyle-sexton Nov 7, 2026
dbb3f94
Merge remote-tracking branch 'origin/feat/13847-handoff-retire-ids' i…
kyle-sexton Nov 7, 2026
5e1981a
Merge branch 'feat/13847-handoff-amend' into feat/13847-handoff-skill…
kyle-sexton Nov 7, 2026
af370ce
Merge remote-tracking branch 'origin/docs/13847-retired-rules' into f…
kyle-sexton Nov 7, 2026
a518502
feat(session-flow): require question and decision ids on new chains
kyle-sexton Nov 7, 2026
ea548ac
docs(session-flow): fold late events in with amend and retire by rele…
kyle-sexton Nov 7, 2026
028590a
test(session-flow): add shape-3 resume-eval cases for retired and bin…
kyle-sexton Nov 7, 2026
eb485d8
test(session-flow): add the ho-late-event-amends plugin-eval case
kyle-sexton Nov 7, 2026
3cb170f
test(session-flow): cover amend under id enforcement and narrow case …
kyle-sexton Nov 7, 2026
5658d68
fix(session-flow): tighten the late-event graders and the amend help
kyle-sexton Nov 7, 2026
1feda57
Merge remote-tracking branch 'origin/main' into feat/13847-handoff-sk…
kyle-sexton Nov 7, 2026
de82bea
Merge branch 'main' into feat/13847-handoff-skill-text
kyle-sexton Nov 7, 2026
baf5de8
fix(session-flow): require question and decision ids on a first hop
kyle-sexton Nov 7, 2026
d1a43db
fix(session-flow): key the first-hop id rule on previous_handoff
kyle-sexton Nov 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changes/session-flow/feat-13847-handoff-amend-3d9a41f7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
bump: minor
---

### Added

- `save_point.py amend <file> --json <path>` folds a late event into a filled shape-3 hot file. The JSON object takes `sections` (replace a written section; the old body goes to this hop's file under `## Amended <UTC> <title>`), `append` (add lines to Original goal or Direction changes, archiving nothing), `retire` (the `fill` retire operation), `next` (rewrite the Resume prompt's Next: headlines, old lines archived) and `floors` (raise an id floor; a retired id raises its own). It refuses before any write: an unfilled skeleton, a no-op, a carried or unknown section, a lowered floor, removing an entry this hop added without retiring it, a FAIL the amend would add, and a file that is no longer the chain tip (it prints the successor's `amend` command). A size FAIL never blocks the write; each file keeps its line endings, and the command prints the validate verdict, then the resume prompt (#13847).

### Changed

- `save_point.py new` refuses to rewrite a same-session hop file that holds `## Amended` or `## Retired …` content, and names `amend` (#13847).
12 changes: 12 additions & 0 deletions .changes/session-flow/feat-13847-handoff-skill-text-7c4e1a92.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
bump: minor
---

### Changed

- `save_point.py validate` fails an Open questions or Decisions in force entry without a `[Q<n>]` / `[D<n>]` id when the predecessor already carries the `next_question_id` / `next_decision_id` floor; chains started before the floors still validate. The goal, trail, question and decision slot texts name the `retire` refs, the retire headings and the ids (#13847).
- `/session-flow:handoff` checks each task notification, Monitor event, peer message or subagent result that lands after emit and until `/clear`, folds one that changes a section in with `save_point.py amend`, and ends the turn on the re-emitted rails. An amendment unit with a still-binding clause stays whole or is codified as `[R<n>]` first; a rule or preference leaves the hot file only when retired or promoted, never to meet the size cap. The save-point and structure references describe `amend`, the append-only hop file, the four retire headings, the ids and the retire pointer (#13847).

### Added

- Resume-eval cases `re-writer-keeps-binding-amendment` and `re-retired-amendment` on shape-3 predecessors, and the plugin-eval case `ho-late-event-amends` (#13847).
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Ship handoff shape 3 on measured size and leave accuracy to the resume eval

- Status: accepted
- Status: accepted; Decision 6 (the unbounded core) is superseded by
[ADR 0091](0091-bound-the-handoff-core-by-relevance-and-amend-late-events.md)
- Date: 2026-10-24
- Related: [#9238](https://github.com/melodic-software/claude-code-plugins/issues/9238) (the
hot-file and archive redesign). The harness and its cases are described in
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Bound the handoff core by relevance and amend late events

- Status: accepted
- Date: 2026-11-07
- Supersedes: decision 6 of
[ADR 0084](0084-ship-handoff-shape-3-on-measured-size-and-leave-accuracy-to-the-resume-eval.md)
(leave the core's growth unbounded)
- Related: [#13847](https://github.com/melodic-software/claude-code-plugins/issues/13847); owner
decisions Q1-Q3,
[2026-11-07](https://github.com/melodic-software/claude-code-plugins/issues/13847#issuecomment-6703829081)

## Context

ADR 0084 decision 6 left Original goal and Direction changes unbounded until accuracy runs that
never ran. At hop 46 of one real chain they held 21,048 and 21,418 bytes, 3.3 times the 16.4 KB
the ADR projected, and a near-cap core pushed a writer to drop in-force rules (#13847). Open
questions and Decisions in force are rewritten every hop with no carry check, so an unanswered
question can disappear between hops. And nothing folds an event that arrives after the handoff
is written into it: the reference text said the handoff "is not amended later by default".

The owner asked for handoffs that lose nothing, hold only what the next session needs now, and
take in late events (owner, 2026-11-07).

## Decision

1. **Keep by relevance, account for every move.** The goal quote, intent, vision, opening ask,
and every amendment or Direction-changes line still in force stay verbatim. An entry that is
superseded or done leaves the hot file only when this hop's file lists it verbatim under
`## Retired goal amendments` or `## Retired direction changes` with a reason. An instruction
that still binds is first codified (a rule, an instruction-file line, or an owner-decisions
row), then retired with a pointer to it. `save_point.py validate` fails an entry that is in
neither place. An amendment unit with any still-binding clause stays whole or is codified first;
units are never split.
2. **Ids for Open questions and Decisions in force.** `[Q<n>]` and `[D<n>]` ids with monotonic
frontmatter floors carry the same retire-with-reason check as rule ids. Observations and
Completion criteria stay free-form.
3. **Retirement is a script operation.** `fill` and `amend` take references (`[R|Q|D<n>]`,
`[h<k>]#<i>`, `amendment#<i>`) and copy the bytes themselves; the hot file carries a pointer to
each retire listing forward.
4. **Amend late events.** `save_point.py amend` replaces written sections, may rewrite the
`Next:` lines and raise id floors, appends the replaced text to this hop's file, re-validates
and prints the resume prompt again. A hop file becomes append-only through `amend` instead of
never edited. The handoff skill checks each event that arrives after emit and until `/clear`
or a successor `new`, and runs `amend` when one changes a section.

## Alternatives considered

- **Keep the newest N entries by count.** Mechanical and easy to test, but it can hide an old
amendment that still binds. Rejected by the owner.
- **Keep everything and accept UNVALIDATED.** Nothing moves, and the file keeps growing.
- **Owner-written summaries of older entries.** Needs the owner at every hop; published studies
found summarized history no better than retained raw history.
- **Hand edit, then validate, then emit, for late events.** No new code, but the replaced text is
lost unless copied by hand.

## Consequences

- Size stays the writer's judgment of relevance, checked for losslessness by `validate`; a wrong
relevance call is recoverable from the hop file the pointer names.
- `amend` never blocks on a size finding, so a late event is never lost to the cap.
- The resume eval reruns on this change, as ADR 0084 requires, with two cases that grade the new
read path: a writer keeping a still-binding amendment, and a reader answering from a retired
entry.
61 changes: 61 additions & 0 deletions plugins/session-flow/evals/ho-late-event-amends/case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
schema_version: "1.1"
name: ho-late-event-amends
description: 'Handoff late event: the session starts ./ci-wait.sh as a background command, which reports a failing test after a fixed 300-second delay, then runs /session-flow:handoff without waiting for it. The result lands after the rails are emitted; the session folds it in with save_point.py amend, never a hand edit or a second new, and ends on the re-emitted rails. A run where the result lands before emit, so its failing test is already in the fill slots, fails event-after-emit. A run needs --scaffold, --allow-tools Bash Write Edit, and a session UUID (amend exists on the full path only).'
tags: [handoff, late-event, amend]
plugins: ["../.."]
expected_outcome: 'The run starts ./ci-wait.sh with run_in_background, writes the shape-3 save-point with the check recorded as still running, emits the railed resume prompt and ends its turn. When the check reports test_backoff_cap failing, the session runs save_point.py amend on the handoff (Completion criteria, Remaining actions, Environment or Next: now name the failure), runs new only once, and ends on the rails amend prints.'
context:
scaffold_script: scaffold.sh
execution:
prompt: 'Start ./ci-wait.sh as a background command (run_in_background). It takes about five minutes and the handoff does not depend on it, so do not wait for it: record it as still running. Then run /session-flow:handoff file retry-backoff.'
allowed_tools: [Bash, Read, Write, Edit, Glob, Grep, Skill]
max_turns: 40
timeout_seconds: 900
graders:
- name: ran-amend
type: tool_used
tool: Bash
input_match: 'save_point\.py(?:\\")?[ \t]+amend\b[^\n]*--json'
min: 1
arm: with-only
- name: no-hand-edit
type: tool_used
tool: Edit
input_match: '"file_path":"[^"]*-handoff-[^"/]*\.md"'
min: 0
max: 0
arm: with-only
- name: no-hand-write
type: tool_used
tool: Write
input_match: '"file_path":"[^"]*-handoff-[^"/]*\.md"'
min: 0
max: 0
arm: with-only
- name: amend-after-emit
type: tool_order
before:
tool: Bash
input_match: 'save_point\.py(?:\\")?[ \t]+emit\b'
after:
tool: Bash
input_match: 'save_point\.py(?:\\")?[ \t]+amend\b'
arm: with-only
- name: event-after-emit
type: tool_used
tool: Write
input_match: '^(?=.*"file_path":"[^"]*\.slots\.json")(?=.*test_backoff_cap)'
min: 0
max: 0
arm: with-only
- name: no-second-new
type: tool_used
tool: Bash
input_match: 'save_point\.py(?:\\")?[ \t]+new\b'
min: 0
max: 1
arm: with-only
- name: rails-re-emitted
type: regex
pattern: '/clear`?,? then copy everything between the dashed lines[\s\S]*?\n[ \t]*─{10,}[ \t]*\n(?:(?![ \t]*─{10,})[^\n]*\n)*?[ \t]*(?!─)\S[^\n]*\n(?:(?![ \t]*─{10,})[^\n]*\n)*?[ \t]*─{10,}'
arm: with-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"pass": [
{
"answer": [
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" new --topic retry-backoff --no-previous"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" fill /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --slots /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.slots.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" validate /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md && python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" emit /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md"
}
},
{
"tool": "Write",
"input": {
"file_path": "/tmp/w/.work/handoffs/amend.json",
"content": "{\"sections\": {\"Remaining actions, in order\": \"1. Fix test_backoff_cap: cap delayFor at 30000 ms.\"}}"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" amend /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --json /tmp/w/.work/handoffs/amend.json"
}
}
],
"why": "emit, then amend"
},
{
"answer": [
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" new --topic retry-backoff --no-previous"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" fill /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --slots /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.slots.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" validate /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md && python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" emit /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" validate /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md && python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" emit /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" amend /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --json /tmp/w/.work/handoffs/amend.json"
}
}
],
"why": "emit, a second emit, then amend"
}
],
"fail": [
{
"answer": [
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" new --topic retry-backoff --no-previous"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" fill /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --slots /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.slots.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" amend /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --json /tmp/w/.work/handoffs/amend.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" validate /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md && python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" emit /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md"
}
}
],
"why": "amend before the first emit"
},
{
"answer": [
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" new --topic retry-backoff --no-previous"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" fill /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --slots /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.slots.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" validate /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md && python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" emit /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md"
}
}
],
"why": "no amend"
},
{
"answer": [
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" new --topic retry-backoff --no-previous"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" fill /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --slots /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.slots.json"
}
},
{
"tool": "Bash",
"input": {
"command": "python3 -X utf8 \"${CLAUDE_PLUGIN_ROOT}/scripts/save_point.py\" amend /tmp/w/.work/handoffs/20261107T120000Z-handoff-retry-backoff.md --json /tmp/w/.work/handoffs/amend.json"
}
}
],
"why": "no emit"
}
]
}
Loading
Loading