@aperant/framework 0.8.1 → 0.8.6

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 (308) hide show
  1. package/CHANGELOG.md +443 -1
  2. package/agents/apt-planner.md +39 -7
  3. package/dist/cli/commands/adr.mjs +1 -1
  4. package/dist/cli/commands/audit-branch-current.d.mts +25 -0
  5. package/dist/cli/commands/audit-branch-current.d.mts.map +1 -0
  6. package/dist/cli/commands/audit-branch-current.mjs +252 -0
  7. package/dist/cli/commands/audit-branch-current.mjs.map +1 -0
  8. package/dist/cli/commands/audit.d.mts.map +1 -1
  9. package/dist/cli/commands/audit.mjs +13 -2
  10. package/dist/cli/commands/audit.mjs.map +1 -1
  11. package/dist/cli/commands/check-version.d.mts.map +1 -1
  12. package/dist/cli/commands/check-version.mjs +19 -1
  13. package/dist/cli/commands/check-version.mjs.map +1 -1
  14. package/dist/cli/commands/context.mjs +3 -3
  15. package/dist/cli/commands/context.mjs.map +1 -1
  16. package/dist/cli/commands/coverage-check.d.mts.map +1 -1
  17. package/dist/cli/commands/coverage-check.mjs +74 -7
  18. package/dist/cli/commands/coverage-check.mjs.map +1 -1
  19. package/dist/cli/commands/detect-runtime.d.mts +6 -0
  20. package/dist/cli/commands/detect-runtime.d.mts.map +1 -0
  21. package/dist/cli/commands/detect-runtime.mjs +142 -0
  22. package/dist/cli/commands/detect-runtime.mjs.map +1 -0
  23. package/dist/cli/commands/driver-doctor.d.mts +29 -0
  24. package/dist/cli/commands/driver-doctor.d.mts.map +1 -0
  25. package/dist/cli/commands/driver-doctor.mjs +291 -0
  26. package/dist/cli/commands/driver-doctor.mjs.map +1 -0
  27. package/dist/cli/commands/gate.mjs +14 -0
  28. package/dist/cli/commands/gate.mjs.map +1 -1
  29. package/dist/cli/commands/init.d.mts.map +1 -1
  30. package/dist/cli/commands/init.mjs +9 -6
  31. package/dist/cli/commands/init.mjs.map +1 -1
  32. package/dist/cli/commands/install-from-source.d.mts +2 -0
  33. package/dist/cli/commands/install-from-source.d.mts.map +1 -0
  34. package/dist/cli/commands/install-from-source.mjs +2 -0
  35. package/dist/cli/commands/install-from-source.mjs.map +1 -0
  36. package/dist/cli/commands/modes.mjs +1 -1
  37. package/dist/cli/commands/route.d.mts.map +1 -1
  38. package/dist/cli/commands/route.mjs +38 -1
  39. package/dist/cli/commands/route.mjs.map +1 -1
  40. package/dist/cli/commands/triage.mjs +1 -1
  41. package/dist/cli/config/load.d.mts.map +1 -1
  42. package/dist/cli/config/load.mjs +9 -3
  43. package/dist/cli/config/load.mjs.map +1 -1
  44. package/dist/cli/coordination/auto-emit-artifact-ready.mjs +1 -1
  45. package/dist/cli/coordination/event-schema.d.mts.map +1 -1
  46. package/dist/cli/coordination/event-schema.mjs +18 -0
  47. package/dist/cli/coordination/event-schema.mjs.map +1 -1
  48. package/dist/cli/coverage-check/user-outcomes.d.mts +84 -0
  49. package/dist/cli/coverage-check/user-outcomes.d.mts.map +1 -0
  50. package/dist/cli/coverage-check/user-outcomes.mjs +265 -0
  51. package/dist/cli/coverage-check/user-outcomes.mjs.map +1 -0
  52. package/dist/cli/dispatch.d.mts.map +1 -1
  53. package/dist/cli/dispatch.mjs +18 -1
  54. package/dist/cli/dispatch.mjs.map +1 -1
  55. package/dist/cli/gate/context.d.mts +1 -0
  56. package/dist/cli/gate/context.d.mts.map +1 -1
  57. package/dist/cli/gate/context.mjs +14 -1
  58. package/dist/cli/gate/context.mjs.map +1 -1
  59. package/dist/cli/gate/gates/consistency-check.d.mts +1 -0
  60. package/dist/cli/gate/gates/consistency-check.d.mts.map +1 -1
  61. package/dist/cli/gate/gates/consistency-check.mjs +1 -0
  62. package/dist/cli/gate/gates/consistency-check.mjs.map +1 -1
  63. package/dist/cli/gate/gates/review-clean.d.mts +1 -0
  64. package/dist/cli/gate/gates/review-clean.d.mts.map +1 -1
  65. package/dist/cli/gate/gates/review-clean.mjs +1 -0
  66. package/dist/cli/gate/gates/review-clean.mjs.map +1 -1
  67. package/dist/cli/gate/gates/verify-approved.d.mts +1 -0
  68. package/dist/cli/gate/gates/verify-approved.d.mts.map +1 -1
  69. package/dist/cli/gate/gates/verify-approved.mjs +1 -0
  70. package/dist/cli/gate/gates/verify-approved.mjs.map +1 -1
  71. package/dist/cli/gate/registry.d.mts.map +1 -1
  72. package/dist/cli/gate/registry.mjs +9 -1
  73. package/dist/cli/gate/registry.mjs.map +1 -1
  74. package/dist/cli/host/detect.mjs +1 -1
  75. package/dist/cli/host/detect.mjs.map +1 -1
  76. package/dist/cli/install/find-workspace-framework-version.d.mts +16 -0
  77. package/dist/cli/install/find-workspace-framework-version.d.mts.map +1 -0
  78. package/dist/cli/install/find-workspace-framework-version.mjs +85 -0
  79. package/dist/cli/install/find-workspace-framework-version.mjs.map +1 -0
  80. package/dist/cli/install/install-from-source.d.mts +10 -0
  81. package/dist/cli/install/install-from-source.d.mts.map +1 -0
  82. package/dist/cli/install/install-from-source.mjs +271 -0
  83. package/dist/cli/install/install-from-source.mjs.map +1 -0
  84. package/dist/cli/install/install-kernel.d.mts.map +1 -1
  85. package/dist/cli/install/install-kernel.mjs +24 -0
  86. package/dist/cli/install/install-kernel.mjs.map +1 -1
  87. package/dist/cli/install/legacy-paths.d.mts +33 -11
  88. package/dist/cli/install/legacy-paths.d.mts.map +1 -1
  89. package/dist/cli/install/legacy-paths.mjs +163 -39
  90. package/dist/cli/install/legacy-paths.mjs.map +1 -1
  91. package/dist/cli/install/runtime-detect.mjs +1 -1
  92. package/dist/cli/install/runtime-detect.mjs.map +1 -1
  93. package/dist/cli/install/runtime-migrate.d.mts +34 -14
  94. package/dist/cli/install/runtime-migrate.d.mts.map +1 -1
  95. package/dist/cli/install/runtime-migrate.mjs +63 -30
  96. package/dist/cli/install/runtime-migrate.mjs.map +1 -1
  97. package/dist/cli/install/transforms/codex.d.mts.map +1 -1
  98. package/dist/cli/install/transforms/codex.mjs +28 -17
  99. package/dist/cli/install/transforms/codex.mjs.map +1 -1
  100. package/dist/cli/skill-author/contract.mjs +2 -2
  101. package/dist/cli/skill-author/contract.mjs.map +1 -1
  102. package/dist/cli/verify-proof/audit.d.mts +34 -0
  103. package/dist/cli/verify-proof/audit.d.mts.map +1 -0
  104. package/dist/cli/verify-proof/audit.mjs +53 -0
  105. package/dist/cli/verify-proof/audit.mjs.map +1 -0
  106. package/dist/cli/verify-proof/exec.d.mts +20 -0
  107. package/dist/cli/verify-proof/exec.d.mts.map +1 -0
  108. package/dist/cli/verify-proof/exec.mjs +74 -0
  109. package/dist/cli/verify-proof/exec.mjs.map +1 -0
  110. package/dist/cli/verify-proof/idl/index.d.mts +2 -0
  111. package/dist/cli/verify-proof/idl/index.d.mts.map +1 -0
  112. package/dist/cli/verify-proof/idl/index.mjs +13 -0
  113. package/dist/cli/verify-proof/idl/index.mjs.map +1 -0
  114. package/dist/cli/verify-proof/idl/types.d.ts +10 -0
  115. package/dist/cli/verify-proof/idl/types.d.ts.map +1 -0
  116. package/dist/cli/verify-proof/idl/types.js +10 -0
  117. package/dist/cli/verify-proof/idl/types.js.map +1 -0
  118. package/dist/cli/verify-proof/manifest-validator.d.mts +19 -0
  119. package/dist/cli/verify-proof/manifest-validator.d.mts.map +1 -0
  120. package/dist/cli/verify-proof/manifest-validator.mjs +182 -0
  121. package/dist/cli/verify-proof/manifest-validator.mjs.map +1 -0
  122. package/dist/cli/verify-proof/resolver.d.mts +105 -0
  123. package/dist/cli/verify-proof/resolver.d.mts.map +1 -0
  124. package/dist/cli/verify-proof/resolver.mjs +320 -0
  125. package/dist/cli/verify-proof/resolver.mjs.map +1 -0
  126. package/dist/cli/verify-proof/runtime-detect.d.mts +30 -0
  127. package/dist/cli/verify-proof/runtime-detect.d.mts.map +1 -0
  128. package/dist/cli/verify-proof/runtime-detect.mjs +209 -0
  129. package/dist/cli/verify-proof/runtime-detect.mjs.map +1 -0
  130. package/dist/cli/verify-proof/trust.d.mts +70 -0
  131. package/dist/cli/verify-proof/trust.d.mts.map +1 -0
  132. package/dist/cli/verify-proof/trust.mjs +174 -0
  133. package/dist/cli/verify-proof/trust.mjs.map +1 -0
  134. package/dist/driver-sdk/conformance.d.ts +41 -0
  135. package/dist/driver-sdk/conformance.d.ts.map +1 -0
  136. package/dist/driver-sdk/conformance.js +123 -0
  137. package/dist/driver-sdk/conformance.js.map +1 -0
  138. package/dist/driver-sdk/errors.d.ts +75 -0
  139. package/dist/driver-sdk/errors.d.ts.map +1 -0
  140. package/dist/driver-sdk/errors.js +80 -0
  141. package/dist/driver-sdk/errors.js.map +1 -0
  142. package/dist/driver-sdk/idl.d.ts +221 -0
  143. package/dist/driver-sdk/idl.d.ts.map +1 -0
  144. package/dist/driver-sdk/idl.js +140 -0
  145. package/dist/driver-sdk/idl.js.map +1 -0
  146. package/dist/driver-sdk/index.d.ts +28 -0
  147. package/dist/driver-sdk/index.d.ts.map +1 -0
  148. package/dist/driver-sdk/index.js +28 -0
  149. package/dist/driver-sdk/index.js.map +1 -0
  150. package/dist/driver-sdk/manifest.d.ts +93 -0
  151. package/dist/driver-sdk/manifest.d.ts.map +1 -0
  152. package/dist/driver-sdk/manifest.js +12 -0
  153. package/dist/driver-sdk/manifest.js.map +1 -0
  154. package/dist/driver-sdk/retry.d.ts +33 -0
  155. package/dist/driver-sdk/retry.d.ts.map +1 -0
  156. package/dist/driver-sdk/retry.js +50 -0
  157. package/dist/driver-sdk/retry.js.map +1 -0
  158. package/dist/plugin/.claude-plugin/plugin.json +4 -1
  159. package/dist/plugin/agents/apt-planner.md +39 -7
  160. package/dist/plugin/skills/apt/SKILL.md +75 -6
  161. package/dist/plugin/skills/apt-caveman/SKILL.md +64 -0
  162. package/dist/plugin/skills/apt-debug/SKILL.md +36 -4
  163. package/dist/plugin/skills/apt-debug/appendices/diagnose-discipline.md +2 -11
  164. package/dist/plugin/skills/apt-discuss/SKILL.md +4 -4
  165. package/dist/plugin/skills/apt-discuss/appendices/grill-discipline.md +2 -11
  166. package/dist/plugin/skills/apt-discuss/appendices/zoom-out-helper.md +0 -8
  167. package/dist/plugin/skills/apt-execute/SKILL.md +27 -4
  168. package/dist/plugin/skills/apt-execute/appendices/tdd-mode.md +2 -10
  169. package/dist/plugin/skills/apt-fan-out/SKILL.md +36 -1
  170. package/dist/plugin/skills/apt-handoff/SKILL.md +228 -0
  171. package/dist/plugin/skills/apt-improve/DEEPENING.md +0 -8
  172. package/dist/plugin/skills/apt-improve/INTERFACE-DESIGN.md +0 -8
  173. package/dist/plugin/skills/apt-improve/LANGUAGE.md +0 -8
  174. package/dist/plugin/skills/apt-improve/SKILL.md +4 -4
  175. package/dist/plugin/skills/apt-plan/SKILL.md +73 -5
  176. package/dist/plugin/skills/apt-plan/adapters/conductor.md +1 -1
  177. package/dist/plugin/skills/apt-pr-review/SKILL.md +1 -1
  178. package/dist/plugin/skills/apt-prototype/LOGIC.md +0 -8
  179. package/dist/plugin/skills/apt-prototype/SKILL.md +4 -4
  180. package/dist/plugin/skills/apt-prototype/UI.md +0 -8
  181. package/dist/plugin/skills/apt-quick/SKILL.md +31 -1
  182. package/dist/plugin/skills/apt-research/SKILL.md +526 -0
  183. package/dist/plugin/skills/apt-research/appendices/budget-loop.md +397 -0
  184. package/dist/plugin/skills/apt-research/appendices/claim-graph-schema.md +206 -0
  185. package/dist/plugin/skills/apt-research/appendices/domain-tools.md +236 -0
  186. package/dist/plugin/skills/apt-resume/SKILL.md +54 -31
  187. package/dist/plugin/skills/apt-run/SKILL.md +114 -16
  188. package/dist/plugin/skills/apt-setup/SKILL.md +97 -8
  189. package/dist/plugin/skills/apt-ship/SKILL.md +165 -9
  190. package/dist/plugin/skills/apt-spar/SKILL.md +84 -23
  191. package/dist/plugin/skills/apt-triage/AGENT-BRIEF.md +0 -8
  192. package/dist/plugin/skills/apt-triage/OUT-OF-SCOPE.md +0 -7
  193. package/dist/plugin/skills/apt-triage/SKILL.md +2 -2
  194. package/dist/plugin/skills/apt-update/SKILL.md +74 -17
  195. package/dist/plugin/skills/apt-verify-proof/SKILL.md +87 -1
  196. package/dist/plugin/skills/apt-zoom-out/SKILL.md +3 -3
  197. package/dist/schemas/quick-task.d.ts +17 -17
  198. package/dist/schemas/quick-task.d.ts.map +1 -1
  199. package/dist/schemas/quick-task.js +2 -2
  200. package/dist/schemas/quick-task.js.map +1 -1
  201. package/dist/types/config.d.ts +33 -0
  202. package/dist/types/config.d.ts.map +1 -1
  203. package/dist/types/state.d.ts +1 -1
  204. package/dist/types/state.d.ts.map +1 -1
  205. package/dist/types/task-record.d.ts +1 -1
  206. package/dist/types/task-record.d.ts.map +1 -1
  207. package/drivers/.gitkeep +0 -0
  208. package/drivers/api/README.md +40 -0
  209. package/drivers/api/driver.mjs +59 -0
  210. package/drivers/api/manifest.json +26 -0
  211. package/drivers/browser/README.md +105 -0
  212. package/drivers/browser/driver.mjs +134 -0
  213. package/drivers/browser/manifest.json +35 -0
  214. package/drivers/cli/README.md +44 -0
  215. package/drivers/cli/driver.mjs +62 -0
  216. package/drivers/cli/manifest.json +28 -0
  217. package/drivers/electron/README.md +64 -0
  218. package/drivers/electron/driver.mjs +87 -0
  219. package/drivers/electron/manifest.json +37 -0
  220. package/package.json +138 -133
  221. package/prompts/planner.md +1 -1
  222. package/prompts/spec_writer.md +1 -1
  223. package/skills/apt/SKILL.md +75 -6
  224. package/skills/apt-caveman/SKILL.md +64 -0
  225. package/skills/apt-debug/SKILL.md +36 -4
  226. package/skills/apt-debug/appendices/diagnose-discipline.md +2 -11
  227. package/skills/apt-discuss/SKILL.md +4 -4
  228. package/skills/apt-discuss/appendices/grill-discipline.md +2 -11
  229. package/skills/apt-discuss/appendices/zoom-out-helper.md +0 -8
  230. package/skills/apt-execute/SKILL.md +27 -4
  231. package/skills/apt-execute/appendices/tdd-mode.md +2 -10
  232. package/skills/apt-fan-out/SKILL.md +36 -1
  233. package/skills/apt-handoff/SKILL.md +228 -0
  234. package/skills/apt-improve/DEEPENING.md +0 -8
  235. package/skills/apt-improve/INTERFACE-DESIGN.md +0 -8
  236. package/skills/apt-improve/LANGUAGE.md +0 -8
  237. package/skills/apt-improve/SKILL.md +4 -4
  238. package/skills/apt-plan/SKILL.md +73 -5
  239. package/skills/apt-plan/adapters/conductor.md +1 -1
  240. package/skills/apt-planner.md +17 -1
  241. package/skills/apt-pr-review/SKILL.md +1 -1
  242. package/skills/apt-prototype/LOGIC.md +0 -8
  243. package/skills/apt-prototype/SKILL.md +4 -4
  244. package/skills/apt-prototype/UI.md +0 -8
  245. package/skills/apt-quick/SKILL.md +31 -1
  246. package/skills/apt-research/SKILL.md +526 -0
  247. package/skills/apt-research/appendices/budget-loop.md +397 -0
  248. package/skills/apt-research/appendices/claim-graph-schema.md +206 -0
  249. package/skills/apt-research/appendices/domain-tools.md +236 -0
  250. package/skills/apt-resume/SKILL.md +54 -31
  251. package/skills/apt-run/SKILL.md +114 -16
  252. package/skills/apt-setup/SKILL.md +97 -8
  253. package/skills/apt-ship/SKILL.md +165 -9
  254. package/skills/apt-spar/SKILL.md +84 -23
  255. package/skills/apt-triage/AGENT-BRIEF.md +0 -8
  256. package/skills/apt-triage/OUT-OF-SCOPE.md +0 -7
  257. package/skills/apt-triage/SKILL.md +2 -2
  258. package/skills/apt-update/SKILL.md +74 -17
  259. package/skills/apt-verify-proof/SKILL.md +87 -1
  260. package/skills/apt-zoom-out/SKILL.md +3 -3
  261. package/src/cli/commands/adr.mjs +1 -1
  262. package/src/cli/commands/audit-branch-current.mjs +250 -0
  263. package/src/cli/commands/audit.mjs +13 -2
  264. package/src/cli/commands/check-version.mjs +20 -1
  265. package/src/cli/commands/context.mjs +3 -3
  266. package/src/cli/commands/coverage-check.mjs +126 -44
  267. package/src/cli/commands/detect-runtime.mjs +143 -0
  268. package/src/cli/commands/driver-doctor.mjs +294 -0
  269. package/src/cli/commands/gate.mjs +15 -0
  270. package/src/cli/commands/init.mjs +9 -6
  271. package/src/cli/commands/install-from-source.mjs +1 -0
  272. package/src/cli/commands/modes.mjs +1 -1
  273. package/src/cli/commands/route.mjs +42 -1
  274. package/src/cli/commands/triage.mjs +1 -1
  275. package/src/cli/config/load.mjs +9 -3
  276. package/src/cli/coordination/auto-emit-artifact-ready.mjs +1 -1
  277. package/src/cli/coordination/event-schema.mjs +19 -0
  278. package/src/cli/coverage-check/user-outcomes.mjs +273 -0
  279. package/src/cli/dispatch.mjs +17 -1
  280. package/src/cli/gate/context.mjs +20 -1
  281. package/src/cli/gate/gates/consistency-check.mjs +1 -0
  282. package/src/cli/gate/gates/review-clean.mjs +1 -0
  283. package/src/cli/gate/gates/verify-approved.mjs +1 -0
  284. package/src/cli/gate/registry.mjs +11 -1
  285. package/src/cli/host/detect.mjs +1 -1
  286. package/src/cli/install/find-workspace-framework-version.mjs +88 -0
  287. package/src/cli/install/install-from-source.mjs +276 -0
  288. package/src/cli/install/install-kernel.mjs +24 -0
  289. package/src/cli/install/legacy-paths.mjs +164 -39
  290. package/src/cli/install/runtime-detect.mjs +1 -1
  291. package/src/cli/install/runtime-migrate.mjs +63 -30
  292. package/src/cli/install/transforms/codex.mjs +26 -17
  293. package/src/cli/skill-author/contract.mjs +2 -2
  294. package/src/cli/verify-proof/.gitkeep +0 -0
  295. package/src/cli/verify-proof/audit.mjs +55 -0
  296. package/src/cli/verify-proof/exec.mjs +74 -0
  297. package/src/cli/verify-proof/idl/index.mjs +23 -0
  298. package/src/cli/verify-proof/idl/types.ts +42 -0
  299. package/src/cli/verify-proof/manifest-schema.json +212 -0
  300. package/src/cli/verify-proof/manifest-validator.mjs +184 -0
  301. package/src/cli/verify-proof/resolver.mjs +330 -0
  302. package/src/cli/verify-proof/runtime-detect.mjs +211 -0
  303. package/src/cli/verify-proof/trust.mjs +187 -0
  304. package/templates/adr-format.md +0 -8
  305. package/templates/aperant-claude-md-appendix.md +1 -1
  306. package/templates/context-format.md +1 -9
  307. package/templates/proof-verification.md +51 -8
  308. package/workflows/verify-proof.md +130 -19
@@ -1,12 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/grill-with-docs
4
- Licensed under MIT. Modifications: ported as an apt:discuss posture loader,
5
- extended with the validated 100-token reframe sentence and the
6
- autonomy-aware degradation table from the Pocock adoption brainstorm
7
- (Architectural principles to lock §2).
8
- -->
9
-
10
1
  # Grill Discipline — apt:discuss posture loader
11
2
 
12
3
  This appendix loads into `apt:discuss`'s reasoning context whenever the
@@ -15,7 +6,7 @@ skill is invoked in decision-lock posture (or as a sub-step inside
15
6
  artifacts:
16
7
 
17
8
  1. The 100-token **reframe sentence** validated by the V2 grill-comparison
18
- experiment (43/44 vs 38/44 blind-judge score against Pocock's verbatim
9
+ experiment (43/44 vs 38/44 blind-judge score against the verbatim
19
10
  `grill-with-docs`).
20
11
  2. The **autonomy-aware degradation table** that prevents full-auto runs
21
12
  from grinding to a halt grilling every gray area.
@@ -98,7 +89,7 @@ where the user has a concrete task with implicit gray areas). The
98
89
  options) does NOT load this appendix; brainstorm has its own posture
99
90
  encoded in apt:discuss's `<objective>` block.
100
91
 
