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,223 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { READ_ONLY_QUEUE_JOB_TYPES } from "./queue.js";
|
|
5
|
+
import type { ChildStopCondition } from "./types.js";
|
|
6
|
+
import { sha256 } from "./utils/hashing.js";
|
|
7
|
+
import { parseJsonFile } from "./utils/json.js";
|
|
8
|
+
import { safeFileStem } from "./utils/paths.js";
|
|
9
|
+
import { isRecord } from "./utils/records.js";
|
|
10
|
+
|
|
11
|
+
export interface DaemonPolicyReadinessAuditInput {
|
|
12
|
+
run_id?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const FORBIDDEN_DAEMON_POLICY_BODY_KEYS = new Set(["task", "prompt", "output", "body", "content", "patch", "diff"]);
|
|
16
|
+
const REQUIRED_DISABLED_FLAGS = [
|
|
17
|
+
"daemonEnabled",
|
|
18
|
+
"alwaysOnDaemonEnabled",
|
|
19
|
+
"autoStartDaemon",
|
|
20
|
+
"continuousLoop",
|
|
21
|
+
"cronEnabled",
|
|
22
|
+
"budgetEnforced",
|
|
23
|
+
"strictEnabled",
|
|
24
|
+
"wouldBlockDispatch",
|
|
25
|
+
"modelRouterUsed",
|
|
26
|
+
"routingApplied",
|
|
27
|
+
"childDispatchAllowed",
|
|
28
|
+
"liveChildExecution",
|
|
29
|
+
"networkAccessed",
|
|
30
|
+
"writeAdaptersEnabled",
|
|
31
|
+
"productionWritesPerformed",
|
|
32
|
+
"autoApply",
|
|
33
|
+
"bodyStored",
|
|
34
|
+
"promptBodiesStored",
|
|
35
|
+
"outputBodiesStored",
|
|
36
|
+
];
|
|
37
|
+
const REQUIRED_DISALLOWED_ADAPTERS = ["write", "edit", "github", "browser", "cloud", "web", "deploy", "publish"];
|
|
38
|
+
const ALL_STOP_CONDITIONS: ChildStopCondition[] = [
|
|
39
|
+
"none",
|
|
40
|
+
"failed_preflight",
|
|
41
|
+
"incomplete_no_assistant_turn",
|
|
42
|
+
"incomplete_no_evidence",
|
|
43
|
+
"failed_validation",
|
|
44
|
+
"timeout",
|
|
45
|
+
"blocked",
|
|
46
|
+
"scope_violation",
|
|
47
|
+
"agentic_failed",
|
|
48
|
+
"oracle_fail",
|
|
49
|
+
"no_ship",
|
|
50
|
+
"fail_loop",
|
|
51
|
+
];
|
|
52
|
+
const REQUIRED_TERMINAL_STOP_CONDITIONS = ALL_STOP_CONDITIONS.filter((condition) => condition !== "none");
|
|
53
|
+
|
|
54
|
+
function hasForbiddenBodyKeys(value: unknown): boolean {
|
|
55
|
+
if (!value || typeof value !== "object") return false;
|
|
56
|
+
if (Array.isArray(value)) return value.some(hasForbiddenBodyKeys);
|
|
57
|
+
return Object.entries(value as Record<string, unknown>).some(([key, child]) => FORBIDDEN_DAEMON_POLICY_BODY_KEYS.has(key) || hasForbiddenBodyKeys(child));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function stringArray(value: unknown): string[] | undefined {
|
|
61
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function sameStringSet(actual: string[] | undefined, expected: string[]): boolean {
|
|
65
|
+
if (!actual) return false;
|
|
66
|
+
return JSON.stringify([...actual].sort()) === JSON.stringify([...expected].sort());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function readinessCheck(name: string, passed: boolean, detail: Record<string, unknown> = {}): Record<string, unknown> {
|
|
70
|
+
return { name, passed, detail };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function validateDaemonPolicyConfig(repoRoot: string): Record<string, unknown> {
|
|
74
|
+
const configPath = join(repoRoot, ".pi", "daemon-policy.json");
|
|
75
|
+
const errors: string[] = [];
|
|
76
|
+
let parsed: Record<string, unknown> | undefined;
|
|
77
|
+
let configHash: string | undefined;
|
|
78
|
+
if (!existsSync(configPath)) {
|
|
79
|
+
errors.push(".pi/daemon-policy.json is missing");
|
|
80
|
+
} else {
|
|
81
|
+
try {
|
|
82
|
+
const raw = readFileSync(configPath, "utf8");
|
|
83
|
+
configHash = sha256(raw);
|
|
84
|
+
const value = parseJsonFile(configPath);
|
|
85
|
+
if (!isRecord(value)) errors.push("daemon policy config must be a JSON object");
|
|
86
|
+
else parsed = value;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
errors.push(`daemon policy config could not be parsed: ${error instanceof Error ? error.message : String(error)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const allowedJobTypes = stringArray(parsed?.allowedJobTypes);
|
|
93
|
+
const allowedStopConditions = stringArray(parsed?.allowedStopConditions);
|
|
94
|
+
const requiredStopConditions = stringArray(parsed?.requiredStopConditions);
|
|
95
|
+
const disallowedAdapters = stringArray(parsed?.disallowedAdapters);
|
|
96
|
+
const futureAlwaysOnPrerequisites = stringArray(parsed?.futureAlwaysOnPrerequisites);
|
|
97
|
+
|
|
98
|
+
if (parsed) {
|
|
99
|
+
if (parsed.schema !== "zob.daemon-policy.v1") errors.push("daemon policy schema must be zob.daemon-policy.v1");
|
|
100
|
+
if (parsed.mode !== "manual_one_shot_readonly") errors.push("daemon policy mode must remain manual_one_shot_readonly");
|
|
101
|
+
for (const flag of REQUIRED_DISABLED_FLAGS) {
|
|
102
|
+
if (parsed[flag] !== false) errors.push(`daemon policy must keep ${flag}=false`);
|
|
103
|
+
}
|
|
104
|
+
if (parsed.noExecution !== true) errors.push("daemon policy must keep noExecution=true");
|
|
105
|
+
if (parsed.maxWorkersDefault !== 1) errors.push("daemon policy maxWorkersDefault must remain 1");
|
|
106
|
+
if (parsed.maxWorkersMax !== 1) errors.push("daemon policy maxWorkersMax must remain 1");
|
|
107
|
+
if (parsed.claimAtMostOneJobPerTick !== true) errors.push("daemon policy must claim at most one job per tick");
|
|
108
|
+
if (!sameStringSet(allowedJobTypes, READ_ONLY_QUEUE_JOB_TYPES)) errors.push("daemon policy allowedJobTypes must match READ_ONLY_QUEUE_JOB_TYPES");
|
|
109
|
+
if (!sameStringSet(disallowedAdapters, REQUIRED_DISALLOWED_ADAPTERS)) errors.push("daemon policy disallowedAdapters must match required unsafe adapters");
|
|
110
|
+
if (!sameStringSet(allowedStopConditions, ALL_STOP_CONDITIONS)) errors.push("daemon policy allowedStopConditions must cover all known child stop conditions");
|
|
111
|
+
if (!sameStringSet(requiredStopConditions, REQUIRED_TERMINAL_STOP_CONDITIONS)) errors.push("daemon policy requiredStopConditions must cover all terminal stop conditions");
|
|
112
|
+
if (!futureAlwaysOnPrerequisites || futureAlwaysOnPrerequisites.length === 0) errors.push("daemon policy requires futureAlwaysOnPrerequisites string array");
|
|
113
|
+
if (hasForbiddenBodyKeys(parsed)) errors.push("daemon policy must not store raw task/prompt/output/body/content/patch/diff fields");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
schema: "zob.daemon-policy-validation.v1",
|
|
118
|
+
path: ".pi/daemon-policy.json",
|
|
119
|
+
present: existsSync(configPath),
|
|
120
|
+
valid: errors.length === 0,
|
|
121
|
+
errors,
|
|
122
|
+
configHash,
|
|
123
|
+
mode: parsed?.mode,
|
|
124
|
+
allowedJobTypes: allowedJobTypes ?? [],
|
|
125
|
+
disallowedAdapters: disallowedAdapters ?? [],
|
|
126
|
+
allowedStopConditions: allowedStopConditions ?? [],
|
|
127
|
+
requiredStopConditions: requiredStopConditions ?? [],
|
|
128
|
+
futureAlwaysOnPrerequisitesCount: futureAlwaysOnPrerequisites?.length ?? 0,
|
|
129
|
+
maxWorkersDefault: parsed?.maxWorkersDefault,
|
|
130
|
+
maxWorkersMax: parsed?.maxWorkersMax,
|
|
131
|
+
claimAtMostOneJobPerTick: parsed?.claimAtMostOneJobPerTick === true,
|
|
132
|
+
daemonEnabled: parsed?.daemonEnabled === true,
|
|
133
|
+
alwaysOnDaemonEnabled: parsed?.alwaysOnDaemonEnabled === true,
|
|
134
|
+
autoStartDaemon: parsed?.autoStartDaemon === true,
|
|
135
|
+
continuousLoop: parsed?.continuousLoop === true,
|
|
136
|
+
cronEnabled: parsed?.cronEnabled === true,
|
|
137
|
+
budgetEnforced: parsed?.budgetEnforced === true,
|
|
138
|
+
strictEnabled: parsed?.strictEnabled === true,
|
|
139
|
+
wouldBlockDispatch: parsed?.wouldBlockDispatch === true,
|
|
140
|
+
modelRouterUsed: parsed?.modelRouterUsed === true,
|
|
141
|
+
routingApplied: parsed?.routingApplied === true,
|
|
142
|
+
childDispatchAllowed: parsed?.childDispatchAllowed === true,
|
|
143
|
+
liveChildExecution: parsed?.liveChildExecution === true,
|
|
144
|
+
networkAccessed: parsed?.networkAccessed === true,
|
|
145
|
+
writeAdaptersEnabled: parsed?.writeAdaptersEnabled === true,
|
|
146
|
+
productionWritesPerformed: parsed?.productionWritesPerformed === true,
|
|
147
|
+
autoApply: parsed?.autoApply === true,
|
|
148
|
+
noExecution: parsed?.noExecution === true,
|
|
149
|
+
bodyStored: false,
|
|
150
|
+
promptBodiesStored: false,
|
|
151
|
+
outputBodiesStored: false,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function buildDaemonPolicyReadinessAudit(repoRoot: string, input: DaemonPolicyReadinessAuditInput = {}): Record<string, unknown> {
|
|
156
|
+
const configValidation = validateDaemonPolicyConfig(repoRoot);
|
|
157
|
+
const checks = [
|
|
158
|
+
readinessCheck("daemon_policy_config_valid", configValidation.present === true && configValidation.valid === true, { configHash: configValidation.configHash, errors: configValidation.errors }),
|
|
159
|
+
readinessCheck("manual_one_shot_readonly_policy", configValidation.mode === "manual_one_shot_readonly" && configValidation.claimAtMostOneJobPerTick === true, { mode: configValidation.mode, claimAtMostOneJobPerTick: configValidation.claimAtMostOneJobPerTick }),
|
|
160
|
+
readinessCheck("one_worker_policy", configValidation.maxWorkersDefault === 1 && configValidation.maxWorkersMax === 1, { maxWorkersDefault: configValidation.maxWorkersDefault, maxWorkersMax: configValidation.maxWorkersMax }),
|
|
161
|
+
readinessCheck("read_only_job_types_match_queue_registry", sameStringSet(configValidation.allowedJobTypes as string[], READ_ONLY_QUEUE_JOB_TYPES), { allowedJobTypes: configValidation.allowedJobTypes, queueJobTypes: READ_ONLY_QUEUE_JOB_TYPES }),
|
|
162
|
+
readinessCheck("terminal_stop_conditions_registered", sameStringSet(configValidation.requiredStopConditions as string[], REQUIRED_TERMINAL_STOP_CONDITIONS), { requiredStopConditions: configValidation.requiredStopConditions }),
|
|
163
|
+
readinessCheck("daemon_activation_flags_disabled", REQUIRED_DISABLED_FLAGS.every((flag) => configValidation[flag] === false) && configValidation.noExecution === true, { disabledFlags: REQUIRED_DISABLED_FLAGS }),
|
|
164
|
+
readinessCheck("always_on_daemon_integration_implemented", false, { reason: "always-on daemon/cron runner is intentionally not implemented or enabled yet" }),
|
|
165
|
+
];
|
|
166
|
+
const failedChecks = checks.filter((check) => check.passed !== true).map((check) => check.name);
|
|
167
|
+
const auditPassed = checks
|
|
168
|
+
.filter((check) => check.name !== "always_on_daemon_integration_implemented")
|
|
169
|
+
.every((check) => check.passed === true);
|
|
170
|
+
const report = {
|
|
171
|
+
schema: "zob.daemon-policy-readiness-audit.v1",
|
|
172
|
+
runId: input.run_id,
|
|
173
|
+
auditPassed,
|
|
174
|
+
readiness: failedChecks.length === 0 ? "ready_for_future_always_on_daemon_review" : "blocked_for_always_on_daemon",
|
|
175
|
+
readyForManualOneShotOnly: auditPassed,
|
|
176
|
+
alwaysOnDaemonReady: false,
|
|
177
|
+
alwaysOnDaemonNoShip: true,
|
|
178
|
+
alwaysOnDaemonBlockers: [
|
|
179
|
+
"always-on daemon/cron runner is not implemented",
|
|
180
|
+
"daemon autostart remains disabled",
|
|
181
|
+
"continuous loop remains disabled",
|
|
182
|
+
"strict budget enforcement is not integrated with dispatch blocking",
|
|
183
|
+
"live model routing is not integrated",
|
|
184
|
+
"oracle review and explicit approval are required before daemon autostart",
|
|
185
|
+
],
|
|
186
|
+
checks,
|
|
187
|
+
failedChecks,
|
|
188
|
+
config: configValidation,
|
|
189
|
+
maxWorkersDefault: 1,
|
|
190
|
+
maxWorkersMax: 1,
|
|
191
|
+
claimAtMostOneJobPerTick: true,
|
|
192
|
+
autoStartDaemon: false,
|
|
193
|
+
continuousLoop: false,
|
|
194
|
+
daemonStarted: false,
|
|
195
|
+
cronEnabled: false,
|
|
196
|
+
budgetEnforced: false,
|
|
197
|
+
strictEnabled: false,
|
|
198
|
+
wouldBlockDispatch: false,
|
|
199
|
+
modelRouterUsed: false,
|
|
200
|
+
routingApplied: false,
|
|
201
|
+
childDispatchAllowed: false,
|
|
202
|
+
liveChildExecution: false,
|
|
203
|
+
networkAccessed: false,
|
|
204
|
+
writeAdaptersEnabled: false,
|
|
205
|
+
productionWritesPerformed: false,
|
|
206
|
+
autoApply: false,
|
|
207
|
+
noExecution: true,
|
|
208
|
+
bodyStored: false,
|
|
209
|
+
promptBodiesStored: false,
|
|
210
|
+
outputBodiesStored: false,
|
|
211
|
+
generatedAt: new Date().toISOString(),
|
|
212
|
+
};
|
|
213
|
+
if (hasForbiddenBodyKeys(report)) throw new Error("Daemon policy readiness audit would store forbidden body keys");
|
|
214
|
+
return report;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function writeDaemonPolicyReadinessAuditReport(repoRoot: string, runId = "daemon-policy-readiness", input: DaemonPolicyReadinessAuditInput = {}): string {
|
|
218
|
+
const dir = join(repoRoot, ".pi", "logs", "daemon-readiness");
|
|
219
|
+
mkdirSync(dir, { recursive: true });
|
|
220
|
+
const outputPath = join(dir, `${safeFileStem(runId)}.json`);
|
|
221
|
+
writeFileSync(outputPath, JSON.stringify(buildDaemonPolicyReadinessAudit(repoRoot, { ...input, run_id: runId }), null, 2), "utf8");
|
|
222
|
+
return outputPath;
|
|
223
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { evaluateBudgetPreflightDryRun } from "./chronicle.js";
|
|
5
|
+
import { validateDaemonPolicyConfig } from "./daemon-policy.js";
|
|
6
|
+
import { evaluateModelRoutingDryRun } from "./model-routing.js";
|
|
7
|
+
import { buildQueueDashboardSummary, ensureQueueDirs, READ_ONLY_QUEUE_JOB_TYPES, validateReadOnlyQueueJob } from "./queue.js";
|
|
8
|
+
import { sha256 } from "./utils/hashing.js";
|
|
9
|
+
import { parseJsonFile } from "./utils/json.js";
|
|
10
|
+
import { safeFileStem } from "./utils/paths.js";
|
|
11
|
+
import { isRecord } from "./utils/records.js";
|
|
12
|
+
|
|
13
|
+
export interface DaemonReadinessDryRunInput {
|
|
14
|
+
run_id?: string;
|
|
15
|
+
maxWorkers?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function pendingQueueJobSummaries(repoRoot: string): Array<Record<string, unknown>> {
|
|
19
|
+
const paths = ensureQueueDirs(repoRoot);
|
|
20
|
+
const pending = readdirSync(paths.pending).filter((file) => file.endsWith(".json")).sort();
|
|
21
|
+
return pending.map((fileName) => {
|
|
22
|
+
const filePath = join(paths.pending, fileName);
|
|
23
|
+
let parsed: unknown;
|
|
24
|
+
let parseError: string | undefined;
|
|
25
|
+
let raw = "";
|
|
26
|
+
try {
|
|
27
|
+
raw = readFileSync(filePath, "utf8");
|
|
28
|
+
parsed = parseJsonFile(filePath);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
31
|
+
}
|
|
32
|
+
const validationErrors = parseError ? [`could not parse queue job: ${parseError}`] : validateReadOnlyQueueJob(repoRoot, parsed);
|
|
33
|
+
const record = isRecord(parsed) ? parsed : {};
|
|
34
|
+
return {
|
|
35
|
+
fileName,
|
|
36
|
+
jobHash: sha256(raw),
|
|
37
|
+
id: typeof record.id === "string" ? record.id : undefined,
|
|
38
|
+
type: typeof record.type === "string" ? record.type : undefined,
|
|
39
|
+
readOnly: record.readOnly === true,
|
|
40
|
+
pathCount: Array.isArray(record.paths) ? record.paths.length : 0,
|
|
41
|
+
adapterCount: Array.isArray(record.adapters) ? record.adapters.length : 0,
|
|
42
|
+
valid: validationErrors.length === 0,
|
|
43
|
+
validationErrors,
|
|
44
|
+
bodyStored: false,
|
|
45
|
+
promptBodiesStored: false,
|
|
46
|
+
outputBodiesStored: false,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function readinessCheck(name: string, passed: boolean, detail: Record<string, unknown> = {}): Record<string, unknown> {
|
|
52
|
+
return { name, passed, detail };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function buildDaemonReadinessDryRun(repoRoot: string, input: DaemonReadinessDryRunInput = {}): Record<string, unknown> {
|
|
56
|
+
const maxWorkers = input.maxWorkers ?? 1;
|
|
57
|
+
const queuePaths = ensureQueueDirs(repoRoot);
|
|
58
|
+
const pendingJobs = pendingQueueJobSummaries(repoRoot);
|
|
59
|
+
const invalidPendingJobs = pendingJobs.filter((job) => job.valid !== true);
|
|
60
|
+
const queueDashboard = buildQueueDashboardSummary(repoRoot);
|
|
61
|
+
const budget = evaluateBudgetPreflightDryRun({ runs: 1, parallelChildren: maxWorkers, caps: { maxParallelChildren: 1 }, strictRequested: false });
|
|
62
|
+
const modelRouting = evaluateModelRoutingDryRun({ mode: "factory", taskType: "read-only-queue-daemon-dry-run", risk: "medium", estimatedRuns: 1, estimatedParallelChildren: maxWorkers, caps: { maxParallelChildren: 1 } });
|
|
63
|
+
const daemonPolicy = validateDaemonPolicyConfig(repoRoot);
|
|
64
|
+
|
|
65
|
+
const checks = [
|
|
66
|
+
readinessCheck("queue_dirs_ready", [queuePaths.pending, queuePaths.running, queuePaths.done, queuePaths.failed].every((path) => existsSync(path)), { root: queuePaths.root }),
|
|
67
|
+
readinessCheck("read_only_job_types_registered", READ_ONLY_QUEUE_JOB_TYPES.length > 0, { jobTypes: READ_ONLY_QUEUE_JOB_TYPES }),
|
|
68
|
+
readinessCheck("daemon_policy_config_valid", daemonPolicy.present === true && daemonPolicy.valid === true && daemonPolicy.alwaysOnDaemonEnabled === false && daemonPolicy.autoStartDaemon === false && daemonPolicy.continuousLoop === false && daemonPolicy.noExecution === true, { configHash: daemonPolicy.configHash, errors: daemonPolicy.errors }),
|
|
69
|
+
readinessCheck("pending_jobs_readonly_valid", invalidPendingJobs.length === 0, { pending: pendingJobs.length, invalid: invalidPendingJobs.length }),
|
|
70
|
+
readinessCheck("one_worker_default", maxWorkers === 1, { maxWorkers }),
|
|
71
|
+
readinessCheck("controlled_scheduler_controls_available", true, { leases: true, heartbeat: true, staleRecovery: true, killSwitchPath: ".pi/queue/KILL_SWITCH", maxRetries: 1, claimAtMostOneJobPerTick: true }),
|
|
72
|
+
readinessCheck("budget_advisory_nonblocking", budget.budgetEnforced === false && budget.wouldBlockDispatch === false && budget.childDispatchAllowed === false, { wouldExceed: budget.wouldExceed, failures: budget.failures }),
|
|
73
|
+
readinessCheck("model_routing_dry_run_only", modelRouting.modelRouterUsed === false && modelRouting.routingApplied === false && modelRouting.childDispatchAllowed === false, { recommendedModelClass: modelRouting.recommendedModelClass }),
|
|
74
|
+
readinessCheck("no_autostart_no_loop", true, { autoStartDaemon: false, continuousLoop: false, daemonStarted: false }),
|
|
75
|
+
];
|
|
76
|
+
const failedChecks = checks.filter((check) => check.passed !== true).map((check) => check.name);
|
|
77
|
+
const readyForManualOneShot = failedChecks.length === 0;
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
schema: "zob.daemon-readiness-dry-run.v1",
|
|
81
|
+
runId: input.run_id,
|
|
82
|
+
readiness: readyForManualOneShot ? "ready_for_manual_one_shot" : "blocked_preflight",
|
|
83
|
+
readyForManualOneShot,
|
|
84
|
+
no_ship: !readyForManualOneShot,
|
|
85
|
+
checks,
|
|
86
|
+
failedChecks,
|
|
87
|
+
queue: {
|
|
88
|
+
paths: queuePaths,
|
|
89
|
+
dashboard: queueDashboard,
|
|
90
|
+
pendingJobs,
|
|
91
|
+
controlPlane: {
|
|
92
|
+
schema: "zob.queue-daemon-control-plane.v1",
|
|
93
|
+
leaseMs: 30000,
|
|
94
|
+
heartbeatFile: ".pi/queue/heartbeat.json",
|
|
95
|
+
killSwitchPath: ".pi/queue/KILL_SWITCH",
|
|
96
|
+
staleRunningJobRecovery: true,
|
|
97
|
+
maxWorkers: 1,
|
|
98
|
+
maxRetries: 1,
|
|
99
|
+
claimAtMostOneJobPerTick: true,
|
|
100
|
+
autoStartDaemon: false,
|
|
101
|
+
continuousLoop: false,
|
|
102
|
+
bodyStored: false,
|
|
103
|
+
promptBodiesStored: false,
|
|
104
|
+
outputBodiesStored: false,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
daemonPolicy,
|
|
108
|
+
budget,
|
|
109
|
+
modelRouting,
|
|
110
|
+
maxWorkers,
|
|
111
|
+
autoStartDaemon: false,
|
|
112
|
+
continuousLoop: false,
|
|
113
|
+
daemonStarted: false,
|
|
114
|
+
childDispatchAllowed: false,
|
|
115
|
+
liveChildExecution: false,
|
|
116
|
+
networkAccessed: false,
|
|
117
|
+
writeAdaptersEnabled: false,
|
|
118
|
+
budgetEnforced: false,
|
|
119
|
+
modelRouterUsed: false,
|
|
120
|
+
noExecution: true,
|
|
121
|
+
bodyStored: false,
|
|
122
|
+
promptBodiesStored: false,
|
|
123
|
+
outputBodiesStored: false,
|
|
124
|
+
generatedAt: new Date().toISOString(),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function writeDaemonReadinessDryRunReport(repoRoot: string, runId = "daemon-readiness", input: DaemonReadinessDryRunInput = {}): string {
|
|
129
|
+
const dir = join(repoRoot, ".pi", "logs", "daemon-readiness");
|
|
130
|
+
mkdirSync(dir, { recursive: true });
|
|
131
|
+
const outputPath = join(dir, `${safeFileStem(runId)}.json`);
|
|
132
|
+
writeFileSync(outputPath, JSON.stringify(buildDaemonReadinessDryRun(repoRoot, { ...input, run_id: runId }), null, 2), "utf8");
|
|
133
|
+
return outputPath;
|
|
134
|
+
}
|