@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
@@ -0,0 +1,93 @@
1
+ /**
2
+ * manifest.ts — TypeScript shape of a driver manifest.
3
+ *
4
+ * Mirrors `packages/framework/src/cli/verify-proof/manifest-schema.json`
5
+ * (ST03) one-to-one. The JSON Schema is the runtime validator (publish-
6
+ * time + load-time); this TS type is what third-party driver authors
7
+ * `import type` to author manifests with intellisense.
8
+ *
9
+ * Spec authority: spec.md §ID-03 (trust tiers) + §ID-04 (driver layout).
10
+ */
11
+ export type TrustTier = 'first_party_signed' | 'community_verified' | 'community_unverified' | 'local_unverified';
12
+ export type Stability = 'experimental' | 'beta' | 'ga';
13
+ export type SandboxProfile = 'read_only' | 'workspace_write' | 'system_write';
14
+ export type NetworkPosture = 'deny' | 'allowlist' | 'allow';
15
+ /** Structured local-command — strings are NEVER accepted (ID-03). */
16
+ export interface LocalCommand {
17
+ readonly binary: string;
18
+ readonly args: readonly string[];
19
+ }
20
+ /** Transport — exactly one of the variants. */
21
+ export type Transport = {
22
+ readonly mcp_server_id: string;
23
+ } | {
24
+ readonly local_command: LocalCommand;
25
+ } | {
26
+ readonly http_endpoint: string;
27
+ } | {
28
+ readonly npm_package: string;
29
+ } | {
30
+ readonly builtin: true;
31
+ };
32
+ export interface Publisher {
33
+ readonly name: string;
34
+ readonly npm_scope?: string;
35
+ readonly github_org?: string;
36
+ readonly verified?: boolean;
37
+ }
38
+ export interface Provenance {
39
+ readonly scheme?: 'sigstore' | 'npm-provenance' | 'gpg' | 'none';
40
+ readonly identity?: string;
41
+ readonly signature?: string;
42
+ readonly certificate?: string;
43
+ }
44
+ export interface Integrity {
45
+ readonly manifest_sha256?: string;
46
+ readonly artifact_digest?: string;
47
+ }
48
+ export interface TrustBlock {
49
+ readonly tier: TrustTier;
50
+ readonly publisher?: Publisher;
51
+ readonly provenance?: Provenance;
52
+ readonly integrity?: Integrity;
53
+ }
54
+ export interface SecurityBlock {
55
+ readonly sandbox_profile: SandboxProfile;
56
+ readonly network: NetworkPosture;
57
+ readonly allowed_executables?: readonly string[];
58
+ readonly allow_shell?: boolean;
59
+ readonly requires_user_approval?: boolean;
60
+ }
61
+ export interface AuditBlock {
62
+ readonly log_invocations: boolean;
63
+ readonly log_manifest_hash: boolean;
64
+ }
65
+ export interface PreflightCheck {
66
+ readonly name: string;
67
+ readonly command?: LocalCommand;
68
+ readonly required: boolean;
69
+ }
70
+ export interface DriverManifest {
71
+ readonly driverId: string;
72
+ readonly version: string;
73
+ readonly targets: readonly string[];
74
+ readonly capabilities: readonly string[];
75
+ readonly evidence_capabilities?: readonly string[];
76
+ readonly frameworkApiRange: string;
77
+ readonly requires?: {
78
+ readonly allOf?: readonly string[];
79
+ readonly anyOf?: readonly string[];
80
+ };
81
+ readonly os?: readonly string[];
82
+ readonly arch?: readonly string[];
83
+ readonly container_support?: boolean;
84
+ readonly conflicts_with?: readonly string[];
85
+ readonly priority: number;
86
+ readonly stability: Stability;
87
+ readonly trust: TrustBlock;
88
+ readonly security: SecurityBlock;
89
+ readonly audit?: AuditBlock;
90
+ readonly preflight?: readonly PreflightCheck[];
91
+ readonly transport: Transport;
92
+ }
93
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/driver-sdk/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,SAAS,GAClB,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,GACtB,kBAAkB,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,GAAG,IAAI,CAAA;AAEtD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,iBAAiB,GAAG,cAAc,CAAA;AAE7E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAA;AAE3D,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GAClB;IAAE,QAAQ,CAAC,aAAa,EAAE,MAA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AAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IAC9C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAC7B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * manifest.ts — TypeScript shape of a driver manifest.
3
+ *
4
+ * Mirrors `packages/framework/src/cli/verify-proof/manifest-schema.json`
5
+ * (ST03) one-to-one. The JSON Schema is the runtime validator (publish-
6
+ * time + load-time); this TS type is what third-party driver authors
7
+ * `import type` to author manifests with intellisense.
8
+ *
9
+ * Spec authority: spec.md §ID-03 (trust tiers) + §ID-04 (driver layout).
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/driver-sdk/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * retry.ts — exponential backoff helper with abort signal.
3
+ *
4
+ * Used by driver implementations that want to retry transient transport
5
+ * failures (DriverInvocationError) before giving up. Pure, dependency-free.
6
+ */
7
+ export interface RetryOptions {
8
+ /** Total maximum attempts including the first. Default 3. */
9
+ readonly max_attempts?: number;
10
+ /** Initial delay in ms before the second attempt. Default 100. */
11
+ readonly base_delay_ms?: number;
12
+ /** Cap each delay at this many ms. Default 5000. */
13
+ readonly max_delay_ms?: number;
14
+ /**
15
+ * Multiplier applied to delay after each failed attempt. Default 2 →
16
+ * 100ms, 200ms, 400ms, 800ms, …
17
+ */
18
+ readonly multiplier?: number;
19
+ /** Optional AbortSignal — abort short-circuits the retry loop. */
20
+ readonly signal?: AbortSignal;
21
+ /**
22
+ * Optional predicate. When provided, only retry when shouldRetry(err) is
23
+ * true; otherwise re-throw immediately. Default: retry every error.
24
+ */
25
+ readonly shouldRetry?: (err: unknown) => boolean;
26
+ }
27
+ /**
28
+ * Run `fn` with exponential backoff. Returns the result of the first
29
+ * successful call. If every attempt fails (or the signal aborts), throws
30
+ * the last error.
31
+ */
32
+ export declare function retryWithBackoff<T>(fn: () => Promise<T>, opts?: RetryOptions): Promise<T>;
33
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/driver-sdk/retry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA;CAChD;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE,YAAiB,GACrB,OAAO,CAAC,CAAC,CAAC,CAqCZ"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * retry.ts — exponential backoff helper with abort signal.
3
+ *
4
+ * Used by driver implementations that want to retry transient transport
5
+ * failures (DriverInvocationError) before giving up. Pure, dependency-free.
6
+ */
7
+ /**
8
+ * Run `fn` with exponential backoff. Returns the result of the first
9
+ * successful call. If every attempt fails (or the signal aborts), throws
10
+ * the last error.
11
+ */
12
+ export async function retryWithBackoff(fn, opts = {}) {
13
+ const maxAttempts = Math.max(1, opts.max_attempts ?? 3);
14
+ const baseDelay = Math.max(0, opts.base_delay_ms ?? 100);
15
+ const maxDelay = Math.max(0, opts.max_delay_ms ?? 5000);
16
+ const multiplier = opts.multiplier ?? 2;
17
+ const signal = opts.signal;
18
+ const shouldRetry = opts.shouldRetry ?? (() => true);
19
+ let lastErr;
20
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
21
+ if (signal?.aborted) {
22
+ throw signal.reason instanceof Error ? signal.reason : new Error('retryWithBackoff aborted');
23
+ }
24
+ try {
25
+ return await fn();
26
+ }
27
+ catch (err) {
28
+ lastErr = err;
29
+ if (attempt >= maxAttempts)
30
+ break;
31
+ if (!shouldRetry(err))
32
+ break;
33
+ const delay = Math.min(maxDelay, baseDelay * multiplier ** (attempt - 1));
34
+ await new Promise((resolve, reject) => {
35
+ const timer = setTimeout(resolve, delay);
36
+ if (signal) {
37
+ const onAbort = () => {
38
+ clearTimeout(timer);
39
+ reject(signal.reason instanceof Error
40
+ ? signal.reason
41
+ : new Error('retryWithBackoff aborted'));
42
+ };
43
+ signal.addEventListener('abort', onAbort, { once: true });
44
+ }
45
+ });
46
+ }
47
+ }
48
+ throw lastErr instanceof Error ? lastErr : new Error(String(lastErr));
49
+ }
50
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/driver-sdk/retry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuBH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,EAAoB,EACpB,OAAqB,EAAE;IAEvB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,CAAA;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,IAAI,G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L,MAAM,CAAC,MAAM,YAAY,KAAK;4BAC7B,CAAC,CAAC,MAAM,CAAC,MAAM;4BACf,CAAC,CAAC,IAAI,KAAK,CAAC,0BAA0B,CAAC,CACxC,CAAA;oBACF,CAAC,CAAA;oBACD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;gBAC1D,CAAC;YACF,CAAC,CAAC,CAAA;QACH,CAAC;IACF,CAAC;IACD,MAAM,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACtE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aperant",
3
- "version": "0.8.1",
3
+ "version": "0.8.6",
4
4
  "description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
