Repository navigation
fix(disk-hygiene): release the clean session belt when no run is open - #11250
melodic-automation-lanes[bot] wants to merge 2 commits into
Conversation
Lane-Activity: work-resolve-issue/resolve-issue
| # A manual-lane step (null), or a corrupt value. | ||
| return True | ||
| try: | ||
| ended = os.stat(ends_with).st_mtime >= opened_at |
There was a problem hiding this comment.
A run ends when a file at a model-chosen path has mtime >= opened_at, and the model can create that file itself. The hook matcher is only Bash|PowerShell (SKILL.md line 8), so the Write and Edit tools can create <plan>.run-end.json or the --report path. The marker under clean-runs/ can also be overwritten, because that directory is not engine-owned. A deliberately blocked preview makes the engine write the run-end file as well.
Exploit path: text injected during a run (filenames or content in the scan target) gets the model to write one of those files. _run_open then returns False and unlinks the marker, so gh, rm and Remove-Item calls are no longer denied. Before this change the belt stayed on for the whole session, and the Bash lane was the control against an injected model. The PR claims releasing the belt "opens no delete path", but that is true only for engine deletes. Manual rm and PowerShell deletes were what the belt covered, and a signal the model controls now releases it.
Suggested direction: end a run only on a signal the model cannot write, such as the engine itself writing the end file into an engine-owned directory (add clean-runs/ and the end-file location to ENGINE_OWNED_DIRS). Alternatively, drop self-service run-end for blocked previews and rely on the idle timeout.
severity: IMPORTANT
claude-lane: claude-security-review
|
claude-security-review reviewed I found no security issues in the incremental change. The only file changed since the last review is Instruction-surface check. The bullet describes when the belt, the deny-by-default Bash lane, is active. It does not grant, widen or remove any permission or deny rule.
Not a security finding. The new wording may describe the run's lifetime less accurately than the old text.
Manifest items: none in this increment. Prepaid-credit or subscription spend: none. critical-findings: 0 |
|
|
||
|
|
||
| def _run_open(authority: str | None, session_id: str | None) -> bool: | ||
| """Whether this session has an open clean run, so the belt holds. |
There was a problem hiding this comment.
Advisory: the marker is trusted state a session can write itself. _run_open releases the belt whenever the marker file says the run ended: ended = os.stat(ends_with).st_mtime >= opened_at, or the mtime is past the idle timeout. The marker sits at a predictable path, <data-root>/clean-runs/<session_id>.json. The belt's job is to stop the session issuing unprompted deletes while a run is open, and the model can use a non-Bash tool such as a file write to create the marker.
Example: while a run is open, write {"version":1,"opened_at":0.0,"ends_with":"/etc/hostname"} to that path. On the next call os.stat(ends_with).st_mtime >= 0.0 is true, the marker is unlinked, and _belt_released stands down. Before this change nothing the model could write turned the belt off.
The PR notes cover only a forged marker made through an engine --report. That one reads as corrupt and holds. They do not cover a direct write. The issue says releasing opens no delete path because the engine gate and approval token remain, but non-engine rm and PowerShell deletes now fall to the session's own permission rules, and those are what the belt was holding back.
Options:
- Add
clean-runsto the engine-owned or guard-protected set and deny writes to it. - Make the marker tamper-evident, for example by holding the end signal only in files the engine itself writes.
- Record the accepted residual in
safety-model.md, which currently lists only the unwritable-data-root and--reportcases.
claude-lane: claude-review
|
claude-review reviewed Incremental review of One advisory finding, inline: the shortened wording no longer says that a preview that produces a plan keeps the belt on until The |
|
The pr-unblock lane stopped
When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean. To run it again on this head now, dispatch the gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=11250 -f activity=fix-ci |
Lane-Activity: pr-unblock/fix-ci
| as of 2026-10-11; recheck when that section changes what the field grants). Consumer permission | ||
| policy remains authoritative. | ||
| - The Bash lane is deny-by-default: only the literal-word bundled scan, inventory, preview, | ||
| - The belt holds only while a clean run is open: from a `preview`, `apply`, `handoff-apply` or manual-lane `handoff-verify` until that step ends, or until an hour passes with no engine call; a `scan` alone opens no run. Outside a run, the belt denies nothing that does not name the engine ([the safety model](reference/safety-model.md), "When a run is open"). |
There was a problem hiding this comment.
This rewrite loses the span that matters most. The old text said the belt holds "from a plan's preview until that run's apply or handoff-apply writes its report or the preview ends in manual-handoff-lane or blocked." The new text says "from a preview, apply, handoff-apply or manual-lane handoff-verify until that step ends." A reader can take that to mean the belt drops once a preview completes, before the apply. reference/safety-model.md:615-625 says otherwise. A preview that yields a plan records <plan>.run-end.json, and the engine writes that file only for a manual-handoff-lane or blocked outcome or for the later mutation's --report. So the marker, and the belt, stays through the gap between preview and apply. The clause also stops covering a scan that precedes a preview, which the safety model treats as audit-only. This file is the guard's operator contract, so please restore the preview-to-apply span. For example: "from a preview until the run's apply/handoff-apply report is written or the preview ends in manual-handoff-lane or blocked; from each manual-lane handoff-verify until an hour passes with no engine call."
claude-lane: claude-review
|
The pr-unblock lane stopped on this pull request and needs a person: the lane could fix a failing check only by weakening a required check, and the head has no fresh fixer round left (it ran one, or an earlier lane stop already spent its same-head retry), so a person decides.
To resume, deal with the reason above, remove the gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=11250 -f activity=fix-ci |
|
The pr-unblock lane escalated this pull request as |
|
Superseded by #11295, which carries this change plus its review and security fixes. |
Closes #6377
Summary
Opened by the work-resolve-issue lane. The run's own summary:
Not verified
Fix
Verification
The runner ran each check from the base copy against ff67cba:
The run reports:
Left out: the items under Not verified.
Related
#6377