approval-md 0.2.0 → 0.4.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 (378) hide show
  1. package/README.md +85 -877
  2. package/SPEC.md +150 -19
  3. package/cli.js +66 -7
  4. package/dist/src/adapters/smtp.d.ts +18 -0
  5. package/dist/src/adapters/smtp.js +24 -3
  6. package/dist/src/adapters/smtp.js.map +1 -1
  7. package/dist/src/channels/contract.d.ts +53 -1
  8. package/dist/src/channels/contract.js +304 -7
  9. package/dist/src/channels/contract.js.map +1 -1
  10. package/dist/src/channels/relay-server.d.ts +90 -0
  11. package/dist/src/channels/relay-server.js +295 -0
  12. package/dist/src/channels/relay-server.js.map +1 -0
  13. package/dist/src/channels/relay.d.ts +273 -0
  14. package/dist/src/channels/relay.js +564 -0
  15. package/dist/src/channels/relay.js.map +1 -0
  16. package/dist/src/channels/tagging.js +6 -1
  17. package/dist/src/channels/tagging.js.map +1 -1
  18. package/dist/src/channels/telegram-webhook.d.ts +273 -0
  19. package/dist/src/channels/telegram-webhook.js +536 -0
  20. package/dist/src/channels/telegram-webhook.js.map +1 -0
  21. package/dist/src/channels/telegram.d.ts +394 -12
  22. package/dist/src/channels/telegram.js +621 -68
  23. package/dist/src/channels/telegram.js.map +1 -1
  24. package/dist/src/channels/web.d.ts +9 -0
  25. package/dist/src/channels/web.js +17 -0
  26. package/dist/src/channels/web.js.map +1 -1
  27. package/dist/src/cli/amend.js +564 -34
  28. package/dist/src/cli/amend.js.map +1 -1
  29. package/dist/src/cli/attest.d.ts +9 -0
  30. package/dist/src/cli/attest.js +177 -13
  31. package/dist/src/cli/attest.js.map +1 -1
  32. package/dist/src/cli/channel-relay.d.ts +108 -0
  33. package/dist/src/cli/channel-relay.js +334 -0
  34. package/dist/src/cli/channel-relay.js.map +1 -0
  35. package/dist/src/cli/channel-telegram-webhook.d.ts +273 -0
  36. package/dist/src/cli/channel-telegram-webhook.js +709 -0
  37. package/dist/src/cli/channel-telegram-webhook.js.map +1 -0
  38. package/dist/src/cli/channel-telegram.d.ts +347 -28
  39. package/dist/src/cli/channel-telegram.js +763 -28
  40. package/dist/src/cli/channel-telegram.js.map +1 -1
  41. package/dist/src/cli/channel.d.ts +10 -1
  42. package/dist/src/cli/channel.js +14 -1
  43. package/dist/src/cli/channel.js.map +1 -1
  44. package/dist/src/cli/codex-bridge.d.ts +819 -0
  45. package/dist/src/cli/codex-bridge.js +1607 -0
  46. package/dist/src/cli/codex-bridge.js.map +1 -0
  47. package/dist/src/cli/codex.d.ts +1 -1
  48. package/dist/src/cli/codex.js +304 -7
  49. package/dist/src/cli/codex.js.map +1 -1
  50. package/dist/src/cli/daemon.js +41 -6
  51. package/dist/src/cli/daemon.js.map +1 -1
  52. package/dist/src/cli/doctor.d.ts +63 -0
  53. package/dist/src/cli/doctor.js +1322 -122
  54. package/dist/src/cli/doctor.js.map +1 -1
  55. package/dist/src/cli/execute.d.ts +17 -1
  56. package/dist/src/cli/execute.js +366 -22
  57. package/dist/src/cli/execute.js.map +1 -1
  58. package/dist/src/cli/exit-codes.d.ts +12 -0
  59. package/dist/src/cli/exit-codes.js +13 -0
  60. package/dist/src/cli/exit-codes.js.map +1 -1
  61. package/dist/src/cli/gate.d.ts +2 -0
  62. package/dist/src/cli/gate.js +233 -2
  63. package/dist/src/cli/gate.js.map +1 -1
  64. package/dist/src/cli/help.d.ts +14 -2
  65. package/dist/src/cli/help.js +395 -82
  66. package/dist/src/cli/help.js.map +1 -1
  67. package/dist/src/cli/hook-codex.d.ts +49 -1
  68. package/dist/src/cli/hook-codex.js +60 -1
  69. package/dist/src/cli/hook-codex.js.map +1 -1
  70. package/dist/src/cli/hook.d.ts +828 -4
  71. package/dist/src/cli/hook.js +2972 -142
  72. package/dist/src/cli/hook.js.map +1 -1
  73. package/dist/src/cli/import.js +1 -1
  74. package/dist/src/cli/import.js.map +1 -1
  75. package/dist/src/cli/init.js +16 -7
  76. package/dist/src/cli/init.js.map +1 -1
  77. package/dist/src/cli/instructions.js +24 -3
  78. package/dist/src/cli/instructions.js.map +1 -1
  79. package/dist/src/cli/log-anchor.d.ts +55 -0
  80. package/dist/src/cli/log-anchor.js +199 -60
  81. package/dist/src/cli/log-anchor.js.map +1 -1
  82. package/dist/src/cli/main.d.ts +0 -12
  83. package/dist/src/cli/main.js +56 -3
  84. package/dist/src/cli/main.js.map +1 -1
  85. package/dist/src/cli/muse.d.ts +2 -0
  86. package/dist/src/cli/muse.js +62 -0
  87. package/dist/src/cli/muse.js.map +1 -0
  88. package/dist/src/cli/payload.js +79 -1
  89. package/dist/src/cli/payload.js.map +1 -1
  90. package/dist/src/cli/policy-apply.d.ts +195 -0
  91. package/dist/src/cli/policy-apply.js +573 -0
  92. package/dist/src/cli/policy-apply.js.map +1 -0
  93. package/dist/src/cli/policy.js +14 -1
  94. package/dist/src/cli/policy.js.map +1 -1
  95. package/dist/src/cli/preflight.d.ts +151 -13
  96. package/dist/src/cli/preflight.js +398 -41
  97. package/dist/src/cli/preflight.js.map +1 -1
  98. package/dist/src/cli/sandbox.js +17 -1
  99. package/dist/src/cli/sandbox.js.map +1 -1
  100. package/dist/src/cli/scaffold.d.ts +1 -1
  101. package/dist/src/cli/scaffold.js +7 -1
  102. package/dist/src/cli/scaffold.js.map +1 -1
  103. package/dist/src/cli/serve.d.ts +53 -0
  104. package/dist/src/cli/serve.js +270 -0
  105. package/dist/src/cli/serve.js.map +1 -0
  106. package/dist/src/cli/setup-channel.d.ts +9 -0
  107. package/dist/src/cli/setup-channel.js +28 -1
  108. package/dist/src/cli/setup-channel.js.map +1 -1
  109. package/dist/src/cli/setup-common.d.ts +3 -1
  110. package/dist/src/cli/setup-common.js +3 -2
  111. package/dist/src/cli/setup-common.js.map +1 -1
  112. package/dist/src/cli/setup.d.ts +2 -0
  113. package/dist/src/cli/setup.js +94 -2
  114. package/dist/src/cli/setup.js.map +1 -1
  115. package/dist/src/cli/up.js +134 -51
  116. package/dist/src/cli/up.js.map +1 -1
  117. package/dist/src/cli/values.js +3 -4
  118. package/dist/src/cli/values.js.map +1 -1
  119. package/dist/src/cli/verb-registry.d.ts +2 -0
  120. package/dist/src/cli/verb-registry.js +510 -47
  121. package/dist/src/cli/verb-registry.js.map +1 -1
  122. package/dist/src/cli/wordmark.d.ts +2 -2
  123. package/dist/src/cli/wordmark.js +2 -2
  124. package/dist/src/codex/broker.d.ts +229 -0
  125. package/dist/src/codex/broker.js +548 -0
  126. package/dist/src/codex/broker.js.map +1 -0
  127. package/dist/src/codex/runner.d.ts +178 -0
  128. package/dist/src/codex/runner.js +231 -0
  129. package/dist/src/codex/runner.js.map +1 -0
  130. package/dist/src/codex/serve.d.ts +56 -0
  131. package/dist/src/codex/serve.js +98 -0
  132. package/dist/src/codex/serve.js.map +1 -0
  133. package/dist/src/codex/workspace-commit.d.ts +219 -0
  134. package/dist/src/codex/workspace-commit.js +549 -0
  135. package/dist/src/codex/workspace-commit.js.map +1 -0
  136. package/dist/src/core/advance-cycle.d.ts +51 -0
  137. package/dist/src/core/advance-cycle.js +66 -2
  138. package/dist/src/core/advance-cycle.js.map +1 -1
  139. package/dist/src/core/agents-md.d.ts +20 -18
  140. package/dist/src/core/agents-md.js +33 -31
  141. package/dist/src/core/agents-md.js.map +1 -1
  142. package/dist/src/core/attest-bootstrap.d.ts +95 -0
  143. package/dist/src/core/attest-bootstrap.js +135 -0
  144. package/dist/src/core/attest-bootstrap.js.map +1 -0
  145. package/dist/src/core/attest.d.ts +234 -2
  146. package/dist/src/core/attest.js +342 -7
  147. package/dist/src/core/attest.js.map +1 -1
  148. package/dist/src/core/audit.d.ts +73 -3
  149. package/dist/src/core/audit.js +65 -5
  150. package/dist/src/core/audit.js.map +1 -1
  151. package/dist/src/core/channel-lease.d.ts +322 -0
  152. package/dist/src/core/channel-lease.js +663 -0
  153. package/dist/src/core/channel-lease.js.map +1 -0
  154. package/dist/src/core/channel-owner.d.ts +213 -0
  155. package/dist/src/core/channel-owner.js +358 -0
  156. package/dist/src/core/channel-owner.js.map +1 -0
  157. package/dist/src/core/command-class.d.ts +205 -0
  158. package/dist/src/core/command-class.js +1433 -28
  159. package/dist/src/core/command-class.js.map +1 -1
  160. package/dist/src/core/commit-guard.d.ts +272 -0
  161. package/dist/src/core/commit-guard.js +424 -0
  162. package/dist/src/core/commit-guard.js.map +1 -0
  163. package/dist/src/core/daemon-actor.d.ts +45 -0
  164. package/dist/src/core/daemon-actor.js +54 -0
  165. package/dist/src/core/daemon-actor.js.map +1 -0
  166. package/dist/src/core/daemon-host.d.ts +178 -0
  167. package/dist/src/core/daemon-host.js +228 -0
  168. package/dist/src/core/daemon-host.js.map +1 -0
  169. package/dist/src/core/daemon-identity.d.ts +238 -0
  170. package/dist/src/core/daemon-identity.js +252 -0
  171. package/dist/src/core/daemon-identity.js.map +1 -0
  172. package/dist/src/core/dark-session.d.ts +109 -8
  173. package/dist/src/core/dark-session.js +266 -82
  174. package/dist/src/core/dark-session.js.map +1 -1
  175. package/dist/src/core/decision-refusal.d.ts +23 -2
  176. package/dist/src/core/decision-refusal.js +24 -2
  177. package/dist/src/core/decision-refusal.js.map +1 -1
  178. package/dist/src/core/env-file.d.ts +5 -0
  179. package/dist/src/core/env-file.js +60 -1
  180. package/dist/src/core/env-file.js.map +1 -1
  181. package/dist/src/core/execute.d.ts +15 -2
  182. package/dist/src/core/execute.js +15 -2
  183. package/dist/src/core/execute.js.map +1 -1
  184. package/dist/src/core/gate.d.ts +392 -6
  185. package/dist/src/core/gate.js +852 -24
  186. package/dist/src/core/gate.js.map +1 -1
  187. package/dist/src/core/gesture-refusal.d.ts +166 -0
  188. package/dist/src/core/gesture-refusal.js +188 -0
  189. package/dist/src/core/gesture-refusal.js.map +1 -0
  190. package/dist/src/core/harness-version.d.ts +128 -4
  191. package/dist/src/core/harness-version.js +181 -12
  192. package/dist/src/core/harness-version.js.map +1 -1
  193. package/dist/src/core/harness-wait.d.ts +82 -3
  194. package/dist/src/core/harness-wait.js +89 -3
  195. package/dist/src/core/harness-wait.js.map +1 -1
  196. package/dist/src/core/instance.d.ts +59 -2
  197. package/dist/src/core/instance.js +113 -0
  198. package/dist/src/core/instance.js.map +1 -1
  199. package/dist/src/core/log-subscribe.d.ts +21 -0
  200. package/dist/src/core/log-subscribe.js +16 -6
  201. package/dist/src/core/log-subscribe.js.map +1 -1
  202. package/dist/src/core/log-write-layer.d.ts +55 -0
  203. package/dist/src/core/log-write-layer.js +91 -0
  204. package/dist/src/core/log-write-layer.js.map +1 -0
  205. package/dist/src/core/log.d.ts +89 -22
  206. package/dist/src/core/log.js +197 -19
  207. package/dist/src/core/log.js.map +1 -1
  208. package/dist/src/core/payload-census.d.ts +51 -0
  209. package/dist/src/core/payload-census.js +125 -2
  210. package/dist/src/core/payload-census.js.map +1 -1
  211. package/dist/src/core/payload-store.d.ts +31 -0
  212. package/dist/src/core/payload-store.js +113 -8
  213. package/dist/src/core/payload-store.js.map +1 -1
  214. package/dist/src/core/payload.d.ts +18 -3
  215. package/dist/src/core/payload.js +20 -4
  216. package/dist/src/core/payload.js.map +1 -1
  217. package/dist/src/core/policy-diff.d.ts +10 -0
  218. package/dist/src/core/policy-diff.js +10 -2
  219. package/dist/src/core/policy-diff.js.map +1 -1
  220. package/dist/src/core/policy-explain.d.ts +17 -1
  221. package/dist/src/core/policy-explain.js +48 -1
  222. package/dist/src/core/policy-explain.js.map +1 -1
  223. package/dist/src/core/policy-load.d.ts +65 -1
  224. package/dist/src/core/policy-load.js +21 -3
  225. package/dist/src/core/policy-load.js.map +1 -1
  226. package/dist/src/core/policy-match.d.ts +81 -0
  227. package/dist/src/core/policy-match.js +87 -0
  228. package/dist/src/core/policy-match.js.map +1 -1
  229. package/dist/src/core/policy-proposal.d.ts +75 -0
  230. package/dist/src/core/policy-proposal.js +110 -4
  231. package/dist/src/core/policy-proposal.js.map +1 -1
  232. package/dist/src/core/protected-path-guard.d.ts +117 -4
  233. package/dist/src/core/protected-path-guard.js +362 -48
  234. package/dist/src/core/protected-path-guard.js.map +1 -1
  235. package/dist/src/core/question-preempted.d.ts +141 -0
  236. package/dist/src/core/question-preempted.js +152 -0
  237. package/dist/src/core/question-preempted.js.map +1 -0
  238. package/dist/src/core/read-scope.d.ts +182 -0
  239. package/dist/src/core/read-scope.js +256 -0
  240. package/dist/src/core/read-scope.js.map +1 -0
  241. package/dist/src/core/run-payload.d.ts +160 -0
  242. package/dist/src/core/run-payload.js +304 -0
  243. package/dist/src/core/run-payload.js.map +1 -0
  244. package/dist/src/core/sandbox.d.ts +81 -0
  245. package/dist/src/core/sandbox.js +190 -1
  246. package/dist/src/core/sandbox.js.map +1 -1
  247. package/dist/src/core/sender-identity.d.ts +501 -0
  248. package/dist/src/core/sender-identity.js +609 -0
  249. package/dist/src/core/sender-identity.js.map +1 -0
  250. package/dist/src/core/shlex.d.ts +102 -0
  251. package/dist/src/core/shlex.js +159 -0
  252. package/dist/src/core/shlex.js.map +1 -0
  253. package/dist/src/core/state.d.ts +52 -1
  254. package/dist/src/core/state.js +52 -6
  255. package/dist/src/core/state.js.map +1 -1
  256. package/dist/src/core/telegram-config.d.ts +79 -0
  257. package/dist/src/core/telegram-config.js +108 -0
  258. package/dist/src/core/telegram-config.js.map +1 -1
  259. package/dist/src/core/values.d.ts +18 -8
  260. package/dist/src/core/values.js +36 -1
  261. package/dist/src/core/values.js.map +1 -1
  262. package/dist/src/core/verify.d.ts +23 -1
  263. package/dist/src/core/verify.js +20 -2
  264. package/dist/src/core/verify.js.map +1 -1
  265. package/dist/src/daemon/advance.d.ts +10 -0
  266. package/dist/src/daemon/advance.js +25 -4
  267. package/dist/src/daemon/advance.js.map +1 -1
  268. package/dist/src/daemon/audit.d.ts +80 -5
  269. package/dist/src/daemon/audit.js +126 -6
  270. package/dist/src/daemon/audit.js.map +1 -1
  271. package/dist/src/daemon/daemon.d.ts +174 -2
  272. package/dist/src/daemon/daemon.js +307 -7
  273. package/dist/src/daemon/daemon.js.map +1 -1
  274. package/dist/src/daemon/git-evidence.d.ts +2 -2
  275. package/dist/src/daemon/git-evidence.js +1 -1
  276. package/dist/src/daemon/projection.d.ts +13 -2
  277. package/dist/src/daemon/projection.js +39 -6
  278. package/dist/src/daemon/projection.js.map +1 -1
  279. package/dist/src/mcp/server.d.ts +39 -3
  280. package/dist/src/mcp/server.js +30 -3
  281. package/dist/src/mcp/server.js.map +1 -1
  282. package/dist/src/muse/server.d.ts +16 -0
  283. package/dist/src/muse/server.js +238 -0
  284. package/dist/src/muse/server.js.map +1 -0
  285. package/dist/src/serve/archive.d.ts +158 -0
  286. package/dist/src/serve/archive.js +354 -0
  287. package/dist/src/serve/archive.js.map +1 -0
  288. package/dist/src/serve/arguments.d.ts +93 -0
  289. package/dist/src/serve/arguments.js +228 -0
  290. package/dist/src/serve/arguments.js.map +1 -0
  291. package/dist/src/serve/credentials.d.ts +91 -0
  292. package/dist/src/serve/credentials.js +143 -0
  293. package/dist/src/serve/credentials.js.map +1 -0
  294. package/dist/src/serve/follow.d.ts +86 -0
  295. package/dist/src/serve/follow.js +101 -0
  296. package/dist/src/serve/follow.js.map +1 -0
  297. package/dist/src/serve/hook-thread.d.ts +134 -0
  298. package/dist/src/serve/hook-thread.js +333 -0
  299. package/dist/src/serve/hook-thread.js.map +1 -0
  300. package/dist/src/serve/hook-worker.d.ts +134 -0
  301. package/dist/src/serve/hook-worker.js +173 -0
  302. package/dist/src/serve/hook-worker.js.map +1 -0
  303. package/dist/src/serve/server.d.ts +412 -0
  304. package/dist/src/serve/server.js +1251 -0
  305. package/dist/src/serve/server.js.map +1 -0
  306. package/docs/README-extended.md +766 -0
  307. package/docs/cli-reference.md +2563 -73
  308. package/docs/codex-enforced-session.md +75 -2
  309. package/docs/codex-workspace-broker.md +118 -0
  310. package/package.json +6 -2
  311. package/schema/event.schema.json +595 -9
  312. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-false.json +20 -0
  313. package/schema/fixtures/event/invalid/approval-granted-sender-hashed-raw-id.json +20 -0
  314. package/schema/fixtures/event/invalid/audit-gesture-refused-human-actor.json +16 -0
  315. package/schema/fixtures/event/invalid/audit-gesture-refused-no-actor-no-sender.json +15 -0
  316. package/schema/fixtures/event/invalid/audit-gesture-refused-unknown-gesture.json +16 -0
  317. package/schema/fixtures/event/invalid/audit-question-preempted-agent-actor.json +16 -0
  318. package/schema/fixtures/event/invalid/audit-question-preempted-no-question-id.json +16 -0
  319. package/schema/fixtures/event/invalid/audit-question-preempted-unknown-source.json +15 -0
  320. package/schema/fixtures/event/invalid/daemon-id-malformed.json +15 -0
  321. package/schema/fixtures/event/invalid/execution-started-truncated-policy-sha256.json +18 -0
  322. package/schema/fixtures/event/invalid/gate-path-signed-off-absolute-path.json +14 -0
  323. package/schema/fixtures/event/invalid/gate-path-signed-off-agent-actor.json +14 -0
  324. package/schema/fixtures/event/invalid/gate-path-signed-off-missing-path.json +13 -0
  325. package/schema/fixtures/event/invalid/harness-cap-at-margin.json +16 -0
  326. package/schema/fixtures/event/invalid/harness-cap-fractional.json +16 -0
  327. package/schema/fixtures/event/invalid/harness-cap-negative.json +16 -0
  328. package/schema/fixtures/event/invalid/harness-cap-string.json +16 -0
  329. package/schema/fixtures/event/invalid/harness-cap-without-harness-execution.json +16 -0
  330. package/schema/fixtures/event/invalid/harness-cap-zero.json +16 -0
  331. package/schema/fixtures/event/valid/approval-granted-sender-hashed.json +20 -0
  332. package/schema/fixtures/event/valid/approval-requested-harness-cap.json +18 -0
  333. package/schema/fixtures/event/valid/audit-gesture-refused-review-note.json +21 -0
  334. package/schema/fixtures/event/valid/audit-gesture-refused-sender-key-unavailable.json +19 -0
  335. package/schema/fixtures/event/valid/audit-gesture-refused.json +19 -0
  336. package/schema/fixtures/event/valid/audit-question-preempted-no-verdict.json +16 -0
  337. package/schema/fixtures/event/valid/audit-question-preempted.json +20 -0
  338. package/schema/fixtures/event/valid/daemon-identity-declared.json +17 -0
  339. package/schema/fixtures/event/valid/daemon-identity.json +15 -0
  340. package/schema/fixtures/event/valid/execution-started-policy-sha256.json +18 -0
  341. package/schema/fixtures/event/valid/gate-path-signed-off.json +14 -0
  342. package/schema/fixtures/event/valid/harness-kind-claude-code.json +23 -0
  343. package/schema/fixtures/event/valid/harness-kind-codex.json +23 -0
  344. package/schema/fixtures/event/valid/harness-kind-cursor.json +23 -0
  345. package/schema/fixtures/event/valid/harness-kind-grok.json +23 -0
  346. package/schema/fixtures/event/valid/harness-kind-hermes.json +23 -0
  347. package/schema/fixtures/event/valid/harness-kind-muse.json +23 -0
  348. package/schema/fixtures/policy/invalid/daemons-malformed-id.json +10 -0
  349. package/schema/fixtures/policy/invalid/senders-half-keyed.json +20 -0
  350. package/schema/fixtures/policy/valid/canonical.json +1 -1
  351. package/schema/fixtures/policy/valid/daemons-allowlist.json +19 -0
  352. package/schema/fixtures/policy/valid/senders-keyed.json +24 -0
  353. package/schema/fixtures/policy-md/invalid/schema-invalid-agent-may-request.md +21 -0
  354. package/schema/fixtures/policy-md/valid/agent-may-request.md +24 -0
  355. package/schema/fixtures/policy-md/valid/canonical.md +1 -1
  356. package/schema/fixtures/policy-md/valid/with-values.md +5 -7
  357. package/schema/fixtures/values/invalid/class-shaped.json +1 -1
  358. package/schema/fixtures/values/invalid/duplicate-entry.json +1 -1
  359. package/schema/fixtures/values/invalid/non-string-item.json +1 -1
  360. package/schema/fixtures/values/invalid/over-cap.json +1 -1
  361. package/schema/fixtures/values/invalid/unknown-key.json +1 -1
  362. package/schema/fixtures/values/invalid/version-float.json +1 -0
  363. package/schema/fixtures/values/invalid/version-integer.json +1 -0
  364. package/schema/fixtures/values/invalid/version-wrong-string.json +1 -0
  365. package/schema/fixtures/values/valid/empty-lists.json +2 -3
  366. package/schema/fixtures/values/valid/full.json +5 -7
  367. package/schema/fixtures/values/valid/minimal.json +1 -1
  368. package/schema/fixtures/values-md/invalid/schema-invalid.md +5 -3
  369. package/schema/fixtures/values-md/invalid/two-blocks.md +3 -3
  370. package/schema/fixtures/values-md/invalid/unterminated.md +2 -2
  371. package/schema/fixtures/values-md/invalid/version-1.md +69 -0
  372. package/schema/fixtures/values-md/invalid/version-unquoted.md +64 -0
  373. package/schema/fixtures/values-md/invalid/yaml-error.md +2 -2
  374. package/schema/fixtures/values-md/valid/absent.md +1 -1
  375. package/schema/fixtures/values-md/valid/with-values.md +5 -7
  376. package/schema/policy.schema.json +100 -4
  377. package/schema/values.schema.json +7 -11
  378. package/schema/fixtures/values/invalid/version-string.json +0 -1