101
- `apt:zoom-out` (a sibling skill, also Pocock-adopted) does NOT load
92
+ `apt:zoom-out` (a sibling skill, also adopted) does NOT load
102
93
  this appendix. Zoom-out is descriptive ("show me the broader picture"),
103
94
  not normative ("lock this decision"). Loading grill-discipline there
104
95
  would mis-fire the reframe sentence on a read-only operation.
@@ -1,11 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/zoom-out
4
- Licensed under MIT. Modifications: ported as a loaded-helper for apt:discuss
5
- brainstorm mode so the discipline activates without spawning the full
6
- apt:zoom-out skill (the latter is a router-invocable verb on its own).
7
- -->
8
-
9
1
  # Zoom-Out Helper — apt:discuss brainstorm mode loaded helper
10
2
 
11
3
  This appendix loads into `apt:discuss` brainstorm mode when the user's
@@ -15,7 +15,7 @@ execution_modes:
15
15
  - auto
16
16
  - step
17
17
  allowed-tools: "Read, Write, Edit, Bash, Grep, Glob"
18
- argument-hint: "apt:execute [--continue] [--subtask <id>] [--parallel] [--wave <N>] [--tdd] [--no-tdd]"
18
+ argument-hint: "apt:execute [--continue] [--subtask <id>] [--parallel] [--wave <N>] [--tdd] [--no-tdd] [--spar]"
19
19
  gates:
20
20
  - constitution-read
21
21
  - constitution-coverage
@@ -139,7 +139,7 @@ Before loading context, determine execution mode:
139
139
 
140
140
  4. **If Sequential Mode:** proceed to Section 1 below (existing behavior, unchanged).
141
141
 
142
- ### 0a.1. TDD Discipline Detection (Pocock adoption AC3)
142
+ ### 0a.1. TDD Discipline Detection
143
143
 
144
144
  Compute whether the vertical-tracer-bullet TDD discipline is active for
145
145
  this run. The `<tdd_iron_law>` block in Section 3c is gated on this
@@ -168,13 +168,13 @@ else:
168
168
 
169
169
  Carry `tdd_active` forward to Section 3c. When `tdd_active === false`,
170
170
  the iron-law block is skipped entirely and execute behaves identically
171
- to the pre-Pocock single-commit flow. When `tdd_active === true`, the
171
+ to the pre-vertical-slice single-commit flow. When `tdd_active === true`, the
172
172
  red-green-refactor sequence is mandatory and audited by gate G9.
173
173
 
174
174
  **The QUICK exemption is a constraint, not a toggle.** A user who passes
175
175
  `--tdd` on a QUICK-routed task gets `tdd_active = false` and a one-line
176
176
  note in the run report: "TDD requested but skipped — QUICK Fast Path
177
- Guarantee (ID-05)". The Pocock appendix
177
+ Guarantee (ID-05)". The Aperant appendix
178
178
  `appendices/tdd-mode.md` carries the rationale.
179
179
 
180
180
  ## 1. Load Context
@@ -476,6 +476,29 @@ Execution complete:
476
476
  Next: /apt:verify
477
477
  ```
478
478
 
479
+ ### 4a. --spar flag (FRAMEWORK-RFC-001)
480
+
481
+ If `$ARGUMENTS` contained `--spar`, dispatch `/apt:spar` against the
482
+ just-completed implementation before reporting Next.
483
+
484
+ Topic frame: 1-2 sentences derived from `build-progress.json` summarizing
485
+ the diff that just landed (e.g. "N subtasks completed against the M-file
486
+ plan; the largest change touched <path>"). If `build-progress.json` is
487
+ missing or empty (corner case), use the task description from
488
+ `.aperant/state.json` as a graceful fallback.
489
+
490
+ Same `--timeout-ms 120000` pipeline-mode budget and NO `--rounds` flag
491
+ (per FRAMEWORK-BUG-038 — pipeline gates always defer to the skill
492
+ default). When merged-config `spar.partner` is set, append `--with <partner>`.
493
+
494
+ ```
495
+ /apt:spar --timeout-ms 120000 [--with <partner>] <topic-frame-from-build-progress.json>
496
+ ```
497
+
498
+ After spar returns, append the termination headline + Layer 2 path
499
+ (`.aperant/spar/<slug>-<ts>.md`) into the report output so the user can
500
+ review findings before invoking `/apt:verify`.
501
+
479
502
  ## 5. Wave-Parallel Execution
480
503
 
481
504
  When wave mode is active (determined in Section 0), execution follows the wave structure instead of flat sequential order. This is the throughput multiplier — independent subtasks run in parallel across multiple agent contexts.
@@ -1,16 +1,8 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/tdd
4
- Licensed under MIT. Modifications: ported as an apt:execute appendix
5
- gated by `tdd_active` (config.coding.tdd_default || --tdd flag) and
6
- made QUICK-exempt per Aperant's Fast Path Guarantee (ID-05).
7
- -->
8
-
9
1
  # TDD Mode — Vertical Tracer-Bullet Discipline (apt:execute appendix)
10
2
 
11
3
  This appendix loads into `apt:execute`'s context when `tdd_active === true`
12
4
  (see SKILL.md §0a.1). It carries the vertical-tracer-bullet discipline
13
- Pocock's `tdd` skill captured. The audit gate G9 (`tdd-iron-law`) enforces
5
+ the `tdd` skill captured. The audit gate G9 (`tdd-iron-law`) enforces
14
6
  the commit order; this prose explains the **why**.
15
7
 
16
8
  ## Why vertical tracer bullets, not horizontal layers
@@ -90,7 +82,7 @@ that their flag was overridden by the constraint.
90
82
  ## Backward-compat alias
91
83
 
92
84
  The legacy `config.tdd.iron_law` key continues to enable TDD for
93
- projects that adopted Aperant before the Pocock content-format
85
+ projects that adopted Aperant before content-format
94
86
  upgrade. The new computation rolls it into `tdd_active`:
95
87
 
96
88
  ```
@@ -106,9 +106,44 @@ node packages/framework/bin/apt-tools.mjs team list .
106
106
 
107
107
  Each worker's row uses its `APT_AGENT_ID=fanout-${batch_id}-${task_id}`. A worker is "done" when its corresponding task's `lifecycle_phase` is one of `closed`, `shipped-pending-merge`, or `blocked`.
108
108
 
109
+ **On each poll, re-render the multi-task phase rail verbatim** — one boxed panel per worker, branch glyphs `┌─ │ └─` separating panels, status glyphs `✓` (done) / `●` (active) / `○` (pending), inline metrics on completed rows. Pull metrics from each worker's `build-progress.json` / `qa_signoff.json` / `review.json` (see paths in `.aperant/tasks/{task_id}/`):
110
+
111
+ ```
112
+ [APT] Fan-out status: {N} workers
113
+ ┌─ {task 1 short name} ─────────────────────────────
114
+ │ Phase 1 Plan ✓
115
+ │ Phase 2 Execute ✓ 7 commits, 81 tests
116
+ │ Phase 3 Verify ✓ APPROVED 9/10/9/9
117
+ │ Phase 4 Review ✓ APPROVE 9/9/9/10/10, 5 findings fixed
118
+ │ Phase 5 Ship ● opening PR
119
+
120
+ └─ {task 2 short name} ─────────────────────────────
121
+ Phase 1 Plan ✓
122
+ Phase 2 Execute ✓ 14 commits, 129 tests
123
+ Phase 3 Verify ● running
124
+ Phase 4 Review ○
125
+ Phase 5 Ship ○
126
+
127
+ Churned for {Xm Ys} · {K} local agents still running
128
+ ```
129
+
130
+ The first panel uses `┌─ ... │` (top-with-stem); the LAST panel uses `└─ ... ` (bottom corner). Footer line: "Churned" = elapsed since the most recent lifecycle event across all in-flight workers; "K local agents still running" = count of workers whose `lifecycle_phase` is non-terminal AND `assigned_to` is non-null.
131
+
109
132
  ## 5. Report
110
133
 
111
- When all workers reach a terminal state, emit one consolidated summary: which tasks closed (verdict + PR URL), which are awaiting merge, which blocked. Recommend `/apt:close-task --all` for the post-merge sweep.
134
+ When all workers reach a terminal state, render the rail one final time. For each shipped worker (lifecycle `shipped-pending-merge` + `pr_url` set), collapse that panel to the SHIPPED variant:
135
+
136
+ ```
137
+ [APT] Fan-out complete
138
+ ┌─ {task 1 short name} ────────────────────── ✅ SHIPPED
139
+ │ Plan ✓ Execute ✓ Verify ✓ Review ✓ Ship ✓
140
+ │ PR #{N}: {url}
141
+
142
+ └─ {task 2 short name} ─────────────────────── ⚠ BLOCKED
143
+ {one-line reason}
144
+ ```
145
+
146
+ Mix SHIPPED / BLOCKED / in-flight variants in the same rail. Below the panel, emit one consolidated summary: which tasks closed (verdict + PR URL), which are awaiting merge, which blocked. Recommend `/apt:close-task --all` for the post-merge sweep. The `[APT] Fan-out` header lines above each rail are the backward-compat markers for external log-grep tooling — keep them.
112
147
 
113
148
  </process>
114
149
 
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: apt:handoff
3
+ description: "Agent-to-agent handoff — compact current conversation into a HANDOFF artifact in the repo for a fresh agent to pick up"
4
+ apt-skill-version: {{APT_VERSION}}
5
+ stage: pause
6
+ intent: capture
7
+ when_to_use: "An agent (not a human) needs to transfer in-flight work to a different agent — different model, different CLI, a fan-out peer, or a fresh context window. Writes a HANDOFF artifact under .aperant/ so the receiver picks up exactly where the sender left off. NOT for human end-of-day stops (use /apt:pause) and NOT for harness auto-compact (the query loop handles that itself)."
8
+ user_invocable: true
9
+ internal: false
10
+ spawns_agent: false
11
+ agent_name: null
12
+ task_context: none
13
+ default_execution_mode: auto
14
+ execution_modes:
15
+ - auto
16
+ - step
17
+ allowed-tools: "Bash, Read, Write"
18
+ argument-hint: "apt:handoff [what the next session will focus on]"
19
+ gates: []
20
+ ---
21
+ <objective>
22
+ Compact the current conversation into a HANDOFF document so a different agent — different model, different CLI, fan-out peer, or fresh context window — can pick up the work without re-discovering everything you already know.
23
+
24
+ Writes the handoff to `.aperant/handoffs/{id}/HANDOFF.md` (or `{task_dir}/handoffs/{id}/HANDOFF.md` when inside a routed task) so the artifact lives with the repo, survives across machines, and is discoverable by `/apt:resume` and team-status tooling.
25
+
26
+ **Use when:** an agent decides to transfer the work mid-flight. Examples — sender hit context-budget cap, the next phase needs a different model (e.g. Codex for a heavy refactor), a fan-out conductor is sharding scope to peers, or a planning agent is handing a locked plan to an executor.
27
+
28
+ **Do NOT use when:**
29
+ - The human operator wants to stop — use `/apt:pause` (it stashes uncommitted work and updates `CONTINUE_INDEX.md`).
30
+ - The harness is about to auto-compact — the query loop handles that itself; agents executing plans must checkpoint to `build-progress.json` instead.
31
+ - A new task is starting fresh — use `/apt` (router) or `/apt:plan`.
32
+ </objective>
33
+
34
+ <your_environment>
35
+ - **Working directory:** The project root (or current task worktree if `state.active_tasks[taskId].worktree_path` is set)
36
+ - **apt-tools path:** `node packages/framework/bin/apt-tools.mjs` or the locally installed `apt-tools` binary
37
+ - **Constitution:** Read `AGENTS.md` in the project root if it exists
38
+ - **Handoff index:** `.aperant/HANDOFFS_INDEX.md`
39
+ - **Sibling skills:** `/apt:pause` (human stop), `/apt:resume` (restore from CONTINUE *or* HANDOFF), `/apt:fan-out` (parallel peers)
40
+ </your_environment>
41
+
42
+ <state_files>
43
+ ## State Files
44
+
45
+ **Reads:**
46
+ - `AGENTS.md` — Project constitution
47
+ - Active Aperant artifacts for the current task, if any:
48
+ - `{task_dir}/spec.md`, `{task_dir}/implementation_plan.json`, `{task_dir}/build-progress.json`
49
+ - `{task_dir}/qa_signoff.json`, `{task_dir}/review.json`
50
+ - `.aperant/debug/*/DEBUG.md`, `.aperant/quick/*/TASK.md`
51
+ - Git state (branch, uncommitted changes, recent commits)
52
+ - `.aperant/state.json` — active tasks, worktree paths
53
+
54
+ **Writes:**
55
+ - `{task_dir}/handoffs/{handoff-id}/HANDOFF.md` — if inside a routed task
56
+ - `.aperant/handoffs/{handoff-id}/HANDOFF.md` — if ad-hoc work outside any task
57
+ - `.aperant/HANDOFFS_INDEX.md` — index of all open handoffs
58
+
59
+ **Does NOT touch:**
60
+ - The git working tree. Handoffs are read-only against code. If there are uncommitted changes the sender intends the receiver to keep working on, reference them in the HANDOFF (path + status from `git status --short`) — do NOT stash. Stashing is `/apt:pause` semantics, not `/apt:handoff`.
61
+ </state_files>
62
+
63
+ <process>
64
+
65
+ ## 1. Determine Handoff Location
66
+
67
+ Generate a handoff id: `handoff-{YYYYMMDD-HHMM}-{short-slug-of-next-focus}` (e.g. `handoff-20260522-1430-finish-mcp-token-rotation`).
68
+
69
+ **If inside a routed task** (task_dir is known from the conversation, or `state.json` has an active task for the current branch):
70
+ - Write to `{task_dir}/handoffs/{handoff-id}/HANDOFF.md`
71
+
72
+ **If ad-hoc work** (manual coding, not routed through /apt):
73
+ - Write to `.aperant/handoffs/{handoff-id}/HANDOFF.md`
74
+
75
+ ```bash
76
+ mkdir -p {handoff_dir}
77
+ ```
78
+
79
+ ## 2. Gather Current State
80
+
81
+ ### 2a. Git State
82
+ ```bash
83
+ git branch --show-current
84
+ git status --short
85
+ git log --oneline -5
86
+ git stash list
87
+ ```
88
+
89
+ ### 2b. Active Aperant Artifacts
90
+ Check and read status of any of: `implementation_plan.json`, `build-progress.json`, `qa_signoff.json`, `review.json`, `.aperant/debug/*/DEBUG.md`.
91
+
92
+ ### 2c. Conversation Context
93
+ From the current conversation, extract:
94
+ - What task was being worked on and the user's framing of why
95
+ - Key decisions made + rationale (especially decisions NOT obvious from the diff)
96
+ - What was tried, what worked, what failed and why
97
+ - Live blockers and open questions
98
+ - Any external state the receiver must check (running processes, deployed previews, CI runs, MCP server sessions)
99
+
100
+ ## 3. Write HANDOFF.md
101
+
102
+ Create `{handoff_dir}/HANDOFF.md`:
103
+
104
+ ```markdown
105
+ # Handoff: {one-line summary of what the next agent should focus on}
106
+
107
+ ## Session Info
108
+ - **Date:** {ISO datetime}
109
+ - **Sender:** {model + CLI, e.g. "Claude Opus 4.7 / Claude Code"}
110
+ - **Suggested receiver:** {model + CLI hint, or "any agent"}
111
+ - **Branch:** {current branch}
112
+ - **Worktree:** {worktree_path if task-isolated, else repo root}
113
+ - **Last commit:** {hash} — {message}
114
+ - **Task ID:** {task-id, if routed task; else "ad-hoc"}
115
+
116
+ ## Focus For The Receiver
117
+ {The single most important paragraph — what is the receiver supposed to DO next, in concrete terms. If the user passed args to /apt:handoff, that text drives this section.}
118
+
119
+ ## What Was Being Done
120
+ {Plain-language description of the current activity and how it fits the broader task.}
121
+
122
+ ## Decisions Made (do NOT relitigate)
123
+ - {decision 1} — {rationale}
124
+ - {decision 2} — {rationale}
125
+
126
+ ## Existing Artifacts (read these, do not duplicate)
127
+ - `{path or URL}` — {what it contains, why it matters}
128
+ - `{path or URL}` — {what it contains, why it matters}
129
+
130
+ > Reference paths and URLs instead of pasting content. PRDs, plans, ADRs, issues, commits, diffs, /apt:debug DEBUG.md, /apt:design DESIGN.md — link, don't copy.
131
+
132
+ ## Current State
133
+ - **Pipeline stage:** {plan | execute | verify | review | debug | design | quick | none}
134
+ - **Subtask progress:** {n}/{total} (if applicable, with the in-flight subtask id)
135
+ - **Uncommitted changes:** {yes/no — list files, do not stash}
136
+ - **External state the receiver must check:** {running dev servers, open PRs, MCP sessions, etc.}
137
+
138
+ ## Blockers
139
+ - {blocker 1 — what's needed to unblock, and which file/person/check resolves it}
140
+ - (none)
141
+
142
+ ## What Was Tried
143
+ - {approach 1} — {outcome}
144
+ - {approach 2} — {outcome}
145
+
146
+ ## Next Steps (ordered)
147
+ 1. {immediate next action}
148
+ 2. {following action}
149
+ 3. {…}
150
+
151
+ ## Suggested Skills
152
+ Tell the receiver which Aperant skills are likely to fire next. Map verbs to the live `/apt:*` registry — do NOT invent skill names.
153
+
154
+ - `/apt:resume` — first thing the receiver should run to load this handoff into context.
155
+ - `/apt:execute` — if a plan exists and subtasks remain.
156
+ - `/apt:debug` — if the open blocker is a reproducible bug without a known cause.
157
+ - `/apt:spar` — if the next decision wants a second-LLM challenge before committing.
158
+ - `/apt:plan` — if scope changed and the existing plan is stale.
159
+ - (omit any that don't apply)
160
+
161
+ ## Redaction Checklist
162
+ Before saving, scrub the HANDOFF for:
163
+ - [ ] API keys, bearer tokens, OAuth secrets (Anthropic, Stripe, Convex, GitHub, etc.)
164
+ - [ ] Database connection strings with passwords
165
+ - [ ] Personally identifiable information not already in the repo
166
+ - [ ] Internal URLs that should not leave the team
167
+ ```
168
+
169
+ ## 4. Update Handoff Index
170
+
171
+ Update `.aperant/HANDOFFS_INDEX.md`. Create with this header if it does not exist:
172
+ ```markdown
173
+ # Open Handoffs
174
+
175
+ | Focus | Branch | Date | Suggested receiver | Location |
176
+ |-------|--------|------|--------------------|----------|
177
+ ```
178
+
179
+ Append one row:
180
+ ```
181
+ | {focus (truncated to 60 chars)} | {branch} | {YYYY-MM-DD HH:MM} | {model hint or "any"} | {relative path to HANDOFF.md} |
182
+ ```
183
+
184
+ If a row already exists for this handoff path, update it instead of appending.
185
+
186
+ ## 5. Report
187
+
188
+ ```
189
+ Handoff written: {handoff_dir}/HANDOFF.md
190
+
191
+ Summary:
192
+ Focus: {one-line}
193
+ Branch: {branch}
194
+ Pipeline stage: {stage}
195
+ Suggested next skill: {/apt:resume → /apt:{stage}}
196
+ Open handoffs: {total count from index}
197
+
198
+ Receiver picks up with:
199
+ /apt:resume # discovers this handoff via HANDOFFS_INDEX.md
200
+ OR read {handoff_dir}/HANDOFF.md directly
201
+ ```
202
+
203
+ </process>
204
+
205
+ <notes>
206
+ ## Why this skill exists separately from /apt:pause
207
+
208
+ `/apt:pause` and `/apt:handoff` write the same shape of artifact but have different triggers and side effects:
209
+
210
+ | | `/apt:pause` | `/apt:handoff` |
211
+ |---|---|---|
212
+ | Trigger | Human types it | Agent decides mid-work |
213
+ | Audience | Future-you (same human) | A different agent |
214
+ | Uncommitted work | Stashes via `git stash` | Does NOT stash — references in-place |
215
+ | Index file | `.aperant/CONTINUE_INDEX.md` | `.aperant/HANDOFFS_INDEX.md` |
216
+ | Artifact name | `CONTINUE.md` | `HANDOFF.md` |
217
+ | Typical follow-up | Human runs `/apt:resume` hours/days later | Receiver agent runs `/apt:resume` immediately |
218
+
219
+ Keeping the index files separate lets `/apt:resume` distinguish "the human stopped here" from "another agent dropped this in your lap" when presenting recovery options.
220
+
221
+ ## Receiver contract
222
+
223
+ The receiver is expected to:
224
+ 1. Run `/apt:resume` (or read HANDOFF.md directly).
225
+ 2. Load the referenced artifacts (paths under "Existing Artifacts").
226
+ 3. Verify the listed external state still holds (e.g. dev server still running, PR still open).
227
+ 4. Delete the HANDOFF.md and its index row after picking up. `/apt:resume` handles the cleanup automatically; manual readers should do it themselves to keep `HANDOFFS_INDEX.md` from drifting.
228
+ </notes>
@@ -1,11 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/improve-codebase-architecture/DEEPENING.md
4
- Licensed under MIT. Modifications: scoped to Aperant's apt:improve
5
- Phase-1 explore step and aligned with the deletion-test priority
6
- rubric in Phase 2.
7
- -->
8
-
9
1
  # DEEPENING — Domain-modeling depth lens
