Conversation
Upgrade the plugin from a CWD-relative single-run state model to a portable, configurable, multi-run architecture: - scripts/state.py: new shared module — git-root discovery, XDG state home resolver, hashed repo identity, RunStateLock (fcntl.flock), atomic writes, schema v1→v2 migration, drift detection - scripts/controller.py: imports state.py; all mutating commands use RunStateLock + reload; new commands: list-runs, show-run, migrate-legacy-state, archive-run, accept-drift; --state-dir and --run-id global options; init --reuse errors on ambiguous active runs - scripts/stop_gate.py: uses shared resolver; _block_and_exit atomically reloads state inside the lock before incrementing stop_gate_blocks - tests/test_state.py: 25 new tests covering all acceptance criteria - tests/test_controller.py: regression tests for budget exhaustion and --reuse ambiguity; --state-dir wired through run_controller helper - docs: README and all skill MDs updated with XDG, multi-run, migration, drift, and shell examples All 31 tests pass. Ruff clean. Co-Authored-By: Claude Sonnet 4.6 <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/state.py— shared module for git-root discovery, XDG state-home resolution, hashed repository identity,RunStateLock(fcntl.flock), atomic writes, schema v1→v2 migration, and drift detectionscripts/controller.py— all mutating commands use lock+reload; new commandslist-runs,show-run,migrate-legacy-state,archive-run,accept-drift;--state-dir/--run-idglobal options;init --reuseerrors when multiple active runs existscripts/stop_gate.py— uses shared resolver;_block_and_exitatomically reloads state inside the lock before incrementingstop_gate_blockstests/test_state.py— 25 tests covering all 12 acceptance criteria (nested dirs, worktrees, credential stripping, XDG precedence, concurrent runs, drift, migration, concurrency, etc.)tests/test_controller.py— regression tests for review-budget exhaustion and--reuseambiguityTest plan
python3 -m pytest tests/test_state.py tests/test_controller.py -q→ 31 passed.venv/bin/ruff check→ all checks passedpython3 -m py_compile scripts/state.py scripts/controller.py scripts/stop_gate.py→ cleancontroller.py statusfrom repo root and a nested subdirectory resolves the same runcontroller.py migrate-legacy-stateimports.ai/autonomous-development/without deleting originalsCLAUDE_AUTONOMOUS_STATE_HOMEset🤖 Generated with Claude Code