@aperant/framework 0.8.1 → 0.8.4

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 (248) hide show
  1. package/CHANGELOG.md +287 -1
  2. package/agents/apt-planner.md +5 -4
  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/detect-runtime.d.mts +6 -0
  17. package/dist/cli/commands/detect-runtime.d.mts.map +1 -0
  18. package/dist/cli/commands/detect-runtime.mjs +136 -0
  19. package/dist/cli/commands/detect-runtime.mjs.map +1 -0
  20. package/dist/cli/commands/driver-doctor.d.mts +29 -0
  21. package/dist/cli/commands/driver-doctor.d.mts.map +1 -0
  22. package/dist/cli/commands/driver-doctor.mjs +291 -0
  23. package/dist/cli/commands/driver-doctor.mjs.map +1 -0
  24. package/dist/cli/commands/gate.mjs +14 -0
  25. package/dist/cli/commands/gate.mjs.map +1 -1
  26. package/dist/cli/commands/init.d.mts.map +1 -1
  27. package/dist/cli/commands/init.mjs +9 -6
  28. package/dist/cli/commands/init.mjs.map +1 -1
  29. package/dist/cli/commands/install-from-source.d.mts +2 -0
  30. package/dist/cli/commands/install-from-source.d.mts.map +1 -0
  31. package/dist/cli/commands/install-from-source.mjs +2 -0
  32. package/dist/cli/commands/install-from-source.mjs.map +1 -0
  33. package/dist/cli/commands/modes.mjs +1 -1
  34. package/dist/cli/commands/route.d.mts.map +1 -1
  35. package/dist/cli/commands/route.mjs +38 -1
  36. package/dist/cli/commands/route.mjs.map +1 -1
  37. package/dist/cli/commands/triage.mjs +1 -1
  38. package/dist/cli/config/load.d.mts.map +1 -1
  39. package/dist/cli/config/load.mjs +9 -3
  40. package/dist/cli/config/load.mjs.map +1 -1
  41. package/dist/cli/coordination/auto-emit-artifact-ready.mjs +1 -1
  42. package/dist/cli/coordination/event-schema.d.mts.map +1 -1
  43. package/dist/cli/coordination/event-schema.mjs +18 -0
  44. package/dist/cli/coordination/event-schema.mjs.map +1 -1
  45. package/dist/cli/dispatch.d.mts.map +1 -1
  46. package/dist/cli/dispatch.mjs +18 -1
  47. package/dist/cli/dispatch.mjs.map +1 -1
  48. package/dist/cli/gate/context.d.mts +1 -0
  49. package/dist/cli/gate/context.d.mts.map +1 -1
  50. package/dist/cli/gate/context.mjs +14 -1
  51. package/dist/cli/gate/context.mjs.map +1 -1
  52. package/dist/cli/gate/gates/consistency-check.d.mts +1 -0
  53. package/dist/cli/gate/gates/consistency-check.d.mts.map +1 -1
  54. package/dist/cli/gate/gates/consistency-check.mjs +1 -0
  55. package/dist/cli/gate/gates/consistency-check.mjs.map +1 -1
  56. package/dist/cli/gate/gates/review-clean.d.mts +1 -0
  57. package/dist/cli/gate/gates/review-clean.d.mts.map +1 -1
  58. package/dist/cli/gate/gates/review-clean.mjs +1 -0
  59. package/dist/cli/gate/gates/review-clean.mjs.map +1 -1
  60. package/dist/cli/gate/gates/verify-approved.d.mts +1 -0
  61. package/dist/cli/gate/gates/verify-approved.d.mts.map +1 -1
  62. package/dist/cli/gate/gates/verify-approved.mjs +1 -0
  63. package/dist/cli/gate/gates/verify-approved.mjs.map +1 -1
  64. package/dist/cli/gate/registry.d.mts.map +1 -1
  65. package/dist/cli/gate/registry.mjs +9 -1
  66. package/dist/cli/gate/registry.mjs.map +1 -1
  67. package/dist/cli/install/find-workspace-framework-version.d.mts +16 -0
  68. package/dist/cli/install/find-workspace-framework-version.d.mts.map +1 -0
  69. package/dist/cli/install/find-workspace-framework-version.mjs +85 -0
  70. package/dist/cli/install/find-workspace-framework-version.mjs.map +1 -0
  71. package/dist/cli/install/install-from-source.d.mts +10 -0
  72. package/dist/cli/install/install-from-source.d.mts.map +1 -0
  73. package/dist/cli/install/install-from-source.mjs +271 -0
  74. package/dist/cli/install/install-from-source.mjs.map +1 -0
  75. package/dist/cli/install/install-kernel.d.mts.map +1 -1
  76. package/dist/cli/install/install-kernel.mjs +24 -0
  77. package/dist/cli/install/install-kernel.mjs.map +1 -1
  78. package/dist/cli/install/legacy-paths.d.mts +33 -11
  79. package/dist/cli/install/legacy-paths.d.mts.map +1 -1
  80. package/dist/cli/install/legacy-paths.mjs +161 -39
  81. package/dist/cli/install/legacy-paths.mjs.map +1 -1
  82. package/dist/cli/install/runtime-detect.mjs +1 -1
  83. package/dist/cli/install/runtime-detect.mjs.map +1 -1
  84. package/dist/cli/install/runtime-migrate.d.mts +34 -14
  85. package/dist/cli/install/runtime-migrate.d.mts.map +1 -1
  86. package/dist/cli/install/runtime-migrate.mjs +63 -30
  87. package/dist/cli/install/runtime-migrate.mjs.map +1 -1
  88. package/dist/cli/install/transforms/codex.d.mts.map +1 -1
  89. package/dist/cli/install/transforms/codex.mjs +28 -17
  90. package/dist/cli/install/transforms/codex.mjs.map +1 -1
  91. package/dist/cli/skill-author/contract.mjs +2 -2
  92. package/dist/cli/skill-author/contract.mjs.map +1 -1
  93. package/dist/cli/verify-proof/audit.d.mts +34 -0
  94. package/dist/cli/verify-proof/audit.d.mts.map +1 -0
  95. package/dist/cli/verify-proof/audit.mjs +53 -0
  96. package/dist/cli/verify-proof/audit.mjs.map +1 -0
  97. package/dist/cli/verify-proof/exec.d.mts +20 -0
  98. package/dist/cli/verify-proof/exec.d.mts.map +1 -0
  99. package/dist/cli/verify-proof/exec.mjs +74 -0
  100. package/dist/cli/verify-proof/exec.mjs.map +1 -0
  101. package/dist/cli/verify-proof/idl/index.d.mts +2 -0
  102. package/dist/cli/verify-proof/idl/index.d.mts.map +1 -0
  103. package/dist/cli/verify-proof/idl/index.mjs +14 -0
  104. package/dist/cli/verify-proof/idl/index.mjs.map +1 -0
  105. package/dist/cli/verify-proof/idl/types.d.ts +9 -0
  106. package/dist/cli/verify-proof/idl/types.d.ts.map +1 -0
  107. package/dist/cli/verify-proof/idl/types.js +9 -0
  108. package/dist/cli/verify-proof/idl/types.js.map +1 -0
  109. package/dist/cli/verify-proof/manifest-validator.d.mts +19 -0
  110. package/dist/cli/verify-proof/manifest-validator.d.mts.map +1 -0
  111. package/dist/cli/verify-proof/manifest-validator.mjs +182 -0
  112. package/dist/cli/verify-proof/manifest-validator.mjs.map +1 -0
  113. package/dist/cli/verify-proof/resolver.d.mts +43 -0
  114. package/dist/cli/verify-proof/resolver.d.mts.map +1 -0
  115. package/dist/cli/verify-proof/resolver.mjs +160 -0
  116. package/dist/cli/verify-proof/resolver.mjs.map +1 -0
  117. package/dist/cli/verify-proof/runtime-detect.d.mts +27 -0
  118. package/dist/cli/verify-proof/runtime-detect.d.mts.map +1 -0
  119. package/dist/cli/verify-proof/runtime-detect.mjs +116 -0
  120. package/dist/cli/verify-proof/runtime-detect.mjs.map +1 -0
  121. package/dist/cli/verify-proof/trust.d.mts +70 -0
  122. package/dist/cli/verify-proof/trust.d.mts.map +1 -0
  123. package/dist/cli/verify-proof/trust.mjs +174 -0
  124. package/dist/cli/verify-proof/trust.mjs.map +1 -0
  125. package/dist/plugin/.claude-plugin/plugin.json +3 -1
  126. package/dist/plugin/agents/apt-planner.md +5 -4
  127. package/dist/plugin/skills/apt/SKILL.md +75 -6
  128. package/dist/plugin/skills/apt-caveman/SKILL.md +64 -0
  129. package/dist/plugin/skills/apt-debug/SKILL.md +36 -4
  130. package/dist/plugin/skills/apt-debug/appendices/diagnose-discipline.md +2 -11
  131. package/dist/plugin/skills/apt-discuss/SKILL.md +4 -4
  132. package/dist/plugin/skills/apt-discuss/appendices/grill-discipline.md +2 -11
  133. package/dist/plugin/skills/apt-discuss/appendices/zoom-out-helper.md +0 -8
  134. package/dist/plugin/skills/apt-execute/SKILL.md +27 -4
  135. package/dist/plugin/skills/apt-execute/appendices/tdd-mode.md +2 -10
  136. package/dist/plugin/skills/apt-fan-out/SKILL.md +36 -1
  137. package/dist/plugin/skills/apt-handoff/SKILL.md +228 -0
  138. package/dist/plugin/skills/apt-improve/DEEPENING.md +0 -8
  139. package/dist/plugin/skills/apt-improve/INTERFACE-DESIGN.md +0 -8
  140. package/dist/plugin/skills/apt-improve/LANGUAGE.md +0 -8
  141. package/dist/plugin/skills/apt-improve/SKILL.md +4 -4
  142. package/dist/plugin/skills/apt-plan/SKILL.md +23 -5
  143. package/dist/plugin/skills/apt-plan/adapters/conductor.md +1 -1
  144. package/dist/plugin/skills/apt-prototype/LOGIC.md +0 -8
  145. package/dist/plugin/skills/apt-prototype/SKILL.md +4 -4
  146. package/dist/plugin/skills/apt-prototype/UI.md +0 -8
  147. package/dist/plugin/skills/apt-quick/SKILL.md +31 -1
  148. package/dist/plugin/skills/apt-resume/SKILL.md +54 -31
  149. package/dist/plugin/skills/apt-run/SKILL.md +114 -16
  150. package/dist/plugin/skills/apt-setup/SKILL.md +97 -8
  151. package/dist/plugin/skills/apt-ship/SKILL.md +165 -9
  152. package/dist/plugin/skills/apt-spar/SKILL.md +65 -16
  153. package/dist/plugin/skills/apt-triage/AGENT-BRIEF.md +0 -8
  154. package/dist/plugin/skills/apt-triage/OUT-OF-SCOPE.md +0 -7
  155. package/dist/plugin/skills/apt-triage/SKILL.md +2 -2
  156. package/dist/plugin/skills/apt-update/SKILL.md +74 -17
  157. package/dist/plugin/skills/apt-verify-proof/SKILL.md +48 -1
  158. package/dist/plugin/skills/apt-zoom-out/SKILL.md +3 -3
  159. package/dist/schemas/quick-task.d.ts.map +1 -1
  160. package/dist/schemas/quick-task.js +2 -2
  161. package/dist/schemas/quick-task.js.map +1 -1
  162. package/dist/types/config.d.ts +33 -0
  163. package/dist/types/config.d.ts.map +1 -1
  164. package/dist/types/state.d.ts +1 -1
  165. package/dist/types/state.d.ts.map +1 -1
  166. package/dist/types/task-record.d.ts +1 -1
  167. package/dist/types/task-record.d.ts.map +1 -1
  168. package/package.json +134 -133
  169. package/prompts/planner.md +1 -1
  170. package/prompts/spec_writer.md +1 -1
  171. package/skills/apt/SKILL.md +75 -6
  172. package/skills/apt-caveman/SKILL.md +64 -0
  173. package/skills/apt-debug/SKILL.md +36 -4
  174. package/skills/apt-debug/appendices/diagnose-discipline.md +2 -11
  175. package/skills/apt-discuss/SKILL.md +4 -4
  176. package/skills/apt-discuss/appendices/grill-discipline.md +2 -11
  177. package/skills/apt-discuss/appendices/zoom-out-helper.md +0 -8
  178. package/skills/apt-execute/SKILL.md +27 -4
  179. package/skills/apt-execute/appendices/tdd-mode.md +2 -10
  180. package/skills/apt-fan-out/SKILL.md +36 -1
  181. package/skills/apt-handoff/SKILL.md +228 -0
  182. package/skills/apt-improve/DEEPENING.md +0 -8
  183. package/skills/apt-improve/INTERFACE-DESIGN.md +0 -8
  184. package/skills/apt-improve/LANGUAGE.md +0 -8
  185. package/skills/apt-improve/SKILL.md +4 -4
  186. package/skills/apt-plan/SKILL.md +23 -5
  187. package/skills/apt-plan/adapters/conductor.md +1 -1
  188. package/skills/apt-planner.md +1 -1
  189. package/skills/apt-prototype/LOGIC.md +0 -8
  190. package/skills/apt-prototype/SKILL.md +4 -4
  191. package/skills/apt-prototype/UI.md +0 -8
  192. package/skills/apt-quick/SKILL.md +31 -1
  193. package/skills/apt-resume/SKILL.md +54 -31
  194. package/skills/apt-run/SKILL.md +114 -16
  195. package/skills/apt-setup/SKILL.md +97 -8
  196. package/skills/apt-ship/SKILL.md +165 -9
  197. package/skills/apt-spar/SKILL.md +65 -16
  198. package/skills/apt-triage/AGENT-BRIEF.md +0 -8
  199. package/skills/apt-triage/OUT-OF-SCOPE.md +0 -7
  200. package/skills/apt-triage/SKILL.md +2 -2
  201. package/skills/apt-update/SKILL.md +74 -17
  202. package/skills/apt-verify-proof/SKILL.md +48 -1
  203. package/skills/apt-zoom-out/SKILL.md +3 -3
  204. package/src/cli/commands/adr.mjs +1 -1
  205. package/src/cli/commands/audit-branch-current.mjs +250 -0
  206. package/src/cli/commands/audit.mjs +13 -2
  207. package/src/cli/commands/check-version.mjs +20 -1
  208. package/src/cli/commands/context.mjs +3 -3
  209. package/src/cli/commands/detect-runtime.mjs +134 -0
  210. package/src/cli/commands/driver-doctor.mjs +294 -0
  211. package/src/cli/commands/gate.mjs +15 -0
  212. package/src/cli/commands/init.mjs +9 -6
  213. package/src/cli/commands/install-from-source.mjs +1 -0
  214. package/src/cli/commands/modes.mjs +1 -1
  215. package/src/cli/commands/route.mjs +42 -1
  216. package/src/cli/commands/triage.mjs +1 -1
  217. package/src/cli/config/load.mjs +9 -3
  218. package/src/cli/coordination/auto-emit-artifact-ready.mjs +1 -1
  219. package/src/cli/coordination/event-schema.mjs +19 -0
  220. package/src/cli/dispatch.mjs +17 -1
  221. package/src/cli/gate/context.mjs +20 -1
  222. package/src/cli/gate/gates/consistency-check.mjs +1 -0
  223. package/src/cli/gate/gates/review-clean.mjs +1 -0
  224. package/src/cli/gate/gates/verify-approved.mjs +1 -0
  225. package/src/cli/gate/registry.mjs +11 -1
  226. package/src/cli/install/find-workspace-framework-version.mjs +88 -0
  227. package/src/cli/install/install-from-source.mjs +276 -0
  228. package/src/cli/install/install-kernel.mjs +24 -0
  229. package/src/cli/install/legacy-paths.mjs +162 -39
  230. package/src/cli/install/runtime-detect.mjs +1 -1
  231. package/src/cli/install/runtime-migrate.mjs +63 -30
  232. package/src/cli/install/transforms/codex.mjs +26 -17
  233. package/src/cli/skill-author/contract.mjs +2 -2
  234. package/src/cli/verify-proof/.gitkeep +0 -0
  235. package/src/cli/verify-proof/audit.mjs +55 -0
  236. package/src/cli/verify-proof/exec.mjs +74 -0
  237. package/src/cli/verify-proof/idl/index.mjs +24 -0
  238. package/src/cli/verify-proof/idl/types.ts +41 -0
  239. package/src/cli/verify-proof/manifest-schema.json +211 -0
  240. package/src/cli/verify-proof/manifest-validator.mjs +184 -0
  241. package/src/cli/verify-proof/resolver.mjs +163 -0
  242. package/src/cli/verify-proof/runtime-detect.mjs +122 -0
  243. package/src/cli/verify-proof/trust.mjs +187 -0
  244. package/templates/adr-format.md +0 -8
  245. package/templates/aperant-claude-md-appendix.md +1 -1
  246. package/templates/context-format.md +1 -9
  247. package/templates/proof-verification.md +19 -5
  248. package/workflows/verify-proof.md +56 -14
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: apt:resume
3
- description: "Restore context from a paused session or recover from a crash"
3
+ description: "Restore context from a paused session, an agent handoff, or recover from a crash"
4
4
  apt-skill-version: {{APT_VERSION}}
5
5
  stage: resume
6
6
  intent: capture
7
- when_to_use: "The user is returning to paused work or recovering from a crash and needs to restore context from CONTINUE artifacts or the active-task state."
7
+ when_to_use: "The user is returning to paused work, picking up an agent-to-agent handoff, or recovering from a crash and needs to restore context from CONTINUE artifacts, HANDOFF artifacts, or the active-task state."
8
8
  user_invocable: true
9
9
  internal: false
10
10
  spawns_agent: false
@@ -19,14 +19,15 @@ argument-hint: "apt:resume [task-id]"
19
19
  gates: []
20
20
  ---
21
21
  <objective>
22
- Restore context and continue work after a session break — whether it was a graceful pause (CONTINUE files exist) or a crash/disconnect (no CONTINUE but state.json has an active task). Supports multiple paused sessions — shows all and lets the user pick which to resume.
22
+ Restore context and continue work after a session break — whether it was a graceful pause (CONTINUE files exist), an agent-to-agent handoff (HANDOFF files exist, written by `/apt:handoff`), or a crash/disconnect (no CONTINUE/HANDOFF but state.json has an active task). Supports multiple resumable sessions of mixed type — shows all and lets the user pick which to resume.
23
23
  </objective>
24
24
 
25
25
  <your_environment>
26
26
  - **Working directory:** The project root (where you were invoked)
27
27
  - **apt-tools path:** `node packages/framework/bin/apt-tools.mjs` or the locally installed `apt-tools` binary
28
28
  - **Constitution:** Read `AGENTS.md` in the project root if it exists
29
- - **Pause index:** `.aperant/CONTINUE_INDEX.md` (lists all paused sessions)
29
+ - **Pause index:** `.aperant/CONTINUE_INDEX.md` (human-pause sessions written by `/apt:pause`)
30
+ - **Handoff index:** `.aperant/HANDOFFS_INDEX.md` (agent-to-agent handoffs written by `/apt:handoff`)
30
31
  - **Legacy handoff:** `.aperant/CONTINUE.md` (pre-v2 single-file format, migrate if found)
31
32
  - **State:** `.aperant/state.json` (always exists if initialized)
32
33
  - **Cross-agent team signal:** `.aperant/team-status/{agent-id}.json` records (gitignored, TTL-expired) are the canonical "who's working on what" surface; `state.active_tasks` is this agent's local view.
@@ -35,74 +36,85 @@ Restore context and continue work after a session break — whether it was a gra
35
36
 
36
37
  <process>
37
38
 
38
- ## 1. Discover Paused Sessions
39
+ ## 1. Discover Resumable Sessions
40
+
41
+ Each discovered session is tagged with a **type** — `pause` (human stopped, `CONTINUE.md`) or `handoff` (agent transferred work, `HANDOFF.md`) — and tracked alongside its location. Scan both surfaces; do not assume only one exists.
39
42
 
40
43
  ### 1a. Check for pause index
41
- Read `.aperant/CONTINUE_INDEX.md` if it exists — this is the primary source of paused sessions.
44
+ Read `.aperant/CONTINUE_INDEX.md` if it exists — primary source for `type=pause` sessions.
45
+
46
+ ### 1b. Check for handoff index
47
+ Read `.aperant/HANDOFFS_INDEX.md` if it exists — primary source for `type=handoff` sessions (agent-to-agent transfers from `/apt:handoff`).
42
48
 
43
- ### 1b. Check for legacy CONTINUE.md
49
+ ### 1c. Check for legacy CONTINUE.md
44
50
  If `.aperant/CONTINUE.md` exists (pre-v2 format), treat it as one paused session. Migrate it after resume:
45
51
  - Move it to the appropriate task dir or `.aperant/paused/` location
46
- - Add it to the index
52
+ - Add it to `CONTINUE_INDEX.md`
47
53
 
48
- ### 1c. Scan for task-level CONTINUE files
49
- As a fallback, scan for CONTINUE.md files that might not be in the index:
54
+ ### 1d. Scan for task-level CONTINUE and HANDOFF files
55
+ As a fallback, scan for files that might not be in either index:
50
56
  ```bash
51
57
  find .aperant/tasks/*/CONTINUE.md .aperant/paused/*/CONTINUE.md 2>/dev/null
58
+ find .aperant/tasks/*/handoffs/*/HANDOFF.md .aperant/handoffs/*/HANDOFF.md 2>/dev/null
52
59
  ```
53
60
 
54
- ### 1d. Check state.json for active tasks
61
+ ### 1e. Check state.json for active tasks
55
62
  ```bash
56
63
  node packages/framework/bin/apt-tools.mjs health-check .
57
64
  node packages/framework/bin/apt-tools.mjs task list .
58
65
  ```
59
66
 
60
- Combine all sources into a unified list of resumable sessions.
67
+ Combine all sources into a unified list of resumable sessions, each carrying `{ type, path, branch, focus_or_task, date, suggested_receiver? }`.
61
68
 
62
69
  ## 2. Present Sessions
63
70
 
64
- ### If multiple paused sessions found:
71
+ ### If multiple resumable sessions found:
72
+
73
+ Render handoffs FIRST (agent dropped work in your lap = higher urgency than human-paused work). Tag each row with `[pause]` or `[handoff]`.
65
74
 
66
75
  ```
67
- Paused Sessions
76
+ Resumable Sessions
68
77
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
78
 
70
- 1. Chat UI Polish + Sidebar Redesign
79
+ 1. [handoff] Finish MCP token rotation wiring
80
+ Branch: feat/mcp-rotation | Handed off: 2026-05-22 14:30
81
+ Sender: Claude Opus 4.7 / Claude Code → Receiver: any agent
82
+ → .aperant/handoffs/handoff-20260522-1430-finish-mcp-token-rotation/HANDOFF.md
83
+
84
+ 2. [pause] Chat UI Polish + Sidebar Redesign
71
85
  Branch: closing-phase-4 | Paused: 2026-04-13
72
86
  Progress: 6/9 items done
73
87
  → .aperant/paused/paused-20260413-chat-ui-polish/CONTINUE.md
74
88
 
75
- 2. Onboarding State Unification
89
+ 3. [pause] Onboarding State Unification
76
90
  Branch: feat/onboarding-sync | Paused: 2026-04-13
77
91
  Progress: executing subtask 3/5
78
92
  → .aperant/tasks/task-20260413-onboarding-sync/CONTINUE.md
79
93
 
80
- 3. Fix DB Path in services.ts
81
- Branch: closing-phase-4 | Paused: 2026-04-12
82
- Progress: planned, not started
83
- → .aperant/tasks/task-20260412-fix-db-path/CONTINUE.md
84
-
85
94
  Which session to resume? (number, or "all" to see full context for each)
86
95
  ```
87
96
 
88
97
  Wait for user selection before proceeding.
89
98
 
90
- ### If one paused session found:
99
+ ### If one resumable session found:
91
100
  Proceed directly to Step 3 with that session.
92
101
 
93
- ### If no paused sessions but active tasks in state.json:
102
+ ### If no resumable sessions but active tasks in state.json:
94
103
  Follow crash recovery flow (Step 4).
95
104
 
96
105
  ### If nothing found:
97
106
  ```
98
- No paused sessions or active tasks found.
107
+ No paused sessions, handoffs, or active tasks found.
99
108
 
100
109
  → Start something new: /apt "describe your task"
101
110
  ```
102
111
 
103
112
  ## 3. Resume Selected Session
104
113
 
105
- Read the selected CONTINUE.md and extract:
114
+ Branch on `type`:
115
+
116
+ ### 3a. type=pause — read CONTINUE.md
117
+ Extract:
106
118
  - **Task description** — What was being worked on
107
119
  - **Branch** — Which branch to be on
108
120
  - **Decisions made** — Context that must not be lost
@@ -110,26 +122,37 @@ Read the selected CONTINUE.md and extract:
110
122
  - **Current state** — Pipeline stage, progress
111
123
  - **Next steps** — Ordered list of what to do next
112
124
 
125
+ ### 3b. type=handoff — read HANDOFF.md
126
+ Extract the handoff-specific fields:
127
+ - **Focus For The Receiver** — the load-bearing paragraph; this drives the immediate next action
128
+ - **Sender / Suggested receiver** — model + CLI hints (warn if the current agent is a poor fit, e.g. handoff suggested Codex for a heavy refactor and the receiver is a small model)
129
+ - **Existing Artifacts** — open each referenced path/URL into context BEFORE acting
130
+ - **Decisions Made (do NOT relitigate)** — treat as locked context
131
+ - **Uncommitted changes** — handoffs do NOT stash; verify the listed files still exist in the working tree with `git status --short` and reconcile if drift occurred since the handoff was written
132
+ - **External state the receiver must check** — verify each item (dev server running, PR open, MCP session live) before resuming
133
+ - **Suggested Skills** — use as the next-action recommendation
134
+
113
135
  ### Check Branch
114
136
  ```bash
115
137
  git branch --show-current
116
138
  ```
117
139
  If not on expected branch: suggest `git checkout {expected-branch}`
118
140
 
119
- ### Restore Stashed Work
120
- If CONTINUE.md indicates stashed changes, find and pop the matching stash:
141
+ ### Restore Stashed Work (pause only)
142
+ For `type=pause` ONLY — if CONTINUE.md indicates stashed changes, find and pop the matching stash:
121
143
  ```bash
122
144
  git stash list | grep "apt-pause: {task description}"
123
145
  ```
146
+ `type=handoff` never stashes; skip this step for handoffs.
124
147
 
125
148
  ### Present Context Summary
126
- Display all key context from CONTINUE.md, then suggest the next action based on pipeline stage.
149
+ Display all key context from the artifact, then suggest the next action based on pipeline stage (pause) or Focus + Suggested Skills (handoff).
127
150
 
128
151
  ### Clean Up After Resume
129
152
  After user confirms they have context:
130
- - Remove the CONTINUE.md file that was resumed
131
- - Remove its row from CONTINUE_INDEX.md
132
- - If the index is now empty, delete CONTINUE_INDEX.md
153
+ - Remove the resumed artifact file (`CONTINUE.md` or `HANDOFF.md`)
154
+ - Remove its row from the matching index (`CONTINUE_INDEX.md` or `HANDOFFS_INDEX.md`)
155
+ - If the index is now empty, delete it
133
156
 
134
157
  ## 4. Crash Recovery (no CONTINUE, stale active_tasks)
135
158
 
