mandrel 2.106.0 → 2.107.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/docs/configuration.md +3 -0
- package/.agents/schemas/agentrc.schema.json +38 -0
- package/.agents/schemas/story-deliver-terminal.schema.json +4 -0
- package/.agents/scripts/lib/audit-suite/selector.js +13 -5
- package/.agents/scripts/lib/audit-suite/sensitive-paths.js +39 -0
- package/.agents/scripts/lib/config-settings-schema-quality.js +31 -0
- package/.agents/scripts/lib/generated/agentrc-validator.js +2 -2
- package/.agents/scripts/lib/observability/metrics-ledger.js +1 -1
- package/.agents/scripts/lib/observability/review-dispositions.js +208 -0
- package/.agents/scripts/lib/observability/source-classifier.js +1 -0
- package/.agents/scripts/lib/orchestration/code-review.js +77 -13
- package/.agents/scripts/lib/orchestration/review-deposit.js +2 -0
- package/.agents/scripts/lib/orchestration/review-depth.js +9 -3
- package/.agents/scripts/lib/orchestration/review-history.js +182 -0
- package/.agents/scripts/lib/orchestration/review-providers/callers-context.js +22 -2
- package/.agents/scripts/lib/orchestration/review-providers/claim-grounding.js +5 -4
- package/.agents/scripts/lib/orchestration/review-providers/claude-verdict.js +12 -0
- package/.agents/scripts/lib/orchestration/review-providers/code-review.js +15 -8
- package/.agents/scripts/lib/orchestration/review-providers/codex-cli.js +26 -5
- package/.agents/scripts/lib/orchestration/review-providers/codex.js +4 -2
- package/.agents/scripts/lib/orchestration/review-providers/critical-verifier.js +357 -0
- package/.agents/scripts/lib/orchestration/review-providers/finding-identity.js +53 -0
- package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +85 -15
- package/.agents/scripts/lib/orchestration/review-providers/parse-findings.js +40 -1
- package/.agents/scripts/lib/orchestration/review-providers/review-guidance.js +68 -0
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +25 -10
- package/.agents/scripts/lib/orchestration/review-providers/types.js +6 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +3 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +14 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-halt.js +1 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-override.js +24 -1
- package/.agents/scripts/review-dispositions-report.js +129 -0
- package/.agents/workflows/helpers/code-review.md +53 -0
- package/docs/CHANGELOG.md +15 -0
- package/package.json +1 -1
|
@@ -248,6 +248,9 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
|
|
|
248
248
|
| `codeReview` | No | `object` | — | Review-provider chain and on-branch remediation threshold for the /mandrel-deliver code-review ceremony. |
|
|
249
249
|
| `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 low-effort `claude --print` bug review 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. |
|
|
250
250
|
| `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. |
|
|
251
|
+
| `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 picomatch globs matched with `dot: true`. |
|
|
252
|
+
| `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. |
|
|
253
|
+
| `codeReview.skipPaths` | No | `array<string>` | — | Picomatch globs (`dot: true`) whose findings are dropped after grounding and before severity is counted; the report states how many were dropped. A finding is dropped when its file, or every instance file, matches. Only config sets skip paths: guidance prose cannot silence a finding. |
|
|
251
254
|
| `refactorStage` | No | `object` | — | Opt-in, config-gated post-green refactor checkpoint wired into story-deliver (Story #3430, Epic #3418). Strictly additive and default-OFF: when disabled, story-deliver behaves exactly as before. Advisory only — never changes existing close-validation gate semantics. |
|
|
252
255
|
| `refactorStage.enabled` | No | `boolean` | `false` | When true, story-deliver runs an advisory post-green refactor stage (core/code-review-and-quality skill, Post-Green Refactor Pass) after the suite is green. Default false — when unset the stage is skipped and close-validation gate semantics are unchanged. |
|
|
253
256
|
| `acceptanceEval` | No | `object` | — | Story #3819. Bounded per-Story acceptance self-eval loop. After the implementation commits land and before the Story-implementation phase flips to `closing`, an independent (fresh-context) critic pass scores the caller-injected change set against each inline `acceptance[]` item, redrafts the unmet items, and re-evaluates — capped at `maxRounds` redraft rounds (0 = scored once, no redraft), then escalates to `agent::blocked` when criteria remain unmet. There is no `enabled` flag: the scoring pass is a hard cutover (always on). |
|
|
@@ -1394,6 +1394,44 @@
|
|
|
1394
1394
|
"enum": ["high", "medium"],
|
|
1395
1395
|
"description": "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.",
|
|
1396
1396
|
"default": "medium"
|
|
1397
|
+
},
|
|
1398
|
+
"sensitivePaths": {
|
|
1399
|
+
"type": "object",
|
|
1400
|
+
"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 picomatch globs matched with `dot: true`.",
|
|
1401
|
+
"propertyNames": {
|
|
1402
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
1403
|
+
},
|
|
1404
|
+
"additionalProperties": {
|
|
1405
|
+
"type": "object",
|
|
1406
|
+
"required": ["filePatterns"],
|
|
1407
|
+
"properties": {
|
|
1408
|
+
"description": {
|
|
1409
|
+
"type": "string"
|
|
1410
|
+
},
|
|
1411
|
+
"filePatterns": {
|
|
1412
|
+
"type": "array",
|
|
1413
|
+
"minItems": 1,
|
|
1414
|
+
"items": {
|
|
1415
|
+
"type": "string",
|
|
1416
|
+
"minLength": 1
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1420
|
+
"additionalProperties": false
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
"guidanceFile": {
|
|
1424
|
+
"type": "string",
|
|
1425
|
+
"minLength": 1,
|
|
1426
|
+
"description": "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."
|
|
1427
|
+
},
|
|
1428
|
+
"skipPaths": {
|
|
1429
|
+
"type": "array",
|
|
1430
|
+
"items": {
|
|
1431
|
+
"type": "string",
|
|
1432
|
+
"minLength": 1
|
|
1433
|
+
},
|
|
1434
|
+
"description": "Picomatch globs (`dot: true`) whose findings are dropped after grounding and before severity is counted; the report states how many were dropped. A finding is dropped when its file, or every instance file, matches. Only config sets skip paths: guidance prose cannot silence a finding."
|
|
1397
1435
|
}
|
|
1398
1436
|
},
|
|
1399
1437
|
"additionalProperties": false
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
},
|
|
106
106
|
"refCleanup": { "type": "boolean" },
|
|
107
107
|
"baseFastForward": { "type": "boolean" },
|
|
108
|
+
"reviewDispositions": {
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"description": "Each finding the Story-scope reviews raised was recorded to the local review-dispositions ledger before the temp purge reaped the review history. No history, or a Story already recorded, reports true. Only a ledger failure reports false, and like every tail step that degrades the report, never the land."
|
|
111
|
+
},
|
|
108
112
|
"tempPurge": {
|
|
109
113
|
"type": "boolean",
|
|
110
114
|
"description": "Story #4794 — the merged Story's spent temp artifacts (gate transcripts, validation evidence) were purged under delivery.tempRetention. A disabled policy reports true: the operator turned the purge off, so doing nothing IS the correct outcome. Only a real failure — an unreadable temp root, an undeletable artifact — reports false, and like every tail step that degrades the report, never the land."
|
|
@@ -10,6 +10,7 @@ import { gitSpawn } from '../git-utils.js';
|
|
|
10
10
|
import { resolveNavConfig } from '../orchestration/plan-navigation.js';
|
|
11
11
|
import { withTimeout } from '../util/with-timeout.js';
|
|
12
12
|
import { readAuditRulesSync } from './audit-rules-reader.js';
|
|
13
|
+
import { resolveSensitivePaths } from './sensitive-paths.js';
|
|
13
14
|
|
|
14
15
|
const DEFAULT_GIT_TIMEOUT_MS = 30000;
|
|
15
16
|
|
|
@@ -47,25 +48,32 @@ export function resolveLensTier(lens) {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
+
* `sensitivePaths` classes the change set touches (review depth and plan
|
|
52
|
+
* routing): the shipped manifest merged with the consumer's own classes.
|
|
51
53
|
*
|
|
52
54
|
* @param {{
|
|
53
55
|
* changedFiles?: string[],
|
|
54
56
|
* injectedRules?: { sensitivePaths?: Record<string, { filePatterns?: string[] }> },
|
|
57
|
+
* injectedConfig?: object,
|
|
55
58
|
* }} [params]
|
|
56
|
-
* @returns {string[]} The matched class names, in
|
|
59
|
+
* @returns {string[]} The matched class names, in effective-map order.
|
|
60
|
+
* @throws {Error} When the manifest or the config cannot be resolved.
|
|
57
61
|
*/
|
|
58
62
|
export function selectSensitivePathClasses({
|
|
59
63
|
changedFiles,
|
|
60
64
|
injectedRules,
|
|
65
|
+
injectedConfig,
|
|
61
66
|
} = {}) {
|
|
62
67
|
const files = Array.isArray(changedFiles) ? changedFiles : [];
|
|
63
68
|
if (files.length === 0) return [];
|
|
64
69
|
|
|
65
|
-
const
|
|
70
|
+
const effective = resolveSensitivePaths({
|
|
71
|
+
rules: injectedRules ?? readAuditRulesSync(),
|
|
72
|
+
config: injectedConfig ?? resolveConfig(),
|
|
73
|
+
});
|
|
66
74
|
const matched = [];
|
|
67
|
-
for (const [name, entry] of Object.entries(
|
|
68
|
-
if (matchesAnyFilePattern(entry
|
|
75
|
+
for (const [name, entry] of Object.entries(effective)) {
|
|
76
|
+
if (matchesAnyFilePattern(entry.filePatterns, files)) {
|
|
69
77
|
matched.push(name);
|
|
70
78
|
}
|
|
71
79
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The effective `sensitivePaths` map: the shipped manifest's classes merged
|
|
3
|
+
* with the consumer's `delivery.codeReview.sensitivePaths`. The merge is
|
|
4
|
+
* additive only, so consumer config can make review stricter, never looser.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {{ description?: string, filePatterns: string[] }} SensitivePathClass
|
|
9
|
+
* @typedef {Record<string, { description?: string, filePatterns?: string[] }>} SensitivePathMap
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {{
|
|
14
|
+
* rules?: { sensitivePaths?: SensitivePathMap }|null,
|
|
15
|
+
* config?: { delivery?: { codeReview?: { sensitivePaths?: SensitivePathMap } } }|null,
|
|
16
|
+
* }} [params]
|
|
17
|
+
* @returns {Record<string, SensitivePathClass>} Shipped classes in manifest
|
|
18
|
+
* order (consumer patterns appended, de-duplicated), then consumer-only
|
|
19
|
+
* classes in config order.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveSensitivePaths({ rules, config } = {}) {
|
|
22
|
+
const merged = {};
|
|
23
|
+
for (const [name, entry] of Object.entries(rules?.sensitivePaths ?? {})) {
|
|
24
|
+
merged[name] = { ...entry, filePatterns: [...(entry?.filePatterns ?? [])] };
|
|
25
|
+
}
|
|
26
|
+
const consumer = config?.delivery?.codeReview?.sensitivePaths ?? {};
|
|
27
|
+
for (const [name, entry] of Object.entries(consumer)) {
|
|
28
|
+
const patterns = entry?.filePatterns ?? [];
|
|
29
|
+
const shipped = merged[name];
|
|
30
|
+
if (shipped) {
|
|
31
|
+
shipped.filePatterns = [
|
|
32
|
+
...new Set([...shipped.filePatterns, ...patterns]),
|
|
33
|
+
];
|
|
34
|
+
} else {
|
|
35
|
+
merged[name] = { ...entry, filePatterns: [...new Set(patterns)] };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return merged;
|
|
39
|
+
}
|
|
@@ -116,6 +116,37 @@ export const CODE_REVIEW_SCHEMA = {
|
|
|
116
116
|
'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.',
|
|
117
117
|
default: DEFAULT_CODE_REVIEW.autoFixSeverity,
|
|
118
118
|
},
|
|
119
|
+
sensitivePaths: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
description:
|
|
122
|
+
"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 picomatch globs matched with `dot: true`.",
|
|
123
|
+
propertyNames: { pattern: '^[a-z0-9][a-z0-9-]*$' },
|
|
124
|
+
additionalProperties: {
|
|
125
|
+
type: 'object',
|
|
126
|
+
required: ['filePatterns'],
|
|
127
|
+
properties: {
|
|
128
|
+
description: { type: 'string' },
|
|
129
|
+
filePatterns: {
|
|
130
|
+
type: 'array',
|
|
131
|
+
minItems: 1,
|
|
132
|
+
items: { type: 'string', minLength: 1 },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
guidanceFile: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
minLength: 1,
|
|
141
|
+
description:
|
|
142
|
+
"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.",
|
|
143
|
+
},
|
|
144
|
+
skipPaths: {
|
|
145
|
+
type: 'array',
|
|
146
|
+
items: { type: 'string', minLength: 1 },
|
|
147
|
+
description:
|
|
148
|
+
'Picomatch globs (`dot: true`) whose findings are dropped after grounding and before severity is counted; the report states how many were dropped. A finding is dropped when its file, or every instance file, matches. Only config sets skip paths: guidance prose cannot silence a finding.',
|
|
149
|
+
},
|
|
119
150
|
},
|
|
120
151
|
additionalProperties: false,
|
|
121
152
|
};
|