okstra 0.228.1 → 0.229.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,10 +6,11 @@ description: >-
6
6
  unrelated to an okstra run. The tell is a review request over a diff:
7
7
  "review this stage", "review my branch", "code review", "leave the review
8
8
  in a file". The orchestrator censuses the diff into an explicit worklist,
9
- one to three reviewers (the user picks) each return a verdict for every cell
10
- against this project's coding-preflight rules, a coverage audit
11
- re-dispatches any gap, and the orchestrator settles what the reviewers
12
- disagree on. NOT for writing a PR body (okstra-pr-gen), starting a run
9
+ one to three reviewers on distinct models (default two) each delegate structure, naming,
10
+ readability, general defects, state and tests to six same-model subagents.
11
+ Model reviewers consolidate their teams before the orchestrator settles the
12
+ combined findings. A coverage audit repeats missing checks on their original model and specialty slots,
13
+ and the orchestrator verifies and settles findings. NOT for writing a PR body (okstra-pr-gen), starting a run
13
14
  (okstra-run), or inspecting a finished task (okstra-inspect).
14
15
  ---
15
16
 
@@ -21,7 +22,7 @@ Review what a diff changed — one okstra implementation stage, or any branch
21
22
 
22
23
  A reviewer left to build its own worklist enumerates the diff differently every run, so every run finds different things. Here the worklist — the **census** — is built **once, by you, deterministically**, before any reviewer is dispatched. Reviewers receive their slice as input; they never rebuild, reinterpret, or extend it.
23
24
 
24
- Each reviewer accounts for every cell, so Step 3.5 can detect missing checks. Complete accounting does not prove that every defect was discovered. A follow-up keeps the full PR census but re-inspects only the correction's impact closure; unchanged verdicts require verified prior evidence and a current boundary attestation. Follow `references/census-rules.md#follow-up-review` before dispatch.
25
+ Each model reviewer owns the full census and delegates its rules to six specialty subagents. Each model's team covers the full census independently; another model's findings never substitute for missing checks. Complete accounting does not prove that every defect was discovered. A follow-up keeps the full PR census but re-inspects only the correction's impact closure; unchanged verdicts require verified prior evidence and a current boundary attestation. Reading full context is required even when only the correction is being re-evaluated. Follow `references/census-rules.md#follow-up-review` before dispatch. Assignment, context and retry boundaries are lead checks, not runtime guarantees.
25
26
 
26
27
  ## Rules
27
28
 
@@ -101,7 +102,7 @@ pass task manifests, target-CLI JSON, or arbitrary JSON fields to a reviewer.
101
102
 
102
103
  **The user owns the comparison base.** Both modes resolve the selected base to a fixed commit before returning `baseCommit`. Stage mode selects the recorded stage base unless the user explicitly overrides it. Carry the returned hash verbatim into every later command and the report. Do not substitute the default branch or an inferred parent.
103
104
 
104
- **Read the frozen head in both modes.** Run git in `worktreePath` when it is non-empty, otherwise in `projectRoot`; call that location `<gitRoot>`. Read every whole source file, caller and test with `git -C <gitRoot> show <headCommit>:<path>`, including clean observations. A checkout on the selected branch may contain uncommitted edits or move during review. `worktreePath` identifies a Git repository, not authority to read its working files. Branch targets leave it empty; a released stage can also have an empty path.
105
+ **Read the frozen head in both modes.** Run git in `worktreePath` when it is non-empty, otherwise in `projectRoot`; call that location `<gitRoot>`. Read every whole source file, caller and test with `git -C <gitRoot> show <headCommit>:<path>`, including clean observations. A checkout on the selected branch may contain uncommitted edits or move during review. `worktreePath` identifies a Git repository, not authority to read its working files. Branch targets leave it empty; a released stage can also have an empty path. Deleted targets are read with `git -C <gitRoot> show <baseCommit>:<path>`; surviving callers and contracts are still read at the head.
105
106
  **Then show the base and confirm it — branch mode and stage mode alike.** The CLI's answer is a recommendation the user has not seen yet, and a base nobody looked at is how unrelated commits slip into a review unnoticed. Print `baseCommit` verbatim next to `git -C <workdir> log -1 --oneline <baseCommit>` so the commit it names is legible, then ask with a 3-option picker:
106
107
 
107
108
  1. `Use <baseCommit>` — **the recommendation**, the value the CLI returned.
@@ -122,30 +123,47 @@ pass task manifests, target-CLI JSON, or arbitrary JSON fields to a reviewer.
122
123
 
123
124
  A large census is never truncated. Report the cell count and confirm before dispatching — a silent cut is a false "I looked at everything" signal.
124
125
 
125
- ## Step 3 — Materialize and dispatch the reviewers in parallel
126
+ ## Step 3 — Select one to three model teams with six specialists each
126
127
 
127
- **Ask how many reviewers** with these choices:
128
+ Let the user choose one to three reviewers with distinct models at review start; the default is 2. Honor an explicit count without asking again. Otherwise offer 2 as the default/recommended choice, with 1 and 3 as alternatives. Carry the selected value as `<reviewerCount>`; use 2 when the user accepts the default or supplies no count. Keep that count for this review and its gap-fills. The instruction and its default are checked by `tests/contract/test_standalone_agent_invocation_surfaces.py::test_code_review_dispatches_use_verified_standalone_invocations`; the runtime count range is enforced by `resolve_operation_slots` and `tests/run/test_operation_invocation.py::test_the_caller_picks_a_count_up_to_the_contract_s`. This skill is model-agnostic: do not hard-code provider names, model names or versions, preferred model order, or specialty-to-model mappings. Resolve the roster from the runtime's registered model pool for each new review:
128
129
 
129
- 1. `2 reviewers` — **the recommendation**: two different models each review the whole census.
130
- 2. `3 reviewers` — three different models each review the whole census; higher execution cost.
131
- 3. `1 reviewer` — cheaper; you adjudicate every finding it returns.
130
+ ```
131
+ okstra agent-prompt resolve-operation --operation code-review --count <reviewerCount>
132
+ ```
132
133
 
133
- Accept only `1`, `2` or `3`; a host may also allow direct text input.
134
+ It prints the duty, the role, the reviewer count, and one `slot` line per reviewer carrying that slot's
135
+ provider and model. The operation contract (`agents/operations/code-review.json`) owns the duty and count ceiling;
136
+ the duty supplies the role, and the runtime model pool supplies the provider/model assignments.
137
+ Always pass the selected count explicitly; the operation contract's count is the ceiling, not this skill's default.
138
+ A machine with too few distinct models fails here rather than quietly running fewer reviewers.
139
+ Dispatch exactly the returned slots; never replace them with a remembered or preferred model list.
140
+ Keep the resolved assignments within that review and its gap-fills. Child inheritance below refers to
141
+ the selected runtime assignment, never to a specific model required by this skill.
134
142
 
