approval-md 0.1.0 → 0.3.0

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 (416) hide show
  1. package/README.md +629 -559
  2. package/SPEC.md +99 -24
  3. package/dist/src/adapters/agentmail.d.ts +426 -0
  4. package/dist/src/adapters/agentmail.js +2 -2
  5. package/dist/src/adapters/conformance.d.ts +149 -0
  6. package/dist/src/adapters/contract.d.ts +628 -0
  7. package/dist/src/adapters/contract.js +110 -16
  8. package/dist/src/adapters/contract.js.map +1 -1
  9. package/dist/src/adapters/email.d.ts +324 -0
  10. package/dist/src/adapters/env-passphrase.d.ts +93 -0
  11. package/dist/src/adapters/public.d.ts +11 -0
  12. package/dist/src/adapters/public.js +11 -0
  13. package/dist/src/adapters/public.js.map +1 -0
  14. package/dist/src/adapters/registry.d.ts +59 -0
  15. package/dist/src/adapters/registry.js +2 -1
  16. package/dist/src/adapters/registry.js.map +1 -1
  17. package/dist/src/adapters/smtp.d.ts +213 -0
  18. package/dist/src/adapters/vault-provider.d.ts +114 -0
  19. package/dist/src/adapters/vault-provider.js +3 -3
  20. package/dist/src/adapters/zzz.d.ts +66 -0
  21. package/dist/src/adapters/zzz.js +299 -0
  22. package/dist/src/adapters/zzz.js.map +1 -0
  23. package/dist/src/channels/batch.d.ts +109 -0
  24. package/dist/src/channels/cli.d.ts +193 -0
  25. package/dist/src/channels/conformance.d.ts +92 -0
  26. package/dist/src/channels/contract.d.ts +656 -0
  27. package/dist/src/channels/contract.js +200 -7
  28. package/dist/src/channels/contract.js.map +1 -1
  29. package/dist/src/channels/payload-view.d.ts +35 -0
  30. package/dist/src/channels/render-queue.d.ts +149 -0
  31. package/dist/src/channels/tagging.d.ts +196 -0
  32. package/dist/src/channels/telegram.d.ts +1944 -0
  33. package/dist/src/channels/telegram.js +218 -23
  34. package/dist/src/channels/telegram.js.map +1 -1
  35. package/dist/src/channels/web.d.ts +350 -0
  36. package/dist/src/channels/web.js +17 -0
  37. package/dist/src/channels/web.js.map +1 -1
  38. package/dist/src/cli/adapter.d.ts +90 -0
  39. package/dist/src/cli/adapter.js +25 -15
  40. package/dist/src/cli/adapter.js.map +1 -1
  41. package/dist/src/cli/amend.d.ts +59 -0
  42. package/dist/src/cli/amend.js +214 -30
  43. package/dist/src/cli/amend.js.map +1 -1
  44. package/dist/src/cli/args.d.ts +43 -0
  45. package/dist/src/cli/attest.d.ts +50 -0
  46. package/dist/src/cli/attest.js +134 -7
  47. package/dist/src/cli/attest.js.map +1 -1
  48. package/dist/src/cli/audit-card.d.ts +62 -0
  49. package/dist/src/cli/audit.d.ts +59 -0
  50. package/dist/src/cli/channel-telegram.d.ts +879 -0
  51. package/dist/src/cli/channel-telegram.js +311 -13
  52. package/dist/src/cli/channel-telegram.js.map +1 -1
  53. package/dist/src/cli/channel-web.d.ts +131 -0
  54. package/dist/src/cli/channel.d.ts +80 -0
  55. package/dist/src/cli/channel.js +9 -0
  56. package/dist/src/cli/channel.js.map +1 -1
  57. package/dist/src/cli/checkpoint-tap.d.ts +169 -0
  58. package/dist/src/cli/codex-bridge.d.ts +819 -0
  59. package/dist/src/cli/codex-bridge.js +1607 -0
  60. package/dist/src/cli/codex-bridge.js.map +1 -0
  61. package/dist/src/cli/codex.d.ts +2 -0
  62. package/dist/src/cli/codex.js +469 -0
  63. package/dist/src/cli/codex.js.map +1 -0
  64. package/dist/src/cli/coverage.d.ts +61 -0
  65. package/dist/src/cli/daemon.d.ts +120 -0
  66. package/dist/src/cli/daemon.js +4 -1
  67. package/dist/src/cli/daemon.js.map +1 -1
  68. package/dist/src/cli/doctor.d.ts +129 -0
  69. package/dist/src/cli/doctor.js +586 -17
  70. package/dist/src/cli/doctor.js.map +1 -1
  71. package/dist/src/cli/env.d.ts +65 -0
  72. package/dist/src/cli/execute.d.ts +202 -0
  73. package/dist/src/cli/execute.js +25 -2
  74. package/dist/src/cli/execute.js.map +1 -1
  75. package/dist/src/cli/exit-codes.d.ts +73 -0
  76. package/dist/src/cli/feedback.d.ts +60 -0
  77. package/dist/src/cli/gate-window.d.ts +40 -0
  78. package/dist/src/cli/gate.d.ts +68 -0
  79. package/dist/src/cli/git-scope.d.ts +190 -0
  80. package/dist/src/cli/gloss-attach.d.ts +85 -0
  81. package/dist/src/cli/gloss-codex-child.d.ts +9 -0
  82. package/dist/src/cli/gloss-codex.d.ts +24 -0
  83. package/dist/src/cli/gloss-options.d.ts +42 -0
  84. package/dist/src/cli/gloss.d.ts +265 -0
  85. package/dist/src/cli/help.d.ts +107 -0
  86. package/dist/src/cli/help.js +320 -93
  87. package/dist/src/cli/help.js.map +1 -1
  88. package/dist/src/cli/hook-codex.d.ts +126 -0
  89. package/dist/src/cli/hook-codex.js +226 -0
  90. package/dist/src/cli/hook-codex.js.map +1 -0
  91. package/dist/src/cli/hook.d.ts +787 -0
  92. package/dist/src/cli/hook.js +1235 -181
  93. package/dist/src/cli/hook.js.map +1 -1
  94. package/dist/src/cli/import.d.ts +35 -0
  95. package/dist/src/cli/import.js +1 -1
  96. package/dist/src/cli/import.js.map +1 -1
  97. package/dist/src/cli/init.d.ts +84 -0
  98. package/dist/src/cli/init.js +2 -2
  99. package/dist/src/cli/init.js.map +1 -1
  100. package/dist/src/cli/instructions.d.ts +23 -0
  101. package/dist/src/cli/journal.d.ts +41 -0
  102. package/dist/src/cli/log-advance.d.ts +287 -0
  103. package/dist/src/cli/log-advance.js +102 -11
  104. package/dist/src/cli/log-advance.js.map +1 -1
  105. package/dist/src/cli/log-anchor.d.ts +176 -0
  106. package/dist/src/cli/log-checkpoint.d.ts +22 -0
  107. package/dist/src/cli/log-sync.d.ts +243 -0
  108. package/dist/src/cli/log-verbs.d.ts +16 -0
  109. package/dist/src/cli/log-verbs.js +7 -1
  110. package/dist/src/cli/log-verbs.js.map +1 -1
  111. package/dist/src/cli/long-help.d.ts +70 -0
  112. package/dist/src/cli/main.d.ts +77 -0
  113. package/dist/src/cli/main.js +159 -7
  114. package/dist/src/cli/main.js.map +1 -1
  115. package/dist/src/cli/mcp.d.ts +52 -0
  116. package/dist/src/cli/paths.d.ts +56 -0
  117. package/dist/src/cli/payload.d.ts +58 -0
  118. package/dist/src/cli/policy-apply.d.ts +195 -0
  119. package/dist/src/cli/policy-apply.js +573 -0
  120. package/dist/src/cli/policy-apply.js.map +1 -0
  121. package/dist/src/cli/policy.d.ts +43 -0
  122. package/dist/src/cli/policy.js +14 -1
  123. package/dist/src/cli/policy.js.map +1 -1
  124. package/dist/src/cli/preflight.d.ts +501 -0
  125. package/dist/src/cli/preflight.js +689 -45
  126. package/dist/src/cli/preflight.js.map +1 -1
  127. package/dist/src/cli/progress.d.ts +78 -0
  128. package/dist/src/cli/prompt.d.ts +209 -0
  129. package/dist/src/cli/quickstart.d.ts +46 -0
  130. package/dist/src/cli/quickstart.js +297 -0
  131. package/dist/src/cli/quickstart.js.map +1 -0
  132. package/dist/src/cli/records.d.ts +34 -0
  133. package/dist/src/cli/render.d.ts +22 -0
  134. package/dist/src/cli/sandbox.d.ts +51 -0
  135. package/dist/src/cli/sandbox.js +17 -1
  136. package/dist/src/cli/sandbox.js.map +1 -1
  137. package/dist/src/cli/scaffold.d.ts +79 -0
  138. package/dist/src/cli/scaffold.js +1 -1
  139. package/dist/src/cli/setup-adapter.d.ts +137 -0
  140. package/dist/src/cli/setup-adapter.js +38 -4
  141. package/dist/src/cli/setup-adapter.js.map +1 -1
  142. package/dist/src/cli/setup-channel.d.ts +126 -0
  143. package/dist/src/cli/setup-channel.js +28 -1
  144. package/dist/src/cli/setup-channel.js.map +1 -1
  145. package/dist/src/cli/setup-checkpoint.d.ts +57 -0
  146. package/dist/src/cli/setup-common.d.ts +277 -0
  147. package/dist/src/cli/setup-common.js +3 -2
  148. package/dist/src/cli/setup-common.js.map +1 -1
  149. package/dist/src/cli/setup-flow.d.ts +287 -0
  150. package/dist/src/cli/setup-service.d.ts +96 -0
  151. package/dist/src/cli/setup.d.ts +204 -0
  152. package/dist/src/cli/setup.js +94 -2
  153. package/dist/src/cli/setup.js.map +1 -1
  154. package/dist/src/cli/style.d.ts +320 -0
  155. package/dist/src/cli/token.d.ts +39 -0
  156. package/dist/src/cli/up.d.ts +155 -0
  157. package/dist/src/cli/up.js +119 -53
  158. package/dist/src/cli/up.js.map +1 -1
  159. package/dist/src/cli/usage.d.ts +37 -0
  160. package/dist/src/cli/values.d.ts +40 -0
  161. package/dist/src/cli/values.js +3 -4
  162. package/dist/src/cli/values.js.map +1 -1
  163. package/dist/src/cli/vault.d.ts +59 -0
  164. package/dist/src/cli/vault.js +2 -2
  165. package/dist/src/cli/vault.js.map +1 -1
  166. package/dist/src/cli/verb-registry.d.ts +76 -0
  167. package/dist/src/cli/verb-registry.js +344 -11
  168. package/dist/src/cli/verb-registry.js.map +1 -1
  169. package/dist/src/cli/wordmark.d.ts +31 -0
  170. package/dist/src/cli/wordmark.js +2 -2
  171. package/dist/src/codex/broker.d.ts +229 -0
  172. package/dist/src/codex/broker.js +548 -0
  173. package/dist/src/codex/broker.js.map +1 -0
  174. package/dist/src/codex/doctor.d.ts +13 -0
  175. package/dist/src/codex/doctor.js +41 -0
  176. package/dist/src/codex/doctor.js.map +1 -0
  177. package/dist/src/codex/manifest.d.ts +49 -0
  178. package/dist/src/codex/manifest.js +103 -0
  179. package/dist/src/codex/manifest.js.map +1 -0
  180. package/dist/src/codex/runner.d.ts +178 -0
  181. package/dist/src/codex/runner.js +231 -0
  182. package/dist/src/codex/runner.js.map +1 -0
  183. package/dist/src/codex/serve.d.ts +56 -0
  184. package/dist/src/codex/serve.js +98 -0
  185. package/dist/src/codex/serve.js.map +1 -0
  186. package/dist/src/codex/templates.d.ts +41 -0
  187. package/dist/src/codex/templates.js +319 -0
  188. package/dist/src/codex/templates.js.map +1 -0
  189. package/dist/src/codex/trust.d.ts +19 -0
  190. package/dist/src/codex/trust.js +183 -0
  191. package/dist/src/codex/trust.js.map +1 -0
  192. package/dist/src/codex/workspace-commit.d.ts +219 -0
  193. package/dist/src/codex/workspace-commit.js +549 -0
  194. package/dist/src/codex/workspace-commit.js.map +1 -0
  195. package/dist/src/codex/workspace-plan.d.ts +131 -0
  196. package/dist/src/codex/workspace-plan.js +561 -0
  197. package/dist/src/codex/workspace-plan.js.map +1 -0
  198. package/dist/src/core/actor.d.ts +2 -0
  199. package/dist/src/core/actor.js +5 -0
  200. package/dist/src/core/actor.js.map +1 -0
  201. package/dist/src/core/advance-cycle.d.ts +221 -0
  202. package/dist/src/core/advance-cycle.js +66 -2
  203. package/dist/src/core/advance-cycle.js.map +1 -1
  204. package/dist/src/core/agents-md.d.ts +278 -0
  205. package/dist/src/core/agents-md.js +33 -31
  206. package/dist/src/core/agents-md.js.map +1 -1
  207. package/dist/src/core/apply-patch.d.ts +49 -0
  208. package/dist/src/core/apply-patch.js +266 -0
  209. package/dist/src/core/apply-patch.js.map +1 -0
  210. package/dist/src/core/attest.d.ts +635 -0
  211. package/dist/src/core/attest.js +326 -4
  212. package/dist/src/core/attest.js.map +1 -1
  213. package/dist/src/core/audit.d.ts +510 -0
  214. package/dist/src/core/audit.js +13 -0
  215. package/dist/src/core/audit.js.map +1 -1
  216. package/dist/src/core/budgets.d.ts +238 -0
  217. package/dist/src/core/channel-owner.d.ts +213 -0
  218. package/dist/src/core/channel-owner.js +358 -0
  219. package/dist/src/core/channel-owner.js.map +1 -0
  220. package/dist/src/core/checkpoint.d.ts +500 -0
  221. package/dist/src/core/child-env.d.ts +88 -0
  222. package/dist/src/core/clock.d.ts +52 -0
  223. package/dist/src/core/command-class.d.ts +697 -0
  224. package/dist/src/core/command-class.js +713 -25
  225. package/dist/src/core/command-class.js.map +1 -1
  226. package/dist/src/core/commit-guard.d.ts +272 -0
  227. package/dist/src/core/commit-guard.js +424 -0
  228. package/dist/src/core/commit-guard.js.map +1 -0
  229. package/dist/src/core/coverage-sources/adapter.d.ts +40 -0
  230. package/dist/src/core/coverage-sources/gh.d.ts +48 -0
  231. package/dist/src/core/coverage-sources/git.d.ts +101 -0
  232. package/dist/src/core/coverage.d.ts +217 -0
  233. package/dist/src/core/credential-spec.d.ts +72 -0
  234. package/dist/src/core/daemon-actor.d.ts +45 -0
  235. package/dist/src/core/daemon-actor.js +54 -0
  236. package/dist/src/core/daemon-actor.js.map +1 -0
  237. package/dist/src/core/dark-session.d.ts +432 -0
  238. package/dist/src/core/dark-session.js +266 -82
  239. package/dist/src/core/dark-session.js.map +1 -1
  240. package/dist/src/core/decision-refusal.d.ts +206 -0
  241. package/dist/src/core/decision-refusal.js +24 -2
  242. package/dist/src/core/decision-refusal.js.map +1 -1
  243. package/dist/src/core/env-file.d.ts +455 -0
  244. package/dist/src/core/env-file.js +60 -1
  245. package/dist/src/core/env-file.js.map +1 -1
  246. package/dist/src/core/execute.d.ts +871 -0
  247. package/dist/src/core/execute.js +59 -8
  248. package/dist/src/core/execute.js.map +1 -1
  249. package/dist/src/core/frontmatter.d.ts +78 -0
  250. package/dist/src/core/gate-window.d.ts +312 -0
  251. package/dist/src/core/gate.d.ts +1449 -0
  252. package/dist/src/core/gate.js +149 -14
  253. package/dist/src/core/gate.js.map +1 -1
  254. package/dist/src/core/gesture-refusal.d.ts +166 -0
  255. package/dist/src/core/gesture-refusal.js +188 -0
  256. package/dist/src/core/gesture-refusal.js.map +1 -0
  257. package/dist/src/core/git-run.d.ts +73 -0
  258. package/dist/src/core/harness-version.d.ts +157 -0
  259. package/dist/src/core/harness-version.js +4 -1
  260. package/dist/src/core/harness-version.js.map +1 -1
  261. package/dist/src/core/harness-wait.d.ts +55 -0
  262. package/dist/src/core/head-retry.d.ts +107 -0
  263. package/dist/src/core/instance.d.ts +310 -0
  264. package/dist/src/core/instance.js +113 -0
  265. package/dist/src/core/instance.js.map +1 -1
  266. package/dist/src/core/intake-limits.d.ts +247 -0
  267. package/dist/src/core/jcs.d.ts +52 -0
  268. package/dist/src/core/journal.d.ts +144 -0
  269. package/dist/src/core/live-draw.d.ts +436 -0
  270. package/dist/src/core/log-reconcile.d.ts +89 -0
  271. package/dist/src/core/log-subscribe.d.ts +36 -0
  272. package/dist/src/core/log-subscribe.js +162 -0
  273. package/dist/src/core/log-subscribe.js.map +1 -0
  274. package/dist/src/core/log.d.ts +316 -0
  275. package/dist/src/core/log.js.map +1 -1
  276. package/dist/src/core/loop.d.ts +274 -0
  277. package/dist/src/core/loop.js +11 -0
  278. package/dist/src/core/loop.js.map +1 -1
  279. package/dist/src/core/md-fence.d.ts +41 -0
  280. package/dist/src/core/money.d.ts +147 -0
  281. package/dist/src/core/payload-census.d.ts +74 -0
  282. package/dist/src/core/payload-store.d.ts +175 -0
  283. package/dist/src/core/payload.d.ts +71 -0
  284. package/dist/src/core/policy-diff.d.ts +292 -0
  285. package/dist/src/core/policy-diff.js +27 -4
  286. package/dist/src/core/policy-diff.js.map +1 -1
  287. package/dist/src/core/policy-expectations.d.ts +199 -0
  288. package/dist/src/core/policy-explain.d.ts +160 -0
  289. package/dist/src/core/policy-explain.js +63 -3
  290. package/dist/src/core/policy-explain.js.map +1 -1
  291. package/dist/src/core/policy-load.d.ts +567 -0
  292. package/dist/src/core/policy-load.js +36 -6
  293. package/dist/src/core/policy-load.js.map +1 -1
  294. package/dist/src/core/policy-match.d.ts +324 -0
  295. package/dist/src/core/policy-match.js +72 -9
  296. package/dist/src/core/policy-match.js.map +1 -1
  297. package/dist/src/core/policy-proposal.d.ts +317 -0
  298. package/dist/src/core/policy-proposal.js +102 -2
  299. package/dist/src/core/policy-proposal.js.map +1 -1
  300. package/dist/src/core/prompt-layout.d.ts +221 -0
  301. package/dist/src/core/protected-path-guard.d.ts +566 -0
  302. package/dist/src/core/protected-path-guard.js +848 -55
  303. package/dist/src/core/protected-path-guard.js.map +1 -1
  304. package/dist/src/core/question-preempted.d.ts +141 -0
  305. package/dist/src/core/question-preempted.js +152 -0
  306. package/dist/src/core/question-preempted.js.map +1 -0
  307. package/dist/src/core/read-scope.d.ts +172 -0
  308. package/dist/src/core/read-scope.js +252 -0
  309. package/dist/src/core/read-scope.js.map +1 -0
  310. package/dist/src/core/registration.d.ts +25 -0
  311. package/dist/src/core/reindex.d.ts +99 -0
  312. package/dist/src/core/sampler.d.ts +313 -0
  313. package/dist/src/core/sandbox.d.ts +371 -0
  314. package/dist/src/core/sandbox.js +190 -1
  315. package/dist/src/core/sandbox.js.map +1 -1
  316. package/dist/src/core/seal.d.ts +165 -0
  317. package/dist/src/core/sender-identity.d.ts +476 -0
  318. package/dist/src/core/sender-identity.js +572 -0
  319. package/dist/src/core/sender-identity.js.map +1 -0
  320. package/dist/src/core/shlex.d.ts +102 -0
  321. package/dist/src/core/shlex.js +159 -0
  322. package/dist/src/core/shlex.js.map +1 -0
  323. package/dist/src/core/state.d.ts +505 -0
  324. package/dist/src/core/task-file.d.ts +185 -0
  325. package/dist/src/core/telegram-config.d.ts +93 -0
  326. package/dist/src/core/token.d.ts +409 -0
  327. package/dist/src/core/token.js +21 -38
  328. package/dist/src/core/token.js.map +1 -1
  329. package/dist/src/core/validate.d.ts +138 -0
  330. package/dist/src/core/values.d.ts +147 -0
  331. package/dist/src/core/values.js +36 -1
  332. package/dist/src/core/values.js.map +1 -1
  333. package/dist/src/core/vault.d.ts +291 -0
  334. package/dist/src/core/verified-snapshot.d.ts +204 -0
  335. package/dist/src/core/verify.d.ts +336 -0
  336. package/dist/src/core/version.d.ts +8 -0
  337. package/dist/src/core/wysiwys.d.ts +370 -0
  338. package/dist/src/daemon/advance-child.d.ts +39 -0
  339. package/dist/src/daemon/advance.d.ts +476 -0
  340. package/dist/src/daemon/advance.js +25 -4
  341. package/dist/src/daemon/advance.js.map +1 -1
  342. package/dist/src/daemon/audit.d.ts +87 -0
  343. package/dist/src/daemon/daemon.d.ts +1180 -0
  344. package/dist/src/daemon/daemon.js +9 -0
  345. package/dist/src/daemon/daemon.js.map +1 -1
  346. package/dist/src/daemon/dark-session.d.ts +64 -0
  347. package/dist/src/daemon/draw-child.d.ts +36 -0
  348. package/dist/src/daemon/draw.d.ts +154 -0
  349. package/dist/src/daemon/git-evidence.d.ts +173 -0
  350. package/dist/src/daemon/git-evidence.js +1 -1
  351. package/dist/src/daemon/projection.d.ts +180 -0
  352. package/dist/src/daemon/prune.d.ts +207 -0
  353. package/dist/src/mcp/http.d.ts +113 -0
  354. package/dist/src/mcp/server.d.ts +265 -0
  355. package/dist/src/mcp/server.js +17 -1
  356. package/dist/src/mcp/server.js.map +1 -1
  357. package/docs/adapter-api.md +106 -0
  358. package/docs/cli-reference.md +1316 -63
  359. package/docs/codex-enforced-session.md +103 -0
  360. package/docs/codex-workspace-broker.md +118 -0
  361. package/package.json +14 -2
  362. package/schema/codex-instance.schema.json +82 -0
  363. package/schema/event.schema.json +539 -9
  364. package/schema/fixtures/codex-instance/invalid/unpinned-codex-version.json +40 -0
  365. package/schema/fixtures/codex-instance/valid/canonical.json +40 -0
  366. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-false.json +20 -0
  367. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-raw-id.json +20 -0
  368. package/schema/fixtures/event/invalid/audit-gesture-refused-human-actor.json +16 -0
  369. package/schema/fixtures/event/invalid/audit-gesture-refused-no-actor-no-sender.json +15 -0
  370. package/schema/fixtures/event/invalid/audit-gesture-refused-unknown-gesture.json +16 -0
  371. package/schema/fixtures/event/invalid/audit-question-preempted-agent-actor.json +16 -0
  372. package/schema/fixtures/event/invalid/audit-question-preempted-no-question-id.json +16 -0
  373. package/schema/fixtures/event/invalid/audit-question-preempted-unknown-source.json +15 -0
  374. package/schema/fixtures/event/invalid/gate-path-signed-off-absolute-path.json +14 -0
  375. package/schema/fixtures/event/invalid/gate-path-signed-off-agent-actor.json +14 -0
  376. package/schema/fixtures/event/invalid/gate-path-signed-off-missing-path.json +13 -0
  377. package/schema/fixtures/event/valid/approval-granted-sender-hashed.json +20 -0
  378. package/schema/fixtures/event/valid/audit-gesture-refused-review-note.json +21 -0
  379. package/schema/fixtures/event/valid/audit-gesture-refused-sender-key-unavailable.json +19 -0
  380. package/schema/fixtures/event/valid/audit-gesture-refused.json +19 -0
  381. package/schema/fixtures/event/valid/audit-question-preempted-no-verdict.json +16 -0
  382. package/schema/fixtures/event/valid/audit-question-preempted.json +20 -0
  383. package/schema/fixtures/event/valid/gate-path-signed-off.json +14 -0
  384. package/schema/fixtures/event/valid/harness-kind-claude-code.json +23 -0
  385. package/schema/fixtures/event/valid/harness-kind-codex.json +23 -0
  386. package/schema/fixtures/event/valid/harness-kind-cursor.json +23 -0
  387. package/schema/fixtures/event/valid/harness-kind-grok.json +23 -0
  388. package/schema/fixtures/event/valid/harness-kind-muse.json +23 -0
  389. package/schema/fixtures/policy/invalid/senders-half-keyed.json +20 -0
  390. package/schema/fixtures/policy/valid/canonical.json +1 -1
  391. package/schema/fixtures/policy/valid/senders-keyed.json +24 -0
  392. package/schema/fixtures/policy-md/valid/canonical.md +1 -1
  393. package/schema/fixtures/policy-md/valid/with-values.md +5 -7
  394. package/schema/fixtures/values/invalid/class-shaped.json +1 -1
  395. package/schema/fixtures/values/invalid/duplicate-entry.json +1 -1
  396. package/schema/fixtures/values/invalid/non-string-item.json +1 -1
  397. package/schema/fixtures/values/invalid/over-cap.json +1 -1
  398. package/schema/fixtures/values/invalid/unknown-key.json +1 -1
  399. package/schema/fixtures/values/invalid/version-float.json +1 -0
  400. package/schema/fixtures/values/invalid/version-integer.json +1 -0
  401. package/schema/fixtures/values/invalid/version-wrong-string.json +1 -0
  402. package/schema/fixtures/values/valid/empty-lists.json +2 -3
  403. package/schema/fixtures/values/valid/full.json +5 -7
  404. package/schema/fixtures/values/valid/minimal.json +1 -1
  405. package/schema/fixtures/values-md/invalid/schema-invalid.md +5 -3
  406. package/schema/fixtures/values-md/invalid/two-blocks.md +3 -3
  407. package/schema/fixtures/values-md/invalid/unterminated.md +2 -2
  408. package/schema/fixtures/values-md/invalid/version-1.md +69 -0
  409. package/schema/fixtures/values-md/invalid/version-unquoted.md +64 -0
  410. package/schema/fixtures/values-md/invalid/yaml-error.md +2 -2
  411. package/schema/fixtures/values-md/valid/absent.md +1 -1
  412. package/schema/fixtures/values-md/valid/with-values.md +5 -7
  413. package/schema/policy.schema.json +75 -3
  414. package/schema/values.schema.json +7 -11
  415. package/templates/codex/README.md +9 -0
  416. package/schema/fixtures/values/invalid/version-string.json +0 -1
