Skip to content

chore(dev): add cleanup-agent-state.sh (drops stale stashes + dead-PID worktrees) - #73

Merged
lusoris merged 1 commit into
masterfrom
chore/dev-cleanup-script-20260528
May 28, 2026
Merged

lusoris merged 1 commit into
masterfrom
chore/dev-cleanup-script-20260528

Conversation

@lusoris

@lusoris lusoris commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persists scripts/dev/cleanup-agent-state.sh written by a previous agent run that existed only in its ephemeral worktree and would have been lost at worktree pruning.
  • Removes agent-* worktrees whose lock-holder PID is dead; drops redundant stashes (on master, detached HEAD, or branches that still exist locally).
  • Adds a "Cleaning up stale agent state" section to docs/development/agent-worktree-discipline.md explaining 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 made

Six deep-dive deliverables

  • Research digest: no digest needed: dev-tooling addition
  • Decision matrix: no alternatives: only-one-way fix (persist the script as-is)
  • AGENTS.md invariant: no rebase-sensitive invariants
  • Reproducer: bash scripts/dev/cleanup-agent-state.sh --dry-run (above)
  • changelog.d/added/dev-cleanup-script.md
  • docs/rebase-notes.md entry added

State.md

No bug opened or closed — dev tooling only; no state.md row required.

🤖 Generated with Claude Code

@lusoris
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
lusoris force-pushed the chore/dev-cleanup-script-20260528 branch from 0ceb922 to 7409803 Compare May 28, 2026 21:13
@lusoris
lusoris merged commit 7fba41a into master May 28, 2026
39 of 59 checks passed
@lusoris
lusoris deleted the chore/dev-cleanup-script-20260528 branch May 28, 2026 21:13
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 lusoris added this to the 1.0.0 — First release milestone Sep 4, 2026
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>
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