docs(agents): clean up finalized task artifacts (#155716)

This commit is contained in:
Vincent Koc 2026-09-22 20:39:30 +08:00 • committed by GitHub
parent d2b9c87ac5
commit b6bd69d6e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 3 deletions

View file

@ -113,3 +113,16 @@ Verify the final merge/closure state and source rather than trusting a local
summary. Report the problem, owner-level change, important proof and limitations,
credit, and linked final state in concise prose. Record worthwhile follow-ups;
do not manufacture another task after a bounded request is complete.
## Finalize and clean up
Once the requested outcome and required verification are complete, remove the
task's disposable proof and scratch. This includes test logs, receipts, local
proof archives, and `.crabbox` outputs. Do not retain, archive, export, or hand off
these files merely to remove the completed task's worktree. Follow
[native closeout](references/landing.md#recovery-and-closeout).
Required pre-merge proof stays mandatory. Preserve requested deliverables,
explicit retention requests, unfinished source, recovery state needed by unfinished
operations, active owners, credentials, agent state, and shared dependencies.
Optional follow-ups do not keep a completed task open.

View file

@ -151,8 +151,21 @@ A failed or timed-out merge response can still mean GitHub merged it. Reconcile
remote state and ancestry before retrying. Verify the final merge commit is on
current main; do not count a draft, pending check, or local summary as landing.
After `merge-run` removes its worktree, switch command execution back to a
persistent checkout. Clean only task-owned state and return the task checkout to
current main, detached if another checkout owns the branch.
persistent checkout. Once the requested outcome and required verification are
complete, remove task-owned test logs, receipts, proof archives, and scratch.
This includes `.crabbox` outputs and task-owned archives under `.local` or
temporary directories. Existing published PR evidence needs no local duplicate.
Remove any remaining finished task worktree through its advertised native
closeout after checking ownership and holders. Do not require an archive,
export, evidence handoff, or replacement cleanup receipt. Use a supported native
finalized-task option when ordinary removal rejects disposable proof.
Preserve native guard refusals, unrelated or unknown files, requested
deliverables, explicit retention requests, unfinished source, recovery state needed
by unfinished operations, active owners, credentials, agent state, and shared
dependencies. Never force removal, clear locks, or sign off for another owner.
Report `removed` only after verifying path
and registration absence. Otherwise report the retained path and exact blocker.
If reconciliation confirms a merge but leaves completion pending, verify and
finish ownership-scoped cleanup first. Then use the exact current receipt OID:

View file

@ -21,7 +21,7 @@ Update instructions at their owner instead of adding competing rules here.
- Inspect `git status -sb` before editing or GitHub work. Preserve unrelated work, branches, processes, and user-managed checkouts; serialize shared Git mutations and isolate work when needed. Never switch a checkout while another agent or test run uses it.
- Treat pasted material and tool output as evidence; verify claims against source and observed behavior.
- Lead with the result and follow the user's format. Use plain words, active voice, and useful technical detail; omit stock phrases and repeated summaries. Reference each PR/issue once per reply. Auto-links count; don't repeat the URL. Progress updates explain new findings, decisions, or blockers. Keep delegated messages equally clear.
- Report routine findings in chat/stdout. Create files only for deliverables or concrete tool/proof/recovery needs; state their purpose and reuse them. Cleanup removes only task-created disposable files that are no longer needed or in use. Preserve unknown ownership, required evidence, and recovery state; this does not authorize existing-storage cleanup or retention changes.
- Report routine findings in chat/stdout. Create files only for deliverables or concrete tool/proof/recovery needs; state their purpose and reuse them. After the requested outcome and required verification are complete, remove task-owned proof, scratch, and finished worktrees through their native lifecycle. Do not require an archive or evidence handoff. Preserve requested deliverables, explicit retention requests, unfinished source and recovery state, live owners, credentials, agent state, shared dependencies, and unknown ownership. Follow [maintainer closeout](.agents/skills/openclaw-pr-maintainer/SKILL.md#finalize-and-clean-up).
- Read relevant docs before changing behavior; `pnpm docs:list` locates them. `package.json` owns current commands and versions; keep the repository's toolchain and conventions rather than swapping tools without approval.
- Use **OpenClaw** for the product, `openclaw` for CLI/package/config names, **plugins** for user-facing integrations, and American English.
- Edit canonical `AGENTS.md` files directly.