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
|
@@ -13,7 +13,10 @@ import { spawnSync } from 'node:child_process';
|
|
|
13
13
|
import { resolveAgentrcRoot } from '../../config/git-roots.js';
|
|
14
14
|
import { BUG_CLASS_RULE, parseProviderFindings } from './parse-findings.js';
|
|
15
15
|
import { PROVIDER_SEVERITY_MAP } from './provider-severity.js';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
renderDepthDirective,
|
|
18
|
+
renderExhaustiveDirective,
|
|
19
|
+
} from './review-depth.js';
|
|
17
20
|
import { renderGuidanceBlock } from './review-guidance.js';
|
|
18
21
|
|
|
19
22
|
export const SECURITY_REVIEW_REMEDIATIONS = Object.freeze({
|
|
@@ -122,7 +125,11 @@ export function buildSecurityReviewPrompt(input) {
|
|
|
122
125
|
.replace('{headRef}', headRef)
|
|
123
126
|
.replace('{scopeLabel}', scopeLabel)
|
|
124
127
|
.replace('{ticketId}', ticketId)
|
|
125
|
-
.replace(
|
|
128
|
+
.replace(
|
|
129
|
+
'{depthDirective}',
|
|
130
|
+
renderDepthDirective(input?.depth) +
|
|
131
|
+
renderExhaustiveDirective(input?.exhaustive),
|
|
132
|
+
)
|
|
126
133
|
.replace('{guidance}', () => renderGuidanceBlock(input?.guidance));
|
|
127
134
|
}
|
|
128
135
|
|
|
@@ -211,6 +218,7 @@ export function createSecurityReviewProvider(deps = {}) {
|
|
|
211
218
|
baseRef,
|
|
212
219
|
headRef,
|
|
213
220
|
depth: input.depth,
|
|
221
|
+
exhaustive: input.exhaustive,
|
|
214
222
|
guidance: input.guidance,
|
|
215
223
|
});
|
|
216
224
|
if (result.status !== 0) {
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
* providers MUST render it into their prompt. Absent → `standard`.
|
|
41
41
|
* @property {string=} effort - `claude --effort` level resolved from `depth`;
|
|
42
42
|
* absent → `low`.
|
|
43
|
+
* @property {boolean=} exhaustive - The Story's first review pass; LLM-backed
|
|
44
|
+
* providers render it via `renderExhaustiveDirective`.
|
|
43
45
|
* @property {(string|null)=} guidance - Project review guidance; LLM-backed
|
|
44
46
|
* providers render it via `renderGuidanceBlock`.
|
|
45
47
|
*
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
* @typedef {import('./types.js').ReviewInput} ReviewInput
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
renderDepthDirective,
|
|
14
|
+
renderExhaustiveDirective,
|
|
15
|
+
} from './review-depth.js';
|
|
13
16
|
|
|
14
17
|
export const ULTRAREVIEW_PROMPT_TEMPLATE =
|
|
15
18
|
'💡 **Suggested:** Consider running `/ultrareview` on this ' +
|
|
@@ -29,7 +32,15 @@ export function buildUltrareviewMessage(input) {
|
|
|
29
32
|
return ULTRAREVIEW_PROMPT_TEMPLATE.replace('{scopeLabel}', scopeLabel)
|
|
30
33
|
.replace('{baseRef}', baseRef)
|
|
31
34
|
.replace('{headRef}', headRef)
|
|
32
|
-
.replace('{depthDirective}',
|
|
35
|
+
.replace('{depthDirective}', directives(input));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The depth directive, then the exhaustive one on a first pass. */
|
|
39
|
+
function directives(input) {
|
|
40
|
+
return (
|
|
41
|
+
renderDepthDirective(input?.depth) +
|
|
42
|
+
renderExhaustiveDirective(input?.exhaustive)
|
|
43
|
+
);
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
/**
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* check fails fast instead of burning the budget.
|
|
16
16
|
*
|
|
17
17
|
* Terminals: `landed` (confirmed, post-land tail ran); `pending` (nothing
|
|
18
|
-
* mutated); `blocked` (classified, `merge.unlanded` emitted, friction posted
|
|
19
|
-
*
|
|
18
|
+
* mutated); `blocked` (classified, `merge.unlanded` emitted, friction posted;
|
|
19
|
+
* only an operator-recovery class flips `agent::blocked`); `blocked`/`merged-flip-failed` (merged but the
|
|
20
20
|
* `agent::done` write failed — its own event and wording, since the merge
|
|
21
21
|
* is not in question).
|
|
22
22
|
*/
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import { pollUntil } from '../../../util/poll-loop.js';
|
|
33
33
|
import { defaultSleep } from '../../../util/sleep.js';
|
|
34
34
|
import { applyBehindUpdate } from '../../behind-recovery.js';
|
|
35
|
+
import { recoveryOf } from '../../block-class-recovery.js';
|
|
35
36
|
import {
|
|
36
37
|
checkVerdict,
|
|
37
38
|
classifyRollupEntry,
|
|
@@ -495,10 +496,17 @@ function formatUnlandedFriction({
|
|
|
495
496
|
`gave up after ${elapsedSeconds}s without observing a confirmed merge.\n\n` +
|
|
496
497
|
`**Block class:** \`${blockClass}\`\n\n` +
|
|
497
498
|
`**Reason:** ${reason}\n\n` +
|
|
498
|
-
|
|
499
|
+
`${recoveryLine(blockClass)}\n\n${remedy}`
|
|
499
500
|
);
|
|
500
501
|
}
|
|
501
502
|
|
|
503
|
+
/** Agent-class blocks stay `agent::closing`: the session owns the fix. */
|
|
504
|
+
function recoveryLine(blockClass) {
|
|
505
|
+
return recoveryOf(blockClass) === 'agent'
|
|
506
|
+
? 'Story stays at `agent::closing` — the delivering session fixes and resumes it (recovery: agent).'
|
|
507
|
+
: 'Story transitioned to `agent::blocked` — an operator must act (recovery: operator).';
|
|
508
|
+
}
|
|
509
|
+
|
|
502
510
|
/** Friction for a merge that landed but whose `agent::done` write failed. */
|
|
503
511
|
function formatFlipFailedFriction({
|
|
504
512
|
storyId,
|
|
@@ -927,6 +935,34 @@ function pinnedRun(run) {
|
|
|
927
935
|
return { writeDigestFn: (args) => writeCiDigest({ ...args, checkRunFn }) };
|
|
928
936
|
}
|
|
929
937
|
|
|
938
|
+
/** Only an operator-class block is the HITL pause; best-effort. */
|
|
939
|
+
async function blockIfOperatorOwned({
|
|
940
|
+
provider,
|
|
941
|
+
storyId,
|
|
942
|
+
blockClass,
|
|
943
|
+
progress,
|
|
944
|
+
}) {
|
|
945
|
+
if (recoveryOf(blockClass) === 'agent') {
|
|
946
|
+
progress?.(
|
|
947
|
+
'CONFIRM',
|
|
948
|
+
`🔧 Story #${storyId} stays agent::closing (${blockClass}, recovery: agent).`,
|
|
949
|
+
);
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
try {
|
|
953
|
+
await transitionTicketState(provider, storyId, STATE_LABELS.BLOCKED, {});
|
|
954
|
+
progress?.(
|
|
955
|
+
'CONFIRM',
|
|
956
|
+
`🛑 Story #${storyId} → agent::blocked (${blockClass}).`,
|
|
957
|
+
);
|
|
958
|
+
} catch (err) {
|
|
959
|
+
progress?.(
|
|
960
|
+
'CONFIRM',
|
|
961
|
+
`⚠️ Failed to flip Story #${storyId} to agent::blocked: ${err?.message ?? err}`,
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
930
966
|
/** Classify, emit `merge.unlanded`, post friction, block — all best-effort. */
|
|
931
967
|
async function blockOnUnlanded({
|
|
932
968
|
storyId,
|
|
@@ -999,18 +1035,7 @@ async function blockOnUnlanded({
|
|
|
999
1035
|
progress,
|
|
1000
1036
|
});
|
|
1001
1037
|
|
|
1002
|
-
|
|
1003
|
-
await transitionTicketState(provider, storyId, STATE_LABELS.BLOCKED, {});
|
|
1004
|
-
progress?.(
|
|
1005
|
-
'CONFIRM',
|
|
1006
|
-
`🛑 Story #${storyId} → agent::blocked (${blockClass}).`,
|
|
1007
|
-
);
|
|
1008
|
-
} catch (err) {
|
|
1009
|
-
progress?.(
|
|
1010
|
-
'CONFIRM',
|
|
1011
|
-
`⚠️ Failed to flip Story #${storyId} to agent::blocked: ${err?.message ?? err}`,
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1038
|
+
await blockIfOperatorOwned({ provider, storyId, blockClass, progress });
|
|
1014
1039
|
|
|
1015
1040
|
return {
|
|
1016
1041
|
confirmed: false,
|
|
@@ -8,6 +8,7 @@ import nodeFs from 'node:fs';
|
|
|
8
8
|
import { storyTerminalEnvelopePath } from '../config/temp-paths.js';
|
|
9
9
|
import { resolveConfig } from '../config-resolver.js';
|
|
10
10
|
import { writeFileAtomic } from '../util/atomic-write.js';
|
|
11
|
+
import { BLOCK_CLASS_RECOVERY } from './block-class-recovery.js';
|
|
11
12
|
import { validateTerminalEnvelope } from './story-deliver-terminal-schema.js';
|
|
12
13
|
|
|
13
14
|
export { validateTerminalEnvelope };
|
|
@@ -95,6 +96,12 @@ function compact(obj) {
|
|
|
95
96
|
return out;
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
/** An unknown class gets no `recovery`, so the schema rejects the envelope. */
|
|
100
|
+
function withRecovery(blocked) {
|
|
101
|
+
if (!blocked) return null;
|
|
102
|
+
return { ...blocked, recovery: BLOCK_CLASS_RECOVERY[blocked.blockClass] };
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
/**
|
|
99
106
|
* Throws a `TypeError` on a schema violation — callers trust the status
|
|
100
107
|
* without re-probing GitHub. An unreadable schema does not throw.
|
|
@@ -163,7 +170,7 @@ export function buildTerminalEnvelope({
|
|
|
163
170
|
pr: pr ?? null,
|
|
164
171
|
gates,
|
|
165
172
|
tail: tail ?? null,
|
|
166
|
-
blocked: blocked
|
|
173
|
+
blocked: withRecovery(blocked),
|
|
167
174
|
failure: failure ?? null,
|
|
168
175
|
escalation: escalation ?? null,
|
|
169
176
|
nextCommand: nextCommand ?? null,
|