agent-bober 0.12.0 → 0.17.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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +243 -0
- package/README.md +238 -5
- package/agents/bober-architect.md +72 -0
- package/agents/bober-code-reviewer.md +238 -0
- package/agents/bober-curator.md +49 -0
- package/agents/bober-deployer.md +267 -0
- package/agents/bober-diagnoser.md +289 -0
- package/agents/bober-documenter.md +129 -0
- package/agents/bober-evaluator.md +135 -1
- package/agents/bober-generator.md +80 -3
- package/agents/bober-planner.md +47 -1
- package/agents/bober-postmortemer.md +185 -0
- package/agents/bober-researcher.md +38 -0
- package/dist/cli/commands/approve.d.ts +17 -0
- package/dist/cli/commands/approve.d.ts.map +1 -0
- package/dist/cli/commands/approve.js +64 -0
- package/dist/cli/commands/approve.js.map +1 -0
- package/dist/cli/commands/audit-show.d.ts +14 -0
- package/dist/cli/commands/audit-show.d.ts.map +1 -0
- package/dist/cli/commands/audit-show.js +85 -0
- package/dist/cli/commands/audit-show.js.map +1 -0
- package/dist/cli/commands/config.d.ts +10 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +73 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +8 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +219 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +19 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +191 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/incident.d.ts +19 -0
- package/dist/cli/commands/incident.d.ts.map +1 -0
- package/dist/cli/commands/incident.js +324 -0
- package/dist/cli/commands/incident.js.map +1 -0
- package/dist/cli/commands/init.js +40 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list-approvals.d.ts +16 -0
- package/dist/cli/commands/list-approvals.d.ts.map +1 -0
- package/dist/cli/commands/list-approvals.js +57 -0
- package/dist/cli/commands/list-approvals.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +14 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +132 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +3 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -0
- package/dist/cli/commands/onboard.js +190 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/playbook.d.ts +17 -0
- package/dist/cli/commands/playbook.d.ts.map +1 -0
- package/dist/cli/commands/playbook.js +123 -0
- package/dist/cli/commands/playbook.js.map +1 -0
- package/dist/cli/commands/postmortem.d.ts +12 -0
- package/dist/cli/commands/postmortem.d.ts.map +1 -0
- package/dist/cli/commands/postmortem.js +67 -0
- package/dist/cli/commands/postmortem.js.map +1 -0
- package/dist/cli/commands/reject.d.ts +17 -0
- package/dist/cli/commands/reject.d.ts.map +1 -0
- package/dist/cli/commands/reject.js +52 -0
- package/dist/cli/commands/reject.js.map +1 -0
- package/dist/cli/commands/rollback.d.ts +21 -0
- package/dist/cli/commands/rollback.d.ts.map +1 -0
- package/dist/cli/commands/rollback.js +90 -0
- package/dist/cli/commands/rollback.js.map +1 -0
- package/dist/cli/commands/run.d.ts +9 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +29 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +16 -0
- package/dist/cli/commands/telemetry.d.ts.map +1 -0
- package/dist/cli/commands/telemetry.js +152 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/commands/worktree.d.ts +12 -0
- package/dist/cli/commands/worktree.d.ts.map +1 -0
- package/dist/cli/commands/worktree.js +57 -0
- package/dist/cli/commands/worktree.js.map +1 -0
- package/dist/cli/index.js +56 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +41 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +4 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +25 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/role-providers.d.ts +29 -0
- package/dist/config/role-providers.d.ts.map +1 -0
- package/dist/config/role-providers.js +115 -0
- package/dist/config/role-providers.js.map +1 -0
- package/dist/config/schema.d.ts +1350 -61
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +189 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/contracts/eval-result.d.ts +112 -56
- package/dist/contracts/eval-result.d.ts.map +1 -1
- package/dist/contracts/eval-result.js +3 -0
- package/dist/contracts/eval-result.js.map +1 -1
- package/dist/contracts/sprint-contract.d.ts +30 -30
- package/dist/fleet/aggregator.d.ts +5 -0
- package/dist/fleet/aggregator.d.ts.map +1 -0
- package/dist/fleet/aggregator.js +39 -0
- package/dist/fleet/aggregator.js.map +1 -0
- package/dist/fleet/child-config.d.ts +12 -0
- package/dist/fleet/child-config.d.ts.map +1 -0
- package/dist/fleet/child-config.js +38 -0
- package/dist/fleet/child-config.js.map +1 -0
- package/dist/fleet/coordinator.d.ts +25 -0
- package/dist/fleet/coordinator.d.ts.map +1 -0
- package/dist/fleet/coordinator.js +40 -0
- package/dist/fleet/coordinator.js.map +1 -0
- package/dist/fleet/index.d.ts +40 -0
- package/dist/fleet/index.d.ts.map +1 -0
- package/dist/fleet/index.js +117 -0
- package/dist/fleet/index.js.map +1 -0
- package/dist/fleet/manifest.d.ts +51 -0
- package/dist/fleet/manifest.d.ts.map +1 -0
- package/dist/fleet/manifest.js +32 -0
- package/dist/fleet/manifest.js.map +1 -0
- package/dist/fleet/reporter.d.ts +32 -0
- package/dist/fleet/reporter.d.ts.map +1 -0
- package/dist/fleet/reporter.js +71 -0
- package/dist/fleet/reporter.js.map +1 -0
- package/dist/fleet/runner.d.ts +48 -0
- package/dist/fleet/runner.d.ts.map +1 -0
- package/dist/fleet/runner.js +104 -0
- package/dist/fleet/runner.js.map +1 -0
- package/dist/fleet/scaffolder.d.ts +12 -0
- package/dist/fleet/scaffolder.d.ts.map +1 -0
- package/dist/fleet/scaffolder.js +82 -0
- package/dist/fleet/scaffolder.js.map +1 -0
- package/dist/fleet/types.d.ts +21 -0
- package/dist/fleet/types.d.ts.map +1 -0
- package/dist/fleet/types.js +2 -0
- package/dist/fleet/types.js.map +1 -0
- package/dist/graph/artifact-store.d.ts +14 -0
- package/dist/graph/artifact-store.d.ts.map +1 -0
- package/dist/graph/artifact-store.js +100 -0
- package/dist/graph/artifact-store.js.map +1 -0
- package/dist/graph/cli.d.ts +53 -0
- package/dist/graph/cli.d.ts.map +1 -0
- package/dist/graph/cli.js +181 -0
- package/dist/graph/cli.js.map +1 -0
- package/dist/graph/client.d.ts +64 -0
- package/dist/graph/client.d.ts.map +1 -0
- package/dist/graph/client.js +216 -0
- package/dist/graph/client.js.map +1 -0
- package/dist/graph/fallback.d.ts +13 -0
- package/dist/graph/fallback.d.ts.map +1 -0
- package/dist/graph/fallback.js +57 -0
- package/dist/graph/fallback.js.map +1 -0
- package/dist/graph/hook-handler.d.ts +50 -0
- package/dist/graph/hook-handler.d.ts.map +1 -0
- package/dist/graph/hook-handler.js +217 -0
- package/dist/graph/hook-handler.js.map +1 -0
- package/dist/graph/incidents.d.ts +59 -0
- package/dist/graph/incidents.d.ts.map +1 -0
- package/dist/graph/incidents.js +22 -0
- package/dist/graph/incidents.js.map +1 -0
- package/dist/graph/mcp-client.d.ts +51 -0
- package/dist/graph/mcp-client.d.ts.map +1 -0
- package/dist/graph/mcp-client.js +285 -0
- package/dist/graph/mcp-client.js.map +1 -0
- package/dist/graph/onboarding-composer.d.ts +30 -0
- package/dist/graph/onboarding-composer.d.ts.map +1 -0
- package/dist/graph/onboarding-composer.js +275 -0
- package/dist/graph/onboarding-composer.js.map +1 -0
- package/dist/graph/pipeline-lifecycle.d.ts +95 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -0
- package/dist/graph/pipeline-lifecycle.js +341 -0
- package/dist/graph/pipeline-lifecycle.js.map +1 -0
- package/dist/graph/preflight-budgets.d.ts +52 -0
- package/dist/graph/preflight-budgets.d.ts.map +1 -0
- package/dist/graph/preflight-budgets.js +78 -0
- package/dist/graph/preflight-budgets.js.map +1 -0
- package/dist/graph/preflight-injector.d.ts +130 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -0
- package/dist/graph/preflight-injector.js +618 -0
- package/dist/graph/preflight-injector.js.map +1 -0
- package/dist/graph/prereq.d.ts +12 -0
- package/dist/graph/prereq.d.ts.map +1 -0
- package/dist/graph/prereq.js +61 -0
- package/dist/graph/prereq.js.map +1 -0
- package/dist/graph/prompts.d.ts +42 -0
- package/dist/graph/prompts.d.ts.map +1 -0
- package/dist/graph/prompts.js +80 -0
- package/dist/graph/prompts.js.map +1 -0
- package/dist/graph/sandbox.d.ts +19 -0
- package/dist/graph/sandbox.d.ts.map +1 -0
- package/dist/graph/sandbox.js +25 -0
- package/dist/graph/sandbox.js.map +1 -0
- package/dist/graph/token-usage.d.ts +21 -0
- package/dist/graph/token-usage.d.ts.map +1 -0
- package/dist/graph/token-usage.js +22 -0
- package/dist/graph/token-usage.js.map +1 -0
- package/dist/graph/types.d.ts +129 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +12 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/incident/orchestrator.d.ts +168 -0
- package/dist/incident/orchestrator.d.ts.map +1 -0
- package/dist/incident/orchestrator.js +279 -0
- package/dist/incident/orchestrator.js.map +1 -0
- package/dist/incident/playbook-search.d.ts +67 -0
- package/dist/incident/playbook-search.d.ts.map +1 -0
- package/dist/incident/playbook-search.js +288 -0
- package/dist/incident/playbook-search.js.map +1 -0
- package/dist/incident/postmortem.d.ts +44 -0
- package/dist/incident/postmortem.d.ts.map +1 -0
- package/dist/incident/postmortem.js +486 -0
- package/dist/incident/postmortem.js.map +1 -0
- package/dist/incident/resolution-verify.d.ts +186 -0
- package/dist/incident/resolution-verify.d.ts.map +1 -0
- package/dist/incident/resolution-verify.js +210 -0
- package/dist/incident/resolution-verify.js.map +1 -0
- package/dist/incident/rollback.d.ts +137 -0
- package/dist/incident/rollback.d.ts.map +1 -0
- package/dist/incident/rollback.js +328 -0
- package/dist/incident/rollback.js.map +1 -0
- package/dist/incident/timeline.d.ts +147 -0
- package/dist/incident/timeline.d.ts.map +1 -0
- package/dist/incident/timeline.js +452 -0
- package/dist/incident/timeline.js.map +1 -0
- package/dist/incident/types.d.ts +335 -0
- package/dist/incident/types.d.ts.map +1 -0
- package/dist/incident/types.js +158 -0
- package/dist/incident/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/event-stream.d.ts +46 -0
- package/dist/mcp/event-stream.d.ts.map +1 -0
- package/dist/mcp/event-stream.js +421 -0
- package/dist/mcp/event-stream.js.map +1 -0
- package/dist/mcp/external-client.d.ts +38 -0
- package/dist/mcp/external-client.d.ts.map +1 -0
- package/dist/mcp/external-client.js +121 -0
- package/dist/mcp/external-client.js.map +1 -0
- package/dist/mcp/run-manager.d.ts +74 -9
- package/dist/mcp/run-manager.d.ts.map +1 -1
- package/dist/mcp/run-manager.js +127 -31
- package/dist/mcp/run-manager.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +56 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/abort-run.d.ts +2 -0
- package/dist/mcp/tools/abort-run.d.ts.map +1 -0
- package/dist/mcp/tools/abort-run.js +62 -0
- package/dist/mcp/tools/abort-run.js.map +1 -0
- package/dist/mcp/tools/anchor.js +1 -1
- package/dist/mcp/tools/anchor.js.map +1 -1
- package/dist/mcp/tools/approve-checkpoint.d.ts +2 -0
- package/dist/mcp/tools/approve-checkpoint.d.ts.map +1 -0
- package/dist/mcp/tools/approve-checkpoint.js +70 -0
- package/dist/mcp/tools/approve-checkpoint.js.map +1 -0
- package/dist/mcp/tools/brownfield.js +1 -1
- package/dist/mcp/tools/brownfield.js.map +1 -1
- package/dist/mcp/tools/get-project-state.d.ts +2 -0
- package/dist/mcp/tools/get-project-state.d.ts.map +1 -0
- package/dist/mcp/tools/get-project-state.js +107 -0
- package/dist/mcp/tools/get-project-state.js.map +1 -0
- package/dist/mcp/tools/get-run-status.d.ts +2 -0
- package/dist/mcp/tools/get-run-status.d.ts.map +1 -0
- package/dist/mcp/tools/get-run-status.js +40 -0
- package/dist/mcp/tools/get-run-status.js.map +1 -0
- package/dist/mcp/tools/graph-schemas.d.ts +100 -0
- package/dist/mcp/tools/graph-schemas.d.ts.map +1 -0
- package/dist/mcp/tools/graph-schemas.js +39 -0
- package/dist/mcp/tools/graph-schemas.js.map +1 -0
- package/dist/mcp/tools/graph.d.ts +19 -0
- package/dist/mcp/tools/graph.d.ts.map +1 -0
- package/dist/mcp/tools/graph.js +263 -0
- package/dist/mcp/tools/graph.js.map +1 -0
- package/dist/mcp/tools/incident.d.ts +2 -0
- package/dist/mcp/tools/incident.d.ts.map +1 -0
- package/dist/mcp/tools/incident.js +246 -0
- package/dist/mcp/tools/incident.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +38 -18
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +74 -18
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/init.d.ts.map +1 -1
- package/dist/mcp/tools/init.js +2 -0
- package/dist/mcp/tools/init.js.map +1 -1
- package/dist/mcp/tools/list-active-runs.d.ts +2 -0
- package/dist/mcp/tools/list-active-runs.d.ts.map +1 -0
- package/dist/mcp/tools/list-active-runs.js +35 -0
- package/dist/mcp/tools/list-active-runs.js.map +1 -0
- package/dist/mcp/tools/list-pending-approvals.d.ts +2 -0
- package/dist/mcp/tools/list-pending-approvals.d.ts.map +1 -0
- package/dist/mcp/tools/list-pending-approvals.js +40 -0
- package/dist/mcp/tools/list-pending-approvals.js.map +1 -0
- package/dist/mcp/tools/list-projects.d.ts +2 -0
- package/dist/mcp/tools/list-projects.d.ts.map +1 -0
- package/dist/mcp/tools/list-projects.js +101 -0
- package/dist/mcp/tools/list-projects.js.map +1 -0
- package/dist/mcp/tools/list-specs.d.ts +2 -0
- package/dist/mcp/tools/list-specs.d.ts.map +1 -0
- package/dist/mcp/tools/list-specs.js +48 -0
- package/dist/mcp/tools/list-specs.js.map +1 -0
- package/dist/mcp/tools/playbook.d.ts +2 -0
- package/dist/mcp/tools/playbook.d.ts.map +1 -0
- package/dist/mcp/tools/playbook.js +104 -0
- package/dist/mcp/tools/playbook.js.map +1 -0
- package/dist/mcp/tools/postmortem.d.ts +2 -0
- package/dist/mcp/tools/postmortem.d.ts.map +1 -0
- package/dist/mcp/tools/postmortem.js +75 -0
- package/dist/mcp/tools/postmortem.js.map +1 -0
- package/dist/mcp/tools/react.js +1 -1
- package/dist/mcp/tools/react.js.map +1 -1
- package/dist/mcp/tools/reject-checkpoint.d.ts +2 -0
- package/dist/mcp/tools/reject-checkpoint.d.ts.map +1 -0
- package/dist/mcp/tools/reject-checkpoint.js +79 -0
- package/dist/mcp/tools/reject-checkpoint.js.map +1 -0
- package/dist/mcp/tools/rollback.d.ts +2 -0
- package/dist/mcp/tools/rollback.d.ts.map +1 -0
- package/dist/mcp/tools/rollback.js +78 -0
- package/dist/mcp/tools/rollback.js.map +1 -0
- package/dist/mcp/tools/run-in-worktree.d.ts +2 -0
- package/dist/mcp/tools/run-in-worktree.d.ts.map +1 -0
- package/dist/mcp/tools/run-in-worktree.js +90 -0
- package/dist/mcp/tools/run-in-worktree.js.map +1 -0
- package/dist/mcp/tools/run.js +1 -1
- package/dist/mcp/tools/run.js.map +1 -1
- package/dist/mcp/tools/solidity.js +1 -1
- package/dist/mcp/tools/solidity.js.map +1 -1
- package/dist/mcp/tools/status.d.ts.map +1 -1
- package/dist/mcp/tools/status.js +11 -0
- package/dist/mcp/tools/status.js.map +1 -1
- package/dist/mcp/tools/subscribe-events.d.ts +2 -0
- package/dist/mcp/tools/subscribe-events.d.ts.map +1 -0
- package/dist/mcp/tools/subscribe-events.js +48 -0
- package/dist/mcp/tools/subscribe-events.js.map +1 -0
- package/dist/mcp/tools/unsubscribe-events.d.ts +2 -0
- package/dist/mcp/tools/unsubscribe-events.d.ts.map +1 -0
- package/dist/mcp/tools/unsubscribe-events.js +45 -0
- package/dist/mcp/tools/unsubscribe-events.js.map +1 -0
- package/dist/orchestrator/agent-loader.d.ts +16 -0
- package/dist/orchestrator/agent-loader.d.ts.map +1 -1
- package/dist/orchestrator/agent-loader.js +30 -0
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/agentic-loop.d.ts +51 -0
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -1
- package/dist/orchestrator/agentic-loop.js +123 -4
- package/dist/orchestrator/agentic-loop.js.map +1 -1
- package/dist/orchestrator/arch-lenses.d.ts +7 -0
- package/dist/orchestrator/arch-lenses.d.ts.map +1 -0
- package/dist/orchestrator/arch-lenses.js +22 -0
- package/dist/orchestrator/arch-lenses.js.map +1 -0
- package/dist/orchestrator/architect-agent.d.ts +16 -0
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +546 -9
- package/dist/orchestrator/architect-agent.js.map +1 -1
- package/dist/orchestrator/checkpoints/audit.d.ts +128 -0
- package/dist/orchestrator/checkpoints/audit.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/audit.js +272 -0
- package/dist/orchestrator/checkpoints/audit.js.map +1 -0
- package/dist/orchestrator/checkpoints/feedback-router.d.ts +213 -0
- package/dist/orchestrator/checkpoints/feedback-router.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/feedback-router.js +438 -0
- package/dist/orchestrator/checkpoints/feedback-router.js.map +1 -0
- package/dist/orchestrator/checkpoints/index.d.ts +11 -0
- package/dist/orchestrator/checkpoints/index.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/index.js +12 -0
- package/dist/orchestrator/checkpoints/index.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts +35 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.js +153 -0
- package/dist/orchestrator/checkpoints/mechanisms/cli.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts +34 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.js +139 -0
- package/dist/orchestrator/checkpoints/mechanisms/disk.js.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts +141 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.js +445 -0
- package/dist/orchestrator/checkpoints/mechanisms/pr.js.map +1 -0
- package/dist/orchestrator/checkpoints/noop.d.ts +12 -0
- package/dist/orchestrator/checkpoints/noop.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/noop.js +13 -0
- package/dist/orchestrator/checkpoints/noop.js.map +1 -0
- package/dist/orchestrator/checkpoints/registry.d.ts +48 -0
- package/dist/orchestrator/checkpoints/registry.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/registry.js +89 -0
- package/dist/orchestrator/checkpoints/registry.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/_util.d.ts +50 -0
- package/dist/orchestrator/checkpoints/renderers/_util.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/_util.js +137 -0
- package/dist/orchestrator/checkpoints/renderers/_util.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.js +66 -0
- package/dist/orchestrator/checkpoints/renderers/code-review.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.js +40 -0
- package/dist/orchestrator/checkpoints/renderers/curator-briefing.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.js +54 -0
- package/dist/orchestrator/checkpoints/renderers/eval-result.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts +49 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.js +154 -0
- package/dist/orchestrator/checkpoints/renderers/generator-diff.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js +59 -0
- package/dist/orchestrator/checkpoints/renderers/pipeline-summary.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/plan.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/plan.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/plan.js +34 -0
- package/dist/orchestrator/checkpoints/renderers/plan.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/registry.d.ts +43 -0
- package/dist/orchestrator/checkpoints/renderers/registry.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/registry.js +83 -0
- package/dist/orchestrator/checkpoints/renderers/registry.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/research.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/research.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/research.js +39 -0
- package/dist/orchestrator/checkpoints/renderers/research.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts +20 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.js +57 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-contract.js.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts +15 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.js +38 -0
- package/dist/orchestrator/checkpoints/renderers/sprint-summary.js.map +1 -0
- package/dist/orchestrator/checkpoints/sites.d.ts +22 -0
- package/dist/orchestrator/checkpoints/sites.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/sites.js +57 -0
- package/dist/orchestrator/checkpoints/sites.js.map +1 -0
- package/dist/orchestrator/checkpoints/types.d.ts +51 -0
- package/dist/orchestrator/checkpoints/types.d.ts.map +1 -0
- package/dist/orchestrator/checkpoints/types.js +9 -0
- package/dist/orchestrator/checkpoints/types.js.map +1 -0
- package/dist/orchestrator/code-reviewer-agent.d.ts +50 -0
- package/dist/orchestrator/code-reviewer-agent.d.ts.map +1 -0
- package/dist/orchestrator/code-reviewer-agent.js +283 -0
- package/dist/orchestrator/code-reviewer-agent.js.map +1 -0
- package/dist/orchestrator/curator-agent.d.ts.map +1 -1
- package/dist/orchestrator/curator-agent.js +60 -9
- package/dist/orchestrator/curator-agent.js.map +1 -1
- package/dist/orchestrator/deploy/classify.d.ts +31 -0
- package/dist/orchestrator/deploy/classify.d.ts.map +1 -0
- package/dist/orchestrator/deploy/classify.js +109 -0
- package/dist/orchestrator/deploy/classify.js.map +1 -0
- package/dist/orchestrator/deploy/execute.d.ts +45 -0
- package/dist/orchestrator/deploy/execute.d.ts.map +1 -0
- package/dist/orchestrator/deploy/execute.js +146 -0
- package/dist/orchestrator/deploy/execute.js.map +1 -0
- package/dist/orchestrator/deploy/executor.d.ts +22 -0
- package/dist/orchestrator/deploy/executor.d.ts.map +1 -0
- package/dist/orchestrator/deploy/executor.js +31 -0
- package/dist/orchestrator/deploy/executor.js.map +1 -0
- package/dist/orchestrator/deploy/index.d.ts +21 -0
- package/dist/orchestrator/deploy/index.d.ts.map +1 -0
- package/dist/orchestrator/deploy/index.js +21 -0
- package/dist/orchestrator/deploy/index.js.map +1 -0
- package/dist/orchestrator/deploy/resolve.d.ts +51 -0
- package/dist/orchestrator/deploy/resolve.d.ts.map +1 -0
- package/dist/orchestrator/deploy/resolve.js +53 -0
- package/dist/orchestrator/deploy/resolve.js.map +1 -0
- package/dist/orchestrator/deploy/spawn.d.ts +60 -0
- package/dist/orchestrator/deploy/spawn.d.ts.map +1 -0
- package/dist/orchestrator/deploy/spawn.js +62 -0
- package/dist/orchestrator/deploy/spawn.js.map +1 -0
- package/dist/orchestrator/deploy/types.d.ts +98 -0
- package/dist/orchestrator/deploy/types.d.ts.map +1 -0
- package/dist/orchestrator/deploy/types.js +39 -0
- package/dist/orchestrator/deploy/types.js.map +1 -0
- package/dist/orchestrator/documenter-agent.d.ts +57 -0
- package/dist/orchestrator/documenter-agent.d.ts.map +1 -0
- package/dist/orchestrator/documenter-agent.js +195 -0
- package/dist/orchestrator/documenter-agent.js.map +1 -0
- package/dist/orchestrator/environment.d.ts +45 -0
- package/dist/orchestrator/environment.d.ts.map +1 -0
- package/dist/orchestrator/environment.js +151 -0
- package/dist/orchestrator/environment.js.map +1 -0
- package/dist/orchestrator/eval-lenses.d.ts +7 -0
- package/dist/orchestrator/eval-lenses.d.ts.map +1 -0
- package/dist/orchestrator/eval-lenses.js +19 -0
- package/dist/orchestrator/eval-lenses.js.map +1 -0
- package/dist/orchestrator/eval-persist.d.ts +25 -0
- package/dist/orchestrator/eval-persist.d.ts.map +1 -0
- package/dist/orchestrator/eval-persist.js +74 -0
- package/dist/orchestrator/eval-persist.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts +23 -0
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +80 -10
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +53 -8
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/memory/distill.d.ts +60 -0
- package/dist/orchestrator/memory/distill.d.ts.map +1 -0
- package/dist/orchestrator/memory/distill.js +177 -0
- package/dist/orchestrator/memory/distill.js.map +1 -0
- package/dist/orchestrator/memory/eval-source.d.ts +20 -0
- package/dist/orchestrator/memory/eval-source.d.ts.map +1 -0
- package/dist/orchestrator/memory/eval-source.js +88 -0
- package/dist/orchestrator/memory/eval-source.js.map +1 -0
- package/dist/orchestrator/memory/retrieve.d.ts +45 -0
- package/dist/orchestrator/memory/retrieve.d.ts.map +1 -0
- package/dist/orchestrator/memory/retrieve.js +102 -0
- package/dist/orchestrator/memory/retrieve.js.map +1 -0
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +15 -1
- package/dist/orchestrator/model-resolver.js.map +1 -1
- package/dist/orchestrator/observability/index.d.ts +12 -0
- package/dist/orchestrator/observability/index.d.ts.map +1 -0
- package/dist/orchestrator/observability/index.js +12 -0
- package/dist/orchestrator/observability/index.js.map +1 -0
- package/dist/orchestrator/observability/merge.d.ts +73 -0
- package/dist/orchestrator/observability/merge.d.ts.map +1 -0
- package/dist/orchestrator/observability/merge.js +110 -0
- package/dist/orchestrator/observability/merge.js.map +1 -0
- package/dist/orchestrator/pipeline.d.ts +31 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +267 -5
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts +22 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +165 -8
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/research-agent.d.ts.map +1 -1
- package/dist/orchestrator/research-agent.js +48 -11
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +16 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +30 -5
- package/dist/orchestrator/tools/handlers.js.map +1 -1
- package/dist/orchestrator/tools/index.d.ts +84 -1
- package/dist/orchestrator/tools/index.d.ts.map +1 -1
- package/dist/orchestrator/tools/index.js +164 -1
- package/dist/orchestrator/tools/index.js.map +1 -1
- package/dist/orchestrator/tools/schemas.js +5 -5
- package/dist/orchestrator/tools/schemas.js.map +1 -1
- package/dist/orchestrator/workflow/args-builder.d.ts +35 -0
- package/dist/orchestrator/workflow/args-builder.d.ts.map +1 -0
- package/dist/orchestrator/workflow/args-builder.js +142 -0
- package/dist/orchestrator/workflow/args-builder.js.map +1 -0
- package/dist/orchestrator/workflow/budget.d.ts +57 -0
- package/dist/orchestrator/workflow/budget.d.ts.map +1 -0
- package/dist/orchestrator/workflow/budget.js +80 -0
- package/dist/orchestrator/workflow/budget.js.map +1 -0
- package/dist/orchestrator/workflow/conformance.d.ts +27 -0
- package/dist/orchestrator/workflow/conformance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/conformance.js +111 -0
- package/dist/orchestrator/workflow/conformance.js.map +1 -0
- package/dist/orchestrator/workflow/eligibility.d.ts +8 -0
- package/dist/orchestrator/workflow/eligibility.d.ts.map +1 -0
- package/dist/orchestrator/workflow/eligibility.js +10 -0
- package/dist/orchestrator/workflow/eligibility.js.map +1 -0
- package/dist/orchestrator/workflow/engine.d.ts +10 -0
- package/dist/orchestrator/workflow/engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/engine.js +2 -0
- package/dist/orchestrator/workflow/engine.js.map +1 -0
- package/dist/orchestrator/workflow/errors.d.ts +13 -0
- package/dist/orchestrator/workflow/errors.d.ts.map +1 -0
- package/dist/orchestrator/workflow/errors.js +26 -0
- package/dist/orchestrator/workflow/errors.js.map +1 -0
- package/dist/orchestrator/workflow/flusher.d.ts +19 -0
- package/dist/orchestrator/workflow/flusher.d.ts.map +1 -0
- package/dist/orchestrator/workflow/flusher.js +81 -0
- package/dist/orchestrator/workflow/flusher.js.map +1 -0
- package/dist/orchestrator/workflow/interpreter.d.ts +48 -0
- package/dist/orchestrator/workflow/interpreter.d.ts.map +1 -0
- package/dist/orchestrator/workflow/interpreter.js +92 -0
- package/dist/orchestrator/workflow/interpreter.js.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts +65 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.js +82 -0
- package/dist/orchestrator/workflow/pure-sprint.js.map +1 -0
- package/dist/orchestrator/workflow/reconciler.d.ts +15 -0
- package/dist/orchestrator/workflow/reconciler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/reconciler.js +65 -0
- package/dist/orchestrator/workflow/reconciler.js.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts +10 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.js +25 -0
- package/dist/orchestrator/workflow/resume-cursor.js.map +1 -0
- package/dist/orchestrator/workflow/retry.d.ts +50 -0
- package/dist/orchestrator/workflow/retry.d.ts.map +1 -0
- package/dist/orchestrator/workflow/retry.js +100 -0
- package/dist/orchestrator/workflow/retry.js.map +1 -0
- package/dist/orchestrator/workflow/scheduler.d.ts +87 -0
- package/dist/orchestrator/workflow/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/scheduler.js +158 -0
- package/dist/orchestrator/workflow/scheduler.js.map +1 -0
- package/dist/orchestrator/workflow/selector.d.ts +26 -0
- package/dist/orchestrator/workflow/selector.d.ts.map +1 -0
- package/dist/orchestrator/workflow/selector.js +54 -0
- package/dist/orchestrator/workflow/selector.js.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts +52 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.js +75 -0
- package/dist/orchestrator/workflow/synthesizer.js.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts +13 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.js +14 -0
- package/dist/orchestrator/workflow/ts-engine.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +55 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +3 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts +31 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.js +70 -0
- package/dist/orchestrator/workflow/workflow-engine.js.map +1 -0
- package/dist/orchestrator/worktree.d.ts +18 -0
- package/dist/orchestrator/worktree.d.ts.map +1 -0
- package/dist/orchestrator/worktree.js +129 -0
- package/dist/orchestrator/worktree.js.map +1 -0
- package/dist/providers/anthropic.d.ts +8 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +135 -11
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/claude-code.d.ts +44 -0
- package/dist/providers/claude-code.d.ts.map +1 -0
- package/dist/providers/claude-code.js +143 -0
- package/dist/providers/claude-code.js.map +1 -0
- package/dist/providers/factory.d.ts +16 -2
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +101 -14
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +32 -3
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +4 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +28 -3
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/preflight.d.ts +22 -0
- package/dist/providers/preflight.d.ts.map +1 -0
- package/dist/providers/preflight.js +54 -0
- package/dist/providers/preflight.js.map +1 -0
- package/dist/providers/structured.d.ts +130 -0
- package/dist/providers/structured.d.ts.map +1 -0
- package/dist/providers/structured.js +205 -0
- package/dist/providers/structured.js.map +1 -0
- package/dist/providers/types.d.ts +53 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/state/approval-state.d.ts +74 -0
- package/dist/state/approval-state.d.ts.map +1 -0
- package/dist/state/approval-state.js +127 -0
- package/dist/state/approval-state.js.map +1 -0
- package/dist/state/history-rotation.d.ts +17 -0
- package/dist/state/history-rotation.d.ts.map +1 -0
- package/dist/state/history-rotation.js +84 -0
- package/dist/state/history-rotation.js.map +1 -0
- package/dist/state/history.d.ts +16 -4
- package/dist/state/history.d.ts.map +1 -1
- package/dist/state/history.js +62 -20
- package/dist/state/history.js.map +1 -1
- package/dist/state/index.d.ts +4 -1
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +5 -2
- package/dist/state/index.js.map +1 -1
- package/dist/state/memory.d.ts +60 -0
- package/dist/state/memory.d.ts.map +1 -0
- package/dist/state/memory.js +242 -0
- package/dist/state/memory.js.map +1 -0
- package/dist/state/review-state.d.ts +15 -0
- package/dist/state/review-state.d.ts.map +1 -0
- package/dist/state/review-state.js +51 -0
- package/dist/state/review-state.js.map +1 -0
- package/dist/state/run-state.d.ts +39 -0
- package/dist/state/run-state.d.ts.map +1 -0
- package/dist/state/run-state.js +101 -0
- package/dist/state/run-state.js.map +1 -0
- package/dist/telemetry/emit.d.ts +41 -0
- package/dist/telemetry/emit.d.ts.map +1 -0
- package/dist/telemetry/emit.js +65 -0
- package/dist/telemetry/emit.js.map +1 -0
- package/dist/utils/git.d.ts +27 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +50 -0
- package/dist/utils/git.js.map +1 -1
- package/hooks/hooks.json +27 -1
- package/hooks/session-start +42 -0
- package/package.json +13 -6
- package/scripts/check-prereqs.sh +12 -0
- package/scripts/e2e-graph-smoke.sh +167 -0
- package/scripts/graph-hook.mjs +151 -0
- package/scripts/run-kpi-gate.mjs +245 -0
- package/scripts/spike-claude-code-provider.mjs +66 -0
- package/scripts/spike-deepseek.mjs +63 -0
- package/scripts/sync-skills.mjs +4 -1
- package/scripts/sync-targets.json +12 -0
- package/scripts/update-all.mjs +255 -0
- package/skills/bober.architect/SKILL.md +13 -0
- package/skills/bober.architect/references/arch-lens-panel.md +126 -0
- package/skills/bober.code-review/SKILL.md +186 -0
- package/skills/bober.debug/SKILL.md +300 -0
- package/skills/bober.deploy/SKILL.md +262 -0
- package/skills/bober.diagnose/SKILL.md +254 -0
- package/skills/bober.eval/SKILL.md +9 -0
- package/skills/bober.eval/references/lens-panel.md +115 -0
- package/skills/bober.graph/SKILL.md +85 -0
- package/skills/bober.impact/SKILL.md +101 -0
- package/skills/bober.incident/SKILL.md +245 -0
- package/skills/bober.onboard/SKILL.md +84 -0
- package/skills/bober.plan/SKILL.md +16 -0
- package/skills/bober.postmortem/SKILL.md +231 -0
- package/skills/bober.run/SKILL.md +23 -4
- package/skills/bober.run/references/lens-panel.md +115 -0
- package/skills/bober.runbook/SKILL.md +335 -0
- package/skills/bober.sprint/SKILL.md +44 -2
- package/skills/bober.sprint/references/lens-panel.md +115 -0
- package/skills/bober.using-bober/SKILL.md +133 -0
- package/skills/bober.verify/SKILL.md +143 -0
- package/skills/shared/arch-lens-panel.md +126 -0
- package/skills/shared/lens-panel.md +115 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token / agent budget tracking for a workflow run.
|
|
3
|
+
*
|
|
4
|
+
* Bounds the cost of a fan-out so a runaway script (parallel × retries × N
|
|
5
|
+
* sprints) can't spend without limit. Mirrors the intent of Claude Code's
|
|
6
|
+
* per-run budget: a hard ceiling on agents and an optional token ceiling.
|
|
7
|
+
*
|
|
8
|
+
* The {@link Scheduler} owns the live agent-count runaway guard for a single
|
|
9
|
+
* fan-out; `Budget` is the run-level accountant the interpreter (Sprint 3)
|
|
10
|
+
* charges as agents complete, surfacing `spent`/`remaining` for dynamic
|
|
11
|
+
* loops (`while (budget.remainingTokens() > 50_000) { ... }`).
|
|
12
|
+
*/
|
|
13
|
+
/** Raised by {@link Budget.assertWithinBudget} when a ceiling is exceeded. */
|
|
14
|
+
export class BudgetExceededError extends Error {
|
|
15
|
+
kind;
|
|
16
|
+
constructor(message,
|
|
17
|
+
/** Which ceiling was hit. */
|
|
18
|
+
kind) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.kind = kind;
|
|
21
|
+
this.name = "BudgetExceededError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class Budget {
|
|
25
|
+
opts;
|
|
26
|
+
inputTokens = 0;
|
|
27
|
+
outputTokens = 0;
|
|
28
|
+
agents = 0;
|
|
29
|
+
constructor(opts = {}) {
|
|
30
|
+
this.opts = opts;
|
|
31
|
+
}
|
|
32
|
+
/** Record an agent's token usage. */
|
|
33
|
+
chargeTokens(usage) {
|
|
34
|
+
this.inputTokens += usage.inputTokens;
|
|
35
|
+
this.outputTokens += usage.outputTokens;
|
|
36
|
+
}
|
|
37
|
+
/** Record `n` agent executions (default 1). */
|
|
38
|
+
chargeAgents(n = 1) {
|
|
39
|
+
this.agents += n;
|
|
40
|
+
}
|
|
41
|
+
/** Total tokens spent (input + output). */
|
|
42
|
+
get tokensSpent() {
|
|
43
|
+
return this.inputTokens + this.outputTokens;
|
|
44
|
+
}
|
|
45
|
+
/** Agent executions charged so far. */
|
|
46
|
+
get agentsSpent() {
|
|
47
|
+
return this.agents;
|
|
48
|
+
}
|
|
49
|
+
/** Remaining token headroom, or `Infinity` when uncapped. */
|
|
50
|
+
remainingTokens() {
|
|
51
|
+
const max = this.opts.maxTokens;
|
|
52
|
+
if (max === null || max === undefined)
|
|
53
|
+
return Infinity;
|
|
54
|
+
return Math.max(0, max - this.tokensSpent);
|
|
55
|
+
}
|
|
56
|
+
/** Remaining agent headroom, or `Infinity` when uncapped. */
|
|
57
|
+
remainingAgents() {
|
|
58
|
+
const max = this.opts.maxAgents;
|
|
59
|
+
if (max === null || max === undefined)
|
|
60
|
+
return Infinity;
|
|
61
|
+
return Math.max(0, max - this.agents);
|
|
62
|
+
}
|
|
63
|
+
/** True once any configured ceiling has been reached or passed. */
|
|
64
|
+
exceeded() {
|
|
65
|
+
return this.remainingTokens() === 0 || this.remainingAgents() === 0;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Throw {@link BudgetExceededError} if a ceiling has been reached. Call before
|
|
69
|
+
* dispatching the next agent to fail fast on the offending dimension.
|
|
70
|
+
*/
|
|
71
|
+
assertWithinBudget() {
|
|
72
|
+
if (this.remainingTokens() === 0) {
|
|
73
|
+
throw new BudgetExceededError(`Token budget exhausted (${String(this.opts.maxTokens ?? 0)} tokens).`, "tokens");
|
|
74
|
+
}
|
|
75
|
+
if (this.remainingAgents() === 0) {
|
|
76
|
+
throw new BudgetExceededError(`Agent budget exhausted (${String(this.opts.maxAgents ?? 0)} agents).`, "agents");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,8EAA8E;AAC9E,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAIjC;IAHX,YACE,OAAe;IACf,6BAA6B;IACpB,IAAyB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,SAAI,GAAJ,IAAI,CAAq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;IACxC,CAAC;IAED,mEAAmE;IACnE,QAAQ;QACN,OAAO,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,mBAAmB,CAC3B,2BAA2B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW,EACtE,QAAQ,CACT,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,mBAAmB,CAC3B,2BAA2B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW,EACtE,QAAQ,CACT,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PipelineEngineName } from "./engine.js";
|
|
2
|
+
import type { ConformanceReport } from "./types.js";
|
|
3
|
+
/** Deterministic runner the TEST injects — NOT a real engine. */
|
|
4
|
+
export type EngineRunner = (projectRoot: string) => Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Asserts that two or more pipeline engines produce equivalent .bober/ artifacts
|
|
7
|
+
* for a given fixture spec, ignoring volatile fields (timestamps, durations, runIds).
|
|
8
|
+
*
|
|
9
|
+
* DESIGN: No real engines run internally. The caller provides `runnerFor` which
|
|
10
|
+
* returns a deterministic EngineRunner per engine name. Each runner writes fixed
|
|
11
|
+
* .bober/ artifacts to a fresh projectRoot supplied by projectRootFactory().
|
|
12
|
+
* The harness reads back, normalizes, and deep-compares.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EngineConformanceHarness {
|
|
15
|
+
/**
|
|
16
|
+
* Run each engine's runner against a fresh projectRoot, read back artifacts,
|
|
17
|
+
* normalize (strip volatile fields), and deep-compare across engine pairs.
|
|
18
|
+
*
|
|
19
|
+
* @param fixtureSpecId The spec ID to pass to runners (informational).
|
|
20
|
+
* @param engines Names of engines to compare (at least two for a diff).
|
|
21
|
+
* @param projectRootFactory Returns a FRESH temporary root per engine.
|
|
22
|
+
* @param runnerFor Returns the deterministic EngineRunner for each engine.
|
|
23
|
+
* @returns ConformanceReport with equivalent:true if all artifacts match.
|
|
24
|
+
*/
|
|
25
|
+
assertEquivalent(fixtureSpecId: string, engines: PipelineEngineName[], projectRootFactory: () => Promise<string>, runnerFor: (engine: PipelineEngineName) => EngineRunner): Promise<ConformanceReport>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/conformance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,iEAAiE;AACjE,MAAM,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AA2ClE;;;;;;;;GAQG;AACH,qBAAa,wBAAwB;IACnC;;;;;;;;;OASG;IACG,gBAAgB,CACpB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,kBAAkB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACzC,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,YAAY,GACtD,OAAO,CAAC,iBAAiB,CAAC;CA0E9B"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// ── EngineConformanceHarness ────────────────────────────────────────
|
|
2
|
+
import { listContracts } from "../../state/sprint-state.js";
|
|
3
|
+
import { loadHistory } from "../../state/history.js";
|
|
4
|
+
import { logger } from "../../utils/logger.js";
|
|
5
|
+
// ── Normalization ────────────────────────────────────────────────────
|
|
6
|
+
// Volatile fields stripped before deep-compare.
|
|
7
|
+
// Covers: SprintContract, PlanSpec, HistoryEntry, EvalResult, PipelineResult
|
|
8
|
+
const VOLATILE_KEYS = new Set([
|
|
9
|
+
"createdAt",
|
|
10
|
+
"updatedAt",
|
|
11
|
+
"startedAt",
|
|
12
|
+
"completedAt",
|
|
13
|
+
"timestamp",
|
|
14
|
+
"duration",
|
|
15
|
+
"runId",
|
|
16
|
+
"totalCost",
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Recursively deep-clone an object, stripping all volatile fields at every depth.
|
|
20
|
+
* This lets the harness compare normalized .bober/ artifacts across engines
|
|
21
|
+
* without noise from timestamps, durations, or run IDs.
|
|
22
|
+
*/
|
|
23
|
+
function normalize(value) {
|
|
24
|
+
if (value === null || typeof value !== "object") {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
return value.map(normalize);
|
|
29
|
+
}
|
|
30
|
+
const obj = value;
|
|
31
|
+
const result = {};
|
|
32
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
33
|
+
if (!VOLATILE_KEYS.has(k)) {
|
|
34
|
+
result[k] = normalize(v);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
// ── EngineConformanceHarness ─────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* Asserts that two or more pipeline engines produce equivalent .bober/ artifacts
|
|
42
|
+
* for a given fixture spec, ignoring volatile fields (timestamps, durations, runIds).
|
|
43
|
+
*
|
|
44
|
+
* DESIGN: No real engines run internally. The caller provides `runnerFor` which
|
|
45
|
+
* returns a deterministic EngineRunner per engine name. Each runner writes fixed
|
|
46
|
+
* .bober/ artifacts to a fresh projectRoot supplied by projectRootFactory().
|
|
47
|
+
* The harness reads back, normalizes, and deep-compares.
|
|
48
|
+
*/
|
|
49
|
+
export class EngineConformanceHarness {
|
|
50
|
+
/**
|
|
51
|
+
* Run each engine's runner against a fresh projectRoot, read back artifacts,
|
|
52
|
+
* normalize (strip volatile fields), and deep-compare across engine pairs.
|
|
53
|
+
*
|
|
54
|
+
* @param fixtureSpecId The spec ID to pass to runners (informational).
|
|
55
|
+
* @param engines Names of engines to compare (at least two for a diff).
|
|
56
|
+
* @param projectRootFactory Returns a FRESH temporary root per engine.
|
|
57
|
+
* @param runnerFor Returns the deterministic EngineRunner for each engine.
|
|
58
|
+
* @returns ConformanceReport with equivalent:true if all artifacts match.
|
|
59
|
+
*/
|
|
60
|
+
async assertEquivalent(fixtureSpecId, engines, projectRootFactory, runnerFor) {
|
|
61
|
+
// ── Collect per-engine normalized artifacts ─────────────────────────────
|
|
62
|
+
const perEngine = {};
|
|
63
|
+
for (const engine of engines) {
|
|
64
|
+
const root = await projectRootFactory();
|
|
65
|
+
const runner = runnerFor(engine);
|
|
66
|
+
logger.debug(`[conformance] running ${engine} runner against ${root} (specId=${fixtureSpecId})`);
|
|
67
|
+
await runner(root);
|
|
68
|
+
const rawContracts = await listContracts(root);
|
|
69
|
+
const rawHistory = await loadHistory(root);
|
|
70
|
+
perEngine[engine] = {
|
|
71
|
+
contracts: normalize(rawContracts),
|
|
72
|
+
history: normalize(rawHistory),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// ── Deep-compare normalized artifacts across engine pairs ───────────────
|
|
76
|
+
const diffs = [];
|
|
77
|
+
for (let i = 0; i < engines.length; i++) {
|
|
78
|
+
for (let j = i + 1; j < engines.length; j++) {
|
|
79
|
+
const nameA = engines[i];
|
|
80
|
+
const nameB = engines[j];
|
|
81
|
+
const a = perEngine[nameA];
|
|
82
|
+
const b = perEngine[nameB];
|
|
83
|
+
// Compare contracts
|
|
84
|
+
if (JSON.stringify(a.contracts) !== JSON.stringify(b.contracts)) {
|
|
85
|
+
diffs.push({
|
|
86
|
+
artifact: "contract",
|
|
87
|
+
path: ".bober/contracts/",
|
|
88
|
+
engines: [nameA, nameB],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// Compare history
|
|
92
|
+
if (JSON.stringify(a.history) !== JSON.stringify(b.history)) {
|
|
93
|
+
diffs.push({
|
|
94
|
+
artifact: "history",
|
|
95
|
+
path: ".bober/history.jsonl",
|
|
96
|
+
engines: [nameA, nameB],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const report = {
|
|
102
|
+
equivalent: diffs.length === 0,
|
|
103
|
+
diffs,
|
|
104
|
+
};
|
|
105
|
+
if (!report.equivalent) {
|
|
106
|
+
logger.info(`[conformance] artifact divergence detected: ${diffs.length} diff(s) across engines [${engines.join(", ")}]`);
|
|
107
|
+
}
|
|
108
|
+
return report;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/conformance.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAS/C,wEAAwE;AAExE,gDAAgD;AAChD,6EAA6E;AAC7E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,UAAU;IACV,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,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AEF,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CACT,+CAA+C,KAAK,CAAC,MAAM,4BAA4B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC7G,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BoberConfig } from "../../config/schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Conservative default-ineligible workflow probe.
|
|
4
|
+
* TODO(sprint-6): contact the runtime and return true only when
|
|
5
|
+
* Claude Code >= 2.1.154 with Dynamic Workflows is available.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isWorkflowEligible(_config: BoberConfig): boolean;
|
|
8
|
+
//# sourceMappingURL=eligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/eligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// ── Eligibility ────────────────────────────────────────────────────
|
|
2
|
+
/**
|
|
3
|
+
* Conservative default-ineligible workflow probe.
|
|
4
|
+
* TODO(sprint-6): contact the runtime and return true only when
|
|
5
|
+
* Claude Code >= 2.1.154 with Dynamic Workflows is available.
|
|
6
|
+
*/
|
|
7
|
+
export function isWorkflowEligible(_config) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=eligibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eligibility.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/eligibility.ts"],"names":[],"mappings":"AAEA,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoB;IACrD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BoberConfig } from "../../config/schema.js";
|
|
2
|
+
import type { PipelineResult } from "../pipeline.js";
|
|
3
|
+
/** Well-known orchestration engine names. Mirrors the z.enum in PipelineSectionSchema. */
|
|
4
|
+
export type PipelineEngineName = "ts" | "skill" | "workflow";
|
|
5
|
+
/** Interface every pipeline engine implementation must satisfy. */
|
|
6
|
+
export interface PipelineEngine {
|
|
7
|
+
readonly name: PipelineEngineName;
|
|
8
|
+
run(userPrompt: string, projectRoot: string, config: BoberConfig): Promise<PipelineResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7D,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,GAAG,CACD,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/engine.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class MissingKnobError extends Error {
|
|
2
|
+
constructor(knob: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class AgentCapError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class NonSerializableArgError extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class WorkflowUnavailableError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/errors.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,IAAI,EAAE,MAAM;CAIzB;AAED,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// ── Typed errors (host-side, build-time) ────────────────────────────
|
|
2
|
+
export class MissingKnobError extends Error {
|
|
3
|
+
constructor(knob) {
|
|
4
|
+
super(`Required workflow knob "${knob}" is unset; refusing to silently default.`);
|
|
5
|
+
this.name = "MissingKnobError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export class AgentCapError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "AgentCapError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class NonSerializableArgError extends Error {
|
|
15
|
+
constructor(message) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = "NonSerializableArgError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class WorkflowUnavailableError extends Error {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "WorkflowUnavailableError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/errors.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,IAAY;QACtB,KAAK,CAAC,2BAA2B,IAAI,2CAA2C,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BoberConfig } from "../../config/schema.js";
|
|
2
|
+
import { loadContract, listContracts } from "../../state/sprint-state.js";
|
|
3
|
+
import type { WorkflowRunResult } from "./types.js";
|
|
4
|
+
import type { PipelineResult } from "../pipeline.js";
|
|
5
|
+
export declare class RunResultFlusher {
|
|
6
|
+
/**
|
|
7
|
+
* Commit a WorkflowRunResult to durable .bober/ state.
|
|
8
|
+
*
|
|
9
|
+
* Write sequence (mirrors pipeline.ts:381-394):
|
|
10
|
+
* 1. For each sprint: updateContractStatus → updateContract (crash-safe per-contract).
|
|
11
|
+
* 2. updateProgress after each contract (cumulative list, crash-safe).
|
|
12
|
+
* 3. After all contracts: appendHistory for each pendingHistory entry (stamped).
|
|
13
|
+
* 4. Save the spec.
|
|
14
|
+
* 5. Return PipelineResult.
|
|
15
|
+
*/
|
|
16
|
+
flush(projectRoot: string, _config: BoberConfig, result: WorkflowRunResult): Promise<PipelineResult>;
|
|
17
|
+
}
|
|
18
|
+
export { loadContract, listContracts };
|
|
19
|
+
//# sourceMappingURL=flusher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusher.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/flusher.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAkB,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,qBAAa,gBAAgB;IAC3B;;;;;;;;;OASG;IACG,KAAK,CACT,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC;CAmE3B;AAID,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// ── RunResultFlusher ─────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Host-side flusher: commits a WorkflowRunResult from the JS workflow script
|
|
4
|
+
// to durable .bober/ state. This class is the ONLY clock source for the
|
|
5
|
+
// workflow engine — new Date() is called here, never in the script.
|
|
6
|
+
//
|
|
7
|
+
// Flush strategy:
|
|
8
|
+
// - Per-contract: update status + write contract, then updateProgress (crash-safe).
|
|
9
|
+
// - pendingHistory: appended ONCE after all contracts have been flushed
|
|
10
|
+
// (history entries are not per-contract; the list is global to the run).
|
|
11
|
+
// Re-flushing the same result appends the same entries again — callers
|
|
12
|
+
// must ensure idempotency at the orchestration layer (skip-completed cursor).
|
|
13
|
+
import { updateContractStatus } from "../../contracts/sprint-contract.js";
|
|
14
|
+
import { updateContract, loadContract, listContracts } from "../../state/sprint-state.js";
|
|
15
|
+
import { appendHistory, updateProgress } from "../../state/history.js";
|
|
16
|
+
import { ensureBoberDir, saveSpec } from "../../state/index.js";
|
|
17
|
+
export class RunResultFlusher {
|
|
18
|
+
/**
|
|
19
|
+
* Commit a WorkflowRunResult to durable .bober/ state.
|
|
20
|
+
*
|
|
21
|
+
* Write sequence (mirrors pipeline.ts:381-394):
|
|
22
|
+
* 1. For each sprint: updateContractStatus → updateContract (crash-safe per-contract).
|
|
23
|
+
* 2. updateProgress after each contract (cumulative list, crash-safe).
|
|
24
|
+
* 3. After all contracts: appendHistory for each pendingHistory entry (stamped).
|
|
25
|
+
* 4. Save the spec.
|
|
26
|
+
* 5. Return PipelineResult.
|
|
27
|
+
*/
|
|
28
|
+
async flush(projectRoot, _config, result) {
|
|
29
|
+
const startTime = Date.now();
|
|
30
|
+
await ensureBoberDir(projectRoot);
|
|
31
|
+
const completedSprints = [];
|
|
32
|
+
const failedSprints = [];
|
|
33
|
+
// ── Per-contract loop (crash-safe: flush after each) ────────────────
|
|
34
|
+
for (const sprint of result.perSprint) {
|
|
35
|
+
const contractStatus = sprint.outcome === "passed"
|
|
36
|
+
? "passed"
|
|
37
|
+
: sprint.outcome === "needs-rework"
|
|
38
|
+
? "needs-rework"
|
|
39
|
+
: "failed";
|
|
40
|
+
// Stamp updatedAt / completedAt (host is the only clock)
|
|
41
|
+
const stamped = updateContractStatus(sprint.contract, contractStatus);
|
|
42
|
+
// Persist — atomic per file (updateContract = saveContract with same id)
|
|
43
|
+
await updateContract(projectRoot, stamped);
|
|
44
|
+
// Accumulate before updateProgress so the progress file always reflects
|
|
45
|
+
// all contracts flushed so far
|
|
46
|
+
if (contractStatus === "passed") {
|
|
47
|
+
completedSprints.push(stamped);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
failedSprints.push(stamped);
|
|
51
|
+
}
|
|
52
|
+
// updateProgress with cumulative list (crash-safe checkpoint after each contract)
|
|
53
|
+
await updateProgress(projectRoot, [...completedSprints, ...failedSprints], result.spec);
|
|
54
|
+
}
|
|
55
|
+
// ── History: append all pendingHistory entries with stamped timestamps ──
|
|
56
|
+
//
|
|
57
|
+
// Appended once after the per-contract loop. Each entry receives a fresh
|
|
58
|
+
// new Date().toISOString() stamp here — the script passed Omit<HistoryEntry,"timestamp">.
|
|
59
|
+
for (const partial of result.pendingHistory) {
|
|
60
|
+
await appendHistory(projectRoot, {
|
|
61
|
+
...partial,
|
|
62
|
+
timestamp: new Date().toISOString(),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// ── Persist the spec ────────────────────────────────────────────────
|
|
66
|
+
await saveSpec(projectRoot, result.spec);
|
|
67
|
+
// ── Return PipelineResult (pipeline.ts:809-810 success formula) ─────
|
|
68
|
+
return {
|
|
69
|
+
success: failedSprints.length === 0 && completedSprints.length > 0,
|
|
70
|
+
spec: result.spec,
|
|
71
|
+
completedSprints,
|
|
72
|
+
failedSprints,
|
|
73
|
+
duration: Date.now() - startTime,
|
|
74
|
+
needsClarification: result.needsClarification,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Re-export for test convenience (allows tests to load contracts back without
|
|
79
|
+
// importing sprint-state directly if they already import flusher).
|
|
80
|
+
export { loadContract, listContracts };
|
|
81
|
+
//# sourceMappingURL=flusher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusher.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/flusher.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,oEAAoE;AACpE,EAAE;AACF,kBAAkB;AAClB,sFAAsF;AACtF,0EAA0E;AAC1E,6EAA6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AkF;YAClF,MAAM,cAAc,CAClB,WAAW,EACX,CAAC,GAAG,gBAAgB,EAAE,GAAG,aAAa,CAAC,EACvC,MAAM,CAAC,IAAI,CACZ,CAAC;QACJ,CAAC;QAED,2EAA2E;QAC3E,EAAE;QACF,yEAAyE;QACzE,0FAA0F;QAE1F,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC5C,MAAM,aAAa,CAAC,WAAW,EAAE;gBAC/B,GAAG,OAAO;gBACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC,CAAC;QACL,CAAC;QAED,uEAAuE;QAEvE,MAAM,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAEzC,uEAAuE;QAEvE,OAAO;YACL,OAAO,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC;YAClE,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,gBAAgB;YAChB,aAAa;YACb,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAChC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;SAC9C,CAAC;IACJ,CAAC;CACF;AAED,8EAA8E;AAC9E,mEAAmE;AACnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow interpreter — the live body of the (currently dormant) WorkflowEngine
|
|
3
|
+
* invoke() seam.
|
|
4
|
+
*
|
|
5
|
+
* Reproduces the TS pipeline's plan → sprint-loop orchestration as PURE
|
|
6
|
+
* computation: it produces a {@link WorkflowRunResult} and writes nothing.
|
|
7
|
+
* `RunResultFlusher.flush()` commits the result afterward (the sole clock/commit
|
|
8
|
+
* source). Plan / contract-derivation / sprint-cycle are injected
|
|
9
|
+
* ({@link WorkflowDeps}) so the interpreter is hermetically testable; the real
|
|
10
|
+
* agent wiring (default deps) and the invoke() rewire + eligibility flip land in
|
|
11
|
+
* Sprint 5.
|
|
12
|
+
*
|
|
13
|
+
* Resume: contracts whose `sprintNumber` is in `args.resumeCursor.completed-
|
|
14
|
+
* SprintNumbers` are filtered out BEFORE dispatch, so the result only contains
|
|
15
|
+
* newly-run sprints — the flusher then appends only their history (no
|
|
16
|
+
* double-write on re-run).
|
|
17
|
+
*/
|
|
18
|
+
import type { WorkflowArgs, WorkflowRunResult } from "./types.js";
|
|
19
|
+
import type { PlanSpec } from "../../contracts/spec.js";
|
|
20
|
+
import type { SprintContract } from "../../contracts/sprint-contract.js";
|
|
21
|
+
import { Scheduler } from "./scheduler.js";
|
|
22
|
+
import type { SprintInput, SprintOutcome } from "./pure-sprint.js";
|
|
23
|
+
export interface PlanResult {
|
|
24
|
+
spec: PlanSpec;
|
|
25
|
+
needsClarification: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface WorkflowDeps {
|
|
28
|
+
/** Produce or load the plan spec for the run. */
|
|
29
|
+
plan: (args: WorkflowArgs, projectRoot: string) => Promise<PlanResult>;
|
|
30
|
+
/** Derive sprint contracts from a spec (used when preloadedContracts is empty). */
|
|
31
|
+
buildContracts: (spec: PlanSpec, args: WorkflowArgs) => SprintContract[];
|
|
32
|
+
/** Run one sprint's pure (side-effect-free) generate→evaluate cycle. */
|
|
33
|
+
runSprint: (input: SprintInput) => Promise<SprintOutcome>;
|
|
34
|
+
}
|
|
35
|
+
export interface RunWorkflowOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Scheduler used to run the sprint loop. Defaults to a sequential scheduler
|
|
38
|
+
* (maxConcurrent 1) for TS-pipeline parity. Sprint 5 raises the cap and adds
|
|
39
|
+
* dependsOn-aware ordering for true cross-sprint parallelism.
|
|
40
|
+
*/
|
|
41
|
+
scheduler?: Scheduler;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Run the workflow: plan → derive contracts → (skip completed) → sprint loop →
|
|
45
|
+
* aggregate into a {@link WorkflowRunResult}. Writes nothing.
|
|
46
|
+
*/
|
|
47
|
+
export declare function runWorkflow(args: WorkflowArgs, projectRoot: string, deps: WorkflowDeps, opts?: RunWorkflowOptions): Promise<WorkflowRunResult>;
|
|
48
|
+
//# sourceMappingURL=interpreter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/interpreter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAInE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,IAAI,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACvE,mFAAmF;IACnF,cAAc,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,cAAc,EAAE,CAAC;IACzE,wEAAwE;IACxE,SAAS,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,YAAY,EAClB,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAsF5B"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow interpreter — the live body of the (currently dormant) WorkflowEngine
|
|
3
|
+
* invoke() seam.
|
|
4
|
+
*
|
|
5
|
+
* Reproduces the TS pipeline's plan → sprint-loop orchestration as PURE
|
|
6
|
+
* computation: it produces a {@link WorkflowRunResult} and writes nothing.
|
|
7
|
+
* `RunResultFlusher.flush()` commits the result afterward (the sole clock/commit
|
|
8
|
+
* source). Plan / contract-derivation / sprint-cycle are injected
|
|
9
|
+
* ({@link WorkflowDeps}) so the interpreter is hermetically testable; the real
|
|
10
|
+
* agent wiring (default deps) and the invoke() rewire + eligibility flip land in
|
|
11
|
+
* Sprint 5.
|
|
12
|
+
*
|
|
13
|
+
* Resume: contracts whose `sprintNumber` is in `args.resumeCursor.completed-
|
|
14
|
+
* SprintNumbers` are filtered out BEFORE dispatch, so the result only contains
|
|
15
|
+
* newly-run sprints — the flusher then appends only their history (no
|
|
16
|
+
* double-write on re-run).
|
|
17
|
+
*/
|
|
18
|
+
import { Scheduler } from "./scheduler.js";
|
|
19
|
+
/**
|
|
20
|
+
* Run the workflow: plan → derive contracts → (skip completed) → sprint loop →
|
|
21
|
+
* aggregate into a {@link WorkflowRunResult}. Writes nothing.
|
|
22
|
+
*/
|
|
23
|
+
export async function runWorkflow(args, projectRoot, deps, opts = {}) {
|
|
24
|
+
const scheduler = opts.scheduler ?? new Scheduler({ maxConcurrent: 1 });
|
|
25
|
+
const pendingHistory = [];
|
|
26
|
+
// ── Plan (or reuse preloaded spec on resume) ───────────────────────
|
|
27
|
+
let spec;
|
|
28
|
+
let needsClarification = false;
|
|
29
|
+
if (args.preloadedSpec) {
|
|
30
|
+
spec = args.preloadedSpec;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const planned = await deps.plan(args, projectRoot);
|
|
34
|
+
spec = planned.spec;
|
|
35
|
+
needsClarification = planned.needsClarification;
|
|
36
|
+
}
|
|
37
|
+
pendingHistory.push({
|
|
38
|
+
event: "workflow-planning-complete",
|
|
39
|
+
phase: "planning",
|
|
40
|
+
details: { specId: spec.specId },
|
|
41
|
+
});
|
|
42
|
+
if (needsClarification) {
|
|
43
|
+
pendingHistory.push({
|
|
44
|
+
event: "planning-needs-clarification",
|
|
45
|
+
phase: "planning",
|
|
46
|
+
details: { specId: spec.specId },
|
|
47
|
+
});
|
|
48
|
+
return { spec, perSprint: [], needsClarification: true, pendingHistory };
|
|
49
|
+
}
|
|
50
|
+
// ── Contracts (preloaded on resume, else derived from the spec) ────
|
|
51
|
+
const allContracts = args.preloadedContracts.length > 0
|
|
52
|
+
? args.preloadedContracts
|
|
53
|
+
: deps.buildContracts(spec, args);
|
|
54
|
+
const capped = allContracts.slice(0, Math.min(allContracts.length, args.knobs.maxSprints));
|
|
55
|
+
// ── Skip-completed (resume) — filter BEFORE dispatch ───────────────
|
|
56
|
+
const completed = new Set(args.resumeCursor.completedSprintNumbers);
|
|
57
|
+
const pending = capped.filter((c) => !completed.has(c.sprintNumber));
|
|
58
|
+
// ── Sprint loop (scheduler-bounded; results index-aligned) ─────────
|
|
59
|
+
const outcomes = await scheduler.parallel(pending.map((contract) => () => deps.runSprint({
|
|
60
|
+
contract,
|
|
61
|
+
spec,
|
|
62
|
+
maxIterations: args.knobs.maxIterations,
|
|
63
|
+
priorPassed: [],
|
|
64
|
+
})));
|
|
65
|
+
const perSprint = outcomes.map((o) => ({
|
|
66
|
+
contract: o.contract,
|
|
67
|
+
finalVerdict: o.finalVerdict,
|
|
68
|
+
iterationsUsed: o.iterationsUsed,
|
|
69
|
+
outcome: o.outcome,
|
|
70
|
+
lensVerdicts: o.lensVerdicts,
|
|
71
|
+
}));
|
|
72
|
+
for (const o of outcomes) {
|
|
73
|
+
pendingHistory.push({
|
|
74
|
+
event: "workflow-sprint-evaluated",
|
|
75
|
+
phase: o.outcome === "passed" ? "complete" : "evaluating",
|
|
76
|
+
sprintId: o.contract.contractId,
|
|
77
|
+
details: { outcome: o.outcome, iterations: o.iterationsUsed },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const allPassed = perSprint.length > 0 && perSprint.every((p) => p.outcome === "passed");
|
|
81
|
+
pendingHistory.push({
|
|
82
|
+
event: "workflow-complete",
|
|
83
|
+
phase: allPassed ? "complete" : "failed",
|
|
84
|
+
details: {
|
|
85
|
+
total: perSprint.length,
|
|
86
|
+
passed: perSprint.filter((p) => p.outcome === "passed").length,
|
|
87
|
+
failed: perSprint.filter((p) => p.outcome !== "passed").length,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
return { spec, perSprint, needsClarification: false, pendingHistory };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=interpreter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpreter.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/interpreter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA4B3C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAkB,EAClB,WAAmB,EACnB,IAAkB,EAClB,OAA2B,EAAE;IAE7B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,MAAM,cAAc,GAAqB,EAAE,CAAC;IAE5C,sEAAsE;IACtE,IAAI,IAAc,CAAC;IACnB,IAAI,kBAAkB,GAAG,KAAK,CAAC;IAC/B,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,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