@kitman-sh/software-engineering 0.10.97 → 0.10.98

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
@@ -19381,6 +19381,7 @@ var PipelineStatus = Struct({
19381
19381
  runnerChecks: optionalKey2(ArraySchema(String5)),
19382
19382
  approved: optionalKey2(String5),
19383
19383
  repository: optionalKey2(String5),
19384
+ sourceBranch: optionalKey2(String5),
19384
19385
  targetBranch: optionalKey2(String5),
19385
19386
  conflicts: optionalKey2(Boolean3),
19386
19387
  needsRebase: optionalKey2(Boolean3),
@@ -20378,7 +20379,14 @@ var defaultActivities = {
20378
20379
  },
20379
20380
  transcripts: { run: () => succeed7({ runs: [] }) },
20380
20381
  changeRequestRead: {
20381
- pipeline: () => succeed7({ head: "head", status: "success", source: "forge", jobs: [], targetBranch: "main" }),
20382
+ pipeline: () => succeed7({
20383
+ head: "head",
20384
+ status: "success",
20385
+ source: "forge",
20386
+ jobs: [],
20387
+ sourceBranch: "change",
20388
+ targetBranch: "main"
20389
+ }),
20382
20390
  reviewThreads: () => succeed7({ threads: [] }),
20383
20391
  opened: () => succeed7({ changeRequests: [] }),
20384
20392
  own: () => succeed7({ changeRequests: [] })
@@ -20921,9 +20929,12 @@ class ReviewBaseUnpinned extends TaggedError3()("ReviewBaseUnpinned", {
20921
20929
  message: String5
20922
20930
  }) {
20923
20931
  }
20924
- var targetOf = (input, { base, head }) => {
20925
- if (input.changeRequestId !== undefined)
20926
- return `ChangeRequest ${input.changeRequestId} at revision ${head}: \`git diff ${base}...${head}\`, its change against its target branch as that stood when this review started. Read it with \`kitman.changeRequests.get("${input.changeRequestId}")\` through Kitman's MCP and fetch its source branch; diff exactly those commits even if either branch has moved since. If the Runner cannot fetch that revision (a fork, say), report exactly that as your only finding, a blocker, and stop.`;
20932
+ var targetOf = (input, { base, head, branches }) => {
20933
+ if (input.changeRequestId !== undefined && branches !== undefined) {
20934
+ const { source, target } = branches;
20935
+ const from = source === undefined ? "" : ` from source branch \`${source}\``;
20936
+ return `ChangeRequest ${input.changeRequestId} at revision ${head}: \`git diff ${base}...${head}\`, its change${from} into target branch \`${target}\` as that stood when this review started. This names all you need of the ChangeRequest, so look nothing up: fetch \`${source ?? head}\` and \`${target}\` from \`origin\`, and diff exactly those commits even if either branch has moved since. If the Runner cannot fetch revision ${head} (a fork, say), report exactly that as your only finding, a blocker, and stop.`;
20937
+ }
20927
20938
  if (input.files === undefined && input.approved !== undefined)
20928
20939
  return [
20929
20940
  `only what the change gained or lost since it was approved at ${input.approved}: compare \`git diff ${base}...${input.approved}\`, the change as approved, with \`git diff ${base}...${head}\`, the change now, in your checkout. The rest was reviewed and approved before.`,
@@ -20946,7 +20957,11 @@ var pinnedRange = (input) => gen2(function* () {
20946
20957
  message: `Kitman did not say which branch ChangeRequest ${input.changeRequestId} merges into, so there is no base to review against; update Kitman`
20947
20958
  });
20948
20959
  const [base = ""] = yield* resolveRevisions("pin", [`origin/${status.targetBranch}`]);
20949
- return { base, head: status.head.toLowerCase() };
20960
+ return {
20961
+ base,
20962
+ head: status.head.toLowerCase(),
20963
+ branches: { source: status.sourceBranch, target: status.targetBranch }
20964
+ };
20950
20965
  }
20951
20966
  if (input.base === undefined || input.head === undefined)
20952
20967
  return yield* new ReviewTargetMissing({ message: "Name a ChangeRequest, or both base and head revisions" });
@@ -21027,7 +21042,7 @@ var fixBrief = (changeRequestId, findings) => [
21027
21042
  `);
21028
21043
  var review_default = defineLoop({
21029
21044
  id: "review",
21030
- version: "3.6.0",
21045
+ version: "3.7.0",
21031
21046
  title: "Review",
21032
21047
  input: Input,
21033
21048
  output: Output,
@@ -27507,6 +27522,7 @@ class RunnerCapabilityRpcs extends make30(make29("PutQuestion", {
27507
27522
  runnerChecks: optionalKey2(ArraySchema(String5)),
27508
27523
  approved: optionalKey2(String5),
27509
27524
  repository: optionalKey2(String5),
27525
+ sourceBranch: optionalKey2(String5),
27510
27526
  targetBranch: optionalKey2(String5),
27511
27527
  conflicts: optionalKey2(Boolean3),
27512
27528
  needsRebase: optionalKey2(Boolean3),
@@ -30396,4 +30412,4 @@ var runKit = (config, identity, packages) => {
30396
30412
  runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
30397
30413
  };
30398
30414
  // .kitman-build-entry.ts
30399
- runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.97" }, []);
30415
+ runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.10.98" }, []);
@@ -2176,7 +2176,7 @@
2176
2176
  {
2177
2177
  "id": "review",
2178
2178
  "title": "Review",
2179
- "version": "3.6.0",
2179
+ "version": "3.7.0",
2180
2180
  "input": {
2181
2181
  "type": "object",
2182
2182
  "properties": {
@@ -3528,7 +3528,7 @@
3528
3528
  "carried": [
3529
3529
  {
3530
3530
  "name": "@kitman-sh/software-engineering",
3531
- "version": "0.10.97",
3531
+ "version": "0.10.98",
3532
3532
  "setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
3533
3533
  "loops": [
3534
3534
  "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/software-engineering",
3
- "version": "0.10.97",
3
+ "version": "0.10.98",
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.97",
20
+ "@kitman-sh/sdk": "0.10.98",
21
21
  "effect": "^4.1.2"
22
22
  },
23
23
  "kitman": {
24
24
  "bundle": "dist/bundle.js",
25
- "digest": "2459274fb05cdd90d4dc1c9d48bc85ae4ca8dc79e6444fe895a9592bd43342b0",
25
+ "digest": "e6297206d85c5a25a0025cc1e2c3b2ea76453c7b59ebb843ec1b92c6c3e85ea3",
26
26
  "protocolVersion": 5,
27
27
  "declarations": "dist/declarations.json",
28
28
  "setup": {
package/src/review.ts CHANGED
@@ -137,11 +137,20 @@ export class ReviewBaseUnpinned extends Schema.TaggedError<ReviewBaseUnpinned>()
137
137
  }) {}
138
138
 
139
139
  /** The commits a review diffs, `git diff base...head`, resolved once so every seat reads the same diff. */
140
- type Range = { readonly base: string; readonly head: string }
140
+ type Range = {
141
+ readonly base: string
142
+ readonly head: string
143
+ /** A ChangeRequest's branches, which its reviewers are told so they need not look it up. */
144
+ readonly branches?: { readonly source: string | undefined; readonly target: string }
145
+ }
146
+
147
+ const targetOf = (input: typeof Input.Type, { base, head, branches }: Range) => {
148
+ if (input.changeRequestId !== undefined && branches !== undefined) {
149
+ const { source, target } = branches
150
+ const from = source === undefined ? '' : ` from source branch \`${source}\``
141
151
 
142
- const targetOf = (input: typeof Input.Type, { base, head }: Range) => {
143
- if (input.changeRequestId !== undefined)
144
- return `ChangeRequest ${input.changeRequestId} at revision ${head}: \`git diff ${base}...${head}\`, its change against its target branch as that stood when this review started. Read it with \`kitman.changeRequests.get("${input.changeRequestId}")\` through Kitman's MCP and fetch its source branch; diff exactly those commits even if either branch has moved since. If the Runner cannot fetch that revision (a fork, say), report exactly that as your only finding, a blocker, and stop.`
152
+ return `ChangeRequest ${input.changeRequestId} at revision ${head}: \`git diff ${base}...${head}\`, its change${from} into target branch \`${target}\` as that stood when this review started. This names all you need of the ChangeRequest, so look nothing up: fetch \`${source ?? head}\` and \`${target}\` from \`origin\`, and diff exactly those commits even if either branch has moved since. If the Runner cannot fetch revision ${head} (a fork, say), report exactly that as your only finding, a blocker, and stop.`
153
+ }
145
154
 
146
155
  if (input.files === undefined && input.approved !== undefined)
147
156
  return [
@@ -176,7 +185,11 @@ const pinnedRange = (input: typeof Input.Type) =>
176
185
 
177
186
  const [base = ''] = yield* resolveRevisions('pin', [`origin/${status.targetBranch}`])
178
187
 
179
- return { base, head: status.head.toLowerCase() }
188
+ return {
189
+ base,
190
+ head: status.head.toLowerCase(),
191
+ branches: { source: status.sourceBranch, target: status.targetBranch }
192
+ }
180
193
  }
181
194
 
182
195
  if (input.base === undefined || input.head === undefined)
@@ -305,7 +318,7 @@ const fixBrief = (changeRequestId: string, findings: readonly MergedFinding[]) =
305
318
  */
306
319
  export default defineLoop({
307
320
  id: 'review',
308
- version: '3.6.0',
321
+ version: '3.7.0',
309
322
  title: 'Review',
310
323
  input: Input,
311
324
  output: Output,