@@ -0,0 +1,206 @@
1
+ /**
2
+ * What the log says when a human decided and the gate could not take it
3
+ * (APRV-235, amended SPEC.md §5.2).
4
+ *
5
+ * ## The fact this module is about
6
+ *
7
+ * Seen live on 2026-09-02, after the seq 13704 ceremony. Carter tapped approve
8
+ * on a request that had been asked under the previous policy. The gate refused
9
+ * `policy-drift`, which is right: the rules the approver was shown are not the
10
+ * rules in force, so a grant recorded there would claim a decision under a
11
+ * policy nobody put in front of them. But the refusal went to the operator's
12
+ * terminal and nowhere else. Nothing was appended, the request stayed pending
13
+ * in `QUEUE.md` and on Telegram, and the person who had tapped saw no reaction
14
+ * at all.
15
+ *
16
+ * Three things were wrong and this module fixes two of them (the third, the
17
+ * message edit, belongs to the channels).
18
+ *
19
+ * ## 1. A human's decision is a fact even when the gate cannot honour it
20
+ *
21
+ * The log is the truth. SPEC.md §11 makes human attention the audit budget, and
22
+ * an approver's tap SPENDS it whether or not an authorization comes out the
23
+ * other end. A reader looking at that log later found a request sitting
24
+ * unanswered with nothing to say a person had answered it, which is a question
25
+ * the log is supposed to be able to settle.
26
+ *
27
+ * So {@link recordRefusedDecision} appends one `audit.decision_refused`. It is
28
+ * an **audit-tier** record in the strict sense:
29
+ *
30
+ * - it grants nothing and mints no token;
31
+ * - `core/state.ts` does not settle a request on it, so no verdict moves;
32
+ * - `core/budgets.ts` charges nothing for it, so no budget moves;
33
+ * - `core/audit.ts` does not sample it and no streak counts it.
34
+ *
35
+ * `tests/decision-refusal.test.ts` asserts that last group by construction: the
36
+ * derived request state, the budget verdicts and the sampling draw are taken
37
+ * before and after and compared, and they are identical.
38
+ *
39
+ * ## The asymmetry: humans yes, agents no
40
+ *
41
+ * Gate-side refusals handed to an AGENT stay unlogged, and that is a choice
42
+ * rather than an omission. An agent that is refused reads the code, stops or
43
+ * asks again, and nothing was spent that a record could account for. A human
44
+ * who is refused has already spent the scarce thing, and cannot be asked to
45
+ * spend it again without the log saying the first spend happened. Recording
46
+ * every agent-side refusal would also put the busiest path in the runtime — a
47
+ * hook classifying every shell command — into the append path, which is a cost
48
+ * with no reader.
49
+ *
50
+ * ## 2. A request the gate calls void must stop being offered
51
+ *
52
+ * `policy-drift` is the one refusal where the gate does not merely decline this
53
+ * decision, it declares the REQUEST dead: "the pending request is void and the
54
+ * action must be requested again". Leaving it pending afterwards offers every
55
+ * approver on every channel a tap that cannot be honoured, forever, until the
56
+ * TTL lapses. So a drift refusal also appends `approval.withdrawn` with the
57
+ * runtime's own reason, `policy-drift` (APRV-106 gave the event; the schema's
58
+ * cross-rule makes that reason `system:`-only and `system:` that-reason-only).
59
+ * `approval queue`, `QUEUE.md` and every channel then read the request as
60
+ * settled, because they all derive state from `core/state.ts` and it settles on
61
+ * `approval.withdrawn` without looking at who wrote it or why.
62
+ *
63
+ * The action is not stranded: its caller requests it again, and the new request
64
+ * is routed, budgeted and displayed under the policy actually in force. That is
65
+ * what the refusal message already told them to do.
66
+ *
67
+ * ## Order, and what an interrupted write leaves behind
68
+ *
69
+ * The audit record is appended first and the withdrawal second, naming it in
70
+ * `payload.refused_seq`. Two appends are two records — the log never batches —
71
+ * so a crash between them is a state this code can reach, and the order is
72
+ * chosen for which half is safe to have alone. The explanation without the
73
+ * withdrawal leaves the request pending exactly as it is today, and a reader can
74
+ * see why. The withdrawal without the explanation would take a request out of a
75
+ * human's queue with nothing on the record saying who tapped, or why it was
76
+ * refused, which is the failure this task exists to end.
77
+ *
78
+ * ## Invariants
79
+ *
80
+ * - **Gate-typed events never accept caller timestamps** (§11.1). `ts` comes
81
+ * from the injected clock at the write boundary; there is no parameter.
82
+ * - **Every check-then-append passes through compare-and-append** (§11.1(5)).
83
+ * Both writes state the head they were derived against, and the whole cycle
84
+ * re-enters from a fresh read on `head-moved` through
85
+ * {@link withHeadRetry} — the same bounded retry APRV-236 gave `decide`.
86
+ * - **Self-reported fields never reduce scrutiny** (§11.1). Everything here only
87
+ * ADDS to what a reviewer sees. The approver's identity comes from the
88
+ * decision surface's configured actor, the same source a grant's does, and the
89
+ * record's own actor is `system:` so that neither party to the refusal is its
90
+ * author.
91
+ * - **Refusals stay machine-readable and distinct** (§11.1). The gate's code is
92
+ * copied verbatim; nothing here invents, merges or softens one.
93
+ *
94
+ * ## No attestation check, deliberately
95
+ *
96
+ * Nothing here asks whether the policy is attested, for the reason `reject` and
97
+ * `revoke` do not: this write confers no authority. Refusing to record a refusal
98
+ * because a file changed would be the strict direction pointing the wrong way,
99
+ * and the case where it would bite hardest is `policy-not-attested` itself —
100
+ * exactly the refusal an operator most needs the log to remember. The write
101
+ * boundary still validates every record, so what lands is still constrained.
102
+ */
103
+ import { type AppendError, type EventRecord } from "./log.js";
104
+ import { type Decision } from "./state.js";
105
+ import type { GateOptions } from "./gate.js";
106
+ import type { RecordedSender, SenderSource } from "./sender-identity.js";
107
+ /**
108
+ * The actor every record here carries. `system:`, and the same id the runtime's
109
+ * other unprompted writes use: this is the gate stating what the gate did.
110
+ */
111
+ export declare const DECISION_REFUSAL_ACTOR = "system:gate";
112
+ /** The runtime's withdrawal reason, closed to requesters by the event schema. */
113
+ export declare const POLICY_DRIFT_REASON = "policy-drift";
114
+ /** Who decided what, on which surface — everything the record needs about the tap. */
115
+ export interface RefusedDecision {
116
+ /** The action whose decision was refused. */
117
+ actionKey: string;
118
+ /** Which of the three human-only verbs was attempted. */
119
+ decision: Decision;
120
+ /**
121
+ * The approver, `human:<id>`, from the surface's configured identity or from
122
+ * the sender mapping that resolved one.
123
+ *
124
+ * `null` since APRV-324, for the one refusal where the runtime cannot name a
125
+ * person: a transport authenticated an account the attested policy binds to
126
+ * nobody. Writing the listener's own identity there would say the operator's
127
+ * decision was refused when the operator did not decide, which is the false
128
+ * record this whole module exists to avoid. The record then carries
129
+ * {@link RefusedDecision.sender} and no `actor`, and the event schema requires
130
+ * one or the other.
131
+ */
132
+ actor: string | null;
133
+ /** The surface that collected the gesture: `telegram`, `web`, `cli`. */
134
+ channel: string;
135
+ /**
136
+ * The authenticated sender the gesture arrived from (APRV-324), when the
137
+ * surface observed one, in the form the record carries it (APRV-370: raw, or
138
+ * the operator's keyed digest). The transport's own attribution, never
139
+ * anything the message claimed about itself (§11.1 invariant 4).
140
+ */
141
+ sender?: RecordedSender;
142
+ /** How the sender became the actor, when one did. */
143
+ senderSource?: SenderSource;
144
+ }
145
+ /** The gate refusal being recorded. Only these fields are ever read. */
146
+ export interface RefusalFacts {
147
+ /** The gate's code, verbatim. */
148
+ code: string;
149
+ /** The gate's message, verbatim. */
150
+ message: string;
151
+ /**
152
+ * The two policy hashes the gate compared, on `policy-drift` alone. Supplied
153
+ * by the refusal that made the comparison rather than re-derived here: a
154
+ * second derivation could disagree with the one that actually refused, and
155
+ * then the record would describe a comparison nobody made.
156
+ */
157
+ drift?: {
158
+ requested: string;
159
+ attested: string;
160
+ };
161
+ }
162
+ /** What the module could not do. Never thrown; the caller carries on regardless. */
163
+ export interface RefusalRecordFailure {
164
+ ok: false;
165
+ code: "log-unreadable" | "append-failed";
166
+ message: string;
167
+ append?: AppendError;
168
+ }
169
+ export type RecordRefusedDecisionResult = {
170
+ ok: true;
171
+ /**
172
+ * The `audit.decision_refused` record, or `null` when the refused actor
173
+ * was not a person and there was therefore nothing to record.
174
+ */
175
+ audit: EventRecord | null;
176
+ /** The `approval.withdrawn` record, on `policy-drift` alone; `null` otherwise. */
177
+ withdrawn: EventRecord | null;
178
+ } | RefusalRecordFailure;
179
+ /** Is this the refusal that declares the request itself void? */
180
+ export declare function voidsTheRequest(code: string): boolean;
181
+ /**
182
+ * Record that a human's decision was refused, and withdraw the request when the
183
+ * refusal was the gate declaring it void.
184
+ *
185
+ * Called by the decision SURFACES — `channels/contract.ts`'s
186
+ * `recordChannelDecision` and `cli/gate.ts`'s `commandDecide` — and never from
187
+ * inside `decide()`. That placement is deliberate twice over. `decide()`'s
188
+ * contract is that a refusal appends nothing, which is what lets a caller retry
189
+ * one without wondering what it wrote; and this record is about a HUMAN having
190
+ * decided, which is a fact only a surface that collected a human's gesture can
191
+ * assert.
192
+ *
193
+ * Best-effort by design: a failure here is returned, never thrown, and the
194
+ * caller shows the gate's refusal either way. The decision was already refused
195
+ * before this ran, and nothing about that outcome depends on this write landing.
196
+ *
197
+ * **Two writes, two retry cycles, and deliberately not one.** `head-retry.ts`
198
+ * asks that the unit of retry be a whole read-check-append cycle, and putting
199
+ * both appends inside one cycle would break that in the direction that matters:
200
+ * a moved head under the SECOND write would re-enter from the top and append a
201
+ * second `audit.decision_refused` for one tap. So each write has its own cycle,
202
+ * each re-reads and re-derives, and the withdrawal's cycle re-checks that the
203
+ * request is still pending — a decision or a withdrawal that landed in the
204
+ * window is the new verdict, and there is then nothing left to withdraw.
205
+ */
206
+ export declare function recordRefusedDecision(logPath: string, decided: RefusedDecision, refusal: RefusalFacts, options?: GateOptions): RecordRefusedDecisionResult;
@@ -157,8 +157,16 @@ export function recordRefusedDecision(logPath, decided, refusal, options = {}) {
157
157
  // No person, no record. See {@link HUMAN_ACTOR}: `actor-not-human` is the
158
158
  // refusal a misconfigured channel gets, and it is the one refusal that says
159
159
  // nobody's attention was spent.
160
- if (!HUMAN_ACTOR.test(decided.actor))
160
+ if (decided.actor !== null && !HUMAN_ACTOR.test(decided.actor)) {
161
161
  return { ok: true, audit: null, withdrawn: null };
162
+ }
163
+ // APRV-324. An unresolved sender is the other way to have no person — and the
164
+ // opposite case, because somebody's attention WAS spent: a human tapped from
165
+ // an account the policy names nobody for. The record is the only place an
166
+ // operator can learn that, and the id is the only thing it can say.
167
+ if (decided.actor === null && decided.sender === undefined) {
168
+ return { ok: true, audit: null, withdrawn: null };
169
+ }
162
170
  const attempts = attemptsOf(options.retryOnHeadMoved);
163
171
  const audit = withHeadRetry(attempts, () => appendAudit(logPath, decided, refusal, options));
164
172
  if (!audit.ok)
@@ -182,11 +190,25 @@ function appendAudit(logPath, decided, refusal, options) {
182
190
  // is asked for the task alone.
183
191
  const derivation = requestState(read.records, decided.actionKey, ts, null);
184
192
  const payload = {
185
- actor: decided.actor,
193
+ ...(decided.actor === null ? {} : { actor: decided.actor }),
186
194
  decision: decided.decision,
187
195
  code: refusal.code,
188
196
  message: refusal.message,
189
197
  };
198
+ // APRV-324. The account the gesture came from, when the surface authenticated
199
+ // one. On an unmapped sender it is the whole of what is known about who
200
+ // tapped; on any other refusal of a sender-resolved decision it says which
201
+ // account spent the attention the record is accounting for.
202
+ if (decided.sender !== undefined) {
203
+ payload["sender"] = {
204
+ channel: decided.sender.channel,
205
+ id: decided.sender.id,
206
+ // APRV-370: only when true, so a raw record does not change shape.
207
+ ...(decided.sender.hashed === true ? { hashed: true } : {}),
208
+ };
209
+ if (decided.senderSource !== undefined)
210
+ payload["sender_source"] = decided.senderSource;
211
+ }
190
212
  if (refusal.drift !== undefined) {
191
213
  payload["policy_sha256_requested"] = refusal.drift.requested;
192
214
  payload["policy_sha256_attested"] = refusal.drift.attested;
@@ -1 +1 @@
1
- {"version":3,"file":"decision-refusal.js","sourceRoot":"","sources":["../../../src/core/decision-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAqE,MAAM,UAAU,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAG9E;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEpD,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;A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