@kitman-sh/software-engineering 0.52.0 → 0.53.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/dist/bundle.js +50 -11
- package/dist/declarations.json +390 -256
- package/package.json +3 -3
- package/src/build.ts +1 -0
- package/src/file-tasks.ts +1 -1
- package/src/hillclimb.ts +1 -0
- package/src/plan-review.ts +9 -4
- package/src/plan.ts +18 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitman-sh/software-engineering",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
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": "SEE LICENSE IN LICENSE.md",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"LICENSE.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@kitman-sh/sdk": "0.
|
|
22
|
+
"@kitman-sh/sdk": "0.53.0",
|
|
23
23
|
"effect": "^4.1.2"
|
|
24
24
|
},
|
|
25
25
|
"kitman": {
|
|
26
26
|
"bundle": "dist/bundle.js",
|
|
27
|
-
"digest": "
|
|
27
|
+
"digest": "85b617ff2f67ca68913602627bc0675bcc075d8c981c6bafaefea2d7a0a5574a",
|
|
28
28
|
"protocolVersion": 5,
|
|
29
29
|
"declarations": "dist/declarations.json",
|
|
30
30
|
"setup": {
|
package/src/build.ts
CHANGED
|
@@ -223,6 +223,7 @@ const build = defineLoop({
|
|
|
223
223
|
id: 'build',
|
|
224
224
|
version: '4.0.0',
|
|
225
225
|
title: 'Build',
|
|
226
|
+
intent: 'task',
|
|
226
227
|
description: 'Implements a Task or words, reviews and fixes the change, and opens a ChangeRequest with its evidence.',
|
|
227
228
|
input: BuildInput,
|
|
228
229
|
output: BuildOutput,
|
package/src/file-tasks.ts
CHANGED
|
@@ -30,7 +30,7 @@ const Output = Schema.Struct({
|
|
|
30
30
|
*/
|
|
31
31
|
export default defineLoop({
|
|
32
32
|
id: 'file-tasks',
|
|
33
|
-
version: '2.2.
|
|
33
|
+
version: '2.2.1',
|
|
34
34
|
title: 'File Tasks',
|
|
35
35
|
description: 'Files reviewed tickets as Tasks, with their blockers as dependencies.',
|
|
36
36
|
input: FileTasksInput,
|
package/src/hillclimb.ts
CHANGED
|
@@ -645,6 +645,7 @@ export default defineLoop({
|
|
|
645
645
|
id: 'hillclimb',
|
|
646
646
|
version: '2.0.0',
|
|
647
647
|
title: 'Hillclimb',
|
|
648
|
+
intent: 'task',
|
|
648
649
|
description: 'Improves a measured number one verified step at a time, keeping only the steps that prove a gain.',
|
|
649
650
|
outcome: 'performance',
|
|
650
651
|
input: Input,
|
package/src/plan-review.ts
CHANGED
|
@@ -14,13 +14,17 @@ export const ScopedTickets = planTicketsOf(
|
|
|
14
14
|
})
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
+
/** The acceptance criterion, in the ticket's words, that serves another outcome than the ticket's Promise. */
|
|
18
|
+
const criterion = Schema.optional(Schema.String)
|
|
19
|
+
|
|
17
20
|
const Concern = Schema.Struct({
|
|
18
21
|
/** The key of the ticket it is about; the whole plan when left out. */
|
|
19
22
|
ticket: Schema.optional(Schema.String),
|
|
20
|
-
concern: Reason
|
|
23
|
+
concern: Reason,
|
|
24
|
+
criterion
|
|
21
25
|
})
|
|
22
26
|
|
|
23
|
-
export const TicketConcern = Schema.Struct({ ticket: Schema.String, concern: Reason })
|
|
27
|
+
export const TicketConcern = Schema.Struct({ ticket: Schema.String, concern: Reason, criterion })
|
|
24
28
|
|
|
25
29
|
const Check = Schema.Struct({ concerns: Schema.Array(Concern) })
|
|
26
30
|
|
|
@@ -73,7 +77,7 @@ export const ticketText = (ticket: PlanTicket) =>
|
|
|
73
77
|
const checks = [
|
|
74
78
|
"Load skills({ name: 'scope-tasks' }) from the Kitman MCP, read the code the plan is about, and check every ticket for each of these:",
|
|
75
79
|
[
|
|
76
|
-
|
|
80
|
+
"- One Promise: the ticket promises one thing, and its Out of scope list names the cases it does not handle. An open-ended Promise is a concern. Every acceptance criterion serves the ticket's Promise: a criterion that serves another outcome, one that could land as its own change, is a concern that names the criterion and the ticket it belongs in, with the criterion in its words in the concern's criterion. Set criterion on such a concern and on no other.",
|
|
77
81
|
'- Size: estimate the context one agent session needs from reading the code to a verified change. 200k tokens or more is a concern; give your estimate.',
|
|
78
82
|
'- Decisions: no design decision is left to the implementer.',
|
|
79
83
|
'- Blockers: it is blocked by each ticket whose code it needs, and by no other.'
|
|
@@ -176,8 +180,9 @@ export const disputedText = (disputed: readonly DisputedConcern[]) =>
|
|
|
176
180
|
: [
|
|
177
181
|
'## Still disputed',
|
|
178
182
|
disputed
|
|
179
|
-
.flatMap(({ ticket, concern, declined }) => [
|
|
183
|
+
.flatMap(({ ticket, concern, criterion, declined }) => [
|
|
180
184
|
`- ${ticket === undefined ? '' : `${ticket}: `}${oneLine(concern)}`,
|
|
185
|
+
...(criterion === undefined ? [] : [` - Criterion of another promise: ${oneLine(criterion)}`]),
|
|
181
186
|
...(declined === undefined ? [] : [` - The planner did not act on it: ${oneLine(declined)}`])
|
|
182
187
|
])
|
|
183
188
|
.join('\n')
|
package/src/plan.ts
CHANGED
|
@@ -93,6 +93,7 @@ const ReworkedAnswer = Schema.Struct({
|
|
|
93
93
|
const Disputed = Schema.Struct({
|
|
94
94
|
ticket: Schema.optional(Schema.String),
|
|
95
95
|
concern: Schema.String,
|
|
96
|
+
criterion: Schema.optional(Schema.String),
|
|
96
97
|
declined: Schema.optional(Schema.String)
|
|
97
98
|
})
|
|
98
99
|
|
|
@@ -164,7 +165,7 @@ const onFailure = ['Retry with a steer', 'Skip it and its dependents', 'Stop her
|
|
|
164
165
|
|
|
165
166
|
const ticketRules = [
|
|
166
167
|
'Each ticket is one Build: a vertical slice an agent can implement, review and deliver as one ChangeRequest. Give it a short unique key, and list in blockedBy the keys of the tickets whose code it needs; tickets never block each other in a cycle. Set repoBindingId only when it changes another repository than the plan, keep one repository per ticket, and no cycle across repositories. Set outcome to the kind of change: feature, bug, refactor, docs, migration, investigation or performance.',
|
|
167
|
-
|
|
168
|
+
"Give each ticket its promise: one sentence that says what is true once it is done. List in its outOfScope the cases it does not handle. Two promises are two tickets. Each acceptance criterion serves its ticket's promise; a criterion for another outcome goes in another ticket.",
|
|
168
169
|
"Each acceptance criterion is something a Build can show before its ChangeRequest: a behaviour a test or a check proves. A text search is never a criterion, nor is something the code already does. Outcomes only visible after merge go under afterMerge, not under a ticket's criteria."
|
|
169
170
|
].join('\n\n')
|
|
170
171
|
|
|
@@ -449,6 +450,10 @@ export const planReviewed = step('planReviewed', {
|
|
|
449
450
|
key: ({ draft }) => String(draft.revision),
|
|
450
451
|
run: ({ draft: { plan, revision, disputed, asked }, implement }) =>
|
|
451
452
|
Effect.gen(function* () {
|
|
453
|
+
const otherPromises = new Set(
|
|
454
|
+
disputed.flatMap(entry => (entry.criterion === undefined ? [] : [entry.ticket ?? '']))
|
|
455
|
+
).size
|
|
456
|
+
|
|
452
457
|
const { answer: decision, by } = yield* ask('review', {
|
|
453
458
|
prompt: [
|
|
454
459
|
`Review revision ${revision} of the plan "${plan.title}": approve it, or request changes by commenting on what should change.`,
|
|
@@ -456,13 +461,22 @@ export const planReviewed = step('planReviewed', {
|
|
|
456
461
|
? []
|
|
457
462
|
: [
|
|
458
463
|
`The plan reviewer still disputes ${disputed.length} point${disputed.length === 1 ? '' : 's'}, listed at the end of the plan.`
|
|
464
|
+
]),
|
|
465
|
+
...(otherPromises === 0
|
|
466
|
+
? []
|
|
467
|
+
: [
|
|
468
|
+
`The plan reviewer holds that ${otherPromises} ticket(s) have an acceptance criterion of another promise, so nobody's silence approves this revision.`
|
|
459
469
|
])
|
|
460
470
|
].join(' '),
|
|
461
471
|
answer: planReviewDecision(revision),
|
|
462
472
|
recommended: PlanApproval,
|
|
463
473
|
recommendationReason: 'Approve it once the plan reads right; until then the Run waits for you.',
|
|
464
|
-
...(
|
|
465
|
-
|
|
474
|
+
...(otherPromises > 0
|
|
475
|
+
? { default: null }
|
|
476
|
+
: {
|
|
477
|
+
...(implement ? { default: PlanApproval, timeout: '1 hour' } : { default: null }),
|
|
478
|
+
unattendedAuto: PlanApproval
|
|
479
|
+
})
|
|
466
480
|
})
|
|
467
481
|
|
|
468
482
|
if ('approve' in decision)
|
|
@@ -1107,7 +1121,7 @@ const outputOfPlan = ({ plan, rejected }: Drafted, docs: Drafted['docs'], asTask
|
|
|
1107
1121
|
*/
|
|
1108
1122
|
export default defineLoop({
|
|
1109
1123
|
id: 'plan',
|
|
1110
|
-
version: '5.
|
|
1124
|
+
version: '5.1.0',
|
|
1111
1125
|
title: 'Plan',
|
|
1112
1126
|
description: 'Plans a goal into reviewed tickets and a spec, then builds them or files them as Tasks.',
|
|
1113
1127
|
input: Input,
|