project-tiny-context-harness 0.8.11 → 0.8.13

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 (395) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +514 -472
  3. package/assets/README.md +803 -749
  4. package/assets/README.zh-CN.md +468 -431
  5. package/assets/agents/.gitkeep +1 -1
  6. package/assets/agents/AGENTS_CORE.md +22 -24
  7. package/assets/agents/long-task-implementation.toml +15 -0
  8. package/assets/context_templates/architecture.md +18 -18
  9. package/assets/context_templates/area.md +30 -30
  10. package/assets/context_templates/context.toml +24 -24
  11. package/assets/context_templates/deployment.md +35 -35
  12. package/assets/context_templates/global.md +56 -56
  13. package/assets/context_templates/product-surface-contract.md +70 -70
  14. package/assets/context_templates/screen-contract.md +189 -189
  15. package/assets/context_templates/verification.md +25 -25
  16. package/assets/github/.gitkeep +1 -1
  17. package/assets/github/harness.yml +39 -39
  18. package/assets/make/.gitkeep +1 -1
  19. package/assets/make/ty-context.mk +48 -48
  20. package/assets/skills/context_development_engineer/SKILL.md +72 -185
  21. package/assets/skills/context_full_project_export/SKILL.md +28 -28
  22. package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
  23. package/assets/skills/context_product_plan/SKILL.md +35 -101
  24. package/assets/skills/context_surface_contract/SKILL.md +194 -191
  25. package/assets/skills/context_uiux_design/SKILL.md +49 -172
  26. package/assets/skills/design-resource-authoring/SKILL.md +54 -88
  27. package/assets/skills/design-resource-authoring/references/downstream-handoff.md +51 -163
  28. package/assets/skills/design-resource-authoring/references/formal-selected-web-app-handoff.md +96 -0
  29. package/assets/skills/design-resource-authoring/references/open-design-provider.md +140 -120
  30. package/assets/skills/design-resource-authoring/references/recovery-and-writeback.md +199 -0
  31. package/assets/skills/design-resource-authoring/references/resource-selection.md +158 -181
  32. package/assets/skills/design-system-authoring/SKILL.md +57 -57
  33. package/assets/skills/design-system-authoring/agents/openai.yaml +6 -6
  34. package/assets/skills/design-system-authoring/references/authority-adoption.md +48 -48
  35. package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +110 -110
  36. package/assets/skills/long-task-workflow/SKILL.md +71 -106
  37. package/assets/skills/long-task-workflow/agents/openai.yaml +1 -1
  38. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +71 -69
  39. package/assets/skills/long-task-workflow/references/contract-authoring.md +110 -101
  40. package/assets/skills/long-task-workflow/references/evidence-design.md +99 -78
  41. package/assets/skills/long-task-workflow/references/source-authoring.md +90 -90
  42. package/assets/tools/validate_context.py +442 -442
  43. package/dist/commands/design-resource-recovery.d.ts +1 -0
  44. package/dist/commands/design-resource-recovery.js +152 -0
  45. package/dist/commands/design-resource.js +29 -3
  46. package/dist/commands/enable.js +2 -0
  47. package/dist/commands/index.js +2 -2
  48. package/dist/commands/long-task-revision.js +8 -7
  49. package/dist/commands/sync.js +2 -0
  50. package/dist/index.d.ts +3 -3
  51. package/dist/index.js +2 -0
  52. package/dist/lib/compact-authoring-support.d.ts +22 -0
  53. package/dist/lib/compact-authoring-support.js +143 -0
  54. package/dist/lib/compact-shared-structure-authoring.d.ts +5 -0
  55. package/dist/lib/compact-shared-structure-authoring.js +9 -0
  56. package/dist/lib/compact-shared-structure-types.d.ts +61 -0
  57. package/dist/lib/compact-shared-structure-types.js +1 -0
  58. package/dist/lib/compact-shared-structure-validation.d.ts +2 -0
  59. package/dist/lib/compact-shared-structure-validation.js +159 -0
  60. package/dist/lib/compact-shared-structures.d.ts +3 -0
  61. package/dist/lib/compact-shared-structures.js +204 -0
  62. package/dist/lib/design-resource-fact-enums.d.ts +4 -0
  63. package/dist/lib/design-resource-fact-enums.js +12 -0
  64. package/dist/lib/design-resource-fact-manifest-shape-evidence.js +2 -2
  65. package/dist/lib/design-resource-fact-policy.d.ts +2 -2
  66. package/dist/lib/design-resource-fact-types.d.ts +2 -2
  67. package/dist/lib/design-resource-handoff-bundle-draft.js +4 -2
  68. package/dist/lib/design-resource-handoff-input-types.d.ts +3 -0
  69. package/dist/lib/design-resource-handoff-parser.d.ts +2 -2
  70. package/dist/lib/design-resource-handoff-parser.js +2 -2
  71. package/dist/lib/design-resource-handoff-shape.d.ts +2 -0
  72. package/dist/lib/design-resource-handoff-shape.js +10 -0
  73. package/dist/lib/design-resource-handoff-snapshot.js +4 -0
  74. package/dist/lib/design-resource-handoff-validation.d.ts +4 -1
  75. package/dist/lib/design-resource-handoff-validation.js +11 -0
  76. package/dist/lib/design-resource-handoff-web-dependency-validation.d.ts +4 -2
  77. package/dist/lib/design-resource-reconciliation-codec.d.ts +2 -0
  78. package/dist/lib/design-resource-reconciliation-codec.js +174 -0
  79. package/dist/lib/design-resource-reconciliation-types.d.ts +62 -0
  80. package/dist/lib/design-resource-reconciliation-types.js +1 -0
  81. package/dist/lib/design-resource-reconciliation.d.ts +3 -0
  82. package/dist/lib/design-resource-reconciliation.js +224 -0
  83. package/dist/lib/design-resource-recovery-authority-policy.d.ts +8 -0
  84. package/dist/lib/design-resource-recovery-authority-policy.js +123 -0
  85. package/dist/lib/design-resource-recovery-catalog-resources.d.ts +6 -0
  86. package/dist/lib/design-resource-recovery-catalog-resources.js +121 -0
  87. package/dist/lib/design-resource-recovery-catalog-shape.d.ts +3 -0
  88. package/dist/lib/design-resource-recovery-catalog-shape.js +104 -0
  89. package/dist/lib/design-resource-recovery-catalog.d.ts +9 -0
  90. package/dist/lib/design-resource-recovery-catalog.js +103 -0
  91. package/dist/lib/design-resource-recovery-cleanup.d.ts +2 -0
  92. package/dist/lib/design-resource-recovery-cleanup.js +11 -0
  93. package/dist/lib/design-resource-recovery-codec-primitives.d.ts +19 -0
  94. package/dist/lib/design-resource-recovery-codec-primitives.js +92 -0
  95. package/dist/lib/design-resource-recovery-codec.d.ts +4 -0
  96. package/dist/lib/design-resource-recovery-codec.js +93 -0
  97. package/dist/lib/design-resource-recovery-current.d.ts +9 -0
  98. package/dist/lib/design-resource-recovery-current.js +41 -0
  99. package/dist/lib/design-resource-recovery-delta-policy.d.ts +5 -0
  100. package/dist/lib/design-resource-recovery-delta-policy.js +108 -0
  101. package/dist/lib/design-resource-recovery-files.d.ts +37 -0
  102. package/dist/lib/design-resource-recovery-files.js +204 -0
  103. package/dist/lib/design-resource-recovery-final-disposition-shape.d.ts +2 -0
  104. package/dist/lib/design-resource-recovery-final-disposition-shape.js +47 -0
  105. package/dist/lib/design-resource-recovery-patch-types.d.ts +54 -0
  106. package/dist/lib/design-resource-recovery-patch-types.js +1 -0
  107. package/dist/lib/design-resource-recovery-replay.d.ts +7 -0
  108. package/dist/lib/design-resource-recovery-replay.js +112 -0
  109. package/dist/lib/design-resource-recovery-repository-bindings.d.ts +9 -0
  110. package/dist/lib/design-resource-recovery-repository-bindings.js +49 -0
  111. package/dist/lib/design-resource-recovery-schema.d.ts +5 -0
  112. package/dist/lib/design-resource-recovery-schema.js +5 -0
  113. package/dist/lib/design-resource-recovery-shape.d.ts +10 -0
  114. package/dist/lib/design-resource-recovery-shape.js +184 -0
  115. package/dist/lib/design-resource-recovery-source-authority.d.ts +5 -0
  116. package/dist/lib/design-resource-recovery-source-authority.js +219 -0
  117. package/dist/lib/design-resource-recovery-text.d.ts +17 -0
  118. package/dist/lib/design-resource-recovery-text.js +186 -0
  119. package/dist/lib/design-resource-recovery-types.d.ts +197 -0
  120. package/dist/lib/design-resource-recovery-types.js +1 -0
  121. package/dist/lib/design-resource-recovery-writeback-policy.d.ts +5 -0
  122. package/dist/lib/design-resource-recovery-writeback-policy.js +326 -0
  123. package/dist/lib/design-resource-recovery-writeback-shape.d.ts +6 -0
  124. package/dist/lib/design-resource-recovery-writeback-shape.js +155 -0
  125. package/dist/lib/design-resource-recovery.d.ts +44 -0
  126. package/dist/lib/design-resource-recovery.js +216 -0
  127. package/dist/lib/design-resource-symbolic-applicability-authority.d.ts +7 -0
  128. package/dist/lib/design-resource-symbolic-applicability-authority.js +19 -0
  129. package/dist/lib/design-resource-symbolic-applicability-policy.d.ts +12 -0
  130. package/dist/lib/design-resource-symbolic-applicability-policy.js +79 -0
  131. package/dist/lib/design-resource-symbolic-applicability-profiles.d.ts +8 -0
  132. package/dist/lib/design-resource-symbolic-applicability-profiles.js +55 -0
  133. package/dist/lib/design-resource-symbolic-applicability-shape.d.ts +2 -0
  134. package/dist/lib/design-resource-symbolic-applicability-shape.js +76 -0
  135. package/dist/lib/design-resource-symbolic-applicability-validation.d.ts +7 -0
  136. package/dist/lib/design-resource-symbolic-applicability-validation.js +128 -0
  137. package/dist/lib/design-resource-symbolic-compilation.d.ts +3 -0
  138. package/dist/lib/design-resource-symbolic-compilation.js +13 -0
  139. package/dist/lib/design-resource-symbolic-denotation.d.ts +3 -0
  140. package/dist/lib/design-resource-symbolic-denotation.js +167 -0
  141. package/dist/lib/design-resource-symbolic-disposition-validation.d.ts +4 -0
  142. package/dist/lib/design-resource-symbolic-disposition-validation.js +28 -0
  143. package/dist/lib/design-resource-symbolic-fact-policy.d.ts +12 -0
  144. package/dist/lib/design-resource-symbolic-fact-policy.js +12 -0
  145. package/dist/lib/design-resource-symbolic-fact-shape.d.ts +3 -0
  146. package/dist/lib/design-resource-symbolic-fact-shape.js +138 -0
  147. package/dist/lib/design-resource-symbolic-fact-types.d.ts +213 -0
  148. package/dist/lib/design-resource-symbolic-fact-types.js +1 -0
  149. package/dist/lib/design-resource-symbolic-fact-validation.d.ts +3 -0
  150. package/dist/lib/design-resource-symbolic-fact-validation.js +86 -0
  151. package/dist/lib/design-resource-symbolic-indexes.d.ts +23 -0
  152. package/dist/lib/design-resource-symbolic-indexes.js +54 -0
  153. package/dist/lib/design-resource-symbolic-manifest-shape.d.ts +3 -0
  154. package/dist/lib/design-resource-symbolic-manifest-shape.js +155 -0
  155. package/dist/lib/design-resource-symbolic-manifest-validation.d.ts +6 -0
  156. package/dist/lib/design-resource-symbolic-manifest-validation.js +132 -0
  157. package/dist/lib/design-resource-symbolic-noninterference-artifact.d.ts +33 -0
  158. package/dist/lib/design-resource-symbolic-noninterference-artifact.js +110 -0
  159. package/dist/lib/design-resource-symbolic-noninterference-equivalence.d.ts +3 -0
  160. package/dist/lib/design-resource-symbolic-noninterference-equivalence.js +77 -0
  161. package/dist/lib/design-resource-symbolic-noninterference-recompute.d.ts +4 -0
  162. package/dist/lib/design-resource-symbolic-noninterference-recompute.js +146 -0
  163. package/dist/lib/design-resource-symbolic-noninterference-scope.d.ts +7 -0
  164. package/dist/lib/design-resource-symbolic-noninterference-scope.js +49 -0
  165. package/dist/lib/design-resource-symbolic-noninterference-shape.d.ts +2 -0
  166. package/dist/lib/design-resource-symbolic-noninterference-shape.js +152 -0
  167. package/dist/lib/design-resource-symbolic-noninterference-types.d.ts +103 -0
  168. package/dist/lib/design-resource-symbolic-noninterference-types.js +1 -0
  169. package/dist/lib/design-resource-symbolic-noninterference-validation.d.ts +5 -0
  170. package/dist/lib/design-resource-symbolic-noninterference-validation.js +62 -0
  171. package/dist/lib/design-resource-symbolic-oracle-fingerprint.d.ts +1 -0
  172. package/dist/lib/design-resource-symbolic-oracle-fingerprint.js +47 -0
  173. package/dist/lib/design-resource-symbolic-predicate-shape.d.ts +6 -0
  174. package/dist/lib/design-resource-symbolic-predicate-shape.js +123 -0
  175. package/dist/lib/design-resource-symbolic-production-closure.d.ts +4 -0
  176. package/dist/lib/design-resource-symbolic-production-closure.js +144 -0
  177. package/dist/lib/design-resource-symbolic-proof-authority-validation.d.ts +10 -0
  178. package/dist/lib/design-resource-symbolic-proof-authority-validation.js +68 -0
  179. package/dist/lib/design-resource-symbolic-proof-validation.d.ts +10 -0
  180. package/dist/lib/design-resource-symbolic-proof-validation.js +89 -0
  181. package/dist/lib/design-resource-symbolic-region-validation.d.ts +19 -0
  182. package/dist/lib/design-resource-symbolic-region-validation.js +146 -0
  183. package/dist/lib/design-resource-symbolic-resource-validation.d.ts +5 -0
  184. package/dist/lib/design-resource-symbolic-resource-validation.js +90 -0
  185. package/dist/lib/design-resource-symbolic-rule-shape.d.ts +27 -0
  186. package/dist/lib/design-resource-symbolic-rule-shape.js +158 -0
  187. package/dist/lib/design-resource-symbolic-safety-validation.d.ts +6 -0
  188. package/dist/lib/design-resource-symbolic-safety-validation.js +29 -0
  189. package/dist/lib/design-resource-symbolic-source-ir-evaluation.d.ts +19 -0
  190. package/dist/lib/design-resource-symbolic-source-ir-evaluation.js +74 -0
  191. package/dist/lib/design-resource-symbolic-source-ir-evidence.d.ts +44 -0
  192. package/dist/lib/design-resource-symbolic-source-ir-evidence.js +88 -0
  193. package/dist/lib/design-resource-symbolic-source-ir-oracle.d.ts +13 -0
  194. package/dist/lib/design-resource-symbolic-source-ir-oracle.js +96 -0
  195. package/dist/lib/design-resource-symbolic-source-ir-proof.d.ts +14 -0
  196. package/dist/lib/design-resource-symbolic-source-ir-proof.js +98 -0
  197. package/dist/lib/design-resource-symbolic-source-ir-shape.d.ts +2 -0
  198. package/dist/lib/design-resource-symbolic-source-ir-shape.js +38 -0
  199. package/dist/lib/design-resource-symbolic-source-ir-types.d.ts +17 -0
  200. package/dist/lib/design-resource-symbolic-source-ir-types.js +2 -0
  201. package/dist/lib/design-resource-symbolic-static-dependency-validation.d.ts +2 -0
  202. package/dist/lib/design-resource-symbolic-static-dependency-validation.js +83 -0
  203. package/dist/lib/design-resource-symbolic-structural-closure-validation.d.ts +6 -0
  204. package/dist/lib/design-resource-symbolic-structural-closure-validation.js +79 -0
  205. package/dist/lib/design-resource-symbolic-validation-support.d.ts +29 -0
  206. package/dist/lib/design-resource-symbolic-validation-support.js +111 -0
  207. package/dist/lib/design-resource-v1-capacity-header.d.ts +8 -0
  208. package/dist/lib/design-resource-v1-capacity-header.js +231 -0
  209. package/dist/lib/design-resource-v1-capacity.d.ts +5 -0
  210. package/dist/lib/design-resource-v1-capacity.js +45 -0
  211. package/dist/lib/init.js +1 -0
  212. package/dist/lib/long-task-acceptance-shape.js +8 -2
  213. package/dist/lib/long-task-activation-validation.js +13 -3
  214. package/dist/lib/long-task-admitted-observation-records.d.ts +25 -0
  215. package/dist/lib/long-task-admitted-observation-records.js +40 -0
  216. package/dist/lib/long-task-admitted-observation.d.ts +93 -0
  217. package/dist/lib/long-task-admitted-observation.js +201 -0
  218. package/dist/lib/long-task-artifacts.d.ts +1 -0
  219. package/dist/lib/long-task-artifacts.js +1 -0
  220. package/dist/lib/long-task-authority-material-diff.js +1 -0
  221. package/dist/lib/long-task-authority-policy.d.ts +5 -0
  222. package/dist/lib/long-task-authority-policy.js +5 -0
  223. package/dist/lib/long-task-authority-revision-details.js +3 -1
  224. package/dist/lib/long-task-authority.js +2 -1
  225. package/dist/lib/long-task-check-execution-policy.js +5 -0
  226. package/dist/lib/long-task-check-runner.d.ts +2 -2
  227. package/dist/lib/long-task-check-runner.js +440 -23
  228. package/dist/lib/long-task-claims.d.ts +18 -0
  229. package/dist/lib/long-task-claims.js +35 -0
  230. package/dist/lib/long-task-codex-agent-profile.d.ts +42 -0
  231. package/dist/lib/long-task-codex-agent-profile.js +276 -0
  232. package/dist/lib/long-task-compact-authoring-projections.d.ts +12 -0
  233. package/dist/lib/long-task-compact-authoring-projections.js +67 -0
  234. package/dist/lib/long-task-compact-authoring.d.ts +3 -0
  235. package/dist/lib/long-task-compact-authoring.js +173 -0
  236. package/dist/lib/long-task-compact-carrier.d.ts +7 -0
  237. package/dist/lib/long-task-compact-carrier.js +132 -0
  238. package/dist/lib/long-task-compact-parser.d.ts +14 -0
  239. package/dist/lib/long-task-compact-parser.js +123 -0
  240. package/dist/lib/long-task-compact-primitives.d.ts +22 -0
  241. package/dist/lib/long-task-compact-primitives.js +132 -0
  242. package/dist/lib/long-task-compact-projections.d.ts +4 -0
  243. package/dist/lib/long-task-compact-projections.js +153 -0
  244. package/dist/lib/long-task-compact-structure-targets.d.ts +2 -0
  245. package/dist/lib/long-task-compact-structure-targets.js +91 -0
  246. package/dist/lib/long-task-conformance-policy.js +3 -1
  247. package/dist/lib/long-task-counterfactual-claim-policy.d.ts +3 -4
  248. package/dist/lib/long-task-counterfactual-claim-policy.js +11 -3
  249. package/dist/lib/long-task-counterfactual-sandbox.d.ts +1 -1
  250. package/dist/lib/long-task-counterfactual-sandbox.js +8 -5
  251. package/dist/lib/long-task-counterfactual-types.d.ts +2 -0
  252. package/dist/lib/long-task-delivery-compiler.js +2 -0
  253. package/dist/lib/long-task-delivery-parser.d.ts +1 -0
  254. package/dist/lib/long-task-delivery-parser.js +38 -6
  255. package/dist/lib/long-task-design-resource-handoff.d.ts +2 -1
  256. package/dist/lib/long-task-design-resource-handoff.js +71 -11
  257. package/dist/lib/long-task-design-resource-method-binding.d.ts +8 -1
  258. package/dist/lib/long-task-design-resource-method-binding.js +150 -0
  259. package/dist/lib/long-task-evidence-capability-codec.js +256 -34
  260. package/dist/lib/long-task-evidence-capability-policy.d.ts +3 -2
  261. package/dist/lib/long-task-evidence-capability-policy.js +142 -8
  262. package/dist/lib/long-task-evidence-capability-runtime.d.ts +5 -2
  263. package/dist/lib/long-task-evidence-capability-runtime.js +420 -68
  264. package/dist/lib/long-task-evidence-capability-types.d.ts +70 -2
  265. package/dist/lib/long-task-evidence-sensitivity-policy.d.ts +9 -0
  266. package/dist/lib/long-task-evidence-sensitivity-policy.js +31 -1
  267. package/dist/lib/long-task-evidence-v2.d.ts +4 -4
  268. package/dist/lib/long-task-evidence-v2.js +322 -44
  269. package/dist/lib/long-task-exact-comparison.d.ts +16 -0
  270. package/dist/lib/long-task-exact-comparison.js +28 -0
  271. package/dist/lib/long-task-execution-observation.d.ts +24 -0
  272. package/dist/lib/long-task-execution-observation.js +332 -0
  273. package/dist/lib/long-task-explain-acceptance-link.d.ts +4 -0
  274. package/dist/lib/long-task-explain-acceptance-link.js +4 -0
  275. package/dist/lib/long-task-explain-claim-links.d.ts +2 -0
  276. package/dist/lib/long-task-explain-claim-links.js +2 -0
  277. package/dist/lib/long-task-explain-source-links.d.ts +6 -0
  278. package/dist/lib/long-task-final-v2.js +7 -4
  279. package/dist/lib/long-task-hook-install.d.ts +19 -2
  280. package/dist/lib/long-task-hook-install.js +288 -91
  281. package/dist/lib/long-task-json-pointer-observation.d.ts +59 -0
  282. package/dist/lib/long-task-json-pointer-observation.js +184 -0
  283. package/dist/lib/long-task-observation-artifact.d.ts +8 -0
  284. package/dist/lib/long-task-observation-artifact.js +58 -0
  285. package/dist/lib/long-task-observation-authority.d.ts +17 -0
  286. package/dist/lib/long-task-observation-authority.js +348 -0
  287. package/dist/lib/long-task-paths.js +1 -1
  288. package/dist/lib/long-task-playwright-capability-records.d.ts +2 -0
  289. package/dist/lib/long-task-playwright-capability-records.js +74 -2
  290. package/dist/lib/long-task-process-observation.d.ts +6 -0
  291. package/dist/lib/long-task-process-observation.js +117 -0
  292. package/dist/lib/long-task-process-runtime-closure.d.ts +13 -0
  293. package/dist/lib/long-task-process-runtime-closure.js +175 -0
  294. package/dist/lib/long-task-progress.js +2 -0
  295. package/dist/lib/long-task-protected-files.d.ts +1 -1
  296. package/dist/lib/long-task-protected-files.js +1 -30
  297. package/dist/lib/long-task-risk.js +8 -3
  298. package/dist/lib/long-task-root-shape.js +10 -1
  299. package/dist/lib/long-task-runner-environment.d.ts +1 -1
  300. package/dist/lib/long-task-runner-environment.js +4 -4
  301. package/dist/lib/long-task-runner-freeze.d.ts +4 -2
  302. package/dist/lib/long-task-runner-freeze.js +130 -28
  303. package/dist/lib/long-task-runtime-types.d.ts +111 -0
  304. package/dist/lib/long-task-scoped-binding.d.ts +13 -0
  305. package/dist/lib/long-task-scoped-binding.js +11 -0
  306. package/dist/lib/long-task-semantic-contract-types.d.ts +2 -1
  307. package/dist/lib/long-task-semantic-fact-binding-types.d.ts +8 -0
  308. package/dist/lib/long-task-semantic-fact-closure.js +4 -1
  309. package/dist/lib/long-task-semantic-fact-contract-closure.d.ts +1 -1
  310. package/dist/lib/long-task-semantic-fact-contract-closure.js +18 -6
  311. package/dist/lib/long-task-semantic-fact-contract-facts.d.ts +1 -1
  312. package/dist/lib/long-task-semantic-fact-contract-facts.js +4 -1
  313. package/dist/lib/long-task-semantic-fact-contract-proofs.d.ts +1 -1
  314. package/dist/lib/long-task-semantic-fact-contract-proofs.js +12 -3
  315. package/dist/lib/long-task-semantic-fact-evidence.d.ts +8 -4
  316. package/dist/lib/long-task-semantic-fact-evidence.js +103 -43
  317. package/dist/lib/long-task-semantic-fact-shape.js +17 -6
  318. package/dist/lib/long-task-shape-primitives.d.ts +1 -1
  319. package/dist/lib/long-task-shape-primitives.js +1 -0
  320. package/dist/lib/long-task-source-claim-validation.js +4 -1
  321. package/dist/lib/long-task-source-item-parser.d.ts +2 -2
  322. package/dist/lib/long-task-source-item-parser.js +20 -11
  323. package/dist/lib/long-task-source-target-continuity.d.ts +2 -2
  324. package/dist/lib/long-task-source-target-continuity.js +35 -2
  325. package/dist/lib/long-task-source-target-index.d.ts +3 -0
  326. package/dist/lib/long-task-source-target-index.js +19 -0
  327. package/dist/lib/long-task-stage-policy.js +10 -4
  328. package/dist/lib/long-task-static-observation-freeze.d.ts +83 -0
  329. package/dist/lib/long-task-static-observation-freeze.js +428 -0
  330. package/dist/lib/long-task-status-projection.js +5 -1
  331. package/dist/lib/long-task-target-policy.d.ts +1 -1
  332. package/dist/lib/long-task-target-policy.js +3 -0
  333. package/dist/lib/long-task-ui-design-policy.js +64 -4
  334. package/dist/lib/long-task-ui-surface-shape.js +195 -0
  335. package/dist/lib/long-task-ui-surface-types.d.ts +53 -0
  336. package/dist/lib/long-task-verifier-dependency-closure.js +7 -3
  337. package/dist/lib/long-task-verifier-v2.js +70 -9
  338. package/dist/lib/long-task-worker-selection.d.ts +2 -0
  339. package/dist/lib/long-task-worker-selection.js +7 -0
  340. package/dist/lib/long-task-workspace-scope.js +3 -1
  341. package/dist/lib/long-task-workspace.d.ts +1 -1
  342. package/dist/lib/long-task-workspace.js +12 -13
  343. package/dist/lib/migrations.js +58 -0
  344. package/dist/lib/profiles.js +0 -1
  345. package/dist/lib/repository-path-safety.d.ts +14 -0
  346. package/dist/lib/repository-path-safety.js +126 -0
  347. package/dist/lib/semantic-fact-compact-authoring.d.ts +2 -0
  348. package/dist/lib/semantic-fact-compact-authoring.js +160 -0
  349. package/dist/lib/semantic-fact-compact-capacity.d.ts +9 -0
  350. package/dist/lib/semantic-fact-compact-capacity.js +40 -0
  351. package/dist/lib/semantic-fact-compact-carrier.d.ts +16 -0
  352. package/dist/lib/semantic-fact-compact-carrier.js +146 -0
  353. package/dist/lib/semantic-fact-compact-parser.d.ts +17 -0
  354. package/dist/lib/semantic-fact-compact-parser.js +168 -0
  355. package/dist/lib/semantic-fact-compact-revision.d.ts +11 -0
  356. package/dist/lib/semantic-fact-compact-revision.js +64 -0
  357. package/dist/lib/semantic-fact-compact-support.d.ts +23 -0
  358. package/dist/lib/semantic-fact-compact-support.js +159 -0
  359. package/dist/lib/semantic-fact-policy-census.d.ts +1 -0
  360. package/dist/lib/semantic-fact-policy-census.js +43 -0
  361. package/dist/lib/semantic-fact-proof-shape.d.ts +1 -1
  362. package/dist/lib/semantic-fact-property-shape.d.ts +1 -1
  363. package/dist/lib/semantic-fact-source-parser.d.ts +5 -0
  364. package/dist/lib/semantic-fact-source-parser.js +47 -6
  365. package/dist/lib/structural-closure-cost.d.ts +79 -0
  366. package/dist/lib/structural-closure-cost.js +91 -0
  367. package/dist/lib/symbolic-denotation-dag-builder.d.ts +25 -0
  368. package/dist/lib/symbolic-denotation-dag-builder.js +176 -0
  369. package/dist/lib/symbolic-denotation-domain-validation.d.ts +3 -0
  370. package/dist/lib/symbolic-denotation-domain-validation.js +56 -0
  371. package/dist/lib/symbolic-denotation-engine.d.ts +32 -0
  372. package/dist/lib/symbolic-denotation-engine.js +140 -0
  373. package/dist/lib/symbolic-denotation-public.d.ts +11 -0
  374. package/dist/lib/symbolic-denotation-public.js +12 -0
  375. package/dist/lib/symbolic-denotation-runtime.d.ts +20 -0
  376. package/dist/lib/symbolic-denotation-runtime.js +90 -0
  377. package/dist/lib/symbolic-denotation-support.d.ts +11 -0
  378. package/dist/lib/symbolic-denotation-support.js +49 -0
  379. package/dist/lib/symbolic-denotation-types.d.ts +133 -0
  380. package/dist/lib/symbolic-denotation-types.js +18 -0
  381. package/dist/lib/symbolic-denotation-validation.d.ts +6 -0
  382. package/dist/lib/symbolic-denotation-validation.js +126 -0
  383. package/dist/lib/sync-engine.d.ts +1 -0
  384. package/dist/lib/sync-engine.js +4 -1
  385. package/dist/lib/upgrade.js +1 -0
  386. package/dist/long-task-hook.js +40 -1
  387. package/dist/public-types.d.ts +8 -0
  388. package/dist/public-types.js +1 -0
  389. package/dist/schemas/design-resource-symbolic-noninterference-artifact-v2.schema.json +289 -0
  390. package/dist/schemas/design-resource-symbolic-source-ir-v1.schema.json +130 -0
  391. package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +435 -5
  392. package/migrations/README.md +92 -15
  393. package/package.json +2 -2
  394. package/source-mappings.yaml +28 -25
  395. package/assets/skills/source-plan-authoring/SKILL.md +0 -14
