@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
@@ -43,27 +43,81 @@ cat implementation_plan.json 2>/dev/null
43
43
  cat testable_features.json 2>/dev/null
44
44
  ```
45
45
 
46
- Generate run ID and create proof directory:
46
+ Generate run ID and create proof directory. v0.8.6 — when the spec
47
+ carries `## User Outcomes` with cross-surface tags (e.g.
48
+ `[electron+web]`), proof artifacts MUST land under PER-SURFACE
49
+ subdirectories so reviewers can tell at a glance which surface failed.
50
+ Set up the path template here:
51
+
47
52
  ```bash
48
53
  RUN_ID="$(date +%H%M%S)"
49
54
  APP_NAME=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('package.json','utf8')).name)}catch{console.log('app')}" 2>/dev/null)
50
55
  PROOF_DIR=".aperant/proof/${APP_NAME}/$(date +%Y%m%d)/${RUN_ID}"
51
- mkdir -p "${PROOF_DIR}/screenshots"
56
+ # Per-surface screenshot path template — Step 7c populates ${surface}
57
+ # from the per-outcome resolver dispatch:
58
+ # ${PROOF_DIR}/${surface}/screenshots/${outcome-id}.png
59
+ mkdir -p "${PROOF_DIR}"
52
60
  ```
61
+
62
+ Sub-directories under `${PROOF_DIR}/${surface}/screenshots/` are
63
+ created lazily in Step 7c when the workflow runner takes the first
64
+ screenshot for that surface.
53
65
  </step>
54
66
 
55
67
  <step name="pre_check">
56
- ## 2. Pre-Check
68
+ ## 2. Pre-Check + Driver Selection
57
69
 
58
70
  If `implementation_plan.json` exists, verify all subtasks are completed.
59
71
  If any are pending: report and exit.
60
72
 
61
- Check which MCP tools are available:
62
- - Try `mcp__electron__get_electron_window_info` — if responds, Electron is available
63
- - Try `mcp__puppeteer__puppeteer_navigate`if responds, browser is available
64
- - Check `apt-proof-video --version` — if available, CDP video capture is enabled
73
+ ### 2a. Resolve the verify-proof driver
74
+
75
+ The workflow is **runtime-agnostic** it refers to IDL verbs
76
+ (`driver.click(target)`, `driver.screenshot(path)`), never to concrete
77
+ MCP tool names. The driver layer (`packages/framework/drivers/*/`)
78
+ maps verbs to transports. Auto-detect the runtime and select a driver:
79
+
80
+ ```bash
81
+ # Detect the project's runtime capabilities + select a driver
82
+ node .aperant/deps/node_modules/@aperant/framework/bin/apt-tools.mjs detect-runtime .
83
+ # → {status:"ok", runtime:{is_electron, is_tauri, is_nextjs, ...}, selected_driver_id:"..."}
84
+ ```
85
+
86
+ The resolver picks the highest-scoring driver per ID-02 (capability_coverage
87
+ > compatibility > stability > priority > locality). Adopters override
88
+ auto-detect via `.aperant/config.json:verification.runtimes[]`:
89
+
90
+ ```json
91
+ { "verification": { "runtimes": ["electron", "cli"] } }
92
+ ```
93
+
94
+ If no driver satisfies a REQUIRED capability, the resolver throws
95
+ `unsatisfied_required_capability` — fail-closed, NOT a silent
96
+ `blocked_by_platform` skip (per ID-02).
65
97
 
