@kitman-sh/software-engineering 0.12.0-rc.4 → 0.12.0-rc.5
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/dist/bundle.js +25 -10
- package/dist/declarations.json +2 -2
- package/package.json +3 -3
- package/src/build.ts +23 -12
package/dist/bundle.js
CHANGED
|
@@ -19330,6 +19330,7 @@ var verify = (name, request) => takeStep(name, "verify", "verify", gen2(function
|
|
|
19330
19330
|
...request.revision === undefined ? undefined : { revision: request.revision },
|
|
19331
19331
|
...request.checks === undefined ? undefined : { checks: request.checks },
|
|
19332
19332
|
...request.suggested === undefined || request.suggested.length === 0 ? undefined : { suggested: request.suggested },
|
|
19333
|
+
...request.extra === undefined || request.extra.length === 0 ? undefined : { extra: request.extra },
|
|
19333
19334
|
...request.rerunFailed === true ? { rerunFailed: true } : undefined,
|
|
19334
19335
|
token: token2
|
|
19335
19336
|
}));
|
|
@@ -20685,6 +20686,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
|
|
|
20685
20686
|
step: launch.step,
|
|
20686
20687
|
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
20687
20688
|
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
20689
|
+
...launch.extra === undefined ? undefined : { extra: launch.extra },
|
|
20688
20690
|
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed }
|
|
20689
20691
|
});
|
|
20690
20692
|
if (launch.measure !== undefined) {
|
|
@@ -20696,7 +20698,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
|
|
|
20696
20698
|
revision: launch.revision ?? "head",
|
|
20697
20699
|
tree: launch.revision ?? "head",
|
|
20698
20700
|
passed: true,
|
|
20699
|
-
checks:
|
|
20701
|
+
checks: [...launch.suggested ?? [], ...launch.extra ?? []].map((check) => ({
|
|
20700
20702
|
name: check.name,
|
|
20701
20703
|
command: check.command,
|
|
20702
20704
|
status: "passed",
|
|
@@ -23105,7 +23107,7 @@ var Implemented = Struct({
|
|
|
23105
23107
|
checks: optional2(ArraySchema(SuggestedCheck))
|
|
23106
23108
|
});
|
|
23107
23109
|
var Reproduced = Struct({
|
|
23108
|
-
check:
|
|
23110
|
+
check: SuggestedCheck,
|
|
23109
23111
|
summary: ChangeRequestSummary
|
|
23110
23112
|
});
|
|
23111
23113
|
var ReproducedOnBranch = Struct({
|
|
@@ -23185,16 +23187,19 @@ var criteriaPrompt = (unanswered, unmet) => [
|
|
|
23185
23187
|
|
|
23186
23188
|
`);
|
|
23187
23189
|
var answerLine = (answer) => `${answer.criterion}: ${answer.status.replaceAll("_", " ")}, ${answer.detail}`;
|
|
23190
|
+
var reproducingCheckGuidance = "Give in `check` the command that runs only that test, with a `name` of letters, digits, `.`, `_`, `:` and `-` that no approved verification of the repository has, unless it is exactly that approved check. Kitman runs it before the fix, where it must fail, and on every head after, where it must pass.";
|
|
23188
23191
|
var reproducePrompt = (task) => [
|
|
23189
23192
|
`Reproduce the bug in ${task} before anyone fixes it.`,
|
|
23190
|
-
"Add a test that fails because of the bug, and change nothing else.
|
|
23193
|
+
"Add a test that fails because of the bug, and change nothing else.",
|
|
23194
|
+
reproducingCheckGuidance
|
|
23191
23195
|
].join(`
|
|
23192
23196
|
|
|
23193
23197
|
`);
|
|
23194
23198
|
var reproducedOnBranchPrompt = (task) => [
|
|
23195
23199
|
`An earlier Run already worked on fixing the bug in ${task}, on this branch.`,
|
|
23196
|
-
"Find the commit on this branch where the test reproducing the bug was in place and the fix was not yet, and give it as `revision
|
|
23197
|
-
"If no commit on the branch has the reproducing test without the fix, add a test that fails on the branch head now, change nothing else, and give no `revision`."
|
|
23200
|
+
"Find the commit on this branch where the test reproducing the bug was in place and the fix was not yet, and give it as `revision`. Change nothing.",
|
|
23201
|
+
"If no commit on the branch has the reproducing test without the fix, add a test that fails on the branch head now, change nothing else, and give no `revision`.",
|
|
23202
|
+
reproducingCheckGuidance
|
|
23198
23203
|
].join(`
|
|
23199
23204
|
|
|
23200
23205
|
`);
|
|
@@ -23248,7 +23253,10 @@ var rally = (input) => gen2(function* () {
|
|
|
23248
23253
|
return yield* new BuildBaseUnpinned({
|
|
23249
23254
|
message: `The Runner did not report which commit of ${input.target ?? "the default branch"} it merged in round ${round}, so there is no base to review against; update the Runner`
|
|
23250
23255
|
});
|
|
23251
|
-
const head = yield* verify(`verify:${round}`, {
|
|
23256
|
+
const head = yield* verify(`verify:${round}`, {
|
|
23257
|
+
suggested: input.suggested,
|
|
23258
|
+
...input.reproducing === undefined ? undefined : { extra: [input.reproducing] }
|
|
23259
|
+
});
|
|
23252
23260
|
if (last !== undefined && last.head.tree === head.tree && rebuttals.length === 0 && onlyChecksBlock(last.settled))
|
|
23253
23261
|
return {
|
|
23254
23262
|
...last,
|
|
@@ -23307,7 +23315,7 @@ var rally = (input) => gen2(function* () {
|
|
|
23307
23315
|
});
|
|
23308
23316
|
var build2 = defineLoop({
|
|
23309
23317
|
id: "build",
|
|
23310
|
-
version: "2.
|
|
23318
|
+
version: "2.9.0",
|
|
23311
23319
|
title: "Build",
|
|
23312
23320
|
input: BuildInput,
|
|
23313
23321
|
output: BuildOutput,
|
|
@@ -23344,7 +23352,10 @@ var build2 = defineLoop({
|
|
|
23344
23352
|
prompt: input.continuing === undefined ? reproducePrompt(task) : reproducedOnBranchPrompt(task),
|
|
23345
23353
|
output: ReproducedOnBranch
|
|
23346
23354
|
}) : undefined;
|
|
23347
|
-
const base = reproduced !== undefined ? yield* verify("verify:reproduction",
|
|
23355
|
+
const base = reproduced !== undefined ? yield* verify("verify:reproduction", {
|
|
23356
|
+
...reproduced.revision === undefined ? undefined : { revision: reproduced.revision },
|
|
23357
|
+
extra: [reproduced.check]
|
|
23358
|
+
}) : outcome === "refactor" ? yield* verify("verify:base", {}) : undefined;
|
|
23348
23359
|
const implemented = yield* agentWorkOnce("implement", {
|
|
23349
23360
|
agent: "implementer",
|
|
23350
23361
|
skill: "implement",
|
|
@@ -23364,6 +23375,7 @@ var build2 = defineLoop({
|
|
|
23364
23375
|
outcome,
|
|
23365
23376
|
claims: [...implemented.claims, ...criteria.map((answer) => `Criterion ${answerLine(answer)}`)],
|
|
23366
23377
|
suggested: implemented.checks ?? [],
|
|
23378
|
+
reproducing: reproduced?.check,
|
|
23367
23379
|
reviewed: input.reviewed,
|
|
23368
23380
|
earlier: input.earlier ?? []
|
|
23369
23381
|
});
|
|
@@ -23372,7 +23384,7 @@ var build2 = defineLoop({
|
|
|
23372
23384
|
head: last.head,
|
|
23373
23385
|
...base === undefined ? undefined : { base },
|
|
23374
23386
|
...last.scope === undefined ? undefined : { review: last.scope },
|
|
23375
|
-
...reproduced === undefined ? undefined : { reproducing: reproduced.check },
|
|
23387
|
+
...reproduced === undefined ? undefined : { reproducing: reproduced.check.name },
|
|
23376
23388
|
...implemented.documented === undefined ? undefined : { documented: implemented.documented },
|
|
23377
23389
|
...implemented.rollback === undefined ? undefined : { rollback: implemented.rollback }
|
|
23378
23390
|
});
|
|
@@ -28187,6 +28199,7 @@ class RunnerCapabilityRpcs extends make31(make30("PutQuestion", {
|
|
|
28187
28199
|
revision: optionalKey2(String5),
|
|
28188
28200
|
checks: optional2(ArraySchema(String5)),
|
|
28189
28201
|
suggested: optionalKey2(ArraySchema(ApprovedCheck)),
|
|
28202
|
+
extra: optionalKey2(ArraySchema(ApprovedCheck)),
|
|
28190
28203
|
rerunFailed: optionalKey2(Boolean3),
|
|
28191
28204
|
measure: optionalKey2(Struct({
|
|
28192
28205
|
base: optionalKey2(String5),
|
|
@@ -28774,6 +28787,7 @@ var runnerHost = (capabilities) => ({
|
|
|
28774
28787
|
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
28775
28788
|
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
28776
28789
|
...launch.suggested === undefined ? undefined : { suggested: launch.suggested },
|
|
28790
|
+
...launch.extra === undefined ? undefined : { extra: launch.extra },
|
|
28777
28791
|
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed },
|
|
28778
28792
|
...launch.measure === undefined ? undefined : { measure: launch.measure },
|
|
28779
28793
|
...launch.resolve === undefined ? undefined : { resolve: launch.resolve },
|
|
@@ -29006,6 +29020,7 @@ var rpcProgramPorts = (rpc, work) => {
|
|
|
29006
29020
|
...verification.revision === undefined ? undefined : { revision: verification.revision },
|
|
29007
29021
|
...verification.checks === undefined ? undefined : { checks: [...verification.checks] },
|
|
29008
29022
|
...verification.suggested === undefined ? undefined : { suggested: [...verification.suggested] },
|
|
29023
|
+
...verification.extra === undefined ? undefined : { extra: [...verification.extra] },
|
|
29009
29024
|
...verification.rerunFailed === undefined ? undefined : { rerunFailed: verification.rerunFailed },
|
|
29010
29025
|
...verification.measure === undefined ? undefined : { measure: verification.measure },
|
|
29011
29026
|
...verification.resolve === undefined ? undefined : { resolve: { revisions: [...verification.resolve.revisions] } },
|
|
@@ -31309,4 +31324,4 @@ var runKit = (config, identity, packages) => {
|
|
|
31309
31324
|
runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
|
|
31310
31325
|
};
|
|
31311
31326
|
// .kitman-build-entry.ts
|
|
31312
|
-
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.12.0-rc.
|
|
31327
|
+
runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.12.0-rc.5" }, []);
|
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.9.0",
|
|
7
7
|
"input": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {
|
|
@@ -5522,7 +5522,7 @@
|
|
|
5522
5522
|
"carried": [
|
|
5523
5523
|
{
|
|
5524
5524
|
"name": "@kitman-sh/software-engineering",
|
|
5525
|
-
"version": "0.12.0-rc.
|
|
5525
|
+
"version": "0.12.0-rc.5",
|
|
5526
5526
|
"setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
|
|
5527
5527
|
"loops": [
|
|
5528
5528
|
"build",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitman-sh/software-engineering",
|
|
3
|
-
"version": "0.12.0-rc.
|
|
3
|
+
"version": "0.12.0-rc.5",
|
|
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.12.0-rc.
|
|
20
|
+
"@kitman-sh/sdk": "0.12.0-rc.5",
|
|
21
21
|
"effect": "^4.1.2"
|
|
22
22
|
},
|
|
23
23
|
"kitman": {
|
|
24
24
|
"bundle": "dist/bundle.js",
|
|
25
|
-
"digest": "
|
|
25
|
+
"digest": "d757a9241ab045f60b41f909d35f672691246a21ca6d9d01c15786b79285af52",
|
|
26
26
|
"protocolVersion": 5,
|
|
27
27
|
"declarations": "dist/declarations.json",
|
|
28
28
|
"setup": {
|
package/src/build.ts
CHANGED
|
@@ -119,8 +119,8 @@ const Implemented = Schema.Struct({
|
|
|
119
119
|
})
|
|
120
120
|
|
|
121
121
|
const Reproduced = Schema.Struct({
|
|
122
|
-
/** The
|
|
123
|
-
check:
|
|
122
|
+
/** The check that runs only the test reproducing the bug; verify runs it on the base and on each head. */
|
|
123
|
+
check: SuggestedCheck,
|
|
124
124
|
summary: ChangeRequestSummary
|
|
125
125
|
})
|
|
126
126
|
|
|
@@ -224,17 +224,22 @@ const criteriaPrompt = (unanswered: boolean, unmet: readonly CriterionAnswer[])
|
|
|
224
224
|
const answerLine = (answer: CriterionAnswer) =>
|
|
225
225
|
`${answer.criterion}: ${answer.status.replaceAll('_', ' ')}, ${answer.detail}`
|
|
226
226
|
|
|
227
|
+
const reproducingCheckGuidance =
|
|
228
|
+
'Give in `check` the command that runs only that test, with a `name` of letters, digits, `.`, `_`, `:` and `-` that no approved verification of the repository has, unless it is exactly that approved check. Kitman runs it before the fix, where it must fail, and on every head after, where it must pass.'
|
|
229
|
+
|
|
227
230
|
const reproducePrompt = (task: string) =>
|
|
228
231
|
[
|
|
229
232
|
`Reproduce the bug in ${task} before anyone fixes it.`,
|
|
230
|
-
'Add a test that fails because of the bug, and change nothing else.
|
|
233
|
+
'Add a test that fails because of the bug, and change nothing else.',
|
|
234
|
+
reproducingCheckGuidance
|
|
231
235
|
].join('\n\n')
|
|
232
236
|
|
|
233
237
|
const reproducedOnBranchPrompt = (task: string) =>
|
|
234
238
|
[
|
|
235
239
|
`An earlier Run already worked on fixing the bug in ${task}, on this branch.`,
|
|
236
|
-
'Find the commit on this branch where the test reproducing the bug was in place and the fix was not yet, and give it as `revision
|
|
237
|
-
'If no commit on the branch has the reproducing test without the fix, add a test that fails on the branch head now, change nothing else, and give no `revision`.'
|
|
240
|
+
'Find the commit on this branch where the test reproducing the bug was in place and the fix was not yet, and give it as `revision`. Change nothing.',
|
|
241
|
+
'If no commit on the branch has the reproducing test without the fix, add a test that fails on the branch head now, change nothing else, and give no `revision`.',
|
|
242
|
+
reproducingCheckGuidance
|
|
238
243
|
].join('\n\n')
|
|
239
244
|
|
|
240
245
|
const findingLine = (finding: MergedFinding) => `- **${finding.severity}** \`${finding.id}\` ${finding.detail}`
|
|
@@ -302,6 +307,8 @@ const rally = (input: {
|
|
|
302
307
|
readonly outcome: LoopOutcome | undefined
|
|
303
308
|
readonly claims: readonly string[]
|
|
304
309
|
readonly suggested: readonly (typeof SuggestedCheck.Type)[]
|
|
310
|
+
/** The bug's reproducing check, run on every head besides the approved ones. */
|
|
311
|
+
readonly reproducing: typeof SuggestedCheck.Type | undefined
|
|
305
312
|
readonly reviewed: string | undefined
|
|
306
313
|
readonly earlier: readonly MergedFinding[]
|
|
307
314
|
}) =>
|
|
@@ -336,7 +343,10 @@ const rally = (input: {
|
|
|
336
343
|
message: `The Runner did not report which commit of ${input.target ?? 'the default branch'} it merged in round ${round}, so there is no base to review against; update the Runner`
|
|
337
344
|
})
|
|
338
345
|
|
|
339
|
-
const head = yield* verify(`verify:${round}`, {
|
|
346
|
+
const head = yield* verify(`verify:${round}`, {
|
|
347
|
+
suggested: input.suggested,
|
|
348
|
+
...(input.reproducing === undefined ? undefined : { extra: [input.reproducing] })
|
|
349
|
+
})
|
|
340
350
|
|
|
341
351
|
// Evidence is held per tree, so the same checks would fail again and a review would judge the same change.
|
|
342
352
|
if (last !== undefined && last.head.tree === head.tree && rebuttals.length === 0 && onlyChecksBlock(last.settled))
|
|
@@ -433,7 +443,7 @@ const rally = (input: {
|
|
|
433
443
|
*/
|
|
434
444
|
const build = defineLoop({
|
|
435
445
|
id: 'build',
|
|
436
|
-
version: '2.
|
|
446
|
+
version: '2.9.0',
|
|
437
447
|
title: 'Build',
|
|
438
448
|
input: BuildInput,
|
|
439
449
|
output: BuildOutput,
|
|
@@ -487,10 +497,10 @@ const build = defineLoop({
|
|
|
487
497
|
|
|
488
498
|
const base =
|
|
489
499
|
reproduced !== undefined
|
|
490
|
-
? yield* verify(
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
)
|
|
500
|
+
? yield* verify('verify:reproduction', {
|
|
501
|
+
...(reproduced.revision === undefined ? undefined : { revision: reproduced.revision }),
|
|
502
|
+
extra: [reproduced.check]
|
|
503
|
+
})
|
|
494
504
|
: outcome === 'refactor'
|
|
495
505
|
? yield* verify('verify:base', {})
|
|
496
506
|
: undefined
|
|
@@ -522,6 +532,7 @@ const build = defineLoop({
|
|
|
522
532
|
outcome,
|
|
523
533
|
claims: [...implemented.claims, ...criteria.map(answer => `Criterion ${answerLine(answer)}`)],
|
|
524
534
|
suggested: implemented.checks ?? [],
|
|
535
|
+
reproducing: reproduced?.check,
|
|
525
536
|
reviewed: input.reviewed,
|
|
526
537
|
earlier: input.earlier ?? []
|
|
527
538
|
})
|
|
@@ -531,7 +542,7 @@ const build = defineLoop({
|
|
|
531
542
|
head: last.head,
|
|
532
543
|
...(base === undefined ? undefined : { base }),
|
|
533
544
|
...(last.scope === undefined ? undefined : { review: last.scope }),
|
|
534
|
-
...(reproduced === undefined ? undefined : { reproducing: reproduced.check }),
|
|
545
|
+
...(reproduced === undefined ? undefined : { reproducing: reproduced.check.name }),
|
|
535
546
|
...(implemented.documented === undefined ? undefined : { documented: implemented.documented }),
|
|
536
547
|
...(implemented.rollback === undefined ? undefined : { rollback: implemented.rollback })
|
|
537
548
|
})
|