Skip to content

feat: mark each safe point to /clear for Headroom's auto-clear - #456

Merged
crenshawdev merged 6 commits into
mainfrom
feat/headroom-clear-point
Dec 4, 2026
Merged

crenshawdev merged 6 commits into
mainfrom
feat/headroom-clear-point

Conversation

@crenshawdev

@crenshawdev crenshawdev commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Cadence 4.6.0. Every command whose report says it's safe to /clear first now marks that safe point, with the command that picks up after it, for a host that clears on its own. Today that host is Headroom 0.2.0's auto-clear. The new cadence-core/bin/clear-point.mjs writes { "next": "/cadence:cad-plan 2" } to the file HEADROOM_CLEAR_POINT names, and with the variable unset it writes nothing, so without Headroom nothing changes. The old path marks in the done steps of context, plan, execute, verify, new-project and adopt. The agile path marks /cadence:cad-agile after a report that finished its step, while the release has a next step.

The script won't mark again when nothing has moved since its last mark, so a step that keeps stopping can't loop a clear and a retry. On the old path it compares the working tree by HEAD plus the size and time of each path git status lists and each file in .planning, leaving out the logs Cadence's hooks append on every tool call. On the agile path it compares the release's next step. It reads no file content and writes nothing into .git, only a small fingerprint file under the git directory.

Verified: 22 tests in tests/clear-point.test.mjs and the moved pins in arg-contract.test.mjs and seam-calls.test.mjs. The full suite shows no failures beyond the 44 that fail on untouched 4.5.3 on my machine, and self-verify is clean. Two code reviews and their fixes. A live run of the agile path with Headroom in a scratch project, where each safe point was marked, Headroom cleared above its clear point, and Cadence picked up in the fresh session from disk. The suite is pinned to 4bebbda, the 4.x tests tip, which cadence-tests PR #27 merged into its main.

Byte budgets rose where the mark went in: 156 to 159 bytes for adopt, context, execute, new-project and plan, 302 for verify, 188 for the /cad-agile skill, and 38 for the convention in references/conventions.md. This change still has to be merged forward into release/5.0.

clear-point.mjs writes the next command to the file HEADROOM_CLEAR_POINT names, and only there. It won't mark twice with nothing changed, so a step that keeps failing can't loop a clear and retry.
…e-to-clear closer

From the review: git status hid edits to an already-changed file and new files in an untracked folder, so the tree is fingerprinted through a throwaway index. The agile path marks only when the release's next step has moved, so a stopped run gets one retry at most. verify's mark no longer doubles the slash, and new-project and adopt mark theirs.
From the re-review: git add -A copied every untracked file into .git, so a 1 GB file timed out the mark and left an 800 MB temp pack each time. The fingerprint is now HEAD plus the size and time of each path git status lists and each file in .planning, found where Cadence finds it, leaving out the logs its hooks append on every tool call.
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@crenshawdev
crenshawdev merged commit a402437 into main Dec 4, 2026
19 checks passed
@crenshawdev
crenshawdev deleted the feat/headroom-clear-point branch December 4, 2026 15:52
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.

1 participant