@aperant/framework 0.6.7 → 0.7.3

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 (205) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/agents/apt-planner.md +12 -0
  3. package/agents/apt-pr-review-fixer.md +13 -9
  4. package/bin/apt-tools.mjs +7 -0
  5. package/dist/cli/ci-watch/stop-matrix.d.mts.map +1 -1
  6. package/dist/cli/ci-watch/stop-matrix.mjs +16 -0
  7. package/dist/cli/ci-watch/stop-matrix.mjs.map +1 -1
  8. package/dist/cli/commands/ci-watch.d.mts +11 -0
  9. package/dist/cli/commands/ci-watch.d.mts.map +1 -1
  10. package/dist/cli/commands/ci-watch.mjs +147 -3
  11. package/dist/cli/commands/ci-watch.mjs.map +1 -1
  12. package/dist/cli/commands/features-audit.d.mts +24 -0
  13. package/dist/cli/commands/features-audit.d.mts.map +1 -1
  14. package/dist/cli/commands/features-audit.mjs +159 -5
  15. package/dist/cli/commands/features-audit.mjs.map +1 -1
  16. package/dist/cli/commands/health-check.d.mts +16 -0
  17. package/dist/cli/commands/health-check.d.mts.map +1 -1
  18. package/dist/cli/commands/health-check.mjs +119 -3
  19. package/dist/cli/commands/health-check.mjs.map +1 -1
  20. package/dist/cli/commands/init.d.mts +19 -1
  21. package/dist/cli/commands/init.d.mts.map +1 -1
  22. package/dist/cli/commands/init.mjs +143 -8
  23. package/dist/cli/commands/init.mjs.map +1 -1
  24. package/dist/cli/commands/modes.d.mts.map +1 -1
  25. package/dist/cli/commands/modes.mjs +11 -0
  26. package/dist/cli/commands/modes.mjs.map +1 -1
  27. package/dist/cli/commands/pr-review-audit-fixer.d.mts +13 -0
  28. package/dist/cli/commands/pr-review-audit-fixer.d.mts.map +1 -1
  29. package/dist/cli/commands/pr-review-audit-fixer.mjs +18 -5
  30. package/dist/cli/commands/pr-review-audit-fixer.mjs.map +1 -1
  31. package/dist/cli/commands/route.d.mts.map +1 -1
  32. package/dist/cli/commands/route.mjs +37 -2
  33. package/dist/cli/commands/route.mjs.map +1 -1
  34. package/dist/cli/commands/task.d.mts.map +1 -1
  35. package/dist/cli/commands/task.mjs +132 -5
  36. package/dist/cli/commands/task.mjs.map +1 -1
  37. package/dist/cli/commands/validate-evidence.d.mts +24 -2
  38. package/dist/cli/commands/validate-evidence.d.mts.map +1 -1
  39. package/dist/cli/commands/validate-evidence.mjs +154 -17
  40. package/dist/cli/commands/validate-evidence.mjs.map +1 -1
  41. package/dist/cli/commands/vitest-doctor.d.mts +2 -0
  42. package/dist/cli/commands/vitest-doctor.d.mts.map +1 -0
  43. package/dist/cli/commands/vitest-doctor.mjs +168 -0
  44. package/dist/cli/commands/vitest-doctor.mjs.map +1 -0
  45. package/dist/cli/config/gitignore-drift.d.mts +23 -1
  46. package/dist/cli/config/gitignore-drift.d.mts.map +1 -1
  47. package/dist/cli/config/gitignore-drift.mjs +81 -3
  48. package/dist/cli/config/gitignore-drift.mjs.map +1 -1
  49. package/dist/cli/config/load.d.mts +56 -2
  50. package/dist/cli/config/load.d.mts.map +1 -1
  51. package/dist/cli/config/load.mjs +192 -2
  52. package/dist/cli/config/load.mjs.map +1 -1
  53. package/dist/cli/consistency/parse-review.mjs +7 -0
  54. package/dist/cli/consistency/parse-review.mjs.map +1 -1
  55. package/dist/cli/dispatch.d.mts.map +1 -1
  56. package/dist/cli/dispatch.mjs +24 -2
  57. package/dist/cli/dispatch.mjs.map +1 -1
  58. package/dist/cli/gate/gates/gitignore-in-sync.d.mts +1 -1
  59. package/dist/cli/gate/gates/gitignore-in-sync.d.mts.map +1 -1
  60. package/dist/cli/gate/gates/gitignore-in-sync.mjs +5 -2
  61. package/dist/cli/gate/gates/gitignore-in-sync.mjs.map +1 -1
  62. package/dist/cli/gate/gates/review-clean.d.mts +5 -1
  63. package/dist/cli/gate/gates/review-clean.d.mts.map +1 -1
  64. package/dist/cli/gate/gates/review-clean.mjs +23 -18
  65. package/dist/cli/gate/gates/review-clean.mjs.map +1 -1
  66. package/dist/cli/gate/gates/verify-approved.d.mts +49 -1
  67. package/dist/cli/gate/gates/verify-approved.d.mts.map +1 -1
  68. package/dist/cli/gate/gates/verify-approved.mjs +93 -14
  69. package/dist/cli/gate/gates/verify-approved.mjs.map +1 -1
  70. package/dist/cli/help.d.mts.map +1 -1
  71. package/dist/cli/help.mjs +8 -2
  72. package/dist/cli/help.mjs.map +1 -1
  73. package/dist/cli/host/detect.d.mts +122 -9
  74. package/dist/cli/host/detect.d.mts.map +1 -1
  75. package/dist/cli/host/detect.mjs +132 -0
  76. package/dist/cli/host/detect.mjs.map +1 -1
  77. package/dist/cli/install/legacy-paths.d.mts +38 -0
  78. package/dist/cli/install/legacy-paths.d.mts.map +1 -0
  79. package/dist/cli/install/legacy-paths.mjs +69 -0
  80. package/dist/cli/install/legacy-paths.mjs.map +1 -0
  81. package/dist/cli/install/runtime-detect.d.mts +13 -0
  82. package/dist/cli/install/runtime-detect.d.mts.map +1 -1
  83. package/dist/cli/install/runtime-detect.mjs +9 -0
  84. package/dist/cli/install/runtime-detect.mjs.map +1 -1
  85. package/dist/cli/install/runtime-migrate.d.mts +84 -0
  86. package/dist/cli/install/runtime-migrate.d.mts.map +1 -0
  87. package/dist/cli/install/runtime-migrate.mjs +244 -0
  88. package/dist/cli/install/runtime-migrate.mjs.map +1 -0
  89. package/dist/cli/route/drift-detect.d.mts +20 -0
  90. package/dist/cli/route/drift-detect.d.mts.map +1 -0
  91. package/dist/cli/route/drift-detect.mjs +107 -0
  92. package/dist/cli/route/drift-detect.mjs.map +1 -0
  93. package/dist/cli/task/index-md.d.mts.map +1 -1
  94. package/dist/cli/task/index-md.mjs +14 -2
  95. package/dist/cli/task/index-md.mjs.map +1 -1
  96. package/dist/cli/util/aperant-section.d.mts +34 -0
  97. package/dist/cli/util/aperant-section.d.mts.map +1 -0
  98. package/dist/cli/util/aperant-section.mjs +127 -0
  99. package/dist/cli/util/aperant-section.mjs.map +1 -0
  100. package/dist/cli/util/copy.d.mts +28 -1
  101. package/dist/cli/util/copy.d.mts.map +1 -1
  102. package/dist/cli/util/copy.mjs +43 -55
  103. package/dist/cli/util/copy.mjs.map +1 -1
  104. package/dist/cli/util/semver.d.mts +17 -0
  105. package/dist/cli/util/semver.d.mts.map +1 -0
  106. package/dist/cli/util/semver.mjs +29 -0
  107. package/dist/cli/util/semver.mjs.map +1 -0
  108. package/dist/cli/util/skill-installs.d.mts +65 -9
  109. package/dist/cli/util/skill-installs.d.mts.map +1 -1
  110. package/dist/cli/util/skill-installs.mjs +130 -21
  111. package/dist/cli/util/skill-installs.mjs.map +1 -1
  112. package/dist/cli/util/version-preflight.d.mts +44 -0
  113. package/dist/cli/util/version-preflight.d.mts.map +1 -0
  114. package/dist/cli/util/version-preflight.mjs +66 -0
  115. package/dist/cli/util/version-preflight.mjs.map +1 -0
  116. package/dist/plugin/.claude-plugin/plugin.json +11 -2
  117. package/dist/plugin/agents/apt-improver.md +99 -0
  118. package/dist/plugin/agents/apt-planner.md +127 -10
  119. package/dist/plugin/agents/apt-pr-review-fixer.md +13 -9
  120. package/dist/plugin/skills/apt/SKILL.md +1 -0
  121. package/dist/plugin/skills/apt-close-task/SKILL.md +63 -1
  122. package/dist/plugin/skills/apt-debug/SKILL.md +39 -6
  123. package/dist/plugin/skills/apt-debug/appendices/diagnose-discipline.md +119 -0
  124. package/dist/plugin/skills/apt-diagram/SKILL.md +378 -0
  125. package/dist/plugin/skills/apt-diagram/appendices/design-discipline.md +97 -0
  126. package/dist/plugin/skills/apt-discuss/SKILL.md +72 -5
  127. package/dist/plugin/skills/apt-discuss/appendices/grill-discipline.md +104 -0
  128. package/dist/plugin/skills/apt-discuss/appendices/zoom-out-helper.md +79 -0
  129. package/dist/plugin/skills/apt-execute/SKILL.md +57 -5
  130. package/dist/plugin/skills/apt-execute/appendices/tdd-mode.md +107 -0
  131. package/dist/plugin/skills/apt-improve/DEEPENING.md +84 -0
  132. package/dist/plugin/skills/apt-improve/INTERFACE-DESIGN.md +97 -0
  133. package/dist/plugin/skills/apt-improve/LANGUAGE.md +104 -0
  134. package/dist/plugin/skills/apt-improve/SKILL.md +141 -0
  135. package/dist/plugin/skills/apt-plan/SKILL.md +171 -4
  136. package/dist/plugin/skills/apt-plan/adapters/conductor.md +98 -0
  137. package/dist/plugin/skills/apt-pr-review/SKILL.md +57 -18
  138. package/dist/plugin/skills/apt-prototype/LOGIC.md +109 -0
  139. package/dist/plugin/skills/apt-prototype/SKILL.md +143 -0
  140. package/dist/plugin/skills/apt-prototype/UI.md +90 -0
  141. package/dist/plugin/skills/apt-quick/SKILL.md +49 -8
  142. package/dist/plugin/skills/apt-release-notes/SKILL.md +193 -0
  143. package/dist/plugin/skills/apt-release-notes/appendices/persona-voice.md +59 -0
  144. package/dist/plugin/skills/apt-review/SKILL.md +2 -0
  145. package/dist/plugin/skills/apt-run/SKILL.md +32 -4
  146. package/dist/plugin/skills/apt-setup/SKILL.md +308 -6
  147. package/dist/plugin/skills/apt-ship/SKILL.md +122 -1
  148. package/dist/plugin/skills/apt-spar/SKILL.md +315 -0
  149. package/dist/plugin/skills/apt-triage/AGENT-BRIEF.md +84 -0
  150. package/dist/plugin/skills/apt-triage/OUT-OF-SCOPE.md +75 -0
  151. package/dist/plugin/skills/apt-triage/SKILL.md +169 -0
  152. package/dist/plugin/skills/apt-update/SKILL.md +77 -10
  153. package/dist/plugin/skills/apt-verify/SKILL.md +3 -0
  154. package/dist/plugin/skills/apt-verify-proof/SKILL.md +10 -5
  155. package/dist/plugin/skills/apt-watch-ci/SKILL.md +166 -0
  156. package/dist/plugin/skills/apt-zoom-out/SKILL.md +130 -0
  157. package/package.json +133 -133
  158. package/prompts/conductor-framework-context.md +63 -0
  159. package/prompts/conductor-system.md +11 -0
  160. package/skills/apt-close-task/SKILL.md +6 -0
  161. package/skills/apt-discuss/SKILL.md +47 -5
  162. package/skills/apt-execute/SKILL.md +9 -0
  163. package/skills/apt-plan/SKILL.md +12 -0
  164. package/skills/apt-pr-review/SKILL.md +11 -2
  165. package/skills/apt-quick/SKILL.md +19 -8
  166. package/skills/apt-researcher.md +1 -0
  167. package/skills/apt-setup/SKILL.md +33 -2
  168. package/skills/apt-ship/SKILL.md +16 -4
  169. package/skills/apt-spar/SKILL.md +36 -11
  170. package/skills/apt-update/SKILL.md +26 -1
  171. package/skills/apt-verify-proof/SKILL.md +7 -5
  172. package/skills/apt-watch-ci/SKILL.md +4 -1
  173. package/src/cli/ci-watch/stop-matrix.mjs +17 -0
  174. package/src/cli/commands/ci-watch.mjs +152 -3
  175. package/src/cli/commands/features-audit.mjs +164 -5
  176. package/src/cli/commands/health-check.mjs +116 -3
  177. package/src/cli/commands/init.mjs +154 -6
  178. package/src/cli/commands/modes.mjs +11 -0
  179. package/src/cli/commands/pr-review-audit-fixer.mjs +18 -5
  180. package/src/cli/commands/route.mjs +38 -2
  181. package/src/cli/commands/task.mjs +132 -5
  182. package/src/cli/commands/validate-evidence.mjs +158 -17
  183. package/src/cli/commands/vitest-doctor.mjs +173 -0
  184. package/src/cli/config/gitignore-drift.mjs +74 -3
  185. package/src/cli/config/load.mjs +188 -2
  186. package/src/cli/consistency/parse-review.mjs +6 -0
  187. package/src/cli/dispatch.mjs +23 -2
  188. package/src/cli/gate/gates/gitignore-in-sync.mjs +5 -2
  189. package/src/cli/gate/gates/review-clean.mjs +24 -19
  190. package/src/cli/gate/gates/verify-approved.mjs +97 -14
  191. package/src/cli/help.mjs +8 -2
  192. package/src/cli/host/detect.mjs +135 -0
  193. package/src/cli/install/legacy-paths.mjs +69 -0
  194. package/src/cli/install/runtime-detect.mjs +9 -0
  195. package/src/cli/install/runtime-migrate.mjs +252 -0
  196. package/src/cli/route/drift-detect.mjs +107 -0
  197. package/src/cli/task/index-md.mjs +15 -2
  198. package/src/cli/util/aperant-section.mjs +136 -0
  199. package/src/cli/util/copy.mjs +43 -56
  200. package/src/cli/util/semver.mjs +28 -0
  201. package/src/cli/util/skill-installs.mjs +134 -21
  202. package/src/cli/util/version-preflight.mjs +65 -0
  203. package/templates/aperant-claude-md-appendix.md +37 -0
  204. package/templates/config.json +2 -7
  205. package/workflows/verify-proof.md +8 -3
