zob-harness 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/.pi/adapters/registry.json +103 -0
  2. package/.pi/agents/architecture-cartographer.md +53 -0
  3. package/.pi/agents/chief-vision.md +39 -0
  4. package/.pi/agents/clarifier.md +58 -0
  5. package/.pi/agents/context-steward.md +52 -0
  6. package/.pi/agents/doc-steward.md +34 -0
  7. package/.pi/agents/explore.md +49 -0
  8. package/.pi/agents/factory.md +41 -0
  9. package/.pi/agents/implementer.md +44 -0
  10. package/.pi/agents/librarian.md +32 -0
  11. package/.pi/agents/oracle-merge.md +50 -0
  12. package/.pi/agents/oracle.md +55 -0
  13. package/.pi/agents/pattern-miner.md +53 -0
  14. package/.pi/agents/planner.md +39 -0
  15. package/.pi/agents/project-dna-golden-evaluator.md +32 -0
  16. package/.pi/agents/project-dna-ontology-steward.md +30 -0
  17. package/.pi/agents/project-dna-oracle.md +56 -0
  18. package/.pi/agents/project-dna-orchestrator.md +60 -0
  19. package/.pi/agents/project-dna-query-steward.md +38 -0
  20. package/.pi/agents/project-dna-safety-preflight.md +54 -0
  21. package/.pi/agents/project-dna-test-linker.md +27 -0
  22. package/.pi/agents/qa.md +38 -0
  23. package/.pi/agents/refactor-cartographer.md +28 -0
  24. package/.pi/agents/refactor-mover.md +31 -0
  25. package/.pi/agents/refactor-oracle.md +49 -0
  26. package/.pi/agents/repo-scout.md +60 -0
  27. package/.pi/agents/sample-architect.md +48 -0
  28. package/.pi/agents/specifier.md +57 -0
  29. package/.pi/agents/symbol-range-curator.md +41 -0
  30. package/.pi/agents/synthesis.md +52 -0
  31. package/.pi/agents/temp-agent-creator.md +35 -0
  32. package/.pi/autonomy-policy.json +67 -0
  33. package/.pi/budget-policy.json +54 -0
  34. package/.pi/capabilities/zob-public-runtime-capabilities.json +1700 -0
  35. package/.pi/chains/explore-plan-oracle.json +78 -0
  36. package/.pi/chains/explore-spec-clarify-plan-oracle.json +64 -0
  37. package/.pi/chains/explore-spec-plan-oracle.json +53 -0
  38. package/.pi/chains/spec-clarify-plan-oracle.json +53 -0
  39. package/.pi/chains/spec-factory-oracle.json +42 -0
  40. package/.pi/chains/spec-plan-oracle.json +42 -0
  41. package/.pi/compute-profiles/defaults.json +19 -0
  42. package/.pi/compute-profiles/overrides.json +13 -0
  43. package/.pi/compute-profiles/risk-rules.json +16 -0
  44. package/.pi/daemon-policy.json +80 -0
  45. package/.pi/damage-control-rules.json +45 -0
  46. package/.pi/extensions/zob-child-safety/index.ts +212 -0
  47. package/.pi/extensions/zob-harness/AGENTS.md +28 -0
  48. package/.pi/extensions/zob-harness/index.ts +391 -0
  49. package/.pi/extensions/zob-harness/src/AGENTS.md +25 -0
  50. package/.pi/extensions/zob-harness/src/agents.ts +82 -0
  51. package/.pi/extensions/zob-harness/src/autonomous-runtime.ts +2912 -0
  52. package/.pi/extensions/zob-harness/src/autonomy-readiness.ts +778 -0
  53. package/.pi/extensions/zob-harness/src/budget-policy.ts +308 -0
  54. package/.pi/extensions/zob-harness/src/capabilities.ts +249 -0
  55. package/.pi/extensions/zob-harness/src/child-runner.ts +249 -0
  56. package/.pi/extensions/zob-harness/src/chronicle.ts +262 -0
  57. package/.pi/extensions/zob-harness/src/compute-profile.ts +602 -0
  58. package/.pi/extensions/zob-harness/src/compute-workflow-shape.ts +168 -0
  59. package/.pi/extensions/zob-harness/src/coms-v2/AGENTS.md +16 -0
  60. package/.pi/extensions/zob-harness/src/coms-v2/envelope.ts +121 -0
  61. package/.pi/extensions/zob-harness/src/coms-v2/identity.ts +53 -0
  62. package/.pi/extensions/zob-harness/src/coms-v2/ledger-bridge.ts +67 -0
  63. package/.pi/extensions/zob-harness/src/coms-v2/local-transport.ts +147 -0
  64. package/.pi/extensions/zob-harness/src/coms-v2/pending-replies.ts +80 -0
  65. package/.pi/extensions/zob-harness/src/coms-v2/policy.ts +125 -0
  66. package/.pi/extensions/zob-harness/src/coms-v2/presence.ts +55 -0
  67. package/.pi/extensions/zob-harness/src/coms-v2/registry.ts +113 -0
  68. package/.pi/extensions/zob-harness/src/coms-v2/response-capture.ts +50 -0
  69. package/.pi/extensions/zob-harness/src/coms-v2/transcript-capture.ts +164 -0
  70. package/.pi/extensions/zob-harness/src/coms-v2/types.ts +149 -0
  71. package/.pi/extensions/zob-harness/src/coms-v2/zpeer-profile.ts +140 -0
  72. package/.pi/extensions/zob-harness/src/coms-v2/zpeer.ts +452 -0
  73. package/.pi/extensions/zob-harness/src/constants.ts +108 -0
  74. package/.pi/extensions/zob-harness/src/context-gbrain.ts +465 -0
  75. package/.pi/extensions/zob-harness/src/daemon-policy.ts +223 -0
  76. package/.pi/extensions/zob-harness/src/daemon-readiness.ts +134 -0
  77. package/.pi/extensions/zob-harness/src/daemon-runtime.ts +393 -0
  78. package/.pi/extensions/zob-harness/src/factory/AGENTS.md +24 -0
  79. package/.pi/extensions/zob-harness/src/factory/agentic-plan.ts +65 -0
  80. package/.pi/extensions/zob-harness/src/factory/quarantine.ts +319 -0
  81. package/.pi/extensions/zob-harness/src/factory/run.ts +520 -0
  82. package/.pi/extensions/zob-harness/src/factory/validation.ts +454 -0
  83. package/.pi/extensions/zob-harness/src/factory-selector.ts +318 -0
  84. package/.pi/extensions/zob-harness/src/full-autonomy-test.ts +226 -0
  85. package/.pi/extensions/zob-harness/src/git-ops.ts +868 -0
  86. package/.pi/extensions/zob-harness/src/goal-room.ts +178 -0
  87. package/.pi/extensions/zob-harness/src/goal-runtime.ts +1569 -0
  88. package/.pi/extensions/zob-harness/src/goal-todo-imports.ts +111 -0
  89. package/.pi/extensions/zob-harness/src/goal-todo-types.ts +231 -0
  90. package/.pi/extensions/zob-harness/src/goal-todos.ts +1410 -0
  91. package/.pi/extensions/zob-harness/src/goal.ts +152 -0
  92. package/.pi/extensions/zob-harness/src/governed-requests.ts +436 -0
  93. package/.pi/extensions/zob-harness/src/interactive-autonomy.ts +595 -0
  94. package/.pi/extensions/zob-harness/src/launch-apply.ts +313 -0
  95. package/.pi/extensions/zob-harness/src/merge-queue.ts +290 -0
  96. package/.pi/extensions/zob-harness/src/mission-control.ts +573 -0
  97. package/.pi/extensions/zob-harness/src/model-availability.ts +52 -0
  98. package/.pi/extensions/zob-harness/src/model-routing.ts +429 -0
  99. package/.pi/extensions/zob-harness/src/orchestration/AGENTS.md +23 -0
  100. package/.pi/extensions/zob-harness/src/orchestration/adaptive-delegation.ts +547 -0
  101. package/.pi/extensions/zob-harness/src/orchestration/adaptive-workflow.ts +585 -0
  102. package/.pi/extensions/zob-harness/src/orchestration/lead-plan.ts +192 -0
  103. package/.pi/extensions/zob-harness/src/orchestration/plan.ts +168 -0
  104. package/.pi/extensions/zob-harness/src/orchestration/room.ts +346 -0
  105. package/.pi/extensions/zob-harness/src/orchestration/run.ts +134 -0
  106. package/.pi/extensions/zob-harness/src/orchestration/supervised-readonly.ts +1147 -0
  107. package/.pi/extensions/zob-harness/src/orchestration/widget-readers.ts +132 -0
  108. package/.pi/extensions/zob-harness/src/output-contracts.ts +656 -0
  109. package/.pi/extensions/zob-harness/src/project-dna.ts +533 -0
  110. package/.pi/extensions/zob-harness/src/promotion/AGENTS.md +24 -0
  111. package/.pi/extensions/zob-harness/src/promotion/candidate.ts +336 -0
  112. package/.pi/extensions/zob-harness/src/promotion/coms.ts +127 -0
  113. package/.pi/extensions/zob-harness/src/promotion/documentation.ts +142 -0
  114. package/.pi/extensions/zob-harness/src/promotion/factory.ts +107 -0
  115. package/.pi/extensions/zob-harness/src/promotion/ledger.ts +2 -0
  116. package/.pi/extensions/zob-harness/src/promotion/temp-agent.ts +151 -0
  117. package/.pi/extensions/zob-harness/src/promotion/types.ts +149 -0
  118. package/.pi/extensions/zob-harness/src/promotion/validate.ts +6 -0
  119. package/.pi/extensions/zob-harness/src/promotion/write-lane.ts +162 -0
  120. package/.pi/extensions/zob-harness/src/prompt-packs.ts +239 -0
  121. package/.pi/extensions/zob-harness/src/queue.ts +386 -0
  122. package/.pi/extensions/zob-harness/src/rules.ts +225 -0
  123. package/.pi/extensions/zob-harness/src/runtime/AGENTS.md +26 -0
  124. package/.pi/extensions/zob-harness/src/runtime/adaptive-zmode.ts +116 -0
  125. package/.pi/extensions/zob-harness/src/runtime/auto-compaction.ts +715 -0
  126. package/.pi/extensions/zob-harness/src/runtime/commands.ts +1315 -0
  127. package/.pi/extensions/zob-harness/src/runtime/compaction-policy.ts +516 -0
  128. package/.pi/extensions/zob-harness/src/runtime/delegation-click-markers.ts +141 -0
  129. package/.pi/extensions/zob-harness/src/runtime/delegation-feed.ts +415 -0
  130. package/.pi/extensions/zob-harness/src/runtime/delegation-markdown.ts +97 -0
  131. package/.pi/extensions/zob-harness/src/runtime/delegation-monitor.ts +553 -0
  132. package/.pi/extensions/zob-harness/src/runtime/delegation-mouse.ts +205 -0
  133. package/.pi/extensions/zob-harness/src/runtime/delegation-overlay.ts +434 -0
  134. package/.pi/extensions/zob-harness/src/runtime/events.ts +736 -0
  135. package/.pi/extensions/zob-harness/src/runtime/goal-todo-overlay.ts +214 -0
  136. package/.pi/extensions/zob-harness/src/runtime/mode-intent.ts +144 -0
  137. package/.pi/extensions/zob-harness/src/runtime/plan-capture.ts +270 -0
  138. package/.pi/extensions/zob-harness/src/runtime/state.ts +403 -0
  139. package/.pi/extensions/zob-harness/src/runtime/tools-autonomous.ts +117 -0
  140. package/.pi/extensions/zob-harness/src/runtime/tools-compute.ts +136 -0
  141. package/.pi/extensions/zob-harness/src/runtime/tools-coms.ts +365 -0
  142. package/.pi/extensions/zob-harness/src/runtime/tools-context.ts +70 -0
  143. package/.pi/extensions/zob-harness/src/runtime/tools-delegation.ts +1854 -0
  144. package/.pi/extensions/zob-harness/src/runtime/tools-factory.ts +810 -0
  145. package/.pi/extensions/zob-harness/src/runtime/tools-goal-room.ts +46 -0
  146. package/.pi/extensions/zob-harness/src/runtime/tools-governed-requests.ts +38 -0
  147. package/.pi/extensions/zob-harness/src/runtime/tools-merge-queue.ts +61 -0
  148. package/.pi/extensions/zob-harness/src/runtime/tools-mission-control.ts +77 -0
  149. package/.pi/extensions/zob-harness/src/runtime/tools-orchestration.ts +106 -0
  150. package/.pi/extensions/zob-harness/src/runtime/tools-project-dna.ts +123 -0
  151. package/.pi/extensions/zob-harness/src/runtime/tools-worker-pool.ts +93 -0
  152. package/.pi/extensions/zob-harness/src/runtime/tools-workspace-claims.ts +62 -0
  153. package/.pi/extensions/zob-harness/src/runtime/tools-zcommit.ts +147 -0
  154. package/.pi/extensions/zob-harness/src/runtime/widget.ts +353 -0
  155. package/.pi/extensions/zob-harness/src/runtime/zobHarness.ts +60 -0
  156. package/.pi/extensions/zob-harness/src/safety.ts +338 -0
  157. package/.pi/extensions/zob-harness/src/sandbox.ts +1508 -0
  158. package/.pi/extensions/zob-harness/src/schemas-project-dna.ts +47 -0
  159. package/.pi/extensions/zob-harness/src/schemas.ts +695 -0
  160. package/.pi/extensions/zob-harness/src/telemetry.ts +373 -0
  161. package/.pi/extensions/zob-harness/src/topology/AGENTS.md +22 -0
  162. package/.pi/extensions/zob-harness/src/topology/chains.ts +236 -0
  163. package/.pi/extensions/zob-harness/src/topology/coms.ts +211 -0
  164. package/.pi/extensions/zob-harness/src/topology/orchestration-profiles.ts +204 -0
  165. package/.pi/extensions/zob-harness/src/topology/teams.ts +113 -0
  166. package/.pi/extensions/zob-harness/src/types/core.ts +47 -0
  167. package/.pi/extensions/zob-harness/src/types.ts +939 -0
  168. package/.pi/extensions/zob-harness/src/utils/AGENTS.md +22 -0
  169. package/.pi/extensions/zob-harness/src/utils/formatting.ts +34 -0
  170. package/.pi/extensions/zob-harness/src/utils/hashing.ts +11 -0
  171. package/.pi/extensions/zob-harness/src/utils/json.ts +28 -0
  172. package/.pi/extensions/zob-harness/src/utils/paths.ts +54 -0
  173. package/.pi/extensions/zob-harness/src/utils/records.ts +25 -0
  174. package/.pi/extensions/zob-harness/src/utils/resources.ts +38 -0
  175. package/.pi/extensions/zob-harness/src/worker-pool.ts +672 -0
  176. package/.pi/extensions/zob-harness/src/workspace-claims.ts +297 -0
  177. package/.pi/extensions/zob-switch/index.ts +180 -0
  178. package/.pi/factories/budget-preflight-dry-run/batch-manifest.json +59 -0
  179. package/.pi/factories/budget-preflight-dry-run/factory.json +94 -0
  180. package/.pi/factories/budget-preflight-dry-run/pilot-manifest.json +50 -0
  181. package/.pi/factories/budget-preflight-dry-run/smoke-manifest.json +43 -0
  182. package/.pi/factories/code-review-matrix/batch-manifest.json +61 -0
  183. package/.pi/factories/code-review-matrix/factory.json +163 -0
  184. package/.pi/factories/code-review-matrix/pilot-manifest.json +41 -0
  185. package/.pi/factories/code-review-matrix/smoke-manifest.json +35 -0
  186. package/.pi/factories/factory-forge/batch-manifest.json +56 -0
  187. package/.pi/factories/factory-forge/factory.json +84 -0
  188. package/.pi/factories/factory-forge/pilot-manifest.json +32 -0
  189. package/.pi/factories/factory-forge/smoke-manifest.json +19 -0
  190. package/.pi/factories/opencode-pattern-canonizer/batch-manifest.json +54 -0
  191. package/.pi/factories/opencode-pattern-canonizer/factory.json +86 -0
  192. package/.pi/factories/opencode-pattern-canonizer/pilot-manifest.json +39 -0
  193. package/.pi/factories/opencode-pattern-canonizer/smoke-manifest.json +26 -0
  194. package/.pi/factories/project-dna/README.md +182 -0
  195. package/.pi/factories/project-dna/batch-manifest.json +37 -0
  196. package/.pi/factories/project-dna/example-project-dna-manifest-v2.json +80 -0
  197. package/.pi/factories/project-dna/example-project-dna-manifest.json +58 -0
  198. package/.pi/factories/project-dna/factory.json +131 -0
  199. package/.pi/factories/project-dna/golden-cases-smoke.json +62 -0
  200. package/.pi/factories/project-dna/pi-agentic-ontology.json +88 -0
  201. package/.pi/factories/project-dna/pilot-manifest.json +32 -0
  202. package/.pi/factories/project-dna/schemas/benchmark-suite.schema.json +27 -0
  203. package/.pi/factories/project-dna/schemas/code-knowledge-graph.schema.json +97 -0
  204. package/.pi/factories/project-dna/schemas/context-pack.schema.json +43 -0
  205. package/.pi/factories/project-dna/schemas/golden-case.schema.json +36 -0
  206. package/.pi/factories/project-dna/schemas/manifest-v2.schema.json +128 -0
  207. package/.pi/factories/project-dna/schemas/manifest.schema.json +77 -0
  208. package/.pi/factories/project-dna/schemas/ontology.schema.json +45 -0
  209. package/.pi/factories/project-dna/schemas/project-fingerprint.schema.json +28 -0
  210. package/.pi/factories/project-dna/schemas/query-steward-report.schema.json +52 -0
  211. package/.pi/factories/project-dna/smoke-manifest.json +27 -0
  212. package/.pi/factories/roadmap-smoke-lots/batch-manifest.json +49 -0
  213. package/.pi/factories/roadmap-smoke-lots/factory.json +89 -0
  214. package/.pi/factories/roadmap-smoke-lots/pilot-manifest.json +50 -0
  215. package/.pi/factories/roadmap-smoke-lots/smoke-manifest.json +35 -0
  216. package/.pi/git-policy.json +120 -0
  217. package/.pi/mission-control/zob_coms_transport.json +64 -0
  218. package/.pi/model-catalog.example.json +345 -0
  219. package/.pi/model-economy.example.json +196 -0
  220. package/.pi/model-routing.json +86 -0
  221. package/.pi/orchestrations/adaptive-chief-vision.json +193 -0
  222. package/.pi/orchestrations/ceo-feature-build.json +182 -0
  223. package/.pi/orchestrations/readonly-dynamic-smoke.json +75 -0
  224. package/.pi/output-contracts/agent-event.v1.json +19 -0
  225. package/.pi/output-contracts/base.v1.json +24 -0
  226. package/.pi/output-contracts/brain-lookup.v1.json +21 -0
  227. package/.pi/output-contracts/clarification.v1.json +21 -0
  228. package/.pi/output-contracts/context-pack.v1.json +20 -0
  229. package/.pi/output-contracts/context-request.v1.json +21 -0
  230. package/.pi/output-contracts/context-steward.v1.json +19 -0
  231. package/.pi/output-contracts/context-writeback-proposal.v1.json +18 -0
  232. package/.pi/output-contracts/delegation-request.v1.json +21 -0
  233. package/.pi/output-contracts/explore.v1.json +52 -0
  234. package/.pi/output-contracts/factory.v1.json +48 -0
  235. package/.pi/output-contracts/guidance-steward.v1.json +18 -0
  236. package/.pi/output-contracts/implement.v1.json +40 -0
  237. package/.pi/output-contracts/launch-authorization.v1.json +21 -0
  238. package/.pi/output-contracts/lead-plan.v1.json +22 -0
  239. package/.pi/output-contracts/mission-readiness.v1.json +20 -0
  240. package/.pi/output-contracts/oracle-merge.v1.json +44 -0
  241. package/.pi/output-contracts/oracle-request.v1.json +20 -0
  242. package/.pi/output-contracts/oracle.v1.json +44 -0
  243. package/.pi/output-contracts/orchestration-profile.v1.json +22 -0
  244. package/.pi/output-contracts/plan.v1.json +48 -0
  245. package/.pi/output-contracts/prompt-pack.v1.json +20 -0
  246. package/.pi/output-contracts/qa.v1.json +40 -0
  247. package/.pi/output-contracts/research.v1.json +36 -0
  248. package/.pi/output-contracts/spec.v1.json +22 -0
  249. package/.pi/output-contracts/synthesis.v1.json +44 -0
  250. package/.pi/output-contracts/temp-agent-card.v1.json +23 -0
  251. package/.pi/output-contracts/todo-child-result.v1.json +20 -0
  252. package/.pi/output-contracts/todo-child-result.v2.json +22 -0
  253. package/.pi/output-contracts/todo-claim-validation.v1.json +22 -0
  254. package/.pi/output-contracts/todo-split-request.v1.json +20 -0
  255. package/.pi/prompts/adaptive-workflow.md +63 -0
  256. package/.pi/prompts/autonomous-runtime.md +15 -0
  257. package/.pi/prompts/benchmark-contender.md +15 -0
  258. package/.pi/prompts/benchmark-judge.md +19 -0
  259. package/.pi/prompts/clarify-spec.md +20 -0
  260. package/.pi/prompts/compute-plan.md +36 -0
  261. package/.pi/prompts/compute-preview.md +42 -0
  262. package/.pi/prompts/contract.md +29 -0
  263. package/.pi/prompts/explore.md +13 -0
  264. package/.pi/prompts/factory-run.md +36 -0
  265. package/.pi/prompts/factory.md +20 -0
  266. package/.pi/prompts/implement.md +27 -0
  267. package/.pi/prompts/model-catalog.md +68 -0
  268. package/.pi/prompts/model-economy.md +64 -0
  269. package/.pi/prompts/oracle-merge.md +18 -0
  270. package/.pi/prompts/oracle.md +13 -0
  271. package/.pi/prompts/orchestrator.md +48 -0
  272. package/.pi/prompts/parallel-review.md +21 -0
  273. package/.pi/prompts/plan.md +21 -0
  274. package/.pi/prompts/project-dna.md +90 -0
  275. package/.pi/prompts/refactor-oracle.md +23 -0
  276. package/.pi/prompts/refactor-slice.md +24 -0
  277. package/.pi/prompts/research.md +20 -0
  278. package/.pi/prompts/spec.md +19 -0
  279. package/.pi/prompts/synthesis.md +18 -0
  280. package/.pi/rules/always.md +38 -0
  281. package/.pi/rules/docs.md +32 -0
  282. package/.pi/rules/factory.md +44 -0
  283. package/.pi/rules/oracle.md +34 -0
  284. package/.pi/rules/orchestration.md +44 -0
  285. package/.pi/rules/project.md +34 -0
  286. package/.pi/rules/prompts.md +43 -0
  287. package/.pi/rules/runtime.md +43 -0
  288. package/.pi/rules/sandbox.md +43 -0
  289. package/.pi/settings.json +28 -0
  290. package/.pi/skills/zob-agentic-access/SKILL.md +20 -0
  291. package/.pi/skills/zob-autonomous-runtime/SKILL.md +41 -0
  292. package/.pi/skills/zob-commit/SKILL.md +79 -0
  293. package/.pi/skills/zob-compaction-policy/SKILL.md +92 -0
  294. package/.pi/skills/zob-compute-profile/SKILL.md +108 -0
  295. package/.pi/skills/zob-coms-safety/SKILL.md +54 -0
  296. package/.pi/skills/zob-coms-v2-live/SKILL.md +47 -0
  297. package/.pi/skills/zob-delegation-routing/SKILL.md +82 -0
  298. package/.pi/skills/zob-factory/SKILL.md +28 -0
  299. package/.pi/skills/zob-goal-todo-tree/SKILL.md +279 -0
  300. package/.pi/skills/zob-harness/SKILL.md +68 -0
  301. package/.pi/skills/zob-mission-control-coms/SKILL.md +39 -0
  302. package/.pi/skills/zob-oracle/SKILL.md +21 -0
  303. package/.pi/skills/zob-owner-pool-drill-writer/SKILL.md +244 -0
  304. package/.pi/skills/zob-owner-pool-launcher/SKILL.md +261 -0
  305. package/.pi/skills/zob-project-dna/SKILL.md +275 -0
  306. package/.pi/skills/zob-sandbox/SKILL.md +29 -0
  307. package/.pi/skills/zob-spec/SKILL.md +25 -0
  308. package/.pi/skills/zob-split-refactor/SKILL.md +39 -0
  309. package/.pi/skills/zob-tool-router/SKILL.md +104 -0
  310. package/.pi/teams/zob-core.json +122 -0
  311. package/AGENTS.md +89 -0
  312. package/CONTRIBUTING.md +56 -0
  313. package/LICENSE +21 -0
  314. package/README.md +360 -0
  315. package/SECURITY.md +35 -0
  316. package/SOURCE_INDEX.md +46 -0
  317. package/package.json +135 -0
  318. package/scripts/README.md +57 -0
  319. package/scripts/autonomy/mission-readiness-secret-smoke.mjs +90 -0
  320. package/scripts/compute-profile/plan-workflow.mjs +85 -0
  321. package/scripts/compute-profile/preview.mjs +242 -0
  322. package/scripts/compute-profile/regression-smoke.mjs +38 -0
  323. package/scripts/compute-profile/summarize.mjs +72 -0
  324. package/scripts/compute-profile/validate-policy.mjs +50 -0
  325. package/scripts/compute-profile/validate-preview.mjs +95 -0
  326. package/scripts/compute-profile/validate-workflow.mjs +58 -0
  327. package/scripts/git-ops/commit-policy-smoke.mjs +221 -0
  328. package/scripts/goal-todo/child-goal-ref-smoke.mjs +252 -0
  329. package/scripts/harness-switch/static-smoke.mjs +43 -0
  330. package/scripts/model-catalog/validate-economy.mjs +223 -0
  331. package/scripts/model-catalog/validate.mjs +199 -0
  332. package/scripts/package-surface/validate-script-refs.mjs +190 -0
  333. package/scripts/path-policy/validate-smoke.mjs +103 -0
  334. package/scripts/project-dna/bench-smoke.mjs +217 -0
  335. package/scripts/project-dna/build-capsules.mjs +207 -0
  336. package/scripts/project-dna/build-sample-spec.mjs +140 -0
  337. package/scripts/project-dna/emit-golden-cases.mjs +75 -0
  338. package/scripts/project-dna/emit-ontology.mjs +75 -0
  339. package/scripts/project-dna/generate-sample.mjs +302 -0
  340. package/scripts/project-dna/oracle-review-smoke.mjs +157 -0
  341. package/scripts/project-dna/plan-workflow.mjs +289 -0
  342. package/scripts/project-dna/query-context.mjs +276 -0
  343. package/scripts/project-dna/query-steward.mjs +149 -0
  344. package/scripts/project-dna/scan.mjs +553 -0
  345. package/scripts/project-dna/validate-5of5.mjs +159 -0
  346. package/scripts/project-dna/validate-golden-cases.mjs +78 -0
  347. package/scripts/project-dna/validate-ontology.mjs +97 -0
  348. package/scripts/project-dna/validate-sample-project.mjs +105 -0
  349. package/scripts/project-dna/validate-scaffold.mjs +383 -0
  350. package/scripts/project-dna/validate-scan-artifacts.mjs +187 -0
  351. package/scripts/project-dna/validate-workflow.mjs +166 -0
  352. package/scripts/start-pi.sh +4 -0
  353. package/scripts/worker-pool/static-smoke.mjs +54 -0
  354. package/scripts/zpeer-local-e2e-smoke.mjs +395 -0
  355. package/scripts/zpeer-static-smoke.mjs +129 -0
  356. package/tsconfig.json +12 -0
@@ -0,0 +1,212 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join, resolve } from "node:path";
4
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
5
+ import { isToolCallEventType } from "@earendil-works/pi-coding-agent";
6
+
7
+ interface DamageRule {
8
+ pattern: string;
9
+ reason: string;
10
+ ask?: boolean;
11
+ }
12
+
13
+ interface DamageRules {
14
+ bashToolPatterns: DamageRule[];
15
+ zeroAccessPaths: string[];
16
+ readOnlyPaths: string[];
17
+ noDeletePaths: string[];
18
+ }
19
+
20
+ const DEFAULT_RULES: DamageRules = {
21
+ bashToolPatterns: [
22
+ { pattern: "\\brm\\s+(-rf?|--recursive)", reason: "recursive deletion" },
23
+ { pattern: "\\bgit\\s+reset\\s+--hard\\b", reason: "destructive git reset" },
24
+ { pattern: "\\bgit\\s+clean\\s+-", reason: "destructive git clean" },
25
+ { pattern: "\\bgit\\s+add\\s+(-A|\\.)", reason: "bulk git staging" },
26
+ { pattern: "\\bsudo\\b", reason: "privileged command" },
27
+ ],
28
+ zeroAccessPaths: [".env", ".env.*", "~/.ssh", "~/.aws", "*.pem", "*.key"],
29
+ readOnlyPaths: [".git/", "node_modules/", "dist/", "build/", "package-lock.json", "pnpm-lock.yaml", "bun.lock"],
30
+ noDeletePaths: [".git/", "AGENTS.md", "README.md", ".pi/"],
31
+ };
32
+
33
+ function expandHome(input: string): string {
34
+ if (input === "~") return homedir();
35
+ if (input.startsWith("~/")) return join(homedir(), input.slice(2));
36
+ return input;
37
+ }
38
+
39
+ function wildcardToRegex(pattern: string): RegExp {
40
+ const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
41
+ return new RegExp(`(^|/)${escaped}($|/)`);
42
+ }
43
+
44
+ export function pathMatches(targetPath: string, pattern: string, cwd: string, policyRoot = cwd): boolean {
45
+ const expanded = expandHome(pattern);
46
+ const root = resolve(policyRoot);
47
+ const normalizedTarget = resolve(cwd, expandHome(targetPath));
48
+ const relativeTarget = normalizedTarget.startsWith(root) ? normalizedTarget.slice(root.length + 1) : normalizedTarget;
49
+ if (expanded.endsWith("/")) {
50
+ const prefix = resolve(root, expanded.slice(0, -1));
51
+ return normalizedTarget === prefix || normalizedTarget.startsWith(`${prefix}/`) || relativeTarget.startsWith(expanded);
52
+ }
53
+ const regex = wildcardToRegex(expanded);
54
+ return regex.test(normalizedTarget) || regex.test(relativeTarget) || relativeTarget.includes(expanded);
55
+ }
56
+
57
+ export function parsePathListEnv(value: string | undefined): string[] {
58
+ if (!value) return [];
59
+ return value
60
+ .split(/[,:\n]/)
61
+ .map((item) => item.trim())
62
+ .filter(Boolean);
63
+ }
64
+
65
+ export function validateRuntimeWritePolicy(input: {
66
+ targetPath: string;
67
+ cwd: string;
68
+ policyRoot?: string;
69
+ allowedPaths?: string[];
70
+ forbiddenPaths?: string[];
71
+ zeroAccessPaths?: string[];
72
+ readOnlyPaths?: string[];
73
+ sandboxRoot?: string;
74
+ }): { allowed: boolean; violations: string[] } {
75
+ const policyRoot = input.policyRoot ?? input.cwd;
76
+ const violations: string[] = [];
77
+ for (const protectedPattern of input.zeroAccessPaths ?? []) {
78
+ if (pathMatches(input.targetPath, protectedPattern, input.cwd, policyRoot)) violations.push(`zero-access path: ${protectedPattern}`);
79
+ }
80
+ for (const forbiddenPattern of input.forbiddenPaths ?? []) {
81
+ if (pathMatches(input.targetPath, forbiddenPattern, input.cwd, policyRoot)) violations.push(`forbidden path: ${forbiddenPattern}`);
82
+ }
83
+ for (const readOnlyPattern of input.readOnlyPaths ?? []) {
84
+ if (pathMatches(input.targetPath, readOnlyPattern, input.cwd, policyRoot)) violations.push(`read-only path: ${readOnlyPattern}`);
85
+ }
86
+ const allowedPaths = input.allowedPaths ?? [];
87
+ if (allowedPaths.length > 0 && !allowedPaths.some((allowedPath) => pathMatches(input.targetPath, allowedPath, input.cwd, policyRoot))) {
88
+ violations.push(`outside allowed_paths: ${allowedPaths.join(", ")}`);
89
+ }
90
+ if (input.sandboxRoot) {
91
+ const sandboxRoot = resolve(policyRoot, expandHome(input.sandboxRoot));
92
+ const target = resolve(input.cwd, expandHome(input.targetPath));
93
+ if (target !== sandboxRoot && !target.startsWith(`${sandboxRoot}/`)) violations.push(`outside sandbox root: ${input.sandboxRoot}`);
94
+ }
95
+ return { allowed: violations.length === 0, violations };
96
+ }
97
+
98
+ function loadDamageRules(cwd: string): DamageRules {
99
+ const root = process.env.ZOB_HARNESS_ROOT || cwd;
100
+ const candidate = join(root, ".pi", "damage-control-rules.json");
101
+ if (!existsSync(candidate)) return DEFAULT_RULES;
102
+ try {
103
+ const loaded = JSON.parse(readFileSync(candidate, "utf8")) as Partial<DamageRules>;
104
+ return {
105
+ bashToolPatterns: loaded.bashToolPatterns ?? DEFAULT_RULES.bashToolPatterns,
106
+ zeroAccessPaths: loaded.zeroAccessPaths ?? DEFAULT_RULES.zeroAccessPaths,
107
+ readOnlyPaths: loaded.readOnlyPaths ?? DEFAULT_RULES.readOnlyPaths,
108
+ noDeletePaths: loaded.noDeletePaths ?? DEFAULT_RULES.noDeletePaths,
109
+ };
110
+ } catch {
111
+ return DEFAULT_RULES;
112
+ }
113
+ }
114
+
115
+ function blockedFeedback(toolName: string, reason: string, attempted: string): string {
116
+ return [
117
+ `ZOB child safety blocked ${toolName}: ${reason}`,
118
+ "",
119
+ `Attempted: ${attempted}`,
120
+ "",
121
+ "Continue safely:",
122
+ "- Do not retry the same blocked call.",
123
+ "- If a secret or destructive operation is required, stop and ask the parent/user for explicit approval.",
124
+ "- Produce a safe partial result with evidence and blockers instead.",
125
+ ].join("\n");
126
+ }
127
+
128
+ export default function zobChildSafety(pi: ExtensionAPI): void {
129
+ let rules: DamageRules = DEFAULT_RULES;
130
+
131
+ pi.on("session_start", async (_event, ctx) => {
132
+ rules = loadDamageRules(ctx.cwd);
133
+ ctx.ui.setStatus("zob-child-safety", ctx.ui.theme.fg("accent", "child-safe"));
134
+ });
135
+
136
+ pi.on("tool_call", async (event, ctx) => {
137
+ let violation: string | undefined;
138
+ let attempted = JSON.stringify(event.input);
139
+ const pathInputs: string[] = [];
140
+ const policyRoot = process.env.ZOB_HARNESS_ROOT || ctx.cwd;
141
+
142
+ if (isToolCallEventType("read", event) || isToolCallEventType("write", event) || isToolCallEventType("edit", event)) {
143
+ pathInputs.push(event.input.path);
144
+ }
145
+ if (isToolCallEventType("grep", event) || isToolCallEventType("find", event) || isToolCallEventType("ls", event)) {
146
+ pathInputs.push(event.input.path ?? ".");
147
+ }
148
+
149
+ const inheritedAllowedPaths = parsePathListEnv(process.env.ZOB_ALLOWED_PATHS);
150
+ const inheritedForbiddenPaths = parsePathListEnv(process.env.ZOB_FORBIDDEN_PATHS);
151
+ const sandboxRoot = process.env.ZOB_SANDBOX_ROOT;
152
+
153
+ for (const inputPath of pathInputs) {
154
+ for (const protectedPattern of rules.zeroAccessPaths) {
155
+ if (pathMatches(inputPath, protectedPattern, ctx.cwd, policyRoot)) violation = `zero-access path: ${protectedPattern}`;
156
+ }
157
+ if (!violation) {
158
+ for (const forbiddenPattern of inheritedForbiddenPaths) {
159
+ if (pathMatches(inputPath, forbiddenPattern, ctx.cwd, policyRoot)) violation = `forbidden path: ${forbiddenPattern}`;
160
+ }
161
+ }
162
+ if ((event.toolName === "write" || event.toolName === "edit") && !violation) {
163
+ const writePolicy = validateRuntimeWritePolicy({
164
+ targetPath: inputPath,
165
+ cwd: ctx.cwd,
166
+ policyRoot,
167
+ allowedPaths: inheritedAllowedPaths,
168
+ forbiddenPaths: inheritedForbiddenPaths,
169
+ zeroAccessPaths: rules.zeroAccessPaths,
170
+ readOnlyPaths: rules.readOnlyPaths,
171
+ sandboxRoot,
172
+ });
173
+ if (!writePolicy.allowed) violation = writePolicy.violations[0];
174
+ }
175
+ }
176
+
177
+ if (isToolCallEventType("bash", event)) {
178
+ const command = event.input.command;
179
+ attempted = command;
180
+ for (const rule of rules.bashToolPatterns) {
181
+ if (new RegExp(rule.pattern, "i").test(command)) {
182
+ violation = rule.reason;
183
+ break;
184
+ }
185
+ }
186
+ if (!violation) {
187
+ for (const protectedPattern of rules.zeroAccessPaths) {
188
+ if (command.includes(protectedPattern)) violation = `bash references zero-access path: ${protectedPattern}`;
189
+ }
190
+ }
191
+ if (!violation) {
192
+ for (const forbiddenPattern of inheritedForbiddenPaths) {
193
+ if (command.includes(forbiddenPattern)) violation = `bash references forbidden path: ${forbiddenPattern}`;
194
+ }
195
+ }
196
+ if (!violation) {
197
+ for (const noDelete of rules.noDeletePaths) {
198
+ if (command.includes(noDelete) && /\b(rm|mv)\b/.test(command)) violation = `delete/move protected path: ${noDelete}`;
199
+ }
200
+ }
201
+ }
202
+
203
+ if (violation) {
204
+ pi.appendEntry("zob-child-safety", { tool: event.toolName, input: event.input, violation, timestamp: Date.now() });
205
+ return { block: true, reason: blockedFeedback(event.toolName, violation, attempted) };
206
+ }
207
+ });
208
+
209
+ pi.on("session_shutdown", async (_event, ctx) => {
210
+ ctx.ui.setStatus("zob-child-safety", undefined);
211
+ });
212
+ }
@@ -0,0 +1,28 @@
1
+ # Scope du dossier
2
+
3
+ - Ce dossier contient l'extension Pi `zob-harness`, son entrypoint `index.ts` et les modules sidecar du refactor split-only.
4
+ - `index.ts` reste l'entrypoint Pi déclaré dans `package.json` jusqu'à approval explicite d'une bascule finale.
5
+ - Les sous-dossiers `src/**` contiennent uniquement de la logique extraite ou du contexte local; ils ne remplacent pas l'entrypoint sans review.
6
+
7
+ # Invariants
8
+
9
+ - Split-only: déplacer du code sans changer le comportement observable.
10
+ - Préserver le `default export` `zobHarness(pi)`.
11
+ - Préserver tous les exports publics utilisés par `scripts/harness-smoke.mjs`.
12
+ - Ne pas changer noms de tools, commandes, event handlers, sentinels, artefacts, messages d'erreur, descriptions Typebox, snippets de prompts ou guidelines.
13
+ - Ne pas changer l'ordre des arrays observables ni les defaults runtime.
14
+ - Ne pas convertir les opérations `fs` sync en async.
15
+
16
+ # Imports
17
+
18
+ - En NodeNext, utiliser des imports relatifs avec suffixe `.js`.
19
+ - `index.ts` peut rester hybride pendant la migration.
20
+ - Aucun fichier `src/**` ne doit importer depuis `index.ts`.
21
+ - Préférer `import type` pour les types.
22
+
23
+ # Validation locale
24
+
25
+ - Baseline avant tranche: `npm run check -- --pretty false`.
26
+ - Après toute tranche code: `npm run check -- --pretty false`.
27
+ - Après tranche domaine/runtime: `npm run smoke:harness`.
28
+ - Avant bascule finale: `npm run check:all` et oracle read-only.
@@ -0,0 +1,391 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+
3
+ import zobHarnessRuntime from "./src/runtime/zobHarness.js";
4
+
5
+ export { renderHarnessWidget } from "./src/runtime/widget.js";
6
+ export { createHarnessRuntimeState, inferModeFromUserIntent } from "./src/runtime/state.js";
7
+
8
+ export type {
9
+ AdaptiveDelegationGovernorState,
10
+ AdaptiveDelegationMode,
11
+ AdaptiveDelegationOracleMode,
12
+ AdaptiveDelegationPolicy,
13
+ AdaptiveDelegationPolicyInput,
14
+ AdaptiveDelegationRisk,
15
+ DelegationRequestProposal,
16
+ DelegationScore,
17
+ GovernorDecision,
18
+ ParentDispatchContract,
19
+ SupervisedReadonlyDispatchContract,
20
+ SupervisedReadonlyDispatchResult,
21
+ SupervisedReadonlyDispatcher,
22
+ } from "./src/types.js";
23
+
24
+ export { CHRONICLE_STATES } from "./src/chronicle.js";
25
+
26
+ export type { ChronicleState } from "./src/chronicle.js";
27
+
28
+ export type {
29
+ ChildStopCondition,
30
+ RuleAppliesTo,
31
+ RuleEnforcementLevel,
32
+ RuleOracleRequirement,
33
+ RulePack,
34
+ RuleResolution,
35
+ RuleResolverInput,
36
+ } from "./src/types.js";
37
+
38
+ export { pathMatches } from "./src/utils/paths.js";
39
+
40
+ export { parseGoalState, validateGoalState, validateStrictGoalSpecAnchor, parseBillableJobIntake, validateBillableJobIntake } from "./src/goal.js";
41
+ export type { StrictGoalSpecAnchor, StrictGoalSpecAnchorKind } from "./src/goal.js";
42
+ export { DEFAULT_GOAL_ACTIVATION_MODE, clearRuntimeGoalContinuationState, clearRuntimeGoalContinuationStateFor, formatGoalActivationMode, formatRuntimeGoalSummary, queueRuntimeGoalContinuation, restoreRuntimeGoalFromBranch, resumeRuntimeGoal, runtimeGoalStatusLine } from "./src/goal-runtime.js";
43
+ export type { GoalActivationMode, RuntimeGoal, RuntimeGoalStatus, RuntimeGoalOracleStatus, RuntimeGoalOracleVerdict } from "./src/goal-runtime.js";
44
+ export { extractModeIntent, looksLikeCompletePlanResponse, stripModeIntentMarkup, validateModeIntent } from "./src/runtime/mode-intent.js";
45
+ export type { ZobModeIntent, ZobModeIntentConfidence, ZobModeIntentRisk, ZobModeIntentValidation } from "./src/runtime/mode-intent.js";
46
+ export { capturePlanArtifact, extractPlanTitle, shouldCapturePlanResponse } from "./src/runtime/plan-capture.js";
47
+ export type { PlanCaptureInput, PlanCaptureResult, PlanIndexEntry } from "./src/runtime/plan-capture.js";
48
+ export { ZOB_COMPACTION_CONTINUITY_CONTRACT, ZOB_TOOL_ROUTING_CONTRACT } from "./src/constants.js";
49
+ export { ZOB_COMPACTION_DETAILS_SCHEMA, ZOB_COMPACTION_ENTRY_TYPE, ZOB_COMPACTION_HARD_CAP_TOKENS, ZOB_COMPACTION_LEDGER_SCHEMA, ZOB_COMPACTION_SUMMARY_SCHEMA, ZOB_COMPACTION_TARGET_TOKENS, buildDeterministicZobCompactionResult, buildDeterministicZobCompactionSummary, buildZobCompactionDetails, buildZobCompactionInstructions, buildZobCompactionLedgerEntry, buildZobCompactionStateCapsule, withZobCompactionDetails, zobCompactionBodyFreeViolations } from "./src/runtime/compaction-policy.js";
50
+ export type { ZobCompactionDetails, ZobCompactionFileRefsInput, ZobCompactionInstructionInput, ZobCompactionLedgerEntry, ZobCompactionStateCapsule } from "./src/runtime/compaction-policy.js";
51
+ export { isAdaptiveZmodeAlias, renderAdaptiveZmodeTemplate, resolveAdaptiveZmodeEntrypoint, validateAdaptiveZmodeEntrypoint } from "./src/runtime/adaptive-zmode.js";
52
+ export type { AdaptiveZmodeAlias, AdaptiveZmodeEntrypoint } from "./src/runtime/adaptive-zmode.js";
53
+ export {
54
+ ZOB_GOAL_TODO_ENTRY_TYPE,
55
+ acceptGoalTodoClaim,
56
+ addGoalTodo,
57
+ blockGoalTodo,
58
+ completeGoalTodo,
59
+ applyGoalRoomEventTodoReducer,
60
+ applyTodoSplitRequest,
61
+ createGoalTodoState,
62
+ defaultGoalTodoPolicy,
63
+ extractTodoClaimFromText,
64
+ extractTodoClaimValidationFromText,
65
+ extractTodoSplitRequestFromText,
66
+ formatGoalTodoDiagnostics,
67
+ formatGoalTodoHudLine,
68
+ formatGoalTodoPromptHint,
69
+ formatGoalTodoSummary,
70
+ formatGoalTodoTree,
71
+ goalTodoCompletionBlockers,
72
+ goalTodoCompletionDiagnostics,
73
+ handleGoalTodoTextCommand,
74
+ nextValidGoalTodoActions,
75
+ linkGoalTodoDelegation,
76
+ patchGoalTodo,
77
+ recordGoalTodoClaimValidationResult,
78
+ reduceGoalRoomEventToTodoDecision,
79
+ requestGoalTodoClaimValidation,
80
+ rejectGoalTodoClaim,
81
+ restoreGoalTodosFromBranch,
82
+ returnGoalTodoClaim,
83
+ resolveGoalTodo,
84
+ splitGoalTodo,
85
+ summarizeGoalTodos,
86
+ validateGoalTodoGraph,
87
+ } from "./src/goal-todos.js";
88
+ export type { GoalRoomTodoReducerAction, GoalRoomTodoReducerDecision, GoalTodoClaimRef, GoalTodoClaimValidationRef, GoalTodoCompletionDiagnostics, GoalTodoNode, GoalTodoOwner, GoalTodoPolicy, GoalTodoPriority, GoalTodoState, GoalTodoStatus, GoalTodoSummary, ResolveGoalTodoAction, TodoClaimValidationResult, TodoSplitRequest, TodoSplitRequestAction, TodoSplitRiskLevel } from "./src/goal-todos.js";
89
+ export { importChainRunTodos, importFactoryRunTodos, importOrchestrationRunTodos } from "./src/goal-todo-imports.js";
90
+ export type { GoalTodoImportResult } from "./src/goal-todo-imports.js";
91
+ export { appendGoalRoomMessage, buildGoalRoomMessage, goalRoomBodyFreeViolations, isGoalRoomMessage, listGoalRoomMessages, validateGoalRoomMessageInput, validateGoalRoomMessageRecord } from "./src/goal-room.js";
92
+ export type { GoalRoomAudience, GoalRoomListInput, GoalRoomMessageInput, GoalRoomMessageKind, GoalRoomPriority } from "./src/goal-room.js";
93
+ export { buildPromptPackReport, defaultFactoryAgentPromptPacks, promptPackBodyFreeViolations, validatePromptPack } from "./src/prompt-packs.js";
94
+ export type { PromptPackContextPolicy, PromptPackDefinition, PromptPackEvalResult, PromptPackEventPolicy, PromptPackReport, PromptPackRole } from "./src/prompt-packs.js";
95
+ export { buildFactorySelectorSmokeReport, detectFactoryDemandSignals, loadFactorySelectorCandidates, selectFactoryForDemands } from "./src/factory-selector.js";
96
+ export type { FactoryDemandInput, FactoryDemandSignal, FactorySelectionStatus, FactorySelectorCandidateInput, FactorySelectorCandidateScore, FactorySelectorDemandSummary, FactorySelectorResult, FactorySelectorSmokeReport } from "./src/factory-selector.js";
97
+ export { buildControlledWorkerPoolPlan, buildLaunchAuthorizedApplySmokeReport, evaluateLaunchAuthorizedApplyGate } from "./src/launch-apply.js";
98
+ export type { ApplyGateStatus, ControlledWorkerPoolLane, ControlledWorkerPoolPlan, LaunchAuthorizedApplyGate, LaunchAuthorizedApplyInput, LaunchAuthorizedApplySmokeReport, WorkerPoolLaneKind } from "./src/launch-apply.js";
99
+ export { writeFullAutonomyTestRun } from "./src/full-autonomy-test.js";
100
+ export type { FullAutonomyTestInput, FullAutonomyTestRun } from "./src/full-autonomy-test.js";
101
+ export {
102
+ DEFAULT_INTERACTIVE_AUTONOMY_POLICY,
103
+ INTERACTIVE_AUTONOMY_MODES,
104
+ asInteractiveAutonomyMode,
105
+ buildInteractiveLaunchAuthorization,
106
+ createInteractiveAutonomyRuntimeState,
107
+ formatInteractiveAutonomyPromptHint,
108
+ formatInteractiveAutonomyStatus,
109
+ formatMissionReadinessForUi,
110
+ hashInteractiveAutonomyPolicy,
111
+ readInteractiveAutonomyPolicy,
112
+ restoreInteractiveAutonomyState,
113
+ scoreMissionReadiness,
114
+ toAutonomyStateLedgerEntry,
115
+ toMissionReadinessLedgerEntry,
116
+ } from "./src/interactive-autonomy.js";
117
+ export type { InteractiveAutonomyLaunchPolicy, InteractiveAutonomyMode, InteractiveAutonomyPolicy, InteractiveAutonomyRuntimeState, InteractiveAutonomySafetyPolicy, InteractiveAutonomyThresholds, InteractiveLaunchAuthorization, MissionReadinessDecision, MissionReadinessReport, MissionReadinessSignals, MissionReadinessVerdict, MissionRiskLevel } from "./src/interactive-autonomy.js";
118
+ export { appendGovernedRequestsToGoalRoom, extractGovernedRequestsFromText, governedRequestBodyFreeViolations, isGovernedRequest, validateGovernedRequest } from "./src/governed-requests.js";
119
+ export type { GovernedRequestExtractionResult, GovernedRequestKind, GovernedRequestPriority, GovernedRequestRecord, GovernedRequestRisk } from "./src/governed-requests.js";
120
+ export { createWorkspaceClaim, isWorkspaceClaimRecord, isWorkspaceReleaseRecord, listWorkspaceClaims, releaseWorkspaceClaim, workspaceClaimBodyFreeViolations } from "./src/workspace-claims.js";
121
+ export type { WorkspaceClaimInput, WorkspaceClaimMode, WorkspaceClaimRecord, WorkspaceClaimsListInput, WorkspaceClaimStatus, WorkspaceConflictWarning, WorkspaceReleaseInput, WorkspaceReleaseRecord } from "./src/workspace-claims.js";
122
+ export { createWorkerPoolOwnerDecision, createWorkerPoolOwnerRequest, createWorkerPoolPlan, isWorkerPoolPlanRecord, listWorkerPoolPlans, workerPoolBodyFreeViolations } from "./src/worker-pool.js";
123
+ export type { WorkerPoolAssignmentInput, WorkerPoolAssignmentRecord, WorkerPoolCommunicationPolicyInput, WorkerPoolCommunicationPolicyMode, WorkerPoolCommunicationPolicyRecord, WorkerPoolConflictRecord, WorkerPoolDecision, WorkerPoolOwnerDecisionInput, WorkerPoolOwnerDecisionRecord, WorkerPoolOwnerRequestInput, WorkerPoolOwnerRequestRecord, WorkerPoolPlanInput, WorkerPoolPlanRecord, WorkerPoolStatusInput } from "./src/worker-pool.js";
124
+ export { decideMergeCandidate, isMergeCandidateRecord, isMergeDecisionRecord, listMergeQueue, mergeQueueBodyFreeViolations, submitMergeCandidate } from "./src/merge-queue.js";
125
+ export type { MergeCandidateInput, MergeCandidatePriority, MergeCandidateRecord, MergeCandidateRisk, MergeDecision, MergeDecisionInput, MergeDecisionRecord, MergeQueueListInput } from "./src/merge-queue.js";
126
+ export { DEFAULT_PROMOTION_GATES, advancePromotionCandidate, appendPromotionLedger, createPromotionCandidate, promotionCandidateDir, promotionCandidateRef, promotionReportsDir, summarizePromotionCandidates, transitionAllowed, validatePromotionCandidate, writePromotionCandidate } from "./src/promotion/candidate.js";
127
+ export { addPromotionComsMessageRef, buildPromotionComsMessageRef, buildPromotionComsThread, validatePromotionComsMessageRef, validatePromotionComsReadiness, validatePromotionComsThread, writePromotionComsThread } from "./src/promotion/coms.js";
128
+ export { applyDocumentationPromotionInQuarantine, prepareDocumentationPromotion, validateDocumentationPromotion, validateDocumentationPromotionCandidate } from "./src/promotion/documentation.js";
129
+ export { activateFactoryPromotionInQuarantine, prepareFactoryPromotion, validateFactoryPromotionCandidate, validateFactoryPromotionManifest } from "./src/promotion/factory.js";
130
+ export { applyTempAgentPromotionInQuarantine, prepareTempAgentPromotion, validateTempAgentCardForPromotion, validateTempAgentPromotionArtifact, validateTempAgentPromotionCandidate } from "./src/promotion/temp-agent.js";
131
+ export { markWriteLaneAppliedInQuarantine, prepareWriteLanePromotion, validateWriteLaneDiffMetadata, validateWriteLanePromotionCandidate } from "./src/promotion/write-lane.js";
132
+ export type { PromotionApplyScope, PromotionCandidateInput, PromotionCandidateRecord, PromotionComsMessageRef, PromotionComsThreadInput, PromotionComsThreadRecord, PromotionGates, PromotionKind, PromotionStatus, PromotionTransitionInput, PromotionValidationResult } from "./src/promotion/types.js";
133
+
134
+ export {
135
+ listRulePackPaths,
136
+ loadRulePack,
137
+ loadRulePacks,
138
+ validateRulePack,
139
+ inferRuleProfile,
140
+ resolveRuleProfile,
141
+ formatRuleResolution,
142
+ } from "./src/rules.js";
143
+
144
+ export {
145
+ validateSixPartContract,
146
+ parseToolList,
147
+ validateToolList,
148
+ resolveChildCwd,
149
+ validateAllowedPathPolicy,
150
+ validateForbiddenPathPolicy,
151
+ validatePathPolicy,
152
+ parsePathListEnv,
153
+ validateRuntimeWritePolicy,
154
+ validateDelegationWriteScope,
155
+ validateDelegateTaskWriteScope,
156
+ createSandboxMetadata,
157
+ createDiffGateResult,
158
+ createRollbackMetadata,
159
+ } from "./src/safety.js";
160
+
161
+ export {
162
+ listOutputContracts,
163
+ getOutputContractDefinitions,
164
+ inferOutputContract,
165
+ validateOutputContractId,
166
+ validateOutputContract,
167
+ validateChildOutput,
168
+ applyChildGates,
169
+ } from "./src/output-contracts.js";
170
+
171
+ export { buildChildEnv } from "./src/safety.js";
172
+
173
+ export {
174
+ validateSandboxWritePlanInputs,
175
+ runSandboxWritePlan,
176
+ validateSandboxIsolatedExecutionInputs,
177
+ runSandboxIsolatedExecution,
178
+ validateSandboxDiffReviewGateInputs,
179
+ runSandboxDiffReviewGate,
180
+ validateSandboxApplyReadinessInputs,
181
+ runSandboxApplyReadiness,
182
+ validateSandboxApplySimulationInputs,
183
+ runSandboxApplySimulation,
184
+ validateSandboxManualApplyPreflightInputs,
185
+ runSandboxManualApplyPreflight,
186
+ } from "./src/sandbox.js";
187
+
188
+ export {
189
+ buildAutonomyReadinessAudit,
190
+ writeAutonomyReadinessAuditReport,
191
+ buildFactoryRegistryReadinessAudit,
192
+ writeFactoryRegistryReadinessAuditReport,
193
+ } from "./src/autonomy-readiness.js";
194
+
195
+ export { validateBudgetPolicyConfig, evaluateStrictBudgetDispatchGate, buildBudgetReadinessAudit, writeBudgetReadinessAuditReport } from "./src/budget-policy.js";
196
+
197
+ export {
198
+ evaluateBudgetPreflightDryRun,
199
+ detectOracleFail,
200
+ summarizeRunawayGuard,
201
+ classifyChildStopCondition,
202
+ classifyChronicleCompletion,
203
+ classifyDelegationChronicleCompletion,
204
+ classifyFactoryChronicleCompletion,
205
+ writeChronicleSnapshot,
206
+ } from "./src/chronicle.js";
207
+
208
+ export { buildCapabilityIndex, buildReuseScoutReport, writeCapabilityIndex, writeReuseScoutReport } from "./src/capabilities.js";
209
+
210
+ export { buildAutonomousRuntimeDryRun, buildAutonomousRuntimeDryRunFinalReport, buildAutonomousRuntimeDryRunValidation, validateAutonomousReadOnlySmokeRunArtifacts, validateAutonomousRuntimeDryRunArtifacts, writeAutonomousReadOnlySmokeRunReport, writeAutonomousRuntimeDryRunReport } from "./src/autonomous-runtime.js";
211
+ export type { AutonomousApplyPolicy, AutonomousBudgetProfile, AutonomousReadOnlySmokeRunInput, AutonomousRisk, AutonomousRuntimeDryRunInput } from "./src/autonomous-runtime.js";
212
+
213
+ export { buildDaemonReadinessDryRun, writeDaemonReadinessDryRunReport } from "./src/daemon-readiness.js";
214
+
215
+ export { validateDaemonPolicyConfig, buildDaemonPolicyReadinessAudit, writeDaemonPolicyReadinessAuditReport } from "./src/daemon-policy.js";
216
+
217
+ export { DEFAULT_DAEMON_RUNTIME_POLICY, DAEMON_RUNTIME_STATUSES, buildDaemonRuntimeState, buildDaemonTickPlan, evaluateDaemonStopCondition, selectNextActionableTodo } from "./src/daemon-runtime.js";
218
+ export type { DaemonLoopSnapshot, DaemonLoopStatus, DaemonRuntimeActionKind, DaemonRuntimeAutonomySnapshot, DaemonRuntimePolicy, DaemonRuntimeState, DaemonRuntimeStateInput, DaemonRuntimeStatus, DaemonRuntimeTodoCounts, DaemonRuntimeTodoRef, DaemonStopCondition, DaemonTickPlan } from "./src/daemon-runtime.js";
219
+
220
+ export {
221
+ evaluateModelRoutingDryRun,
222
+ evaluateModelRoutingDispatchGate,
223
+ writeModelRoutingDryRunReport,
224
+ validateModelRoutingConfig,
225
+ buildModelRoutingReadinessAudit,
226
+ writeModelRoutingReadinessAuditReport,
227
+ } from "./src/model-routing.js";
228
+
229
+ export {
230
+ buildComputePreview,
231
+ resolveComputeProfile,
232
+ validateComputeProfileArtifacts,
233
+ writeComputeProfileReports,
234
+ } from "./src/compute-profile.js";
235
+ export type { ComputeCapsInput, ComputeDomain, ComputeEffectiveProfile, ComputePreviewConfidence, ComputePreviewInput, ComputeProfileValidationInput, ComputeRequestedProfile } from "./src/compute-profile.js";
236
+ export { buildComputeWorkflowShape, validateComputeWorkflowShape } from "./src/compute-workflow-shape.js";
237
+ export type { ComputeWorkflowShapeInput } from "./src/compute-workflow-shape.js";
238
+
239
+ export {
240
+ buildProjectDnaFederatedQueryResult,
241
+ buildProjectDnaQueryResult,
242
+ buildProjectDnaReadinessAudit,
243
+ writeProjectDnaWritebackProposal,
244
+ } from "./src/project-dna.js";
245
+ export type { ProjectDnaFederatedQueryInput, ProjectDnaQueryInput, ProjectDnaWritebackProposalInput } from "./src/project-dna.js";
246
+
247
+ export {
248
+ buildDelegationTelemetrySummary,
249
+ writeDelegationTelemetrySummary,
250
+ buildFactoryTelemetrySummary,
251
+ writeFactoryTelemetrySummary,
252
+ buildDailyTelemetrySummary,
253
+ writeDailyTelemetrySummary,
254
+ } from "./src/telemetry.js";
255
+
256
+ export {
257
+ READ_ONLY_QUEUE_JOB_TYPES,
258
+ getQueuePaths,
259
+ ensureQueueDirs,
260
+ validateReadOnlyQueueJob,
261
+ writeQueueLifecycleEvent,
262
+ runQueueDaemonTick,
263
+ buildQueueDashboardSummary,
264
+ } from "./src/queue.js";
265
+
266
+ export { loadTeamDefinition, validateTeamDefinition } from "./src/topology/teams.js";
267
+
268
+ export {
269
+ listOrchestrationProfiles,
270
+ loadOrchestrationProfile,
271
+ validateOrchestrationProfile,
272
+ teamDefinitionFromOrchestrationProfile,
273
+ validateOrchestrateRunInputs,
274
+ } from "./src/topology/orchestration-profiles.js";
275
+
276
+ export {
277
+ listChainDefinitions,
278
+ loadChainDefinition,
279
+ validateChainDefinition,
280
+ validateChainRunInputs,
281
+ buildChainPlan,
282
+ runChainPlanOnly,
283
+ } from "./src/topology/chains.js";
284
+
285
+ export {
286
+ validateZobComsEdge,
287
+ buildZobComsMessage,
288
+ validateZobComsMessage,
289
+ appendZobComsMessage,
290
+ listZobComsMessages,
291
+ getZobComsMessage,
292
+ ackZobComsMessage,
293
+ transitionZobComsStatus,
294
+ replyZobComsMessage,
295
+ awaitZobComsMessage,
296
+ } from "./src/topology/coms.js";
297
+
298
+ export {
299
+ MISSION_CONTROL_COMMANDS,
300
+ validateMissionControlCommandProposal,
301
+ buildMissionControlCommandProposal,
302
+ writeMissionControlCommandProposal,
303
+ buildZobComsTransportReadiness,
304
+ buildZobCommunicationReadinessAudit,
305
+ buildMissionControlSnapshot,
306
+ } from "./src/mission-control.js";
307
+
308
+ export { readZobComsV2Policy, zobComsRegistryEnabled } from "./src/coms-v2/policy.js";
309
+ export { buildZobComsProjectId, buildCurrentZobLivePeerCard } from "./src/coms-v2/identity.js";
310
+ export { registerCurrentZobLivePeer, touchCurrentZobLivePeer, unregisterCurrentZobLivePeer, writeZobLivePeerCard, readZobLiveRegistrySnapshot } from "./src/coms-v2/registry.js";
311
+ export { buildZobLivePresenceSummary, redactZobLivePeerForMissionControl } from "./src/coms-v2/presence.js";
312
+ export { buildZobLiveEnvelope, buildZobLiveAckEnvelope, buildZobLivePongEnvelope, buildZobLiveErrorEnvelope, validateZobLiveEnvelope, parseZobLiveEnvelopeLine } from "./src/coms-v2/envelope.js";
313
+ export { makeZobLocalEndpoint, bindZobLocalEndpoint, sendZobLocalEnvelope, pingZobLocalEndpoint, pruneZobLocalEndpoint } from "./src/coms-v2/local-transport.js";
314
+ export { ZobPendingReplies } from "./src/coms-v2/pending-replies.js";
315
+ export { buildZobLiveResponseCapture, buildZobLiveResponseEnvelope } from "./src/coms-v2/response-capture.js";
316
+ export { appendLiveSendRequestedRef, appendLiveDeliveredStatus, appendLiveRunningStatus, appendLiveCompletedRef, appendLiveErrorStatus, appendPeerStaleStatus } from "./src/coms-v2/ledger-bridge.js";
317
+ export { redactZobComsText, writeZobComsRedactedCapture } from "./src/coms-v2/transcript-capture.js";
318
+ export type { ZobLiveEnvelope, ZobLiveEnvelopeType } from "./src/coms-v2/envelope.js";
319
+ export type { ZobComsTranscriptCapturePolicy, ZobComsTranscriptMode, ZobComsTranscriptRetentionClass, ZobComsTransportMode, ZobComsV2Policy, ZobLivePeerCard, ZobLivePeerStatus, ZobLivePresenceSummary, ZobLiveRegistrySnapshot } from "./src/coms-v2/types.js";
320
+
321
+ export {
322
+ buildContextBrainSourceRegistry,
323
+ buildDefaultContextScope,
324
+ validateContextScope,
325
+ buildBrainLookupResult,
326
+ validateBrainLookupResult,
327
+ buildContextPack,
328
+ validateContextPack,
329
+ buildContextWritebackProposal,
330
+ validateContextWritebackProposal,
331
+ writeContextWritebackProposal,
332
+ buildContextGbrainReadinessAudit,
333
+ writeContextGbrainReadinessAuditReport,
334
+ } from "./src/context-gbrain.js";
335
+
336
+ export { readLatestOrchestrationWidgetSummary, readHarnessReadinessWidgetSummary } from "./src/orchestration/widget-readers.js";
337
+
338
+ export {
339
+ ADAPTIVE_DELEGATION_DEFAULT_MAX_TOTAL_AGENTS,
340
+ ADAPTIVE_DELEGATION_HARD_MAX_DEPTH,
341
+ ADAPTIVE_DELEGATION_HARD_MAX_TOTAL_AGENTS_WITH_ORACLE,
342
+ buildInitialAdaptiveDelegationGovernorState,
343
+ buildParentDispatchContractForDecision,
344
+ computeAdaptiveDelegationDuplicateSignature,
345
+ computeAdaptiveDelegationLineageHash,
346
+ computeAdaptiveDelegationNormalizedTaskHash,
347
+ computeAdaptiveDelegationRequestId,
348
+ decideDelegationRequest,
349
+ extractDelegationRequestsFromText,
350
+ normalizeAdaptiveDelegationPolicy,
351
+ scoreDelegationRequest,
352
+ updateGovernorState,
353
+ validateAdaptiveDelegationEvidenceRefs,
354
+ validateAdaptiveDelegationPolicy,
355
+ validateDelegationRequestHardGates,
356
+ } from "./src/orchestration/adaptive-delegation.js";
357
+
358
+ export { extractLeadPlanWorkerContracts, redactLeadPlanWorkerContractsForPersistence, validateLeadPlanWorkerContracts } from "./src/orchestration/lead-plan.js";
359
+
360
+ export { writeAdaptiveWorkflowArtifacts, validateAdaptiveWorkflowArtifacts } from "./src/orchestration/adaptive-workflow.js";
361
+ export type { AdaptiveWorkflowArtifactsInput, AdaptiveWorkflowArtifactsResult } from "./src/orchestration/adaptive-workflow.js";
362
+
363
+ export { writeOrchestrationRoomArtifacts } from "./src/orchestration/room.js";
364
+
365
+ export { runOrchestrateRun } from "./src/orchestration/run.js";
366
+
367
+ export { buildSupervisedReadonlyNoMockFinalGate, buildSupervisedReadonlyRuntimeInvariants, runSupervisedReadonlyOrchestration } from "./src/orchestration/supervised-readonly.js";
368
+
369
+ export {
370
+ factoryPhaseSentinelForMode,
371
+ validateFactoryStages,
372
+ loadFactoryDefinition,
373
+ loadFactoryInputManifest,
374
+ normalizeFactoryAdaptiveDispatchGate,
375
+ validateFactoryAdaptiveDispatchGate,
376
+ validateFactoryRunInputs,
377
+ } from "./src/factory/validation.js";
378
+
379
+ export { buildFactoryAgenticPlan } from "./src/factory/agentic-plan.js";
380
+
381
+ export { buildAgenticFactoryNoMockFinalGate, runFactoryRun } from "./src/factory/run.js";
382
+
383
+ export {
384
+ runFactoryQuarantineReview,
385
+ runFactoryQuarantineActivate,
386
+ runFactoryQuarantineVerifyActivation,
387
+ } from "./src/factory/quarantine.js";
388
+
389
+ export default function zobHarness(pi: ExtensionAPI): void {
390
+ return zobHarnessRuntime(pi);
391
+ }
@@ -0,0 +1,25 @@
1
+ # Scope du dossier
2
+
3
+ - `src/**` reçoit les modules extraits de `.pi/extensions/zob-harness/index.ts`.
4
+ - Chaque module doit correspondre à une tranche claire du playbook de refactor.
5
+ - Ce dossier ne contient pas de nouvelle fonctionnalité produit.
6
+
7
+ # Invariants
8
+
9
+ - Move-only: conserver logique, strings, validations, defaults et ordre observable.
10
+ - Les exports publics doivent rester disponibles depuis `index.ts` jusqu'à la bascule finale.
11
+ - Éviter les cycles; isoler types, constantes et utils avant runtime.
12
+ - Ne pas stocker de prompt/output bodies dans telemetry/coms.
13
+
14
+ # Imports
15
+
16
+ - Imports relatifs NodeNext avec suffixe `.js` pour les imports runtime.
17
+ - `import type` pour les types.
18
+ - Interdit: importer depuis `../index.js`, `../../index.js` ou `index.ts`.
19
+ - Les modules bas niveau ne doivent pas dépendre de runtime Pi.
20
+
21
+ # Validation locale
22
+
23
+ - `npm run check -- --pretty false` après chaque tranche.
24
+ - `npm run smoke:harness` après safety, output-contracts, queue, topology, orchestration, factory, child-runner ou runtime.
25
+ - Oracle read-only avant de passer à la tranche suivante si une API publique est touchée.