# Pre-push review contract

Canonical owner for the `pre-push-reviewer` role and its two bounded modes. Full
mode is the pre-PR review phase: a developer-briefed, fresh-context,
general-purpose review pass that runs before the first push and fixes findings
in-tree. Delta mode (see [Delta mode](#delta-mode)) reviews a gate act-list fix
before its push. Other docs MAY link this contract; they MUST NOT redefine it.
Full mode is unchanged by delta mode. The sections up to Delta mode describe full
mode.

## Phase position

<!-- rule: PRE-PR-BEFORE-FIRST-PUSH -->
`PRE-PR-BEFORE-FIRST-PUSH`: the pre-PR review MUST run after local implementation
is complete and committed, and BEFORE the first push of the branch and before
`node <dev-loops-package-root>/cli/index.mjs pr create`. Its fixes MUST be applied to the working tree, validated
with the narrowest justified check (re-checked after the final round), and
committed (a follow-up commit or an amend of the last implementation commit), so
the branch is pushed once, already cleaned and validated. In the `local-implementation`
loop it sits between the exit-validation commit (implementation-loop step 11,
`LOCAL-COMMIT-BEFORE-EXIT`, whose first push is deferred to here) and PR creation
(implementation-loop step 12). The phase applies to any session that pushes and
opens a PR, whichever route the startup resolver selected: a tracker-backed or
issue-less `--lightweight` (PR-body-as-spec) session on the local route (the review phase and the `pr create` record check both apply), and any
session on a GitHub-first route that creates the branch and PR itself. On the
GitHub-first routes the step sits before the first push and before `create-pr.mjs`
at `OPS-DRAFT-FIRST-PR` in [Copilot Loop Operations](copilot-loop-operations.md).
The guard: after the final round, the implementer MUST write the review record with `node <dev-loops-package-root>/cli/index.mjs loop pre-pr-review --verdict <clean|findings_fixed> --disposition <none|all_applied|rationale_recorded> (--body-file <file> --issue <n> | --no-linked-issue)`, which reads the head from git and is the only writer. `node <dev-loops-package-root>/cli/index.mjs pr create` refuses with the typed error `pre_pr_review_missing` unless a valid record names the head given by `--head` (else the checked-out HEAD), or an ancestor head when every later change touches docs and tests under the repository classify rules. The head is the local branch or `origin/<head>` when only that exists, and a local branch and `origin/<head>` at different commits are refused. Only branch refs (`refs/heads/<head>`, `refs/remotes/origin/<head>`) count; a same-named tag never does. The only exempt path is a plan-doc promotion branch whose whole `base...head` diff is `.md` files under `docs/phases/`; contract and skill prose under `skills/` needs a record. A hand-built record fails its integrity check. The writer also gates on `PRE-PR-STALE-SURFACE-SWEEP`.
A session that opens no PR has no pre-PR step: a phase-doc-backed session that
merges locally, a follow-up session on a PR that already exists, or a session on
a Copilot-authored PR.

<!-- rule: PRE-PR-SIZE-CHECK -->
`PRE-PR-SIZE-CHECK`: the pre-PR review MUST run `node <dev-loops-package-root>/cli/index.mjs gate size-budget --base origin/<base>` on the local `base...HEAD` diff. When the whole-PR logic LOC is over the resolved default-tier `softLoc`, the developer MUST split the local branch before any PR exists, unless the branch's plan recorded a `PLAN-SIZE-BAND` split assessment for that slice (`oversizeJustification` on the plan-file path, the grill results comment on the tracker-first path). At or above `waiverLoc` the split stays mandatory. The one enforcement point is `node <dev-loops-package-root>/cli/index.mjs pr create`: before it creates anything, it refuses with `size_split_required_before_pr` at or above the resolved default-tier `waiverLoc`. An `unknown` size does not refuse, because the draft gate stays the authority (`PRE-PR-GATE-STILL-AUTHORITY`). The refusal has no override flag.

<!-- rule: PRE-PR-STALE-SURFACE-SWEEP -->
`PRE-PR-STALE-SURFACE-SWEEP`: before dispatching the reviewer, the developer MUST run `node <dev-loops-package-root>/cli/index.mjs loop pre-pr-review --scan [--base <ref>] [--body-file <file> --issue <n> | --no-linked-issue]` and MUST pass its `staleSurfaceHits`, `staleSurfaceTruncated` and `truncatedNeedles` in the review brief. The scan reuses the delta review's stale-surface scan over `base...HEAD` (base default `origin/<resolved base branch>`) and writes nothing. With `--body-file` and `--issue` it also compares the PR body's In scope, Acceptance criteria, Definition of done and Non-goals items with the linked issue body; a PR item missing from the issue and an issue item missing from the PR are hits (PR-side sites are `pr-body/<section>:<n>`, issue-side sites `issue-body/<section>:<n>`), and a PR with no linked issue (PR body as spec) omits both flags. A linked issue without a valid AC/DoD matrix yields one `issue-body/issue-matrix` hit, addressed by fixing the issue matrix or skipping that site with a reason. When the linked issue has no In scope section, the In scope comparison is skipped and the other sections are still compared. Any git error fails the scan, and so does an empty scan range (the merge-base of the base and HEAD equals HEAD). The record writer MUST rescan at the current head and refuses unless it gets `--body-file` with `--issue`, or `--no-linked-issue` (PR body is the spec); the two forms are mutually exclusive. It MUST refuse with `pre_pr_stale_surface_unaddressed` while a hit is neither fixed nor skipped with a non-empty reason in `--skips-file` (a JSON array of `{ "site", "reason" }`); a truncated scan needs a skip naming `stale-surface-hits-truncated`. The sweep is not gate evidence (`PRE-PR-NOT-GATE-EVIDENCE`).

<!-- rule: LOCAL-DEV-SIZE-STOP -->
`LOCAL-DEV-SIZE-STOP`: the developer MUST run the same `gate size-budget` check at each local commit. When the whole-PR logic LOC crosses the resolved default-tier `softLoc`, the developer MUST stop and hand back a split point instead of continuing, unless the branch's plan recorded a `PLAN-SIZE-BAND` split assessment for that slice. At or above `waiverLoc` the stop applies in every case.

## The review pass

<!-- rule: PRE-PR-ONE-FRESH-REVIEWER -->
`PRE-PR-ONE-FRESH-REVIEWER`: the developer MUST hand a mandatory REVIEW BRIEF to
exactly ONE fresh-context, general-purpose reviewer per round (a round-two
re-review runs one reviewer too; see `PRE-PR-BOUNDED-TWO-ROUNDS`). The brief is a
developer-authored prompt stating what changed, what to scrutinize, known risks
and tradeoffs, and where the implementation cut corners. The reviewer MUST NOT be
a fixed angle: it reviews holistically per the brief. This is distinct from the
single developer self-check (`LOCAL-DEV-SELF-CHECK-NO-FANOUT`), which the
implementer runs against the plan; the pre-push reviewer MUST be a separate
fresh-context agent. The reviewer returns findings only and MUST NOT edit the
tree; the implementer applies the fixes. The full-mode brief MUST name the
artifact paths the reviewer reads (the full-mode brief carries no `patchPath`)
and the read-only evidence rule (evidence is a file:line or test path:line read
from disk; the reviewer runs no tests or builds), and
MUST NOT prescribe `sed`, a pipe to `head`, or test execution.

The reviewer MUST run with the adversarial-enumeration checklist below.

### Harness-specific dispatch

The reviewer is dispatched per harness, always with the brief as the reviewer's
task and the config-resolved model (see below) passed only when non-null:

- Claude Code: dispatch the built-in `general-purpose` subagent type with the
  brief as its prompt and the resolved model as the Agent `model` parameter.
- Pi: dispatch one fresh subagent with the brief as its task (a general-purpose
  reviewer; the PR-bound `review` gate procedure does not apply). The model stays
  keyed on the `pre-push-reviewer` role.
- Codex: run `node <dev-loops-package-root>/cli/index.mjs gate resolve-role --role pre-push-reviewer --harness codex`
  from the target repo and consume only exit 0. Forward `nativeOverrides`
  unchanged to `collaboration.spawn_agent` with the brief and `fork_turns: "none"`.
  Omit absent fields; config or native rejection stops dispatch without fallback.
  Follow [Generic Codex dispatch](main-agent-contract.md#generic-codex-dispatch)
  for role/setup reads and source-worktree qualification. This is a routine role,
  never a lifecycle fan-out angle.

### Adversarial-enumeration checklist

For any new or changed filesystem, parse, or diff seam the brief MUST direct the
reviewer to enumerate, at minimum:

- errno classes (missing, permission, not-a-directory, already-exists)
- symlink handling for both a file target and a directory target
- rename and move across the seam
- empty input and empty file
- malformed input (for example a malformed heading in a parsed doc)
- path normalization (relative, absolute, `..`, trailing slash)

This list is the floor. A seam with other adversarial surface obliges the brief
to name it too.

## Reviewer model (harness-agnostic, config-resolved)

<!-- rule: PRE-PR-MODEL-CONFIG-RESOLVED -->
`PRE-PR-MODEL-CONFIG-RESOLVED`: on Codex, both modes MUST use the role selector above,
which resolves model and effort together from `models.harnesses.codex.roles` or
`.tiers` with shared `models.roleTiers`; no legacy concrete values are borrowed.
On Claude/Pi the pre-push reviewer's model, in both modes, MUST be resolved
through `resolveRoleModel(config, { role: "pre-push-reviewer", harness })` from
`@dev-loops/core/config`. No model literal is hardcoded in this phase's prose,
tooling, or dispatch. The resolved model MUST be passed to the dispatch only when
it is non-null (the existing tier-at-dispatch contract); a `null` resolution
passes no override and inherits the session model. Operators opt into a concrete
strong model per harness in `.devloops` via `models.tiers.<alias>.<harness>`
mapped through `models.roleTiers.pre-push-reviewer` (or a direct `models.roles`
override). Each harness value MUST be a model token that harness's dispatch
accepts. On the Claude Code harness the Agent-tool `model` enum accepts only
`sonnet|opus|haiku|fable`, so an operator opting into Fable sets `fable` (the
underlying model identity is `claude-fable-5-1`).

## Findings are ephemeral

<!-- rule: PRE-PR-EPHEMERAL-NO-ARTIFACTS -->
`PRE-PR-EPHEMERAL-NO-ARTIFACTS`: the pass MUST be ephemeral. Findings are applied
directly to the working tree and then live and die in the pass. It MUST NOT
create a pull request, a comment, a review thread, or a Copilot round.

## Bounds

<!-- rule: PRE-PR-BOUNDED-TWO-ROUNDS -->
`PRE-PR-BOUNDED-TWO-ROUNDS`: the pass MUST NOT exceed two internal rounds and
MUST NOT run more than one general-purpose reviewer per round; after at most two
rounds the branch is pushed once. It MUST NOT fan out to multiple reviewers. The
round-two re-review verifies the applied fixes with a fresh-context reviewer: the
same reviewer continued when the harness supports agent continuation, otherwise
one new fresh-context dispatch.

## The fan-out gate stays the authority

<!-- rule: PRE-PR-GATE-STILL-AUTHORITY -->
`PRE-PR-GATE-STILL-AUTHORITY`: the pre-PR pass is a cheap pre-filter, not a
replacement for the gate. After the push, the full fresh-context fan-out
`draft_gate` and `pre_approval_gate` lifecycle MUST run unchanged and remains the
authority for merge readiness.

<!-- rule: PRE-PR-NOT-GATE-EVIDENCE -->
`PRE-PR-NOT-GATE-EVIDENCE`: the pre-PR pass is NOT a lifecycle-gate fan-out. It
MUST NOT produce gate evidence: no `resolveGateAngles` run, no fan-in disposition
ledger, no gate verdict comment.

## Delta mode

Delta mode is one fresh holistic review of a gate act-list fix or of a
Copilot-thread fix before that fix is pushed. It checks the cumulative fix delta
against the act items the fix claims to resolve. It resolves the same `pre-push-reviewer`
role and tier as full mode (`PRE-PR-MODEL-CONFIG-RESOLVED`) and uses the same
harness dispatch. There are two delta sources: the gate judge's act list, and
the thread route, which takes the captured set of unresolved review threads
(`list-review-threads --unresolved-only` output, passed with `--threads-file` in
place of `--act-list`, with `--repo` and `--pr`). On the thread route each
unresolved thread is one act item and its `ref` is the `threadId`. The
deterministic checks live in `@dev-loops/core/loop/pre-push-delta-review`; the
dev-loop coordinator runs them through `node <dev-loops-package-root>/cli/index.mjs loop pre-push-delta`.

The dev-loop coordinator owns delta mode, because it dispatches the Phase 4
fixer and owns the push. The sequence is:

1. The dev-loop coordinator emits a `commit_only` fixer work order from the act
   list with the invocation in
   [gate contract Phase 4](gate-review-sub-loop-contract.md#phase-4--fix) and
   dispatches the printed `dispatchPayload` unchanged (ADR 0106). The fixer
   commits the fix, writes the site coverage record to the work order's outputRef
   (`PRE-PUSH-DELTA-RESIDUE`), and hands back the commit SHA unpushed. The
   coordinator passes that record to the check with `--site-coverage` and the emission's
   canonical `--fixer-plan` on both ACT and THREAD routes, including a no-commit
   handback. Both flags are mandatory for ACT coordinator input and result recording;
   omission of either or both refuses. Every fixer emission
   in delta mode uses the PR head (`headRefOid`), never the local candidate
   head, because the emitter pins the GitHub PR head and the local fix commits
   descend from it.
2. The dev-loop coordinator builds the reviewer input with `check-pre-push-delta.mjs`
   with both flags above on either route. On the ACT route it requires
   `--findings-log <the reviewed gate round's findings log>`; the thread route takes no
   `--findings-log`. It passes `--pr-head <the full PR head SHA just read from GitHub>` to
   the check. Handle authenticated `no_commit` or `head_moved` outcomes first:
   the matching sequence is closed and `nextStep: push_to_gate` routes to the full
   gate path, carrying open threads and their full bodies as the full round's
   hash-bound `--known-findings` input, without a live-head-baseline Delta. An unresolved
   gate-authored thread can still block admission to that round; recovery admission is a
   tracked `known_gap` in the [fix-loop state graph](https://github.com/mfittko/dev-loops/blob/main/docs/fix-loop-state-graph.md). Dispatch no delta reviewer
   and emit no `full` fixer for these closure outcomes. Otherwise dispatch one fresh delta reviewer for the current worktree head,
   briefing it that it MUST NOT push (`PRE-PUSH-DELTA-PUSH-AUTHORITY`); the brief also names `input.patchPath`, `input.evidenceRule` and `input.sealCommand`. The input run takes the absolute result path as `--result-path`, and the brief names that same absolute `--result` path. The delta reviewer writes its `DeltaPrePushReviewResult` (copying `runId` from `input.resultShape` unchanged) to that path with the file-write tool, then seals it with `input.sealCommand`. On Claude Code the coordinator then joins the delta reviewer with `node <dev-loops-package-root>/cli/index.mjs gate wait-for-units --artifact <hand-back path> --after <reference path> [--timeout <seconds>]`, passing the reviewer's `--result` path and, as the reference, the `input.patchPath` file the input run wrote before dispatch (`COORDINATOR-SINGLE-CHILD-JOIN`; a stale `--result` file older than the reference never satisfies the join). That join returns once the result file parses, which can be before the reviewer seals it. Step 3 runs the `--result` check; on `evidence_unsealed` the coordinator waits for the reviewer's hand-back to name the seal output (the completion notification is the sanctioned wait for this one case) and re-runs `--result`, and a second `evidence_unsealed` re-runs the input run with a fresh `--result-path` before re-dispatching the reviewer; that re-run uses one of the three delta invocations (`COORDINATOR-SINGLE-CHILD-JOIN`).
3. The coordinator runs the CLI `--result` check (no `--findings-log`; only the input run
   reads it), and follows its `nextStep`. Both routes again pass `--fixer-plan`
   and `--site-coverage`. The THREAD route retains `--threads-file`, `--repo`,
   `--pr`, `--baseline`, `--result` and `--invocation`; its result still carries no ACT binding. On `nextStep: fix_and_rereview`,
   it dispatches a fresh fixer again, commit-only, and returns to step 2. It
   emits a new work order with `--delta-result <result>` at the PR head.
   That fixer receives the delta result's `not_resolved` and `cannot_verify` act
   refs with their evidence, plus the result's medium-or-higher `newFindings` and every
   `residueOf` finding at any severity (`PRE-PUSH-DELTA-RESIDUE`; residue is exempt from the
   medium-or-higher and regression-range limits).
   On the thread route the coordinator emits the commit-only re-dispatch with
   `--threads-file` and without `--delta-result`. The emitter attaches the head's
   delta record as the `delta-result` read. The record carries item ref/status
   pairs and the `findings[]` the fixer must act on (medium-or-higher
   `newFindings` without `residueOf`, and open residue); the emitter renders
   them as act items (`deltaFindings`, ADR 0235, `docs/decisions/0235-ci-failure-source-and-delta-findings-intake.md`).
   A CI failure is a fourth fixer-order source (`--ci-file`, full phase only, no delta route).
   On `nextStep: rereview_current_head`, the result is stale for the current
   head; the coordinator returns to step 2 without a fixer.
   When the `--result` check refuses a `locally_clear` result only for unaddressed stale-surface hits, the refusal arrives as `nextStep: fix_and_rereview` when the result is fresh and the invocation is below the bound (`DELTA_MAX_INVOCATIONS`). At the bound the refusal is `bounded_out` with `nextStep: push_to_gate` and step 4 applies, and a stale result follows the `rereview_current_head` rule. The case is identified when every `errors[]` entry starts with the `PRE-PUSH-DELTA-RESULT: locally_clear leaves stale-surface hits unaddressed` text. For that case this rule overrides the `fix_and_rereview` fixer dispatch of the previous sentence: the owner of the next action is the delta reviewer. The coordinator re-dispatches a fresh delta reviewer with a re-review demand to clear each hit with a `newFindings[]` entry that names its file; a skipped `siteCoverage[]` site counts only when the original fixer handback already records it. It then re-runs the `--result` check with the next invocation, keeping the original canonical `fixer-emit-plan.json` as `--fixer-plan` and the original fixer's handback as `--site-coverage`. A keyed `planPath` from a same-head re-emission, and that emission's no-commit handback, never feed step 2 or the no-commit close below. A fixer is dispatched only when the result names a fix to make. When a keyed fixer commits, HEAD moves past the original handback, and the exit is a canonical `commit_only` re-emission without `--delta-result`.
4. On `nextStep: push` (`locally_clear`) or `nextStep: push_to_gate`
   (`bounded_out`), it emits a `full` work order with `--delta-result <result>`
   and dispatches the fixer to push the candidate and wait for CI. The fixer writes no handoff
   and posts no reply. `verify-fixer-disposition.mjs --repo <owner/repo> --pr <n> --head-sha <sha> --fixer-plan <plan> --construct`
   writes the handoff to the work order's outputRef, and the same command without `--construct` then replies to each
   gate thread with the fixing commit and resolves it after CI settles. On
   `locally_clear`, the verifier resolves each thread. On `bounded_out`, it
   resolves only the threads of act items with status `resolved`. For
   `not_resolved` and `cannot_verify` items, it replies with the residual delta
   status and leaves the thread unresolved. The fixer MUST NOT mark these
   residual threads `tackled`; its handoff disposition records them as
   `deferred`. In a full-phase order, the verifier's `--construct` step writes that
   `deferred` entry and its normal step posts the residual reply. On the thread route the emitter attaches the head's delta record
   as a `delta-result` required read to the work order when a delta record exists for the head (always in the `full` phase; the
   `--delta-result` flag stays refused for thread sources), so this residual-thread
   rule applies to thread sources through that read.

   A round in which the `commit_only` fixer makes no commit writes a minimal baseline-headed
   handback at its outputRef. The coordinator still runs step 2 with the plan and handback
   to authenticate `no_commit` closure. No delta reviewer runs and no delta decision record is
   written (`PRE-PUSH-DELTA-TRIGGER`), and `--phase full` stays refused. The coordinator then posts each declined or deferred
   thread reply directly with `reply-resolve-review-thread.mjs --disposition rejected|deferred` at the unchanged head. That
   helper refuses only a `fixed` reply, so no full-phase refusal is bypassed. The fixer's `handbackCheck` does not apply to a
   no-commit handback. When a `commit_only` fixer hands back with no commit, the coordinator runs the no-commit close of step 2 (`check-pre-push-delta.mjs` input-only with `--fixer-plan` and `--site-coverage`, outcome `no_commit`), which removes the sequence marker. No marker needs hand deletion.

   After a pushed candidate X is contained by live H, the disposition verifier can
   deliver open threads at H while preserving X's authenticated report and Delta.
   It checks historical root ranges and every intervening commit before delivery.
   `thread_site_changed` or `thread_site_unverifiable` names the open thread for
   the full `pre_approval_gate` input instead. LEFT-side or missing coordinates,
   deleted/binary files and nonlinear history use this conservative fallback.
   Current-head CI and the existing draft boundary still apply. An unresolved
   gate-authored thread can still block admission to that full round; recovery
   admission remains a tracked gap in the [fix-loop state graph](https://github.com/mfittko/dev-loops/blob/main/docs/fix-loop-state-graph.md).
   No carried disposition is a gate verdict.

Each delta review, including a re-review of the current head, consumes one
invocation. The dev-loop coordinator owns the invocation count and passes it to
`node <dev-loops-package-root>/cli/index.mjs loop pre-push-delta --invocation` monotonically, starting at 1 for
each sequence.

ACT input retains raw `siteCoverage` unchanged, including kind, reason and test fields;
normalization is only a validation view. Input, `resultShape`, result and decision carry
identical `coverageProtocol: "pulled_commit_only_v1"`, raw semantic `siteCoverageDigest`,
exact `handbackBytesDigest` and `origin: {workOrderRef, workOrderDigest, executionIdentity}`.
The reviewer copies that tuple unchanged. Input and result recording authenticate the
canonical current plan/output, original pull, renderer/materialization bytes, ACT source,
branch, baseline and candidate. Result recording recomputes the expected tuple; any
missing, partial or altered binding refuses before the invocation-three fallback.
A matching stale result retains ordinary bounded-out behavior. Membership-only callers
check structure without claiming source authentication; optional completion separately
checks the genuine origin/report bytes against result and decision. Digest-only old
records stay legacy and unchanged. The emitted `--handback` check remains write-free
validation without attestation. THREAD and the reviewer-only route (ADR 0255) carry no ACT binding. See ADR 0150 in the
[decision records](https://github.com/mfittko/dev-loops/tree/main/docs/decisions).

<!-- rule: PRE-PUSH-DELTA-TRIGGER -->
`PRE-PUSH-DELTA-TRIGGER`: delta mode MUST run after the gate Phase 4 fixer commits a fix for a judge act list, or after a fixer commits a fix for the captured set of unresolved review threads (the thread route), and before that fix is pushed. On the thread route the baseline is the PR head (`headRefOid`) passed to the `commit_only` emission, because the emitter reads the record at `gate-delta/<that head>.json`. A push with no act-list fix and no thread-route fix MUST NOT get a delta review, even when a PR exists. The one exception is the reviewer-only code-range clearing route (`loop pre-push-delta --reviewer-only`, ADR 0255, `GATE-EXEC-ROUND-CAP-CHAIN-EXTEND`): for a PR whose head moved past the cap round it reviews `baseline..PR head` with no fixer commit and no fixer plan. Standalone implementation pushes and the full-mode first push are unaffected. A CI-only fix is out of scope.

The decision field list below is the THREAD/legacy base; ACT decisions additionally carry the binding above, except on the reviewer-only route.

`check-pre-push-delta.mjs --result` records its decision as local evidence at `<tmp-root>/gate-delta/<reviewBaselineHead>.json` (`reviewBaselineHead`, `candidateHead`, `actSetId`, `invocation`, `outcome`, `nextStep`, `items: [{ ref, status }]`, and `findings[]` when non-empty, at most 20 entries with `summary`, `evidence`, `residueOf` and `site` cut at 2000 characters; the last write for a baseline wins). The run without `--result` writes only the cumulative patch (`PRE-PUSH-DELTA-PATCH-ARTIFACT`); the `--handback` run writes nothing. The emitter and the reply wrappers enforce two refusals from the record. `emit-fixer-work-order.mjs` refuses `--phase full` unless a clearing delta decision exists for the PR head: an act-list source needs `--delta-result`, a record for the PR head with `nextStep: push` or `nextStep: push_to_gate` and the result's `actSetId`, and result item ref/status pairs equal to the record's items, a threads source needs a record for the PR head whose decision is `nextStep: push` or `nextStep: push_to_gate` and whose item refs equal the thread ids in the threads file (a record ref that is no thread, or a thread with no record item, refuses), and a record with any other `nextStep` refuses either source. The coordinator emits `--phase commit_only` first, then runs the delta review. A fixed reply (`reply-resolve-review-thread.mjs`, `reply-resolve-review-threads.mjs`, and the `Fixed in commit` reply of `verify-fixer-disposition.mjs`) is refused for a thread that a record marks `not_resolved` or `cannot_verify`, when the fixing commit is the record's `candidateHead` or lies in `reviewBaselineHead..candidateHead`. A thread matches an item by `threadId` or by the fingerprint of its `dev-loops:finding` marker.

<!-- rule: PRE-PUSH-DELTA-PINNED-BASELINE -->
`PRE-PUSH-DELTA-PINNED-BASELINE`: every delta sequence MUST bind `reviewBaselineHead..candidateHead`, where `reviewBaselineHead` is the head the gate round reviewed and stays pinned for the whole sequence. A second local fix `C` after candidate `B` MUST be reviewed as `A..C`, never only `B..C`, with the same act-set identity. `reviewBaselineHead` MUST be an ancestor of `candidateHead`; otherwise the delta check fails closed. A new gate round starts a new sequence. The reviewer-only route pins its baseline to the cap-round head or the end of the sealed clearing chain (ADR 0255).

<!-- rule: GATE-EXEC-EVIDENCE-SEALED -->
`GATE-EXEC-EVIDENCE-SEALED`: a delta result file that a gate tool consumes MUST be bound to the run that produced it. Other evidence files (findings logs, ledgers, judge decisions, dispositions) stay unsealed until slice 2 of issue 2892. The producer run records `<tmp-root>/evidence-runs/<key>.json` with the expected identity fields (`@dev-loops/core/loop/evidence-seal`); the reviewer seals its file with `scripts/loop/seal-evidence.mjs` (sha256 of the exact bytes); the consumer verifies before use. For a delta result the key is `delta-<reviewBaselineHead>-<candidateHead>-<runId>`, where the input run mints `runId` (16 lowercase hex characters) and returns it in `input.runId` and `input.resultShape`, and the result carries it. Both heads MUST be canonical full lowercase commit SHAs, or the key derivation refuses with `evidence_malformed`. The expected fields are `reviewBaselineHead`, `candidateHead`, `actSetId` and `runId`. The input run requires `--result-path`, and the record holds that path's real path, and sealing any other path refuses with `evidence_foreign_run`. `check-pre-push-delta.mjs --result` and `emit-fixer-work-order.mjs --delta-result` MUST refuse with one typed reason: `evidence_malformed`, `evidence_run_missing`, `evidence_unsealed`, `evidence_digest_mismatch` or `evidence_foreign_run`; each verifies the result before it uses any of its fields and digests the exact bytes it parsed. The input run records the newest `runId` per baseline and candidate head pair (`evidence-runs/current-delta-<baseline>-<candidate>.txt`), and a sealed result of a superseded run refuses with `evidence_foreign_run`. `--result-path` MUST be an absolute path. A refusal routes to re-running the producer, never to a manual repair of the file: a re-run of the input run mints a new run id and opens a new unsealed record, and the old seal stays final. A seal is final: sealing an already sealed run refuses with `evidence_foreign_run`, and a consumer path whose real path differs from the sealed real path refuses with `evidence_foreign_run`. This rule replaces interim rule 37, which barred hand edits of reviewer evidence.

<!-- rule: PRE-PUSH-DELTA-PATCH-ARTIFACT -->
`PRE-PUSH-DELTA-PATCH-ARTIFACT`: the `check-pre-push-delta.mjs` run without `--result` MUST write the cumulative `reviewBaselineHead..candidateHead` patch to the run-bound path `<tmp-root>/gate-delta/<reviewBaselineHead>-<candidateHead>-<runId>.patch`, with the `runId` minted for that input run before the path is computed (the `--handback` run writes nothing); on the `--reviewer-only` route the patch also appends a labeled `git show --remerge-diff` section per non-base-only merge, and the reviewer reviews those hunks too; the `--reviewer-only` result run reads only the patch of the `runId` in its own result and refuses when that file is missing or differs from its recomputed patch, so a later input run never overwrites the patch an earlier reviewer read. Each input run leaves its own patch file, and nothing prunes the older ones. The input run MUST carry that path as `input.patchPath` with `input.evidenceRule`: "Read patchPath with the read tool. Evidence is a file:line, or a test's path:line, read from disk. Run no tests, builds, or other command that mutates or executes anything, with one exception: scripts/loop/seal-evidence.mjs, to seal your own result; for a site query use only the shell-inert read/search commands the reviewer read-only gate allows (git grep, grep, rg)." The delta reviewer needs no shell for the diff: the coordinator briefs it with the input artifact paths only, and it MUST NOT run `git diff`, tests, builds or any command that mutates or executes, with the single named exception `scripts/loop/seal-evidence.mjs` for sealing its own result (`input.sealCommand` carries the concrete command). It MAY run the shell-inert read/search commands the reviewer read-only gate allows (`git grep`, `grep`, `rg`) for site queries. The `--handback` run prints none of `patchPath`, `evidenceRule` or `sealCommand`.

<!-- rule: PRE-PUSH-DELTA-INPUT -->
`PRE-PUSH-DELTA-INPUT`: the reviewer input MUST carry `reviewBaselineHead` and `candidateHead`, the act-item refs with their judge dispositions from the gate findings ledger, the current spec identity, the surface hints (the union of the act items' angle names and the angle names of the reviewed gate round, `provenance.perAngle` in the findings log; the thread route carries the act items' angles only; the CLI refuses an act-list input run without `--findings-log` (only the fixer's emitted `handbackCheck` passes `--handback`, which needs `--site-coverage` and no `--result`; the coordinator never passes it), `--findings-log` with `--threads-file`, a log without a non-empty `provenance.perAngle` (an `inline_single_agent` log without provenance contributes the angles of its `findings[]` instead), and a log whose `headSha` differs from the baseline unless `PRE-PUSH-DELTA-INPUT-CAP-CHAIN` authenticates it), `staleSurfaceHits[]` (below), each act item's `authorizedRemediation` text and site query (`defectClass`, `siteQuery`, and the input-form or stated-surface lists when present, plus `siblingRemediations[]`: each sibling's fingerprint, differing remediation text and `siteQuery`), the fixer's site coverage record (`siteCoverage[]`, below), and the adversarial-enumeration checklist. The reviewer checks the edit against the authorized remedy text and runs the site query at the candidate head, and also runs each sibling `siteQuery` there and reports its unfixed sites as residue of the kept act item. The input also carries `patchPath` and `evidenceRule` (`PRE-PUSH-DELTA-PATCH-ARTIFACT`); the reviewer reads the cumulative diff from `patchPath` with the read tool and MUST review every hunk of `reviewBaselineHead..candidateHead` for new defects under the surface hints, including the docs, contracts and tests that restate the changed behavior; each defect becomes a `newFindings[]` entry. `staleSurfaceHits[]` (optional on an older input) lists every tracked-file hit at the candidate head of a sentence removed from a Markdown or test hunk, or of an identifier removed or renamed in a code hunk, of that range; each entry is `{ kind, needle, file, line, site }`. Test and docs hits come first when a cap applies; the input carries `staleSurfaceTruncated: true` when a cap dropped hits or a needle is too common (an identifier found in many files) to list, and then also lists the dropped identifiers as `truncatedNeedles[]` (`{ kind, needle, fileCount }`) for the reviewer to check by name. The check reads git strictly: a missing commit object, a failed `git diff` or `git grep`, or non-empty `git grep` output whose rows parse to no hit fails the check; the diff and grep formats are pinned against operator git config. The coordinator MUST NOT inline diff bytes. The input MUST NOT carry sibling reviewer verdicts or "clean" claims. The reviewer MAY widen to surrounding code, spec or prior finding evidence when a concrete dependency requires it, and it MUST record each widened read in `widenedReads[]`. ADR 0141 amends the ADR 0094 surface hints and `locally_clear` condition and adds the stale-surface check (`docs/decisions/0141-delta-review-changed-line-lens-and-stale-surface-check.md`).

<!-- rule: PRE-PUSH-DELTA-INPUT-CAP-CHAIN -->
`PRE-PUSH-DELTA-INPUT-CAP-CHAIN`: the delta input accepts a `--findings-log` whose `headSha` differs from the baseline when the baseline is a base-only merge of that head, equals the end of the sealed clearing chain that starts at that head (or at a ledgerless base-only merge of the log head or of a chain end, the ADR 0218 seeding), or is a base-only merge of a chain end. The CLI resolves `--baseline` to a full SHA before the chain walk. On the chain path the baseline and every head the chain visits after the log head (each seeded merge, record candidate head and chain end) MUST have no draft_gate findings log of the PR, because a later full round supersedes the cap-round log. Chain ends and visited heads come from `clearingChainWalk` (the walk behind `clearingChainLastCandidates`, which the fixer emitter uses) and need the log's `repo` and `pr`, which MUST equal the authenticated fixer plan target, or on the reviewer-only route the `--repo` and `--pr` flags (ADR 0255); without either the chain path refuses. An unsealed record, a chain that does not reach the baseline, a merge that is not base-only, on the chain path a log without `repo` or `pr` (it has no chain ends; the base-only merge of the log head needs neither), a log whose `repo` or `pr` differs from the target, and any error or `.devloops` load failure refuse the log. The refusal names the remedy: pass the log recorded at the baseline, or the cap-round log whose sealed clearing chain reaches the baseline. ADR 0225 amends ADR 0218 and ADR 0197 for this seam.

<!-- rule: PRE-PUSH-DELTA-RESULT -->
`PRE-PUSH-DELTA-RESULT`: the reviewer MUST return a `DeltaPrePushReviewResult` bound to the baseline, candidate and act set, with a status and evidence for every claimed act item. The `actSetId` MUST equal the sequence's id, which hashes each act item's ref, angle, severity, file, line and summary (a thread-route item omits the summary, a body excerpt that varies with `--body-max`), plus its remediation scope fields (`authorizedRemediation`, `defectClass`, `siteQuery`, `defectKind`, `acceptedForms`, `rejectedForms`, `statedSurfaces`, `siblingRemediations`) when present. Each act item ref appears once, in the act list and in the result. The status MUST be `resolved`, `not_resolved` or `cannot_verify`; `cannot_verify` stays distinct from `not_resolved`. Every `evidence[]` entry, for act items and new findings, MUST be a non-empty string, and each list MUST be non-empty. `widenedReads[]` is required, and empty when nothing was widened; each entry MUST be an object `{ path, reason }` with non-empty strings, never a bare path string. A result with a missing or unknown status is rejected. The status `resolved` requires two conditions: the reported defect is gone, and the applied remedy introduces no new finding of severity medium or higher. Conformance to `authorizedRemediation` alone is not enough; when the remedy itself causes a defect, the reviewer reports it as a `newFindings[]` entry whose evidence cites the remedy text. A result of `locally_clear` MUST be refused while a `staleSurfaceHits[]` entry has neither a `newFindings[]` entry that names its file (as a whole path token: `docs/README.md` and `.claude/skills/x.md` do not name `README.md` and `skills/x.md`) nor a skipped site (with a non-empty `reason`) in `siteCoverage[]` whose site is its bare file, or its file with a `:line` or `:start-end` suffix that covers the hit's line (a skip recorded for another line of the file does not address it); a truncated list (`staleSurfaceTruncated`) is addressed the same way by an entry that names `stale-surface-hits-truncated`; this holds on the act-list route, on the thread route and on the reviewer-only route.

```text
DeltaPrePushReviewResult {  // Complete THREAD shape; an unsealed or runId-less result is refused under GATE-EXEC-EVIDENCE-SEALED.
  reviewBaselineHead, candidateHead, actSetId
  runId  // copied unchanged from input.resultShape
  actionableItems[] { ref, status: resolved | not_resolved | cannot_verify, evidence[] }
  newFindings[] { severity, summary, evidence[], residueOf?, site?, skipReason? }
  widenedReads[] { path, reason }
  outcome: locally_clear | needs_fix | bounded_out
}
```

Plan-bound ACT results (not the reviewer-only route) additionally require top-level `coverageProtocol`, `siteCoverageDigest`,
`handbackBytesDigest` and `origin`, copied unchanged from `input.resultShape` as defined above.
The recorded decision and stdout carry that same ACT-only tuple; THREAD cannot claim it.

<!-- rule: PRE-PUSH-DELTA-RESIDUE -->
`PRE-PUSH-DELTA-RESIDUE`: the reviewer MUST report an unfixed site that the act item's site query returns, or any other unfixed same-class site, as a `newFindings[]` entry with `residueOf` set to the act item ref. Residue never defers and is never resolved with a rationale. It rides the same fix commit. A residue finding without a `skipReason` blocks `locally_clear` at any severity, so the push waits. The `commit_only` fixer hands back the site coverage record (`siteCoverage[]`) that `GATE-EXEC-REMEDIATION-SITE-QUERY` defines, keyed by act-item fingerprint, and the delta input carries it. A residue finding names its `site`, and its `skipReason` MUST equal the reason that the record holds for that `residueOf` site; any other reason is rejected, and a matching reason unblocks only that finding. The record MUST be complete per `GATE-EXEC-REMEDIATION-SITE-QUERY` in [Gate Review Sub-Loop Contract](./gate-review-sub-loop-contract.md); a gap blocks `locally_clear`.

<!-- rule: PRE-PUSH-DELTA-EXIT-BOUND -->
`PRE-PUSH-DELTA-EXIT-BOUND`: `locally_clear` MUST require every claimed act item `resolved`, none `cannot_verify`, no new non-residue finding of severity medium or higher, and no residue finding (`PRE-PUSH-DELTA-RESIDUE`) that lacks a `skipReason` equal to the recorded reason for its site, and no unaddressed `staleSurfaceHits[]` entry (`PRE-PUSH-DELTA-RESULT`). Medium or higher means `high`, `question` or `medium`. A sequence MUST NOT exceed three delta review invocations, one fresh reviewer each, with no fan-out. When the third review is not locally clear, the outcome is `bounded_out` with the residual evidence: no fourth review runs, the committed candidate is pushed into the normal gate path, and no success is claimed. On the reviewer-only route `bounded_out` carries `nextStep` `restart_on_replacement_pr` and pushes nothing (ADR 0255). At the third review the bound takes precedence over `PRE-PUSH-DELTA-FRESHNESS`: a stale result also ends `bounded_out`, and the current worktree head is pushed into the normal gate path; `bounded_out` claims no remediation success or clean gate. A lifecycle refusal of the `--result` run (`LIFECYCLE-CHANGELOG-COMPLETENESS`, or a docs validator that the repository's `test:docs` runs through `scripts/docs/docs-validators.mjs`) is recorded as one medium finding per refusing validator in the sealed record (marked `lifecycle: true` by the writer) and exits 0 ([ADR 0259](https://github.com/mfittko/dev-loops/blob/main/docs/decisions/0259-delta-lifecycle-refusal-is-a-finding.md)). When the decision is otherwise locally clear, it becomes `needs_fix` with `nextStep: fix_and_rereview` (`bounded_out` at the third invocation); a decision that is already not clear keeps its outcome. On the reviewer-only route a `locally_clear` prior record is never replaced by a non-clearing result, so a lifecycle finding there throws and writes no record. A thrown infrastructure error (configuration, git, missing base, a validator crash) and a tracked or untracked non-ignored file that differs from HEAD exit 2 and write no record. The record lists at most 20 findings, lifecycle findings first; the act-list emitter adds one task per open act ref beyond them. Three named refusals exit 2 and write no record: `head_moved_during_run` (the worktree HEAD is not the reviewed candidate, checked on every `--result` run before the lifecycle checks and again after the docs validators ran, opted in or not), `docs_validators_dirty_worktree` (a tracked or untracked non-ignored file differs from HEAD, checked before and after the docs validators run) and `docs_validators_worktree_unreadable` (`git status` failed). One more named refusal exits 2: `delta_record_unsealed` (a `fix_and_rereview` record of this act set at the handback candidate has no matching seal, or the record file exists and cannot be parsed, on the handback and the act-list re-emission; the run is refused until the `--result` step reruns). A `commit_only` act-list re-emission whose sealed record holds `fix_and_rereview` at the candidate that is the worktree HEAD lists each record finding and each `not_resolved` or `cannot_verify` act ref as a fixer task and tells the fixer to commit on top of HEAD; it decides from the record's `nextStep`, never from the reviewer's stated outcome, and a re-emission with no open task refuses with `delta_record_no_open_task`; a `locally_clear` reviewer result whose record holds no finding and no open act ref keeps the issue 3111 keyed-plan route. The `--handback` run and the coordinator input run (a baseline handback on the closure path included, checked at the worktree HEAD) refuse a handback at that candidate while the record lists a lifecycle finding, or a residue finding with no recorded skip reason for its site; a handback at a new commit is accepted.

Pre-push Delta validation and ordinary commit-only coverage remain strict. After the push, full
completion may retain explicitly skipped residual input forms only under the authenticated
decision/status checks in `GATE-EXEC-FIXER-DISPOSITION-BOUNDARY` in the
[Gate Review Sub-Loop Contract](./gate-review-sub-loop-contract.md#finding-threads-and-disposition).
The clearing decision must name the actual pushed candidate even when the third result is
stale. Each ACT member still requires its own strict or explicitly residual coverage. Aggregate
repeated refs and every matching fingerprint on the authenticated root before choosing its single
disposition: all resolved means tackled; any residual means deferred/open without a Fixed reply.
A scalar fingerprint cannot narrow root membership, and distinct roots sharing a fingerprint each
need an entry. This completion exception supplies no lifecycle gate evidence.

After the push is confirmed and CI is green (ADR 0166), the full worker runs
`--construct` for every full-phase order (ACT and THREAD). For optional authenticated typed completion (ADR 0149), it uses
`verify-fixer-disposition.mjs --repo <owner/repo> --pr <n> --head-sha <sha> --fixer-plan <plan> --construct`
before normal verification. Follow the complete source,
prior commit-only provenance, raw coverage identity and live-root checks in
`GATE-EXEC-FIXER-DISPOSITION-BOUNDARY`; retain original Delta baseline A independently of full
authority/live candidate B. Construction writes only its own report and does not finish delivery.
Normal verification and `--check` authenticate that same source. Ordinary ACT/full emission now
requires the immediate genuine commit-only plan/pull/raw report and both complete modern result
and clearing-decision bindings. It preserves raw coverage and fixing F, checks clean committed
candidate B on the authority branch, and retains reviewed A as `authority.reviewBaselineHead`.
CLI/live PR head, Delta and push marker remain A; full order/ref/receipt name B. Locally-clear
results must be fresh B; invocation-three bounded-out results may remain at F while the decision
names B. Missing, partial or historical digest-only evidence refuses before replacement/grant.
Original A retirement is checked using its original execution timestamp before publication and
after awaited capture. Both emitted verifier commands use the absolute emitting script while
cwd remains the authority worktree. The constructor writes exclusively; an authentic existing
report is retried through normal/check, never removed and reconstructed. Legacy deliveries,
pre-push Delta policy and compact dispatch payloads retain their existing behavior. Isolated
mixed-root tests establish command routing, not actual worker qualification or recovery.

Explicit full `operation: complete` requires the authenticated `completesExecution` root `{ executionIdentity, heads[] }` (pull refuses without it, and refuses `stale_dispatch` once the root execution's sequence is closed) and consumes already-reviewed delivery with empty source
selectors, exactly one authenticated ACT/THREAD source and only its own output authority.
Follow `GATE-EXEC-FIXER-DISPOSITION-BOUNDARY`: ACT completion input is mandatory, even when
all optional markers are absent; THREAD reports exactly its pinned IDs, built by `--construct`,
without ACT/history. Preserve bootstrap/hash checks and immutable output; perform no source
validation, stage, commit, push, new Delta or counter reset. Complete task prose overrides
generic guidance and quoted JSON task fields without rewriting that evidence. Consumer
support does not enable emission or qualify a fresh worker: ordinary producers still emit
`fix`, and producer eligibility/publication and runtime proof remain later work.

The explicit `legacyRevalidation.origin: "legacy_revalidated"` consumer exception in
`GATE-EXEC-FIXER-DISPOSITION-BOUNDARY` replaces only unavailable historical coverage hashes
after authenticating the original full archive/prompt/receipt and exact raw prior handback.
Both historical hashes and all modern binding fields must be absent. Partial/current bindings
refuse; the commit-only origin triple remains unchanged. Require the exact historical full
Work order JSON suffix, original/current ACT/Delta bytes and semantic identity, canonical clearing
bytes and fresh unchanged locally-clear candidate. Rerun the single supported literal through
bounded native Git and compare exact stdout bytes and all raw file/form coverage on every mode.
Original evidence stays unchanged. Current sealed authority asserts capture order; later producer
work must perform/prove pre-overwrite capture and optional-worker smoke. See ADR 0151 in the
[decision records](https://github.com/mfittko/dev-loops/tree/main/docs/decisions). This enables no producer or A1 recovery.

<!-- rule: PRE-PUSH-DELTA-PUSH-AUTHORITY -->
`PRE-PUSH-DELTA-PUSH-AUTHORITY`: during a gate fix sequence only the full-phase fixer pushes the fix commit. `emit-fixer-work-order.mjs --phase commit_only` starts the sequence and writes the marker `<main worktree>/tmp/gate-delta/<reviewBaselineHead>.sequence`, whatever `--tmp-root` says; `--phase full` flips it to `fullGranted`. The marker records the PR head branch. A marker that names a branch is skipped when the push target ref is known and differs from `refs/heads/<branch>` (a stacked branch is not covered by its base branch marker). Otherwise (the target is that branch, the target is unknown, or the marker names no branch) a marker is active for a tested commit that is its baseline or descends from it, or for any push to the marker's branch (so a force-push of a rewritten, non-descendant sha is covered), until the remote-tracking ref of that branch advances past the baseline; a push of the fix branch ends it. An unreadable or malformed marker names no branch, so it reads as active and not granted and no remote ref ends it; deleting the marker ends it. A `git merge-base` failure other than "not an ancestor" refuses the push under that marker unless the marker is `fullGranted` (a granted marker is skipped, so a pruned baseline object cannot block later pushes), so the refusal names the marker file. The check tests the pushed shas and their remote refs (the checkout HEAD only when stdin has no ref lines). The refusal reason names the marker file. The refusal names the sanctioned no-commit close of the sequence with the marker's baseline head (ADR 0218), in both route forms (`--act-list <act-list> --findings-log <findings-log>` or `--threads-file <threads-file> --repo <owner/name> --pr <n>`, because the marker records no route); it never names marker deletion. For a marker that names no branch (unreadable or malformed) the no-commit close cannot authenticate it, so the refusal names no no-commit close command: it says the marker names no branch and that this rule owns its recovery. A baseline that is not a full lowercase hex SHA (including an empty one) gets the marker path and no no-commit close command, and this rule owns its recovery. The fallback refusal of a hook whose check script is missing names the ensure-worktree reinstall and the `check-pre-push-delta.mjs` no-commit close, never marker deletion. Both hook refusal texts (the check's refusal, in every branch above, and the fallback refusal) also name the one runnable spelling of the abandoned-sequence close: `node <dev-loops-package-root>/cli/index.mjs gate close-sequence --head <baseline sha> --repo <owner/name> --pr <number>`. The runtime refusals print the rendered `dev-loops-run` form of this command. To close an abandoned sequence, run that command: it removes the marker only after it writes `gate-delta/<baseline>.sequence-closed.<execution|none>.json` and proves the PR head differs from the baseline or a marker-named fixer execution never pulled its work order within the grace (the runner-lock TTL; a later pull of that work order is then refused as `stale_dispatch`); it refuses `sequence_live`, `fixer_running`, `abandonment_unproven`, `baseline_unknown` (the marker names no work order ref and its baseline is not a commit in the local repository; remedy: run the close from a checkout of the marker's repository, or ask the operator to delete the marker) and `sequence_absent` with a remedy, so a live sequence is never cleared. The closure record is an audit record only and is never gate evidence, a verdict, a findings ledger entry or a merge-readiness signal (`PRE-PUSH-DELTA-NOT-GATE-EVIDENCE`). Residual: a fork that shares git objects with the marker's repository can satisfy the local commit check (the legacy-marker baseline check, for a marker without a work order ref), so `baseline_unknown` is a guard against a wrong checkout and no proof of repository identity. `emit-fixer-work-order.mjs --phase full` works only for a sequence with a clearing delta record (see step 4 of the delta sequence). For an ACT or THREAD `commit_only` pass, the coordinator supplies the current pulled `--fixer-plan` and `--site-coverage` handback to `check-pre-push-delta.mjs`. After canonical plan, pull, source, materialization and branch authentication, HEAD equal to the baseline returns `outcome: no_commit`; HEAD differing from the authentic handback returns `outcome: head_moved`. Each closes only the matching ungranted branch marker and returns `nextStep: push_to_gate`. Missing or malformed provenance never proves a foreign commit and cannot retire a marker. The head goes to a full gate with open threads named through hash-bound `--known-findings`, without a live-head-baseline Delta. An unresolved gate-authored thread can still block admission to that round; recovery admission is a tracked `known_gap` in the [fix-loop state graph](https://github.com/mfittko/dev-loops/blob/main/docs/fix-loop-state-graph.md). THREAD full emission requires the delta record's `candidateHead` to equal the committed worktree candidate; verification independently binds it to the pushed candidate before descendant delivery. ADR 0213 records these exits. The generated git `pre-push` hook enforces the rule and runs `scripts/loop/check-fix-push-authority.mjs` with the pushed refs from git's stdin and refuses a push of any tested sha under an active, not granted marker, on Pi and Claude Code alike wherever the hook is installed; `DEVLOOPS_ALLOW_MAIN` does not bypass it. No push is refused in a checkout without the dev-loops hook (`core.hooksPath` set, or a foreign `pre-push` hook the guard does not own); with `core.hooksPath` set the install refuses, and with a foreign `pre-push` hook the install skips that slot; in both cases `ensure-worktree` warns that gate fix push authority is not enforced. The script path comes from the dev-loops side that installs the hook (`ensure-worktree`), and a hook whose baked path is missing falls back to the pushing checkout's `scripts/loop/check-fix-push-authority.mjs` and, when neither file exists, refuses a push only under a `*.sequence` marker that is not `fullGranted` and whose branch ref has not advanced past the baseline (or that names no branch), under the main worktree's `tmp/gate-delta` (fail closed). That fallback blocks no push once every marker is granted or its branch ref has advanced, and while such a marker is open it refuses every push from the repository. The delta reviewer and the `commit_only` fixer MUST NOT push. `check-pre-push-delta.mjs --pr-head <full sha>` fails closed when the PR head read from GitHub differs from `--baseline`, which detects a PR head that moved during the sequence. `emit-fixer-work-order.mjs` refuses a PR head that is not `--head-sha`.

<!-- rule: PRE-PUSH-DELTA-CLOSE-ADMISSION-ATOMIC -->
`PRE-PUSH-DELTA-CLOSE-ADMISSION-ATOMIC`: the sequence close and the fixer pull admission MUST serialize on a per-baseline-head `mkdir` lock at `gate-delta/<head>.sequence-lock` (stale after 60 seconds; a held lock refuses the close as `sequence_live`, and the pull and the fixer emission as retryable `sequence_lock_busy`, all with a rerun remedy; a stealer that died inside the steal leaves a `.steal` directory that the next contender removes once it is older than the stale age). Under the lock the close rechecks the marker (identity and mtime) and the pull receipt before it writes the closure record, the pull rechecks the closure record before it writes the receipt, the fixer emission writes the marker and renames the plan, and the no-commit close of `check-pre-push-delta.mjs` rechecks and clears the marker, so a receipt never lands after a closure record and a close never lands after a receipt (ADR 0229). A fixer that pulled its work order reads as running unless it handed back or its last activity, the later of the pull and the last write to the fixer branch reflog (a fixer that never commits shows only its pull, and a local write to the fixer branch by the closing coordinator, such as a rebase, reset or fast-forward, counts as fixer activity and delays a close by at most one grace period; both are named residuals), is older than the grace, which is the runner-lock TTL itself (`resolveStaleRunnerMaxAgeMs`), floored at the 30 minute default so `DEVLOOPS_STALE_RUNNER_MAX_AGE_MS` can only lengthen it; the runner claim `updatedAt` is never the signal, because the closing coordinator heartbeats it.

<!-- rule: PRE-PUSH-DELTA-FRESHNESS -->
`PRE-PUSH-DELTA-FRESHNESS`: before each invocation the fix MUST be committed and `candidateHead` read from the worktree. A result whose `candidateHead` differs from the current worktree head MUST NOT authorize the push; a head change outside the loop needs a new review against the current candidate.

<!-- rule: PRE-PUSH-DELTA-NOT-GATE-EVIDENCE -->
`PRE-PUSH-DELTA-NOT-GATE-EVIDENCE`: a delta result is ephemeral local evidence. It MUST NOT become a gate verdict, findings ledger entry, PR review, comment, thread or merge-readiness signal. The delta reviewer MUST NOT run gate fan-out, write the findings ledger, post a verdict, resolve threads, satisfy a gate requirement or authorize merge. The pushed fix still gets the full gate round (`PRE-PR-GATE-STILL-AUTHORITY`). One exception (ADR 0168, `GATE-EXEC-LOW-NIT-CONVERGENCE`): for a `draft_gate` round whose act items are all low or nit, a fresh `locally_clear` delta result is the proof behind the `**Converged:**` marker on the `draft_gate` comment, and that round needs no second full `draft_gate` round. A second exception (ADR 0208, `GATE-EXEC-ROUND-CAP`): a sealed `locally_clear` or `bounded_out` delta record bound to the `draft_gate` cap round's head is the proof behind the "cap round fixed" state, which lets the PR leave draft without a clean current-head `draft_gate` verdict, and which stands in for the clean `draft_gate` comment at merge (`merge-pr` gate_evidence, `GATE-EXEC-ROUND-CAP`) and at `pre_approval_gate` context entry (the `write-gate-context.mjs` `main()` ordering check, `prematureGateOrderingRefusal`) while a clean current-head `pre_approval_gate` verdict and every other pre-merge condition stay required. Only the sealed reader (`readSealedGateDeltaRecord`) trusts the record; an unsealed or hand-edited record is not evidence. Later docs-only and tests-only commits extend that chain with `gate extend-cap-round-chain` (`GATE-EXEC-ROUND-CAP-CHAIN-EXTEND`), and code commits extend it only when a sealed `locally_clear` delta record bound to exactly the start of the logic range and the PR head covers them (`extension: "delta_covered"`, ADR 0254). The `**Converged:**` marker is not merge evidence, the cap-round proof is merge evidence only in place of the clean `draft_gate` comment, and the `pre_approval_gate` still reviews the final head in full.

## Cross-references

- [Local Implementation](../local-implementation/SKILL.md): `LOCAL-PRE-PR-REVIEW-BEFORE-PUSH` wires this phase into the implementation loop; `LOCAL-DEV-SELF-CHECK-NO-FANOUT` and `LOCAL-COMMIT-BEFORE-EXIT` are the adjacent steps.
- [Copilot Loop Operations](copilot-loop-operations.md): `OPS-DRAFT-FIRST-PR` reaches this phase on the GitHub-first routes, before the first push and before `create-pr.mjs`.
- [Main-agent contract](main-agent-contract.md): model tier at dispatch (`resolveRoleModel`, pass the override only when non-null).
- [PR Lifecycle Contract](pr-lifecycle-contract.md): the post-push gate/Copilot/approval sequence this pass pre-filters.
- [Gate Review Sub-Loop Contract](gate-review-sub-loop-contract.md): the fan-out gate that remains the authority.
- [dev-loop SKILL](../dev-loop/SKILL.md) and the fixer agent (`agents/fixer.agent.md`): the gate fix pass reaches delta mode between the act-list fix commit and its push.