@@ -0,0 +1,23 @@
1
+ {
2
+ "seq": 56,
3
+ "ts": "2026-09-20T09:41:12Z",
4
+ "event": "task.registered",
5
+ "task": "hook:hermes-sess-1:toolu-16",
6
+ "actor": "agent:hermes",
7
+ "payload": {
8
+ "state": "proposed",
9
+ "actions": [
10
+ {
11
+ "class": "deps.add",
12
+ "summary": "npm install --save-dev oxlint",
13
+ "idempotency_key": "hook:hermes-sess-1:toolu-16:deps.add",
14
+ "payload_hash": "4d0a9c2b7e5f13860ad4c9b217e3f508cc61a7d2394b8e05f7ca61d3b8092e4f"
15
+ }
16
+ ],
17
+ "harness": "hermes",
18
+ "harness_version": "hermes 0.21.3"
19
+ },
20
+ "alg": "sha256/jcs",
21
+ "prev": "7d925ec380b14fa6c05e971b3d4287ac6fb015e93c2a480df6b1e7c05a83942f",
22
+ "hash": "e1f6a30c4d7b92815ac0fe43b6d258907cb14fe2839a5d07f4cb62e1a9350b7d"
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "seq": 55,
3
+ "ts": "2026-09-19T08:18:59Z",
4
+ "event": "task.registered",
5
+ "task": "hook:muse-sess-1:toolu-15",
6
+ "actor": "agent:muse",
7
+ "payload": {
8
+ "state": "proposed",
9
+ "actions": [
10
+ {
11
+ "class": "deps.add",
12
+ "summary": "npm install --save-dev oxlint",
13
+ "idempotency_key": "hook:muse-sess-1:toolu-15:deps.add",
14
+ "payload_hash": "4d0a9c2b7e5f13860ad4c9b217e3f508cc61a7d2394b8e05f7ca61d3b8092e4f"
15
+ }
16
+ ],
17
+ "harness": "muse",
18
+ "harness_version": "muse-bin-1.3.0-R3233.1"
19
+ },
20
+ "alg": "sha256/jcs",
21
+ "prev": "c6410d97b28e53fa0716d8c4b93e250fa8d17c6b4093e5ad21fc80b7e5943d1a",
22
+ "hash": "7d925ec380b14fa6c05e971b3d4287ac6fb015e93c2a480df6b1e7c05a83942f"
23
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": "0.1",
3
+ "defaults": {
4
+ "autonomy": "manual"
5
+ },
6
+ "daemons": ["Village-Goa-1"],
7
+ "classes": {
8
+ "communicate.email.external": { "autonomy": "manual" }
9
+ }
10
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": "0.1",
3
+ "defaults": {
4
+ "autonomy": "manual",
5
+ "channel": "telegram",
6
+ "approval_ttl": "30m",
7
+ "on_expiry": "reject"
8
+ },
9
+ "approvers": {
10
+ "carter": {
11
+ "channels": ["telegram"],
12
+ "senders": {
13
+ "telegram": "sha256:3f2a9c11b4d7e6085a1c2f9d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a"
14
+ }
15
+ }
16
+ },
17
+ "classes": {
18
+ "communicate.email.external": { "autonomy": "manual" }
19
+ }
20
+ }
@@ -14,7 +14,7 @@
14
14
  "classes": {
15
15
  "read.*": { "autonomy": "autonomous" },
16
16
  "files.write.workspace": { "autonomy": "autonomous" },
17
- "calendar.write.own": { "autonomy": "supervised" },
17
+ "calendar.write.own": { "autonomy": "supervised-retro" },
18
18
  "communicate.email.draft": { "autonomy": "autonomous" },
19
19
  "communicate.email.external": {
20
20
  "autonomy": "manual",
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "0.1",
3
+ "defaults": {
4
+ "autonomy": "manual",
5
+ "channel": "telegram",
6
+ "approval_ttl": "30m",
7
+ "on_expiry": "reject"
8
+ },
9
+ "approvers": {
10
+ "carter": {
11
+ "channels": ["telegram", "cli"],
12
+ "senders": { "telegram": "5551234567" }
13
+ }
14
+ },
15
+ "daemons": ["daemon-3f2a9c11", "village-goa-1"],
16
+ "classes": {
17
+ "communicate.email.external": { "autonomy": "manual" }
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "0.1",
3
+ "defaults": {
4
+ "autonomy": "manual",
5
+ "channel": "telegram",
6
+ "approval_ttl": "30m",
7
+ "on_expiry": "reject"
8
+ },
9
+ "approvers": {
10
+ "carter": {
11
+ "channels": ["telegram", "cli"],
12
+ "senders": {
13
+ "telegram": "hmac-sha256:3f2a9c11b4d7e6085a1c2f9d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a"
14
+ }
15
+ },
16
+ "dana": {
17
+ "channels": ["telegram"],
18
+ "senders": { "telegram": "5551234567" }
19
+ }
20
+ },
21
+ "classes": {
22
+ "communicate.email.external": { "autonomy": "manual" }
23
+ }
24
+ }
@@ -0,0 +1,21 @@
1
+ # Approval Policy
2
+
3
+ Two invalid spellings of `agent_may_request` (APRV-445): a string where a
4
+ boolean belongs, and `true` on a `human-only` rule, which is inert to agents
5
+ and may not be opened to them. Either alone fails the whole policy closed:
6
+ `schema-invalid`.
7
+
8
+ ```yaml approval-policy
9
+ version: "0.1"
10
+
11
+ defaults:
12
+ autonomy: manual
13
+
14
+ classes:
15
+ intent.publish.inferred.index:
16
+ autonomy: manual
17
+ agent_may_request: "yes"
18
+ account.credential:
19
+ autonomy: human-only
20
+ agent_may_request: true
21
+ ```
@@ -0,0 +1,24 @@
1
+ # Approval Policy
2
+
3
+ `agent_may_request` (APRV-445) opens `approval propose` to classes the operator
4
+ declares by name. The family line opens the branch; each member is still a line
5
+ of its own, and the closed member says no for itself.
6
+
7
+ ```yaml approval-policy
8
+ version: "0.1"
9
+
10
+ defaults:
11
+ autonomy: manual
12
+ approval_ttl: 72h
13
+
14
+ classes:
15
+ intent.publish.*:
16
+ autonomy: manual
17
+ agent_may_request: true
18
+ intent.publish.inferred.index: { autonomy: manual }
19
+ intent.publish.stated.index: { autonomy: autonomous }
20
+ intent.publish.closed:
21
+ autonomy: manual
22
+ agent_may_request: false
23
+ communicate.email.external: { autonomy: manual }
24
+ ```
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -55,7 +55,7 @@ The block below is guidance, never policy. Nothing in it grants anything, and
55
55
  no part of the runtime reads it to decide.
56
56
 
57
57
  ```yaml approval-values
58
- version: 1
58
+ version: "0.2"
59
59
 
60
60
  love:
61
61
  - seeing the real change, not a description of it
@@ -64,16 +64,14 @@ love:
64
64
  like:
65
65
  - success reported first, caveats after
66
66
  - small reviewable commits
67
+ - honest opinions on the work, including when you think a task is wrong
68
+ - a journal entry of about five points per milestone
67
69
 
68
70
  dislike:
69
71
  - prose where a command would do
70
72
  - being asked to approve something I cannot see
71
73
 
72
- wants:
73
- - honest opinions on the work, including when you think a task is wrong
74
- - a journal entry of about five points per milestone
75
-
76
- responds: "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
74
+ communication: "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
77
75
  ```
78
76
 
79
77
  Prose again after the block, ignored by both readers.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "like": ["small reviewable commits"],
4
4
  "classes": {
5
5
  "message.send": {
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "dislike": ["prose where a command would do", "prose where a command would do"]
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "love": ["a runbook I can paste into a terminal", 7]
4
4
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "like": [
4
4
  "preference 01",
5
5
  "preference 02",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "like": ["small reviewable commits"],
4
4
  "priority": 3
5
5
  }
@@ -0,0 +1 @@
1
+ { "version": 0.2 }
@@ -0,0 +1 @@
1
+ { "version": 1 }
@@ -0,0 +1 @@
1
+ { "version": "0.1" }
@@ -1,7 +1,6 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "love": [],
4
4
  "like": [],
5
- "dislike": [],
6
- "wants": []
5
+ "dislike": []
7
6
  }
@@ -1,20 +1,18 @@
1
1
  {
2
- "version": 1,
2
+ "version": "0.2",
3
3
  "love": [
4
4
  "seeing the real change, not a description of it",
5
5
  "a runbook I can paste into a terminal"
6
6
  ],
7
7
  "like": [
8
8
  "success reported first, caveats after",
9
- "small reviewable commits"
9
+ "small reviewable commits",
10
+ "honest opinions on the work, including when you think a task is wrong",
11
+ "a journal entry of about five points per milestone"
10
12
  ],
11
13
  "dislike": [
12
14
  "prose where a command would do",
13
15
  "being asked to approve something I cannot see"
14
16
  ],
15
- "wants": [
16
- "honest opinions on the work, including when you think a task is wrong",
17
- "a journal entry of about five points per milestone"
18
- ],
19
- "responds": "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
17
+ "communication": "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
20
18
  }
@@ -1 +1 @@
1
- { "version": 1 }
1
+ { "version": "0.2" }
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -52,8 +52,10 @@ Everything after the block is prose again and is ignored by the parser.
52
52
  ## What I value
53
53
 
54
54
  The block below parses as YAML and is refused by values.schema.json: `version`
55
- is the string "1" rather than the integer 1, and `classes` is a policy-shaped
56
- key the closed schema does not admit.
55
+ is the string "1" rather than the string "0.2", and `classes` is a policy-shaped
56
+ key the closed schema does not admit. The version here is a STRING on purpose,
57
+ so this fixture reaches the schema: a numeric version is refused earlier, by
58
+ name, as `version-unsupported` (APRV-336).
57
59
 
58
60
  ```yaml approval-values
59
61
  version: "1"
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -55,7 +55,7 @@ Two values blocks: two answers to one question. The reader refuses rather than
55
55
  picking one on document order.
56
56
 
57
57
  ```yaml approval-values
58
- version: 1
58
+ version: "0.2"
59
59
  like:
60
60
  - success reported first, caveats after
61
61
  ```
@@ -63,7 +63,7 @@ like:
63
63
  And, further down the file, a second one somebody pasted in later.
64
64
 
65
65
  ```yaml approval-values
66
- version: 1
66
+ version: "0.2"
67
67
  like:
68
68
  - the opposite of the above
69
69
  ```
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -56,6 +56,6 @@ file; this reader will not, because the truncated tail of a block is
56
56
  indistinguishable from a complete one.
57
57
 
58
58
  ```yaml approval-values
59
- version: 1
59
+ version: "0.2"
60
60
  like:
61
61
  - success reported first, caveats after
@@ -0,0 +1,69 @@
1
+ # Approval Policy
2
+
3
+ Agents working in this project handle my life admin. Anything that leaves
4
+ the machine gets declared, and the classes below say what I sign off on.
5
+
6
+ ```yaml approval-policy
7
+ version: "0.1"
8
+
9
+ defaults:
10
+ autonomy: manual # unknown/undeclared classes require sign-off
11
+ channel: telegram
12
+ approval_ttl: 24h # pending requests expire
13
+ on_expiry: reject
14
+
15
+ approvers:
16
+ alice:
17
+ channels: [telegram, cli]
18
+
19
+ classes:
20
+ read.*: { autonomy: autonomous }
21
+ files.write.workspace: { autonomy: autonomous }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
+ communicate.email.draft: { autonomy: autonomous }
24
+ communicate.email.external:
25
+ autonomy: manual
26
+ approvers: [alice]
27
+ financial.spend:
28
+ autonomy: manual
29
+ approvers: [alice]
30
+ limits: { per_action_usd: 25, daily_usd: 100 }
31
+ public.post: { autonomy: manual }
32
+ data.delete: { autonomy: manual }
33
+ account.auth: { autonomy: manual }
34
+
35
+ budgets:
36
+ global: { daily_usd: 100, daily_actions: 200 }
37
+
38
+ audit:
39
+ supervised_sample_rate: 0.10 # fraction of supervised actions escalated
40
+ # for retrospective human review
41
+
42
+ channels:
43
+ telegram:
44
+ chat_id_env: APPROVAL_TG_CHAT
45
+ token_env: APPROVAL_TG_TOKEN
46
+ web:
47
+ port: 4680
48
+ ```
49
+
50
+ Everything after the block is prose again and is ignored by the parser.
51
+
52
+ ## What I value
53
+
54
+ The block below is the FIRST revision of the values format: `version` is the
55
+ integer 1 and it carries a `wants:` list. APRV-336 folded `wants` into `like`
56
+ and moved the version to the quoted string "0.2", so this block is refused with
57
+ `version-unsupported` and a message naming the two edits.
58
+
59
+ ```yaml approval-values
60
+ version: 1
61
+ like:
62
+ - success reported first, caveats after
63
+
64
+ wants:
65
+ - say when you are stuck rather than guessing a fourth time
66
+ ```
67
+
68
+ Prose again after the block. The policy above loads exactly as it does in every
69
+ other fixture here: a values failure is never a policy failure.
@@ -0,0 +1,64 @@
1
+ # Approval Policy
2
+
3
+ Agents working in this project handle my life admin. Anything that leaves
4
+ the machine gets declared, and the classes below say what I sign off on.
5
+
6
+ ```yaml approval-policy
7
+ version: "0.1"
8
+
9
+ defaults:
10
+ autonomy: manual # unknown/undeclared classes require sign-off
11
+ channel: telegram
12
+ approval_ttl: 24h # pending requests expire
13
+ on_expiry: reject
14
+
15
+ approvers:
16
+ alice:
17
+ channels: [telegram, cli]
18
+
19
+ classes:
20
+ read.*: { autonomy: autonomous }
21
+ files.write.workspace: { autonomy: autonomous }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
+ communicate.email.draft: { autonomy: autonomous }
24
+ communicate.email.external:
25
+ autonomy: manual
26
+ approvers: [alice]
27
+ financial.spend:
28
+ autonomy: manual
29
+ approvers: [alice]
30
+ limits: { per_action_usd: 25, daily_usd: 100 }
31
+ public.post: { autonomy: manual }
32
+ data.delete: { autonomy: manual }
33
+ account.auth: { autonomy: manual }
34
+
35
+ budgets:
36
+ global: { daily_usd: 100, daily_actions: 200 }
37
+
38
+ audit:
39
+ supervised_sample_rate: 0.10 # fraction of supervised actions escalated
40
+ # for retrospective human review
41
+
42
+ channels:
43
+ telegram:
44
+ chat_id_env: APPROVAL_TG_CHAT
45
+ token_env: APPROVAL_TG_TOKEN
46
+ web:
47
+ port: 4680
48
+ ```
49
+
50
+ Everything after the block is prose again and is ignored by the parser.
51
+
52
+ ## What I value
53
+
54
+ The block below is the current revision written without quotes. YAML reads the
55
+ dotted identifier as the float 0.2, which is why the version is quoted at all,
56
+ so the reader refuses it with `version-unsupported` and the quotes as the fix.
57
+
58
+ ```yaml approval-values
59
+ version: 0.2
60
+ like:
61
+ - success reported first, caveats after
62
+ ```
63
+
64
+ Prose again after the block, ignored by both readers.
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -55,7 +55,7 @@ The block below is not YAML: the second entry is indented into a mapping that
55
55
  was never opened.
56
56
 
57
57
  ```yaml approval-values
58
- version: 1
58
+ version: "0.2"
59
59
  like:
60
60
  - success reported first
61
61
  key: value
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -19,7 +19,7 @@ approvers:
19
19
  classes:
20
20
  read.*: { autonomy: autonomous }
21
21
  files.write.workspace: { autonomy: autonomous }
22
- calendar.write.own: { autonomy: supervised }
22
+ calendar.write.own: { autonomy: supervised-retro }
23
23
  communicate.email.draft: { autonomy: autonomous }
24
24
  communicate.email.external:
25
25
  autonomy: manual
@@ -55,7 +55,7 @@ The block below is guidance, never policy. Nothing in it grants anything, and
55
55
  no part of the runtime reads it to decide.
56
56
 
57
57
  ```yaml approval-values
58
- version: 1
58
+ version: "0.2"
59
59
 
60
60
  love:
61
61
  - seeing the real change, not a description of it
@@ -64,16 +64,14 @@ love:
64
64
  like:
65
65
  - success reported first, caveats after
66
66
  - small reviewable commits
67
+ - honest opinions on the work, including when you think a task is wrong
68
+ - a journal entry of about five points per milestone
67
69
 
68
70
  dislike:
69
71
  - prose where a command would do
70
72
  - being asked to approve something I cannot see
71
73
 
72
- wants:
73
- - honest opinions on the work, including when you think a task is wrong
74
- - a journal entry of about five points per milestone
75
-
76
- responds: "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
74
+ communication: "Usually within the hour on the phone; a bare 'ok' means yes and is not curtness."
77
75
  ```
78
76
 
79
77
  Prose again after the block, ignored by both readers.