@kitman-sh/software-engineering 0.12.0-rc.3 → 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 +30 -11
- package/dist/declarations.json +2 -2
- package/package.json +3 -3
- package/src/build.ts +23 -12
package/dist/bundle.js
CHANGED
|
@@ -12624,7 +12624,11 @@ function inSecretReference(text, start, end) {
|
|
|
12624
12624
|
var placeholderTokenName = new RegExp(`^<?(?:ghp_|github_pat_|glpat-|ksa1\\.|sk-|xox[baprs]-)${placeholderNamePart}(?:[_.-]${placeholderNamePart})*>?$`, "u");
|
|
12625
12625
|
var bearerValue = /[0-9]|[._~+/:-][A-Za-z0-9]|[<{]/u;
|
|
12626
12626
|
var VALUE_RULES = [
|
|
12627
|
-
{
|
|
12627
|
+
{
|
|
12628
|
+
classification: "secret",
|
|
12629
|
+
name: "private-key",
|
|
12630
|
+
pattern: /-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY-----(?:[\s\S]*?-----END (?:[A-Z0-9]+ )*PRIVATE KEY-----|[\s\S]*)/u
|
|
12631
|
+
},
|
|
12628
12632
|
{
|
|
12629
12633
|
classification: "credential",
|
|
12630
12634
|
name: "bearer-token",
|
|
@@ -19326,6 +19330,7 @@ var verify = (name, request) => takeStep(name, "verify", "verify", gen2(function
|
|
|
19326
19330
|
...request.revision === undefined ? undefined : { revision: request.revision },
|
|
19327
19331
|
...request.checks === undefined ? undefined : { checks: request.checks },
|
|
19328
19332
|
...request.suggested === undefined || request.suggested.length === 0 ? undefined : { suggested: request.suggested },
|
|
19333
|
+
...request.extra === undefined || request.extra.length === 0 ? undefined : { extra: request.extra },
|
|
19329
19334
|
...request.rerunFailed === true ? { rerunFailed: true } : undefined,
|
|
19330
19335
|
token: token2
|
|
19331
19336
|
}));
|
|
@@ -20681,6 +20686,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
|
|
|
20681
20686
|
step: launch.step,
|
|
20682
20687
|
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
20683
20688
|
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
20689
|
+
...launch.extra === undefined ? undefined : { extra: launch.extra },
|
|
20684
20690
|
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed }
|
|
20685
20691
|
});
|
|
20686
20692
|
if (launch.measure !== undefined) {
|
|
@@ -20692,7 +20698,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
|
|
|
20692
20698
|
revision: launch.revision ?? "head",
|
|
20693
20699
|
tree: launch.revision ?? "head",
|
|
20694
20700
|
passed: true,
|
|
20695
|
-
checks:
|
|
20701
|
+
checks: [...launch.suggested ?? [], ...launch.extra ?? []].map((check) => ({
|
|
20696
20702
|
name: check.name,
|
|
20697
20703
|
command: check.command,
|
|
20698
20704
|
status: "passed",
|
|
@@ -23101,7 +23107,7 @@ var Implemented = Struct({
|
|
|
23101
23107
|
checks: optional2(ArraySchema(SuggestedCheck))
|
|
23102
23108
|
});
|
|
23103
23109
|
var Reproduced = Struct({
|
|
23104
|
-
check:
|
|
23110
|
+
check: SuggestedCheck,
|
|
23105
23111
|
summary: ChangeRequestSummary
|
|
23106
23112
|
});
|
|
23107
23113
|
var ReproducedOnBranch = Struct({
|
|
@@ -23181,16 +23187,19 @@ var criteriaPrompt = (unanswered, unmet) => [
|
|
|
23181
23187
|
|
|
23182
23188
|
`);
|
|
23183
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.";
|
|
23184
23191
|
var reproducePrompt = (task) => [
|
|
23185
23192
|
`Reproduce the bug in ${task} before anyone fixes it.`,
|
|
23186
|
-
"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
|
|
23187
23195
|
].join(`
|
|
23188
23196
|
|
|
23189
23197
|
`);
|
|
23190
23198
|
var reproducedOnBranchPrompt = (task) => [
|
|
23191
23199
|
`An earlier Run already worked on fixing the bug in ${task}, on this branch.`,
|
|
23192
|
-
"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
|
|
23193
|
-
"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
|
|
23194
23203
|
].join(`
|
|
23195
23204
|
|
|
23196
23205
|
`);
|
|
@@ -23244,7 +23253,10 @@ var rally = (input) => gen2(function* () {
|
|
|
23244
23253
|
return yield* new BuildBaseUnpinned({
|
|
23245
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`
|
|
23246
23255
|
});
|
|
23247
|
-
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
|
+
});
|
|
23248
23260
|
if (last !== undefined && last.head.tree === head.tree && rebuttals.length === 0 && onlyChecksBlock(last.settled))
|
|
23249
23261
|
return {
|
|
23250
23262
|
...last,
|
|
@@ -23303,7 +23315,7 @@ var rally = (input) => gen2(function* () {
|
|
|
23303
23315
|
});
|
|
23304
23316
|
var build2 = defineLoop({
|
|
23305
23317
|
id: "build",
|
|
23306
|
-
version: "2.
|
|
23318
|
+
version: "2.9.0",
|
|
23307
23319
|
title: "Build",
|
|
23308
23320
|
input: BuildInput,
|
|
23309
23321
|
output: BuildOutput,
|
|
@@ -23340,7 +23352,10 @@ var build2 = defineLoop({
|
|
|
23340
23352
|
prompt: input.continuing === undefined ? reproducePrompt(task) : reproducedOnBranchPrompt(task),
|
|
23341
23353
|
output: ReproducedOnBranch
|
|
23342
23354
|
}) : undefined;
|
|
23343
|
-
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;
|
|
23344
23359
|
const implemented = yield* agentWorkOnce("implement", {
|
|
23345
23360
|
agent: "implementer",
|
|
23346
23361
|
skill: "implement",
|
|
@@ -23360,6 +23375,7 @@ var build2 = defineLoop({
|
|
|
23360
23375
|
outcome,
|
|
23361
23376
|
claims: [...implemented.claims, ...criteria.map((answer) => `Criterion ${answerLine(answer)}`)],
|
|
23362
23377
|
suggested: implemented.checks ?? [],
|
|
23378
|
+
reproducing: reproduced?.check,
|
|
23363
23379
|
reviewed: input.reviewed,
|
|
23364
23380
|
earlier: input.earlier ?? []
|
|
23365
23381
|
});
|
|
@@ -23368,7 +23384,7 @@ var build2 = defineLoop({
|
|
|
23368
23384
|
head: last.head,
|
|
23369
23385
|
...base === undefined ? undefined : { base },
|
|
23370
23386
|
...last.scope === undefined ? undefined : { review: last.scope },
|
|
23371
|
-
...reproduced === undefined ? undefined : { reproducing: reproduced.check },
|
|
23387
|
+
...reproduced === undefined ? undefined : { reproducing: reproduced.check.name },
|
|
23372
23388
|
...implemented.documented === undefined ? undefined : { documented: implemented.documented },
|
|
23373
23389
|
...implemented.rollback === undefined ? undefined : { rollback: implemented.rollback }
|
|
23374
23390
|
});
|
|
@@ -28183,6 +28199,7 @@ class RunnerCapabilityRpcs extends make31(make30("PutQuestion", {
|
|
|
28183
28199
|
revision: optionalKey2(String5),
|
|
28184
28200
|
checks: optional2(ArraySchema(String5)),
|
|
28185
28201
|
suggested: optionalKey2(ArraySchema(ApprovedCheck)),
|
|
28202
|
+
extra: optionalKey2(ArraySchema(ApprovedCheck)),
|
|
28186
28203
|
rerunFailed: optionalKey2(Boolean3),
|
|
28187
28204
|
measure: optionalKey2(Struct({
|
|
28188
28205
|
base: optionalKey2(String5),
|
|
@@ -28770,6 +28787,7 @@ var runnerHost = (capabilities) => ({
|
|
|
28770
28787
|
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
28771
28788
|
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
28772
28789
|
...launch.suggested === undefined ? undefined : { suggested: launch.suggested },
|
|
28790
|
+
...launch.extra === undefined ? undefined : { extra: launch.extra },
|
|
28773
28791
|
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed },
|
|
28774
28792
|
...launch.measure === undefined ? undefined : { measure: launch.measure },
|
|
28775
28793
|
...launch.resolve === undefined ? undefined : { resolve: launch.resolve },
|
|
@@ -29002,6 +29020,7 @@ var rpcProgramPorts = (rpc, work) => {
|
|
|
29002
29020
|
...verification.revision === undefined ? undefined : { revision: verification.revision },
|
|
29003
29021
|
...verification.checks === undefined ? undefined : { checks: [...verification.checks] },
|
|
29004
29022
|
...verification.suggested === undefined ? undefined : { suggested: [...verification.suggested] },
|
|
29023
|
+
...verification.extra === undefined ? undefined : { extra: [...verification.extra] },
|
|
29005
29024
|
...verification.rerunFailed === undefined ? undefined : { rerunFailed: verification.rerunFailed },
|
|
29006
29025
|
...verification.measure === undefined ? undefined : { measure: verification.measure },
|
|
29007
29026
|
...verification.resolve === undefined ? undefined : { resolve: { revisions: [...verification.resolve.revisions] } },
|
|
@@ -31305,4 +31324,4 @@ var runKit = (config, identity, packages) => {
|
|
|
31305
31324
|
runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
|
|
31306
31325
|
};
|
|
31307
31326
|
// .kitman-build-entry.ts
|
|
31308
|
-
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
|
})
|