10
2
 
11
3
  This lens asks: **does this area model the domain at the right depth?**
@@ -1,11 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/improve-codebase-architecture/INTERFACE-DESIGN.md
4
- Licensed under MIT. Modifications: scoped to Aperant's apt:improve
5
- Phase-1 explore step and aligned with apt:review Pass 4's boundary
6
- audit semantics (this lens is proactive; Pass 4 is reactive).
7
- -->
8
-
9
1
  # INTERFACE-DESIGN — Boundary-shape lens
10
2
 
11
3
  This lens asks: **are the boundaries between modules well-shaped?** Are
@@ -1,11 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/improve-codebase-architecture/LANGUAGE.md
4
- Licensed under MIT. Modifications: scoped to Aperant's apt:improve
5
- Phase-1 explore step and aligned with CONTEXT.md's aliases-to-avoid
6
- field — this lens reads that field to catch term conflations.
7
- -->
8
-
9
1
  # LANGUAGE — Naming-consistency lens
10
2
 
11
3
  This lens asks: **does the codebase use the same word for the same
@@ -22,15 +22,15 @@ gates: []
22
22
 
23
23
  # Improve — Proactive Refactor Discovery
24
24
 
25
- Open question #2 in the Pocock adoption spec was answered concretely:
25
+ Open question #2 in adoption spec was answered concretely:
26
26
  `apt:review` Pass 4 (architecture) is strictly **reactive** — it audits
27
27
  the current diff for boundary violations. The work-intent "look at this
28
28
  codebase and tell me what to refactor proactively" has no home today
29
29
  (users retrofit it onto `apt:discuss --brainstorm` or `/apt:roundtable`,
30
30
  both scope-mismatched). This skill is that home.
31
31
 
32
- **Pocock adoption attribution.** 3-phase workflow + DEEPENING /
33
- INTERFACE-DESIGN / LANGUAGE lenses ported from Matt Pocock's MIT-licensed
32
+ **Aperant adoption attribution.** 3-phase workflow + DEEPENING /
33
+ INTERFACE-DESIGN / LANGUAGE lenses ported from
34
34
  `improve-codebase-architecture` skill. Aperant-specific: spawns the
35
35
  `apt-improver` agent and references `apt-discuss/appendices/grill-discipline.md`
36
36
  as the canonical source for the autonomy-aware deepening loop rather than
