mandrel 2.70.0 → 2.71.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 +8 -9
- package/.agents/agents/acceptance-critic.md +1 -0
- package/.agents/agents/auditor.md +1 -0
- package/.agents/agents/plan-critic.md +1 -0
- package/.agents/agents/story-worker.md +63 -64
- package/.agents/docs/agentrc-reference.json +2 -1
- package/.agents/docs/configuration.md +7 -8
- package/.agents/rules/git-conventions-reference.md +2 -2
- package/.agents/schemas/agentrc.schema.json +19 -2
- package/.agents/scripts/acceptance-eval.js +194 -15
- package/.agents/scripts/deliver-run.js +92 -43
- package/.agents/scripts/lib/audit-suite/index.js +1 -1
- package/.agents/scripts/lib/audit-suite/story-checklist.js +65 -0
- package/.agents/scripts/lib/audit-to-stories/audit-label-taxonomy.js +2 -2
- package/.agents/scripts/lib/bootstrap/issue-forms-template.js +1 -1
- package/.agents/scripts/lib/cli-args.js +22 -0
- package/.agents/scripts/lib/close-validation/gates.js +17 -3
- package/.agents/scripts/lib/config/agent-models.js +117 -0
- package/.agents/scripts/lib/config-settings-schema-delivery.js +13 -1
- package/.agents/scripts/lib/config-settings-schema-quality.js +1 -1
- package/.agents/scripts/lib/generated/agentrc-validator.js +1 -1
- package/.agents/scripts/lib/git/sync-from-base.js +89 -17
- package/.agents/scripts/lib/label-taxonomy.js +13 -3
- package/.agents/scripts/lib/notifications/notifier.js +11 -15
- package/.agents/scripts/lib/observability/close-telemetry.js +19 -3
- package/.agents/scripts/lib/observability/source-classifier.js +1 -0
- package/.agents/scripts/lib/orchestration/code-review.js +2 -2
- package/.agents/scripts/lib/orchestration/file-assumptions.js +45 -11
- package/.agents/scripts/lib/orchestration/plan-context.js +17 -10
- package/.agents/scripts/lib/orchestration/plan-persist/changes-repair.js +130 -24
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +19 -16
- package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +1 -0
- package/.agents/scripts/lib/orchestration/plan-persist/summary.js +4 -3
- package/.agents/scripts/lib/orchestration/resolve-stories.js +10 -2
- package/.agents/scripts/lib/orchestration/review-providers/native.js +5 -165
- package/.agents/scripts/lib/orchestration/single-story-close/failed-terminal.js +14 -2
- package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +151 -56
- package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +4 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +20 -4
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +26 -17
- package/.agents/scripts/lib/orchestration/story-handoff.js +849 -0
- package/.agents/scripts/lib/orchestration/story-init-result.js +83 -0
- package/.agents/scripts/lib/orchestration/task-body-validator.js +35 -5
- package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +1 -1
- package/.agents/scripts/lib/orchestration/ticket-validator.js +20 -2
- package/.agents/scripts/lib/single-story/confirm-merge.js +44 -7
- package/.agents/scripts/lib/story-body/story-body.js +40 -5
- package/.agents/scripts/lib/templates/decomposer-prompts.js +33 -36
- package/.agents/scripts/single-story-close.js +8 -0
- package/.agents/scripts/single-story-init.js +17 -32
- package/.agents/scripts/story-handoff.js +112 -0
- package/.agents/scripts/sync-claude-agents.js +58 -27
- package/.agents/workflows/helpers/acceptance-self-eval.md +24 -18
- package/.agents/workflows/helpers/code-review.md +3 -3
- package/.agents/workflows/helpers/deliver-digest.md +79 -80
- package/.agents/workflows/helpers/deliver-light.md +9 -7
- package/.agents/workflows/helpers/deliver-reference.md +38 -22
- package/.agents/workflows/helpers/deliver-story-reference.md +11 -9
- package/.agents/workflows/helpers/deliver-story.md +30 -23
- package/.agents/workflows/helpers/plan-reference.md +24 -9
- package/docs/CHANGELOG.md +19 -0
- package/lib/cli/registry.js +7 -0
- package/package.json +4 -3
- package/.agents/scripts/lib/orchestration/review-providers/scoped-lint.js +0 -272
|
@@ -110,11 +110,27 @@ export function assertNoRetiredFlags(argv) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* The story-worker figures close records in its telemetry. Raw: validated
|
|
115
|
+
* best-effort by the runner, never thrown on.
|
|
116
|
+
*
|
|
117
|
+
* @param {unknown} tokensParam
|
|
118
|
+
* @param {unknown} modelParam
|
|
119
|
+
* @param {{ workerTokens?: unknown, workerModel?: unknown }} parsed
|
|
120
|
+
* @returns {{ workerTokens: unknown, workerModel: unknown }}
|
|
121
|
+
*/
|
|
122
|
+
function workerFlags(tokensParam, modelParam, parsed) {
|
|
123
|
+
return {
|
|
124
|
+
workerTokens: resolveFlag(tokensParam, parsed.workerTokens),
|
|
125
|
+
workerModel: resolveFlag(modelParam, parsed.workerModel),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
113
129
|
/**
|
|
114
130
|
* Returns raw wait-for-merge intent; the runner resolves it after the arm.
|
|
115
131
|
*
|
|
116
|
-
* @param {{ storyIdParam, cwdParam, skipValidationParam, skipSyncParam, noAutoMergeParam, waitForMergeParam, noWaitForMergeParam, maxWaitSecondsParam, mergeWatchModeParam, rerunAdvisoryParam, overrideReviewBlockParam, workerTokensParam }} raw
|
|
117
|
-
* @returns {{ storyId, cwd, skipValidation, skipSync, noAutoMerge, waitForMergeExplicit, noWaitForMerge, maxWaitSeconds, mergeWatchMode, rerunAdvisory, overrideReviewBlock, workerTokens }}
|
|
132
|
+
* @param {{ storyIdParam, cwdParam, skipValidationParam, skipSyncParam, noAutoMergeParam, waitForMergeParam, noWaitForMergeParam, maxWaitSecondsParam, mergeWatchModeParam, rerunAdvisoryParam, overrideReviewBlockParam, workerTokensParam, workerModelParam }} raw
|
|
133
|
+
* @returns {{ storyId, cwd, skipValidation, skipSync, noAutoMerge, waitForMergeExplicit, noWaitForMerge, maxWaitSeconds, mergeWatchMode, rerunAdvisory, overrideReviewBlock, workerTokens, workerModel }}
|
|
118
134
|
*/
|
|
119
135
|
export function parseCloseOptions({
|
|
120
136
|
storyIdParam,
|
|
@@ -129,6 +145,7 @@ export function parseCloseOptions({
|
|
|
129
145
|
rerunAdvisoryParam,
|
|
130
146
|
overrideReviewBlockParam,
|
|
131
147
|
workerTokensParam,
|
|
148
|
+
workerModelParam,
|
|
132
149
|
}) {
|
|
133
150
|
// An injecting caller never reads argv (the host's flags are not its
|
|
134
151
|
// business), so `parsed` stays empty and the retired-flag guard is skipped.
|
|
@@ -169,7 +186,6 @@ export function parseCloseOptions({
|
|
|
169
186
|
overrideReviewBlock: parseOverrideReviewBlock(
|
|
170
187
|
resolveFlag(overrideReviewBlockParam, parsed.overrideReviewBlock),
|
|
171
188
|
),
|
|
172
|
-
|
|
173
|
-
workerTokens: resolveFlag(workerTokensParam, parsed.workerTokens),
|
|
189
|
+
...workerFlags(workerTokensParam, workerModelParam, parsed),
|
|
174
190
|
};
|
|
175
191
|
}
|
|
@@ -12,6 +12,7 @@ import { Logger } from '../../Logger.js';
|
|
|
12
12
|
import {
|
|
13
13
|
emitReviewBlockedFriction,
|
|
14
14
|
recordCloseTelemetry,
|
|
15
|
+
resolveWorkerModel,
|
|
15
16
|
resolveWorkerTokens,
|
|
16
17
|
} from '../../observability/close-telemetry.js';
|
|
17
18
|
import { emitTerminalFriction } from '../../observability/runtime-friction.js';
|
|
@@ -95,6 +96,9 @@ function createPhaseTimer(nowMs = Date.now) {
|
|
|
95
96
|
|
|
96
97
|
const UNTIMED = Object.freeze({ stamp() {} });
|
|
97
98
|
|
|
99
|
+
/** No worker figures: an inline close, or an ending before they resolve. */
|
|
100
|
+
const NO_WORKER = Object.freeze({ workerTokens: null, workerModel: null });
|
|
101
|
+
|
|
98
102
|
/**
|
|
99
103
|
* The single terminal writer: the retry signal, the result summary (with its
|
|
100
104
|
* `telemetry`), the envelope callers parse, and terminal friction — so no
|
|
@@ -106,10 +110,10 @@ async function emitTerminal({
|
|
|
106
110
|
result,
|
|
107
111
|
config,
|
|
108
112
|
phaseTimer = UNTIMED,
|
|
109
|
-
|
|
113
|
+
worker = NO_WORKER,
|
|
110
114
|
}) {
|
|
111
115
|
phaseTimer.stamp(terminal);
|
|
112
|
-
await recordCloseTelemetry({ terminal, result, config,
|
|
116
|
+
await recordCloseTelemetry({ terminal, result, config, ...worker });
|
|
113
117
|
if (result) {
|
|
114
118
|
emitTerseResult({
|
|
115
119
|
label: 'STORY CLOSE RESULT',
|
|
@@ -146,7 +150,7 @@ async function alreadyClosedResult(
|
|
|
146
150
|
storyId,
|
|
147
151
|
stateReason = null,
|
|
148
152
|
config,
|
|
149
|
-
|
|
153
|
+
worker = NO_WORKER,
|
|
150
154
|
) {
|
|
151
155
|
if (stateReason === 'not_planned') {
|
|
152
156
|
progress(
|
|
@@ -166,7 +170,7 @@ async function alreadyClosedResult(
|
|
|
166
170
|
nextCommand: null,
|
|
167
171
|
elapsedSeconds: 0,
|
|
168
172
|
});
|
|
169
|
-
await emitTerminal({ terminal, result, config,
|
|
173
|
+
await emitTerminal({ terminal, result, config, worker });
|
|
170
174
|
return { success: false, result, terminal };
|
|
171
175
|
}
|
|
172
176
|
|
|
@@ -179,7 +183,7 @@ async function alreadyClosedResult(
|
|
|
179
183
|
nextCommand: null,
|
|
180
184
|
elapsedSeconds: 0,
|
|
181
185
|
});
|
|
182
|
-
await emitTerminal({ terminal, result, config,
|
|
186
|
+
await emitTerminal({ terminal, result, config, worker });
|
|
183
187
|
return { success: true, result, terminal };
|
|
184
188
|
}
|
|
185
189
|
|
|
@@ -202,7 +206,7 @@ async function preflightBlockedResult({
|
|
|
202
206
|
preflight,
|
|
203
207
|
config,
|
|
204
208
|
startedAtMs,
|
|
205
|
-
|
|
209
|
+
worker = NO_WORKER,
|
|
206
210
|
}) {
|
|
207
211
|
const result = noopResult(storyId, `graphql-preflight-${preflight.verdict}`);
|
|
208
212
|
const terminal = buildTerminalEnvelope({
|
|
@@ -217,7 +221,7 @@ async function preflightBlockedResult({
|
|
|
217
221
|
nextCommand: NEXT_COMMANDS.close(storyId),
|
|
218
222
|
elapsedSeconds: elapsedSecondsSince(startedAtMs),
|
|
219
223
|
});
|
|
220
|
-
await emitTerminal({ terminal, result, config,
|
|
224
|
+
await emitTerminal({ terminal, result, config, worker });
|
|
221
225
|
return { success: false, result, terminal };
|
|
222
226
|
}
|
|
223
227
|
|
|
@@ -589,6 +593,7 @@ export async function runSingleStoryClose({
|
|
|
589
593
|
rerunAdvisory: rerunAdvisoryParam,
|
|
590
594
|
overrideReviewBlock: overrideReviewBlockParam,
|
|
591
595
|
workerTokens: workerTokensParam,
|
|
596
|
+
workerModel: workerModelParam,
|
|
592
597
|
...injected
|
|
593
598
|
} = {}) {
|
|
594
599
|
const options = parseCloseOptions({
|
|
@@ -604,10 +609,11 @@ export async function runSingleStoryClose({
|
|
|
604
609
|
rerunAdvisoryParam,
|
|
605
610
|
overrideReviewBlockParam,
|
|
606
611
|
workerTokensParam,
|
|
612
|
+
workerModelParam,
|
|
607
613
|
});
|
|
608
614
|
if (!options.storyId) {
|
|
609
615
|
throw new Error(
|
|
610
|
-
'Usage: node single-story-close.js --story <STORY_ID> [--cwd <main-repo>] [--skip-validation] [--skip-sync] [--no-auto-merge] [--wait-merge|--no-wait-merge] [--max-wait-seconds <n>] [--merge-watch-mode <sync|async>] [--rerun-advisory <n>] [--override-review-block <reason>] [--worker-tokens <n>]',
|
|
616
|
+
'Usage: node single-story-close.js --story <STORY_ID> [--cwd <main-repo>] [--skip-validation] [--skip-sync] [--no-auto-merge] [--wait-merge|--no-wait-merge] [--max-wait-seconds <n>] [--merge-watch-mode <sync|async>] [--rerun-advisory <n>] [--override-review-block <reason>] [--worker-tokens <n>] [--worker-model <model>]',
|
|
611
617
|
);
|
|
612
618
|
}
|
|
613
619
|
|
|
@@ -754,7 +760,7 @@ async function finishWithMergeWait(prCtx, deps) {
|
|
|
754
760
|
result,
|
|
755
761
|
config: prCtx.config,
|
|
756
762
|
phaseTimer: prCtx.phaseTimer,
|
|
757
|
-
|
|
763
|
+
worker: prCtx.worker,
|
|
758
764
|
});
|
|
759
765
|
reportWaitTerminal(terminal, { storyId: prCtx.storyId, prUrl: prCtx.prUrl });
|
|
760
766
|
return { success: terminal.status === 'landed', result, terminal };
|
|
@@ -809,7 +815,7 @@ async function finishWithoutMergeWait(prCtx, waitForMergeReason) {
|
|
|
809
815
|
result,
|
|
810
816
|
config: prCtx.config,
|
|
811
817
|
phaseTimer: prCtx.phaseTimer,
|
|
812
|
-
|
|
818
|
+
worker: prCtx.worker,
|
|
813
819
|
});
|
|
814
820
|
progress(
|
|
815
821
|
'DONE',
|
|
@@ -828,14 +834,14 @@ async function finishWithoutMergeWait(prCtx, waitForMergeReason) {
|
|
|
828
834
|
*/
|
|
829
835
|
async function finishDeferred(
|
|
830
836
|
lockWait,
|
|
831
|
-
{ config, startedAtMs, phaseTimer,
|
|
837
|
+
{ config, startedAtMs, phaseTimer, worker, ...ids },
|
|
832
838
|
) {
|
|
833
839
|
const { result, terminal, note } = lockWaitPending({
|
|
834
840
|
...ids,
|
|
835
841
|
lockWait,
|
|
836
842
|
elapsedSeconds: elapsedSecondsSince(startedAtMs),
|
|
837
843
|
});
|
|
838
|
-
await emitTerminal({ terminal, result, config, phaseTimer,
|
|
844
|
+
await emitTerminal({ terminal, result, config, phaseTimer, worker });
|
|
839
845
|
progress('PENDING', note);
|
|
840
846
|
return { success: false, result, terminal };
|
|
841
847
|
}
|
|
@@ -878,7 +884,7 @@ async function loadStoryPhase(ctx, deps) {
|
|
|
878
884
|
ctx.storyId,
|
|
879
885
|
ctx.story.stateReason,
|
|
880
886
|
deps.config,
|
|
881
|
-
ctx.
|
|
887
|
+
ctx.worker,
|
|
882
888
|
);
|
|
883
889
|
}
|
|
884
890
|
|
|
@@ -898,7 +904,7 @@ async function graphqlPreflightPhase(ctx, deps) {
|
|
|
898
904
|
preflight,
|
|
899
905
|
config: deps.config,
|
|
900
906
|
startedAtMs: ctx.startedAtMs,
|
|
901
|
-
|
|
907
|
+
worker: ctx.worker,
|
|
902
908
|
});
|
|
903
909
|
}
|
|
904
910
|
|
|
@@ -937,7 +943,7 @@ async function prePushPhase(ctx, deps) {
|
|
|
937
943
|
config: deps.config,
|
|
938
944
|
startedAtMs: ctx.startedAtMs,
|
|
939
945
|
phaseTimer: ctx.phaseTimer,
|
|
940
|
-
|
|
946
|
+
worker: ctx.worker,
|
|
941
947
|
});
|
|
942
948
|
}
|
|
943
949
|
|
|
@@ -1028,7 +1034,7 @@ async function finishPhase(ctx, deps) {
|
|
|
1028
1034
|
config: deps.config,
|
|
1029
1035
|
startedAtMs: ctx.startedAtMs,
|
|
1030
1036
|
phaseTimer: ctx.phaseTimer,
|
|
1031
|
-
|
|
1037
|
+
worker: ctx.worker,
|
|
1032
1038
|
lockWait: ctx.prePush.lockWait,
|
|
1033
1039
|
suiteTimings: ctx.prePush.suiteTimings,
|
|
1034
1040
|
gates: closeEnvelopeGates(
|
|
@@ -1074,7 +1080,10 @@ async function runClosePipeline(run, deps) {
|
|
|
1074
1080
|
...run,
|
|
1075
1081
|
storyId: run.options.storyId,
|
|
1076
1082
|
storyBranch: getStoryBranch(run.options.storyId),
|
|
1077
|
-
|
|
1083
|
+
worker: {
|
|
1084
|
+
workerTokens: resolveWorkerTokens(run.options.workerTokens),
|
|
1085
|
+
workerModel: resolveWorkerModel(run.options.workerModel),
|
|
1086
|
+
},
|
|
1078
1087
|
};
|
|
1079
1088
|
for (const phase of CLOSE_PIPELINE) {
|
|
1080
1089
|
const ending = await phase(ctx, deps);
|