@aperant/framework 0.6.6 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +215 -0
  2. package/dist/cli/commands/check-version.d.mts.map +1 -1
  3. package/dist/cli/commands/check-version.mjs +76 -1
  4. package/dist/cli/commands/check-version.mjs.map +1 -1
  5. package/dist/cli/commands/ci-watch.d.mts.map +1 -1
  6. package/dist/cli/commands/ci-watch.mjs +73 -5
  7. package/dist/cli/commands/ci-watch.mjs.map +1 -1
  8. package/dist/cli/commands/health-check.mjs +1 -1
  9. package/dist/cli/commands/health-check.mjs.map +1 -1
  10. package/dist/cli/commands/init.d.mts +17 -1
  11. package/dist/cli/commands/init.d.mts.map +1 -1
  12. package/dist/cli/commands/init.mjs +183 -11
  13. package/dist/cli/commands/init.mjs.map +1 -1
  14. package/dist/cli/commands/release-notes.d.mts +11 -0
  15. package/dist/cli/commands/release-notes.d.mts.map +1 -0
  16. package/dist/cli/commands/release-notes.mjs +173 -0
  17. package/dist/cli/commands/release-notes.mjs.map +1 -0
  18. package/dist/cli/commands/route.d.mts.map +1 -1
  19. package/dist/cli/commands/route.mjs +37 -2
  20. package/dist/cli/commands/route.mjs.map +1 -1
  21. package/dist/cli/commands/task.d.mts.map +1 -1
  22. package/dist/cli/commands/task.mjs +48 -0
  23. package/dist/cli/commands/task.mjs.map +1 -1
  24. package/dist/cli/config/load.d.mts +14 -0
  25. package/dist/cli/config/load.d.mts.map +1 -1
  26. package/dist/cli/config/load.mjs +40 -0
  27. package/dist/cli/config/load.mjs.map +1 -1
  28. package/dist/cli/config/upgrade-gitignore.d.mts.map +1 -1
  29. package/dist/cli/config/upgrade-gitignore.mjs +6 -0
  30. package/dist/cli/config/upgrade-gitignore.mjs.map +1 -1
  31. package/dist/cli/consistency/parse-review.d.mts.map +1 -1
  32. package/dist/cli/consistency/parse-review.mjs +4 -1
  33. package/dist/cli/consistency/parse-review.mjs.map +1 -1
  34. package/dist/cli/dispatch.d.mts.map +1 -1
  35. package/dist/cli/dispatch.mjs +2 -0
  36. package/dist/cli/dispatch.mjs.map +1 -1
  37. package/dist/cli/gate/gates/review-clean.d.mts.map +1 -1
  38. package/dist/cli/gate/gates/review-clean.mjs +4 -2
  39. package/dist/cli/gate/gates/review-clean.mjs.map +1 -1
  40. package/dist/cli/help.d.mts.map +1 -1
  41. package/dist/cli/help.mjs +1 -0
  42. package/dist/cli/help.mjs.map +1 -1
  43. package/dist/cli/host/detect.d.mts +122 -9
  44. package/dist/cli/host/detect.d.mts.map +1 -1
  45. package/dist/cli/host/detect.mjs +132 -0
  46. package/dist/cli/host/detect.mjs.map +1 -1
  47. package/dist/cli/install/legacy-paths.d.mts +38 -0
  48. package/dist/cli/install/legacy-paths.d.mts.map +1 -0
  49. package/dist/cli/install/legacy-paths.mjs +69 -0
  50. package/dist/cli/install/legacy-paths.mjs.map +1 -0
  51. package/dist/cli/install/runtime-migrate.d.mts +84 -0
  52. package/dist/cli/install/runtime-migrate.d.mts.map +1 -0
  53. package/dist/cli/install/runtime-migrate.mjs +244 -0
  54. package/dist/cli/install/runtime-migrate.mjs.map +1 -0
  55. package/dist/cli/install/update-chips.d.mts +23 -0
  56. package/dist/cli/install/update-chips.d.mts.map +1 -1
  57. package/dist/cli/install/update-chips.mjs +60 -0
  58. package/dist/cli/install/update-chips.mjs.map +1 -1
  59. package/dist/cli/release-notes/compile.d.mts +38 -0
  60. package/dist/cli/release-notes/compile.d.mts.map +1 -0
  61. package/dist/cli/release-notes/compile.mjs +244 -0
  62. package/dist/cli/release-notes/compile.mjs.map +1 -0
  63. package/dist/cli/release-notes/draft.d.mts +73 -0
  64. package/dist/cli/release-notes/draft.d.mts.map +1 -0
  65. package/dist/cli/release-notes/draft.mjs +120 -0
  66. package/dist/cli/release-notes/draft.mjs.map +1 -0
  67. package/dist/cli/release-notes/output-dir.d.mts +20 -0
  68. package/dist/cli/release-notes/output-dir.d.mts.map +1 -0
  69. package/dist/cli/release-notes/output-dir.mjs +42 -0
  70. package/dist/cli/release-notes/output-dir.mjs.map +1 -0
  71. package/dist/cli/release-notes/persona-filter.d.mts +51 -0
  72. package/dist/cli/release-notes/persona-filter.d.mts.map +1 -0
  73. package/dist/cli/release-notes/persona-filter.mjs +127 -0
  74. package/dist/cli/release-notes/persona-filter.mjs.map +1 -0
  75. package/dist/cli/release-notes/publish.d.mts +23 -0
  76. package/dist/cli/release-notes/publish.d.mts.map +1 -0
  77. package/dist/cli/release-notes/publish.mjs +125 -0
  78. package/dist/cli/release-notes/publish.mjs.map +1 -0
  79. package/dist/cli/release-notes/ship-autodraft.d.mts +37 -0
  80. package/dist/cli/release-notes/ship-autodraft.d.mts.map +1 -0
  81. package/dist/cli/release-notes/ship-autodraft.mjs +97 -0
  82. package/dist/cli/release-notes/ship-autodraft.mjs.map +1 -0
  83. package/dist/cli/route/drift-detect.d.mts +20 -0
  84. package/dist/cli/route/drift-detect.d.mts.map +1 -0
  85. package/dist/cli/route/drift-detect.mjs +107 -0
  86. package/dist/cli/route/drift-detect.mjs.map +1 -0
  87. package/dist/cli/util/aperant-section.d.mts +34 -0
  88. package/dist/cli/util/aperant-section.d.mts.map +1 -0
  89. package/dist/cli/util/aperant-section.mjs +127 -0
  90. package/dist/cli/util/aperant-section.mjs.map +1 -0
  91. package/dist/cli/util/copy.d.mts +28 -1
  92. package/dist/cli/util/copy.d.mts.map +1 -1
  93. package/dist/cli/util/copy.mjs +43 -55
  94. package/dist/cli/util/copy.mjs.map +1 -1
  95. package/dist/cli/util/semver.d.mts +17 -0
  96. package/dist/cli/util/semver.d.mts.map +1 -0
  97. package/dist/cli/util/semver.mjs +29 -0
  98. package/dist/cli/util/semver.mjs.map +1 -0
  99. package/dist/cli/util/skill-installs.d.mts +65 -9
  100. package/dist/cli/util/skill-installs.d.mts.map +1 -1
  101. package/dist/cli/util/skill-installs.mjs +130 -21
  102. package/dist/cli/util/skill-installs.mjs.map +1 -1
  103. package/dist/cli/util/version-preflight.d.mts +44 -0
  104. package/dist/cli/util/version-preflight.d.mts.map +1 -0
  105. package/dist/cli/util/version-preflight.mjs +66 -0
  106. package/dist/cli/util/version-preflight.mjs.map +1 -0
  107. package/dist/types/config.d.ts +11 -7
  108. package/dist/types/config.d.ts.map +1 -1
  109. package/package.json +133 -133
  110. package/skills/apt-close-task/SKILL.md +30 -0
  111. package/skills/apt-diagram/SKILL.md +45 -9
  112. package/skills/apt-release-notes/SKILL.md +193 -0
  113. package/skills/apt-release-notes/appendices/persona-voice.md +59 -0
  114. package/skills/apt-setup/SKILL.md +146 -3
  115. package/skills/apt-ship/SKILL.md +63 -4
  116. package/skills/apt-spar/SKILL.md +36 -11
  117. package/skills/apt-update/SKILL.md +77 -10
  118. package/skills/apt-watch-ci/SKILL.md +6 -3
  119. package/src/cli/commands/check-version.mjs +73 -1
  120. package/src/cli/commands/ci-watch.mjs +74 -5
  121. package/src/cli/commands/health-check.mjs +1 -1
  122. package/src/cli/commands/init.mjs +202 -10
  123. package/src/cli/commands/release-notes.mjs +187 -0
  124. package/src/cli/commands/route.mjs +38 -2
  125. package/src/cli/commands/task.mjs +49 -0
  126. package/src/cli/config/load.mjs +37 -0
  127. package/src/cli/config/upgrade-gitignore.mjs +6 -0
  128. package/src/cli/consistency/parse-review.mjs +3 -1
  129. package/src/cli/dispatch.mjs +2 -0
  130. package/src/cli/gate/gates/review-clean.mjs +4 -2
  131. package/src/cli/help.mjs +1 -0
  132. package/src/cli/host/detect.mjs +135 -0
  133. package/src/cli/install/legacy-paths.mjs +69 -0
  134. package/src/cli/install/runtime-migrate.mjs +252 -0
  135. package/src/cli/install/update-chips.mjs +57 -0
  136. package/src/cli/release-notes/compile.mjs +261 -0
  137. package/src/cli/release-notes/draft.mjs +133 -0
  138. package/src/cli/release-notes/output-dir.mjs +52 -0
  139. package/src/cli/release-notes/persona-filter.mjs +126 -0
  140. package/src/cli/release-notes/publish.mjs +128 -0
  141. package/src/cli/release-notes/ship-autodraft.mjs +106 -0
  142. package/src/cli/route/drift-detect.mjs +107 -0
  143. package/src/cli/util/aperant-section.mjs +136 -0
  144. package/src/cli/util/copy.mjs +43 -56
  145. package/src/cli/util/semver.mjs +28 -0
  146. package/src/cli/util/skill-installs.mjs +134 -21
  147. package/src/cli/util/version-preflight.mjs +65 -0
  148. package/templates/aperant-claude-md-appendix.md +37 -0
  149. package/templates/config.json +28 -3
  150. package/workflows/docs.md +12 -0
@@ -32,20 +32,133 @@ export function detectHost(opts?: {
32
32
  };
33
33
  aperant_terminal: boolean;
34
34
  aperant_socket: string | null;
35
+ partner_transports: {
36
+ codex: ({
37
+ rung: string;
38
+ detected: boolean;
39
+ reason: string;
40
+ invocation?: undefined;
41
+ } | {
42
+ rung: string;
43
+ detected: string;
44
+ invocation: string;
45
+ reason?: undefined;
46
+ } | {
47
+ rung: string;
48
+ detected: boolean;
49
+ invocation: any;
50
+ reason?: undefined;
51
+ })[];
52
+ claude: ({
53
+ rung: string;
54
+ detected: boolean;
55
+ reason: string;
56
+ invocation?: undefined;
57
+ } | {
58
+ rung: string;
59
+ detected: string;
60
+ invocation: string;
61
+ reason?: undefined;
62
+ } | {
63
+ rung: string;
64
+ detected: boolean;
65
+ invocation: any;
66
+ reason?: undefined;
67
+ })[];
68
+ gemini: ({
69
+ rung: string;
70
+ detected: boolean;
71
+ reason: string;
72
+ invocation?: undefined;
73
+ } | {
74
+ rung: string;
75
+ detected: string;
76
+ invocation: string;
77
+ reason?: undefined;
78
+ } | {
79
+ rung: string;
80
+ detected: boolean;
81
+ invocation: any;
82
+ reason?: undefined;
83
+ })[];
84
+ };
35
85
  };