@@ -3,20 +3,53 @@
3
3
  * G4 verify-approved — blocking gate for `apt:ship`.
4
4
  *
5
5
  * Requires {task_dir}/qa_signoff.json to exist, parse, and carry
6
- * verdict === "approved". The ship skill's existing prose only asked the
7
- * agent to "confirm" approval; this gate enforces it deterministically.
6
+ * verdict === "approved" (BUG-013: normalized via parseQaSignoff case
7
+ * and underscore/hyphen variants collapse to canonical). BUG-012: also
8
+ * accepts `approved-with-notes` when config.qa.approved_with_notes_threshold
9
+ * is set AND every dimension score meets the threshold (best-effort when
10
+ * dimensions are missing or in an unknown shape).
8
11
  *
9
- * NOTE: the file may use either `verdict` (newer) or `status` (older) field
10
- * name for the QA result. We accept both for forwards/backwards compatibility,
11
- * but only the string "approved" passes — "approved-with-notes" fails
12
- * because ship-time deserves the strongest signal.
12
+ * Accepts both `verdict` (newer) and `status` (older) field names — that
13
+ * normalization is delegated to parseQaSignoff.
13
14
  */
14
15
  import { existsSync, readFileSync } from 'node:fs';
15
16
  import { join } from 'node:path';