5
5
  "author": {
6
6
  "name": "Mikalsen AI",
@@ -25,6 +25,7 @@
25
25
  "skills/apt",
26
26
  "skills/apt-author-skill",
27
27
  "skills/apt-bootstrap",
28
+ "skills/apt-caveman",
28
29
  "skills/apt-classify",
29
30
  "skills/apt-close-task",
30
31
  "skills/apt-create-docs",
@@ -35,6 +36,7 @@
35
36
  "skills/apt-docs",
36
37
  "skills/apt-execute",
37
38
  "skills/apt-fan-out",
39
+ "skills/apt-handoff",
38
40
  "skills/apt-improve",
39
41
  "skills/apt-mockup",
40
42
  "skills/apt-pause",
@@ -44,6 +46,7 @@
44
46
  "skills/apt-prototype",
45
47
  "skills/apt-quick",
46
48
  "skills/apt-release-notes",
49
+ "skills/apt-research",
47
50
  "skills/apt-resume",
48
51
  "skills/apt-review",
49
52
  "skills/apt-roadmap",
@@ -32,7 +32,8 @@ Before planning, discover project context:
32
32
  <environment>
33
33
  - **Working directory:** The project root
34
34
  - **apt-tools:** Always invoke as `node packages/framework/bin/apt-tools.mjs`
35
- - **Task directory:** Provided in the spawn prompt as `task_dir`. ALL artifacts (spec.md, implementation_plan.json) are written here, NOT to project root.
35
+ - **Task directory:** Provided in the spawn prompt as `task_dir`. It MUST be an absolute path under the main repo's `.aperant/tasks/{task-id}/`. ALL artifacts (spec.md, implementation_plan.json) are written here, NOT to project root and NOT to a worktree-local `.aperant/tasks/` directory.
36
+ - **Worktree path:** If provided, use it only for code investigation/editing context. Do not derive artifact paths from it.
36
37
  - **Config:** `.aperant/config.json` — project preferences
37
38
  - **State:** `.aperant/state.json` — execution state
38
39
  </environment>
@@ -43,7 +44,7 @@ Before planning, discover project context:
43
44
 
44
45
  1. Read `CLAUDE.md` and `AGENTS.md` if they exist — extract conventions, stack, constraints
45
46
  2. Run `node packages/framework/bin/apt-tools.mjs state .` to understand current project state
46
- 3. Parse the task description and task_dir from the spawn prompt
47
+ 3. Parse the task description and task_dir from the spawn prompt. If task_dir is relative, resolve the real main repo path first instead of writing under the current worktree.
47
48
 
48
49
  ## 2. Assess Complexity
49
50
 
@@ -211,7 +212,7 @@ If unable to enumerate (network unavailable, action docs unclear), flag it expli
211
212
 
212
213
  ## 4. Write Specification
213
214
 
214
- The spec.md content format **branches on track** (Pocock adoption ID-05,
215
+ The spec.md content format **branches on track** (ID-05,
215
216
  Fast Path Guarantee). QUICK-routed tasks keep the existing 4-section
216
217
  shape; STANDARD/DEEP/COMPLEX tasks get a PRD-shaped artifact that
217
218
  survives the task as a second-consumer document.
@@ -239,6 +240,11 @@ survives the task as a second-consumer document.
239
240
 
240
241
  ### 4.B. STANDARD / DEEP / COMPLEX — PRD-shaped spec.md
241
242
 
243
+ **Three orthogonal user-facing sections — keep them distinct.** User
244
+ Stories (motivation prose), User Outcomes (verify-proof input contract),
245
+ and Acceptance Criteria (code-level invariants) serve distinct
246
+ purposes. Do NOT collapse them — STANDARD/DEEP specs carry all three.
247
+
242
248
  ```markdown
243
249
  # Spec: {task title}
244
250
 
@@ -256,6 +262,22 @@ survives the task as a second-consumer document.
256
262
  {One **US-NN (persona).** story per user-value slice. Stories map 1:1
257
263
  onto subtasks in implementation_plan.json.}
258
264
 
265
+ ## User Outcomes
266
+ {Verify-proof input contract. One bolded `**Epic:**` headline + N
267
+ atomic outcomes. Authors write the LITERAL string `**ON**` — IDs are
268
+ POSITIONAL and synthesized by the parser (first row becomes O1, second
269
+ O2, ...). Closed surface set: `electron | web | cli | api | electron+web`.
270
+ Optional cross-refs via `*(requires ON N)*`. Refactor-only specs MAY
271
+ use the empty-with-note escape (verbatim string,
272
+ italic underscores + em dash + period required):}
273
+
274
+ `_No user-observable changes — pure refactor._`
275
+
276
+ **Epic:** {one-sentence user-facing capability headline}
277
+
278
+ - **ON** [surface]: {user does X; system shows/does Y}
279
+ - **ON** [surface]: {user does X; system shows/does Y} *(requires ON 1)*
280
+
259
281
  ## Implementation Decisions
260
282
  {Load-bearing principles carried into every subtask. Format:
261
283
  "### ID-NN: {title}" + rationale + practical consequence.}
@@ -278,9 +300,19 @@ reference these IDs via the per-subtask `acceptance_criteria` field.}
278
300
  ```
279
301
 
280
302
  **PRD section ordering is load-bearing.** `apt-tools coverage-check
281
- validate` greps `## Acceptance Criteria`; `apt-tools consistency check`
282
- greps `## Solution` and `## User Stories`. Renaming or reordering these
283
- sections breaks downstream tooling and the C15 consistency rules.
303
+ validate` greps `## Acceptance Criteria` AND `## User Outcomes`;
304
+ `apt-tools consistency check` greps `## Solution` and `## User Stories`.
305
+ Renaming or reordering these sections breaks downstream tooling and the
306
+ C15 consistency rules.
307
+
308
+ **`## User Outcomes` synthesis directive.** Outcomes are
309
+ user-observable (a user does X; the system shows/does Y); Acceptance
310
+ Criteria are code-level invariants (a function returns X; a config key
311
+ exists). Do NOT collapse them — they parse through different gates and
312
+ serve different consumers. STANDARD/DEEP specs carry both sections in
313
+ parallel. IDs are POSITIONAL: the parser counts outcome rows in
314
+ document order and synthesizes `O1`, `O2`, ... — authors MUST write
315
+ the literal `**ON**` token, never `**O1**`/`**O2**`.
284
316
 
285
317
  **Do NOT interview the user.** The PRD is synthesized from the task
286
318
  description + codebase investigation + AGENTS.md, not from a clarifying
@@ -344,7 +376,7 @@ fix it now, not later.
344
376
 
345
377
  ## 5. Create Implementation Plan
346
378
 
347
- Subtask schema branches on track (Pocock adoption ID-05 — Fast Path Guarantee).
379
+ Subtask schema branches on track.
348
380
 
349
381
  ### 5.A. QUICK track / SIMPLE complexity — legacy flat subtask schema
350
382
 
@@ -386,18 +386,27 @@ Parse `task_id`, `task_dir`, and (if present) `worktree.worktree_path` / `worktr
386
386
  Important nuances:
387
387
  - `task_dir` is an **absolute path** under the main repo's `.aperant/tasks/{task-id}/`. All spec/plan/progress artifacts live there and are shared across worktrees.
388
388
  - `apt-tools` commands still receive the **project root** as `<project-dir>` — they coordinate state through the main repo's `.aperant/`. The worktree only affects *code editing* cwd.
389
- - When spawning an agent, set its `cwd` (or prefix its Bash calls with `cd {worktree_path} &&`) to the worktree. Pass `worktree_path` in the agent's context so it knows where it is.
389
+ - When spawning an agent, set its `cwd` (or prefix its Bash calls with `cd {worktree_path} &&`) to the worktree for code reads/edits. Pass `worktree_path` in the agent's context so it knows where code work happens.
390
+ - Planner artifact safety: do **not** spawn `apt-planner` with host-level worktree isolation that gives it a separate copied repo. The planner must write `spec.md` and `implementation_plan.json` to the absolute main-repo `task_dir` from `task create`; `.aperant/tasks/**` is gitignored, so artifacts written under a disposable worktree can be invisible to git and lost when that worktree is cleaned.
390
391
  - If no `worktree` block is returned, proceed in the project root as before.
391
392
 
392
393
  ### Step 3: Spawn Planner Agent
393
394
 
394
395
  **If `spawn_agent` is true (STANDARD/DEEP):**
395
396
 
396
- Print phase marker BEFORE spawning:
397
+ Print the phase rail BEFORE spawning. Render the panel verbatim — branch glyphs `┌─ │ └─`, status glyphs `✓` (done) / `●` (active) / `○` (pending), one phase per row, inline metrics on completed rows when available:
398
+
397
399
  ```
398
400
  [APT] Phase 1/N — Planning (spawning apt-planner agent)
401
+ ┌─ Phase rail: {short task name} ───────────────────
402
+ │ Phase 1 Plan ● spawning apt-planner
403
+ │ Phase 2 Execute ○
404
+ │ Phase 3 Verify ○
405
+ │ Phase 4 Review ○
406
+ └───────────────────────────────────────────────────
399
407
  ```
400
- (N = total pipeline phases: e.g. plan+execute+verify+review = 4, discuss+plan+… = 5)
408
+
409
+ (N = total pipeline phases: e.g. plan+execute+verify+review = 4, discuss+plan+… = 5. Keep the `[APT] Phase X/N` header line — it's the backward-compat marker that external grep tooling relies on. The rail panel sits directly below it.)
401
410
 
402
411
  You **MUST** use the `Task` tool to spawn `apt-planner` — do NOT write
403
412
  `spec.md` or `implementation_plan.json` inline using the `Write` tool. The
@@ -414,8 +423,9 @@ Spawn `apt-planner` via Task tool with context:
414
423
  ```
415
424
  Task: {task_description}
416
425
  Task ID: {task_id}
417
- Task Dir: {task_dir}
426
+ Task Dir: {task_dir} # absolute path under the main repo, not under worktree_path
418
427
  Track: {track}
428
+ Worktree Path: {worktree_path or "none"}
419
429
 
420
430
  <files_to_read>
421
431
  - CLAUDE.md (if exists)
@@ -423,7 +433,7 @@ Track: {track}
423
433
  - Any brainstorm notes at .aperant/context/notes/{task_id}-brainstorm.md
424
434
  </files_to_read>
425
435
 
426
- Write spec.md and implementation_plan.json to {task_dir}/
436
+ Write spec.md and implementation_plan.json to {task_dir}/. Do not write plan artifacts to `{worktree_path}/.aperant/tasks/...` or any relative `.aperant/tasks/...` path.
427
437
  ```
428
438
 
429
439
  After the agent returns, emit a token running-total line:
@@ -445,9 +455,32 @@ The user's chosen option has a `pipeline` array (e.g. `["plan", "execute", "veri
445
455
  **execution_mode = "auto":**
446
456
  Auto-chain without waiting. STANDARD and DEEP auto pipelines both follow Plan → execute → verify → review (DEEP additionally leads with discuss).
447
457
 
448
- Each phase transition MUST emit a status marker for visibility:
458
+ Each phase transition MUST emit a status marker AND re-render the phase rail showing the updated state for ALL phases. The rail is the user's primary signal — render it verbatim, do not summarize or skip.
459
+
449
460
  ```
450
461
  [APT] Phase {current}/{total} — {name} (spawning {agent})
462
+ ┌─ Phase rail: {short task name} ───────────────────
463
+ │ Phase 1 Plan ✓ {N} subtasks
464
+ │ Phase 2 Execute ● spawning apt-executor
465
+ │ Phase 3 Verify ○
466
+ │ Phase 4 Review ○
467
+ └───────────────────────────────────────────────────
468
+ ```
469
+
470
+ Metric conventions per phase row (omit metrics on `○` pending rows):
471
+ - **Plan ✓**: `N subtasks`
472
+ - **Execute ✓**: `N commits, K tests` (or `N/M subtasks` mid-execute on `●`)
473
+ - **Verify ✓**: `APPROVED a/b/c/d` (completeness/correctness/quality/coverage)
474
+ - **Review ✓**: `APPROVE a/b/c/d/e/f, K findings fixed` (or `request-changes, K open`)
475
+ - **Ship ✓**: `PR #N` (the SHIPPED collapsed variant — see below)
476
+
477
+ When ship completes (lifecycle `shipped-pending-merge` + PR URL exists), collapse to the SHIPPED variant:
478
+
479
+ ```
480
+ ┌─ {short task name} ────────────────────── ✅ SHIPPED
481
+ │ Plan ✓ Execute ✓ Verify ✓ Review ✓ Ship ✓
482
+ │ PR #{N}: {url}
483
+ └───────────────────────────────────────────────────
451
484
  ```
452
485
 
453
486
  Full auto-chain sequence (STANDARD = 4 phases, DEEP = 5 phases):
@@ -460,6 +493,42 @@ Full auto-chain sequence (STANDARD = 4 phases, DEEP = 5 phases):
460
493
  After EACH agent returns, emit the token running-total line (same pattern
461
494
  as Step 3: `tokens tally` then print `[APT] Tokens: input+output = total`).
462
495
 
496
+ #### Consent-driven --spar-gates auto-inject (FRAMEWORK-RFC-001)
497
+
498
+ The route envelope carries the consent signal deterministically — do NOT
499
+ re-read `.aperant/config.local.json` from prompt-space. Two envelope fields
500
+ drive the decision, both emitted by `route.mjs` per spec §4.10:
501
+
502
+ 1. **`envelope.spar_inject_gates`** — present only on the flag-override path
503
+ (explicit `--quick` / `--deep` / `--debug`) when consent is on AND the
504
+ user did NOT pass an explicit `--spar-gates`. Value is `"plan"` (STANDARD)
505
+ or `"plan,execute"` (DEEP). When set, append `--spar-gates <value>` to
506
+ the chained `/apt:run` invocation. **Do NOT recompute** — the deterministic
507
+ contract lives in code, not prompt-space.
508
+
509
+ 2. **`envelope.spar_consent`** — present on the host-LLM classify path.
510
+ Shape: `{ enabled: boolean, partner: string|null, user_passed_explicit_gates: boolean }`.
511
+ After you (the host model) pick a track via Step 0c:
512
+ - **Track === QUICK or DEBUG: do NOT inject.** QUICK is Fast-Path-exempt
513
+ (CLAUDE.md Fast Path Guarantee); DEBUG produces no spec/plan to spar
514
+ against.
515
+ - **Track === STANDARD** AND `spar_consent.enabled === true` AND
516
+ `spar_consent.user_passed_explicit_gates === false`: append
517
+ `--spar-gates plan` to the `/apt:run` invocation.
518
+ - **Track === DEEP** AND `spar_consent.enabled === true` AND
519
+ `spar_consent.user_passed_explicit_gates === false`: append
520
+ `--spar-gates plan,execute` to the `/apt:run` invocation.
521
+ - `user_passed_explicit_gates === true`: the user already supplied
522
+ `--spar-gates` — do NOT double-inject. Their flag is already in the
523
+ dispatched invocation.
524
+
525
+ If `envelope.spar_consent` is absent (consent never configured) AND
526
+ `envelope.spar_inject_gates` is absent, do NOT inject. The signal is
527
+ **deterministic** — Step 4 reads ONLY the envelope fields above. Do NOT
528
+ re-read `.aperant/config.local.json` from prompt-space; the
529
+ consent-resolution helper is wired into `route.mjs` and the envelope is
530
+ the canonical contract. The structural test grep-locks this invariant.
531
+
463
532
  **execution_mode = "step" or "research":**
464
533
  After each stage in the pipeline, show result and ask before proceeding:
465
534
  ```
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: apt:caveman
3
+ description: "Ultra-compressed communication mode — toggle terse 'smart caveman' output to cut token usage ~75% while keeping full technical accuracy"
4
+ apt-skill-version: {{APT_VERSION}}
5
+ stage: ops
6
+ intent: configure
7
+ when_to_use: "The user invokes /apt:caveman, or says 'caveman mode', 'talk like caveman', 'be brief', 'less tokens'. Toggles a persistent terse output mode. Off with 'stop caveman' or 'normal mode'."
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
+ allowed-tools: ""
17
+ argument-hint: "apt:caveman"
18
+ gates: []
19
+ ---
20
+
21
+ Respond terse like smart caveman. All technical substance stay. Only fluff die.
22
+
23
+ ## Persistence
24
+
25
+ ACTIVE EVERY RESPONSE once triggered. No revert after many turns. No filler drift. Still active if unsure. Off only when user says "stop caveman" or "normal mode".
26
+
27
+ ## Rules
28
+
29
+ Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Abbreviate common terms (DB/auth/config/req/res/fn/impl). Strip conjunctions. Use arrows for causality (X -> Y). One word when one word enough.
30
+
31
+ Technical terms stay exact. Code blocks unchanged. Errors quoted exact.
32
+
33
+ Pattern: `[thing] [action] [reason]. [next step].`
34
+
35
+ Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
36
+ Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
37
+
38
+ ### Examples
39
+
40
+ **"Why React component re-render?"**
41
+
42
+ > Inline obj prop -> new ref -> re-render. `useMemo`.
43
+
44
+ **"Explain database connection pooling."**
45
+
46
+ > Pool = reuse DB conn. Skip handshake -> fast under load.
47
+
48
+ ## Auto-Clarity Exception
49
+
50
+ Drop caveman temporarily for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.
51
+
52
+ Example — destructive op:
53
+
54
+ > **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
55
+ >
56
+ > ```sql
57
+ > DROP TABLE users;
58
+ > ```
59
+ >
60
+ > Caveman resume. Verify backup exist first.
61
+
62
+ ## Boundaries
63
+
64
+ Code, commits, PRs: write normal (full sentences in commit bodies / PR descriptions). Only conversational output is compressed. `stop caveman` / `normal mode` reverts.
@@ -22,7 +22,7 @@ gates: []
22
22
  <objective>
23
23
  Debug an issue using the scientific method: observe symptoms, form hypotheses, test them systematically, and reach a conclusion. State persists across context resets via `.aperant/debug/{session-id}/DEBUG.md`.
24
24
 
25
- **Diagnose-discipline posture loader (Pocock adoption AC10).** You MUST
25
+ **Diagnose-discipline posture loader.** You MUST
26
26
  load `appendices/diagnose-discipline.md` into reasoning context at
27
27
  session start. It carries the 6-phase loop (Reproduce → Minimise →
28
28
  Hypothesise → Instrument → Fix → Regression-test) and the **Phase-1
@@ -61,12 +61,44 @@ reproduction, so loading this appendix is non-trivial.
61
61
  ## 1. Initialize or Resume Session
62
62
 
63
63
  Parse `$ARGUMENTS`:
64
- - **New session:** Generate session ID from timestamp (`debug-YYYYMMDD-HHmm`)
65
- - **`--resume <session-id>`:** Read existing `.aperant/debug/{session-id}/DEBUG.md` and continue from last state
66
- - **`--resume` (no id):** Find the most recent session in `.aperant/debug/` and resume it
64
+ - **New session:** resolve a canonical task id (see 1a below), then use it as the `{session-id}` for the debug working directory.
65
+ - **`--resume <session-id>`:** Read existing `.aperant/debug/{session-id}/DEBUG.md` and continue from last state. Skip Section 1a — the session id is already canonical.
66
+ - **`--resume` (no id):** Find the most recent session in `.aperant/debug/` and resume it. Skip Section 1a.
67
67
 
68
68
  If resuming, read DEBUG.md and skip to the current phase (observe/hypothesize/test/conclude).
69
69
 
70
+ ### 1a. Resolve canonical task id (idempotent — new sessions only)
71
+
72
+ DEBUG now produces a canonical state.active_tasks record so `/apt:ship` can find the task via the lite ship profile once the fix is committed. The body owns idempotency because `apt-tools task create` does NOT guard against existing ids (see spec §3 R8).
73
+
74
+ Two invocation paths converge here:
75
+
76
+ - **Router path** (`/apt` → `/apt:debug`): the router has already called `task create` and injected `task_id` into your skill context.
77
+ - **Direct path** (`/apt:debug foo`): no `task_id` in context — you create one now.
78
+
79
+ Sequence:
80
+
81
+ 1. **If `task_id` is present in skill context** (router path):
82
+ ```bash
83
+ apt-tools task get . --id {task_id}
84
+ ```
85
+ - If exit 0 AND the returned record has `track === "DEBUG"` → reuse, skip the create call. Adopt `task_id` as `{session-id}`.
86
+ - Else (record missing OR wrong track) → call:
87
+ ```bash
88
+ apt-tools task create . --description "$ARGUMENTS" --track DEBUG --id {task_id}
89
+ ```
90
+ Adopt the id as `{session-id}`.
91
+
92
+ 2. **If no `task_id` in skill context** (direct path):
93
+ ```bash
94
+ apt-tools task create . --description "$ARGUMENTS" --track DEBUG
95
+ ```
96
+ Parse the generated `task_id` from the envelope and adopt it as `{session-id}`. The canonical id replaces the legacy `debug-YYYYMMDD-HHmm` form.
97
+
98
+ The debug working dir at `.aperant/debug/{session-id}/` stays — that working artifact is preserved (per spec §3 R7). The canonical task record at `.aperant/tasks/{task-id}/` is created in parallel by `task create`, and both share the same id.
99
+
100
+ ### 1b. Create debug working directory
101
+
70
102
  ```bash
71
103
  mkdir -p .aperant/debug/{session-id}
72
104
  mkdir -p .aperant/debug/{session-id}/checkpoints
@@ -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/diagnose
4
- Licensed under MIT. Modifications: ported as an apt:debug posture loader
5
- so the 6-phase loop attaches to the existing 5-phase apt:debug body
6
- without forking apt:debug's control flow. Aligned with apt:debug's
7
- DEBUG.md state file and checkpoint conventions.
8
- -->
9
-
10
1
  # Diagnose Discipline — apt:debug posture loader (6-phase loop)
11
2
 
12
3
  This appendix loads into `apt:debug`'s reasoning context as a posture
@@ -15,7 +6,7 @@ upgrade. The existing apt:debug body has 5 phases (Observe → Hypothesize
15
6
  symptom-gathering with reproduction. Open question #1 was verified — the
16
7
  gap is real, the appendix is non-trivial.
17
8
 
18
- This appendix carries the 6-phase Pocock discipline. The skill body
9
+ This appendix carries the 6-phase Aperant discipline. The skill body
19
10
  loads it and uses Phase 1 (Reproduce) as a **hard prerequisite** before
20
11
  advancing from Observe to Hypothesize.
21
12
 
@@ -82,7 +73,7 @@ run on demand to trigger the failure.
82
73
 
83
74
  These are different mental modes. Minimise asks "what's the smallest
84
75
  thing that still fails?" — a reductive activity. Hypothesise asks
85
- "WHY does it fail?" — an explanatory activity. Pocock's discipline
76
+ "WHY does it fail?" — an explanatory activity. the discipline
86
77
  separates them because skipping Phase 2 and going straight from "I can
87
78
  repro" to "here's why" tends to anchor on the first plausible cause
88
79
  and miss alternatives.
@@ -47,7 +47,7 @@ These are two postures of the same skill, not two different skills. The
47
47
  intent-detection step below decides which one to enter — same file, same
48
48
  artifact layout, different section populated.
49
49
 
50
- **Decision-lock posture loader (Pocock adoption ID-02 + ID-04 — AC11).**
50
+ **Decision-lock posture loader (ID-02 + ID-04 — AC11).**
51
51
  When entering decision-lock posture, you MUST load
52
52
  `appendices/grill-discipline.md` into reasoning context. It carries the
53
53
  validated 100-token reframe sentence ("Your job is not to emit a plan;
@@ -60,7 +60,7 @@ source for the autonomy-aware rule; downstream skills (`apt:improve`,
60
60
  `apt:triage`) reference it rather than re-stating the policy. Brainstorm
61
61
  posture does NOT load this appendix.
62
62
 
63
- **Brainstorm posture zoom-out helper (Pocock adoption AC6 + AC11).**
63
+ **Brainstorm posture zoom-out helper (AC6 + AC11).**
64
64
  When in brainstorm posture and the user's turn contains a zoom-out
65
65
  trigger phrase ("give me a broader picture", "I'm lost in this area",
66
66
  "explain how this fits", "what's the surrounding architecture", "zoom
@@ -565,9 +565,9 @@ Review-Auto is Auto Mode **plus one human checkpoint at the batch end**. It does
565
565
 
566
566
  Do NOT introduce per-decision staging ("show me D-01, wait, show me D-02, wait...") — that collapses review-auto into spaced interactive mode and defeats the point of joint reasoning up front. Do NOT skip the pause ("autonomy is high, let's just write it") — that collapses review-auto into auto. The one pause at the end is the whole identity of this mode.
567
567
 
568
- ## 6.5. Grill Mode (`--grill` flag — Pocock `grill-with-docs` overlay)
568
+ ## 6.5. Grill Mode (`--grill` flag — Aperant `grill-with-docs` overlay)
569
569
 
570
- **Activate when:** the user invoked the skill with `--grill`. This is an **overlay**, not a mode — it stacks on top of whichever Section 6 mode is active (Interactive by default; combine with `--auto` etc. as desired). The overlay does two things: (1) it applies Pocock's 4 grill moves during decision resolution; (2) it fires inline writes to CONTEXT.md and ADRs as terms resolve and decisions pass the Nygard 3-gate.
570
+ **Activate when:** the user invoked the skill with `--grill`. This is an **overlay**, not a mode — it stacks on top of whichever Section 6 mode is active (Interactive by default; combine with `--auto` etc. as desired). The overlay does two things: (1) it applies the 4 grill moves during decision resolution; (2) it fires inline writes to CONTEXT.md and ADRs as terms resolve and decisions pass the Nygard 3-gate.
571
571
 
572
572
  The discipline this overlay loads is already in [`appendices/grill-discipline.md`](./appendices/grill-discipline.md) — re-read the reframe sentence and the autonomy degradation table before each grill turn. **Do NOT duplicate that content here.** What follows is only the moves + writer-call instructions specific to the overlay.
573
573