project-tiny-context-harness 0.2.85 → 0.6.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 (361) hide show
  1. package/README.md +163 -428
  2. package/assets/README.md +283 -455
  3. package/assets/README.zh-CN.md +199 -123
  4. package/assets/agents/AGENTS_CORE.md +54 -67
  5. package/assets/context_templates/context.toml +3 -0
  6. package/assets/context_templates/global.md +6 -6
  7. package/assets/github/harness.yml +2 -2
  8. package/assets/skills/context_development_engineer/SKILL.md +91 -107
  9. package/assets/skills/context_product_plan/SKILL.md +18 -28
  10. package/assets/skills/context_surface_contract/SKILL.md +35 -38
  11. package/assets/skills/context_uiux_design/SKILL.md +31 -30
  12. package/assets/skills/long-task-workflow/SKILL.md +76 -0
  13. package/assets/skills/long-task-workflow/agents/openai.yaml +4 -0
  14. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +41 -0
  15. package/assets/skills/long-task-workflow/references/contract-authoring.md +62 -0
  16. package/assets/skills/long-task-workflow/references/evidence-design.md +45 -0
  17. package/assets/skills/normal-long-task/SKILL.md +12 -489
  18. package/assets/skills/source-plan-authoring/SKILL.md +379 -0
  19. package/assets/tools/validate_context.py +293 -127
  20. package/dist/cli.js +3 -1
  21. package/dist/commands/check-modularity.js +33 -10
  22. package/dist/commands/composite-campaign.d.ts +1 -0
  23. package/dist/commands/composite-campaign.js +8 -0
  24. package/dist/commands/composite-long-task.d.ts +1 -6
  25. package/dist/commands/composite-long-task.js +7 -163
  26. package/dist/commands/delivery-set.d.ts +1 -0
  27. package/dist/commands/delivery-set.js +8 -0
  28. package/dist/commands/disable.d.ts +1 -0
  29. package/dist/commands/disable.js +15 -0
  30. package/dist/commands/enable.d.ts +1 -0
  31. package/dist/commands/enable.js +14 -0
  32. package/dist/commands/export-context-args.js +13 -4
  33. package/dist/commands/export-context.js +18 -7
  34. package/dist/commands/index.js +42 -30
  35. package/dist/commands/init.js +12 -6
  36. package/dist/commands/long-task-authoring.d.ts +3 -0
  37. package/dist/commands/long-task-authoring.js +92 -0
  38. package/dist/commands/long-task-explain.d.ts +1 -0
  39. package/dist/commands/long-task-explain.js +52 -0
  40. package/dist/commands/long-task.d.ts +1 -0
  41. package/dist/commands/long-task.js +226 -0
  42. package/dist/commands/package-source.js +2 -2
  43. package/dist/commands/upgrade.js +10 -10
  44. package/dist/index.d.ts +11 -1
  45. package/dist/index.js +8 -0
  46. package/dist/lib/config.js +34 -8
  47. package/dist/lib/context-default-footprint.d.ts +16 -0
  48. package/dist/lib/context-default-footprint.js +107 -0
  49. package/dist/lib/context-export.js +105 -41
  50. package/dist/lib/context-graph-snapshot.d.ts +18 -0
  51. package/dist/lib/context-graph-snapshot.js +171 -0
  52. package/dist/lib/context-manifest-schema.d.ts +28 -0
  53. package/dist/lib/context-manifest-schema.js +150 -0
  54. package/dist/lib/context-manifest.js +28 -20
  55. package/dist/lib/context-templates.js +5 -5
  56. package/dist/lib/design-md.js +1 -1
  57. package/dist/lib/doctor.js +54 -1
  58. package/dist/lib/harness-root.js +25 -8
  59. package/dist/lib/init.js +6 -3
  60. package/dist/lib/legacy-managed-scan.js +23 -7
  61. package/dist/lib/legacy-sdlc-migration.js +21 -11
  62. package/dist/lib/long-task-acceptance-reference.d.ts +22 -0
  63. package/dist/lib/long-task-acceptance-reference.js +46 -0
  64. package/dist/lib/long-task-acceptance-shape.d.ts +5 -0
  65. package/dist/lib/long-task-acceptance-shape.js +131 -0
  66. package/dist/lib/long-task-activation-validation.d.ts +21 -0
  67. package/dist/lib/long-task-activation-validation.js +136 -0
  68. package/dist/lib/long-task-artifacts.d.ts +5 -0
  69. package/dist/lib/long-task-artifacts.js +34 -0
  70. package/dist/lib/long-task-assertions-v2.d.ts +22 -0
  71. package/dist/lib/long-task-assertions-v2.js +212 -0
  72. package/dist/lib/long-task-authoring-authority-preview.d.ts +5 -0
  73. package/dist/lib/long-task-authoring-authority-preview.js +85 -0
  74. package/dist/lib/long-task-authoring-preflight-diagnostics.d.ts +8 -0
  75. package/dist/lib/long-task-authoring-preflight-diagnostics.js +179 -0
  76. package/dist/lib/long-task-authoring-preflight-repair-order.d.ts +8 -0
  77. package/dist/lib/long-task-authoring-preflight-repair-order.js +95 -0
  78. package/dist/lib/long-task-authoring-preflight-types.d.ts +46 -0
  79. package/dist/lib/long-task-authoring-preflight-types.js +38 -0
  80. package/dist/lib/long-task-authoring-preflight.d.ts +3 -0
  81. package/dist/lib/long-task-authoring-preflight.js +44 -0
  82. package/dist/lib/long-task-authority-material-diff.d.ts +17 -0
  83. package/dist/lib/long-task-authority-material-diff.js +152 -0
  84. package/dist/lib/long-task-authority-materials.d.ts +7 -0
  85. package/dist/lib/long-task-authority-materials.js +83 -0
  86. package/dist/lib/long-task-authority-policy.d.ts +168 -0
  87. package/dist/lib/long-task-authority-policy.js +181 -0
  88. package/dist/lib/long-task-authority-revision-details.d.ts +19 -0
  89. package/dist/lib/long-task-authority-revision-details.js +192 -0
  90. package/dist/lib/long-task-authority-revision-enforcement.d.ts +3 -0
  91. package/dist/lib/long-task-authority-revision-enforcement.js +41 -0
  92. package/dist/lib/long-task-authority-revision-types.d.ts +50 -0
  93. package/dist/lib/long-task-authority-revision-types.js +1 -0
  94. package/dist/lib/long-task-authority-revision.d.ts +4 -0
  95. package/dist/lib/long-task-authority-revision.js +188 -0
  96. package/dist/lib/long-task-authority-transition-policy.d.ts +62 -0
  97. package/dist/lib/long-task-authority-transition-policy.js +62 -0
  98. package/dist/lib/long-task-authority-types.d.ts +96 -0
  99. package/dist/lib/long-task-authority-types.js +1 -0
  100. package/dist/lib/long-task-authority.d.ts +7 -0
  101. package/dist/lib/long-task-authority.js +142 -0
  102. package/dist/lib/long-task-boundary-check.d.ts +15 -0
  103. package/dist/lib/long-task-boundary-check.js +9 -0
  104. package/dist/lib/long-task-check-evidence-decoder.d.ts +3 -0
  105. package/dist/lib/long-task-check-evidence-decoder.js +74 -0
  106. package/dist/lib/long-task-check-execution-policy.d.ts +18 -0
  107. package/dist/lib/long-task-check-execution-policy.js +36 -0
  108. package/dist/lib/long-task-check-runner.d.ts +2 -0
  109. package/dist/lib/long-task-check-runner.js +181 -0
  110. package/dist/lib/long-task-check-shape.d.ts +2 -0
  111. package/dist/lib/long-task-check-shape.js +136 -0
  112. package/dist/lib/long-task-claim-definitions.d.ts +7 -0
  113. package/dist/lib/long-task-claim-definitions.js +78 -0
  114. package/dist/lib/long-task-claim-proof-policy.d.ts +4 -0
  115. package/dist/lib/long-task-claim-proof-policy.js +57 -0
  116. package/dist/lib/long-task-claims.d.ts +10 -0
  117. package/dist/lib/long-task-claims.js +187 -0
  118. package/dist/lib/long-task-context-authority-topology.d.ts +7 -0
  119. package/dist/lib/long-task-context-authority-topology.js +37 -0
  120. package/dist/lib/long-task-context-authority.d.ts +14 -0
  121. package/dist/lib/long-task-context-authority.js +66 -0
  122. package/dist/lib/long-task-contract-types.d.ts +203 -0
  123. package/dist/lib/long-task-contract-types.js +1 -0
  124. package/dist/lib/long-task-counterfactual-claim-policy.d.ts +10 -0
  125. package/dist/lib/long-task-counterfactual-claim-policy.js +57 -0
  126. package/dist/lib/long-task-counterfactual-sandbox.d.ts +6 -0
  127. package/dist/lib/long-task-counterfactual-sandbox.js +87 -0
  128. package/dist/lib/long-task-counterfactual-types.d.ts +24 -0
  129. package/dist/lib/long-task-counterfactual-types.js +1 -0
  130. package/dist/lib/long-task-delivery-compiler.d.ts +10 -0
  131. package/dist/lib/long-task-delivery-compiler.js +129 -0
  132. package/dist/lib/long-task-delivery-parser.d.ts +13 -0
  133. package/dist/lib/long-task-delivery-parser.js +90 -0
  134. package/dist/lib/long-task-delivery-preflight.d.ts +5 -0
  135. package/dist/lib/long-task-delivery-preflight.js +151 -0
  136. package/dist/lib/long-task-delivery-shape.d.ts +5 -0
  137. package/dist/lib/long-task-delivery-shape.js +5 -0
  138. package/dist/lib/long-task-delivery-types.d.ts +8 -0
  139. package/dist/lib/long-task-delivery-types.js +8 -0
  140. package/dist/lib/long-task-delivery-validation.d.ts +3 -0
  141. package/dist/lib/long-task-delivery-validation.js +175 -0
  142. package/dist/lib/long-task-evidence-adapter-policy.d.ts +4 -0
  143. package/dist/lib/long-task-evidence-adapter-policy.js +15 -0
  144. package/dist/lib/long-task-evidence-adapter-types.d.ts +1 -0
  145. package/dist/lib/long-task-evidence-adapter-types.js +1 -0
  146. package/dist/lib/long-task-evidence-findings.d.ts +5 -0
  147. package/dist/lib/long-task-evidence-findings.js +113 -0
  148. package/dist/lib/long-task-evidence-sensitivity-policy.d.ts +4 -0
  149. package/dist/lib/long-task-evidence-sensitivity-policy.js +98 -0
  150. package/dist/lib/long-task-evidence-v2.d.ts +5 -0
  151. package/dist/lib/long-task-evidence-v2.js +226 -0
  152. package/dist/lib/long-task-explain-acceptance-link.d.ts +46 -0
  153. package/dist/lib/long-task-explain-acceptance-link.js +96 -0
  154. package/dist/lib/long-task-explain-claim-links.d.ts +45 -0
  155. package/dist/lib/long-task-explain-claim-links.js +88 -0
  156. package/dist/lib/long-task-explain-source-links.d.ts +93 -0
  157. package/dist/lib/long-task-explain-source-links.js +51 -0
  158. package/dist/lib/long-task-final-v2.d.ts +2 -0
  159. package/dist/lib/long-task-final-v2.js +124 -0
  160. package/dist/lib/long-task-finding-context.d.ts +3 -0
  161. package/dist/lib/long-task-finding-context.js +63 -0
  162. package/dist/lib/long-task-freshness.d.ts +3 -0
  163. package/dist/lib/long-task-freshness.js +80 -0
  164. package/dist/lib/long-task-hook-install.d.ts +9 -0
  165. package/dist/lib/long-task-hook-install.js +184 -0
  166. package/dist/lib/long-task-hook-preflight.d.ts +7 -0
  167. package/dist/lib/long-task-hook-preflight.js +58 -0
  168. package/dist/lib/long-task-observation-ownership.d.ts +2 -0
  169. package/dist/lib/long-task-observation-ownership.js +22 -0
  170. package/dist/lib/long-task-outcome-parser.d.ts +4 -0
  171. package/dist/lib/long-task-outcome-parser.js +100 -0
  172. package/dist/lib/long-task-paths.d.ts +49 -0
  173. package/dist/lib/long-task-paths.js +418 -0
  174. package/dist/lib/long-task-playwright-counterfactual-policy.d.ts +7 -0
  175. package/dist/lib/long-task-playwright-counterfactual-policy.js +125 -0
  176. package/dist/lib/long-task-playwright-evidence.d.ts +6 -0
  177. package/dist/lib/long-task-playwright-evidence.js +244 -0
  178. package/dist/lib/long-task-product-shape.d.ts +6 -0
  179. package/dist/lib/long-task-product-shape.js +73 -0
  180. package/dist/lib/long-task-progress.d.ts +4 -0
  181. package/dist/lib/long-task-progress.js +114 -0
  182. package/dist/lib/long-task-protected-files.d.ts +1 -0
  183. package/dist/lib/long-task-protected-files.js +30 -0
  184. package/dist/lib/long-task-required-proof-surfaces.d.ts +2 -0
  185. package/dist/lib/long-task-required-proof-surfaces.js +13 -0
  186. package/dist/lib/long-task-requirement-shape.d.ts +2 -0
  187. package/dist/lib/long-task-requirement-shape.js +18 -0
  188. package/dist/lib/long-task-risk-surfaces.d.ts +2 -0
  189. package/dist/lib/long-task-risk-surfaces.js +60 -0
  190. package/dist/lib/long-task-risk-types.d.ts +5 -0
  191. package/dist/lib/long-task-risk-types.js +12 -0
  192. package/dist/lib/long-task-risk.d.ts +9 -0
  193. package/dist/lib/long-task-risk.js +132 -0
  194. package/dist/lib/long-task-root-shape.d.ts +4 -0
  195. package/dist/lib/long-task-root-shape.js +86 -0
  196. package/dist/lib/long-task-runner-environment.d.ts +7 -0
  197. package/dist/lib/long-task-runner-environment.js +57 -0
  198. package/dist/lib/long-task-runner-files.d.ts +3 -0
  199. package/dist/lib/long-task-runner-files.js +39 -0
  200. package/dist/lib/long-task-runner-freeze.d.ts +2 -0
  201. package/dist/lib/long-task-runner-freeze.js +168 -0
  202. package/dist/lib/long-task-runtime-types.d.ts +214 -0
  203. package/dist/lib/long-task-runtime-types.js +1 -0
  204. package/dist/lib/long-task-shape-primitives.d.ts +17 -0
  205. package/dist/lib/long-task-shape-primitives.js +81 -0
  206. package/dist/lib/long-task-source-authority-types.d.ts +13 -0
  207. package/dist/lib/long-task-source-authority-types.js +1 -0
  208. package/dist/lib/long-task-source-claim-validation.d.ts +5 -0
  209. package/dist/lib/long-task-source-claim-validation.js +96 -0
  210. package/dist/lib/long-task-source-continuity.d.ts +4 -0
  211. package/dist/lib/long-task-source-continuity.js +57 -0
  212. package/dist/lib/long-task-source-inventory.d.ts +2 -0
  213. package/dist/lib/long-task-source-inventory.js +21 -0
  214. package/dist/lib/long-task-source-item-parser.d.ts +3 -0
  215. package/dist/lib/long-task-source-item-parser.js +112 -0
  216. package/dist/lib/long-task-source-shape.d.ts +2 -0
  217. package/dist/lib/long-task-source-shape.js +56 -0
  218. package/dist/lib/long-task-source-target-continuity.d.ts +4 -0
  219. package/dist/lib/long-task-source-target-continuity.js +80 -0
  220. package/dist/lib/long-task-source-target-index.d.ts +12 -0
  221. package/dist/lib/long-task-source-target-index.js +76 -0
  222. package/dist/lib/long-task-source-validation.d.ts +3 -0
  223. package/dist/lib/long-task-source-validation.js +46 -0
  224. package/dist/lib/long-task-state.d.ts +91 -0
  225. package/dist/lib/long-task-state.js +611 -0
  226. package/dist/lib/long-task-status-projection.d.ts +21 -0
  227. package/dist/lib/long-task-status-projection.js +116 -0
  228. package/dist/lib/long-task-status-v2.d.ts +37 -0
  229. package/dist/lib/long-task-status-v2.js +306 -0
  230. package/dist/lib/long-task-technical-shape.d.ts +3 -0
  231. package/dist/lib/long-task-technical-shape.js +44 -0
  232. package/dist/lib/long-task-verifier-authority.d.ts +12 -0
  233. package/dist/lib/long-task-verifier-authority.js +47 -0
  234. package/dist/lib/long-task-verifier-identity.d.ts +2 -0
  235. package/dist/lib/long-task-verifier-identity.js +55 -0
  236. package/dist/lib/long-task-verifier-v2.d.ts +13 -0
  237. package/dist/lib/long-task-verifier-v2.js +266 -0
  238. package/dist/lib/long-task-workspace-runtime-types.d.ts +23 -0
  239. package/dist/lib/long-task-workspace-runtime-types.js +1 -0
  240. package/dist/lib/long-task-workspace.d.ts +25 -0
  241. package/dist/lib/long-task-workspace.js +366 -0
  242. package/dist/lib/managed-file.js +20 -5
  243. package/dist/lib/migrations.js +156 -32
  244. package/dist/lib/modularity.d.ts +27 -1
  245. package/dist/lib/modularity.js +499 -23
  246. package/dist/lib/package-json-config.js +14 -5
  247. package/dist/lib/package-source.js +4 -2
  248. package/dist/lib/profiles.d.ts +13 -0
  249. package/dist/lib/profiles.js +66 -0
  250. package/dist/lib/schema-guard.js +4 -2
  251. package/dist/lib/source-files.js +14 -7
  252. package/dist/lib/source-pack-classify.js +91 -19
  253. package/dist/lib/source-pack-config.js +25 -8
  254. package/dist/lib/source-pack-export.js +84 -25
  255. package/dist/lib/source-pack-manifest.js +18 -6
  256. package/dist/lib/source-pack-records.js +35 -11
  257. package/dist/lib/source-pack-render.js +47 -18
  258. package/dist/lib/stable-json.d.ts +2 -0
  259. package/dist/lib/stable-json.js +21 -0
  260. package/dist/lib/strict-codec.d.ts +4 -0
  261. package/dist/lib/strict-codec.js +65 -0
  262. package/dist/lib/sync-engine.js +76 -24
  263. package/dist/lib/types.d.ts +8 -1
  264. package/dist/lib/upgrade.js +4 -3
  265. package/dist/lib/validators.js +218 -191
  266. package/dist/long-task-hook.d.ts +2 -0
  267. package/dist/long-task-hook.js +55 -0
  268. package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +340 -0
  269. package/dist/schemas/long-task-delivery-v2/long-task-outcomes-v2.schema.json +18 -0
  270. package/migrations/README.md +8 -3
  271. package/package.json +17 -6
  272. package/source-mappings.yaml +0 -3
  273. package/assets/protected-harness-baseline.json +0 -20
  274. package/assets/skills/composite-long-task-workflow/SKILL.md +0 -245
  275. package/assets/skills/composite-long-task-workflow/assets/execution-binding.template.md +0 -62
  276. package/assets/skills/composite-long-task-workflow/assets/goal-objective.template.md +0 -17
  277. package/assets/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md +0 -682
  278. package/dist/commands/superpowers.d.ts +0 -1
  279. package/dist/commands/superpowers.js +0 -8
  280. package/dist/lib/composite-long-task-renderer.d.ts +0 -12
  281. package/dist/lib/composite-long-task-renderer.js +0 -109
  282. package/dist/lib/plan-acceptance-artifacts.d.ts +0 -1
  283. package/dist/lib/plan-acceptance-artifacts.js +0 -220
  284. package/dist/lib/plan-acceptance-evidence.d.ts +0 -2
  285. package/dist/lib/plan-acceptance-evidence.js +0 -108
  286. package/dist/lib/plan-acceptance-json.d.ts +0 -15
  287. package/dist/lib/plan-acceptance-json.js +0 -133
  288. package/dist/lib/plan-acceptance-validator.d.ts +0 -2
  289. package/dist/lib/plan-acceptance-validator.js +0 -209
  290. package/dist/lib/plan-contract-validator.d.ts +0 -2
  291. package/dist/lib/plan-contract-validator.js +0 -127
  292. package/dist/lib/plan-validator-common.d.ts +0 -24
  293. package/dist/lib/plan-validator-common.js +0 -196
  294. package/dist/lib/superpowers-task-ac010.d.ts +0 -6
  295. package/dist/lib/superpowers-task-ac010.js +0 -26
  296. package/dist/lib/superpowers-task-assertion-normalizers.d.ts +0 -3
  297. package/dist/lib/superpowers-task-assertion-normalizers.js +0 -74
  298. package/dist/lib/superpowers-task-assertions.d.ts +0 -20
  299. package/dist/lib/superpowers-task-assertions.js +0 -257
  300. package/dist/lib/superpowers-task-attempt.d.ts +0 -4
  301. package/dist/lib/superpowers-task-attempt.js +0 -102
  302. package/dist/lib/superpowers-task-command-run-correlation.d.ts +0 -8
  303. package/dist/lib/superpowers-task-command-run-correlation.js +0 -103
  304. package/dist/lib/superpowers-task-command-specs.d.ts +0 -3
  305. package/dist/lib/superpowers-task-command-specs.js +0 -52
  306. package/dist/lib/superpowers-task-compile-diagnostics.d.ts +0 -5
  307. package/dist/lib/superpowers-task-compile-diagnostics.js +0 -20
  308. package/dist/lib/superpowers-task-compile-guards.d.ts +0 -2
  309. package/dist/lib/superpowers-task-compile-guards.js +0 -66
  310. package/dist/lib/superpowers-task-compile.d.ts +0 -6
  311. package/dist/lib/superpowers-task-compile.js +0 -133
  312. package/dist/lib/superpowers-task-completion-output.d.ts +0 -91
  313. package/dist/lib/superpowers-task-completion-output.js +0 -374
  314. package/dist/lib/superpowers-task-conformance.d.ts +0 -2
  315. package/dist/lib/superpowers-task-conformance.js +0 -24
  316. package/dist/lib/superpowers-task-contradictions.d.ts +0 -6
  317. package/dist/lib/superpowers-task-contradictions.js +0 -126
  318. package/dist/lib/superpowers-task-current-evidence.d.ts +0 -3
  319. package/dist/lib/superpowers-task-current-evidence.js +0 -176
  320. package/dist/lib/superpowers-task-delivery.d.ts +0 -4
  321. package/dist/lib/superpowers-task-delivery.js +0 -96
  322. package/dist/lib/superpowers-task-derive.d.ts +0 -14
  323. package/dist/lib/superpowers-task-derive.js +0 -393
  324. package/dist/lib/superpowers-task-events.d.ts +0 -1
  325. package/dist/lib/superpowers-task-events.js +0 -13
  326. package/dist/lib/superpowers-task-evidence-kernel.d.ts +0 -19
  327. package/dist/lib/superpowers-task-evidence-kernel.js +0 -347
  328. package/dist/lib/superpowers-task-evidence-records.d.ts +0 -2
  329. package/dist/lib/superpowers-task-evidence-records.js +0 -55
  330. package/dist/lib/superpowers-task-evidence.d.ts +0 -10
  331. package/dist/lib/superpowers-task-evidence.js +0 -147
  332. package/dist/lib/superpowers-task-fields.d.ts +0 -22
  333. package/dist/lib/superpowers-task-fields.js +0 -276
  334. package/dist/lib/superpowers-task-final-card.d.ts +0 -3
  335. package/dist/lib/superpowers-task-final-card.js +0 -35
  336. package/dist/lib/superpowers-task-gates.d.ts +0 -12
  337. package/dist/lib/superpowers-task-gates.js +0 -267
  338. package/dist/lib/superpowers-task-harness-drift.d.ts +0 -11
  339. package/dist/lib/superpowers-task-harness-drift.js +0 -90
  340. package/dist/lib/superpowers-task-next-slices.d.ts +0 -1
  341. package/dist/lib/superpowers-task-next-slices.js +0 -12
  342. package/dist/lib/superpowers-task-protected-baseline.d.ts +0 -10
  343. package/dist/lib/superpowers-task-protected-baseline.js +0 -66
  344. package/dist/lib/superpowers-task-source-compile.d.ts +0 -5
  345. package/dist/lib/superpowers-task-source-compile.js +0 -226
  346. package/dist/lib/superpowers-task-source-parser.d.ts +0 -23
  347. package/dist/lib/superpowers-task-source-parser.js +0 -218
  348. package/dist/lib/superpowers-task-state-schema.d.ts +0 -460
  349. package/dist/lib/superpowers-task-state-schema.js +0 -66
  350. package/dist/lib/superpowers-task-state-shape.d.ts +0 -3
  351. package/dist/lib/superpowers-task-state-shape.js +0 -50
  352. package/dist/lib/superpowers-task-state.d.ts +0 -16
  353. package/dist/lib/superpowers-task-state.js +0 -246
  354. package/dist/lib/superpowers-task-status.d.ts +0 -2
  355. package/dist/lib/superpowers-task-status.js +0 -24
  356. package/dist/lib/superpowers-task-under-specified.d.ts +0 -7
  357. package/dist/lib/superpowers-task-under-specified.js +0 -61
  358. package/dist/lib/superpowers-task-unregistered-evidence.d.ts +0 -11
  359. package/dist/lib/superpowers-task-unregistered-evidence.js +0 -72
  360. package/dist/lib/superpowers-task-validator.d.ts +0 -5
  361. package/dist/lib/superpowers-task-validator.js +0 -293
@@ -0,0 +1,152 @@
1
+ import { compiledAuthorityMaterials } from "./long-task-authority-materials.js";
2
+ import { contextAuthorityChanged } from "./long-task-context-authority.js";
3
+ import { canonicalValueJson } from "./strict-codec.js";
4
+ export function authorityMaterialRevisionDiff(previous, nextMaterials) {
5
+ const previousMaterials = compiledAuthorityMaterials(previous);
6
+ const productSemanticsChanged = changedProjectionFields(flattenProductSemantics(previousMaterials.product_semantics), flattenProductSemantics(nextMaterials.product_semantics));
7
+ const globalSemanticsChanged = changedProjectionFields(flattenGlobalSemantics(previousMaterials.global_semantics), flattenGlobalSemantics(nextMaterials.global_semantics));
8
+ const sourceFilesAdded = recordKeysAdded(previousMaterials.source_hashes, nextMaterials.source_hashes);
9
+ const sourceFilesRemoved = recordKeysRemoved(previousMaterials.source_hashes, nextMaterials.source_hashes);
10
+ const sourceFilesChanged = recordValuesChanged(previousMaterials.source_hashes, nextMaterials.source_hashes);
11
+ const contextSnapshotModeChanged = previousMaterials.context_snapshot.mode !==
12
+ nextMaterials.context_snapshot.mode;
13
+ const contextTopologyChanged = previousMaterials.context_snapshot.topology_sha256 !==
14
+ nextMaterials.context_snapshot.topology_sha256;
15
+ const contextFilesAdded = recordKeysAdded(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
16
+ const contextFilesRemoved = recordKeysRemoved(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
17
+ const contextFilesChanged = recordValuesChanged(previousMaterials.context_snapshot.sha256, nextMaterials.context_snapshot.sha256);
18
+ const controllingContextChanged = contextAuthorityChanged(previousMaterials.context_snapshot, nextMaterials.context_snapshot);
19
+ return {
20
+ product_semantics_changed: productSemanticsChanged,
21
+ global_semantics_changed: globalSemanticsChanged,
22
+ source_files_added: sourceFilesAdded,
23
+ source_files_removed: sourceFilesRemoved,
24
+ source_files_changed: sourceFilesChanged,
25
+ context_snapshot_mode_changed: contextSnapshotModeChanged,
26
+ context_topology_changed: contextTopologyChanged,
27
+ context_files_added: contextFilesAdded,
28
+ context_files_removed: contextFilesRemoved,
29
+ context_files_changed: contextFilesChanged,
30
+ reduction_reasons: [
31
+ ...(productSemanticsChanged.length ? ["product_semantics_changed"] : []),
32
+ ...(globalSemanticsChanged.length ? ["global_semantics_changed"] : []),
33
+ ...(sourceFilesAdded.length ||
34
+ sourceFilesRemoved.length ||
35
+ sourceFilesChanged.length
36
+ ? ["source_file_content_changed"]
37
+ : []),
38
+ ...(controllingContextChanged ? ["context_authority_changed"] : []),
39
+ ],
40
+ };
41
+ }
42
+ export function sourceClaimAdditions(beforeClaims, afterClaims) {
43
+ const before = new Set(beforeClaims.map((claim) => claim.key));
44
+ return afterClaims
45
+ .filter((claim) => !before.has(claim.key))
46
+ .map((claim) => `${claim.key}:added`)
47
+ .sort();
48
+ }
49
+ export function changedProductClaimSemantics(previous, next) {
50
+ const before = productClaimSemantics(previous);
51
+ const after = productClaimSemantics(next);
52
+ return [...before.keys()]
53
+ .filter((claim) => after.has(claim) &&
54
+ canonicalValueJson(before.get(claim)) !==
55
+ canonicalValueJson(after.get(claim)))
56
+ .sort();
57
+ }
58
+ function productClaimSemantics(contract) {
59
+ const result = new Map();
60
+ for (const outcome of contract.outcomes) {
61
+ result.set(`${outcome.key}.result`, outcome.product.observable_result);
62
+ for (const item of outcome.product.requirements)
63
+ result.set(`${outcome.key}.requirement.${item.key}`, {
64
+ statement: item.statement,
65
+ required_proof_surfaces: [...item.required_proof_surfaces].sort(),
66
+ });
67
+ for (const control of outcome.product.controls)
68
+ for (const [field, value] of [
69
+ ["location", control.location],
70
+ ["trigger", control.trigger],
71
+ ["input", control.input],
72
+ ["loading", control.loading_state],
73
+ ["empty", control.empty_state],
74
+ ["success", control.success_state],
75
+ ["failure", control.failure_state],
76
+ ["feedback", control.feedback],
77
+ ])
78
+ if (value.trim())
79
+ result.set(`${outcome.key}.control.${control.key}.${field}`, value);
80
+ for (const item of outcome.product.non_completing_outcomes)
81
+ result.set(`${outcome.key}.non_completing.${item.key}`, item.statement);
82
+ for (const item of outcome.technical.obligations)
83
+ result.set(`${outcome.key}.obligation.${item.key}`, item.statement);
84
+ for (const item of outcome.technical.forbidden_shortcuts)
85
+ result.set(`${outcome.key}.forbidden_shortcut.${item.key}`, item.statement);
86
+ }
87
+ return result;
88
+ }
89
+ function flattenProductSemantics(projection) {
90
+ const fields = new Map([
91
+ ["task.goal", projection.task_goal],
92
+ ]);
93
+ for (const item of projection.global_non_goals)
94
+ fields.set(`global.product.non_goals.${item.key}`, item.statement);
95
+ for (const outcome of projection.outcomes) {
96
+ const prefix = `outcomes.${outcome.key}`;
97
+ fields.set(`${prefix}.title`, outcome.title);
98
+ fields.set(`${prefix}.observable_result`, outcome.observable_result);
99
+ fields.set(`${prefix}.owner.label`, outcome.owner.label);
100
+ fields.set(`${prefix}.owner.owner_surfaces`, outcome.owner.owner_surfaces);
101
+ for (const requirement of outcome.requirements) {
102
+ fields.set(`${prefix}.requirements.${requirement.key}`, requirement.statement);
103
+ fields.set(`${prefix}.requirements.${requirement.key}.required_proof_surfaces`, requirement.required_proof_surfaces);
104
+ }
105
+ for (const control of outcome.controls)
106
+ for (const field of [
107
+ "location",
108
+ "trigger",
109
+ "input",
110
+ "loading_state",
111
+ "empty_state",
112
+ "success_state",
113
+ "failure_state",
114
+ "feedback",
115
+ ])
116
+ fields.set(`${prefix}.controls.${control.key}.${field}`, control[field]);
117
+ for (const item of outcome.non_completing_outcomes)
118
+ fields.set(`${prefix}.non_completing.${item.key}`, item.statement);
119
+ }
120
+ return fields;
121
+ }
122
+ function flattenGlobalSemantics(projection) {
123
+ const fields = new Map();
124
+ for (const item of projection.constraints)
125
+ fields.set(`global.technical.constraints.${item.key}`, item.statement);
126
+ for (const item of projection.forbidden_shortcuts)
127
+ fields.set(`global.technical.forbidden_shortcuts.${item.key}`, item.statement);
128
+ return fields;
129
+ }
130
+ function changedProjectionFields(previous, next) {
131
+ return [...new Set([...previous.keys(), ...next.keys()])]
132
+ .filter((field) => !previous.has(field) ||
133
+ !next.has(field) ||
134
+ canonicalValueJson(previous.get(field)) !==
135
+ canonicalValueJson(next.get(field)))
136
+ .sort();
137
+ }
138
+ function recordKeysAdded(previous, next) {
139
+ return Object.keys(next)
140
+ .filter((key) => !(key in previous))
141
+ .sort();
142
+ }
143
+ function recordKeysRemoved(previous, next) {
144
+ return Object.keys(previous)
145
+ .filter((key) => !(key in next))
146
+ .sort();
147
+ }
148
+ function recordValuesChanged(previous, next) {
149
+ return Object.keys(previous)
150
+ .filter((key) => key in next && previous[key] !== next[key])
151
+ .sort();
152
+ }
@@ -0,0 +1,7 @@
1
+ import type { AuthorityMaterialHashesV2, CompiledDeliveryContractV2, CompiledSourceItemV2, ContextAuthoritySnapshotV2, DeliveryContractV2, GlobalSemanticProjectionV2, NextAuthorityMaterialsV2, ProductSemanticProjectionV2 } from "./long-task-delivery-types.js";
2
+ export declare function computeAuthorityMaterials(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">, sourceHashes: Record<string, string>, sourceItems: CompiledSourceItemV2[], contextSnapshot: ContextAuthoritySnapshotV2): NextAuthorityMaterialsV2;
3
+ export declare function compiledAuthorityMaterials(compiled: CompiledDeliveryContractV2): NextAuthorityMaterialsV2;
4
+ export declare function authorityMaterialHashes(materials: NextAuthorityMaterialsV2): AuthorityMaterialHashesV2;
5
+ export declare function authorityMaterialsChanged(previous: NextAuthorityMaterialsV2, next: NextAuthorityMaterialsV2): boolean;
6
+ export declare function projectProductSemantics(contract: Pick<DeliveryContractV2, "task" | "global" | "outcomes">): ProductSemanticProjectionV2;
7
+ export declare function projectGlobalSemantics(contract: Pick<DeliveryContractV2, "global">): GlobalSemanticProjectionV2;
@@ -0,0 +1,83 @@
1
+ import { normalizeContextAuthoritySnapshot } from "./long-task-context-authority.js";
2
+ import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
3
+ export function computeAuthorityMaterials(contract, sourceHashes, sourceItems, contextSnapshot) {
4
+ return {
5
+ source_hashes: sortRecord(sourceHashes),
6
+ source_items: [...sourceItems].sort((left, right) => left.key.localeCompare(right.key)),
7
+ context_snapshot: normalizeContextAuthoritySnapshot(contextSnapshot),
8
+ product_semantics: projectProductSemantics(contract),
9
+ global_semantics: projectGlobalSemantics(contract),
10
+ };
11
+ }
12
+ export function compiledAuthorityMaterials(compiled) {
13
+ const stored = compiled.authority_materials;
14
+ return (stored ??
15
+ computeAuthorityMaterials(compiled, compiled.source_hashes, compiled.source_items, compiled.context_snapshot));
16
+ }
17
+ export function authorityMaterialHashes(materials) {
18
+ return {
19
+ source_hashes_sha256: hash(materials.source_hashes),
20
+ context_snapshot_sha256: hash(materials.context_snapshot),
21
+ product_semantics_sha256: hash(materials.product_semantics),
22
+ global_semantics_sha256: hash(materials.global_semantics),
23
+ };
24
+ }
25
+ export function authorityMaterialsChanged(previous, next) {
26
+ return canonicalValueJson(previous) !== canonicalValueJson(next);
27
+ }
28
+ export function projectProductSemantics(contract) {
29
+ return {
30
+ task_goal: contract.task.goal,
31
+ global_non_goals: keyedStatements(contract.global.product.non_goals),
32
+ outcomes: [...contract.outcomes].sort(keyOrder).map((outcome) => ({
33
+ key: outcome.key,
34
+ title: outcome.title,
35
+ observable_result: outcome.product.observable_result,
36
+ owner: {
37
+ label: outcome.product.owner.label,
38
+ owner_surfaces: [...outcome.product.owner_surfaces].sort(),
39
+ },
40
+ requirements: [...outcome.product.requirements]
41
+ .sort(keyOrder)
42
+ .map((requirement) => ({
43
+ key: requirement.key,
44
+ statement: requirement.statement,
45
+ required_proof_surfaces: [
46
+ ...requirement.required_proof_surfaces,
47
+ ].sort(),
48
+ })),
49
+ controls: [...outcome.product.controls].sort(keyOrder).map((control) => ({
50
+ key: control.key,
51
+ location: control.location,
52
+ trigger: control.trigger,
53
+ input: control.input,
54
+ loading_state: control.loading_state,
55
+ empty_state: control.empty_state,
56
+ success_state: control.success_state,
57
+ failure_state: control.failure_state,
58
+ feedback: control.feedback,
59
+ })),
60
+ non_completing_outcomes: keyedStatements(outcome.product.non_completing_outcomes),
61
+ })),
62
+ };
63
+ }
64
+ export function projectGlobalSemantics(contract) {
65
+ return {
66
+ constraints: keyedStatements(contract.global.technical.constraints),
67
+ forbidden_shortcuts: keyedStatements(contract.global.technical.forbidden_shortcuts),
68
+ };
69
+ }
70
+ function keyedStatements(values) {
71
+ return [...values]
72
+ .sort(keyOrder)
73
+ .map(({ key, statement }) => ({ key, statement }));
74
+ }
75
+ function keyOrder(left, right) {
76
+ return left.key.localeCompare(right.key);
77
+ }
78
+ function sortRecord(value) {
79
+ return Object.fromEntries(Object.entries(value).sort(([left], [right]) => left.localeCompare(right)));
80
+ }
81
+ function hash(value) {
82
+ return sha256Hex(canonicalValueJson(value));
83
+ }
@@ -0,0 +1,168 @@
1
+ export type AuthorityFieldPolicy = "identity" | "semantic_user_review" | "proof_additive" | "runner_authority" | "input_coverage" | "output_requirement" | "scope" | "readiness_only" | "descriptive_non_authoritative";
2
+ export declare const CHECK_AUTHORITY_POLICY: {
3
+ key: "identity";
4
+ proof_surface: "semantic_user_review";
5
+ runner: "runner_authority";
6
+ verification_inputs: "proof_additive";
7
+ input_paths: "input_coverage";
8
+ expected_output_paths: "output_requirement";
9
+ artifact_globs: "proof_additive";
10
+ positive_assertions: "proof_additive";
11
+ negative_assertions: "proof_additive";
12
+ environment_requirements: "proof_additive";
13
+ };
14
+ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
15
+ readonly task: {
16
+ id: "identity";
17
+ title: "descriptive_non_authoritative";
18
+ goal: "semantic_user_review";
19
+ source_paths: "scope";
20
+ context_refs: "scope";
21
+ context_snapshot_mode: "scope";
22
+ };
23
+ readonly source_claim: {
24
+ key: "identity";
25
+ source_ref: "scope";
26
+ statement: "semantic_user_review";
27
+ disposition: "semantic_user_review";
28
+ };
29
+ readonly risk: {
30
+ requested_level: "semantic_user_review";
31
+ facts: "semantic_user_review";
32
+ };
33
+ readonly global_product: {
34
+ non_goals: "semantic_user_review";
35
+ };
36
+ readonly global_technical: {
37
+ constraints: "semantic_user_review";
38
+ forbidden_paths: "scope";
39
+ forbidden_shortcuts: "semantic_user_review";
40
+ };
41
+ readonly global_acceptance: {
42
+ checks: "proof_additive";
43
+ counterfactual_controls: "proof_additive";
44
+ external_confirmations: "semantic_user_review";
45
+ };
46
+ readonly outcome: {
47
+ key: "identity";
48
+ title: "descriptive_non_authoritative";
49
+ depends_on: "readiness_only";
50
+ product: "semantic_user_review";
51
+ technical: "semantic_user_review";
52
+ acceptance: "proof_additive";
53
+ };
54
+ readonly outcome_product: {
55
+ observable_result: "semantic_user_review";
56
+ owner: "semantic_user_review";
57
+ requirements: "semantic_user_review";
58
+ owner_surfaces: "semantic_user_review";
59
+ controls: "semantic_user_review";
60
+ non_completing_outcomes: "semantic_user_review";
61
+ };
62
+ readonly requirement: {
63
+ key: "identity";
64
+ statement: "semantic_user_review";
65
+ required_proof_surfaces: "proof_additive";
66
+ };
67
+ readonly owner: {
68
+ label: "identity";
69
+ context_refs: "scope";
70
+ path_globs: "scope";
71
+ };
72
+ readonly control: {
73
+ key: "identity";
74
+ location: "semantic_user_review";
75
+ trigger: "semantic_user_review";
76
+ input: "semantic_user_review";
77
+ loading_state: "semantic_user_review";
78
+ empty_state: "semantic_user_review";
79
+ success_state: "semantic_user_review";
80
+ failure_state: "semantic_user_review";
81
+ feedback: "semantic_user_review";
82
+ };
83
+ readonly outcome_technical: {
84
+ obligations: "semantic_user_review";
85
+ expected_change_paths: "scope";
86
+ allowed_support_paths: "scope";
87
+ forbidden_paths: "scope";
88
+ bindings: "semantic_user_review";
89
+ forbidden_shortcuts: "semantic_user_review";
90
+ rollback_and_recovery: "semantic_user_review";
91
+ };
92
+ readonly obligation: {
93
+ key: "identity";
94
+ statement: "semantic_user_review";
95
+ required_proof_surfaces: "proof_additive";
96
+ };
97
+ readonly binding: {
98
+ key: "identity";
99
+ kind: "semantic_user_review";
100
+ target: "semantic_user_review";
101
+ carrier_paths: "scope";
102
+ existence: "semantic_user_review";
103
+ verification_check_key: "proof_additive";
104
+ };
105
+ readonly rollback: {
106
+ rollback: "semantic_user_review";
107
+ recovery: "semantic_user_review";
108
+ verification_check_keys: "proof_additive";
109
+ };
110
+ readonly outcome_acceptance: {
111
+ checks: "proof_additive";
112
+ population: "proof_additive";
113
+ counterfactual_controls: "proof_additive";
114
+ };
115
+ readonly check: {
116
+ key: "identity";
117
+ proof_surface: "semantic_user_review";
118
+ runner: "runner_authority";
119
+ verification_inputs: "proof_additive";
120
+ input_paths: "input_coverage";
121
+ expected_output_paths: "output_requirement";
122
+ artifact_globs: "proof_additive";
123
+ positive_assertions: "proof_additive";
124
+ negative_assertions: "proof_additive";
125
+ environment_requirements: "proof_additive";
126
+ };
127
+ readonly assertion: {
128
+ key: "identity";
129
+ criterion: "semantic_user_review";
130
+ claims: "proof_additive";
131
+ observation: "proof_additive";
132
+ operator: "proof_additive";
133
+ expected: "proof_additive";
134
+ };
135
+ readonly runner: {
136
+ type: "runner_authority";
137
+ target: "runner_authority";
138
+ argv: "runner_authority";
139
+ cwd: "runner_authority";
140
+ timeout_ms: "runner_authority";
141
+ effect: "runner_authority";
142
+ retry_policy: "runner_authority";
143
+ idempotent: "runner_authority";
144
+ };
145
+ readonly population: {
146
+ check_key: "proof_additive";
147
+ claims: "proof_additive";
148
+ observations: "proof_additive";
149
+ exclusion_rules: "proof_additive";
150
+ };
151
+ readonly counterfactual: {
152
+ key: "identity";
153
+ binding_key: "proof_additive";
154
+ claims: "proof_additive";
155
+ check_key: "proof_additive";
156
+ mutation: "proof_additive";
157
+ expected_assertion_failures: "proof_additive";
158
+ };
159
+ readonly global_counterfactual: {
160
+ key: "identity";
161
+ binding_ref: "proof_additive";
162
+ claims: "proof_additive";
163
+ check_key: "proof_additive";
164
+ mutation: "proof_additive";
165
+ expected_assertion_failures: "proof_additive";
166
+ };
167
+ };
168
+ export declare function projectFieldsByPolicy<T extends object>(value: T, policy: Record<keyof T, AuthorityFieldPolicy>, included: ReadonlySet<AuthorityFieldPolicy>): Partial<T>;
@@ -0,0 +1,181 @@
1
+ const TASK_AUTHORITY_POLICY = {
2
+ id: "identity",
3
+ title: "descriptive_non_authoritative",
4
+ goal: "semantic_user_review",
5
+ source_paths: "scope",
6
+ context_refs: "scope",
7
+ context_snapshot_mode: "scope",
8
+ };
9
+ const SOURCE_CLAIM_AUTHORITY_POLICY = {
10
+ key: "identity",
11
+ source_ref: "scope",
12
+ statement: "semantic_user_review",
13
+ disposition: "semantic_user_review",
14
+ };
15
+ const RISK_AUTHORITY_POLICY = {
16
+ requested_level: "semantic_user_review",
17
+ facts: "semantic_user_review",
18
+ };
19
+ const GLOBAL_PRODUCT_AUTHORITY_POLICY = {
20
+ non_goals: "semantic_user_review",
21
+ };
22
+ const GLOBAL_TECHNICAL_AUTHORITY_POLICY = {
23
+ constraints: "semantic_user_review",
24
+ forbidden_paths: "scope",
25
+ forbidden_shortcuts: "semantic_user_review",
26
+ };
27
+ const GLOBAL_ACCEPTANCE_AUTHORITY_POLICY = {
28
+ checks: "proof_additive",
29
+ counterfactual_controls: "proof_additive",
30
+ external_confirmations: "semantic_user_review",
31
+ };
32
+ const OUTCOME_AUTHORITY_POLICY = {
33
+ key: "identity",
34
+ title: "descriptive_non_authoritative",
35
+ depends_on: "readiness_only",
36
+ product: "semantic_user_review",
37
+ technical: "semantic_user_review",
38
+ acceptance: "proof_additive",
39
+ };
40
+ const OUTCOME_PRODUCT_AUTHORITY_POLICY = {
41
+ observable_result: "semantic_user_review",
42
+ owner: "semantic_user_review",
43
+ requirements: "semantic_user_review",
44
+ owner_surfaces: "semantic_user_review",
45
+ controls: "semantic_user_review",
46
+ non_completing_outcomes: "semantic_user_review",
47
+ };
48
+ const REQUIREMENT_AUTHORITY_POLICY = {
49
+ key: "identity",
50
+ statement: "semantic_user_review",
51
+ required_proof_surfaces: "proof_additive",
52
+ };
53
+ const OWNER_AUTHORITY_POLICY = {
54
+ label: "identity",
55
+ context_refs: "scope",
56
+ path_globs: "scope",
57
+ };
58
+ const CONTROL_AUTHORITY_POLICY = {
59
+ key: "identity",
60
+ location: "semantic_user_review",
61
+ trigger: "semantic_user_review",
62
+ input: "semantic_user_review",
63
+ loading_state: "semantic_user_review",
64
+ empty_state: "semantic_user_review",
65
+ success_state: "semantic_user_review",
66
+ failure_state: "semantic_user_review",
67
+ feedback: "semantic_user_review",
68
+ };
69
+ const OUTCOME_TECHNICAL_AUTHORITY_POLICY = {
70
+ obligations: "semantic_user_review",
71
+ expected_change_paths: "scope",
72
+ allowed_support_paths: "scope",
73
+ forbidden_paths: "scope",
74
+ bindings: "semantic_user_review",
75
+ forbidden_shortcuts: "semantic_user_review",
76
+ rollback_and_recovery: "semantic_user_review",
77
+ };
78
+ const OBLIGATION_AUTHORITY_POLICY = {
79
+ key: "identity",
80
+ statement: "semantic_user_review",
81
+ required_proof_surfaces: "proof_additive",
82
+ };
83
+ const BINDING_AUTHORITY_POLICY = {
84
+ key: "identity",
85
+ kind: "semantic_user_review",
86
+ target: "semantic_user_review",
87
+ carrier_paths: "scope",
88
+ existence: "semantic_user_review",
89
+ verification_check_key: "proof_additive",
90
+ };
91
+ const ROLLBACK_AUTHORITY_POLICY = {
92
+ rollback: "semantic_user_review",
93
+ recovery: "semantic_user_review",
94
+ verification_check_keys: "proof_additive",
95
+ };
96
+ const OUTCOME_ACCEPTANCE_AUTHORITY_POLICY = {
97
+ checks: "proof_additive",
98
+ population: "proof_additive",
99
+ counterfactual_controls: "proof_additive",
100
+ };
101
+ export const CHECK_AUTHORITY_POLICY = {
102
+ key: "identity",
103
+ proof_surface: "semantic_user_review",
104
+ runner: "runner_authority",
105
+ verification_inputs: "proof_additive",
106
+ input_paths: "input_coverage",
107
+ expected_output_paths: "output_requirement",
108
+ artifact_globs: "proof_additive",
109
+ positive_assertions: "proof_additive",
110
+ negative_assertions: "proof_additive",
111
+ environment_requirements: "proof_additive",
112
+ };
113
+ const ASSERTION_AUTHORITY_POLICY = {
114
+ key: "identity",
115
+ criterion: "semantic_user_review",
116
+ claims: "proof_additive",
117
+ observation: "proof_additive",
118
+ operator: "proof_additive",
119
+ expected: "proof_additive",
120
+ };
121
+ const RUNNER_AUTHORITY_POLICY = {
122
+ type: "runner_authority",
123
+ target: "runner_authority",
124
+ argv: "runner_authority",
125
+ cwd: "runner_authority",
126
+ timeout_ms: "runner_authority",
127
+ effect: "runner_authority",
128
+ retry_policy: "runner_authority",
129
+ idempotent: "runner_authority",
130
+ };
131
+ const POPULATION_AUTHORITY_POLICY = {
132
+ check_key: "proof_additive",
133
+ claims: "proof_additive",
134
+ observations: "proof_additive",
135
+ exclusion_rules: "proof_additive",
136
+ };
137
+ const COUNTERFACTUAL_AUTHORITY_POLICY = {
138
+ key: "identity",
139
+ binding_key: "proof_additive",
140
+ claims: "proof_additive",
141
+ check_key: "proof_additive",
142
+ mutation: "proof_additive",
143
+ expected_assertion_failures: "proof_additive",
144
+ };
145
+ const GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY = {
146
+ key: "identity",
147
+ binding_ref: "proof_additive",
148
+ claims: "proof_additive",
149
+ check_key: "proof_additive",
150
+ mutation: "proof_additive",
151
+ expected_assertion_failures: "proof_additive",
152
+ };
153
+ export const AUTHORITY_FIELD_POLICY_REGISTRIES = {
154
+ task: TASK_AUTHORITY_POLICY,
155
+ source_claim: SOURCE_CLAIM_AUTHORITY_POLICY,
156
+ risk: RISK_AUTHORITY_POLICY,
157
+ global_product: GLOBAL_PRODUCT_AUTHORITY_POLICY,
158
+ global_technical: GLOBAL_TECHNICAL_AUTHORITY_POLICY,
159
+ global_acceptance: GLOBAL_ACCEPTANCE_AUTHORITY_POLICY,
160
+ outcome: OUTCOME_AUTHORITY_POLICY,
161
+ outcome_product: OUTCOME_PRODUCT_AUTHORITY_POLICY,
162
+ requirement: REQUIREMENT_AUTHORITY_POLICY,
163
+ owner: OWNER_AUTHORITY_POLICY,
164
+ control: CONTROL_AUTHORITY_POLICY,
165
+ outcome_technical: OUTCOME_TECHNICAL_AUTHORITY_POLICY,
166
+ obligation: OBLIGATION_AUTHORITY_POLICY,
167
+ binding: BINDING_AUTHORITY_POLICY,
168
+ rollback: ROLLBACK_AUTHORITY_POLICY,
169
+ outcome_acceptance: OUTCOME_ACCEPTANCE_AUTHORITY_POLICY,
170
+ check: CHECK_AUTHORITY_POLICY,
171
+ assertion: ASSERTION_AUTHORITY_POLICY,
172
+ runner: RUNNER_AUTHORITY_POLICY,
173
+ population: POPULATION_AUTHORITY_POLICY,
174
+ counterfactual: COUNTERFACTUAL_AUTHORITY_POLICY,
175
+ global_counterfactual: GLOBAL_COUNTERFACTUAL_AUTHORITY_POLICY,
176
+ };
177
+ export function projectFieldsByPolicy(value, policy, included) {
178
+ return Object.fromEntries(Object.keys(policy)
179
+ .filter((key) => included.has(policy[key]))
180
+ .map((key) => [key, value[key]]));
181
+ }
@@ -0,0 +1,19 @@
1
+ import type { CompiledCheckV2, CompiledDeliveryContractV2, CompiledOutcomeV2, DeliveryContractV2, DeliveryOutcomeV2, SourceClaimV2 } from "./long-task-delivery-types.js";
2
+ export declare function checkIndex(globalChecks: CompiledCheckV2[], outcomes: CompiledOutcomeV2[]): Map<string, CompiledCheckV2>;
3
+ export declare function changedRunnerFields(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
4
+ export declare function removedOrReplacedVerificationInputs(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
5
+ export declare function removedOrNarrowedInputPaths(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
6
+ export declare function removedOrWeakenedExpectedOutputPaths(identity: string, before: CompiledCheckV2, after: CompiledCheckV2): string[];
7
+ export declare function sourceClaimReductions(beforeClaims: SourceClaimV2[], afterClaims: SourceClaimV2[]): string[];
8
+ export declare function removedGlobalForbiddenPaths(previous: CompiledDeliveryContractV2, next: DeliveryContractV2): string[];
9
+ export declare function bindingReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
10
+ export declare function obligationReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
11
+ export declare function rollbackReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
12
+ export declare function counterfactualReductions(before: CompiledOutcomeV2, after: DeliveryOutcomeV2): string[];
13
+ export declare function globalCounterfactualReductions(before: CompiledDeliveryContractV2, after: DeliveryContractV2): string[];
14
+ export declare function expandedPatterns(label: string, before: string[], after: string[]): string[];
15
+ export declare function removedExactValues(label: string, before: string[], after: string[]): string[];
16
+ export declare function removedStructuredValues(label: string, before: unknown[], after: unknown[]): string[];
17
+ export declare function removedValues(before: Set<string>, after: Set<string>): string[];
18
+ export declare function addedValues(before: Set<string>, after: Set<string>): string[];
19
+ export declare function same(left: unknown, right: unknown): boolean;