@outerlayer/cli 0.33.0 → 0.34.0-next.20261023233807

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 (113) hide show
  1. package/README.md +4 -1
  2. package/dist/{agent-setup-YHEW3WXB.js → agent-setup-FBAT5LGX.js} +10 -10
  3. package/dist/{artifact-link-cmd-7FYKWA7J.js → artifact-link-cmd-LWPY3V4N.js} +2 -2
  4. package/dist/{build-SEAQVLD5.js → build-LSU25G3M.js} +2 -2
  5. package/dist/{build-disk-ECTLWTPC.js → build-disk-ZDGSJLPA.js} +5 -5
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-LUPHKUFM.js → builder-QKH2HBAO.js} +4 -4
  8. package/dist/{check-XPMN4GHD.js → check-4MYU7S73.js} +32 -32
  9. package/dist/{chunk-QKNFU5GA.js → chunk-2GWMYY4M.js} +5 -5
  10. package/dist/{chunk-HLZMAJJD.js → chunk-2HCXEIJD.js} +2 -2
  11. package/dist/{chunk-VWQCYOBS.js → chunk-2UF4H4PG.js} +2 -2
  12. package/dist/{chunk-Z57X4KNC.js → chunk-3CUGPUCP.js} +2 -2
  13. package/dist/{chunk-EXZACZ2P.js → chunk-3FMARI3L.js} +1 -1
  14. package/dist/{chunk-6SPD266O.js → chunk-4H2DWORO.js} +3 -3
  15. package/dist/{chunk-EHOFFTVX.js → chunk-4V5V2HAQ.js} +2 -2
  16. package/dist/{chunk-VMIOUVJF.js → chunk-5CHRWX3K.js} +5 -5
  17. package/dist/{chunk-L6MDOEHN.js → chunk-74Q24R3B.js} +7 -7
  18. package/dist/{chunk-BLHUFOOB.js → chunk-7JETLQED.js} +12 -12
  19. package/dist/{chunk-AKZRGFGT.js → chunk-B44BFR2Q.js} +3 -3
  20. package/dist/{chunk-V673DFOL.js → chunk-B5MSDF5B.js} +4 -4
  21. package/dist/{chunk-X4JEBMYN.js → chunk-BBGVXGSO.js} +1 -1
  22. package/dist/{chunk-NIY2UBT6.js → chunk-BO42KT3D.js} +1 -1
  23. package/dist/{chunk-6CXNWKWD.js → chunk-CQRPR4WZ.js} +143 -22
  24. package/dist/{chunk-F2D5BSXS.js → chunk-EOTMDIYC.js} +1 -1
  25. package/dist/{chunk-NE63JADS.js → chunk-ES4ULBAL.js} +2 -2
  26. package/dist/{emit-demo-cmd-IQRS7BP2.js → chunk-GODAKHDD.js} +6 -35
  27. package/dist/{chunk-RZOO7X4G.js → chunk-HG6INMG3.js} +3 -3
  28. package/dist/{chunk-JEVKOZBB.js → chunk-HMCBX3PL.js} +1 -1
  29. package/dist/{chunk-7UPMYRPS.js → chunk-HUUYTDFV.js} +4 -4
  30. package/dist/{chunk-VSLJ6PPG.js → chunk-J32AF6D2.js} +5 -5
  31. package/dist/{chunk-D3EDZPJR.js → chunk-KLGYSJ3A.js} +5 -5
  32. package/dist/{chunk-4YLL2E7Y.js → chunk-KSZXJE3R.js} +12 -12
  33. package/dist/{chunk-YY3OQJ4X.js → chunk-LFBMXXE6.js} +14 -14
  34. package/dist/{chunk-MPC2UAW2.js → chunk-MECW77XP.js} +1 -1
  35. package/dist/{work-proofs-cmd-XBESDEPM.js → chunk-NYHQF6BT.js} +30 -30
  36. package/dist/{chunk-DKFUXYGD.js → chunk-OLCIPTST.js} +4 -4
  37. package/dist/{chunk-S5CNYXUA.js → chunk-OVRNGOD2.js} +4 -4
  38. package/dist/{chunk-UK4RGH46.js → chunk-SHIGGHZO.js} +2 -2
  39. package/dist/{chunk-EJL6CWSP.js → chunk-SVLFZLTE.js} +6 -6
  40. package/dist/{chunk-5M2J7B5N.js → chunk-TCGVYHII.js} +2 -2
  41. package/dist/{chunk-LYGI3T66.js → chunk-TIRHZC2M.js} +2 -2
  42. package/dist/{chunk-OGMXVPCS.js → chunk-TYBK2UCW.js} +2 -2
  43. package/dist/{chunk-FT7MUQGO.js → chunk-UF2FU3CM.js} +2 -2
  44. package/dist/{work-comment-cmd-QEZHRXC5.js → chunk-VY2FE5VT.js} +4 -24
  45. package/dist/{chunk-GO2DUPQS.js → chunk-WEUCD3J3.js} +3 -3
  46. package/dist/{chunk-KUE4V2SK.js → chunk-XFAJQZN2.js} +2 -2
  47. package/dist/{chunk-2LFWCIIE.js → chunk-XXTXM47K.js} +15 -15
  48. package/dist/{chunk-7V5GUEDU.js → chunk-Y5YCX6AL.js} +1 -1
  49. package/dist/chunk-YNJUN6BB.js +148 -0
  50. package/dist/{chunk-ZF24JN7R.js → chunk-YPCDDQFU.js} +1 -1
  51. package/dist/{chunk-7IFYI7XF.js → chunk-YQ5BEACL.js} +3 -3
  52. package/dist/{chunk-44V5SD4G.js → chunk-ZGB4ZJ5E.js} +1 -1
  53. package/dist/{chunk-YXHKCHWG.js → chunk-ZVLSYWDF.js} +1 -1
  54. package/dist/{claude-launcher-YRPW4SWA.js → claude-launcher-YXRS4EZE.js} +5 -5
  55. package/dist/{cli-65ZQJ622.js → cli-QQBC67PY.js} +132 -108
  56. package/dist/{command-QENZQGZL.js → command-27SJOFEM.js} +21 -21
  57. package/dist/{config-MVA7YTFW.js → config-7M4PJUZ5.js} +6 -6
  58. package/dist/{connect-cmd-KWXV2CGC.js → connect-cmd-XPSJT6JW.js} +8 -8
  59. package/dist/{container-start-RVH5743X.js → container-start-FDUQKTOF.js} +27 -27
  60. package/dist/{context-cleanup-A2FGVVPH.js → context-cleanup-YGWYIFFV.js} +3 -3
  61. package/dist/{context-show-cmd-6F4UF4ND.js → context-show-cmd-4HLZ6DEB.js} +9 -9
  62. package/dist/{control-plane-launch-7SOH6IMA.js → control-plane-launch-AXBWT5CC.js} +6 -6
  63. package/dist/{dist-IG2DKUJJ.js → dist-ELNMCU72.js} +2 -2
  64. package/dist/{docker-YKYQJHL2.js → docker-7XRXEGMX.js} +4 -4
  65. package/dist/{doctor-MFLM7DMY.js → doctor-Y3F7KETW.js} +22 -22
  66. package/dist/{emit-artifact-cmd-6QTTWBVN.js → emit-artifact-cmd-SX6A3N46.js} +13 -13
  67. package/dist/{emit-cmd-3FG7FEGO.js → emit-cmd-A4CB7BEC.js} +6 -6
  68. package/dist/{emit-criteria-cmd-22VVCL2W.js → emit-criteria-cmd-4LXKENTI.js} +10 -10
  69. package/dist/emit-demo-cmd-ECMS73O6.js +48 -0
  70. package/dist/{emit-finding-cmd-TXDPJFVT.js → emit-finding-cmd-K73WX2UP.js} +10 -10
  71. package/dist/{emit-result-cmd-QHJDUC7J.js → emit-result-cmd-SUQASZMD.js} +12 -12
  72. package/dist/{emit-step-cmd-TQCOLXAA.js → emit-step-cmd-5NQ6W4F3.js} +10 -10
  73. package/dist/{findings-cmd-EURKADAY.js → findings-cmd-2BOST4CX.js} +10 -10
  74. package/dist/{fleet-readiness-GXDSFTLP.js → fleet-readiness-VAKMSSWI.js} +8 -8
  75. package/dist/{governing-source-INEXO2CK.js → governing-source-NSQ5TIMO.js} +13 -13
  76. package/dist/{hook-fast-3IYSWDL4.js → hook-fast-WENTLDMA.js} +1 -1
  77. package/dist/index.js +4 -4
  78. package/dist/{init-WIHSXL74.js → init-E2N3A4MB.js} +21 -21
  79. package/dist/{init-VWJIINBC.js → init-SFZ5VUZ6.js} +21 -21
  80. package/dist/{init-cmd-3VWJUWXA.js → init-cmd-BNOWYMNA.js} +18 -18
  81. package/dist/{init-update-LFKSC6Y4.js → init-update-6QK5URLQ.js} +17 -17
  82. package/dist/{install-47Z7VNWP.js → install-E6DEU5NV.js} +7 -7
  83. package/dist/{layout-44S4OYLK.js → layout-NAPG4SX2.js} +4 -4
  84. package/dist/{login-browser-BJZYKWHF.js → login-browser-DQ6YRXUB.js} +2 -2
  85. package/dist/{loop-5QV4VZOF.js → loop-6RHTIIIE.js} +32 -32
  86. package/dist/{machine-XTSUAX3K.js → machine-OYI4ZWQS.js} +21 -21
  87. package/dist/{machine-skills-GOKW3U5N.js → machine-skills-2TT3RXMJ.js} +4 -4
  88. package/dist/{runner-env-ILP6BAC2.js → runner-env-EKBC5EYE.js} +8 -8
  89. package/dist/{runner-identity-MF3AYBR6.js → runner-identity-KN4CW5VQ.js} +4 -4
  90. package/dist/{runner-key-N4IIFMUX.js → runner-key-W6KG4QD7.js} +21 -21
  91. package/dist/{session-sender-2DYAJIMM.js → session-sender-Q7I6NUJU.js} +13 -13
  92. package/dist/{spec-cmd-7W4ERDL7.js → spec-cmd-3RWLOGZW.js} +11 -11
  93. package/dist/{starter-pack-FWTXE6XB.js → starter-pack-5D4BANFU.js} +5 -5
  94. package/dist/{status-VBUCLDN5.js → status-G26SS4VW.js} +26 -26
  95. package/dist/{sync-cmd-NGX2PGIW.js → sync-cmd-2W5F23IM.js} +12 -12
  96. package/dist/{watch-ZIWZVU3Z.js → watch-QW4LMB23.js} +12 -12
  97. package/dist/{work-claim-cmd-G3DC5LJK.js → work-claim-cmd-D2VABY7U.js} +16 -16
  98. package/dist/{work-cmd-J2LJ3V4A.js → work-cmd-FVDCWSPE.js} +10 -10
  99. package/dist/work-comment-cmd-RW7FZBBH.js +33 -0
  100. package/dist/{work-demo-cmd-A7XE4NKA.js → work-demo-cmd-M5NL3IPF.js} +10 -10
  101. package/dist/{work-logs-cmd-UA5PAXRP.js → work-logs-cmd-KUG5JARJ.js} +10 -10
  102. package/dist/{work-open-pr-cmd-ZYKNAJJM.js → work-open-pr-cmd-HSVGGLFC.js} +11 -11
  103. package/dist/{work-pr-cmd-DH43AH3V.js → work-pr-cmd-KBHTEAIT.js} +10 -10
  104. package/dist/work-proofs-cmd-A6QNVO6B.js +34 -0
  105. package/dist/work-proofs-init-QB2UL3BC.js +35 -0
  106. package/dist/work-proofs-record-APK4VWRB.js +402 -0
  107. package/dist/{work-stop-cmd-ZDIW3MVX.js → work-stop-cmd-HSGFTRIX.js} +10 -10
  108. package/package.json +1 -1
  109. package/skill-pack/maintained/outerlayer-amend/SKILL.md +5 -5
  110. package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -3
  111. package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +30 -17
  112. package/skill-pack/maintained/outerlayer-build/references/evidence.md +17 -15
  113. package/skill-pack/maintained/outerlayer-amend/scripts/rerecord-demo.mjs +0 -187
