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,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure (side-effect-free) sprint cycle for the workflow interpreter.
|
|
3
|
+
*
|
|
4
|
+
* The TS pipeline's `runSprintCycle` (pipeline.ts:131) writes contracts, history,
|
|
5
|
+
* and audit checkpoints to `.bober/` inline. The workflow engine makes
|
|
6
|
+
* `RunResultFlusher` the SOLE clock/commit source — so the interpreter needs a
|
|
7
|
+
* sprint cycle that produces a result WITHOUT touching disk. This is that cycle:
|
|
8
|
+
* a generate→evaluate retry loop that returns a {@link SprintOutcome} and writes
|
|
9
|
+
* nothing. The flusher commits it afterward.
|
|
10
|
+
*
|
|
11
|
+
* The curate / generate / evaluate steps are INJECTED ({@link PureSprintDeps}):
|
|
12
|
+
* Sprint 3 ships the loop + its tests with fakes; the real wiring (runCurator /
|
|
13
|
+
* runGenerator / panel evaluator) is attached in the interpreter's default deps
|
|
14
|
+
* (Sprint 5, when eligibility flips). EvalResult timestamps come from the
|
|
15
|
+
* evaluator (real evaluation data) — never synthesized here — so this stays
|
|
16
|
+
* clock-free for the host's history stamping.
|
|
17
|
+
*/
|
|
18
|
+
import type { SprintContract } from "../../contracts/sprint-contract.js";
|
|
19
|
+
import type { EvalResult } from "../../contracts/eval-result.js";
|
|
20
|
+
import type { PlanSpec } from "../../contracts/spec.js";
|
|
21
|
+
export type SprintOutcomeKind = "passed" | "needs-rework" | "failed";
|
|
22
|
+
export interface SprintInput {
|
|
23
|
+
contract: SprintContract;
|
|
24
|
+
spec: PlanSpec;
|
|
25
|
+
/** Max generate→evaluate iterations for this sprint. */
|
|
26
|
+
maxIterations: number;
|
|
27
|
+
/** Contracts that already passed — context for the generator/curator. */
|
|
28
|
+
priorPassed: SprintContract[];
|
|
29
|
+
}
|
|
30
|
+
export interface SprintOutcome {
|
|
31
|
+
contract: SprintContract;
|
|
32
|
+
finalVerdict: EvalResult;
|
|
33
|
+
iterationsUsed: number;
|
|
34
|
+
outcome: SprintOutcomeKind;
|
|
35
|
+
/** The per-lens verdicts from the final iteration (length >= 1). */
|
|
36
|
+
lensVerdicts: EvalResult[];
|
|
37
|
+
}
|
|
38
|
+
/** One generation attempt's result (provider-agnostic, side-effect-free). */
|
|
39
|
+
export interface GenerationResult {
|
|
40
|
+
/** True if the generator hit a hard blocker it could not resolve. */
|
|
41
|
+
blocked: boolean;
|
|
42
|
+
/** Free-form summary, threaded into the next iteration's feedback. */
|
|
43
|
+
summary: string;
|
|
44
|
+
}
|
|
45
|
+
export type ReconcileFn = (contractId: string, iteration: number, verdicts: EvalResult[], timestamp: string) => EvalResult;
|
|
46
|
+
export interface PureSprintDeps {
|
|
47
|
+
/** Optional one-shot context curation; returns a briefing string. */
|
|
48
|
+
curate?: (input: SprintInput) => Promise<string>;
|
|
49
|
+
/** Run one generation attempt. `feedback` is empty on the first iteration. */
|
|
50
|
+
generate: (input: SprintInput, briefing: string, feedback: string) => Promise<GenerationResult>;
|
|
51
|
+
/** Evaluate current state → one or more lens verdicts for this iteration. */
|
|
52
|
+
evaluate: (input: SprintInput, iteration: number) => Promise<EvalResult[]>;
|
|
53
|
+
/** Reduce lens verdicts to one verdict. Defaults to the majority-vote reconciler. */
|
|
54
|
+
reconcile?: ReconcileFn;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Run a single sprint's generate→evaluate retry loop, side-effect-free.
|
|
58
|
+
*
|
|
59
|
+
* Each iteration: (curate once) → generate → evaluate → reconcile. Returns
|
|
60
|
+
* `passed` as soon as a verdict passes (and the generator isn't blocked);
|
|
61
|
+
* `failed` if the generator reports a hard blocker; `needs-rework` if the
|
|
62
|
+
* iteration budget is exhausted without passing.
|
|
63
|
+
*/
|
|
64
|
+
export declare function runPureSprint(input: SprintInput, deps: PureSprintDeps): Promise<SprintOutcome>;
|
|
65
|
+
//# sourceMappingURL=pure-sprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pure-sprint.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/pure-sprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;A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O,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3E,qFAAqF;IACrF,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAaD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,aAAa,CAAC,CAqDxB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure (side-effect-free) sprint cycle for the workflow interpreter.
|
|
3
|
+
*
|
|
4
|
+
* The TS pipeline's `runSprintCycle` (pipeline.ts:131) writes contracts, history,
|
|
5
|
+
* and audit checkpoints to `.bober/` inline. The workflow engine makes
|
|
6
|
+
* `RunResultFlusher` the SOLE clock/commit source — so the interpreter needs a
|
|
7
|
+
* sprint cycle that produces a result WITHOUT touching disk. This is that cycle:
|
|
8
|
+
* a generate→evaluate retry loop that returns a {@link SprintOutcome} and writes
|
|
9
|
+
* nothing. The flusher commits it afterward.
|
|
10
|
+
*
|
|
11
|
+
* The curate / generate / evaluate steps are INJECTED ({@link PureSprintDeps}):
|
|
12
|
+
* Sprint 3 ships the loop + its tests with fakes; the real wiring (runCurator /
|
|
13
|
+
* runGenerator / panel evaluator) is attached in the interpreter's default deps
|
|
14
|
+
* (Sprint 5, when eligibility flips). EvalResult timestamps come from the
|
|
15
|
+
* evaluator (real evaluation data) — never synthesized here — so this stays
|
|
16
|
+
* clock-free for the host's history stamping.
|
|
17
|
+
*/
|
|
18
|
+
import { reconcile } from "./reconciler.js";
|
|
19
|
+
/** Use a verdict's own timestamp (evaluation data); epoch fallback if none. */
|
|
20
|
+
function pickTimestamp(verdicts) {
|
|
21
|
+
return verdicts[0]?.timestamp ?? new Date(0).toISOString();
|
|
22
|
+
}
|
|
23
|
+
function buildFeedback(verdict, gen) {
|
|
24
|
+
return [verdict.feedback, gen.summary]
|
|
25
|
+
.filter((s) => s.length > 0)
|
|
26
|
+
.join("\n");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Run a single sprint's generate→evaluate retry loop, side-effect-free.
|
|
30
|
+
*
|
|
31
|
+
* Each iteration: (curate once) → generate → evaluate → reconcile. Returns
|
|
32
|
+
* `passed` as soon as a verdict passes (and the generator isn't blocked);
|
|
33
|
+
* `failed` if the generator reports a hard blocker; `needs-rework` if the
|
|
34
|
+
* iteration budget is exhausted without passing.
|
|
35
|
+
*/
|
|
36
|
+
export async function runPureSprint(input, deps) {
|
|
37
|
+
const reduce = deps.reconcile ?? reconcile;
|
|
38
|
+
const contractId = input.contract.contractId;
|
|
39
|
+
const briefing = deps.curate ? await deps.curate(input) : "";
|
|
40
|
+
const maxIter = Math.max(1, input.maxIterations);
|
|
41
|
+
let feedback = "";
|
|
42
|
+
let lastVerdict;
|
|
43
|
+
let lastLensVerdicts = [];
|
|
44
|
+
for (let iter = 1; iter <= maxIter; iter += 1) {
|
|
45
|
+
const gen = await deps.generate(input, briefing, feedback);
|
|
46
|
+
const lensVerdicts = await deps.evaluate(input, iter);
|
|
47
|
+
lastLensVerdicts = lensVerdicts;
|
|
48
|
+
const verdict = lensVerdicts.length === 1 && lensVerdicts[0] !== undefined
|
|
49
|
+
? lensVerdicts[0]
|
|
50
|
+
: reduce(contractId, iter, lensVerdicts, pickTimestamp(lensVerdicts));
|
|
51
|
+
lastVerdict = verdict;
|
|
52
|
+
if (verdict.passed && !gen.blocked) {
|
|
53
|
+
return {
|
|
54
|
+
contract: input.contract,
|
|
55
|
+
finalVerdict: verdict,
|
|
56
|
+
iterationsUsed: iter,
|
|
57
|
+
outcome: "passed",
|
|
58
|
+
lensVerdicts,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (gen.blocked) {
|
|
62
|
+
return {
|
|
63
|
+
contract: input.contract,
|
|
64
|
+
finalVerdict: verdict,
|
|
65
|
+
iterationsUsed: iter,
|
|
66
|
+
outcome: "failed",
|
|
67
|
+
lensVerdicts,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
feedback = buildFeedback(verdict, gen);
|
|
71
|
+
}
|
|
72
|
+
// Iteration budget exhausted without passing → retryable rework.
|
|
73
|
+
const finalVerdict = lastVerdict ?? reduce(contractId, maxIter, [], new Date(0).toISOString());
|
|
74
|
+
return {
|
|
75
|
+
contract: input.contract,
|
|
76
|
+
finalVerdict,
|
|
77
|
+
iterationsUsed: maxIter,
|
|
78
|
+
outcome: "needs-rework",
|
|
79
|
+
lensVerdicts: lastLensVerdicts,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=pure-sprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pure-sprint.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/pure-sprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoD5C,+EAA+E;AAC/E,SAAS,aAAa,CAAC,QAAsB;IAC3C,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7D,CAAC;AAED,SAAS,aAAa,CAAC,OAAmB,EAAE,GAAqB;IAC/D,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAkB,EAClB,IAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;IAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,C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EAAE,IAAI;gBACpB,OAAO,EAAE,QAAQ;gBACjB,YAAY;aACb,CAAC;QACJ,CAAC;QAED,QAAQ,GAAG,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,iEAAiE;IACjE,MAAM,YAAY,GAAG,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/F,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,YAAY;QACZ,cAAc,EAAE,OAAO;QACvB,OAAO,EAAE,cAAc;QACvB,YAAY,EAAE,gBAAgB;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EvalResult } from "../../contracts/eval-result.js";
|
|
2
|
+
/**
|
|
3
|
+
* Pure majority-vote reducer over per-lens EvalResult[] (ADR-4).
|
|
4
|
+
* No Date.now / new Date / Math.random / fs — timestamp is a caller arg.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - empty lensVerdicts → throws
|
|
8
|
+
* - passed = passCount > failCount (strict majority, fail-closed on tie)
|
|
9
|
+
* - details = union of all failing details, de-duped by (criterion, message)
|
|
10
|
+
* - feedback = failing lenses' feedback joined with newlines, or "All lenses passed."
|
|
11
|
+
* - evaluator = "panel"
|
|
12
|
+
* - timestamp = the injected timestamp argument (echoed verbatim)
|
|
13
|
+
*/
|
|
14
|
+
export declare function reconcile(_sprintId: string, _round: number, lensVerdicts: EvalResult[], timestamp: string): EvalResult;
|
|
15
|
+
//# sourceMappingURL=reconciler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciler.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/reconciler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,gCAAgC,CAAC;AAI7E;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,UAAU,EAAE,EAC1B,SAAS,EAAE,MAAM,GAChB,UAAU,CA4DZ"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// ── Reconciler ─────────────────────────────────────────────────────
|
|
2
|
+
/**
|
|
3
|
+
* Pure majority-vote reducer over per-lens EvalResult[] (ADR-4).
|
|
4
|
+
* No Date.now / new Date / Math.random / fs — timestamp is a caller arg.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - empty lensVerdicts → throws
|
|
8
|
+
* - passed = passCount > failCount (strict majority, fail-closed on tie)
|
|
9
|
+
* - details = union of all failing details, de-duped by (criterion, message)
|
|
10
|
+
* - feedback = failing lenses' feedback joined with newlines, or "All lenses passed."
|
|
11
|
+
* - evaluator = "panel"
|
|
12
|
+
* - timestamp = the injected timestamp argument (echoed verbatim)
|
|
13
|
+
*/
|
|
14
|
+
export function reconcile(_sprintId, _round, lensVerdicts, timestamp) {
|
|
15
|
+
if (lensVerdicts.length === 0) {
|
|
16
|
+
throw new Error("reconcile: lensVerdicts must be non-empty");
|
|
17
|
+
}
|
|
18
|
+
const n = lensVerdicts.length;
|
|
19
|
+
// Count passing lenses
|
|
20
|
+
let passCount = 0;
|
|
21
|
+
for (const lens of lensVerdicts) {
|
|
22
|
+
if (lens.passed === true) {
|
|
23
|
+
passCount = passCount + 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const failCount = n - passCount;
|
|
27
|
+
// Strict majority: passCount must exceed failCount (fail-closed on tie)
|
|
28
|
+
const passed = passCount > failCount;
|
|
29
|
+
// Union failing details, de-duped by criterion + message
|
|
30
|
+
const seenKeys = new Set();
|
|
31
|
+
const details = [];
|
|
32
|
+
for (const lens of lensVerdicts) {
|
|
33
|
+
for (const detail of lens.details) {
|
|
34
|
+
if (detail.passed === false) {
|
|
35
|
+
const key = `${detail.criterion}␟${detail.message}`;
|
|
36
|
+
if (!seenKeys.has(key)) {
|
|
37
|
+
seenKeys.add(key);
|
|
38
|
+
details.push(detail);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Build summary
|
|
44
|
+
const summary = `Panel verdict: ${passCount}/${n} lenses passed`;
|
|
45
|
+
// Build feedback from failing lenses
|
|
46
|
+
const feedbackParts = [];
|
|
47
|
+
for (const lens of lensVerdicts) {
|
|
48
|
+
if (!lens.passed && lens.feedback) {
|
|
49
|
+
feedbackParts.push(lens.feedback);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const feedback = feedbackParts.length > 0 ? feedbackParts.join("\n") : "All lenses passed.";
|
|
53
|
+
// Compute optional score
|
|
54
|
+
const score = Math.round((100 * passCount) / n);
|
|
55
|
+
return {
|
|
56
|
+
evaluator: "panel",
|
|
57
|
+
passed,
|
|
58
|
+
score,
|
|
59
|
+
details,
|
|
60
|
+
summary,
|
|
61
|
+
feedback,
|
|
62
|
+
timestamp,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=reconciler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciler.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/reconciler.ts"],"names":[],"mappings":"AAEA,sEAAsE;AAEtE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CACvB,SAAiB,EACjB,MAAc,EACd,YAA0B,EAC1B,SAAiB;IAEjB,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;IAE9B,uBAAuB;IACvB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,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C,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAE5F,yBAAyB;IACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhD,OAAO;QACL,SAAS,EAAE,OAAO;QAClB,MAAM;QACN,KAAK;QACL,OAAO;QACP,OAAO;QACP,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResumeCursor } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Reconstructs a ResumeCursor from durable contract status and history.
|
|
4
|
+
* Contract status is the source of truth — history is corroboration only.
|
|
5
|
+
* When history and contract status conflict, contract status wins.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ResumeCursorReconstructor {
|
|
8
|
+
reconstruct(projectRoot: string, specId: string): Promise<ResumeCursor>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=resume-cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-cursor.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/resume-cursor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,yBAAyB;IAC9B,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAoB9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// ── ResumeCursorReconstructor ───────────────────────────────────────
|
|
2
|
+
import { listContracts } from "../../state/sprint-state.js";
|
|
3
|
+
import { loadHistory } from "../../state/history.js";
|
|
4
|
+
/**
|
|
5
|
+
* Reconstructs a ResumeCursor from durable contract status and history.
|
|
6
|
+
* Contract status is the source of truth — history is corroboration only.
|
|
7
|
+
* When history and contract status conflict, contract status wins.
|
|
8
|
+
*/
|
|
9
|
+
export class ResumeCursorReconstructor {
|
|
10
|
+
async reconstruct(projectRoot, specId) {
|
|
11
|
+
const contracts = (await listContracts(projectRoot)).filter((c) => c.specId === specId);
|
|
12
|
+
// Corroborate with history, but contract status WINS on conflict
|
|
13
|
+
await loadHistory(projectRoot);
|
|
14
|
+
const completed = contracts
|
|
15
|
+
.filter((c) => c.status === "passed" || c.status === "completed")
|
|
16
|
+
.map((c) => c.sprintNumber);
|
|
17
|
+
const allNumbers = contracts.map((c) => c.sprintNumber);
|
|
18
|
+
return {
|
|
19
|
+
specId,
|
|
20
|
+
completedSprintNumbers: [...completed].sort((a, b) => a - b),
|
|
21
|
+
lastObservedSprintNumber: allNumbers.length ? Math.max(...allNumbers) : 0,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=resume-cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-cursor.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/resume-cursor.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACpC,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,MAAc;QACnD,MAAM,SAAS,GAAG,CAAC,MAAM,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CACzD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAC3B,CAAC;QAEF,iEAAiE;QACjE,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;QAE/B,MAAM,SAAS,GAAG,SAAS;aACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC;aAChE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAE9B,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAExD,OAAO;YACL,MAAM;YACN,sBAAsB,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;YAC5D,wBAAwB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exponential-backoff retry for transient provider failures.
|
|
3
|
+
*
|
|
4
|
+
* Today the agentic loop ends on the first `client.chat()` error
|
|
5
|
+
* (agentic-loop.ts), which is fragile when hammering a single local model
|
|
6
|
+
* server (Ollama/vLLM return 429/503 under load). `withRetry` wraps a call in
|
|
7
|
+
* bounded exponential backoff with jitter, retrying only TRANSIENT failures
|
|
8
|
+
* (rate limits, overload, timeouts, network resets) and surfacing everything
|
|
9
|
+
* else immediately.
|
|
10
|
+
*
|
|
11
|
+
* The scheduler / interpreter wraps each provider call in this, so every
|
|
12
|
+
* provider benefits without per-adapter changes. `sleep` and `jitter` are
|
|
13
|
+
* injectable so tests are deterministic and instant.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Heuristic: is this error worth retrying? True for HTTP 408/429 and 5xx,
|
|
17
|
+
* known transient network codes, and overload/rate-limit/timeout messages.
|
|
18
|
+
*/
|
|
19
|
+
export declare function classifyTransient(err: unknown): boolean;
|
|
20
|
+
export interface RetryOptions {
|
|
21
|
+
/** Max retries AFTER the first attempt. Default 3 (=> up to 4 calls). */
|
|
22
|
+
maxRetries?: number;
|
|
23
|
+
/** Base delay in ms for the first backoff. Default 500. */
|
|
24
|
+
baseDelayMs?: number;
|
|
25
|
+
/** Upper bound on a single backoff delay. Default 30_000. */
|
|
26
|
+
maxDelayMs?: number;
|
|
27
|
+
/** Exponential growth factor. Default 2. */
|
|
28
|
+
factor?: number;
|
|
29
|
+
/** Returns a value in [0, 1) for jitter. Default Math.random. Inject for tests. */
|
|
30
|
+
jitter?: () => number;
|
|
31
|
+
/** Sleeps for `ms`. Default setTimeout-backed. Inject for tests. */
|
|
32
|
+
sleep?: (ms: number) => Promise<void>;
|
|
33
|
+
/** Decides whether an error is retryable. Default {@link classifyTransient}. */
|
|
34
|
+
isTransient?: (err: unknown) => boolean;
|
|
35
|
+
/** Called before each backoff sleep (for logging / telemetry). */
|
|
36
|
+
onRetry?: (info: {
|
|
37
|
+
attempt: number;
|
|
38
|
+
delayMs: number;
|
|
39
|
+
error: unknown;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Run `fn`, retrying TRANSIENT failures with exponential backoff + jitter.
|
|
44
|
+
* Non-transient errors and the final exhausted error are rethrown.
|
|
45
|
+
*
|
|
46
|
+
* Backoff for retry `n` (0-based): `min(maxDelayMs, baseDelayMs * factor**n)`,
|
|
47
|
+
* then jittered to 50–100% of that value (decorrelated, avoids thundering herd).
|
|
48
|
+
*/
|
|
49
|
+
export declare function withRetry<T>(fn: () => Promise<T>, opts?: RetryOptions): Promise<T>;
|
|
50
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA2CH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CASvD;AAID,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,oEAAoE;IACpE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,gFAAgF;IAChF,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;IACxC,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAChF;AAKD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exponential-backoff retry for transient provider failures.
|
|
3
|
+
*
|
|
4
|
+
* Today the agentic loop ends on the first `client.chat()` error
|
|
5
|
+
* (agentic-loop.ts), which is fragile when hammering a single local model
|
|
6
|
+
* server (Ollama/vLLM return 429/503 under load). `withRetry` wraps a call in
|
|
7
|
+
* bounded exponential backoff with jitter, retrying only TRANSIENT failures
|
|
8
|
+
* (rate limits, overload, timeouts, network resets) and surfacing everything
|
|
9
|
+
* else immediately.
|
|
10
|
+
*
|
|
11
|
+
* The scheduler / interpreter wraps each provider call in this, so every
|
|
12
|
+
* provider benefits without per-adapter changes. `sleep` and `jitter` are
|
|
13
|
+
* injectable so tests are deterministic and instant.
|
|
14
|
+
*/
|
|
15
|
+
// ── Transient classification ────────────────────────────────────────
|
|
16
|
+
function asRecord(err) {
|
|
17
|
+
return typeof err === "object" && err !== null
|
|
18
|
+
? err
|
|
19
|
+
: undefined;
|
|
20
|
+
}
|
|
21
|
+
function getStatus(err) {
|
|
22
|
+
const e = asRecord(err);
|
|
23
|
+
if (!e)
|
|
24
|
+
return undefined;
|
|
25
|
+
const s = e["status"] ?? e["statusCode"];
|
|
26
|
+
return typeof s === "number" ? s : undefined;
|
|
27
|
+
}
|
|
28
|
+
function getCode(err) {
|
|
29
|
+
const e = asRecord(err);
|
|
30
|
+
const c = e?.["code"];
|
|
31
|
+
return typeof c === "string" ? c : undefined;
|
|
32
|
+
}
|
|
33
|
+
function getMessage(err) {
|
|
34
|
+
if (err instanceof Error)
|
|
35
|
+
return err.message;
|
|
36
|
+
const e = asRecord(err);
|
|
37
|
+
const m = e?.["message"];
|
|
38
|
+
return typeof m === "string" ? m : String(err);
|
|
39
|
+
}
|
|
40
|
+
const TRANSIENT_CODES = new Set([
|
|
41
|
+
"ETIMEDOUT",
|
|
42
|
+
"ECONNRESET",
|
|
43
|
+
"ECONNREFUSED",
|
|
44
|
+
"ENOTFOUND",
|
|
45
|
+
"EAI_AGAIN",
|
|
46
|
+
"EPIPE",
|
|
47
|
+
"ECONNABORTED",
|
|
48
|
+
]);
|
|
49
|
+
const TRANSIENT_MESSAGE = /rate.?limit|too many requests|overloaded|overload|temporarily|try again|timed? ?out|service unavailable|ECONNRESET|ETIMEDOUT|\b(?:429|500|502|503|504|529)\b/i;
|
|
50
|
+
/**
|
|
51
|
+
* Heuristic: is this error worth retrying? True for HTTP 408/429 and 5xx,
|
|
52
|
+
* known transient network codes, and overload/rate-limit/timeout messages.
|
|
53
|
+
*/
|
|
54
|
+
export function classifyTransient(err) {
|
|
55
|
+
const status = getStatus(err);
|
|
56
|
+
if (status !== undefined) {
|
|
57
|
+
if (status === 408 || status === 429)
|
|
58
|
+
return true;
|
|
59
|
+
if (status >= 500 && status < 600)
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
const code = getCode(err);
|
|
63
|
+
if (code && TRANSIENT_CODES.has(code))
|
|
64
|
+
return true;
|
|
65
|
+
return TRANSIENT_MESSAGE.test(getMessage(err));
|
|
66
|
+
}
|
|
67
|
+
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
68
|
+
/**
|
|
69
|
+
* Run `fn`, retrying TRANSIENT failures with exponential backoff + jitter.
|
|
70
|
+
* Non-transient errors and the final exhausted error are rethrown.
|
|
71
|
+
*
|
|
72
|
+
* Backoff for retry `n` (0-based): `min(maxDelayMs, baseDelayMs * factor**n)`,
|
|
73
|
+
* then jittered to 50–100% of that value (decorrelated, avoids thundering herd).
|
|
74
|
+
*/
|
|
75
|
+
export async function withRetry(fn, opts = {}) {
|
|
76
|
+
const maxRetries = opts.maxRetries ?? 3;
|
|
77
|
+
const baseDelayMs = opts.baseDelayMs ?? 500;
|
|
78
|
+
const maxDelayMs = opts.maxDelayMs ?? 30_000;
|
|
79
|
+
const factor = opts.factor ?? 2;
|
|
80
|
+
const jitter = opts.jitter ?? Math.random;
|
|
81
|
+
const sleep = opts.sleep ?? defaultSleep;
|
|
82
|
+
const isTransient = opts.isTransient ?? classifyTransient;
|
|
83
|
+
for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
|
|
84
|
+
try {
|
|
85
|
+
return await fn();
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (attempt === maxRetries || !isTransient(error)) {
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
const raw = Math.min(maxDelayMs, baseDelayMs * Math.pow(factor, attempt));
|
|
92
|
+
const delayMs = raw * (0.5 + 0.5 * jitter());
|
|
93
|
+
opts.onRetry?.({ attempt: attempt + 1, delayMs, error });
|
|
94
|
+
await sleep(delayMs);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Unreachable: the loop either returns or throws on the final attempt.
|
|
98
|
+
throw new Error("withRetry: retry loop exited unexpectedly.");
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../src/orchestrator/workflow/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uEAAuE;AAEvE,SAAS,QAAQ,CAAC,GAAY;IAC5B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAC5C,CAAC,CAAE,GAA+B;QAClC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED,SAAS,OAAO,CAAC,GAAY;IAC3B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED,SAAS,UAAU,CAAC,GAAY;IAC9B,IAAI,GAAG,YAAY,KAAK;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACzB,OA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parallel(thunks)` — barrier; runs all thunks with bounded concurrency
|
|
6
|
+
* and awaits them all (order-preserving). Use for lens panels / N skeptics.
|
|
7
|
+
* - `pipeline(items, ...stages)` — per-item, NO barrier between stages; each
|
|
8
|
+
* item flows through every stage independently, so item A can be in stage 3
|
|
9
|
+
* while item B is still in stage 1. Total concurrent stage executions are
|
|
10
|
+
* bounded by the same cap.
|
|
11
|
+
*
|
|
12
|
+
* Concurrency is enforced by a hand-off semaphore (true bounded concurrency,
|
|
13
|
+
* unlike chunk-batching which idles fast tasks waiting on a slow one). A live
|
|
14
|
+
* agent counter caps total executions over the scheduler's lifetime (the
|
|
15
|
+
* runaway guard — Claude Code uses 1000/run).
|
|
16
|
+
*/
|
|
17
|
+
/** Raised when a scheduler exceeds its lifetime agent-execution cap. */
|
|
18
|
+
export declare class AgentCapError extends Error {
|
|
19
|
+
/** The cap that was hit. */
|
|
20
|
+
readonly cap: number;
|
|
21
|
+
constructor(message: string,
|
|
22
|
+
/** The cap that was hit. */
|
|
23
|
+
cap: number);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The default concurrency cap: `min(16, cores - 2)`, floored at 1. Matches the
|
|
27
|
+
* Claude Code dynamic-workflow runtime. For local model servers the real bound
|
|
28
|
+
* is usually the server's slot count (e.g. Ollama's OLLAMA_NUM_PARALLEL), so
|
|
29
|
+
* callers should override `maxConcurrent` to match their backend.
|
|
30
|
+
*/
|
|
31
|
+
export declare function defaultConcurrency(): number;
|
|
32
|
+
/**
|
|
33
|
+
* A counting semaphore with FIFO hand-off: when a holder releases and a waiter
|
|
34
|
+
* is queued, the slot transfers directly to that waiter (the active count never
|
|
35
|
+
* dips), giving true peak-concurrency === cap regardless of task duration.
|
|
36
|
+
*/
|
|
37
|
+
export declare class Semaphore {
|
|
38
|
+
private readonly cap;
|
|
39
|
+
private active;
|
|
40
|
+
private readonly waiters;
|
|
41
|
+
constructor(cap: number);
|
|
42
|
+
acquire(): Promise<void>;
|
|
43
|
+
release(): void;
|
|
44
|
+
/** Number of currently-held slots (for tests / introspection). */
|
|
45
|
+
get inFlight(): number;
|
|
46
|
+
}
|
|
47
|
+
export interface SchedulerOptions {
|
|
48
|
+
/** Max concurrent task executions. Default {@link defaultConcurrency}. */
|
|
49
|
+
maxConcurrent?: number;
|
|
50
|
+
/** Hard ceiling on total executions over this scheduler's lifetime. Default 1000. */
|
|
51
|
+
maxAgents?: number;
|
|
52
|
+
}
|
|
53
|
+
/** A pipeline stage: receives the previous stage's output, the original item, and its index. */
|
|
54
|
+
export type Stage<I> = (prev: unknown, item: I, index: number) => Promise<unknown>;
|
|
55
|
+
export declare class Scheduler {
|
|
56
|
+
readonly maxConcurrent: number;
|
|
57
|
+
readonly maxAgents: number;
|
|
58
|
+
private readonly sem;
|
|
59
|
+
private agentsStarted;
|
|
60
|
+
constructor(opts?: SchedulerOptions);
|
|
61
|
+
/** Total task executions started over this scheduler's lifetime. */
|
|
62
|
+
get agentsRun(): number;
|
|
63
|
+
/** Acquire a slot, run, release — counting the execution against the cap. */
|
|
64
|
+
private run;
|
|
65
|
+
/**
|
|
66
|
+
* Run all thunks concurrently (bounded by the cap) and await them all.
|
|
67
|
+
* Results are index-aligned with `thunks`. A thunk that throws rejects the
|
|
68
|
+
* whole call (use try/catch inside the thunk for {@link Promise.allSettled}-style
|
|
69
|
+
* tolerance).
|
|
70
|
+
*/
|
|
71
|
+
parallel<T>(thunks: ReadonlyArray<() => Promise<T>>): Promise<T[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Run each item through every stage independently — no barrier between
|
|
74
|
+
* stages. Returns an array index-aligned with `items`. A stage that throws
|
|
75
|
+
* (other than {@link AgentCapError}) drops that item to `null` and skips its
|
|
76
|
+
* remaining stages; the runaway-cap error propagates.
|
|
77
|
+
*/
|
|
78
|
+
pipeline<I>(items: ReadonlyArray<I>, ...stages: Array<Stage<I>>): Promise<unknown[]>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Map over `items` applying `fn` with at most `cap` concurrent calls, preserving
|
|
82
|
+
* input order. Backed by a hand-off {@link Semaphore} (true bounded concurrency,
|
|
83
|
+
* superseding the chunk-batching copies previously duplicated in the evaluator
|
|
84
|
+
* and architect agents).
|
|
85
|
+
*/
|
|
86
|
+
export declare function mapBounded<T, R>(items: ReadonlyArray<T>, cap: number, fn: (x: T) => Promise<R>): Promise<R[]>;
|
|
87
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/workflow/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,wEAAwE;AACxE,qBAAa,aAAc,SAAQ,KAAK;IAGpC,4BAA4B;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM;gBAFpB,OAAO,EAAE,MAAM;IACf,4BAA4B;IACnB,GAAG,EAAE,MAAM;CAKvB;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAID;;;;GAIG;AACH,qBAAa,SAAS;IAIR,OAAO,CAAC,QAAQ,CAAC,GAAG;IAHhC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAEpB,GAAG,EAAE,MAAM;IAIlC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B,OAAO,IAAI,IAAI;IASf,kEAAkE;IAClE,IAAI,QAAQ,IAAI,MAAM,CAErB;CACF;AAID,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gGAAgG;AAChG,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO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