36
86
  /**
37
- * host/detect.mjs AI CLI host detection (C29).
87
+ * Partner-transport ladder used by `apt:spar` (FRAMEWORK-BUG-024).
88
+ *
89
+ * For each partner (codex / claude / gemini) we resolve a 3-rung ladder in
90
+ * preference order — MCP first (cleanest integration), then plugin shim
91
+ * (codex only), then raw CLI on $PATH. The first rung with `detected: true`
92
+ * wins; the spar skill's gate fails only when all three rungs report
93
+ * `detected: false`.
94
+ *
95
+ * Detection is best-effort and side-effect-free w/r/t the FS — only
96
+ * `existsSync` reads. No spawn, no network. The MCP rung uses
97
+ * `detected: "runtime-host-only"` when the framework process cannot probe
98
+ * the host's deferred-tool registry (the common case — MCP availability
99
+ * is host-internal), signalling the SKILL body to self-check at invocation
100
+ * time rather than fail the gate.
38
101
  *
39
- * Detection maintenance: env-var mappings for each runtime below are the
40
- * authoritative signal. They must be re-verified against each CLI's current
41
- * public docs every quarter. See packages/framework/docs/intents.md
42
- * §Host-detection-maintenance for the process.
102
+ * Pure function w/r/t injected `env` + `existsSync` so tests can mock both
103
+ * without monkey-patching `process.env` or `node:fs`.
43
104
  *
44
- * For env vars that could not be confirmed from public docs at the time of
45
- * writing, we leave a TODO comment with the docs URL. These branches still
46
- * ship we prefer best-effort coverage + structured unknown-host error
47
- * for misses over silently routing into the wrong runtime.
105
+ * @param {object} [opts]
106
+ * @param {NodeJS.ProcessEnv} [opts.env] defaults to `process.env`
107
+ * @param {(p: string) => boolean} [opts.existsSync] defaults to `node:fs` existsSync
48
108
  */