@@ -118,7 +118,7 @@ The deepening loop produces a concrete refactor plan (which becomes
118
118
  - `INTERFACE-DESIGN.md` — boundary-shape lens
119
119
  - `LANGUAGE.md` — naming-consistency lens
120
120
 
121
- All three are ported from Matt Pocock's improve-codebase-architecture
121
+ All three are ported from 's improve-codebase-architecture
122
122
  skill with MIT attribution per AC15.
123
123
 
124
124
  ## Agent spawned
@@ -19,7 +19,7 @@ execution_modes:
19
19
  - plan-only
20
20
  - research
21
21
  allowed-tools: "Read, Grep, Glob, Write, Bash, WebSearch"
22
- argument-hint: "apt:plan [task description]"
22
+ argument-hint: "apt:plan [task description] [--spar]"
23
23
  gates:
24
24
  - constitution-read
25
25
  - constitution-coverage
@@ -33,7 +33,7 @@ Analyze a task, assess complexity, investigate the codebase, and produce a struc
33
33
  - **apt-tools path:** `node packages/framework/bin/apt-tools.mjs` or the locally installed `apt-tools` binary
34
34
  - **Prompts directory:** Installed alongside this command in the @aperant/framework package
35
35
  - **Constitution:** Read `AGENTS.md` in the project root if it exists — it defines project principles, tech stack, and conventions that override defaults
36
- - **Task directory:** `{task_dir}` — passed from the router. All plan artifacts (spec.md, implementation_plan.json) are written here, NOT to project root.
36
+ - **Task directory:** `{task_dir}` — passed from the router as an absolute main-repo path. All plan artifacts (spec.md, implementation_plan.json) are written here, NOT to project root and NOT to a worktree-local `.aperant/tasks/` directory.
37
37
  </your_environment>
38
38
 
39
39
  <state_files>
@@ -122,9 +122,9 @@ If `{task_dir}/design.md` exists (emitted by a prior `/apt:design` run), load it
122
122
 
123
123
  ## 5. Write Specification
124
124
 
125
- Create `spec.md` in the task directory (`{task_dir}` passed from the router, e.g. `.aperant/tasks/{task-id}/spec.md`).
125
+ Create `spec.md` in the task directory (`{task_dir}` passed from the router, e.g. `/abs/main/repo/.aperant/tasks/{task-id}/spec.md`). Do not use a relative `.aperant/tasks/{task-id}/spec.md` path when the agent is running in a worktree.
126
126
 
127
- **Content format branches on track (Fast Path Guarantee — Pocock adoption ID-05):**
127
+ **Content format branches on track (Fast Path Guarantee — ID-05):**
128
128
 
129
129
  ### 5.A. QUICK track — legacy 4-section format (hard-exempt from PRD upgrade)
130
130
 
@@ -161,6 +161,14 @@ and is committable as a second-consumer document. Section ordering is
161
161
  **load-bearing** — downstream tooling (`apt-tools coverage-check`,
162
162
  `apt-tools consistency check`) reads sections by header.
163
163
 
164
+ **Three orthogonal user-facing sections — keep them distinct.** User
165
+ Stories carry product motivation, User Outcomes carry the
166
+ verify-proof input contract, and Acceptance Criteria carry code-level
167
+ invariants. The three do NOT subsume each other; a STANDARD/DEEP spec
168
+ carries all three. See the `## User Outcomes` block below for the
169
+ verify-proof unit shape (Epic line + atomic outcomes + surface tags
170
+ + empty-with-note escape).
171
+
164
172
  ```markdown
165
173
  # Spec: {task title}
166
174
 
@@ -184,6 +192,29 @@ ships: new files, modified files, new flags, new config, new skills.}
184
192
  {persona}, when I {trigger}, I want {behavior} so I can {outcome}."
185
193
  Stories map 1:1 onto subtasks in implementation_plan.json.}
186
194
 
195
+ ## User Outcomes
196
+
197
+ {The verify-proof input contract. One bolded `**Epic:**` headline + N
198
+ atomic outcomes tagged by surface. Authors write the LITERAL string
199
+ `**ON**` — IDs are POSITIONAL and synthesized by the parser (the first
200
+ outcome row becomes `O1`, the second `O2`, etc.). Closed surface set:
201
+ `electron | web | cli | api | electron+web`. Optional cross-references
202
+ via `*(requires ON N)*` where `N` is the digit of a prior outcome's
203
+ position. For pure-refactor specs with no user-observable changes, the
204
+ body MAY be exactly `_No user-observable changes — pure refactor._`
205
+ (italic underscores required, exact em dash, period mandatory).
206
+ Coverage-check parses this section into a `user_outcomes` payload —
207
+ see the gate table below.}
208
+
209
+ **Epic:** {one-sentence user-facing capability headline}
210
+
211
+ - **ON** [surface]: {user does X; system shows/does Y}
212
+ - **ON** [surface]: {user does X; system shows/does Y} *(requires ON 1)*
213
+ - **ON** [electron+web]: {cross-surface outcome — runs twice, once per surface}
214
+
215
+ (Refactor-only escape:)
216
+ _No user-observable changes — pure refactor._
217
+
187
218
  ## Implementation Decisions
188
219
 
189
220
  {Load-bearing principles carried forward into every subtask. Format:
@@ -215,6 +246,25 @@ ID. Subtasks reference these IDs via their per-subtask
215
246
  plan-coverage-check input.}
216
247
  ```
217
248
 
249
+ **`## User Outcomes` is the verify-proof input contract (STANDARD/DEEP
250
+ only — QUICK is hard-exempt per ID-05 / Fast Path Guarantee).** The
251
+ section sits between `## User Stories` (product motivation prose) and
252
+ `## Implementation Decisions` (load-bearing engineering principles).
253
+ Coverage-check (`apt-tools coverage-check validate .`) parses the
254
+ section into a `user_outcomes` payload with this gate behavior:
255
+
256
+ | Header present? | Body shape | Gate result (v0.8.x) | v0.9.0 hard cutover |
257
+ |---|---|---|---|
258
+ | no | — | `warn` (migration deadline emitted) | `block` |
259
+ | yes | `outcomes` (≥1 `**ON**` row) | `pass` | `pass` |
260
+ | yes | exactly `_No user-observable changes — pure refactor._` | `pass` | `pass` |
261
+ | yes | empty (header but nothing under it) | `block` | `block` |
262
+
263
+ Closed surface set: `electron | web | cli | api | electron+web`. The
264
+ `electron+web` tag means the outcome runs on both surfaces during
265
+ verify-proof (split screenshot trees, two test entries in
266
+ `verification.json`).
267
+
218
268
  **Constraint — do NOT interview the user.** The PRD is synthesized from
219
269
  the task description + codebase investigation + AGENTS.md, not from a
220
270
  clarifying interview. If a section truly cannot be filled, write
@@ -309,7 +359,7 @@ When `status: warn` (non-blocking enforcement) and the user is in **auto mode**
309
359
 
310
360
  Create `implementation_plan.json` in the task directory (`{task_dir}/implementation_plan.json`).
311
361
 
312
- **Subtask schema branches on track (Pocock adoption ID-05 — Fast Path Guarantee).**
362
+ **Subtask schema branches on track.**
313
363
 
314
364
  ### 6.A. QUICK track / SIMPLE complexity — legacy flat subtask schema
315
365
 
@@ -454,6 +504,24 @@ Plan created:
454
504
  Next: /apt:execute
455
505
  ```
456
506
 
507
+ ### 9b. --spar flag (FRAMEWORK-RFC-001)
508
+
509
+ If `$ARGUMENTS` contained `--spar`, dispatch `/apt:spar` against the
510
+ just-written `spec.md` + `implementation_plan.json` before reporting Next.
511
+
512
+ Topic frame: the §1 Scope paragraph from `spec.md` (1-2 sentences). Same
513
+ `--timeout-ms 120000` pipeline-mode budget and NO `--rounds` flag (per
514
+ FRAMEWORK-BUG-038 — pipeline gates always defer to the skill default).
515
+ When merged-config `spar.partner` is set, append `--with <partner>`.
516
+
517
+ ```
518
+ /apt:spar --timeout-ms 120000 [--with <partner>] <topic-frame-from-spec.md-§Scope>
519
+ ```
520
+
521
+ After spar returns, append the termination headline + Layer 2 path
522
+ (`.aperant/spar/<slug>-<ts>.md`) into the report output so the user can
523
+ review findings before invoking `/apt:execute`.
524
+
457
525
  ### 9a. Mode-Aware Compact Suggestion (Human-in-the-Loop Only)
458
526
 
459
527
  Decide whether to show a compact suggestion by reading the **per-task autonomy** from state — not the global default, because the router asks per-task and stores the answer on the task record.
@@ -42,7 +42,7 @@ auto-stamped `terminal_id`.
42
42
 
43
43
  This replaces the earlier markdown-discipline emit step. The earlier
44
44
  step was correctly skipped on QUICK / SIMPLE classified tasks (Fast
45
- Path Guarantee, Pocock adoption ID-05) — moving the emit to a
45
+ Path Guarantee, ID-05) — moving the emit to a
46
46
  framework postcondition makes it work uniformly across QUICK, STANDARD,
47
47
  DEEP, and COMPLEX without violating the Fast Path Guarantee.
48
48
 
@@ -1081,7 +1081,7 @@ For every finding with `validation_status == "confirmed_valid"` AND `severity
1081
1081
  - `{REVIEWER_EVIDENCE}` — the finding's `evidence` field verbatim.
1082
1082
  3. Invoke codex using the shape configured at `.aperant/config.json:router.llm.providers.codex`:
1083
1083
  ```bash
1084
- codex exec --model gpt-5.3-codex --input-file /tmp/fp-gate-${FINDING_ID}.md
1084
+ codex exec --input-file /tmp/fp-gate-${FINDING_ID}.md
1085
1085
  ```
1086
1086
  Parse the JSON response `{verdict, reasoning, evidence_quote, severity_assessment}`.
1087
1087
  4. If `verdict == "falsify"`, set the finding's `validation_status = "dismissed_cross_model_falsification"` and copy the codex response into `fp_gate_result`. If `verdict == "confirm"`, pass through unchanged.
@@ -1,11 +1,3 @@
1
- <!--
2
- Adapted from Matt Pocock's MIT-licensed skill suite:
3
- https://github.com/mattpocock/skills/blob/main/skills/engineering/prototype/LOGIC.md
4
- Licensed under MIT. Modifications: scoped to terminal-app prototypes
5
- that validate state machines, protocols, and control flow. Aligned with
6
- the 5 universal rules in apt-prototype/SKILL.md.
7
- -->
8
-
9
1
  # LOGIC branch — Terminal app for state-machine validation
10
2
 
11
3
  When the user's question is about **behavior**, the prototype is a