@@ -1,46 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { WorkCommandError, resolveCredentials, getJson } from './chunk-VSLJ6PPG.js';
4
- import './chunk-IP7BIBXJ.js';
5
- import './chunk-HLZMAJJD.js';
6
- import './chunk-S5CNYXUA.js';
7
- import { sanitizeTerminal } from './chunk-MPC2UAW2.js';
8
- import { resolveRepoIdentity } from './chunk-NIY2UBT6.js';
9
- import './chunk-LYGI3T66.js';
10
- import './chunk-7V5GUEDU.js';
11
- import './chunk-G2JWZDFA.js';
3
+ import { WorkCommandError, resolveCredentials, getJson } from './chunk-J32AF6D2.js';
4
+ import { sanitizeTerminal } from './chunk-MECW77XP.js';
5
+ import { resolveRepoIdentity } from './chunk-BO42KT3D.js';
12
6
  import { C } from './chunk-ANPNT6PM.js';
13
7
  import { defaultFetch } from './chunk-6RKD7YZ6.js';
14
- import './chunk-PJDQPF5N.js';
15
- import './chunk-SOI6K5DY.js';
16
- import './chunk-PA6CK6WQ.js';
17
- import './chunk-BALIE3BA.js';
18
- import './chunk-BJ3KTMDH.js';
19
- import './chunk-44V5SD4G.js';
20
- import './chunk-5BHIBJDA.js';
21
- import './chunk-CDDED64E.js';
22
- import './chunk-RA3O54FC.js';
23
8
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
24
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
25
- import './chunk-CRB3POP4.js';
26
- import './chunk-6CXNWKWD.js';
27
- import './chunk-F2D5BSXS.js';
28
- import './chunk-VNVZDWO3.js';
29
- import './chunk-HACGUL52.js';
30
- import './chunk-MESOOLF4.js';
31
- import './chunk-Z5GEFMRW.js';
32
10
 
