@codyswann/lisa 4.101.8 → 4.101.10

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.
Files changed (122) hide show
  1. package/all/copy-overwrite/scripts/lib/completion-proof-github.mjs +228 -30
  2. package/all/copy-overwrite/scripts/lisa-work-item.mjs +27 -5
  3. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
  4. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  5. package/dist/core/lisa-owned-hash-ledger.js +20 -0
  6. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  7. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  8. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
  9. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  10. package/dist/core/upstream-evidence-manifest.js +20 -9
  11. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  12. package/package.json +4 -4
  13. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  14. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  15. package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  16. package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +1 -1
  17. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
  18. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/SKILL.md +1 -1
  19. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  20. package/plugins/lisa/rules/reference/tracked-work.md +1 -1
  21. package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  22. package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +1 -1
  23. package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
  24. package/plugins/lisa/skills/lisa-tracker-evidence/SKILL.md +1 -1
  25. package/plugins/lisa/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  26. package/plugins/lisa-agy/plugin.json +1 -1
  27. package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  28. package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +1 -1
  29. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
  30. package/plugins/lisa-agy/skills/lisa-tracker-evidence/SKILL.md +1 -1
  31. package/plugins/lisa-agy/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  32. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  35. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  39. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-copilot/rules/reference/tracked-work.md +1 -1
  41. package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  42. package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +1 -1
  43. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
  44. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/SKILL.md +1 -1
  45. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  46. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-cursor/rules/tracked-work-reference.mdc +1 -1
  48. package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  49. package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +1 -1
  50. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
  51. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/SKILL.md +1 -1
  52. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  53. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  55. package/plugins/lisa-devin/rules/reference/tracked-work.md +1 -1
  56. package/plugins/lisa-devin/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  57. package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +1 -1
  58. package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +1 -1
  59. package/plugins/lisa-devin/skills/lisa-tracker-evidence/SKILL.md +1 -1
  60. package/plugins/lisa-devin/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
  61. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-expo-agy/plugin.json +1 -1
  64. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  68. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  71. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  75. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  78. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  82. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  84. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  85. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  89. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  91. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  92. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  96. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  98. package/plugins/lisa-rails-agy/plugin.json +1 -1
  99. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  103. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  105. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  106. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  110. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  112. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  113. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  117. package/plugins/src/base/rules/reference/tracked-work.md +1 -1
  118. package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +10 -2
  119. package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +1 -1
  120. package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
  121. package/plugins/src/base/skills/lisa-tracker-evidence/SKILL.md +1 -1
  122. package/plugins/src/base/skills/lisa-tracker-evidence/references/completion-authorization.md +2 -2
@@ -153,6 +153,157 @@ export function isAcceptedEvidenceRelease(policy, tag) {
153
153
  );
154
154
  }
155
155
 
