Skip to content

feat(session-flow): carry handoff decisions off disk and fold old direction changes - #16943

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-16427-44162700131-1
Nov 17, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-16427-44162700131-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #16427

Summary

Opened by the work-resolve-issue lane. The run's own summary:

First slice of #16427, as the recorded decision chose. save_point.py new now copies ## Open questions and ## Decisions in force off disk, as it does rules, and offers open-questions-new / decisions-new slots for new entries. validate fails a carried entry whose text changed unless it left through retire or ends with Rewritten h<N>: <why> naming this hop, so a shortened decision no longer passes on its id alone. new also folds Direction changes lines 3 or more hops old (DIRECTION_HOPS_KEPT = 3) behind one - Folded: pointer line naming the newest hop file that holds them; validate accepts a folded line only while that pointer is present and fails a hop that drops the predecessor's pointer. The cap stays 24,600 bytes. Choices and their basis: (1) The marked field is an inline Rewritten h<N>: <why> in the entry, and it must name this hop so a stale mark cannot license a later silent edit. The prior text is already in the hop file, because hop_file_text archives the predecessor's whole section. (2) Fold window: the hot file keeps the lines of the last 3 hops, this one included, so a line folds at age 3. The literal 'older than 3 hops' reading keeps 4 hops and has no pointer at hop 4, which makes hop 8's fixed part one pointer line larger than hop 4's and fails the acceptance test; the reading used here keeps the two equal. (3) A section is carried only when the predecessor is shape 3, carries the id floor, and holds entries that all have ids. A 'None.'-only section or a legacy id-less section keeps the full slot, so no writer inherits a line that validate would reject. The harness generators (hop_chain.py, resume_cases.py) now give carried sections only new lines.

Remaining work

  • Have new print the byte budget left for the written sections, and have fill refuse an over-budget object with per-slot sizes (deferred by the recorded decision to a follow-up)
  • Give the over-cap case a command that moves a named written section's overflow into the hop file and leaves a pointer (deferred by the recorded decision to a follow-up)

Not verified

  • pytest over plugins/session-flow/scripts/tests/test_save_point.py, harness/test_resume_cases.py and harness/test_resume_eval.py, plus harness/hop_chain.test.sh, were not executed: this lane runs no interpreter. The new and changed tests were traced by hand and by the review subagent only. Left to…
  • tidy skipped: the change is about 345 changed lines, over the 300-line tidy cutoff
  • The issue's 'Next step' audit of all handoff chains was not run; the recorded decision says no audit first
  • REWRITE_MARK_RE accepts the mark anywhere in the entry, while the docs and the slot instruction tell the writer to end the entry with it

Fix

  • plugins/session-flow/scripts/save_point.py: adds DIRECTION_HOPS_KEPT, FOLD_PREFIX, REWRITE_MARK(_RE), _folds, _carries. build_skeleton_3 copies carried question/decision sections above an optional <slot>-new slot and folds old trail lines behind the pointer. _check_carry_3 fails an…
  • plugins/session-flow/scripts/tests/test_save_point.py: three existing tests now key decisions-new / open-questions-new where hop 2 carries the section, and fill_hop2 passes optional slots the caller names. New tests cover the off-disk carry, an unmarked or stale-marked change failing and a…
  • plugins/session-flow/scripts/harness/hop_chain.py: generated shape-3 hops after hop 1 leave the carried question/decision -new slots empty.
  • plugins/session-flow/scripts/harness/resume_cases.py: _fill_3 gives a carried id section only this hop's new lines (put), and the full list otherwise.
  • plugins/session-flow/reference/structure.md: the shape-3 table and writer bullets describe the off-disk carry, the Rewritten h<N>: <why> mark and the 3-hop fold with its pointer.
  • plugins/session-flow/skills/handoff/SKILL.md: the 'Keep the hot file current' paragraph states the carry, the rewrite mark and the fold, and the fill checklist lists questions and decisions among the fields new writes. The file stays at 499 of 500 lines.
  • .changes/session-flow/work-resolve-issue-issue-16427-44162700131-1-8c695e35.md: minor changelog fragment for session-flow.

Verification

