# Deterministic evidence gates implementation Implemented layered deterministic gates. ## Added - `scripts/task-phase-lib.ts` ## Updated - `bin/task-phase-init` - `bin/task-phase-run` - `bin/task-phase-loop` - `docs/task-phase-machine.md` ## Gate model Three layers: 1. universal gates 2. task-class gate profile 3. task-instance required gates ## Built-in gate profiles - `repo_code` - `docs_only` - `audit` - `migration` - `ops_setup` - `research_with_artifact` ## Behavior - `task-phase-init` now creates: - `Gate profile` - `Required gates` - `Gate status` - `task-phase-run` now enforces required gate pass states on: - `verify -> review` - `review -> done` - loop reuses the shared parsing/state logic ## Determinism The runner no longer trusts prose-only claims for completion. Required gates must exist and be explicitly marked `pass`. ## Validation - `bun run typecheck` passes - smoke-checked generated STATE.md gate sections