66
- Record available tools in verification.json `meta.tools` array.
98
+ **v0.8.6 per-outcome dispatch.** When the spec carries
99
+ `## User Outcomes`, the workflow runner picks a driver PER OUTCOME
100
+ SURFACE via `resolveDriversForOutcomes()` instead of a single
101
+ per-run driver pick. Each outcome's `[surface]` tag maps to the
102
+ runtime-capability flag a driver must carry; `[electron+web]`
103
+ outcomes dispatch to TWO drivers (one per surface) sharing the same
104
+ `outcome_id`. The legacy `apt-tools detect-runtime .` call above
105
+ still works for the per-run "what driver would be picked?" preview
106
+ — it answers the OLD question. For the new per-outcome question,
107
+ the workflow runner imports `resolveDriversForOutcomes` directly
108
+ from the resolver module in Step 7c.
109
+
110
+ ### 2b. Probe optional evidence-capture tools
111
+
112
+ ```bash
113
+ # CDP video capture (optional)
114
+ apt-proof-video --version # if available, CDP video is on
115
+ ```
116
+
117
+ Record the selected driver + auxiliary tools in verification.json:
118
+ `meta.selected_driver: {driverId, version, manifest_sha256, trust_tier,
119
+ sandbox_profile}` and `meta.fallback_attempts: [{driver_id, reason}]`
120
+ (see ST11's schema extension in `templates/proof-verification.md`).
67
121
  </step>
68
122
 
69
123
  <step name="automated_checks">
@@ -112,6 +166,16 @@ If no feature registry exists:
112
166
  - Suggest: "No feature registry found. Consider running `/apt:scan {area}` first for exhaustive coverage."
113
167
  - Proceed with manual discovery below, but warn that coverage may be incomplete
114
168
 
169
+ **v0.8.6 — read `## User Outcomes` from spec.md FIRST when present.**
170
+ The PRD-shaped spec.md (STANDARD/DEEP tracks) ships a
171
+ `## User Outcomes` section that is the verify-proof input contract:
172
+ `**Epic:**` headline + N atomic outcomes tagged by `[surface]`. When
173
+ present, each outcome maps 1:1 to a test entry — the workflow runner
174
+ does NOT have to invent test units from the feature registry. Fall
175
+ back to the feature-registry-based discovery below ONLY when the spec
176
+ lacks `## User Outcomes` (the v0.8.x warn-not-block migration window
177
+ per spec ID-06; the section becomes a hard block in v0.9.0).
178
+
115
179
  ### 4b. Read the source code
116
180
 
117
181
  You MUST read the actual source code for the features under test. Do not guess.
@@ -165,10 +229,14 @@ coverage = tested_count / registered_count
165
229
  **Every untested registered feature MUST go in the `skipped` array** with a reason.
166
230
  Valid skip reasons:
167
231
  - `time_constraint` — would take too long relative to value
168
- - `blocked_by_platform` — MCP tools cannot interact with this element
232
+ - `unsatisfied_optional_capability` — the selected driver lacks an OPTIONAL IDL verb needed by this test (e.g. `assert_network` not implemented). Loud, deliberate skip.
169
233
  - `depends_on_other` — requires a feature not yet implemented
170
234
  - `not_applicable` — feature is deprecated or not relevant to this verification
171
235
 
236
+ > **Legacy alias.** `blocked_by_platform` (pre-driver-architecture) is read by the schema reader as an alias for `unsatisfied_optional_capability` and emits a deprecation warning. New writes MUST use the new reason.
237
+
238
+ > **Fail-closed, not a skip:** if a REQUIRED IDL capability has no implementing driver in the resolver chain, the resolver throws `unsatisfied_required_capability` (per ID-02). This aborts the run — it does NOT silently land in the `skipped` array. Coverage loss is loud, deliberate, and audited.
239
+
172
240
  Silence about untested features is NOT acceptable. Every registered sub-feature must appear
173
241
  either as a test (with `registry_id`) or in the `skipped` array.
174
242
  </step>
@@ -232,23 +300,61 @@ If CDP is NOT available, note it and proceed without video.
232
300
  For each test, in order:
233
301
 
234
302
  ### 7a. Perform the Action
235
- Actually do what the test says:
236
- - If it says "type X" → use `mcp__electron__send_command_to_electron` with `fill_input` or `send_keyboard_shortcut`
237
- - If it says "click X" → use the appropriate click tool
238
- - If it says "navigate to X" → navigate there
239
- - If it says "run command X" → run it
303
+ Actually do what the test says — invoke the IDL verb on the selected driver:
304
+ - If it says "type X" → `driver.type({ target, text: "X" })`
305
+ - If it says "click X" → `driver.click({ target })`
306
+ - If it says "navigate to X" → `driver.navigate({ url: "X" })`
307
+ - If it says "press key X" → `driver.key({ key: "X" })`
308
+ - If it says "run command X" → `driver.execute_js({ script: "X" })`
309
+
310
+ The driver layer translates IDL verbs to its transport (an MCP server,
311
+ a local binary, or a built-in HTTP request). Workflow prose names ONLY
312
+ IDL verbs per ID-01 — concrete tool names live in
313
+ `packages/framework/drivers/<driver>/driver.mjs`.
314
+
315
+ **v0.8.6 — transport dispatch directive (MUST honor).** When
316
+ `driver.transport.skill_id` is set AND the host CLI exposes the
317
+ Skill tool AND the outcome surface is `web`, the workflow runner
318
+ MUST invoke `Skill({skill: driver.transport.skill_id, args: ...})`
319
+ (passing the IDL verb args) and MUST record `transport: "skill"` on
320
+ the resulting test entry in verification.json. When the host CLI
321
+ does NOT expose the Skill tool, fall back to the MCP transport via
322
+ the existing puppeteer MCP server and record `transport: "mcp"`.
323
+ The driver's `chooseTransport({has_skill_tool})` helper computes
324
+ the choice; the workflow runner is the site that knows
325
+ `has_skill_tool`. This directive is LLM-honored (the v1 verify-proof
326
+ runner is the host LLM following this workflow as prose); a
327
+ text-level grep guard (TD-08) pins the `MUST` language so future
328
+ edits cannot silently soften it to `SHOULD`.
240
329
 
241
330
  ### 7b. Wait for Result
242
331
  Wait for the action to complete. If it involves loading, wait for the load.
243
332
  Add a short delay (1-2 seconds) so the CDP capture also captures this state.
244
333
 
245
334
  ### 7c. Capture Evidence
246
- Take a screenshot AFTER the action completes:
335
+ Take a screenshot AFTER the action completes. v0.8.6 — screenshots
336
+ land under PER-SURFACE subdirectories, with the per-outcome driver
337
+ returned by `resolveDriversForOutcomes()`:
338
+
247
339
  ```
248
- Tool: mcp__electron__take_screenshot
249
- Args: {"outputPath": "${PROOF_DIR}/screenshots/{feature-id}-test-{n}.png"}
340
+ // Pick a driver per outcome surface (NOT per run). `entries[]` is
341
+ // the resolver's per-(outcome, surface) dispatch — for an
342
+ // [electron+web] outcome you get TWO entries sharing outcome_id
343
+ // and you loop both, capturing one screenshot per surface.
344
+ for (const entry of entries) {
345
+ await entry.driver.screenshot({
346
+ target: { kind: "css", value: "body" },
347
+ output_path: `${PROOF_DIR}/${entry.surface}/screenshots/${outcome.id}.png`
348
+ })
349
+ }
250
350
  ```
251
351
 
352
+ Single-surface outcomes (`[electron]`, `[web]`, `[cli]`, `[api]`)
353
+ produce one screenshot under `${PROOF_DIR}/${surface}/screenshots/`;
354
+ cross-surface (`[electron+web]`) produces two — one per surface tree
355
+ — with both test entries in `verification.json:tests[]` carrying the
356
+ same `id` but distinct `surface` and `evidence` fields.
357
+
252
358
  ### 7d. Analyze Evidence
253
359
  **MANDATORY and CRITICAL.** Every screenshot must be analyzed in detail.
254
360
 
@@ -271,18 +377,23 @@ apt-proof-video analyze "${PROOF_DIR}/screenshots/{feature-id}-test-{n}.png" \
271
377
  ```
272
378
 
273
379
  ### 7e. Record Result to verification.json
274
- After each test, update the test entry in verification.json `tests` array:
380
+ After each test, update the test entry in verification.json `tests` array.
381
+ v0.8.6 adds `surface` and `transport` fields per test entry — the workflow
382
+ runner populates them from the per-outcome dispatch directive:
275
383
 
276
384
  ```json
277
385
  {
278
386
  "id": "TEST-01",
279
387
  "registry_id": "terminals-grid-auto-tile",
280
388
  "name": "Three Terminal Grid Auto-Tile",
389
+ "outcome_id": "O3",
390
+ "surface": "electron",
391
+ "transport": "mcp",
281
392
  "precondition": "2 terminals active",
282
393
  "action": "Press Cmd+T",
283
394
  "expected": "Grid reflows to 2+1 layout",
284
395
  "actual": "Grid correctly tiled",
285
- "evidence": "screenshots/03-grid.png",
396
+ "evidence": "electron/screenshots/03-grid.png",
286
397
  "analysis": "Detailed adversarial analysis of what is actually visible in the screenshot...",
287
398
  "result": "pass",
288
399
  "severity": null