The runner ran each check from the base copy against e0955db:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 5 fragments valid (after adding the required ### section)
  • check-changed-skills: handoff PASS, 0 errors, 2 pre-existing size warnings (after holding SKILL.md to 499 lines; the first run failed at 504)
  • check-affected: 16 passed, 6 skipped over 7 changed files. Its ruff step first caught a nested body function shadowing the body list in build_skeleton_3; renamed to id_body and re-run green
  • cant-fail-scan --file plugins/session-flow/scripts/tests/test_save_point.py --lines 3858-4060: no can't-fail tests found
  • review: one fresh-context subagent read the whole diff and traced each new, changed and existing shape-3 test and both harnesses by hand. It found no runtime error or regression and two likely bugs, both fixed: id-less legacy entries being carried, and no check on a dropped fold pointer (new test…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44162700131

Left out: the items under Not verified.

Related

#16427

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44174561042

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, blocking only): no security issues found

This was an incremental, blocking-only review of what changed since e0955db783174ccc73ad8e0821bfeb1d95ae72cf. I read every hunk of the 3 files in scope:

  • plugins/session-flow/scripts/harness/hop_chain.py: two inline comments in fill_skeleton are moved into its docstring. No logic changes.
  • plugins/session-flow/scripts/save_point.py: comments above DIRECTION_HOPS_KEPT and REWRITE_MARK are removed. The constants and regexes are unchanged.
  • plugins/session-flow/scripts/tests/test_save_point.py: one test-parameter comment and one section-banner comment are removed.

What I checked:

  • Behaviour. Every change is to a comment or docstring. Nothing changes how the code runs, so there is no new data flow, injection surface, credential handling or network access.
  • Trusted paths and trust controls. No file in scope matches a trusted-path glob. Nothing touches the trusted-trigger check, the lane token or broker, the kill switch, the merge holds, .github/actions/ or a workflow.
  • Plugin manifests. No plugin.json or marketplace.json changed, so there are no manifest lines.
  • Instruction surface. The removed text is code comments, not a standing instruction such as CLAUDE.md, AGENTS.md, a rules file, a skill or agent body, or a hook list.
  • Prior findings. The earlier review of this pull request found nothing, so there is nothing to carry forward.
  • PR context. The description contains no instructions aimed at the review lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): no blocking findings

What I reviewed. This review covers only the push from e0955db7 to 51132b44. I read every hunk of all 3 files on the incremental list in .claude-lane/incremental.diff:

  • plugins/session-flow/scripts/harness/hop_chain.py
  • plugins/session-flow/scripts/save_point.py
  • plugins/session-flow/scripts/tests/test_save_point.py

What changed. The push only moves or removes comments. No code, test, parametrize value or expected value changes.

  • hop_chain.py: two inline comments in fill_skeleton are now one sentence in its docstring.
  • save_point.py: the explanatory comments above DIRECTION_HOPS_KEPT and REWRITE_MARK are removed. The constants keep their values (3, "- Folded: ", "Rewritten").
  • test_save_point.py: a comment inside a parametrize list and the shape-3 section-header comment block are removed. The test bodies are unchanged.

Behavior is the same as at the head this lane reviewed before, which had no findings.

Blocking only. This lane already reviewed an earlier head, so this review reports only blocking findings. Losing the explanation of the 3-hop fold window next to DIRECTION_HOPS_KEPT would at most be an advisory point, so it is not reported.

Closing issue. The PR says Refs: #16427, and the context file has no closing-issue section. No acceptance criteria were checked, and none are reported as met.

Loosened checks. Loosened-check verdict: fail (default: the prompt has no loosened_check_verdict or loosened_check_patterns line); patterns: 0. No test, assertion or check is relaxed in this push, because only comments were removed.

Verification. I ran nothing: this lane has no shell. The CI fix this commit claims is the author's own and unverified.

Spend and holds. The push spends nothing, and nothing in it meets a hold class.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44184206635

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 51132b4
Run 44184206635

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 51132b44a5c59684423f31b73ac6b4ba5020d8f8, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 51132b4

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-16943-51132b44a5c59684423f31b73ac6b4ba5020d8f8, expires on 2026-12-17.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=HIGH demote=true head=51132b44a5c59684423f31b73ac6b4ba5020d8f8 rubric=10.2.1 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 4442bc7 Nov 17, 2026
47 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-16427-44162700131-1 branch November 17, 2026 22:32
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 4442bc75405f976722dc48e6e79cd49d84ac9c09; later checks count it verified from this comment.

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.

0 participants