@kitman-sh/software-engineering 0.13.5 → 0.13.7
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/planner.md +2 -2
- package/dist/bundle.js +69 -12
- package/dist/declarations.json +115 -4
- package/kitman.config.ts +4 -2
- package/package.json +3 -3
- package/src/build.ts +36 -9
- package/src/convergence.ts +36 -0
- package/src/plan.ts +11 -2
package/agents/planner.md
CHANGED
|
@@ -10,10 +10,10 @@ You are a planner. You turn what someone asked for into a spec and tickets an im
|
|
|
10
10
|
|
|
11
11
|
## Tickets
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- Before you write tickets, load `skills({ name: 'scope-tasks' })` from the Kitman MCP and scope each ticket as it says.
|
|
14
|
+
- Write vertical slices: each ticket lands on its own as one ChangeRequest and is verifiable on its own.
|
|
14
15
|
- Give every ticket Acceptance Criteria that a reviewer can check against the change.
|
|
15
16
|
- Give the plan an explicit out-of-scope list, so what was left out is a decision and not an omission.
|
|
16
|
-
- Name each ticket's blockers by the tickets whose code it needs.
|
|
17
17
|
- Check the documentation when an API detail affects the plan.
|
|
18
18
|
|
|
19
19
|
## Boundaries
|
package/dist/bundle.js
CHANGED
|
@@ -19364,6 +19364,8 @@ var PlanTicket = Struct({
|
|
|
19364
19364
|
title: String5,
|
|
19365
19365
|
body: String5,
|
|
19366
19366
|
acceptanceCriteria: ArraySchema(String5),
|
|
19367
|
+
promise: optional2(String5),
|
|
19368
|
+
outOfScope: optional2(ArraySchema(String5)),
|
|
19367
19369
|
repoBindingId: optional2(String5),
|
|
19368
19370
|
blockedBy: ArraySchema(String5),
|
|
19369
19371
|
outcome: optional2(LoopOutcome)
|
|
@@ -20825,7 +20827,8 @@ var Finding = Struct({
|
|
|
20825
20827
|
var MergedFinding = Struct({
|
|
20826
20828
|
id: String5,
|
|
20827
20829
|
...Finding.fields,
|
|
20828
|
-
seats: ArraySchema(String5)
|
|
20830
|
+
seats: ArraySchema(String5),
|
|
20831
|
+
blockingSeats: optionalKey2(ArraySchema(String5))
|
|
20829
20832
|
});
|
|
20830
20833
|
var Rebuttal = Struct({ findingId: String5, reason: String5 });
|
|
20831
20834
|
var RebuttalVerdict = Struct({ findingId: String5, accepted: Boolean3 });
|
|
@@ -20834,6 +20837,7 @@ var rank = { blocker: 0, major: 1, minor: 2 };
|
|
|
20834
20837
|
var isBlocking = (finding) => finding.severity !== "minor";
|
|
20835
20838
|
var mergeFindings = (bySeat) => {
|
|
20836
20839
|
const merged = new Map;
|
|
20840
|
+
const blocking = new Map;
|
|
20837
20841
|
for (const [seat, findings] of Object.entries(bySeat))
|
|
20838
20842
|
for (const finding of findings) {
|
|
20839
20843
|
const id = `${finding.file}:${finding.line}`;
|
|
@@ -20841,8 +20845,13 @@ var mergeFindings = (bySeat) => {
|
|
|
20841
20845
|
const seats = [...new Set([...known?.seats ?? [], seat])];
|
|
20842
20846
|
const worst = known === undefined || rank[finding.severity] < rank[known.severity] ? finding : known;
|
|
20843
20847
|
merged.set(id, { id, severity: worst.severity, file: worst.file, line: worst.line, detail: worst.detail, seats });
|
|
20848
|
+
if (isBlocking(finding))
|
|
20849
|
+
blocking.set(id, new Set([...blocking.get(id) ?? [], seat]));
|
|
20844
20850
|
}
|
|
20845
|
-
return [...merged.values()].
|
|
20851
|
+
return [...merged.values()].map((finding) => {
|
|
20852
|
+
const blockingSeats = [...blocking.get(finding.id) ?? []];
|
|
20853
|
+
return blockingSeats.length === 0 || blockingSeats.length === finding.seats.length ? finding : { ...finding, blockingSeats };
|
|
20854
|
+
}).toSorted((left, right) => rank[left.severity] - rank[right.severity]);
|
|
20846
20855
|
};
|
|
20847
20856
|
var splitDisputed = (findings, rebuttals) => {
|
|
20848
20857
|
const disputed = [];
|
|
@@ -21136,6 +21145,20 @@ var changeRequestBody = (build) => [
|
|
|
21136
21145
|
|
|
21137
21146
|
`);
|
|
21138
21147
|
|
|
21148
|
+
// src/convergence.ts
|
|
21149
|
+
var everyRoundSeat = "code-review";
|
|
21150
|
+
var levelLimit = 3;
|
|
21151
|
+
var raisedAsBlocking = (finding) => isBlocking(finding) && (finding.blockingSeats ?? finding.seats).includes(everyRoundSeat);
|
|
21152
|
+
var blockingCount = (settled) => [...settled.open, ...settled.standing.map((entry) => entry.finding)].filter(raisedAsBlocking).length;
|
|
21153
|
+
var rebuildRefusal = (counts) => {
|
|
21154
|
+
const previous = counts.at(-2);
|
|
21155
|
+
const latest = counts.at(-1);
|
|
21156
|
+
if (previous === undefined || latest === undefined)
|
|
21157
|
+
return;
|
|
21158
|
+
const change = latest > previous ? `rose from ${previous} to ${latest}` : latest === previous && latest >= levelLimit ? `stayed level at ${latest}` : undefined;
|
|
21159
|
+
return change === undefined ? undefined : `its Review rounds are not converging: the ${everyRoundSeat} reviewer's blockers and majors ${change} in the last Review round (${counts.join(", ")})`;
|
|
21160
|
+
};
|
|
21161
|
+
|
|
21139
21162
|
// src/delivery.ts
|
|
21140
21163
|
var DeliveryFields = {
|
|
21141
21164
|
deliveryTarget: optional2(DeliveryTarget),
|
|
@@ -23201,6 +23224,7 @@ var BuildOutput = Struct({
|
|
|
23201
23224
|
criteria: ArraySchema(CriterionAnswer),
|
|
23202
23225
|
notRun: optional2(ArraySchema(String5)),
|
|
23203
23226
|
findings: optional2(ArraySchema(MergedFinding)),
|
|
23227
|
+
blockingCounts: optional2(ArraySchema(Int)),
|
|
23204
23228
|
approval: optional2(ApproveChangeRequestResult),
|
|
23205
23229
|
landed: optional2(ShepherdOutput),
|
|
23206
23230
|
next: Struct({ changeRequestId: String5 }),
|
|
@@ -23304,6 +23328,7 @@ var onlyChecksBlock = (settled) => blockingIds(settled).every(isCheckFinding) &&
|
|
|
23304
23328
|
var rally = (input) => gen2(function* () {
|
|
23305
23329
|
const claims = [...input.claims];
|
|
23306
23330
|
const conflicts = [];
|
|
23331
|
+
const blockingCounts = [];
|
|
23307
23332
|
let rebuttals = [];
|
|
23308
23333
|
let earlier = input.earlier;
|
|
23309
23334
|
let previous;
|
|
@@ -23335,7 +23360,8 @@ var rally = (input) => gen2(function* () {
|
|
|
23335
23360
|
decision: { stop: true, reason: "findings_returned", unsettled: blockingIds(last.settled) },
|
|
23336
23361
|
claims,
|
|
23337
23362
|
conflicts,
|
|
23338
|
-
earlier
|
|
23363
|
+
earlier,
|
|
23364
|
+
blockingCounts
|
|
23339
23365
|
};
|
|
23340
23366
|
const failing = brokenChecks(head).map((check) => check.name);
|
|
23341
23367
|
const notRun = testsNotRunReasons(head);
|
|
@@ -23356,6 +23382,7 @@ var rally = (input) => gen2(function* () {
|
|
|
23356
23382
|
rebuttals,
|
|
23357
23383
|
verdicts: reviewed.verdicts
|
|
23358
23384
|
});
|
|
23385
|
+
blockingCounts.push(blockingCount(settled));
|
|
23359
23386
|
earlier = [...settled.open, ...settled.standing.map((entry) => entry.finding)].filter((finding) => !finding.id.startsWith("scope: ") && !isCheckFinding(finding.id));
|
|
23360
23387
|
const unseen = checks.some((finding) => !shown.has(finding.detail));
|
|
23361
23388
|
const decision = rallyStop({
|
|
@@ -23365,7 +23392,17 @@ var rally = (input) => gen2(function* () {
|
|
|
23365
23392
|
...previous === undefined || unseen ? undefined : { previous }
|
|
23366
23393
|
});
|
|
23367
23394
|
if (decision.stop && (!unseen || round >= input.maxRounds))
|
|
23368
|
-
return {
|
|
23395
|
+
return {
|
|
23396
|
+
round,
|
|
23397
|
+
head,
|
|
23398
|
+
settled,
|
|
23399
|
+
decision,
|
|
23400
|
+
claims,
|
|
23401
|
+
scope: reviewed.scope,
|
|
23402
|
+
conflicts,
|
|
23403
|
+
earlier,
|
|
23404
|
+
blockingCounts
|
|
23405
|
+
};
|
|
23369
23406
|
for (const finding of checks)
|
|
23370
23407
|
shown.add(finding.detail);
|
|
23371
23408
|
const fixed = yield* agentWork(`fix:${round}`, {
|
|
@@ -23385,7 +23422,7 @@ var rally = (input) => gen2(function* () {
|
|
|
23385
23422
|
});
|
|
23386
23423
|
var build2 = defineLoop({
|
|
23387
23424
|
id: "build",
|
|
23388
|
-
version: "2.
|
|
23425
|
+
version: "2.10.0",
|
|
23389
23426
|
title: "Build",
|
|
23390
23427
|
input: BuildInput,
|
|
23391
23428
|
output: BuildOutput,
|
|
@@ -23498,14 +23535,20 @@ var build2 = defineLoop({
|
|
|
23498
23535
|
criteria,
|
|
23499
23536
|
...lastNotRun.length === 0 ? undefined : { notRun: lastNotRun },
|
|
23500
23537
|
...last.earlier.length === 0 ? undefined : { findings: last.earlier },
|
|
23538
|
+
blockingCounts: last.blockingCounts,
|
|
23501
23539
|
...approval === undefined ? undefined : { approval }
|
|
23502
23540
|
};
|
|
23503
23541
|
const maxRebuilds = input.maxRebuilds ?? 1;
|
|
23504
23542
|
for (let rebuilds = 0;input.land !== false && settledAs.unsettled.length > 0; ) {
|
|
23505
23543
|
const standing = settledAs.unsettled;
|
|
23506
|
-
const
|
|
23544
|
+
const refusal = rebuildRefusal(settledAs.blockingCounts ?? []);
|
|
23545
|
+
const again = rebuilds < maxRebuilds && refusal === undefined;
|
|
23546
|
+
const refused = refusal === undefined ? [] : [`Another Build is not offered: ${refusal}.`];
|
|
23507
23547
|
const answer = yield* ask(rebuilds === 0 ? "unsettled" : `unsettled:${rebuilds + 1}`, {
|
|
23508
|
-
prompt:
|
|
23548
|
+
prompt: [
|
|
23549
|
+
`The ChangeRequest ${opened.url} is open, but these still stand: ${standing.join("; ")}. Build will not land it.`,
|
|
23550
|
+
...refused
|
|
23551
|
+
].join(" "),
|
|
23509
23552
|
options: [
|
|
23510
23553
|
{ value: takenOverAnswer, description: "A person fixes, rebuts or steers it from here." },
|
|
23511
23554
|
again ? {
|
|
@@ -23530,7 +23573,8 @@ var build2 = defineLoop({
|
|
|
23530
23573
|
text: [
|
|
23531
23574
|
`Build stopped without landing ${opened.url}, marked blocked on what still stands:`,
|
|
23532
23575
|
"",
|
|
23533
|
-
...standing.map((item) => `- ${item}`)
|
|
23576
|
+
...standing.map((item) => `- ${item}`),
|
|
23577
|
+
...refused.length === 0 ? [] : ["", ...refused]
|
|
23534
23578
|
].join(`
|
|
23535
23579
|
`)
|
|
23536
23580
|
});
|
|
@@ -24271,10 +24315,13 @@ var planText = (plan) => [
|
|
|
24271
24315
|
].join(`
|
|
24272
24316
|
|
|
24273
24317
|
`);
|
|
24318
|
+
var outOfScopeText = ({ outOfScope = [] }) => outOfScope.length === 0 ? [] : ["Out of scope:", ...outOfScope.map((item) => `- ${item}`)];
|
|
24274
24319
|
var ticketText = (ticket) => [
|
|
24275
24320
|
`### ${ticket.key}: ${ticket.title}`,
|
|
24276
24321
|
ticket.body,
|
|
24322
|
+
...ticket.promise === undefined ? [] : [`Promise: ${ticket.promise}`],
|
|
24277
24323
|
...ticket.acceptanceCriteria.map((criterion) => `- [ ] ${criterion}`),
|
|
24324
|
+
...outOfScopeText(ticket),
|
|
24278
24325
|
...ticket.blockedBy.length === 0 ? [] : [`Blocked by: ${ticket.blockedBy.join(", ")}`]
|
|
24279
24326
|
].join(`
|
|
24280
24327
|
|
|
@@ -24337,10 +24384,12 @@ var storePlan = (plan, suffix, revision, answered) => gen2(function* () {
|
|
|
24337
24384
|
text: plan.tickets.map(ticketText).join(`
|
|
24338
24385
|
|
|
24339
24386
|
`),
|
|
24340
|
-
data: plan.tickets.map(({ repoBindingId, outcome, ...ticket }) => ({
|
|
24387
|
+
data: plan.tickets.map(({ repoBindingId, outcome, promise, outOfScope, ...ticket }) => ({
|
|
24341
24388
|
...ticket,
|
|
24342
24389
|
acceptanceCriteria: [...ticket.acceptanceCriteria],
|
|
24343
24390
|
blockedBy: [...ticket.blockedBy],
|
|
24391
|
+
...promise === undefined ? undefined : { promise },
|
|
24392
|
+
...outOfScope === undefined ? undefined : { outOfScope: [...outOfScope] },
|
|
24344
24393
|
...repoBindingId === undefined ? undefined : { repoBindingId },
|
|
24345
24394
|
...outcome === undefined ? undefined : { outcome }
|
|
24346
24395
|
}))
|
|
@@ -24378,7 +24427,9 @@ var changelog = (before, after, words) => {
|
|
|
24378
24427
|
var buildWords = (ticket) => [
|
|
24379
24428
|
ticket.title,
|
|
24380
24429
|
ticket.body,
|
|
24381
|
-
...ticket.
|
|
24430
|
+
...ticket.promise === undefined ? [] : [`Promise: ${ticket.promise}`],
|
|
24431
|
+
...ticket.acceptanceCriteria.length === 0 ? [] : ["Acceptance criteria:", ...ticket.acceptanceCriteria.map((criterion) => `- ${criterion}`)],
|
|
24432
|
+
...outOfScopeText(ticket)
|
|
24382
24433
|
].join(`
|
|
24383
24434
|
|
|
24384
24435
|
`);
|
|
@@ -25635,7 +25686,7 @@ var fallbacks = [{ harness: "pi" }];
|
|
|
25635
25686
|
var reviewer = {
|
|
25636
25687
|
harness: "pi",
|
|
25637
25688
|
model: "openai-codex/gpt-6.2-sol",
|
|
25638
|
-
fallbacks: [{ harness: "claude", model: "opus", effort: "
|
|
25689
|
+
fallbacks: [{ harness: "claude", model: "opus", effort: "medium" }]
|
|
25639
25690
|
};
|
|
25640
25691
|
var kitman_config_default = defineKit({
|
|
25641
25692
|
loops: [
|
|
@@ -25669,6 +25720,8 @@ var kitman_config_default = defineKit({
|
|
|
25669
25720
|
skills: ["code-review-and-quality", "security-and-hardening"]
|
|
25670
25721
|
},
|
|
25671
25722
|
planner: {
|
|
25723
|
+
harness: "claude",
|
|
25724
|
+
model: "claude-fable-5-2",
|
|
25672
25725
|
effort: "high",
|
|
25673
25726
|
fallbacks,
|
|
25674
25727
|
skills: ["grilling", "domain-modeling"],
|
|
@@ -28644,6 +28697,8 @@ class RunnerCapabilityRpcs extends make31(make30("PutQuestion", {
|
|
|
28644
28697
|
title: String5,
|
|
28645
28698
|
body: String5,
|
|
28646
28699
|
acceptanceCriteria: ArraySchema(String5),
|
|
28700
|
+
promise: optionalKey2(String5),
|
|
28701
|
+
outOfScope: optionalKey2(ArraySchema(String5)),
|
|
28647
28702
|
blockedBy: ArraySchema(String5),
|
|
28648
28703
|
outcome: optionalKey2(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"])),
|
|
28649
28704
|
repoBindingId: optionalKey2(String5)
|
|
@@ -29186,6 +29241,8 @@ var rpcProgramPorts = (rpc, work) => {
|
|
|
29186
29241
|
title: ticket.title,
|
|
29187
29242
|
body: ticket.body,
|
|
29188
29243
|
acceptanceCriteria: ticket.acceptanceCriteria,
|
|
29244
|
+
...ticket.promise === undefined ? undefined : { promise: ticket.promise },
|
|
29245
|
+
...ticket.outOfScope === undefined ? undefined : { outOfScope: ticket.outOfScope },
|
|
29189
29246
|
blockedBy: ticket.blockedBy,
|
|
29190
29247
|
...ticket.outcome === undefined ? undefined : { outcome: ticket.outcome },
|
|
29191
29248
|
...ticket.repoBindingId === undefined ? undefined : { repoBindingId: ticket.repoBindingId }
|
|
@@ -31463,4 +31520,4 @@ var runKit = (config, identity, packages) => {
|
|
|
31463
31520
|
runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
|
|
31464
31521
|
};
|
|
31465
31522
|
// .kitman-build-entry.ts
|
|
31466
|
-
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.
|
|
31523
|
+
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.7" }, []);
|
package/dist/declarations.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{
|
|
4
4
|
"id": "build",
|
|
5
5
|
"title": "Build",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.10.0",
|
|
7
7
|
"input": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {
|
|
@@ -249,6 +249,12 @@
|
|
|
249
249
|
"items": {
|
|
250
250
|
"type": "string"
|
|
251
251
|
}
|
|
252
|
+
},
|
|
253
|
+
"blockingSeats": {
|
|
254
|
+
"type": "array",
|
|
255
|
+
"items": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
}
|
|
252
258
|
}
|
|
253
259
|
},
|
|
254
260
|
"required": [
|
|
@@ -496,6 +502,12 @@
|
|
|
496
502
|
"items": {
|
|
497
503
|
"type": "string"
|
|
498
504
|
}
|
|
505
|
+
},
|
|
506
|
+
"blockingSeats": {
|
|
507
|
+
"type": "array",
|
|
508
|
+
"items": {
|
|
509
|
+
"type": "string"
|
|
510
|
+
}
|
|
499
511
|
}
|
|
500
512
|
},
|
|
501
513
|
"required": [
|
|
@@ -514,6 +526,21 @@
|
|
|
514
526
|
}
|
|
515
527
|
]
|
|
516
528
|
},
|
|
529
|
+
"blockingCounts": {
|
|
530
|
+
"anyOf": [
|
|
531
|
+
{
|
|
532
|
+
"type": "array",
|
|
533
|
+
"items": {
|
|
534
|
+
"type": "integer",
|
|
535
|
+
"minimum": -9007199254740991,
|
|
536
|
+
"maximum": 9007199254740991
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"type": "null"
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
},
|
|
517
544
|
"approval": {
|
|
518
545
|
"anyOf": [
|
|
519
546
|
{
|
|
@@ -823,6 +850,12 @@
|
|
|
823
850
|
"items": {
|
|
824
851
|
"type": "string"
|
|
825
852
|
}
|
|
853
|
+
},
|
|
854
|
+
"blockingSeats": {
|
|
855
|
+
"type": "array",
|
|
856
|
+
"items": {
|
|
857
|
+
"type": "string"
|
|
858
|
+
}
|
|
826
859
|
}
|
|
827
860
|
},
|
|
828
861
|
"required": [
|
|
@@ -1139,6 +1172,29 @@
|
|
|
1139
1172
|
"type": "string"
|
|
1140
1173
|
}
|
|
1141
1174
|
},
|
|
1175
|
+
"promise": {
|
|
1176
|
+
"anyOf": [
|
|
1177
|
+
{
|
|
1178
|
+
"type": "string"
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"type": "null"
|
|
1182
|
+
}
|
|
1183
|
+
]
|
|
1184
|
+
},
|
|
1185
|
+
"outOfScope": {
|
|
1186
|
+
"anyOf": [
|
|
1187
|
+
{
|
|
1188
|
+
"type": "array",
|
|
1189
|
+
"items": {
|
|
1190
|
+
"type": "string"
|
|
1191
|
+
}
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"type": "null"
|
|
1195
|
+
}
|
|
1196
|
+
]
|
|
1197
|
+
},
|
|
1142
1198
|
"repoBindingId": {
|
|
1143
1199
|
"anyOf": [
|
|
1144
1200
|
{
|
|
@@ -2684,6 +2740,29 @@
|
|
|
2684
2740
|
"type": "string"
|
|
2685
2741
|
}
|
|
2686
2742
|
},
|
|
2743
|
+
"promise": {
|
|
2744
|
+
"anyOf": [
|
|
2745
|
+
{
|
|
2746
|
+
"type": "string"
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
"type": "null"
|
|
2750
|
+
}
|
|
2751
|
+
]
|
|
2752
|
+
},
|
|
2753
|
+
"outOfScope": {
|
|
2754
|
+
"anyOf": [
|
|
2755
|
+
{
|
|
2756
|
+
"type": "array",
|
|
2757
|
+
"items": {
|
|
2758
|
+
"type": "string"
|
|
2759
|
+
}
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
"type": "null"
|
|
2763
|
+
}
|
|
2764
|
+
]
|
|
2765
|
+
},
|
|
2687
2766
|
"repoBindingId": {
|
|
2688
2767
|
"anyOf": [
|
|
2689
2768
|
{
|
|
@@ -3546,6 +3625,12 @@
|
|
|
3546
3625
|
"items": {
|
|
3547
3626
|
"type": "string"
|
|
3548
3627
|
}
|
|
3628
|
+
},
|
|
3629
|
+
"blockingSeats": {
|
|
3630
|
+
"type": "array",
|
|
3631
|
+
"items": {
|
|
3632
|
+
"type": "string"
|
|
3633
|
+
}
|
|
3549
3634
|
}
|
|
3550
3635
|
},
|
|
3551
3636
|
"required": [
|
|
@@ -3827,6 +3912,12 @@
|
|
|
3827
3912
|
"items": {
|
|
3828
3913
|
"type": "string"
|
|
3829
3914
|
}
|
|
3915
|
+
},
|
|
3916
|
+
"blockingSeats": {
|
|
3917
|
+
"type": "array",
|
|
3918
|
+
"items": {
|
|
3919
|
+
"type": "string"
|
|
3920
|
+
}
|
|
3830
3921
|
}
|
|
3831
3922
|
},
|
|
3832
3923
|
"required": [
|
|
@@ -4035,6 +4126,12 @@
|
|
|
4035
4126
|
"items": {
|
|
4036
4127
|
"type": "string"
|
|
4037
4128
|
}
|
|
4129
|
+
},
|
|
4130
|
+
"blockingSeats": {
|
|
4131
|
+
"type": "array",
|
|
4132
|
+
"items": {
|
|
4133
|
+
"type": "string"
|
|
4134
|
+
}
|
|
4038
4135
|
}
|
|
4039
4136
|
},
|
|
4040
4137
|
"required": [
|
|
@@ -4082,6 +4179,12 @@
|
|
|
4082
4179
|
"items": {
|
|
4083
4180
|
"type": "string"
|
|
4084
4181
|
}
|
|
4182
|
+
},
|
|
4183
|
+
"blockingSeats": {
|
|
4184
|
+
"type": "array",
|
|
4185
|
+
"items": {
|
|
4186
|
+
"type": "string"
|
|
4187
|
+
}
|
|
4085
4188
|
}
|
|
4086
4189
|
},
|
|
4087
4190
|
"required": [
|
|
@@ -4923,6 +5026,12 @@
|
|
|
4923
5026
|
"items": {
|
|
4924
5027
|
"type": "string"
|
|
4925
5028
|
}
|
|
5029
|
+
},
|
|
5030
|
+
"blockingSeats": {
|
|
5031
|
+
"type": "array",
|
|
5032
|
+
"items": {
|
|
5033
|
+
"type": "string"
|
|
5034
|
+
}
|
|
4926
5035
|
}
|
|
4927
5036
|
},
|
|
4928
5037
|
"required": [
|
|
@@ -5422,7 +5531,7 @@
|
|
|
5422
5531
|
{
|
|
5423
5532
|
"harness": "claude",
|
|
5424
5533
|
"model": "opus",
|
|
5425
|
-
"effort": "
|
|
5534
|
+
"effort": "medium"
|
|
5426
5535
|
}
|
|
5427
5536
|
]
|
|
5428
5537
|
},
|
|
@@ -5440,7 +5549,9 @@
|
|
|
5440
5549
|
]
|
|
5441
5550
|
},
|
|
5442
5551
|
"planner": {
|
|
5443
|
-
"instructions": "You are a planner. You turn what someone asked for into a spec and tickets an implementer can build without asking again.\n\n## Questions\n\n- When your Step runs grill-with-docs, interview the person with the Kitman MCP `ask` tool, never in your reply: walk the decisions one at a time, and ask only when the answer changes what gets built. A clear goal needs no interview and no approval of a summary.\n- Ask one question at a time, and give options when the choices are clear, each with its trade-off in a short `description`.\n- Recommend an answer with `recommended` and say why in `recommendationReason`. Keep the prompt to the context and the decision. Only a question that purely asks for information you cannot guess, such as a secret's name, sets `informationOnly` instead, saying why.\n- Respect decisions already made; do not ask for them again.\n- Push back when an approach has a concrete downside: name it, propose an alternative, then accept the decision.\n\n## Tickets\n\n- Write vertical slices: each ticket lands on its own as one ChangeRequest and is verifiable on its own
|
|
5552
|
+
"instructions": "You are a planner. You turn what someone asked for into a spec and tickets an implementer can build without asking again.\n\n## Questions\n\n- When your Step runs grill-with-docs, interview the person with the Kitman MCP `ask` tool, never in your reply: walk the decisions one at a time, and ask only when the answer changes what gets built. A clear goal needs no interview and no approval of a summary.\n- Ask one question at a time, and give options when the choices are clear, each with its trade-off in a short `description`.\n- Recommend an answer with `recommended` and say why in `recommendationReason`. Keep the prompt to the context and the decision. Only a question that purely asks for information you cannot guess, such as a secret's name, sets `informationOnly` instead, saying why.\n- Respect decisions already made; do not ask for them again.\n- Push back when an approach has a concrete downside: name it, propose an alternative, then accept the decision.\n\n## Tickets\n\n- Before you write tickets, load `skills({ name: 'scope-tasks' })` from the Kitman MCP and scope each ticket as it says.\n- Write vertical slices: each ticket lands on its own as one ChangeRequest and is verifiable on its own.\n- Give every ticket Acceptance Criteria that a reviewer can check against the change.\n- Give the plan an explicit out-of-scope list, so what was left out is a decision and not an omission.\n- Check the documentation when an API detail affects the plan.\n\n## Boundaries\n\n- Write no code; write only ADR and glossary changes. Your Output is the plan, and Kitman stores it.\n- Never `git stash`: the stash stack is shared with every other worktree of the repository.\n- An implementer that asks you a question gets one answer. Never give an answer and a wider version of it elsewhere: a requirement it was not told about is one it will not build.\n\n## Output\n\nSubmit your Output with the Kitman MCP `submit_output` tool, in the shape the brief's Output schema gives.",
|
|
5553
|
+
"harness": "claude",
|
|
5554
|
+
"model": "claude-fable-5-2",
|
|
5444
5555
|
"effort": "high",
|
|
5445
5556
|
"fallbacks": [
|
|
5446
5557
|
{
|
|
@@ -5523,7 +5634,7 @@
|
|
|
5523
5634
|
"carried": [
|
|
5524
5635
|
{
|
|
5525
5636
|
"name": "@kitman-sh/software-engineering",
|
|
5526
|
-
"version": "0.13.
|
|
5637
|
+
"version": "0.13.7",
|
|
5527
5638
|
"setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
|
|
5528
5639
|
"loops": [
|
|
5529
5640
|
"build",
|
package/kitman.config.ts
CHANGED
|
@@ -26,12 +26,12 @@ const fallbacks = [{ harness: 'pi' }]
|
|
|
26
26
|
/**
|
|
27
27
|
* Reviews run on Pi, off the Claude subscription, with another model family checking Opus's work; pi's `--model` is a
|
|
28
28
|
* fuzzy pattern with no alias for the latest Sol, so it is pinned and bumped here. When Codex is out of quota, Opus at
|
|
29
|
-
*
|
|
29
|
+
* medium effort reviews instead.
|
|
30
30
|
*/
|
|
31
31
|
const reviewer = {
|
|
32
32
|
harness: 'pi',
|
|
33
33
|
model: 'openai-codex/gpt-6.2-sol',
|
|
34
|
-
fallbacks: [{ harness: 'claude', model: 'opus', effort: '
|
|
34
|
+
fallbacks: [{ harness: 'claude', model: 'opus', effort: 'medium' as const }]
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** Kitman's Kit for building software: its Loops, the Agents they run, and the skills those use. */
|
|
@@ -69,6 +69,8 @@ export default defineKit({
|
|
|
69
69
|
skills: ['code-review-and-quality', 'security-and-hardening']
|
|
70
70
|
},
|
|
71
71
|
planner: {
|
|
72
|
+
harness: 'claude',
|
|
73
|
+
model: 'claude-fable-5-2',
|
|
72
74
|
effort: 'high',
|
|
73
75
|
fallbacks,
|
|
74
76
|
skills: ['grilling', 'domain-modeling'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitman-sh/software-engineering",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"description": "Everything for building software: Loops, their Agents, the skills they use and the Ponytail plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"tsconfig.json"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@kitman-sh/sdk": "0.13.
|
|
20
|
+
"@kitman-sh/sdk": "0.13.7",
|
|
21
21
|
"effect": "^4.1.2"
|
|
22
22
|
},
|
|
23
23
|
"kitman": {
|
|
24
24
|
"bundle": "dist/bundle.js",
|
|
25
|
-
"digest": "
|
|
25
|
+
"digest": "4fb614facf6d2f22392e1be3142c31eee106ccf165a3c0fbfe9f71d41cd08766",
|
|
26
26
|
"protocolVersion": 5,
|
|
27
27
|
"declarations": "dist/declarations.json",
|
|
28
28
|
"setup": {
|
package/src/build.ts
CHANGED
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
scopeFindings,
|
|
45
45
|
unsettledItems
|
|
46
46
|
} from './change-request-body'
|
|
47
|
+
import { blockingCount, rebuildRefusal } from './convergence'
|
|
47
48
|
import review from './review'
|
|
48
49
|
import shepherd from './shepherd'
|
|
49
50
|
import { ShepherdOutput } from './shepherd-output'
|
|
@@ -76,7 +77,7 @@ export const BuildInput = Schema.Struct({
|
|
|
76
77
|
changeRequestId: Schema.optional(Schema.String),
|
|
77
78
|
/**
|
|
78
79
|
* How many more Builds an unattended full-auto Run starts on its ChangeRequest while review findings still stand,
|
|
79
|
-
* before it fails with them; 1 when left out.
|
|
80
|
+
* before it fails with them; 1 when left out. None starts after Review rounds that were not converging.
|
|
80
81
|
*/
|
|
81
82
|
maxRebuilds: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
82
83
|
/** The head an earlier review read, whose `earlier` findings this Build fixes: its first review reviews the fix. */
|
|
@@ -152,6 +153,8 @@ export const BuildOutput = Schema.Struct({
|
|
|
152
153
|
notRun: Schema.optional(Schema.Array(Schema.String)),
|
|
153
154
|
/** The last review's code findings still open or disputed, which a Build fixing them takes as `earlier`. */
|
|
154
155
|
findings: Schema.optional(Schema.Array(MergedFinding)),
|
|
156
|
+
/** Each Review round's blocking count, first to last, which decides whether a Rebuild may follow. */
|
|
157
|
+
blockingCounts: Schema.optional(Schema.Array(Schema.Int)),
|
|
155
158
|
/** Whether the last Review's approval was recorded, or why not, when nothing was left unsettled. */
|
|
156
159
|
approval: Schema.optional(ApproveChangeRequestResult),
|
|
157
160
|
/** What Shepherd did with the ChangeRequest, when the Build was told to land it. */
|
|
@@ -295,6 +298,7 @@ type Round = {
|
|
|
295
298
|
readonly scope: ScopeJudgement | undefined
|
|
296
299
|
readonly conflicts: readonly string[]
|
|
297
300
|
readonly earlier: readonly MergedFinding[]
|
|
301
|
+
readonly blockingCounts: readonly number[]
|
|
298
302
|
}
|
|
299
303
|
|
|
300
304
|
/**
|
|
@@ -315,6 +319,7 @@ const rally = (input: {
|
|
|
315
319
|
Effect.gen(function* () {
|
|
316
320
|
const claims = [...input.claims]
|
|
317
321
|
const conflicts: string[] = []
|
|
322
|
+
const blockingCounts: number[] = []
|
|
318
323
|
let rebuttals: readonly Rebuttal[] = []
|
|
319
324
|
let earlier = input.earlier
|
|
320
325
|
let previous: readonly string[] | undefined
|
|
@@ -357,7 +362,8 @@ const rally = (input: {
|
|
|
357
362
|
decision: { stop: true, reason: 'findings_returned', unsettled: blockingIds(last.settled) },
|
|
358
363
|
claims,
|
|
359
364
|
conflicts,
|
|
360
|
-
earlier
|
|
365
|
+
earlier,
|
|
366
|
+
blockingCounts
|
|
361
367
|
} satisfies Round
|
|
362
368
|
|
|
363
369
|
const failing = brokenChecks(head).map(check => check.name)
|
|
@@ -387,6 +393,8 @@ const rally = (input: {
|
|
|
387
393
|
verdicts: reviewed.verdicts
|
|
388
394
|
})
|
|
389
395
|
|
|
396
|
+
blockingCounts.push(blockingCount(settled))
|
|
397
|
+
|
|
390
398
|
// A dispute that stands stays in front of the reviewers when a broken check carries the rally on past it.
|
|
391
399
|
earlier = [...settled.open, ...settled.standing.map(entry => entry.finding)].filter(
|
|
392
400
|
finding => !finding.id.startsWith('scope: ') && !isCheckFinding(finding.id)
|
|
@@ -403,7 +411,17 @@ const rally = (input: {
|
|
|
403
411
|
})
|
|
404
412
|
|
|
405
413
|
if (decision.stop && (!unseen || round >= input.maxRounds))
|
|
406
|
-
return {
|
|
414
|
+
return {
|
|
415
|
+
round,
|
|
416
|
+
head,
|
|
417
|
+
settled,
|
|
418
|
+
decision,
|
|
419
|
+
claims,
|
|
420
|
+
scope: reviewed.scope,
|
|
421
|
+
conflicts,
|
|
422
|
+
earlier,
|
|
423
|
+
blockingCounts
|
|
424
|
+
} satisfies Round
|
|
407
425
|
|
|
408
426
|
for (const finding of checks) shown.add(finding.detail)
|
|
409
427
|
|
|
@@ -439,11 +457,12 @@ const rally = (input: {
|
|
|
439
457
|
* Implements a Task or words, reviews and fixes until the rally stops, gates on the evidence for the head, and opens
|
|
440
458
|
* the Run's ChangeRequest with the evidence, the claims and whatever it could not settle (ADR-0051). It writes the
|
|
441
459
|
* Run's milestones to its Task: started, ChangeRequest opened, and failed, or blocked instead of failed when findings
|
|
442
|
-
* still stand once full auto's rebuilds run out; those findings go on the Task as a blocker
|
|
460
|
+
* still stand once full auto's rebuilds run out or its Review rounds are not converging; those findings go on the Task as a blocker
|
|
461
|
+
* before the Run fails.
|
|
443
462
|
*/
|
|
444
463
|
const build = defineLoop({
|
|
445
464
|
id: 'build',
|
|
446
|
-
version: '2.
|
|
465
|
+
version: '2.10.0',
|
|
447
466
|
title: 'Build',
|
|
448
467
|
input: BuildInput,
|
|
449
468
|
output: BuildOutput,
|
|
@@ -611,19 +630,26 @@ const build = defineLoop({
|
|
|
611
630
|
criteria,
|
|
612
631
|
...(lastNotRun.length === 0 ? undefined : { notRun: lastNotRun }),
|
|
613
632
|
...(last.earlier.length === 0 ? undefined : { findings: last.earlier }),
|
|
633
|
+
blockingCounts: last.blockingCounts,
|
|
614
634
|
...(approval === undefined ? undefined : { approval })
|
|
615
635
|
}
|
|
616
636
|
|
|
617
637
|
const maxRebuilds = input.maxRebuilds ?? 1
|
|
618
638
|
|
|
619
639
|
// Anything left unsettled stops here with the findings for a person, not in Shepherd. Full auto builds again on
|
|
620
|
-
// the same branch up to the cap, then fails with them rather than wait on a
|
|
640
|
+
// the same branch up to the cap while its Review rounds converge, then fails with them rather than wait on a
|
|
641
|
+
// Question nobody answers.
|
|
621
642
|
for (let rebuilds = 0; input.land !== false && settledAs.unsettled.length > 0;) {
|
|
622
643
|
const standing = settledAs.unsettled
|
|
623
|
-
const
|
|
644
|
+
const refusal = rebuildRefusal(settledAs.blockingCounts ?? [])
|
|
645
|
+
const again = rebuilds < maxRebuilds && refusal === undefined
|
|
646
|
+
const refused = refusal === undefined ? [] : [`Another Build is not offered: ${refusal}.`]
|
|
624
647
|
|
|
625
648
|
const answer = yield* ask(rebuilds === 0 ? 'unsettled' : `unsettled:${rebuilds + 1}`, {
|
|
626
|
-
prompt:
|
|
649
|
+
prompt: [
|
|
650
|
+
`The ChangeRequest ${opened.url} is open, but these still stand: ${standing.join('; ')}. Build will not land it.`,
|
|
651
|
+
...refused
|
|
652
|
+
].join(' '),
|
|
627
653
|
options: [
|
|
628
654
|
{ value: takenOverAnswer, description: 'A person fixes, rebuts or steers it from here.' },
|
|
629
655
|
again
|
|
@@ -652,7 +678,8 @@ const build = defineLoop({
|
|
|
652
678
|
text: [
|
|
653
679
|
`Build stopped without landing ${opened.url}, marked blocked on what still stands:`,
|
|
654
680
|
'',
|
|
655
|
-
...standing.map(item => `- ${item}`)
|
|
681
|
+
...standing.map(item => `- ${item}`),
|
|
682
|
+
...(refused.length === 0 ? [] : ['', ...refused])
|
|
656
683
|
].join('\n')
|
|
657
684
|
})
|
|
658
685
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isBlocking, type MergedFinding, type SettledRound } from '@kitman-sh/sdk/loop'
|
|
2
|
+
|
|
3
|
+
/** The reviewer seat that runs in every Review round, so its counts compare from one round to the next. */
|
|
4
|
+
const everyRoundSeat = 'code-review'
|
|
5
|
+
|
|
6
|
+
/** From this many blockers and majors, a count that only stays level is not converging. */
|
|
7
|
+
const levelLimit = 3
|
|
8
|
+
|
|
9
|
+
const raisedAsBlocking = (finding: MergedFinding) =>
|
|
10
|
+
isBlocking(finding) && (finding.blockingSeats ?? finding.seats).includes(everyRoundSeat)
|
|
11
|
+
|
|
12
|
+
/** The blockers and majors of the seat that runs in every round, still open or disputed after a Review round. */
|
|
13
|
+
export const blockingCount = (settled: SettledRound) =>
|
|
14
|
+
[...settled.open, ...settled.standing.map(entry => entry.finding)].filter(raisedAsBlocking).length
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Why a Build whose Review rounds had these blocking counts, first to last, may not start a Rebuild; undefined when it
|
|
18
|
+
* may.
|
|
19
|
+
*/
|
|
20
|
+
export const rebuildRefusal = (counts: readonly number[]) => {
|
|
21
|
+
const previous = counts.at(-2)
|
|
22
|
+
const latest = counts.at(-1)
|
|
23
|
+
|
|
24
|
+
if (previous === undefined || latest === undefined) return undefined
|
|
25
|
+
|
|
26
|
+
const change =
|
|
27
|
+
latest > previous
|
|
28
|
+
? `rose from ${previous} to ${latest}`
|
|
29
|
+
: latest === previous && latest >= levelLimit
|
|
30
|
+
? `stayed level at ${latest}`
|
|
31
|
+
: undefined
|
|
32
|
+
|
|
33
|
+
return change === undefined
|
|
34
|
+
? undefined
|
|
35
|
+
: `its Review rounds are not converging: the ${everyRoundSeat} reviewer's blockers and majors ${change} in the last Review round (${counts.join(', ')})`
|
|
36
|
+
}
|
package/src/plan.ts
CHANGED
|
@@ -150,11 +150,16 @@ const planText = (plan: Plan) =>
|
|
|
150
150
|
...plan.tickets.map(ticketText)
|
|
151
151
|
].join('\n\n')
|
|
152
152
|
|
|
153
|
+
const outOfScopeText = ({ outOfScope = [] }: PlanTicket) =>
|
|
154
|
+
outOfScope.length === 0 ? [] : ['Out of scope:', ...outOfScope.map(item => `- ${item}`)]
|
|
155
|
+
|
|
153
156
|
const ticketText = (ticket: PlanTicket) =>
|
|
154
157
|
[
|
|
155
158
|
`### ${ticket.key}: ${ticket.title}`,
|
|
156
159
|
ticket.body,
|
|
160
|
+
...(ticket.promise === undefined ? [] : [`Promise: ${ticket.promise}`]),
|
|
157
161
|
...ticket.acceptanceCriteria.map(criterion => `- [ ] ${criterion}`),
|
|
162
|
+
...outOfScopeText(ticket),
|
|
158
163
|
...(ticket.blockedBy.length === 0 ? [] : [`Blocked by: ${ticket.blockedBy.join(', ')}`])
|
|
159
164
|
].join('\n\n')
|
|
160
165
|
|
|
@@ -255,10 +260,12 @@ const storePlan = (plan: Plan, suffix: string, revision: number, answered?: Answ
|
|
|
255
260
|
kind: 'plan_tickets',
|
|
256
261
|
title: `Tickets for ${plan.title}`,
|
|
257
262
|
text: plan.tickets.map(ticketText).join('\n\n'),
|
|
258
|
-
data: plan.tickets.map(({ repoBindingId, outcome, ...ticket }) => ({
|
|
263
|
+
data: plan.tickets.map(({ repoBindingId, outcome, promise, outOfScope, ...ticket }) => ({
|
|
259
264
|
...ticket,
|
|
260
265
|
acceptanceCriteria: [...ticket.acceptanceCriteria],
|
|
261
266
|
blockedBy: [...ticket.blockedBy],
|
|
267
|
+
...(promise === undefined ? undefined : { promise }),
|
|
268
|
+
...(outOfScope === undefined ? undefined : { outOfScope: [...outOfScope] }),
|
|
262
269
|
...(repoBindingId === undefined ? undefined : { repoBindingId }),
|
|
263
270
|
...(outcome === undefined ? undefined : { outcome })
|
|
264
271
|
}))
|
|
@@ -306,9 +313,11 @@ const buildWords = (ticket: PlanTicket) =>
|
|
|
306
313
|
[
|
|
307
314
|
ticket.title,
|
|
308
315
|
ticket.body,
|
|
316
|
+
...(ticket.promise === undefined ? [] : [`Promise: ${ticket.promise}`]),
|
|
309
317
|
...(ticket.acceptanceCriteria.length === 0
|
|
310
318
|
? []
|
|
311
|
-
: ['Acceptance criteria:', ...ticket.acceptanceCriteria.map(criterion => `- ${criterion}`)])
|
|
319
|
+
: ['Acceptance criteria:', ...ticket.acceptanceCriteria.map(criterion => `- ${criterion}`)]),
|
|
320
|
+
...outOfScopeText(ticket)
|
|
312
321
|
].join('\n\n')
|
|
313
322
|
|
|
314
323
|
const settled = (ticket: PlanTicket, result: Omit<TicketResult, 'key' | 'title'>): TicketResult => ({
|