# workspace-cli AINative Completion Audit

- Audit date: 2026-07-11
- Scope: `ai-native-requirements.md` section 13 plus explicit health, isolation, loop, realtime, approval, and release invariants
- Rule: a row is `Verified` only when current code and a directly relevant automated test both exist

## Evidence Matrix

| ID | Requirement | Current evidence | Result |
| --- | --- | --- | --- |
| A01 | Configure coordinator/analysis/coding/testing Agents, including provider, model, prompts, command, sandbox and approval policy | Agent CLI/service/store tests; worker model and prompt provider tests | Verified |
| A02 | Configure worker pool parallelism and maximum workers; execute providers concurrently within both limits | Effective-min capacity, per-pool polling, asynchronous production scheduling, lease heartbeat and lost-worker replacement tests | Verified |
| A03 | Check Codex provider health and skip unavailable Agents | `CheckAgentHealth`, `TestAgentHealthMarksUnavailable`, `TestDaemonRunOnceSkipsUnavailableAgentPool` | Verified |
| A04 | Check the workspace-cli MCP control plane can start and answer `tools/list` | `workspace mcp health`, server/Cobra stdio tests, invalid-token/large-request tests and Step 9 Batch 14 Round 2 Review | Verified |
| A05 | Before worker provider startup, validate the required requirement/release workspace or artifact directory | Explicit daemon preflight, no-provider retry tests, worker idle assertions and Step 7 Batch 6 Round 2 Review | Verified |
| A06 | Main/analysis/coordinator Agents mutate platform state only through capability-scoped MCP | Trusted canonical workspace derivation, full-component symlink rejection, Worker workspace injection rejection, daemon/Codex double sandbox normalization, workspace-policy-only grants, daemon-owned Unix control plane, Codex/Claude sandbox tests, token scope/revocation tests and MCP socket integration test | Verified |
| A07 | Submit AINative requirement into `pending_acceptance`, assign three Agents, and prepare feature workspace without duplicate requirement rows | CLI/service tests for submit, assign, advance and prepare-workspace | Verified |
| A08 | Analysis generate/Review/revise loop persists every design and Review artifact and enforces configured policy | Per-requirement analysis/development policy bindings, policy CRUD and loop tests, including high-risk revise and max-round block | Verified |
| A09 | User can inspect, edit and finalize requirement and technical design artifacts before development | Artifact CLI/service tests plus strict test-run-first requirement and artifact access regression; Round 13 overall Review approved | Verified |
| A10 | Development executes a plan step by step, Reviews every step, fixes/reviews findings and writes implementation/review reports | Development-cycle daemon tests, replan isolation tests and blocker approval tests | Verified |
| A11 | Release test records command, report and requirement+repo+commit snapshot; failed tests create bugs fixed on feature branches and retested | Atomic cycles, snapshot guard, exact capability job/run bug binding, post-run validation blocker and real ProcessRunner protocol-error blocker; Round 13 overall Review approved | Verified |
| A12 | Testing Agent cannot modify release worktree and release branch is never the bugfix branch | Release worktree pre/post immutability tests and bugfix feature-worktree E2E | Verified |
| A13 | Publish requires passed current snapshot and explicit user confirmation; partial publish remains recoverable and authoritative | Pending-only creation plus service/specialized/generic store confirm guards and atomic response/status-event rollback; Round 13 overall Review approved | Verified |
| A14 | Key requirement/release changes are written as status events | Transactional workflow/stale changes plus atomic bug, publish, test-cycle, invalid-output and worktree-block rollback tests; Round 13 overall Review approved | Verified |
| A15 | User and main Agent can watch requirement/release/job/run events, raw output is stored separately and redacted by default | Exact active-run events, redaction/filtering, byte-bounded raw tail and atomic blocker realtime events | Verified |
| A16 | Clarification, artifact finalization, implementation blocker, missing test command, publish confirmation and provider permission use structured human approvals | Direct injected-failure rollback test proves approval, event, run and job finalization are atomic; Provider failure/approval precedence and existing responder guards are covered | Verified |
| A17 | Main Agent observes new requirements, completed phases, bugs, stale/partial releases and blocked jobs without duplicate polling work | Coordinator watcher tests plus authoritative stale workflow events, real-process malformed-output blockers and stale-to-retest E2E; Round 13 overall Review approved | Verified |
| A18 | Codex and Claude Code provider command contracts work for main Agent and Worker execution | Dual-provider command/protocol tests and real Codex smoke pass; real Claude smoke harness exists but cannot run on this machine because Claude CLI is unavailable | Partial |
| A19 | Existing non-AINative local workflow remains compatible | Full CLI/workspace regression suite | Verified |
| A20 | Daemon is a manageable single-instance background service and main-agent credentials remain revocable during long sessions | Atomic lease-bound capability issuance, strict token-cardinality heartbeat, live Retry/Requeue guards, migrations 0010/0011 orphan and residual ownership cleanup, active lease aggregation, terminal revocation, process identity checks and lifecycle tests | Verified |

## Remaining Scope

Required implementation is complete for the current macOS local single-user scope. A18 remains `Partial` until the gated real Claude smoke runs on a machine with an installed and authenticated Claude CLI. Linux execution remains fail closed until an external isolation backend is configured.

## Completion State

Step 26 closes capability issuance outside a valid lease, live Job retry takeover, token-less heartbeat commits, residual Worker/token ownership and succeeded-run error drift. Verification evidence below is refreshed after these changes.

## Final Verification Evidence

- `go test -count=1 ./...`: passed for every package.
- `go test -race -count=1 ./...`: passed for every package.
- `go vet ./...`: passed.
- `go build ./cmd/workspace`: passed.
- Built-binary smoke: temporary home `init` followed by `mcp health` returned `status=available`, `transport=stdio`, and 33 registered tools.
- Current real-provider smoke: `WORKSPACE_CLI_REAL_PROVIDER_SMOKE=codex go test -count=1 ./internal/agent -run TestCodexProviderSmoke -v` passed against the installed Codex CLI.
- `git diff --check`: passed.
- `gofmt -l internal cmd`: empty.
- Markdown fence balance over `docs/*.md` and `README.md`: passed.
- Step 20 Review hardening final review: Approved with no blocking or important findings.
- Step 21 runtime hardening final review: Approved with no blocking or important findings.
