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
@@ -1,9 +1,9 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
 
3
- import { buildZcommitPlan, runGovernedZcommitCommit, runGovernedZcommitPush, type ZcommitCommandResult, type ZcommitPlan, type ZcommitPlanOptions } from "../git-ops.js";
4
- import { ZcommitRunParams } from "../schemas.js";
3
+ import { buildZcommitPlan, runGovernedZcommitCommit, runGovernedZcommitPush, type ZcommitCommandResult, type ZcommitPlan, type ZcommitPlanOptions } from "../domains/git/git-ops.js";
4
+ import { ZcommitRunParams } from "./schemas.js";
5
5
  import type { HarnessRuntimeState } from "./state.js";
6
- import { sha256 } from "../utils/hashing.js";
6
+ import { sha256 } from "../core/utils/hashing.js";
7
7
 
8
8
  function uniqueSorted(values: string[]): string[] {
9
9
  return [...new Set(values.filter((value) => value.trim().length > 0))].sort();
@@ -1,13 +1,13 @@
1
1
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
3
3
 
4
- import { MODE_TOOLS } from "../constants.js";
5
- import { buildDaemonRuntimeState, buildDaemonTickPlan } from "../daemon-runtime.js";
6
- import { goalTodoCompletionDiagnostics, summarizeGoalTodos } from "../goal-todos.js";
7
- import { isRecord } from "../utils/records.js";
4
+ import { MODE_TOOLS } from "../core/constants.js";
5
+ import { buildDaemonRuntimeState, buildDaemonTickPlan } from "../domains/autonomy/daemon-runtime.js";
6
+ import { goalTodoCompletionDiagnostics, summarizeGoalTodos } from "../domains/goal/goal-todos.js";
7
+ import { isRecord } from "../core/utils/records.js";
8
8
  import type { AssistantLikeMessage, ModeName } from "../types.js";
9
- import { readHarnessReadinessWidgetData } from "../orchestration/widget-readers.js";
10
- import { buildZpeerPeerRoomSummaries, type ZpeerPeerRoomSummary } from "../coms-v2/zpeer.js";
9
+ import { readHarnessReadinessWidgetData } from "../domains/orchestration/widget-readers.js";
10
+ import { buildZpeerPeerRoomSummaries, type ZpeerPeerRoomSummary } from "../domains/coms/coms-v2/zpeer.js";
11
11
  import { delegationCost, delegationDurationMs, formatDelegationCost, formatDuration, summarizeDelegations } from "./delegation-monitor.js";
12
12
  import { disposeDelegationMouseSupport } from "./delegation-mouse.js";
13
13
  import { formatZcompactHudLine } from "./auto-compaction.js";
@@ -427,10 +427,27 @@ export function renderHarnessWidget(pi: ExtensionAPI, state: HarnessRuntimeState
427
427
  });
428
428
  }
429
429
 
430
+ type PiToolInfo = ReturnType<ExtensionAPI["getAllTools"]>[number];
431
+
432
+ function isZobInternalTool(tool: PiToolInfo): boolean {
433
+ const path = tool.sourceInfo.path.replace(/\\/g, "/");
434
+ return path.includes("/.pi/extensions/zob-harness/") || path.includes("/.pi/extensions/zob-switch/");
435
+ }
436
+
437
+ function isExternalPackageTool(tool: PiToolInfo): boolean {
438
+ return tool.sourceInfo.source !== "builtin" && tool.sourceInfo.source !== "sdk" && !isZobInternalTool(tool);
439
+ }
440
+
441
+ function uniqueToolNames(names: string[]): string[] {
442
+ return [...new Set(names)];
443
+ }
444
+
430
445
  export function applyMode(pi: ExtensionAPI, state: HarnessRuntimeState, ctx: ExtensionContext, mode: ModeName, persist = true): void {
431
446
  state.activeMode = mode;
432
- const available = new Set(pi.getAllTools().map((tool) => tool.name));
433
- const activeTools = mode === "vanilla" ? [...available] : MODE_TOOLS[mode].filter((tool) => available.has(tool));
447
+ const allTools = pi.getAllTools();
448
+ const available = new Set(allTools.map((tool) => tool.name));
449
+ const externalPackageTools = allTools.filter(isExternalPackageTool).map((tool) => tool.name);
450
+ const activeTools = mode === "vanilla" ? [...available] : uniqueToolNames([...MODE_TOOLS[mode].filter((tool) => available.has(tool)), ...externalPackageTools]);
434
451
  pi.setActiveTools(activeTools);
435
452
  if (persist) pi.appendEntry("zob-mode-state", { mode, timestamp: new Date().toISOString() });
436
453
  ctx.ui.setStatus("zob-mode", ctx.ui.theme.fg("accent", `zob:${mode}`));
@@ -12,7 +12,7 @@ import { registerMissionControlTools } from "./tools-mission-control.js";
12
12
  import { registerFactoryTools } from "./tools-factory.js";
13
13
  import { registerProjectDnaTools } from "./tools-project-dna.js";
14
14
  import { registerOrchestrationTools } from "./tools-orchestration.js";
15
- import { registerGoalRuntimeEvents, registerGoalRuntimeTools } from "../goal-runtime.js";
15
+ import { registerGoalRuntimeEvents, registerGoalRuntimeTools } from "./goal-runtime.js";
16
16
  import { registerGoalRoomTools } from "./tools-goal-room.js";
17
17
  import { registerGovernedRequestTools } from "./tools-governed-requests.js";
18
18
  import { registerWorkspaceClaimTools } from "./tools-workspace-claims.js";
@@ -1,4 +1,4 @@
1
- import type { ChildChangedPathRef, ModeName } from "./types/core.js";
1
+ import type { ChildChangedPathRef, ModeName } from "./core/types/core.js";
2
2
 
3
3
  export type {
4
4
  AgentScope,
@@ -9,7 +9,7 @@ export type {
9
9
  JsonEvent,
10
10
  ModeName,
11
11
  TextBlock,
12
- } from "./types/core.js";
12
+ } from "./core/types/core.js";
13
13
 
14
14
  export interface DamageRule {
15
15
  pattern: string;
@@ -0,0 +1,9 @@
1
+ # zob-switch Extension Guardrails
2
+
3
+ - This folder owns the `/zob` Pi switch extension only.
4
+ - Keep `.pi/extensions/zob-switch/index.ts` as the stable Pi entrypoint and preserve its default export.
5
+ - Split-only refactors are allowed; do not change `/zob` behavior, command registration, aliases/autocomplete behavior, messages, settings paths, snapshot paths, schemas, defaults, or sync/async behavior.
6
+ - Use NodeNext relative imports with `.js` suffix.
7
+ - Use `import type` for type-only imports.
8
+ - No file under `src/` may import from `index.ts`.
9
+ - Do not touch secrets, generated/vendor folders, logs, sessions, reports, or unrelated extensions from this package.
@@ -1,134 +1,22 @@
1
1
  import { existsSync } from "node:fs";
2
- import { mkdir, readFile, writeFile } from "node:fs/promises";
3
- import { dirname, join } from "node:path";
2
+ import { join } from "node:path";
4
3
 
5
4
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
- import type { AutocompleteItem } from "@earendil-works/pi-tui";
7
5
 
8
- const SETTINGS_PATH = join(".pi", "settings.json");
9
- const SNAPSHOT_PATH = join(".pi", "tmp", "zob-switch", "settings-snapshot.json");
10
- const SWITCH_EXTENSION = "extensions/zob-switch/index.ts";
11
- const HARNESS_EXTENSION = "extensions/zob-harness/index.ts";
12
- const ZOB_PROMPTS = "prompts";
13
- const ZOB_SKILLS = "skills";
14
-
15
- type JsonObject = Record<string, unknown>;
16
-
17
- type Snapshot = {
18
- schema: "zob.harness-switch.settings-snapshot.v1";
19
- savedAt: string;
20
- settings: JsonObject;
21
- };
22
-
23
- function isObject(value: unknown): value is JsonObject {
24
- return typeof value === "object" && value !== null && !Array.isArray(value);
25
- }
26
-
27
- function asStringArray(value: unknown): string[] {
28
- return Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === "string") : [];
29
- }
30
-
31
- function uniqueWithRequiredFirst(values: string[], requiredFirst: string[]): string[] {
32
- const result: string[] = [];
33
- for (const value of [...requiredFirst, ...values]) {
34
- if (!result.includes(value)) result.push(value);
35
- }
36
- return result;
37
- }
38
-
39
- function withoutValues(values: string[], remove: string[]): string[] {
40
- return values.filter((value) => !remove.includes(value));
41
- }
42
-
43
- function hasValue(settings: JsonObject, key: "extensions" | "prompts" | "skills", value: string): boolean {
44
- return asStringArray(settings[key]).includes(value);
45
- }
46
-
47
- async function readSettings(cwd: string): Promise<JsonObject> {
48
- const raw = await readFile(join(cwd, SETTINGS_PATH), "utf8");
49
- const parsed = JSON.parse(raw) as unknown;
50
- if (!isObject(parsed)) throw new Error(`${SETTINGS_PATH} must contain a JSON object`);
51
- return parsed;
52
- }
6
+ import { argumentCompletions } from "./src/autocomplete.js";
7
+ import { HARNESS_EXTENSION, SETTINGS_PATH } from "./src/paths.js";
8
+ import { readSettings, writeSettings } from "./src/settings.js";
9
+ import type { JsonObject } from "./src/settings.js";
10
+ import { readSnapshot, writeSnapshot } from "./src/snapshot.js";
11
+ import type { Snapshot } from "./src/snapshot.js";
12
+ import { buildOffSettings, buildOnSettings, hasValue, statusFor } from "./src/state.js";
53
13
 
54
- async function writeSettings(cwd: string, settings: JsonObject): Promise<void> {
55
- await writeFile(join(cwd, SETTINGS_PATH), `${JSON.stringify(settings, null, 2)}\n`, "utf8");
56
- }
57
-
58
- async function writeSnapshot(cwd: string, settings: JsonObject): Promise<void> {
59
- const snapshot: Snapshot = {
60
- schema: "zob.harness-switch.settings-snapshot.v1",
61
- savedAt: new Date().toISOString(),
62
- settings,
63
- };
64
- const snapshotPath = join(cwd, SNAPSHOT_PATH);
65
- await mkdir(dirname(snapshotPath), { recursive: true });
66
- await writeFile(snapshotPath, `${JSON.stringify(snapshot, null, 2)}\n`, "utf8");
67
- }
68
-
69
- async function readSnapshot(cwd: string): Promise<Snapshot | null> {
70
- const snapshotPath = join(cwd, SNAPSHOT_PATH);
71
- if (!existsSync(snapshotPath)) return null;
72
- const parsed = JSON.parse(await readFile(snapshotPath, "utf8")) as unknown;
73
- if (!isObject(parsed) || parsed.schema !== "zob.harness-switch.settings-snapshot.v1" || !isObject(parsed.settings)) {
74
- throw new Error(`${SNAPSHOT_PATH} is not a valid ZOB switch snapshot`);
75
- }
76
- return parsed as Snapshot;
77
- }
14
+ const SNAPSHOT_PATH = join(".pi", "tmp", "zob-switch", "settings-snapshot.json");
78
15
 
79
16
  function shouldWriteOffSnapshot(current: JsonObject, snapshot: Snapshot | null): boolean {
80
17
  return snapshot === null || hasValue(current, "extensions", HARNESS_EXTENSION);
81
18
  }
82
19
 
83
- function buildOffSettings(current: JsonObject): JsonObject {
84
- return {
85
- ...current,
86
- extensions: uniqueWithRequiredFirst(withoutValues(asStringArray(current.extensions), [HARNESS_EXTENSION]), [SWITCH_EXTENSION]),
87
- prompts: withoutValues(asStringArray(current.prompts), [ZOB_PROMPTS]),
88
- skills: withoutValues(asStringArray(current.skills), [ZOB_SKILLS]),
89
- };
90
- }
91
-
92
- function buildOnSettings(base: JsonObject, usedSnapshot: boolean): JsonObject {
93
- return {
94
- ...base,
95
- extensions: uniqueWithRequiredFirst(asStringArray(base.extensions), [SWITCH_EXTENSION, HARNESS_EXTENSION]),
96
- prompts: usedSnapshot ? asStringArray(base.prompts) : uniqueWithRequiredFirst(asStringArray(base.prompts), [ZOB_PROMPTS]),
97
- skills: usedSnapshot ? asStringArray(base.skills) : uniqueWithRequiredFirst(asStringArray(base.skills), [ZOB_SKILLS]),
98
- };
99
- }
100
-
101
- function statusFor(settings: JsonObject, snapshotPresent: boolean): string {
102
- const switchConfigured = hasValue(settings, "extensions", SWITCH_EXTENSION);
103
- const harnessConfigured = hasValue(settings, "extensions", HARNESS_EXTENSION);
104
- const promptsConfigured = hasValue(settings, "prompts", ZOB_PROMPTS);
105
- const skillsConfigured = hasValue(settings, "skills", ZOB_SKILLS);
106
- const state = switchConfigured && harnessConfigured && promptsConfigured && skillsConfigured
107
- ? "on"
108
- : switchConfigured && !harnessConfigured && !promptsConfigured && !skillsConfigured
109
- ? "off"
110
- : "partial";
111
- return [
112
- `ZOB Harness switch: ${state}`,
113
- `switch extension: ${switchConfigured ? "configured" : "missing"}`,
114
- `harness extension: ${harnessConfigured ? "configured" : "missing"}`,
115
- `prompts: ${promptsConfigured ? "configured" : "missing"}`,
116
- `skills: ${skillsConfigured ? "configured" : "missing"}`,
117
- `snapshot: ${snapshotPresent ? "present" : "missing"}`,
118
- ].join("\n");
119
- }
120
-
121
- function argumentCompletions(prefix: string): AutocompleteItem[] | null {
122
- const query = prefix.trim().toLowerCase();
123
- const items: AutocompleteItem[] = [
124
- { value: "on", label: "on", description: "restore ZOB Harness from snapshot/defaults and reload" },
125
- { value: "off", label: "off", description: "snapshot settings, unload ZOB Harness resources, and reload" },
126
- { value: "status", label: "status", description: "show switch/harness/prompts/skills/snapshot state" },
127
- ];
128
- const filtered = query ? items.filter((item) => item.value.startsWith(query)) : items;
129
- return filtered.length > 0 ? filtered : null;
130
- }
131
-
132
20
  export default function zobSwitch(pi: ExtensionAPI): void {
133
21
  pi.registerCommand("zob", {
134
22
  description: "Switch ZOB Harness on/off or show status: /zob on|off|status",
@@ -0,0 +1,8 @@
1
+ # zob-switch src Guardrails
2
+
3
+ - Modules here are sidecars for `.pi/extensions/zob-switch/index.ts`.
4
+ - Move code only; do not rewrite logic, optimize, reorder behavior, rename helpers for behavior changes, or alter strings/schemas/paths.
5
+ - Preserve `/zob` command behavior exactly, including settings and snapshot semantics.
6
+ - Use NodeNext relative imports with `.js` suffix.
7
+ - Use `import type` for type-only imports.
8
+ - Never import from `../index.ts` or any `index.ts` entrypoint.
@@ -0,0 +1,12 @@
1
+ import type { AutocompleteItem } from "@earendil-works/pi-tui";
2
+
3
+ export function argumentCompletions(prefix: string): AutocompleteItem[] | null {
4
+ const query = prefix.trim().toLowerCase();
5
+ const items: AutocompleteItem[] = [
6
+ { value: "on", label: "on", description: "restore ZOB Harness from snapshot/defaults and reload" },
7
+ { value: "off", label: "off", description: "snapshot settings, unload ZOB Harness resources, and reload" },
8
+ { value: "status", label: "status", description: "show switch/harness/prompts/skills/snapshot state" },
9
+ ];
10
+ const filtered = query ? items.filter((item) => item.value.startsWith(query)) : items;
11
+ return filtered.length > 0 ? filtered : null;
12
+ }
@@ -0,0 +1,8 @@
1
+ import { join } from "node:path";
2
+
3
+ export const SETTINGS_PATH = join(".pi", "settings.json");
4
+ export const SNAPSHOT_PATH = join(".pi", "tmp", "zob-switch", "settings-snapshot.json");
5
+ export const SWITCH_EXTENSION = "extensions/zob-switch/index.ts";
6
+ export const HARNESS_EXTENSION = "extensions/zob-harness/index.ts";
7
+ export const ZOB_PROMPTS = "prompts";
8
+ export const ZOB_SKILLS = "skills";
@@ -0,0 +1,25 @@
1
+ import { readFile, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+
4
+ import { SETTINGS_PATH } from "./paths.js";
5
+
6
+ export type JsonObject = Record<string, unknown>;
7
+
8
+ export function isObject(value: unknown): value is JsonObject {
9
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10
+ }
11
+
12
+ export function asStringArray(value: unknown): string[] {
13
+ return Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === "string") : [];
14
+ }
15
+
16
+ export async function readSettings(cwd: string): Promise<JsonObject> {
17
+ const raw = await readFile(join(cwd, SETTINGS_PATH), "utf8");
18
+ const parsed = JSON.parse(raw) as unknown;
19
+ if (!isObject(parsed)) throw new Error(`${SETTINGS_PATH} must contain a JSON object`);
20
+ return parsed;
21
+ }
22
+
23
+ export async function writeSettings(cwd: string, settings: JsonObject): Promise<void> {
24
+ await writeFile(join(cwd, SETTINGS_PATH), `${JSON.stringify(settings, null, 2)}\n`, "utf8");
25
+ }
@@ -0,0 +1,34 @@
1
+ import { existsSync } from "node:fs";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+
5
+ import { SNAPSHOT_PATH } from "./paths.js";
6
+ import { isObject } from "./settings.js";
7
+ import type { JsonObject } from "./settings.js";
8
+
9
+ export type Snapshot = {
10
+ schema: "zob.harness-switch.settings-snapshot.v1";
11
+ savedAt: string;
12
+ settings: JsonObject;
13
+ };
14
+
15
+ export async function writeSnapshot(cwd: string, settings: JsonObject): Promise<void> {
16
+ const snapshot: Snapshot = {
17
+ schema: "zob.harness-switch.settings-snapshot.v1",
18
+ savedAt: new Date().toISOString(),
19
+ settings,
20
+ };
21
+ const snapshotPath = join(cwd, SNAPSHOT_PATH);
22
+ await mkdir(dirname(snapshotPath), { recursive: true });
23
+ await writeFile(snapshotPath, `${JSON.stringify(snapshot, null, 2)}\n`, "utf8");
24
+ }
25
+
26
+ export async function readSnapshot(cwd: string): Promise<Snapshot | null> {
27
+ const snapshotPath = join(cwd, SNAPSHOT_PATH);
28
+ if (!existsSync(snapshotPath)) return null;
29
+ const parsed = JSON.parse(await readFile(snapshotPath, "utf8")) as unknown;
30
+ if (!isObject(parsed) || parsed.schema !== "zob.harness-switch.settings-snapshot.v1" || !isObject(parsed.settings)) {
31
+ throw new Error(`${SNAPSHOT_PATH} is not a valid ZOB switch snapshot`);
32
+ }
33
+ return parsed as Snapshot;
34
+ }
@@ -0,0 +1,57 @@
1
+ import { HARNESS_EXTENSION, SWITCH_EXTENSION, ZOB_PROMPTS, ZOB_SKILLS } from "./paths.js";
2
+ import { asStringArray } from "./settings.js";
3
+ import type { JsonObject } from "./settings.js";
4
+
5
+ function uniqueWithRequiredFirst(values: string[], requiredFirst: string[]): string[] {
6
+ const result: string[] = [];
7
+ for (const value of [...requiredFirst, ...values]) {
8
+ if (!result.includes(value)) result.push(value);
9
+ }
10
+ return result;
11
+ }
12
+
13
+ function withoutValues(values: string[], remove: string[]): string[] {
14
+ return values.filter((value) => !remove.includes(value));
15
+ }
16
+
17
+ export function hasValue(settings: JsonObject, key: "extensions" | "prompts" | "skills", value: string): boolean {
18
+ return asStringArray(settings[key]).includes(value);
19
+ }
20
+
21
+ export function buildOffSettings(current: JsonObject): JsonObject {
22
+ return {
23
+ ...current,
24
+ extensions: uniqueWithRequiredFirst(withoutValues(asStringArray(current.extensions), [HARNESS_EXTENSION]), [SWITCH_EXTENSION]),
25
+ prompts: withoutValues(asStringArray(current.prompts), [ZOB_PROMPTS]),
26
+ skills: withoutValues(asStringArray(current.skills), [ZOB_SKILLS]),
27
+ };
28
+ }
29
+
30
+ export function buildOnSettings(base: JsonObject, usedSnapshot: boolean): JsonObject {
31
+ return {
32
+ ...base,
33
+ extensions: uniqueWithRequiredFirst(asStringArray(base.extensions), [SWITCH_EXTENSION, HARNESS_EXTENSION]),
34
+ prompts: usedSnapshot ? asStringArray(base.prompts) : uniqueWithRequiredFirst(asStringArray(base.prompts), [ZOB_PROMPTS]),
35
+ skills: usedSnapshot ? asStringArray(base.skills) : uniqueWithRequiredFirst(asStringArray(base.skills), [ZOB_SKILLS]),
36
+ };
37
+ }
38
+
39
+ export function statusFor(settings: JsonObject, snapshotPresent: boolean): string {
40
+ const switchConfigured = hasValue(settings, "extensions", SWITCH_EXTENSION);
41
+ const harnessConfigured = hasValue(settings, "extensions", HARNESS_EXTENSION);
42
+ const promptsConfigured = hasValue(settings, "prompts", ZOB_PROMPTS);
43
+ const skillsConfigured = hasValue(settings, "skills", ZOB_SKILLS);
44
+ const state = switchConfigured && harnessConfigured && promptsConfigured && skillsConfigured
45
+ ? "on"
46
+ : switchConfigured && !harnessConfigured && !promptsConfigured && !skillsConfigured
47
+ ? "off"
48
+ : "partial";
49
+ return [
50
+ `ZOB Harness switch: ${state}`,
51
+ `switch extension: ${switchConfigured ? "configured" : "missing"}`,
52
+ `harness extension: ${harnessConfigured ? "configured" : "missing"}`,
53
+ `prompts: ${promptsConfigured ? "configured" : "missing"}`,
54
+ `skills: ${skillsConfigured ? "configured" : "missing"}`,
55
+ `snapshot: ${snapshotPresent ? "present" : "missing"}`,
56
+ ].join("\n");
57
+ }
@@ -0,0 +1,35 @@
1
+ # Agentic Spec Team Factory
2
+
3
+ Status: **v1 scaffold**.
4
+
5
+ This factory describes the repeatable checkpoint backbone for the Agentic Spec Team workflow. The actual v1 launch surface is `scripts/spec-run.mjs` plus run-scoped ZTeam agents. The factory keeps the process evidence-first, human-question-gated, and oracle-reviewed.
6
+
7
+ ## Safe entrypoints
8
+
9
+ ```bash
10
+ npm run spec-run -- init --mission "..." --source docs/ --source data/export.csv
11
+ npm run spec-run:auto-pilot -- --mission-file specs/mission.md --source docs/ --source mockups/
12
+ ```
13
+
14
+ ## What it does
15
+
16
+ - Defines map/reduce/validate stages for source intake, data/domain/UX analysis, spec synthesis, BDD, handoff, and oracle review.
17
+ - Requires traceability from source/answer/assumption to requirement, criteria, task, and oracle check.
18
+ - Treats raw sources as `citation_only` or `context_only` until explicitly approved otherwise.
19
+ - Blocks completion on open blocking questions.
20
+ - Requires final oracle PASS with `no_ship=false`.
21
+
22
+ ## What it does not do in v1
23
+
24
+ - No runtime `/spec-run` extension command.
25
+ - No external durable write/import/sync.
26
+ - No automatic answer invention for business decisions.
27
+ - No closing tmux on timeout/WARN/FAIL/no_ship=true.
28
+
29
+ ## Local validators
30
+
31
+ ```bash
32
+ node scripts/spec-run.mjs validate <run_id>
33
+ node scripts/agentic-spec-team/validate-run.mjs <run_id>
34
+ node scripts/agentic-spec-team/validate-traceability.mjs <run_id>
35
+ ```
@@ -0,0 +1,11 @@
1
+ {
2
+ "factory": "agentic-spec-team",
3
+ "mode": "batch",
4
+ "items": [
5
+ {
6
+ "id": "agentic-spec-docs-batch",
7
+ "path": "docs/",
8
+ "mission": "Analyze ZOB docs as source material for a detailed agentic spec team operating model."
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "schema": "zob.agentic-spec-manifest.v1",
3
+ "name": "billing-redesign",
4
+ "mission": "Produce a detailed, testable billing redesign implementation spec from approved docs, data exports, mockups, and owner notes.",
5
+ "sources": [
6
+ { "path": "docs/billing-brief.md", "type": "doc", "policy": "citation_only" },
7
+ { "path": "data/billing-export.csv", "type": "data", "policy": "citation_only" },
8
+ { "path": "mockups/billing-flow/", "type": "mockups", "policy": "context_only" }
9
+ ],
10
+ "human_question_policy": {
11
+ "interlocutor": "spec-chief",
12
+ "blocking_questions_stop_auto_pilot": true
13
+ },
14
+ "completion_gate": {
15
+ "traceability_required": true,
16
+ "oracle_required": true,
17
+ "no_ship_must_be_false": true
18
+ }
19
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "agentic-spec-team",
3
+ "version": "0.1.0",
4
+ "description": "Evidence-first ZOB workflow for producing detailed implementation specs from missions plus docs/data/mockups through a run-scoped agent team.",
5
+ "status": "v1-scaffold",
6
+ "autoPromotion": false,
7
+ "manualPromotionRequired": true,
8
+ "defaultMode": "smoke",
9
+ "agenticModel": {
10
+ "controlPlane": "spec-chief-led-zteam-plus-deterministic-cli",
11
+ "runtimeExtensionV1": false,
12
+ "humanInterlocutor": "spec-chief",
13
+ "traceabilityRequired": true,
14
+ "oracleRequired": true
15
+ },
16
+ "requiredStages": [
17
+ "manifest_loaded",
18
+ "source_registered",
19
+ "analysis_ready",
20
+ "clarification_closed",
21
+ "spec_synthesized",
22
+ "acceptance_ready",
23
+ "workgraph_ready",
24
+ "oracle_passed",
25
+ "sentinel"
26
+ ],
27
+ "expectedArtifacts": [
28
+ "run-manifest.json",
29
+ "source-register.json",
30
+ "source-register.md",
31
+ "questions.md",
32
+ "answers.md",
33
+ "validation/traceability-matrix.json",
34
+ "validation/traceability-matrix.md",
35
+ "spec/mission-spec.md",
36
+ "validation/acceptance-criteria.md",
37
+ "handoff/workgraph.md",
38
+ "oracle/final-oracle-review.json",
39
+ "final-report.json",
40
+ "status.json"
41
+ ],
42
+ "noShipBlockers": [
43
+ "secret-like source path or sensitive raw data persisted without approval",
44
+ "blocking human question open",
45
+ "requirement without source, answer, assumption, or decision support",
46
+ "acceptance criterion not mapped to requirement",
47
+ "task not mapped to acceptance criterion",
48
+ "contradiction hidden without decision",
49
+ "final oracle missing or no_ship=true",
50
+ "auto-pilot closes tmux on timeout/WARN/FAIL/no_ship=true"
51
+ ],
52
+ "stages": [
53
+ {
54
+ "name": "source-intake",
55
+ "type": "map",
56
+ "agent": "explore",
57
+ "outputContract": "explore.v1",
58
+ "requiredTools": ["read", "grep", "find", "ls"],
59
+ "expectedOutcome": "Inventory approved sources, sensitivity, freshness, owners, contradictions, and open questions with citations.",
60
+ "mustDo": ["Use only explicit sources from run-manifest.json.", "Assign stable source IDs.", "Flag secret-like or sensitive sources.", "Write source quality gaps."],
61
+ "mustNotDo": ["No broad filesystem scan.", "No secrets.", "No source mutation.", "No external durable writes."],
62
+ "context": "Agentic Spec Team run {run.id}; source intake stage."
63
+ },
64
+ {
65
+ "name": "specialized-analysis",
66
+ "type": "map",
67
+ "agent": "explore",
68
+ "outputContract": "explore.v1",
69
+ "requiredTools": ["read", "grep", "find", "ls"],
70
+ "expectedOutcome": "Produce data/domain/UX analysis artifacts and candidate traceability rows.",
71
+ "mustDo": ["Cite source refs for each finding.", "Separate facts from assumptions.", "Propose questions to spec-chief when blocked."],
72
+ "mustNotDo": ["No invented business decisions.", "No direct human questions except through spec-chief.", "No edits outside the run directory."],
73
+ "context": "Agentic Spec Team run {run.id}; data/domain/UX analysis."
74
+ },
75
+ {
76
+ "name": "spec-synthesis",
77
+ "type": "reduce",
78
+ "agent": "specifier",
79
+ "outputContract": "spec.v1",
80
+ "requiredTools": ["read", "grep", "find", "ls"],
81
+ "expectedOutcome": "Synthesize mission spec, requirements, acceptance criteria, BDD, and workgraph from cited analysis artifacts.",
82
+ "mustDo": ["Every requirement must be traceable.", "List non-functional requirements and edge cases.", "Map implementation tasks to acceptance criteria."],
83
+ "mustNotDo": ["No unsupported requirements.", "No hidden contradictions.", "No open blocking questions."],
84
+ "context": "Agentic Spec Team run {run.id}; spec synthesis."
85
+ },
86
+ {
87
+ "name": "oracle-validation",
88
+ "type": "validate",
89
+ "agent": "oracle",
90
+ "outputContract": "oracle.v1",
91
+ "requiredTools": ["read", "grep", "find", "ls"],
92
+ "expectedOutcome": "Validate source-to-requirement-to-task traceability, question closure, sensitive data posture, and final no-ship status.",
93
+ "mustDo": ["Fail if traceability is incomplete.", "Fail if blocking questions remain open.", "Fail if final-report PASS/no_ship=false is unsupported."],
94
+ "mustNotDo": ["No patches.", "No commits.", "No external writes.", "No approval of unsupported specs."],
95
+ "context": "Agentic Spec Team run {run.id}; final oracle gate."
96
+ }
97
+ ]
98
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "factory": "agentic-spec-team",
3
+ "mode": "pilot",
4
+ "items": [
5
+ {
6
+ "id": "agentic-spec-readme-pilot",
7
+ "path": "README.md",
8
+ "mission": "Produce a cited internal spec for how the Agentic Spec Team should be used from this repository."
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "zob.agentic-spec.final-report.schema.v1",
4
+ "type": "object",
5
+ "required": ["schema", "run_id", "status", "no_ship", "verdict"],
6
+ "properties": {
7
+ "schema": { "const": "agentic-spec.final-report.v1" },
8
+ "run_id": { "type": "string", "minLength": 1 },
9
+ "status": { "enum": ["pass", "blocked", "fail", "warn"] },
10
+ "verdict": { "enum": ["PASS", "WARN", "FAIL"] },
11
+ "no_ship": { "type": "boolean" },
12
+ "evidence_refs": { "type": "array", "items": { "type": "string" } },
13
+ "blocking_issues": { "type": "array", "items": { "type": "string" } }
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "zob.agentic-spec.manifest.schema.v1",
4
+ "type": "object",
5
+ "required": ["schema", "name", "mission", "sources", "completion_gate"],
6
+ "properties": {
7
+ "schema": { "const": "zob.agentic-spec-manifest.v1" },
8
+ "name": { "type": "string", "minLength": 1 },
9
+ "mission": { "type": "string", "minLength": 1 },
10
+ "sources": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["path"], "properties": { "path": { "type": "string", "minLength": 1 }, "type": { "type": "string" }, "policy": { "enum": ["citation_only", "context_only", "safe_to_copy"] } } } },
11
+ "human_question_policy": { "type": "object" },
12
+ "completion_gate": { "type": "object" }
13
+ }
14
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "zob.agentic-spec.question.schema.v1",
4
+ "type": "object",
5
+ "required": ["schema", "question_id", "status", "blocking", "question"],
6
+ "properties": {
7
+ "schema": { "const": "agentic-spec.question.v1" },
8
+ "question_id": { "type": "string", "pattern": "^Q-[0-9]{3,}$" },
9
+ "status": { "enum": ["open", "answered", "closed", "withdrawn"] },
10
+ "blocking": { "type": "boolean" },
11
+ "origin_agent": { "type": "string" },
12
+ "concerns": { "type": "array", "items": { "type": "string" } },
13
+ "source_refs": { "type": "array", "items": { "type": "string" } },
14
+ "question": { "type": "string", "minLength": 1 },
15
+ "options": { "type": "array" },
16
+ "recommended_option": { "type": ["string", "null"] }
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "zob.agentic-spec.source-register.schema.v1",
4
+ "type": "object",
5
+ "required": ["schema", "run_id", "sources"],
6
+ "properties": {
7
+ "schema": { "const": "agentic-spec.source-register.v1" },
8
+ "run_id": { "type": "string", "minLength": 1 },
9
+ "sources": { "type": "array", "items": { "type": "object", "required": ["source_id", "path", "exists", "policy"], "properties": { "source_id": { "type": "string" }, "path": { "type": "string" }, "exists": { "type": "boolean" }, "kind": { "type": "string" }, "policy": { "type": "string" }, "sensitivity": { "type": "string" } } } }
10
+ }
11
+ }