@@ -17,7 +17,7 @@ execution_modes:
17
17
  - plan-mode
18
18
  - plan-only
19
19
  allowed-tools: "Bash, Read, Write, Edit, Grep, Glob, Task"
20
- argument-hint: "apt:run [task description] [--skip-review] [--phase-mode auto|agent-team|sub-agents|sequential]"
20
+ argument-hint: "apt:run [task description] [--skip-review] [--phase-mode auto|agent-team|sub-agents|sequential] [--spar-gates plan[,execute]]"
21
21
  gates:
22
22
  - constitution-read
23
23
  - constitution-coverage
@@ -58,7 +58,14 @@ As of C32 the STANDARD and DEEP auto pipelines **terminate on review** (`plan
58
58
 
59
59
  1. Read `AGENTS.md` if it exists
60
60
  2. Parse task description from `$ARGUMENTS` (everything before flags)
61
- 3. Parse flags: `--skip-review`, `--dry-run`
61
+ 3. Parse flags: `--skip-review`, `--dry-run`, `--phase-mode <mode>`, `--spar-gates <comma-list>`.
62
+ - `--spar-gates <plan|execute|plan,execute>` (FRAMEWORK-RFC-001) — comma-separated stage list to auto-fire `/apt:spar` after. Per-invocation override of `.aperant/config.local.json` `spar.enabled`. On QUICK track, print the verbatim hard-reject line and discard the flag (Fast Path Guarantee — CLAUDE.md):
63
+
64
+ ```
65
+ [apt:run] --spar-gates ignored for QUICK track (Fast Path Guarantee)
66
+ ```
67
+
68
+ On STANDARD / DEEP / DEBUG tracks, the flag is honored and consumed by §3b (plan gate) and §4b (execute gate). Default is to fall back to merged-config `spar.enabled` semantics — see §3b / §4b for the full resolution order. The flag accepts only `plan`, `execute`, or `plan,execute` — any other value is rejected with `[apt:run] --spar-gates accepts plan, execute, or plan,execute`.
62
69
 
63
70
  ```bash
64
71
  node packages/framework/bin/apt-tools.mjs state .
@@ -127,6 +134,12 @@ node packages/framework/bin/apt-tools.mjs commit "plan: create implementation pl
127
134
 
128
135
  **Output:** spec.md, implementation_plan.json
129
136
 
137
+ **Spar hint surface (FRAMEWORK-RFC-001).** If merged-config `spar.hint === true` AND `spar.enabled === false`, print:
138
+ ```
139
+ [apt] plan complete. /apt:spar available before next stage. (skill, not auto-fire)
140
+ ```
141
+ Skip the print on `spar.enabled === true` (the gate handler in §3b already fires).
142
+
130
143
  If `--dry-run` flag is set:
131
144
  ```
132
145
  Dry run complete. Plan created but not executed.
@@ -137,6 +150,51 @@ Remove --dry-run to execute the full pipeline.
137
150
  ```
138
151
  Exit.
139
152
 
153
+ ## 3b. Stage 1.5 — Spar Gate (plan)
154
+
155
+ **FRAMEWORK-RFC-001 — auto-fire `/apt:spar` after the plan stage when consent is on.**
156
+
157
+ Resolve effective gates:
158
+
159
+ 1. **Track gate.** If track is `QUICK`, **skip this entire section** and continue to §4. QUICK is hard-exempt per CLAUDE.md Fast Path Guarantee. If the user passed `--spar-gates` on a QUICK invocation, §1 already printed the verbatim hard-reject and discarded the flag.
160
+ 2. **Read merged config** via `loadMergedProjectConfig(.)`:
161
+
162
+ ```bash
163
+ node packages/framework/bin/apt-tools.mjs config show . --merged
164
+ ```
165
+
166
+ Parse `spar.enabled` (boolean) and `spar.partner` (`'codex' | 'claude' | 'gemini' | null`). When `spar.enabled === true`, build default gates by track: `["plan"]` for STANDARD, `["plan", "execute"]` for DEEP.
167
+ 3. **Per-invocation override.** If the user passed `--spar-gates <list>` on the `/apt:run` invocation (parsed in §1), the explicit value WINS over merged-config defaults (per-invocation precedence — classic config precedence).
168
+ 4. **Gate check.** If `"plan"` is not in the resolved gate list, skip the rest of this section.
169
+
170
+ If `"plan"` is in the resolved gate list, dispatch the spar gate.
171
+
172
+ **Compose the topic frame (1–2 sentences).** Prefer `spec.md` §Scope (the first paragraph under the `## 1. Scope` heading). If spec.md has no `## 1. Scope` heading (QUICK-skipped or non-PRD-shaped — Open Q4 graceful fallback), use the task description passed to `/apt:run`.
173
+
174
+ **Dispatch `/apt:spar`** with the topic frame. **Pipeline-mode invocation MUST carry `--timeout-ms 120000`** (2-min Bash-rung fast-fail per spec §4.6 "Pipeline-mode timeout rationale" — pipeline gates run under a tighter budget than manual `apt:spar`). **NO `--rounds` flag** (per FRAMEWORK-BUG-038 fix — pipeline gates always defer to the skill default; passing `--rounds 1` would re-introduce the Round 1 unilateral-terminate bug). When `spar.partner` is set in merged config, append `--with <partner>`; when null, omit `--with` and let `apt:spar` use the host-default-partner mapping in `apt-spar/SKILL.md` §3.
175
+
176
+ ```
177
+ /apt:spar --timeout-ms 120000 [--with <partner>] <topic-frame-from-spec.md-or-task-description>
178
+ ```
179
+
180
+ **Pipeline-mode timeout rationale.** `apt-spar/SKILL.md:198` "Timeout calibration" notes that modern partner CLIs commonly spend multiple minutes doing real Read/Grep/Bash investigation, justifying the manual-mode 5-min Bash-rung / 15-min MCP-rung defaults. Pipeline-mode partner queries are NARROWER than manual: the gate prompt is a focused 1-2-sentence frame on a specific just-completed stage, not open-ended brainstorming. 2 minutes is adequate for that narrower scope, and `partner-unreachable` (the rung ladder exhausts within 2 min) skips the gate cleanly without blocking the pipeline. Worst-case DEEP wall budget: 2 gates × 3 rounds × 2 min = 12 min (vs ~90 min before this clamp under MCP-rung partner degradation). MCP-rung tightening is out of scope per Open Q5 — see spec §4.6.
181
+
182
+ **Consent-on but partner-null inline prompt.** If `spar.enabled: true && spar.partner === null` (consent given but no partner detected at install — graceful skip path), prompt the user inline before dispatch (the inline prompt's dispatch ALSO carries `--timeout-ms 120000` and NO `--rounds` flag):
183
+
184
+ ```
185
+ [apt:run] Sparring auto-fire is enabled but no partner was set at install. Pick one now ([1] codex / [2] claude / [3] gemini / [s] skip this gate):
186
+ ```
187
+
188
+ Map response → invoke `/apt:spar --timeout-ms 120000 --with <id> <topic-frame>` (no `--rounds`), or skip the gate. Do NOT write the choice back to `config.local.json` automatically — the user re-runs `/apt:setup` → Pipeline → Sparring Auto-Fire to persist.
189
+
190
+ **After spar returns to natural convergence:**
191
+
192
+ 1. Read the spar termination headline (printed inline by `apt:spar/SKILL.md` §9 Layer 1).
193
+ 2. Capture the Layer 2 file path from the `Full detail:` line of the headline (e.g. `.aperant/spar/<slug>-<YYYYMMDD-HHMMSS>.md`).
194
+ 3. Append both the one-line headline summary AND the Layer 2 file path into the executor's spawn context for §4 (the executor reads spar findings before subtask 1).
195
+
196
+ If the gate emits `partner-unreachable` (rung ladder exhausted within timeout), skip the gate cleanly and continue to §4 — do NOT fail the pipeline.
197
+
140
198
  ## 4. Stage 2 — Execute (apt:execute)
141
199
 
142
200
  Branch on `PHASE_MODE`:
@@ -168,6 +226,34 @@ Execute the apt:execute workflow inline:
168
226
 
169
227
  **Output:** All subtasks completed, build-progress.json updated
170
228
 
229
+ **Spar hint surface (FRAMEWORK-RFC-001).** If merged-config `spar.hint === true` AND `spar.enabled === false`, print:
230
+ ```
231
+ [apt] execute complete. /apt:spar available before next stage. (skill, not auto-fire)
232
+ ```
233
+ Skip on `spar.enabled === true` (the gate handler in §4b already fires).
234
+
235
+ ## 4b. Stage 2.5 — Spar Gate (execute)
236
+
237
+ **FRAMEWORK-RFC-001 — auto-fire `/apt:spar` after the execute stage on DEEP (or explicit user opt-in).**
238
+
239
+ Same resolution logic as §3b, but the gate name is `"execute"` and the topic frame is composed from `build-progress.json` (1–2 sentences summarizing the diff that just landed, e.g. "N subtasks completed against the M-file plan; the largest change touched <path>"). If `build-progress.json` is missing or empty, fall back to the task description (Open Q4 graceful fallback).
240
+
241
+ **Track gate:** if track is `QUICK`, skip this section entirely (Fast Path Guarantee). Default gates from merged-config `spar.enabled === true` only include `"execute"` on DEEP. STANDARD does NOT enter this block by default; DEEP does. User-passed `--spar-gates plan,execute` opts STANDARD into this block too (per-invocation precedence).
242
+
243
+ **Gate check:** if `"execute"` is not in the resolved gate list, skip this section.
244
+
245
+ If `"execute"` is in the resolved gate list, dispatch as in §3b — same pipeline-mode budget:
246
+
247
+ ```
248
+ /apt:spar --timeout-ms 120000 [--with <partner>] <topic-frame-from-build-progress.json>
249
+ ```
250
+
251
+ **NO `--rounds` flag** (per FRAMEWORK-BUG-038 — pipeline always defers to skill default). Same `--timeout-ms 120000` 2-min Bash-rung fast-fail as §3b. Same inline-prompt path for the `enabled: true && partner === null` graceful-skip case (the inline-prompt dispatch ALSO carries `--timeout-ms 120000`).
252
+
253
+ After spar returns, parse the termination headline + Layer 2 path and append both into the verifier's spawn context for §5 (the verifier reads execute-gate spar findings alongside its de-anchored re-read).
254
+
255
+ `partner-unreachable` skips the gate cleanly — pipeline continues to §5.
256
+
171
257
  ## 5. Stage 3 — Verify (apt:verify)
172
258
 
173
259
  **De-anchored re-read (PHASE_MODE=sequential only — roundtable 2026-05-14 R2):**
@@ -183,6 +269,8 @@ This block exists because the roundtable's STANDARD-track de-anchoring relies on
183
269
 
184
270
  Sub-agents and agent-team modes skip this block — they get fresh-context isolation by spawning, which makes the de-anchored re-read redundant.
185
271
 
272
+ **Spar findings context (FRAMEWORK-RFC-001).** If §3b or §4b dispatched `/apt:spar`, the verifier MUST read the Layer 2 file (`.aperant/spar/<slug>-<YYYYMMDD-HHMMSS>.md`) before scoring — both gate files when DEEP fired both gates. Spar findings flagged as `parallel call-outs` in the Layer 2 file may require `qa_signoff.json` `notes` entries even when not blocking. The headline summary already lives in the verifier's spawn context (appended by §3b / §4b); the Layer 2 read is the load-bearing detail loop.
273
+
186
274
  Execute the apt:verify workflow inline:
187
275
 
188
276
  1. Check all subtasks completed
@@ -200,6 +288,12 @@ Execute the apt:verify workflow inline:
200
288
 
201
289
  **Output:** qa_signoff.json with status
202
290
 
291
+ **Spar hint surface (FRAMEWORK-RFC-001).** If merged-config `spar.hint === true` AND `spar.enabled === false`, print:
292
+ ```
293
+ [apt] verify complete. /apt:spar available before next stage. (skill, not auto-fire)
294
+ ```
295
+ Skip on `spar.enabled === true` (no verify-stage gate exists in v2 — see spec §8 Out of Scope; this nudge surfaces /apt:spar as a manual option only).
296
+
203
297
  If `qa_signoff.json` status is `"rejected"` after max iterations:
204
298
  ```
205
299
  Verification failed after {n} iterations. Issues remain:
@@ -236,28 +330,32 @@ Execute the apt:review workflow inline (see `apt-review/SKILL.md`):
236
330
 
237
331
  **Output:** review.json (written to task directory)
238
332
 
333
+ **Spar hint surface (FRAMEWORK-RFC-001).** If merged-config `spar.hint === true` AND `spar.enabled === false`, print:
334
+ ```
335
+ [apt] review complete. /apt:spar available before next stage. (skill, not auto-fire)
336
+ ```
337
+ Skip on `spar.enabled === true` (no pre-ship gate exists in v2 — see spec §8 Out of Scope).
338
+
239
339
  **This is the task review, not the PR review.** It runs inline without sub-agents. For heavy multi-agent PR review, use `/apt:pr-review` separately.
240
340
 
241
341
  ## 7. Pipeline Summary
242
342
 
243
- ```
244
- Pipeline Complete: {task description}
343
+ Render the phase rail panel verbatim — branch glyphs `┌─ │ └─`, status glyphs `✓` (done) / `●` (active) / `○` (pending/skipped), inline metrics per row drawn from the artifacts written across §3–§6:
245
344
 
345
+ ```
346
+ [APT] Pipeline Complete: {task description}
347
+ ┌─ Phase rail: {short task name} ───────────────────
348
+ │ Phase 1 Plan ✓ {n} subtasks
349
+ │ Phase 2 Execute ✓ {completed}/{total} subtasks, {k} commits
350
+ │ Phase 3 Verify ✓ {qa_status} {completeness}/{correctness}/{quality}/{coverage}
351
+ │ Phase 4 Review ✓ {assessment} {scores}, {findings_count} findings ({fixed} fixed)
352
+ └───────────────────────────────────────────────────
246
353
  Branch: apt/{sanitized-task-name}
247
- Stages:
248
- 1. Plan: spec.md + implementation_plan.json ({n} subtasks)
249
- 2. Execute: {completed}/{total} subtasks completed
250
- 3. Verify: {qa_status} (scores: {completeness}/{correctness}/{quality}/{coverage})
251
- 4. Review: {assessment} ({findings} found, {fixed} fixed, {remaining} remaining)
252
-
253
- Artifacts:
254
- - spec.md
255
- - implementation_plan.json
256
- - build-progress.json
257
- - qa_signoff.json
258
- - review.json
354
+ Artifacts: spec.md · implementation_plan.json · build-progress.json · qa_signoff.json · review.json
259
355
  ```
260
356
 
357
+ Substitute live values from the on-disk artifacts: `build-progress.json.completed_subtasks.length` for the commits count, `qa_signoff.json.verdict` + `scores` for verify, `review.json.assessment` + `scores` + `findings.length` for review. Use `●` for a stage still in flight (e.g. verify rejected mid-rerun), `○` only for a stage skipped entirely. The `[APT] Pipeline Complete` header above the panel is the backward-compat marker for external log-grep tooling — keep it.
358
+
261
359
  **Always end with a "What's Next" recommendation:**
262
360
 
263
361
  ```
@@ -199,7 +199,7 @@ AskUserQuestion([
199
199
 
200
200
  **Routing:**
201
201
  - "Verification" → jump to **Step 2** (Batch 1 + Batch 2 only), then skip to **Step 4** (mapping) and **Step 5** (write)
202
- - "Pipeline" → jump to **Step 3b** (Batch 3 only, including Diagram Mode), then skip to **Step 4** and **Step 5**
202
+ - "Pipeline" → jump to **Step 3** (Batch 2: auto-branch, code review, TDD, PR Review Auto-Suggest, **Sparring Auto-Fire**) AND **Step 3b** (Batch 3 only, including Diagram Mode), then skip to **Step 4** and **Step 5**
203
203
  - "Orchestration" → jump to **Step 3c** (Batch 4 only), then skip to **Step 4** and **Step 5**
204
204
  - "Team Collaboration" → jump to **Step 3d** (Batch 5 only), then skip to **Step 4** and **Step 5**
205
205
  - "Visibility" → jump to **Step 3e** (Batch 6 only), then skip to **Step 4** and **Step 5**
@@ -359,6 +359,76 @@ AskUserQuestion([
359
359
  ])
360
360
  ```
361
361
 
362
+ ### Sparring Auto-Fire (FRAMEWORK-RFC-001)
363
+
364
+ Per-device opt-in for pipeline-integrated `/apt:spar`. Three phases — top-level Yes/No, then a conditional partner picker (if Yes) or hint sub-picker (if No). All three resolved fields land in `.aperant/config.local.json` per AUDIT-001 (NOT the shared `config.json`).
365
+
366
+ **Phase 1 — Top-level Yes/No:**
367
+
368
+ ```
369
+ AskUserQuestion([
370
+ {
371
+ question: "Enable /apt:spar to auto-fire after planning (and execution on DEEP tasks)? Spawns a second LLM provider to challenge the plan before you commit code.",
372
+ header: "Sparring Auto-Fire",
373
+ multiSelect: false,
374
+ options: [
375
+ { label: "No (Recommended for now)", description: "Keep /apt:spar manual-only. You invoke it yourself when you want a second opinion." },
376
+ { label: "Yes", description: "After every /apt:run plan stage (STANDARD) or plan+execute stages (DEEP), spawn a partner LLM to spar with the current host. QUICK tasks are hard-exempt." }
377
+ ]
378
+ }
379
+ ])
380
+ ```
381
+
382
+ **Phase 2 — Partner picker (only if Phase 1 = Yes):**
383
+
384
+ Before showing the picker, run `apt-tools host-detect` and parse `host.partner_transports.{codex,claude,gemini}` plus `host.cli`. Build the partner availability map:
385
+
386
+ ```bash
387
+ node packages/framework/bin/apt-tools.mjs host-detect
388
+ ```
389
+
390
+ For each of `codex`, `claude`, `gemini`, check whether ANY rung (MCP, plugin, raw CLI) under `host.partner_transports.<id>` is `detected: true` (or `"runtime-host-only"` for the MCP rung). Also exclude the current host (`host.cli`) — `/apt:spar` rejects same-host sparring by construction (Open Q1 — e.g. on `claude-code` host, the `claude` option is hidden because sparring against the same CLI is sycophancy).
391
+
392
+ If zero partners remain after filtering, print this graceful skip line and write `spar.enabled: true, spar.partner: null` so the user can opt back in later by installing a partner CLI and re-running `/apt:setup` → Pipeline:
393
+
394
+ ```
395
+ [apt:setup] Sparring auto-fire enabled but no partner CLIs detected. Install codex / claude / gemini and re-run /apt:setup → Pipeline → Sparring Auto-Fire to pick a partner.
396
+ ```
397
+
398
+ Otherwise, show the partner picker including only detected, non-same-host partners. Example (on a Claude Code host where codex MCP is loaded and gemini CLI is installed):
399
+
400
+ ```
401
+ AskUserQuestion([
402
+ {
403
+ question: "Which partner LLM should /apt:spar use by default? You can override per-invocation with --with <id>.",
404
+ header: "Sparring Partner",
405
+ multiSelect: false,
406
+ options: [
407
+ // Include only detected, non-same-host partners. Example shape:
408
+ { label: "Codex (gpt-5)", description: "OpenAI Codex CLI / MCP — sharp on type and edge-case reasoning." },
409
+ { label: "Gemini", description: "Google Gemini — sharp on broad search and doc citations." }
410
+ // "Claude (sonnet)" omitted on a claude-code host (same-host rejection).
411
+ ]
412
+ }
413
+ ])
414
+ ```
415
+
416
+ **Phase 3 — Hint sub-picker (only if Phase 1 = No):**
417
+
418
+ ```
419
+ AskUserQuestion([
420
+ {
421
+ question: "Print a one-line reminder at the end of each pipeline stage that /apt:spar is available?",
422
+ header: "Sparring Hint",
423
+ multiSelect: false,
424
+ options: [
425
+ { label: "No (Recommended)", description: "Silent. You remember to run /apt:spar yourself when needed." },
426
+ { label: "Yes", description: "Print `[apt] {stage} complete. /apt:spar available before next stage. (skill, not auto-fire)` at each stage hand-off." }
427
+ ]
428
+ }
429
+ ])
430
+ ```
431
+
362
432
  ### Task-level worktree isolation (only if host supports worktrees)
363
433
 
364
434
  First check `host.capabilities.worktrees` from the host-detect output. If `false` (Codex, Gemini, OpenCode), skip this question and leave `task_isolation.worktree_per_task` at its default (`false`).
@@ -888,10 +958,10 @@ Add a row to the Step 8 table:
888
958
 
889
959
  ---
890
960
 
891
- ## 3g. Present Settings (Batch 8: Task Tracking + Coding) (Pocock adoption AC13)
961
+ ## 3g. Present Settings (Batch 8: Task Tracking + Coding) (AC13)
892
962
 
893
963
  This batch captures the **task_tracking** backend and the **coding**
894
- defaults block introduced by the Pocock adoption (ST-10 apt:triage +
964
+ defaults block introduced by adoption (ST-10 apt:triage +
895
965
  ST-3 apt:execute --tdd).
896
966
 
897
967
  Per ID-01 (Framework full-featured locally; backends are pluggable), the
@@ -977,7 +1047,7 @@ AskUserQuestion([
977
1047
 
978
1048
  Migration rule: any existing config WITHOUT a `task_tracking` or
979
1049
  `coding` block gets defaults silently — NEVER error on a missing block.
980
- This is the migration path for projects that adopted Aperant pre-Pocock.
1050
+ This is the migration path for projects that adopted Aperant pre-vertical-slice.
981
1051
 
982
1052
  ### 3g.4 Review-Mode routing entry
983
1053
 
@@ -1111,14 +1181,17 @@ The selective-edit pass through Batch 9 MUST respect the §1b dispatch — it do
1111
1181
 
1112
1182
  ## 4. Map Answers to Config
1113
1183
 
1114
- **AUDIT-001 — file-routing contract for per-device fields (UPDATED 0.7.2):** the
1115
- following five fields are PER-DEVICE and MUST land in `.aperant/config.local.json`
1184
+ **AUDIT-001 — file-routing contract for per-device fields (UPDATED 0.8.1 for FRAMEWORK-RFC-001):** the
1185
+ following PER-DEVICE fields MUST land in `.aperant/config.local.json`
1116
1186
  (gitignored), NOT the shared `.aperant/config.json`:
1117
1187
  - `verification.open_report` — covered in the "Auto-Open" mapping below.
1118
1188
  - `multi_model.cross_verification.tools` — covered in the "Cross-Verification" mapping below.
1119
1189
  - `preferences.date_format` — covered in the "Date Format" mapping below.
1120
1190
  - `preferences.time_format` — covered in the "Time Format" mapping below.
1121
1191
  - `preferences.quick_task_post_verify` — covered in apt-quick SKILL config block.
1192
+ - `spar.enabled` — covered in the "Sparring Auto-Fire" mapping below (FRAMEWORK-RFC-001).
1193
+ - `spar.partner` — covered in the "Sparring Auto-Fire" mapping below (FRAMEWORK-RFC-001).
1194
+ - `spar.hint` — covered in the "Sparring Auto-Fire" mapping below (FRAMEWORK-RFC-001).
1122
1195
 
1123
1196
  All other fields (including `verification.evidence_capture`,
1124
1197
  `multi_model.cross_verification.enabled`, `multi_model.video_review.*`,
@@ -1128,7 +1201,10 @@ All other fields (including `verification.evidence_capture`,
1128
1201
  Implementation: use the framework's `writeLocalConfigField(targetDir, dotPath, value)`
1129
1202
  helper from `packages/framework/src/cli/config/load.mjs` (or its shell-out
1130
1203
  equivalent via `apt-tools config write . --local --key <dotpath> --value <json>`)
1131
- for the five fields above. NEVER hand-roll `JSON.parse(readFileSync('.aperant/config.json'))`
1204
+ for the per-device fields enumerated above (`verification.open_report`,
1205
+ `multi_model.cross_verification.tools`, `preferences.date_format`,
1206
+ `preferences.time_format`, `preferences.quick_task_post_verify`, and the
1207
+ three `spar.*` fields). NEVER hand-roll `JSON.parse(readFileSync('.aperant/config.json'))`
1132
1208
  followed by `writeFileSync('.aperant/config.json', ...)` for these fields — it
1133
1209
  will land per-device data in the shared file and re-introduce the
1134
1210
  shared-config trap AUDIT-001 was designed to close.
@@ -1176,6 +1252,18 @@ Map the user's selections to config values:
1176
1252
  - "Ask me" → `pr_review.suggest_after_ship: "ask"`
1177
1253
  - "Never" → `pr_review.suggest_after_ship: "never"`
1178
1254
 
1255
+ **Sparring Auto-Fire (FRAMEWORK-RFC-001):**
1256
+ - Phase 1 "No" → `spar.enabled: false`, ask Phase 3 (hint sub-picker)
1257
+ - Phase 1 "Yes" → `spar.enabled: true`, ask Phase 2 (partner picker)
1258
+ - Phase 2 "Codex" → `spar.partner: "codex"`
1259
+ - Phase 2 "Claude" → `spar.partner: "claude"`
1260
+ - Phase 2 "Gemini" → `spar.partner: "gemini"`
1261
+ - Phase 2 graceful-skip path (zero partners detected) → `spar.partner: null` (re-prompted inline by `/apt:run` gate handler when consent is on but partner is null)
1262
+ - Phase 3 "Yes" → `spar.hint: true`
1263
+ - Phase 3 "No" → `spar.hint: false` (or omit the field)
1264
+
1265
+ **AUDIT-001 — all three fields are PER-DEVICE** and MUST land in `.aperant/config.local.json` via `writeLocalConfigField(targetDir, dotPath, value)` (or its shell-out equivalent `apt-tools config write . --local --key <dotpath> --value <json>`). Do NOT touch shared `.aperant/config.json` for any `spar.*` field. The AUDIT-001 routing block above already enumerates `spar.enabled`, `spar.partner`, `spar.hint` as per-device — this addendum is the call-site reference for future contributors.
1266
+
1179
1267
  Note: task ids are slug-first since v0.6.6 — the date-format setting controls the trailing date component only.
1180
1268
 
1181
1269
  **Date Format:**
@@ -1211,7 +1299,7 @@ Note: task ids are slug-first since v0.6.6 — the date-format setting controls
1211
1299
  Write merged config to two files per AUDIT-001 routing (see Step 4 block):
1212
1300
 
1213
1301
  - Shared `.aperant/config.json` — all project policy values (the bulk of the answers).
1214
- - Per-device `.aperant/config.local.json` — the five AUDIT-001 fields enumerated in Step 4.
1302
+ - Per-device `.aperant/config.local.json` — the AUDIT-001 per-device fields enumerated in Step 4 (5 original + 3 `spar.*` fields per FRAMEWORK-RFC-001).
1215
1303
 
1216
1304
  ```bash
1217
1305
  mkdir -p .aperant
@@ -1302,6 +1390,7 @@ Display:
1302
1390
  | Auto Branch | {Yes/No} |
1303
1391
  | Code Review | {Yes/No} |
1304
1392
  | TDD Iron Law | {Yes/No} |
1393
+ | Sparring Auto-Fire | {Off / On (codex), On (claude), On (gemini)} (hint: {Yes/No}) |
1305
1394
  | Date Format | {DD-MM-YY / MM-DD-YY / YY-MM-DD} |
1306
1395
  | Time Format | {24h / 12h} |
1307
1396
  | Task Index | {Yes/No} |