docs: let maintenance clones self-heal and abort without leaving debris

A failed nightly run left edits in the maintenance clone, and every later run
correctly refused to work on a dirty worktree, so one failure stalled the whole
pipeline until morning.

Maintenance task commands now recognise a gitignored .maintenance-clone marker.
In a marked disposable clone they discard leftover debris, return to main, and
continue; in a human working copy they still stop and touch nothing.

Add an explicit abort protocol: revert your own edits, confirm the worktree is
clean, release the claim, and report. Restore the honest skip that the
complete-file rule had squeezed out, since a laundered fix is worse than a
documented skip, and describe how to handle a file that is entirely an
external-data boundary instead of inventing generic JSON contracts.
This commit is contained in:
Bohdan Triapitsyn
2026-08-17 21:49:33 +03:00
parent d9f1c0d44c
commit 344c1b3ce3
6 changed files with 106 additions and 7 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ Verify the worktree is clean:
`git status --porcelain`
If the output is not empty, stop immediately and report it. Do not stash, reset, or discard anything.
If the output is not empty and the repository root contains a `.maintenance-clone` marker file, this is a disposable maintenance clone and the changes are debris from an earlier failed task. Recover it with `git checkout -- .`, `git clean -fd`, `git checkout main`, `git pull`, report exactly which files you discarded, and continue.
If the marker file is absent, stop immediately and report it. Do not stash, reset, or discard anything.
Read `AGENTS.md`, and read `.opencode/commands/as-fixes.md` in full, including the sections "What a good fix looks like" and "Hard prohibitions". Those describe the standard the anti-slop PRs were supposed to meet. Your job includes verifying they actually met it.