135
- Treat reviewer-count selection as authorization for the initial invocations only. Additional model calls require explicit authorization under Step 3.5; missing coverage or a formatting error does not authorize a retry. Instruction presence is checked by `tests/contract/test_standalone_agent_invocation_surfaces.py::test_code_review_dispatches_use_verified_standalone_invocations`; actual authorization remains a lead check.
143
+ Each returned slot is a model-team coordinator, not a specialty. Every coordinator receives the full census and delegates to six actual subagents using its exact provider/model assignment:
136
144
 
137
- Then ask the runtime what those reviewers run — do not choose the role or the providers here:
145
+ | Specialty within every model team | Assigned axis | Assigned rule IDs |
146
+ |---|---|---|
147
+ | Structure | `structural` | `S1`–`S4`, plus routed `S5`–`S10` |
148
+ | Naming | `semantic` | `M1` |
149
+ | Readability | `semantic` | `M2`, `M3` |
150
+ | General defects | `general` | `G1`–`G5` |
151
+ | State | `state-and-tests` | `T1` |
152
+ | Tests | `state-and-tests` | `T2`–`T4` |
138
153
 
139
- ```
140
- okstra agent-prompt resolve-operation --operation code-review --count <1|2|3>
141
- ```
154
+ Each model coordinator divides its received full census into six assigned censuses and passes each one to its responsible subagent. The orchestrator supplies the same full census to each coordinator; the coordinator owns division and delivery within its team. Copy the specialty's rules and all cells of its axis without changing IDs, targets, references or ordering. Naming/readability share semantic cell IDs; state/tests share state-and-tests cell IDs. Their rule subsets differ. Within each team, assigned `(cell ID, rule ID)` pairs are disjoint and their union equals the full census's pairs. Across models the entire assignment repeats independently. Never partition specialties between models. An empty specialty is recorded by its coordinator as not applicable without inventing checks or dispatching an empty review. Do not pass an empty census to `scope` or `check-coverage`, which require cells.
142
155
 
143
- It prints the duty, the role, the reviewer count, and one `slot` line per reviewer carrying that slot's
144
- provider and model. The contract owns those values (`agents/operations/code-review.json`, whose `count` is
145
- the ceiling), so a machine with too few distinct models fails here rather than quietly running fewer
146
- reviewers. Dispatch exactly the slots it prints.
156
+ Show all selected model teams and the six-specialty division policy before dispatching coordinators. Each coordinator records its concrete child assignments before spawning them. The initial review includes `reviewerCount` coordinator calls and up to `6 × reviewerCount` specialty subagent calls, plus automatic coverage gap-fills under Step 3.5. Honor any user-set cost or call limit; an insufficient limit blocks dispatch rather than silently reducing the team. This authorization does not cover provider retries, new scope, another model or a new implementation round. Instruction presence is checked by `tests/contract/test_standalone_agent_invocation_surfaces.py::test_code_review_dispatches_use_verified_standalone_invocations`; delegation, authorization and assignment accuracy remain lead checks.
157
+
158
+ Each selected model coordinator itself spawns its six specialty subagents through a supported delegation surface, collects their verified completions, requests any specialty gap-fills, and consolidates their results before returning its model report. The orchestrator launches the selected coordinators; it does not spawn their children on their behalf or consolidate raw child results. These are actual separate model calls, not six headings in one response. Preserve the verified provider/model binding and standalone evidence for every child. If a coordinator cannot spawn and collect its children under that binding, report an execution blocker rather than moving those responsibilities to the orchestrator, substituting a model or replacing the team with one serial review. Specialty subagents do not delegate further. Never share other model teams' verdicts before independent team reports are complete.
159
+
160
+ ### Shared test execution evidence
147
161
 
148
- Every reviewer and later gap-fill is a separate auditable standalone invocation. For each slot, create
162
+ Before dispatch, inspect the project's test commands and applicable verification requirements. Reuse saved results only when their source tree, dependencies, configuration and test inputs match the fixed head. Otherwise the lead runs the relevant tests once in a checkout of that head isolated from user edits, preserving command, head, environment, exit code and full log. Run the project's required full gate at its prescribed stage; do not invent a universal test command or require every reviewer to rerun the same suite. External, paid or destructive tests keep their existing authorization boundary.
163
+
164
+ Share the evidence with all model teams and subagents. Every model's Tests subagent independently checks whether tests discriminate the changed behavior, cover applicable failure and boundary cases, and avoid self-mocking; test success is not proof of correctness or rule conformance. A missing, failed or blocked required test stays explicit in the report. If review identifies a necessary additional local test, the lead runs it once and shares the result. Reviewers do not edit code, add tests or launch duplicate suites. Follow-up changes invalidate affected results; unchanged, matching evidence is reused. These are lead/reviewer checks, not enforced by the coverage parser.
165
+
166
+ Every coordinator, specialty subagent and later gap-fill is a separate auditable standalone invocation. Record its team slot, specialty (or coordinator), parent coordinator ID and assigned census path in the instructions. Use unique IDs for all calls. For each invocation, create
149
167
  `.okstra/agent-invocations/code-review/<invocation-id>.instructions.md` from that reviewer's brief, then run
150
168
  `okstra agent-prompt materialize --project-root <projectRoot> --invocation-id <invocation-id> --host-runtime <runtime> --provider <slot provider> --model <slot model> --model-role <role> --audience <duty> --purpose code-review --instruction <instructions-path> --prompt <prompt-path>`,
151
169
  copying `role`, `duty`, and the slot's `provider` and `model` verbatim from `resolve-operation` (`--model`
