@kitman-sh/software-engineering 0.10.81 → 0.10.82

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 CHANGED
@@ -20392,6 +20392,7 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
20392
20392
  step: launch.step,
20393
20393
  agent: launch.agent,
20394
20394
  prompt: launch.prompt,
20395
+ output: launch.output,
20395
20396
  ...launch.skill === undefined ? undefined : { skill: launch.skill },
20396
20397
  ...launch.secrets === undefined ? undefined : { secrets: launch.secrets },
20397
20398
  ...launch.mergeTarget === undefined ? undefined : { mergeTarget: launch.mergeTarget }
@@ -20786,6 +20787,14 @@ var changeRequestBody = (build) => [
20786
20787
 
20787
20788
  `);
20788
20789
 
20790
+ // src/text-limits.ts
20791
+ var bounded2 = (maxLength, description) => String5.check(isMaxLength(maxLength)).annotate({ description });
20792
+ var OneSentence = bounded2(300, "One sentence, at most 300 characters.");
20793
+ var ChangeRequestSummary = bounded2(3000, "At most 3,000 characters.");
20794
+ var FindingDetail = bounded2(1200, "At most 1,200 characters.");
20795
+ var ShortStatement = bounded2(400, "One or two sentences, at most 400 characters.");
20796
+ var Reason = bounded2(600, "At most 600 characters.");
20797
+
20789
20798
  // src/review.ts
20790
20799
  var buildLoop = () => ({ id: "build", input: BuildInput, output: BuildOutput });
20791
20800
  var seats = {
@@ -20820,10 +20829,11 @@ var FollowUpStatus = Literals(["fixed", "changed", "still_there"]);
20820
20829
  var FollowUp = Struct({ id: String5, status: FollowUpStatus });
20821
20830
  var SeatFinding = Struct({
20822
20831
  ...Finding.fields,
20832
+ detail: FindingDetail,
20823
20833
  approvedCode: optional2(Boolean3)
20824
20834
  });
20825
20835
  var SeatOutput = Struct({
20826
- summary: String5,
20836
+ summary: OneSentence,
20827
20837
  findings: ArraySchema(SeatFinding),
20828
20838
  verdicts: optional2(ArraySchema(RebuttalVerdict)),
20829
20839
  scope: optional2(ScopeJudgement),
@@ -21080,7 +21090,7 @@ var Drafted = Struct({
21080
21090
  });
21081
21091
  var Deployed = Struct({
21082
21092
  status: Literals(["deployed", "failed", "rolled_back", "rollback_failed", "none"]),
21083
- detail: String5
21093
+ detail: FindingDetail
21084
21094
  });
21085
21095
  var deployPrompt = (tag, previousTag) => [
21086
21096
  `Deploy the release ${tag}, which Kitman has just tagged and pushed.`,
@@ -21444,7 +21454,7 @@ var Input3 = Struct({
21444
21454
  var Output3 = ShepherdOutput;
21445
21455
  var CiFix = Struct({
21446
21456
  verdict: Literals(["fixed", "pre_existing", "flaky"]),
21447
- summary: String5
21457
+ summary: OneSentence
21448
21458
  });
21449
21459
  var Replies = Struct({
21450
21460
  replies: ArraySchema(Struct({
@@ -21484,7 +21494,7 @@ var threadLine = (thread) => [
21484
21494
  ].join(`
21485
21495
  `);
21486
21496
  var ReviewFix = Struct({
21487
- summary: String5,
21497
+ summary: OneSentence,
21488
21498
  changed: Boolean3
21489
21499
  });
21490
21500
  var findingLines2 = (findings) => findings.map((finding) => `- ${finding.id} (${finding.severity}): ${finding.detail}`).join(`
@@ -22182,7 +22192,7 @@ var BuildInput = Struct({
22182
22192
  var CriterionAnswer = Struct({
22183
22193
  criterion: String5,
22184
22194
  status: Literals(["met", "after_merge", "not_met"]),
22185
- detail: String5
22195
+ detail: ShortStatement
22186
22196
  });
22187
22197
  var Criteria = Struct({ criteria: ArraySchema(CriterionAnswer) });
22188
22198
  var SuggestedCheck = Struct({
@@ -22192,8 +22202,8 @@ var SuggestedCheck = Struct({
22192
22202
  });
22193
22203
  var Implemented = Struct({
22194
22204
  title: String5,
22195
- summary: String5,
22196
- claims: ArraySchema(String5),
22205
+ summary: ChangeRequestSummary,
22206
+ claims: ArraySchema(ShortStatement),
22197
22207
  documented: optional2(ArraySchema(String5)),
22198
22208
  rollback: optional2(String5),
22199
22209
  criteria: optional2(ArraySchema(CriterionAnswer)),
@@ -22201,16 +22211,17 @@ var Implemented = Struct({
22201
22211
  });
22202
22212
  var Reproduced = Struct({
22203
22213
  check: String5,
22204
- summary: String5
22214
+ summary: ChangeRequestSummary
22205
22215
  });
22206
22216
  var ReproducedOnBranch = Struct({
22207
22217
  ...Reproduced.fields,
22208
22218
  revision: optional2(String5)
22209
22219
  });
22220
+ var FixRebuttal = Struct({ ...Rebuttal.fields, reason: Reason });
22210
22221
  var Fixed = Struct({
22211
- summary: String5,
22212
- claims: ArraySchema(String5),
22213
- rebuttals: ArraySchema(Rebuttal)
22222
+ summary: ChangeRequestSummary,
22223
+ claims: ArraySchema(ShortStatement),
22224
+ rebuttals: ArraySchema(FixRebuttal)
22214
22225
  });
22215
22226
  var BuildOutput = Struct({
22216
22227
  changeRequest: ChangeRequestResult,
@@ -22571,7 +22582,7 @@ var Input4 = Struct({
22571
22582
  });
22572
22583
  var Done3 = Struct({
22573
22584
  status: Literals(["done", "blocked", "too_big"]),
22574
- summary: String5,
22585
+ summary: ChangeRequestSummary,
22575
22586
  changed: Boolean3,
22576
22587
  title: optional2(String5),
22577
22588
  checks: optional2(ArraySchema(SuggestedCheck))
@@ -22700,7 +22711,7 @@ var Input5 = Struct({
22700
22711
  });
22701
22712
  var Opportunity = Struct({
22702
22713
  title: String5,
22703
- detail: String5,
22714
+ detail: FindingDetail,
22704
22715
  evidence: Literals(["measured", "telemetry", "hypothesis"]),
22705
22716
  external: optional2(Boolean3)
22706
22717
  });
@@ -22711,12 +22722,12 @@ var Discovery = Struct({
22711
22722
  opportunities: ArraySchema(Opportunity)
22712
22723
  });
22713
22724
  var Harness = Struct({
22714
- summary: String5,
22725
+ summary: OneSentence,
22715
22726
  plan: MeasurePlan
22716
22727
  });
22717
22728
  var Change = Struct({
22718
22729
  status: Literals(["changed", "exhausted", "unsafe"]),
22719
- summary: String5
22730
+ summary: OneSentence
22720
22731
  });
22721
22732
  var Kept = Struct({ summary: String5, verdict: String5, reason: String5 });
22722
22733
  var Output6 = Struct({
@@ -22952,7 +22963,7 @@ var hillclimb_default = defineLoop({
22952
22963
  yield* agentWork(`fix:${round}`, {
22953
22964
  agent: "implementer",
22954
22965
  prompt: fixPrompt2(blocking),
22955
- output: Struct({ summary: String5 })
22966
+ output: Struct({ summary: OneSentence })
22956
22967
  });
22957
22968
  const fixed = yield* verify(`verify:fix:${round}`, {});
22958
22969
  if (!fixed.passed) {
@@ -23019,7 +23030,7 @@ var Input6 = Struct({
23019
23030
  autoFix: optional2(Boolean3)
23020
23031
  });
23021
23032
  var Conclusion = Struct({
23022
- summary: String5,
23033
+ summary: OneSentence,
23023
23034
  cause: String5,
23024
23035
  confidence: Literals(["high", "medium", "low"]),
23025
23036
  sources: NonEmptyArray(String5),
@@ -23689,7 +23700,7 @@ var Fix = Struct({
23689
23700
  var NextSteps = Struct({ tickets: PlanTickets });
23690
23701
  var Report = Struct({
23691
23702
  title: String5,
23692
- summary: String5,
23703
+ summary: OneSentence,
23693
23704
  findings: ArraySchema(Struct({
23694
23705
  finding: String5,
23695
23706
  basis: Literals(["observed", "read", "inferred"]),
@@ -23862,7 +23873,7 @@ var Finding2 = Struct({
23862
23873
  category: Category,
23863
23874
  kind: Literals(["memory", "task"]),
23864
23875
  lesson: String5,
23865
- detail: optional2(String5),
23876
+ detail: optional2(FindingDetail),
23866
23877
  fix: optional2(Struct({ size: Literals(["errand", "build"]), words: String5 })),
23867
23878
  citations: ArraySchema(TranscriptPoint)
23868
23879
  });
@@ -23876,9 +23887,9 @@ var Proposal2 = Struct({
23876
23887
  runIds: ArraySchema(String5)
23877
23888
  });
23878
23889
  var Output11 = Struct({
23879
- summary: String5,
23890
+ summary: OneSentence,
23880
23891
  proposals: ArraySchema(Proposal2),
23881
- leftOut: ArraySchema(Struct({ key: String5, reason: String5 })),
23892
+ leftOut: ArraySchema(Struct({ key: String5, reason: Reason })),
23882
23893
  improvements: ArraySchema(Struct({ key: String5, loop: Literals(["errand", "build"]), outcome: String5 }))
23883
23894
  });
23884
23895
  var prompt4 = (runs, days) => [
@@ -23997,7 +24008,7 @@ var Assessed = Struct({
23997
24008
  var Batched = Struct({
23998
24009
  applied: ArraySchema(String5),
23999
24010
  dropped: ArraySchema(Struct({ number: String5, reason: String5 })),
24000
- summary: String5
24011
+ summary: OneSentence
24001
24012
  });
24002
24013
  var Placed = Struct({ number: String5, title: String5, url: String5, reason: String5 });
24003
24014
  var Output12 = Struct({
@@ -24250,8 +24261,8 @@ var Tidied = Struct({
24250
24261
  improved: Boolean3,
24251
24262
  hint: optional2(Hint),
24252
24263
  title: optional2(String5),
24253
- summary: String5,
24254
- claims: ArraySchema(String5)
24264
+ summary: OneSentence,
24265
+ claims: ArraySchema(ShortStatement)
24255
24266
  });
24256
24267
  var Output13 = Struct({
24257
24268
  status: Literals(["nothing_worth_it", "reported", "planned", "opened"]),
@@ -24431,7 +24442,11 @@ What next?`,
24431
24442
 
24432
24443
  // kitman.config.ts
24433
24444
  var fallbacks = [{ harness: "pi" }];
24434
- var reviewer = { harness: "pi", model: "openai-codex/gpt-6.1-sol", fallbacks: [{ harness: "claude" }] };
24445
+ var reviewer = {
24446
+ harness: "pi",
24447
+ model: "openai-codex/gpt-6.1-sol",
24448
+ fallbacks: [{ harness: "claude", model: "opus", effort: "high" }]
24449
+ };
24435
24450
  var kitman_config_default = defineKit({
24436
24451
  loops: [
24437
24452
  build_default,
@@ -30169,4 +30184,4 @@ var runKit = (config, identity, packages) => {
30169
30184
  runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
30170
30185
  };
30171
30186
  // .kitman-build-entry.ts
30172
- runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.81" }, []);
30187
+ runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.82" }, []);
@@ -268,7 +268,9 @@
268
268
  ]
269
269
  },
270
270
  "detail": {
271
- "type": "string"
271
+ "type": "string",
272
+ "maxLength": 400,
273
+ "description": "One or two sentences, at most 400 characters."
272
274
  }
273
275
  },
274
276
  "required": [
@@ -1948,7 +1950,9 @@
1948
1950
  "type": "object",
1949
1951
  "properties": {
1950
1952
  "summary": {
1951
- "type": "string"
1953
+ "type": "string",
1954
+ "maxLength": 300,
1955
+ "description": "One sentence, at most 300 characters."
1952
1956
  },
1953
1957
  "proposals": {
1954
1958
  "type": "array",
@@ -2011,7 +2015,9 @@
2011
2015
  "type": "string"
2012
2016
  },
2013
2017
  "reason": {
2014
- "type": "string"
2018
+ "type": "string",
2019
+ "maxLength": 600,
2020
+ "description": "At most 600 characters."
2015
2021
  }
2016
2022
  },
2017
2023
  "required": [
@@ -3299,7 +3305,9 @@
3299
3305
  "effort": "high",
3300
3306
  "fallbacks": [
3301
3307
  {
3302
- "harness": "claude"
3308
+ "harness": "claude",
3309
+ "model": "opus",
3310
+ "effort": "high"
3303
3311
  }
3304
3312
  ]
3305
3313
  },
@@ -3409,7 +3417,7 @@
3409
3417
  "carried": [
3410
3418
  {
3411
3419
  "name": "@kitman-sh/software-engineering",
3412
- "version": "0.10.81",
3420
+ "version": "0.10.82",
3413
3421
  "setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
3414
3422
  "loops": [
3415
3423
  "build",
package/kitman.config.ts CHANGED
@@ -24,9 +24,14 @@ const fallbacks = [{ harness: 'pi' }]
24
24
 
25
25
  /**
26
26
  * Reviews run on Pi, off the Claude subscription, with another model family checking Opus's work; pi's `--model` is a
27
- * fuzzy pattern with no alias for the latest Sol, so it is pinned and bumped here.
27
+ * fuzzy pattern with no alias for the latest Sol, so it is pinned and bumped here. When Codex is out of quota, Opus at
28
+ * high effort reviews instead.
28
29
  */
29
- const reviewer = { harness: 'pi', model: 'openai-codex/gpt-6.1-sol', fallbacks: [{ harness: 'claude' }] }
30
+ const reviewer = {
31
+ harness: 'pi',
32
+ model: 'openai-codex/gpt-6.1-sol',
33
+ fallbacks: [{ harness: 'claude', model: 'opus', effort: 'high' as const }]
34
+ }
30
35
 
31
36
  /** Kitman's Kit for building software: its Loops, the Agents they run, and the skills those use. */
32
37
  export default defineKit({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/software-engineering",
3
- "version": "0.10.81",
3
+ "version": "0.10.82",
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.10.81",
21
- "effect": "4.1.2"
20
+ "@kitman-sh/sdk": "0.10.82",
21
+ "effect": "^4.1.2"
22
22
  },
23
23
  "kitman": {
24
24
  "bundle": "dist/bundle.js",
25
- "digest": "8b38eb9071e521d41da1abdfb4579ddbaed942e423430be8211817fafaad6280",
25
+ "digest": "828c128c0e8d48d9b8612e9fc73aca0cedaa37a4a28d319ffec70eabd5d1fe84",
26
26
  "protocolVersion": 5,
27
27
  "declarations": "dist/declarations.json",
28
28
  "setup": {
package/src/build.ts CHANGED
@@ -45,6 +45,7 @@ import {
45
45
  import review from './review'
46
46
  import shepherd from './shepherd'
47
47
  import { ShepherdOutput } from './shepherd-output'
48
+ import { ChangeRequestSummary, Reason, ShortStatement } from './text-limits'
48
49
 
49
50
  export const BuildInput = Schema.Struct({
50
51
  /** What to build, when no Task says it. */
@@ -79,7 +80,7 @@ const CriterionAnswer = Schema.Struct({
79
80
  criterion: Schema.String,
80
81
  status: Schema.Literals(['met', 'after_merge', 'not_met']),
81
82
  /** The test or file that shows it met, or why it is after merge or not met. */
82
- detail: Schema.String
83
+ detail: ShortStatement
83
84
  })
84
85
 
85
86
  type CriterionAnswer = typeof CriterionAnswer.Type
@@ -95,8 +96,8 @@ export const SuggestedCheck = Schema.Struct({
95
96
  const Implemented = Schema.Struct({
96
97
  /** The ChangeRequest's title. */
97
98
  title: Schema.String,
98
- summary: Schema.String,
99
- claims: Schema.Array(Schema.String),
99
+ summary: ChangeRequestSummary,
100
+ claims: Schema.Array(ShortStatement),
100
101
  /** The approved checks that run the documented commands, for a docs Outcome. */
101
102
  documented: Schema.optional(Schema.Array(Schema.String)),
102
103
  /** The approved check that rolls a migration back. */
@@ -110,7 +111,7 @@ const Implemented = Schema.Struct({
110
111
  const Reproduced = Schema.Struct({
111
112
  /** The approved check that reproduces the bug. */
112
113
  check: Schema.String,
113
- summary: Schema.String
114
+ summary: ChangeRequestSummary
114
115
  })
115
116
 
116
117
  /** A bug's proof; a continued Build recovers it from the branch an earlier Run left. */
@@ -120,10 +121,12 @@ const ReproducedOnBranch = Schema.Struct({
120
121
  revision: Schema.optional(Schema.String)
121
122
  })
122
123
 
124
+ const FixRebuttal = Schema.Struct({ ...Rebuttal.fields, reason: Reason })
125
+
123
126
  const Fixed = Schema.Struct({
124
- summary: Schema.String,
125
- claims: Schema.Array(Schema.String),
126
- rebuttals: Schema.Array(Rebuttal)
127
+ summary: ChangeRequestSummary,
128
+ claims: Schema.Array(ShortStatement),
129
+ rebuttals: Schema.Array(FixRebuttal)
127
130
  })
128
131
 
129
132
  export const BuildOutput = Schema.Struct({
package/src/errand.ts CHANGED
@@ -13,6 +13,7 @@ import * as Effect from 'effect/Effect'
13
13
  import * as Schema from 'effect/Schema'
14
14
  import build, { implementAdaptation, SuggestedCheck } from './build'
15
15
  import { evidenceTable } from './change-request-body'
16
+ import { ChangeRequestSummary } from './text-limits'
16
17
 
17
18
  const Input = Schema.Struct({
18
19
  /** What to just do. */
@@ -27,7 +28,7 @@ const Done = Schema.Struct({
27
28
  /** done: finished; blocked: something stopped it; too_big: it is a feature, not an errand, and nothing changed. */
28
29
  status: Schema.Literals(['done', 'blocked', 'too_big']),
29
30
  /** What it did or found, or what stopped it, for the person who asked. */
30
- summary: Schema.String,
31
+ summary: ChangeRequestSummary,
31
32
  /** Whether it changed any file. */
32
33
  changed: Schema.Boolean,
33
34
  /** The ChangeRequest's title, when it changed files. */
package/src/firewatch.ts CHANGED
@@ -3,6 +3,7 @@ import * as Effect from 'effect/Effect'
3
3
  import * as Predicate from 'effect/Predicate'
4
4
  import * as Schema from 'effect/Schema'
5
5
  import build from './build'
6
+ import { OneSentence } from './text-limits'
6
7
 
7
8
  const Input = Schema.Struct({
8
9
  /** The alert as the monitoring Connection received it. */
@@ -21,7 +22,7 @@ const Input = Schema.Struct({
21
22
  type Alert = (typeof Input.Type)['alert']
22
23
 
23
24
  const Conclusion = Schema.Struct({
24
- summary: Schema.String,
25
+ summary: OneSentence,
25
26
  cause: Schema.String,
26
27
  /** high: the evidence shows it; medium: it fits but something is unchecked; low: a best guess. */
27
28
  confidence: Schema.Literals(['high', 'medium', 'low']),
package/src/hillclimb.ts CHANGED
@@ -22,6 +22,7 @@ import * as Effect from 'effect/Effect'
22
22
  import * as Schema from 'effect/Schema'
23
23
  import { notVerifiedSection, scopeFindings } from './change-request-body'
24
24
  import review from './review'
25
+ import { FindingDetail, OneSentence } from './text-limits'
25
26
 
26
27
  const Input = Schema.Struct({
27
28
  /** What to make faster, in words; the journeys that matter most when left out. */
@@ -40,7 +41,7 @@ const Input = Schema.Struct({
40
41
 
41
42
  const Opportunity = Schema.Struct({
42
43
  title: Schema.String,
43
- detail: Schema.String,
44
+ detail: FindingDetail,
44
45
  /** measured: a number shows it; telemetry: production data shows it; hypothesis: reading the code suggests it. */
45
46
  evidence: Schema.Literals(['measured', 'telemetry', 'hypothesis']),
46
47
  /** Only another repository can make it; offered as a Task at the end, never made here. */
@@ -59,14 +60,14 @@ const Discovery = Schema.Struct({
59
60
 
60
61
  const Harness = Schema.Struct({
61
62
  /** What the benchmark exercises and why it stands for the journeys. */
62
- summary: Schema.String,
63
+ summary: OneSentence,
63
64
  plan: MeasurePlan
64
65
  })
65
66
 
66
67
  const Change = Schema.Struct({
67
68
  /** changed: one change is committed; exhausted: nothing left worth trying; unsafe: the gain would cost correctness. */
68
69
  status: Schema.Literals(['changed', 'exhausted', 'unsafe']),
69
- summary: Schema.String
70
+ summary: OneSentence
70
71
  })
71
72
 
72
73
  const Kept = Schema.Struct({ summary: Schema.String, verdict: Schema.String, reason: Schema.String })
@@ -362,7 +363,7 @@ export default defineLoop({
362
363
  yield* agentWork(`fix:${round}`, {
363
364
  agent: 'implementer',
364
365
  prompt: fixPrompt(blocking),
365
- output: Schema.Struct({ summary: Schema.String })
366
+ output: Schema.Struct({ summary: OneSentence })
366
367
  })
367
368
 
368
369
  const fixed = yield* verify(`verify:fix:${round}`, {})
package/src/hindsight.ts CHANGED
@@ -12,6 +12,7 @@ import * as Effect from 'effect/Effect'
12
12
  import * as Schema from 'effect/Schema'
13
13
  import build from './build'
14
14
  import errand from './errand'
15
+ import { FindingDetail, OneSentence, Reason } from './text-limits'
15
16
 
16
17
  const Input = Schema.Struct({
17
18
  /** How many days back to read; a week when left out. */
@@ -44,7 +45,7 @@ const Finding = Schema.Struct({
44
45
  /** The Memory's words, or the Task's title. */
45
46
  lesson: Schema.String,
46
47
  /** The Task's description. */
47
- detail: Schema.optional(Schema.String),
48
+ detail: Schema.optional(FindingDetail),
48
49
  /** How to fix the cause when a Run may start on it: an errand for a small change, a build for a feature. */
49
50
  fix: Schema.optional(Schema.Struct({ size: Schema.Literals(['errand', 'build']), words: Schema.String })),
50
51
  citations: Schema.Array(TranscriptPoint)
@@ -66,10 +67,10 @@ const Proposal = Schema.Struct({
66
67
 
67
68
  const Output = Schema.Struct({
68
69
  /** One line on what the Run found. */
69
- summary: Schema.String,
70
+ summary: OneSentence,
70
71
  proposals: Schema.Array(Proposal),
71
72
  /** Findings left out, and why. */
72
- leftOut: Schema.Array(Schema.Struct({ key: Schema.String, reason: Schema.String })),
73
+ leftOut: Schema.Array(Schema.Struct({ key: Schema.String, reason: Reason })),
73
74
  improvements: Schema.Array(
74
75
  Schema.Struct({ key: Schema.String, loop: Schema.Literals(['errand', 'build']), outcome: Schema.String })
75
76
  )
package/src/release.ts CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  } from '@kitman-sh/sdk/loop'
15
15
  import * as Effect from 'effect/Effect'
16
16
  import * as Schema from 'effect/Schema'
17
+ import { FindingDetail } from './text-limits'
17
18
 
18
19
  const Input = Schema.Struct({
19
20
  /** The tag to release; the drafting agent proposes one when left out. */
@@ -47,7 +48,7 @@ type Drafted = typeof Drafted.Type
47
48
  const Deployed = Schema.Struct({
48
49
  /** none: the repository has no `.kitman/deploy`, so the deploy is left to whatever sends the deploy Event. */
49
50
  status: Schema.Literals(['deployed', 'failed', 'rolled_back', 'rollback_failed', 'none']),
50
- detail: Schema.String
51
+ detail: FindingDetail
51
52
  })
52
53
 
53
54
  const deployPrompt = (tag: string, previousTag: string | undefined) =>
package/src/research.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { agentWork, artifact, defineLoop, LoopOutcome, note, PlanTickets } from '@kitman-sh/sdk/loop'
2
2
  import * as Effect from 'effect/Effect'
3
3
  import * as Schema from 'effect/Schema'
4
+ import { OneSentence } from './text-limits'
4
5
 
5
6
  export class ResearchQuestionMissing extends Schema.TaggedError<ResearchQuestionMissing>()('ResearchQuestionMissing', {
6
7
  message: Schema.String
@@ -28,7 +29,7 @@ const NextSteps = Schema.Struct({ tickets: PlanTickets })
28
29
  const Report = Schema.Struct({
29
30
  /** The Task's title, or a short title for the question. */
30
31
  title: Schema.String,
31
- summary: Schema.String,
32
+ summary: OneSentence,
32
33
  findings: Schema.Array(
33
34
  Schema.Struct({
34
35
  finding: Schema.String,
package/src/review.ts CHANGED
@@ -21,6 +21,7 @@ import * as Effect from 'effect/Effect'
21
21
  import * as Schema from 'effect/Schema'
22
22
  import build, { BuildInput, BuildOutput } from './build'
23
23
  import { verifyHead } from './change-request-body'
24
+ import { FindingDetail, OneSentence } from './text-limits'
24
25
 
25
26
  /** Build, by its schemas: the module imports this one, so its definition is not ready when this one loads. */
26
27
  const buildLoop = () => ({ id: 'build', input: BuildInput, output: BuildOutput })
@@ -85,13 +86,14 @@ const FollowUp = Schema.Struct({ id: Schema.String, status: FollowUpStatus })
85
86
 
86
87
  const SeatFinding = Schema.Struct({
87
88
  ...Finding.fields,
89
+ detail: FindingDetail,
88
90
  /** In a review since an approved head: the problem is in code the change already had there. */
89
91
  approvedCode: Schema.optional(Schema.Boolean)
90
92
  })
91
93
 
92
94
  const SeatOutput = Schema.Struct({
93
95
  /** One sentence: can it merge, and what matters most. */
94
- summary: Schema.String,
96
+ summary: OneSentence,
95
97
  findings: Schema.Array(SeatFinding),
96
98
  verdicts: Schema.optional(Schema.Array(RebuttalVerdict)),
97
99
  scope: Schema.optional(ScopeJudgement),
package/src/shepherd.ts CHANGED
@@ -34,6 +34,7 @@ import release from './release'
34
34
  import { verifyHead } from './change-request-body'
35
35
  import review, { ReviewInput, ReviewOutput } from './review'
36
36
  import { ShepherdOutput } from './shepherd-output'
37
+ import { OneSentence } from './text-limits'
37
38
 
38
39
  /** Review, by its schemas: Build calls this Loop and Review calls Build, so Review's definition may not be ready yet. */
39
40
  const reviewLoop = () => ({ id: 'review', input: ReviewInput, output: ReviewOutput })
@@ -73,7 +74,7 @@ type Output = typeof Output.Type
73
74
  const CiFix = Schema.Struct({
74
75
  /** fixed: a commit fixes the branch's own failure; pre_existing: it fails on the target branch too; flaky: it passed on its rerun. */
75
76
  verdict: Schema.Literals(['fixed', 'pre_existing', 'flaky']),
76
- summary: Schema.String
77
+ summary: OneSentence
77
78
  })
78
79
 
79
80
  const Replies = Schema.Struct({
@@ -143,7 +144,7 @@ const threadLine = (thread: ReviewThreads['threads'][number]) =>
143
144
  ].join('\n')
144
145
 
145
146
  const ReviewFix = Schema.Struct({
146
- summary: Schema.String,
147
+ summary: OneSentence,
147
148
  /** Whether it left a change for Kitman to push. */
148
149
  changed: Schema.Boolean
149
150
  })
package/src/sweep.ts CHANGED
@@ -18,6 +18,7 @@ import * as Effect from 'effect/Effect'
18
18
  import * as Schema from 'effect/Schema'
19
19
  import { notVerifiedSection, verifyHead } from './change-request-body'
20
20
  import shepherd from './shepherd'
21
+ import { OneSentence } from './text-limits'
21
22
 
22
23
  const Input = Schema.Struct({
23
24
  /** The dependency bots' logins; Renovate's and Dependabot's on GitHub when left out. */
@@ -49,7 +50,7 @@ const Batched = Schema.Struct({
49
50
  applied: Schema.Array(Schema.String),
50
51
  /** The updates taken out, each with why. */
51
52
  dropped: Schema.Array(Schema.Struct({ number: Schema.String, reason: Schema.String })),
52
- summary: Schema.String
53
+ summary: OneSentence
53
54
  })
54
55
 
55
56
  type Batched = typeof Batched.Type
@@ -0,0 +1,17 @@
1
+ import * as Schema from 'effect/Schema'
2
+
3
+ /** Text an agent writes into an Output, bounded so its brief shows the limit and Kitman refuses a longer one. */
4
+ const bounded = (maxLength: number, description: string) =>
5
+ Schema.String.check(Schema.isMaxLength(maxLength)).annotate({ description })
6
+
7
+ export const OneSentence = bounded(300, 'One sentence, at most 300 characters.')
8
+
9
+ /** A summary that becomes a ChangeRequest's description. */
10
+ export const ChangeRequestSummary = bounded(3000, 'At most 3,000 characters.')
11
+
12
+ export const FindingDetail = bounded(1200, 'At most 1,200 characters.')
13
+
14
+ /** A claim, or a criterion's answer. */
15
+ export const ShortStatement = bounded(400, 'One or two sentences, at most 400 characters.')
16
+
17
+ export const Reason = bounded(600, 'At most 600 characters.')
package/src/tidy.ts CHANGED
@@ -19,6 +19,7 @@ import * as Schema from 'effect/Schema'
19
19
  import { changeRequestBody, unsettledItems } from './change-request-body'
20
20
  import plan from './plan'
21
21
  import review from './review'
22
+ import { OneSentence, ShortStatement } from './text-limits'
22
23
 
23
24
  const Input = Schema.Struct({
24
25
  /**
@@ -68,8 +69,8 @@ const Tidied = Schema.Struct({
68
69
  improved: Schema.Boolean,
69
70
  hint: Schema.optional(Hint),
70
71
  title: Schema.optional(Schema.String),
71
- summary: Schema.String,
72
- claims: Schema.Array(Schema.String)
72
+ summary: OneSentence,
73
+ claims: Schema.Array(ShortStatement)
73
74
  })
74
75
 
75
76
  const Output = Schema.Struct({