Skip to content

docs(adr): record handoff shape 4 and its tool-owned byte budget - #17875

Merged
kyle-sexton merged 2 commits into
mainfrom
docs/adr-handoff-shape-4
Nov 21, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
docs/adr-handoff-shape-4

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #17877

Summary

Records the shape-4 handoff decision that #17677 shipped, as ADR 0115.

Fix

  • New docs/adr/0115-write-handoff-shape-4-with-binding-sections-first-and-a-tool-owned-byte-budget.md:
    shape 4 is a new stored shape, binding sections come first and never move, new and fill own
    the byte budget, fit and verdict, and binding content over the cap prints OVER-CAP.
  • ADR 0084's status now says its decision 3 is superseded by ADR 0115. ADR 0091's status says its
    decision 1 is superseded in part by ADR 0115. The owner approved both edits in session.

Verification

  • Constants cited in the ADR were read from the merged tree: HANDOFF_SHAPE = 4,
    WRITABLE_SHAPES = (2, 3, 4), DIRECTION_HOPS_KEPT = 3 (save_point.py), MOVE_ORDER
    (handoff_fit.py:26), cap_bytes=24_600 (handoff_chain.py:195), and the OVER-CAP: line
    (save_point.py:1907).
  • Citation sweep: two eval cases cite ADR 0091 decision 1 for its retire-by-relevance rule, which
    stays in force, so they keep their citations. Nothing cites ADR 0084 decision 3.

Related

🤖 Generated with Claude Code

ADR 0115 records the shape-4 decision merged in #17677: a new stored
shape with binding sections first, and new/fill owning the budget, fit
and verdict. It supersedes ADR 0084 decision 3 and, in part, ADR 0091
decision 1; their status lines say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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-21T09:14:14.760972Z 024d50f PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 024d50f942

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

`new` folds Direction changes lines 3 or more hops old behind a
`- Folded:` line. `fill` moves whole movable sections, newest Direction
changes lines included, and leaves its `- Moved:` pointer inside the
moved section, not in Review before you continue (handoff_fit.py:141-160).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44888522718, attempt 1

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

Failed GitHub API calls

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

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: no security issues found

I read every hunk of all 3 changed files in .claude-lane/pr.diff:

  • docs/adr/0084-…: the Status line now says Decision 3 is superseded by ADR 0115.
  • docs/adr/0091-…: the Status line now says Decision 1 is superseded in part by ADR 0115.
  • docs/adr/0115-…: a new ADR on handoff shape 4. It covers the section order, the byte budget owned by new and fill, the age fold, the over-cap move and the OVER-CAP: reporting.

Result: There is nothing in this pull request to hold or flag.

  • Changed files: All three are architecture decision records, not code or config. They change no workflow, script, action, token request, trusted-actor list, kill switch, merge hold or plugin manifest.
  • Trusted paths: None of the files matches a trusted-path glob.
  • Standing instructions: No CLAUDE.md, AGENTS.md, rules file, skill or agent body, or hook list is deleted or softened. The instruction-surface lens does not apply.
  • Manifests: No plugin manifest changed, so there is no manifest block.
  • Prior state: There are no prior findings from this lane and no settled threads to check.
  • Embedded text: Nothing in the PR text tries to direct the review.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: ADR 0115 (handoff shape 4)

This pull request changes only documentation. It adds ADR 0115 and adds supersession notes to the status lines of ADR 0084 and ADR 0091. I read all three files' hunks in full and checked what the ADR says against the code in plugins/session-flow/scripts/.

Matches the code:

  • HANDOFF_SHAPE = 4 and WRITABLE_SHAPES = (2, 3, 4) (save_point.py:163-167).
  • DIRECTION_HOPS_KEPT = 3 and FOLD_PREFIX (save_point.py:179-180).
  • MOVE_ORDER is Observations, Suggested skills, then Direction changes (handoff_fit.py:26).
  • The cap is 24,600 bytes (handoff_chain.py:245).
  • The shape-4 section table (handoff_chain.py:200-244) has the same binding sections in the same order as Decision 2, the same three movable sections, and Prior sessions and Resume prompt as carried.
  • fit() moves whole sections and puts the - Moved: pointer inside the moved section (handoff_fit.py:141-161). That agrees with the corrected Decision 3, the point the settled thread covered; this review does not raise it again.
  • read --section exits 1 when the file or heading a pointer names is missing (tests/test_save_point_shape4.py:323-329).

Finding (1): Decision 4's heading says binding content over the cap is "reported, not failed". The code does fail it: validate FAILs OVER-CAP and exits 1. Only fill and emit exit 0. Details and suggested wording are in the inline comment.

Other checks:

  • Closing issue: the pull request only refers to Shape-4 handoff: eval expectations and link ignore that change with it #17838 and closes no issue, so there are no acceptance criteria to check.
  • Paved paths and path-scoped rules: none were checked against this documentation-only change.
  • Manifests: no plugin manifest changed.
  • Embedded text: nothing in the pull request context, settled threads or prior findings tries to direct this review.
  • Loosened checks: no check is loosened. Loosened checks would be marked: fail (default; the prompt gave no loosened_check_verdict or loosened_check_patterns lines); patterns: 0. The prompt gave no loosened_check_decision_record: line, so the citation requirement was not checked.

I checked the finding myself against the source and its tests; no separate verifier subagent was dispatched.

Verifier dropped 0 of 1 candidates.

critical-findings: 1

Findings not posted inline (their path, line or side is malformed):

  • docs/adr/0115-write-handoff-shape-4-with-binding-sections-first-and-a-tool-owned-byte-budget.md:49: The heading says OVER-CAP is "reported, not failed", but validate does fail it. Only fill (and emit) exit 0 on it. validate turns OVER-CAP into a FAIL and exits 1:

  • save_point.py:2188-2189 records the OVER-CAP verdict with f.fail(message, CheckKind.OVER_CAP_BINDING).

  • The docstring at save_point.py:76-80 says "a shape-4 file never passes UNVALIDATED: binding content over the cap FAILs naming the section".

  • emit prints "validate fails it; the prompt is emitted" (save_point.py:2613-2619).

  • tests/test_save_point_shape4.py:169-176 (test_binding_content_over_the_cap_fails_naming_the_section) checks for returncode == 1 and a FAIL: OVER-CAP: Decisions in force holds … line.

  • harness/hop_chain.py:1309 counts it among a hop's FAILs.

As written, the ADR tells a reader that an over-cap shape-4 handoff passes validation. The code says it passes the write and the emit but fails validate. Suggested wording: "Binding content over the cap is written, not refused. When the binding and carried sections alone exceed the cap, fill still writes both files and the resume prompt, exits 0, and prints one OVER-CAP: line naming the section and how to shrink it. validate FAILs the file on that line, and emit still prints the prompt." The ADR 0091 status line ("binding content over the cap reports OVER-CAP") can stay as it is.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 37bf892ec78e16f39fae01fe48ed30420b2e71b4. What it wrote, as data:

Summary: The pull request links only #17838, through a `Refs:` line, so it is judged as delivering
  part of that issue. That issue covers three changes that ride with #17677: the `expected_fail`
  patterns in two resume evals (re-oversized-brief hop 4 and re-rule-after-size-fail hop 6) and a
  four-name `.lycheeignore` entry. It is done when #17677 merges with exactly those changes and no
  other widened expectation. This diff changes none of those files. It adds ADR 0115 (handoff shape
  4 and a byte budget owned by the tool) and updates the status lines of ADR 0084 and ADR 0091 to
  say which of their decisions ADR 0115 supersedes. The body says the part it delivers is the ADR
  recording, which is outside the issue's scope, so under the `refs` rule this fails. I found no
  correctness or safety problem: the changes are docs only, nothing in the takeover set or any hold
  changed, no binary files, and no credentials. The supersession cross-links agree across all three
  ADRs. The `Select Tests` job and the lint and check jobs passed, and the test suites were skipped
  by design because only docs changed. I found no text trying to steer the reviewer.
- PR body: `Refs: #17838` names an issue whose spec covers only the two resume-eval `expected_fail`
  patterns and the `.lycheeignore` entry for #17677. Writing ADR 0115 and editing the status lines
  of ADR 0084 and 0091 is outside its scope. Point the `Refs:`/`Closes:` line at an issue whose
  trusted spec asks for this ADR (file one if none exists), or move this work into a pull request
  for such an issue.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 21, 2026
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 65101f4 Nov 21, 2026
64 checks passed
@kyle-sexton
kyle-sexton deleted the docs/adr-handoff-shape-4 branch November 21, 2026 09:35
@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