156
+ /** Lets gh >= 2.97 print a raw body holding terminal escape sequences. */
157
+ const ESCAPE_FLAG = "--allow-escape-sequences";
158
+ /** How gh < 2.97, which has no escape check, rejects that flag. */
159
+ const UNKNOWN_ESCAPE_FLAG = /unknown flag:? --allow-escape-sequences/;
160
+ const OCTET_STREAM = "Accept: application/octet-stream";
161
+ /** The longest stderr excerpt a read failure quotes. */
162
+ const STDERR_EXCERPT = 200;
163
+ const ESC = 0x1b;
164
+ /** Repository-relative read paths and the read each one is. */
165
+ const READ_KINDS = [
166
+ [/^releases\/assets\/\d+$/, "asset-metadata"],
167
+ [/^releases\/tags\//, "release"],
168
+ [/^releases\/\d+\/assets/, "release-assets"],
169
+ [/^collaborators\/[^/]+\/permission$/, "collaborator-permission"],
170
+ [/^compare\//, "compare"],
171
+ [/^pulls\//, "pull"],
172
+ [/^commits\//, "commit"],
173
+ [/^actions\/runs\//, "actions-run"],
174
+ [/^branches\//, "branch"],
175
+ [/^issues\/\d+\/comments/, "comments"],
176
+ [/^user$/, "user"],
177
+ ];
178
+
179
+ /**
180
+ * The endpoint a `gh api` argument vector reads: the first operand after
181
+ * `api` that is neither a flag nor a flag's value.
182
+ * @param {string[]} args - Exact `gh` argument vector.
183
+ * @returns {string} The endpoint, or "" when there is none.
184
+ */
185
+ function readPath(args) {
186
+ return (
187
+ args.find(
188
+ (value, index) =>
189
+ index > 0 &&
190
+ !value.startsWith("-") &&
191
+ !["--header", "-H"].includes(args[index - 1])
192
+ ) ?? ""
193
+ );
194
+ }
195
+
196
+ /**
197
+ * Text with terminal control removed: CSI escape sequences whole, every other
198
+ * C0/C1 control character except the newline. Scanned, not matched, so no
199
+ * control character has to appear in a pattern.
200
+ * @param {string} text - Untrusted diagnostics.
201
+ * @returns {string} The printable text and its newlines.
202
+ */
203
+ function stripControl(text) {
204
+ const kept = [];
205
+ // "text" | "escape" (just read ESC) | "csi" (inside ESC [ ... final).
206
+ // `[` is itself in the final-byte range, so the introducer must be consumed
207
+ // on its own or `ESC [31m` would leave `31m` glued to the next word.
208
+ let state = "text";
209
+ for (const character of text) {
210
+ const code = character.codePointAt(0);
211
+ if (state === "escape") {
212
+ state = code === 0x5b ? "csi" : "text";
213
+ continue;
214
+ }
215
+ if (state === "csi") {
216
+ if (code >= 0x40 && code <= 0x7e) state = "text";
217
+ continue;
218
+ }
219
+ if (code === ESC) state = "escape";
220
+ else if (code === 0x0a || (code >= 0x20 && (code < 0x7f || code > 0x9f)))
221
+ kept.push(character);
222
+ }
223
+ return kept.join("");
224
+ }
225
+
226
+ /**
227
+ * Stderr made safe to quote: control stripped, credentials redacted, first
228
+ * non-empty line only, bounded.
229
+ * @param {string} [stderr] - Raw `gh` diagnostics.
230
+ * @returns {string} One quotable line, possibly empty.
231
+ */
232
+ function quotableStderr(stderr) {
233
+ const line =
234
+ stripControl(String(stderr ?? ""))
235
+ // No word boundary: a token glued to preceding text must still redact.
236
+ .replace(/(?:gh[pousr]_|github_pat_)\w+/g, "[redacted]")
237
+ .split("\n")
238
+ .map(row => row.trim())
239
+ .find(Boolean) ?? "";
240
+ return line.length > STDERR_EXCERPT
241
+ ? `${line.slice(0, STDERR_EXCERPT)}…`
242
+ : line;
243
+ }
244
+
245
+ /**
246
+ * How a bounded `gh` run failed, or null when it completed in full.
247
+ * @param {object} result - The canonical runner's spawn result.
248
+ * @param {number} maxBuffer - The byte ceiling the read ran under.
249
+ * @returns {string|null} Exit, timeout, overflow or ceiling detail.
250
+ */
251
+ function readFailure(result, maxBuffer) {
252
+ const code = result.error?.code;
253
+ if (code === "ETIMEDOUT") return "timed out";
254
+ if (code === "ENOBUFS")
255
+ return `output exceeded the ${maxBuffer}-byte ceiling (ENOBUFS)`;
256
+ if (result.error) return `gh could not run (${code ?? result.error.message})`;
257
+ if (result.status !== 0)
258
+ return result.signal
259
+ ? `killed by ${result.signal}`
260
+ : `exit ${result.status}`;
261
+ if (Buffer.byteLength(result.stdout ?? "") > maxBuffer)
262
+ return `response exceeded the ${maxBuffer}-byte ceiling`;
263
+ return null;
264
+ }
265
+
266
+ /**
267
+ * Which read an endpoint is, for the operator.
268
+ * @param {string} target - Repository-relative endpoint ("" for the repository).
269
+ * @param {boolean} raw - Whether the read downloads raw asset bytes.
270
+ * @returns {string} A stable read kind.
271
+ */
272
+ function readKind(target, raw) {
273
+ if (raw) return "asset-download";
274
+ if (target === "") return "repository";
275
+ return READ_KINDS.find(([pattern]) => pattern.test(target))?.[1] ?? "api";
276
+ }
277
+
278
+ /**
279
+ * Name a failed read: what it was, where, and how it ended (#4773). Repository
280
+ * paths keep their ids, so the exact asset, PR or commit is identifiable.
281
+ * @param {object} read - The read that failed.
282
+ * @param {string} [read.kind] - Explicit kind, when the endpoint is ambiguous.
283
+ * @param {string[]} read.args - Exact `gh` argument vector.
284
+ * @param {string} read.root - `repos/<owner>/<repo>` of the transport.
285
+ * @param {string} read.failure - Exit, timeout, overflow or ceiling detail.
286
+ * @param {string} [read.stderr] - Raw `gh` diagnostics.
287
+ * @returns {string} One bounded, credential-free description.
288
+ */
289
+ function describeRead({ kind, args, root, failure, stderr }) {
290
+ const path = readPath(args);
291
+ const target = path.startsWith(`${root}/`)
292
+ ? path.slice(root.length + 1)
293
+ : path === root
294
+ ? ""
295
+ : path;
296
+ const http = /HTTP (\d{3})/.exec(stderr ?? "")?.[1];
297
+ const said = quotableStderr(stderr);
298
+ return [
299
+ `${kind ?? readKind(target, args.includes(OCTET_STREAM))} ${target || root}: ${failure}`,
300
+ http ? `HTTP ${http}` : "",
301
+ said ? `gh said: ${said}` : "",
302
+ ]
303
+ .filter(Boolean)
304
+ .join("; ");
305
+ }
306
+
156
307
  /** `/<owner>/<repo>/releases/download/<tag>/<asset>`, and nothing nested. */
157
308
  const DOWNLOAD_PATH = /^\/([^/]+\/[^/]+)\/releases\/download\/([^/]+)\/[^/]+$/;
158
309
 
@@ -163,24 +314,81 @@ export function githubProofTransport(run, repository, policy = {}) {
163
314
  "The implementation repository is not canonical."
164
315
  );
165
316
  const root = `repos/${repository}`;
166
- function call(args, options = {}) {
167
- const maxBuffer = options.maxBuffer ?? MAX_NATIVE_JSON_BYTES;
317
+ /**
318
+ * Run one bounded `gh` read and report, rather than throw, how it ended.
319
+ * @param {string[]} args - Exact `gh` argument vector.
320
+ * @param {object} [options] - Runner options plus an optional `kind`.
321
+ * @returns {{result: object, failure: string|null}} The run and, when it
322
+ * failed, a description naming the read.
323
+ */
324
+ function attempt(args, options = {}) {
325
+ const { kind, ...runOptions } = options;
326
+ const maxBuffer = runOptions.maxBuffer ?? MAX_NATIVE_JSON_BYTES;
168
327
  const result = run("gh", args, {
169
328
  allowFailure: true,
329
+ ...runOptions,
170
330
  maxBuffer,
171
- ...options,
172
331
  });
173
- if (
174
- result.status !== 0 ||
175
- result.error ||
176
- Buffer.byteLength(result.stdout ?? "") > maxBuffer
177
- )
332
+ const failure = readFailure(result, maxBuffer);
333
+ return {
334
+ result,
335
+ failure:
336
+ failure &&
337
+ describeRead({ kind, args, root, failure, stderr: result.stderr }),
338
+ };
339
+ }
340
+ /** The bytes of a completed read; a failed one names itself (#4773). */
341
+ function settle({ result, failure }) {
342
+ if (failure)
178
343
  throw new CompletionProofError(
179
344
  READ_ERROR,
180
- "A required GitHub completion-proof read did not complete; restore repository access and retry canonical Verify/evidence."
345
+ `A required GitHub completion-proof read did not complete (${failure}); restore repository access and retry canonical Verify/evidence.`
181
346
  );
182
347
  return result.stdout;
183
348
  }
349
+ /**
350
+ * One bounded `gh` read.
351
+ * @param {string[]} args - Exact `gh` argument vector.
352
+ * @param {object} [options] - Runner options; `kind` names the read when
353
+ * its endpoint alone does not.
354
+ * @returns {string|Buffer} The complete response.
355
+ */
356
+ function call(args, options = {}) {
357
+ return settle(attempt(args, options));
358
+ }
359
+ // gh >= 2.97 needs the flag and gh < 2.97 rejects it. Assumed supported
360
+ // until gh rejects it once; remembered for this transport's later downloads.
361
+ let escapeFlagSupported = true;
362
+ /**
363
+ * Download a release asset's raw bytes on either side of gh's
364
+ * escape-sequence check (GHSA-3m3g-3wcr-px46, gh v2.97.0). Since then
365
+ * `gh api` refuses to print a raw body holding terminal escape sequences
366
+ * without `--allow-escape-sequences`, so an ANSI-coloured test log failed
367
+ * every terminal transition on CI's gh while an older local gh, which
368
+ * rejects the flag, read it fine (CodySwannGT/lisa#4773). The bytes go to a
369
+ * Buffer and are hashed, never to a terminal, so allowing them is safe.
370
+ * @param {number} id - Native asset identifier.
371
+ * @param {number} max - Byte ceiling for this attachment.
372
+ * @returns {Buffer} The raw asset bytes.
373
+ */
374
+ function downloadAsset(id, max) {
375
+ const args = [
376
+ "api",
377
+ `${root}/releases/assets/${id}`,
378
+ "--header",
379
+ OCTET_STREAM,
380
+ ];
381
+ const options = { binary: true, maxBuffer: max };
382
+ if (escapeFlagSupported) {
383
+ const flagged = attempt([...args, ESCAPE_FLAG], options);
384
+ const rejected =
385
+ flagged.result.status !== 0 &&
386
+ UNKNOWN_ESCAPE_FLAG.test(flagged.result.stderr ?? "");
387
+ if (!rejected) return settle(flagged);
388
+ escapeFlagSupported = false;
389
+ }
390
+ return call(args, options);
391
+ }
184
392
  function json(path, paginated = false) {
185
393
  requireProof(
186
394
  path.startsWith(`${root}/`) || path === root,
@@ -202,7 +410,7 @@ export function githubProofTransport(run, repository, policy = {}) {
202
410
  if (error instanceof CompletionProofError) throw error;
203
411
  throw new CompletionProofError(
204
412
  READ_ERROR,
205
- "A required GitHub proof response is not complete JSON."
413
+ `A required GitHub proof response is not complete JSON (${describeRead({ args: ["api", path], root, failure: "unparseable response" })}).`
206
414
  );
207
415
  }
208
416
  }
@@ -296,19 +504,17 @@ export function githubProofTransport(run, repository, policy = {}) {
296
504
  row.type === "Bot" &&
297
505
  row.repository_id === repositoryId
298
506
  );
299
- const result = run(
300
- "gh",
301
- [
302
- "api",
303
- `${root}/collaborators/${encodeURIComponent(user.login)}/permission`,
304
- ],
305
- { allowFailure: true, maxBuffer: MAX_NATIVE_JSON_BYTES }
306
- );
307
- if (result.status !== 0) {
308
- if (/HTTP 404/.test(result.stderr ?? "")) return false;
507
+ const read = attempt([
508
+ "api",
509
+ `${root}/collaborators/${encodeURIComponent(user.login)}/permission`,
510
+ ]);
511
+ const { result } = read;
512
+ if (read.failure) {
513
+ if (result.status !== 0 && /HTTP 404/.test(result.stderr ?? ""))
514
+ return false;
309
515
  throw new CompletionProofError(
310
516
  READ_ERROR,
311
- "The native proof publisher's repository authority could not be read."
517
+ `The native proof publisher's repository authority could not be read (${read.failure}).`
312
518
  );
313
519
  }
314
520
  let permission;
@@ -358,15 +564,7 @@ export function githubProofTransport(run, repository, policy = {}) {
358
564
  isAcceptedEvidenceRelease(policy, download[2]),
359
565
  `The proof attachment is outside the implementation repository's accepted evidence releases (${acceptedEvidenceReleases(policy).join(", ")}).`
360
566
  );
361
- const bytes = call(
362
- [
363
- "api",
364
- `${root}/releases/assets/${id}`,
365
- "--header",
366
- "Accept: application/octet-stream",
367
- ],
368
- { binary: true, maxBuffer: max }
369
- );
567
+ const bytes = downloadAsset(id, max);
370
568
  requireProof(
371
569
  Buffer.isBuffer(bytes) && bytes.length === metadata.size,
372
570
  "The proof attachment download is incomplete."
@@ -221,6 +221,18 @@ function isIssueNumber(text) {
221
221
  /** Trailer key that carries the lane id in a commit message or PR body. */
222
222
  export const LANE_TRAILER = "Lane-Id";
223
223
 
224
+ /**
225
+ * Subcommands for which a `pending-proof` outcome is a normal, nonterminal
226
+ * result (exit 0) rather than a failure. `finish` and `complete` are one
227
+ * operation under two names (#4683), so both must be listed — a list naming
228
+ * only one would make the same outcome exit differently by spelling.
229
+ */
230
+ export const PENDING_PROOF_IS_SUCCESS_FOR = Object.freeze([
231
+ "finish",
232
+ "complete",
233
+ "sweep",
234
+ ]);
235
+
224
236
  /**
225
237
  * Environment variables consulted, in order, for the caller's owner id.
226
238
  *
@@ -5797,7 +5809,7 @@ function complete(args) {
5797
5809
  const bound = supplied ? null : boundRef();
5798
5810
  if (!supplied && !bound) {
5799
5811
  throw new TrackingError(
5800
- "complete requires --ref <work-item>, or a worktree binding from `lisa-work-item.mjs link`"
5812
+ "finish requires --ref <work-item>, or a worktree binding from `lisa-work-item.mjs link`"
5801
5813
  );
5802
5814
  }
5803
5815
  const ref = canonicalizeRef(supplied ?? bound, contract);
@@ -7134,7 +7146,17 @@ function main() {
7134
7146
  return console.log("work-item binding cleared");
7135
7147
  }
7136
7148
  if (command === "backlink") return backlink(args);
7137
- if (command === "complete") return complete(args);
7149
+ // `finish` and `complete` are one operation under two names, for the same
7150
+ // reason as `link` and `bind` above (#4683). `complete` is a bash builtin
7151
+ // that defines programmable completion from a string, and Claude Code's
7152
+ // worktree isolation refuses any command line carrying that bare token —
7153
+ // as argv[0], as this subcommand, or as an argument to a wrapper script. It
7154
+ // refused `node scripts/lisa-work-item.mjs complete --ref ... --pr-url ...`
7155
+ // on every attempt, which left a merged, verified, evidenced work item with
7156
+ // no sanctioned path to its terminal state. `finish` is the spelling the
7157
+ // docs teach; `complete` stays forever because host projects' checked-in
7158
+ // automation calls it and updates on its own schedule.
7159
+ if (command === "finish" || command === "complete") return complete(args);
7138
7160
  if (command === "sweep") return sweep(args);
7139
7161
  // One place resolves the level, and everything else asks. The CI job needs
7140
7162
  // it to decide whether a missing tracker credential is a problem, and a
@@ -7160,8 +7182,8 @@ function main() {
7160
7182
  if (command === "validate-pr") return validatePr(args);
7161
7183
  if (command === DISCHARGE_COMMAND) return dischargePrGates(args);
7162
7184
  throw new TrackingError(
7163
- "Usage: lisa-work-item.mjs link|current|attach-branch|clear|verify-level|contract-version|backlink|publish-completion-proof|evidence-release [--ensure]|complete|sweep|lane|prepare-commit-msg|validate-commit|validate-push|validate-push-destination|validate-pr|discharge-pr-gates" +
7164
- "\n(`bind` is accepted as an alias for `link`, but some agent harnesses refuse the token `bind` in a command line.)"
7185
+ "Usage: lisa-work-item.mjs link|current|attach-branch|clear|verify-level|contract-version|backlink|publish-completion-proof|evidence-release [--ensure]|finish|sweep|lane|prepare-commit-msg|validate-commit|validate-push|validate-push-destination|validate-pr|discharge-pr-gates" +
7186
+ "\n(`bind` is accepted as an alias for `link`, and `complete` is accepted as an alias for `finish`, but some agent harnesses refuse the tokens `bind` and `complete` in a command line.)"
7165
7187
  );
7166
7188
  }
7167
7189
 
@@ -7184,7 +7206,7 @@ export function runCli() {
7184
7206
  console.error(`work-item proof ${error.category}: ${detail}`);
7185
7207
  const pendingLifecycle =
7186
7208
  error.category === "pending-proof" &&
7187
- ["complete", "sweep"].includes(process.argv[2]);
7209
+ PENDING_PROOF_IS_SUCCESS_FOR.includes(process.argv[2]);
7188
7210
  process.exitCode = pendingLifecycle ? 0 : 1;
7189
7211
  return;
7190
7212
  }
@@ -119,7 +119,7 @@
119
119
  "children": []
120
120
  },
121
121
  "lib/completion-proof-github.mjs": {
122
- "sha256": "bcd6a03ad609375b886a45e7af31670b49f1bc4888de1e2f31eb86c44ad56204",
122
+ "sha256": "e8152fec3b77c3d9b79358f7972b60e4ea0d0ed32618aff614bc787875ddfb92",
123
123
  "staticImports": [
124
124
  "lib/completion-proof-shape.mjs"
125
125
  ],
@@ -1432,7 +1432,7 @@
1432
1432
  "children": []
1433
1433
  },
1434
1434
  "lisa-work-item.mjs": {
1435
- "sha256": "c4a12e7ed3036b235cac8ef02e05695d9e01dbc2bd7b78a8644a50c476a94a02",
1435
+ "sha256": "fe413e0ec7dad9d1fc5c512253de7510415bff3b82d3f06bf3f52cd2c68ef4b5",
1436
1436
  "staticImports": [
1437
1437
  "lib/completion-authorization.mjs",
1438
1438
  "lib/completion-proof-adapters.mjs",
@@ -1 +1 @@
1
- {"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAw1EjC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CACpD,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA2vEjC,CAAC"}
1
+ {"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAk2EjC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CACpD,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAqwEjC,CAAC"}
@@ -544,10 +544,12 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
544
544
  "3422df7049227eff77f3ef7bf954eeb74a63e9879b06d8126c7c3a2485b6d1f3",
545
545
  ]),
546
546
  "scripts/lib/completion-proof-github.mjs": Object.freeze([
547
+ "209f6425ed69d3e897ce2c5aa88a72ad61ad3b36af4280814413d9b6ad2ba05a",
547
548
  "4355cbc85dbc2ee174ae8727b89a24be79813b8689589a94b717ec971f4d9a15",
548
549
  "4b7f8b01ab846a7a16a4d7f66cb7731a83d4b7208aad627834df8a851a36fc32",
549
550
  "b101b6cb5da8cb8d61cc45de8d1da0699713dfd39da0dc75ddd16e726db25228",
550
551
  "bcd6a03ad609375b886a45e7af31670b49f1bc4888de1e2f31eb86c44ad56204",
552
+ "e8152fec3b77c3d9b79358f7972b60e4ea0d0ed32618aff614bc787875ddfb92",
551
553
  "e8a5b585625c2d663c0f92046d8ff020b2e769860235634cd0e4bea4b3a234ae",
552
554
  ]),
553
555
  "scripts/lib/completion-proof-markdown.mjs": Object.freeze([
@@ -2142,6 +2144,8 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2142
2144
  "fc0d92739e620d8fd70f7aa4a12d3e0b3a8f790d47c4a8322040f32c30b9445a",
2143
2145
  "fca248edcf17db19c22584ab549fb2409e57cb82fa9f8e7568890c98cd02b290",
2144
2146
  "fe064a2bd11200ed256fb36e203978f858fccbcaf40708496c066383345900ef",
2147
+ "fe413e0ec7dad9d1fc5c512253de7510415bff3b82d3f06bf3f52cd2c68ef4b5",
2148
+ "ffd5b44e89574e2e2b455e076209eeb207ba038e206e6892273a8dc2978066d8",
2145
2149
  ]),
2146
2150
  "scripts/lisa-worktree-guard.mjs": Object.freeze([
2147
2151
  "2535ef2a60b3413dacb8491c008ab28f0a07929196277d1d1fed54a04740c025",
@@ -2218,6 +2222,7 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2218
2222
  "08fce845f478d3d4a29c343b93365355c69d4aba73c035c36971e72c7861d939",
2219
2223
  "09352aa145bc81c3c5dab282c61d084cbbe5af6242d7d12303ad764fbad53de2",
2220
2224
  "09ef191f06018f4fe7ac580b94e096d6370ab5a3e816e00401597a70470ebb2b",
2225
+ "0a71d81153816c78464e765f122c49233a61a8ceb1e8584bd94697f95eb960a8",
2221
2226
  "0a76c621e15d88133f6a7f17fcad37842246f23d88f8e4ff3c954a84c6f285b2",
2222
2227
  "0b8d6e6cd22d8a2edef3437c772a7ddf7afc7e7c61e73476323da11d0972a888",
2223
2228
  "0d82401079f442dd1a617a2a85b910be321ba0badbef2120d9ad4b9cff3767bc",
@@ -2235,7 +2240,9 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2235
2240
  "2598d36cbe86a4b067bdfc966904fe3c1face600d6f70be5eea21e9e7fa72117",
2236
2241
  "25bde11dcbd1253e63af13174c00a91d731079de82f72cc27b0ca784d0fcb065",
2237
2242
  "271caef22d688dd63de6042b875ee314558ca7aff755032157a86e3e2795ad17",
2243
+ "275b142e1f94022ad0bbab5a53b9a070a3f160b5b4169c42c1f537ed1f7a6998",
2238
2244
  "29d6986ecf8b659f829517a1e0bac2ef456934633cb8e5842756abc37359d870",
2245
+ "2a5802e3f1ad42123516751b153bb242cd41fc5d7c4c478d62c3e69dd6cbc548",
2239
2246
  "2b904537d68eb957b6e90e7baacf1e2445003260ccb4a231b53a15886ec9368f",
2240
2247
  "2f891ecd469ef94e4b8e3e6a7b9463f1ad2b3a0838bbae1d8775f689c15497d1",
2241
2248
  "3026d644ae88075117650b932d5791b2228d090f00074d8ae2ec34d27a204a75",
@@ -2245,6 +2252,7 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2245
2252
  "34f4354eefbe5c2a4b1f4e87b575d63d52ec8420f03a71e5e9a0c586046aa925",
2246
2253
  "381611fa7242751ab28617797c257b5137f928c8bff1041eec0821014638fbd5",
2247
2254
  "4147c90547b1b67d1ea213fbd1e1e55917335325374e65b0ec4039311184713e",
2255
+ "4417f9e3a238be0200602d923f4b562226d231cc664b9505d6fd76285cfe5b9d",
2248
2256
  "44774fb225e22b19697907c32aa9582f0a114a3206bde1c1d95d0797994a7bef",
2249
2257
  "45bb1e58fa069e51de109e75caf55544e4652a0f5afab4c692234073bae3a7e6",
2250
2258
  "470715340b46b978c5fb2e129f952889acfc3e92a28767b849b456b2bf557c04",
@@ -2284,6 +2292,7 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2284
2292
  "901c52e08a53f0c7420ddc3308aa49e656429827770c1fd6a3f4ba8c9029d8ad",
2285
2293
  "9344207510f0c613088b4c82c9b3962a815ec79d0664886bf01f34b7a6f1f4ab",
2286
2294
  "93875fef09d764a84ce9bb255b55dc0bd02e323ba32c02a8c21b276761a79cbc",
2295
+ "95a3059275526a0993b7b38ab28c7bfec29653840737b0697f869a1dc7fca92d",
2287
2296
  "9f2be0dcbdba3b42ea89fb8ebd363daf12b6c2709fb05459a9d682ccf5d5c1c6",
2288
2297
  "a0c61991fc833118ac62449383a1ad44f3502f94b2d340176d93c654426269d8",
2289
2298
  "a114ac60b0e390ad2518bda5871aa1c9680755f10fe36ebae26de4ad170490d5",
@@ -2294,6 +2303,7 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
2294
2303
  "a9f7aff4ca32e9dafbd9f242d0253da86df5b3a38c66dd2a275aa44c14f032f2",
2295
2304
  "ab1e4e2810b47e1c14db8386cf1175bf5b58f42000f784f440cb06b4ad4bab01",
2296
2305
  "b19c9073ac69315cffb122af22b82c1c5a59ab0838a464cb54150101cec3ef30",
2306
+ "b24b4dd50b7f9b987b689578798585639993dcf7210b8f38c7b1ba82c851a0d4",
2297
2307
  "b2f392ac7eb9f645583dfbe357d608ab266c19177230b9b4420baa8975573b2c",
2298
2308
  "b45d7b88eeadaf859ac312398aa49fc7e1f1882d1b5afcf58676178ea0695b58",
2299
2309
  "b4d6534ddcaaf0693f23ff8ca20d63ef8a3f8f537a266987cd9ac901d260c7d6",
@@ -2931,10 +2941,12 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
2931
2941
  "3422df7049227eff77f3ef7bf954eeb74a63e9879b06d8126c7c3a2485b6d1f3",
2932
2942
  ]),
2933
2943
  "scripts/lib/completion-proof-github.mjs": Object.freeze([
2944
+ "209f6425ed69d3e897ce2c5aa88a72ad61ad3b36af4280814413d9b6ad2ba05a",
2934
2945
  "4355cbc85dbc2ee174ae8727b89a24be79813b8689589a94b717ec971f4d9a15",
2935
2946
  "4b7f8b01ab846a7a16a4d7f66cb7731a83d4b7208aad627834df8a851a36fc32",
2936
2947
  "b101b6cb5da8cb8d61cc45de8d1da0699713dfd39da0dc75ddd16e726db25228",
2937
2948
  "bcd6a03ad609375b886a45e7af31670b49f1bc4888de1e2f31eb86c44ad56204",
2949
+ "e8152fec3b77c3d9b79358f7972b60e4ea0d0ed32618aff614bc787875ddfb92",
2938
2950
  "e8a5b585625c2d663c0f92046d8ff020b2e769860235634cd0e4bea4b3a234ae",
2939
2951
  ]),
2940
2952
  "scripts/lib/completion-proof-markdown.mjs": Object.freeze([
@@ -4458,6 +4470,8 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4458
4470
  "fc0d92739e620d8fd70f7aa4a12d3e0b3a8f790d47c4a8322040f32c30b9445a",
4459
4471
  "fca248edcf17db19c22584ab549fb2409e57cb82fa9f8e7568890c98cd02b290",
4460
4472
  "fe064a2bd11200ed256fb36e203978f858fccbcaf40708496c066383345900ef",
4473
+ "fe413e0ec7dad9d1fc5c512253de7510415bff3b82d3f06bf3f52cd2c68ef4b5",
4474
+ "ffd5b44e89574e2e2b455e076209eeb207ba038e206e6892273a8dc2978066d8",
4461
4475
  ]),
4462
4476
  "scripts/lisa-worktree-guard.mjs": Object.freeze([
4463
4477
  "2535ef2a60b3413dacb8491c008ab28f0a07929196277d1d1fed54a04740c025",
@@ -4534,6 +4548,7 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4534
4548
  "08fce845f478d3d4a29c343b93365355c69d4aba73c035c36971e72c7861d939",
4535
4549
  "09352aa145bc81c3c5dab282c61d084cbbe5af6242d7d12303ad764fbad53de2",
4536
4550
  "09ef191f06018f4fe7ac580b94e096d6370ab5a3e816e00401597a70470ebb2b",
4551
+ "0a71d81153816c78464e765f122c49233a61a8ceb1e8584bd94697f95eb960a8",
4537
4552
  "0a76c621e15d88133f6a7f17fcad37842246f23d88f8e4ff3c954a84c6f285b2",
4538
4553
  "0b8d6e6cd22d8a2edef3437c772a7ddf7afc7e7c61e73476323da11d0972a888",
4539
4554
  "0d82401079f442dd1a617a2a85b910be321ba0badbef2120d9ad4b9cff3767bc",
@@ -4551,7 +4566,9 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4551
4566
  "2598d36cbe86a4b067bdfc966904fe3c1face600d6f70be5eea21e9e7fa72117",
4552
4567
  "25bde11dcbd1253e63af13174c00a91d731079de82f72cc27b0ca784d0fcb065",
4553
4568
  "271caef22d688dd63de6042b875ee314558ca7aff755032157a86e3e2795ad17",
4569
+ "275b142e1f94022ad0bbab5a53b9a070a3f160b5b4169c42c1f537ed1f7a6998",
4554
4570
  "29d6986ecf8b659f829517a1e0bac2ef456934633cb8e5842756abc37359d870",
4571
+ "2a5802e3f1ad42123516751b153bb242cd41fc5d7c4c478d62c3e69dd6cbc548",
4555
4572
  "2b904537d68eb957b6e90e7baacf1e2445003260ccb4a231b53a15886ec9368f",
4556
4573
  "2f891ecd469ef94e4b8e3e6a7b9463f1ad2b3a0838bbae1d8775f689c15497d1",
4557
4574
  "3026d644ae88075117650b932d5791b2228d090f00074d8ae2ec34d27a204a75",
@@ -4561,6 +4578,7 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4561
4578
  "34f4354eefbe5c2a4b1f4e87b575d63d52ec8420f03a71e5e9a0c586046aa925",
4562
4579
  "381611fa7242751ab28617797c257b5137f928c8bff1041eec0821014638fbd5",
4563
4580
  "4147c90547b1b67d1ea213fbd1e1e55917335325374e65b0ec4039311184713e",
4581
+ "4417f9e3a238be0200602d923f4b562226d231cc664b9505d6fd76285cfe5b9d",
4564
4582
  "44774fb225e22b19697907c32aa9582f0a114a3206bde1c1d95d0797994a7bef",
4565
4583
  "45bb1e58fa069e51de109e75caf55544e4652a0f5afab4c692234073bae3a7e6",
4566
4584
  "470715340b46b978c5fb2e129f952889acfc3e92a28767b849b456b2bf557c04",
@@ -4600,6 +4618,7 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4600
4618
  "901c52e08a53f0c7420ddc3308aa49e656429827770c1fd6a3f4ba8c9029d8ad",
4601
4619
  "9344207510f0c613088b4c82c9b3962a815ec79d0664886bf01f34b7a6f1f4ab",
4602
4620
  "93875fef09d764a84ce9bb255b55dc0bd02e323ba32c02a8c21b276761a79cbc",
4621
+ "95a3059275526a0993b7b38ab28c7bfec29653840737b0697f869a1dc7fca92d",
4603
4622
  "9f2be0dcbdba3b42ea89fb8ebd363daf12b6c2709fb05459a9d682ccf5d5c1c6",
4604
4623
  "a0c61991fc833118ac62449383a1ad44f3502f94b2d340176d93c654426269d8",
4605
4624
  "a114ac60b0e390ad2518bda5871aa1c9680755f10fe36ebae26de4ad170490d5",
@@ -4610,6 +4629,7 @@ export const LISA_OWNED_HASH_HISTORY_DERIVED = Object.freeze({
4610
4629
  "a9f7aff4ca32e9dafbd9f242d0253da86df5b3a38c66dd2a275aa44c14f032f2",
4611
4630
  "ab1e4e2810b47e1c14db8386cf1175bf5b58f42000f784f440cb06b4ad4bab01",
4612
4631
  "b19c9073ac69315cffb122af22b82c1c5a59ab0838a464cb54150101cec3ef30",
4632
+ "b24b4dd50b7f9b987b689578798585639993dcf7210b8f38c7b1ba82c851a0d4",
4613
4633
  "b2f392ac7eb9f645583dfbe357d608ab266c19177230b9b4420baa8975573b2c",
4614
4634
  "b45d7b88eeadaf859ac312398aa49fc7e1f1882d1b5afcf58676178ea0695b58",
4615
4635
  "b4d6534ddcaaf0693f23ff8ca20d63ef8a3f8f537a266987cd9ac901d260c7d6",