@@ -0,0 +1,152 @@
1
+ import { nonnegativeInteger, sha256, stableKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
2
+ import { parseSymbolicPredicate } from "./design-resource-symbolic-predicate-shape.js";
3
+ import { array, literal, nullable, object, string, } from "./long-task-shape-primitives.js";
4
+ export function parseSymbolicNoninterferenceProof(value, label) {
5
+ const row = object(value, label, [
6
+ "side",
7
+ "method",
8
+ "input_resource_refs",
9
+ "oracle_ref",
10
+ "environment_ref",
11
+ "static_dependency_nodes",
12
+ "static_rule_roots",
13
+ "equivalence_cases",
14
+ "dynamic_dependency_kinds",
15
+ "external_device_refs",
16
+ "complete_domain_cardinality",
17
+ "oracle_version",
18
+ "oracle_implementation_sha256",
19
+ "oracle_capability",
20
+ "environment_sha256",
21
+ "input_snapshot_sha256",
22
+ "source_manifest_snapshot_sha256",
23
+ "target_snapshot_sha256",
24
+ "certificate_scope_sha256",
25
+ "rule_scope_sha256",
26
+ "omitted_axis_refs",
27
+ "method_result_sha256",
28
+ "artifact_resource_ref",
29
+ "artifact_path",
30
+ "artifact_sha256",
31
+ "failure_witness",
32
+ ]);
33
+ return {
34
+ side: literal(row.side, ["source", "production"], `${label}.side`),
35
+ method: literal(row.method, [
36
+ "closed_world_static_dependency_closure",
37
+ "restricted_ir_symbolic_equivalence",
38
+ "finite_complete_domain_exhaustive_equivalence",
39
+ ], `${label}.method`),
40
+ input_resource_refs: stableKeys(row.input_resource_refs, `${label}.input_resource_refs`),
41
+ oracle_ref: stableKey(row.oracle_ref, `${label}.oracle_ref`),
42
+ environment_ref: stableKey(row.environment_ref, `${label}.environment_ref`),
43
+ static_dependency_nodes: array(row.static_dependency_nodes, `${label}.static_dependency_nodes`).map((item, index) => parseStaticDependencyNode(item, `${label}.static_dependency_nodes[${index}]`)),
44
+ static_rule_roots: array(row.static_rule_roots, `${label}.static_rule_roots`).map((item, index) => parseStaticDependencyRoot(item, `${label}.static_rule_roots[${index}]`)),
45
+ equivalence_cases: array(row.equivalence_cases, `${label}.equivalence_cases`).map((item, index) => {
46
+ const itemLabel = `${label}.equivalence_cases[${index}]`;
47
+ const entry = object(item, itemLabel, [
48
+ "fact_rule_refs",
49
+ "side_predicate",
50
+ "axis_erased_predicate",
51
+ ]);
52
+ return {
53
+ fact_rule_refs: stableKeys(entry.fact_rule_refs, `${itemLabel}.fact_rule_refs`),
54
+ side_predicate: parseSymbolicPredicate(entry.side_predicate, `${itemLabel}.side_predicate`),
55
+ axis_erased_predicate: parseSymbolicPredicate(entry.axis_erased_predicate, `${itemLabel}.axis_erased_predicate`),
56
+ };
57
+ }),
58
+ dynamic_dependency_kinds: stableKeys(row.dynamic_dependency_kinds, `${label}.dynamic_dependency_kinds`),
59
+ external_device_refs: stableKeys(row.external_device_refs, `${label}.external_device_refs`),
60
+ complete_domain_cardinality: nullable(row.complete_domain_cardinality, (entry) => decimalCardinality(entry, `${label}.complete_domain_cardinality`)),
61
+ oracle_version: string(row.oracle_version, `${label}.oracle_version`),
62
+ oracle_implementation_sha256: sha256(row.oracle_implementation_sha256, `${label}.oracle_implementation_sha256`),
63
+ oracle_capability: string(row.oracle_capability, `${label}.oracle_capability`),
64
+ environment_sha256: sha256(row.environment_sha256, `${label}.environment_sha256`),
65
+ input_snapshot_sha256: sha256(row.input_snapshot_sha256, `${label}.input_snapshot_sha256`),
66
+ source_manifest_snapshot_sha256: nullable(row.source_manifest_snapshot_sha256, (entry) => sha256(entry, `${label}.source_manifest_snapshot_sha256`)),
67
+ target_snapshot_sha256: sha256(row.target_snapshot_sha256, `${label}.target_snapshot_sha256`),
68
+ certificate_scope_sha256: sha256(row.certificate_scope_sha256, `${label}.certificate_scope_sha256`),
69
+ rule_scope_sha256: sha256(row.rule_scope_sha256, `${label}.rule_scope_sha256`),
70
+ omitted_axis_refs: stableKeys(row.omitted_axis_refs, `${label}.omitted_axis_refs`),
71
+ method_result_sha256: sha256(row.method_result_sha256, `${label}.method_result_sha256`),
72
+ artifact_resource_ref: stableKey(row.artifact_resource_ref, `${label}.artifact_resource_ref`),
73
+ artifact_path: string(row.artifact_path, `${label}.artifact_path`),
74
+ artifact_sha256: sha256(row.artifact_sha256, `${label}.artifact_sha256`),
75
+ failure_witness: nullable(row.failure_witness, (entry) => parseFailureWitness(entry, `${label}.failure_witness`)),
76
+ };
77
+ }
78
+ function parseFailureWitness(value, label) {
79
+ const row = object(value, label, [
80
+ "kind",
81
+ "side",
82
+ "certificate_scope_sha256",
83
+ "axis_ref",
84
+ "fact_rule_ref",
85
+ "resource_ref",
86
+ "path",
87
+ "locator",
88
+ "node_ref",
89
+ "byte_offset",
90
+ "assignment",
91
+ "detail",
92
+ ]);
93
+ return {
94
+ kind: literal(row.kind, [
95
+ "omitted_axis_dependency",
96
+ "unsupported_dependency",
97
+ "source_rule_denotation_mismatch",
98
+ "complete_domain_counterexample",
99
+ ], `${label}.kind`),
100
+ side: literal(row.side, ["source", "production"], `${label}.side`),
101
+ certificate_scope_sha256: sha256(row.certificate_scope_sha256, `${label}.certificate_scope_sha256`),
102
+ axis_ref: nullable(row.axis_ref, (entry) => stableKey(entry, `${label}.axis_ref`)),
103
+ fact_rule_ref: nullable(row.fact_rule_ref, (entry) => stableKey(entry, `${label}.fact_rule_ref`)),
104
+ resource_ref: nullable(row.resource_ref, (entry) => stableKey(entry, `${label}.resource_ref`)),
105
+ path: nullable(row.path, (entry) => string(entry, `${label}.path`)),
106
+ locator: nullable(row.locator, (entry) => string(entry, `${label}.locator`)),
107
+ node_ref: nullable(row.node_ref, (entry) => stableKey(entry, `${label}.node_ref`)),
108
+ byte_offset: nullable(row.byte_offset, (entry) => nonnegativeInteger(entry, `${label}.byte_offset`)),
109
+ assignment: nullable(row.assignment, (entry) => parseAssignment(entry, `${label}.assignment`)),
110
+ detail: string(row.detail, `${label}.detail`),
111
+ };
112
+ }
113
+ function parseAssignment(value, label) {
114
+ if (!value || typeof value !== "object" || Array.isArray(value))
115
+ throw new Error(`${label}: must be an object`);
116
+ const result = {};
117
+ for (const [key, entry] of Object.entries(value)) {
118
+ stableKey(key, `${label}.key`);
119
+ if ((typeof entry !== "string" && typeof entry !== "number") ||
120
+ (typeof entry === "number" && !Number.isFinite(entry)))
121
+ throw new Error(`${label}.${key}: must be a finite scalar`);
122
+ result[key] = entry;
123
+ }
124
+ return result;
125
+ }
126
+ function parseStaticDependencyNode(value, label) {
127
+ const row = object(value, label, [
128
+ "key",
129
+ "axis_refs",
130
+ "dependency_refs",
131
+ "input_resource_refs",
132
+ ]);
133
+ return {
134
+ key: stableKey(row.key, `${label}.key`),
135
+ axis_refs: stableKeys(row.axis_refs, `${label}.axis_refs`),
136
+ dependency_refs: stableKeys(row.dependency_refs, `${label}.dependency_refs`),
137
+ input_resource_refs: stableKeys(row.input_resource_refs, `${label}.input_resource_refs`),
138
+ };
139
+ }
140
+ function parseStaticDependencyRoot(value, label) {
141
+ const row = object(value, label, ["fact_rule_refs", "node_ref"]);
142
+ return {
143
+ fact_rule_refs: nullable(row.fact_rule_refs, (entry) => stableKeys(entry, `${label}.fact_rule_refs`)),
144
+ node_ref: stableKey(row.node_ref, `${label}.node_ref`),
145
+ };
146
+ }
147
+ function decimalCardinality(value, label) {
148
+ const parsed = string(value, label);
149
+ if (!/^(?:0|[1-9][0-9]*)$/u.test(parsed))
150
+ throw new Error(`${label}: must be a canonical nonnegative decimal`);
151
+ return parsed;
152
+ }
@@ -0,0 +1,103 @@
1
+ import type { SymbolicDenotationPredicate, SymbolicDenotationScalar } from "./symbolic-denotation-types.js";
2
+ export interface DesignResourceSymbolicNoninterferenceCertificateV2 {
3
+ key: string;
4
+ fact_rule_refs: string[];
5
+ omitted_axis_refs: string[];
6
+ dependency_edge_refs: string[];
7
+ canonical_rule_dag_sha256: string;
8
+ source_noninterference_proof?: DesignResourceSymbolicNoninterferenceProofV2 | null;
9
+ production_noninterference_proof?: DesignResourceSymbolicNoninterferenceProofV2 | null;
10
+ }
11
+ export type DesignResourceSymbolicNoninterferenceProofMethodV2 = "closed_world_static_dependency_closure" | "restricted_ir_symbolic_equivalence" | "finite_complete_domain_exhaustive_equivalence";
12
+ export interface DesignResourceSymbolicNoninterferenceEquivalenceCaseV2 {
13
+ fact_rule_refs: string[];
14
+ side_predicate: SymbolicDenotationPredicate;
15
+ axis_erased_predicate: SymbolicDenotationPredicate;
16
+ }
17
+ export interface DesignResourceSymbolicStaticDependencyNodeV2 {
18
+ key: string;
19
+ axis_refs: string[];
20
+ dependency_refs: string[];
21
+ input_resource_refs: string[];
22
+ }
23
+ export interface DesignResourceSymbolicStaticDependencyRootV2 {
24
+ fact_rule_refs: string[] | null;
25
+ node_ref: string;
26
+ }
27
+ export interface DesignResourceSymbolicNoninterferenceFailureWitnessV1 {
28
+ kind: "omitted_axis_dependency" | "unsupported_dependency" | "source_rule_denotation_mismatch" | "complete_domain_counterexample";
29
+ side: "source" | "production";
30
+ certificate_scope_sha256: string;
31
+ axis_ref: string | null;
32
+ fact_rule_ref: string | null;
33
+ resource_ref: string | null;
34
+ path: string | null;
35
+ locator: string | null;
36
+ node_ref: string | null;
37
+ byte_offset: number | null;
38
+ assignment: Record<string, SymbolicDenotationScalar> | null;
39
+ detail: string;
40
+ }
41
+ export interface DesignResourceSymbolicNoninterferenceInputBindingV2 {
42
+ resource_ref: string;
43
+ path: string;
44
+ declared_sha256: string;
45
+ current_sha256: string;
46
+ }
47
+ export interface DesignResourceSymbolicNoninterferenceDerivedResultV2 {
48
+ source_ir_resource_ref: string | null;
49
+ static_dependency_nodes: DesignResourceSymbolicStaticDependencyNodeV2[];
50
+ static_rule_roots: DesignResourceSymbolicStaticDependencyRootV2[];
51
+ equivalence_cases: DesignResourceSymbolicNoninterferenceEquivalenceCaseV2[];
52
+ complete_domain_cardinality: string | null;
53
+ exhaustive_evaluation_sha256: string | null;
54
+ }
55
+ export interface DesignResourceSymbolicNoninterferenceArtifactV2 {
56
+ schema_version: "design-resource-symbolic-noninterference-artifact-v2";
57
+ side: "source" | "production";
58
+ method: DesignResourceSymbolicNoninterferenceProofMethodV2;
59
+ oracle_identity: string;
60
+ oracle_version: string;
61
+ oracle_implementation_sha256: string;
62
+ oracle_capability: string;
63
+ environment_sha256: string;
64
+ input_resources: DesignResourceSymbolicNoninterferenceInputBindingV2[];
65
+ input_snapshot_sha256: string;
66
+ source_manifest_snapshot_sha256: string | null;
67
+ target_snapshot_sha256: string;
68
+ certificate_scope_sha256: string;
69
+ rule_scope_sha256: string;
70
+ omitted_axis_refs: string[];
71
+ derived_result: DesignResourceSymbolicNoninterferenceDerivedResultV2;
72
+ method_result_sha256: string;
73
+ verdict: "passed" | "failed";
74
+ failure_witness: DesignResourceSymbolicNoninterferenceFailureWitnessV1 | null;
75
+ }
76
+ export interface DesignResourceSymbolicNoninterferenceProofV2 {
77
+ side: "source" | "production";
78
+ method: DesignResourceSymbolicNoninterferenceProofMethodV2;
79
+ input_resource_refs: string[];
80
+ oracle_ref: string;
81
+ environment_ref: string;
82
+ static_dependency_nodes: DesignResourceSymbolicStaticDependencyNodeV2[];
83
+ static_rule_roots: DesignResourceSymbolicStaticDependencyRootV2[];
84
+ equivalence_cases: DesignResourceSymbolicNoninterferenceEquivalenceCaseV2[];
85
+ dynamic_dependency_kinds: string[];
86
+ external_device_refs: string[];
87
+ complete_domain_cardinality: string | null;
88
+ oracle_version: string;
89
+ oracle_implementation_sha256: string;
90
+ oracle_capability: string;
91
+ environment_sha256: string;
92
+ input_snapshot_sha256: string;
93
+ source_manifest_snapshot_sha256: string | null;
94
+ target_snapshot_sha256: string;
95
+ certificate_scope_sha256: string;
96
+ rule_scope_sha256: string;
97
+ omitted_axis_refs: string[];
98
+ method_result_sha256: string;
99
+ artifact_resource_ref: string;
100
+ artifact_path: string;
101
+ artifact_sha256: string;
102
+ failure_witness: DesignResourceSymbolicNoninterferenceFailureWitnessV1 | null;
103
+ }
@@ -0,0 +1,5 @@
1
+ import type { DesignResourceSymbolicCompilationSession } from "./design-resource-symbolic-compilation.js";
2
+ import type { DesignResource } from "./design-resource-handoff-file-primitives.js";
3
+ import type { DesignResourceHandoffPreflightV2, DesignResourceObservableRuleManifestV2, DesignResourceSymbolicNoninterferenceCertificateV2 } from "./design-resource-symbolic-fact-types.js";
4
+ import type { SymbolicManifestIndexes } from "./design-resource-symbolic-indexes.js";
5
+ export declare function validateTrustedSymbolicNoninterference(manifest: DesignResourceObservableRuleManifestV2, certificate: DesignResourceSymbolicNoninterferenceCertificateV2, projections: DesignResourceHandoffPreflightV2["rule_projections"], indexes: SymbolicManifestIndexes, compilation: DesignResourceSymbolicCompilationSession, target: DesignResourceHandoffPreflightV2["handoff"]["targets"][number], resources: ReadonlyMap<string, DesignResource>, contents: ReadonlyMap<string, Buffer>): void;
@@ -0,0 +1,62 @@
1
+ import { DESIGN_RESOURCE_SYMBOLIC_NONINTERFERENCE_ORACLE_CAPABILITIES, } from "./design-resource-fact-enums.js";
2
+ import { validateSymbolicNoninterferenceEquivalence } from "./design-resource-symbolic-noninterference-equivalence.js";
3
+ import { validateStaticDependencyClosure } from "./design-resource-symbolic-static-dependency-validation.js";
4
+ import { validateSymbolicNoninterferenceArtifact } from "./design-resource-symbolic-noninterference-artifact.js";
5
+ import { assertSameSet, invalid, unique, } from "./design-resource-symbolic-validation-support.js";
6
+ export function validateTrustedSymbolicNoninterference(manifest, certificate, projections, indexes, compilation, target, resources, contents) {
7
+ if (!certificate.omitted_axis_refs.length) {
8
+ if (certificate.source_noninterference_proof != null ||
9
+ certificate.production_noninterference_proof != null)
10
+ invalid("v2_noninterference_proof_without_omission", certificate.key);
11
+ return;
12
+ }
13
+ const proofs = [
14
+ ["source", certificate.source_noninterference_proof],
15
+ ["production", certificate.production_noninterference_proof],
16
+ ];
17
+ for (const [side, proof] of proofs) {
18
+ if (!proof)
19
+ invalid("v2_noninterference_proof_unavailable", `${certificate.key}:${side}:${certificate.omitted_axis_refs.join(",")}`);
20
+ validateProof(side, proof, manifest, certificate, projections, indexes, compilation, target, resources, contents);
21
+ }
22
+ }
23
+ function validateProof(expectedSide, proof, manifest, certificate, projections, indexes, compilation, target, resources, contents) {
24
+ if (proof.side !== expectedSide)
25
+ invalid("v2_noninterference_proof_side_mismatch", `${certificate.key}:${expectedSide}:${proof.side}`);
26
+ assertSameSet(proof.input_resource_refs, manifest.inspector.input_resources.map((item) => item.resource_ref), "v2_noninterference_input_closure_mismatch", `${certificate.key}:${expectedSide}`);
27
+ if (!indexes.oracles.has(proof.oracle_ref))
28
+ invalid("v2_noninterference_oracle_unknown", proof.oracle_ref);
29
+ const oracle = indexes.oracles.get(proof.oracle_ref);
30
+ if (oracle.trust !== "frozen_executable" || oracle.sha256 === null)
31
+ invalid("v2_noninterference_frozen_oracle_required", proof.oracle_ref);
32
+ const requiredCapability = `symbolic_noninterference.${expectedSide}.${proof.method}`;
33
+ if (!isNoninterferenceOracleCapability(requiredCapability))
34
+ invalid("v2_noninterference_oracle_capability_unregistered", requiredCapability);
35
+ if (!oracle.capability_refs.includes(requiredCapability))
36
+ invalid("v2_noninterference_oracle_capability_missing", `${proof.oracle_ref}:${requiredCapability}`);
37
+ if (proof.oracle_capability !== requiredCapability)
38
+ invalid("v2_noninterference_oracle_capability_binding_mismatch", `${certificate.key}:${proof.oracle_capability}:${requiredCapability}`);
39
+ if (!indexes.environments.has(proof.environment_ref))
40
+ invalid("v2_noninterference_environment_unknown", proof.environment_ref);
41
+ if (proof.dynamic_dependency_kinds.length)
42
+ invalid("v2_noninterference_dynamic_dependency_unproved", `${certificate.key}:${proof.dynamic_dependency_kinds.join(",")}`);
43
+ if (proof.external_device_refs.length)
44
+ invalid("v2_noninterference_external_device_unproved", `${certificate.key}:${proof.external_device_refs.join(",")}`);
45
+ unique(proof.input_resource_refs, `v2_noninterference_input_duplicate:${certificate.key}:${expectedSide}`);
46
+ unique(proof.dynamic_dependency_kinds, `v2_noninterference_dynamic_dependency_duplicate:${certificate.key}:${expectedSide}`);
47
+ unique(proof.external_device_refs, `v2_noninterference_external_device_duplicate:${certificate.key}:${expectedSide}`);
48
+ assertSameSet(proof.omitted_axis_refs, certificate.omitted_axis_refs, "v2_noninterference_artifact_omitted_axis_mismatch", `${certificate.key}:${expectedSide}`);
49
+ if (expectedSide === "source") {
50
+ validateSymbolicNoninterferenceArtifact(manifest, certificate, proof, target, resources, contents);
51
+ return;
52
+ }
53
+ if (proof.method === "closed_world_static_dependency_closure") {
54
+ validateStaticDependencyClosure(proof, certificate, projections, manifest);
55
+ }
56
+ else
57
+ validateSymbolicNoninterferenceEquivalence(proof, manifest, certificate, projections, compilation);
58
+ validateSymbolicNoninterferenceArtifact(manifest, certificate, proof, target, resources, contents);
59
+ }
60
+ function isNoninterferenceOracleCapability(value) {
61
+ return DESIGN_RESOURCE_SYMBOLIC_NONINTERFERENCE_ORACLE_CAPABILITIES.includes(value);
62
+ }
@@ -0,0 +1 @@
1
+ export declare function fingerprintExecutableModuleClosure(entryUrls: readonly string[]): string;
@@ -0,0 +1,47 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ const LOCAL_MODULE_IMPORT = /(?:\bfrom\s*|\bimport\s*)["'](\.[^"']+\.js)["']/gu;
6
+ const DYNAMIC_MODULE_IMPORT = /\bimport\s*\(/gu;
7
+ const HIDDEN_LOCAL_LOADER = /\b(?:createRequire|require)\s*\(/gu;
8
+ export function fingerprintExecutableModuleClosure(entryUrls) {
9
+ const pending = [...new Set(entryUrls)].sort();
10
+ const seen = new Map();
11
+ while (pending.length) {
12
+ const url = pending.shift();
13
+ if (seen.has(url))
14
+ continue;
15
+ const bytes = readFileSync(fileURLToPath(url));
16
+ const source = bytes.toString("utf8");
17
+ if (DYNAMIC_MODULE_IMPORT.test(source))
18
+ throw new Error(`symbolic Oracle implementation uses dynamic import: ${url}`);
19
+ DYNAMIC_MODULE_IMPORT.lastIndex = 0;
20
+ if (HIDDEN_LOCAL_LOADER.test(source))
21
+ throw new Error(`symbolic Oracle implementation uses a hidden local loader: ${url}`);
22
+ HIDDEN_LOCAL_LOADER.lastIndex = 0;
23
+ seen.set(url, bytes);
24
+ for (const specifier of localModuleImports(source)) {
25
+ const dependencyUrl = new URL(specifier, url).href;
26
+ if (!seen.has(dependencyUrl))
27
+ pending.push(dependencyUrl);
28
+ }
29
+ pending.sort();
30
+ }
31
+ const commonRoot = path.dirname(fileURLToPath([...seen.keys()].sort()[0] ?? entryUrls[0]));
32
+ const entries = [...seen.entries()]
33
+ .map(([url, bytes]) => ({
34
+ path: path
35
+ .relative(commonRoot, fileURLToPath(url))
36
+ .replaceAll(path.sep, "/"),
37
+ sha256: createHash("sha256").update(bytes).digest("hex"),
38
+ }))
39
+ .sort((left, right) => left.path.localeCompare(right.path, "en"));
40
+ return createHash("sha256").update(JSON.stringify(entries)).digest("hex");
41
+ }
42
+ function localModuleImports(source) {
43
+ const result = [];
44
+ for (const match of source.matchAll(LOCAL_MODULE_IMPORT))
45
+ result.push(match[1]);
46
+ return result;
47
+ }
@@ -0,0 +1,6 @@
1
+ import type { SymbolicDenotationAxisDomain, SymbolicDenotationPredicate } from "./symbolic-denotation-types.js";
2
+ export declare function parseSymbolicAxisDomains(value: unknown, label: string): SymbolicDenotationAxisDomain[];
3
+ export declare function parseSymbolicPredicate(value: unknown, label: string): SymbolicDenotationPredicate;
4
+ export declare function parseSymbolicScalar(value: unknown, label: string): string | number;
5
+ export declare function parseSymbolicSafeInteger(value: unknown, label: string): number;
6
+ export declare function parseSymbolicNonnegativeInteger(value: unknown, label: string): number;
@@ -0,0 +1,123 @@
1
+ import { stableKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
2
+ import { array, boolean, literal, object, } from "./long-task-shape-primitives.js";
3
+ export function parseSymbolicAxisDomains(value, label) {
4
+ return array(value, label).map((item, index) => {
5
+ const itemLabel = `${label}[${index}]`;
6
+ const kindValue = object(item, itemLabel, ["key", "kind"], ["values", "minimum", "maximum", "integer"]).kind;
7
+ if (kindValue === "enum") {
8
+ const row = object(item, itemLabel, ["key", "kind", "values"]);
9
+ return {
10
+ key: stableKey(row.key, `${itemLabel}.key`),
11
+ kind: literal(row.kind, ["enum"], `${itemLabel}.kind`),
12
+ values: stableKeys(row.values, `${itemLabel}.values`),
13
+ };
14
+ }
15
+ const row = object(item, itemLabel, [
16
+ "key",
17
+ "kind",
18
+ "minimum",
19
+ "maximum",
20
+ "integer",
21
+ ]);
22
+ return {
23
+ key: stableKey(row.key, `${itemLabel}.key`),
24
+ kind: literal(row.kind, ["bounded_number"], `${itemLabel}.kind`),
25
+ minimum: parseSymbolicSafeInteger(row.minimum, `${itemLabel}.minimum`),
26
+ maximum: parseSymbolicSafeInteger(row.maximum, `${itemLabel}.maximum`),
27
+ integer: parseLiteralBooleanTrue(row.integer, `${itemLabel}.integer`),
28
+ };
29
+ });
30
+ }
31
+ export function parseSymbolicPredicate(value, label) {
32
+ const operator = object(value, label, ["op"], [
33
+ "axis_ref",
34
+ "value",
35
+ "values",
36
+ "minimum",
37
+ "maximum",
38
+ "minimum_inclusive",
39
+ "maximum_inclusive",
40
+ "predicates",
41
+ "predicate",
42
+ ]).op;
43
+ if (operator === "eq")
44
+ return parseEquality(value, label);
45
+ if (operator === "in")
46
+ return parseMembership(value, label);
47
+ if (operator === "range")
48
+ return parseRange(value, label);
49
+ if (operator === "all" || operator === "any")
50
+ return parseGroup(value, label);
51
+ if (operator === "not")
52
+ return parseNegation(value, label);
53
+ throw new Error(`design_resource_symbolic_manifest_invalid:${label}.op:unknown:${String(operator)}`);
54
+ }
55
+ function parseEquality(value, label) {
56
+ const row = object(value, label, ["op", "axis_ref", "value"]);
57
+ return {
58
+ op: "eq",
59
+ axis_ref: stableKey(row.axis_ref, `${label}.axis_ref`),
60
+ value: parseSymbolicScalar(row.value, `${label}.value`),
61
+ };
62
+ }
63
+ function parseMembership(value, label) {
64
+ const row = object(value, label, ["op", "axis_ref", "values"]);
65
+ return {
66
+ op: "in",
67
+ axis_ref: stableKey(row.axis_ref, `${label}.axis_ref`),
68
+ values: array(row.values, `${label}.values`).map((entry, index) => parseSymbolicScalar(entry, `${label}.values[${index}]`)),
69
+ };
70
+ }
71
+ function parseRange(value, label) {
72
+ const row = object(value, label, [
73
+ "op",
74
+ "axis_ref",
75
+ "minimum",
76
+ "maximum",
77
+ "minimum_inclusive",
78
+ "maximum_inclusive",
79
+ ]);
80
+ return {
81
+ op: "range",
82
+ axis_ref: stableKey(row.axis_ref, `${label}.axis_ref`),
83
+ minimum: parseSymbolicSafeInteger(row.minimum, `${label}.minimum`),
84
+ maximum: parseSymbolicSafeInteger(row.maximum, `${label}.maximum`),
85
+ minimum_inclusive: boolean(row.minimum_inclusive, `${label}.minimum_inclusive`),
86
+ maximum_inclusive: boolean(row.maximum_inclusive, `${label}.maximum_inclusive`),
87
+ };
88
+ }
89
+ function parseGroup(value, label) {
90
+ const row = object(value, label, ["op", "predicates"]);
91
+ return {
92
+ op: literal(row.op, ["all", "any"], `${label}.op`),
93
+ predicates: array(row.predicates, `${label}.predicates`).map((entry, index) => parseSymbolicPredicate(entry, `${label}.predicates[${index}]`)),
94
+ };
95
+ }
96
+ function parseNegation(value, label) {
97
+ const row = object(value, label, ["op", "predicate"]);
98
+ return {
99
+ op: "not",
100
+ predicate: parseSymbolicPredicate(row.predicate, `${label}.predicate`),
101
+ };
102
+ }
103
+ export function parseSymbolicScalar(value, label) {
104
+ if (typeof value === "string")
105
+ return stableKey(value, label);
106
+ return parseSymbolicSafeInteger(value, label);
107
+ }
108
+ export function parseSymbolicSafeInteger(value, label) {
109
+ if (typeof value !== "number" || !Number.isSafeInteger(value))
110
+ throw new Error(`design_resource_symbolic_manifest_invalid:${label}:safe_integer_required`);
111
+ return value;
112
+ }
113
+ export function parseSymbolicNonnegativeInteger(value, label) {
114
+ const parsed = parseSymbolicSafeInteger(value, label);
115
+ if (parsed < 0)
116
+ throw new Error(`design_resource_symbolic_manifest_invalid:${label}:nonnegative_required`);
117
+ return parsed;
118
+ }
119
+ function parseLiteralBooleanTrue(value, label) {
120
+ if (boolean(value, label) !== true)
121
+ throw new Error(`design_resource_symbolic_manifest_invalid:${label}:must_be_true`);
122
+ return true;
123
+ }
@@ -0,0 +1,4 @@
1
+ import { Buffer } from "node:buffer";
2
+ import type { DesignResource } from "./design-resource-handoff-file-primitives.js";
3
+ import type { DesignResourceSymbolicHandoffTargetV2, DesignResourceSymbolicNoninterferenceCertificateV2, DesignResourceSymbolicNoninterferenceFailureWitnessV1 } from "./design-resource-symbolic-fact-types.js";
4
+ export declare function productionClosureFailure(target: DesignResourceSymbolicHandoffTargetV2, certificate: DesignResourceSymbolicNoninterferenceCertificateV2, resources: ReadonlyMap<string, DesignResource>, contents: ReadonlyMap<string, Buffer>): DesignResourceSymbolicNoninterferenceFailureWitnessV1 | null;
@@ -0,0 +1,144 @@
1
+ import { Buffer } from "node:buffer";
2
+ import { symbolicNoninterferenceCertificateScopeSha256 } from "./design-resource-symbolic-noninterference-scope.js";
3
+ import { DESIGN_RESOURCE_SYMBOLIC_SOURCE_IR_MEDIA_TYPE } from "./design-resource-symbolic-source-ir-types.js";
4
+ import { canonicalJson } from "./strict-codec.js";
5
+ const SAFE_STATIC_HTML_TAGS = new Set([
6
+ "article",
7
+ "aside",
8
+ "body",
9
+ "br",
10
+ "div",
11
+ "footer",
12
+ "h1",
13
+ "h2",
14
+ "h3",
15
+ "h4",
16
+ "h5",
17
+ "h6",
18
+ "head",
19
+ "header",
20
+ "html",
21
+ "li",
22
+ "main",
23
+ "nav",
24
+ "ol",
25
+ "p",
26
+ "section",
27
+ "span",
28
+ "strong",
29
+ "ul",
30
+ ]);
31
+ const SAFE_STATIC_HTML_ATTRIBUTE = /^(?:aria-[a-z0-9-]+|class|data-[a-z0-9-]+|dir|id|lang|role|title)$/u;
32
+ const HTML_TOKEN = /<!doctype\s+html\s*>|<\/?[A-Za-z][A-Za-z0-9]*\b[^<>]*>/giu;
33
+ const HTML_TAG = /^<(\/)?([A-Za-z][A-Za-z0-9]*)([^<>]*)>$/u;
34
+ const HTML_ATTRIBUTE = /\s+([A-Za-z_:][A-Za-z0-9_.:-]*)(?:\s*=\s*(?:"[^"]*"|'[^']*'))?/guy;
35
+ export function productionClosureFailure(target, certificate, resources, contents) {
36
+ for (const resourceRef of target.resource_refs) {
37
+ const resource = resources.get(resourceRef);
38
+ const bytes = contents.get(resourceRef);
39
+ if (!resource || !bytes)
40
+ continue;
41
+ if (resourceRef === target.source_profile.entry_resource_ref) {
42
+ if (resource.media_type !== "text/html")
43
+ return witness(certificate, resource, null, `unsupported_entry_media:${resource.media_type}`);
44
+ const failure = staticHtmlFailure(bytes.toString("utf8"));
45
+ if (failure)
46
+ return witness(certificate, resource, failure.offset, failure.detail, bytes.toString("utf8"));
47
+ continue;
48
+ }
49
+ if (resource.media_type !== "application/json" &&
50
+ resource.media_type !== DESIGN_RESOURCE_SYMBOLIC_SOURCE_IR_MEDIA_TYPE)
51
+ return witness(certificate, resource, null, `unsupported_dependency_media:${resource.media_type}`);
52
+ try {
53
+ const parsed = JSON.parse(bytes.toString("utf8"));
54
+ if (resource.media_type === DESIGN_RESOURCE_SYMBOLIC_SOURCE_IR_MEDIA_TYPE &&
55
+ canonicalJson(parsed) !== bytes.toString("utf8"))
56
+ return witness(certificate, resource, null, "noncanonical_symbolic_source_ir");
57
+ }
58
+ catch {
59
+ return witness(certificate, resource, null, "invalid_inert_json");
60
+ }
61
+ }
62
+ return null;
63
+ }
64
+ function staticHtmlFailure(source) {
65
+ let cursor = 0;
66
+ let doctypeSeen = false;
67
+ for (const match of source.matchAll(HTML_TOKEN)) {
68
+ const token = match[0];
69
+ const offset = match.index;
70
+ if (source.slice(cursor, offset).includes("<"))
71
+ return {
72
+ offset: cursor + source.slice(cursor, offset).indexOf("<"),
73
+ detail: "unsupported_html_token",
74
+ };
75
+ cursor = offset + token.length;
76
+ if (/^<!doctype/iu.test(token)) {
77
+ if (doctypeSeen || source.slice(0, offset).trim())
78
+ return { offset, detail: "misplaced_or_duplicate_doctype" };
79
+ doctypeSeen = true;
80
+ continue;
81
+ }
82
+ const parsed = HTML_TAG.exec(token);
83
+ if (!parsed)
84
+ return { offset, detail: "unsupported_html_token" };
85
+ const closing = parsed[1] === "/";
86
+ const tag = parsed[2].toLowerCase();
87
+ if (!SAFE_STATIC_HTML_TAGS.has(tag))
88
+ return { offset, detail: `unsupported_html_tag:${tag}` };
89
+ const attributes = parsed[3];
90
+ if (closing) {
91
+ if (attributes.trim())
92
+ return { offset, detail: "closing_tag_attributes" };
93
+ continue;
94
+ }
95
+ const attributeFailure = staticAttributeFailure(attributes);
96
+ if (attributeFailure)
97
+ return {
98
+ offset: offset + token.indexOf(attributes) + attributeFailure.offset,
99
+ detail: attributeFailure.detail,
100
+ };
101
+ }
102
+ const remainder = source.slice(cursor);
103
+ if (remainder.includes("<"))
104
+ return {
105
+ offset: cursor + remainder.indexOf("<"),
106
+ detail: "unsupported_html_token",
107
+ };
108
+ return null;
109
+ }
110
+ function staticAttributeFailure(source) {
111
+ const value = source.endsWith("/") ? source.slice(0, -1) : source;
112
+ let cursor = 0;
113
+ HTML_ATTRIBUTE.lastIndex = 0;
114
+ while (cursor < value.length) {
115
+ HTML_ATTRIBUTE.lastIndex = cursor;
116
+ const match = HTML_ATTRIBUTE.exec(value);
117
+ if (!match || match.index !== cursor)
118
+ return { offset: cursor, detail: "unsupported_html_attribute_syntax" };
119
+ const name = match[1].toLowerCase();
120
+ if (!SAFE_STATIC_HTML_ATTRIBUTE.test(name))
121
+ return { offset: cursor, detail: `unsupported_html_attribute:${name}` };
122
+ cursor = HTML_ATTRIBUTE.lastIndex;
123
+ }
124
+ return null;
125
+ }
126
+ function witness(certificate, resource, byteOffset, detail, source = "") {
127
+ const axisRef = certificate.omitted_axis_refs.find((axis) => source.includes(axis));
128
+ return {
129
+ kind: axisRef ? "omitted_axis_dependency" : "unsupported_dependency",
130
+ side: "production",
131
+ certificate_scope_sha256: symbolicNoninterferenceCertificateScopeSha256(certificate),
132
+ axis_ref: axisRef ?? null,
133
+ fact_rule_ref: null,
134
+ resource_ref: resource.key,
135
+ path: resource.path,
136
+ locator: null,
137
+ node_ref: null,
138
+ byte_offset: byteOffset === null
139
+ ? null
140
+ : Buffer.byteLength(source.slice(0, byteOffset)),
141
+ assignment: null,
142
+ detail,
143
+ };
144
+ }