109
+ export function detectPartnerTransports(opts?: {
110
+ env?: NodeJS.ProcessEnv | undefined;
111
+ existsSync?: ((p: string) => boolean) | undefined;
112
+ }): {
113
+ codex: ({
114
+ rung: string;
115
+ detected: boolean;
116
+ reason: string;
117
+ invocation?: undefined;
118
+ } | {
119
+ rung: string;
120
+ detected: string;
121
+ invocation: string;
122
+ reason?: undefined;
123
+ } | {
124
+ rung: string;
125
+ detected: boolean;
126
+ invocation: any;
127
+ reason?: undefined;
128
+ })[];
129
+ claude: ({
130
+ rung: string;
131
+ detected: boolean;
132
+ reason: string;
133
+ invocation?: undefined;
134
+ } | {
135
+ rung: string;
136
+ detected: string;
137
+ invocation: string;
138
+ reason?: undefined;
139
+ } | {
140
+ rung: string;
141
+ detected: boolean;
142
+ invocation: any;
143
+ reason?: undefined;
144
+ })[];
145
+ gemini: ({
146
+ rung: string;
147
+ detected: boolean;
148
+ reason: string;
149
+ invocation?: undefined;
150
+ } | {
151
+ rung: string;
152
+ detected: string;
153
+ invocation: string;
154
+ reason?: undefined;
155
+ } | {
156
+ rung: string;
157
+ detected: boolean;
158
+ invocation: any;
159
+ reason?: undefined;
160
+ })[];
161
+ };
49
162
  /**
50
163
  * Canonical list of runtime identifiers accepted by detectHost's
51
164
  * `overrideCli` parameter AND by the route command's `--runtime <id>` flag.
@@ -1 +1 @@
1
- {"version":3,"file":"detect.d.mts","sourceRoot":"","sources":["../../../src/cli/host/detect.mjs"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;;;;;;GAiBG;AACH,kCARG;IAAsB,WAAW;CAOnC;;;;;;;;;;;;;;EA6JA;AAtND;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH,gDAgBE"}
1
+ {"version":3,"file":"detect.d.mts","sourceRoot":"","sources":["../../../src/cli/host/detect.mjs"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;;;;;GAiBG;AACH,kCARG;IAAsB,WAAW;CAOnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8JA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,+CAHG;IAAiC,GAAG;IACE,UAAU,QAApC,MAAM,KAAK,OAAO;CAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBA;AA1PD;;;;;;;GAOG;AACH,gDAgBE"}
@@ -11,6 +11,8 @@
11
11
  * ship — we prefer best-effort coverage + structured unknown-host error
12
12
  * for misses over silently routing into the wrong runtime.
13
13
  */