@@ -154,33 +172,35 @@ the instructions file; the returned assignment is authoritative. Run `okstra age
154
172
  invoking any model.
155
173
 
156
174
  For a native host call, pass the verified prompt body and `hostModelValue`. For a deterministic provider
157
- process, run the provider wrapper `~/.okstra/bin/okstra-<provider>-exec.sh <projectRoot> <modelExecutionValue> <prompt-path>`
175
+ process, run the provider wrapper `~/.okstra/bin/okstra-<provider>-exec.sh <projectRoot> <modelExecutionValue> <prompt-path> "" <role> --invocation-metadata <metadataPath>`
158
176
  with the verified prompt path (`okstra worker-dispatch` dispatches only a run manifest's assignments, not a
159
177
  standalone prompt). The wrapper records the provider's output in the prompt path with `.md` replaced by
160
178
  `.log`. Never substitute one model value for the other. Dispatch the verified calls in parallel when the host supports
161
- it. **Every reviewer receives the same full census** and independently owns its verdicts. On follow-ups, add that slot's verified previous results and scope decision as described below. Every brief carries:
179
+ it. **Every reviewer receives its assigned census** and independently owns its verdicts. On follow-ups, add that slot's verified previous results and scope decision as described below. Every brief carries:
162
180
 
163
181
  - the diff and the fixed-head read command `git -C <gitRoot> show <headCommit>:<path>`, where Step 1 resolved `<gitRoot>`
164
182
  - the project layout in one or two lines (where source, tests, and — if the routing found one — domain / ports / adapters live)
165
- - **the whole census** — the shared rule catalog once and every grouped cell of all four axes, verbatim
166
- - the absolute paths of every applied pack (from step 2's routing)
183
+ - **the assigned census** — its rule subset and grouped cells, verbatim, plus its model-team slot, specialty, parent coordinator ID and the full census path for context. Coordinators receive the full census and all six child assignments; children receive only their own verdict assignment
184
+ - the absolute paths of the packs allocated to its axes (from step 2's routing)
185
+ - shared test execution evidence, including missing or blocked verification
186
+ - the full-context inspection requirement: read whole target files, enclosing definitions, affected callers and callees, contracts, outcome consumers and related tests at the frozen head; follow transitive effects as needed. Specialty limits verdict ownership, not access to context. Report a suspected issue outside the assignment to the lead, who checks it and routes any required inspection to the owning specialist without duplicating or changing cells
167
187
  - the calibration path, written out in full as Step 2 fixed it — `~/.agents/skills/okstra-code-review/references/review-calibration.md`. The verdict format, the severity points, and the rules for a legitimate `clean` are defined there, not in the brief; a reviewer that cannot open this file cannot return a usable verdict, so never hand it a relative path or a "next to the skill" hint
168
188
 
169
189
  **Resolve each slot's inspection scope before materializing its prompt.** Run:
170
190
 
171
- Use `~/.agents/skills/okstra-code-review/SKILL.md` for `<skill-path>`, the calibration path fixed in Step 2 for `<calibration-path>`, and `<okstraHome>/prompts/duties/code-reviewer.json` for `<duty-contract-path>` using Step 2's resolved home. This installed duty source exists before materialization; invocation materialization still freezes its own duty snapshot. Keep the same ordered list of policy documents and applied project instructions across rounds. Policy content is matched by position; catalog references retain the rule-to-resource binding.
191
+ Use `~/.agents/skills/okstra-code-review/SKILL.md` for `<skill-path>`, the calibration path fixed in Step 2 for `<calibration-path>`, `~/.agents/skills/okstra-code-review/references/census-rules.md` for `<census-rules-path>`, and `<okstraHome>/prompts/duties/code-reviewer.json` for `<duty-contract-path>` using Step 2's resolved home. This installed duty source exists before materialization; invocation materialization still freezes its own duty snapshot. Keep the same ordered list of policy documents and applied project instructions across rounds. Policy content is matched by position; catalog references retain the rule-to-resource binding.
172
192
 
173
193
  ```bash
174
- okstra code-review scope --project-root <projectRoot> --base <baseCommit> --head <headCommit> --census <full-census-path> --policy <skill-path> --policy <calibration-path> --policy <duty-contract-path>
194
+ okstra code-review scope --project-root <projectRoot> --base <baseCommit> --head <headCommit> --census <assigned-census-path> --policy <skill-path> --policy <calibration-path> --policy <census-rules-path> --policy <duty-contract-path>
175
195
  ```
176
196
 
177
- For a follow-up, add `--previous-head <priorHead> --previous-census <prior-census-path>` and repeat `--completion <prior-completion-path>` for that slot's retained verified completions. Include every applied project instruction as another `--policy`. Use the same selected provider/model; a missing or changed slot starts with a full review. Never substitute another reviewer's evidence. Prior records remain immutable. An identical head, rules and completed adjudication need no new model call; reuse the existing report.
197
+ For a follow-up, add `--previous-head <priorHead> --previous-census <prior-assigned-census-path>` and repeat `--completion <prior-completion-path>` for that model team's same specialty's retained verified completions. Include every applied project instruction as another `--policy`. Use the same specialty and selected provider/model; a missing or changed assignment starts with full inspection of that specialty. Never substitute another team's or another specialty's evidence. Prior records remain immutable. An identical head, rules and completed adjudication need no new model call; reuse the existing report.
178
198
 
179
199
  Carry the fixed scope text into the brief. `Recheck` names mandatory inspections; `Carry candidates` are proposals, not automatic coverage. Each reviewer inspects the delta, searches changed symbols' callers and tests, checks the dependency inventory and expands Recheck for newly discovered effects before accepting any candidate. Unknown or unbounded effects require a full review. The full census remains unchanged; no candidate silently disappears. Return current coverage rows for both inspected and inherited cells, plus the baseline and dependencies in the calibration format. Only this current invocation's verified completion and gap-fills enter the current coverage audit; old completions are scope inputs, never current verdicts.
180
200
 
181
201
  Each axis is **one rule group**, so a cell is `target × <axis>` — never `target × <individual rule>`. The reviewer names the specific rule it found violated inside the verdict's `rule` field, and one cell may carry findings from several rules of its group.
182
202
 
183
- Axis scope — each reviewer works all four axes; the `Reads` column names each group's rules, and a brief never restates them; the bodies are in the packs:
203
+ Axis scope — each specialist works its assigned axes; the `Reads` column names each group's rules, and a brief never restates them; the bodies are in the packs:
184
204
 
185
205
  | Axis | Cell | Reads |
186
206
  |---|---|---|
@@ -199,23 +219,39 @@ review result and cannot contribute a verdict.
199
219
 
200
220
  ## Step 3.5 — Audit the coverage
201
221
 
202
- Audit responses against the [coverage format](references/review-calibration.md#compact-rule-coverage).
222
+ Each spawning coordinator owns this loop against the [coverage format](references/review-calibration.md#compact-rule-coverage):
223
+
224
+ 1. Collect each child's investigation of its assigned census, including evidence, findings and explicit rule accounting.
225
+ 2. Compare the collected results with the assigned subsets and the received full census; list missing cells and rules by responsible child.
226
+ 3. Return only those omissions or invalid verdicts to the same responsible subagent, preserving its logical child identity and original assignment. Resume that child when supported; otherwise use a linked continuation invocation with its prior verified results. Do not assign the omission to another reviewer or restart completed investigations.
227
+ 4. Collect the supplementary results and repeat the audit and requests until no cells or rules remain unaccounted for. A new invocation ID records each continuation without changing logical ownership.
228
+ 5. Only then consolidate the complete results and return the model report. A stopping condition below produces an explicitly incomplete status with its blocker, never a completed review.
203
229
 
204
- For each reviewer separately, audit its grouped rows and explicit rule-ID accounting using its verified completion marker:
230
+ For each model team's specialty subagent separately, audit its grouped rows against that child's assigned rule subset using its verified completion marker:
205
231
 
206
232
  ```bash
