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,95 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
+
5
+ const repoRoot = process.cwd();
6
+ const profiles = new Set(["low", "medium", "high", "xhigh", "max"]);
7
+ const requested = new Set(["auto", ...profiles]);
8
+ const forbiddenKeys = new Set(["task", "prompt", "output", "body", "content", "diff", "patch"]);
9
+
10
+ function usage() {
11
+ console.error("Usage: node scripts/compute-profile/validate-preview.mjs --preview reports/.../compute-preview.json [--resolution reports/.../compute-profile-resolution.json]");
12
+ }
13
+ function parseArgs(argv) {
14
+ const out = {};
15
+ for (let i = 0; i < argv.length; i += 1) {
16
+ const arg = argv[i];
17
+ if (arg === "--preview") out.preview = argv[++i];
18
+ else if (arg === "--resolution") out.resolution = argv[++i];
19
+ else if (arg === "--help" || arg === "-h") { usage(); process.exit(0); }
20
+ else throw new Error(`unknown argument: ${arg}`);
21
+ }
22
+ if (!out.preview) throw new Error("--preview is required");
23
+ return out;
24
+ }
25
+ function insideRepo(path) {
26
+ const resolved = resolve(repoRoot, path);
27
+ const root = resolve(repoRoot);
28
+ if (resolved !== root && !resolved.startsWith(`${root}/`)) throw new Error(`path must stay inside repo: ${path}`);
29
+ return resolved;
30
+ }
31
+ function readJson(path) {
32
+ const resolved = insideRepo(path);
33
+ if (!existsSync(resolved)) throw new Error(`missing artifact: ${path}`);
34
+ return JSON.parse(readFileSync(resolved, "utf8"));
35
+ }
36
+ function hasForbiddenKeys(value) {
37
+ if (!value || typeof value !== "object") return false;
38
+ if (Array.isArray(value)) return value.some(hasForbiddenKeys);
39
+ return Object.entries(value).some(([key, child]) => forbiddenKeys.has(key) || hasForbiddenKeys(child));
40
+ }
41
+ function validScores(value) {
42
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
43
+ return ["size", "material", "complexity", "ambiguity", "risk", "novelty", "reuseValue", "validationNeed"].every((key) => typeof value[key] === "number" && Number.isFinite(value[key]) && value[key] >= 0 && value[key] <= 1);
44
+ }
45
+ function checkFlag(record, key, expected, errors, label) {
46
+ if (record[key] !== expected) errors.push(`${label} must keep ${key}=${expected}`);
47
+ }
48
+ function validatePreview(preview, errors) {
49
+ if (preview.schema !== "zob.compute-preview.v1") errors.push("preview schema must be zob.compute-preview.v1");
50
+ if (!requested.has(preview.requestedProfile)) errors.push("preview requestedProfile invalid");
51
+ if (!profiles.has(preview.recommendedProfile)) errors.push("preview recommendedProfile invalid");
52
+ if (!validScores(preview.scores)) errors.push("preview scores invalid");
53
+ checkFlag(preview, "noExecution", true, errors, "preview");
54
+ checkFlag(preview, "childDispatchAllowed", false, errors, "preview");
55
+ checkFlag(preview, "networkAccessed", false, errors, "preview");
56
+ checkFlag(preview, "sourceProjectModified", false, errors, "preview");
57
+ checkFlag(preview, "knowledgeBackendWriteEnabled", false, errors, "preview");
58
+ checkFlag(preview, "bodyStored", false, errors, "preview");
59
+ checkFlag(preview, "promptBodiesStored", false, errors, "preview");
60
+ checkFlag(preview, "outputBodiesStored", false, errors, "preview");
61
+ if (hasForbiddenKeys(preview)) errors.push("preview must not contain raw body/prompt/output/content/diff/patch keys");
62
+ }
63
+ function validateResolution(resolution, errors) {
64
+ if (resolution.schema !== "zob.compute-profile-resolution.v1") errors.push("resolution schema must be zob.compute-profile-resolution.v1");
65
+ if (!requested.has(resolution.requestedProfile)) errors.push("resolution requestedProfile invalid");
66
+ if (!profiles.has(resolution.recommendedProfile)) errors.push("resolution recommendedProfile invalid");
67
+ if (!profiles.has(resolution.effectiveProfile)) errors.push("resolution effectiveProfile invalid");
68
+ if (!resolution.caps || typeof resolution.caps !== "object") errors.push("resolution caps missing");
69
+ checkFlag(resolution, "noExecution", true, errors, "resolution");
70
+ checkFlag(resolution, "childDispatchAllowed", false, errors, "resolution");
71
+ checkFlag(resolution, "networkAccessed", false, errors, "resolution");
72
+ checkFlag(resolution, "sourceProjectModified", false, errors, "resolution");
73
+ checkFlag(resolution, "knowledgeBackendWriteEnabled", false, errors, "resolution");
74
+ checkFlag(resolution, "bodyStored", false, errors, "resolution");
75
+ checkFlag(resolution, "promptBodiesStored", false, errors, "resolution");
76
+ checkFlag(resolution, "outputBodiesStored", false, errors, "resolution");
77
+ if (resolution.gates?.parentOwnedDispatch !== true) errors.push("resolution gate parentOwnedDispatch must be true");
78
+ if (resolution.gates?.childDirectDispatch !== false) errors.push("resolution gate childDirectDispatch must be false");
79
+ if (resolution.adaptiveDelegationPolicyHint?.parentOwnedDispatch !== true) errors.push("resolution adaptiveDelegationPolicyHint.parentOwnedDispatch must be true");
80
+ if (resolution.adaptiveDelegationPolicyHint?.childDirectDispatch !== false) errors.push("resolution adaptiveDelegationPolicyHint.childDirectDispatch must be false");
81
+ if (hasForbiddenKeys(resolution)) errors.push("resolution must not contain raw body/prompt/output/content/diff/patch keys");
82
+ }
83
+ try {
84
+ const args = parseArgs(process.argv.slice(2));
85
+ const errors = [];
86
+ validatePreview(readJson(args.preview), errors);
87
+ if (args.resolution) validateResolution(readJson(args.resolution), errors);
88
+ const result = { schema: "zob.compute-profile-validation.v1", valid: errors.length === 0, errors, previewPath: args.preview, resolutionPath: args.resolution, noExecution: true, childDispatchAllowed: false, networkAccessed: false, bodyStored: false };
89
+ console.log(JSON.stringify(result, null, 2));
90
+ if (errors.length > 0) process.exit(1);
91
+ } catch (error) {
92
+ console.error(error instanceof Error ? error.message : String(error));
93
+ usage();
94
+ process.exit(1);
95
+ }
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
+
5
+ const repoRoot = process.cwd();
6
+ function usage() { console.error("Usage: node scripts/compute-profile/validate-workflow.mjs --workflow reports/.../compute-workflow-shape.json"); }
7
+ function parseArgs(argv) {
8
+ const out = {};
9
+ for (let i = 0; i < argv.length; i += 1) {
10
+ if (argv[i] === "--workflow") out.workflow = argv[++i];
11
+ else if (argv[i] === "--help" || argv[i] === "-h") { usage(); process.exit(0); }
12
+ else throw new Error(`unknown argument: ${argv[i]}`);
13
+ }
14
+ if (!out.workflow) throw new Error("--workflow is required");
15
+ return out;
16
+ }
17
+ function repoPath(path) {
18
+ const resolved = resolve(repoRoot, path);
19
+ const root = resolve(repoRoot);
20
+ if (resolved !== root && !resolved.startsWith(`${root}/`)) throw new Error(`path must stay inside repo: ${path}`);
21
+ return resolved;
22
+ }
23
+ function validate(shape) {
24
+ const errors = [];
25
+ if (shape.schema !== "zob.compute-workflow-shape.v1") errors.push("workflow schema must be zob.compute-workflow-shape.v1");
26
+ if (shape.parentOwnedDispatch !== true) errors.push("parentOwnedDispatch must be true");
27
+ if (shape.childDirectDispatch !== false) errors.push("childDirectDispatch must be false");
28
+ if (shape.liveDispatchEnabled !== false) errors.push("liveDispatchEnabled must be false");
29
+ if (shape.noExecution !== true) errors.push("noExecution must be true");
30
+ if (shape.networkAccessed !== false) errors.push("networkAccessed must be false");
31
+ if (shape.sourceProjectModified !== false) errors.push("sourceProjectModified must be false");
32
+ if (shape.bodyStored !== false || shape.promptBodiesStored !== false || shape.outputBodiesStored !== false) errors.push("workflow must keep body/prompt/output storage false");
33
+ if (!Array.isArray(shape.lanes) || shape.lanes.length < 1) errors.push("workflow requires lanes");
34
+ if (shape.promptPolicy?.rootCanWriteDirectly !== false) errors.push("promptPolicy rootCanWriteDirectly must be false");
35
+ if (shape.modelPolicy?.downgradePolicy !== "blocked_for_oracle_security") errors.push("modelPolicy must block oracle/security downgrade");
36
+ if (shape.scalePolicy?.stalePeerBlocksCompletion !== true || shape.scalePolicy?.duplicateDetectionRequired !== true) errors.push("scalePolicy must require stale and duplicate safeguards");
37
+ if (shape.documentationPolicy?.roleDocPacksRequired !== true || shape.documentationPolicy?.writebackPolicy !== "human_approval_required") errors.push("documentationPolicy must require role doc packs and human-approved writeback");
38
+ for (const [index, lane] of (shape.lanes || []).entries()) {
39
+ if (lane.parentOwnedDispatch !== true) errors.push(`lane ${index} parentOwnedDispatch must be true`);
40
+ if (lane.childDirectDispatch !== false) errors.push(`lane ${index} childDirectDispatch must be false`);
41
+ if (!Array.isArray(lane.tools)) errors.push(`lane ${index} tools must be array`);
42
+ }
43
+ return errors;
44
+ }
45
+ try {
46
+ const args = parseArgs(process.argv.slice(2));
47
+ const workflowPath = repoPath(args.workflow);
48
+ if (!existsSync(workflowPath)) throw new Error(`missing workflow: ${args.workflow}`);
49
+ const shape = JSON.parse(readFileSync(workflowPath, "utf8"));
50
+ const errors = validate(shape);
51
+ const result = { schema: "zob.compute-workflow-shape-validation.v1", valid: errors.length === 0, errors, workflowPath: args.workflow, noExecution: true, childDispatchAllowed: false, networkAccessed: false, bodyStored: false };
52
+ console.log(JSON.stringify(result, null, 2));
53
+ if (errors.length > 0) process.exit(1);
54
+ } catch (error) {
55
+ console.error(error instanceof Error ? error.message : String(error));
56
+ usage();
57
+ process.exit(1);
58
+ }
@@ -0,0 +1,221 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from "node:child_process";
3
+ import { readFileSync } from "node:fs";
4
+ import { resolve } from "node:path";
5
+
6
+ const repoRoot = resolve(new URL("../..", import.meta.url).pathname);
7
+
8
+ function readText(path) {
9
+ return readFileSync(resolve(repoRoot, path), "utf8");
10
+ }
11
+
12
+ function fail(message) {
13
+ console.error(`git-ops policy smoke failed: ${message}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ function assert(condition, message) {
18
+ if (!condition) fail(message);
19
+ }
20
+
21
+ function assertIncludes(text, needle, label) {
22
+ assert(text.includes(needle), `${label} missing ${JSON.stringify(needle)}`);
23
+ }
24
+
25
+ function assertNotIncludes(text, needle, label) {
26
+ assert(!text.includes(needle), `${label} must not contain ${JSON.stringify(needle)}`);
27
+ }
28
+
29
+ const packageManifest = JSON.parse(readText("package.json"));
30
+ const policy = JSON.parse(readText(".pi/git-policy.json"));
31
+ const capabilities = JSON.parse(readText(".pi/capabilities/zob-public-runtime-capabilities.json"));
32
+ const damageRules = JSON.parse(readText(".pi/damage-control-rules.json"));
33
+ const skill = readText(".pi/skills/zob-commit/SKILL.md");
34
+ const gitOps = readText(".pi/extensions/zob-harness/src/git-ops.ts");
35
+ const commands = readText(".pi/extensions/zob-harness/src/runtime/commands.ts");
36
+ const events = readText(".pi/extensions/zob-harness/src/runtime/events.ts");
37
+ const toolsZcommit = readText(".pi/extensions/zob-harness/src/runtime/tools-zcommit.ts");
38
+ const runtime = readText(".pi/extensions/zob-harness/src/runtime/zobHarness.ts");
39
+ const state = readText(".pi/extensions/zob-harness/src/runtime/state.ts");
40
+ const goalTodos = readText(".pi/extensions/zob-harness/src/goal-todos.ts");
41
+ const goalRuntime = readText(".pi/extensions/zob-harness/src/goal-runtime.ts");
42
+ const toolsDelegation = readText(".pi/extensions/zob-harness/src/runtime/tools-delegation.ts");
43
+
44
+ const allowedZcommitCommands = [
45
+ "/zcommit status [paths/globs...]",
46
+ "/zcommit plan [paths/globs...]",
47
+ "/zcommit adopt <paths...>",
48
+ "/zcommit commit [paths/globs...]",
49
+ "/zcommit push",
50
+ "/zcommit autocommit on",
51
+ "/zcommit autocommit off",
52
+ "/zcommit autopush on",
53
+ "/zcommit autopush off",
54
+ ];
55
+
56
+ assert(policy.defaults?.autocommit === "off", ".pi/git-policy.json must default autocommit off");
57
+ assert(policy.defaults?.autopush === "off", ".pi/git-policy.json must default autopush off");
58
+ assert(policy.commandSurface?.aliasesAllowed === false, ".pi/git-policy.json must set aliasesAllowed=false");
59
+ assert(policy.commandSurface?.explicitOnly === true, ".pi/git-policy.json must require explicitOnly command surface");
60
+ assert(policy.commandSurface?.directGitCommitPushTagAllowed === false, ".pi/git-policy.json must block direct git commit/push/tag");
61
+ assert((policy.commandSurface?.agentExecutableTools ?? []).includes("zob_zcommit_run"), ".pi/git-policy.json must expose agent-executable zcommit tool");
62
+ assert(policy.fileSelection?.strategy === "workspace_filtered", ".pi/git-policy.json must use easy workspace_filtered selection");
63
+ assert(policy.fileSelection?.onlyAgentOwnedFiles === false, ".pi/git-policy.json must not require agent-owned files in easy mode");
64
+ assert(policy.fileSelection?.excludeUnrelatedDirtyFiles === false, ".pi/git-policy.json must not exclude safe workspace dirty files in easy mode");
65
+ assert(policy.fileSelection?.bulkStageAllAllowed === true, ".pi/git-policy.json must allow bulk selection of safe filtered workspace files");
66
+ assert((policy.fileSelection?.forbiddenPaths ?? []).includes(".pi/worker-pools/"), ".pi/git-policy.json must exclude worker-pool runtime ledgers");
67
+ assert(policy.push?.forcePushAllowed === false, ".pi/git-policy.json must disallow force push");
68
+ assert(policy.push?.tagsAllowed === false, ".pi/git-policy.json must disallow tag push");
69
+ assert(policy.push?.pushAllAllowed === false, ".pi/git-policy.json must disallow push --all");
70
+ assert(policy.commitMessage?.format === "conventional-commits", ".pi/git-policy.json must require Conventional Commits");
71
+ assert(policy.commitMessage?.required === true, ".pi/git-policy.json must require a commit message policy");
72
+ assert(policy.validation?.mode === "advisory", ".pi/git-policy.json must use advisory validation before easy commits");
73
+ assert(policy.validation?.runBeforeCommit === true, ".pi/git-policy.json must still run validation before commit when possible");
74
+ assert(policy.validation?.requiredBeforeCommit === false, ".pi/git-policy.json must not block easy commits on validation by default");
75
+ assert(policy.validation?.requiredBeforePush === false, ".pi/git-policy.json must not block easy push on advisory validation by default");
76
+ assert(JSON.stringify(policy.commandSurface?.allowedCommands ?? []) === JSON.stringify(allowedZcommitCommands), ".pi/git-policy.json allowedCommands must be the explicit /zcommit surface only");
77
+ assert((packageManifest.files ?? []).includes(".pi/git-policy.json"), "package.json files must include .pi/git-policy.json");
78
+ assert((packageManifest.files ?? []).includes("scripts/git-ops"), "package.json files must include scripts/git-ops");
79
+
80
+ const damagePatterns = (damageRules.bashToolPatterns ?? []).map((rule) => rule.pattern ?? "");
81
+ for (const expected of ["\\bgit\\s+commit\\b", "\\bgit\\s+push\\b", "\\bgit\\s+tag\\b", "\\bgit\\s+add\\s+(-A|\\.)"]) {
82
+ assert(damagePatterns.includes(expected), `.pi/damage-control-rules.json missing blocked pattern ${expected}`);
83
+ }
84
+ assert(damagePatterns.some((pattern) => pattern.includes("--force") || pattern.includes("force-with-lease")), ".pi/damage-control-rules.json must explicitly block force push");
85
+
86
+ for (const command of allowedZcommitCommands) assertIncludes(skill, `- \`${command}\``, ".pi/skills/zob-commit/SKILL.md allowed command list");
87
+ for (const forbidden of ["/zc", "/zci", "/zpush", "/commit", "/push"]) {
88
+ assert(!skill.includes("`" + forbidden + "`") && !skill.includes("`" + forbidden + " "), `.pi/skills/zob-commit/SKILL.md alias surface must not list ${forbidden}`);
89
+ }
90
+ assertIncludes(skill, "Use only these explicit commands", ".pi/skills/zob-commit/SKILL.md");
91
+ assertIncludes(skill, "Do not invent aliases", ".pi/skills/zob-commit/SKILL.md");
92
+ assertIncludes(skill, "zob_zcommit_run", ".pi/skills/zob-commit/SKILL.md");
93
+ assertIncludes(skill, "do not answer with instructions", ".pi/skills/zob-commit/SKILL.md");
94
+ assertIncludes(skill, "Conventional Commits", ".pi/skills/zob-commit/SKILL.md");
95
+ assertIncludes(skill, "Easy workspace file rule", ".pi/skills/zob-commit/SKILL.md");
96
+ assertIncludes(skill, "autocommit` defaults to `off", ".pi/skills/zob-commit/SKILL.md");
97
+ assertIncludes(skill, "autopush` defaults to `off", ".pi/skills/zob-commit/SKILL.md");
98
+
99
+ assertIncludes(commands, 'pi.registerCommand("zcommit"', "commands.ts");
100
+ assertNotIncludes(commands, 'registerCommand("zc"', "commands.ts alias surface");
101
+ assertNotIncludes(commands, 'registerCommand("commit"', "commands.ts alias surface");
102
+ assertNotIncludes(commands, 'registerCommand("push"', "commands.ts alias surface");
103
+ assertIncludes(commands, "Easy governed ZOB commit workflow", "commands.ts zcommit description");
104
+ assertIncludes(commands, "status [paths/globs...]|plan [paths/globs...]|adopt <paths...>|commit [paths/globs...]|push|autocommit on|off|autopush on|off (no aliases)", "commands.ts zcommit description");
105
+ assertIncludes(commands, "Unknown /zcommit command", "commands.ts command parser");
106
+ assert((capabilities.tools ?? []).some((entry) => entry?.name === "zob_zcommit_run"), ".pi/capabilities registry must list zob_zcommit_run under tools[]");
107
+ assert(!(capabilities.commands ?? []).some((entry) => entry?.name === "zob_zcommit_run"), ".pi/capabilities registry must not list zob_zcommit_run under commands[]");
108
+ assertIncludes(runtime, "registerZcommitTools(pi, state)", "zobHarness.ts registers agent-executable zcommit tool");
109
+ assertIncludes(toolsZcommit, 'name: "zob_zcommit_run"', "tools-zcommit.ts registers zob_zcommit_run");
110
+ assertIncludes(toolsZcommit, "runGovernedZcommitCommit(ctx.cwd, state.zcommit, options)", "tools-zcommit.ts reuses governed commit engine");
111
+ assertIncludes(toolsZcommit, "runGovernedZcommitPush(ctx.cwd, state.zcommit, { explicitPush: true })", "tools-zcommit.ts reuses governed push engine");
112
+ assertIncludes(toolsZcommit, "sessionModifiedPathspecs", "tools-zcommit.ts supports session_modified scope");
113
+ assertIncludes(toolsZcommit, "scope=pathspecs requires non-empty paths", "tools-zcommit.ts supports explicit pathspec scope preflight");
114
+ assertIncludes(toolsZcommit, "action === \"commit_and_push\"", "tools-zcommit.ts supports commit_and_push");
115
+ assertIncludes(toolsZcommit, "messageHash", "tools-zcommit.ts stores message hash only in ledger");
116
+ assertNotIncludes(toolsZcommit, '["commit"', "tools-zcommit.ts must not call git commit directly");
117
+ assertNotIncludes(toolsZcommit, '["push"', "tools-zcommit.ts must not call git push directly");
118
+ assertNotIncludes(toolsZcommit, '["add"', "tools-zcommit.ts must not stage directly");
119
+
120
+ assertIncludes(gitOps, 'selectionMode === "workspace_filtered"', "git-ops.ts easy workspace mode");
121
+ assertIncludes(gitOps, "normalizeZcommitPathspecs", "git-ops.ts supports explicit pathspec filters");
122
+ assertIncludes(gitOps, "outside_zcommit_pathspec_filter", "git-ops.ts excludes dirty files outside explicit pathspec filters");
123
+ assertIncludes(gitOps, "pathspecErrors.length === 0", "git-ops.ts invalid pathspecs must block commit execution");
124
+ assertIncludes(gitOps, "abort: no safe dirty files match zcommit pathspecs", "git-ops.ts reports empty pathspec selections");
125
+ assertIncludes(gitOps, "abort: no safe dirty workspace files to commit", "git-ops.ts easy mode missing-files blocker");
126
+ assertIncludes(gitOps, "forbidden_by_git_policy_excluded", "git-ops.ts excludes forbidden unstaged paths");
127
+ assertIncludes(gitOps, '".pi/worker-pools/"', "git-ops.ts hard-excludes worker-pool runtime ledgers");
128
+ assertIncludes(gitOps, "plan.validationMode === \"blocking\"", "git-ops.ts advisory validation must not block easy commits");
129
+ assertIncludes(gitOps, "add supervised owner micro-worker pools", "git-ops.ts infers a beautiful worker-pool Conventional Commit");
130
+ assertIncludes(gitOps, "parseConventionalCommitOverride", "git-ops.ts supports governed message overrides");
131
+ assertIncludes(gitOps, '["add", "--", ...eligiblePaths]', "git-ops.ts explicit selected-path staging");
132
+ assertNotIncludes(gitOps, '["add", "."]', "git-ops.ts must not use git add .");
133
+ assertNotIncludes(gitOps, '["add", "-A"]', "git-ops.ts must not use git add -A");
134
+ assertNotIncludes(gitOps, '["add", "--all"]', "git-ops.ts must not use git add --all");
135
+ assertIncludes(gitOps, '["push", remote, `HEAD:${branch}`]', "git-ops.ts governed push shape");
136
+ assertIncludes(gitOps, "policy.validation?.requiredBeforePush !== false", "git-ops.ts keeps optional strict push validation gate");
137
+ assertIncludes(gitOps, 'runtime.autocommit !== "on"', "git-ops.ts autopush requires autocommit on");
138
+ assertIncludes(gitOps, "runtime.lastValidation", "git-ops.ts optional push validation gate");
139
+ assertIncludes(gitOps, "validation.requiredBeforePush requires successful validation before /zcommit push", "git-ops.ts optional missing push validation blocker");
140
+ assertIncludes(gitOps, "validation.requiredBeforePush requires validation to run before or at the last /zcommit commit creation", "git-ops.ts optional stale push validation blocker");
141
+ assertIncludes(gitOps, "plan.unexpectedStaged.length > 0", "git-ops.ts push staged-file blocker");
142
+ assertIncludes(gitOps, "last /zcommit commit contains forbidden files", "git-ops.ts push forbidden last-commit blocker");
143
+ for (const forbidden of ["--force", "--force-with-lease", "-f", "--tags", "--all", "tag"]) {
144
+ assert(!gitOps.includes(`[${JSON.stringify(forbidden)}`), `git-ops.ts must not provide git ${forbidden} command path`);
145
+ assert(!gitOps.includes(`, ${JSON.stringify(forbidden)}`), `git-ops.ts must not provide git ${forbidden} command path`);
146
+ }
147
+ assertIncludes(gitOps, '["restore", "--staged", "--", ...paths]', "git-ops.ts commit cleanup");
148
+ assertIncludes(gitOps, 'export type ZcommitOwnershipSource = "local_tool_call" | "parent_accepted_child_claim" | "compaction_continuity" | "explicit_zcommit_adopt"', "git-ops.ts explicit ownership sources");
149
+ assertIncludes(gitOps, "export interface ZcommitAdoptResult", "git-ops.ts explicit adopt result");
150
+ assertIncludes(gitOps, "runGovernedZcommitAdopt", "git-ops.ts governed adopt API");
151
+ assertIncludes(gitOps, "readGitDirtyFiles(repoRoot)", "git-ops.ts adopt reads git status");
152
+ assertIncludes(gitOps, '"--untracked-files=all"', "git-ops.ts git status must include untracked files");
153
+ assertIncludes(gitOps, "isExplicitZcommitAdoptArg", "git-ops.ts adopt rejects broad-root/global adoption");
154
+ assertIncludes(gitOps, "statSync(resolve(repoRoot, normalizedPath)).isDirectory()", "git-ops.ts adopt rejects directory adoption");
155
+ assertIncludes(gitOps, "hasZcommitAdoptWildcard", "git-ops.ts adopt rejects wildcard adoption");
156
+ assertIncludes(gitOps, "zcommitDirtyFileMatchesAdoptPath", "git-ops.ts adopt uses explicit path matching");
157
+ assertIncludes(gitOps, "file.path === requestedPath || file.originalPath === requestedPath", "git-ops.ts adopt must match exact dirty file paths only");
158
+ assertNotIncludes(gitOps, "file.path.startsWith(`${requestedPath}/`)", "git-ops.ts adopt must not use directory-prefix matching");
159
+ assertNotIncludes(gitOps, "file.originalPath?.startsWith(`${requestedPath}/`)", "git-ops.ts adopt must not use original-path directory-prefix matching");
160
+ assertIncludes(gitOps, "staged_file_not_adopted", "git-ops.ts adopt refuses staged dirty files");
161
+ assertIncludes(gitOps, "recordZcommitOwnedPath(runtime, repoRoot, file.path, \"explicit_zcommit_adopt\"", "git-ops.ts adopt records only matched dirty files");
162
+ assertNotIncludes(gitOps, "recordZcommitOwnedPaths(runtime, repoRoot, dirtyFiles", "git-ops.ts adopt must not globally adopt dirty files");
163
+ const adoptFunction = gitOps.slice(gitOps.indexOf("export function runGovernedZcommitAdopt"), gitOps.indexOf("export function readZcommitPolicy"));
164
+ assert(adoptFunction.includes("runGovernedZcommitAdopt"), "git-ops.ts adopt function block must be discoverable");
165
+ assertNotIncludes(adoptFunction, '["add"', "git-ops.ts adopt must not run git add");
166
+ assertNotIncludes(adoptFunction, "...dirtyFiles", "git-ops.ts adopt must not bulk-record all dirty files");
167
+ assertIncludes(gitOps, "recordZcommitOwnedPath", "git-ops.ts explicit owned path API");
168
+ assertIncludes(gitOps, "captureZcommitChildDirtySnapshot", "git-ops.ts child dirty delta snapshot API");
169
+ assertIncludes(gitOps, "diffZcommitChildDirtySnapshots", "git-ops.ts child dirty delta diff API");
170
+ assertIncludes(gitOps, "recordZcommitOwnedPaths", "git-ops.ts accepted child changed path adoption API");
171
+ assertIncludes(gitOps, "zcommitPathWithinAllowed", "git-ops.ts child dirty delta allowed-path filter");
172
+ assertIncludes(gitOps, "zcommitFileContentHash", "git-ops.ts child dirty delta content hash");
173
+ assertIncludes(gitOps, "hardForbiddenZcommitPatterns", "git-ops.ts policy/hard forbidden path filter");
174
+ assertIncludes(gitOps, "...Object.keys(runtime.ownedPathRefs ?? {})", "git-ops.ts retains explicit owned path refs for legacy/adopt metadata");
175
+ assertNotIncludes(gitOps, "dirtyFiles.map", "git-ops.ts must not blindly map all dirty files into ownership refs");
176
+ assertIncludes(gitOps, '["diff", "--cached", "--name-only", "-z"]', "git-ops.ts cached index inspection");
177
+ assertIncludes(gitOps, '["diff", "--cached", "--check"]', "git-ops.ts cached diff verification");
178
+ assertIncludes(gitOps, "sameStringSet(stagedAfterAdd, eligiblePaths)", "git-ops.ts staged path allowlist verification");
179
+ assertIncludes(gitOps, "commitMessageArgs", "git-ops.ts Conventional Commit path");
180
+
181
+ assertIncludes(events, 'pi.on("message_end"', "events.ts message_end hook");
182
+ assertIncludes(events, 'state.zcommit.autocommit !== "on"', "events.ts autocommit default-off guard");
183
+ assertIncludes(events, "runGovernedZcommitCommit(ctx.cwd, state.zcommit)", "events.ts governed autocommit gate");
184
+ assertIncludes(events, 'state.zcommit.autopush === "on"', "events.ts autopush toggle guard");
185
+ assertIncludes(events, "runGovernedZcommitPush(ctx.cwd, state.zcommit, { explicitPush: false })", "events.ts governed autopush hook");
186
+ assertIncludes(events, "zob.zcommit-message-end.v1", "events.ts body-free autocommit ledger schema");
187
+ assertIncludes(events, 'schema: "zob.zcommit-message-end.v1",\n bodyStored: false', "events.ts body-free autocommit ledger flag");
188
+ assertIncludes(events, "ownedPathRefs: zcommitOwnedPathLedgerRefs(state)", "events.ts persists explicit zcommit ownership refs");
189
+ assertIncludes(events, "zob.zcommit-continuity.v1", "events.ts compaction persists zcommit-owned refs in zcommit ledger");
190
+ assertIncludes(commands, "ownedPathRefs: zcommitOwnedPathLedgerRefs(state)", "commands.ts persists explicit zcommit ownership refs");
191
+ assertNotIncludes(state, "restoreZcommitCompactionContinuity", "state.ts must not restore zcommit ownership from compaction modifiedFiles");
192
+ assertNotIncludes(state, "restoreZcommitAcceptedTodoClaimOwnership", "state.ts must not restore zcommit ownership from TODO evidenceRefs");
193
+ assertNotIncludes(state, "fileRefs?.modifiedFiles", "state.ts must not inspect compaction modifiedFiles for zcommit ownership");
194
+ assertNotIncludes(state, "for (const ref of node.evidenceRefs)", "state.ts must not adopt TODO evidenceRefs as zcommit ownership");
195
+ assertIncludes(state, "restoreZcommitMetadataFromEntries", "state.ts restores zcommit-owned refs only from zob-zcommit entries");
196
+ assertIncludes(goalTodos, "childChangedPaths", "goal-todos.ts stores child changed paths on returned claim");
197
+ assertIncludes(goalTodos, "recordZcommitOwnedPaths(state.zcommit", "goal-todos.ts adopts accepted child changed paths");
198
+ assertIncludes(goalTodos, "changedPaths.length > 0 && !input.repoRoot", "goal-todos.ts must require explicit repoRoot when accepting child changed paths");
199
+ assertNotIncludes(goalTodos, "input.repoRoot ?? process.cwd()", "goal-todos.ts must not fall back to process.cwd for child ownership adoption");
200
+ assertIncludes(goalTodos, "parent_accepted_child_claim", "goal-todos.ts uses delegated claim ownership source only at acceptance");
201
+ assertIncludes(goalRuntime, "resolveGoalTodo(pi, state, goalId, params.todo_id, { action: params.action as ResolveGoalTodoAction, evidenceRefs: params.evidence_refs, validationCommands: params.validation_commands, reason: params.reason, repoRoot: ctx.cwd }", "goal-runtime.ts resolve_goal_todo passes ctx.cwd as repoRoot");
202
+ assertIncludes(goalRuntime, "recordGoalTodoClaimValidationResult(pi, state, goalId, params.todo_id", "goal-runtime.ts validates delegated claims through runtime path");
203
+ assertIncludes(goalRuntime, "repoRoot: ctx.cwd", "goal-runtime.ts auto/accept claim paths pass ctx.cwd repoRoot");
204
+ assertIncludes(toolsDelegation, "captureZcommitChildDirtySnapshot", "tools-delegation.ts captures child dirty snapshot");
205
+ assertIncludes(toolsDelegation, "diffZcommitChildDirtySnapshots", "tools-delegation.ts computes child dirty delta");
206
+ assertIncludes(toolsDelegation, "captureZcommitChildDirtySnapshot(ctx.cwd, childPathPolicy)", "tools-delegation.ts must capture child dirty snapshot at repo root, not child cwd");
207
+ assertIncludes(toolsDelegation, "captureChildDirtyDelta(ctx.cwd, childPathPolicy, beforeChildDirty)", "tools-delegation.ts must diff child dirty snapshot at repo root, not child cwd");
208
+ assertNotIncludes(toolsDelegation, "captureZcommitChildDirtySnapshot(cwdResult.cwd, childPathPolicy)", "tools-delegation.ts must not use child cwd as repoRoot for dirty snapshot");
209
+ assertNotIncludes(toolsDelegation, "captureChildDirtyDelta(cwdResult.cwd, childPathPolicy, beforeChildDirty)", "tools-delegation.ts must not use child cwd as repoRoot for dirty diff");
210
+ assertIncludes(toolsDelegation, "toolsEnableWrites", "tools-delegation.ts captures only write-enabled child runs");
211
+ assertIncludes(toolsDelegation, "result.childChangedPaths", "tools-delegation.ts stores child changed paths in ChildResult");
212
+ assertIncludes(toolsDelegation, "childChangedPathRefs", "tools-delegation.ts persists body-free child changed paths in ledger");
213
+ assertIncludes(toolsDelegation, "recordTodoClaimFromChildResult", "tools-delegation.ts attaches run changed paths to returned claims");
214
+
215
+ const cached = execFileSync("git", ["diff", "--cached", "--name-only"], { cwd: repoRoot, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] })
216
+ .trim()
217
+ .split(/\r?\n/)
218
+ .filter(Boolean);
219
+ assert(cached.length === 0, `current git index must be empty; staged files: ${cached.join(", ")}`);
220
+
221
+ console.log("git-ops policy smoke passed");