mandrel 2.123.0 → 2.124.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/README.md +1 -1
- package/.agents/docs/agentrc-reference.json +1 -0
- package/.agents/docs/configuration.md +4 -3
- package/.agents/runtime-deps.json +2 -2
- package/.agents/schemas/agentrc.schema.json +25 -3
- package/.agents/schemas/audit-rules.schema.json +1 -1
- package/.agents/schemas/story-deliver-terminal.schema.json +7 -2
- package/.agents/scripts/check-doc-links.js +4 -4
- package/.agents/scripts/lib/audit-baselines/surface-entry.js +2 -2
- package/.agents/scripts/lib/audit-exceptions/globs.js +2 -2
- package/.agents/scripts/lib/audit-exceptions/scope.js +2 -2
- package/.agents/scripts/lib/audit-suite/selector.js +3 -3
- package/.agents/scripts/lib/baselines/bundle-size-scorer.js +3 -3
- package/.agents/scripts/lib/baselines/components.js +2 -2
- package/.agents/scripts/lib/baselines/kinds/_crap-new-method-gate.js +2 -2
- package/.agents/scripts/lib/bdd-runner-detect.js +3 -4
- package/.agents/scripts/lib/close-validation/base-sync-revalidation.js +2 -2
- package/.agents/scripts/lib/config/gates/coverage.schema.js +1 -1
- package/.agents/scripts/lib/config/handoff.js +21 -6
- package/.agents/scripts/lib/config-settings-schema-delivery.js +19 -10
- package/.agents/scripts/lib/config-settings-schema-quality.js +1 -1
- package/.agents/scripts/lib/coverage-baseline.js +3 -3
- package/.agents/scripts/lib/coverage-capture-delta.js +2 -2
- package/.agents/scripts/lib/coverage-capture-own-fix.js +2 -2
- package/.agents/scripts/lib/generated/agentrc-validator.js +2 -2
- package/.agents/scripts/lib/git-test-guard.js +119 -0
- package/.agents/scripts/lib/git-utils.js +3 -0
- package/.agents/scripts/lib/maintainability-utils.js +4 -4
- package/.agents/scripts/lib/observability/handoff-telemetry.js +2 -0
- package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +3 -2
- package/.agents/scripts/lib/orchestration/block-class-recovery.js +44 -0
- package/.agents/scripts/lib/orchestration/code-review.js +35 -19
- package/.agents/scripts/lib/orchestration/diff-magnitude.js +1 -1
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/filters.js +3 -3
- package/.agents/scripts/lib/orchestration/plan-persist/audit-attribution.js +3 -4
- package/.agents/scripts/lib/orchestration/review-history.js +9 -10
- package/.agents/scripts/lib/orchestration/review-providers/code-review.js +9 -2
- package/.agents/scripts/lib/orchestration/review-providers/codex-cli.js +8 -5
- package/.agents/scripts/lib/orchestration/review-providers/codex.js +3 -11
- package/.agents/scripts/lib/orchestration/review-providers/mi-exemptions.js +2 -2
- package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +22 -0
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +10 -2
- package/.agents/scripts/lib/orchestration/review-providers/types.js +2 -0
- package/.agents/scripts/lib/orchestration/review-providers/ultrareview.js +13 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +40 -15
- package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +8 -1
- package/.agents/scripts/lib/orchestration/story-handoff.js +216 -54
- package/.agents/scripts/lib/test-temp.js +5 -5
- package/.agents/scripts/lib/test-tiers.js +3 -3
- package/.agents/scripts/lib/util/glob-match.js +64 -0
- package/.agents/scripts/lib/wave-runner/footprint.js +3 -3
- package/.agents/scripts/run-tests.js +2 -1
- package/.agents/scripts/single-story-init.js +3 -3
- package/.agents/workflows/helpers/code-review.md +8 -1
- package/.agents/workflows/helpers/deliver-digest.md +22 -23
- package/.agents/workflows/helpers/deliver-reference.md +55 -24
- package/.agents/workflows/helpers/deliver-story-reference.md +10 -3
- package/.agents/workflows/helpers/deliver-story.md +27 -7
- package/.agents/workflows/mandrel-deliver.md +8 -2
- package/docs/CHANGELOG.md +15 -0
- package/package.json +2 -2
package/.agents/README.md
CHANGED
|
@@ -363,7 +363,7 @@ a single vendored manifest that ships inside the bundle:
|
|
|
363
363
|
|
|
364
364
|
- **[`runtime-deps.json`](runtime-deps.json)** — the single source of
|
|
365
365
|
truth. Its `dependencies` block lists the **required** packages — `ajv`,
|
|
366
|
-
`js-yaml`, `
|
|
366
|
+
`js-yaml`, `minimatch`, plus the complexity
|
|
367
367
|
kernel's closure (`@babel/parser`, `typhonjs-escomplex-commons`,
|
|
368
368
|
`escomplex-plugin-metrics-module`, `escomplex-plugin-syntax-babylon`,
|
|
369
369
|
`typhonjs-ast-walker`, and `babel-runtime`, which those packages require
|
|
@@ -185,7 +185,7 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
|
|
|
185
185
|
| `quality.gates.coverage.onOverBudget` | No | `"block"` \| `"defer-to-ci"` | `"block"` | What handoff and close do when the capture script — or the `test` command (`project.commands.test`, or `testChanged` on the skip branch and the delta re-credit) — exits 76: the consumer-declared signal that the selected slice is over this host's budget and no test ran. `block` (default) stops the handoff (`blocked`) and fails close, naming this key. `defer-to-ci` settles the coverage gate as deferred to CI: no artifact is written or stamped and no credit is recorded, the coverage-reading gates (CRAP preview, coverage and CRAP baselines) are skipped, and handoff and close proceed — the terminal envelope and the PR body say coverage was deferred. Set it only when the consumer's CI runs the deferred suite with a coverage floor. A timeout (124) is never deferred, under either value. |
|
|
186
186
|
| `quality.gates.coverage.suiteOfRecord` | No | `"local"` \| `"ci"` | `"local"` | Where the coverage capture runs. `local` (default) changes nothing. `ci` — meant for a small host's `.agentrc.local.json` — makes CI the coverage and CRAP ratchet of record: handoff and close settle the suite gate (the capture, or `test` when it is the depositor) as deferred (reason `suite-of-record-ci`) without spawning it, the PR body carries the `Coverage-deferred:` key line, and confirm-merge waits for `ciRatchetCheck` to go green. When `project.commands.testChanged` is set, the handoff first runs it as a changed-tests guard. Requires `ciRatchetCheck`; without it handoff blocks and close fails. |
|
|
187
187
|
| `quality.gates.coverage.ciRatchetCheck` | No | `string` \| `null` | `null` | Name of the consumer's CI check (check-run or status context) that runs `coverage-ratchet.js` on a deferred PR. Required by `suiteOfRecord: ci`; when set, confirm-merge holds `agent::done` on a PR carrying the `Coverage-deferred:` key line until this check is green on the PR head. Default `null`. |
|
|
188
|
-
| `quality.gates.coverage.nonInputGlobs` | No | `array<string>` | `[]` | Repo-relative
|
|
188
|
+
| `quality.gates.coverage.nonInputGlobs` | No | `array<string>` | `[]` | Repo-relative globs naming paths no test reads. A matching path is dropped from both sides of the coverage delta-refresh overlap check and from the re-measured set — a delta of only matching, baseline and coverage-directory paths restamps without a run — and from the overlap check of close's `test` delta re-credit (its incoming count and emptiness test are unchanged). It never changes the suite-input filter, the tree digest or stamp freshness. Default `[]`: nothing is built in, so Markdown counts as an input unless declared here. |
|
|
189
189
|
| `quality.gates.coverage.captureHandlesConfigChanges` | No | `boolean` | `false` | Declares that the affected capture script, given `MANDREL_COVERAGE_BASE_REF`, widens its own selection when a coverage-determining config file (`package.json`, a lockfile, `tsconfig*.json`, a test-runner config) changes. When `true`, such a file in the coverage delta no longer refuses the delta refresh. Close's `test` delta re-credit refuses on a config file under either value. Default `false`. |
|
|
190
190
|
| `quality.gates.coverage.ownFixDeltaMaxFiles` | No | `integer` | `0` | Opt-in own-fix delta refresh for `captureScope: affected`. `0` (default) keeps it off. `N >= 1` lets a delta that today's rule refuses for a Story overlap or a config file be re-measured as a delta when it splits, along HEAD's first-parent chain, into base-sync merges that pass today's rule and the Story's own non-merge commits touching at most `N` suite-input files, with no config file, no deleted or renamed suite input and no test file: a changed test moves the rows of sources mandrel cannot name, so it refuses the split. A red capture keeps the last green stamp for this split alone. Rows outside the delta can go stale in either direction; validate against full captures before raising it. `10` is a reasonable start. |
|
|
191
191
|
| `quality.gates.crap` | No | `object` | — | CRAP (Change Risk Anti-Pattern) ratchet — per-method cyclomatic complexity joined against per-method coverage. |
|
|
@@ -261,11 +261,11 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
|
|
|
261
261
|
| `close.baseSync` | No | `"always"` \| `"on-conflict"` | `"always"` | `always` (default) merges `origin/<baseBranch>` on every close, as before. `on-conflict` first runs a conflict-only probe and skips the merge when it is conflict-free (`git merge-tree --write-tree`) and the incoming and Story paths are disjoint (raw paths, `baselines/` and renames included); `check-baselines` then compares against the merge-base and the terminal envelope's `baseSync` says why. Any other probe answer merges as today. A handoff applies the probe only on a re-run. Opt in only behind a merge queue that re-tests the merged tree and with no up-to-date-branch requirement: a semantic conflict the probe cannot see surfaces in CI, and coverage is measured on the pre-merge tree. |
|
|
262
262
|
| `close.revalidateAfterBaseSync` | No | `"full"` \| `"ci"` | `"full"` | What close re-runs after base-sync merged `origin/<baseBranch>`. `full` (default) re-runs every gate, as before. `ci` defers `typecheck`, `lint` and the coverage capture to the CI checks named in `revalidateCiChecks` — never spawned, reported `deferred`, the capture writing `Coverage-deferred: base-sync-ci` — but only for a conflict-free merge commit whose pre-sync head carries `typecheck` and `lint` pass evidence, with no incoming path under `revalidateAlwaysPaths` and, when the capture is registered, a `coverage.ciRatchetCheck`. Any other close re-runs everything and the terminal envelope's `revalidation` names why. |
|
|
263
263
|
| `close.revalidateCiChecks` | No | `array<string>` | — | The CI check names (check-run or status context) a `revalidateAfterBaseSync: "ci"` deferral leans on. Absent or empty, the mode falls back to a full re-run. |
|
|
264
|
-
| `close.revalidateAlwaysPaths` | No | `array<string>` | — | Globs (
|
|
264
|
+
| `close.revalidateAlwaysPaths` | No | `array<string>` | — | Globs (dotfiles included) for whole-repo invariants: a base merge bringing in any matching path always re-runs every gate under `revalidateAfterBaseSync: "ci"`. |
|
|
265
265
|
| `codeReview` | No | `object` | — | Review-provider chain and on-branch remediation threshold for the /mandrel-deliver code-review ceremony. |
|
|
266
266
|
| `codeReview.providers[]` | No | `array<object>` | `[{"name":"native"},{"name":"llm-review","scopes":["story"],"optional":true}]` | Review-provider chain (Story #2871). When unset or empty, falls back to this default: `native` (maintainability scoring of the changed files) then an optional story-scoped `llm-review` — the first available of `code-review` (a `claude --print` bug review, at the effort `effortByDepth` maps its depth to, whose every finding is critical and halts close before auto-merge) and `codex` (`codex exec`), so a host with both CLIs runs one LLM review and a host with neither skips it. Pin `code-review` or `codex` to choose the CLI. `security-review` and `ultrareview` are opt-in. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain. Each item has: name, scopes, optional, manualPrompt, when. |
|
|
267
267
|
| `codeReview.autoFixSeverity` | No | `"high"` \| `"medium"` | `"medium"` | Severity threshold for on-branch remediation in /mandrel-deliver Phase 5 (code-review). `medium` (default) routes 🔴/🟠/🟡 findings into the host-LLM focused-fix routing (Mediums batched per lens: one commit per lens, a single validation + rescan at the end) while 🟢 suggestions still graduate to follow-up issues; `high` reproduces the pre-4399 Critical/High-only routing. Hard cutover — no back-compat flag. |
|
|
268
|
-
| `codeReview.sensitivePaths` | No | `object<map>` | — | The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are
|
|
268
|
+
| `codeReview.sensitivePaths` | No | `object<map>` | — | The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are globs matched with `dot: true`. |
|
|
269
269
|
| `codeReview.effortByDepth` | No | `object<map>` | — | The `claude --effort` level the `code-review` provider runs at for each review depth. An entry overrides the shipped default for that depth only: `light: low`, `standard: low`, `deep: high`. |
|
|
270
270
|
| `codeReview.guidanceFile` | No | `string` | — | Project review guidance, a path relative to the project root. Unset, a root `REVIEW.md` is used when present; an absent file is a no-op. Its text is rendered into every LLM review provider's prompt after the framework's severity and anti-gaming rules, and over 8,000 characters is truncated with a degradation. Guidance may add failure classes and paths worth skipping but cannot lower a severity rule, excuse a `shortcut:`, or change the output shape. |
|
|
271
271
|
| `codeReview.onNoVerdict` | No | `"report"` \| `"block"` | `"report"` | What a Story-scope review that left part or all of the diff without a verdict does. `report` (default) records it (`gates.codeReview: unreviewed` or `partial`) and does not halt. `block` halts handoff and close on any `verdict-missing` or `coverage-partial` degradation, naming the cause, its fix and the `story-review-compute.js` re-run command; `--override-review-block` stays the escape. Reduced context (`degraded`) never halts. Set `block` when this review is the only pre-merge review. |
|
|
@@ -285,6 +285,7 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
|
|
|
285
285
|
| `pullRequest` | No | `object` | — | Story #5875. What close writes into the pull request it opens, beyond the title and the `Closes #<id>` line. |
|
|
286
286
|
| `pullRequest.bodyTrailers` | No | `array<string>` | `[]` | Story #5875. Git-trailer keys close lifts from the Story branch commits into the PR body, for a consumer whose required check reads a body line (e.g. `Policy-impact`). For each key the last branch commit carrying `<Key>: <value>` as a trailer wins, and the line is appended after the auto-opened marker and before any `BREAKING CHANGE:` footer. A key no commit carries appends nothing and logs one info line. Workers record the value with `git commit --trailer`. Default [] leaves the body unchanged. |
|
|
287
287
|
| `handoff` | No | `object` | — | Story #5960. What `story-handoff.js` runs beyond close's own gates. |
|
|
288
|
+
| `handoff.firstChecks[]` | No | `array<object>` | `[]` | Story #6099. Cheap consumer checks the handoff preflight runs first, in order, beside close's independent baseline compare: each `{ cmd, args? }` runs in the worktree without a shell, with `MANDREL_HANDOFF_STEP=preflight`. A non-zero exit settles `fix-required` naming the check and quoting its failure rows, before typecheck, lint, format, quality-preview, the ratchets or the held review start; under `--report-all` the rest still run. Default [] runs only the compare first. Each item has: cmd, args. |
|
|
288
289
|
| `handoff.postSeatChecks[]` | No | `array<object>` | `[]` | Story #5960. Consumer checks the handoff re-runs in its post-capture step, after the seat commits the Story's new baseline rows: each `{ cmd, args? }` runs in the worktree without a shell, with `MANDREL_HANDOFF_STEP=post-capture`, and a non-zero exit settles `fix-required`. Declare the check a consumer downgrades during `preflight` (keyed on `MANDREL_HANDOFF_STEP`) here, so a row the seat did not write still fails the handoff; while any is declared the preflight `lint` credit is withheld until they pass at HEAD. Skipped under a coverage deferral. Default [] runs nothing extra. Each item has: cmd, args. |
|
|
289
290
|
| `orchestrate` | No | `object` | — | Story #6040. Project facts `/mandrel-orchestrate` cannot derive: how this repository re-queues an ejected PR, and the release veto. Thresholds and authority defaults are constants, not config. |
|
|
290
291
|
| `orchestrate.requeueCommand` | No | `object` | — | Story #6040. `{ cmd, args? }` the inventory offers for an eligible ejected PR; `{pr}` in an arg is replaced by the PR number. Run without a shell, and only when the operator granted `requeue`. Unset, the inventory reports `command: null`. |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Single source of truth for the third-party npm packages the .agents/ framework scripts import at runtime. This manifest ships *inside* .agents/ so it travels with the mandrel package into consumer projects. Consumers must provide these packages in the node_modules resolvable from their repository root (the framework scripts free-ride on the consumer's install). The `dependencies` block is fail-fast enforced by the preflight guard (.agents/scripts/lib/runtime-deps/ensure-installed.js); the `optionalDependencies` block lists packages that are imported behind graceful-degradation paths (try/catch or dev-only watch tooling) and are therefore declared but never preflight-blocked. A drift test (tests/scripts/runtime-deps-drift.test.js) asserts every third-party import under .agents/scripts/** is declared here. Version ranges mirror the framework's own root package.json except where noted. Three entries need their reason recorded. `@babel/parser` is pinned to ^7 because the kernel's fixed plugin list does not parse under 8.x, and the range is documentation rather than enforcement
|
|
2
|
+
"description": "Single source of truth for the third-party npm packages the .agents/ framework scripts import at runtime. This manifest ships *inside* .agents/ so it travels with the mandrel package into consumer projects. Consumers must provide these packages in the node_modules resolvable from their repository root (the framework scripts free-ride on the consumer's install). The `dependencies` block is fail-fast enforced by the preflight guard (.agents/scripts/lib/runtime-deps/ensure-installed.js); the `optionalDependencies` block lists packages that are imported behind graceful-degradation paths (try/catch or dev-only watch tooling) and are therefore declared but never preflight-blocked. A drift test (tests/scripts/runtime-deps-drift.test.js) asserts every third-party import under .agents/scripts/** is declared here. Version ranges mirror the framework's own root package.json except where noted. Three entries need their reason recorded. `@babel/parser` is pinned to ^7 because the kernel's fixed plugin list does not parse under 8.x, and the range is documentation rather than enforcement — `.agents/` resolves from the consumer's own node_modules — so the kernel asserts the resolved major at load. `babel-runtime` is declared even though no framework script imports it: four of the metric-core packages require it and none of them declares it, so it resolved only by being hoisted from the parse/dispatch plumbing this framework used to depend on. Declaring it makes the closure explicit and preflight-enforced. The import-vs-manifest drift guard only flags imported-but-undeclared, so a declared-but-unimported peer repair like this is legal by design. `js-yaml` accepts both majors although package.json pins ^5 for markdownlint-cli2: consumers whose own tooling (cosmiconfig, rc-config-loader, @eslint/eslintrc) keeps 4.x at their root resolve that copy, and the framework imports only the named `load`, which both majors export and parse identically. 4.3.2 is the 4.x floor that clears GHSA-52cp-r559-cp3m, GHSA-h67p-54hq-rp68, GHSA-5p4m-2wfm-xmqj and GHSA-2883-xcg3-v3hh. `minimatch` is the one glob engine (lib/util/glob-match.js) and needs ^11: a consumer whose root node_modules resolves an older major (eslint 8, glob 7) must declare minimatch@^11 itself. It replaced picomatch, which has no release fixing GHSA-fc5q-39xc-vjpf.",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@babel/parser": "^7.29.9",
|
|
5
5
|
"ajv": "^8.20.0",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"escomplex-plugin-metrics-module": "^0.1.0",
|
|
8
8
|
"escomplex-plugin-syntax-babylon": "^0.1.0",
|
|
9
9
|
"js-yaml": "^4.3.2 || ^5.4.3",
|
|
10
|
-
"
|
|
10
|
+
"minimatch": "^11.0.9",
|
|
11
11
|
"typhonjs-ast-walker": "^0.2.1",
|
|
12
12
|
"typhonjs-escomplex-commons": "^0.1.1"
|
|
13
13
|
},
|
|
@@ -776,7 +776,7 @@
|
|
|
776
776
|
},
|
|
777
777
|
"minLength": 1
|
|
778
778
|
},
|
|
779
|
-
"description": "Repo-relative
|
|
779
|
+
"description": "Repo-relative globs naming paths no test reads. A matching path is dropped from both sides of the coverage delta-refresh overlap check and from the re-measured set — a delta of only matching, baseline and coverage-directory paths restamps without a run — and from the overlap check of close's `test` delta re-credit (its incoming count and emptiness test are unchanged). It never changes the suite-input filter, the tree digest or stamp freshness. Default `[]`: nothing is built in, so Markdown counts as an input unless declared here.",
|
|
780
780
|
"default": []
|
|
781
781
|
},
|
|
782
782
|
"captureHandlesConfigChanges": {
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
"type": "string",
|
|
1468
1468
|
"minLength": 1
|
|
1469
1469
|
},
|
|
1470
|
-
"description": "Globs (
|
|
1470
|
+
"description": "Globs (dotfiles included) for whole-repo invariants: a base merge bringing in any matching path always re-runs every gate under `revalidateAfterBaseSync: \"ci\"`."
|
|
1471
1471
|
}
|
|
1472
1472
|
},
|
|
1473
1473
|
"additionalProperties": false
|
|
@@ -1556,7 +1556,7 @@
|
|
|
1556
1556
|
},
|
|
1557
1557
|
"sensitivePaths": {
|
|
1558
1558
|
"type": "object",
|
|
1559
|
-
"description": "The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are
|
|
1559
|
+
"description": "The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are globs matched with `dot: true`.",
|
|
1560
1560
|
"propertyNames": {
|
|
1561
1561
|
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
1562
1562
|
},
|
|
@@ -1707,6 +1707,28 @@
|
|
|
1707
1707
|
"type": "object",
|
|
1708
1708
|
"description": "Story #5960. What `story-handoff.js` runs beyond close's own gates.",
|
|
1709
1709
|
"properties": {
|
|
1710
|
+
"firstChecks": {
|
|
1711
|
+
"type": "array",
|
|
1712
|
+
"items": {
|
|
1713
|
+
"type": "object",
|
|
1714
|
+
"properties": {
|
|
1715
|
+
"cmd": {
|
|
1716
|
+
"type": "string",
|
|
1717
|
+
"minLength": 1
|
|
1718
|
+
},
|
|
1719
|
+
"args": {
|
|
1720
|
+
"type": "array",
|
|
1721
|
+
"items": {
|
|
1722
|
+
"type": "string"
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
"required": ["cmd"],
|
|
1727
|
+
"additionalProperties": false
|
|
1728
|
+
},
|
|
1729
|
+
"description": "Story #6099. Cheap consumer checks the handoff preflight runs first, in order, beside close's independent baseline compare: each `{ cmd, args? }` runs in the worktree without a shell, with `MANDREL_HANDOFF_STEP=preflight`. A non-zero exit settles `fix-required` naming the check and quoting its failure rows, before typecheck, lint, format, quality-preview, the ratchets or the held review start; under `--report-all` the rest still run. Default [] runs only the compare first.",
|
|
1730
|
+
"default": []
|
|
1731
|
+
},
|
|
1710
1732
|
"postSeatChecks": {
|
|
1711
1733
|
"type": "array",
|
|
1712
1734
|
"items": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"sensitivePaths": {
|
|
24
24
|
"type": "object",
|
|
25
|
-
"description": "Map of sensitive-path class name to the globs that identify it. A change set touching any registered pattern derives a `high` change level, which resolves review depth to `deep` and the acceptance critic to `fresh` regardless of how narrow the diff is (deriveChangeLevel in lib/orchestration/review-depth.js). This is configuration, not code: an operator extends the classes or their globs here without editing a module, and the globs run through the same
|
|
25
|
+
"description": "Map of sensitive-path class name to the globs that identify it. A change set touching any registered pattern derives a `high` change level, which resolves review depth to `deep` and the acceptance critic to `fresh` regardless of how narrow the diff is (deriveChangeLevel in lib/orchestration/review-depth.js). This is configuration, not code: an operator extends the classes or their globs here without editing a module, and the globs run through the same glob machinery as the audit-lens `filePatterns` triggers above. Those lens triggers are a SEPARATE block with a separate job — they select which lens runs, never the change level — so a path registered there is not sensitive here unless it is also registered in this block. An absent or empty block means no path is sensitive and depth falls back to diff width alone.",
|
|
26
26
|
"patternProperties": {
|
|
27
27
|
"^[a-z][a-z0-9-]*$": { "$ref": "#/definitions/sensitivePathClass" }
|
|
28
28
|
},
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"status": {
|
|
23
23
|
"type": "string",
|
|
24
|
-
"description": "landed — the PR merged, the Story is agent::done, and the post-land tail was attempted. pending — a bounded wait expired with the PR still in flight; NO label was mutated and no merge.unlanded event was emitted, so the run is resumable via nextCommand. blocked — a classified hard block; the Story
|
|
24
|
+
"description": "landed — the PR merged, the Story is agent::done, and the post-land tail was attempted. pending — a bounded wait expired with the PR still in flight; NO label was mutated and no merge.unlanded event was emitted, so the run is resumable via nextCommand. blocked — a classified hard block; blocked.blockClass names the class and blocked.recovery who clears it: with recovery agent an unlanded merge leaves the Story at agent::closing for the session to fix and resume, with recovery operator the Story carries agent::blocked. failed — a phase crashed; phase names which one. escalated — /deliver-light's suitability gate refused a prompt on an un-waivable risk rule or an un-ledgered verdict; nothing was created and the LIGHT PATH ends here, nextCommand naming the /mandrel-plan invocation that owns the work instead. Story #5344 narrowed what refuses (the predicted-shape ceilings are gone) and loosened what follows (that command may be run in the same session, seeded with escalation.reasons) without touching this shape.",
|
|
25
25
|
"enum": ["landed", "pending", "blocked", "failed", "escalated"]
|
|
26
26
|
},
|
|
27
27
|
"phase": {
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"blocked": {
|
|
146
146
|
"type": ["object", "null"],
|
|
147
147
|
"description": "Present iff status === \"blocked\". blockClass comes from the shared classifier (merge-block-class.js) or the merged-flip-failed terminal, never an ad hoc string.",
|
|
148
|
-
"required": ["blockClass", "reason"],
|
|
148
|
+
"required": ["blockClass", "reason", "recovery"],
|
|
149
149
|
"properties": {
|
|
150
150
|
"blockClass": {
|
|
151
151
|
"type": "string",
|
|
@@ -167,6 +167,11 @@
|
|
|
167
167
|
"frictionCommentId": {
|
|
168
168
|
"type": ["string", "null"],
|
|
169
169
|
"description": "Pointer to the friction comment carrying the operator-facing remediation."
|
|
170
|
+
},
|
|
171
|
+
"recovery": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"enum": ["agent", "operator"],
|
|
174
|
+
"description": "Who clears the block, from BLOCK_CLASS_RECOVERY in merge-block-class.js. agent: the delivering session fixes and resumes in the same turn, and an unlanded merge leaves the Story at agent::closing. operator: a human must act; the Story carries agent::blocked."
|
|
170
175
|
}
|
|
171
176
|
},
|
|
172
177
|
"additionalProperties": false
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import { fileURLToPath } from 'node:url';
|
|
11
|
-
import picomatch from 'picomatch';
|
|
12
11
|
import { parseStandardCliArgs } from './lib/cli/standard-args.js';
|
|
13
12
|
import { runAsCli } from './lib/cli-utils.js';
|
|
14
13
|
import { Logger } from './lib/Logger.js';
|
|
14
|
+
import { isGlobMatch } from './lib/util/glob-match.js';
|
|
15
15
|
import { toPosix } from './lib/util/paths.js';
|
|
16
16
|
|
|
17
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -156,7 +156,7 @@ function walkMarkdown(dirAbs, repoRoot, out) {
|
|
|
156
156
|
/**
|
|
157
157
|
* @param {string} rootAbs
|
|
158
158
|
* @param {string[]} scanRoots
|
|
159
|
-
* @param {string[]} [exclude]
|
|
159
|
+
* @param {string[]} [exclude] globs over repo-relative POSIX paths
|
|
160
160
|
*/
|
|
161
161
|
export function discoverMarkdown(rootAbs, scanRoots, exclude = []) {
|
|
162
162
|
const out = [];
|
|
@@ -167,7 +167,7 @@ export function discoverMarkdown(rootAbs, scanRoots, exclude = []) {
|
|
|
167
167
|
const filtered = exclude.length
|
|
168
168
|
? out.filter((abs) => {
|
|
169
169
|
const rel = toPosix(path.relative(rootAbs, abs));
|
|
170
|
-
return !exclude.some((g) =>
|
|
170
|
+
return !exclude.some((g) => isGlobMatch(rel, g, { dot: true }));
|
|
171
171
|
})
|
|
172
172
|
: out;
|
|
173
173
|
filtered.sort();
|
|
@@ -457,7 +457,7 @@ runAsCli(import.meta.url, main, {
|
|
|
457
457
|
],
|
|
458
458
|
[
|
|
459
459
|
'--exclude <glob>',
|
|
460
|
-
'Repeatable.
|
|
460
|
+
'Repeatable. glob; matching files are dropped from the scan.',
|
|
461
461
|
],
|
|
462
462
|
],
|
|
463
463
|
notes: [
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @module lib/audit-baselines/surface-entry
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import picomatch from 'picomatch';
|
|
9
8
|
import { IGNORED_DIRS } from '../maintainability-utils.js';
|
|
9
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
10
10
|
import { GATE_KINDS, KIND_SPECS, measuredTotalOf, rollupOf } from './kinds.js';
|
|
11
11
|
import { stalenessOf } from './staleness.js';
|
|
12
12
|
|
|
@@ -110,7 +110,7 @@ function isJudgeableGlob(glob, scannerSkipDirs) {
|
|
|
110
110
|
* @returns {boolean}
|
|
111
111
|
*/
|
|
112
112
|
function matchesNothing(glob, files) {
|
|
113
|
-
const isMatch =
|
|
113
|
+
const isMatch = globMatcher(glob, { dot: true });
|
|
114
114
|
return !files.some((f) => isMatch(f));
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import fs from 'node:fs';
|
|
12
12
|
import path from 'node:path';
|
|
13
|
-
import picomatch from 'picomatch';
|
|
14
13
|
import { gitSpawn } from '../git-utils.js';
|
|
14
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
15
15
|
|
|
16
16
|
const GLOB_CHAR_RE = /[*?[\]{}()!]/;
|
|
17
17
|
|
|
@@ -62,7 +62,7 @@ function byDesignHint(glob) {
|
|
|
62
62
|
*/
|
|
63
63
|
function probeOne(ctx, glob) {
|
|
64
64
|
const clean = glob.replace(/^\.\//, '').replace(/^!/, '');
|
|
65
|
-
const isMatch =
|
|
65
|
+
const isMatch = globMatcher([clean, `${clean.replace(/\/+$/, '')}/**`], {
|
|
66
66
|
dot: true,
|
|
67
67
|
});
|
|
68
68
|
if (ctx.scope.files.some((f) => isMatch(f)))
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import path from 'node:path';
|
|
11
|
-
import picomatch from 'picomatch';
|
|
12
11
|
import { gitSpawn } from '../git-utils.js';
|
|
12
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
13
13
|
import { readJsonc, readYaml } from './read.js';
|
|
14
14
|
|
|
15
15
|
const ALWAYS_EXCLUDED = Object.freeze([
|
|
@@ -81,7 +81,7 @@ function collectManifests(root, rootPkg, files, pnpmWorkspace) {
|
|
|
81
81
|
: [];
|
|
82
82
|
const globs = workspaceGlobs(rootPkg, pnpmWorkspace);
|
|
83
83
|
if (globs.length === 0) return manifests;
|
|
84
|
-
const isWorkspace =
|
|
84
|
+
const isWorkspace = globMatcher(globs);
|
|
85
85
|
for (const rel of files) {
|
|
86
86
|
if (path.posix.basename(rel) !== 'package.json' || rel === 'package.json')
|
|
87
87
|
continue;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { readdirSync, readFileSync } from 'node:fs';
|
|
4
4
|
import fs from 'node:fs/promises';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import picomatch from 'picomatch';
|
|
7
6
|
import { getPaths, PROJECT_ROOT, resolveConfig } from '../config-resolver.js';
|
|
8
7
|
import { softFailOrThrow } from '../degraded-mode.js';
|
|
9
8
|
import { gitSpawn } from '../git-utils.js';
|
|
10
9
|
import { resolveNavConfig } from '../orchestration/plan-navigation.js';
|
|
10
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
11
11
|
import { withTimeout } from '../util/with-timeout.js';
|
|
12
12
|
import { readAuditRulesSync } from './audit-rules-reader.js';
|
|
13
13
|
import { resolveSensitivePaths } from './sensitive-paths.js';
|
|
@@ -529,12 +529,12 @@ export function hasExternalDependencies({ projectRoot = PROJECT_ROOT } = {}) {
|
|
|
529
529
|
|
|
530
530
|
/** Single file × single glob, with the project's matcher semantics (`dot: true`). */
|
|
531
531
|
export function matchesFilePattern(pattern, file) {
|
|
532
|
-
return
|
|
532
|
+
return globMatcher(pattern, { dot: true })(file);
|
|
533
533
|
}
|
|
534
534
|
|
|
535
535
|
export function matchesAnyFilePattern(patterns, files) {
|
|
536
536
|
if (!patterns?.length || !files?.length) return false;
|
|
537
|
-
const matchers = patterns.map((p) =>
|
|
537
|
+
const matchers = patterns.map((p) => globMatcher(p, { dot: true }));
|
|
538
538
|
return files.some((file) => matchers.some((m) => m(file)));
|
|
539
539
|
}
|
|
540
540
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import nodeFs from 'node:fs';
|
|
11
11
|
import path from 'node:path';
|
|
12
12
|
import { gzipSync } from 'node:zlib';
|
|
13
|
-
import
|
|
13
|
+
import { globMatcher, scanGlob } from '../util/glob-match.js';
|
|
14
14
|
import { toPosix, walkFiles } from '../util/paths.js';
|
|
15
15
|
|
|
16
16
|
/** Directories a bundle glob never descends into. */
|
|
@@ -47,11 +47,11 @@ function staticBase(segments) {
|
|
|
47
47
|
*/
|
|
48
48
|
function resolveBundleFiles(pattern, cwd, fs = nodeFs) {
|
|
49
49
|
const posix = pattern.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
50
|
-
if (!
|
|
50
|
+
if (!scanGlob(posix).isGlob) {
|
|
51
51
|
const abs = path.resolve(cwd, posix);
|
|
52
52
|
return fs.existsSync(abs) && fs.statSync(abs).isFile() ? [abs] : [];
|
|
53
53
|
}
|
|
54
|
-
const isMatch =
|
|
54
|
+
const isMatch = globMatcher(posix, { dot: true });
|
|
55
55
|
const base = staticBase(posix.split('/'));
|
|
56
56
|
return walkFiles(path.resolve(cwd, base), {
|
|
57
57
|
skipDirs: SKIPPED_DIRS,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// buckets for per-component floors. The `*` component is the whole-repo
|
|
3
3
|
// rollup and matches every row; overlap between components is allowed.
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Compiled matchers keyed by glob: `groupRows` runs over tens of thousands of
|
|
@@ -19,7 +19,7 @@ const GLOB_MATCHER_CACHE = new Map();
|
|
|
19
19
|
function matcherFor(glob) {
|
|
20
20
|
let matcher = GLOB_MATCHER_CACHE.get(glob);
|
|
21
21
|
if (!matcher) {
|
|
22
|
-
matcher =
|
|
22
|
+
matcher = globMatcher(glob, { dot: true });
|
|
23
23
|
GLOB_MATCHER_CACHE.set(glob, matcher);
|
|
24
24
|
}
|
|
25
25
|
return matcher;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The gate `compareCrap` applies to a method with no baseline row. A leaf. */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { isGlobMatch } from '../../util/glob-match.js';
|
|
4
4
|
import { canonicalizeBaselinePath } from '../path-canon.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -55,7 +55,7 @@ function isUntestableWiring(file, globs) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function matchesAny(file, globs) {
|
|
58
|
-
return
|
|
58
|
+
return isGlobMatch(canonicalizeBaselinePath(file), globs, {
|
|
59
59
|
dot: true,
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -11,9 +11,8 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
|
11
11
|
import { readFile } from 'node:fs/promises';
|
|
12
12
|
import path from 'node:path';
|
|
13
13
|
import { load } from 'js-yaml';
|
|
14
|
-
import picomatch from 'picomatch';
|
|
15
|
-
|
|
16
14
|
import { Logger } from './Logger.js';
|
|
15
|
+
import { globMatcher } from './util/glob-match.js';
|
|
17
16
|
import { toPosix } from './util/paths.js';
|
|
18
17
|
|
|
19
18
|
/** npm package name → pending tag. Preferred-first: the first match wins. */
|
|
@@ -186,7 +185,7 @@ function expandWorkspacePatterns(cwd, patterns, logger) {
|
|
|
186
185
|
const excludes = patterns
|
|
187
186
|
.filter((p) => p.startsWith('!'))
|
|
188
187
|
.map((p) => p.slice(1));
|
|
189
|
-
const excludeMatchers = excludes.map((e) =>
|
|
188
|
+
const excludeMatchers = excludes.map((e) => globMatcher(e));
|
|
190
189
|
|
|
191
190
|
const results = new Set();
|
|
192
191
|
|
|
@@ -211,7 +210,7 @@ function expandWorkspacePatterns(cwd, patterns, logger) {
|
|
|
211
210
|
const baseDir = path.join(cwd, ...literalSegments);
|
|
212
211
|
if (!existsSyncDir(baseDir, logger)) continue;
|
|
213
212
|
const recursive = segments.slice(i).includes('**');
|
|
214
|
-
const includeMatcher =
|
|
213
|
+
const includeMatcher = globMatcher(pattern);
|
|
215
214
|
walkPackages({
|
|
216
215
|
dir: baseDir,
|
|
217
216
|
relBase: literalSegments.join('/'),
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* the first failing rule is the reason the close re-runs everything.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import picomatch from 'picomatch';
|
|
9
8
|
import { COVERAGE_DEFERRED_REASONS } from '../coverage-deferral.js';
|
|
9
|
+
import { globMatcher } from '../util/glob-match.js';
|
|
10
10
|
import {
|
|
11
11
|
shouldSkip as defaultShouldSkip,
|
|
12
12
|
hashCommandConfig,
|
|
@@ -53,7 +53,7 @@ function mergeIneligibility(baseSync, alwaysPaths) {
|
|
|
53
53
|
return { reason: 'conflict-resolved' };
|
|
54
54
|
}
|
|
55
55
|
if (alwaysPaths.length === 0) return null;
|
|
56
|
-
const matches =
|
|
56
|
+
const matches = globMatcher(alwaysPaths, { dot: true });
|
|
57
57
|
const hit = incoming.find((path) => matches(path));
|
|
58
58
|
return hit ? { reason: 'always-revalidate-path', detail: hit } : null;
|
|
59
59
|
}
|
|
@@ -114,7 +114,7 @@ export const COVERAGE_GATE = {
|
|
|
114
114
|
type: 'array',
|
|
115
115
|
items: { ...SAFE_STRING, minLength: 1 },
|
|
116
116
|
description:
|
|
117
|
-
"Repo-relative
|
|
117
|
+
"Repo-relative globs naming paths no test reads. A matching path is dropped from both sides of the coverage delta-refresh overlap check and from the re-measured set — a delta of only matching, baseline and coverage-directory paths restamps without a run — and from the overlap check of close's `test` delta re-credit (its incoming count and emptiness test are unchanged). It never changes the suite-input filter, the tree digest or stamp freshness. Default `[]`: nothing is built in, so Markdown counts as an input unless declared here.",
|
|
118
118
|
default: [],
|
|
119
119
|
},
|
|
120
120
|
captureHandlesConfigChanges: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** `delivery.handoff`: consumer checks the handoff
|
|
1
|
+
/** `delivery.handoff`: consumer checks the handoff runs beside close's gates. */
|
|
2
2
|
|
|
3
3
|
const isStringArray = (v) =>
|
|
4
4
|
Array.isArray(v) && v.every((a) => typeof a === 'string');
|
|
@@ -9,6 +9,15 @@ const isCheck = (c) =>
|
|
|
9
9
|
c.cmd.length > 0 &&
|
|
10
10
|
(c.args === undefined || isStringArray(c.args));
|
|
11
11
|
|
|
12
|
+
/** `delivery.handoff[key]`, malformed entries dropped. */
|
|
13
|
+
function checksAt(config, key) {
|
|
14
|
+
const checks = config?.delivery?.handoff?.[key];
|
|
15
|
+
if (!Array.isArray(checks)) return [];
|
|
16
|
+
return checks
|
|
17
|
+
.filter(isCheck)
|
|
18
|
+
.map(({ cmd, args }) => ({ cmd, args: args ?? [] }));
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
/**
|
|
13
22
|
* `delivery.handoff.postSeatChecks`, malformed entries dropped.
|
|
14
23
|
*
|
|
@@ -16,9 +25,15 @@ const isCheck = (c) =>
|
|
|
16
25
|
* @returns {Array<{ cmd: string, args: string[] }>}
|
|
17
26
|
*/
|
|
18
27
|
export function getPostSeatChecks(config) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
return checksAt(config, 'postSeatChecks');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* `delivery.handoff.firstChecks`, malformed entries dropped.
|
|
33
|
+
*
|
|
34
|
+
* @param {object|null|undefined} config
|
|
35
|
+
* @returns {Array<{ cmd: string, args: string[] }>}
|
|
36
|
+
*/
|
|
37
|
+
export function getFirstChecks(config) {
|
|
38
|
+
return checksAt(config, 'firstChecks');
|
|
24
39
|
}
|
|
@@ -249,7 +249,7 @@ const CLOSE_SCHEMA = {
|
|
|
249
249
|
type: 'array',
|
|
250
250
|
items: { type: 'string', minLength: 1 },
|
|
251
251
|
description:
|
|
252
|
-
'Globs (
|
|
252
|
+
'Globs (dotfiles included) for whole-repo invariants: a base merge bringing in any matching path always re-runs every gate under `revalidateAfterBaseSync: "ci"`.',
|
|
253
253
|
},
|
|
254
254
|
},
|
|
255
255
|
additionalProperties: false,
|
|
@@ -372,22 +372,31 @@ const PULL_REQUEST_DELIVERY_SCHEMA = {
|
|
|
372
372
|
additionalProperties: false,
|
|
373
373
|
};
|
|
374
374
|
|
|
375
|
+
const HANDOFF_CHECK_ITEMS = {
|
|
376
|
+
type: 'object',
|
|
377
|
+
properties: {
|
|
378
|
+
cmd: { type: 'string', minLength: 1 },
|
|
379
|
+
args: { type: 'array', items: { type: 'string' } },
|
|
380
|
+
},
|
|
381
|
+
required: ['cmd'],
|
|
382
|
+
additionalProperties: false,
|
|
383
|
+
};
|
|
384
|
+
|
|
375
385
|
const HANDOFF_SCHEMA = {
|
|
376
386
|
type: 'object',
|
|
377
387
|
description:
|
|
378
388
|
"Story #5960. What `story-handoff.js` runs beyond close's own gates.",
|
|
379
389
|
properties: {
|
|
390
|
+
firstChecks: {
|
|
391
|
+
type: 'array',
|
|
392
|
+
items: HANDOFF_CHECK_ITEMS,
|
|
393
|
+
description:
|
|
394
|
+
"Story #6099. Cheap consumer checks the handoff preflight runs first, in order, beside close's independent baseline compare: each `{ cmd, args? }` runs in the worktree without a shell, with `MANDREL_HANDOFF_STEP=preflight`. A non-zero exit settles `fix-required` naming the check and quoting its failure rows, before typecheck, lint, format, quality-preview, the ratchets or the held review start; under `--report-all` the rest still run. Default [] runs only the compare first.",
|
|
395
|
+
default: [],
|
|
396
|
+
},
|
|
380
397
|
postSeatChecks: {
|
|
381
398
|
type: 'array',
|
|
382
|
-
items:
|
|
383
|
-
type: 'object',
|
|
384
|
-
properties: {
|
|
385
|
-
cmd: { type: 'string', minLength: 1 },
|
|
386
|
-
args: { type: 'array', items: { type: 'string' } },
|
|
387
|
-
},
|
|
388
|
-
required: ['cmd'],
|
|
389
|
-
additionalProperties: false,
|
|
390
|
-
},
|
|
399
|
+
items: HANDOFF_CHECK_ITEMS,
|
|
391
400
|
description:
|
|
392
401
|
"Story #5960. Consumer checks the handoff re-runs in its post-capture step, after the seat commits the Story's new baseline rows: each `{ cmd, args? }` runs in the worktree without a shell, with `MANDREL_HANDOFF_STEP=post-capture`, and a non-zero exit settles `fix-required`. Declare the check a consumer downgrades during `preflight` (keyed on `MANDREL_HANDOFF_STEP`) here, so a row the seat did not write still fails the handoff; while any is declared the preflight `lint` credit is withheld until they pass at HEAD. Skipped under a coverage deferral. Default [] runs nothing extra.",
|
|
393
402
|
default: [],
|
|
@@ -137,7 +137,7 @@ export const CODE_REVIEW_SCHEMA = {
|
|
|
137
137
|
sensitivePaths: {
|
|
138
138
|
type: 'object',
|
|
139
139
|
description:
|
|
140
|
-
"The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are
|
|
140
|
+
"The project's own sensitive-path classes, merged additively over the shipped `audit-rules.json` `sensitivePaths`: a class named like a shipped one appends its patterns to it, a new name adds a class, and no shipped class or pattern can be removed or narrowed. A changed file matching any class derives a `high` change level, which drives both code-review depth (`deep`, never `light`) and plan-time routing. Patterns are globs matched with `dot: true`.",
|
|
141
141
|
propertyNames: { pattern: '^[a-z0-9][a-z0-9-]*$' },
|
|
142
142
|
additionalProperties: {
|
|
143
143
|
type: 'object',
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import picomatch from 'picomatch';
|
|
9
8
|
import { write, writeFile } from './baselines/writer.js';
|
|
10
9
|
import { COVERAGE_CAPTURE_DEFAULTS } from './config/gates/coverage.schema.js';
|
|
11
10
|
import {
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
} from './coverage-capture.js';
|
|
15
14
|
import { isObject } from './json-utils.js';
|
|
16
15
|
import { isScorableSourceFile } from './source-extensions.js';
|
|
16
|
+
import { globMatcher } from './util/glob-match.js';
|
|
17
17
|
|
|
18
18
|
const COVERAGE_FINAL_PATH = COVERAGE_CAPTURE_DEFAULTS.coveragePath;
|
|
19
19
|
const COVERAGE_BASELINE_PATH = 'baselines/coverage.json';
|
|
@@ -30,9 +30,9 @@ function toForwardSlash(p) {
|
|
|
30
30
|
/** c8's scope rule: some `include` matches and no `exclude` does. */
|
|
31
31
|
export function buildScopePredicate({ include = [], exclude = [] } = {}) {
|
|
32
32
|
const inc =
|
|
33
|
-
include.length === 0 ? () => true :
|
|
33
|
+
include.length === 0 ? () => true : globMatcher(include, { dot: true });
|
|
34
34
|
const exc =
|
|
35
|
-
exclude.length === 0 ? () => false :
|
|
35
|
+
exclude.length === 0 ? () => false : globMatcher(exclude, { dot: true });
|
|
36
36
|
return (relPath) => {
|
|
37
37
|
const norm = toForwardSlash(relPath);
|
|
38
38
|
return inc(norm) && !exc(norm);
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import picomatch from 'picomatch';
|
|
11
10
|
import { getQuality } from './config/quality.js';
|
|
12
11
|
import {
|
|
13
12
|
captureStampPath,
|
|
@@ -18,6 +17,7 @@ import {
|
|
|
18
17
|
} from './coverage-capture.js';
|
|
19
18
|
import { judgeOwnFix, supersededSeed } from './coverage-capture-own-fix.js';
|
|
20
19
|
import { gitSpawn } from './git-utils.js';
|
|
20
|
+
import { globMatcher } from './util/glob-match.js';
|
|
21
21
|
|
|
22
22
|
/** Basenames whose change moves coverage beyond the files it names. */
|
|
23
23
|
const COVERAGE_CONFIG_RE =
|
|
@@ -127,7 +127,7 @@ function treeIneligibility({ cwd, commit, spawn }) {
|
|
|
127
127
|
/** `nonInputGlobs` as a predicate; an unset list matches nothing. */
|
|
128
128
|
function nonInputMatcher(globs) {
|
|
129
129
|
return Array.isArray(globs) && globs.length > 0
|
|
130
|
-
?
|
|
130
|
+
? globMatcher(globs, { dot: true })
|
|
131
131
|
: () => false;
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
import fs from 'node:fs';
|
|
10
10
|
import path from 'node:path';
|
|
11
|
-
import picomatch from 'picomatch';
|
|
12
11
|
import {
|
|
13
12
|
filterSuiteInputPaths,
|
|
14
13
|
supersededArtifactPath,
|
|
15
14
|
supersededStampPath,
|
|
16
15
|
} from './coverage-capture.js';
|
|
16
|
+
import { globMatcher } from './util/glob-match.js';
|
|
17
17
|
|
|
18
18
|
const TEST_FILE_RE = /\.(test|spec)\.[cm]?[jt]sx?$/;
|
|
19
19
|
const TEST_DIR_RE = /(^|\/)(tests?|__tests__|spec|e2e)\//;
|
|
@@ -172,7 +172,7 @@ function ownFixContext({
|
|
|
172
172
|
}) {
|
|
173
173
|
const isNonInput =
|
|
174
174
|
coverage.nonInputGlobs?.length > 0
|
|
175
|
-
?
|
|
175
|
+
? globMatcher(coverage.nonInputGlobs, { dot: true })
|
|
176
176
|
: () => false;
|
|
177
177
|
const suite = (files) => filterSuiteInputPaths(files, crap.coveragePath);
|
|
178
178
|
return {
|