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
@@ -1,13 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import { readActiveLongTaskBinding } from "./lib/long-task-state.js";
3
3
  import { stopCheckDeliveryTask } from "./lib/long-task-status-v2.js";
4
+ import { LONG_TASK_IMPLEMENTATION_AGENT, selectedAgentType, } from "./lib/long-task-worker-selection.js";
4
5
  import { repositoryRoot } from "./lib/long-task-workspace.js";
6
+ const LONG_TASK_IMPLEMENTATION_BOUNDARY = [
7
+ "This is a delegated rolling implementation worker, not the parent Long-Task Goal.",
8
+ "Follow only the bounded packet from the parent.",
9
+ "Do not run long-task resume, Preflight, Compile, Authority Revision, verify as formal Progress, Final Gate, Stop/close, abandon, or completion.",
10
+ "The parent Goal owns Source, Contract, Authority, Context writeback, integration and formal acceptance.",
11
+ "Your report is advisory and is not Progress, Evidence or acceptance.",
12
+ ].join("\n");
13
+ const AGENT_SPAWN_TOOLS = new Set(["spawn_agent", "Agent"]);
14
+ const EXACT_WORKER_REQUIRED = "Active Tiny Context Long-Task permits delegation only to the exact custom agent long_task_implementation. The current host request does not explicitly select it. Do not substitute a generic worker; complete this packet in the parent Goal.";
5
15
  const input = await readStdin();
16
+ const isAgentSpawnPreToolUse = input.hook_event_name === "PreToolUse" &&
17
+ AGENT_SPAWN_TOOLS.has(input.tool_name ?? "");
18
+ if (input.hook_event_name === "PreToolUse" && !isAgentSpawnPreToolUse)
19
+ output({});
6
20
  try {
7
21
  const root = await repositoryRoot(input.cwd || process.cwd());
8
22
  const active = await readActiveLongTaskBinding(root);
9
23
  if (!active)
10
24
  output({});
25
+ if (isAgentSpawnPreToolUse) {
26
+ if (selectedAgentType(input.tool_input) === LONG_TASK_IMPLEMENTATION_AGENT)
27
+ output({});
28
+ denyAgentSpawn(EXACT_WORKER_REQUIRED);
29
+ }
30
+ if (input.hook_event_name === "SubagentStart")
31
+ output(input.agent_type === LONG_TASK_IMPLEMENTATION_AGENT
32
+ ? {
33
+ hookSpecificOutput: {
34
+ hookEventName: "SubagentStart",
35
+ additionalContext: LONG_TASK_IMPLEMENTATION_BOUNDARY,
36
+ },
37
+ }
38
+ : {});
11
39
  if (input.hook_event_name === "SessionStart" ||
12
40
  input.hook_event_name === "PostCompact")
13
41
  output({
@@ -35,7 +63,9 @@ try {
35
63
  });
36
64
  }
37
65
  catch (error) {
38
- const reason = `Long-task Live Final Gate failed closed: ${message(error)}`;
66
+ const reason = `Tiny Context Long-Task Hook failed closed: ${message(error)}`;
67
+ if (isAgentSpawnPreToolUse)
68
+ denyAgentSpawn(`${reason} Do not spawn a substitute agent; complete the packet in the parent Goal.`);
39
69
  if (input.hook_event_name === "Stop")
40
70
  output({ decision: "block", reason });
41
71
  output({ continue: false, stopReason: reason });
@@ -50,6 +80,15 @@ function output(value) {
50
80
  process.stdout.write(`${JSON.stringify(value)}\n`);
51
81
  process.exit(0);
52
82
  }
83
+ function denyAgentSpawn(reason) {
84
+ output({
85
+ hookSpecificOutput: {
86
+ hookEventName: "PreToolUse",
87
+ permissionDecision: "deny",
88
+ permissionDecisionReason: reason,
89
+ },
90
+ });
91
+ }
53
92
  function message(error) {
54
93
  return error instanceof Error ? error.message : String(error);
55
94
  }
@@ -0,0 +1,8 @@
1
+ export type { HarnessConfig, HarnessProfile, ManagedFile, SourceMapping, } from "./lib/types.js";
2
+ export type { CheckExecutionResultV2, CompiledDeliveryContractV2, DeliveryAssertionV2, DeliveryCheckV2, DeliveryContractV2, DeliveryOutcomeV2, EffectiveRiskLevel, ExternalConfirmationV2, FinalReceiptV2, LongTaskFindingV2, LongTaskRiskFacts, ProofSurface, ProgressRecordV2, RequestedRiskLevel, RunnerType, SourceClaimV2, TargetedVerificationResultV2, } from "./lib/long-task-delivery-types.js";
3
+ export type { BoundaryCheckDecisionV2, BoundaryCheckInputV2, } from "./lib/long-task-boundary-check.js";
4
+ export type { DesignResourceHandoffBundleOptions, DesignResourceHandoffBundleResult, } from "./lib/design-resource-handoff-bundle.js";
5
+ export type { DesignResourceHandoffPreflightV1, DesignResourceHandoffV1, } from "./lib/design-resource-handoff-types.js";
6
+ export type { DesignResourceHandoffPreflightV2, DesignResourceHandoffV2, DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicNoninterferenceCertificateV2, DesignResourceSymbolicNoninterferenceArtifactV2, DesignResourceSymbolicNoninterferenceDerivedResultV2, DesignResourceSymbolicNoninterferenceFailureWitnessV1, DesignResourceSymbolicNoninterferenceInputBindingV2, DesignResourceSymbolicNoninterferenceProofV2, DesignResourceSymbolicProofObligationV2, } from "./lib/design-resource-symbolic-fact-types.js";
7
+ export type { DesignResourceSymbolicSourceIrCertificateScopeV1, DesignResourceSymbolicSourceIrRegionV1, DesignResourceSymbolicSourceIrV1, } from "./lib/design-resource-symbolic-source-ir-types.js";
8
+ export type { CompiledSymbolicDenotationV1, SymbolicDenotationAxisDomain, SymbolicDenotationComplexityLimits, SymbolicDenotationPredicate, SymbolicExtensionalPointV1, SymbolicPointDenotationV1, } from "./lib/symbolic-denotation-types.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,289 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Seven128/project-tiny-context-harness/schemas/design-resource-symbolic-noninterference-artifact-v2.schema.json",
4
+ "title": "Project Tiny Context Symbolic Non-Interference Artifact v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "side",
10
+ "method",
11
+ "oracle_identity",
12
+ "oracle_version",
13
+ "oracle_implementation_sha256",
14
+ "oracle_capability",
15
+ "environment_sha256",
16
+ "input_resources",
17
+ "input_snapshot_sha256",
18
+ "source_manifest_snapshot_sha256",
19
+ "target_snapshot_sha256",
20
+ "certificate_scope_sha256",
21
+ "rule_scope_sha256",
22
+ "omitted_axis_refs",
23
+ "derived_result",
24
+ "method_result_sha256",
25
+ "verdict",
26
+ "failure_witness"
27
+ ],
28
+ "properties": {
29
+ "schema_version": {
30
+ "const": "design-resource-symbolic-noninterference-artifact-v2"
31
+ },
32
+ "side": { "enum": ["source", "production"] },
33
+ "method": { "$ref": "#/$defs/method" },
34
+ "oracle_identity": { "$ref": "#/$defs/nonemptyString" },
35
+ "oracle_version": { "$ref": "#/$defs/nonemptyString" },
36
+ "oracle_implementation_sha256": { "$ref": "#/$defs/sha256" },
37
+ "oracle_capability": { "$ref": "#/$defs/nonemptyString" },
38
+ "environment_sha256": { "$ref": "#/$defs/sha256" },
39
+ "input_resources": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "items": { "$ref": "#/$defs/inputBinding" }
43
+ },
44
+ "input_snapshot_sha256": { "$ref": "#/$defs/sha256" },
45
+ "source_manifest_snapshot_sha256": {
46
+ "oneOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }]
47
+ },
48
+ "target_snapshot_sha256": { "$ref": "#/$defs/sha256" },
49
+ "certificate_scope_sha256": { "$ref": "#/$defs/sha256" },
50
+ "rule_scope_sha256": { "$ref": "#/$defs/sha256" },
51
+ "omitted_axis_refs": {
52
+ "type": "array",
53
+ "uniqueItems": true,
54
+ "items": { "$ref": "#/$defs/stableKey" }
55
+ },
56
+ "derived_result": { "$ref": "#/$defs/derivedResult" },
57
+ "method_result_sha256": { "$ref": "#/$defs/sha256" },
58
+ "verdict": { "enum": ["passed", "failed"] },
59
+ "failure_witness": {
60
+ "oneOf": [{ "$ref": "#/$defs/failureWitness" }, { "type": "null" }]
61
+ }
62
+ },
63
+ "allOf": [
64
+ {
65
+ "if": {
66
+ "properties": { "side": { "const": "source" } },
67
+ "required": ["side"]
68
+ },
69
+ "then": {
70
+ "properties": {
71
+ "source_manifest_snapshot_sha256": { "$ref": "#/$defs/sha256" }
72
+ }
73
+ },
74
+ "else": {
75
+ "properties": {
76
+ "source_manifest_snapshot_sha256": { "type": "null" }
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "if": {
82
+ "properties": { "verdict": { "const": "passed" } },
83
+ "required": ["verdict"]
84
+ },
85
+ "then": { "properties": { "failure_witness": { "type": "null" } } },
86
+ "else": {
87
+ "properties": {
88
+ "failure_witness": { "$ref": "#/$defs/failureWitness" }
89
+ }
90
+ }
91
+ }
92
+ ],
93
+ "$defs": {
94
+ "nonemptyString": { "type": "string", "minLength": 1 },
95
+ "stableKey": {
96
+ "type": "string",
97
+ "minLength": 1,
98
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
99
+ },
100
+ "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
101
+ "method": {
102
+ "enum": [
103
+ "closed_world_static_dependency_closure",
104
+ "restricted_ir_symbolic_equivalence",
105
+ "finite_complete_domain_exhaustive_equivalence"
106
+ ]
107
+ },
108
+ "scalar": {
109
+ "oneOf": [{ "type": "string" }, { "type": "number" }]
110
+ },
111
+ "inputBinding": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["resource_ref", "path", "declared_sha256", "current_sha256"],
115
+ "properties": {
116
+ "resource_ref": { "$ref": "#/$defs/stableKey" },
117
+ "path": { "$ref": "#/$defs/nonemptyString" },
118
+ "declared_sha256": { "$ref": "#/$defs/sha256" },
119
+ "current_sha256": { "$ref": "#/$defs/sha256" }
120
+ }
121
+ },
122
+ "dependencyNode": {
123
+ "type": "object",
124
+ "additionalProperties": false,
125
+ "required": [
126
+ "key",
127
+ "axis_refs",
128
+ "dependency_refs",
129
+ "input_resource_refs"
130
+ ],
131
+ "properties": {
132
+ "key": { "$ref": "#/$defs/stableKey" },
133
+ "axis_refs": {
134
+ "type": "array",
135
+ "uniqueItems": true,
136
+ "items": { "$ref": "#/$defs/stableKey" }
137
+ },
138
+ "dependency_refs": {
139
+ "type": "array",
140
+ "uniqueItems": true,
141
+ "items": { "$ref": "#/$defs/stableKey" }
142
+ },
143
+ "input_resource_refs": {
144
+ "type": "array",
145
+ "uniqueItems": true,
146
+ "items": { "$ref": "#/$defs/stableKey" }
147
+ }
148
+ }
149
+ },
150
+ "dependencyRoot": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": ["fact_rule_refs", "node_ref"],
154
+ "properties": {
155
+ "fact_rule_refs": {
156
+ "oneOf": [
157
+ {
158
+ "type": "array",
159
+ "minItems": 1,
160
+ "uniqueItems": true,
161
+ "items": { "$ref": "#/$defs/stableKey" }
162
+ },
163
+ { "type": "null" }
164
+ ]
165
+ },
166
+ "node_ref": { "$ref": "#/$defs/stableKey" }
167
+ }
168
+ },
169
+ "equivalenceCase": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["fact_rule_refs", "side_predicate", "axis_erased_predicate"],
173
+ "properties": {
174
+ "fact_rule_refs": {
175
+ "type": "array",
176
+ "minItems": 1,
177
+ "uniqueItems": true,
178
+ "items": { "$ref": "#/$defs/stableKey" }
179
+ },
180
+ "side_predicate": {
181
+ "$ref": "design-resource-symbolic-source-ir-v1.schema.json#/$defs/predicate"
182
+ },
183
+ "axis_erased_predicate": {
184
+ "$ref": "design-resource-symbolic-source-ir-v1.schema.json#/$defs/predicate"
185
+ }
186
+ }
187
+ },
188
+ "derivedResult": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": [
192
+ "source_ir_resource_ref",
193
+ "static_dependency_nodes",
194
+ "static_rule_roots",
195
+ "equivalence_cases",
196
+ "complete_domain_cardinality",
197
+ "exhaustive_evaluation_sha256"
198
+ ],
199
+ "properties": {
200
+ "source_ir_resource_ref": {
201
+ "oneOf": [{ "$ref": "#/$defs/stableKey" }, { "type": "null" }]
202
+ },
203
+ "static_dependency_nodes": {
204
+ "type": "array",
205
+ "items": { "$ref": "#/$defs/dependencyNode" }
206
+ },
207
+ "static_rule_roots": {
208
+ "type": "array",
209
+ "items": { "$ref": "#/$defs/dependencyRoot" }
210
+ },
211
+ "equivalence_cases": {
212
+ "type": "array",
213
+ "items": { "$ref": "#/$defs/equivalenceCase" }
214
+ },
215
+ "complete_domain_cardinality": {
216
+ "oneOf": [
217
+ { "type": "string", "pattern": "^(?:0|[1-9][0-9]*)$" },
218
+ { "type": "null" }
219
+ ]
220
+ },
221
+ "exhaustive_evaluation_sha256": {
222
+ "oneOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }]
223
+ }
224
+ }
225
+ },
226
+ "failureWitness": {
227
+ "type": "object",
228
+ "additionalProperties": false,
229
+ "required": [
230
+ "kind",
231
+ "side",
232
+ "certificate_scope_sha256",
233
+ "axis_ref",
234
+ "fact_rule_ref",
235
+ "resource_ref",
236
+ "path",
237
+ "locator",
238
+ "node_ref",
239
+ "byte_offset",
240
+ "assignment",
241
+ "detail"
242
+ ],
243
+ "properties": {
244
+ "kind": {
245
+ "enum": [
246
+ "omitted_axis_dependency",
247
+ "unsupported_dependency",
248
+ "source_rule_denotation_mismatch",
249
+ "complete_domain_counterexample"
250
+ ]
251
+ },
252
+ "side": { "enum": ["source", "production"] },
253
+ "certificate_scope_sha256": { "$ref": "#/$defs/sha256" },
254
+ "axis_ref": {
255
+ "oneOf": [{ "$ref": "#/$defs/stableKey" }, { "type": "null" }]
256
+ },
257
+ "fact_rule_ref": {
258
+ "oneOf": [{ "$ref": "#/$defs/stableKey" }, { "type": "null" }]
259
+ },
260
+ "resource_ref": {
261
+ "oneOf": [{ "$ref": "#/$defs/stableKey" }, { "type": "null" }]
262
+ },
263
+ "path": {
264
+ "oneOf": [{ "$ref": "#/$defs/nonemptyString" }, { "type": "null" }]
265
+ },
266
+ "locator": {
267
+ "oneOf": [{ "$ref": "#/$defs/nonemptyString" }, { "type": "null" }]
268
+ },
269
+ "node_ref": {
270
+ "oneOf": [{ "$ref": "#/$defs/stableKey" }, { "type": "null" }]
271
+ },
272
+ "byte_offset": {
273
+ "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }]
274
+ },
275
+ "assignment": {
276
+ "oneOf": [
277
+ {
278
+ "type": "object",
279
+ "propertyNames": { "$ref": "#/$defs/stableKey" },
280
+ "additionalProperties": { "$ref": "#/$defs/scalar" }
281
+ },
282
+ { "type": "null" }
283
+ ]
284
+ },
285
+ "detail": { "$ref": "#/$defs/nonemptyString" }
286
+ }
287
+ }
288
+ }
289
+ }
@@ -0,0 +1,130 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Seven128/project-tiny-context-harness/schemas/design-resource-symbolic-source-ir-v1.schema.json",
4
+ "title": "Project Tiny Context Symbolic Source IR v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "target_ref", "certificate_scopes"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "design-resource-symbolic-source-ir-v1"
11
+ },
12
+ "target_ref": {
13
+ "$ref": "#/$defs/stableKey"
14
+ },
15
+ "certificate_scopes": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": [
22
+ "certificate_scope_sha256",
23
+ "rule_scope_sha256",
24
+ "regions"
25
+ ],
26
+ "properties": {
27
+ "certificate_scope_sha256": { "$ref": "#/$defs/sha256" },
28
+ "rule_scope_sha256": { "$ref": "#/$defs/sha256" },
29
+ "regions": {
30
+ "type": "array",
31
+ "minItems": 1,
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["rule_region_sha256", "predicate"],
36
+ "properties": {
37
+ "rule_region_sha256": { "$ref": "#/$defs/sha256" },
38
+ "predicate": { "$ref": "#/$defs/predicate" }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "$defs": {
47
+ "stableKey": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
51
+ },
52
+ "sha256": {
53
+ "type": "string",
54
+ "pattern": "^[a-f0-9]{64}$"
55
+ },
56
+ "scalar": {
57
+ "oneOf": [{ "type": "string" }, { "type": "number" }]
58
+ },
59
+ "predicate": {
60
+ "oneOf": [
61
+ {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["op", "axis_ref", "value"],
65
+ "properties": {
66
+ "op": { "const": "eq" },
67
+ "axis_ref": { "$ref": "#/$defs/stableKey" },
68
+ "value": { "$ref": "#/$defs/scalar" }
69
+ }
70
+ },
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["op", "axis_ref", "values"],
75
+ "properties": {
76
+ "op": { "const": "in" },
77
+ "axis_ref": { "$ref": "#/$defs/stableKey" },
78
+ "values": {
79
+ "type": "array",
80
+ "minItems": 1,
81
+ "items": { "$ref": "#/$defs/scalar" }
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": [
89
+ "op",
90
+ "axis_ref",
91
+ "minimum",
92
+ "maximum",
93
+ "minimum_inclusive",
94
+ "maximum_inclusive"
95
+ ],
96
+ "properties": {
97
+ "op": { "const": "range" },
98
+ "axis_ref": { "$ref": "#/$defs/stableKey" },
99
+ "minimum": { "type": "number" },
100
+ "maximum": { "type": "number" },
101
+ "minimum_inclusive": { "type": "boolean" },
102
+ "maximum_inclusive": { "type": "boolean" }
103
+ }
104
+ },
105
+ {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "required": ["op", "predicates"],
109
+ "properties": {
110
+ "op": { "enum": ["all", "any"] },
111
+ "predicates": {
112
+ "type": "array",
113
+ "minItems": 1,
114
+ "items": { "$ref": "#/$defs/predicate" }
115
+ }
116
+ }
117
+ },
118
+ {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["op", "predicate"],
122
+ "properties": {
123
+ "op": { "const": "not" },
124
+ "predicate": { "$ref": "#/$defs/predicate" }
125
+ }
126
+ }
127
+ ]
128
+ }
129
+ }
130
+ }