Skip to content

v0.4.1 — order-free CLI & snapshot-safe inner loop

Choose a tag to compare

@xenups xenups released this 17 Oct 01:02

Phase 11.1: real-world friction from the Detailist PR #222 run removed, fail-closed governance unchanged.

Fix 1 — order-independent unified CLI (asha/cli.py)

asha /path/to/repo --exec "pytest -q" --base origin/dev
asha --base origin/dev /path/to/repo --exec pytest -q --json
asha --json /path/to/repo --stack b1 b2 b3 --base origin/dev
asha /path/to/repo --context a.py:Foo b.py:Bar
asha /path/to/repo --verify --base origin/dev
asha /path/to/repo --exec -- pytest -q

Global modifiers (--root, --base, --json, --no-color, --ui, --ui-out) are extracted wherever they appear (never after verbatim --); a positional PATH binds root before any mode flag; a mode owns its tokens up to the next known Asha flag (so --exec python -c ... works); conflicting root bindings exit 2 instead of guessing; legacy subcommands (status, inspect, run --spec) and schema-v1 flags (--paths, --no-execute) are unchanged.

Fix 2 — snapshot-safe in_place_atomic

A dirty WIP tree is no longer TIP_DIRTY: the exact pre-execution state (HEAD, index tree, tracked WIP blobs, untracked files, porcelain status set) is snapshotted and restored on failure or scope violation — never git reset --hard HEAD, so uncommitted work survives the inner TDD loop. A pass on a dirty tree returns state: DONE, validation_result: PASS, ready_to_push: false, reason: WIP_UNCOMMITTED_PASS; a clean-tree pass stays commit-bound and pushable. @diff auto-scope includes working-tree changes. Unmerged index entries, in-flight git states and clean-tree diff defects still fail closed before anything runs.

Verification

  • tests/test_mcp_phase11_1.py (15 new tests: CLI permutations, -- verbatim, conflicting root exit 2, dirty-WIP fidelity, out-of-scope rollback, WIP pass + post-commit seal, @diff WIP scope).
  • Full suite 959 passed / 1 skipped (baseline 944); ruff 0; mypy 0 issues in 130 files; governance gates 78 + 73 passed; CI + Asha Governance green on 6f7bbbd.