zob-harness 0.2.0 → 0.3.1
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/capabilities/zob-public-runtime-capabilities.json +4 -4
- package/.pi/extensions/zob-child-safety/AGENTS.md +12 -0
- package/.pi/extensions/zob-child-safety/index.ts +4 -105
- package/.pi/extensions/zob-child-safety/src/AGENTS.md +10 -0
- package/.pi/extensions/zob-child-safety/src/policy.ts +106 -0
- package/.pi/extensions/zob-harness/AGENTS.md +2 -0
- package/.pi/extensions/zob-harness/index.ts +94 -94
- package/.pi/extensions/zob-harness/src/AGENTS.md +4 -0
- package/.pi/extensions/zob-harness/src/core/AGENTS.md +24 -0
- package/.pi/extensions/zob-harness/src/{constants.ts → core/constants.ts} +10 -1
- package/.pi/extensions/zob-harness/src/core/utils/AGENTS.md +23 -0
- package/.pi/extensions/zob-harness/src/{utils → core/utils}/formatting.ts +1 -1
- package/.pi/extensions/zob-harness/src/{utils → core/utils}/records.ts +1 -1
- package/.pi/extensions/zob-harness/src/{utils → core/utils}/resources.ts +1 -1
- package/.pi/extensions/zob-harness/src/domains/AGENTS.md +23 -0
- package/.pi/extensions/zob-harness/src/domains/autonomy/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{autonomous-runtime.ts → domains/autonomy/autonomous-runtime.ts} +22 -22
- package/.pi/extensions/zob-harness/src/{autonomy-readiness.ts → domains/autonomy/autonomy-readiness.ts} +18 -18
- package/.pi/extensions/zob-harness/src/{daemon-policy.ts → domains/autonomy/daemon-policy.ts} +6 -6
- package/.pi/extensions/zob-harness/src/{daemon-readiness.ts → domains/autonomy/daemon-readiness.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{daemon-runtime.ts → domains/autonomy/daemon-runtime.ts} +2 -2
- package/.pi/extensions/zob-harness/src/{full-autonomy-test.ts → domains/autonomy/full-autonomy-test.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{interactive-autonomy.ts → domains/autonomy/interactive-autonomy.ts} +2 -2
- package/.pi/extensions/zob-harness/src/{compute-profile.ts → domains/compute/compute-profile.ts} +3 -3
- package/.pi/extensions/zob-harness/src/{compute-workflow-shape.ts → domains/compute/compute-workflow-shape.ts} +3 -3
- package/.pi/extensions/zob-harness/src/domains/coms/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/envelope.ts +2 -2
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/identity.ts +3 -3
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/ledger-bridge.ts +2 -2
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/local-transport.ts +1 -1
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/policy.ts +3 -3
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/presence.ts +1 -1
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/registry.ts +47 -4
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/response-capture.ts +1 -1
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/transcript-capture.ts +2 -2
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/zpeer-profile.ts +3 -3
- package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/zpeer.ts +35 -7
- package/.pi/extensions/zob-harness/src/{mission-control.ts → domains/coms/mission-control.ts} +12 -9
- package/.pi/extensions/zob-harness/src/{zagents.ts → domains/coms/zagents.ts} +86 -4
- package/.pi/extensions/zob-harness/src/domains/context/AGENTS.md +20 -0
- package/.pi/extensions/zob-harness/src/{context-gbrain.ts → domains/context/context-gbrain.ts} +4 -4
- package/.pi/extensions/zob-harness/src/domains/delegation/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{agents.ts → domains/delegation/agents.ts} +2 -2
- package/.pi/extensions/zob-harness/src/{capabilities.ts → domains/delegation/capabilities.ts} +6 -6
- package/.pi/extensions/zob-harness/src/{child-runner.ts → domains/delegation/child-runner.ts} +8 -8
- package/.pi/extensions/zob-harness/src/{output-contracts.ts → domains/delegation/output-contracts.ts} +1 -1
- package/.pi/extensions/zob-harness/src/{prompt-packs.ts → domains/delegation/prompt-packs.ts} +4 -4
- package/.pi/extensions/zob-harness/src/domains/factory/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{factory → domains/factory}/agentic-plan.ts +1 -1
- package/.pi/extensions/zob-harness/src/{factory-selector.ts → domains/factory/factory-selector.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{factory → domains/factory}/quarantine.ts +5 -5
- package/.pi/extensions/zob-harness/src/{factory → domains/factory}/run.ts +5 -5
- package/.pi/extensions/zob-harness/src/{factory → domains/factory}/validation.ts +10 -10
- package/.pi/extensions/zob-harness/src/domains/git/AGENTS.md +20 -0
- package/.pi/extensions/zob-harness/src/{git-ops.ts → domains/git/git-ops.ts} +3 -3
- package/.pi/extensions/zob-harness/src/domains/goal/AGENTS.md +22 -0
- package/.pi/extensions/zob-harness/src/{goal-room.ts → domains/goal/goal-room.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{goal-todo-imports.ts → domains/goal/goal-todo-imports.ts} +1 -1
- package/.pi/extensions/zob-harness/src/{goal-todo-types.ts → domains/goal/goal-todo-types.ts} +1 -1
- package/.pi/extensions/zob-harness/src/{goal-todos.ts → domains/goal/goal-todos.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{goal.ts → domains/goal/goal.ts} +1 -1
- package/.pi/extensions/zob-harness/src/domains/governance/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{budget-policy.ts → domains/governance/budget-policy.ts} +6 -6
- package/.pi/extensions/zob-harness/src/{governed-requests.ts → domains/governance/governed-requests.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{launch-apply.ts → domains/governance/launch-apply.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{merge-queue.ts → domains/governance/merge-queue.ts} +6 -6
- package/.pi/extensions/zob-harness/src/{rules.ts → domains/governance/rules.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{safety.ts → domains/governance/safety.ts} +3 -3
- package/.pi/extensions/zob-harness/src/{sandbox.ts → domains/governance/sandbox.ts} +5 -5
- package/.pi/extensions/zob-harness/src/{worker-pool.ts → domains/governance/worker-pool.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{workspace-claims.ts → domains/governance/workspace-claims.ts} +6 -6
- package/.pi/extensions/zob-harness/src/domains/models/AGENTS.md +20 -0
- package/.pi/extensions/zob-harness/src/{model-availability.ts → domains/models/model-availability.ts} +1 -1
- package/.pi/extensions/zob-harness/src/{model-routing.ts → domains/models/model-routing.ts} +6 -6
- package/.pi/extensions/zob-harness/src/domains/orchestration/AGENTS.md +21 -0
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/adaptive-delegation.ts +8 -8
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/adaptive-workflow.ts +4 -4
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/lead-plan.ts +5 -5
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/plan.ts +5 -5
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/room.ts +4 -4
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/run.ts +6 -6
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/supervised-readonly.ts +6 -6
- package/.pi/extensions/zob-harness/src/{orchestration → domains/orchestration}/widget-readers.ts +2 -2
- package/.pi/extensions/zob-harness/src/domains/project-dna/AGENTS.md +19 -0
- package/.pi/extensions/zob-harness/src/{project-dna.ts → domains/project-dna/project-dna.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/candidate.ts +5 -5
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/coms.ts +3 -3
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/documentation.ts +4 -4
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/factory.ts +2 -2
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/temp-agent.ts +4 -4
- package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/write-lane.ts +3 -3
- package/.pi/extensions/zob-harness/src/domains/telemetry/AGENTS.md +19 -0
- package/.pi/extensions/zob-harness/src/{chronicle.ts → domains/telemetry/chronicle.ts} +3 -3
- package/.pi/extensions/zob-harness/src/{queue.ts → domains/telemetry/queue.ts} +7 -7
- package/.pi/extensions/zob-harness/src/{telemetry.ts → domains/telemetry/telemetry.ts} +4 -4
- package/.pi/extensions/zob-harness/src/{topology → domains/topology}/chains.ts +10 -10
- package/.pi/extensions/zob-harness/src/{topology → domains/topology}/coms.ts +3 -3
- package/.pi/extensions/zob-harness/src/{topology → domains/topology}/orchestration-profiles.ts +8 -8
- package/.pi/extensions/zob-harness/src/{topology → domains/topology}/teams.ts +8 -8
- package/.pi/extensions/zob-harness/src/runtime/adaptive-zmode.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/auto-compaction.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/commands.ts +51 -29
- package/.pi/extensions/zob-harness/src/runtime/compaction-policy.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/delegation-feed.ts +1 -1
- package/.pi/extensions/zob-harness/src/runtime/delegation-monitor.ts +1 -1
- package/.pi/extensions/zob-harness/src/runtime/events.ts +53 -37
- package/.pi/extensions/zob-harness/src/{goal-runtime.ts → runtime/goal-runtime.ts} +9 -9
- package/.pi/extensions/zob-harness/src/runtime/goal-todo-overlay.ts +1 -1
- package/.pi/extensions/zob-harness/src/runtime/plan-capture.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/state.ts +15 -13
- package/.pi/extensions/zob-harness/src/runtime/tools-autonomous.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/tools-compute.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-coms.ts +15 -12
- package/.pi/extensions/zob-harness/src/runtime/tools-context.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/tools-delegation.ts +13 -13
- package/.pi/extensions/zob-harness/src/runtime/tools-factory.ts +19 -19
- package/.pi/extensions/zob-harness/src/runtime/tools-goal-room.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-governed-requests.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-merge-queue.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-mission-control.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-orchestration.ts +9 -9
- package/.pi/extensions/zob-harness/src/runtime/tools-project-dna.ts +2 -2
- package/.pi/extensions/zob-harness/src/runtime/tools-worker-pool.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-workspace-claims.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/tools-zcommit.ts +3 -3
- package/.pi/extensions/zob-harness/src/runtime/widget.ts +27 -10
- package/.pi/extensions/zob-harness/src/runtime/zobHarness.ts +1 -1
- package/.pi/extensions/zob-harness/src/types.ts +2 -2
- package/.pi/extensions/zob-switch/AGENTS.md +9 -0
- package/.pi/extensions/zob-switch/index.ts +9 -121
- package/.pi/extensions/zob-switch/src/AGENTS.md +8 -0
- package/.pi/extensions/zob-switch/src/autocomplete.ts +12 -0
- package/.pi/extensions/zob-switch/src/paths.ts +8 -0
- package/.pi/extensions/zob-switch/src/settings.ts +25 -0
- package/.pi/extensions/zob-switch/src/snapshot.ts +34 -0
- package/.pi/extensions/zob-switch/src/state.ts +57 -0
- package/.pi/factories/agentic-spec-team/README.md +35 -0
- package/.pi/factories/agentic-spec-team/batch-manifest.json +11 -0
- package/.pi/factories/agentic-spec-team/example-agentic-spec-manifest.json +19 -0
- package/.pi/factories/agentic-spec-team/factory.json +98 -0
- package/.pi/factories/agentic-spec-team/pilot-manifest.json +11 -0
- package/.pi/factories/agentic-spec-team/schemas/final-report.schema.json +15 -0
- package/.pi/factories/agentic-spec-team/schemas/manifest.schema.json +14 -0
- package/.pi/factories/agentic-spec-team/schemas/question.schema.json +18 -0
- package/.pi/factories/agentic-spec-team/schemas/source-register.schema.json +11 -0
- package/.pi/factories/agentic-spec-team/schemas/traceability.schema.json +11 -0
- package/.pi/factories/agentic-spec-team/smoke-manifest.json +11 -0
- package/.pi/skills/zob-agentic-spec-team/SKILL.md +148 -0
- package/.pi/skills/zob-coms-safety/SKILL.md +13 -0
- package/.pi/skills/zob-coms-v2-live/SKILL.md +11 -0
- package/.pi/skills/zob-factory/SKILL.md +21 -0
- package/.pi/skills/zob-harness/SKILL.md +14 -0
- package/.pi/skills/zob-split-refactor/SKILL.md +1 -1
- package/.pi/skills/zob-zagent-creator/SKILL.md +266 -12
- package/.pi/zagents/agent-factory-pacman-chief.json +22 -0
- package/.pi/zagents/agent-factory-pacman-engine-builder.json +21 -0
- package/.pi/zagents/agent-factory-pacman-frontend-builder.json +21 -0
- package/.pi/zagents/agent-factory-pacman-game-architect.json +21 -0
- package/.pi/zagents/agent-factory-pacman-game-designer.json +21 -0
- package/.pi/zagents/agent-factory-pacman-qa-oracle.json +21 -0
- package/.pi/zagents/bdd-writer.json +20 -0
- package/.pi/zagents/data-profile-analyst.json +20 -0
- package/.pi/zagents/domain-modeler.json +20 -0
- package/.pi/zagents/planner-handoff-writer.json +20 -0
- package/.pi/zagents/prompts/agent-factory-pacman-chief.md +53 -0
- package/.pi/zagents/prompts/agent-factory-pacman-engine-builder.md +41 -0
- package/.pi/zagents/prompts/agent-factory-pacman-frontend-builder.md +40 -0
- package/.pi/zagents/prompts/agent-factory-pacman-game-architect.md +41 -0
- package/.pi/zagents/prompts/agent-factory-pacman-game-designer.md +43 -0
- package/.pi/zagents/prompts/agent-factory-pacman-qa-oracle.md +51 -0
- package/.pi/zagents/prompts/agentic-spec-run-role.md +30 -0
- package/.pi/zagents/source-intake-steward.json +20 -0
- package/.pi/zagents/spec-chief.json +21 -0
- package/.pi/zagents/spec-oracle.json +20 -0
- package/.pi/zagents/spec-writer.json +20 -0
- package/.pi/zagents/ux-flow-analyst.json +20 -0
- package/.pi/zteams/agent-factory-pacman-multiplayer-runtime.mjs +384 -0
- package/.pi/zteams/agent-factory-pacman-multiplayer.json +42 -0
- package/.pi/zteams/agent-factory-pacman-multiplayer.tmux.sh +256 -0
- package/.pi/zteams/agentic-spec-run.json +42 -0
- package/.pi/zteams/agentic-spec-run.tmux.sh +134 -0
- package/.pi/zteams/templates/agent-factory-pacman-chief-kickoff.template.md +71 -0
- package/.pi/zteams/templates/agent-factory-pacman-worker-kickoff.template.md +59 -0
- package/README.md +183 -110
- package/SOURCE_INDEX.md +5 -1
- package/examples/agent-factory-mission-control/AGENTS.md +10 -0
- package/examples/agent-factory-mission-control/README.md +17 -0
- package/examples/agent-factory-mission-control/apps/api/AGENTS.md +3 -0
- package/examples/agent-factory-mission-control/apps/dashboard/AGENTS.md +3 -0
- package/examples/agent-factory-mission-control/mission.md +3 -0
- package/examples/agent-factory-mission-control/output-contract.md +3 -0
- package/examples/agent-factory-mission-control/packages/domain/AGENTS.md +3 -0
- package/examples/agent-factory-mission-control/packages/snapshot-reader/AGENTS.md +3 -0
- package/examples/agent-factory-pacman-multiplayer/AGENTS.md +27 -0
- package/examples/agent-factory-pacman-multiplayer/README.md +84 -0
- package/examples/agent-factory-pacman-multiplayer/mission.md +43 -0
- package/examples/agent-factory-pacman-multiplayer/output-contract.md +58 -0
- package/examples/agent-factory-tmux-comms/README.md +146 -0
- package/examples/agent-factory-tmux-comms/chief-kickoff.template.md +54 -0
- package/examples/agent-factory-tmux-comms/simple-agent-factory.team.json +92 -0
- package/examples/agent-factory-tmux-comms/simple-agent-factory.tmux.sh +248 -0
- package/examples/agent-factory-tmux-comms/worker-kickoff.template.md +43 -0
- package/package.json +17 -3
- package/scripts/README.md +1 -1
- package/scripts/agentic-spec-team/validate-bdd.mjs +13 -0
- package/scripts/agentic-spec-team/validate-final-report.mjs +14 -0
- package/scripts/agentic-spec-team/validate-manifest.mjs +14 -0
- package/scripts/agentic-spec-team/validate-oracle-ready.mjs +13 -0
- package/scripts/agentic-spec-team/validate-question-loop.mjs +15 -0
- package/scripts/agentic-spec-team/validate-run.mjs +11 -0
- package/scripts/agentic-spec-team/validate-source-register.mjs +17 -0
- package/scripts/agentic-spec-team/validate-traceability.mjs +20 -0
- package/scripts/agentic-spec-team/validate-workgraph.mjs +13 -0
- package/scripts/autonomy/mission-readiness-secret-smoke.mjs +5 -5
- package/scripts/git-ops/commit-policy-smoke.mjs +5 -4
- package/scripts/goal-todo/child-goal-ref-smoke.mjs +2 -2
- package/scripts/path-policy/validate-smoke.mjs +3 -3
- package/scripts/project-dna/AGENTS.md +39 -0
- package/scripts/project-dna/{validate-scaffold.mjs → validation/validate-scaffold.mjs} +7 -7
- package/scripts/spec-run.mjs +365 -0
- package/scripts/worker-pool/static-smoke.mjs +5 -5
- package/scripts/zagent-static-smoke.mjs +35 -6
- package/scripts/zpeer-local-e2e-smoke.mjs +12 -5
- package/scripts/zpeer-static-smoke.mjs +17 -17
- /package/.pi/extensions/zob-harness/src/{types → core/types}/core.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{utils → core/utils}/hashing.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{utils → core/utils}/json.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{utils → core/utils}/paths.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/AGENTS.md +0 -0
- /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/pending-replies.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/types.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/ledger.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/types.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{promotion → domains/promotion}/validate.ts +0 -0
- /package/.pi/extensions/zob-harness/src/{schemas-project-dna.ts → runtime/schemas-project-dna.ts} +0 -0
- /package/.pi/extensions/zob-harness/src/{schemas.ts → runtime/schemas.ts} +0 -0
- /package/scripts/project-dna/{bench-smoke.mjs → benchmark/bench-smoke.mjs} +0 -0
- /package/scripts/project-dna/{build-capsules.mjs → capsules/build-capsules.mjs} +0 -0
- /package/scripts/project-dna/{emit-golden-cases.mjs → emit/emit-golden-cases.mjs} +0 -0
- /package/scripts/project-dna/{emit-ontology.mjs → emit/emit-ontology.mjs} +0 -0
- /package/scripts/project-dna/{oracle-review-smoke.mjs → oracle/oracle-review-smoke.mjs} +0 -0
- /package/scripts/project-dna/{query-context.mjs → query/query-context.mjs} +0 -0
- /package/scripts/project-dna/{query-steward.mjs → query/query-steward.mjs} +0 -0
- /package/scripts/project-dna/{build-sample-spec.mjs → sample/build-sample-spec.mjs} +0 -0
- /package/scripts/project-dna/{generate-sample.mjs → sample/generate-sample.mjs} +0 -0
- /package/scripts/project-dna/{validate-sample-project.mjs → sample/validate-sample-project.mjs} +0 -0
- /package/scripts/project-dna/{scan.mjs → scan/scan.mjs} +0 -0
- /package/scripts/project-dna/{validate-scan-artifacts.mjs → scan/validate-scan-artifacts.mjs} +0 -0
- /package/scripts/project-dna/{validate-5of5.mjs → validation/validate-5of5.mjs} +0 -0
- /package/scripts/project-dna/{validate-golden-cases.mjs → validation/validate-golden-cases.mjs} +0 -0
- /package/scripts/project-dna/{validate-ontology.mjs → validation/validate-ontology.mjs} +0 -0
- /package/scripts/project-dna/{plan-workflow.mjs → workflow/plan-workflow.mjs} +0 -0
- /package/scripts/project-dna/{validate-workflow.mjs → workflow/validate-workflow.mjs} +0 -0
|
@@ -2,15 +2,15 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSy
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
4
|
import { buildAutonomousRuntimeDryRun, validateAutonomousReadOnlySmokeRunArtifacts, validateAutonomousRuntimeDryRunArtifacts } from "./autonomous-runtime.js";
|
|
5
|
-
import { buildCapabilityIndex } from "
|
|
6
|
-
import { buildContextGbrainReadinessAudit } from "
|
|
7
|
-
import { loadFactoryDefinition, loadFactoryInputManifest, validateFactoryStages } from "
|
|
8
|
-
import { validateStrictGoalSpecAnchor } from "
|
|
9
|
-
import { validateDelegationWriteScope } from "
|
|
10
|
-
import { sha256 } from "
|
|
11
|
-
import { parseJsonFile } from "
|
|
12
|
-
import { safeFileStem } from "
|
|
13
|
-
import { isRecord } from "
|
|
5
|
+
import { buildCapabilityIndex } from "../delegation/capabilities.js";
|
|
6
|
+
import { buildContextGbrainReadinessAudit } from "../context/context-gbrain.js";
|
|
7
|
+
import { loadFactoryDefinition, loadFactoryInputManifest, validateFactoryStages } from "../factory/validation.js";
|
|
8
|
+
import { validateStrictGoalSpecAnchor } from "../goal/goal.js";
|
|
9
|
+
import { validateDelegationWriteScope } from "../governance/safety.js";
|
|
10
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
11
|
+
import { parseJsonFile } from "../../core/utils/json.js";
|
|
12
|
+
import { safeFileStem } from "../../core/utils/paths.js";
|
|
13
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
14
14
|
|
|
15
15
|
export interface AutonomyReadinessAuditInput {
|
|
16
16
|
run_id?: string;
|
|
@@ -43,16 +43,16 @@ const REGISTERED_FACTORY_SOURCE_FINGERPRINT_BASE_FILES = [
|
|
|
43
43
|
".pi/model-routing.json",
|
|
44
44
|
".pi/extensions/zob-harness/index.ts",
|
|
45
45
|
".pi/extensions/zob-harness/src/runtime/tools-factory.ts",
|
|
46
|
-
".pi/extensions/zob-harness/src/budget-policy.ts",
|
|
47
|
-
".pi/extensions/zob-harness/src/model-routing.ts",
|
|
48
|
-
".pi/extensions/zob-harness/src/schemas.ts",
|
|
46
|
+
".pi/extensions/zob-harness/src/domains/governance/budget-policy.ts",
|
|
47
|
+
".pi/extensions/zob-harness/src/domains/models/model-routing.ts",
|
|
48
|
+
".pi/extensions/zob-harness/src/runtime/schemas.ts",
|
|
49
49
|
".pi/extensions/zob-harness/src/types.ts",
|
|
50
|
-
".pi/extensions/zob-harness/src/telemetry.ts",
|
|
51
|
-
".pi/extensions/zob-harness/src/factory/run.ts",
|
|
52
|
-
".pi/extensions/zob-harness/src/factory/agentic-plan.ts",
|
|
53
|
-
".pi/extensions/zob-harness/src/factory/validation.ts",
|
|
54
|
-
".pi/extensions/zob-harness/src/child-runner.ts",
|
|
55
|
-
".pi/extensions/zob-harness/src/output-contracts.ts",
|
|
50
|
+
".pi/extensions/zob-harness/src/domains/telemetry/telemetry.ts",
|
|
51
|
+
".pi/extensions/zob-harness/src/domains/factory/run.ts",
|
|
52
|
+
".pi/extensions/zob-harness/src/domains/factory/agentic-plan.ts",
|
|
53
|
+
".pi/extensions/zob-harness/src/domains/factory/validation.ts",
|
|
54
|
+
".pi/extensions/zob-harness/src/domains/delegation/child-runner.ts",
|
|
55
|
+
".pi/extensions/zob-harness/src/domains/delegation/output-contracts.ts",
|
|
56
56
|
];
|
|
57
57
|
|
|
58
58
|
function uniqueSorted(items: string[]): string[] {
|
package/.pi/extensions/zob-harness/src/{daemon-policy.ts → domains/autonomy/daemon-policy.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
|
-
import { READ_ONLY_QUEUE_JOB_TYPES } from "
|
|
5
|
-
import type { ChildStopCondition } from "
|
|
6
|
-
import { sha256 } from "
|
|
7
|
-
import { parseJsonFile } from "
|
|
8
|
-
import { safeFileStem } from "
|
|
9
|
-
import { isRecord } from "
|
|
4
|
+
import { READ_ONLY_QUEUE_JOB_TYPES } from "../telemetry/queue.js";
|
|
5
|
+
import type { ChildStopCondition } from "../../types.js";
|
|
6
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
7
|
+
import { parseJsonFile } from "../../core/utils/json.js";
|
|
8
|
+
import { safeFileStem } from "../../core/utils/paths.js";
|
|
9
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
10
10
|
|
|
11
11
|
export interface DaemonPolicyReadinessAuditInput {
|
|
12
12
|
run_id?: string;
|
package/.pi/extensions/zob-harness/src/{daemon-readiness.ts → domains/autonomy/daemon-readiness.ts}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
|
-
import { evaluateBudgetPreflightDryRun } from "
|
|
4
|
+
import { evaluateBudgetPreflightDryRun } from "../telemetry/chronicle.js";
|
|
5
5
|
import { validateDaemonPolicyConfig } from "./daemon-policy.js";
|
|
6
|
-
import { evaluateModelRoutingDryRun } from "
|
|
7
|
-
import { buildQueueDashboardSummary, ensureQueueDirs, READ_ONLY_QUEUE_JOB_TYPES, validateReadOnlyQueueJob } from "
|
|
8
|
-
import { sha256 } from "
|
|
9
|
-
import { parseJsonFile } from "
|
|
10
|
-
import { safeFileStem } from "
|
|
11
|
-
import { isRecord } from "
|
|
6
|
+
import { evaluateModelRoutingDryRun } from "../models/model-routing.js";
|
|
7
|
+
import { buildQueueDashboardSummary, ensureQueueDirs, READ_ONLY_QUEUE_JOB_TYPES, validateReadOnlyQueueJob } from "../telemetry/queue.js";
|
|
8
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
9
|
+
import { parseJsonFile } from "../../core/utils/json.js";
|
|
10
|
+
import { safeFileStem } from "../../core/utils/paths.js";
|
|
11
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
12
12
|
|
|
13
13
|
export interface DaemonReadinessDryRunInput {
|
|
14
14
|
run_id?: string;
|
package/.pi/extensions/zob-harness/src/{daemon-runtime.ts → domains/autonomy/daemon-runtime.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InteractiveAutonomyMode, InteractiveLaunchAuthorization, MissionReadinessReport } from "./interactive-autonomy.js";
|
|
2
|
-
import type { RuntimeGoal, RuntimeGoalStatus } from "
|
|
3
|
-
import type { GoalTodoNode, GoalTodoState, GoalTodoStatus } from "
|
|
2
|
+
import type { RuntimeGoal, RuntimeGoalStatus } from "../../runtime/goal-runtime.js";
|
|
3
|
+
import type { GoalTodoNode, GoalTodoState, GoalTodoStatus } from "../goal/goal-todos.js";
|
|
4
4
|
|
|
5
5
|
export const DAEMON_RUNTIME_STATUSES = [
|
|
6
6
|
"off",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
|
-
import { loadFactorySelectorCandidates, selectFactoryForDemands, type FactorySelectorResult } from "
|
|
5
|
-
import { buildControlledWorkerPoolPlan, evaluateLaunchAuthorizedApplyGate, type ControlledWorkerPoolPlan, type LaunchAuthorizedApplyGate } from "
|
|
6
|
-
import { sha256 } from "
|
|
7
|
-
import { safeFileStem } from "
|
|
4
|
+
import { loadFactorySelectorCandidates, selectFactoryForDemands, type FactorySelectorResult } from "../factory/factory-selector.js";
|
|
5
|
+
import { buildControlledWorkerPoolPlan, evaluateLaunchAuthorizedApplyGate, type ControlledWorkerPoolPlan, type LaunchAuthorizedApplyGate } from "../governance/launch-apply.js";
|
|
6
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
7
|
+
import { safeFileStem } from "../../core/utils/paths.js";
|
|
8
8
|
|
|
9
9
|
export interface FullAutonomyTestInput {
|
|
10
10
|
runId?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
|
-
import { sha256 } from "
|
|
5
|
-
import { isRecord } from "
|
|
4
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
5
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
6
6
|
|
|
7
7
|
export const INTERACTIVE_AUTONOMY_MODES = ["off", "open", "controlled", "adaptive"] as const;
|
|
8
8
|
export type InteractiveAutonomyMode = typeof INTERACTIVE_AUTONOMY_MODES[number];
|
package/.pi/extensions/zob-harness/src/{compute-profile.ts → domains/compute/compute-profile.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { basename, extname, join, relative, resolve } from "node:path";
|
|
3
3
|
|
|
4
|
-
import { sha256 } from "
|
|
5
|
-
import { resolveRepoPath, safeFileStem, safeRunId } from "
|
|
6
|
-
import { isRecord } from "
|
|
4
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
5
|
+
import { resolveRepoPath, safeFileStem, safeRunId } from "../../core/utils/paths.js";
|
|
6
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
7
7
|
|
|
8
8
|
export type ComputeRequestedProfile = "auto" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
9
9
|
export type ComputeEffectiveProfile = Exclude<ComputeRequestedProfile, "auto">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { sha256 } from "
|
|
3
|
-
import { resolveRepoPath } from "
|
|
4
|
-
import { isRecord } from "
|
|
2
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
3
|
+
import { resolveRepoPath } from "../../core/utils/paths.js";
|
|
4
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
5
5
|
import { resolveComputeProfile, type ComputeDomain, type ComputeEffectiveProfile, type ComputePreviewInput, type ComputeRequestedProfile } from "./compute-profile.js";
|
|
6
6
|
|
|
7
7
|
export interface ComputeWorkflowShapeInput extends ComputePreviewInput {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Coms domain guardrail
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
- Hash-only/local communication domains, Mission Control metadata, governed request extraction, topology-facing coms helpers, and coms-v2 compatibility.
|
|
6
|
+
|
|
7
|
+
## MUST DO
|
|
8
|
+
|
|
9
|
+
- Preserve hash-only/body-free ledgers, stale/offline peer blockers, bounded awaits, and topology guards.
|
|
10
|
+
- Keep Goal Room parent-visible as canonical for coordination decisions.
|
|
11
|
+
|
|
12
|
+
## MUST NOT
|
|
13
|
+
|
|
14
|
+
- Do not persist raw prompts, outputs, rationale, diffs, patches, or message bodies.
|
|
15
|
+
- Do not introduce hidden worker-to-worker direct chat or network transport.
|
|
16
|
+
- Do not import from `index.ts` or `index.js`.
|
|
17
|
+
|
|
18
|
+
## Validation
|
|
19
|
+
|
|
20
|
+
- `npm run check -- --pretty false`.
|
|
21
|
+
- `npm run smoke:harness` plus coms-specific smoke if coms transport paths move.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sha256 } from "
|
|
2
|
-
import { isRecord } from "
|
|
1
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
2
|
+
import { isRecord } from "../../../core/utils/records.js";
|
|
3
3
|
|
|
4
4
|
const FORBIDDEN_PERSISTED_KEYS = new Set(["body", "task", "prompt", "output", "content", "message", "rationale", "text", "diff", "patch"]);
|
|
5
5
|
const ENVELOPE_TYPES = new Set(["ping", "pong", "prompt", "ack", "response", "error"]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
2
|
|
|
3
|
-
import type { TeamDefinition, TeamLead, TeamWorker } from "
|
|
4
|
-
import { sha256 } from "
|
|
5
|
-
import { safeFileStem } from "
|
|
3
|
+
import type { TeamDefinition, TeamLead, TeamWorker } from "../../../types.js";
|
|
4
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
5
|
+
import { safeFileStem } from "../../../core/utils/paths.js";
|
|
6
6
|
import type { ZobComsV2Policy, ZobLivePeerCard, ZobLiveRoleType } from "./types.js";
|
|
7
7
|
|
|
8
8
|
const PROCESS_STARTED_AT = new Date().toISOString();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TeamDefinition } from "
|
|
2
|
-
import { appendZobComsMessage, replyZobComsMessage, transitionZobComsStatus } from "
|
|
1
|
+
import type { TeamDefinition } from "../../../types.js";
|
|
2
|
+
import { appendZobComsMessage, replyZobComsMessage, transitionZobComsStatus } from "../../topology/coms.js";
|
|
3
3
|
import type { ZobLiveEnvelope } from "./envelope.js";
|
|
4
4
|
|
|
5
5
|
export function appendLiveSendRequestedRef(repoRoot: string, definition: TeamDefinition, envelope: ZobLiveEnvelope): Record<string, unknown> {
|
|
@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { createConnection, createServer, type Server, type Socket } from "node:net";
|
|
5
5
|
|
|
6
|
-
import { safeFileStem } from "
|
|
6
|
+
import { safeFileStem } from "../../../core/utils/paths.js";
|
|
7
7
|
import { buildZobLiveErrorEnvelope, parseZobLiveEnvelopeLine, validateZobLiveEnvelope, type ZobLiveEnvelope } from "./envelope.js";
|
|
8
8
|
|
|
9
9
|
export interface ZobLocalTransportServer {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
|
|
3
3
|
import type { ZobComsTranscriptMode, ZobComsTranscriptRetentionClass, ZobComsTransportMode, ZobComsV2Policy } from "./types.js";
|
|
4
|
-
import { sha256 } from "
|
|
5
|
-
import { readJsonObjectIfPresent } from "
|
|
6
|
-
import { isRecord } from "
|
|
4
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
5
|
+
import { readJsonObjectIfPresent } from "../../../core/utils/json.js";
|
|
6
|
+
import { isRecord } from "../../../core/utils/records.js";
|
|
7
7
|
|
|
8
8
|
const TRANSPORT_POLICY_RELATIVE_PATH = ".pi/mission-control/zob_coms_transport.json";
|
|
9
9
|
const MODES = new Set<ZobComsTransportMode>(["off", "observe_only", "required_local", "required_network", "break_glass_ledger_only"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sha256 } from "
|
|
1
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
2
2
|
import { readZobLiveRegistrySnapshot } from "./registry.js";
|
|
3
3
|
import { readZobComsV2Policy } from "./policy.js";
|
|
4
4
|
import type { ZobLivePeerCard, ZobLivePresenceSummary } from "./types.js";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
|
|
5
|
-
import { loadTeamDefinition, validateTeamDefinition } from "
|
|
6
|
-
import { isRecord } from "
|
|
7
|
-
import { safeFileStem } from "
|
|
5
|
+
import { loadTeamDefinition, validateTeamDefinition } from "../../topology/teams.js";
|
|
6
|
+
import { isRecord } from "../../../core/utils/records.js";
|
|
7
|
+
import { safeFileStem } from "../../../core/utils/paths.js";
|
|
8
8
|
import { buildCurrentZobLivePeerCard, buildZobComsProjectId } from "./identity.js";
|
|
9
9
|
import { readZobComsV2Policy, zobComsRegistryEnabled } from "./policy.js";
|
|
10
10
|
import type { ZobLivePeerCard, ZobLivePeerStatus, ZobLiveRegistrySnapshot } from "./types.js";
|
|
11
11
|
|
|
12
12
|
const FORBIDDEN_PERSISTED_KEYS = new Set(["body", "task", "prompt", "output", "content", "message", "rationale", "text", "diff", "patch"]);
|
|
13
|
+
const DEFAULT_OFFLINE_PEER_RETENTION_MS = 24 * 60 * 60 * 1000;
|
|
14
|
+
const MIN_OFFLINE_PEER_RETENTION_MS = 5 * 60 * 1000;
|
|
13
15
|
|
|
14
16
|
function registryRoot(): { path: string; kind: "user_runtime" | "env_override" } {
|
|
15
17
|
const override = process.env.ZOB_COMS_REGISTRY_ROOT;
|
|
@@ -54,6 +56,19 @@ function readPeerCardsFromAgentsDir(dir: string, nowMs: number, teamName?: strin
|
|
|
54
56
|
.map((peer) => ({ ...peer, status: derivePeerStatus(peer, nowMs) }));
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
function boundedOfflinePeerRetentionMs(value: number | undefined): number {
|
|
60
|
+
const env = Number.parseInt(process.env.ZOB_COMS_OFFLINE_PEER_RETENTION_MS ?? "", 10);
|
|
61
|
+
const raw = typeof value === "number" && Number.isFinite(value) ? value : Number.isFinite(env) ? env : DEFAULT_OFFLINE_PEER_RETENTION_MS;
|
|
62
|
+
return Math.max(MIN_OFFLINE_PEER_RETENTION_MS, Math.floor(raw));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function offlinePeerExpired(peer: ZobLivePeerCard, nowMs: number, retentionMs: number): boolean {
|
|
66
|
+
if (derivePeerStatus(peer, nowMs) !== "offline") return false;
|
|
67
|
+
const heartbeatMs = Date.parse(peer.heartbeatAt);
|
|
68
|
+
if (!Number.isFinite(heartbeatMs)) return true;
|
|
69
|
+
return nowMs - heartbeatMs >= Math.max(peer.offlineAfterMs, retentionMs);
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
function allProjectAgentsDirs(): string[] {
|
|
58
73
|
const root = registryRoot();
|
|
59
74
|
const projectsDir = join(root.path, "projects");
|
|
@@ -94,6 +109,34 @@ function derivePeerStatus(peer: ZobLivePeerCard, nowMs: number): ZobLivePeerStat
|
|
|
94
109
|
return "online";
|
|
95
110
|
}
|
|
96
111
|
|
|
112
|
+
export function pruneExpiredZobLivePeers(repoRoot: string, input: { teamName?: string; nowMs?: number; retentionMs?: number } = {}): { schema: "zob.live-registry-prune.v1"; pruned: number; retained: number; retentionMs: number; bodyStored: false } {
|
|
113
|
+
const { dir } = projectAgentsDir(repoRoot);
|
|
114
|
+
const nowMs = input.nowMs ?? Date.now();
|
|
115
|
+
const retentionMs = boundedOfflinePeerRetentionMs(input.retentionMs);
|
|
116
|
+
let pruned = 0;
|
|
117
|
+
let retained = 0;
|
|
118
|
+
if (!existsSync(dir)) return { schema: "zob.live-registry-prune.v1", pruned, retained, retentionMs, bodyStored: false };
|
|
119
|
+
for (const entry of readdirSync(dir).filter((name) => name.endsWith(".json"))) {
|
|
120
|
+
const filePath = join(dir, entry);
|
|
121
|
+
try {
|
|
122
|
+
const peer = parsePeerCard(JSON.parse(readFileSync(filePath, "utf8")) as unknown);
|
|
123
|
+
if (!peer || (input.teamName && peer.team !== input.teamName)) {
|
|
124
|
+
retained += 1;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (offlinePeerExpired(peer, nowMs, retentionMs)) {
|
|
128
|
+
unlinkSync(filePath);
|
|
129
|
+
pruned += 1;
|
|
130
|
+
} else {
|
|
131
|
+
retained += 1;
|
|
132
|
+
}
|
|
133
|
+
} catch {
|
|
134
|
+
retained += 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return { schema: "zob.live-registry-prune.v1", pruned, retained, retentionMs, bodyStored: false };
|
|
138
|
+
}
|
|
139
|
+
|
|
97
140
|
export function writeZobLivePeerCard(repoRoot: string, peer: ZobLivePeerCard): ZobLivePeerCard {
|
|
98
141
|
if (hasForbiddenPersistedKey(peer)) throw new Error("Refusing to persist ZOB live peer card with forbidden body-like keys");
|
|
99
142
|
if (peer.bodyStored !== false) throw new Error("ZOB live peer card bodyStored must be false");
|
package/.pi/extensions/zob-harness/src/{coms-v2 → domains/coms/coms-v2}/transcript-capture.ts
RENAMED
|
@@ -2,8 +2,8 @@ import { mkdirSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
|
|
4
4
|
import type { ZobComsTranscriptCapturePolicy } from "./types.js";
|
|
5
|
-
import { sha256 } from "
|
|
6
|
-
import { safeFileStem } from "
|
|
5
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
6
|
+
import { safeFileStem } from "../../../core/utils/paths.js";
|
|
7
7
|
|
|
8
8
|
export type ZobComsRedactedCaptureKind = "live_prompt" | "live_response" | "live_exchange";
|
|
9
9
|
|
|
@@ -4,9 +4,9 @@ import { join } from "node:path";
|
|
|
4
4
|
|
|
5
5
|
import { buildZobComsProjectId } from "./identity.js";
|
|
6
6
|
import type { ZobLivePeerCard, ZpeerRoomMembership } from "./types.js";
|
|
7
|
-
import { sha256 } from "
|
|
8
|
-
import { isRecord } from "
|
|
9
|
-
import { safeFileStem } from "
|
|
7
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
8
|
+
import { isRecord } from "../../../core/utils/records.js";
|
|
9
|
+
import { safeFileStem } from "../../../core/utils/paths.js";
|
|
10
10
|
|
|
11
11
|
const PROFILE_SCHEMA = "zob.zpeer-local-profile.v1";
|
|
12
12
|
const NEW_CARRYOVER_SCHEMA = "zob.zpeer-new-carryover.v1";
|
|
@@ -6,10 +6,10 @@ import { buildZobLiveEnvelope } from "./envelope.js";
|
|
|
6
6
|
import { sendZobLocalEnvelope } from "./local-transport.js";
|
|
7
7
|
import { readZobLiveRegistryAllProjectsSnapshot, writeZobLivePeerCard, writeZobLivePeerCardToProjectId } from "./registry.js";
|
|
8
8
|
import type { ZobLivePeerCard, ZobLivePeerStatus, ZpeerRoomMembership, ZpeerRoomMembershipRole } from "./types.js";
|
|
9
|
-
import { validateZobComsEdge } from "
|
|
10
|
-
import { loadTeamDefinition, validateTeamDefinition } from "
|
|
9
|
+
import { validateZobComsEdge } from "../../topology/coms.js";
|
|
10
|
+
import { loadTeamDefinition, validateTeamDefinition } from "../../topology/teams.js";
|
|
11
11
|
import { loadZteamManifest, zteamAllowsZpeerContact } from "../zagents.js";
|
|
12
|
-
import { sha256 } from "
|
|
12
|
+
import { sha256 } from "../../../core/utils/hashing.js";
|
|
13
13
|
|
|
14
14
|
const DEFAULT_ROOM_ID = "default";
|
|
15
15
|
const ALIAS_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{1,31}$/;
|
|
@@ -26,6 +26,9 @@ export interface ZpeerRoomSummary {
|
|
|
26
26
|
stale: number;
|
|
27
27
|
offline: number;
|
|
28
28
|
aliases: string[];
|
|
29
|
+
onlineAliases: string[];
|
|
30
|
+
staleAliases: string[];
|
|
31
|
+
offlineAliases: string[];
|
|
29
32
|
duplicateAliases: string[];
|
|
30
33
|
membershipCount?: number;
|
|
31
34
|
localOnly: true;
|
|
@@ -248,9 +251,15 @@ function peersInRoom(repoRoot: string, roomId: string): ZpeerRoomPeer[] {
|
|
|
248
251
|
|
|
249
252
|
function buildZpeerRoomSummaryFromPeers(projectId: string, self: ZobLivePeerCard | undefined, roomId: string, peers: ZpeerRoomPeer[]): ZpeerRoomSummary {
|
|
250
253
|
const counts: Record<ZobLivePeerStatus, number> = { online: 0, stale: 0, offline: 0 };
|
|
254
|
+
const statusAliases: Record<ZobLivePeerStatus, string[]> = { online: [], stale: [], offline: [] };
|
|
251
255
|
const aliases = peers.map((entry) => entry.membership.alias).sort();
|
|
252
|
-
for (const entry of peers)
|
|
253
|
-
|
|
256
|
+
for (const entry of peers) {
|
|
257
|
+
const status = zpeerReachableStatus(entry.peer);
|
|
258
|
+
counts[status] += 1;
|
|
259
|
+
statusAliases[status].push(entry.membership.alias);
|
|
260
|
+
}
|
|
261
|
+
const onlineAliases = statusAliases.online.sort();
|
|
262
|
+
const duplicateAliases = onlineAliases.filter((alias, index) => onlineAliases.indexOf(alias) !== index).filter((alias, index, all) => all.indexOf(alias) === index);
|
|
254
263
|
return {
|
|
255
264
|
schema: "zob.zpeer-room-summary.v1",
|
|
256
265
|
projectId,
|
|
@@ -261,6 +270,9 @@ function buildZpeerRoomSummaryFromPeers(projectId: string, self: ZobLivePeerCard
|
|
|
261
270
|
stale: counts.stale,
|
|
262
271
|
offline: counts.offline,
|
|
263
272
|
aliases,
|
|
273
|
+
onlineAliases,
|
|
274
|
+
staleAliases: statusAliases.stale.sort(),
|
|
275
|
+
offlineAliases: statusAliases.offline.sort(),
|
|
264
276
|
duplicateAliases,
|
|
265
277
|
membershipCount: self ? zpeerMembershipsForPeer(self).length : undefined,
|
|
266
278
|
localOnly: true,
|
|
@@ -471,8 +483,24 @@ export async function sendZpeerPrompt(repoRoot: string, self: ZobLivePeerCard, t
|
|
|
471
483
|
const candidates = peersInRoom(repoRoot, roomId).filter((entry) => entry.membership.alias === targetAlias && entry.peer.sessionHash !== self.sessionHash);
|
|
472
484
|
if (targetAlias === senderAlias) return finish("attempt", { status: "blocked", reason: "cannot send to self", targetAlias, taskHash, bodyStored: false });
|
|
473
485
|
if (candidates.length === 0) return finish("attempt", { status: "blocked", reason: `peer @${targetAlias} not found in room '${roomId}'`, targetAlias, taskHash, bodyStored: false }, 0);
|
|
474
|
-
|
|
475
|
-
|
|
486
|
+
let liveCandidates = candidates.filter((entry) => zpeerReachableStatus(entry.peer) === "online");
|
|
487
|
+
if (liveCandidates.length > 1) {
|
|
488
|
+
const responsiveCandidates: ZpeerRoomPeer[] = [];
|
|
489
|
+
for (const entry of liveCandidates) {
|
|
490
|
+
if (await peerRespondsToAliasPing(entry.peer)) {
|
|
491
|
+
responsiveCandidates.push(entry);
|
|
492
|
+
} else {
|
|
493
|
+
try { writeZobLivePeerCard(repoRoot, { ...entry.peer, heartbeatAt: new Date().toISOString(), status: "offline" }); } catch { /* best-effort ghost alias release */ }
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
liveCandidates = responsiveCandidates;
|
|
497
|
+
}
|
|
498
|
+
if (liveCandidates.length === 0) {
|
|
499
|
+
const statuses = [...new Set(candidates.map((entry) => zpeerReachableStatus(entry.peer)))].sort().join("/") || "offline";
|
|
500
|
+
return finish("attempt", { status: "blocked", reason: `peer @${targetAlias} is ${statuses}`, targetAlias, taskHash, bodyStored: false }, candidates.length);
|
|
501
|
+
}
|
|
502
|
+
if (liveCandidates.length > 1) return finish("attempt", { status: "blocked", reason: `duplicate live alias @${targetAlias} in room '${roomId}'`, targetAlias, taskHash, bodyStored: false }, liveCandidates.length);
|
|
503
|
+
const target = liveCandidates[0];
|
|
476
504
|
const targetReachableStatus = zpeerReachableStatus(target.peer);
|
|
477
505
|
if (targetReachableStatus !== "online") return finish("attempt", { status: "blocked", reason: `peer @${targetAlias} is ${targetReachableStatus}`, targetAlias, taskHash, bodyStored: false }, 1);
|
|
478
506
|
const topologyBlocker = validateZpeerTopology(repoRoot, self, target.peer, roomId, senderAlias, target.membership.alias);
|
package/.pi/extensions/zob-harness/src/{mission-control.ts → domains/coms/mission-control.ts}
RENAMED
|
@@ -5,14 +5,14 @@ import { buildZobLivePresenceSummary, redactZobLivePeerForMissionControl } from
|
|
|
5
5
|
import { readZobComsV2Policy } from "./coms-v2/policy.js";
|
|
6
6
|
import { zpeerMembershipsForPeer } from "./coms-v2/zpeer.js";
|
|
7
7
|
import { readZobLiveRegistrySnapshot } from "./coms-v2/registry.js";
|
|
8
|
-
import { buildQueueDashboardSummary } from "
|
|
9
|
-
import type { TeamDefinition } from "
|
|
10
|
-
import { summarizePromotionCandidates } from "
|
|
11
|
-
import { buildZobComsMessage, listZobComsMessages, validateZobComsEdge, validateZobComsMessage } from "
|
|
12
|
-
import { sha256 } from "
|
|
13
|
-
import { readJsonl, readJsonObjectIfPresent } from "
|
|
14
|
-
import { safeFileStem } from "
|
|
15
|
-
import { isRecord } from "
|
|
8
|
+
import { buildQueueDashboardSummary } from "../telemetry/queue.js";
|
|
9
|
+
import type { TeamDefinition } from "../../types.js";
|
|
10
|
+
import { summarizePromotionCandidates } from "../promotion/candidate.js";
|
|
11
|
+
import { buildZobComsMessage, listZobComsMessages, validateZobComsEdge, validateZobComsMessage } from "../topology/coms.js";
|
|
12
|
+
import { sha256 } from "../../core/utils/hashing.js";
|
|
13
|
+
import { readJsonl, readJsonObjectIfPresent } from "../../core/utils/json.js";
|
|
14
|
+
import { safeFileStem } from "../../core/utils/paths.js";
|
|
15
|
+
import { isRecord } from "../../core/utils/records.js";
|
|
16
16
|
|
|
17
17
|
export const MISSION_CONTROL_COMMANDS = ["pause", "resume", "reprioritize", "request_context", "request_oracle", "stop", "approve", "replan"] as const;
|
|
18
18
|
|
|
@@ -63,6 +63,7 @@ function summarizeZpeerRooms(peers: Array<Record<string, unknown>>): Array<Recor
|
|
|
63
63
|
}
|
|
64
64
|
return [...rooms.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([roomId, roomPeers]) => {
|
|
65
65
|
const aliases = roomPeers.map((entry) => entry.alias).filter((alias): alias is string => Boolean(alias)).sort();
|
|
66
|
+
const onlineAliases = roomPeers.filter((entry) => entry.peer.status === "online").map((entry) => entry.alias).filter((alias): alias is string => Boolean(alias)).sort();
|
|
66
67
|
const sessionHashes = roomPeers.map((entry) => typeof entry.peer.sessionHash === "string" ? entry.peer.sessionHash : undefined).filter((sessionHash): sessionHash is string => Boolean(sessionHash));
|
|
67
68
|
return {
|
|
68
69
|
schema: "zob.zpeer-room-summary.v1",
|
|
@@ -73,7 +74,9 @@ function summarizeZpeerRooms(peers: Array<Record<string, unknown>>): Array<Recor
|
|
|
73
74
|
stale: roomPeers.filter((entry) => entry.peer.status === "stale").length,
|
|
74
75
|
offline: roomPeers.filter((entry) => entry.peer.status === "offline").length,
|
|
75
76
|
aliasHashes: aliases.map((alias) => sha256(alias)),
|
|
76
|
-
|
|
77
|
+
onlineAliasHashes: onlineAliases.map((alias) => sha256(alias)),
|
|
78
|
+
duplicateAliasHashes: onlineAliases.filter((alias, index) => onlineAliases.indexOf(alias) !== index).filter((alias, index, all) => all.indexOf(alias) === index).map((alias) => sha256(alias)),
|
|
79
|
+
duplicateAliasScope: "online_only",
|
|
77
80
|
localOnly: true,
|
|
78
81
|
networkEnabled: false,
|
|
79
82
|
bodyStored: false,
|