zob-harness 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/adapters/registry.json +103 -0
- package/.pi/agents/architecture-cartographer.md +53 -0
- package/.pi/agents/chief-vision.md +39 -0
- package/.pi/agents/clarifier.md +58 -0
- package/.pi/agents/context-steward.md +52 -0
- package/.pi/agents/doc-steward.md +34 -0
- package/.pi/agents/explore.md +49 -0
- package/.pi/agents/factory.md +41 -0
- package/.pi/agents/implementer.md +44 -0
- package/.pi/agents/librarian.md +32 -0
- package/.pi/agents/oracle-merge.md +50 -0
- package/.pi/agents/oracle.md +55 -0
- package/.pi/agents/pattern-miner.md +53 -0
- package/.pi/agents/planner.md +39 -0
- package/.pi/agents/project-dna-golden-evaluator.md +32 -0
- package/.pi/agents/project-dna-ontology-steward.md +30 -0
- package/.pi/agents/project-dna-oracle.md +56 -0
- package/.pi/agents/project-dna-orchestrator.md +60 -0
- package/.pi/agents/project-dna-query-steward.md +38 -0
- package/.pi/agents/project-dna-safety-preflight.md +54 -0
- package/.pi/agents/project-dna-test-linker.md +27 -0
- package/.pi/agents/qa.md +38 -0
- package/.pi/agents/refactor-cartographer.md +28 -0
- package/.pi/agents/refactor-mover.md +31 -0
- package/.pi/agents/refactor-oracle.md +49 -0
- package/.pi/agents/repo-scout.md +60 -0
- package/.pi/agents/sample-architect.md +48 -0
- package/.pi/agents/specifier.md +57 -0
- package/.pi/agents/symbol-range-curator.md +41 -0
- package/.pi/agents/synthesis.md +52 -0
- package/.pi/agents/temp-agent-creator.md +35 -0
- package/.pi/autonomy-policy.json +67 -0
- package/.pi/budget-policy.json +54 -0
- package/.pi/capabilities/zob-public-runtime-capabilities.json +1700 -0
- package/.pi/chains/explore-plan-oracle.json +78 -0
- package/.pi/chains/explore-spec-clarify-plan-oracle.json +64 -0
- package/.pi/chains/explore-spec-plan-oracle.json +53 -0
- package/.pi/chains/spec-clarify-plan-oracle.json +53 -0
- package/.pi/chains/spec-factory-oracle.json +42 -0
- package/.pi/chains/spec-plan-oracle.json +42 -0
- package/.pi/compute-profiles/defaults.json +19 -0
- package/.pi/compute-profiles/overrides.json +13 -0
- package/.pi/compute-profiles/risk-rules.json +16 -0
- package/.pi/daemon-policy.json +80 -0
- package/.pi/damage-control-rules.json +45 -0
- package/.pi/extensions/zob-child-safety/index.ts +212 -0
- package/.pi/extensions/zob-harness/AGENTS.md +28 -0
- package/.pi/extensions/zob-harness/index.ts +391 -0
- package/.pi/extensions/zob-harness/src/AGENTS.md +25 -0
- package/.pi/extensions/zob-harness/src/agents.ts +82 -0
- package/.pi/extensions/zob-harness/src/autonomous-runtime.ts +2912 -0
- package/.pi/extensions/zob-harness/src/autonomy-readiness.ts +778 -0
- package/.pi/extensions/zob-harness/src/budget-policy.ts +308 -0
- package/.pi/extensions/zob-harness/src/capabilities.ts +249 -0
- package/.pi/extensions/zob-harness/src/child-runner.ts +249 -0
- package/.pi/extensions/zob-harness/src/chronicle.ts +262 -0
- package/.pi/extensions/zob-harness/src/compute-profile.ts +602 -0
- package/.pi/extensions/zob-harness/src/compute-workflow-shape.ts +168 -0
- package/.pi/extensions/zob-harness/src/coms-v2/AGENTS.md +16 -0
- package/.pi/extensions/zob-harness/src/coms-v2/envelope.ts +121 -0
- package/.pi/extensions/zob-harness/src/coms-v2/identity.ts +53 -0
- package/.pi/extensions/zob-harness/src/coms-v2/ledger-bridge.ts +67 -0
- package/.pi/extensions/zob-harness/src/coms-v2/local-transport.ts +147 -0
- package/.pi/extensions/zob-harness/src/coms-v2/pending-replies.ts +80 -0
- package/.pi/extensions/zob-harness/src/coms-v2/policy.ts +125 -0
- package/.pi/extensions/zob-harness/src/coms-v2/presence.ts +55 -0
- package/.pi/extensions/zob-harness/src/coms-v2/registry.ts +113 -0
- package/.pi/extensions/zob-harness/src/coms-v2/response-capture.ts +50 -0
- package/.pi/extensions/zob-harness/src/coms-v2/transcript-capture.ts +164 -0
- package/.pi/extensions/zob-harness/src/coms-v2/types.ts +149 -0
- package/.pi/extensions/zob-harness/src/coms-v2/zpeer-profile.ts +140 -0
- package/.pi/extensions/zob-harness/src/coms-v2/zpeer.ts +452 -0
- package/.pi/extensions/zob-harness/src/constants.ts +108 -0
- package/.pi/extensions/zob-harness/src/context-gbrain.ts +465 -0
- package/.pi/extensions/zob-harness/src/daemon-policy.ts +223 -0
- package/.pi/extensions/zob-harness/src/daemon-readiness.ts +134 -0
- package/.pi/extensions/zob-harness/src/daemon-runtime.ts +393 -0
- package/.pi/extensions/zob-harness/src/factory/AGENTS.md +24 -0
- package/.pi/extensions/zob-harness/src/factory/agentic-plan.ts +65 -0
- package/.pi/extensions/zob-harness/src/factory/quarantine.ts +319 -0
- package/.pi/extensions/zob-harness/src/factory/run.ts +520 -0
- package/.pi/extensions/zob-harness/src/factory/validation.ts +454 -0
- package/.pi/extensions/zob-harness/src/factory-selector.ts +318 -0
- package/.pi/extensions/zob-harness/src/full-autonomy-test.ts +226 -0
- package/.pi/extensions/zob-harness/src/git-ops.ts +868 -0
- package/.pi/extensions/zob-harness/src/goal-room.ts +178 -0
- package/.pi/extensions/zob-harness/src/goal-runtime.ts +1569 -0
- package/.pi/extensions/zob-harness/src/goal-todo-imports.ts +111 -0
- package/.pi/extensions/zob-harness/src/goal-todo-types.ts +231 -0
- package/.pi/extensions/zob-harness/src/goal-todos.ts +1410 -0
- package/.pi/extensions/zob-harness/src/goal.ts +152 -0
- package/.pi/extensions/zob-harness/src/governed-requests.ts +436 -0
- package/.pi/extensions/zob-harness/src/interactive-autonomy.ts +595 -0
- package/.pi/extensions/zob-harness/src/launch-apply.ts +313 -0
- package/.pi/extensions/zob-harness/src/merge-queue.ts +290 -0
- package/.pi/extensions/zob-harness/src/mission-control.ts +573 -0
- package/.pi/extensions/zob-harness/src/model-availability.ts +52 -0
- package/.pi/extensions/zob-harness/src/model-routing.ts +429 -0
- package/.pi/extensions/zob-harness/src/orchestration/AGENTS.md +23 -0
- package/.pi/extensions/zob-harness/src/orchestration/adaptive-delegation.ts +547 -0
- package/.pi/extensions/zob-harness/src/orchestration/adaptive-workflow.ts +585 -0
- package/.pi/extensions/zob-harness/src/orchestration/lead-plan.ts +192 -0
- package/.pi/extensions/zob-harness/src/orchestration/plan.ts +168 -0
- package/.pi/extensions/zob-harness/src/orchestration/room.ts +346 -0
- package/.pi/extensions/zob-harness/src/orchestration/run.ts +134 -0
- package/.pi/extensions/zob-harness/src/orchestration/supervised-readonly.ts +1147 -0
- package/.pi/extensions/zob-harness/src/orchestration/widget-readers.ts +132 -0
- package/.pi/extensions/zob-harness/src/output-contracts.ts +656 -0
- package/.pi/extensions/zob-harness/src/project-dna.ts +533 -0
- package/.pi/extensions/zob-harness/src/promotion/AGENTS.md +24 -0
- package/.pi/extensions/zob-harness/src/promotion/candidate.ts +336 -0
- package/.pi/extensions/zob-harness/src/promotion/coms.ts +127 -0
- package/.pi/extensions/zob-harness/src/promotion/documentation.ts +142 -0
- package/.pi/extensions/zob-harness/src/promotion/factory.ts +107 -0
- package/.pi/extensions/zob-harness/src/promotion/ledger.ts +2 -0
- package/.pi/extensions/zob-harness/src/promotion/temp-agent.ts +151 -0
- package/.pi/extensions/zob-harness/src/promotion/types.ts +149 -0
- package/.pi/extensions/zob-harness/src/promotion/validate.ts +6 -0
- package/.pi/extensions/zob-harness/src/promotion/write-lane.ts +162 -0
- package/.pi/extensions/zob-harness/src/prompt-packs.ts +239 -0
- package/.pi/extensions/zob-harness/src/queue.ts +386 -0
- package/.pi/extensions/zob-harness/src/rules.ts +225 -0
- package/.pi/extensions/zob-harness/src/runtime/AGENTS.md +26 -0
- package/.pi/extensions/zob-harness/src/runtime/adaptive-zmode.ts +116 -0
- package/.pi/extensions/zob-harness/src/runtime/auto-compaction.ts +715 -0
- package/.pi/extensions/zob-harness/src/runtime/commands.ts +1315 -0
- package/.pi/extensions/zob-harness/src/runtime/compaction-policy.ts +516 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-click-markers.ts +141 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-feed.ts +415 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-markdown.ts +97 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-monitor.ts +553 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-mouse.ts +205 -0
- package/.pi/extensions/zob-harness/src/runtime/delegation-overlay.ts +434 -0
- package/.pi/extensions/zob-harness/src/runtime/events.ts +736 -0
- package/.pi/extensions/zob-harness/src/runtime/goal-todo-overlay.ts +214 -0
- package/.pi/extensions/zob-harness/src/runtime/mode-intent.ts +144 -0
- package/.pi/extensions/zob-harness/src/runtime/plan-capture.ts +270 -0
- package/.pi/extensions/zob-harness/src/runtime/state.ts +403 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-autonomous.ts +117 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-compute.ts +136 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-coms.ts +365 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-context.ts +70 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-delegation.ts +1854 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-factory.ts +810 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-goal-room.ts +46 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-governed-requests.ts +38 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-merge-queue.ts +61 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-mission-control.ts +77 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-orchestration.ts +106 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-project-dna.ts +123 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-worker-pool.ts +93 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-workspace-claims.ts +62 -0
- package/.pi/extensions/zob-harness/src/runtime/tools-zcommit.ts +147 -0
- package/.pi/extensions/zob-harness/src/runtime/widget.ts +353 -0
- package/.pi/extensions/zob-harness/src/runtime/zobHarness.ts +60 -0
- package/.pi/extensions/zob-harness/src/safety.ts +338 -0
- package/.pi/extensions/zob-harness/src/sandbox.ts +1508 -0
- package/.pi/extensions/zob-harness/src/schemas-project-dna.ts +47 -0
- package/.pi/extensions/zob-harness/src/schemas.ts +695 -0
- package/.pi/extensions/zob-harness/src/telemetry.ts +373 -0
- package/.pi/extensions/zob-harness/src/topology/AGENTS.md +22 -0
- package/.pi/extensions/zob-harness/src/topology/chains.ts +236 -0
- package/.pi/extensions/zob-harness/src/topology/coms.ts +211 -0
- package/.pi/extensions/zob-harness/src/topology/orchestration-profiles.ts +204 -0
- package/.pi/extensions/zob-harness/src/topology/teams.ts +113 -0
- package/.pi/extensions/zob-harness/src/types/core.ts +47 -0
- package/.pi/extensions/zob-harness/src/types.ts +939 -0
- package/.pi/extensions/zob-harness/src/utils/AGENTS.md +22 -0
- package/.pi/extensions/zob-harness/src/utils/formatting.ts +34 -0
- package/.pi/extensions/zob-harness/src/utils/hashing.ts +11 -0
- package/.pi/extensions/zob-harness/src/utils/json.ts +28 -0
- package/.pi/extensions/zob-harness/src/utils/paths.ts +54 -0
- package/.pi/extensions/zob-harness/src/utils/records.ts +25 -0
- package/.pi/extensions/zob-harness/src/utils/resources.ts +38 -0
- package/.pi/extensions/zob-harness/src/worker-pool.ts +672 -0
- package/.pi/extensions/zob-harness/src/workspace-claims.ts +297 -0
- package/.pi/extensions/zob-switch/index.ts +180 -0
- package/.pi/factories/budget-preflight-dry-run/batch-manifest.json +59 -0
- package/.pi/factories/budget-preflight-dry-run/factory.json +94 -0
- package/.pi/factories/budget-preflight-dry-run/pilot-manifest.json +50 -0
- package/.pi/factories/budget-preflight-dry-run/smoke-manifest.json +43 -0
- package/.pi/factories/code-review-matrix/batch-manifest.json +61 -0
- package/.pi/factories/code-review-matrix/factory.json +163 -0
- package/.pi/factories/code-review-matrix/pilot-manifest.json +41 -0
- package/.pi/factories/code-review-matrix/smoke-manifest.json +35 -0
- package/.pi/factories/factory-forge/batch-manifest.json +56 -0
- package/.pi/factories/factory-forge/factory.json +84 -0
- package/.pi/factories/factory-forge/pilot-manifest.json +32 -0
- package/.pi/factories/factory-forge/smoke-manifest.json +19 -0
- package/.pi/factories/opencode-pattern-canonizer/batch-manifest.json +54 -0
- package/.pi/factories/opencode-pattern-canonizer/factory.json +86 -0
- package/.pi/factories/opencode-pattern-canonizer/pilot-manifest.json +39 -0
- package/.pi/factories/opencode-pattern-canonizer/smoke-manifest.json +26 -0
- package/.pi/factories/project-dna/README.md +182 -0
- package/.pi/factories/project-dna/batch-manifest.json +37 -0
- package/.pi/factories/project-dna/example-project-dna-manifest-v2.json +80 -0
- package/.pi/factories/project-dna/example-project-dna-manifest.json +58 -0
- package/.pi/factories/project-dna/factory.json +131 -0
- package/.pi/factories/project-dna/golden-cases-smoke.json +62 -0
- package/.pi/factories/project-dna/pi-agentic-ontology.json +88 -0
- package/.pi/factories/project-dna/pilot-manifest.json +32 -0
- package/.pi/factories/project-dna/schemas/benchmark-suite.schema.json +27 -0
- package/.pi/factories/project-dna/schemas/code-knowledge-graph.schema.json +97 -0
- package/.pi/factories/project-dna/schemas/context-pack.schema.json +43 -0
- package/.pi/factories/project-dna/schemas/golden-case.schema.json +36 -0
- package/.pi/factories/project-dna/schemas/manifest-v2.schema.json +128 -0
- package/.pi/factories/project-dna/schemas/manifest.schema.json +77 -0
- package/.pi/factories/project-dna/schemas/ontology.schema.json +45 -0
- package/.pi/factories/project-dna/schemas/project-fingerprint.schema.json +28 -0
- package/.pi/factories/project-dna/schemas/query-steward-report.schema.json +52 -0
- package/.pi/factories/project-dna/smoke-manifest.json +27 -0
- package/.pi/factories/roadmap-smoke-lots/batch-manifest.json +49 -0
- package/.pi/factories/roadmap-smoke-lots/factory.json +89 -0
- package/.pi/factories/roadmap-smoke-lots/pilot-manifest.json +50 -0
- package/.pi/factories/roadmap-smoke-lots/smoke-manifest.json +35 -0
- package/.pi/git-policy.json +120 -0
- package/.pi/mission-control/zob_coms_transport.json +64 -0
- package/.pi/model-catalog.example.json +345 -0
- package/.pi/model-economy.example.json +196 -0
- package/.pi/model-routing.json +86 -0
- package/.pi/orchestrations/adaptive-chief-vision.json +193 -0
- package/.pi/orchestrations/ceo-feature-build.json +182 -0
- package/.pi/orchestrations/readonly-dynamic-smoke.json +75 -0
- package/.pi/output-contracts/agent-event.v1.json +19 -0
- package/.pi/output-contracts/base.v1.json +24 -0
- package/.pi/output-contracts/brain-lookup.v1.json +21 -0
- package/.pi/output-contracts/clarification.v1.json +21 -0
- package/.pi/output-contracts/context-pack.v1.json +20 -0
- package/.pi/output-contracts/context-request.v1.json +21 -0
- package/.pi/output-contracts/context-steward.v1.json +19 -0
- package/.pi/output-contracts/context-writeback-proposal.v1.json +18 -0
- package/.pi/output-contracts/delegation-request.v1.json +21 -0
- package/.pi/output-contracts/explore.v1.json +52 -0
- package/.pi/output-contracts/factory.v1.json +48 -0
- package/.pi/output-contracts/guidance-steward.v1.json +18 -0
- package/.pi/output-contracts/implement.v1.json +40 -0
- package/.pi/output-contracts/launch-authorization.v1.json +21 -0
- package/.pi/output-contracts/lead-plan.v1.json +22 -0
- package/.pi/output-contracts/mission-readiness.v1.json +20 -0
- package/.pi/output-contracts/oracle-merge.v1.json +44 -0
- package/.pi/output-contracts/oracle-request.v1.json +20 -0
- package/.pi/output-contracts/oracle.v1.json +44 -0
- package/.pi/output-contracts/orchestration-profile.v1.json +22 -0
- package/.pi/output-contracts/plan.v1.json +48 -0
- package/.pi/output-contracts/prompt-pack.v1.json +20 -0
- package/.pi/output-contracts/qa.v1.json +40 -0
- package/.pi/output-contracts/research.v1.json +36 -0
- package/.pi/output-contracts/spec.v1.json +22 -0
- package/.pi/output-contracts/synthesis.v1.json +44 -0
- package/.pi/output-contracts/temp-agent-card.v1.json +23 -0
- package/.pi/output-contracts/todo-child-result.v1.json +20 -0
- package/.pi/output-contracts/todo-child-result.v2.json +22 -0
- package/.pi/output-contracts/todo-claim-validation.v1.json +22 -0
- package/.pi/output-contracts/todo-split-request.v1.json +20 -0
- package/.pi/prompts/adaptive-workflow.md +63 -0
- package/.pi/prompts/autonomous-runtime.md +15 -0
- package/.pi/prompts/benchmark-contender.md +15 -0
- package/.pi/prompts/benchmark-judge.md +19 -0
- package/.pi/prompts/clarify-spec.md +20 -0
- package/.pi/prompts/compute-plan.md +36 -0
- package/.pi/prompts/compute-preview.md +42 -0
- package/.pi/prompts/contract.md +29 -0
- package/.pi/prompts/explore.md +13 -0
- package/.pi/prompts/factory-run.md +36 -0
- package/.pi/prompts/factory.md +20 -0
- package/.pi/prompts/implement.md +27 -0
- package/.pi/prompts/model-catalog.md +68 -0
- package/.pi/prompts/model-economy.md +64 -0
- package/.pi/prompts/oracle-merge.md +18 -0
- package/.pi/prompts/oracle.md +13 -0
- package/.pi/prompts/orchestrator.md +48 -0
- package/.pi/prompts/parallel-review.md +21 -0
- package/.pi/prompts/plan.md +21 -0
- package/.pi/prompts/project-dna.md +90 -0
- package/.pi/prompts/refactor-oracle.md +23 -0
- package/.pi/prompts/refactor-slice.md +24 -0
- package/.pi/prompts/research.md +20 -0
- package/.pi/prompts/spec.md +19 -0
- package/.pi/prompts/synthesis.md +18 -0
- package/.pi/rules/always.md +38 -0
- package/.pi/rules/docs.md +32 -0
- package/.pi/rules/factory.md +44 -0
- package/.pi/rules/oracle.md +34 -0
- package/.pi/rules/orchestration.md +44 -0
- package/.pi/rules/project.md +34 -0
- package/.pi/rules/prompts.md +43 -0
- package/.pi/rules/runtime.md +43 -0
- package/.pi/rules/sandbox.md +43 -0
- package/.pi/settings.json +28 -0
- package/.pi/skills/zob-agentic-access/SKILL.md +20 -0
- package/.pi/skills/zob-autonomous-runtime/SKILL.md +41 -0
- package/.pi/skills/zob-commit/SKILL.md +79 -0
- package/.pi/skills/zob-compaction-policy/SKILL.md +92 -0
- package/.pi/skills/zob-compute-profile/SKILL.md +108 -0
- package/.pi/skills/zob-coms-safety/SKILL.md +54 -0
- package/.pi/skills/zob-coms-v2-live/SKILL.md +47 -0
- package/.pi/skills/zob-delegation-routing/SKILL.md +82 -0
- package/.pi/skills/zob-factory/SKILL.md +28 -0
- package/.pi/skills/zob-goal-todo-tree/SKILL.md +279 -0
- package/.pi/skills/zob-harness/SKILL.md +68 -0
- package/.pi/skills/zob-mission-control-coms/SKILL.md +39 -0
- package/.pi/skills/zob-oracle/SKILL.md +21 -0
- package/.pi/skills/zob-owner-pool-drill-writer/SKILL.md +244 -0
- package/.pi/skills/zob-owner-pool-launcher/SKILL.md +261 -0
- package/.pi/skills/zob-project-dna/SKILL.md +275 -0
- package/.pi/skills/zob-sandbox/SKILL.md +29 -0
- package/.pi/skills/zob-spec/SKILL.md +25 -0
- package/.pi/skills/zob-split-refactor/SKILL.md +39 -0
- package/.pi/skills/zob-tool-router/SKILL.md +104 -0
- package/.pi/teams/zob-core.json +122 -0
- package/AGENTS.md +89 -0
- package/CONTRIBUTING.md +56 -0
- package/LICENSE +21 -0
- package/README.md +360 -0
- package/SECURITY.md +35 -0
- package/SOURCE_INDEX.md +46 -0
- package/package.json +135 -0
- package/scripts/README.md +57 -0
- package/scripts/autonomy/mission-readiness-secret-smoke.mjs +90 -0
- package/scripts/compute-profile/plan-workflow.mjs +85 -0
- package/scripts/compute-profile/preview.mjs +242 -0
- package/scripts/compute-profile/regression-smoke.mjs +38 -0
- package/scripts/compute-profile/summarize.mjs +72 -0
- package/scripts/compute-profile/validate-policy.mjs +50 -0
- package/scripts/compute-profile/validate-preview.mjs +95 -0
- package/scripts/compute-profile/validate-workflow.mjs +58 -0
- package/scripts/git-ops/commit-policy-smoke.mjs +221 -0
- package/scripts/goal-todo/child-goal-ref-smoke.mjs +252 -0
- package/scripts/harness-switch/static-smoke.mjs +43 -0
- package/scripts/model-catalog/validate-economy.mjs +223 -0
- package/scripts/model-catalog/validate.mjs +199 -0
- package/scripts/package-surface/validate-script-refs.mjs +190 -0
- package/scripts/path-policy/validate-smoke.mjs +103 -0
- package/scripts/project-dna/bench-smoke.mjs +217 -0
- package/scripts/project-dna/build-capsules.mjs +207 -0
- package/scripts/project-dna/build-sample-spec.mjs +140 -0
- package/scripts/project-dna/emit-golden-cases.mjs +75 -0
- package/scripts/project-dna/emit-ontology.mjs +75 -0
- package/scripts/project-dna/generate-sample.mjs +302 -0
- package/scripts/project-dna/oracle-review-smoke.mjs +157 -0
- package/scripts/project-dna/plan-workflow.mjs +289 -0
- package/scripts/project-dna/query-context.mjs +276 -0
- package/scripts/project-dna/query-steward.mjs +149 -0
- package/scripts/project-dna/scan.mjs +553 -0
- package/scripts/project-dna/validate-5of5.mjs +159 -0
- package/scripts/project-dna/validate-golden-cases.mjs +78 -0
- package/scripts/project-dna/validate-ontology.mjs +97 -0
- package/scripts/project-dna/validate-sample-project.mjs +105 -0
- package/scripts/project-dna/validate-scaffold.mjs +383 -0
- package/scripts/project-dna/validate-scan-artifacts.mjs +187 -0
- package/scripts/project-dna/validate-workflow.mjs +166 -0
- package/scripts/start-pi.sh +4 -0
- package/scripts/worker-pool/static-smoke.mjs +54 -0
- package/scripts/zpeer-local-e2e-smoke.mjs +395 -0
- package/scripts/zpeer-static-smoke.mjs +129 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { extname, resolve, sep } from "node:path";
|
|
3
|
+
|
|
4
|
+
import type { ChildResult, OutputContract, OutputRequirement } from "./types.js";
|
|
5
|
+
|
|
6
|
+
const COMMON_OUTPUT_REQUIREMENTS: OutputRequirement[] = [
|
|
7
|
+
{
|
|
8
|
+
name: "deliverable_delivered",
|
|
9
|
+
pattern: "deliverable_delivered\\s*:\\s*(yes|no)|<deliverable_delivered>\\s*(yes|no)\\s*</deliverable_delivered>",
|
|
10
|
+
message: "Missing required final marker: deliverable_delivered: yes/no",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "evidence",
|
|
14
|
+
pattern: "<evidence>|\\bevidence\\b|preuve|preuves",
|
|
15
|
+
message: "Missing evidence/proof section",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "risks_blockers",
|
|
19
|
+
pattern: "<risks_blockers>|risks?/blockers?|risks?|blockers?|risques?|blocage",
|
|
20
|
+
message: "Missing risks/blockers section",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "compliance",
|
|
24
|
+
pattern: "<compliance>|\\bcompliance\\b|conformité|must not",
|
|
25
|
+
message: "Missing compliance line",
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const OUTPUT_CONTRACTS: OutputContract[] = [
|
|
30
|
+
{
|
|
31
|
+
id: "base.v1",
|
|
32
|
+
description: "Base ZOB delegated output: deliverable marker, evidence, risks/blockers, compliance.",
|
|
33
|
+
agentNames: [],
|
|
34
|
+
required: COMMON_OUTPUT_REQUIREMENTS,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "explore.v1",
|
|
38
|
+
description: "Read-only exploration with reframing, files, answer, gaps, and next steps.",
|
|
39
|
+
agentNames: ["explore", "refactor-cartographer"],
|
|
40
|
+
required: [
|
|
41
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
42
|
+
{ name: "literal_request", pattern: "<literal_request>|literal request|literal_request", message: "Explore output missing literal_request" },
|
|
43
|
+
{ name: "actual_need", pattern: "<actual_need>|actual need|actual_need", message: "Explore output missing actual_need" },
|
|
44
|
+
{ name: "success_looks_like", pattern: "<success_looks_like>|success looks like|success_looks_like", message: "Explore output missing success_looks_like" },
|
|
45
|
+
{ name: "files", pattern: "<files>|\\bfiles\\b|fichiers", message: "Explore output missing files section" },
|
|
46
|
+
{ name: "answer", pattern: "<answer>|\\banswer\\b|réponse|reponse", message: "Explore output missing answer section" },
|
|
47
|
+
{ name: "gaps", pattern: "<gaps>|\\bgaps\\b|trous|manques", message: "Explore output missing gaps section" },
|
|
48
|
+
{ name: "next_steps", pattern: "<next_steps>|next steps|next_steps|prochaines étapes", message: "Explore output missing next_steps section" },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "plan.v1",
|
|
53
|
+
description: "Planning output with scope, assumptions, validation ladder, stop conditions, and handoff contract.",
|
|
54
|
+
agentNames: ["planner", "plan", "chief-vision"],
|
|
55
|
+
required: [
|
|
56
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
57
|
+
{ name: "scope", pattern: "scope|in-scope|out-of-scope|forbidden", message: "Plan output missing scope table" },
|
|
58
|
+
{ name: "assumptions", pattern: "assumptions?|hypothèses", message: "Plan output missing assumptions" },
|
|
59
|
+
{ name: "implementation_slices", pattern: "implementation (steps|slices)|slices?|étapes", message: "Plan output missing implementation slices/steps" },
|
|
60
|
+
{ name: "validation_ladder", pattern: "validation ladder|validation", message: "Plan output missing validation ladder" },
|
|
61
|
+
{ name: "stop_conditions", pattern: "stop conditions?|conditions d'arrêt|conditions d’arret", message: "Plan output missing stop conditions" },
|
|
62
|
+
{ name: "handoff_contract", pattern: "handoff|TASK:|EXPECTED OUTCOME:|MUST NOT", message: "Plan output missing implementer handoff contract" },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "implement.v1",
|
|
67
|
+
description: "Bounded implementation report with gap verdict, changed files/no-change evidence, commands, and results.",
|
|
68
|
+
agentNames: ["implementer", "implement", "refactor-mover"],
|
|
69
|
+
required: [
|
|
70
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
71
|
+
{ name: "gap_verdict", pattern: "gap verdict|SUFFICIENT|GAP|no change|no-change", message: "Implement output missing gap/no-change verdict" },
|
|
72
|
+
{ name: "changed_files", pattern: "changed files|fichiers modifiés|no change|no-change", message: "Implement output missing changed files or no-change evidence" },
|
|
73
|
+
{ name: "verification_commands", pattern: "verification|vérification|commands?|commandes?", message: "Implement output missing verification commands" },
|
|
74
|
+
{ name: "results", pattern: "results?|résultats?|exit code|passed|failed", message: "Implement output missing command/results evidence" },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "oracle.v1",
|
|
79
|
+
description: "Skeptical review with verdict, confidence, blockers, evidence, and no_ship decision.",
|
|
80
|
+
agentNames: ["oracle", "refactor-oracle"],
|
|
81
|
+
required: [
|
|
82
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
83
|
+
{ name: "verdict", pattern: "<verdict>\\s*(PASS|FAIL|WARN)\\s*</verdict>|\\b(PASS|FAIL|WARN)\\b", message: "Oracle output missing PASS/FAIL/WARN verdict" },
|
|
84
|
+
{ name: "confidence", pattern: "<confidence>|\\bconfidence\\b|confiance", message: "Oracle output missing confidence" },
|
|
85
|
+
{ name: "blocking_issues", pattern: "<blocking_issues>|blocking issues?|blockers?|bloqueurs", message: "Oracle output missing blocking issues" },
|
|
86
|
+
{ name: "non_blocking_notes", pattern: "<non_blocking_notes>|non[-_ ]blocking", message: "Oracle output missing non-blocking notes" },
|
|
87
|
+
{ name: "no_ship", pattern: "<no_ship>|no_ship|no ship", message: "Oracle output missing no_ship decision" },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "qa.v1",
|
|
92
|
+
description: "QA verification with verdict, commands, exit/output evidence, and reproduction details.",
|
|
93
|
+
agentNames: ["qa"],
|
|
94
|
+
required: [
|
|
95
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
96
|
+
{ name: "verdict", pattern: "\\b(PASS|FAIL|WARN|INCONCLUSIVE)\\b|verdict", message: "QA output missing verification verdict" },
|
|
97
|
+
{ name: "command", pattern: "commands?|commandes?|cwd", message: "QA output missing command/cwd evidence" },
|
|
98
|
+
{ name: "exit_or_output", pattern: "exit code|output|stdout|stderr|important output", message: "QA output missing exit/output evidence" },
|
|
99
|
+
{ name: "reproduction", pattern: "reproduction|reproduce|steps", message: "QA output missing reproduction steps" },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "synthesis.v1",
|
|
104
|
+
description: "Parallel-lane synthesis with consensus, conflicts, missing evidence, next action, and rerun tasks.",
|
|
105
|
+
agentNames: ["synthesis"],
|
|
106
|
+
required: [
|
|
107
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
108
|
+
{ name: "consensus", pattern: "<consensus>|\\bconsensus\\b", message: "Synthesis output missing consensus section" },
|
|
109
|
+
{ name: "conflicts", pattern: "<conflicts>|conflicts?|désaccords?", message: "Synthesis output missing conflicts section" },
|
|
110
|
+
{ name: "missing_evidence", pattern: "<missing_evidence>|missing_evidence|missing evidence|preuves manquantes", message: "Synthesis output missing missing_evidence section" },
|
|
111
|
+
{ name: "recommended_next_action", pattern: "<recommended_next_action>|recommended_next_action|recommended next action", message: "Synthesis output missing recommended_next_action section" },
|
|
112
|
+
{ name: "tasks_to_rerun", pattern: "<tasks_to_rerun>|tasks_to_rerun|tasks to rerun|rerun", message: "Synthesis output missing tasks_to_rerun section" },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "oracle-merge.v1",
|
|
117
|
+
description: "Merged review verdict with confidence, no_ship, blockers, evidence, and lane summary.",
|
|
118
|
+
agentNames: ["oracle-merge"],
|
|
119
|
+
required: [
|
|
120
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
121
|
+
{ name: "verdict", pattern: "<verdict>\\s*(PASS|FAIL|WARN)\\s*</verdict>|\\b(PASS|FAIL|WARN)\\b", message: "Oracle merge output missing PASS/FAIL/WARN verdict" },
|
|
122
|
+
{ name: "confidence", pattern: "<confidence>|\\bconfidence\\b|confiance", message: "Oracle merge output missing confidence" },
|
|
123
|
+
{ name: "no_ship", pattern: "<no_ship>|no_ship|no ship", message: "Oracle merge output missing no_ship decision" },
|
|
124
|
+
{ name: "blocking_issues", pattern: "<blocking_issues>|blocking issues?|blockers?|bloqueurs", message: "Oracle merge output missing blocking issues" },
|
|
125
|
+
{ name: "merged_lanes", pattern: "<merged_lanes>|merged_lanes|merged lanes", message: "Oracle merge output missing merged_lanes" },
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "factory.v1",
|
|
130
|
+
description: "Factory design with manifest, schema, validators, pilot, sentinel, and resume strategy.",
|
|
131
|
+
agentNames: ["factory"],
|
|
132
|
+
required: [
|
|
133
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
134
|
+
{ name: "manifest", pattern: "manifest", message: "Factory output missing manifest" },
|
|
135
|
+
{ name: "schema", pattern: "schema", message: "Factory output missing schema" },
|
|
136
|
+
{ name: "validators", pattern: "validators?|validation gates?", message: "Factory output missing validators" },
|
|
137
|
+
{ name: "pilot", pattern: "pilot|smoke", message: "Factory output missing pilot plan/result" },
|
|
138
|
+
{ name: "sentinel", pattern: "sentinel", message: "Factory output missing sentinel strategy" },
|
|
139
|
+
{ name: "resume", pattern: "resume|checkpoint", message: "Factory output missing resume/checkpoint strategy" },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "research.v1",
|
|
144
|
+
description: "Sourced research with sources, unknowns, recommendation, evidence, risks, and compliance.",
|
|
145
|
+
agentNames: ["librarian", "research"],
|
|
146
|
+
required: [
|
|
147
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
148
|
+
{ name: "sources", pattern: "sources?|sources_consulted|URLs?|paths?", message: "Research output missing sources" },
|
|
149
|
+
{ name: "unknowns", pattern: "unknowns?|uncertainties|incertitudes", message: "Research output missing unknowns/uncertainties" },
|
|
150
|
+
{ name: "recommendation", pattern: "recommendation|recommandation", message: "Research output missing recommendation" },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "brain-lookup.v1",
|
|
155
|
+
description: "Context/GBrain P0 lookup result with explicit scope, brain/source ids, citations, freshness, confidence, and no body storage.",
|
|
156
|
+
agentNames: [],
|
|
157
|
+
required: [
|
|
158
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
159
|
+
{ name: "context_scope", pattern: "context_scope|context scope", message: "Brain lookup output missing context_scope" },
|
|
160
|
+
{ name: "brain_id", pattern: "brain_id|brainId|brain id", message: "Brain lookup output missing brain_id" },
|
|
161
|
+
{ name: "source_id", pattern: "source_id|sourceId|source id", message: "Brain lookup output missing source_id" },
|
|
162
|
+
{ name: "citations", pattern: "citations?|source refs?", message: "Brain lookup output missing citations" },
|
|
163
|
+
{ name: "facts_or_patterns", pattern: "facts_or_patterns|facts|patterns", message: "Brain lookup output missing facts_or_patterns" },
|
|
164
|
+
{ name: "gaps", pattern: "gaps|source gaps", message: "Brain lookup output missing gaps" },
|
|
165
|
+
{ name: "freshness", pattern: "freshness|stale", message: "Brain lookup output missing freshness" },
|
|
166
|
+
{ name: "confidence", pattern: "confidence|confiance", message: "Brain lookup output missing confidence" },
|
|
167
|
+
{ name: "no_body_storage", pattern: "no_body_storage|bodyStored\s*[:=]\s*false|no body storage", message: "Brain lookup output missing no_body_storage" },
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "context-pack.v1",
|
|
172
|
+
description: "Bounded Context/GBrain P0 context pack with source locks, citations, loading rules, agent profile map, and no body storage.",
|
|
173
|
+
agentNames: [],
|
|
174
|
+
required: [
|
|
175
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
176
|
+
{ name: "pack_id", pattern: "pack_id|packId|pack id", message: "Context pack output missing pack_id" },
|
|
177
|
+
{ name: "context_scope", pattern: "context_scope|context scope", message: "Context pack output missing context_scope" },
|
|
178
|
+
{ name: "source_locks", pattern: "source_locks|sourceLocks|source locks", message: "Context pack output missing source_locks" },
|
|
179
|
+
{ name: "loading_rules", pattern: "loading_rules|loadingRules|loading rules", message: "Context pack output missing loading_rules" },
|
|
180
|
+
{ name: "agent_profile_map", pattern: "agent_profile_map|agentProfileMap|agent profile map", message: "Context pack output missing agent_profile_map" },
|
|
181
|
+
{ name: "citations", pattern: "citations?|source refs?", message: "Context pack output missing citations" },
|
|
182
|
+
{ name: "budget_limits", pattern: "budget_limits|budgetLimits|context limits", message: "Context pack output missing budget_limits" },
|
|
183
|
+
{ name: "no_body_storage", pattern: "no_body_storage|bodyStored\s*[:=]\s*false|no body storage", message: "Context pack output missing no_body_storage" },
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: "context-writeback-proposal.v1",
|
|
188
|
+
description: "Context/GBrain P0 learning writeback proposal. Proposal only; no auto-promotion or GBrain write.",
|
|
189
|
+
agentNames: [],
|
|
190
|
+
required: [
|
|
191
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
192
|
+
{ name: "observed_problem", pattern: "observed_problem|observed problem", message: "Context writeback proposal missing observed_problem" },
|
|
193
|
+
{ name: "new_pattern", pattern: "new_pattern|new pattern", message: "Context writeback proposal missing new_pattern" },
|
|
194
|
+
{ name: "evidence_refs", pattern: "evidence_refs|evidence refs|evidence", message: "Context writeback proposal missing evidence_refs" },
|
|
195
|
+
{ name: "recommended_artifact", pattern: "recommended_artifact|recommended artifact", message: "Context writeback proposal missing recommended_artifact" },
|
|
196
|
+
{ name: "promotion_requires", pattern: "promotion_requires|promotion requires|oracle_PASS|human_approval|smoke_proof", message: "Context writeback proposal missing promotion_requires" },
|
|
197
|
+
{ name: "auto_promote", pattern: "auto_promote\s*[:=]\s*false|autoPromote\s*[:=]\s*false", message: "Context writeback proposal missing auto_promote=false" },
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "context-steward.v1",
|
|
202
|
+
description: "Context Steward P0 output with cited context hints, source gaps, stale/missing context warnings, and writeback candidates only.",
|
|
203
|
+
agentNames: ["context-steward"],
|
|
204
|
+
required: [
|
|
205
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
206
|
+
{ name: "context_scope", pattern: "context_scope|context scope", message: "Context steward output missing context_scope" },
|
|
207
|
+
{ name: "context_hints", pattern: "context_hints|context hints", message: "Context steward output missing context_hints" },
|
|
208
|
+
{ name: "citations", pattern: "citations?|source refs?", message: "Context steward output missing citations" },
|
|
209
|
+
{ name: "source_gaps", pattern: "source_gaps|source gaps", message: "Context steward output missing source_gaps" },
|
|
210
|
+
{ name: "writeback_candidates", pattern: "writeback_candidates|writeback candidates", message: "Context steward output missing writeback_candidates" },
|
|
211
|
+
{ name: "parent_owned", pattern: "parent_owned|parent-owned", message: "Context steward output missing parent_owned" },
|
|
212
|
+
{ name: "no_plan_mutation", pattern: "no_plan_mutation|no plan mutation", message: "Context steward output missing no_plan_mutation" },
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "spec.v1",
|
|
217
|
+
description: "Product/factory specification with scope, constraints, acceptance criteria, and planner handoff.",
|
|
218
|
+
agentNames: ["specifier", "spec"],
|
|
219
|
+
required: [
|
|
220
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
221
|
+
{ name: "problem", pattern: "<problem>|\\bproblem\\b|problème|probleme", message: "Spec output missing problem" },
|
|
222
|
+
{ name: "context", pattern: "<context>|\\bcontext\\b|contexte", message: "Spec output missing context" },
|
|
223
|
+
{ name: "objectives", pattern: "<objectives>|objectives?|objectifs?", message: "Spec output missing objectives" },
|
|
224
|
+
{ name: "non_goals", pattern: "<non_goals>|non[-_ ]goals?|non[-_ ]objectifs?", message: "Spec output missing non_goals" },
|
|
225
|
+
{ name: "in_scope", pattern: "<in_scope>|in[-_ ]scope|périmètre inclus|perimetre inclus", message: "Spec output missing in_scope" },
|
|
226
|
+
{ name: "out_of_scope", pattern: "<out_of_scope>|out[-_ ]of[-_ ]scope|hors[-_ ]scope|hors périmètre|hors perimetre", message: "Spec output missing out_of_scope" },
|
|
227
|
+
{ name: "constraints", pattern: "<constraints>|constraints?|contraintes?", message: "Spec output missing constraints" },
|
|
228
|
+
{ name: "acceptance_criteria", pattern: "<acceptance_criteria>|acceptance criteria|acceptance_criteria|critères d'acceptation|criteres d'acceptation", message: "Spec output missing acceptance_criteria" },
|
|
229
|
+
{ name: "open_questions", pattern: "<open_questions>|open questions|open_questions|questions ouvertes", message: "Spec output missing open_questions" },
|
|
230
|
+
{ name: "handoff_to_planner", pattern: "<handoff_to_planner>|handoff to planner|handoff_to_planner|planner", message: "Spec output missing handoff_to_planner" },
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: "clarification.v1",
|
|
235
|
+
description: "Clarification gate with clarity score, verdict, allow_plan, guided questions, and minimum-to-plan.",
|
|
236
|
+
agentNames: ["clarifier"],
|
|
237
|
+
required: [
|
|
238
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
239
|
+
{ name: "clarity_score", pattern: "<clarity_score>|clarity_score|clarity score|score de clarté", message: "Clarification output missing clarity_score" },
|
|
240
|
+
{ name: "verdict", pattern: "<verdict>\\s*(CLEAR|NEEDS_CLARIFICATION|BLOCKED)\\s*</verdict>|\\b(CLEAR|NEEDS_CLARIFICATION|BLOCKED)\\b", message: "Clarification output missing CLEAR/NEEDS_CLARIFICATION/BLOCKED verdict" },
|
|
241
|
+
{ name: "allow_plan", pattern: "<allow_plan>\\s*(yes|no)\\s*</allow_plan>|allow_plan\\s*[:=]\\s*(yes|no)", message: "Clarification output missing allow_plan yes/no" },
|
|
242
|
+
{ name: "ambiguities", pattern: "<ambiguities>|ambiguities|ambiguïtés|ambiguites", message: "Clarification output missing ambiguities" },
|
|
243
|
+
{ name: "questions", pattern: "<questions>|questions?", message: "Clarification output missing questions" },
|
|
244
|
+
{ name: "assumptions", pattern: "<assumptions>|assumptions?|hypothèses|hypotheses", message: "Clarification output missing assumptions" },
|
|
245
|
+
{ name: "refined_spec", pattern: "<refined_spec>|refined spec|refined_spec|spec affinée|spec affinee", message: "Clarification output missing refined_spec" },
|
|
246
|
+
{ name: "minimum_to_plan", pattern: "<minimum_to_plan>|minimum to plan|minimum_to_plan", message: "Clarification output missing minimum_to_plan" },
|
|
247
|
+
{ name: "acceptance_criteria", pattern: "<acceptance_criteria>|acceptance criteria|acceptance_criteria|critères d'acceptation|criteres d'acceptation", message: "Clarification output missing acceptance_criteria" },
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "launch-authorization.v1",
|
|
252
|
+
description: "Launch authorization envelope: spec lock plus explicit user launch bounds in-scope autonomous actions without storing raw bodies.",
|
|
253
|
+
agentNames: [],
|
|
254
|
+
required: [
|
|
255
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
256
|
+
{ name: "schema", pattern: "zob\.launch-authorization\.v1|launch-authorization\.v1", message: "Launch authorization output missing schema" },
|
|
257
|
+
{ name: "spec_locked", pattern: "specLocked\s*[:=]\s*true|spec_locked\s*[:=]\s*true", message: "Launch authorization output missing specLocked=true" },
|
|
258
|
+
{ name: "user_launch_confirmed", pattern: "userLaunchConfirmed|user_launch_confirmed", message: "Launch authorization output missing user launch confirmation field" },
|
|
259
|
+
{ name: "allowed_actions", pattern: "allowedActions|allowed_actions|allowed actions", message: "Launch authorization output missing allowed actions" },
|
|
260
|
+
{ name: "allowed_paths", pattern: "allowedPaths|allowed_paths|allowed paths", message: "Launch authorization output missing allowed paths" },
|
|
261
|
+
{ name: "forbidden_paths", pattern: "forbiddenPaths|forbidden_paths|forbidden paths", message: "Launch authorization output missing forbidden paths" },
|
|
262
|
+
{ name: "apply_policy", pattern: "applyPolicy|apply_policy|apply policy", message: "Launch authorization output missing apply policy" },
|
|
263
|
+
{ name: "stop_conditions", pattern: "stopConditions|stop_conditions|stop conditions", message: "Launch authorization output missing stop conditions" },
|
|
264
|
+
{ name: "body_free", pattern: "bodyStored\s*[:=]\s*false|body-free|hash-only", message: "Launch authorization output missing body-free posture" },
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "mission-readiness.v1",
|
|
269
|
+
description: "Interactive autonomy mission-readiness verdict with score, decision, safety gates, launch posture, and hash-only input metadata.",
|
|
270
|
+
agentNames: [],
|
|
271
|
+
required: [
|
|
272
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
273
|
+
{ name: "schema", pattern: "zob\\.mission-readiness\\.v1|mission-readiness\\.v1", message: "Mission readiness output missing schema" },
|
|
274
|
+
{ name: "mode", pattern: "mode|open|controlled|adaptive", message: "Mission readiness output missing mode" },
|
|
275
|
+
{ name: "decision", pattern: "auto_launch|clarify|block|stopped|decision", message: "Mission readiness output missing decision" },
|
|
276
|
+
{ name: "score", pattern: "score|readiness", message: "Mission readiness output missing score" },
|
|
277
|
+
{ name: "safety_gates", pattern: "safetyGates|safety_gates|no[- ]secrets|no[- ]destructive", message: "Mission readiness output missing safety gates" },
|
|
278
|
+
{ name: "manual_per_action_approval", pattern: "manualPerActionApproval|manual_per_action|per-action", message: "Mission readiness output missing manual per-action approval posture" },
|
|
279
|
+
{ name: "launch_authorization", pattern: "launchAuthorization|launch_authorization|launch authorized|launch=", message: "Mission readiness output missing launch authorization posture" },
|
|
280
|
+
{ name: "body_free", pattern: "rawInputStored\\s*[:=]\\s*false|bodyStored\\s*[:=]\\s*false|body-free|hash-only", message: "Mission readiness output missing body-free posture" },
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
id: "agent-event.v1",
|
|
285
|
+
description: "Typed parent-visible agent event with hash-only body/output refs, evidence, and no direct TODO mutation.",
|
|
286
|
+
agentNames: [],
|
|
287
|
+
required: [
|
|
288
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
289
|
+
{ name: "schema", pattern: "zob\.agent-event\.v1|agent-event\.v1|zob\.goal-room-message\.v1", message: "Agent event output missing schema" },
|
|
290
|
+
{ name: "kind", pattern: "STATUS_UPDATE|FINDING|ACTION_TAKEN|ARTIFACT_READY|TODO_CLAIM|BLOCKER|RISK|CONTEXT_REQUEST|SPLIT_REQUEST|DELEGATION_REQUEST|ORACLE_REQUEST|HANDOFF|DECISION", message: "Agent event output missing typed kind" },
|
|
291
|
+
{ name: "body_hash", pattern: "bodyHash|body_hash", message: "Agent event output missing body hash" },
|
|
292
|
+
{ name: "parent_visible", pattern: "parentVisible\s*[:=]\s*true|parent_visible\s*[:=]\s*true", message: "Agent event output missing parent-visible posture" },
|
|
293
|
+
{ name: "parent_owned_actions", pattern: "parentOwnedActions\s*[:=]\s*true|parent_owned_actions\s*[:=]\s*true", message: "Agent event output missing parent-owned action posture" },
|
|
294
|
+
{ name: "no_direct_todo_mutation", pattern: "reducerRequiredForTodoMutation|no direct TODO mutation|no_direct_todo_mutation", message: "Agent event output missing reducer/no-direct-TODO-mutation guard" },
|
|
295
|
+
{ name: "body_free", pattern: "bodyStored\s*[:=]\s*false|body-free|hash-only", message: "Agent event output missing body-free posture" },
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "prompt-pack.v1",
|
|
300
|
+
description: "Role-scoped prompt/context pack with bounded docs, skill refs, output contract, event policy, and body-free posture.",
|
|
301
|
+
agentNames: [],
|
|
302
|
+
required: [
|
|
303
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
304
|
+
{ name: "schema", pattern: "zob\.prompt-pack\.v1|prompt-pack\.v1", message: "Prompt pack output missing schema" },
|
|
305
|
+
{ name: "role_id", pattern: "roleId|role_id|role id", message: "Prompt pack output missing role id" },
|
|
306
|
+
{ name: "prompt_refs", pattern: "promptRefs|prompt_refs|prompt refs", message: "Prompt pack output missing prompt refs" },
|
|
307
|
+
{ name: "skill_refs", pattern: "skillRefs|skill_refs|skill refs", message: "Prompt pack output missing skill refs" },
|
|
308
|
+
{ name: "doc_refs", pattern: "docRefs|doc_refs|doc refs", message: "Prompt pack output missing doc refs" },
|
|
309
|
+
{ name: "output_contract", pattern: "outputContract|output_contract|output contract", message: "Prompt pack output missing output contract" },
|
|
310
|
+
{ name: "event_policy", pattern: "eventPolicy|event_policy|agent-event", message: "Prompt pack output missing event policy" },
|
|
311
|
+
{ name: "body_free", pattern: "bodyStored\s*[:=]\s*false|body-free|hash-only", message: "Prompt pack output missing body-free posture" },
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: "lead-plan.v1",
|
|
316
|
+
description: "Lead plan with worker contracts, risks, evidence needs, no-ship criteria, and model classes.",
|
|
317
|
+
agentNames: [],
|
|
318
|
+
required: [
|
|
319
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
320
|
+
{ name: "lead_id", pattern: "lead_id|leadId|lead id", message: "Lead plan output missing lead_id" },
|
|
321
|
+
{ name: "phase", pattern: "phase", message: "Lead plan output missing phase" },
|
|
322
|
+
{ name: "worker_contracts", pattern: "worker_contracts|workerContracts|worker contracts", message: "Lead plan output missing worker_contracts" },
|
|
323
|
+
{ name: "required_tools", pattern: "required_tools|requiredTools|required tools", message: "Lead plan output missing required_tools" },
|
|
324
|
+
{ name: "allowed_paths", pattern: "allowed_paths|allowedPaths|allowed paths", message: "Lead plan output missing allowed_paths" },
|
|
325
|
+
{ name: "forbidden_paths", pattern: "forbidden_paths|forbiddenPaths|forbidden paths", message: "Lead plan output missing forbidden_paths" },
|
|
326
|
+
{ name: "output_contract", pattern: "output_contract|outputContract|output contract", message: "Lead plan output missing output_contract" },
|
|
327
|
+
{ name: "model_class", pattern: "model_class|modelClass|model class", message: "Lead plan output missing model_class" },
|
|
328
|
+
{ name: "evidence_needed", pattern: "evidence_needed|evidenceNeeded|evidence needed", message: "Lead plan output missing evidence_needed" },
|
|
329
|
+
{ name: "no_ship_criteria", pattern: "no_ship_criteria|noShipCriteria|no ship criteria", message: "Lead plan output missing no_ship_criteria" },
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: "todo-child-result.v1",
|
|
334
|
+
description: "Parent-owned delegated TODO claim with child goal status, evidence, validation commands, risks, no_ship, and final marker.",
|
|
335
|
+
agentNames: [],
|
|
336
|
+
required: [
|
|
337
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
338
|
+
{ name: "todo_id", pattern: "todo_id|TODO_ID|todo id", message: "TODO child result missing todo_id" },
|
|
339
|
+
{ name: "child_goal_status", pattern: "child_goal_status\\s*[:=]\\s*(ready_for_oracle|incomplete|blocked)|child goal status", message: "TODO child result missing child_goal_status" },
|
|
340
|
+
{ name: "status_claim", pattern: "status_claim\\s*[:=]\\s*(done|incomplete|blocked)|status claim", message: "TODO child result missing status_claim" },
|
|
341
|
+
{ name: "evidence_refs", pattern: "evidence_refs|evidence refs|evidence", message: "TODO child result missing evidence_refs" },
|
|
342
|
+
{ name: "validation_commands", pattern: "validation_commands|validation commands|commands", message: "TODO child result missing validation_commands" },
|
|
343
|
+
{ name: "subtodo_delta_proposals", pattern: "subtodo_delta_proposals|subtodo delta proposals", message: "TODO child result missing subtodo_delta_proposals" },
|
|
344
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "TODO child result missing no_ship" },
|
|
345
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*TODO_CHILD_RESULT_END|TODO_CHILD_RESULT_END", message: "TODO child result missing FINAL_MARKER: TODO_CHILD_RESULT_END" },
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: "todo-child-result.v2",
|
|
350
|
+
description: "Parent-owned delegated TODO claim v2; no_ship is advisory/readiness evidence and does not make a delivered child result a runtime failure.",
|
|
351
|
+
agentNames: [],
|
|
352
|
+
required: [
|
|
353
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
354
|
+
{ name: "todo_id", pattern: "todo_id|TODO_ID|todo id", message: "TODO child result missing todo_id" },
|
|
355
|
+
{ name: "child_goal_status", pattern: "child_goal_status\\s*[:=]\\s*(ready_for_oracle|incomplete|blocked)|child goal status", message: "TODO child result missing child_goal_status" },
|
|
356
|
+
{ name: "status_claim", pattern: "status_claim\\s*[:=]\\s*(done|incomplete|blocked)|status claim", message: "TODO child result missing status_claim" },
|
|
357
|
+
{ name: "evidence_refs", pattern: "evidence_refs|evidence refs|evidence", message: "TODO child result missing evidence_refs" },
|
|
358
|
+
{ name: "validation_commands", pattern: "validation_commands|validation commands|commands", message: "TODO child result missing validation_commands" },
|
|
359
|
+
{ name: "acceptance_blockers", pattern: "acceptance_blockers|acceptance blockers", message: "TODO child result v2 missing acceptance_blockers" },
|
|
360
|
+
{ name: "target_readiness", pattern: "target_readiness\\s*[:=]\\s*(ready_for_parent_acceptance|needs_parent_review|blocked)|target readiness", message: "TODO child result v2 missing target_readiness" },
|
|
361
|
+
{ name: "subtodo_delta_proposals", pattern: "subtodo_delta_proposals|subtodo delta proposals", message: "TODO child result missing subtodo_delta_proposals" },
|
|
362
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "TODO child result missing no_ship" },
|
|
363
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*(TODO_CHILD_RESULT_V2_END|TODO_CHILD_RESULT_END)|TODO_CHILD_RESULT_V2_END|TODO_CHILD_RESULT_END", message: "TODO child result missing FINAL_MARKER: TODO_CHILD_RESULT_V2_END" },
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: "todo-claim-validation.v1",
|
|
368
|
+
description: "Oracle validation of a returned delegated TODO claim; parent runtime may auto-accept only on PASS and no_ship=false.",
|
|
369
|
+
agentNames: [],
|
|
370
|
+
required: [
|
|
371
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
372
|
+
{ name: "todo_id", pattern: "todo_id|TODO_ID|todo id", message: "TODO claim validation missing todo_id" },
|
|
373
|
+
{ name: "claim_hash", pattern: "claim_hash\\s*[:=]\\s*[a-fA-F0-9]{64}|claim hash", message: "TODO claim validation missing claim_hash" },
|
|
374
|
+
{ name: "verdict", pattern: "verdict\\s*[:=]\\s*(PASS|WARN|FAIL)|\\b(PASS|WARN|FAIL)\\b", message: "TODO claim validation missing PASS/WARN/FAIL verdict" },
|
|
375
|
+
{ name: "recommended_action", pattern: "recommended_action\\s*[:=]\\s*(accept_claim|needs_review|reject_claim|block)|recommended action", message: "TODO claim validation missing recommended_action" },
|
|
376
|
+
{ name: "evidence_refs", pattern: "evidence_refs|evidence refs|evidence", message: "TODO claim validation missing evidence_refs" },
|
|
377
|
+
{ name: "validation_commands", pattern: "validation_commands|validation commands|commands", message: "TODO claim validation missing validation_commands" },
|
|
378
|
+
{ name: "blocking_issues", pattern: "blocking_issues|blocking issues|blockers", message: "TODO claim validation missing blocking_issues" },
|
|
379
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "TODO claim validation missing no_ship" },
|
|
380
|
+
{ name: "confidence", pattern: "confidence\\s*[:=]\\s*(LOW|MEDIUM|HIGH)|confidence", message: "TODO claim validation missing confidence" },
|
|
381
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*TODO_CLAIM_VALIDATION_END|TODO_CLAIM_VALIDATION_END", message: "TODO claim validation missing FINAL_MARKER: TODO_CLAIM_VALIDATION_END" },
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
id: "todo-split-request.v1",
|
|
386
|
+
description: "Parent-owned TODO replan signal: a delegated child requests that its parent split an oversized TODO instead of forcing poor completion.",
|
|
387
|
+
agentNames: [],
|
|
388
|
+
required: [
|
|
389
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
390
|
+
{ name: "todo_id", pattern: "todo_id|TODO_ID|todo id", message: "TODO split request missing todo_id" },
|
|
391
|
+
{ name: "reason", pattern: "reason\\s*[:=]|reason|rationale", message: "TODO split request missing reason" },
|
|
392
|
+
{ name: "recommended_action", pattern: "recommended_action\\s*[:=]\\s*(split|replan|factory|needs_user|blocked)|recommended action", message: "TODO split request missing recommended_action" },
|
|
393
|
+
{ name: "proposed_subtodos", pattern: "proposed_subtodos|proposed subtodos|subtasks", message: "TODO split request missing proposed_subtodos" },
|
|
394
|
+
{ name: "risk_level", pattern: "risk_level\\s*[:=]\\s*(low|medium|high)|risk level", message: "TODO split request missing risk_level" },
|
|
395
|
+
{ name: "validation_plan", pattern: "validation_plan|validation plan", message: "TODO split request missing validation_plan" },
|
|
396
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "TODO split request missing no_ship" },
|
|
397
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*TODO_SPLIT_REQUEST_END|TODO_SPLIT_REQUEST_END", message: "TODO split request missing FINAL_MARKER: TODO_SPLIT_REQUEST_END" },
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: "delegation-request.v1",
|
|
402
|
+
description: "Governed parent-owned request for a future delegation. It is a request only: no child direct dispatch or parent TODO mutation.",
|
|
403
|
+
agentNames: [],
|
|
404
|
+
required: [
|
|
405
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
406
|
+
{ name: "request_type", pattern: "request_type\\s*[:=]\\s*DELEGATION_REQUEST\\.v1|DELEGATION_REQUEST\\.v1", message: "Delegation request missing request_type: DELEGATION_REQUEST.v1" },
|
|
407
|
+
{ name: "request_id", pattern: "request_id|request id", message: "Delegation request missing request_id" },
|
|
408
|
+
{ name: "requested_by", pattern: "requested_by|requested by", message: "Delegation request missing requested_by" },
|
|
409
|
+
{ name: "requested_action", pattern: "requested_action|requested action", message: "Delegation request missing requested_action" },
|
|
410
|
+
{ name: "body_hash", pattern: "body_hash\\s*[:=]\\s*[a-fA-F0-9]{64}|body hash", message: "Delegation request missing body_hash" },
|
|
411
|
+
{ name: "agent", pattern: "agent\\s*[:=]", message: "Delegation request missing agent" },
|
|
412
|
+
{ name: "risk_level", pattern: "risk_level\\s*[:=]\\s*(low|medium|high)|risk level", message: "Delegation request missing risk_level" },
|
|
413
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "Delegation request missing no_ship" },
|
|
414
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*DELEGATION_REQUEST_END|DELEGATION_REQUEST_END", message: "Delegation request missing FINAL_MARKER: DELEGATION_REQUEST_END" },
|
|
415
|
+
],
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: "oracle-request.v1",
|
|
419
|
+
description: "Governed parent-owned request for oracle review. It is visible metadata only and executes no oracle dispatch by itself.",
|
|
420
|
+
agentNames: [],
|
|
421
|
+
required: [
|
|
422
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
423
|
+
{ name: "request_type", pattern: "request_type\\s*[:=]\\s*ORACLE_REQUEST\\.v1|ORACLE_REQUEST\\.v1", message: "Oracle request missing request_type: ORACLE_REQUEST.v1" },
|
|
424
|
+
{ name: "request_id", pattern: "request_id|request id", message: "Oracle request missing request_id" },
|
|
425
|
+
{ name: "requested_by", pattern: "requested_by|requested by", message: "Oracle request missing requested_by" },
|
|
426
|
+
{ name: "requested_action", pattern: "requested_action|requested action", message: "Oracle request missing requested_action" },
|
|
427
|
+
{ name: "body_hash", pattern: "body_hash\\s*[:=]\\s*[a-fA-F0-9]{64}|body hash", message: "Oracle request missing body_hash" },
|
|
428
|
+
{ name: "risk_level", pattern: "risk_level\\s*[:=]\\s*(low|medium|high)|risk level", message: "Oracle request missing risk_level" },
|
|
429
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "Oracle request missing no_ship" },
|
|
430
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*ORACLE_REQUEST_END|ORACLE_REQUEST_END", message: "Oracle request missing FINAL_MARKER: ORACLE_REQUEST_END" },
|
|
431
|
+
],
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: "context-request.v1",
|
|
435
|
+
description: "Governed parent-owned request for bounded context. It is visible metadata only and performs no corpus/backend write or child dispatch.",
|
|
436
|
+
agentNames: [],
|
|
437
|
+
required: [
|
|
438
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
439
|
+
{ name: "request_type", pattern: "request_type\\s*[:=]\\s*CONTEXT_REQUEST\\.v1|CONTEXT_REQUEST\\.v1", message: "Context request missing request_type: CONTEXT_REQUEST.v1" },
|
|
440
|
+
{ name: "request_id", pattern: "request_id|request id", message: "Context request missing request_id" },
|
|
441
|
+
{ name: "requested_by", pattern: "requested_by|requested by", message: "Context request missing requested_by" },
|
|
442
|
+
{ name: "requested_action", pattern: "requested_action|requested action", message: "Context request missing requested_action" },
|
|
443
|
+
{ name: "body_hash", pattern: "body_hash\\s*[:=]\\s*[a-fA-F0-9]{64}|body hash", message: "Context request missing body_hash" },
|
|
444
|
+
{ name: "context_scope_id", pattern: "context_scope_id|context scope", message: "Context request missing context_scope_id" },
|
|
445
|
+
{ name: "risk_level", pattern: "risk_level\\s*[:=]\\s*(low|medium|high)|risk level", message: "Context request missing risk_level" },
|
|
446
|
+
{ name: "no_ship", pattern: "no_ship|no ship", message: "Context request missing no_ship" },
|
|
447
|
+
{ name: "final_marker", pattern: "FINAL_MARKER\\s*:\\s*CONTEXT_REQUEST_END|CONTEXT_REQUEST_END", message: "Context request missing FINAL_MARKER: CONTEXT_REQUEST_END" },
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: "guidance-steward.v1",
|
|
452
|
+
description: "Documentation/guidance steward output with layer docs, role doc packs, rule gaps, and proposal-only writebacks.",
|
|
453
|
+
agentNames: ["doc-steward", "guidance-steward"],
|
|
454
|
+
required: [
|
|
455
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
456
|
+
{ name: "documentation_policy", pattern: "documentation_policy|documentationPolicy|documentation policy", message: "Guidance steward output missing documentation_policy" },
|
|
457
|
+
{ name: "guidance_index", pattern: "guidance_index|guidanceIndex|guidance index", message: "Guidance steward output missing guidance_index" },
|
|
458
|
+
{ name: "layer_docs", pattern: "layer_docs|layer docs|AGENTS\.md", message: "Guidance steward output missing layer_docs" },
|
|
459
|
+
{ name: "role_doc_packs", pattern: "role_doc_packs|role doc packs|roleDocs", message: "Guidance steward output missing role_doc_packs" },
|
|
460
|
+
{ name: "writeback_proposals", pattern: "writeback_proposals|writeback proposals|proposal_only", message: "Guidance steward output missing writeback_proposals" },
|
|
461
|
+
{ name: "body_free", pattern: "bodyStored\s*[:=]\s*false|body-free|hash-only", message: "Guidance steward output missing body-free/hash-only posture" },
|
|
462
|
+
],
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
id: "temp-agent-card.v1",
|
|
466
|
+
description: "Run-scoped temporary agent card proposal. Proposal only; parent/governor validates before any temp agent joins a run.",
|
|
467
|
+
agentNames: ["temp-agent-creator", "agent-creator"],
|
|
468
|
+
required: [
|
|
469
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
470
|
+
{ name: "request_type", pattern: "AGENT_CREATE_REQUEST\.v1|request_type", message: "Temp agent card output missing AGENT_CREATE_REQUEST.v1" },
|
|
471
|
+
{ name: "temp_agent_card", pattern: "temp_agent_card|temp-agent-card|TempAgentCard", message: "Temp agent card output missing temp_agent_card" },
|
|
472
|
+
{ name: "run_id", pattern: "run_id|runId", message: "Temp agent card output missing run_id" },
|
|
473
|
+
{ name: "role", pattern: "role", message: "Temp agent card output missing role" },
|
|
474
|
+
{ name: "allowed_tools", pattern: "allowed_tools|allowedTools|allowed tools", message: "Temp agent card output missing allowed_tools" },
|
|
475
|
+
{ name: "forbidden_paths", pattern: "forbidden_paths|forbiddenPaths|forbidden paths", message: "Temp agent card output missing forbidden_paths" },
|
|
476
|
+
{ name: "output_contract", pattern: "output_contract|outputContract|output contract", message: "Temp agent card output missing output_contract" },
|
|
477
|
+
{ name: "model_class", pattern: "model_class|modelClass|model class", message: "Temp agent card output missing model_class" },
|
|
478
|
+
{ name: "expires_at", pattern: "expires_at|expiresAt", message: "Temp agent card output missing expires_at" },
|
|
479
|
+
{ name: "promotion_policy", pattern: "promotion_policy|promotion requires|promotionEligible", message: "Temp agent card output missing promotion_policy" },
|
|
480
|
+
{ name: "body_free", pattern: "bodyStored\s*[:=]\s*false|promptBodiesStored\s*[:=]\s*false|body-free|hash-only", message: "Temp agent card output missing body-free posture" },
|
|
481
|
+
],
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: "orchestration-profile.v1",
|
|
485
|
+
description: "Declarative orchestration profile with roles, edges, phases, model policy, and completion gates.",
|
|
486
|
+
agentNames: [],
|
|
487
|
+
required: [
|
|
488
|
+
...COMMON_OUTPUT_REQUIREMENTS,
|
|
489
|
+
{ name: "profile", pattern: "profile", message: "Orchestration profile output missing profile" },
|
|
490
|
+
{ name: "roles", pattern: "roles", message: "Orchestration profile output missing roles" },
|
|
491
|
+
{ name: "edges", pattern: "edges", message: "Orchestration profile output missing edges" },
|
|
492
|
+
{ name: "phases", pattern: "phases", message: "Orchestration profile output missing phases" },
|
|
493
|
+
{ name: "model_policy", pattern: "model_policy|modelPolicy|model policy", message: "Orchestration profile output missing model_policy" },
|
|
494
|
+
{ name: "output_contracts", pattern: "output_contracts|outputContracts|output contracts", message: "Orchestration profile output missing output_contracts" },
|
|
495
|
+
{ name: "tools", pattern: "tools", message: "Orchestration profile output missing tools" },
|
|
496
|
+
{ name: "paths", pattern: "paths", message: "Orchestration profile output missing paths" },
|
|
497
|
+
{ name: "final_report", pattern: "final_report|finalReport|final report", message: "Orchestration profile output missing final_report" },
|
|
498
|
+
{ name: "refusal_rules", pattern: "refusal_rules|refusalRules|refusal rules", message: "Orchestration profile output missing refusal_rules" },
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
];
|
|
502
|
+
|
|
503
|
+
const OUTPUT_CONTRACT_BY_ID = new Map(OUTPUT_CONTRACTS.map((contract) => [contract.id, contract]));
|
|
504
|
+
const OUTPUT_CONTRACT_BY_AGENT = new Map(
|
|
505
|
+
OUTPUT_CONTRACTS.flatMap((contract) => contract.agentNames.map((agentName) => [agentName.toLowerCase(), contract.id] as const)),
|
|
506
|
+
);
|
|
507
|
+
|
|
508
|
+
interface OutputContractValidationOptions {
|
|
509
|
+
repoRoot?: string;
|
|
510
|
+
maxArtifactBytes?: number;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const ARTIFACT_REF_REGEX = /(?:^|[\s("'`])((?:\.\/)?(?:reports|\.pi\/tmp|docs)\/[A-Za-z0-9._\/-]+\.(?:md|txt|json|jsonl))(?:$|[\s)"'`,.;:])/g;
|
|
514
|
+
const SAFE_ARTIFACT_EXTENSIONS = new Set([".md", ".txt", ".json", ".jsonl"]);
|
|
515
|
+
const DEFAULT_ARTIFACT_MAX_BYTES = 96 * 1024;
|
|
516
|
+
|
|
517
|
+
function escapeRegExp(value: string): string {
|
|
518
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function requirementAliasPattern(name: string): RegExp {
|
|
522
|
+
const snake = escapeRegExp(name);
|
|
523
|
+
const hyphen = escapeRegExp(name.replace(/_/g, "-"));
|
|
524
|
+
const spaced = escapeRegExp(name.replace(/_/g, " "));
|
|
525
|
+
return new RegExp(`(?:<${snake}>|<${hyphen}>|\\b${snake}\\b|\\b${hyphen}\\b|\\b${spaced}\\b)`, "i");
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function isInside(root: string, candidate: string): boolean {
|
|
529
|
+
const normalizedRoot = resolve(root);
|
|
530
|
+
const normalizedCandidate = resolve(candidate);
|
|
531
|
+
return normalizedCandidate === normalizedRoot || normalizedCandidate.startsWith(`${normalizedRoot}${sep}`);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function isSafeArtifactPath(repoRoot: string, candidate: string): boolean {
|
|
535
|
+
if (!isInside(repoRoot, candidate)) return false;
|
|
536
|
+
const relative = candidate.slice(resolve(repoRoot).length + 1).replace(/\\/g, "/");
|
|
537
|
+
if (!/^(reports|\.pi\/tmp|docs)\//.test(relative)) return false;
|
|
538
|
+
if (/(^|\/)(node_modules|dist|build)(\/|$)/.test(relative)) return false;
|
|
539
|
+
if (/(^|\/)(\.env|.*\.env|.*secret.*|.*credential.*|.*key.*)$/i.test(relative)) return false;
|
|
540
|
+
return SAFE_ARTIFACT_EXTENSIONS.has(extname(relative).toLowerCase());
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function extractArtifactRefs(output: string): string[] {
|
|
544
|
+
const refs = new Set<string>();
|
|
545
|
+
for (const match of output.matchAll(ARTIFACT_REF_REGEX)) {
|
|
546
|
+
const ref = match[1]?.replace(/^\.\//, "");
|
|
547
|
+
if (ref) refs.add(ref);
|
|
548
|
+
}
|
|
549
|
+
return [...refs];
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function readReferencedArtifacts(output: string, options: OutputContractValidationOptions): string[] {
|
|
553
|
+
if (!options.repoRoot) return [];
|
|
554
|
+
const artifacts: string[] = [];
|
|
555
|
+
const maxBytes = options.maxArtifactBytes ?? DEFAULT_ARTIFACT_MAX_BYTES;
|
|
556
|
+
for (const ref of extractArtifactRefs(output)) {
|
|
557
|
+
const candidate = resolve(options.repoRoot, ref);
|
|
558
|
+
if (!isSafeArtifactPath(options.repoRoot, candidate) || !existsSync(candidate)) continue;
|
|
559
|
+
const stat = statSync(candidate);
|
|
560
|
+
if (!stat.isFile() || stat.size > maxBytes) continue;
|
|
561
|
+
artifacts.push(readFileSync(candidate, "utf8"));
|
|
562
|
+
}
|
|
563
|
+
return artifacts;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function listOutputContracts(): string[] {
|
|
567
|
+
return OUTPUT_CONTRACTS.map((contract) => contract.id);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export function getOutputContractDefinitions(): Array<{ id: string; required: string[] }> {
|
|
571
|
+
return OUTPUT_CONTRACTS.map((contract) => ({ id: contract.id, required: contract.required.map((requirement) => requirement.name) }));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export function inferOutputContract(agentName: string): string {
|
|
575
|
+
return OUTPUT_CONTRACT_BY_AGENT.get(agentName.toLowerCase()) ?? "base.v1";
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export function validateOutputContractId(contractId: string | undefined): string[] {
|
|
579
|
+
if (!contractId) return [];
|
|
580
|
+
return OUTPUT_CONTRACT_BY_ID.has(contractId) ? [] : [`Unknown output contract '${contractId}'. Available: ${listOutputContracts().join(", ")}`];
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function extractDeliverableMarker(output: string): "yes" | "no" | undefined {
|
|
584
|
+
const finalLine = output.split(/\r?\n/).filter((line) => line.trim()).at(-1);
|
|
585
|
+
if (!finalLine) return undefined;
|
|
586
|
+
const normalized = finalLine.trim().replace(/^[-*]\s+/, "").replace(/^\d+\.\s+/, "");
|
|
587
|
+
const colonMarker = /^deliverable_delivered\s*:\s*(yes|no)\s*\.?$/i.exec(normalized);
|
|
588
|
+
const xmlMarker = /^<deliverable_delivered>\s*(yes|no)\s*<\/deliverable_delivered>\s*$/i.exec(normalized);
|
|
589
|
+
const value = colonMarker?.[1] ?? xmlMarker?.[1];
|
|
590
|
+
if (value?.toLowerCase() === "yes" || value?.toLowerCase() === "no") return value.toLowerCase() as "yes" | "no";
|
|
591
|
+
return undefined;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function extractAnyDeliverableMarker(output: string): "yes" | "no" | undefined {
|
|
595
|
+
const marker = /(?:^|\n)\s*(?:[-*]\s*)?(?:deliverable_delivered\s*:\s*(yes|no)|<deliverable_delivered>\s*(yes|no)\s*<\/deliverable_delivered>)\s*(?:\n|$)/i.exec(output);
|
|
596
|
+
const value = marker?.[1] ?? marker?.[2];
|
|
597
|
+
if (value?.toLowerCase() === "yes" || value?.toLowerCase() === "no") return value.toLowerCase() as "yes" | "no";
|
|
598
|
+
return undefined;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function validateOutputContractText(output: string, contract: OutputContract): string[] {
|
|
602
|
+
const trimmed = output.trim();
|
|
603
|
+
if (!trimmed) return ["Child produced no assistant output"];
|
|
604
|
+
|
|
605
|
+
const deliverableMarker = extractDeliverableMarker(trimmed);
|
|
606
|
+
const allowsEmbeddedDeliverable = ["todo-child-result.v1", "todo-child-result.v2", "todo-split-request.v1", "todo-claim-validation.v1", "delegation-request.v1", "oracle-request.v1", "context-request.v1"].includes(contract.id);
|
|
607
|
+
const embeddedDeliverableMarker = allowsEmbeddedDeliverable ? extractAnyDeliverableMarker(trimmed) : undefined;
|
|
608
|
+
const effectiveDeliverableMarker = embeddedDeliverableMarker ?? deliverableMarker;
|
|
609
|
+
const errors: string[] = [];
|
|
610
|
+
for (const requirement of contract.required) {
|
|
611
|
+
if (requirement.name === "deliverable_delivered") {
|
|
612
|
+
if (allowsEmbeddedDeliverable ? !embeddedDeliverableMarker : !deliverableMarker) errors.push(requirement.message);
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
let pattern: RegExp;
|
|
617
|
+
try {
|
|
618
|
+
pattern = new RegExp(requirement.pattern, "i");
|
|
619
|
+
} catch (error) {
|
|
620
|
+
errors.push(`Invalid output contract '${contract.id}' requirement '${requirement.name}': ${error instanceof Error ? error.message : String(error)}`);
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
const aliasPattern = requirementAliasPattern(requirement.name);
|
|
624
|
+
if (!pattern.test(trimmed) && !aliasPattern.test(trimmed)) errors.push(requirement.message);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (effectiveDeliverableMarker === "no") errors.push("Child reported deliverable_delivered: no");
|
|
628
|
+
|
|
629
|
+
return errors;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export function validateOutputContract(output: string, contractId: string, options: OutputContractValidationOptions = {}): string[] {
|
|
633
|
+
const trimmed = output.trim();
|
|
634
|
+
const contract = OUTPUT_CONTRACT_BY_ID.get(contractId);
|
|
635
|
+
if (!contract) return validateOutputContractId(contractId);
|
|
636
|
+
|
|
637
|
+
const directErrors = validateOutputContractText(trimmed, contract);
|
|
638
|
+
if (directErrors.length === 0) return [];
|
|
639
|
+
|
|
640
|
+
for (const artifact of readReferencedArtifacts(trimmed, options)) {
|
|
641
|
+
if (validateOutputContractText(artifact, contract).length === 0) return [];
|
|
642
|
+
if (validateOutputContractText(`${artifact}\n\n${trimmed}`, contract).length === 0) return [];
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
return directErrors;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export function validateChildOutput(result: ChildResult, contractId = result.outputContract ?? inferOutputContract(result.agent), options: OutputContractValidationOptions = {}): string[] {
|
|
649
|
+
return validateOutputContract(result.output, contractId, options);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export function applyChildGates(result: ChildResult, options: OutputContractValidationOptions = {}): ChildResult {
|
|
653
|
+
result.gateErrors = validateChildOutput(result, result.outputContract ?? inferOutputContract(result.agent), options);
|
|
654
|
+
result.gatePassed = result.gateErrors.length === 0;
|
|
655
|
+
return result;
|
|
656
|
+
}
|