Skip to content

fix(session-flow): re-arm counter can collide with verbatim loop-prompt text #1518

Closed

Description

@kyle-sexton

Finding

Deferred from PR #1515 review (Codex, P2) on plugins/session-flow/reference/save-point.md.

The re-arm block delimits entries with a literal Re-arm <i> of <n>: counter line, and each entry
quotes the operator's original /loop prompt verbatim. If that verbatim prompt itself contains a
line reading Re-arm 2 of 3:, a consumer scanning for counter lines would treat prompt text as the
next entry boundary — splitting one command across two entries and corrupting the recovered set.

Why it was deferred rather than fixed in PR #1515

  • save-point.md and find-handoff/SKILL.md are prose contracts read by a model, not a
    mechanical parser. There is no scanner in the repository today that this collision can corrupt.
  • Every candidate escape is vulnerable to the same objection one layer down: fencing the verbatim
    prompt in a code block moves the collision to a fence terminator inside the prompt; length-prefixing
    moves it to the length header. Delimiter escaping in a prose contract has no fixed point, and the
    PR's review round was already the second in this lineage — the first (multi-line prompts truncating
    a physical-line stopping rule) was fixed in e9cf9026.
  • The realistic failure requires an operator whose loop prompt contains a line whose literal text is
    a re-arm counter. That is a robustness property of a hypothetical implementation, not a defect in
    what PR fix(session-flow): recover and enforce every loop re-arm, not just the first #1515 changed.

What re-opens this

Writing a mechanical parser (script, hook, or tool) against the re-arm detection contract. At
that point the encoding has to be unambiguous rather than merely unambiguous-to-a-reader, and the
entry boundary needs a real escape discipline — a length-prefixed encoding, or a fence with a
variable backtick count — with find-handoff moved in the same change, per save-point.md:
"Changing this shape is a knowing break of the detection contract below, and must move
find-handoff with it."

Related

Activity

  1. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    Superseded by the PR that filed it. Closing as no longer applicable.

    #1518 was filed at 08:34 to defer this finding from #1515's review. At 08:37, commit b95b1835 on that same PR actually fixed it rather than shipping the deferral: the literal Re-arm <i> of <n>: counter sentinel was replaced by a length boundary (Re-arm <i> of <n> — <L> lines: plus an <L>-body-line rule), so a consumer no longer scans for counter text at all. #1515 merged at 08:51:27Z carrying that fix.

    The collision this issue describes is not reachable against the shipped contract — there is no counter-line scan left to collide with. Leaving it open would read as known-outstanding debt against a contract that no longer has the defect.

    Verified during independent post-merge audit of #1515. Reopen if a consumer is found still parsing the counter line.

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

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions