# workspace-cli AINative Runtime Hardening Final Review

- Review date: 2026-07-11
- Scope: daemon lifecycle, execution atomicity, main-agent capability lifecycle, requirement scheduling priority, Claude Code parity
- Verdict: Approved; no blocking or important findings remain

## Results

- Migration 0006 adds a persistent singleton daemon lease with PID, status and heartbeat. Detached start, live status, graceful/idempotent stop, restart and stale takeover are implemented.
- Daemon workers are keyed by daemon instance and shutdown only stops workers owned by that instance. Worker-level failures are diagnosed and isolated from the scheduler loop.
- Provider failure finalization now atomically commits `run_completed`, failed run and failed job. Fault injection proves rollback when the last write fails.
- Main Agent MCP uses a 0600 capability file with short-lived token rotation. Session state is checked during MCP authorization, stale sessions expire, and completion immediately revokes the token and removes the file.
- Requirement priority participates in queue ordering as `requirement priority * 1000 + stage priority`; lower-valued requirements run first without breaking step/Review order. Clarification only reprioritizes queued jobs.
- Codex and Claude Code are both in scope. Main-session MCP/permission contracts and Worker result protocols are tested for both; real smoke runs when the corresponding local CLI is installed.

## Verification

- `go test -count=1 ./...`: passed.
- `go test -race -count=1 ./...`: passed.
- `go vet ./...`: passed.
- `go build ./cmd/workspace`: passed.
- Built-binary MCP health: stdio available with 33 tools.
- Built-binary daemon smoke: detached start, duplicate start, status, stop, duplicate stop and restart passed.
- Real Codex provider smoke: passed.
- Real Claude provider smoke: skipped because `claude` is not installed; fake CLI and stream-json protocol tests passed in the regular suite.
- `git diff --check`, gofmt and Markdown fence checks: passed.
