project-tiny-context-harness 0.8.11 → 0.8.12

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 (272) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +490 -472
  3. package/assets/README.md +762 -749
  4. package/assets/README.zh-CN.md +446 -431
  5. package/assets/agents/.gitkeep +1 -1
  6. package/assets/agents/AGENTS_CORE.md +17 -23
  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 +64 -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 +52 -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 +119 -119
  30. package/assets/skills/design-resource-authoring/references/resource-selection.md +158 -181
  31. package/assets/skills/design-system-authoring/SKILL.md +57 -57
  32. package/assets/skills/design-system-authoring/agents/openai.yaml +6 -6
  33. package/assets/skills/design-system-authoring/references/authority-adoption.md +48 -48
  34. package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +110 -110
  35. package/assets/skills/long-task-workflow/SKILL.md +71 -106
  36. package/assets/skills/long-task-workflow/agents/openai.yaml +1 -1
  37. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +71 -69
  38. package/assets/skills/long-task-workflow/references/contract-authoring.md +98 -94
  39. package/assets/skills/long-task-workflow/references/evidence-design.md +67 -63
  40. package/assets/skills/long-task-workflow/references/source-authoring.md +90 -90
  41. package/assets/tools/validate_context.py +442 -442
  42. package/dist/commands/design-resource.js +9 -2
  43. package/dist/commands/enable.js +2 -0
  44. package/dist/commands/index.js +1 -1
  45. package/dist/commands/long-task-revision.js +8 -7
  46. package/dist/commands/sync.js +2 -0
  47. package/dist/index.d.ts +3 -3
  48. package/dist/index.js +2 -0
  49. package/dist/lib/compact-authoring-support.d.ts +22 -0
  50. package/dist/lib/compact-authoring-support.js +143 -0
  51. package/dist/lib/compact-shared-structure-authoring.d.ts +5 -0
  52. package/dist/lib/compact-shared-structure-authoring.js +9 -0
  53. package/dist/lib/compact-shared-structure-types.d.ts +61 -0
  54. package/dist/lib/compact-shared-structure-types.js +1 -0
  55. package/dist/lib/compact-shared-structure-validation.d.ts +2 -0
  56. package/dist/lib/compact-shared-structure-validation.js +159 -0
  57. package/dist/lib/compact-shared-structures.d.ts +3 -0
  58. package/dist/lib/compact-shared-structures.js +204 -0
  59. package/dist/lib/design-resource-fact-enums.d.ts +4 -0
  60. package/dist/lib/design-resource-fact-enums.js +12 -0
  61. package/dist/lib/design-resource-fact-manifest-shape-evidence.js +2 -2
  62. package/dist/lib/design-resource-fact-policy.d.ts +2 -2
  63. package/dist/lib/design-resource-fact-types.d.ts +2 -2
  64. package/dist/lib/design-resource-handoff-bundle-draft.js +4 -2
  65. package/dist/lib/design-resource-handoff-input-types.d.ts +3 -0
  66. package/dist/lib/design-resource-handoff-parser.d.ts +2 -2
  67. package/dist/lib/design-resource-handoff-parser.js +2 -2
  68. package/dist/lib/design-resource-handoff-shape.d.ts +2 -0
  69. package/dist/lib/design-resource-handoff-shape.js +10 -0
  70. package/dist/lib/design-resource-handoff-snapshot.js +4 -0
  71. package/dist/lib/design-resource-handoff-validation.d.ts +4 -1
  72. package/dist/lib/design-resource-handoff-validation.js +11 -0
  73. package/dist/lib/design-resource-handoff-web-dependency-validation.d.ts +4 -2
  74. package/dist/lib/design-resource-symbolic-applicability-authority.d.ts +7 -0
  75. package/dist/lib/design-resource-symbolic-applicability-authority.js +19 -0
  76. package/dist/lib/design-resource-symbolic-applicability-policy.d.ts +12 -0
  77. package/dist/lib/design-resource-symbolic-applicability-policy.js +79 -0
  78. package/dist/lib/design-resource-symbolic-applicability-profiles.d.ts +8 -0
  79. package/dist/lib/design-resource-symbolic-applicability-profiles.js +55 -0
  80. package/dist/lib/design-resource-symbolic-applicability-shape.d.ts +2 -0
  81. package/dist/lib/design-resource-symbolic-applicability-shape.js +76 -0
  82. package/dist/lib/design-resource-symbolic-applicability-validation.d.ts +7 -0
  83. package/dist/lib/design-resource-symbolic-applicability-validation.js +128 -0
  84. package/dist/lib/design-resource-symbolic-compilation.d.ts +3 -0
  85. package/dist/lib/design-resource-symbolic-compilation.js +13 -0
  86. package/dist/lib/design-resource-symbolic-denotation.d.ts +3 -0
  87. package/dist/lib/design-resource-symbolic-denotation.js +167 -0
  88. package/dist/lib/design-resource-symbolic-disposition-validation.d.ts +4 -0
  89. package/dist/lib/design-resource-symbolic-disposition-validation.js +28 -0
  90. package/dist/lib/design-resource-symbolic-fact-policy.d.ts +12 -0
  91. package/dist/lib/design-resource-symbolic-fact-policy.js +12 -0
  92. package/dist/lib/design-resource-symbolic-fact-shape.d.ts +3 -0
  93. package/dist/lib/design-resource-symbolic-fact-shape.js +138 -0
  94. package/dist/lib/design-resource-symbolic-fact-types.d.ts +213 -0
  95. package/dist/lib/design-resource-symbolic-fact-types.js +1 -0
  96. package/dist/lib/design-resource-symbolic-fact-validation.d.ts +3 -0
  97. package/dist/lib/design-resource-symbolic-fact-validation.js +86 -0
  98. package/dist/lib/design-resource-symbolic-indexes.d.ts +23 -0
  99. package/dist/lib/design-resource-symbolic-indexes.js +54 -0
  100. package/dist/lib/design-resource-symbolic-manifest-shape.d.ts +3 -0
  101. package/dist/lib/design-resource-symbolic-manifest-shape.js +155 -0
  102. package/dist/lib/design-resource-symbolic-manifest-validation.d.ts +6 -0
  103. package/dist/lib/design-resource-symbolic-manifest-validation.js +132 -0
  104. package/dist/lib/design-resource-symbolic-noninterference-artifact.d.ts +33 -0
  105. package/dist/lib/design-resource-symbolic-noninterference-artifact.js +110 -0
  106. package/dist/lib/design-resource-symbolic-noninterference-equivalence.d.ts +3 -0
  107. package/dist/lib/design-resource-symbolic-noninterference-equivalence.js +77 -0
  108. package/dist/lib/design-resource-symbolic-noninterference-recompute.d.ts +4 -0
  109. package/dist/lib/design-resource-symbolic-noninterference-recompute.js +146 -0
  110. package/dist/lib/design-resource-symbolic-noninterference-scope.d.ts +7 -0
  111. package/dist/lib/design-resource-symbolic-noninterference-scope.js +49 -0
  112. package/dist/lib/design-resource-symbolic-noninterference-shape.d.ts +2 -0
  113. package/dist/lib/design-resource-symbolic-noninterference-shape.js +152 -0
  114. package/dist/lib/design-resource-symbolic-noninterference-types.d.ts +103 -0
  115. package/dist/lib/design-resource-symbolic-noninterference-types.js +1 -0
  116. package/dist/lib/design-resource-symbolic-noninterference-validation.d.ts +5 -0
  117. package/dist/lib/design-resource-symbolic-noninterference-validation.js +62 -0
  118. package/dist/lib/design-resource-symbolic-oracle-fingerprint.d.ts +1 -0
  119. package/dist/lib/design-resource-symbolic-oracle-fingerprint.js +47 -0
  120. package/dist/lib/design-resource-symbolic-predicate-shape.d.ts +6 -0
  121. package/dist/lib/design-resource-symbolic-predicate-shape.js +123 -0
  122. package/dist/lib/design-resource-symbolic-production-closure.d.ts +4 -0
  123. package/dist/lib/design-resource-symbolic-production-closure.js +144 -0
  124. package/dist/lib/design-resource-symbolic-proof-authority-validation.d.ts +10 -0
  125. package/dist/lib/design-resource-symbolic-proof-authority-validation.js +68 -0
  126. package/dist/lib/design-resource-symbolic-proof-validation.d.ts +10 -0
  127. package/dist/lib/design-resource-symbolic-proof-validation.js +89 -0
  128. package/dist/lib/design-resource-symbolic-region-validation.d.ts +19 -0
  129. package/dist/lib/design-resource-symbolic-region-validation.js +146 -0
  130. package/dist/lib/design-resource-symbolic-resource-validation.d.ts +5 -0
  131. package/dist/lib/design-resource-symbolic-resource-validation.js +90 -0
  132. package/dist/lib/design-resource-symbolic-rule-shape.d.ts +27 -0
  133. package/dist/lib/design-resource-symbolic-rule-shape.js +158 -0
  134. package/dist/lib/design-resource-symbolic-safety-validation.d.ts +6 -0
  135. package/dist/lib/design-resource-symbolic-safety-validation.js +29 -0
  136. package/dist/lib/design-resource-symbolic-source-ir-evaluation.d.ts +19 -0
  137. package/dist/lib/design-resource-symbolic-source-ir-evaluation.js +74 -0
  138. package/dist/lib/design-resource-symbolic-source-ir-evidence.d.ts +44 -0
  139. package/dist/lib/design-resource-symbolic-source-ir-evidence.js +88 -0
  140. package/dist/lib/design-resource-symbolic-source-ir-oracle.d.ts +13 -0
  141. package/dist/lib/design-resource-symbolic-source-ir-oracle.js +96 -0
  142. package/dist/lib/design-resource-symbolic-source-ir-proof.d.ts +14 -0
  143. package/dist/lib/design-resource-symbolic-source-ir-proof.js +98 -0
  144. package/dist/lib/design-resource-symbolic-source-ir-shape.d.ts +2 -0
  145. package/dist/lib/design-resource-symbolic-source-ir-shape.js +38 -0
  146. package/dist/lib/design-resource-symbolic-source-ir-types.d.ts +17 -0
  147. package/dist/lib/design-resource-symbolic-source-ir-types.js +2 -0
  148. package/dist/lib/design-resource-symbolic-static-dependency-validation.d.ts +2 -0
  149. package/dist/lib/design-resource-symbolic-static-dependency-validation.js +83 -0
  150. package/dist/lib/design-resource-symbolic-structural-closure-validation.d.ts +6 -0
  151. package/dist/lib/design-resource-symbolic-structural-closure-validation.js +79 -0
  152. package/dist/lib/design-resource-symbolic-validation-support.d.ts +29 -0
  153. package/dist/lib/design-resource-symbolic-validation-support.js +111 -0
  154. package/dist/lib/design-resource-v1-capacity-header.d.ts +8 -0
  155. package/dist/lib/design-resource-v1-capacity-header.js +231 -0
  156. package/dist/lib/design-resource-v1-capacity.d.ts +5 -0
  157. package/dist/lib/design-resource-v1-capacity.js +45 -0
  158. package/dist/lib/init.js +1 -0
  159. package/dist/lib/long-task-activation-validation.js +2 -2
  160. package/dist/lib/long-task-authority-policy.d.ts +3 -0
  161. package/dist/lib/long-task-authority-policy.js +3 -0
  162. package/dist/lib/long-task-codex-agent-profile.d.ts +42 -0
  163. package/dist/lib/long-task-codex-agent-profile.js +276 -0
  164. package/dist/lib/long-task-compact-authoring-projections.d.ts +12 -0
  165. package/dist/lib/long-task-compact-authoring-projections.js +67 -0
  166. package/dist/lib/long-task-compact-authoring.d.ts +3 -0
  167. package/dist/lib/long-task-compact-authoring.js +173 -0
  168. package/dist/lib/long-task-compact-carrier.d.ts +7 -0
  169. package/dist/lib/long-task-compact-carrier.js +132 -0
  170. package/dist/lib/long-task-compact-parser.d.ts +14 -0
  171. package/dist/lib/long-task-compact-parser.js +123 -0
  172. package/dist/lib/long-task-compact-primitives.d.ts +22 -0
  173. package/dist/lib/long-task-compact-primitives.js +132 -0
  174. package/dist/lib/long-task-compact-projections.d.ts +4 -0
  175. package/dist/lib/long-task-compact-projections.js +153 -0
  176. package/dist/lib/long-task-compact-structure-targets.d.ts +2 -0
  177. package/dist/lib/long-task-compact-structure-targets.js +90 -0
  178. package/dist/lib/long-task-counterfactual-sandbox.d.ts +1 -1
  179. package/dist/lib/long-task-counterfactual-sandbox.js +7 -5
  180. package/dist/lib/long-task-delivery-parser.d.ts +1 -0
  181. package/dist/lib/long-task-delivery-parser.js +38 -6
  182. package/dist/lib/long-task-design-resource-handoff.d.ts +2 -1
  183. package/dist/lib/long-task-design-resource-handoff.js +71 -11
  184. package/dist/lib/long-task-design-resource-method-binding.d.ts +8 -1
  185. package/dist/lib/long-task-design-resource-method-binding.js +150 -0
  186. package/dist/lib/long-task-evidence-capability-codec.js +256 -34
  187. package/dist/lib/long-task-evidence-capability-policy.js +28 -0
  188. package/dist/lib/long-task-evidence-capability-runtime.js +271 -63
  189. package/dist/lib/long-task-evidence-capability-types.d.ts +70 -2
  190. package/dist/lib/long-task-evidence-v2.d.ts +1 -1
  191. package/dist/lib/long-task-evidence-v2.js +5 -5
  192. package/dist/lib/long-task-hook-install.d.ts +19 -2
  193. package/dist/lib/long-task-hook-install.js +288 -91
  194. package/dist/lib/long-task-playwright-capability-records.d.ts +2 -0
  195. package/dist/lib/long-task-playwright-capability-records.js +74 -2
  196. package/dist/lib/long-task-runner-freeze.d.ts +1 -1
  197. package/dist/lib/long-task-runner-freeze.js +4 -2
  198. package/dist/lib/long-task-semantic-contract-types.d.ts +1 -1
  199. package/dist/lib/long-task-semantic-fact-binding-types.d.ts +8 -0
  200. package/dist/lib/long-task-semantic-fact-closure.js +4 -1
  201. package/dist/lib/long-task-semantic-fact-contract-closure.d.ts +1 -1
  202. package/dist/lib/long-task-semantic-fact-contract-closure.js +15 -3
  203. package/dist/lib/long-task-semantic-fact-contract-facts.d.ts +1 -1
  204. package/dist/lib/long-task-semantic-fact-contract-facts.js +4 -1
  205. package/dist/lib/long-task-semantic-fact-contract-proofs.d.ts +1 -1
  206. package/dist/lib/long-task-semantic-fact-contract-proofs.js +12 -3
  207. package/dist/lib/long-task-semantic-fact-evidence.d.ts +5 -1
  208. package/dist/lib/long-task-semantic-fact-evidence.js +47 -4
  209. package/dist/lib/long-task-semantic-fact-shape.js +17 -6
  210. package/dist/lib/long-task-shape-primitives.d.ts +1 -1
  211. package/dist/lib/long-task-shape-primitives.js +1 -0
  212. package/dist/lib/long-task-source-item-parser.d.ts +2 -2
  213. package/dist/lib/long-task-source-item-parser.js +20 -11
  214. package/dist/lib/long-task-ui-design-policy.js +64 -4
  215. package/dist/lib/long-task-ui-surface-shape.js +195 -0
  216. package/dist/lib/long-task-ui-surface-types.d.ts +53 -0
  217. package/dist/lib/long-task-verifier-v2.js +1 -1
  218. package/dist/lib/long-task-worker-selection.d.ts +2 -0
  219. package/dist/lib/long-task-worker-selection.js +7 -0
  220. package/dist/lib/long-task-workspace-scope.js +3 -1
  221. package/dist/lib/long-task-workspace.js +11 -1
  222. package/dist/lib/migrations.js +58 -0
  223. package/dist/lib/profiles.js +0 -1
  224. package/dist/lib/semantic-fact-compact-authoring.d.ts +2 -0
  225. package/dist/lib/semantic-fact-compact-authoring.js +160 -0
  226. package/dist/lib/semantic-fact-compact-capacity.d.ts +9 -0
  227. package/dist/lib/semantic-fact-compact-capacity.js +40 -0
  228. package/dist/lib/semantic-fact-compact-carrier.d.ts +16 -0
  229. package/dist/lib/semantic-fact-compact-carrier.js +146 -0
  230. package/dist/lib/semantic-fact-compact-parser.d.ts +17 -0
  231. package/dist/lib/semantic-fact-compact-parser.js +168 -0
  232. package/dist/lib/semantic-fact-compact-revision.d.ts +11 -0
  233. package/dist/lib/semantic-fact-compact-revision.js +64 -0
  234. package/dist/lib/semantic-fact-compact-support.d.ts +23 -0
  235. package/dist/lib/semantic-fact-compact-support.js +159 -0
  236. package/dist/lib/semantic-fact-policy-census.d.ts +1 -0
  237. package/dist/lib/semantic-fact-policy-census.js +43 -0
  238. package/dist/lib/semantic-fact-proof-shape.d.ts +1 -1
  239. package/dist/lib/semantic-fact-property-shape.d.ts +1 -1
  240. package/dist/lib/semantic-fact-source-parser.d.ts +5 -0
  241. package/dist/lib/semantic-fact-source-parser.js +47 -6
  242. package/dist/lib/structural-closure-cost.d.ts +79 -0
  243. package/dist/lib/structural-closure-cost.js +91 -0
  244. package/dist/lib/symbolic-denotation-dag-builder.d.ts +25 -0
  245. package/dist/lib/symbolic-denotation-dag-builder.js +176 -0
  246. package/dist/lib/symbolic-denotation-domain-validation.d.ts +3 -0
  247. package/dist/lib/symbolic-denotation-domain-validation.js +56 -0
  248. package/dist/lib/symbolic-denotation-engine.d.ts +32 -0
  249. package/dist/lib/symbolic-denotation-engine.js +140 -0
  250. package/dist/lib/symbolic-denotation-public.d.ts +11 -0
  251. package/dist/lib/symbolic-denotation-public.js +12 -0
  252. package/dist/lib/symbolic-denotation-runtime.d.ts +20 -0
  253. package/dist/lib/symbolic-denotation-runtime.js +90 -0
  254. package/dist/lib/symbolic-denotation-support.d.ts +11 -0
  255. package/dist/lib/symbolic-denotation-support.js +49 -0
  256. package/dist/lib/symbolic-denotation-types.d.ts +133 -0
  257. package/dist/lib/symbolic-denotation-types.js +18 -0
  258. package/dist/lib/symbolic-denotation-validation.d.ts +6 -0
  259. package/dist/lib/symbolic-denotation-validation.js +126 -0
  260. package/dist/lib/sync-engine.d.ts +1 -0
  261. package/dist/lib/sync-engine.js +4 -1
  262. package/dist/lib/upgrade.js +1 -0
  263. package/dist/long-task-hook.js +40 -1
  264. package/dist/public-types.d.ts +8 -0
  265. package/dist/public-types.js +1 -0
  266. package/dist/schemas/design-resource-symbolic-noninterference-artifact-v2.schema.json +289 -0
  267. package/dist/schemas/design-resource-symbolic-source-ir-v1.schema.json +130 -0
  268. package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +390 -5
  269. package/migrations/README.md +15 -15
  270. package/package.json +2 -2
  271. package/source-mappings.yaml +28 -25
  272. package/assets/skills/source-plan-authoring/SKILL.md +0 -14
@@ -0,0 +1,79 @@
1
+ import { validateDesignResourceLocatedDigest } from "./design-resource-fact-locator-validation.js";
2
+ import { validateSymbolicQuantifier, validateSymbolicRegionWithinReachable, } from "./design-resource-symbolic-region-validation.js";
3
+ import { assertNoUnprovedOmittedAxes } from "./design-resource-symbolic-safety-validation.js";
4
+ import { assertSameSet, invalid, requireKnownRefs, unique, } from "./design-resource-symbolic-validation-support.js";
5
+ export function validateSymbolicSubjectPopulationClosure(manifest, target, indexes, resources, contents, compilation) {
6
+ validateSubjects(manifest, target.key, indexes);
7
+ validatePopulations(manifest, target, indexes, resources, contents, compilation);
8
+ }
9
+ export function validateSymbolicCensusClosure(manifest, indexes) {
10
+ validateCensusClosure(manifest, indexes);
11
+ }
12
+ function validateSubjects(manifest, targetKey, indexes) {
13
+ const stableKeys = [];
14
+ for (const subject of manifest.subjects) {
15
+ if (!subject.stable_keys.length)
16
+ invalid("v2_subject_stable_keys_required", subject.key);
17
+ unique(subject.stable_keys, `v2_subject_stable_key_duplicate:${subject.key}`);
18
+ stableKeys.push(...subject.stable_keys);
19
+ assertSameSet(subject.target_refs, [targetKey], "v2_subject_target_mismatch", subject.key);
20
+ requireKnownRefs(subject.census_refs, indexes.census, "v2_subject_census_unknown");
21
+ if (subject.population_ref &&
22
+ !indexes.populations.has(subject.population_ref))
23
+ invalid("v2_subject_population_unknown", subject.key);
24
+ for (const ref of [
25
+ subject.parent_ref,
26
+ subject.instance_of_ref,
27
+ subject.override_of_ref,
28
+ subject.family_ref,
29
+ subject.portal_host_ref,
30
+ ])
31
+ if (ref !== null && !indexes.subjects.has(ref))
32
+ invalid("v2_subject_hierarchy_ref_unknown", `${subject.key}:${ref}`);
33
+ unique(subject.relation_endpoints.map((item) => item.role), `v2_relation_endpoint_role_duplicate:${subject.key}`);
34
+ for (const endpoint of subject.relation_endpoints)
35
+ if (!indexes.subjects.has(endpoint.subject_ref))
36
+ invalid("v2_relation_endpoint_subject_unknown", `${subject.key}:${endpoint.subject_ref}`);
37
+ if (subject.kind === "relation" && subject.relation_endpoints.length < 2)
38
+ invalid("v2_relation_endpoints_incomplete", subject.key);
39
+ if (subject.presence === "always" && subject.presence_rule_ref !== null)
40
+ invalid("v2_subject_always_presence_rule_forbidden", subject.key);
41
+ }
42
+ unique(stableKeys, "v2_subject_stable_key_ambiguous");
43
+ }
44
+ function validatePopulations(manifest, target, indexes, resources, contents, compilation) {
45
+ const targetResources = new Set(target.resource_refs);
46
+ for (const population of manifest.populations) {
47
+ requireKnownRefs(population.member_subject_refs, indexes.subjects, "v2_population_subject_unknown");
48
+ assertSameSet(population.member_subject_refs, manifest.subjects
49
+ .filter((subject) => subject.population_ref === population.key)
50
+ .map((subject) => subject.key), "v2_population_member_set_mismatch", population.key);
51
+ if ((population.kind === "static" && population.enumeration !== "complete") ||
52
+ (population.kind === "dynamic" &&
53
+ population.enumeration !== "symbolic_partition"))
54
+ invalid("v2_population_enumeration_mismatch", population.key);
55
+ validateDesignResourceLocatedDigest(population.universe, resources, contents, `v2.population.${population.key}.universe`);
56
+ if (!targetResources.has(population.universe.locator.resource_ref))
57
+ invalid("v2_population_resource_outside_target", population.key);
58
+ validateSymbolicQuantifier(population.quantifier, population.key);
59
+ unique(population.exclusions.map((item) => item.key), `v2_population_exclusion_key_duplicate:${population.key}`);
60
+ for (const exclusion of population.exclusions) {
61
+ if (!exclusion.basis_refs.length)
62
+ invalid("v2_population_exclusion_basis_required", exclusion.key);
63
+ const compiled = compilation.compile(exclusion.region);
64
+ assertNoUnprovedOmittedAxes(compiled, exclusion.key);
65
+ validateSymbolicRegionWithinReachable(exclusion.region, manifest.reachable_region, exclusion.key, compilation);
66
+ }
67
+ }
68
+ }
69
+ function validateCensusClosure(manifest, indexes) {
70
+ const rules = new Map(manifest.fact_rules.map((item) => [item.key, item]));
71
+ for (const row of manifest.inspector.census) {
72
+ requireKnownRefs(row.fact_refs, rules, "v2_census_rule_unknown");
73
+ requireKnownRefs(row.source_item_refs, indexes.sourceItems, "v2_census_source_item_unknown");
74
+ if (!row.source_item_refs.length || !row.basis_refs.length)
75
+ invalid("v2_census_basis_source_required", row.key);
76
+ unique(row.fact_refs, `v2_census_rule_ref_duplicate:${row.key}`);
77
+ assertSameSet(row.fact_refs, (indexes.rulesByCensus.get(row.key) ?? []).map((rule) => rule.key), "v2_census_rule_set_mismatch", row.key);
78
+ }
79
+ }
@@ -0,0 +1,29 @@
1
+ import type { DesignResourceObservableRuleManifestV2, DesignResourceSymbolicDependencyEdgeV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicNoninterferenceCertificateV2 } from "./design-resource-symbolic-fact-types.js";
2
+ export declare function designResourceSymbolicRuleKey(rule: Omit<DesignResourceSymbolicFactRuleV2, "key" | "semantic_obligation_refs">, regionSha256: string): string;
3
+ export declare function designResourceSymbolicObligationKey(obligation: Omit<DesignResourceObservableRuleManifestV2["semantic_proof_obligations"][number], "key">): string;
4
+ export declare function designResourceSymbolicDependencyEdge(axisRef: string, factRuleRef: string): DesignResourceSymbolicDependencyEdgeV2;
5
+ export declare function designResourceSymbolicCertificateKey(certificate: Omit<DesignResourceSymbolicNoninterferenceCertificateV2, "key">): string;
6
+ export declare function designResourceSymbolicNoninterferenceProofDigest(proof: DesignResourceSymbolicNoninterferenceCertificateV2["source_noninterference_proof"]): string | null;
7
+ export declare function designResourceSymbolicCombinedRuleDigest(ruleProjections: Array<{
8
+ rule: {
9
+ key: string;
10
+ };
11
+ compiled_region: {
12
+ canonical_sha256: string;
13
+ };
14
+ }>): string;
15
+ export declare function omitRuleIdentityFields(rule: DesignResourceSymbolicFactRuleV2): Omit<DesignResourceSymbolicFactRuleV2, "key" | "semantic_obligation_refs">;
16
+ export declare function omitKey<T extends {
17
+ key: string;
18
+ }>(value: T): Omit<T, "key">;
19
+ export declare function requireExactRefs<T>(refs: string[], values: Map<string, T>, code: string): void;
20
+ export declare function requireKnownRefs(refs: string[], values: ReadonlyMap<string, unknown> | ReadonlySet<string>, code: string): void;
21
+ export declare function unique(values: string[], code: string): void;
22
+ export declare function assertSameSet(actual: string[], expected: string[], code: string, detail: string): void;
23
+ export declare function assertCanonicalSet<T extends {
24
+ key: string;
25
+ }>(actual: T[], expected: T[], code: string): void;
26
+ export declare function stableJson(value: unknown): string;
27
+ export declare function sha256(value: string): string;
28
+ export declare function compareText(left: string, right: string): number;
29
+ export declare function invalid(code: string, detail: string): never;
@@ -0,0 +1,111 @@
1
+ import { createHash } from "node:crypto";
2
+ import { invalidDesignResourceHandoff } from "./design-resource-handoff-validation-primitives.js";
3
+ const ALL_EFFECTS = [
4
+ "disposition",
5
+ "expected_semantics",
6
+ "proof_denotation",
7
+ ];
8
+ export function designResourceSymbolicRuleKey(rule, regionSha256) {
9
+ return `rule.${sha256(stableJson({
10
+ subject_or_relation_ref: rule.subject_or_relation_ref,
11
+ target_ref: rule.target_ref,
12
+ property_ref: rule.property_ref,
13
+ population_ref: rule.population_ref,
14
+ quantifier: rule.quantifier,
15
+ region_sha256: regionSha256,
16
+ expected: rule.expected,
17
+ value_kind: rule.value_kind,
18
+ provenance_ref: rule.provenance_ref,
19
+ observation_scope: rule.observation_scope,
20
+ observation_sensitivity: rule.observation_sensitivity,
21
+ lineage: rule.lineage,
22
+ evidence_refs: [...rule.evidence_refs].sort(compareText),
23
+ census_refs: [...rule.census_refs].sort(compareText),
24
+ source_item_refs: [...rule.source_item_refs].sort(compareText),
25
+ }))}`;
26
+ }
27
+ export function designResourceSymbolicObligationKey(obligation) {
28
+ return `obligation.${sha256(stableJson(obligation))}`;
29
+ }
30
+ export function designResourceSymbolicDependencyEdge(axisRef, factRuleRef) {
31
+ const body = {
32
+ axis_ref: axisRef,
33
+ fact_rule_ref: factRuleRef,
34
+ effects: [...ALL_EFFECTS],
35
+ };
36
+ return { key: `edge.${sha256(stableJson(body))}`, ...body };
37
+ }
38
+ export function designResourceSymbolicCertificateKey(certificate) {
39
+ return `certificate.${sha256(stableJson({
40
+ ...certificate,
41
+ fact_rule_refs: [...certificate.fact_rule_refs].sort(compareText),
42
+ omitted_axis_refs: [...certificate.omitted_axis_refs].sort(compareText),
43
+ dependency_edge_refs: [...certificate.dependency_edge_refs].sort(compareText),
44
+ }))}`;
45
+ }
46
+ export function designResourceSymbolicNoninterferenceProofDigest(proof) {
47
+ return proof ? sha256(stableJson(proof)) : null;
48
+ }
49
+ export function designResourceSymbolicCombinedRuleDigest(ruleProjections) {
50
+ return sha256(stableJson(ruleProjections
51
+ .map((projection) => ({
52
+ rule_ref: projection.rule.key,
53
+ region_sha256: projection.compiled_region.canonical_sha256,
54
+ }))
55
+ .sort((left, right) => compareText(left.rule_ref, right.rule_ref))));
56
+ }
57
+ export function omitRuleIdentityFields(rule) {
58
+ const { key: _key, semantic_obligation_refs: _refs, ...value } = rule;
59
+ return value;
60
+ }
61
+ export function omitKey(value) {
62
+ const { key: _key, ...rest } = value;
63
+ return rest;
64
+ }
65
+ export function requireExactRefs(refs, values, code) {
66
+ unique(refs, `${code}_duplicate`);
67
+ requireKnownRefs(refs, values, `${code}_unknown`);
68
+ }
69
+ export function requireKnownRefs(refs, values, code) {
70
+ for (const ref of refs)
71
+ if (!values.has(ref))
72
+ invalid(code, ref);
73
+ }
74
+ export function unique(values, code) {
75
+ if (new Set(values).size !== values.length)
76
+ invalid(code, "");
77
+ }
78
+ export function assertSameSet(actual, expected, code, detail) {
79
+ const left = [...new Set(actual)].sort(compareText);
80
+ const right = [...new Set(expected)].sort(compareText);
81
+ if (left.length !== right.length ||
82
+ left.some((item, index) => item !== right[index]))
83
+ invalid(code, `${detail}:${left.join(",")}:${right.join(",")}`);
84
+ }
85
+ export function assertCanonicalSet(actual, expected, code) {
86
+ const left = new Map(actual.map((item) => [item.key, stableJson(item)]));
87
+ const right = new Map(expected.map((item) => [item.key, stableJson(item)]));
88
+ assertSameSet([...left.keys()], [...right.keys()], code, "keys");
89
+ for (const [key, value] of right)
90
+ if (left.get(key) !== value)
91
+ invalid(code, key);
92
+ }
93
+ export function stableJson(value) {
94
+ if (Array.isArray(value))
95
+ return `[${value.map((item) => stableJson(item)).join(",")}]`;
96
+ if (value && typeof value === "object")
97
+ return `{${Object.entries(value)
98
+ .sort(([left], [right]) => compareText(left, right))
99
+ .map(([key, entry]) => `${JSON.stringify(key)}:${stableJson(entry)}`)
100
+ .join(",")}}`;
101
+ return JSON.stringify(value);
102
+ }
103
+ export function sha256(value) {
104
+ return createHash("sha256").update(value).digest("hex");
105
+ }
106
+ export function compareText(left, right) {
107
+ return left < right ? -1 : left > right ? 1 : 0;
108
+ }
109
+ export function invalid(code, detail) {
110
+ invalidDesignResourceHandoff(code, detail);
111
+ }
@@ -0,0 +1,8 @@
1
+ declare const V1_SCHEMA = "design-resource-observable-fact-manifest-v1";
2
+ export declare const DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE = "regenerate_as=design-resource-handoff-v2:fact_model=symbolic_rules_v2";
3
+ export interface DesignResourceV1CapacityHeader {
4
+ schema_version: typeof V1_SCHEMA;
5
+ collection_counts: ReadonlyMap<string, number>;
6
+ }
7
+ export declare function parseDesignResourceV1CapacityHeader(prefix: string): DesignResourceV1CapacityHeader;
8
+ export {};
@@ -0,0 +1,231 @@
1
+ import { invalidDesignResourceHandoff } from "./design-resource-handoff-validation-primitives.js";
2
+ import { DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY } from "./design-resource-symbolic-fact-policy.js";
3
+ const V1_SCHEMA = "design-resource-observable-fact-manifest-v1";
4
+ export const DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE = "regenerate_as=design-resource-handoff-v2:fact_model=symbolic_rules_v2";
5
+ export function parseDesignResourceV1CapacityHeader(prefix) {
6
+ try {
7
+ const reader = new BoundedJsonReader(prefix);
8
+ const header = reader.readRootHeader();
9
+ if (header.first_key !== "schema_version")
10
+ invalid("v1_manifest_capacity_header_order_invalid", `first_key=${header.first_key ?? "missing"}:required=schema_version`);
11
+ if (header.schema_version !== V1_SCHEMA)
12
+ invalid("v1_manifest_capacity_header_schema_invalid", `schema_version=${String(header.schema_version)}`);
13
+ if (!header.generation)
14
+ invalid("v1_manifest_capacity_header_missing_or_late", `prefix_limit=${DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY.v1_capacity.capacity_header_prefix_max_bytes}:${DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE}`);
15
+ const collections = objectValue(header.generation, "v1_manifest_capacity_header_generation_invalid").collections;
16
+ if (!Array.isArray(collections))
17
+ invalid("v1_manifest_capacity_header_collections_invalid", "not_array");
18
+ const collectionCounts = new Map();
19
+ for (const value of collections) {
20
+ const collection = objectValue(value, "v1_manifest_capacity_header_collection_invalid");
21
+ if (typeof collection.name !== "string" || !collection.name)
22
+ invalid("v1_manifest_capacity_header_collection_name_invalid", "");
23
+ if (typeof collection.expected_count !== "number" ||
24
+ !Number.isSafeInteger(collection.expected_count) ||
25
+ collection.expected_count < 0)
26
+ invalid("v1_manifest_capacity_header_expected_count_invalid", collection.name);
27
+ if (collectionCounts.has(collection.name))
28
+ invalid("v1_manifest_capacity_header_collection_duplicate", collection.name);
29
+ collectionCounts.set(collection.name, collection.expected_count);
30
+ }
31
+ return {
32
+ schema_version: V1_SCHEMA,
33
+ collection_counts: collectionCounts,
34
+ };
35
+ }
36
+ catch (error) {
37
+ if (error instanceof Error &&
38
+ error.message.startsWith("design_resource_handoff_invalid:"))
39
+ throw error;
40
+ const message = error instanceof Error ? error.message : String(error);
41
+ invalid("v1_manifest_capacity_header_missing_or_late", `prefix_limit=${DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY.v1_capacity.capacity_header_prefix_max_bytes}:reason=${message}:${DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE}`);
42
+ }
43
+ }
44
+ class BoundedJsonReader {
45
+ input;
46
+ offset = 0;
47
+ depth = 0;
48
+ constructor(input) {
49
+ this.input = input;
50
+ }
51
+ readRootHeader() {
52
+ this.whitespace();
53
+ this.character("{");
54
+ const result = {
55
+ first_key: null,
56
+ schema_version: undefined,
57
+ generation: undefined,
58
+ };
59
+ this.whitespace();
60
+ if (this.peek() === "}")
61
+ throw new Error("root_empty");
62
+ for (;;) {
63
+ const key = this.string();
64
+ result.first_key ??= key;
65
+ this.whitespace();
66
+ this.character(":");
67
+ this.whitespace();
68
+ const value = this.value();
69
+ if (key === "schema_version")
70
+ result.schema_version = value;
71
+ if (key === "generation") {
72
+ result.generation = value;
73
+ return result;
74
+ }
75
+ this.whitespace();
76
+ const delimiter = this.peek();
77
+ if (delimiter === "}")
78
+ return result;
79
+ this.character(",");
80
+ this.whitespace();
81
+ }
82
+ }
83
+ value() {
84
+ if (++this.depth > 64)
85
+ throw new Error("depth_limit");
86
+ try {
87
+ const next = this.peek();
88
+ if (next === '"')
89
+ return this.string();
90
+ if (next === "{")
91
+ return this.object();
92
+ if (next === "[")
93
+ return this.array();
94
+ if (next === "t")
95
+ return this.literal("true", true);
96
+ if (next === "f")
97
+ return this.literal("false", false);
98
+ if (next === "n")
99
+ return this.literal("null", null);
100
+ return this.number();
101
+ }
102
+ finally {
103
+ this.depth -= 1;
104
+ }
105
+ }
106
+ object() {
107
+ const value = {};
108
+ this.character("{");
109
+ this.whitespace();
110
+ if (this.peek() === "}") {
111
+ this.offset += 1;
112
+ return value;
113
+ }
114
+ for (;;) {
115
+ const key = this.string();
116
+ if (Object.hasOwn(value, key))
117
+ throw new Error(`duplicate_key:${key}`);
118
+ this.whitespace();
119
+ this.character(":");
120
+ this.whitespace();
121
+ value[key] = this.value();
122
+ this.whitespace();
123
+ if (this.peek() === "}") {
124
+ this.offset += 1;
125
+ return value;
126
+ }
127
+ this.character(",");
128
+ this.whitespace();
129
+ }
130
+ }
131
+ array() {
132
+ const value = [];
133
+ this.character("[");
134
+ this.whitespace();
135
+ if (this.peek() === "]") {
136
+ this.offset += 1;
137
+ return value;
138
+ }
139
+ for (;;) {
140
+ value.push(this.value());
141
+ this.whitespace();
142
+ if (this.peek() === "]") {
143
+ this.offset += 1;
144
+ return value;
145
+ }
146
+ this.character(",");
147
+ this.whitespace();
148
+ }
149
+ }
150
+ string() {
151
+ this.character('"');
152
+ let value = "";
153
+ for (;;) {
154
+ if (this.offset >= this.input.length)
155
+ throw new Error("prefix_ended");
156
+ const character = this.input[this.offset++];
157
+ if (character === '"')
158
+ return value;
159
+ if (character === "\\") {
160
+ if (this.offset >= this.input.length)
161
+ throw new Error("prefix_ended");
162
+ const escaped = this.input[this.offset++];
163
+ const simple = {
164
+ '"': '"',
165
+ "\\": "\\",
166
+ "/": "/",
167
+ b: "\b",
168
+ f: "\f",
169
+ n: "\n",
170
+ r: "\r",
171
+ t: "\t",
172
+ };
173
+ if (escaped in simple)
174
+ value += simple[escaped];
175
+ else if (escaped === "u") {
176
+ const hex = this.input.slice(this.offset, this.offset + 4);
177
+ if (!/^[0-9a-fA-F]{4}$/u.test(hex))
178
+ throw new Error("unicode_escape_invalid");
179
+ value += String.fromCharCode(Number.parseInt(hex, 16));
180
+ this.offset += 4;
181
+ }
182
+ else
183
+ throw new Error("escape_invalid");
184
+ }
185
+ else {
186
+ if (character.charCodeAt(0) < 0x20)
187
+ throw new Error("string_control_character");
188
+ value += character;
189
+ }
190
+ }
191
+ }
192
+ number() {
193
+ const remaining = this.input.slice(this.offset);
194
+ const match = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/u.exec(remaining);
195
+ if (!match)
196
+ throw new Error("number_invalid");
197
+ this.offset += match[0].length;
198
+ const value = Number(match[0]);
199
+ if (!Number.isFinite(value))
200
+ throw new Error("number_non_finite");
201
+ return value;
202
+ }
203
+ literal(token, value) {
204
+ if (this.input.slice(this.offset, this.offset + token.length) !== token)
205
+ throw new Error(`literal_invalid:${token}`);
206
+ this.offset += token.length;
207
+ return value;
208
+ }
209
+ whitespace() {
210
+ while (/\s/u.test(this.input[this.offset] ?? ""))
211
+ this.offset += 1;
212
+ }
213
+ character(expected) {
214
+ if (this.input[this.offset] !== expected)
215
+ throw new Error(`expected:${expected}:at=${this.offset}`);
216
+ this.offset += 1;
217
+ }
218
+ peek() {
219
+ if (this.offset >= this.input.length)
220
+ throw new Error("prefix_ended");
221
+ return this.input[this.offset];
222
+ }
223
+ }
224
+ function objectValue(value, code) {
225
+ if (!value || typeof value !== "object" || Array.isArray(value))
226
+ invalid(code, "not_object");
227
+ return value;
228
+ }
229
+ function invalid(code, detail) {
230
+ invalidDesignResourceHandoff(code, detail);
231
+ }
@@ -0,0 +1,5 @@
1
+ import { type DesignResourceV1CapacityHeader } from "./design-resource-v1-capacity-header.js";
2
+ export { parseDesignResourceV1CapacityHeader } from "./design-resource-v1-capacity-header.js";
3
+ export type { DesignResourceV1CapacityHeader } from "./design-resource-v1-capacity-header.js";
4
+ export declare function assertDesignResourceV1HandoffCapacity(file: string): Promise<void>;
5
+ export declare function assertDesignResourceV1ManifestCapacity(file: string): Promise<DesignResourceV1CapacityHeader>;
@@ -0,0 +1,45 @@
1
+ import { open, stat } from "node:fs/promises";
2
+ import { invalidDesignResourceHandoff } from "./design-resource-handoff-validation-primitives.js";
3
+ import { DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY } from "./design-resource-symbolic-fact-policy.js";
4
+ import { DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE, parseDesignResourceV1CapacityHeader, } from "./design-resource-v1-capacity-header.js";
5
+ export { parseDesignResourceV1CapacityHeader } from "./design-resource-v1-capacity-header.js";
6
+ export async function assertDesignResourceV1HandoffCapacity(file) {
7
+ const bytes = (await stat(file)).size;
8
+ const limit = DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY.v1_capacity.embedded_handoff_max_bytes;
9
+ if (bytes > limit)
10
+ invalid("v1_handoff_capacity_exceeded", `bytes=${bytes}:limit=${limit}:${DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE}`);
11
+ }
12
+ export async function assertDesignResourceV1ManifestCapacity(file) {
13
+ const bytes = (await stat(file)).size;
14
+ const policy = DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY.v1_capacity;
15
+ if (bytes > policy.canonical_manifest_max_bytes)
16
+ invalid("v1_manifest_capacity_exceeded", `bytes=${bytes}:limit=${policy.canonical_manifest_max_bytes}:${DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE}`);
17
+ const prefixBytes = Math.min(bytes, policy.capacity_header_prefix_max_bytes);
18
+ const buffer = Buffer.alloc(prefixBytes);
19
+ const handle = await open(file, "r");
20
+ try {
21
+ let offset = 0;
22
+ while (offset < prefixBytes) {
23
+ const result = await handle.read(buffer, offset, prefixBytes - offset, offset);
24
+ if (result.bytesRead === 0)
25
+ break;
26
+ offset += result.bytesRead;
27
+ }
28
+ if (offset !== prefixBytes)
29
+ invalid("v1_manifest_capacity_header_read_incomplete", `bytes_read=${offset}:expected=${prefixBytes}`);
30
+ }
31
+ finally {
32
+ await handle.close();
33
+ }
34
+ const text = new TextDecoder("utf-8", { fatal: true }).decode(buffer);
35
+ const header = parseDesignResourceV1CapacityHeader(text);
36
+ const expectedFactCells = header.collection_counts.get("fact_cells");
37
+ if (expectedFactCells === undefined)
38
+ invalid("v1_manifest_capacity_header_fact_cells_missing", DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE);
39
+ if (expectedFactCells > policy.expected_fact_cells_max)
40
+ invalid("v1_fact_cell_capacity_exceeded", `expected_count=${expectedFactCells}:limit=${policy.expected_fact_cells_max}:${DESIGN_RESOURCE_V1_REGENERATION_GUIDANCE}`);
41
+ return header;
42
+ }
43
+ function invalid(code, detail) {
44
+ invalidDesignResourceHandoff(code, detail);
45
+ }
package/dist/lib/init.js CHANGED
@@ -25,6 +25,7 @@ export async function runInit(projectRoot, options) {
25
25
  await createDesignMd(projectRoot, report);
26
26
  const syncReport = await runSync(projectRoot);
27
27
  report.push(`sync changed=${syncReport.changed.length} skipped=${syncReport.skipped.length} blocked=${syncReport.blocked.length}`);
28
+ report.push(...(syncReport.notices ?? []));
28
29
  report.push(options.adopt ? "adopt mode complete" : "init complete");
29
30
  return report;
30
31
  }
@@ -66,7 +66,7 @@ export async function validateContractForActivation(options) {
66
66
  const executionTarget = contract.task.execution_targets.find((target) => target.key === check.execution_target.target_ref);
67
67
  if (!executionTarget)
68
68
  continue;
69
- const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, null, repository, workspace, executionTarget, contract.task.execution_targets, [], []), null, check.key);
69
+ const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, null, repository, workspace, executionTarget, contract.task.execution_targets, [], [], context?.files ?? []), null, check.key);
70
70
  if (frozen)
71
71
  globalChecks.push(frozen);
72
72
  }
@@ -77,7 +77,7 @@ export async function validateContractForActivation(options) {
77
77
  const executionTarget = contract.task.execution_targets.find((target) => target.key === check.execution_target.target_ref);
78
78
  if (!executionTarget)
79
79
  continue;
80
- const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, outcome.key, repository, workspace, executionTarget, contract.task.execution_targets, designTargetsForCheck(outcome, check.key), semanticFactClosure?.expectations_by_check.get(check.key) ?? []), outcome.key, check.key);
80
+ const frozen = await attempt(mode, diagnostics, () => freezeDeliveryCheck(check, outcome.key, repository, workspace, executionTarget, contract.task.execution_targets, designTargetsForCheck(outcome, check.key), semanticFactClosure?.expectations_by_check.get(check.key) ?? [], context?.files ?? []), outcome.key, check.key);
81
81
  if (frozen)
82
82
  checks.push(frozen);
83
83
  }
@@ -161,6 +161,7 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
161
161
  };
162
162
  readonly design_target: {
163
163
  key: "identity";
164
+ fact_model: "semantic_user_review";
164
165
  interpretation: "semantic_user_review";
165
166
  source_paths: "scope";
166
167
  condition_keys: "semantic_user_review";
@@ -168,6 +169,8 @@ export declare const AUTHORITY_FIELD_POLICY_REGISTRIES: {
168
169
  conformance_check_ref: "proof_additive";
169
170
  conformance_assertion_ref: "proof_additive";
170
171
  verification_method_bindings: "proof_additive";
172
+ symbolic_method_bindings: "proof_additive";
173
+ symbolic_certificate_binding: "proof_additive";
171
174
  actual_artifact_path: "output_requirement";
172
175
  comparison_artifact_path: "output_requirement";
173
176
  };
@@ -144,6 +144,7 @@ const SURFACE_BINDING_AUTHORITY_POLICY = {
144
144
  };
145
145
  const DESIGN_TARGET_AUTHORITY_POLICY = {
146
146
  key: "identity",
147
+ fact_model: "semantic_user_review",
147
148
  interpretation: "semantic_user_review",
148
149
  source_paths: "scope",
149
150
  condition_keys: "semantic_user_review",
@@ -151,6 +152,8 @@ const DESIGN_TARGET_AUTHORITY_POLICY = {
151
152
  conformance_check_ref: "proof_additive",
152
153
  conformance_assertion_ref: "proof_additive",
153
154
  verification_method_bindings: "proof_additive",
155
+ symbolic_method_bindings: "proof_additive",
156
+ symbolic_certificate_binding: "proof_additive",
154
157
  actual_artifact_path: "output_requirement",
155
158
  comparison_artifact_path: "output_requirement",
156
159
  };
@@ -0,0 +1,42 @@
1
+ import { type Stats } from "node:fs";
2
+ import type { SyncReport } from "./sync-engine.js";
3
+ export declare const LONG_TASK_CODEX_AGENT_PROFILE_RELATIVE_PATH = ".codex/agents/long-task-implementation.toml";
4
+ export declare const LONG_TASK_CODEX_AGENT_PROFILE_MANAGED_MARKER = "# ty-context:managed:long-task-implementation-worker";
5
+ export interface LongTaskCodexAgentProfile {
6
+ name: "long_task_implementation";
7
+ description: string;
8
+ developer_instructions: string;
9
+ model: string;
10
+ model_reasoning_effort: string;
11
+ agents: {
12
+ enabled: false;
13
+ };
14
+ }
15
+ export type LongTaskCodexAgentProfileValidation = {
16
+ valid: true;
17
+ profile: LongTaskCodexAgentProfile;
18
+ } | {
19
+ valid: false;
20
+ errors: string[];
21
+ };
22
+ export interface LongTaskCodexAgentProfileFileOperations {
23
+ lstat(target: string): Promise<Stats>;
24
+ realpath(target: string): Promise<string>;
25
+ readFile(target: string, encoding: "utf8"): Promise<string>;
26
+ mkdir(target: string, options: {
27
+ recursive: true;
28
+ }): Promise<unknown>;
29
+ writeFile(target: string, content: string, options: {
30
+ flag: "wx";
31
+ }): Promise<void>;
32
+ rename(source: string, destination: string): Promise<void>;
33
+ rm(target: string, options: {
34
+ force: true;
35
+ }): Promise<void>;
36
+ randomId(): string;
37
+ }
38
+ export declare function parseAndValidateLongTaskCodexAgentProfile(content: string): LongTaskCodexAgentProfileValidation;
39
+ export declare function syncLongTaskCodexAgentProfile(projectRoot: string, resolvedHarnessRoot: string, enabled: boolean, report: SyncReport, fileOperations?: Partial<LongTaskCodexAgentProfileFileOperations>): Promise<void>;
40
+ export declare function longTaskCodexAgentProfileBootstrapPaths(projectRoot: string, resolvedHarnessRoot: string, enabled: boolean, fileOperations?: Partial<LongTaskCodexAgentProfileFileOperations>): Promise<string[]>;
41
+ export declare function isManagedLongTaskCodexAgentProfile(content: string): boolean;
42
+ export declare function atomicWriteLongTaskCodexAgentProfile(destination: string, content: string, operations?: LongTaskCodexAgentProfileFileOperations, beforeRename?: () => Promise<void>): Promise<void>;