{
  "requirements-discovery": [
    "source code edits of any kind",
    "implementation planning or detailed design beyond what is required to choose the next phase",
    "executing builds, migrations, deployments, or any state-mutating command",
    "starting `error-analysis`, `implementation-planning`, or `implementation` inside this run (each must be a separate run, and `implementation` additionally requires an approved `implementation-planning` deliverable)"
  ],
  "improvement-discovery": [
    "source code edits of any kind",
    "implementation planning, root-cause analysis, builds, migrations, or deployments",
    "starting `implementation-planning`, `implementation`, `error-analysis`, or any other lifecycle phase inside this run",
    "generating candidates outside the lens whitelist (Lens enum violation rejects the report)",
    "exceeding the candidate cap (absolute cap 12)",
    "free external data fetch beyond the brief's Source Material or Phase 1.5 resolved scope",
    "interpreting user phrases like `다음 단계 진행해` as authorisation to enter another phase"
  ],
  "project-analysis": [
    "source or configuration edits",
    "tests, builds, migrations, or deployments",
    "starting any other lifecycle phase inside this run"
  ],
  "feature-analysis": [
    "source or configuration edits",
    "tests, builds, migrations, or deployments",
    "starting any other lifecycle phase inside this run"
  ],
  "change-impact-analysis": [
    "source or configuration edits",
    "tests, builds, migrations, or deployments",
    "starting any other lifecycle phase inside this run",
    "implementation alternatives",
    "file change specifications",
    "stepwise execution plans"
  ],
  "error-analysis": [
    "source code edits, refactors, or fix attempts",
    "implementation design or planning artifacts",
    "executing builds, migrations, deployments, or any state-mutating command",
    "starting `implementation-planning` or `implementation` inside this run (each must be a separate run, and `implementation` additionally requires an approved `implementation-planning` deliverable)"
  ],
  "implementation-option-selection": [
    "source or configuration edits, refactors, or fix attempts",
    "tests, builds, migrations, deployments, or any state-mutating command",
    "detailed file lists, stage maps, execution commands, or plan approval",
    "starting `implementation-planning` or `implementation` inside this run",
    "displaying more than three merged candidates or omitting rejected-candidate audit records"
  ],
  "implementation-planning": [
    "source code edits of any kind (Edit/Write on project source files is forbidden)",
    "file writes outside the run`s artifact directories (`reports/`, `prompts/`, `state/`, `manifests/`, `worker-results/`, `status/`, `sessions/`) and the task-root qa tree (`<task_root>/qa/` — the Tier3 conformance scripts, manifest, and tsconfig this phase MUST write per the Stage Map conformance contract); in particular, do not write to `docs/superpowers/specs/` or `docs/superpowers/plans/`",
    "executing builds, migrations, deployments, or any state-mutating command",
    "starting `implementation` inside this run (must be a separate run authorised by an approved deliverable from this phase), even if the user says \"다음 단계 진행해\"",
    "dispatching parallel sub-agents beyond the required worker roster (okstra owns worker fan-out)",
    "leaving placeholders such as TBD / TODO / \"handle edge cases\" / \"similar to Option N\" in the report",
    "delegating the self-review pass — the Okstra lead must run it"
  ],
  "implementation": [
    "any Edit/Write or state-mutating Bash before the pre-implementation gate passes (gate requires --approved-plan pointing to a final-report.md whose frontmatter has `approved: true`)",
    "`git push` of any kind (including `--dry-run` against a real remote that produces side-effects), `npm publish` / `cargo publish` / `pip publish`, `gh release`, `docker push`",
    "real database migrations, schema changes against shared environments, or writes to non-local datastores",
    "production credentials, deploy commands, infra mutation (`terraform apply`, `kubectl apply` against non-local cluster, etc.)",
    "external API write calls (POST/PUT/PATCH/DELETE) to third-party services other than localhost test fixtures",
    "source edits or Bash mutations performed by any verifier role (`Antigravity verifier`, `Codex verifier`, `Claude verifier` are read-only — recommend, do not apply)",
    "dispatching parallel sub-agents beyond the required worker roster",
    "silent scope expansion: every file edited outside the approved plan list MUST appear in the `Out-of-plan edits` block with rationale",
    "leaving placeholders such as TBD / TODO / \"implement later\" / \"handle edge cases\" in newly-added lines of this run (check via `git diff <base>..HEAD | grep -E '^\\+[^+].*\\b(TBD|TODO|FIXME|XXX|implement later|handle edge cases|similar to|placeholder)\\b'`; pre-existing strings in untouched regions are out of scope)",
    "lead substituting its own verdict when every verifier present in the resolved roster returned a non-result terminal status (`timeout`/`error`/`not-run`); in that case the run MUST end as `blocked` with routing recommendation back to `error-analysis`, never with a lead-only verdict",
    "declaring overall task acceptance — that is `final-verification` ownership; this phase reports only \"ready for final-verification\" or \"needs new planning loop\"",
    "delegating the self-review pass — the Okstra lead must run it"
  ],
  "final-verification": [
    "source code edits, follow-up bug fixes, or scope expansion",
    "state-mutating commands against the project or shared environments; permitted mutations are limited to the run's own `.okstra` artifacts (reports, state, `<task_root>/qa/result-*.json` sidecars, `okstra handoff record-verified` on acceptance) and Tier3 conformance scripts that mutate only their qaEnv replica datastore — everything else is read-only execution of pre-existing test or validation commands",
    "starting any follow-up phase inside this run; record findings and end the run"
  ],
  "release-handoff": [
    "entering this phase when the cited final-verification `Verdict Token` is `conditional-accept` or `blocked`, or when no final-verification report is cited",
    "local commit commands of any kind (`git add`, `git commit`, `git restore --staged`, `git stash`), and any direct `git merge` / `git rebase` run by the lead. The single exception is the merge commits `okstra handoff assemble` itself creates on the collector branch — the lead never merges by hand.",
    "any git push variant that rewrites remote history, regardless of intent or whether the user said \"force it\": `git push --force`, `git push --force-with-lease`, `git push -f`, `git push +<refspec>`, or any other history-rewriting invocation",
    "pushing directly to a base branch — i.e. `git push origin <branch>` where `<branch>` is `main`, `master`, `prod`, `preprod`, `staging`, `dev`, or the branch the user chose as the PR base in this run. The only permitted push target is the current feature branch.",
    "bypassing repo safeguards: `--no-verify` / `-n` on `git push`, bypassing GPG signing, disabling safeguards via equivalent flags, or any hook bypass.",
    "release-publishing commands: `gh release create`, `gh release edit`, `npm publish`, `cargo publish`, `pip publish`, `twine upload`, `docker push`, `terraform apply`, `kubectl apply` against any non-local cluster.",
    "source-code edits, refactors, or any modification to files outside the run's own artifact directories (`reports/`, `prompts/`, `state/`, `manifests/`, `worker-results/`, `status/`, `sessions/`). The diff being shipped MUST be exactly what the prior `implementation` run produced; release-handoff packages it, it does not re-author it.",
    "executing any mutating command the user did NOT select. Examples: opening a PR when the user picked `local checkout`; pushing when the user picked `skip`; switching the PR base branch silently after the user already chose one.",
    "retrying a failed git / gh command with weaker safety flags. If `git push` fails with non-fast-forward, the lead MUST stop, explain the failure to the user, and ask for instructions — it MUST NOT add `--force`.",
    "worker dispatch of any kind, or any other parallel sub-agent fan-out. This phase runs entirely under the Okstra lead.",
    "silently treating an unrecognised user reply as one of the menu options. If the user's answer does not match a presented choice, re-ask the question verbatim."
  ],
  "unknown": [
    "any action that belongs to a different lifecycle phase",
    "source code edits or state-mutating commands unless this task type explicitly authorises them"
  ]
}