207
- okstra code-review check-coverage --project-root <projectRoot> --head <headCommit> --census <grouped-census-path> --completion <completion-path> [--completion <gap-fill-completion-path> ...]
233
+ okstra code-review check-coverage --project-root <projectRoot> --base <baseCommit> --head <headCommit> --census <assigned-census-path> --completion <completion-path> [--completion <gap-fill-completion-path> ...]
208
234
  ```
209
235
 
210
- Pass the `headCommit` that `okstra code-review target` returned. The command reads each evidence file as `<headCommit>` holds it (`git show <headCommit>:<path>`), never the project root's working tree, so a review run from a checkout on another commit audits the reviewed lines. The command reuses the existing completion verification boundary and refuses mixed model assignments. Exit 0 means every cell accounts for all rules in its group with valid source evidence and no unknown cell ID; exit 1 lists missing cells, missing rule IDs or invalid grouped verdicts; exit 2 reports invalid input or completion evidence. It validates the shared catalog and source anchors, but does not establish whether the selected references are exhaustive or a verdict is true.
236
+ Pass the `headCommit` that `okstra code-review target` returned. The command reads head evidence at `<headCommit>` and explicit `base:` evidence at `<baseCommit>`, never the project root's working tree, so a review run from a checkout on another commit audits the reviewed lines. The command reuses the existing completion verification boundary and refuses mixed model assignments. Exit 0 means every cell accounts for all rules in its group with valid source evidence and no unknown cell ID; exit 1 lists missing cells, missing rule IDs or invalid grouped verdicts; exit 2 reports invalid input or completion evidence. It validates the shared catalog and source anchors, but does not establish whether the selected references are exhaustive or a verdict is true.
237
+
238
+ Automatically fill missing verdicts, unaccounted rules and malformed rows within the authorized review. Preserve every raw response and completion. For each incomplete specialist, dispatch one gap-fill on its original slot and specialty carrying only its incomplete grouped cells, their assigned rule subset, the same range, rule paths and full-context requirements. Ask for a complete row per affected cell under that subset. Use a new invocation ID and repeat materialize → verify → dispatch → materialize-result → complete → verify-completion. Audit that child's initial and gap-fill markers against its entire assigned census. Earlier usable verdicts remain unchanged. Repeat while the incomplete cell count decreases, until every assigned cell passes. Do not rerun completed specialists or borrow another model team's verdicts.
239
+
240
+ Stop with incomplete coverage when a gap-fill makes no progress, a user-set call/cost limit is reached, source evidence is unavailable, or an invocation fails authentication, billing, provider execution or integrity verification. Unknown cell IDs are invalid: preserve the response and report the blocker rather than relabeling IDs or retrying automatically. Do not treat infrastructure failures as missing inspections. A stopping condition fails the review instead of pausing it for authorization: dispatch no further gap-fills, continue to Step 3.6 with the verified results, and record every unaccounted `(cell ID, rule ID)` pair as a `must-fix` `now` coverage finding that names the pair, its responsible team and specialty, and the blocker. That finding stays open until a later review round accounts for the pair. A manual assessment does not satisfy reviewer coverage or create a verified completion. The lead checks these stopping conditions; the parser only checks accounting and source anchors.
211
241
 
212
- Do not automatically invoke a model for a format error, unknown ID, or missing coverage. Preserve the verified raw response and report the affected cells as incomplete; never fabricate a passing row or edit immutable evidence. The lead may inspect the cited source and record a separate manual assessment, but that assessment does not satisfy reviewer coverage or create a new verified completion. Request explicit authorization before any additional model call. If authorized for genuinely missing inspection, dispatch one gap-fill invocation per reviewer on that reviewer's original slot, carrying only its incomplete grouped cells, their shared catalog entries, the same range and rule paths. Ask for one complete row for each such cell, not separate replies per missing rule. Use a new invocation ID and repeat the full materialize → verify → dispatch → materialize-result → complete → verify-completion boundary. Re-run the audit with that reviewer's initial and gap-fill markers. Earlier usable verdicts remain unchanged. An invocation with unknown IDs is invalid; record its rejection and incomplete coverage without automatically requesting another invocation. Do not silently relabel IDs.
242
+ An isolated false observation reopens the affected cells and any dependent conclusions, not automatically every valid verdict. Record the excluded completion/cells and retain only independently valid evidence. Semantically rejected rows enter the same affected-cell gap-fill procedure; count them as incomplete when checking progress. If an older row is syntactically valid but disproved, pass the corrected completion first so the existing first-usable rule selects it; retain the older completion only for unaffected rows. If the error's extent cannot be bounded, report the unresolved extent; a full correction requires explicit authorization. Never edit an immutable response to make it pass.
213
243
 
214
- An isolated format error or false observation reopens the affected cells and any dependent conclusions, not automatically every valid verdict. Record the excluded completion/cells and retain only independently valid evidence. If an older row is syntactically valid but disproved, pass the corrected completion first so the existing first-usable rule selects it; retain the older completion only for unaffected rows. If the error's extent cannot be bounded, report the unresolved extent; a full correction requires explicit authorization. Never edit an immutable response to make it pass.
244
+ Before accepting a clean general cell, open its G2/G3/G5 observations and verify the result-meaning trace, the downstream workload and pre-work bound, and the applicable documented convention checks. If opened code contradicts an observation, record the affected cells and dependent conclusions as semantically rejected and use the bounded gap-fill procedure above. Exclude the entire completion only when the error's extent cannot be bounded; report the blocker instead of automatically requesting a full correction. Keep original artifacts immutable for the audit trail. The parser enforces presence and source locations; the lead checks truth. Keep these observations inside the existing Evidence column, without adding verdict rows.
215
245
 
216
- Before accepting a clean general cell, open its G2/G3/G5 observations and verify the result-meaning trace, the downstream workload and pre-work bound, and the applicable documented convention checks. If opened code contradicts an observation, record the affected cells and dependent conclusions as semantically rejected without automatically calling the reviewer again. Any explicitly authorized correction uses the same reviewer slot and the preceding paragraph's completion ordering. Exclude the entire completion only when the error's extent cannot be bounded; report the blocker instead of automatically requesting a full correction. Keep original artifacts immutable for the audit trail. The parser enforces presence and source locations; the lead checks truth. Keep these observations inside the existing Evidence column, without adding verdict rows.
246
+ ### Consolidate within each model, then across models
217
247
 
218
- Do not start Step 3.6 until every reviewer passes the audit. If evidence remains unavailable, report the specific blocker and incomplete coverage instead of writing a completed review.
248
+ After its six child assignments pass, the coordinator that spawned those children consolidates their verified results into one model report itself. It does not hand raw child results to the orchestrator for consolidation. Preserve every finding and its child completion provenance. Namespace finding IDs by team and specialty to avoid collisions. For a shared semantic or state-and-tests cell, combine the children's disjoint rule statuses into one complete grouped row; union their source observations and dependency files. Preserve inspected/inherited distinctions and the frozen baseline. Never convert an unaccounted rule to clean or silently discard a conflicting finding. Record conflicts for the lead to settle against the code.
249
+
250
+ The coordinator returns the full-census coverage, findings, and a child manifest listing each specialty, invocation/completion paths, assignment path and audit result, including empty-specialty acknowledgments. Publish and verify this coordinator completion through the same standalone boundary. The lead checks that every full-census `(cell ID, rule ID)` status is supported by the corresponding child's verified row and that all child findings survive consolidation. A coordinator's summary is not proof that its children ran. This provenance reconciliation is a lead check; the coverage parser does not enforce delegation or parent-child relationships.
251
+
252
+ Audit each coordinator's completion against the full census using `check-coverage`. Do not feed split-rule child completions directly into a full-census audit: the parser selects whole usable rows and does not merge partial rows. If consolidation loses a rule or finding, return the discrepancy to the spawning coordinator so it corrects its report from its saved child results; the orchestrator does not reconstruct the report. Do not rerun completed children. Preserve and verify the replacement coordinator response. Such consolidation corrections fall within authorized gap-fills and the same progress/cost stopping conditions.
253
+
254
+ Do not start Step 3.6 until all selected model reports independently pass full-census coverage and child provenance reconciliation, or a report has stopped under a Step 3.5 stopping condition. Never combine different model assignments in one `check-coverage` call. The lead then compares the selected independent model reports and settles their combined findings in Step 3.7. A stopped report contributes its verified verdicts and its coverage findings; the review is failed, never presented as complete coverage.
219
255
 
220
256
  ## Step 3.6 — Check every citation
221
257
 
@@ -225,7 +261,7 @@ Reviewers miscount lines. Pass every finding's `path:line` to one call:
225
261
  okstra code-review check-lines --project-root <projectRoot> --base <baseCommit> --head <headCommit> --cite <path:line> [--cite <path:line> ...]
226
262
  ```