17
+ import { parseQaSignoff } from '../../consistency/parse-qa.mjs';
16
18
  import { registerGate } from '../registry.mjs';
19
+ /**
20
+ * Extract dimension scores from the qa_signoff.json shape. We've seen two
21
+ * shapes in the wild:
22
+ * - Array: `dimensions: [{name: 'security', score: 0.9}, ...]`
23
+ * - Object: `dimensions: {security: 0.9, performance: 0.85}` OR
24
+ * `dimensions: {security: {score: 0.9}, ...}`
25
+ * Returns an array of numeric scores, or null when no recognizable shape
26
+ * is present (best-effort accept per brief).
27
+ */
28
+ function extractDimensionScores(doc) {
29
+ const dims = doc.dimensions ?? doc.qa?.dimensions ?? null;
30
+ if (!dims)
31
+ return null;
32
+ if (Array.isArray(dims)) {
33
+ const scores = dims
34
+ .map((d) => (typeof d?.score === 'number' ? d.score : null))
35
+ .filter((s) => s !== null);
36
+ return scores.length > 0 ? scores : null;
37
+ }
38
+ if (typeof dims === 'object') {
39
+ const scores = [];
40
+ for (const v of Object.values(dims)) {
41
+ if (typeof v === 'number')
42
+ scores.push(v);
43
+ else if (typeof v?.score === 'number')
44
+ scores.push(v.score);
45
+ }
46
+ return scores.length > 0 ? scores : null;
47
+ }
48
+ return null;
49
+ }
17
50
  const gate = {
18
51
  id: 'verify-approved',
19
- description: 'qa_signoff.json exists with verdict === "approved"',
52
+ description: 'qa_signoff.json exists with verdict === "approved" (or "approved-with-notes" when configured)',
20
53
  severity: 'blocking',
21
54
  skills: ['ship'],
22
55
  async check(ctx) {
@@ -40,18 +73,64 @@ const gate = {
40
73
  inputs,
41
74
  };
42
75
  }
43
- const verdict = doc.verdict ?? doc.status ?? null;
44
- if (verdict !== 'approved') {
76
+ // BUG-013: route through parseQaSignoff so the verdict is
77
+ // case-insensitive AND tolerates `_↔-` (so 'APPROVED', 'Approved',
78
+ // ' approved ', 'APPROVED_WITH_NOTES' all behave canonically). The
79
+ // pre-fix gate compared the raw string against `'approved'` which
80
+ // false-rejected every legitimate variant.
81
+ const { verdict } = parseQaSignoff(doc);
82
+ if (verdict === 'approved') {
45
83
  return {
46
- status: 'fail',
47
- reason: `qa_signoff.json verdict is "${verdict}" (expected "approved")`,
48
- evidence: { verdict },
84
+ status: 'pass',
85
+ reason: 'qa_signoff.json verdict normalized to "approved"',
86
+ inputs,
87
+ };
88
+ }
89
+ // BUG-012: accept `approved-with-notes` when the project has opted
90
+ // in via config.qa.approved_with_notes_threshold. The threshold is
91
+ // the minimum per-dimension score required. Best-effort: when
92
+ // dimensions are missing / in an unknown shape we still accept and
93
+ // log, rather than hard-failing, so projects that haven't started
94
+ // scoring dimensions yet aren't blocked.
95
+ if (verdict === 'approved-with-notes') {
96
+ const threshold = ctx.config?.qa?.approved_with_notes_threshold;
97
+ if (typeof threshold !== 'number') {
98
+ return {
99
+ status: 'fail',
100
+ reason: 'qa_signoff.json verdict is "approved-with-notes" but config.qa.approved_with_notes_threshold is not set',
101
+ evidence: { verdict, threshold: threshold ?? null },
102
+ inputs,
103
+ };
104
+ }
105
+ const scores = extractDimensionScores(doc);
106
+ if (scores === null) {
107
+ return {
108
+ status: 'pass',
109
+ reason: `qa_signoff.json verdict is "approved-with-notes" and threshold ${threshold} is enabled; dimensions missing or unknown-shape — accepting best-effort`,
110
+ evidence: { verdict, threshold, dimensions_present: false },
111
+ inputs,
112
+ };
113
+ }
114
+ const failing = scores.filter((s) => s < threshold);
115
+ if (failing.length > 0) {
116
+ return {
117
+ status: 'fail',
118
+ reason: `qa_signoff.json verdict is "approved-with-notes" but ${failing.length}/${scores.length} dimension score(s) below threshold ${threshold}`,
119
+ evidence: { verdict, threshold, scores, failing },
120
+ inputs,
121
+ };
122
+ }
123
+ return {
124
+ status: 'pass',
125
+ reason: `qa_signoff.json verdict is "approved-with-notes" and all ${scores.length} dimension score(s) meet threshold ${threshold}`,
126
+ evidence: { verdict, threshold, scores },
49
127
  inputs,
50
128
  };
51
129
  }
52
130
  return {
53
- status: 'pass',
54
- reason: 'qa_signoff.json.verdict === "approved"',
131
+ status: 'fail',
132
+ reason: `qa_signoff.json verdict is "${verdict}" (expected "approved" or "approved-with-notes" with threshold)`,
133
+ evidence: { verdict },
55
134
  inputs,
56
135
  };
57
136
  },
@@ -1 +1 @@
1
- {"version":3,"file":"verify-approved.mjs","sourceRoot":"","sources":["../../../../src/cli/gate/gates/verify-approved.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,IAAI,GAAG;IACZ,EAAE,EAAE,iBAAiB;IACrB,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,KAAK,CAAC,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA;QACjD,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,CAAA;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,8BAA8B,IAAI,EAAE;gBAC5C,MAAM;aACN,CAAA;QACF,CAAC;QACD,IAAI,GAAG,CAAA;QACP,IAAI,CAAC;YACJ,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;QAC9C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,mCAAmC,GAAG,CAAC,OAAO,EAAE;gBACxD,MAAM;aACN,CAAA;QACF,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,CAAA;QACjD,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;YAC5B,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,+BAA+B,OAAO,yBAAyB;gBACvE,QAAQ,EAAE,EAAE,OAAO,EAAE;gBACrB,MAAM;aACN,CAAA;QACF,CAAC;QACD,OAAO;YACN,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,wCAAwC;YAChD,MAAM;SACN,CAAA;IACF,CAAC;CACD,CAAA;AAED,YAAY,CAAC,IAAI,CAAC,CAAA;AAClB,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"verify-approved.mjs","sourceRoot":"","sources":["../../../../src/cli/gate/gates/verify-approved.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,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BAA+B,OAAO,iEAAiE;YAC/G,QAAQ,EAAE,EAAE,OAAO,EAAE;YACrB,MAAM;SACN,CAAA;IACF,CAAC;CACD,CAAA;AAED,YAAY,CAAC,IAAI,CAAC,CAAA;AAClB,eAAe,IAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.mts","sourceRoot":"","sources":["../../src/cli/help.mjs"],"names":[],"mappings":"AAMA,kCAgIC"}
1
+ {"version":3,"file":"help.d.mts","sourceRoot":"","sources":["../../src/cli/help.mjs"],"names":[],"mappings":"AAMA,kCAsIC"}
package/dist/cli/help.mjs CHANGED
@@ -29,9 +29,10 @@ Commands:
29
29
  task update <dir> --id <id> [--lifecycle-phase <p>] [--pr-url <url>] [--subtasks-total <N>] [--depends-on <refs>] Update non-linkage task state; --pr-url may arm ci-watch per ci_watch.after_ship
30
30
  task move <dir> --id <id> [--to-scope <s>] [--to-milestone <id>] [--to-phase <id>] [--to-roadmap-ref-url <url>] [--reason <text>] [--force] Reassign scope/milestone/phase with history
31
31
  task close <dir> --id <task-id> [--verdict <v>] Close task and move to completed
32
+ task close-merged <dir> [--task <id>] [--narrate-only] [--dry-run] Sweep shipped-pending-merge tasks for confirmed merges (--narrate-only returns pending_narration[] entries read-only without closing).
32
33
  task narration-drain <dir> --task <task-id> Remove a row from state.pending_narration[] under withFileLock (called by /apt:close-task --narrate-only after a successful narrator spawn)
33
34
  task complete-subtask <dir> --task-id <id> --subtask-id <sid|a+b+c> [--commit <sha>] [--notes <text>] Atomic plan ↔ build-progress sync
34
- features-audit <dir> [--diff-files <csv>|--since <ref>] [--apply-stubs] [--format json|md] Audit features registry for unregistered feature-qualifying files
35
+ features-audit <dir> [--task-id <id>] [--no-worktree-redirect] [--diff-files <csv>|--since <ref>] [--apply-stubs] [--format json|md] Audit features registry for unregistered feature-qualifying files (BUG-025b: --task-id redirects writes to active task's worktree)
35
36
  docs-audit <dir> [--diff-files <csv>|--since <ref>|--dry-run] [--policy <path>] [--format json|md] Audit documented surfaces for docs-drift
36
37
 
37
38
  lock claim <dir> --subtask <id> Claim exclusive lock on a subtask
@@ -107,7 +108,9 @@ Commands:
107
108
 
108
109
  migrate-pr-reviews <project-dir> Migrate legacy .aperant/reviews/ → .aperant/pr-reviews/pr-{N}/rounds/{R}/ (idempotent)
109
110
 
110
- validate-evidence <findings-dir> --worktree <path> Enforce the Evidence Rule (literal substring + multi-file check); mutates findings markdown in place
111
+ validate-evidence <findings-dir> --worktree <path> [--allow-approx-evidence] [--approx-floor <n>] [--llm-validator-confirmed] Enforce the Evidence Rule (literal substring + multi-file check); mutates findings markdown in place. BUG-014: --allow-approx-evidence opts into Jaccard + line-anchor fallback (downgrade to dismissed_evidence_approx_confirmed unless --llm-validator-confirmed promotes to confirmed_valid_approx).
112
+
113
+ vitest doctor <project-dir> [--format json|md] BUG-026: walk vitest.config.{ts,js,mjs} files, report NODE_ENV/jsxAutomaticShim matrix, warn when JSX-rendering tests lack jsxAutomaticShim coverage (exits 1 on warnings)
111
114
 
112
115
  wfrun validate <workflow.yaml> C17: parse + schema-check a declarative YAML workflow (exits 0 on success)
113
116
  wfrun plan <workflow.yaml> [--input k=v …] C17: resolve DAG waves + inputs, emit run-plan JSON (no side effects)
@@ -123,6 +126,9 @@ Commands:
123
126
  pr-review record-comment <dir> --pr <N> --round <R> --url <url> --body-hash <sha256> [--review-id <id>] [--posted-at <iso>] Append entry to comment_timeline (Phase 6b)
124
127
  pr-review audit-fixer <dir> --review-dir <path> --iteration <N> --fixer <name> --worktree <path> --status-line <str> Audit fixer output against git state; exits 0 with JSON envelope (verdict: verified|hallucinated|skipped)
125
128
 
129
+ ci-watch start|stop|status|tick <dir> [--pr <N>] [...] /apt:watch-ci primitives — see SKILL.md for full flag matrix
130
+ ci-watch sweep <dir> --orphaned [--dry-run] BUG-027: enumerate ci-watches state files, query gh per PR, remove terminal-state (MERGED|CLOSED) entries (manual GC; rate-limited)
131
+
126
132
  Flags:
127
133
  --version Print version and exit
128
134
  --help Print usage and exit
@@ -1 +1 @@
1
- {"version":3,"file":"help.mjs","sourceRoot":"","sources":["../../src/cli/help.mjs"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,UAAU,SAAS;IACxB,MAAM,IAAI,GAAG,GAAG,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA4HT,CAAA;IAEnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;AAClC,CAAC"}
1
+ {"version":3,"file":"help.mjs","sourceRoot":"","sources":["../../src/cli/help.mjs"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,UAAU,SAAS;IACxB,MAAM,IAAI,GAAG,GAAG,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkIT,CAAA;IAEnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;AAClC,CAAC"}
@@ -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;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,UAAU,CAAC,IAAI,GAAG,EAAE;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;IAE5B,IAAI,GAAG,GAAG,SAAS,CAAA;IACnB,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,qEAAqE;IACrE,wEAAwE;IACxE,sEAAsE;IACtE,6DAA6D;IAC7D,IAAI,WAAW,IAAI,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,GAAG,GAAG,WAAW,CAAA;QACjB,oEAAoE;QACpE,mEAAmE;QACnE,oEAAoE;QACpE,+CAA+C;QAC/C,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;YAC3B,UAAU,GAAG,GAAG,CAAC,oCAAoC,KAAK,GAAG,CAAA;QAC9D,CAAC;IACF,CAAC;SAAM,IACN,GAAG,CAAC,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AAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,MAAM,QAAQ,EAAE,CAAA;AAC/E,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM;IACjD,MAAM,GAAG,GAAG,OAAO,CAAA;IACnB,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QACpC,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACvB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAA;QAC9E,CAAC;IACF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,EAAE,CAAA;AAC7E,CAAC;AAED,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"}