33
11
  createRequire(import.meta.url);
34
12
 
35
13
  // src/work-proofs-cmd.ts
14
+ function liveHead(pr) {
15
+ if (pr.state !== "open" && pr.state !== "merged" || typeof pr.headSha !== "string" || pr.headSha === "") return void 0;
16
+ return pr.headSha.toLowerCase();
17
+ }
36
18
  function classifyProofs(data, checkoutHead) {
37
19
  const heads = /* @__PURE__ */ new Set();
38
20
  if (checkoutHead !== void 0 && checkoutHead !== "") heads.add(checkoutHead.toLowerCase());
39
21
  data.pullRequests?.forEach((pr) => {
40
- if ((pr.state === "open" || pr.state === "merged") && typeof pr.headSha === "string" && pr.headSha !== "") {
41
- heads.add(pr.headSha.toLowerCase());
42
- }
22
+ const head = liveHead(pr);
23
+ if (head !== void 0) heads.add(head);
43
24
  });
25
+ return classifyProofsAt(data, heads);
26
+ }
27
+ function classifyProofsAt(data, heads) {
44
28
  const entries = [];
45
29
  for (const criterion of data.criteria?.items ?? []) {
46
30
  if (criterion.proof === null || criterion.proof === "test") continue;
@@ -61,7 +45,7 @@ function render(entries, json) {
61
45
  if (entries.length === 0) return "No criterion declares a proof other than test.";
62
46
  return entries.map((e) => `${sanitizeTerminal(e.id)} ${sanitizeTerminal(e.proof)} ${STATE_LABEL[e.state]} ${sanitizeTerminal(e.commit ?? "no commit")}`).join("\n");
63
47
  }
64
- async function runWorkProofs(opts) {
48
+ function resolveProofsItem(opts) {
65
49
  const env = opts.env ?? process.env;
66
50
  let item;
67
51
  if (opts.item !== void 0) {
@@ -75,6 +59,10 @@ async function runWorkProofs(opts) {
75
59
  if (item === void 0) {
76
60
  throw new WorkCommandError("no work item. Pass --item <number>, or set OUTERLAYER_WORK to the item's number.");
77
61
  }
62
+ return item;
63
+ }
64
+ async function runWorkProofs(opts) {
65
+ const item = resolveProofsItem(opts);
78
66
  const creds = resolveCredentials(opts);
79
67
  const { data } = await getJson(creds.url, `/v1/work-items/${item}`, creds.apiKey, creds.appId, opts.fetchImpl ?? defaultFetch);
80
68
  const body = data;
@@ -95,6 +83,18 @@ async function runWorkProofs(opts) {
95
83
  }
96
84
  async function runWorkProofsCommand(opts) {
97
85
  try {
86
+ if (opts.init) {
87
+ const { runWorkProofsInit } = await import('./work-proofs-init-QB2UL3BC.js');
88
+ await runWorkProofsInit(opts);
89
+ process.exitCode = 0;
90
+ return;
91
+ }
92
+ if (opts.record) {
93
+ const { runWorkProofsRecord } = await import('./work-proofs-record-APK4VWRB.js');
94
+ const result2 = await runWorkProofsRecord(opts);
95
+ process.exitCode = result2.exitCode;
96
+ return;
97
+ }
98
98
  const result = await runWorkProofs(opts);
99
99
  process.exitCode = result.exitCode;
100
100
  } catch (err) {
@@ -108,4 +108,4 @@ async function runWorkProofsCommand(opts) {
108
108
  }
109
109
  }
110
110
 
111
- export { classifyProofs, runWorkProofs, runWorkProofsCommand };
111
+ export { classifyProofs, classifyProofsAt, liveHead, resolveProofsItem, runWorkProofs, runWorkProofsCommand };
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-KT4CN6OU.js';
4
- import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-KUE4V2SK.js';
5
- import { skillsBaseFor } from './chunk-LYGI3T66.js';
4
+ import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-XFAJQZN2.js';
5
+ import { skillsBaseFor } from './chunk-TIRHZC2M.js';
6
6
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
7
- import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, skillDir, loadTemplateFiles, rewriteSkillPaths, restoreSkillPaths, TEMPLATE_SKILLS } from './chunk-44V5SD4G.js';
7
+ import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, skillDir, loadTemplateFiles, rewriteSkillPaths, restoreSkillPaths, TEMPLATE_SKILLS } from './chunk-ZGB4ZJ5E.js';
8
8
  import { cliInvocation } from './chunk-CRB3POP4.js';
9
- import { hasSymlinkComponent } from './chunk-ZF24JN7R.js';
9
+ import { hasSymlinkComponent } from './chunk-YPCDDQFU.js';
10
10
  import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
11
11
  import { createHash } from 'crypto';
12
12
  import { existsSync, readFileSync } from 'fs';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-MPC2UAW2.js';
4
- import { remoteLookupFailed } from './chunk-NIY2UBT6.js';
5
- import { isAgentsMdLayout } from './chunk-LYGI3T66.js';
6
- import { DEFAULT_DASHBOARD } from './chunk-7V5GUEDU.js';
3
+ import { sanitizeTerminal } from './chunk-MECW77XP.js';
4
+ import { remoteLookupFailed } from './chunk-BO42KT3D.js';
5
+ import { isAgentsMdLayout } from './chunk-TIRHZC2M.js';
6
+ import { DEFAULT_DASHBOARD } from './chunk-Y5YCX6AL.js';
7
7
  import { cliFetch, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
8
8
  import { readCloudConfig } from './chunk-PJDQPF5N.js';
9
9
  import { findGitDirs, writeRepoConnection, readRepoConnection } from './chunk-BJ3KTMDH.js';
@@ -680,11 +680,11 @@ async function missingControlPlane(cwd, sessionId, home, env) {
680
680
  const dirs = findGitDirs(cwd);
681
681
  if (dirs === void 0) return void 0;
682
682
  if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
683
- const { cleanupEarlierCopies } = await import('./context-cleanup-A2FGVVPH.js');
683
+ const { cleanupEarlierCopies } = await import('./context-cleanup-YGWYIFFV.js');
684
684
  cleanupEarlierCopies(dirs);
685
685
  }
686
686
  if (!contextPossiblyGoverned(cwd, home)) return void 0;
687
- const { governanceOf } = await import('./control-plane-launch-7SOH6IMA.js');
687
+ const { governanceOf } = await import('./control-plane-launch-AXBWT5CC.js');
688
688
  if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
689
689
  recordMissingContext(dirs, sessionId, home);
690
690
  const launcher = `${cliInvocation()} claude`;
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-MPC2UAW2.js';
4
- import { isAgentsMdLayout } from './chunk-LYGI3T66.js';
3
+ import { sanitizeTerminal } from './chunk-MECW77XP.js';
4
+ import { isAgentsMdLayout } from './chunk-TIRHZC2M.js';
5
5
  import { resolveGatewayCredentials, defaultFetch } from './chunk-6RKD7YZ6.js';
6
6
  import { versionAtLeast } from './chunk-HCVLP7XA.js';
7
7
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
- import { machineSkillsState, staleClaudeSkills } from './chunk-JEVKOZBB.js';
9
- import { AGENTS_SKILLS_BASE, skillDir, namesCore, MACHINE_SKILL_PATH, isMaintainedCopy, loadTemplateFiles } from './chunk-44V5SD4G.js';
8
+ import { machineSkillsState, staleClaudeSkills } from './chunk-HMCBX3PL.js';
9
+ import { AGENTS_SKILLS_BASE, skillDir, namesCore, MACHINE_SKILL_PATH, isMaintainedCopy, loadTemplateFiles } from './chunk-ZGB4ZJ5E.js';
10
10
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
11
11
  import { cliInvocation } from './chunk-CRB3POP4.js';
12
- import { hasSymlinkComponent } from './chunk-ZF24JN7R.js';
13
- import { emitTree, ALL_TARGET_IDS, classifyTree, splitRawFile } from './chunk-6CXNWKWD.js';
12
+ import { hasSymlinkComponent } from './chunk-YPCDDQFU.js';
13
+ import { emitTree, ALL_TARGET_IDS, classifyTree, splitRawFile } from './chunk-CQRPR4WZ.js';
14
14
  import { execFileSync } from 'child_process';
15
15
  import { existsSync, readFileSync, writeFileSync, realpathSync, readdirSync } from 'fs';
16
16
  import { join, dirname, posix, basename, isAbsolute, relative } from 'path';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-HLZMAJJD.js';
5
- import { resolveRepoIdentity } from './chunk-NIY2UBT6.js';
4
+ import { autoConnect } from './chunk-2HCXEIJD.js';
5
+ import { resolveRepoIdentity } from './chunk-BO42KT3D.js';
6
6
  import { C } from './chunk-ANPNT6PM.js';
7
7
  import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
8
8
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-44V5SD4G.js';
4
- import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-6CXNWKWD.js';
3
+ import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-ZGB4ZJ5E.js';
4
+ import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-CQRPR4WZ.js';
5
5
  import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
6
6
  import { relative, sep, join } from 'path';
7
7
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { RecipeError } from './chunk-3Z3MPR55.js';
4
- import { BUILDKIT_IMAGE } from './chunk-NE63JADS.js';
5
- import { compareVersions } from './chunk-NIY2UBT6.js';
4
+ import { BUILDKIT_IMAGE } from './chunk-ES4ULBAL.js';
5
+ import { compareVersions } from './chunk-BO42KT3D.js';
6
6
  import { ensureHostKey } from './chunk-SOI6K5DY.js';
7
7
  import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-PA6CK6WQ.js';
8
8
  import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-BALIE3BA.js';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-44V5SD4G.js';
3
+ import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-ZGB4ZJ5E.js';
4
4
  import { cliInvocation } from './chunk-CRB3POP4.js';
5
- import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-6CXNWKWD.js';
5
+ import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-CQRPR4WZ.js';
6
6
  import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
7
7
  import { join, dirname, relative, sep } from 'path';
8
8
 
@@ -1,33 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveCredentials, postJson, getJson } from './chunk-VSLJ6PPG.js';
3
+ import { resolveCredentials, postJson, getJson } from './chunk-J32AF6D2.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
- import './chunk-HLZMAJJD.js';
6
- import './chunk-S5CNYXUA.js';
7
- import { sanitizeTerminal } from './chunk-MPC2UAW2.js';
8
- import { resolveRepoIdentity } from './chunk-NIY2UBT6.js';
9
- import './chunk-LYGI3T66.js';
10
- import './chunk-7V5GUEDU.js';
11
- import './chunk-G2JWZDFA.js';
5
+ import { sanitizeTerminal } from './chunk-MECW77XP.js';
6
+ import { resolveRepoIdentity } from './chunk-BO42KT3D.js';
12
7
  import { C } from './chunk-ANPNT6PM.js';
13
8
  import { defaultFetch } from './chunk-6RKD7YZ6.js';
14
- import './chunk-PJDQPF5N.js';
15
- import './chunk-SOI6K5DY.js';
16
- import './chunk-PA6CK6WQ.js';
17
- import './chunk-BALIE3BA.js';
18
- import './chunk-BJ3KTMDH.js';
19
- import './chunk-44V5SD4G.js';
20
- import './chunk-5BHIBJDA.js';
21
- import './chunk-CDDED64E.js';
22
- import './chunk-RA3O54FC.js';
23
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
24
- import './chunk-CRB3POP4.js';
25
- import './chunk-6CXNWKWD.js';
26
- import './chunk-F2D5BSXS.js';
27
10
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
28
- import './chunk-HACGUL52.js';
29
- import './chunk-MESOOLF4.js';
30
- import './chunk-Z5GEFMRW.js';
31
11
  import { randomUUID } from 'crypto';
32
12
 
33
13
  createRequire(import.meta.url);
@@ -65,7 +45,7 @@ async function runWorkComment(opts) {
65
45
  });
66
46
  const creds = resolveCredentials({ ...opts, cwd, home, env });
67
47
  const comment = {
68
- clientCommentId: randomUUID(),
48
+ clientCommentId: opts.clientCommentId ?? randomUUID(),
69
49
  body: opts.body ?? "",
70
50
  ...opts.criterion !== void 0 ? { criterion: opts.criterion } : {},
71
51
  ...action !== void 0 ? { action } : {},
@@ -2,13 +2,13 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-HLZMAJJD.js';
6
- import { resolveRepoIdentity } from './chunk-NIY2UBT6.js';
5
+ import { autoConnect } from './chunk-2HCXEIJD.js';
6
+ import { resolveRepoIdentity } from './chunk-BO42KT3D.js';
7
7
  import { C } from './chunk-ANPNT6PM.js';
8
8
  import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
9
9
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
- import { CriteriaListSchema } from './chunk-F2D5BSXS.js';
11
+ import { CriteriaListSchema } from './chunk-EOTMDIYC.js';
12
12
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
13
13
  import { readFileSync } from 'fs';
14
14
 
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-ANPNT6PM.js';
4
- import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-44V5SD4G.js';
4
+ import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-ZGB4ZJ5E.js';
5
5
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
6
6
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
7
7
  import { cliInvocation } from './chunk-CRB3POP4.js';
8
- import { linkedAgentsPath } from './chunk-ZF24JN7R.js';
8
+ import { linkedAgentsPath } from './chunk-YPCDDQFU.js';
9
9
  import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
10
10
  import { join, dirname } from 'path';
11
11
 
@@ -4,30 +4,30 @@ import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk
4
4
  import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-HVRQQOMH.js';
5
5
  import { writeDockerClientConfig } from './chunk-6LBSAW6I.js';
6
6
  import { zodProblem } from './chunk-I3LTIAOR.js';
7
- import { senderPidfile } from './chunk-7IFYI7XF.js';
8
- import { installScrubContext } from './chunk-D3EDZPJR.js';
9
- import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, stopJailed, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-4YLL2E7Y.js';
10
- import { readBranchHead, fetchCommit, diffBetween } from './chunk-YXHKCHWG.js';
7
+ import { senderPidfile } from './chunk-YQ5BEACL.js';
8
+ import { installScrubContext } from './chunk-KLGYSJ3A.js';
9
+ import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, stopJailed, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-KSZXJE3R.js';
10
+ import { readBranchHead, fetchCommit, diffBetween } from './chunk-ZVLSYWDF.js';
11
11
  import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
12
12
  import { waitForAgent, vmExecArgs } from './chunk-5THSC6BD.js';
13
13
  import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-L26V6ILJ.js';
14
- import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, WORKFLOW_PERMISSION_REASON, keptContextTree } from './chunk-Z57X4KNC.js';
15
- import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-VWQCYOBS.js';
16
- import { DEFAULT_CACHE_DISK, formatBytes, allocatedBytes } from './chunk-X4JEBMYN.js';
17
- import { parseSize, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-OGMXVPCS.js';
18
- import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-NE63JADS.js';
19
- import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-VSLJ6PPG.js';
20
- import { planArtifactUpload } from './chunk-MPC2UAW2.js';
21
- import { scrubText } from './chunk-NIY2UBT6.js';
14
+ import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, WORKFLOW_PERMISSION_REASON, keptContextTree } from './chunk-3CUGPUCP.js';
15
+ import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-2UF4H4PG.js';
16
+ import { DEFAULT_CACHE_DISK, formatBytes, allocatedBytes } from './chunk-BBGVXGSO.js';
17
+ import { parseSize, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-TYBK2UCW.js';
18
+ import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-ES4ULBAL.js';
19
+ import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-J32AF6D2.js';
20
+ import { planArtifactUpload } from './chunk-MECW77XP.js';
21
+ import { scrubText } from './chunk-BO42KT3D.js';
22
22
  import { readCloudConfig } from './chunk-PJDQPF5N.js';
23
23
  import { signerFor } from './chunk-SOI6K5DY.js';
24
24
  import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-PA6CK6WQ.js';
25
25
  import { JOB_MOUNT, claudeCredential, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, buildMavenSettingsXml, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, MAVEN_SETTINGS_FILE, checkEnvironment, EVAL_INPUT_DIR } from './chunk-BALIE3BA.js';
26
- import { resolvePackRoot } from './chunk-44V5SD4G.js';
26
+ import { resolvePackRoot } from './chunk-ZGB4ZJ5E.js';
27
27
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
28
28
  import { resolveVersion } from './chunk-RA3O54FC.js';
29
- import { parsePolicy } from './chunk-6CXNWKWD.js';
30
- import { CheckItemsSchema, CHECK_ITEM_REASON_MAX_LENGTH } from './chunk-F2D5BSXS.js';
29
+ import { parsePolicy } from './chunk-CQRPR4WZ.js';
30
+ import { CheckItemsSchema, CHECK_ITEM_REASON_MAX_LENGTH } from './chunk-EOTMDIYC.js';
31
31
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
32
32
  import { fdName } from './chunk-HACGUL52.js';
33
33
  import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON } from './chunk-MESOOLF4.js';
@@ -5,7 +5,7 @@ import { C } from './chunk-ANPNT6PM.js';
5
5
  import { readCloudConfigStrict, CloudConfigError, readCloudConfig, writeCloudConfig, cloudConfigPath } from './chunk-PJDQPF5N.js';
6
6
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
7
7
  import { cliInvocation } from './chunk-CRB3POP4.js';
8
- import { CLI_LOGIN_MACHINE_NAME_MAX, CliLoginPollResponseSchema, CLI_LOGIN_KIND, CliLoginRefusalSchema, CliLoginStartedSchema } from './chunk-F2D5BSXS.js';
8
+ import { CLI_LOGIN_MACHINE_NAME_MAX, CliLoginPollResponseSchema, CLI_LOGIN_KIND, CliLoginRefusalSchema, CliLoginStartedSchema } from './chunk-EOTMDIYC.js';
9
9
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
10
10
  import { generateKeyPairSync, privateDecrypt, constants, createPrivateKey } from 'crypto';
11
11
  import { spawn } from 'child_process';
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { liveHead, resolveProofsItem, classifyProofsAt } from './chunk-NYHQF6BT.js';
4
+ import { WorkCommandError, resolveCredentials, getJson } from './chunk-J32AF6D2.js';
5
+ import { resolveRepoIdentity } from './chunk-BO42KT3D.js';
6
+ import { defaultFetch } from './chunk-6RKD7YZ6.js';
7
+ import { renderProofRecipe, renderProofSetup } from './chunk-CQRPR4WZ.js';
8
+ import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-EOTMDIYC.js';
9
+ import { realpathSync, existsSync, mkdirSync, writeFileSync } from 'fs';
10
+ import { join, isAbsolute, resolve, relative } from 'path';
11
+ import { createHash } from 'crypto';
12
+
13
+ createRequire(import.meta.url);
14
+ var DEMO_PROOFS = /* @__PURE__ */ new Set(["screenshot", "video"]);
15
+ var KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
16
+ function recipeKeyFor(trackerKey) {
17
+ const hash = trackerKey.lastIndexOf("#");
18
+ const key = hash === -1 ? trackerKey : trackerKey.slice(hash + 1);
19
+ return KEY_PATTERN.test(key) ? key : void 0;
20
+ }
21
+ function buildRecipe(entries) {
22
+ const run = [];
23
+ if (entries.some((entry) => DEMO_PROOFS.has(entry.proof))) run.push({ command: "", emit: "demo" });
24
+ for (const entry of entries) {
25
+ if (!DEMO_PROOFS.has(entry.proof)) run.push({ command: "", emit: "", for: entry.id });
26
+ }
27
+ return { run, manual: [] };
28
+ }
29
+ function planEntries(recipe, states) {
30
+ const stateOf = new Map(states.map((state) => [state.id, state.state]));
31
+ const named = /* @__PURE__ */ new Set([...recipe.run.flatMap((entry) => entry.for === void 0 ? [] : [entry.for]), ...recipe.manual.map((entry) => entry.criterion)]);
32
+ return recipe.run.map((entry) => {
33
+ const criteria = entry.emit === "demo" ? states.filter((state) => DEMO_PROOFS.has(state.proof) && !named.has(state.id)).map((state) => state.id) : [entry.for];
34
+ if (criteria.length === 0) return { entry, criteria, skip: "empty" };
35
+ const current = criteria.every((id) => stateOf.get(id) === "current");
36
+ return { entry, criteria, skip: current ? "current" : null };
37
+ });
38
+ }
39
+ function checkEmitPath(root, emit) {
40
+ if (emit === "") return { ok: false, reason: "the entry has no emit path" };
41
+ if (isAbsolute(emit)) return { ok: false, reason: `the emit path "${emit}" is outside the repository: it is absolute` };
42
+ const path = resolve(root, emit);
43
+ const from = relative(root, path);
44
+ if (from === "" || from === ".." || from.startsWith("../") || isAbsolute(from)) {
45
+ return { ok: false, reason: `the emit path "${emit}" is outside the repository` };
46
+ }
47
+ return { ok: true, path };
48
+ }
49
+ function insideRoot(root, path) {
50
+ try {
51
+ const from = relative(realpathSync(root), realpathSync(path));
52
+ return from !== "" && from !== ".." && !from.startsWith("../") && !isAbsolute(from);
53
+ } catch {
54
+ return false;
55
+ }
56
+ }
57
+ function kindProblem(declared, file) {
58
+ if (declared === null) return void 0;
59
+ if (declared === "test") return "a test proof is recorded by CI, not by a recipe";
60
+ const kind = inferArtifactKind(mediaTypeForArtifactPath(file));
61
+ return kind === declared ? void 0 : `the file is a ${kind}, but the criterion declares a ${declared} proof`;
62
+ }
63
+ function proofsCommentBody(head, lines) {
64
+ const header = `These proofs are not current at ${head.slice(0, 7)}:`;
65
+ const rows = lines.map((line) => `- ${line.id} (${line.proof}): ${line.reason}`);
66
+ const fits = (count2) => {
67
+ const left = rows.length - count2;
68
+ return [header, ...rows.slice(0, count2), ...left > 0 ? [`and ${left} more.`] : []].join("\n");
69
+ };
70
+ let count = rows.length;
71
+ while (count > 0 && fits(count).length > WORK_ITEM_COMMENT_MAX_BODY_LENGTH) count -= 1;
72
+ return fits(count);
73
+ }
74
+ function proofsCommentId(item, head, lines) {
75
+ const list = [...lines].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0).map((line) => [line.id, line.proof, line.reason]);
76
+ const digest = createHash("sha256").update(JSON.stringify([item, head.toLowerCase(), list])).digest("hex");
77
+ return `proofs-${digest.slice(0, 32)}`;
78
+ }
79
+ function repositoryName(repository) {
80
+ return repository.replace(/\.git$/, "").split("/").filter((part) => part !== "").slice(-2).join("/").toLowerCase();
81
+ }
82
+ function ownPullRequest(pullRequests, requested, checkoutRepository) {
83
+ if (requested !== void 0) return { pr: requested };
84
+ const here = checkoutRepository === void 0 ? void 0 : repositoryName(checkoutRepository);
85
+ const open = pullRequests.filter(
86
+ (pr) => pr.state === "open" && typeof pr.prNumber === "number" && (here === void 0 || repositoryName(pr.repository ?? "") === here)
87
+ );
88
+ if (open.length > 1) return { ambiguous: open.map((pr) => pr.prNumber) };
89
+ return { pr: open[0]?.prNumber };
90
+ }
91
+
92
+ // src/work-proofs-init.ts
93
+ var PROOFS_DIR = join(".outerlayer", "proofs");
94
+ var SETUP_FILE = "setup.yaml";
95
+ function repositoryName2(repository) {
96
+ return repository.replace(/\.git$/, "").split("/").filter((part) => part !== "").slice(-2).join("/").toLowerCase();
97
+ }
98
+ function otherPullRequestHeads(pullRequests, ownPr, checkoutRepository) {
99
+ const here = checkoutRepository === void 0 ? void 0 : repositoryName2(checkoutRepository);
100
+ const heads = /* @__PURE__ */ new Set();
101
+ for (const pr of pullRequests) {
102
+ const head = liveHead(pr);
103
+ if (head === void 0) continue;
104
+ const isOwn = ownPr !== void 0 && pr.prNumber === ownPr && (here === void 0 || repositoryName2(pr.repository ?? "") === here);
105
+ if (!isOwn) heads.add(head);
106
+ }
107
+ return heads;
108
+ }
109
+ function writeOnce(path, text) {
110
+ if (existsSync(path)) return false;
111
+ mkdirSync(join(path, ".."), { recursive: true });
112
+ writeFileSync(path, text, { flag: "wx" });
113
+ return true;
114
+ }
115
+ async function runWorkProofsInit(opts) {
116
+ const item = resolveProofsItem(opts);
117
+ const cwd = opts.cwd ?? process.cwd();
118
+ const identity = resolveRepoIdentity(cwd);
119
+ if (identity.repoRoot === void 0) throw new WorkCommandError("this is not a git checkout. Run this inside the repository.");
120
+ const root = identity.repoRoot;
121
+ const creds = resolveCredentials(opts);
122
+ const { data } = await getJson(creds.url, `/v1/work-items/${item}`, creds.apiKey, creds.appId, opts.fetchImpl ?? defaultFetch);
123
+ const body = data;
124
+ const key = recipeKeyFor(body.trackerKey ?? "");
125
+ if (key === void 0) {
126
+ throw new WorkCommandError(`the item's tracker key "${body.trackerKey ?? ""}" cannot name a recipe file. Name the file by hand in ${PROOFS_DIR}.`);
127
+ }
128
+ const pullRequests = body.pullRequests ?? [];
129
+ const own = ownPullRequest(pullRequests, opts.pr, identity.gitRepo);
130
+ if ("ambiguous" in own) {
131
+ throw new WorkCommandError(`the item links several open pull requests (${own.ambiguous.map((n) => `#${n}`).join(", ")}). Pass --pr <number> to name this checkout's.`);
132
+ }
133
+ const otherHeads = otherPullRequestHeads(pullRequests, own.pr, identity.gitRepo);
134
+ const todo = classifyProofsAt(body, otherHeads).filter((entry) => entry.state !== "current");
135
+ const recipePath = join(root, PROOFS_DIR, `${key}.yaml`);
136
+ const shown = relative(root, recipePath);
137
+ const recipeWritten = writeOnce(recipePath, renderProofRecipe(buildRecipe(todo)));
138
+ const setupWritten = writeOnce(join(root, PROOFS_DIR, SETUP_FILE), renderProofSetup({ setup: [] }));
139
+ const lines = [
140
+ recipeWritten ? `Wrote ${shown} with ${todo.length} proof${todo.length === 1 ? "" : "s"} to record. Fill in each command and emit path, then commit it.` : `Kept ${shown}: it exists, so it is unchanged.`,
141
+ setupWritten ? `Wrote ${join(PROOFS_DIR, SETUP_FILE)} with an empty setup. Add the commands that start the app, then commit it.` : `Kept ${join(PROOFS_DIR, SETUP_FILE)}: it exists.`
142
+ ];
143
+ const output = lines.join("\n");
144
+ if (!opts.quiet) process.stdout.write(output + "\n");
145
+ return { output, recipePath, recipe: recipeWritten ? "written" : "kept", setup: setupWritten ? "written" : "kept" };
146
+ }
147
+
148
+ export { PROOFS_DIR, SETUP_FILE, checkEmitPath, insideRoot, kindProblem, otherPullRequestHeads, ownPullRequest, planEntries, proofsCommentBody, proofsCommentId, recipeKeyFor, runWorkProofsInit };
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { readContextManifest, removeContextManifest } from './chunk-YQR6E6OV.js';
4
4
  import { removePreCommitGuardHook } from './chunk-TUSYOL2O.js';
5
- import { CONTEXT_PIN_FILENAME } from './chunk-6CXNWKWD.js';
5
+ import { CONTEXT_PIN_FILENAME } from './chunk-CQRPR4WZ.js';
6
6
  import { execFileSync } from 'child_process';
7
7
  import { lstatSync, existsSync, unlinkSync, readdirSync, rmdirSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
8
8
  import { join, dirname, isAbsolute } from 'path';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LiveUploader } from './chunk-D3EDZPJR.js';
4
- import { CaptureDaemon } from './chunk-NIY2UBT6.js';
5
- import { spoolDir } from './chunk-UK4RGH46.js';
3
+ import { LiveUploader } from './chunk-KLGYSJ3A.js';
4
+ import { CaptureDaemon } from './chunk-BO42KT3D.js';
5
+ import { spoolDir } from './chunk-SHIGGHZO.js';
6
6
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
7
7
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
8
  import { mkdirSync, writeFileSync, rmSync } from 'fs';
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
4
4
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
5
- import { splitRawFile } from './chunk-6CXNWKWD.js';
5
+ import { splitRawFile } from './chunk-CQRPR4WZ.js';
6
6
  import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
7
7
  import { join, dirname } from 'path';
8
8
  import { fileURLToPath } from 'url';
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
3
3
  import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-F5UL23I2.js';
4
4
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
5
  import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-3Z3MPR55.js';
6
- import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, MEDIA_PINS, PLAYWRIGHT_VERSION } from './chunk-NE63JADS.js';
6
+ import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, MEDIA_PINS, PLAYWRIGHT_VERSION } from './chunk-ES4ULBAL.js';
7
7
  import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-PA6CK6WQ.js';
8
8
  import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-BALIE3BA.js';
9
9
  import { RELAY_ID, RELAY_USER } from './chunk-MESOOLF4.js';
@@ -4,12 +4,12 @@ import { sharedSkillNames } from './chunk-FGF52V4V.js';
4
4
  import { GOVERNANCE_VARIABLE, versionAtLeast, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
5
5
  export { MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
6
6
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
7
- import { setupMachineSkills } from './chunk-JEVKOZBB.js';
8
- import './chunk-44V5SD4G.js';
7
+ import { setupMachineSkills } from './chunk-HMCBX3PL.js';
8
+ import './chunk-ZGB4ZJ5E.js';
9
9
  import './chunk-CDDED64E.js';
10
10
  import './chunk-RA3O54FC.js';
11
- import './chunk-6CXNWKWD.js';
12
- import './chunk-F2D5BSXS.js';
11
+ import './chunk-CQRPR4WZ.js';
12
+ import './chunk-EOTMDIYC.js';
13
13
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
14
14
  import './chunk-Z5GEFMRW.js';
15
15
  import { spawnSync, execFileSync, spawn } from 'child_process';
@@ -252,7 +252,7 @@ async function runClaudeLauncher(args, deps = {}) {
252
252
  return 1;
253
253
  }
254
254
  } else {
255
- const { resolveLaunchPlane } = await import('./control-plane-launch-7SOH6IMA.js');
255
+ const { resolveLaunchPlane } = await import('./control-plane-launch-AXBWT5CC.js');
256
256
  const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
257
257
  if (plane.kind === "none") {
258
258
  const own2 = ownSkillsDirFor(cwd, home, [], stderr);