227
263
 
228
- `ok` keeps the citation. A fully deleted file has no head-side citation; a deletion within a surviving file retains its anchor before the cut. For `not-changed` or `not-in-diff`, find the finding's `snippet` in `git -C <projectRoot> show <headCommit>:<path>`; if it sits on one of the changed lines the output lists, replace the line number with that line and say so in the finding. A finding whose snippet is on no changed line goes to `Rejected` as "cites no changed line". Re-run `check-lines` until every kept citation is `ok`.
264
+ `ok` keeps the citation. Use `base:<path>:<line>` for removed lines, reading the snippet with `git -C <gitRoot> show <baseCommit>:<path>`. Use `<path>:0` only for an empty file at the head; its snippet is the empty string and its evidence describes the removed behavior or empty-file consequence. A deletion within a surviving file may also retain its head anchor before the cut. For `not-changed` or `not-in-diff`, locate the snippet at its declared side and re-anchor it only to a changed location on that side. Otherwise move it to `Rejected` as "cites no changed line". Re-run `check-lines` until every kept citation is `ok`.
229
265
 
230
266
  ## Step 3.7 — Settle the findings
231
267
 
@@ -233,17 +269,15 @@ A formatting-only or minor correction does not automatically require another mod
233
269
 
234
270
  On follow-ups, retain the previous adjudication ledger: resolved, still open, parked and rejected. Recheck every fix and its affected paths. Reopening an unchanged verdict names the prior decision and new evidence: a reachable failure, a previously missed applicable rule with concrete impact, or a changed dependency/requirement. Classify each new finding as fix-introduced, previously missed, or newly in scope; do not count an old discovery as a new regression. A corrected rule interpretation can reopen a real defect; repeated preference or an alternative implementation cannot. Do not suppress a demonstrated failure because a prior reviewer marked it clean. Optional improvements remain parked and do not require a code change or another review round unless the user requests them. Keep existing severity/timing adjudication rules below.
235
271
 
