Repository navigation
chore(dev): add cleanup-agent-state.sh (drops stale stashes + dead-PID worktrees) - #73
Merged
Merged
Conversation
lusoris
enabled auto-merge (squash)
May 28, 2026 19:35
…D worktrees) Persists the cleanup utility written by a previous agent run that was only committed inside that agent's worktree and would have been lost when the worktree was pruned. The script removes agent-* worktrees whose lock-holder PID is no longer alive and drops git stashes that are redundant (on master, detached HEAD, or branches that still exist locally). Supports --dry-run to preview changes without modifying state. Deliverables: - no digest needed: dev-tooling addition - no ADR needed: dev tooling, no architectural decision - no rebase-sensitive invariants - reproducer: bash scripts/dev/cleanup-agent-state.sh --dry-run - changelog.d/added/dev-cleanup-script.md - docs/rebase-notes.md entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
force-pushed
the
chore/dev-cleanup-script-20260528
branch
from
May 28, 2026 21:13
0ceb922 to
7409803
Compare
5 of 9 tasks
lusoris
added a commit
that referenced
this pull request
May 29, 2026
Adds a developer utility script that sweeps stale agent worktrees whose lock-holder PID is no longer alive, and drops ephemeral git stashes on master / detached HEAD / still-existing branches. Supports --dry-run for safe inspection before any destructive action. Only touches agent-* named worktrees to stay conservative. Re-do of PR #73, which merged with no diff due to an agent state error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
added a commit
that referenced
this pull request
Sep 6, 2026
… run (#1349) The Containerfile's own layout comment has always described compat/ as "pip-installed via the python/ shim", and the Netflix golden YUV fetch exists, in its own words, "so that `pytest python/test/` passes inside the container without any host-side manual provisioning". Nothing ever performed that install, so the command died at import with ModuleNotFoundError: No module named 'slugify', and the fixture fetch served no reachable purpose. Found while running the epic #1246 GPU smoke, which had to fall back to the CLI because the suite could not be collected. Installs python/ (package name vmaf, re-exporting compat/python-vmaf per ADR-0700) into /opt/vmaf-venv, first among the editable packages so the ai/ and vmaf-tune pins resolve last and win on shared dependencies. Adds a build-time assertion that the harness imports and the golden suite collects, because the failure mode is silent: the build stayed green for a long time while the command those fixtures exist for could not run at all. --collect-only keeps it to an import plus collection check; the suite itself is a CI gate, not a container build step. The interpreter is spelled /opt/vmaf-venv/bin/python explicitly because ENV PATH is set below this layer, so a bare python3 here would be the system interpreter. VERIFIED by a full dev-mcp build: #72 harness import OK: /build/vmaf/compat/python-vmaf/__init__.py #72 62 tests collected in 0.89s #73 naming to docker.io/library/vmaf-harness-test:local That build needed the nv-codec-headers mirror fallback from #1348 applied locally, because code.ffmpeg.org has been unreachable all day; the fallback was NOT committed here and is not part of this change. Once #1348 lands this branch builds on its own. no docs needed: dev/Containerfile is build infrastructure; the user-visible effect is that a documented command now works, and docs/development/dev-mcp.md already tells operators to run the suite in the container no state delta: closes no tracked bug id -- the gap was between the Containerfile's stated intent and its contents, not a defect in shipped code Co-authored-by: Lusoris <lusoris@pm.me> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/dev/cleanup-agent-state.shwritten by a previous agent run that existed only in its ephemeral worktree and would have been lost at worktree pruning.agent-*worktrees whose lock-holder PID is dead; drops redundant stashes (onmaster, detached HEAD, or branches that still exist locally).docs/development/agent-worktree-discipline.mdexplaining when and how to run the script.Reproducer / smoke test
bash scripts/dev/cleanup-agent-state.sh --dry-run # Prints what would be removed — no changes madeSix deep-dive deliverables
bash scripts/dev/cleanup-agent-state.sh --dry-run(above)changelog.d/added/dev-cleanup-script.mddocs/rebase-notes.mdentry addedState.md
No bug opened or closed — dev tooling only; no state.md row required.
🤖 Generated with Claude Code