mandrel 2.110.0 → 2.112.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.
- package/.agents/agents/acceptance-critic.md +14 -0
- package/.agents/agents/auditor.md +14 -0
- package/.agents/agents/plan-critic.md +5 -0
- package/.agents/agents/story-worker.md +4 -1
- package/.agents/audit-checklists/state-machines.md +21 -0
- package/.agents/docs/agentrc-reference.json +23 -10
- package/.agents/docs/configuration.md +362 -15
- package/.agents/docs/execution-reference.md +11 -0
- package/.agents/docs/workflows.md +2 -1
- package/.agents/rules/ci-remediation.md +28 -4
- package/.agents/rules/git-conventions-reference.md +7 -0
- package/.agents/schemas/agentrc.schema.json +179 -13
- package/.agents/schemas/audit-rules.json +28 -0
- package/.agents/schemas/baselines/baseline-envelope.schema.json +16 -4
- package/.agents/schemas/baselines/bundle-size.schema.json +1 -0
- package/.agents/schemas/baselines/coverage.schema.json +1 -0
- package/.agents/schemas/baselines/crap.schema.json +37 -10
- package/.agents/schemas/baselines/duplication.schema.json +1 -0
- package/.agents/schemas/baselines/maintainability.schema.json +1 -0
- package/.agents/schemas/baselines/mutation.schema.json +1 -0
- package/.agents/schemas/crap-report.schema.json +6 -5
- package/.agents/schemas/story-deliver-terminal.schema.json +49 -3
- package/.agents/schemas/story-progress.schema.json +1 -1
- package/.agents/schemas/validation-evidence.schema.json +2 -2
- package/.agents/scripts/boot-sweep.js +41 -3
- package/.agents/scripts/coverage-capture.js +39 -3
- package/.agents/scripts/coverage-ratchet.js +106 -0
- package/.agents/scripts/evidence-gate.js +84 -21
- package/.agents/scripts/file-ci-gap.js +220 -10
- package/.agents/scripts/lib/audit-baselines/read.js +8 -1
- package/.agents/scripts/lib/audit-baselines/trend.js +2 -1
- package/.agents/scripts/lib/audit-to-stories/audit-lenses.js +1 -0
- package/.agents/scripts/lib/baseline-loader.js +4 -2
- package/.agents/scripts/lib/baselines/codec.js +57 -0
- package/.agents/scripts/lib/baselines/crap-preview-incremental.js +8 -3
- package/.agents/scripts/lib/baselines/crap-preview-scan.js +10 -16
- package/.agents/scripts/lib/baselines/crap-updater-cli.js +4 -13
- package/.agents/scripts/lib/baselines/kernel.js +19 -1
- package/.agents/scripts/lib/baselines/kinds/_crap-codec.js +171 -0
- package/.agents/scripts/lib/baselines/kinds/_crap-read.js +56 -16
- package/.agents/scripts/lib/baselines/kinds/_shared-metric.js +0 -59
- package/.agents/scripts/lib/baselines/kinds/crap.js +283 -319
- package/.agents/scripts/lib/baselines/preview-gates.js +29 -10
- package/.agents/scripts/lib/baselines/reader.js +36 -9
- package/.agents/scripts/lib/baselines/refresh-service.js +79 -18
- package/.agents/scripts/lib/baselines/seat-missing.js +173 -7
- package/.agents/scripts/lib/baselines/writer.js +36 -21
- package/.agents/scripts/lib/changed-files.js +70 -6
- package/.agents/scripts/lib/child-exec.js +10 -0
- package/.agents/scripts/lib/claude/agents-projection.js +5 -5
- package/.agents/scripts/lib/close-lock-events.js +8 -3
- package/.agents/scripts/lib/close-validation/ci-deferral.js +40 -0
- package/.agents/scripts/lib/close-validation/gates.js +156 -32
- package/.agents/scripts/lib/close-validation/process.js +16 -7
- package/.agents/scripts/lib/close-validation/projections/crap.js +43 -10
- package/.agents/scripts/lib/close-validation/runner.js +160 -41
- package/.agents/scripts/lib/close-validation/skip-branch-test.js +144 -0
- package/.agents/scripts/lib/close-validation/test-delta.js +33 -8
- package/.agents/scripts/lib/codex/agents-projection.js +6 -0
- package/.agents/scripts/lib/config/agentrc-overlay.js +9 -5
- package/.agents/scripts/lib/config/explain.js +5 -2
- package/.agents/scripts/lib/config/gates/coverage.schema.js +53 -0
- package/.agents/scripts/lib/config/gates/crap-incremental-coverage.schema.js +1 -1
- package/.agents/scripts/lib/config/git-roots.js +38 -4
- package/.agents/scripts/lib/config/handoff.js +24 -0
- package/.agents/scripts/lib/config/quality.js +28 -12
- package/.agents/scripts/lib/config/worktree-isolation.js +2 -5
- package/.agents/scripts/lib/config-resolver.js +22 -2
- package/.agents/scripts/lib/config-settings-schema-delivery.js +87 -4
- package/.agents/scripts/lib/config-settings-schema-quality.js +36 -1
- package/.agents/scripts/lib/config-settings-schema.js +1 -1
- package/.agents/scripts/lib/coverage-capture-affected.js +1 -0
- package/.agents/scripts/lib/coverage-capture-delta.js +164 -32
- package/.agents/scripts/lib/coverage-capture-own-fix.js +232 -0
- package/.agents/scripts/lib/coverage-capture-usage.js +2 -2
- package/.agents/scripts/lib/coverage-capture.js +31 -0
- package/.agents/scripts/lib/coverage-deferral.js +96 -0
- package/.agents/scripts/lib/coverage-ratchet.js +187 -0
- package/.agents/scripts/lib/crap-baseline-join.js +5 -5
- package/.agents/scripts/lib/crap-engine.js +3 -3
- package/.agents/scripts/lib/crap-method-identity.js +104 -48
- package/.agents/scripts/lib/escomplex-anchor.js +135 -0
- package/.agents/scripts/lib/escomplex-kernel.js +30 -1
- package/.agents/scripts/lib/failure-rows.js +121 -0
- package/.agents/scripts/lib/full-suite-lock.js +44 -4
- package/.agents/scripts/lib/full-suite-queue.js +89 -13
- package/.agents/scripts/lib/generated/agentrc-validator.js +8 -2
- package/.agents/scripts/lib/gh-env.js +3 -6
- package/.agents/scripts/lib/gh-pr-rest.js +1 -0
- package/.agents/scripts/lib/git/base-sync-probe.js +182 -0
- package/.agents/scripts/lib/git-branch-lifecycle.js +9 -0
- package/.agents/scripts/lib/observability/close-telemetry.js +37 -2
- package/.agents/scripts/lib/observability/handoff-telemetry.js +170 -0
- package/.agents/scripts/lib/observability/review-dispositions.js +23 -6
- package/.agents/scripts/lib/observability/runtime-friction.js +17 -4
- package/.agents/scripts/lib/observability/source-classifier.js +3 -0
- package/.agents/scripts/lib/observability/story-outcome.js +393 -0
- package/.agents/scripts/lib/orchestration/check-baselines/phases/compare.js +2 -1
- package/.agents/scripts/lib/orchestration/check-baselines/phases/evaluate.js +19 -1
- package/.agents/scripts/lib/orchestration/check-baselines/phases/fail-detail.js +84 -0
- package/.agents/scripts/lib/orchestration/check-baselines/phases/pipeline.js +14 -5
- package/.agents/scripts/lib/orchestration/check-baselines/phases/refresh-ack.js +3 -2
- package/.agents/scripts/lib/orchestration/check-baselines/phases/report.js +26 -6
- package/.agents/scripts/lib/orchestration/ci-rerun-guard.js +124 -23
- package/.agents/scripts/lib/orchestration/code-review.js +223 -19
- package/.agents/scripts/lib/orchestration/handoff-gates.js +217 -44
- package/.agents/scripts/lib/orchestration/handoff-rescore.js +169 -0
- package/.agents/scripts/lib/orchestration/handoff-suite-of-record.js +45 -0
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +5 -1
- package/.agents/scripts/lib/orchestration/plan-persist/source-rewrite.js +76 -4
- package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +2 -2
- package/.agents/scripts/lib/orchestration/preflight-lanes.js +208 -0
- package/.agents/scripts/lib/orchestration/review-base-ref.js +40 -17
- package/.agents/scripts/lib/orchestration/review-deposit.js +38 -12
- package/.agents/scripts/lib/orchestration/review-depth.js +21 -0
- package/.agents/scripts/lib/orchestration/review-history.js +124 -20
- package/.agents/scripts/lib/orchestration/review-providers/claude-verdict.js +23 -8
- package/.agents/scripts/lib/orchestration/review-providers/code-review.js +82 -39
- package/.agents/scripts/lib/orchestration/review-providers/critical-verifier.js +64 -11
- package/.agents/scripts/lib/orchestration/review-providers/degraded-gates.js +98 -3
- package/.agents/scripts/lib/orchestration/review-providers/finding-identity.js +6 -2
- package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +55 -8
- package/.agents/scripts/lib/orchestration/review-providers/review-guidance.js +1 -0
- package/.agents/scripts/lib/orchestration/review-providers/review-provider-factory.js +42 -15
- package/.agents/scripts/lib/orchestration/review-providers/types.js +6 -0
- package/.agents/scripts/lib/orchestration/single-story-close/failed-terminal.js +10 -1
- package/.agents/scripts/lib/orchestration/single-story-close/gate-log.js +10 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +7 -4
- package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +17 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +59 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +13 -1
- package/.agents/scripts/lib/orchestration/single-story-close/phases/finish.js +15 -4
- package/.agents/scripts/lib/orchestration/single-story-close/phases/land-review-record.js +213 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/normalize-pr-title.js +17 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/open-pr.js +42 -20
- package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +51 -26
- package/.agents/scripts/lib/orchestration/single-story-close/phases/pre-push.js +3 -1
- package/.agents/scripts/lib/orchestration/single-story-close/phases/pull-request.js +51 -15
- package/.agents/scripts/lib/orchestration/single-story-close/phases/push.js +59 -11
- package/.agents/scripts/lib/orchestration/single-story-close/phases/reconcile-done.js +1 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-block.js +31 -13
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-halt.js +29 -6
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-outcome.js +10 -12
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-override.js +19 -4
- package/.agents/scripts/lib/orchestration/single-story-close/result.js +43 -13
- package/.agents/scripts/lib/orchestration/single-story-close/review-overlap.js +73 -39
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +11 -2
- package/.agents/scripts/lib/orchestration/story-close/baseline-upward-writeback.js +3 -2
- package/.agents/scripts/lib/orchestration/story-close/duplication-close-rescore.js +20 -8
- package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +7 -0
- package/.agents/scripts/lib/orchestration/story-handoff.js +789 -196
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +2 -0
- package/.agents/scripts/lib/pr-body-lines.js +32 -0
- package/.agents/scripts/lib/single-story/ci-ratchet-gate.js +140 -0
- package/.agents/scripts/lib/single-story/confirm-and-land.js +17 -7
- package/.agents/scripts/lib/single-story/confirm-merge.js +12 -3
- package/.agents/scripts/lib/single-story-sweep/report-stalled-executing.js +202 -0
- package/.agents/scripts/lib/standalone-ratchets.js +37 -0
- package/.agents/scripts/lib/suite-admission.js +20 -8
- package/.agents/scripts/lib/suite-sizing.js +146 -0
- package/.agents/scripts/lib/workspace-provisioner.js +2 -2
- package/.agents/scripts/merge-baseline.js +14 -3
- package/.agents/scripts/providers/github/comments.js +19 -3
- package/.agents/scripts/providers/github.js +1 -0
- package/.agents/scripts/review-dispositions-report.js +1 -1
- package/.agents/scripts/role-scope-guard.js +267 -0
- package/.agents/scripts/single-story-close.js +4 -4
- package/.agents/scripts/single-story-confirm-merge.js +31 -5
- package/.agents/scripts/single-story-init.js +24 -4
- package/.agents/scripts/story-handoff.js +3 -3
- package/.agents/scripts/story-outcomes-report.js +231 -0
- package/.agents/scripts/story-review-compute.js +9 -5
- package/.agents/scripts/update-coverage-baseline.js +12 -2
- package/.agents/scripts/update-crap-baseline.js +9 -1
- package/.agents/workflows/audit-state-machines.md +213 -0
- package/.agents/workflows/helpers/code-review.md +63 -9
- package/.agents/workflows/helpers/deliver-digest.md +53 -54
- package/.agents/workflows/helpers/deliver-reference.md +236 -63
- package/.agents/workflows/helpers/deliver-story-reference.md +19 -8
- package/.agents/workflows/helpers/deliver-story.md +7 -2
- package/.agents/workflows/helpers/parallel-tooling.md +29 -0
- package/.agents/workflows/helpers/plan-reference.md +10 -2
- package/docs/CHANGELOG.md +56 -0
- package/lib/cli/doctor-checks/coverage-ratchet.js +54 -0
- package/lib/cli/doctor-checks/effective-agentrc.js +23 -0
- package/lib/cli/doctor-checks/llm-review.js +2 -11
- package/lib/cli/doctor-checks/sync-parity.js +5 -1
- package/lib/cli/doctor-checks/test-credit-path.js +7 -2
- package/lib/cli/registry.js +5 -0
- package/package.json +1 -1
|
@@ -83,6 +83,10 @@ How each tier changes the review protocol:
|
|
|
83
83
|
to check every caller in that block against the new signature or shape —
|
|
84
84
|
the one bug class a diff alone cannot show.
|
|
85
85
|
|
|
86
|
+
The `code-review` provider also maps depth to `claude --effort`: `low` at
|
|
87
|
+
`light` and `standard`, `high` at `deep`. `delivery.codeReview.effortByDepth`
|
|
88
|
+
overrides that per depth (`low`/`medium`/`high`/`xhigh`/`max`).
|
|
89
|
+
|
|
86
90
|
The LLM-backed review providers (code-review, codex, security-review,
|
|
87
91
|
ultrareview) render the resolved `depth` into the prompt/instructions they emit so the underlying
|
|
88
92
|
model actually changes thoroughness. The native provider deliberately ignores
|
|
@@ -122,6 +126,30 @@ collapsed under **Previously raised**. A repeat still halts unless an operator
|
|
|
122
126
|
overrode that CRITICAL with `--override-review-block` earlier, in which case
|
|
123
127
|
it is downgraded to a suggestion.
|
|
124
128
|
|
|
129
|
+
### Earlier CRITICALs stay blocking
|
|
130
|
+
|
|
131
|
+
A CRITICAL that survived grounding and verification stays open across later
|
|
132
|
+
runs. Each run settles every open one: raised again at an overlapping
|
|
133
|
+
location and still critical, it halts as a repeat; raised there but refuted
|
|
134
|
+
or ungrounded by this run, it is resolved. Otherwise (absent, or raised below
|
|
135
|
+
critical) the critical-verifier re-checks the stored finding at the current
|
|
136
|
+
head: one call each at any depth, at most 10 per run, 3 in flight. Only a
|
|
137
|
+
`refuted` verdict resolves it; confirmed, uncertain, an unproven
|
|
138
|
+
confirmation, an error, a missing CLI or the cap carries it into the run's
|
|
139
|
+
findings as a blocking CRITICAL (errors and the cap also record a
|
|
140
|
+
`critical-verification` degraded gate). A later delta touching its location
|
|
141
|
+
never clears it: only a verifier refutation at the current head or an
|
|
142
|
+
operator override does, and `--override-review-block` covers a carried
|
|
143
|
+
CRITICAL like any other. A resolved one is labelled `fixed` when its instance
|
|
144
|
+
files changed since the head that raised it, else `refuted` (reporting only).
|
|
145
|
+
The history keeps each CRITICAL's title, body (4,000 characters), location
|
|
146
|
+
and claim for the re-check, plus each run's outcomes; an older history reads
|
|
147
|
+
as before. When the history holds any earlier surviving CRITICAL, the comment
|
|
148
|
+
renders an **Earlier CRITICALs** section (id, title, last location, raising
|
|
149
|
+
head, status `still open` / `fixed` / `refuted` / `overridden`), on a
|
|
150
|
+
zero-finding run too; a carried finding renders only there, and the
|
|
151
|
+
unqualified no-findings claim is suppressed while one is still open.
|
|
152
|
+
|
|
125
153
|
### Review dispositions
|
|
126
154
|
|
|
127
155
|
When a Story lands, the post-land tail (before the temp purge reaps the
|
|
@@ -130,9 +158,11 @@ local, never-committed `<tempRoot>/review-dispositions.ndjson` (rotated at
|
|
|
130
158
|
1 MB, one `.1` generation kept). Precedence, with the last run as the final
|
|
131
159
|
review: `overridden` (an operator overrode it; the record carries the
|
|
132
160
|
redacted reason, clipped to 500 characters), `downgraded-ungrounded` and
|
|
133
|
-
`refuted-by-verifier` (flagged in the final run),
|
|
134
|
-
|
|
135
|
-
|
|
161
|
+
`refuted-by-verifier` (flagged in the final run), then an earlier
|
|
162
|
+
CRITICAL's last re-check resolution (`fixed` → `fixed-on-branch`, `refuted` →
|
|
163
|
+
`refuted-by-verifier`), `open-at-merge` (in the final run otherwise,
|
|
164
|
+
including a carried CRITICAL), `fixed-on-branch` (raised earlier, absent from
|
|
165
|
+
the final run). A record holds ids, provider, severity, class and run count only,
|
|
136
166
|
never a title, body, path or excerpt; a Story already recorded appends
|
|
137
167
|
nothing. Summarize with
|
|
138
168
|
`node .agents/scripts/review-dispositions-report.js [--since <YYYY-MM-DD>] [--json]`:
|
|
@@ -168,12 +198,36 @@ The pipeline will:
|
|
|
168
198
|
close-validation gate, so the review does not re-run it).
|
|
169
199
|
- Post a structured summary report to the `[TICKET_ID]` issue.
|
|
170
200
|
|
|
171
|
-
**What the review did not check is posted, not silent.**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
201
|
+
**What the review did not check is posted, not silent.** Every degradation
|
|
202
|
+
lands in the **Degraded gates** section of the posted `verification-results`
|
|
203
|
+
comment with one of three kinds:
|
|
204
|
+
|
|
205
|
+
- `verdict-missing` — no verdict at all: the diff could not be read, the
|
|
206
|
+
`claude` CLI is not logged in or out of quota, the reviewer failed or its
|
|
207
|
+
output did not parse, every chunk failed, an optional chain entry such as
|
|
208
|
+
`llm-review` was skipped on a host without its CLI, or the base ref is
|
|
209
|
+
unresolvable. Close reports `gates.codeReview: "unreviewed"`.
|
|
210
|
+
- `coverage-partial` — part of the diff went unreviewed: one chunk failed
|
|
211
|
+
beside chunks that returned a verdict, files fell past the chunk bound, or a
|
|
212
|
+
chunk was truncated at the 200,000-character budget. Close reports
|
|
213
|
+
`"partial"`.
|
|
214
|
+
- `context-reduced` — reviewed with less context: a capped `<callers>`
|
|
215
|
+
block or truncated guidance. Close reports `"degraded"`.
|
|
216
|
+
|
|
217
|
+
Before recording a no-verdict, the `code-review` provider re-invokes the
|
|
218
|
+
reviewer **once** when the failure is transient-shaped (a non-zero exit that
|
|
219
|
+
is not a usage limit, an `is_error` result, a non-success subtype,
|
|
220
|
+
unparseable output). It never retries a failed auth preflight, a usage limit
|
|
221
|
+
or a timeout.
|
|
222
|
+
|
|
223
|
+
`delivery.codeReview.onNoVerdict` decides what a gap does. `report` (the
|
|
224
|
+
default) never halts. `block` halts handoff and close on any
|
|
225
|
+
`verdict-missing` or `coverage-partial` record with `haltCause:
|
|
226
|
+
"no-verdict"`: the blocker names the cause, its fix and the
|
|
227
|
+
`story-review-compute.js --story <id>` re-run command, handoff settles
|
|
228
|
+
`blocked` (no code change resolves it) and close refuses to arm auto-merge
|
|
229
|
+
unless re-run with `--override-review-block "<reason>"`. `context-reduced`
|
|
230
|
+
never halts.
|
|
177
231
|
|
|
178
232
|
### Story scope runs no lens pass
|
|
179
233
|
|
|
@@ -8,11 +8,10 @@ description: >-
|
|
|
8
8
|
# Deliver digest (read once per session)
|
|
9
9
|
|
|
10
10
|
> **Bundle, not a procedure.** [`deliver-story.md`](deliver-story.md) is still
|
|
11
|
-
> the steps; this file
|
|
12
|
-
>
|
|
13
|
-
> routers, merge-wait budgets, CI remediation) stays on demand in
|
|
11
|
+
> the steps; this file bundles the material they reference. Situational
|
|
12
|
+
> material stays on demand in
|
|
14
13
|
> [`deliver-story-reference.md`](deliver-story-reference.md) and
|
|
15
|
-
> [`deliver-reference.md`](deliver-reference.md)
|
|
14
|
+
> [`deliver-reference.md`](deliver-reference.md), read only when routed.
|
|
16
15
|
|
|
17
16
|
## 1. Dispatch — where the engine runs
|
|
18
17
|
|
|
@@ -21,12 +20,12 @@ rule produces it:
|
|
|
21
20
|
|
|
22
21
|
1. **Run topology.** A one-Story run is `inline` (the router's own session)
|
|
23
22
|
whatever its shape — isolation only matters against a *concurrent*
|
|
24
|
-
sibling
|
|
25
|
-
2. **Every other run is `subagent`**,
|
|
23
|
+
sibling.
|
|
24
|
+
2. **Every other run is `subagent`**, whatever each Story's shape.
|
|
26
25
|
|
|
27
26
|
`inline` drops only the `story-worker` boot — not the verdict owner, which
|
|
28
27
|
the profile alone names (§ 3). **`subagent` and `inline` run the same engine**: same gates,
|
|
29
|
-
same PR to `main`, same
|
|
28
|
+
same PR to `main`, same envelope.
|
|
30
29
|
|
|
31
30
|
## 2. Engine invariants
|
|
32
31
|
|
|
@@ -44,43 +43,41 @@ the only sanctioned landing.
|
|
|
44
43
|
|
|
45
44
|
## 3. Change set — computed once, handed to everyone
|
|
46
45
|
|
|
47
|
-
One enumeration per Story: a critic
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
One enumeration per Story: a critic re-running `git diff` can score
|
|
47
|
+
another set. **One script** derives the change set, the level and the
|
|
48
|
+
ceremony (close and critic hand-offs call it; the worker gets it from § 4's
|
|
49
|
+
`--init`):
|
|
51
50
|
|
|
52
51
|
```bash
|
|
53
52
|
node <main-repo>/.agents/scripts/ceremony-derive.js --story <storyId> --cwd <workCwd>
|
|
54
53
|
```
|
|
55
54
|
|
|
56
|
-
It prints one
|
|
57
|
-
|
|
55
|
+
It prints one object: `files` — the one change set handed to the verdict
|
|
56
|
+
owner (`null` when the diff is unenumerable) — plus `level` and
|
|
58
57
|
`classes` from `review-depth.js`, and `mode`, `reason` and `verdictOwner`
|
|
59
|
-
from `ceremony-routing.js`. Level
|
|
60
|
-
`audit-rules.json` → `high`,
|
|
61
|
-
The level drives **review depth** only (close reads
|
|
58
|
+
from `ceremony-routing.js`. Level: a sensitive
|
|
59
|
+
`audit-rules.json` path → `high`, else `low`; unenumerable → `null`.
|
|
60
|
+
The level drives **review depth** only (close reads it too): a
|
|
62
61
|
sensitive footprint buys a **deep review**, not a fresh acceptance critic.
|
|
63
62
|
|
|
64
63
|
> **The ceremony rule, stated once.** The **profile alone** names the verdict
|
|
65
64
|
> owner: `minimal` / `standard` → `inline`, `strict` → `fresh`. Nothing else
|
|
66
65
|
> moves it — not the change level, not sensitivity, **not the dispatch
|
|
67
|
-
> mode**: an `inline` Story under `strict` still spawns the fresh critic
|
|
68
|
-
>
|
|
69
|
-
> [`acceptance-self-eval.md`](acceptance-self-eval.md), noted in any friction
|
|
70
|
-
> comment.
|
|
66
|
+
> mode**: an `inline` Story under `strict` still spawns the fresh critic,
|
|
67
|
+
> bar the harness fallback in [`acceptance-self-eval.md`](acceptance-self-eval.md).
|
|
71
68
|
|
|
72
69
|
## 4. Acceptance self-eval (Step 1a, required)
|
|
73
70
|
|
|
74
71
|
**One verdict owner per Story** — named by `verdictOwner`: the inline
|
|
75
72
|
self-eval under `minimal` / `standard` (the default), a fresh maker-blind
|
|
76
|
-
critic under `strict`. Never both
|
|
73
|
+
critic under `strict`. Never both. Start from the
|
|
77
74
|
skeleton — it derives § 3's `files` and `verdictOwner` with the same function:
|
|
78
75
|
|
|
79
76
|
`node <main-repo>/.agents/scripts/acceptance-eval.js --story <storyId> --init
|
|
80
77
|
--cwd <workCwd>`
|
|
81
78
|
|
|
82
|
-
It writes one empty record per `acceptance[]` item
|
|
83
|
-
|
|
79
|
+
It writes one empty record per `acceptance[]` item and prints its
|
|
80
|
+
path. The owner fills **every** record,
|
|
84
81
|
scored against that change set with `verify[]` output as evidence, and scores
|
|
85
82
|
it in **one** gate call. Bounded by `delivery.acceptanceEval.maxRounds`
|
|
86
83
|
(default 2; `0` scores once with no redraft).
|
|
@@ -90,8 +87,7 @@ it in **one** gate call. Bounded by `delivery.acceptanceEval.maxRounds`
|
|
|
90
87
|
|
|
91
88
|
The gate reads the Story's `acceptance[]` count itself and rejects, **before**
|
|
92
89
|
scoring and consuming no round, a verdict whose `criteria[]` length differs
|
|
93
|
-
or with an unfilled record (naming its indices).
|
|
94
|
-
same round wastes it and races the Story ledger.
|
|
90
|
+
or with an unfilled record (naming its indices).
|
|
95
91
|
|
|
96
92
|
`proceed` → § 5. `redraft` → one more round inside the cap. `block` → **do
|
|
97
93
|
not close**: post a `friction` comment and flip `agent::blocked`.
|
|
@@ -99,44 +95,47 @@ Per-round mechanics: [`acceptance-self-eval.md`](acceptance-self-eval.md).
|
|
|
99
95
|
|
|
100
96
|
## 5. The one credited run — `story-handoff.js`
|
|
101
97
|
|
|
102
|
-
After the self-eval
|
|
103
|
-
which runs this section in order and prints one envelope:
|
|
98
|
+
After the self-eval's last fix commit the worker runs **one** command:
|
|
104
99
|
|
|
105
100
|
`node <main-repo>/.agents/scripts/story-handoff.js --story <storyId> --cwd <workCwd>`
|
|
106
101
|
|
|
107
102
|
`ready` (exit 0) → hand off. `fix-required` (exit 2) → a finding, a red or
|
|
108
|
-
deferred suite, a base-merge conflict
|
|
109
|
-
or a CRITICAL: fix, commit,
|
|
110
|
-
only a remote-refused push,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
**
|
|
118
|
-
2. **Preflight — blocking.** `lint`/`format` (close's credit),
|
|
103
|
+
deferred suite, a base-merge conflict, a non-fast-forward push,
|
|
104
|
+
a `commit_refs_rules` push stepping missed or a CRITICAL: fix, commit,
|
|
105
|
+
re-run; labels untouched. `blocked` (exit 1) → only a remote-refused push,
|
|
106
|
+
an unreachable remote, an unconfirmed base branch, an unregistered merge
|
|
107
|
+
driver or `host-resources` (exit 77): it flips `agent::blocked` and posts
|
|
108
|
+
`friction`. A re-run skips every step still valid for HEAD. Past the sync ceiling → **background**, explicit timeout: parallel-tooling Rule 2.
|
|
109
|
+
|
|
110
|
+
1. **Base merge:** merge `origin/<baseBranch>` into the Story branch
|
|
111
|
+
**first**, ahead of every check: close's base-sync then no-ops. Then close's **duplication re-score**, committed
|
|
112
|
+
**untagged** before any credit.
|
|
113
|
+
2. **Preflight — blocking.** `typecheck`/`lint`/`format` (close's credit),
|
|
119
114
|
`quality-preview.js --changed-since origin/<baseBranch>`, then each
|
|
120
|
-
baselined ratchet
|
|
115
|
+
baselined ratchet; one `fix-required` lists every finding. Serial unless
|
|
116
|
+
a per-host `.agentrc.local.json` sets `delivery.execution.preflightConcurrency`
|
|
117
|
+
above 1 (default 1): close's independent gates then run in admitted
|
|
118
|
+
lanes beside the base lane — [`deliver-reference.md`](deliver-reference.md) § Preflight.
|
|
121
119
|
3. **One depositor**, by the one predicate close registers `coverage-capture`
|
|
122
120
|
on — coverage or CRAP gate on **and** a `captureScript`:
|
|
123
121
|
- **Capture-active** →
|
|
124
122
|
`node <main-repo>/.agents/scripts/coverage-capture.js --cwd <workCwd>`,
|
|
125
|
-
behind the
|
|
123
|
+
behind the full-suite lock. Signal: `Wrote content-digest capture
|
|
126
124
|
stamp`. No second `npm test`.
|
|
127
125
|
- **Otherwise** → `node <main-repo>/.agents/scripts/evidence-gate.js
|
|
128
|
-
--standalone --scope-id <storyId> --gate test --worktree <workCwd> -- npm test
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
--standalone --scope-id <storyId> --gate test --worktree <workCwd> -- npm test`;
|
|
127
|
+
a predicted capture skip runs `testChanged --changed-since` the
|
|
128
|
+
merge-base, else says why. Signal: `✓ test passed`.
|
|
129
|
+
4. **Seat.** `--seat-missing` (`seated: N`): MI before step 2, CRAP and
|
|
130
|
+
capture-path coverage here, committed `chore(baselines): baseline-refresh:
|
|
131
|
+
…`; then post-capture checks: close's `quality-preview-crap` and `check-baselines`,
|
|
132
|
+
then `delivery.handoff.postSeatChecks`. Children get `MANDREL_HANDOFF_STEP`.
|
|
133
133
|
5. **Push** `story-<id>`; the remote ref must equal HEAD.
|
|
134
|
-
6. **Held review**
|
|
135
|
-
[`deliver-reference.md`](deliver-reference.md) § Held review.
|
|
134
|
+
6. **Held review** from step 1, beside 2: a CRITICAL skips or aborts 3,
|
|
135
|
+
one envelope with any finding — [`deliver-reference.md`](deliver-reference.md) § Held review.
|
|
136
136
|
|
|
137
137
|
A later commit voids any credit; a baseline-JSON seat keeps the stamp. It
|
|
138
|
-
reads the **output**, not the exit code:
|
|
139
|
-
deposits nothing. Seat order, runner shapes, redraft rounds:
|
|
138
|
+
reads the **output**, not the exit code: no signal deposits nothing. Seat order, runner shapes:
|
|
140
139
|
[`deliver-reference.md`](deliver-reference.md) § Credited run.
|
|
141
140
|
|
|
142
141
|
`verify[]` is scoped entries **plus** this one run: an entry that is a
|
|
@@ -148,7 +147,7 @@ respawned.
|
|
|
148
147
|
`single-story-close.js` emits exactly one envelope on stdout between
|
|
149
148
|
`--- STORY DELIVER TERMINAL ---` markers, schema-validated against
|
|
150
149
|
[`story-deliver-terminal.schema.json`](../../schemas/story-deliver-terminal.schema.json)
|
|
151
|
-
— the SSOT. Relay it verbatim; never hand-compose one
|
|
150
|
+
— the SSOT. Relay it verbatim; never hand-compose one.
|
|
152
151
|
|
|
153
152
|
| `status` | Exit | Meaning | You do |
|
|
154
153
|
| --- | --- | --- | --- |
|
|
@@ -161,12 +160,12 @@ Required fields: `kind` (`story-deliver-terminal`), `storyId`, `status`,
|
|
|
161
160
|
`phase` (the schema's enum names where it stopped), `elapsedSeconds`,
|
|
162
161
|
`nextCommand`. `gates`
|
|
163
162
|
reports every gate as `passed` / `failed` / `skipped` — a skipped gate is
|
|
164
|
-
|
|
163
|
+
never omitted, so a missing gate never reads as passing.
|
|
165
164
|
|
|
166
165
|
## 7. When to leave this file
|
|
167
166
|
|
|
168
|
-
Unclear state / a re-run refusal → `deliver-recover.js --story <id
|
|
169
|
-
|
|
170
|
-
threading → [`deliver-story-reference.md`](deliver-story-reference.md) and
|
|
167
|
+
Unclear state / a re-run refusal → `deliver-recover.js --story <id>`; boot
|
|
168
|
+
auto-lists stalled `agent::executing` Stories with it (read-only, advisory).
|
|
169
|
+
Lease, sweep, worktree scope; sequencing, epilogue, checklist threading → [`deliver-story-reference.md`](deliver-story-reference.md) and
|
|
171
170
|
[`deliver-reference.md`](deliver-reference.md). CI red after the PR opens →
|
|
172
171
|
[`rules/ci-remediation.md`](../../rules/ci-remediation.md).
|