236
- Before pairing findings, check every finding, including agreed ones, against the [kind-specific verdict criteria](references/review-calibration.md#separate-execution-errors-from-design-violations) and [finding requirements](references/review-calibration.md#every-finding-carries-its-fix). Record the specific reason for rejecting unsupported evidence. Then settle the findings according to the reviewer count below.
272
+ Before pairing findings, check every finding, including agreed ones, against the [kind-specific verdict criteria](references/review-calibration.md#separate-execution-errors-from-design-violations) and [finding requirements](references/review-calibration.md#every-finding-carries-its-fix). Record the specific reason for rejecting unsupported evidence. Then settle single and overlapping reports as below.
237
273
 
238
- **Two or three reviewers.** Group findings by the same `path:line` and defect. Inspect every reported finding, including one supported by only one of three reviewers; silence or a clean verdict is not a vote against it. Then:
274
+ **Selected independent model reports.** With one model, adjudicate its report directly against source evidence; do not require cross-model agreement. Group the consolidated findings by the same `path:line` and defect. Adjudicate every finding, including one reported by only one model or one of its children. Multiple children within one team count as one model's report, not independent model agreement. Missing inspection is never a clean verdict or a vote. For overlapping reports:
239
275
 
240
- - **Agreed** — every reviewer reports it with the same severity and timing. It keeps its severity and timing after the evidence and kind checks above; agreement does not replace those checks.
276
+ - **Agreed** — multiple model teams report the same defect with the same severity and timing. It keeps its severity and timing after the evidence and kind checks above; agreement does not replace those checks.
241
277
  - **Graded differently** — at least two report it with different severity or timing. Choose one reporting reviewer's severity/timing pair for that finding after reading the code, and record all reported values and your reason. Never choose an unreported value or use majority vote in place of evidence.
242
- - **One-sided** — fewer than all reviewers report it with no grading disagreement; the others returned `clean` for that cell or reported something else. Adjudicate it as below.
243
-
244
- **One reviewer.** Adjudicate every finding it returns.
278
+ - **Single report** — only one model team reports the defect. Check the other teams' corresponding rule verdicts, then adjudicate against source evidence as below; silence does not override a demonstrated defect.
245
279
 
246
- **Adjudicating** a finding: open each `evidence` location at `headCommit` and the definitions its claim depends on, then apply the verdict criteria linked above.
280
+ **Adjudicating** a finding: open each `evidence` location at its declared side (`baseCommit` for `base:` citations, otherwise `headCommit`) and the definitions its claim depends on, then apply the verdict criteria linked above.
247
281
 
248
282
  - **Confirmed** — the opened evidence satisfies the verdict criteria. The finding keeps its severity and timing.
249
283
  - **Rejected** — the code contradicts the claim (the called function never reads `this`, the value cannot be null there, the branch is unreachable). Move it to `Rejected` with the contradicting `path:line` and one sentence on what it shows.
@@ -41,7 +41,9 @@ Write targets under `## Cells`; each has a stable `C-CR-...` ID, the target and
41
41
  | C-CR-0002 | src/orders/totals.py | structural |
42
42
  ```
43
43
 
44
- The example is abbreviated; the actual catalog includes the named criteria above for every used group. Add `S5` through `S10` only for a routed architecture pack; otherwise the base catalog has 16 criteria. Freeze the catalog and cell IDs before dispatch and send the same census to each reviewer. The command `code-review check-coverage` enforces catalog membership, rule accounting and source-anchor validity against this saved census; the lead still checks that the catalog names the intended references and that verdicts are true.
44
+ The example is abbreviated; the actual catalog includes the named criteria above for every used group. Add `S5` through `S10` only for a routed architecture pack; otherwise the base catalog has 16 criteria. Freeze the full catalog and cell IDs before dispatch. Every model team receives that entire census independently, then delegates its rule subsets by the six-specialty mapping in SKILL.md. A child's assigned census retains only its specialty's rules and all cells of their group, preserving IDs, targets, references and order. Semantic cells appear in both naming and readability assignments; state-and-tests cells appear in both state and tests assignments. Their rule IDs are disjoint. Within each team, reconcile `(cell ID, rule ID)` pairs, not cell IDs alone, against the full census. Across models, repeat the full set independently.
45
+
46
+ The command `code-review check-coverage` enforces catalog membership, rule accounting and source-anchor validity against each child's subset census and, after consolidation, each coordinator's full census. It does not merge partial-rule rows across children. Coordinators combine complementary rule statuses into complete rows, preserving findings, observations, dependencies and child completion provenance. The lead checks delegation, pair coverage, aggregation fidelity, reference completeness and verdict truth; these are not enforced by the coverage parser.
45
47
 
46
48
  Do not omit a cell because a rule seems inapplicable. Record that criterion under `N/A` with its reason in the compact row. The normal case lists checked rule IDs once with one inspected source anchor for the cell. This preserves rule-level omission checks without repeating paths and explanations for every rule.
47
49
 
@@ -132,19 +134,23 @@ Both must hold exactly, and both are shown in the response before dispatch:
132
134
 
133
135
  1. **Files:** distinct files censused (in any axis) + files excluded = files in the diff.
134
136
 
135
- One `git diff --name-status` row is one file, whatever its status letter. A rename row carries two paths (`R100 <old> <new>`) and still counts **once**: census the `<new>` path and never count `<old>` on either side of the equation. A delete row (`D <path>`) counts once too, and it is always an exclusion, with the reason `deleted — no remaining line to anchor a finding on`.
137
+ One `git diff --name-status` row is one file, whatever its status letter. A rename row carries two paths (`R100 <old> <new>`) and still counts **once**: census the `<new>` path and never count `<old>` on either side of the equation. A delete row (`D <path>`) counts once and follows the same source/test membership rules as a surviving file. Its file-level cells retain the deleted path; removed functions have no semantic cells. Inspect the base source and surviving head callers, consumers and contracts. Cite removed lines as `base:<path>:<line>`. An empty surviving source still has file-level cells, anchored by `path:0` or by removed base lines. A diff containing only deletions or empty files is not an empty review.
136
138
  2. **Hunks:** every hunk in a censused file maps either to a censused function or to file-level code (imports, module wiring, declarations).
137
139
 
138
140
  ## Follow-up review
139
141
 
140
142
  Keep the original PR base and rebuild its full net-diff census at the new head. Preserve IDs for identical targets/groups; never renumber unrelated cells to fill gaps. New or moved targets get new IDs and a fresh inspection. A delta is the previous reviewed head to the current head, not a replacement PR base.
141
143
 
144
+ Keep all six specialty assignments stable within each selected model team. Run scope/coverage checks separately for each `(model-team slot, specialty)` against its current and previous subset census, then check each coordinator's consolidated report against the full census. Do not substitute another specialty's or model's completions. Each model independently covers the full census through its children. An empty assignment is acknowledged by its coordinator as described in SKILL.md, not passed to these commands.
145
+
142
146
  The `code-review scope` command proposes carry candidates per reviewer. It verifies prior completion integrity, role/model consistency within the prior results, complete prior coverage, ancestor history, exact base/head baseline, catalog references, and rule/policy content fingerprints. It reopens cells with prior findings, changed targets or changed recorded inputs. Missing dependency records reopen their cells. Any changed path outside the prior inventory, changed rules/base, rewritten history or missing baseline falls back to full review. Invalid completion integrity stops scope calculation. These checks are enforced by `code_review_scope.py::review_scope` and the standalone completion scope tests.
143
147
 
144
148
  Record each inspected cell's repository-relative input files under `Review Dependencies`: its whole target file, definitions/callees, callers, outcome consumers, relevant tests and contracts read to justify the verdict. Include transitive dependencies. Paths describe files, not line ranges; changing any part reopens the dependent cell. An external rule or instruction belongs in the repeated `--policy` inputs instead. A gap-fill retains the same baseline and records dependencies for its inspected cells.
145
149
 
146
150
  The inventory's completeness is a reviewer/lead judgment, not mechanically proven. Before accepting carry candidates, independently search the delta's changed symbols and wiring for effects beyond that inventory. Include changed behavior, error/result mappings, state, test assumptions, public contracts and downstream work. Newly affected cells reopen even when their own bytes did not change. Reopen all affected axes for the target file; expand to callers/tests outside the original census as supporting inspection without dropping or inventing census cells. Unknown reachability, dynamic dispatch, configuration-driven wiring or unexplained test failures require broader inspection, up to full review.
147
151
 
152
+ Read whole target files, relevant callers/callees, contracts and tests on the first review and on follow-ups. A smaller re-evaluation scope never means reading only changed lines or ignoring another layer. Route newly affected cells in other specialties through the lead to their owners. Unknown impact expands inspection; obtain any required scope authorization before additional model calls. Reusing an unchanged verdict requires a current impact check, not just unchanged source bytes.
153
+
148
154
  Reviewers return the complete current coverage table, identifying inherited cells separately in `Review Carry`. They attest that the current impact inspection supports each inheritance. The lead verifies that attestation and the boundary evidence. Prior `checked` labels alone never satisfy current coverage. Continue using the existing current materialize/verify/result/complete/verify-completion and check-coverage boundaries; scope output cannot mark a cell clean. This boundary audit is a review criterion, not a machine guarantee of defect absence.
149
155
 
150
156
  A count that does not balance means a file was dropped, not that the diff was odd. Find it before dispatching.
@@ -23,7 +23,9 @@ A cell covers its whole rule group, so it can carry several findings from severa
23
23
  note: The same tier→rate table is already in `domain/tiers.py:18`; a rate change now has two homes. Call the existing lookup instead of re-expressing it here.
24
24
  ```
25
25
 
26
- Fields: `cell` (`target × axis`, exactly as the census wrote it — the axis is the rule group, and there is never one cell per individual rule), `verdict` (`finding` for a detailed finding), `rule` (the specific rule this finding violates, spelled as its pack spells it), `line` (a line **this diff changed**, numbered at the head commit), `severity`, `timing` (`now` | `park`, below), `snippet` (the quoted changed line, verbatim — the orchestrator locates the finding by it), `id` (a finding ID such as `F-001`), `kind` (`execution-error` | `design-violation`), `failure` (for an execution error: reachable input or state and the wrong result), `impact` (for a design violation: the concrete design or maintenance consequence of violating the applicable rule), `evidence` (the `path:line` locations opened to establish the claim, including definitions it depends on), `note` (1–2 sentences: what is wrong plus a concrete fix).
26
+ Fields: `cell` (`target × axis`, exactly as the census wrote it — the axis is the rule group, and there is never one cell per individual rule), `verdict` (`finding` for a detailed finding), `rule` (the specific rule this finding violates, spelled as its pack spells it), `line` (a location **this diff changed**, numbered at the head commit unless explicitly base-prefixed), `severity`, `timing` (`now` | `park`, below), `snippet` (the quoted changed line, verbatim — the orchestrator locates the finding by it), `id` (a finding ID such as `F-001`), `kind` (`execution-error` | `design-violation`), `failure` (for an execution error: reachable input or state and the wrong result), `impact` (for a design violation: the concrete design or maintenance consequence of violating the applicable rule), `evidence` (the `path:line` locations opened to establish the claim, including definitions it depends on), `note` (1–2 sentences: what is wrong plus a concrete fix).
27
+
28
+ For removals, use `base:path:line` to identify a removed base line and open its snippet at the frozen base. An empty regular file may use `path:0` with an empty snippet as a file-level anchor, not a source line. `check-lines` enforces changed locations; `check-coverage --base` validates base evidence and accepts line 0 only for empty regular files. Use the same citation forms in Evidence and G2/G3/G5 observations. Trace surviving callers and contracts at the head.
27
29
 
28
30
  **Open the definition before you claim its behaviour.** A claim about what a called function, method, or value does — that it reads `this`, throws, mutates its argument, returns `null` — cites that definition in `evidence`. A claim you could not check against its definition remains unevaluated: report the missing evidence and leave that rule unaccounted in the grouped row. Do not turn an inspection failure into `clean`. The orchestrator opens every `evidence` location and rejects a finding the code contradicts.
29
31
 
@@ -63,11 +65,11 @@ Return one compact Coverage Verdicts row per cell under `## Coverage Verdicts`.
63
65
  | C-CR-0003 | - | T1=no state mutation; T2=non-test source; T3=non-test source; T4=no tests or new branches | - | src/orders/schema.py:1 |
64
66
  ```
65
67
 
66
- The example uses the base structural and state-and-tests catalogs. `Checked` means inspected and no actionable finding for those rules. A criterion includes all applicable subconditions in its references; one inapplicable subcondition does not make the entire criterion N/A. Explicitly list the IDs; `all`, counts and ID ranges are not verdicts. `N/A` assigns `rule=reason`; `Findings` assigns `rule=finding-id`. Separate assignments with semicolons and multiple finding IDs for one rule with commas. Use `-` for an empty field. Every expected rule appears exactly once across the three status fields. Never infer an omitted rule as clean.
68
+ The example uses the base structural and state-and-tests catalogs. `Checked` means inspected and no actionable finding for those rules. A criterion includes all applicable subconditions in its references; one inapplicable subcondition does not make the entire criterion N/A. Explicitly list the IDs; `all`, counts and ID ranges are not verdicts. `N/A` assigns `rule=reason`; `Findings` assigns `rule=finding-id`. Separate assignments with semicolons and multiple finding IDs for one rule with commas. Only a semicolon followed by the next `RULE=` starts a new assignment; a semicolon inside a reason stays part of that reason. Use `-` for an empty field. Every expected rule appears exactly once across the three status fields. Never infer an omitted rule as clean.
67
69
 
68
- Every row supplies one literal repository-relative source `path:line` for that cell's target file. The citation may be backtick-quoted and followed by ` — ` and a short observation before any ` :: ` rule observations. Do not substitute a rule-pack citation such as `cc:5`, a global alias such as `E01`, or another target's path. The checker verifies that the file and line exist inside the project. Additional definitions and evidence remain in finding bodies.
70
+ Every row supplies one literal repository-relative source `path:line` for that cell's target file. The citation may be backtick-quoted and followed by ` — ` and a short observation before any ` :: ` rule observations. Do not substitute a rule-pack citation such as `cc:5`, a global alias such as `E01`, or another target's path. The checker verifies the declared source side and location; `base:` requires the frozen `--base`, and line 0 requires an empty regular file. These explicit forms override the head-line default above. Additional definitions and evidence remain in finding bodies.
69
71
 
70
- For `general` cells, checked G2, G3 and G5 each carry a compact observation in that same Evidence field: `target/path:line :: G2=source/path:line observed outcome mapping; G3=source/path:line observed workload and bound; G5=source/path:line applicable clauses and observed conformance`. Each observation begins with an existing project-source citation; it may cite a relevant callee. Keep rule-pack references in the catalog or the observation text, not in the project-source citation slot. Separate assignments with semicolons; use commas within an observation. Findings and reasoned N/A already explain their criteria and need no duplicate clean observation.
72
+ For `general` cells, checked G2, G3 and G5 each carry a compact observation in that same Evidence field: `target/path:line :: G2=source/path:line observed outcome mapping; G3=source/path:line observed workload and bound; G5=source/path:line applicable clauses and observed conformance`. Each observation begins with an existing project-source citation; it may cite a relevant callee. Keep rule-pack references in the catalog or the observation text, not in the project-source citation slot. Separate assignments with semicolons; the same `RULE=` boundary applies, so a semicolon inside an observation stays part of it. Findings and reasoned N/A already explain their criteria and need no duplicate clean observation.
71
73
 
72
74
  For example, `jobs/dispatch.py:18 :: G2=jobs/client.py:25 returned states preserve the dependency outcomes; G3=jobs/dispatch.py:9 validated batch limit bounds work before parsing; G5=jobs/dispatch.py:18 public typing and exception-chaining clauses hold` records three observations in one row. `checked`, `clean` and `no issues` alone are verdict labels, not observations. The checker rejects missing observations, notes for unchecked criteria, aliases and invalid source locations. It cannot establish whether a written observation is true.
73
75
 
@@ -110,7 +112,7 @@ Loose typing in test files (`any`, dynamic casts, untyped fixtures) is a **typin
110
112
 
111
113
  ## The report
112
114
 
113
- Merged and adjudicated by the orchestrator, written to `reviewPath`. Use the values resolved by Step 1 and the dispatched slots for the following YAML frontmatter fields, in this order. Include `taskKey` and `stage` only in stage mode, and `branch` only in branch mode.
115
+ Each spawning model coordinator consolidates its own subagents into a completed model report. The orchestrator receives the selected model teams' completed reports, verifies and adjudicates their findings, and writes the final report to `reviewPath`; it does not consolidate raw child results. Aggregation discrepancies return to the spawning coordinator for correction. Use the values resolved by Step 1 and the dispatched slots for the following YAML frontmatter fields, in this order. Include `taskKey` and `stage` only in stage mode, and `branch` only in branch mode.
114
116
 
115
117
  ```yaml
116
118
  mode: stage | branch
@@ -141,7 +143,8 @@ Sections, in this order, empty ones omitted except `Coverage` and `Score`:
141
143
  - **Parked** — `park` findings, with their severity, not scored.
142
144
  - **Rejected** — findings the orchestrator's adjudication disproved or that cite no changed line: the reviewer's claim in one line, then the contradicting `path:line` and what it shows. Not scored.
143
145
 
144
- - **Coverage** — the reviewers (`provider/model`, one to three); N changed files → S `structural` / F `semantic` / T `state-and-tests` / G `general` cells, all accounted for by every reviewer; M files excluded with reasons; applied/unavailable packs; and how findings were settled. Also show expected/covered grouped cells, missing rule IDs and reasoned applicability exclusions. On follow-ups, distinguish freshly inspected from inherited cells per reviewer, name the prior head and scope fallback/expansion reasons, and classify new findings by origin. Never describe inherited cells as newly inspected or rule flags as independent targets.
146
+ - **Coverage** — the selected one to three model teams (`provider/model`, default two), each team's six specialty subagents and verified child completion provenance; N changed files → S `structural` / F `semantic` / T `state-and-tests` / G `general` cells, independently accounted for in every model report; M files excluded with reasons; applied/unavailable packs; and how findings were settled. Show expected/covered cells and assigned rule IDs per child, empty-specialty acknowledgments, each team's complete `(cell ID, rule ID)` union, and each coordinator's full-census audit. Retain child-to-team-to-final finding provenance when deduplicating. Record gap-fill rounds and any no-progress, budget or execution blocker. On follow-ups, distinguish freshly inspected from inherited cells per model and specialty, name the prior head and scope fallback/expansion reasons, and classify new findings by origin. Never describe inherited cells as newly inspected or rule flags as independent targets.
147
+ - **Test evidence inside Coverage** — record each shared test command, tested head, environment, exit code and log path, identifying reused results and their matching inputs. Distinguish test-source inspection from actual execution. State failed, missing or blocked required checks; a completed code inspection does not imply the implementation passed its release gate. Do not claim an unexecuted test passed or count duplicate reviewer runs as independent evidence.
145
148
  - **Findings** — each one opens with `` `path/to/file.py:42` `` + the verdict's `rule` name + `kind` + severity + points, then the snippet as a blockquote, then the 1–2 sentence note with its fix, the execution `failure` or design `impact`, and supporting `evidence`. Its note then says how it was settled: `agreed`, `graded by orchestrator` (with every reporting reviewer's values), or `confirmed by orchestrator`.
146
149
  - **Score** — every confirmed or agreed `now` finding gets a row after passing the citation and evidence checks in Steps 3.6–3.7. Count each deduplicated finding once. The table is emitted even when there are none, with a single total row reading 0:
147
150
 
@@ -181,7 +181,9 @@ from okstra_project.dirs import tasks_root as _okstra_tasks_root # noqa: E402
181
181
  from okstra_project.resolver import resolve_architecture # noqa: E402
182
182
 
183
183
  from okstra_ctl.conformance import (
184
+ conformance_entry_mismatches,
184
185
  conformance_result_file,
186
+ conformance_script_matches as _conformance_script_matches,
185
187
  detect_surfaces,
186
188
  evaluate_conformance,
187
189
  manifest_required_surfaces,
@@ -2210,27 +2212,6 @@ def _approved_plan_conformance_manifest(
2210
2212
  }
2211
2213
 
2212
2214
 
2213
- def _conformance_script_matches(actual: str, declared: str) -> bool:
2214
- """두 script 표기가 같은 파일을 가리키는지 판정한다.
2215
-
2216
- 1순위는 task-root 상대형끼리의 일치다. task_root 아래로 접히지 않는
2217
- 절대경로(예: 워크트리 경로로 적힌 선언)가 남으면, 남은 쪽이 다른 쪽을
2218
- 경로 경계에서 후행 일치하는지까지 본다 — `/…/wt/qa/scripts/s.ts` 와
2219
- `qa/scripts/s.ts` 는 같은 파일이다. 후행 일치는 경계(`/`)를 요구하므로
2220
- `renamed-stage-1.ts` 같은 다른 파일은 걸리지 않는다.
2221
- """
2222
- if actual == declared:
2223
- return True
2224
- if not actual or not declared:
2225
- return False
2226
- if actual.startswith("/") != declared.startswith("/"):
2227
- longer, shorter = (
2228
- (actual, declared) if actual.startswith("/") else (declared, actual)
2229
- )
2230
- return longer.endswith("/" + shorter)
2231
- return False
2232
-
2233
-
2234
2215
  def _declared_conformance_errors(
2235
2216
  declared_manifest: dict,
2236
2217
  actual_manifest: dict,
@@ -2268,23 +2249,17 @@ def _declared_conformance_errors(
2268
2249
  declared_script = _normalize_conformance_script(
2269
2250
  str(declaration.get("script") or ""), task_root
2270
2251
  )
2271
- if not _conformance_script_matches(actual_script, declared_script):
2272
- errors.append(f"stage {stage_number} script mismatch")
2273
- actual_requires = actual_entry.get("requires")
2274
- actual_capabilities = (
2275
- frozenset(actual_requires)
2276
- if isinstance(actual_requires, list)
2277
- and all(isinstance(value, str) for value in actual_requires)
2278
- else None
2279
- )
2280
2252
  # 넓히는 것만 허용한다 — 선언보다 많은 capability 는 더 엄격한 검증이다.
2281
2253
  # 승인된 계획이 `requires` 를 좁게 적고 그 stage 의 diff 가 다른 표면을
2282
2254
  # 건드리면, diff-surface 대조는 넓힐 것을 요구하는데 정확 일치는 그것을
2283
2255
  # 거절해 같은 계획으로는 통과할 입력이 없었다(2026-09-22 dev-10860
2284
2256
  # Stage 1). 좁히는 것은 선언한 검증을 빼는 것이므로 여전히 불일치다.
2285
- declared_capabilities = frozenset(declaration.get("requires") or [])
2286
- if actual_capabilities is None or not actual_capabilities >= declared_capabilities:
2287
- errors.append(f"stage {stage_number} requires mismatch")
2257
+ for error in conformance_entry_mismatches(
2258
+ actual_script=actual_script, declared_script=declared_script,
2259
+ actual_requires=actual_entry.get("requires"),
2260
+ declared_requires=frozenset(declaration.get("requires") or []),
2261
+ ):
2262
+ errors.append(f"stage {stage_number} {error}")
2288
2263
  # 계획이 면제한 stage 에 구현이 실제 Tier 3 항목을 붙이는 것은 허용한다 —
2289
2264
  # 면제 stage 의 diff 가 db/io/http/external 표면을 건드려 diff-surface 대조에
2290
2265
  # 걸렸을 때, 승인된 계획은 불변이므로 그 항목이 유일한 진행 경로다