14
+ import { existsSync as fsExistsSync } from 'node:fs';
15
+ import { delimiter as PATH_DELIMITER, join as pathJoin } from 'node:path';
14
16
  /**
15
17
  * Canonical list of runtime identifiers accepted by detectHost's
16
18
  * `overrideCli` parameter AND by the route command's `--runtime <id>` flag.
@@ -213,6 +215,136 @@ export function detectHost(opts = {}) {
213
215
  capabilities,
214
216
  aperant_terminal: isAperantTerminal,
215
217
  aperant_socket: aperantSocket,
218
+ partner_transports: detectPartnerTransports({ env }),
216
219
  };
217
220
  }
221
+ /**
222
+ * Partner-transport ladder used by `apt:spar` (FRAMEWORK-BUG-024).
223
+ *
224
+ * For each partner (codex / claude / gemini) we resolve a 3-rung ladder in
225
+ * preference order — MCP first (cleanest integration), then plugin shim
226
+ * (codex only), then raw CLI on $PATH. The first rung with `detected: true`
227
+ * wins; the spar skill's gate fails only when all three rungs report
228
+ * `detected: false`.
229
+ *
230
+ * Detection is best-effort and side-effect-free w/r/t the FS — only
231
+ * `existsSync` reads. No spawn, no network. The MCP rung uses
232
+ * `detected: "runtime-host-only"` when the framework process cannot probe
233
+ * the host's deferred-tool registry (the common case — MCP availability
234
+ * is host-internal), signalling the SKILL body to self-check at invocation
235
+ * time rather than fail the gate.
236
+ *
237
+ * Pure function w/r/t injected `env` + `existsSync` so tests can mock both
238
+ * without monkey-patching `process.env` or `node:fs`.
239
+ *
240
+ * @param {object} [opts]
241
+ * @param {NodeJS.ProcessEnv} [opts.env] — defaults to `process.env`
242
+ * @param {(p: string) => boolean} [opts.existsSync] — defaults to `node:fs` existsSync
243
+ */
244
+ export function detectPartnerTransports(opts = {}) {
245
+ const env = opts.env ?? process.env;
246
+ const exists = opts.existsSync ?? fsExistsSync;
247
+ const pathEntries = (env.PATH ?? '').split(PATH_DELIMITER).filter(Boolean);
248
+ return {
249
+ codex: [
250
+ detectMcpRung('codex', env),
251
+ detectPluginShim('codex', env, exists),
252
+ detectRawCli('codex', pathEntries, exists),
253
+ ],
254
+ claude: [
255
+ detectMcpRung('claude', env),
256
+ // No plugin shim exists for Claude today — kept as `detected: false`
257
+ // for ladder-shape symmetry so consumers can index by rung uniformly.
258
+ { rung: 'plugin', detected: false, reason: 'no plugin shim for claude' },
259
+ detectRawCli('claude', pathEntries, exists),
260
+ ],
261
+ gemini: [
262
+ detectMcpRung('gemini', env),
263
+ { rung: 'plugin', detected: false, reason: 'no plugin shim for gemini' },
264
+ detectRawCli('gemini', pathEntries, exists),
265
+ ],
266
+ };
267
+ }
268
+ /**
269
+ * MCP rung — detected if the host exposes its deferred-tool manifest via
270
+ * `CLAUDE_MCP_DEFERRED_TOOLS` (a JSON array of tool names) AND a matching
271
+ * `mcp__<partner>-mcp__*` entry is present. When the env var is absent the
272
+ * framework cannot observe the host's tool registry from outside, so we
273
+ * return `detected: "runtime-host-only"` — the SKILL body interprets this
274
+ * as "try it; if the host has the tool, use it; otherwise fall through".
275
+ */
276
+ function detectMcpRung(partner, env) {
277
+ const toolPrefix = mcpToolPrefix(partner);
278
+ const manifest = env.CLAUDE_MCP_DEFERRED_TOOLS;
279
+ if (manifest) {
280
+ try {
281
+ const tools = JSON.parse(manifest);
282
+ if (Array.isArray(tools) &&
283
+ tools.some((t) => typeof t === 'string' && t.startsWith(toolPrefix))) {
284
+ return { rung: 'mcp', detected: true, invocation: `${toolPrefix}*` };
285
+ }
286
+ return {
287
+ rung: 'mcp',
288
+ detected: false,
289
+ reason: `no ${toolPrefix}* tool in CLAUDE_MCP_DEFERRED_TOOLS`,
290
+ };
291
+ }
292
+ catch {
293
+ // Malformed manifest — fall through to runtime-deferred
294
+ }
295
+ }
296
+ return { rung: 'mcp', detected: 'runtime-host-only', invocation: `${toolPrefix}*` };
297
+ }
298
+ function mcpToolPrefix(partner) {
299
+ if (partner === 'codex')
300
+ return 'mcp__codex-mcp__';
301
+ if (partner === 'claude')
302
+ return 'mcp__claude-code-mcp__';
303
+ if (partner === 'gemini')
304
+ return 'mcp__gemini-mcp__';
305
+ return `mcp__${partner}-mcp__`;
306
+ }
307
+ /**
308
+ * Plugin-shim rung — Claude Code plugins drop helper scripts under
309
+ * `${CLAUDE_PLUGIN_ROOT}/scripts/<partner>-companion.mjs`. Only codex
310
+ * ships a companion today; the caller passes `'codex'` to probe.
311
+ */
312
+ function detectPluginShim(partner, env, exists) {
313
+ const root = env.CLAUDE_PLUGIN_ROOT;
314
+ if (!root) {
315
+ return { rung: 'plugin', detected: false, reason: 'CLAUDE_PLUGIN_ROOT unset' };
316
+ }
317
+ const script = pathJoin(root, 'scripts', `${partner}-companion.mjs`);
318
+ if (!exists(script)) {
319
+ return { rung: 'plugin', detected: false, reason: `${script} not found` };
320
+ }
321
+ return { rung: 'plugin', detected: true, invocation: `node "${script}" task` };
322
+ }
323
+ /**
324
+ * Raw-CLI rung — probe pre-split $PATH entries for the partner binary using
325
+ * existsSync (no spawn). Accepts a pre-split array so detectPartnerTransports
326
+ * can parse $PATH once and share it across all partner probes.
327
+ *
328
+ * The binary name matches the partner id for all three currently-supported
329
+ * partners (codex / claude / gemini).
330
+ */
331
+ function detectRawCli(partner, pathEntries, exists) {
332
+ const bin = partner;
333
+ for (const dir of pathEntries) {
334
+ const candidate = pathJoin(dir, bin);
335
+ if (exists(candidate)) {
336
+ return { rung: 'cli', detected: true, invocation: rawCliInvocation(partner) };
337
+ }
338
+ }
339
+ return { rung: 'cli', detected: false, reason: `${bin} not found on $PATH` };
340
+ }
341
+ function rawCliInvocation(partner) {
342
+ if (partner === 'codex')
343
+ return 'codex exec';
344
+ if (partner === 'claude')
345
+ return 'claude -p';
346
+ if (partner === 'gemini')
347
+ return 'gemini -m';
348
+ return partner;
349
+ }
218
350
  //# sourceMappingURL=detect.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"detect.mjs","sourceRoot":"","sources":["../../../src/cli/host/detect.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,aAAa;IACb,OAAO;IACP,YAAY;IACZ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,UAAU;IACV,MAAM;IACN,SAAS;IACT,aAAa;IACb,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,WAAW;CACX,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;GAiB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SAAS,gBAAgB,CAAC,OAAO;IAChC,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,YAAY,CAAA;IAC5C,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAA;IAC5C,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAA;IAC5C,OAAO,OAAO,CAAA;AACf,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * install/legacy-paths.mjs — shared registry of legacy install topologies
