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
@@ -1,6 +1,7 @@
1
1
  import { DESIGN_RESOURCE_VERIFICATION_METHODS } from "./design-resource-handoff-types.js";
2
2
  import { DESIGN_RESOURCE_COMPARATORS } from "./design-resource-fact-manifest-types.js";
3
3
  import { parseDesignResourceLocatedDigest } from "./design-resource-fact-shape-primitives.js";
4
+ import { nonnegativeInteger } from "./design-resource-handoff-shape-primitives.js";
4
5
  import { EXECUTION_TARGET_CAPABILITIES } from "./execution-target-capabilities.js";
5
6
  import { array, fail, key, literal, nullable, object, repositoryFile, repositoryFiles, string, strings, } from "./long-task-shape-primitives.js";
6
7
  export function parseSurfaceBindings(value, label) {
@@ -46,9 +47,17 @@ function parseDesignTargets(value, label) {
46
47
  "verification_method_bindings",
47
48
  "actual_artifact_path",
48
49
  "comparison_artifact_path",
50
+ ], [
51
+ "fact_model",
52
+ "symbolic_method_bindings",
53
+ "symbolic_certificate_binding",
49
54
  ]);
55
+ const factModel = row.fact_model === undefined
56
+ ? undefined
57
+ : literal(row.fact_model, ["symbolic_rules_v2"], `${itemLabel}.fact_model`);
50
58
  return {
51
59
  key: key(row.key, `${itemLabel}.key`),
60
+ ...(factModel ? { fact_model: factModel } : {}),
52
61
  interpretation: literal(row.interpretation, ["exact_target", "constraint"], `${itemLabel}.interpretation`),
53
62
  source_paths: repositoryFiles(row.source_paths, `${itemLabel}.source_paths`),
54
63
  condition_keys: keys(row.condition_keys, `${itemLabel}.condition_keys`),
@@ -56,11 +65,197 @@ function parseDesignTargets(value, label) {
56
65
  conformance_check_ref: key(row.conformance_check_ref, `${itemLabel}.conformance_check_ref`),
57
66
  conformance_assertion_ref: key(row.conformance_assertion_ref, `${itemLabel}.conformance_assertion_ref`),
58
67
  verification_method_bindings: parseVerificationMethodBindings(row.verification_method_bindings, `${itemLabel}.verification_method_bindings`),
68
+ ...(row.symbolic_method_bindings === undefined
69
+ ? {}
70
+ : {
71
+ symbolic_method_bindings: parseSymbolicMethodBindings(row.symbolic_method_bindings, `${itemLabel}.symbolic_method_bindings`),
72
+ }),
73
+ ...(row.symbolic_certificate_binding === undefined
74
+ ? {}
75
+ : {
76
+ symbolic_certificate_binding: parseSymbolicCertificateBinding(row.symbolic_certificate_binding, `${itemLabel}.symbolic_certificate_binding`),
77
+ }),
59
78
  actual_artifact_path: repositoryFile(row.actual_artifact_path, `${itemLabel}.actual_artifact_path`),
60
79
  comparison_artifact_path: repositoryFile(row.comparison_artifact_path, `${itemLabel}.comparison_artifact_path`),
61
80
  };
62
81
  });
63
82
  }
83
+ function parseSymbolicMethodBindings(value, label) {
84
+ return array(value, label).map((item, index) => {
85
+ const itemLabel = `${label}[${index}]`;
86
+ const row = object(item, itemLabel, [
87
+ "method",
88
+ "assertion_ref",
89
+ "artifact_path",
90
+ "observation_path",
91
+ "rule_expectations",
92
+ ]);
93
+ return {
94
+ method: literal(row.method, DESIGN_RESOURCE_VERIFICATION_METHODS, `${itemLabel}.method`),
95
+ assertion_ref: key(row.assertion_ref, `${itemLabel}.assertion_ref`),
96
+ artifact_path: repositoryFile(row.artifact_path, `${itemLabel}.artifact_path`),
97
+ observation_path: repositoryFile(row.observation_path, `${itemLabel}.observation_path`),
98
+ rule_expectations: array(row.rule_expectations, `${itemLabel}.rule_expectations`).map((expectation, expectationIndex) => parseSymbolicRuleExpectation(expectation, `${itemLabel}.rule_expectations[${expectationIndex}]`)),
99
+ };
100
+ });
101
+ }
102
+ function parseSymbolicRuleExpectation(value, label) {
103
+ const row = object(value, label, [
104
+ "obligation_ref",
105
+ "fact_rule_ref",
106
+ "region_sha256",
107
+ "subject_or_relation_ref",
108
+ "property_ref",
109
+ "population_ref",
110
+ "quantifier",
111
+ "observation_sensitivity",
112
+ "expected",
113
+ "proof_surface",
114
+ "observation_boundary",
115
+ "comparison",
116
+ "oracle",
117
+ "environment",
118
+ "protected_value_policy",
119
+ "completion_effect",
120
+ ]);
121
+ const comparison = object(row.comparison, `${label}.comparison`, [
122
+ "comparator",
123
+ "mode",
124
+ "parameters",
125
+ "tolerance",
126
+ "mask",
127
+ ]);
128
+ const comparator = string(comparison.comparator, `${label}.comparison.comparator`);
129
+ if (!DESIGN_RESOURCE_COMPARATORS.includes(comparator) &&
130
+ !/^custom\.[a-z0-9][a-z0-9._-]*$/u.test(comparator))
131
+ fail(`${label}.comparison.comparator`, "must be a standard comparator or custom.*");
132
+ const oracle = object(row.oracle, `${label}.oracle`, [
133
+ "key",
134
+ "trust",
135
+ "identity",
136
+ "version",
137
+ "sha256",
138
+ ]);
139
+ const environment = object(row.environment, `${label}.environment`, [
140
+ "key",
141
+ "identity",
142
+ "definition",
143
+ ]);
144
+ const quantifier = object(row.quantifier, `${label}.quantifier`, [
145
+ "kind",
146
+ "minimum",
147
+ "maximum",
148
+ ]);
149
+ return {
150
+ obligation_ref: designFactRef(row.obligation_ref, `${label}.obligation_ref`),
151
+ fact_rule_ref: designFactRef(row.fact_rule_ref, `${label}.fact_rule_ref`),
152
+ region_sha256: digest(row.region_sha256, `${label}.region_sha256`),
153
+ subject_or_relation_ref: designFactRef(row.subject_or_relation_ref, `${label}.subject_or_relation_ref`),
154
+ property_ref: designFactRef(row.property_ref, `${label}.property_ref`),
155
+ population_ref: nullable(row.population_ref, (entry) => designFactRef(entry, `${label}.population_ref`)),
156
+ quantifier: {
157
+ kind: literal(quantifier.kind, [
158
+ "one",
159
+ "all",
160
+ "any",
161
+ "none",
162
+ "exactly",
163
+ "at_least",
164
+ "at_most",
165
+ "range",
166
+ ], `${label}.quantifier.kind`),
167
+ minimum: nullable(quantifier.minimum, (entry) => nonnegativeInteger(entry, `${label}.quantifier.minimum`)),
168
+ maximum: nullable(quantifier.maximum, (entry) => nonnegativeInteger(entry, `${label}.quantifier.maximum`)),
169
+ },
170
+ observation_sensitivity: literal(row.observation_sensitivity, ["plain", "protected"], `${label}.observation_sensitivity`),
171
+ expected: parseDesignResourceLocatedDigest(row.expected, `${label}.expected`),
172
+ proof_surface: string(row.proof_surface, `${label}.proof_surface`),
173
+ observation_boundary: string(row.observation_boundary, `${label}.observation_boundary`),
174
+ comparison: {
175
+ comparator,
176
+ mode: literal(comparison.mode, ["exact", "tolerance"], `${label}.comparison.mode`),
177
+ parameters: parseDesignResourceLocatedDigest(comparison.parameters, `${label}.comparison.parameters`),
178
+ tolerance: nullable(comparison.tolerance, (entry) => parseDesignResourceLocatedDigest(entry, `${label}.comparison.tolerance`)),
179
+ mask: nullable(comparison.mask, (entry) => parseDesignResourceLocatedDigest(entry, `${label}.comparison.mask`)),
180
+ },
181
+ oracle: {
182
+ key: designFactRef(oracle.key, `${label}.oracle.key`),
183
+ trust: literal(oracle.trust, ["frozen_executable", "named_external_tcb"], `${label}.oracle.trust`),
184
+ identity: string(oracle.identity, `${label}.oracle.identity`),
185
+ version: string(oracle.version, `${label}.oracle.version`),
186
+ sha256: nullable(oracle.sha256, (entry) => digest(entry, `${label}.oracle.sha256`)),
187
+ },
188
+ environment: {
189
+ key: designFactRef(environment.key, `${label}.environment.key`),
190
+ identity: string(environment.identity, `${label}.environment.identity`),
191
+ definition: parseDesignResourceLocatedDigest(environment.definition, `${label}.environment.definition`),
192
+ },
193
+ protected_value_policy: string(row.protected_value_policy, `${label}.protected_value_policy`),
194
+ completion_effect: string(row.completion_effect, `${label}.completion_effect`),
195
+ };
196
+ }
197
+ function parseSymbolicCertificateBinding(value, label) {
198
+ const row = object(value, label, [
199
+ "assertion_ref",
200
+ "artifact_path",
201
+ "expectations",
202
+ "metrics",
203
+ ]);
204
+ const metrics = object(row.metrics, `${label}.metrics`, [
205
+ "semantic_obligations",
206
+ "certificate_obligations",
207
+ "certificate_covered_omitted_axes",
208
+ "certificate_covered_dependency_edges",
209
+ "canonical_dag_nodes",
210
+ "canonical_partition_edges",
211
+ "canonical_bytes",
212
+ "theoretical_ground_cardinality",
213
+ ]);
214
+ return {
215
+ assertion_ref: key(row.assertion_ref, `${label}.assertion_ref`),
216
+ artifact_path: repositoryFile(row.artifact_path, `${label}.artifact_path`),
217
+ expectations: array(row.expectations, `${label}.expectations`).map((item, index) => {
218
+ const itemLabel = `${label}.expectations[${index}]`;
219
+ const expectation = object(item, itemLabel, [
220
+ "certificate_ref",
221
+ "fact_rule_refs",
222
+ "omitted_axis_refs",
223
+ "dependency_edge_refs",
224
+ "canonical_rule_dag_sha256",
225
+ ], [
226
+ "source_noninterference_proof_sha256",
227
+ "production_noninterference_proof_sha256",
228
+ ]);
229
+ return {
230
+ certificate_ref: designFactRef(expectation.certificate_ref, `${itemLabel}.certificate_ref`),
231
+ fact_rule_refs: designFactRefs(expectation.fact_rule_refs, `${itemLabel}.fact_rule_refs`),
232
+ omitted_axis_refs: designFactRefs(expectation.omitted_axis_refs, `${itemLabel}.omitted_axis_refs`),
233
+ dependency_edge_refs: designFactRefs(expectation.dependency_edge_refs, `${itemLabel}.dependency_edge_refs`),
234
+ canonical_rule_dag_sha256: digest(expectation.canonical_rule_dag_sha256, `${itemLabel}.canonical_rule_dag_sha256`),
235
+ ...(expectation.source_noninterference_proof_sha256 === undefined
236
+ ? {}
237
+ : {
238
+ source_noninterference_proof_sha256: digest(expectation.source_noninterference_proof_sha256, `${itemLabel}.source_noninterference_proof_sha256`),
239
+ }),
240
+ ...(expectation.production_noninterference_proof_sha256 === undefined
241
+ ? {}
242
+ : {
243
+ production_noninterference_proof_sha256: digest(expectation.production_noninterference_proof_sha256, `${itemLabel}.production_noninterference_proof_sha256`),
244
+ }),
245
+ };
246
+ }),
247
+ metrics: {
248
+ semantic_obligations: nonnegativeInteger(metrics.semantic_obligations, `${label}.metrics.semantic_obligations`),
249
+ certificate_obligations: nonnegativeInteger(metrics.certificate_obligations, `${label}.metrics.certificate_obligations`),
250
+ certificate_covered_omitted_axes: nonnegativeInteger(metrics.certificate_covered_omitted_axes, `${label}.metrics.certificate_covered_omitted_axes`),
251
+ certificate_covered_dependency_edges: nonnegativeInteger(metrics.certificate_covered_dependency_edges, `${label}.metrics.certificate_covered_dependency_edges`),
252
+ canonical_dag_nodes: nonnegativeInteger(metrics.canonical_dag_nodes, `${label}.metrics.canonical_dag_nodes`),
253
+ canonical_partition_edges: nonnegativeInteger(metrics.canonical_partition_edges, `${label}.metrics.canonical_partition_edges`),
254
+ canonical_bytes: nonnegativeInteger(metrics.canonical_bytes, `${label}.metrics.canonical_bytes`),
255
+ theoretical_ground_cardinality: string(metrics.theoretical_ground_cardinality, `${label}.metrics.theoretical_ground_cardinality`),
256
+ },
257
+ };
258
+ }
64
259
  function parseAcceptanceBlockers(value, label) {
65
260
  return array(value, label).map((item, index) => {
66
261
  const itemLabel = `${label}[${index}]`;
@@ -1,6 +1,7 @@
1
1
  import type { DesignResourceVerificationMethod } from "./design-resource-handoff-types.js";
2
2
  import type { DesignResourceComparator, DesignResourceLocatedDigestV1 } from "./design-resource-fact-manifest-types.js";
3
3
  import type { ExecutionTargetCapabilityV2 } from "./execution-target-capabilities.js";
4
+ import type { SymbolicExtensionalPointV1 } from "./symbolic-denotation-types.js";
4
5
  export type DesignTargetInterpretationV2 = "exact_target" | "constraint";
5
6
  export interface DeliveryDesignFactExpectationV2 {
6
7
  fact_ref: string;
@@ -40,8 +41,58 @@ export interface DeliveryDesignVerificationBindingV2 {
40
41
  fact_expectations: DeliveryDesignFactExpectationV2[];
41
42
  }>;
42
43
  }
44
+ export interface DeliveryDesignSymbolicRuleExpectationV2 {
45
+ obligation_ref: string;
46
+ fact_rule_ref: string;
47
+ region_sha256: string;
48
+ subject_or_relation_ref: string;
49
+ property_ref: string;
50
+ population_ref: string | null;
51
+ quantifier: SymbolicExtensionalPointV1["quantifier"];
52
+ observation_sensitivity: "plain" | "protected";
53
+ expected: DesignResourceLocatedDigestV1;
54
+ proof_surface: string;
55
+ observation_boundary: string;
56
+ comparison: DeliveryDesignFactExpectationV2["comparison"];
57
+ oracle: DeliveryDesignFactExpectationV2["oracle"];
58
+ environment: DeliveryDesignFactExpectationV2["environment"];
59
+ protected_value_policy: string;
60
+ completion_effect: string;
61
+ }
62
+ export interface DeliveryDesignSymbolicVerificationBindingV2 {
63
+ method: DesignResourceVerificationMethod;
64
+ assertion_ref: string;
65
+ artifact_path: string;
66
+ observation_path: string;
67
+ rule_expectations: DeliveryDesignSymbolicRuleExpectationV2[];
68
+ }
69
+ export interface DeliveryDesignSymbolicCertificateExpectationV2 {
70
+ certificate_ref: string;
71
+ fact_rule_refs: string[];
72
+ omitted_axis_refs: string[];
73
+ dependency_edge_refs: string[];
74
+ canonical_rule_dag_sha256: string;
75
+ source_noninterference_proof_sha256?: string;
76
+ production_noninterference_proof_sha256?: string;
77
+ }
78
+ export interface DeliveryDesignSymbolicCertificateBindingV2 {
79
+ assertion_ref: string;
80
+ artifact_path: string;
81
+ expectations: DeliveryDesignSymbolicCertificateExpectationV2[];
82
+ metrics: {
83
+ semantic_obligations: number;
84
+ certificate_obligations: number;
85
+ certificate_covered_omitted_axes: number;
86
+ certificate_covered_dependency_edges: number;
87
+ canonical_dag_nodes: number;
88
+ canonical_partition_edges: number;
89
+ canonical_bytes: number;
90
+ theoretical_ground_cardinality: string;
91
+ };
92
+ }
43
93
  export interface DeliveryDesignTargetV2 {
44
94
  key: string;
95
+ fact_model?: "symbolic_rules_v2";
45
96
  interpretation: DesignTargetInterpretationV2;
46
97
  source_paths: string[];
47
98
  condition_keys: string[];
@@ -49,6 +100,8 @@ export interface DeliveryDesignTargetV2 {
49
100
  conformance_check_ref: string;
50
101
  conformance_assertion_ref: string;
51
102
  verification_method_bindings: DeliveryDesignVerificationBindingV2[];
103
+ symbolic_method_bindings?: DeliveryDesignSymbolicVerificationBindingV2[];
104
+ symbolic_certificate_binding?: DeliveryDesignSymbolicCertificateBindingV2;
52
105
  actual_artifact_path: string;
53
106
  comparison_artifact_path: string;
54
107
  }
@@ -167,11 +167,15 @@ function localSpecifierBase(importer, specifier) {
167
167
  const base = specifier.startsWith("/")
168
168
  ? specifier.slice(1)
169
169
  : path.posix.normalize(path.posix.join(path.posix.dirname(importer), specifier));
170
- return base === ".." || base.startsWith("../") ? null : base;
170
+ const canonicalBase = base.replace(/\/+$/u, "") || ".";
171
+ return canonicalBase === ".." || canonicalBase.startsWith("../")
172
+ ? null
173
+ : canonicalBase;
171
174
  }
172
175
  function runtimePatternOwns(base, pattern) {
173
- return (matchesRepoPattern(base, pattern) ||
174
- classifyRepositoryPatternOverlap(`${base}/**`, pattern).status ===
176
+ const directoryPattern = base === "." ? "**" : `${base}/**`;
177
+ return ((base !== "." && matchesRepoPattern(base, pattern)) ||
178
+ classifyRepositoryPatternOverlap(directoryPattern, pattern).status ===
175
179
  "proven_overlap");
176
180
  }
177
181
  function sortRecord(value) {
@@ -2,6 +2,7 @@ import { deliveryCompileFreshness } from "./long-task-freshness.js";
2
2
  import { assertVerifierAuthorityCurrent } from "./long-task-freshness.js";
3
3
  import { enrichCheckResultFindings, enrichFinding, } from "./long-task-finding-context.js";
4
4
  import { executeCheckRunner } from "./long-task-check-runner.js";
5
+ import { prepareExecutionObservationUniverse } from "./long-task-execution-observation.js";
5
6
  import { evaluateCheckEvidence, evaluateGlobalCounterfactuals, evaluateOutcomeCounterfactuals, } from "./long-task-evidence-v2.js";
6
7
  import { matchesRepoPattern } from "./long-task-paths.js";
7
8
  import { activeAuthorityIdentityMatches, loadActiveLongTaskAuthority, writeProgressRecord, } from "./long-task-state.js";
@@ -85,6 +86,12 @@ async function resolved(workdir) {
85
86
  return (await import("node:path")).default.resolve(workdir);
86
87
  }
87
88
  export async function runDeliveryChecks(compiled, snapshot, checks, includeCounterfactuals, finalGate = false) {
89
+ const observationAuthorityPaths = [
90
+ compiled.contract_file,
91
+ ...Object.keys(compiled.contract_files),
92
+ ...Object.keys(compiled.source_hashes),
93
+ ...compiled.context_snapshot.files,
94
+ ];
88
95
  const findings = await preRunFindings(compiled, snapshot.manifest);
89
96
  if (finalGate)
90
97
  findings.push(...finalPathFindings(compiled, snapshot.manifest));
@@ -95,17 +102,46 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
95
102
  findings: findings.map((finding) => enrichFinding(compiled, finding)),
96
103
  };
97
104
  const rawExecutions = new Map();
105
+ const completeChecks = allCompiledChecks(compiled);
106
+ const selectedExecutionGroups = rawExecutionGroups(checks);
107
+ const completeExecutionGroups = selectedExecutionGroups.map((group) => completeChecks.filter((check) => check.raw_execution_identity === group[0].raw_execution_identity));
108
+ const preparedExecutionGroups = await prepareExecutionObservationUniverse({
109
+ groups: completeExecutionGroups,
110
+ snapshot_root: snapshot.root,
111
+ workspace_manifest: snapshot.manifest,
112
+ protected_authority_paths: observationAuthorityPaths,
113
+ });
114
+ try {
115
+ const pending = [];
116
+ for (const [index, group] of selectedExecutionGroups.entries()) {
117
+ const prepared = preparedExecutionGroups[index];
118
+ if (!prepared)
119
+ throw new Error("raw_execution_group_prepare_missing");
120
+ pending.push({
121
+ raw_execution_identity: group[0].raw_execution_identity,
122
+ raw: await executeCheckRunner(group[0], prepared.execution_root, prepared.runner_context),
123
+ prepared,
124
+ });
125
+ }
126
+ const finalized = await Promise.all(pending.map(async (entry) => ({
127
+ raw_execution_identity: entry.raw_execution_identity,
128
+ raw: await entry.prepared.finalize(entry.raw),
129
+ })));
130
+ for (const entry of finalized)
131
+ rawExecutions.set(entry.raw_execution_identity, entry.raw);
132
+ }
133
+ finally {
134
+ await Promise.all(preparedExecutionGroups.map((prepared) => prepared.dispose()));
135
+ }
98
136
  const mainCheckResults = [];
99
137
  for (const check of checks) {
100
- let raw = rawExecutions.get(check.raw_execution_identity);
101
- if (!raw) {
102
- raw = await executeCheckRunner(check, snapshot.root);
103
- rawExecutions.set(check.raw_execution_identity, raw);
104
- }
138
+ const raw = rawExecutions.get(check.raw_execution_identity);
139
+ if (!raw)
140
+ throw new Error("raw_execution_group_result_missing");
105
141
  const outcome = check.outcome_key
106
142
  ? compiled.outcomes.find((item) => item.key === check.outcome_key)
107
143
  : undefined;
108
- mainCheckResults.push(await evaluateCheckEvidence(check, raw, snapshot.root, outcome));
144
+ mainCheckResults.push(await evaluateCheckEvidence(check, raw, snapshot.root, outcome, observationAuthorityPaths));
109
145
  }
110
146
  const counterfactualFindings = [];
111
147
  if (includeCounterfactuals) {
@@ -122,7 +158,7 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
122
158
  passingCheckIds.has(check.internal_id))
123
159
  .map((check) => check.key));
124
160
  if (selectedGlobalCheckKeys.size)
125
- counterfactualFindings.push(...(await evaluateGlobalCounterfactuals(compiled, snapshot.root, selectedGlobalCheckKeys, snapshot.manifest)));
161
+ counterfactualFindings.push(...(await evaluateGlobalCounterfactuals(compiled, snapshot.root, selectedGlobalCheckKeys, snapshot.manifest, mainCheckResults, rawExecutions, completeChecks)));
126
162
  const outcomeKeys = new Set(checks
127
163
  .map((check) => check.outcome_key)
128
164
  .filter((key) => Boolean(key)));
@@ -137,7 +173,7 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
137
173
  ...outcome.acceptance,
138
174
  counterfactual_controls: outcome.acceptance.counterfactual_controls.filter((control) => selectedKeys.has(control.check_key)),
139
175
  },
140
- }, snapshot.root, snapshot.manifest)));
176
+ }, snapshot.root, snapshot.manifest, observationAuthorityPaths, mainCheckResults, rawExecutions, completeChecks)));
141
177
  }
142
178
  }
143
179
  const unassignedCounterfactuals = counterfactualFindings.filter((finding) => !mainCheckResults.some((result) => findingBelongsToCheck(finding, result)));
@@ -154,6 +190,17 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
154
190
  findings: findings.map((finding) => enrichFinding(compiled, finding)),
155
191
  };
156
192
  }
193
+ function rawExecutionGroups(checks) {
194
+ const groups = new Map();
195
+ for (const check of checks) {
196
+ const group = groups.get(check.raw_execution_identity);
197
+ if (group)
198
+ group.push(check);
199
+ else
200
+ groups.set(check.raw_execution_identity, [check]);
201
+ }
202
+ return [...groups.values()];
203
+ }
157
204
  function applyCounterfactualFindings(checkResults, findings, unassignedFinding) {
158
205
  return checkResults.map((result, index) => {
159
206
  const projected = findings.filter((finding) => findingBelongsToCheck(finding, result));
@@ -200,7 +247,9 @@ function finalPathFindings(compiled, manifest) {
200
247
  for (const outcome of compiled.outcomes)
201
248
  for (const binding of outcome.technical.bindings)
202
249
  if (binding.existence === "planned" &&
203
- !plannedBindingRequiredPatterns(binding).every((pattern) => manifest.files.some((file) => matchesRepoPattern(file.path, pattern))))
250
+ !plannedBindingRequiredPatterns(binding).every((pattern) => manifest.files.some((file) => matchesRepoPattern(file.path, pattern))) &&
251
+ !outcome.acceptance.checks.some((check) => (check.observation_authorities ?? []).some((authority) => authority.authority === "package_static_json_exact" &&
252
+ authority.carrier_refs.some((carrier) => carrier.binding_ref === `${outcome.key}.${binding.key}`))))
204
253
  findings.push({
205
254
  code: "binding_missing",
206
255
  outcome_key: outcome.key,
@@ -212,6 +261,18 @@ function finalPathFindings(compiled, manifest) {
212
261
  expected: binding.carrier_paths,
213
262
  next_action: "Implement the declared binding and rerun verification.",
214
263
  });
264
+ for (const check of allCompiledChecks(compiled))
265
+ for (const runtimePath of check.process_runtime_closure
266
+ ?.allowed_runtime_files ?? [])
267
+ if (!manifest.files.some((file) => file.path === runtimePath))
268
+ findings.push({
269
+ code: "process_runtime_input_missing",
270
+ outcome_key: check.outcome_key,
271
+ check_key: check.key,
272
+ message: `Declared process runtime input did not exist in the Final Gate candidate: ${runtimePath}`,
273
+ expected: runtimePath,
274
+ next_action: "Materialize the Source-backed product root and every declared production runtime input, then rerun Final Gate.",
275
+ });
215
276
  return findings;
216
277
  }
217
278
  function plannedBindingRequiredPatterns(binding) {
@@ -0,0 +1,2 @@
1
+ export declare const LONG_TASK_IMPLEMENTATION_AGENT = "long_task_implementation";
2
+ export declare function selectedAgentType(toolInput: unknown): string | null;
@@ -0,0 +1,7 @@
1
+ export const LONG_TASK_IMPLEMENTATION_AGENT = "long_task_implementation";
2
+ export function selectedAgentType(toolInput) {
3
+ if (!toolInput || typeof toolInput !== "object" || Array.isArray(toolInput))
4
+ return null;
5
+ const value = toolInput.agent_type;
6
+ return typeof value === "string" && value.length > 0 ? value : null;
7
+ }
@@ -3,8 +3,9 @@ import { readConfig } from "./config.js";
3
3
  import { harnessConfigPath, harnessPath, harnessRoot } from "./harness-root.js";
4
4
  import { listFiles, pathExists } from "./fs.js";
5
5
  import { matchesRepoPattern, normalizeRepositoryFile, } from "./long-task-paths.js";
6
+ import { longTaskCodexAgentProfileBootstrapPaths } from "./long-task-codex-agent-profile.js";
6
7
  import { packageAssetPath } from "./paths.js";
7
- import { enabledManagedSkillNames } from "./profiles.js";
8
+ import { enabledManagedSkillNames, isProfileEnabled } from "./profiles.js";
8
9
  export function classifyWorkspaceScope(authority, changedPaths, protectedPaths) {
9
10
  const protectedSet = new Set(normalizeFiles(protectedPaths));
10
11
  const expectedPatterns = authority.outcomes.flatMap((outcome) => outcome.technical.expected_change_paths);
@@ -51,6 +52,7 @@ export async function firstLockManagedWorkspacePaths(repository, changedPaths) {
51
52
  const managedFiles = new Set([
52
53
  await harnessConfigPath(repository),
53
54
  ".codex/hooks.json",
55
+ ...(await longTaskCodexAgentProfileBootstrapPaths(repository, root, isProfileEnabled(config, "long-task"))),
54
56
  ...(await packageManagedBootstrapFiles(root, config)),
55
57
  ].map(normalizeManagedRoot));
56
58
  return normalizeFiles(changedPaths).filter((file) => managedFiles.has(file));
@@ -1,3 +1,4 @@
1
+ export { resolveInsideRepository } from "./repository-path-safety.js";
1
2
  import type { WorkspaceFingerprintV2, WorkspaceManifestV2 } from "./long-task-delivery-types.js";
2
3
  export interface WorkspaceSnapshotV2 {
3
4
  root: string;
@@ -22,5 +23,4 @@ export declare function gitPath(root: string, pathSpec: string): Promise<string>
22
23
  export declare function gitConfigGet(root: string, name: string): Promise<string | null>;
23
24
  export declare function gitConfigSet(root: string, name: string, value: string): Promise<void>;
24
25
  export declare function gitConfigUnset(root: string, name: string): Promise<void>;
25
- export declare function resolveInsideRepository(rootInput: string, relativeInput: string, label: string): string;
26
26
  export declare function repoRelative(rootInput: string, fileInput: string): string;
@@ -2,6 +2,7 @@ import { spawn } from "node:child_process";
2
2
  import { copyFile, mkdir, mkdtemp, readFile, readdir, rm, stat, symlink, } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
+ export { resolveInsideRepository } from "./repository-path-safety.js";
5
6
  import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
6
7
  export async function repositoryRoot(start) {
7
8
  const resolved = path.resolve(start);
@@ -247,18 +248,6 @@ export async function gitConfigUnset(root, name) {
247
248
  throw error;
248
249
  }
249
250
  }
250
- export function resolveInsideRepository(rootInput, relativeInput, label) {
251
- if (!relativeInput || path.isAbsolute(relativeInput))
252
- throw new Error(`unsafe_path:${label}:${relativeInput}`);
253
- const normalized = relativeInput.replace(/\\/gu, "/");
254
- if (normalized.split("/").includes(".."))
255
- throw new Error(`unsafe_path:${label}:${relativeInput}`);
256
- const root = path.resolve(rootInput);
257
- const resolved = path.resolve(root, ...normalized.split("/"));
258
- if (resolved !== root && !resolved.startsWith(`${root}${path.sep}`))
259
- throw new Error(`unsafe_path:${label}:${relativeInput}`);
260
- return resolved;
261
- }
262
251
  export function repoRelative(rootInput, fileInput) {
263
252
  const value = path
264
253
  .relative(path.resolve(rootInput), path.resolve(fileInput))
@@ -317,7 +306,7 @@ async function removeExcludedSnapshotPaths(snapshotRoot, excluded) {
317
306
  async function overlayTrackedEolDifferences(sourceRoot, snapshotRoot) {
318
307
  const [raw, autocrlf] = await Promise.all([
319
308
  gitBuffer(sourceRoot, ["ls-files", "--eol", "-z"]),
320
- gitConfigGet(sourceRoot, "core.autocrlf"),
309
+ gitEffectiveConfigGet(sourceRoot, "core.autocrlf"),
321
310
  ]);
322
311
  for (const record of splitZero(raw)) {
323
312
  const tab = record.indexOf("\t");
@@ -341,6 +330,16 @@ async function overlayTrackedEolDifferences(sourceRoot, snapshotRoot) {
341
330
  await copyFile(source, target);
342
331
  }
343
332
  }
333
+ async function gitEffectiveConfigGet(root, name) {
334
+ try {
335
+ return await gitOutput(root, ["config", "--get", name]);
336
+ }
337
+ catch (error) {
338
+ if (message(error).includes("git_exit:1"))
339
+ return null;
340
+ throw error;
341
+ }
342
+ }
344
343
  function checkoutEol(indexEol, attributes, autocrlf) {
345
344
  const explicit = attributes.match(/(?:^|\s)eol=(lf|crlf)(?:\s|$)/u)?.[1];
346
345
  if (explicit)
@@ -17,6 +17,8 @@ async function verifyNoop() {
17
17
  }
18
18
  const REMOVED_NORMAL_LONG_TASK_SKILL = "normal-long-task";
19
19
  const REMOVED_NORMAL_LONG_TASK_SKILL_SHA256 = "7a4f755da9a32e07f258d6c7fc5e5c70395257c72efb8a9ad4995cddcc4c73ba";
20
+ const REMOVED_SOURCE_PLAN_SKILL = "source-plan-authoring";
21
+ const REMOVED_SOURCE_PLAN_SKILL_SHA256 = "902de1cca912a8c4a0f26461d0271f5fb87b970316b58efe1c06418f4531f10f";
20
22
  export const migrations = [
21
23
  legacySdlcHarnessMigration,
22
24
  modularityCapabilityWaiverMigration,
@@ -41,6 +43,17 @@ export const migrations = [
41
43
  apply: migrateRemovedNormalLongTaskSkill,
42
44
  verify: verifyRemovedNormalLongTaskSkill,
43
45
  },
46
+ {
47
+ id: "remove-source-plan-authoring-skill",
48
+ introducedIn: "0.8.12",
49
+ description: "Remove the retired source-plan-authoring compatibility pointer; long-task-workflow owns machine-assurance Source authoring and legacy Source Plans remain ordinary Source.",
50
+ scope: "<harnessRoot>/skills/source-plan-authoring",
51
+ risk: "safe",
52
+ manualMessage: "The same-name directory differs from the former package-owned compatibility pointer. Preserve the user-authored Skill or move its content explicitly; Tiny Context will not delete it.",
53
+ detect: detectRemovedSourcePlanSkill,
54
+ apply: migrateRemovedSourcePlanSkill,
55
+ verify: verifyRemovedSourcePlanSkill,
56
+ },
44
57
  {
45
58
  id: "long-task-v1-retirement",
46
59
  introducedIn: "0.6.0",
@@ -178,6 +191,51 @@ async function verifyRemovedNormalLongTaskSkill(projectRoot, root) {
178
191
  throw new Error("remove-normal-long-task-skill migration verification failed");
179
192
  }
180
193
  }
194
+ async function detectRemovedSourcePlanSkill(projectRoot, root, migration) {
195
+ const skill = removedSourcePlanSkillPath(projectRoot, root);
196
+ const state = await removedSourcePlanSkillState(skill);
197
+ if (state === "absent")
198
+ return [];
199
+ const relative = path.relative(projectRoot, skill).split(path.sep).join("/");
200
+ return [
201
+ item(migration, state === "package-owned" ? "safe_pending" : "manual_required", relative, state === "package-owned"
202
+ ? "Remove the exact retired package-owned Source Plan compatibility pointer."
203
+ : "The retired same-name Skill contains modified or additional content; preserve it and resolve removal manually."),
204
+ ];
205
+ }
206
+ async function migrateRemovedSourcePlanSkill(projectRoot, root, report) {
207
+ const skill = removedSourcePlanSkillPath(projectRoot, root);
208
+ const state = await removedSourcePlanSkillState(skill);
209
+ const relative = path.relative(projectRoot, skill).split(path.sep).join("/");
210
+ if (state === "absent") {
211
+ report.skipped.push("remove-source-plan-authoring-skill");
212
+ return;
213
+ }
214
+ if (state !== "package-owned")
215
+ throw new Error(`${relative} changed after upgrade planning; rerun upgrade and resolve the manual_required item`);
216
+ await fs.rm(skill, { recursive: true, force: true });
217
+ report.changed.push(relative);
218
+ }
219
+ async function verifyRemovedSourcePlanSkill(projectRoot, root) {
220
+ if (await pathExists(removedSourcePlanSkillPath(projectRoot, root)))
221
+ throw new Error("remove-source-plan-authoring-skill migration verification failed");
222
+ }
223
+ function removedSourcePlanSkillPath(projectRoot, root) {
224
+ return path.join(projectRoot, root, "skills", REMOVED_SOURCE_PLAN_SKILL);
225
+ }
226
+ async function removedSourcePlanSkillState(skill) {
227
+ if (!(await pathExists(skill)))
228
+ return "absent";
229
+ const files = await listFiles(skill);
230
+ if (files.length !== 1 ||
231
+ path.relative(skill, files[0]).split(path.sep).join("/") !== "SKILL.md")
232
+ return "modified";
233
+ const normalized = (await readText(files[0])).replace(/\r\n/g, "\n");
234
+ const digest = createHash("sha256").update(normalized).digest("hex");
235
+ return digest === REMOVED_SOURCE_PLAN_SKILL_SHA256
236
+ ? "package-owned"
237
+ : "modified";
238
+ }
181
239
  function removedNormalLongTaskSkillPath(projectRoot, root) {
182
240
  return path.join(projectRoot, root, "skills", REMOVED_NORMAL_LONG_TASK_SKILL);
183
241
  }
@@ -60,7 +60,6 @@ export function enabledManagedSkillNames(config) {
60
60
  ]);
61
61
  if (isProfileEnabled(config, "long-task")) {
62
62
  names.add("long-task-workflow");
63
- names.add("source-plan-authoring");
64
63
  }
65
64
  return names;
66
65
  }
@@ -0,0 +1,14 @@
1
+ import type { Stats } from "node:fs";
2
+ export interface SafeRepositoryPath {
3
+ repository: string;
4
+ absolute: string;
5
+ relative: string;
6
+ }
7
+ export declare function resolveInsideRepository(rootInput: string, relativeInput: string, label: string): string;
8
+ export declare function assertProtectedRepositoryFile(repositoryInput: string, fileInput: string, label: string): Promise<string>;
9
+ export declare function assertSafeRepositoryFilePath(repositoryInput: string, relativeInput: string, label: string, options?: {
10
+ destinationMayBeAbsent?: boolean;
11
+ }): Promise<SafeRepositoryPath & {
12
+ status: Stats | null;
13
+ }>;
14
+ export declare function ensureSafeRepositoryDirectory(repositoryInput: string, relativeInput: string, label: string): Promise<SafeRepositoryPath>;