# Engine outcome codes

Version: 1 (`OUTCOME_CODES_VERSION` in `bin/engine/outcome-codes.mjs`, the single source of truth).

Every `PHASE_FAILED`, blocked `PHASE_COMMIT` (a handoff or block) and `RUN_TERMINAL` run-log event carries a
`code` from this closed enum, so stall causes can be counted and grouped without reading prose. The code is
derived in code from structured evidence only (`REVIEW_RESULT` fields, FORGE markers and sentinels,
`**Re-gate outcome**`, `err.code`), never from the free-text `detail`/`reason`, which stays alongside for humans.
`terminate()` also records the code in the issue's `FORGE:STATE` block (`outcomeCode`), so it survives a rebuild
or resume and is recoverable from GitHub alone. Adding a code is additive; renaming or removing one bumps the
version.

An absent or unknown code is recorded as `unclassified`, with the raw reason kept (`PHASE_FAILED.reason`,
`RUN_TERMINAL.detail`), so gaps show up in a report instead of being hidden.

| Code | Meaning | Emitted by | Source evidence |
|------|---------|------------|-----------------|
| `review.changes_requested` | Review asked for an in-PR fix and handed off to remediate | review | `REVIEW_RESULT` `status: NEXT`, `next: remediate` |
| `review.escalated` | Review escalated the PR to a human or remediation | review | PR/issue carries `needs-human` or `workflow:remediating` |
| `review.rereview_skipped` | Re-review was skipped | reserved | No structured evidence source yet |
| `review.blocking_issue` | Review left the PR open at an unchanged head with a filed blocking ISSUE and handed off to remediate | review | Trusted `FORGE:NOTE_DISPOSITION` on the PR with `findings_filed` > 0 and `reviewed_sha` equal to the live head |
| `review.pr_open` | Review ended with the PR open and unmerged and no handoff signal | review | Live PR open, no `REVIEW_RESULT` remediate handoff, no `needs-human`/`workflow:remediating` label, no blocking disposition |
| `review.ci_pending_timeout` | CI was still pending at the merge gate after the engine's bounded wait (`engine.ci_pending_max_minutes`) ran out | engine | Review ended `REVIEW_RESULT` `status: BLOCKED` with a blocker containing `checks still pending` (or remediate held at its M7 re-gate on `CI pending`), and `scripts/wait-ci-green.sh` still reported pending when the budget expired |
| `build.acceptance_failed` | Newest acceptance gate marker is blocked | build | `FORGE:ACCEPTANCE_GATE:FAILED`/`:BLOCKED` or `FORGE:BUILD_BLOCKED` (`:DEGRADED` is a pass-class marker, not blocked) |
| `build.acceptance_malformed` | Acceptance spec was malformed | reserved | Indistinguishable from `build.acceptance_failed` by sentinel alone |
| `build.size_over_gate` | Retired (forge#3862): the old size gate routed a finished build to decompose; never emitted now, kept so historic runs still parse | reserved | A finished build is never routed to decompose |
| `build.cohesive` | Retired (forge#3862): the old size gate judged an oversized diff cohesive | reserved | No size gate remains |
| `remediate.no_marker` | Remediation ended without its completion marker | remediate | No trusted `FORGE:REMEDIATION:COMPLETE` |
| `remediate.deferred_live_run` | Remediation deferred to a live earlier run | remediate, engine | Trusted `FORGE:REMEDIATION_DEFERRED` record |
| `remediate.re_escalated` | Remediation re-escalated to a human | remediate | `**Re-gate outcome**: RE-ESCALATED` |
| `remediate.unfixable` | Remediation judged the findings unfixable | remediate | `**Re-gate outcome**: UNFIXABLE` |
| `remediate.inpr_requested` | Re-gate approved but requested one further in-PR fix round; the run continues, never `needs-human` | remediate | `**Re-gate outcome**: INPR-FIX-REQUESTED` |
| `ci.red` | CI failed | reserved | `REVIEW_RESULT` carries no CI field yet |
| `ci.timeout` | CI timed out | reserved | `REVIEW_RESULT` carries no CI field yet |
| `ci.dco` | Core work-on (forge#4651): a check named DCO failed on the PR head (required on the lane branch or not), or the lane's unpushed commits lack a sign-off and the worktree has no usable git identity to rewrite them. Not recoverable: a new commit cannot fix author/sign-off history | lean | needs-human; nothing merged |
| `base.conflict` | Base-branch conflict blocked the PR | reserved | `REVIEW_RESULT` carries no conflict field yet |
| `path.switch_conflict` | The full path was started on an issue that has an open core-path PR (`feat/issue-<n>-lean`); refused to avoid a second implementation. Rerun on the default path (base-sync) or close that PR first | engine | `bin/engine.mjs` admission |
| `merge.transient` | `gh pr merge` kept failing with a transient error (`Base branch was modified`, GraphQL or 5xx) after the retry budget; the run is `deferred` and a rerun resumes at the merge | lean | `bin/lean/lean.mjs` |
| `push.transient` | `git push` kept failing with a transient error (`remote unpack failed`, `index-pack failed`, `RPC failed`, 5xx, reset, timeout) after 4 attempts; `deferred`, rerun resumes | lean | `bin/lean/lean.mjs` |
| `cli.idle` | The builder CLI showed no stream activity for `engine.cli_idle_minutes` and was killed; uncommitted work was checkpointed to the lane branch; `deferred` after one automatic retry | lean | `bin/runner.mjs` |
| `cli.host_killed` | The builder CLI was killed from outside (SIGTERM/SIGKILL, status 143/137) with none of our own timers firing; checkpointed and retried once, then `deferred`; never counts toward the batch breaker (#4518) | lean | `bin/lean/hostkill.mjs` |
| `run.interrupted` | A core run got SIGTERM/SIGINT; the lane tore down from its resource ledger (unpushed work checkpointed to the lane branch, worktree removed, lease released) and ended `deferred`, so a batch requeues it | lean | `bin/engine-cli.mjs` |
| `host.busy` | Core run deferred at admission: free memory, free tmp space or load per core outside `engine.admission` limits; no lease taken, nothing posted | lean | `bin/lean/admission.mjs` |
| `gh.unavailable` | `run-issue --repo` could not verify the cwd repo because `gh repo view` kept failing after 3 attempts with backoff (typically a timeout under host load); the core or full run is `deferred` (exit 75, retry in 60s) before any lease, nothing posted | engine CLI | `bin/engine-cli.mjs` |
| `gh.auth` | A `gh` call in a core run answered HTTP 401 (expired or revoked bot token) and one run of `scripts/refresh-bot-token.sh` plus a retry did not fix it; the run is `deferred` (retry in 120s), never `engine-error`. See `docs/CONFIG.md` "Bot token refresh" | lean | `bin/lean/retry.mjs` |
| `rate_limited` | Session or usage limit outlasted the pause budget | engine | `err.usageLimit` / `err.resetAtEpochMs` |
| `backend.auth` | The claude CLI login failed ("Failed to authenticate", expired or invalid login); the lane is `deferred` (retry in 900s) under a per-account hold like a usage limit, never `engine-error`, never relaunched or counted by the breaker (#5168) | lean | `bin/runner.mjs` `err.authFailure` |
| `backend.cli_failed` | The claude CLI exited 1 without reaching the API (`duration_api_ms` 0) and the result is no login or usage-limit text; the lane is `deferred` (retry in 120s), capped by `maxDeferrals`, with no account hold; the CLI `result`/`is_error` (redacted) and the account number ride on the deferral and its `RUN_TERMINAL` (#5762) | lean | `bin/runner.mjs` `err.cliFailed` |
| `quota.exhausted` | No account has capacity (the rotator picks none: every login at its ceiling); the lane is `deferred` until the earliest reset, never spawned through the shim, never `backend.auth` (#5236) | lean | `bin/lean/quota.mjs` `poolExhausted` |
| `engine.error` | Engine or tool failure (missing key/SDK, CLI crash, max turns, unresolved args, runner threw every attempt) | engine | `err.code` |
| `engine.dco_rewrite` | Core work-on (forge#4997): the DCO sign-off rewrite (`git filter-branch`) of the lane's unpushed commits failed, or the lane's uncommitted changes could not be restored after it (kept on `refs/forgedock/dco-stash`). A mechanical engine step, not a human block: the lane ends `engine-error` (never `needs-human`), which `forgedock orchestrate` relaunches like any engine-error | lean | `bin/lean/signoff.mjs` `ensureSignedOff` |
| `engine.push_diverged` | Core work-on (forge#5202): the lane-branch push was rejected non-fast-forward and no other live lane owns the branch (no open PR, no live lease), after the pre-push reconcile could not merge the remote-only commits (they are not this worktree's own `wip(forge): checkpoint` commits). The lane's own history diverged: a mechanical engine state, not a human block. The lane ends `engine-error` (never `needs-human`), which `forgedock orchestrate` relaunches; the exit rescue pushes HEAD to `forge-salvage/<issue>-<sha>` | lean | `bin/lean/lean.mjs` push-rejection classification, `bin/lean/checkpoint-reconcile.mjs` |
| `engine.validate_result_lost` | Core work-on (forge#4708): a validate result recorded before a merge-time CI fix round is missing from the fix session's result file and could not be carried forward; an engine bookkeeping error, not an unimplemented requirement | lean | `bin/lean/lean.mjs` `mergeFixRound` |
| `infra.disk_quota` | Disk full or quota exhausted (EDQUOT/ENOSPC, errno -28/-122); retryable infra failure, never `needs-human` | engine | Runner error text |
| `infra.cli_spawn_transient` | CLI spawn failed transiently before the child ran (ETIMEDOUT, EAGAIN, ENOMEM, EMFILE); retried with backoff on a separate bounded counter that does not consume a phase attempt | engine | `err.code` `CLI_SPAWN_TRANSIENT` |
| `cli.timeout` | CLI child ran and was killed at the wall-clock limit; a normal attempt (consumes one of `maxAttempts`), usage recorded when the CLI emitted any | engine | `err.code` `CLI_TIMEOUT` |
| `cli.spawn_failed` | The CLI could not be started for a reason that repeats on every rerun (`E2BIG` argv too large, `ENOENT`/`EACCES`/`ENOEXEC` binary missing or not executable, `ENAMETOOLONG`). Core work-on ends `needs-human` with this code instead of `engine-error`, so `forgedock orchestrate` does not spend its relaunch on it | lean, engine | `err.code` `CLI_SPAWN_FAILED` (E2BIG) or `err.spawnDeterministic` (other errnos keep their `err.code`); `err.spawnErrno` holds the errno |
| `env.setup_failed` | forge.yaml `env.setup` (run once per fresh lane worktree, before the builder) exited non-zero, timed out or could not start. An environment error, not a build failure: the builder never ran. Core work-on ends `needs-human` with this code instead of `engine-error`, so `forgedock orchestrate` does not relaunch it; fix the setup command or the environment and rerun | lean | `io.runSetup` exit code / spawn error |
| `env.lane_limit` | Core work-on (forge#4690): the lane's systemd scope hit its own `TasksMax` (forks refused, `pids.events max`) or `MemoryMax` (`memory.events oom_kill`) and the engine stopped the lane after checkpointing its work. The message names the limit. An environment error, not an engine-error: it ends `needs-human`, is not relaunched and is not counted by the circuit breaker, so other lanes keep being admitted. Raise `engine.lane_limits.tasks_max` / `memory_max` if the work is legitimate | lean | scope `pids.events` / `memory.events` sampled by `bin/runner.mjs` `readScopeLimitEvents` |
| `env.tool_missing` | Core work-on (forge#4323): a validate command the builder recorded as failed was rerun by the engine and could not run because the host lacks a tool or module (`command not found` / exit 127, Python `No module named x`, Node `Cannot find module|package 'x'` for a bare name the repo does not track). An environment error, not a conformance failure: no builder resume, no reviewer. Also ends this way when a remote-sandbox builder reports a missing tool as a `credentials` block (forge#4685, `missingToolBlock`). Ends `needs-human` naming the tool; recoverable by `forgedock orchestrate` (the recovery lane runs the check through the repo's own toolchain). Skipped on a CI-verified head | lean | `gate()` rerun via `io.runCommand`, `{rc, output}` classified by `conformance.mjs` `missingTool` |
| `env.repro_unrunnable` | Core work-on (forge#4334): on a bug lane the frozen `repro_test` could not be run on head by `scripts/acceptance-red-green.sh` (`HEAD=UNRUNNABLE`: timeout, exit 126/127, unclassifiable output) or the harness returned no result. An environment error, not a conformance failure: no builder resume, no reviewer. Ends `needs-human`; recoverable by `forgedock orchestrate` (the recovery lane reruns the repro command through the repo's own toolchain and installed dependencies). Other non-proofs (passes on base, fails on head, base unrunnable) stay `conformance.unimplemented` | lean | `gate()` `io.redGreen` words, classified by `conformance.mjs` `reproFailures` |
| `env.capability_docker` | Core work-on (forge#6196): a validate command needed a Docker daemon or image the sandbox lacks (no daemon, image not present, `docker` not found). Environment, never conformance: recovered on a placement with Docker (the pool `docker: true` sidecar) or the validate is deferred to CI with a FORGE:DECISION. Recoverable. |
| `env.capability_remote` | Core work-on (forge#4542): a lane placed in a remote sandbox ended `builder.blocked (credentials)` and its summary names only host capabilities declared in `execution.host_capabilities` (SOPS/age key, ops credentials, prod monitor SSH), which the sandbox does not relay but the dispatching host has. Recoverable by `forgedock orchestrate`: the recovery lane is placed local, once, under the same lease. A credential need the host lacks too stays `builder.blocked` | lean | `endBlocked` via `execution.mjs` `hostCapabilityBlock` |
| `env.engine_skew` | Core work-on (forge#5931): a remote sandbox lane ran an engine version (major.minor) other than the dispatching host's, so gates fixed in the host version still fire. Held as an environment outcome (re-admitted on an engine upgrade or --set-env), never reported as conformance. |
| `sandbox.start_failed` | A `forgedock orchestrate` lane sandbox (forge.yaml `execution`, provider `container` or `remote`) could not start: bad image, missing endpoint, a refused launch (HTTP 4xx other than 401/403/429) or a non-HTTP start failure. The lane never ran. Final `needs-human` row: not relaunched and not counted by the engine-error circuit breaker | orchestrate | `bin/lean/execution.mjs` `providerLanes`: `provider.start` threw without `retryable`, `transient` or a 5xx/401/403 `status` |
| `base.red` | Core work-on: a `verify.invariants` guard command fails on the base too (forge#5239). `deferred` (retry 900 s), never needs-human; the introducing issue gets a `FORGE:BASE_RED` comment (reopened if closed) | lean | `bin/lean/basered.mjs` guard run on the base |
| `sandbox.capacity` | The sandbox provider had no capacity for the lane (HTTP 429/503 from the remote transport). `deferred`, requeued after `Retry-After` when sent, else 60s; not counted toward `orchestration.max_deferrals`, like `host.busy` (forge#4528) | orchestrate | `provider.start` threw with `err.retryable: true` |
| `sandbox.transient` | The remote sandbox provider answered HTTP 500/502/504 on launch: a router or agent infrastructure failure, not a code or human problem (forge#5095). `deferred`, requeued after `Retry-After` when sent, else 60s; counted toward `orchestration.max_deferrals` (so a broken pool ends `deferred`, never `needs-human`); not counted by the engine-error circuit breaker | orchestrate | `bin/lean/execution.mjs` `providerLanes` `startFailed`: `provider.start` threw with `err.status` 5xx (not retryable) or `err.transient` |
| `sandbox.auth` | The remote sandbox provider refused the lane's credential (HTTP 401/403) at start (forge#4685). `deferred`, retried after 300s, never `needs-human`; the pool token resolves from the env, the keychain, then `~/.config/computeshare/forgedock.token` | orchestrate | `provider.start` threw with `err.status` 401/403 |
| `sandbox.unreachable` | The remote sandbox provider stayed unreachable (connection refused/reset, `fetch failed`, timeout, 502/503/504) for `execution.unreachable_window_min` while a lane polled or adopted its sandbox (forge#4672). `deferred`, requeued after 60s; not counted by the engine-error circuit breaker. The sandbox is NOT torn down: the next attempt or `--resume` adopts it | orchestrate | `bin/lean/execution.mjs` `providerLanes` poll guard |
| `sandbox.disk_pressure` | The pool agent stopped a lane's sandbox because its host drive fell below half the disk floor and every sandbox on the host was about to be lost (forge#5891). The agent reports it as `code` on the stopped sandbox; its branch, worktree and cache volume are kept, so the requeued lane adopts them instead of starting over. | orchestrate | `bin/pool/agent.mjs` `diskPressure`: host free space below `host_disk_floor_gb / 2` after reclaim and pause |
| `sandbox.mem_pressure` | The pool agent stopped a lane's sandbox after it stayed memory-paused past `host_mem_max_pause_s` (default 600, forge#6270). Reported as `code` on the stopped sandbox; branch, worktree and volume are kept, so the requeued lane adopts them. | orchestrate | `bin/pool/agent.mjs` `hostMemPressure`: paused longer than the max pause |
| `sandbox.lost` | Three or more sandboxes on the same pool agent ended without a result within 60s: the agent or its VM restarted (forge#5859). `deferred`, requeued once after 60s; not counted by the engine-error circuit breaker and does not use the per-issue engine-error relaunch. One batch event (`agent <name> restarted at <ts>; N lanes requeued`) is recorded and shown by `forgedock status --batch` | orchestrate | `bin/lean/orchestrate.mjs` `settleLane` |
| `sandbox.repo_missing` | The claimed sandbox repo directory is missing, not a git repository, or git could not spawn there (`ENOENT`/`EACCES`) (forge#5890). `deferred`, requeued after 120s; not counted by the engine-error circuit breaker and does not use the per-issue engine-error relaunch | lean | `bin/lean/lean.mjs` `runCore` precheck, `bin/lean/worktree.mjs` `addLaneWorktree` |
| `net.transient` | A git clone/fetch hit a transport failure (curl 56/28, early EOF, `RPC failed`, invalid index-pack output, unexpected disconnect, a half-built mirror) (forge#5947). `deferred` with transient backoff (30s, 2m, 8m, 15m); not counted by the engine-error circuit breaker and does not use the engine-error relaunch | lean | `bin/lean/orchestrate.mjs` `settleLane` |
| `lease.held` | Another live agent holds the issue lease | engine | Foreign live lease on acquire |
| `dependency.open` | A dependency is still open: a trusted `**Depends on**: #N` line refused the run before any state write, or the core builder reported `block.kind: "dependency"` naming an issue that is open. Carries `dependencies`; never `needs-human`. `forgedock orchestrate` adds the edge and requeues the issue behind it, without skipping dependents | engine, lean | Trusted `**Depends on**` line, or `result.json` `block.issues`, + the dependency issue's live open state |
| `design.invalidated` | Core work-on: the builder reported `block.kind: "design-invalidated"` (a decision or interface no longer holds). The engine files one spike-amendment issue, holds the affected open siblings behind it with `**Depends on**` edges, and requeues the lane. Carries `dependencies`, `amendment`, `epic`; never `needs-human`. The rework-share rollup counts it | lean | `result.json` `block` + the `FORGE:REPLAN` comment |
| `design.spec_required` | Core work-on (#5330): the lane predicts a page entry under forge.yaml `design.routes` with no `FORGE:DESIGN_SPEC` comment or `design:approved` label, and `design.gate` is `blocking`. The lane stops before implementation as `needs-human` until `/design` approves a spec; under `advisory` the implement prompt gets a note instead. |
| `dependency.unreadable` | The issue body or a declared dependency could not be read, so the run was refused (fail closed) | engine, lean | Failed or unparsable `gh api` / `gh issue view` read |
| `dependency.blocked` | Core work-on: the builder's dependency is open and itself labelled `needs-human`. Terminal reason `dependency-blocked` (blocked by #X); this issue is not labelled `needs-human` | lean | `result.json` `block.kind: "dependency"` + the dependency's `needs-human` label |
| `lane.mismatch` | Core work-on: `--lane` differs from the lane worked out from the issue (milestone → `branches.feature_pattern`, else `branches.staging`); refused before any lease, comment or worktree. `--lane-override` forces it and is recorded in the trajectory. A resumed PR whose base is not the lane is refused the same way before merge | lean | Issue milestone + forge.yaml `branches`, or the open PR's `baseRefName` |
| `lane.default_branch` | Core work-on: the requested or resolved lane is the default (production) branch (forge.yaml `branches.default` or the GitHub default branch); never a lane, refused at every entry point and before PR create and merge | lean, cli | forge.yaml `branches.default`, `gh repo view` `defaultBranchRef` |
| `lane.branch_missing` | Core work-on: the lane branch (e.g. `milestone/<slug>`) does not exist on origin; fail closed | lean | `git ls-remote --heads origin` |
| `lane.unresolved` | Core work-on: the lane could not be worked out (milestone or default branch unreadable, empty milestone slug, bad `feature_pattern`); fail closed | lean | Failed `gh` read or config |
| `invalid` | Issue is invalid or in a divergent closed state | investigate, engine | `INVESTIGATION:INVALID` marker, or live snapshot |
| `decomposed` | Issue was decomposed into sub-issues. In core work-on, the builder reported `block.kind: "split-required"`; the engine files the sub-issues (`**Parent**` and `**Depends on**` lines) and returns them as `subissues` for `forgedock orchestrate` to run. With `decomposition.close_parent: true` the parent is then closed `completed` (label kept; #5152: its scope moved, it was not dropped) and its dependents wait on the sub-issues | investigate, decompose, lean | `FORGE:DECOMPOSED` or the decomposition assessment; `result.json` `block.subissues` |
| `builder.blocked` | Core work-on: the builder reported an external action agents cannot take, or a product decision too critical for agents: `block.kind: "human"` with `why` one of `credentials`, `spend`, `promotion`, `customer`, `product-decision`. An upstream issue, a needed split, or prod data that monitoring access can read never count | lean | `result.json` status `blocked` + typed `block` |
| `builder.block_untyped` | Core work-on: the builder stayed `blocked` without a valid typed reason (missing `block`, a non-human `why` such as prod data, or a dependency that is not open) after one corrective resume | lean | `result.json` status `blocked`, twice |
| `builder.no_evidence` | Core work-on: the builder reported invalid/already-fixed without file:line evidence, so the issue was not closed | lean | `result.json` with empty `evidence` |
| `builder.no_commit` | Core work-on: the builder made no commit for a fix | lean | No changed files after the builder session |
| `budget.exceeded` | Core work-on (forge#4392): the implement turn budget for the lane's size (forge.yaml `engine.turn_budget_s|m|l`, defaults 25/60/100) was spent and the one bounded wrap-up session did not finish (it wrote `status: budget-exceeded` or overran its grant). Work is checkpointed on the lane branch; the detail carries the builder's digest (else the diff stat). Ends with the non-human `budget-exceeded` reason (forge#4505): no `needs-human` label and the issue stays open. `forgedock orchestrate` recovers it once (the recovery lane continues from the checkpoint or ends with a typed split-required block); a first-run overrun the batch does not recover is labelled `needs-human` by the batch, once | lean | Stream turn count (`CLI_TURNS` from `runCliBackendAsync` `turnMax`), wrap-up result.json status |
| `review.failed` | Core work-on: the fix/regression review failed twice (or could not resume the builder) | lean | Reviewer verdict FAIL |
| `review.no_verdict` | Core work-on: the reviewer returned no parseable verdict twice | lean | Unparsable reviewer output |
| `contract.invalid` | Core work-on: the builder's contract.json stayed invalid after one correction (missing requirement rows, a quote not verbatim from the issue, a defer without a why, no validate commands) | lean | `validateContract` problems after the correction resume |
| `contract.invalid_command` | Core work-on (#4761): a frozen validate command was rejected by its runner's own CLI (vitest `Unknown option` for `-q`, jest `Unrecognized CLI Parameter`, pytest `unrecognized arguments`) after the engine's normalised rerun (vitest `-q` → `--reporter=dot`) did not clear it. A contract defect, not `conformance.unimplemented`: no builder resume. `validateContract` also rejects vitest `-q`/`--quiet` up front. Ends `needs-human`; recoverable and mechanical | lean | `gate()` rerun `{rc, output}` classified by `conformance.mjs` `cliUsageError` |
| `review.incomplete` | Core work-on: the conformance review twice returned no complete rows (a generic PASS, a missing requirement/scope/preserve row, evidence in a file that does not exist); nothing merged | lean | `checkCompleteness` problems on both reviewer runs |
| `review.inconsistent` | Core work-on: the reviewer twice said NONCONFORMING without any failing row; the reviewer is re-asked, the builder's resume is not spent | lean | Verdict/row mismatch on both reviewer runs |
| `conformance.omission` | Core work-on: an issue requirement is missing from or narrowed by the frozen contract, after one builder resume | lean | Review `issue_coverage` row not `covered` |
| `conformance.unimplemented` | Core work-on: a contracted requirement is partial, missing or unvalidated, or a validate command failed, after one builder resume (a validate the host cannot run for a missing tool or module is `env.tool_missing`, and a repro test the harness cannot run on head is `env.repro_unrunnable`, instead) | lean | Precheck (result.json, validation) or review requirement row |
| `conformance.scope_creep` | Core work-on: a changed file is not authorized by a deliverable or typed amendment, after one builder resume | lean | Precheck changed files or review `scope` row `none` |
| `failure.repeated` | Core work-on: the same failure (code and normalised detail) ended a second lane of the issue; parked with one summary comment, never recovered (#5979) | lean | Second NEEDS_HUMAN/PARKED comment carrying the same `sig=` |
| `conformance.untracked_deferral` | Core work-on: a requirement was deferred without a typed amendment or a tracking issue, after one builder resume | lean | Precheck or review requirement row `deferred` on a `deliver` requirement |
| `conformance.e2e_unverified` | Core work-on: a `[type:e2e]` requirement is implemented but its validate is not a real end-to-end check (the repo's e2e set, Playwright, live stack), after one builder resume | lean | Review requirement row `implemented` with a unit-test `validated_by` (`bin/lean/conformance.mjs` `e2eVerified`) |
| `conformance.unjustified_deferral` | Core work-on: the reviewer judged a deferred or post-deploy requirement unjustified (it belongs in this change), after one builder resume; nothing is filed or merged | lean | Review requirement row `deferral_ok: false` |
| `conformance.preserve_violated` | Core work-on: a preserve constraint is violated or unverified, after one builder resume | lean | Review `preserve` row not `intact` |
| `conformance.regression` | Core work-on: the reviewer named a concrete regression, after one builder resume | lean | Review `regressions` row |
| `conformance.guard_broken` | Core work-on: the base version of a merged fix's guarding test fails against the lane's tree and no `supersedes` amendment retires it, after one builder resume | lean | `bin/lean/guardgate.mjs` guard rerun |
| `docs.stale` | Core work-on: the target repo's own `scripts/check-devdocs-freshness.sh` (docs must move with `bin/lean/` / `scripts/` behaviour) still fails after one builder resume; caught before the PR instead of by its required check | lean | the repo's `scripts/check-devdocs-freshness.sh <base>` exit 1 |
| `structure.undeclared_edge` | Core work-on: the change adds a package.json dependency between workspace packages that the frozen contract does not name, still present after one builder resume | lean | `unnamedEdges` over `scripts/structure-delta.sh` `package_edges_added` |
| `maintenance.hotspot_growth` | Core work-on: the change grows a file already over `maintenance.hotspot.file_lines` by more than `growth_lines` without a `hotspot-exempt: <reason>` in the contract, still present after one builder resume; blocks in shadow and enforce | lean | `hotspotGrowth` precheck over `scripts/hotspots.sh --base` `growth` |
| `maintenance.counter_growth` | Core work-on: a `forge.yaml` `recurrence.counters` count grew between the merge base and the lane head without a `counter-ok: <name> <reason>` contract decision; blocks in shadow and enforce | lean | `bin/lean/hotarea.mjs` `counterGrowth` |
| `recurrence.design_missing` | Core work-on: a recurring issue (design lane) whose contract lacks a `design` block with `why_failed`, a delete/replace/extend disposition and a measurable outcome; blocks in shadow and enforce | lean | `bin/lean/recurrence.mjs` `designContractFailures` |
| `followup.unavailable` | Core work-on: filing or verifying the tracking issue for a deferral failed; the run is deferred with nothing merged, never needs-human | lean | `file-deferred-followups.sh` exit 3/4 or an unreadable tracking issue |
| `merge.head_mismatch` | Core work-on: CI passed for a head other than the reviewed head; merge refused | lean | Gate head differs from the reviewed head |
| `split.unsupported` | Core work-on `refactor:split` lane (forge#4211): no codemod or index tool for the target's language (Python and TypeScript have movers), or libcst / ts-morph is not available; refused before any edit | lean | target extension, `scripts/symbol-index.py`/`symbol-index.mjs` `unsupported`, `scripts/symbol-move.py` exit 3 naming libcst, `scripts/symbol-move.mjs` exit 3 `no codemod tool for ts` (forge#4212), `scripts/refactor-verify.sh` exit 2 |
| `split.plan_invalid` | Core work-on `refactor:split` lane: no target or test command in the issue, an unparseable grouping reply, a failed baseline, or a plan `scripts/symbol-move.py` / `scripts/symbol-move.mjs` refuses; nothing written | lean | `bin/lean/refactor.mjs` parsers, `scripts/symbol-move.py` / `scripts/symbol-move.mjs` exit 3 |
| `split.verify_failed` | Core work-on `refactor:split` lane: the move did not prove location-only (logic diff, missing symbol, changed pass/skip counts or a new import cycle); the branch is reset and nothing is pushed | lean | `scripts/refactor-verify.sh verify` exit 1 `failures[].kind` |
| `completed` | Non-failure terminal (merged, phase-complete, investigation) | engine | Terminal reason |
| `awaiting_merge` | Clean result held for a merge decision | remediate | Terminal reason `awaiting-merge` |
| `unclassified` | Fallback for an absent or unknown code | engine | The raw reason is kept alongside |

## Needs-human classes (forge#4267)

`classifyNeedsHuman(row)` in `bin/engine/outcome-codes.mjs` sorts a lane result into one of three classes, so
`forgedock orchestrate` recovers mechanical outcomes inside the batch:

- **recoverable**:
  - needs-human with `ci.red`, `base.conflict`, `builder.block_untyped`, `env.tool_missing`, `env.repro_unrunnable`, `env.validate_timeout`, `env.capability_docker`, `env.capability_remote`, `contract.invalid_command`, `budget.exceeded`, `conformance.unimplemented`, `conformance.omission` or `conformance.unjustified_deferral` (#5035: the recovery lane resumes the lane branch, delivers the named gap or records a defer-with-why amendment that files a tracked follow-up);
  - `contract.invalid` when the issue was edited mid-run (`issueEdited`);
  - `ci-pending` on a conflicting PR, recovered as `base.conflict`.

  The runner relaunches the issue once per `orchestration.recovery.max_attempts` (default 1) as a recovery lane (`run-issue --recover <code>`), under the normal admission rules. That lane removes the `needs-human` label, posts `FORGE:DECISION`, and resumes the open PR: base-sync, then CI fix rounds from the failed-check logs. Dependents stay queued. A merged recovery is reported as `recovered`. A failed one is final, keeps the recovery evidence on the row, and skips its dependents. A failed recovery stays `needs-human`: the lane re-adds the label (with a `FORGE:NEEDS_HUMAN` comment carrying the evidence) only for a final `needs-human` or `ci-pending`, and only when it is the last attempt (`attempt == max_attempts`); a non-final attempt that ends `needs-human` or `ci-pending` without another attempt following is re-labelled once by the batch runner; the batch runner re-adds it, once, for a final `engine-error` or `deferred` after the recovery pass (those may be requeued, so the lane cannot know). `invalid`, `decomposed`, `dependency-*` and `merged` never re-label. In-batch recovery is off when `engine.path: full`: the runner passes no recovery to the batch, and `run-issue --path full` rejects `--recover`.
- **human**: `builder.blocked`, which is only reached by a typed human block: credentials, spend, promotion, customer or product-decision. It is never recovered, it skips dependents, and it is the only class in the report's escalation list.
- **terminal**: every other code, including `conformance.regression`, `conformance.guard_broken` and `conformance.scope_creep`. No recovery runs, dependents are skipped, and the row is reported as `unrecovered`.

## Known limits

- `build.acceptance_failed` covers malformed specs too until the gate sentinel distinguishes them.
- `ci.red`, `ci.timeout` and `base.conflict` stay reserved until `REVIEW_RESULT` carries structured fields for
  them; the engine will not infer them from prose. Such outcomes are `unclassified` today.
- `needs-human` has many causes; a pause on a pre-existing `needs-human` label is `unclassified`.
- The `FORGE:TELEMETRY` comment write is owned by #3834. The engine forwards coded deferrals through the
  existing `emitTelemetry` hook and exposes the code on the run log and `FORGE:STATE`.