3
+ * the framework once wrote to but no longer owns. Single source of truth
4
+ * for both:
5
+ *
6
+ * - BUG-021: `runLegacyCleanup` in `install/runtime-migrate.mjs` knows
7
+ * which files under a legacy root are framework-owned (safe to
8
+ * remove) vs user-added (preserve).
9
+ * - BUG-022: `readSkillInstallState` in `util/skill-installs.mjs` falls
10
+ * back to `version_file` here when no manifest is present, so a
11
+ * pre-manifest install still surfaces as "installed" rather than
12
+ * "missing-skills".
13
+ *
14
+ * Derivation: the codex `framework_files` list was extracted from
15
+ * `git show 1a8dd8a8 --stat` (the original "make Codex a first-class
16
+ * skill install surface" commit) — every `.agents/skills/…` path the
17
+ * installer once wrote, including the `.apt-version` stamp and the
18
+ * apt-pr-review / apt-discuss / apt-verify-proof sub-files. When the
19
+ * codex installer was retargeted to `.codex/`, that entire tree became
20
+ * orphaned on upgrading projects.
21
+ *
22
+ * Schema:
23
+ * { [runtimeId]: {
24
+ * install_root: relative path the runtime once wrote into,
25
+ * version_file: relative path of the legacy `.apt-version` stamp,
26
+ * framework_files: array of relative paths the installer once owned
27
+ * (under install_root).
28
+ * } }
29
+ *
30
+ * Frozen via Object.freeze so callers cannot mutate the shared registry.
31
+ */
32
+ /** @type {Record<string, { install_root: string, version_file: string, framework_files: ReadonlyArray<string> }>} */
33
+ export const LEGACY_INSTALL_PATHS: Record<string, {
34
+ install_root: string;
35
+ version_file: string;
36
+ framework_files: ReadonlyArray<string>;
37
+ }>;
38
+ //# sourceMappingURL=legacy-paths.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-paths.d.mts","sourceRoot":"","sources":["../../../src/cli/install/legacy-paths.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,qHAAqH;AACrH,mCADW,MAAM,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,CAoC/G"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * install/legacy-paths.mjs — shared registry of legacy install topologies
3
+ * the framework once wrote to but no longer owns. Single source of truth
4
+ * for both:
5
+ *
6
+ * - BUG-021: `runLegacyCleanup` in `install/runtime-migrate.mjs` knows
7
+ * which files under a legacy root are framework-owned (safe to
8
+ * remove) vs user-added (preserve).
9
+ * - BUG-022: `readSkillInstallState` in `util/skill-installs.mjs` falls
10
+ * back to `version_file` here when no manifest is present, so a
11
+ * pre-manifest install still surfaces as "installed" rather than
12
+ * "missing-skills".
13
+ *
14
+ * Derivation: the codex `framework_files` list was extracted from
15
+ * `git show 1a8dd8a8 --stat` (the original "make Codex a first-class
16
+ * skill install surface" commit) — every `.agents/skills/…` path the
17
+ * installer once wrote, including the `.apt-version` stamp and the
18
+ * apt-pr-review / apt-discuss / apt-verify-proof sub-files. When the
19
+ * codex installer was retargeted to `.codex/`, that entire tree became
20
+ * orphaned on upgrading projects.
21
+ *
22
+ * Schema:
23
+ * { [runtimeId]: {
24
+ * install_root: relative path the runtime once wrote into,
25
+ * version_file: relative path of the legacy `.apt-version` stamp,
26
+ * framework_files: array of relative paths the installer once owned
27
+ * (under install_root).
28
+ * } }
29
+ *
30
+ * Frozen via Object.freeze so callers cannot mutate the shared registry.
31
+ */
32
+ /** @type {Record<string, { install_root: string, version_file: string, framework_files: ReadonlyArray<string> }>} */
33
+ export const LEGACY_INSTALL_PATHS = Object.freeze({
34
+ codex: Object.freeze({
35
+ install_root: '.agents/skills',
36
+ version_file: '.agents/skills/.apt-version',
37
+ framework_files: Object.freeze([
38
+ '.apt-version',
39
+ 'apt/SKILL.md',
40
+ 'apt-debug/SKILL.md',
41
+ 'apt-discuss/SKILL.md',
42
+ 'apt-discuss/examples/rationalization-example.md',
43
+ 'apt-docs/SKILL.md',
44
+ 'apt-execute/SKILL.md',
45
+ 'apt-pause/SKILL.md',
46
+ 'apt-plan/SKILL.md',
47
+ 'apt-pr-review/SCHEMA.md',
48
+ 'apt-pr-review/SKILL.md',
49
+ 'apt-pr-review/prompts/fp-gate-codex.md',
50
+ 'apt-pr-review/templates/external-comment.md',
51
+ 'apt-quick/SKILL.md',
52
+ 'apt-resume/SKILL.md',
53
+ 'apt-review/SKILL.md',
54
+ 'apt-roadmap/SKILL.md',
55
+ 'apt-roundtable/SKILL.md',
56
+ 'apt-run/SKILL.md',
57
+ 'apt-scan/SKILL.md',
58
+ 'apt-setup/SKILL.md',
59
+ 'apt-ship/SKILL.md',
60
+ 'apt-stress-test/SKILL.md',
61
+ 'apt-verify/SKILL.md',
62
+ 'apt-verify-proof/SKILL.md',
63
+ 'apt-verify-proof/references/multi-model-setup.md',
64
+ 'apt-verify-proof/references/multi-model-verification.md',
65
+ 'apt-verify-proof/references/proof-capture.md',
66
+ ]),
67
+ }),
68
+ });
69
+ //# sourceMappingURL=legacy-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-paths.mjs","sourceRoot":"","sources":["../../../src/cli/install/legacy-paths.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,qHAAqH;AACrH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QACpB,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,6BAA6B;QAC3C,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC;YAC9B,cAAc;YACd,cAAc;YACd,oBAAoB;YACpB,sBAAsB;YACtB,iDAAiD;YACjD,mBAAmB;YACnB,sBAAsB;YACtB,oBAAoB;YACpB,mBAAmB;YACnB,yBAAyB;YACzB,wBAAwB;YACxB,wCAAwC;YACxC,6CAA6C;YAC7C,oBAAoB;YACpB,qBAAqB;YACrB,qBAAqB;YACrB,sBAAsB;YACtB,yBAAyB;YACzB,kBAAkB;YAClB,mBAAmB;YACnB,oBAAoB;YACpB,mBAAmB;YACnB,0BAA0B;YAC1B,qBAAqB;YACrB,2BAA2B;YAC3B,kDAAkD;YAClD,yDAAyD;YACzD,8CAA8C;SAC9C,CAAC;KACF,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Probe the codex legacy install tree at `<targetDir>/.agents/skills/`.
3
+ *
4
+ * @param {string} targetDir
5
+ * @returns {LegacyCodexDetection}
6
+ */
7
+ export function detectLegacyCodexTree(targetDir: string): LegacyCodexDetection;
8
+ /**
9
+ * Clean up the legacy `.agents/skills/` tree if it looks orphaned.
10
+ *
11
+ * Branches:
12
+ * 1. `present: false` OR `frameworkFiles.length === 0` → no-op,
13
+ * `{ ran: false, reason: 'no-legacy' }`.
14
+ * 2. `hasManifest: true` → managed install, no-op,
15
+ * `{ ran: false, reason: 'managed' }`.
16
+ * 3. Otherwise: per-file `unlinkSync` each framework-owned file;
17
+ * `rmdirSync` any now-empty `apt-*` subdirectory; sweep
18
+ * `.agents/skills/` only if it is empty; sweep `.agents/` only if
19
+ * its `skills/` got removed and `.agents/` is empty.
20
+ *
21
+ * Returns `{ ran: true, removed, retained, rmdirs }` on the cleanup
22
+ * branch:
23
+ * - `removed` — relative paths under `install_root` that were unlinked.
24
+ * - `retained` — relative paths under `install_root` that were NOT
25
+ * removed (user-added skills / files not in the legacy set).
26
+ * - `rmdirs` — absolute paths of directories that were removed
27
+ * (apt-* subdirs, the install_root itself, .agents/), in removal order.
28
+ *
29
+ * Atomicity: per-file unlink is non-atomic. A partial-failure scenario
30
+ * (process killed mid-loop) is tolerable — the next `init` run will
31
+ * re-detect the remaining framework files and finish the sweep.
32
+ *
33
+ * @param {{ targetDir: string, dryRun?: boolean }} args
34
+ * @returns {
35
+ * | { ran: false, reason: 'no-legacy' | 'managed' }
36
+ * | { ran: true, removed: string[], retained: string[], rmdirs: string[] }
37
+ * }
38
+ */
39
+ export function runLegacyCleanup({ targetDir, dryRun }: {
40
+ targetDir: string;
41
+ dryRun?: boolean;
42
+ }): any | {
43
+ ran: false;
44
+ reason: "no-legacy" | "managed";
45
+ } | {
46
+ ran: true;
47
+ removed: string[];
48
+ retained: string[];
49
+ rmdirs: string[];
50
+ };
51
+ export type LegacyCodexDetection = {
52
+ /**
53
+ * True when `.agents/skills/` exists.
54
+ */
55
+ present: boolean;
56
+ /**
57
+ * Subset of `framework_files` that
58
+ * actually exist on disk (relative
59
+ * to install_root).
60
+ */
61
+ frameworkFiles: string[];
62
+ /**
63
+ * Everything else under
64
+ * install_root (relative to
65
+ * install_root). May include both
66
+ * files and directories. Drives the
67
+ * `retained[]` warning.
68
+ */
69
+ userFiles: string[];
70
+ /**
71
+ * Whether the legacy `.apt-version`
72
+ * stamp is present.
73
+ */
74
+ hasAptVersion: boolean;
75
+ /**
76
+ * Whether an
77
+ * `apt-file-manifest.json` is
78
+ * present at install_root (signals
79
+ * a managed install — cleanup
80
+ * should no-op).
81
+ */
82
+ hasManifest: boolean;
83
+ };
84
+ //# sourceMappingURL=runtime-migrate.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-migrate.d.mts","sourceRoot":"","sources":["../../../src/cli/install/runtime-migrate.mjs"],"names":[],"mappings":"AA8FA;;;;;GAKG;AACH,iDAHW,MAAM,GACJ,oBAAoB,CA0BhC;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wDANW;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAEjD,GAAC,GAAK;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAC/C;IAAE,GAAG,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAgF5E;;;;;aAxNa,OAAO;;;;;;oBACP,MAAM,EAAE;;;;;;;;eAGR,MAAM,EAAE;;;;;mBAKR,OAAO;;;;;;;;iBAEP,OAAO"}