Skip to content

archive_plan_sessions.py generates a pointer that references a nonexistent section and claims a step it never performs #53

Description

@topij

Found by CodeRabbit on the wrap-up PR (#52) — a valid finding whose fix belongs in the engine, not the handoff.

What the engine writes

scripts/archive_plan_sessions.py:73-74 hardcodes the archive pointer:

f"> Older session entries (below the live blocks above) live in [`{label}`]({link}).\n",
'> Active open items from them are folded into the "Open for next session" lists above.\n',

The first line is fine. The second is false in two independent ways.

1. It references a section that does not exist

grep -c 'Open for next session' docs/kit-handoff.md        -> 1

That single occurrence is the generated pointer itself. This repo's handoff calls the section **Open, and owned by nothing yet** (3 occurrences). The shipped template docs/templates/handoff.md.tmpl contains no such heading either:

grep -c 'Open for next session' docs/templates/handoff.md.tmpl   -> 0

So the engine emits a cross-reference to a heading that exists in neither this repo nor the skeleton it ships to adopters. Every adopter who runs an archive sweep gets a dangling pointer.

2. It claims a step the script never performs

There is no folding logic anywhere in the file — the script moves blocks verbatim, which its own docstring says plainly:

It only ever moves content — every cross-reference (ticket ids, PR links, commit shas, …) is preserved.

So the generated sentence asserts that open items were reconciled into a live list. Nothing did that. On this sweep it happened to be harmless (the swept 2026-07-25 block ended ✔ Superseded by the Phase 3a session, so it carried nothing open) — but a future sweep of a block with live open items would move them out of the handoff while the pointer asserts they were folded forward, which is precisely how something gets silently dropped between sessions.

Why file rather than fix in the handoff

The text is engine-generated. Hand-editing it in kit-handoff.md would be overwritten by the next sweep, and editing the engine in an adopter is the anti-pattern the kit exists to prevent.

Suggested fix

Drop the second line, or replace it with something true — e.g. "Open items from swept blocks are NOT carried forward automatically; check the history file before assuming an item was closed." That inverts the claim into a useful warning and stops the engine asserting work it does not do.

If a cross-reference to a live section is wanted at all, the section name has to come from config or be discovered from the document, not hardcoded — the same "no hardcoding" rule (Principle #10) that moved review markers out of pr_watch.

Related

The recurring theme of this session's 17 issues: a narrative surface asserting something the artifact does not support. This one is notable because the false claim is generated by an engine, so it reproduces identically in every adopter rather than depending on an author's carelessness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions