Skip to content

session-flow handoff: the hot-file size cap forces lossy trimming of carried decisions on long chains #16427

Closed

Description

@kyle-sexton

Problem

A shape-3 handoff (/session-flow:handoff, scripts/save_point.py) has a fixed 24,600-byte cap on the hot file. The part of the file that "never moves" grows every hop, so on a long chain the cap can only be met by shortening what the session writes, and the validator cannot tell a harmless shortening from one that drops a detail the next session needs.

Evidence

One session, hop 7 of a chain, 2026-11-15:

  • validate reported core 13071 bytes, carried 5054 bytes: 18,125 of 24,600 bytes were fixed before the session wrote anything, leaving about 6,500 bytes for nine written sections (review, criteria, remaining actions, open questions, observations, commands, environment, decisions, suggested skills).
  • The first fill produced 30,286 bytes. Reaching validate: PASS took 11 validate runs and about 25 Edit calls.
  • To fit, the session shortened decisions carried from earlier hops. Two lost binding text ("committing to main stays rejected"; which route a design answer takes) and the reading list lost the file holding the owner's verbatim answers. validate passed: it checks that a carried decision's id is present, not that its text survived. A side agent caught it; nothing in the tool did.
  • Restoring the text with amend put the file back over the cap (25,505 bytes). amend wrote it, as documented.

Across this project's transcripts (one grep pass, 802 .jsonl files): 115 contain at least one is over the 24600-byte hot-file cap line, 603 such lines in total, 14 in the worst file. UNVERIFIED as a count of sessions or of validate runs: a transcript line can repeat tool output, and subagent transcripts are included.

Causes, as read from the skill and the script's messages

  1. The core grows without bound. ## Direction changes carries one line per change per hop and is in the core, with ## Original goal, ## Current rules and ## Standing preferences. The cap is fixed. At roughly 1 KB of new core per hop, the written sections have no room left a few hops on.
  2. Decisions are retyped, not carried. new copies rules, the goal and the trail off disk. ## Decisions in force and ## Open questions are slots the model fills again each hop, so a carried decision can be reworded or shortened with no record.
  3. The size check comes last. The session learns the budget only from a validate FAIL after fill. new knows the core and carried sizes when it writes the skeleton and could print the remaining budget.
  4. The FAIL names a remedy with no command. "Move written non-core content into archive/.../h<N>-….md" has no subcommand before validate passes (amend is for after emit), so the remedy in practice is hand-editing until the number fits.
  5. validate after fill allows unbounded retries in practice. The skill says at most three attempts, then an UNVALIDATED banner; a session that can see the fix is one more trim away keeps trimming.

Proposed direction (for a design pass, not decided)

  • Carry ## Decisions in force and ## Open questions off disk like rules: new copies them, changes go through retire or an in-place rewrite under the id, and validate fails a carried entry whose text changed without one.
  • Bound the core: fold ## Direction changes lines older than N hops into the hop archive behind one pointer line, the way retired rules already move.
  • Have new print the byte budget left for the written sections, and have fill refuse an over-budget object with per-slot sizes before it writes.
  • Give the over-cap case a command that moves a named written section's overflow into the hop file and leaves a pointer.

Acceptance

  • A hop-8 handoff on a chain like the one above validates on the first fill, or fails once with per-slot sizes.
  • A carried decision whose text was shortened without a retire or an explicit rewrite fails validate.
  • The hot file's fixed part stops growing with hop count.

Next step

An audit of all handoff chains (how often carried text was reworded between hops, how many validate attempts per handoff) would size this properly; the grep above is only a first sign.

Activity

  1. added
    needs-triage
    on Nov 15, 2026
  2. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Knowable
    Flags: none
    Blocked by: none
    Blast radius: plugins/session-flow handoff script (save_point.py), its tests and the handoff skill text; read by anyone running /session-flow:handoff.
    Reversible: yes; each change is a code or doc edit that can be reverted.
    Open questions: none

    Decision recorded. The owner chose a first slice: carry decisions off disk and fold old direction changes into the hop archive.

    Question as put to the owner (Q46): the handoff size cap forces lossy trimming.

    • A (recommended, chosen): the first slice carries decisions off disk and folds old direction changes into the archive.
    • B: all four proposals.
    • C: audit the chains first.

    Owner's answer, 2026-11-17, typed in an agent session, verbatim: "Go with recommendations."

    The slice follows the refinement's recommendations: ## Decisions in force and ## Open questions are carried off disk, with a validate FAIL on carried text changed without a retire entry or a rewrite recorded under the same id in a marked field; ## Direction changes lines older than 3 hops fold into the hop archive behind one pointer line; the 24,600-byte cap stays fixed; no audit first. The budget printout and the overflow command are not in this slice.

    Decision comment. It settles the open design questions.

    What I understood: the handoff hot-file cap forces lossy trimming of carried decisions on long chains. Pull request #16943 merged with Refs: on this issue, so part of the first slice may already be done. The recent merged-PR list I was given was empty, so I could not check what it covered. What remains is whichever of the decision's acceptance items #16943 left, plus the items the decision deferred: the budget printout in new and the over-cap overflow command. Confirming what #16943 left is the next step.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Nov 15, 2026
  4. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: merged pull request #16943 names it with Refs: after its newest decision or refinement comment, so its work may already be done: close the issue if it is, or post a comment whose first line is **Decision recorded.** saying what is left, which sends it back through intake. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  5. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Bound the shape-3 hot file's fixed part and make carried decisions tamper-evident, so a long handoff chain fits the 24,600-byte cap without lossy hand-trimming.

    Related work

    Open questions

    1. The issue calls its direction 'for a design pass, not decided'. Which of the four proposals are in scope: all four, or a first slice?
      RECOMMENDED: Two slices: carry Decisions in force and Open questions off disk with a validate check on changed text, and fold old Direction changes into the hop archive. Leave the budget printout and the overflow command to a follow-up. Basis: judgment
    2. How many hops of Direction changes stay in the hot file before older lines fold into the archive behind one pointer line?
      RECOMMENDED: 3 hops, as a named constant in save_point.py, so the core stops growing from hop 4 on. Basis: plugins/session-flow/scripts/save_point.py:169
    3. What counts as an explicit rewrite of a carried decision, as opposed to a silent shortening that validate must fail?
      RECOMMENDED: Only a retire entry, or an in-place rewrite recorded under the same id in a marked field. A bare text change fails validate. Basis: judgment
    4. Is the 24,600-byte cap fixed, or may it be raised or scaled with the chain?
      RECOMMENDED: Keep it fixed. The acceptance item that the fixed part stops growing implies the cap stays. Basis: plugins/session-flow/scripts/tests/test_save_point.py:2463
    5. Must the audit of all handoff chains under 'Next step' happen before implementation, and are the acceptance items the whole done-when?
      RECOMMENDED: No audit first. Treat the three acceptance items as the done-when, written as checkable tests on a synthetic hop-8 chain. Basis: judgment

    Sources read

    • plugins/session-flow/scripts/save_point.py:115: lists the core sections, including Direction changes
    • plugins/session-flow/scripts/save_point.py:169: retired-section archive mapping, Direction changes goes to Retired direction changes
    • plugins/session-flow/scripts/tests/test_save_point.py:2463: HOT_CAP = 24_600 and the over-cap FAIL test

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  6. kyle-sexton commented on Nov 17, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner chose a first slice: carry decisions off disk and fold old direction changes into the hop archive.

    Question as put to the owner (Q46): the handoff size cap forces lossy trimming.

    • A (recommended, chosen): the first slice carries decisions off disk and folds old direction changes into the archive.
    • B: all four proposals.
    • C: audit the chains first.

    Owner's answer, 2026-11-17, typed in an agent session, verbatim: "Go with recommendations."

    The slice follows the refinement's recommendations: ## Decisions in force and ## Open questions are carried off disk, with a validate FAIL on carried text changed without a retire entry or a rewrite recorded under the same id in a marked field; ## Direction changes lines older than 3 hops fold into the hop archive behind one pointer line; the 24,600-byte cap stays fixed; no audit first. The budget printout and the overflow command are not in this slice.

    Acceptance criteria

    • plugins/session-flow/scripts/save_point.py new copies ## Decisions in force and ## Open questions from the previous hop off disk, as it does rules.
    • validate fails a carried decision or open question whose text changed without a retire entry or a rewrite recorded under the same id in a marked field, and passes one changed through either; tests in plugins/session-flow/scripts/tests/test_save_point.py cover the fail and both pass cases.
    • ## Direction changes lines older than 3 hops (a named constant in save_point.py) move into the hop archive behind one pointer line in the hot file; a test shows it.
    • A test on a synthetic hop-8 chain shows the hot file's fixed part (core plus carried) is no larger than at hop 4.
    • A test shows a synthetic hop-8 chain whose written sections fit the budget a hop-4 chain leaves passes validate on the first fill.
    • The hot-file cap stays 24,600 bytes (HOT_FILE_MAX_BYTES), and the existing over-cap FAIL test still passes.
    • The handoff skill text describes the off-disk carry, the rewrite marker and the 3-hop fold.

    Posted by an agent session.

  7. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    A listed human released the issue's Work status hold, so it goes back to intake triage.

  8. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"882c28b38f4e55198aa63dca8a35dfd215583eb627d1d3f00b9545ec53f3229b","body_sha256":"5173493f892bb2b3d5bc83c32a052442f6bdea0d4600797643cd1041d412d109"}

  9. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier stop, not a new one. The start gate stopped run 44127452530, the work-resolve-issue run that agent-ready started, before any model turn, because the GITHUB_TOKEN budget was under its start-gate share (limits.api github-token start-gate); that run ended at 2026-11-17T17:36:29Z. work-unblock has now removed and added agent-ready back to start a fresh run. A budget stop is the lanes' load, not a fault in this issue: it never counts toward limits.limit-stops-per-issue or the kill-switch wait.

  10. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor
    No description provided.
  11. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor
    No description provided.
  12. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    Pull request #16943 merged with Refs:, so this issue stays open and nothing starts the lane on it again. work-unblock removed status: ready and agent-ready, so the hourly triage sweep sends it back to intake triage. Admission then parks it at status: confirmed for a check of what that pull request left, until a **Decision recorded.** comment says what is left or someone closes it.

  13. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    The triage sweep dispatched intake triage for this issue (dispatch 1; 2 runs that reach intake, or 6 dispatches, hand it to a maintainer).

  14. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    Closing as completed: #16943 delivered the first slice the owner chose (decision comment). Each of the decision's seven acceptance criteria is met on main at d46efa97:

    The decision left two items out of this slice: the budget printout in new and fill, and an over-cap overflow command. #17735 carries them as a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    confirmed

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions