zob-harness 0.2.0 → 0.3.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 (214) hide show
  1. package/.pi/capabilities/zob-public-runtime-capabilities.json +4 -4
  2. package/.pi/extensions/zob-child-safety/AGENTS.md +12 -0
  3. package/.pi/extensions/zob-child-safety/index.ts +4 -105
  4. package/.pi/extensions/zob-child-safety/src/AGENTS.md +10 -0
  5. package/.pi/extensions/zob-child-safety/src/policy.ts +106 -0
  6. package/.pi/extensions/zob-harness/AGENTS.md +2 -0
  7. package/.pi/extensions/zob-harness/index.ts +94 -94
  8. package/.pi/extensions/zob-harness/src/AGENTS.md +4 -0
  9. package/.pi/extensions/zob-harness/src/core/AGENTS.md +24 -0
  10. package/.pi/extensions/zob-harness/src/{constants.ts → core/constants.ts} +10 -1
  11. package/.pi/extensions/zob-harness/src/core/utils/AGENTS.md +23 -0
  12. package/.pi/extensions/zob-harness/src/{utils → core/utils}/formatting.ts +1 -1
  13. package/.pi/extensions/zob-harness/src/{utils → core/utils}/records.ts +1 -1
  14. package/.pi/extensions/zob-harness/src/{utils → core/utils}/resources.ts +1 -1
  15. package/.pi/extensions/zob-harness/src/domains/AGENTS.md +23 -0
  16. package/.pi/extensions/zob-harness/src/domains/autonomy/AGENTS.md +21 -0
  17. package/.pi/extensions/zob-harness/src/{autonomous-runtime.ts → domains/autonomy/autonomous-runtime.ts} +22 -22
  18. package/.pi/extensions/zob-harness/src/{autonomy-readiness.ts → domains/autonomy/autonomy-readiness.ts} +18 -18
  19. package/.pi/extensions/zob-harness/src/{daemon-policy.ts → domains/autonomy/daemon-policy.ts} +6 -6
  20. package/.pi/extensions/zob-harness/src/{daemon-readiness.ts → domains/autonomy/daemon-readiness.ts} +7 -7
  21. package/.pi/extensions/zob-harness/src/{daemon-runtime.ts → domains/autonomy/daemon-runtime.ts} +2 -2
  22. package/.pi/extensions/zob-harness/src/{full-autonomy-test.ts → domains/autonomy/full-autonomy-test.ts} +4 -4
  23. package/.pi/extensions/zob-harness/src/{interactive-autonomy.ts → domains/autonomy/interactive-autonomy.ts} +2 -2
  24. package/.pi/extensions/zob-harness/src/{compute-profile.ts → domains/compute/compute-profile.ts} +3 -3
  25. package/.pi/extensions/zob-harness/src/{compute-workflow-shape.ts → domains/compute/compute-workflow-shape.ts} +3 -3
  26. package/.pi/extensions/zob-harness/src/domains/coms/AGENTS.md +21 -0
  27. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/envelope.ts +2 -2
  28. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/identity.ts +3 -3
  29. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/ledger-bridge.ts +2 -2
  30. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/local-transport.ts +1 -1
  31. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/policy.ts +3 -3
  32. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/presence.ts +1 -1
  33. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/registry.ts +3 -3
  34. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/response-capture.ts +1 -1
  35. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/transcript-capture.ts +2 -2
  36. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/zpeer-profile.ts +3 -3
  37. package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/zpeer.ts +3 -3
  38. package/.pi/extensions/zob-harness/src/{mission-control.ts → domains/coms/mission-control.ts} +8 -8
  39. package/.pi/extensions/zob-harness/src/{zagents.ts → domains/coms/zagents.ts} +86 -4
  40. package/.pi/extensions/zob-harness/src/domains/context/AGENTS.md +20 -0
  41. package/.pi/extensions/zob-harness/src/{context-gbrain.ts → domains/context/context-gbrain.ts} +4 -4
  42. package/.pi/extensions/zob-harness/src/domains/delegation/AGENTS.md +21 -0
  43. package/.pi/extensions/zob-harness/src/{agents.ts → domains/delegation/agents.ts} +2 -2
  44. package/.pi/extensions/zob-harness/src/{capabilities.ts → domains/delegation/capabilities.ts} +6 -6
  45. package/.pi/extensions/zob-harness/src/{child-runner.ts → domains/delegation/child-runner.ts} +8 -8
  46. package/.pi/extensions/zob-harness/src/{output-contracts.ts → domains/delegation/output-contracts.ts} +1 -1
  47. package/.pi/extensions/zob-harness/src/{prompt-packs.ts → domains/delegation/prompt-packs.ts} +4 -4
  48. package/.pi/extensions/zob-harness/src/domains/factory/AGENTS.md +21 -0
  49. package/.pi/extensions/zob-harness/src/{factory → domains/factory}/agentic-plan.ts +1 -1
  50. package/.pi/extensions/zob-harness/src/{factory-selector.ts → domains/factory/factory-selector.ts} +4 -4
  51. package/.pi/extensions/zob-harness/src/{factory → domains/factory}/quarantine.ts +5 -5
  52. package/.pi/extensions/zob-harness/src/{factory → domains/factory}/run.ts +5 -5
  53. package/.pi/extensions/zob-harness/src/{factory → domains/factory}/validation.ts +10 -10
  54. package/.pi/extensions/zob-harness/src/domains/git/AGENTS.md +20 -0
  55. package/.pi/extensions/zob-harness/src/{git-ops.ts → domains/git/git-ops.ts} +3 -3
  56. package/.pi/extensions/zob-harness/src/domains/goal/AGENTS.md +22 -0
  57. package/.pi/extensions/zob-harness/src/{goal-room.ts → domains/goal/goal-room.ts} +7 -7
  58. package/.pi/extensions/zob-harness/src/{goal-todo-imports.ts → domains/goal/goal-todo-imports.ts} +1 -1
  59. package/.pi/extensions/zob-harness/src/{goal-todo-types.ts → domains/goal/goal-todo-types.ts} +1 -1
  60. package/.pi/extensions/zob-harness/src/{goal-todos.ts → domains/goal/goal-todos.ts} +4 -4
  61. package/.pi/extensions/zob-harness/src/{goal.ts → domains/goal/goal.ts} +1 -1
  62. package/.pi/extensions/zob-harness/src/domains/governance/AGENTS.md +21 -0
  63. package/.pi/extensions/zob-harness/src/{budget-policy.ts → domains/governance/budget-policy.ts} +6 -6
  64. package/.pi/extensions/zob-harness/src/{governed-requests.ts → domains/governance/governed-requests.ts} +7 -7
  65. package/.pi/extensions/zob-harness/src/{launch-apply.ts → domains/governance/launch-apply.ts} +4 -4
  66. package/.pi/extensions/zob-harness/src/{merge-queue.ts → domains/governance/merge-queue.ts} +6 -6
  67. package/.pi/extensions/zob-harness/src/{rules.ts → domains/governance/rules.ts} +7 -7
  68. package/.pi/extensions/zob-harness/src/{safety.ts → domains/governance/safety.ts} +3 -3
  69. package/.pi/extensions/zob-harness/src/{sandbox.ts → domains/governance/sandbox.ts} +5 -5
  70. package/.pi/extensions/zob-harness/src/{worker-pool.ts → domains/governance/worker-pool.ts} +7 -7
  71. package/.pi/extensions/zob-harness/src/{workspace-claims.ts → domains/governance/workspace-claims.ts} +6 -6
  72. package/.pi/extensions/zob-harness/src/domains/models/AGENTS.md +20 -0
  73. package/.pi/extensions/zob-harness/src/{model-availability.ts → domains/models/model-availability.ts} +1 -1
  74. package/.pi/extensions/zob-harness/src/{model-routing.ts → domains/models/model-routing.ts} +6 -6
  75. package/.pi/extensions/zob-harness/src/domains/orchestration/AGENTS.md +21 -0
  76. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/adaptive-delegation.ts +8 -8
  77. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/adaptive-workflow.ts +4 -4
  78. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/lead-plan.ts +5 -5
  79. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/plan.ts +5 -5
  80. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/room.ts +4 -4
  81. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/run.ts +6 -6
  82. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/supervised-readonly.ts +6 -6
  83. package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/widget-readers.ts +2 -2
  84. package/.pi/extensions/zob-harness/src/domains/project-dna/AGENTS.md +19 -0
  85. package/.pi/extensions/zob-harness/src/{project-dna.ts → domains/project-dna/project-dna.ts} +4 -4
  86. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/candidate.ts +5 -5
  87. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/coms.ts +3 -3
  88. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/documentation.ts +4 -4
  89. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/factory.ts +2 -2
  90. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/temp-agent.ts +4 -4
  91. package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/write-lane.ts +3 -3
  92. package/.pi/extensions/zob-harness/src/domains/telemetry/AGENTS.md +19 -0
  93. package/.pi/extensions/zob-harness/src/{chronicle.ts → domains/telemetry/chronicle.ts} +3 -3
  94. package/.pi/extensions/zob-harness/src/{queue.ts → domains/telemetry/queue.ts} +7 -7
  95. package/.pi/extensions/zob-harness/src/{telemetry.ts → domains/telemetry/telemetry.ts} +4 -4
  96. package/.pi/extensions/zob-harness/src/{topology → domains/topology}/chains.ts +10 -10
  97. package/.pi/extensions/zob-harness/src/{topology → domains/topology}/coms.ts +3 -3
  98. package/.pi/extensions/zob-harness/src/{topology → domains/topology}/orchestration-profiles.ts +8 -8
  99. package/.pi/extensions/zob-harness/src/{topology → domains/topology}/teams.ts +8 -8
  100. package/.pi/extensions/zob-harness/src/runtime/adaptive-zmode.ts +2 -2
  101. package/.pi/extensions/zob-harness/src/runtime/auto-compaction.ts +2 -2
  102. package/.pi/extensions/zob-harness/src/runtime/commands.ts +49 -27
  103. package/.pi/extensions/zob-harness/src/runtime/compaction-policy.ts +2 -2
  104. package/.pi/extensions/zob-harness/src/runtime/delegation-feed.ts +1 -1
  105. package/.pi/extensions/zob-harness/src/runtime/delegation-monitor.ts +1 -1
  106. package/.pi/extensions/zob-harness/src/runtime/events.ts +52 -37
  107. package/.pi/extensions/zob-harness/src/{goal-runtime.ts → runtime/goal-runtime.ts} +9 -9
  108. package/.pi/extensions/zob-harness/src/runtime/goal-todo-overlay.ts +1 -1
  109. package/.pi/extensions/zob-harness/src/runtime/plan-capture.ts +2 -2
  110. package/.pi/extensions/zob-harness/src/runtime/state.ts +15 -13
  111. package/.pi/extensions/zob-harness/src/runtime/tools-autonomous.ts +2 -2
  112. package/.pi/extensions/zob-harness/src/runtime/tools-compute.ts +3 -3
  113. package/.pi/extensions/zob-harness/src/runtime/tools-coms.ts +15 -12
  114. package/.pi/extensions/zob-harness/src/runtime/tools-context.ts +2 -2
  115. package/.pi/extensions/zob-harness/src/runtime/tools-delegation.ts +13 -13
  116. package/.pi/extensions/zob-harness/src/runtime/tools-factory.ts +19 -19
  117. package/.pi/extensions/zob-harness/src/runtime/tools-goal-room.ts +3 -3
  118. package/.pi/extensions/zob-harness/src/runtime/tools-governed-requests.ts +3 -3
  119. package/.pi/extensions/zob-harness/src/runtime/tools-merge-queue.ts +3 -3
  120. package/.pi/extensions/zob-harness/src/runtime/tools-mission-control.ts +3 -3
  121. package/.pi/extensions/zob-harness/src/runtime/tools-orchestration.ts +9 -9
  122. package/.pi/extensions/zob-harness/src/runtime/tools-project-dna.ts +2 -2
  123. package/.pi/extensions/zob-harness/src/runtime/tools-worker-pool.ts +3 -3
  124. package/.pi/extensions/zob-harness/src/runtime/tools-workspace-claims.ts +3 -3
  125. package/.pi/extensions/zob-harness/src/runtime/tools-zcommit.ts +3 -3
  126. package/.pi/extensions/zob-harness/src/runtime/widget.ts +25 -8
  127. package/.pi/extensions/zob-harness/src/runtime/zobHarness.ts +1 -1
  128. package/.pi/extensions/zob-harness/src/types.ts +2 -2
  129. package/.pi/extensions/zob-switch/AGENTS.md +9 -0
  130. package/.pi/extensions/zob-switch/index.ts +9 -121
  131. package/.pi/extensions/zob-switch/src/AGENTS.md +8 -0
  132. package/.pi/extensions/zob-switch/src/autocomplete.ts +12 -0
  133. package/.pi/extensions/zob-switch/src/paths.ts +8 -0
  134. package/.pi/extensions/zob-switch/src/settings.ts +25 -0
  135. package/.pi/extensions/zob-switch/src/snapshot.ts +34 -0
  136. package/.pi/extensions/zob-switch/src/state.ts +57 -0
  137. package/.pi/factories/agentic-spec-team/README.md +35 -0
  138. package/.pi/factories/agentic-spec-team/batch-manifest.json +11 -0
  139. package/.pi/factories/agentic-spec-team/example-agentic-spec-manifest.json +19 -0
  140. package/.pi/factories/agentic-spec-team/factory.json +98 -0
  141. package/.pi/factories/agentic-spec-team/pilot-manifest.json +11 -0
  142. package/.pi/factories/agentic-spec-team/schemas/final-report.schema.json +15 -0
  143. package/.pi/factories/agentic-spec-team/schemas/manifest.schema.json +14 -0
  144. package/.pi/factories/agentic-spec-team/schemas/question.schema.json +18 -0
  145. package/.pi/factories/agentic-spec-team/schemas/source-register.schema.json +11 -0
  146. package/.pi/factories/agentic-spec-team/schemas/traceability.schema.json +11 -0
  147. package/.pi/factories/agentic-spec-team/smoke-manifest.json +11 -0
  148. package/.pi/skills/zob-agentic-spec-team/SKILL.md +145 -0
  149. package/.pi/skills/zob-split-refactor/SKILL.md +1 -1
  150. package/.pi/skills/zob-zagent-creator/SKILL.md +256 -12
  151. package/.pi/zagents/bdd-writer.json +20 -0
  152. package/.pi/zagents/data-profile-analyst.json +20 -0
  153. package/.pi/zagents/domain-modeler.json +20 -0
  154. package/.pi/zagents/planner-handoff-writer.json +20 -0
  155. package/.pi/zagents/prompts/agentic-spec-run-role.md +30 -0
  156. package/.pi/zagents/source-intake-steward.json +20 -0
  157. package/.pi/zagents/spec-chief.json +21 -0
  158. package/.pi/zagents/spec-oracle.json +20 -0
  159. package/.pi/zagents/spec-writer.json +20 -0
  160. package/.pi/zagents/ux-flow-analyst.json +20 -0
  161. package/.pi/zteams/agentic-spec-run.json +42 -0
  162. package/.pi/zteams/agentic-spec-run.tmux.sh +134 -0
  163. package/SOURCE_INDEX.md +1 -1
  164. package/package.json +9 -1
  165. package/scripts/README.md +1 -1
  166. package/scripts/agentic-spec-team/validate-bdd.mjs +13 -0
  167. package/scripts/agentic-spec-team/validate-final-report.mjs +14 -0
  168. package/scripts/agentic-spec-team/validate-manifest.mjs +14 -0
  169. package/scripts/agentic-spec-team/validate-oracle-ready.mjs +13 -0
  170. package/scripts/agentic-spec-team/validate-question-loop.mjs +15 -0
  171. package/scripts/agentic-spec-team/validate-run.mjs +11 -0
  172. package/scripts/agentic-spec-team/validate-source-register.mjs +17 -0
  173. package/scripts/agentic-spec-team/validate-traceability.mjs +20 -0
  174. package/scripts/agentic-spec-team/validate-workgraph.mjs +13 -0
  175. package/scripts/autonomy/mission-readiness-secret-smoke.mjs +5 -5
  176. package/scripts/git-ops/commit-policy-smoke.mjs +5 -4
  177. package/scripts/goal-todo/child-goal-ref-smoke.mjs +2 -2
  178. package/scripts/path-policy/validate-smoke.mjs +3 -3
  179. package/scripts/project-dna/AGENTS.md +39 -0
  180. package/scripts/project-dna/{validate-scaffold.mjs → validation/validate-scaffold.mjs} +7 -7
  181. package/scripts/spec-run.mjs +365 -0
  182. package/scripts/worker-pool/static-smoke.mjs +5 -5
  183. package/scripts/zagent-static-smoke.mjs +35 -6
  184. package/scripts/zpeer-local-e2e-smoke.mjs +6 -5
  185. package/scripts/zpeer-static-smoke.mjs +17 -17
  186. /package/.pi/extensions/zob-harness/src/{types → core/types}/core.ts +0 -0
  187. /package/.pi/extensions/zob-harness/src/{utils → core/utils}/hashing.ts +0 -0
  188. /package/.pi/extensions/zob-harness/src/{utils → core/utils}/json.ts +0 -0
  189. /package/.pi/extensions/zob-harness/src/{utils → core/utils}/paths.ts +0 -0
  190. /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/AGENTS.md +0 -0
  191. /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/pending-replies.ts +0 -0
  192. /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/types.ts +0 -0
  193. /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/ledger.ts +0 -0
  194. /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/types.ts +0 -0
  195. /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/validate.ts +0 -0
  196. /package/.pi/extensions/zob-harness/src/{schemas-project-dna.ts → runtime/schemas-project-dna.ts} +0 -0
  197. /package/.pi/extensions/zob-harness/src/{schemas.ts → runtime/schemas.ts} +0 -0
  198. /package/scripts/project-dna/{bench-smoke.mjs → benchmark/bench-smoke.mjs} +0 -0
  199. /package/scripts/project-dna/{build-capsules.mjs → capsules/build-capsules.mjs} +0 -0
  200. /package/scripts/project-dna/{emit-golden-cases.mjs → emit/emit-golden-cases.mjs} +0 -0
  201. /package/scripts/project-dna/{emit-ontology.mjs → emit/emit-ontology.mjs} +0 -0
  202. /package/scripts/project-dna/{oracle-review-smoke.mjs → oracle/oracle-review-smoke.mjs} +0 -0
  203. /package/scripts/project-dna/{query-context.mjs → query/query-context.mjs} +0 -0
  204. /package/scripts/project-dna/{query-steward.mjs → query/query-steward.mjs} +0 -0
  205. /package/scripts/project-dna/{build-sample-spec.mjs → sample/build-sample-spec.mjs} +0 -0
  206. /package/scripts/project-dna/{generate-sample.mjs → sample/generate-sample.mjs} +0 -0
  207. /package/scripts/project-dna/{validate-sample-project.mjs → sample/validate-sample-project.mjs} +0 -0
  208. /package/scripts/project-dna/{scan.mjs → scan/scan.mjs} +0 -0
  209. /package/scripts/project-dna/{validate-scan-artifacts.mjs → scan/validate-scan-artifacts.mjs} +0 -0
  210. /package/scripts/project-dna/{validate-5of5.mjs → validation/validate-5of5.mjs} +0 -0
  211. /package/scripts/project-dna/{validate-golden-cases.mjs → validation/validate-golden-cases.mjs} +0 -0
  212. /package/scripts/project-dna/{validate-ontology.mjs → validation/validate-ontology.mjs} +0 -0
  213. /package/scripts/project-dna/{plan-workflow.mjs → workflow/plan-workflow.mjs} +0 -0
  214. /package/scripts/project-dna/{validate-workflow.mjs → workflow/validate-workflow.mjs} +0 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema": "zob.zagent.v1",
3
+ "id": "spec-chief",
4
+ "team": "agentic-spec-run",
5
+ "role": "orchestrator",
6
+ "alias": "spec_chief",
7
+ "description": "Lead for one Agentic Spec Team run; sole human interlocutor and owner of questions, blockers, traceability posture, and final report readiness.",
8
+ "promptRef": ".pi/zagents/prompts/agentic-spec-run-role.md",
9
+ "defaultMode": "orchestrator",
10
+ "defaultRoom": "spec-control",
11
+ "activeRoom": "spec-control",
12
+ "rooms": [{ "id": "spec-control", "alias": "spec_chief", "role": "lead", "active": true }],
13
+ "allowedTools": ["read", "bash", "write", "edit", "zpeer_ask"],
14
+ "allowedPaths": ["AGENTS.md", "README.md", "docs/", "specs/", "scripts/spec-run.mjs", "scripts/agentic-spec-team/", "reports/agentic-spec-runs/", ".pi/skills/zob-agentic-spec-team/", ".pi/factories/agentic-spec-team/", ".pi/zagents/", ".pi/zteams/"],
15
+ "forbiddenPaths": [".env", ".env.*", "node_modules/", "dist/", "build/", "coverage/", ".git/", ".pi/sessions/", ".pi/coms/"],
16
+ "approvalGates": { "externalAccess": "human", "externalWrite": "human+oracle", "commitOrPush": "human" },
17
+ "communicationPolicy": { "zpeerContact": true, "allowedRooms": ["spec-control"], "parentVisible": true, "hiddenPeerChat": false },
18
+ "localOnly": true,
19
+ "networkEnabled": false,
20
+ "bodyStored": false
21
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "zob.zagent.v1",
3
+ "id": "spec-oracle",
4
+ "team": "agentic-spec-run",
5
+ "role": "oracle",
6
+ "alias": "spec_oracle",
7
+ "description": "Skeptically validates source traceability, open questions, sensitive data posture, testability, handoff readiness, and no-ship status.",
8
+ "promptRef": ".pi/zagents/prompts/agentic-spec-run-role.md",
9
+ "defaultMode": "oracle",
10
+ "defaultRoom": "oracle",
11
+ "activeRoom": "oracle",
12
+ "rooms": [{ "id": "spec-control", "alias": "spec_oracle", "role": "oracle", "active": true }, { "id": "oracle", "alias": "spec_oracle", "role": "oracle", "active": true }],
13
+ "allowedTools": ["read", "bash", "write", "zpeer_ask"],
14
+ "allowedPaths": ["reports/agentic-spec-runs/"],
15
+ "forbiddenPaths": [".env", ".env.*", "node_modules/", "dist/", "build/", "coverage/", ".git/", ".pi/sessions/", ".pi/coms/"],
16
+ "communicationPolicy": { "zpeerContact": true, "allowedRooms": ["spec-control", "oracle"], "parentVisible": true, "hiddenPeerChat": false },
17
+ "localOnly": true,
18
+ "networkEnabled": false,
19
+ "bodyStored": false
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "zob.zagent.v1",
3
+ "id": "spec-writer",
4
+ "team": "agentic-spec-run",
5
+ "role": "spec-writing",
6
+ "alias": "spec_writer",
7
+ "description": "Synthesizes mission spec, feature slices, functional/non-functional requirements, and API/data contracts from traced evidence.",
8
+ "promptRef": ".pi/zagents/prompts/agentic-spec-run-role.md",
9
+ "defaultMode": "implement",
10
+ "defaultRoom": "writing",
11
+ "activeRoom": "writing",
12
+ "rooms": [{ "id": "spec-control", "alias": "spec_writer", "role": "member", "active": true }, { "id": "writing", "alias": "spec_writer", "role": "writer", "active": true }],
13
+ "allowedTools": ["read", "bash", "write", "zpeer_ask"],
14
+ "allowedPaths": ["reports/agentic-spec-runs/"],
15
+ "forbiddenPaths": [".env", ".env.*", "node_modules/", "dist/", "build/", "coverage/", ".git/", ".pi/sessions/", ".pi/coms/"],
16
+ "communicationPolicy": { "zpeerContact": true, "allowedRooms": ["spec-control", "writing"], "parentVisible": true, "hiddenPeerChat": false },
17
+ "localOnly": true,
18
+ "networkEnabled": false,
19
+ "bodyStored": false
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "zob.zagent.v1",
3
+ "id": "ux-flow-analyst",
4
+ "team": "agentic-spec-run",
5
+ "role": "ux-analysis",
6
+ "alias": "ux_flow",
7
+ "description": "Maps mockups, screens, user journeys, UI states, roles, permissions, and UX edge cases into cited artifacts.",
8
+ "promptRef": ".pi/zagents/prompts/agentic-spec-run-role.md",
9
+ "defaultMode": "explore",
10
+ "defaultRoom": "ux",
11
+ "activeRoom": "ux",
12
+ "rooms": [{ "id": "spec-control", "alias": "ux_flow", "role": "member", "active": true }, { "id": "ux", "alias": "ux_flow", "role": "analyst", "active": true }],
13
+ "allowedTools": ["read", "bash", "write", "zpeer_ask"],
14
+ "allowedPaths": ["reports/agentic-spec-runs/"],
15
+ "forbiddenPaths": [".env", ".env.*", "node_modules/", "dist/", "build/", "coverage/", ".git/", ".pi/sessions/", ".pi/coms/"],
16
+ "communicationPolicy": { "zpeerContact": true, "allowedRooms": ["spec-control", "ux"], "parentVisible": true, "hiddenPeerChat": false },
17
+ "localOnly": true,
18
+ "networkEnabled": false,
19
+ "bodyStored": false
20
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "schema": "zob.zteam.v1",
3
+ "id": "agentic-spec-run",
4
+ "description": "Temporary run-scoped Agentic Spec Team for turning explicit sources plus mission text into a traceable implementation spec.",
5
+ "defaultRoom": "spec-control",
6
+ "activeRoom": "spec-control",
7
+ "rooms": [
8
+ { "id": "spec-control", "role": "coordination", "active": true },
9
+ { "id": "intake", "role": "source-intake", "active": true },
10
+ { "id": "data", "role": "data-analysis", "active": true },
11
+ { "id": "domain", "role": "domain-modeling", "active": true },
12
+ { "id": "ux", "role": "ux-analysis", "active": true },
13
+ { "id": "writing", "role": "spec-writing", "active": true },
14
+ { "id": "validation", "role": "acceptance-bdd", "active": true },
15
+ { "id": "handoff", "role": "implementation-handoff", "active": true },
16
+ { "id": "oracle", "role": "final-review", "active": true }
17
+ ],
18
+ "agents": [
19
+ { "id": "spec-chief", "alias": "spec_chief", "rooms": [{ "id": "spec-control", "alias": "spec_chief", "role": "lead", "active": true }] },
20
+ { "id": "source-intake-steward", "alias": "source_intake", "rooms": [{ "id": "spec-control", "alias": "source_intake", "role": "member", "active": true }, { "id": "intake", "alias": "source_intake", "role": "steward", "active": true }] },
21
+ { "id": "data-profile-analyst", "alias": "data_profile", "rooms": [{ "id": "spec-control", "alias": "data_profile", "role": "member", "active": true }, { "id": "data", "alias": "data_profile", "role": "analyst", "active": true }] },
22
+ { "id": "domain-modeler", "alias": "domain_modeler", "rooms": [{ "id": "spec-control", "alias": "domain_modeler", "role": "member", "active": true }, { "id": "domain", "alias": "domain_modeler", "role": "modeler", "active": true }] },
23
+ { "id": "ux-flow-analyst", "alias": "ux_flow", "rooms": [{ "id": "spec-control", "alias": "ux_flow", "role": "member", "active": true }, { "id": "ux", "alias": "ux_flow", "role": "analyst", "active": true }] },
24
+ { "id": "spec-writer", "alias": "spec_writer", "rooms": [{ "id": "spec-control", "alias": "spec_writer", "role": "member", "active": true }, { "id": "writing", "alias": "spec_writer", "role": "writer", "active": true }] },
25
+ { "id": "bdd-writer", "alias": "bdd_writer", "rooms": [{ "id": "spec-control", "alias": "bdd_writer", "role": "member", "active": true }, { "id": "validation", "alias": "bdd_writer", "role": "acceptance", "active": true }] },
26
+ { "id": "planner-handoff-writer", "alias": "handoff_writer", "rooms": [{ "id": "spec-control", "alias": "handoff_writer", "role": "member", "active": true }, { "id": "handoff", "alias": "handoff_writer", "role": "planner", "active": true }] },
27
+ { "id": "spec-oracle", "alias": "spec_oracle", "rooms": [{ "id": "spec-control", "alias": "spec_oracle", "role": "oracle", "active": true }, { "id": "oracle", "alias": "spec_oracle", "role": "oracle", "active": true }] }
28
+ ],
29
+ "communicationPolicy": {
30
+ "zpeerContact": true,
31
+ "allowedRooms": ["spec-control", "intake", "data", "domain", "ux", "writing", "validation", "handoff", "oracle"],
32
+ "parentVisible": true,
33
+ "hiddenPeerChat": false,
34
+ "bodyStored": false
35
+ },
36
+ "metadata": {
37
+ "entryAgent": "spec-chief",
38
+ "temporaryRunTeam": true,
39
+ "humanInterlocutor": "spec-chief",
40
+ "closePolicy": "close only after final-report/status PASS no_ship=false"
41
+ }
42
+ }
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ PROJECT_DIR="/Users/cgarrot/zob/zob-harness"
5
+ ENTRY_AGENT="spec-chief"
6
+ PI_BIN="/Users/cgarrot/.nvm/versions/node/v24.14.0/bin/pi"
7
+ AGENTS=(
8
+ "spec-chief"
9
+ "source-intake-steward"
10
+ "data-profile-analyst"
11
+ "domain-modeler"
12
+ "ux-flow-analyst"
13
+ "spec-writer"
14
+ "bdd-writer"
15
+ "planner-handoff-writer"
16
+ "spec-oracle"
17
+ )
18
+
19
+ require_tmux() {
20
+ command -v tmux >/dev/null 2>&1 || { echo "tmux is required" >&2; exit 1; }
21
+ }
22
+
23
+ safe_token() {
24
+ printf '%s' "${1:-}" | tr -c 'A-Za-z0-9_-' '-' | sed 's/^-*//; s/-*$//; s/--*/-/g' | cut -c1-120
25
+ }
26
+
27
+ session_name() {
28
+ local run_id="$(safe_token "${1:-}")"
29
+ [ -n "$run_id" ] || { echo "missing run_id" >&2; exit 2; }
30
+ printf 'agentic-spec-run-%s' "$run_id"
31
+ }
32
+
33
+ is_known_agent() {
34
+ local candidate="${1:-}"
35
+ local agent
36
+ for agent in "${AGENTS[@]}"; do
37
+ [ "$agent" = "$candidate" ] && return 0
38
+ done
39
+ return 1
40
+ }
41
+
42
+ resolve_agent() {
43
+ local requested="${1:-$ENTRY_AGENT}"
44
+ if ! is_known_agent "$requested"; then
45
+ echo "Unknown run agent/window: $requested" >&2
46
+ printf 'Known agents:\n' >&2
47
+ printf ' %s\n' "${AGENTS[@]}" >&2
48
+ exit 2
49
+ fi
50
+ printf '%s' "$requested"
51
+ }
52
+
53
+ session_exists() {
54
+ local session="$1"
55
+ tmux has-session -t "$session" 2>/dev/null
56
+ }
57
+
58
+ start_detached() {
59
+ require_tmux
60
+ local run_id="$(safe_token "${1:-}")"
61
+ local session="$(session_name "$run_id")"
62
+ cd "$PROJECT_DIR"
63
+
64
+ if session_exists "$session"; then
65
+ echo "session already running: $session"
66
+ return 0
67
+ fi
68
+
69
+ local first="${AGENTS[0]}"
70
+ tmux new-session -d -s "$session" -n "$first" -c "$PROJECT_DIR"
71
+ tmux send-keys -t "$session:$first" "cd '$PROJECT_DIR' && unset npm_config_prefix && AGENTIC_SPEC_RUN_ID='$run_id' ZOB_ZAGENT_ID=$first '$PI_BIN'" C-m
72
+
73
+ local agent
74
+ for agent in "${AGENTS[@]:1}"; do
75
+ tmux new-window -t "$session" -n "$agent" -c "$PROJECT_DIR"
76
+ tmux send-keys -t "$session:$agent" "cd '$PROJECT_DIR' && unset npm_config_prefix && AGENTIC_SPEC_RUN_ID='$run_id' ZOB_ZAGENT_ID=$agent '$PI_BIN'" C-m
77
+ done
78
+
79
+ tmux select-window -t "$session:$ENTRY_AGENT"
80
+ echo "session started detached: $session"
81
+ }
82
+
83
+ attach() {
84
+ require_tmux
85
+ local run_id="$(safe_token "${1:-}")"
86
+ local session="$(session_name "$run_id")"
87
+ local agent="$(resolve_agent "${2:-$ENTRY_AGENT}")"
88
+ if ! session_exists "$session"; then
89
+ echo "session not running: $session" >&2
90
+ echo "Run: $0 start-detached $run_id" >&2
91
+ exit 1
92
+ fi
93
+ tmux select-window -t "$session:$agent"
94
+ tmux attach -t "$session:$agent"
95
+ }
96
+
97
+ status() {
98
+ require_tmux
99
+ local run_id="$(safe_token "${1:-}")"
100
+ local session="$(session_name "$run_id")"
101
+ if session_exists "$session"; then
102
+ tmux list-windows -t "$session" -F '#{window_index}: #{window_name} #{pane_current_command} active=#{window_active} panes=#{window_panes}'
103
+ else
104
+ echo "session not running: $session"
105
+ fi
106
+ }
107
+
108
+ close() {
109
+ require_tmux
110
+ local run_id="$(safe_token "${1:-}")"
111
+ local session="$(session_name "$run_id")"
112
+ if session_exists "$session"; then
113
+ tmux kill-session -t "$session"
114
+ echo "session closed: $session"
115
+ else
116
+ echo "session not running: $session"
117
+ fi
118
+ }
119
+
120
+ list_agents() {
121
+ printf 'entry: %s\n' "$ENTRY_AGENT"
122
+ printf 'agents:\n'
123
+ printf ' %s\n' "${AGENTS[@]}"
124
+ }
125
+
126
+ case "${1:-}" in
127
+ start|start-detached) start_detached "${2:-}" ;;
128
+ attach|window) attach "${2:-}" "${3:-$ENTRY_AGENT}" ;;
129
+ status) status "${2:-}" ;;
130
+ close) close "${2:-}" ;;
131
+ list) list_agents ;;
132
+ session-name) session_name "${2:-}" ;;
133
+ *) echo "Usage: $0 start-detached <run_id>|status <run_id>|attach <run_id> [agent]|close <run_id>|list|session-name <run_id>" >&2; exit 2 ;;
134
+ esac
package/SOURCE_INDEX.md CHANGED
@@ -35,7 +35,7 @@ See `scripts/README.md` for the script surface map.
35
35
 
36
36
  These are intentionally local/generated and should not be committed by default:
37
37
 
38
- - `docs/` — legacy/internal docs for now; future curated docs should be recreated intentionally.
38
+ - `docs/` — curated architecture/refactor docs plus local/generated planning docs; classify generated reports separately before commit.
39
39
  - `plans/` — captured planning artifacts.
40
40
  - `reports/` — generated reports and evidence.
41
41
  - `.pi/tmp/`, `.pi/logs/`, `.pi/sessions/`, `.pi/agent-sessions/` — runtime local state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zob-harness",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "A governed, human-controlled Pi harness for contract-driven agentic engineering, safety gates, specialist delegation, and software-factory workflows.",
6
6
  "license": "MIT",
@@ -46,6 +46,7 @@
46
46
  ".pi/factories/factory-forge",
47
47
  ".pi/factories/opencode-pattern-canonizer",
48
48
  ".pi/factories/project-dna",
49
+ ".pi/factories/agentic-spec-team",
49
50
  ".pi/factories/roadmap-smoke-lots",
50
51
  ".pi/git-policy.json",
51
52
  ".pi/mission-control/zob_coms_transport.json",
@@ -57,7 +58,11 @@
57
58
  ".pi/settings.json",
58
59
  ".pi/skills",
59
60
  ".pi/teams",
61
+ ".pi/zagents",
62
+ ".pi/zteams",
60
63
  "scripts/README.md",
64
+ "scripts/spec-run.mjs",
65
+ "scripts/agentic-spec-team",
61
66
  "scripts/autonomy",
62
67
  "scripts/compute-profile",
63
68
  "scripts/git-ops",
@@ -79,6 +84,9 @@
79
84
  "pi": "pi",
80
85
  "pi:explore": "pi --no-extensions -e ./.pi/extensions/zob-harness/index.ts --tools read,grep,find,ls,delegate_agent --append-system-prompt 'Start in ZOB explore mode.'",
81
86
  "pi:check": "pi --offline --no-session --no-extensions -e ./.pi/extensions/zob-harness/index.ts -p 'Reply exactly: zob-harness-ok'",
87
+ "spec-run": "node scripts/spec-run.mjs",
88
+ "spec-run:auto-pilot": "node scripts/spec-run.mjs auto-pilot",
89
+ "validate:agentic-spec-team": "node scripts/agentic-spec-team/validate-run.mjs",
82
90
  "check": "tsc --noEmit --pretty false",
83
91
  "check:ci": "npm run check -- --pretty false",
84
92
  "smoke:path-policy": "node scripts/path-policy/validate-smoke.mjs",
package/scripts/README.md CHANGED
@@ -13,7 +13,7 @@ These script families are intended to be part of the normal tracked repo workflo
13
13
  - `scripts/model-catalog/` — local model catalog/economy validators.
14
14
  - `scripts/package-surface/` — package.json script/file surface validation.
15
15
  - `scripts/path-policy/` — path safety smoke checks.
16
- - `scripts/project-dna/` — ProjectDNA scaffold/scan/query smoke helpers.
16
+ - `scripts/project-dna/` — ProjectDNA scaffold/scan/query smoke helpers; canonical helpers are grouped in subfolders with top-level compatibility CLI shims.
17
17
  - `scripts/worker-pool/` — worker-pool metadata/static checks.
18
18
  - `scripts/start-pi.sh` — local Pi startup helper.
19
19
 
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const criteria = join(runDir, "validation/acceptance-criteria.md");
7
+ const bdd = join(runDir, "validation/bdd-scenarios.feature.md");
8
+ const errors = [];
9
+ if (!existsSync(criteria)) errors.push(`missing ${criteria}`);
10
+ if (!existsSync(bdd)) errors.push(`missing ${bdd}`);
11
+ if (existsSync(bdd) && !/Given|When|Then/u.test(readFileSync(bdd, "utf8"))) errors.push("BDD scenarios should include Given/When/Then");
12
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-bdd-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
13
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const file = join(runDir, "final-report.json");
7
+ const errors = [];
8
+ if (!existsSync(file)) errors.push(`missing ${file}`);
9
+ let value = null;
10
+ if (!errors.length) value = JSON.parse(readFileSync(file, "utf8"));
11
+ if (value && value.schema !== "agentic-spec.final-report.v1") errors.push("schema mismatch");
12
+ if (value && !(value.status === "pass" && value.verdict === "PASS" && value.no_ship === false)) errors.push("final report must be status=pass verdict=PASS no_ship=false");
13
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-final-report-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
14
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const file = join(runDir, "run-manifest.json");
7
+ const errors = [];
8
+ if (!existsSync(file)) errors.push(`missing ${file}`);
9
+ let manifest = null;
10
+ if (!errors.length) manifest = JSON.parse(readFileSync(file, "utf8"));
11
+ if (manifest && manifest.schema !== "agentic-spec-run.manifest.v1") errors.push("schema mismatch");
12
+ if (manifest && (!manifest.mission || !manifest.source_count)) errors.push("mission and source_count are required");
13
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-manifest-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
14
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ const run = process.argv[2];
4
+ const checks = ["validate-run.mjs", "validate-question-loop.mjs", "validate-traceability.mjs"];
5
+ const results = checks.map((script) => {
6
+ const res = spawnSync(process.execPath, [`scripts/agentic-spec-team/${script}`, run], { encoding: "utf8", cwd: process.cwd() });
7
+ let parsed = null;
8
+ try { parsed = JSON.parse(res.stdout); } catch {}
9
+ return { script, status: res.status, parsed };
10
+ });
11
+ const errors = results.filter((r) => r.status !== 0).map((r) => `${r.script} failed`);
12
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-oracle-ready-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors, results }, null, 2));
13
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const file = join(runDir, "questions.jsonl");
7
+ const errors = [];
8
+ const rows = existsSync(file) ? readFileSync(file, "utf8").split(/\n/u).filter(Boolean).map((line) => JSON.parse(line)) : [];
9
+ for (const q of rows) {
10
+ if (!q.question_id || q.schema !== "agentic-spec.question.v1") errors.push(`invalid question: ${JSON.stringify(q)}`);
11
+ }
12
+ const openBlocking = rows.filter((q) => q.blocking === true && !["answered", "closed", "withdrawn"].includes(q.status));
13
+ if (openBlocking.length) errors.push(`open blocking questions: ${openBlocking.map((q) => q.question_id).join(", ")}`);
14
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-question-loop-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, open_blocking_questions: openBlocking.map((q) => q.question_id), errors }, null, 2));
15
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ const target = process.argv[2];
4
+ if (!target || process.argv.includes("--help")) {
5
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-run-help.v1", usage: "node scripts/agentic-spec-team/validate-run.mjs <run_id|run_dir>" }, null, 2));
6
+ process.exit(target ? 0 : 1);
7
+ }
8
+ const result = spawnSync(process.execPath, ["scripts/spec-run.mjs", "validate", target], { encoding: "utf8", cwd: process.cwd() });
9
+ process.stdout.write(result.stdout || "");
10
+ process.stderr.write(result.stderr || "");
11
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const file = join(runDir, "source-register.json");
7
+ const errors = [];
8
+ if (!existsSync(file)) errors.push(`missing ${file}`);
9
+ let value = null;
10
+ if (!errors.length) value = JSON.parse(readFileSync(file, "utf8"));
11
+ if (value && value.schema !== "agentic-spec.source-register.v1") errors.push("schema mismatch");
12
+ if (value && (!Array.isArray(value.sources) || value.sources.length < 1)) errors.push("sources must be non-empty");
13
+ for (const source of value?.sources || []) {
14
+ if (!source.source_id || !source.path || !source.policy) errors.push(`invalid source row: ${JSON.stringify(source)}`);
15
+ }
16
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-source-register-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
17
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const file = join(runDir, "validation/traceability-matrix.json");
7
+ const errors = [];
8
+ if (!existsSync(file)) errors.push(`missing ${file}`);
9
+ let value = null;
10
+ if (!errors.length) value = JSON.parse(readFileSync(file, "utf8"));
11
+ if (value && value.schema !== "agentic-spec.traceability.v1") errors.push("schema mismatch");
12
+ if (value && !Array.isArray(value.rows)) errors.push("rows must be an array");
13
+ for (const row of value?.rows || []) {
14
+ if (!row.requirement_id || !row.support_ref) errors.push(`row missing requirement/support: ${JSON.stringify(row)}`);
15
+ if (!Array.isArray(row.acceptance_criteria_refs) || row.acceptance_criteria_refs.length < 1) errors.push(`row missing acceptance criteria: ${row.requirement_id}`);
16
+ if (!Array.isArray(row.task_refs) || row.task_refs.length < 1) errors.push(`row missing task refs: ${row.requirement_id}`);
17
+ if (!row.oracle_check_ref) errors.push(`row missing oracle check: ${row.requirement_id}`);
18
+ }
19
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-traceability-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
20
+ process.exitCode = errors.length ? 1 : 0;
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const run = process.argv[2];
5
+ const runDir = (run || "").startsWith("reports/") ? run : `reports/agentic-spec-runs/${run || ""}`;
6
+ const workgraph = join(runDir, "handoff/workgraph.md");
7
+ const tasks = join(runDir, "handoff/implementation-tasks.md");
8
+ const errors = [];
9
+ if (!existsSync(workgraph)) errors.push(`missing ${workgraph}`);
10
+ if (!existsSync(tasks)) errors.push(`missing ${tasks}`);
11
+ if (existsSync(tasks) && !/REQ-|AC-|TASK-/u.test(readFileSync(tasks, "utf8"))) errors.push("tasks should cite requirement/acceptance/task ids");
12
+ console.log(JSON.stringify({ schema: "agentic-spec.validate-workgraph-result.v1", status: errors.length ? "fail" : "pass", no_ship: errors.length > 0, errors }, null, 2));
13
+ process.exitCode = errors.length ? 1 : 0;
@@ -7,9 +7,9 @@ const repoRoot = process.cwd();
7
7
  const runtimeRoot = join(repoRoot, "reports/benchmarks/coding-agent-benchmark/live-dokploy-pilot-v3/autonomy-secret-smoke-runtime");
8
8
 
9
9
  const sourceFiles = [
10
- ".pi/extensions/zob-harness/src/interactive-autonomy.ts",
11
- ".pi/extensions/zob-harness/src/utils/hashing.ts",
12
- ".pi/extensions/zob-harness/src/utils/records.ts",
10
+ ".pi/extensions/zob-harness/src/domains/autonomy/interactive-autonomy.ts",
11
+ ".pi/extensions/zob-harness/src/core/utils/hashing.ts",
12
+ ".pi/extensions/zob-harness/src/core/utils/records.ts",
13
13
  ];
14
14
 
15
15
  mkdirSync(runtimeRoot, { recursive: true });
@@ -33,10 +33,10 @@ for (const sourceFile of sourceFiles) {
33
33
  writeFileSync(outputPath, transpiled.outputText, "utf8");
34
34
  }
35
35
 
36
- const { DEFAULT_INTERACTIVE_AUTONOMY_POLICY, scoreMissionReadiness } = await import(pathToFileURL(join(runtimeRoot, "interactive-autonomy.js")).href);
36
+ const { DEFAULT_INTERACTIVE_AUTONOMY_POLICY, scoreMissionReadiness } = await import(pathToFileURL(join(runtimeRoot, "domains", "autonomy", "interactive-autonomy.js")).href);
37
37
 
38
38
  const generatedAt = "2026-05-31T00:00:00.000Z";
39
- const negativeDenylistPrompt = `Fix V3 autonomy readiness in .pi/extensions/zob-harness/src/interactive-autonomy.ts.
39
+ const negativeDenylistPrompt = `Fix V3 autonomy readiness in .pi/extensions/zob-harness/src/domains/autonomy/interactive-autonomy.ts.
40
40
  Acceptance criteria: validate with npm run check -- --pretty false and a deterministic smoke.
41
41
  MUST NOT: Do not read .env/key files, ~/.ssh, or ~/.aws.
42
42
  Deliver evidence and keep safety gates enabled.`;
@@ -31,14 +31,14 @@ const policy = JSON.parse(readText(".pi/git-policy.json"));
31
31
  const capabilities = JSON.parse(readText(".pi/capabilities/zob-public-runtime-capabilities.json"));
32
32
  const damageRules = JSON.parse(readText(".pi/damage-control-rules.json"));
33
33
  const skill = readText(".pi/skills/zob-commit/SKILL.md");
34
- const gitOps = readText(".pi/extensions/zob-harness/src/git-ops.ts");
34
+ const gitOps = readText(".pi/extensions/zob-harness/src/domains/git/git-ops.ts");
35
35
  const commands = readText(".pi/extensions/zob-harness/src/runtime/commands.ts");
36
36
  const events = readText(".pi/extensions/zob-harness/src/runtime/events.ts");
37
37
  const toolsZcommit = readText(".pi/extensions/zob-harness/src/runtime/tools-zcommit.ts");
38
38
  const runtime = readText(".pi/extensions/zob-harness/src/runtime/zobHarness.ts");
39
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");
40
+ const goalTodos = readText(".pi/extensions/zob-harness/src/domains/goal/goal-todos.ts");
41
+ const goalRuntime = readText(".pi/extensions/zob-harness/src/runtime/goal-runtime.ts");
42
42
  const toolsDelegation = readText(".pi/extensions/zob-harness/src/runtime/tools-delegation.ts");
43
43
 
44
44
  const allowedZcommitCommands = [
@@ -173,7 +173,8 @@ assertIncludes(gitOps, "zcommitFileContentHash", "git-ops.ts child dirty delta c
173
173
  assertIncludes(gitOps, "hardForbiddenZcommitPatterns", "git-ops.ts policy/hard forbidden path filter");
174
174
  assertIncludes(gitOps, "...Object.keys(runtime.ownedPathRefs ?? {})", "git-ops.ts retains explicit owned path refs for legacy/adopt metadata");
175
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");
176
+ assertIncludes(gitOps, '["diff", "--cached", "--no-renames", "--name-only", "-z"]', "git-ops.ts cached index inspection must be stable for delete+add rehomes");
177
+ assertIncludes(gitOps, '["diff", "--cached", "--no-renames", "--binary", "--", ...paths]', "git-ops.ts cached patch capture must avoid rename-collapsed rehomes");
177
178
  assertIncludes(gitOps, '["diff", "--cached", "--check"]', "git-ops.ts cached diff verification");
178
179
  assertIncludes(gitOps, "sameStringSet(stagedAfterAdd, eligiblePaths)", "git-ops.ts staged path allowlist verification");
179
180
  assertIncludes(gitOps, "commitMessageArgs", "git-ops.ts Conventional Commit path");
@@ -39,9 +39,9 @@ for (const file of listTsFiles(srcRoot)) {
39
39
  writeFileSync(out, outputText);
40
40
  }
41
41
 
42
- const goalTodos = await import(pathToFileURL(join(outRoot, "goal-todos.js")).href);
42
+ const goalTodos = await import(pathToFileURL(join(outRoot, "domains", "goal", "goal-todos.js")).href);
43
43
  const modeIntent = await import(pathToFileURL(join(outRoot, "runtime", "mode-intent.js")).href);
44
- const modelAvailability = await import(pathToFileURL(join(outRoot, "model-availability.js")).href);
44
+ const modelAvailability = await import(pathToFileURL(join(outRoot, "domains", "models", "model-availability.js")).href);
45
45
  const toolsDelegationSource = readFileSync(join(srcRoot, "runtime", "tools-delegation.ts"), "utf8");
46
46
  assert(!toolsDelegationSource.includes("childGoalTodoErrors"), "delegation runtime must not reference stale childGoalTodoErrors symbol");
47
47
  assert(toolsDelegationSource.includes("...childGoalResolution.errors"), "delegation preflight must include structured childGoalResolution.errors");
@@ -39,9 +39,9 @@ for (const file of listTsFiles(srcRoot)) {
39
39
  writeFileSync(out, outputText);
40
40
  }
41
41
 
42
- const safety = await import(pathToFileURL(join(outRoot, "safety.js")).href);
43
- const paths = await import(pathToFileURL(join(outRoot, "utils", "paths.js")).href);
44
- const adaptive = await import(pathToFileURL(join(outRoot, "orchestration", "adaptive-delegation.js")).href);
42
+ const safety = await import(pathToFileURL(join(outRoot, "domains", "governance", "safety.js")).href);
43
+ const paths = await import(pathToFileURL(join(outRoot, "core", "utils", "paths.js")).href);
44
+ const adaptive = await import(pathToFileURL(join(outRoot, "domains", "orchestration", "adaptive-delegation.js")).href);
45
45
 
46
46
  const invalidAllowedPaths = ["docs/../", "docs/../src", "./docs/../", "a/../../b"];
47
47
  for (const candidate of invalidAllowedPaths) {
@@ -0,0 +1,39 @@
1
+ # ProjectDNA Script Guardrails
2
+
3
+ Scope: `scripts/project-dna/` contains ProjectDNA scaffold, scan, workflow, query, sample, benchmark, oracle, and validation helpers.
4
+
5
+ ## Structure
6
+
7
+ Canonical scripts live in grouped subfolders:
8
+
9
+ - `scan/` — scanner and scan-artifact validation.
10
+ - `workflow/` — agentic workflow planning and validation.
11
+ - `emit/` — ontology and golden-case emission helpers.
12
+ - `query/` — context query and query-steward helpers.
13
+ - `sample/` — sample-spec, quarantine sample generation, and sample validation.
14
+ - `capsules/` — pointer capsule builders.
15
+ - `benchmark/` — deterministic benchmark smoke helpers.
16
+ - `oracle/` — structural oracle review helpers.
17
+ - `validation/` — scaffold, ontology, golden-case, and 5/5 posture validators.
18
+
19
+ Top-level `*.mjs` entries are compatibility shims for existing `package.json` commands and direct CLI paths. Keep those paths stable unless package refs and downstream callers are intentionally migrated.
20
+
21
+ ## Invariants
22
+
23
+ - Split-only changes: move code, do not change script logic, CLI args, output paths, status strings, report schemas, or validation semantics.
24
+ - Preserve read/write posture: ProjectDNA scans are read-only for source projects; generated outputs stay under approved quarantine/report locations.
25
+ - Do not read secrets or traverse forbidden/generated folders such as `.env`, `.git`, `node_modules`, `dist`, `build`, or runtime ledgers.
26
+ - Keep package command behavior stable; prefer compatibility shims over package script churn.
27
+ - Do not introduce network calls or external knowledge-backend imports/writes without explicit approval.
28
+
29
+ ## Validation ladder
30
+
31
+ After structural edits, run:
32
+
33
+ ```bash
34
+ npm run validate:script-surface
35
+ npm run validate:project-dna
36
+ npm run check -- --pretty false
37
+ ```
38
+
39
+ Run targeted ProjectDNA smokes only when their report-output paths are approved for the current task.