agent-bober 0.12.0 → 0.15.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/CHANGELOG.md +213 -0
- package/README.md +112 -3
- package/agents/bober-architect.md +38 -0
- package/agents/bober-code-reviewer.md +236 -0
- package/agents/bober-curator.md +37 -0
- package/agents/bober-deployer.md +267 -0
- package/agents/bober-diagnoser.md +289 -0
- package/agents/bober-evaluator.md +89 -1
- package/agents/bober-generator.md +68 -3
- package/agents/bober-planner.md +39 -0
- 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 +36 -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/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 +50 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +27 -0
- 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 +18 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +976 -56
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +147 -0
- package/dist/config/schema.js.map +1 -1
- 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 +49 -0
- package/dist/graph/cli.d.ts.map +1 -0
- package/dist/graph/cli.js +140 -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 +86 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -0
- package/dist/graph/pipeline-lifecycle.js +329 -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 +116 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -0
- package/dist/graph/preflight-injector.js +538 -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/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 +16 -0
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +37 -8
- 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 +59 -8
- 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/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +21 -8
- 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 +21 -8
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +3 -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 +21 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +156 -2
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +5 -4
- 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 +46 -9
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +2 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +1 -1
- 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/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 +86 -5
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +35 -2
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +5 -0
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +4 -0
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/types.d.ts +25 -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/index.d.ts +3 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +4 -1
- package/dist/state/index.js.map +1 -1
- 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 +17 -1
- package/hooks/session-start +42 -0
- package/package.json +5 -2
- 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/sync-skills.mjs +4 -1
- 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.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 +10 -0
- package/skills/bober.postmortem/SKILL.md +231 -0
- package/skills/bober.runbook/SKILL.md +335 -0
- package/skills/bober.using-bober/SKILL.md +133 -0
- package/skills/bober.verify/SKILL.md +143 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback router (Sprint 12).
|
|
3
|
+
*
|
|
4
|
+
* Maps a CheckpointId to the responsible agent and re-invokes that agent
|
|
5
|
+
* with the prior feedback woven into its prompt. Per-agent adaptation
|
|
6
|
+
* differs by agent role (s12-c6). The 'gate' checkpoints abort
|
|
7
|
+
* the run on rejection — they are not iteration points.
|
|
8
|
+
*
|
|
9
|
+
* Abort token matching is case-SENSITIVE: `feedback.startsWith("!!abort")`.
|
|
10
|
+
* This matches shell convention markers (e.g., `#!`) where case matters.
|
|
11
|
+
* Tests must use the exact prefix "!!abort" (all lowercase).
|
|
12
|
+
*
|
|
13
|
+
* Edit delta application uses full-replacement semantics (no json-patch lib
|
|
14
|
+
* installed). If editDelta is a string, it replaces the file content directly.
|
|
15
|
+
* If it is { after: string }, the `after` property is used. Otherwise the
|
|
16
|
+
* value is JSON.stringify-ed. The original is backed up to
|
|
17
|
+
* `.bober/runs/<runId>/edits/<checkpointId>.original.<ext>` BEFORE overwrite
|
|
18
|
+
* to satisfy evaluatorNotes reversibility requirement.
|
|
19
|
+
*
|
|
20
|
+
* Iteration counters are per-checkpoint-invocation (passed in by the caller),
|
|
21
|
+
* NOT stored in a module-level map. The pipeline wires one counter per
|
|
22
|
+
* checkpoint-invocation site so post-sprint for sprint-1 and post-sprint for
|
|
23
|
+
* sprint-2 are independent.
|
|
24
|
+
*
|
|
25
|
+
* Sprint 12 — colocated in src/orchestrator/checkpoints/ per Sprint 7+8 precedent.
|
|
26
|
+
*/
|
|
27
|
+
import { writeFile, rename, readFile, mkdir } from "node:fs/promises";
|
|
28
|
+
import { join, extname } from "node:path";
|
|
29
|
+
import { logger } from "../../utils/logger.js";
|
|
30
|
+
import { runWithAudit } from "./audit.js";
|
|
31
|
+
/**
|
|
32
|
+
* Per-checkpoint responsibility table. Source-of-truth for s12-c1 + s12-c6.
|
|
33
|
+
* Gate entries abort the run on rejection; they have no agent to re-invoke.
|
|
34
|
+
*/
|
|
35
|
+
export const CHECKPOINT_TO_AGENT = {
|
|
36
|
+
"post-research": "researcher",
|
|
37
|
+
"post-plan": "planner",
|
|
38
|
+
"post-sprint-contract": "planner",
|
|
39
|
+
"pre-curator": "gate",
|
|
40
|
+
"pre-generator": "gate",
|
|
41
|
+
"pre-evaluator": "gate",
|
|
42
|
+
"pre-code-reviewer": "gate",
|
|
43
|
+
"post-sprint": "generator",
|
|
44
|
+
"end-of-pipeline": "gate",
|
|
45
|
+
};
|
|
46
|
+
// ── Abort token ─────────────────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* Default escape-hatch prefix. Case-SENSITIVE: must be exactly "!!abort"
|
|
49
|
+
* at the start of the feedback string. Documented here and matched in
|
|
50
|
+
* shouldAbort() below.
|
|
51
|
+
*/
|
|
52
|
+
export const ABORT_TOKEN = "!!abort";
|
|
53
|
+
/**
|
|
54
|
+
* Returns true if the feedback triggers an immediate abort.
|
|
55
|
+
*
|
|
56
|
+
* Two sources:
|
|
57
|
+
* 1. Feedback starts with ABORT_TOKEN ("!!abort") — case-sensitive prefix match.
|
|
58
|
+
* 2. envAbortToken is non-empty and appears anywhere in the feedback string.
|
|
59
|
+
*/
|
|
60
|
+
export function shouldAbort(feedback, envAbortToken) {
|
|
61
|
+
if (feedback.startsWith(ABORT_TOKEN))
|
|
62
|
+
return true;
|
|
63
|
+
if (envAbortToken && envAbortToken.length > 0 && feedback.includes(envAbortToken))
|
|
64
|
+
return true;
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
// ── Per-agent prompt-augmentation strategies ────────────────────────────────
|
|
68
|
+
// Each function produces a DIFFERENT envelope: different section heading,
|
|
69
|
+
// different placement (prepend vs inline-into-generatorNotes vs question-append),
|
|
70
|
+
// different framing language. The evaluator checks these are NOT identical.
|
|
71
|
+
/**
|
|
72
|
+
* Planner retry prompt: prepend a "## Plan revision request (iteration N of M)" block
|
|
73
|
+
* ABOVE the original prompt. Instructs the planner to update the spec addressing
|
|
74
|
+
* the feedback from a prior checkpoint review.
|
|
75
|
+
*/
|
|
76
|
+
function buildPlannerRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations) {
|
|
77
|
+
const feedbackBlock = feedbackHistory
|
|
78
|
+
.map((e) => `### Feedback from iteration ${e.iteration}\n${e.feedback}` +
|
|
79
|
+
(e.editDelta ? `\n\n**Edit delta:**\n\`\`\`\n${JSON.stringify(e.editDelta, null, 2)}\n\`\`\`` : ""))
|
|
80
|
+
.join("\n\n");
|
|
81
|
+
return [
|
|
82
|
+
`## Plan revision request (iteration ${iteration} of ${maxIterations})`,
|
|
83
|
+
``,
|
|
84
|
+
`A checkpoint review returned the following feedback on the plan. ` +
|
|
85
|
+
`Please revise the PlanSpec to address ALL of the concerns below before re-submitting.`,
|
|
86
|
+
``,
|
|
87
|
+
`## Checkpoint feedback (iteration ${iteration} of ${maxIterations}):`,
|
|
88
|
+
feedbackBlock,
|
|
89
|
+
``,
|
|
90
|
+
`## Edit delta (if any):`,
|
|
91
|
+
feedbackHistory.at(-1)?.editDelta
|
|
92
|
+
? `\`\`\`\n${JSON.stringify(feedbackHistory.at(-1)?.editDelta, null, 2)}\n\`\`\``
|
|
93
|
+
: `(none)`,
|
|
94
|
+
``,
|
|
95
|
+
`---`,
|
|
96
|
+
``,
|
|
97
|
+
originalPrompt,
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generator retry prompt: inline feedback into the sprint contract's generatorNotes
|
|
102
|
+
* context as "additional context from human reviewer". The generator reads
|
|
103
|
+
* generatorNotes from its handoff, so this surfaces naturally in its context.
|
|
104
|
+
*/
|
|
105
|
+
function buildGeneratorRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations) {
|
|
106
|
+
const feedbackLines = feedbackHistory
|
|
107
|
+
.map((e) => `- iteration ${e.iteration}: ${e.feedback}`)
|
|
108
|
+
.join("\n");
|
|
109
|
+
const generatorNotesSection = [
|
|
110
|
+
`## Additional context from human reviewer (checkpoint iteration ${iteration} of ${maxIterations})`,
|
|
111
|
+
``,
|
|
112
|
+
`The following concerns were raised by a checkpoint reviewer and MUST be addressed ` +
|
|
113
|
+
`in this implementation. This feedback is provided as additional context from the ` +
|
|
114
|
+
`human reviewer via the checkpoint system:`,
|
|
115
|
+
``,
|
|
116
|
+
feedbackLines,
|
|
117
|
+
].join("\n");
|
|
118
|
+
// Append the reviewer notes after the original prompt (inline as generatorNotes context).
|
|
119
|
+
return `${originalPrompt}\n\n${generatorNotesSection}`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Researcher retry prompt: prepend feedback as additional research questions
|
|
123
|
+
* for Phase 2 exploration. Instructs the researcher to address the concern
|
|
124
|
+
* as a question to answer during re-exploration.
|
|
125
|
+
*/
|
|
126
|
+
function buildResearcherRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations) {
|
|
127
|
+
const additionalQuestions = feedbackHistory
|
|
128
|
+
.map((e) => `- Address the prior reviewer concern (iteration ${e.iteration}): ${e.feedback}`)
|
|
129
|
+
.join("\n");
|
|
130
|
+
const questionBlock = [
|
|
131
|
+
`## Additional research questions from checkpoint review (iteration ${iteration} of ${maxIterations})`,
|
|
132
|
+
``,
|
|
133
|
+
`The following concerns were raised during checkpoint review. Please address them ` +
|
|
134
|
+
`as additional questions during Phase 2 re-exploration:`,
|
|
135
|
+
``,
|
|
136
|
+
additionalQuestions,
|
|
137
|
+
``,
|
|
138
|
+
`---`,
|
|
139
|
+
``,
|
|
140
|
+
].join("\n");
|
|
141
|
+
return `${questionBlock}${originalPrompt}`;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Evaluator retry prompt: re-frame feedback as a specific concern to investigate.
|
|
145
|
+
* Prepends a "## Concern from prior round" block with a directive to
|
|
146
|
+
* specifically check the flagged issue.
|
|
147
|
+
*/
|
|
148
|
+
function buildEvaluatorRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations) {
|
|
149
|
+
const concerns = feedbackHistory
|
|
150
|
+
.map((e) => `- (iteration ${e.iteration}) Please specifically check: ${e.feedback}`)
|
|
151
|
+
.join("\n");
|
|
152
|
+
const concernBlock = [
|
|
153
|
+
`## Concern from prior round (checkpoint iteration ${iteration} of ${maxIterations})`,
|
|
154
|
+
``,
|
|
155
|
+
`The following concerns were flagged during checkpoint review. ` +
|
|
156
|
+
`Your evaluation MUST specifically investigate and report on each:`,
|
|
157
|
+
``,
|
|
158
|
+
concerns,
|
|
159
|
+
``,
|
|
160
|
+
`---`,
|
|
161
|
+
``,
|
|
162
|
+
].join("\n");
|
|
163
|
+
return `${concernBlock}${originalPrompt}`;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get the responsible agent for a checkpoint ID.
|
|
167
|
+
*/
|
|
168
|
+
export function getResponsibleAgent(checkpointId) {
|
|
169
|
+
return CHECKPOINT_TO_AGENT[checkpointId];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Build a per-agent augmented prompt for a retry invocation.
|
|
173
|
+
* Each agent type uses a distinct framing strategy (s12-c6).
|
|
174
|
+
*
|
|
175
|
+
* @throws Error if the agent is 'gate' — gate checkpoints must not be re-invoked.
|
|
176
|
+
*/
|
|
177
|
+
export function buildFeedbackPrompt(checkpointId, originalPrompt, feedbackHistory, maxIterations) {
|
|
178
|
+
const agent = CHECKPOINT_TO_AGENT[checkpointId];
|
|
179
|
+
const iteration = feedbackHistory.length;
|
|
180
|
+
switch (agent) {
|
|
181
|
+
case "planner":
|
|
182
|
+
return buildPlannerRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations);
|
|
183
|
+
case "generator":
|
|
184
|
+
return buildGeneratorRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations);
|
|
185
|
+
case "researcher":
|
|
186
|
+
return buildResearcherRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations);
|
|
187
|
+
case "evaluator":
|
|
188
|
+
return buildEvaluatorRetryPrompt(originalPrompt, feedbackHistory, iteration, maxIterations);
|
|
189
|
+
case "gate":
|
|
190
|
+
// Gate checkpoints must never be re-invoked. Callers must check CHECKPOINT_TO_AGENT
|
|
191
|
+
// and abort before reaching this path.
|
|
192
|
+
throw new Error(`buildFeedbackPrompt called for gate checkpoint "${checkpointId}". ` +
|
|
193
|
+
`Gate checkpoints abort on rejection — they do not retry.`);
|
|
194
|
+
default: {
|
|
195
|
+
// Exhaustiveness guard (TypeScript narrows here)
|
|
196
|
+
const _never = agent;
|
|
197
|
+
throw new Error(`Unknown agent type: ${String(_never)}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// ── Edit delta application ──────────────────────────────────────────────────
|
|
202
|
+
/**
|
|
203
|
+
* Apply an edit delta to an artifact file on disk.
|
|
204
|
+
*
|
|
205
|
+
* Steps:
|
|
206
|
+
* 1. Read original file content.
|
|
207
|
+
* 2. Write backup to <runsDir>/<runId>/edits/<checkpointId>.original.<ext>
|
|
208
|
+
* 3. Determine new content:
|
|
209
|
+
* - string editDelta → full replacement
|
|
210
|
+
* - { after: string } → use `after` property
|
|
211
|
+
* - anything else → JSON.stringify(editDelta, null, 2)
|
|
212
|
+
* 4. Atomic write: write to <artifactPath>.tmp then fs.rename.
|
|
213
|
+
*/
|
|
214
|
+
export async function applyEditDelta(artifactPath, editDelta, runsDir, runId, checkpointId) {
|
|
215
|
+
// 1. Read original
|
|
216
|
+
const originalContent = await readFile(artifactPath, "utf-8");
|
|
217
|
+
// 2. Write backup (create parent dirs as needed)
|
|
218
|
+
const ext = extname(artifactPath) || ".txt";
|
|
219
|
+
const backupDir = join(runsDir, runId, "edits");
|
|
220
|
+
await mkdir(backupDir, { recursive: true });
|
|
221
|
+
const backupPath = join(backupDir, `${checkpointId}.original${ext}`);
|
|
222
|
+
await writeFile(backupPath, originalContent, "utf-8");
|
|
223
|
+
logger.debug(`[feedback-router] Backed up original to ${backupPath}`);
|
|
224
|
+
// 3. Determine new content
|
|
225
|
+
let newContent;
|
|
226
|
+
if (typeof editDelta === "string") {
|
|
227
|
+
newContent = editDelta;
|
|
228
|
+
}
|
|
229
|
+
else if (editDelta !== null &&
|
|
230
|
+
typeof editDelta === "object" &&
|
|
231
|
+
"after" in editDelta &&
|
|
232
|
+
typeof editDelta.after === "string") {
|
|
233
|
+
newContent = editDelta.after;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
newContent = JSON.stringify(editDelta, null, 2) + "\n";
|
|
237
|
+
}
|
|
238
|
+
// 4. Atomic write
|
|
239
|
+
const tmpPath = `${artifactPath}.tmp`;
|
|
240
|
+
await writeFile(tmpPath, newContent, "utf-8");
|
|
241
|
+
await rename(tmpPath, artifactPath);
|
|
242
|
+
logger.info(`[feedback-router] Applied edit delta to ${artifactPath}`);
|
|
243
|
+
}
|
|
244
|
+
// ── Abort / completion markers ──────────────────────────────────────────────
|
|
245
|
+
/**
|
|
246
|
+
* Write an abort marker to .bober/runs/<runId>.aborted.json atomically.
|
|
247
|
+
* Creates parent directories as needed.
|
|
248
|
+
*/
|
|
249
|
+
export async function writeAbortMarker(projectRoot, runId, reason) {
|
|
250
|
+
const runsDir = join(projectRoot, ".bober", "runs");
|
|
251
|
+
await mkdir(runsDir, { recursive: true });
|
|
252
|
+
const markerPath = join(runsDir, `${runId}.aborted.json`);
|
|
253
|
+
const payload = {
|
|
254
|
+
runId,
|
|
255
|
+
abortedAt: new Date().toISOString(),
|
|
256
|
+
...reason,
|
|
257
|
+
};
|
|
258
|
+
const tmpPath = `${markerPath}.tmp`;
|
|
259
|
+
await writeFile(tmpPath, JSON.stringify(payload, null, 2) + "\n", "utf-8");
|
|
260
|
+
await rename(tmpPath, markerPath);
|
|
261
|
+
logger.info(`[feedback-router] Abort marker written to ${markerPath}`);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Write a completion marker to .bober/runs/<runId>.completed.json atomically.
|
|
265
|
+
* Creates parent directories as needed.
|
|
266
|
+
*/
|
|
267
|
+
export async function writeCompletionMarker(projectRoot, runId, summary) {
|
|
268
|
+
const runsDir = join(projectRoot, ".bober", "runs");
|
|
269
|
+
await mkdir(runsDir, { recursive: true });
|
|
270
|
+
const markerPath = join(runsDir, `${runId}.completed.json`);
|
|
271
|
+
const payload = {
|
|
272
|
+
runId,
|
|
273
|
+
completedAt: new Date().toISOString(),
|
|
274
|
+
...summary,
|
|
275
|
+
};
|
|
276
|
+
const tmpPath = `${markerPath}.tmp`;
|
|
277
|
+
await writeFile(tmpPath, JSON.stringify(payload, null, 2) + "\n", "utf-8");
|
|
278
|
+
await rename(tmpPath, markerPath);
|
|
279
|
+
logger.info(`[feedback-router] Completion marker written to ${markerPath}`);
|
|
280
|
+
}
|
|
281
|
+
// ── Route outcome ────────────────────────────────────────────────────────────
|
|
282
|
+
/**
|
|
283
|
+
* Route a single CheckpointOutcome to a RouterDecision.
|
|
284
|
+
*
|
|
285
|
+
* This is a pure decision function — callers (pipeline.ts / runCheckpointWithFeedback)
|
|
286
|
+
* are responsible for acting on the returned decision (re-invoking agents, writing
|
|
287
|
+
* abort markers, etc.).
|
|
288
|
+
*
|
|
289
|
+
* @param checkpointId The checkpoint whose outcome is being routed.
|
|
290
|
+
* @param outcome The discriminated outcome from the mechanism.
|
|
291
|
+
* @param iteration Current iteration count (1-based).
|
|
292
|
+
* @param maxIterations Cap from config.pipeline.maxCheckpointIterations.
|
|
293
|
+
* @param feedbackHistory All prior feedback entries for this checkpoint invocation.
|
|
294
|
+
* @param originalPrompt The agent's original prompt (for augmentation).
|
|
295
|
+
* @param envAbortToken Optional env-var abort token (checked in addition to ABORT_TOKEN).
|
|
296
|
+
*/
|
|
297
|
+
export function routeOutcome(checkpointId, outcome, iteration, maxIterations, feedbackHistory, originalPrompt, envAbortToken) {
|
|
298
|
+
// Approved — no action needed.
|
|
299
|
+
if ("approved" in outcome && outcome.approved === true) {
|
|
300
|
+
return { kind: "approved" };
|
|
301
|
+
}
|
|
302
|
+
// Edit applied — caller handles file write via applyEditDelta.
|
|
303
|
+
if ("edit" in outcome && outcome.edit === true) {
|
|
304
|
+
return { kind: "edit-applied", updatedArtifact: outcome.editDelta };
|
|
305
|
+
}
|
|
306
|
+
// Rejection.
|
|
307
|
+
if ("approved" in outcome && outcome.approved === false) {
|
|
308
|
+
const feedback = outcome.feedback;
|
|
309
|
+
// Escape hatch — !!abort prefix or env-var token.
|
|
310
|
+
if (shouldAbort(feedback, envAbortToken)) {
|
|
311
|
+
return {
|
|
312
|
+
kind: "abort",
|
|
313
|
+
reason: {
|
|
314
|
+
reason: "USER_ABORT",
|
|
315
|
+
checkpointId,
|
|
316
|
+
lastFeedback: feedback,
|
|
317
|
+
iterationsCompleted: iteration,
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
// Gate checkpoints abort on any rejection.
|
|
322
|
+
if (CHECKPOINT_TO_AGENT[checkpointId] === "gate") {
|
|
323
|
+
return {
|
|
324
|
+
kind: "abort",
|
|
325
|
+
reason: {
|
|
326
|
+
reason: "GATE_REJECTED",
|
|
327
|
+
checkpointId,
|
|
328
|
+
lastFeedback: feedback,
|
|
329
|
+
iterationsCompleted: iteration,
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
// Iteration cap exhausted.
|
|
334
|
+
if (iteration >= maxIterations) {
|
|
335
|
+
return {
|
|
336
|
+
kind: "abort",
|
|
337
|
+
reason: {
|
|
338
|
+
reason: "CHECKPOINT_ITERATION_EXHAUSTED",
|
|
339
|
+
checkpointId,
|
|
340
|
+
lastFeedback: feedback,
|
|
341
|
+
iterationsCompleted: iteration,
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
// Build per-agent augmented prompt for retry.
|
|
346
|
+
const newHistory = [
|
|
347
|
+
...feedbackHistory,
|
|
348
|
+
{
|
|
349
|
+
iteration,
|
|
350
|
+
feedback,
|
|
351
|
+
timestamp: new Date().toISOString(),
|
|
352
|
+
},
|
|
353
|
+
];
|
|
354
|
+
const newPrompt = buildFeedbackPrompt(checkpointId, originalPrompt, newHistory, maxIterations);
|
|
355
|
+
return { kind: "retry", newPrompt, feedbackHistory: newHistory };
|
|
356
|
+
}
|
|
357
|
+
// Unreachable given the CheckpointOutcome union, but guard anyway.
|
|
358
|
+
throw new Error(`[feedback-router] Unrecognized outcome shape: ${JSON.stringify(outcome)}`);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Run a checkpoint with automatic feedback propagation and iteration cap.
|
|
362
|
+
*
|
|
363
|
+
* Loop semantics:
|
|
364
|
+
* - Start at iteration 1.
|
|
365
|
+
* - Call mechanism.request(checkpointId, artifact).
|
|
366
|
+
* - On approved → resolve { kind: 'approved', iterations: N, finalArtifact }.
|
|
367
|
+
* - On edit → applyEditDelta if artifactPath is set; resolve { kind: 'edited', ... }.
|
|
368
|
+
* - On rejection:
|
|
369
|
+
* - shouldAbort → write .aborted.json; resolve { kind: 'aborted', reason: 'USER_ABORT' }.
|
|
370
|
+
* - gate → write .aborted.json; resolve { kind: 'aborted', reason: 'GATE_REJECTED' }.
|
|
371
|
+
* - iteration >= maxIterations → write .aborted.json; resolve 'CHECKPOINT_ITERATION_EXHAUSTED'.
|
|
372
|
+
* - else → buildFeedbackPrompt; reinvokeAgent; new artifact; loop with N+1.
|
|
373
|
+
*
|
|
374
|
+
* Iteration counters are per-invocation of this function, not global.
|
|
375
|
+
*/
|
|
376
|
+
export async function runCheckpointWithFeedback(opts) {
|
|
377
|
+
const { checkpointId, mechanism, maxIterations, runId, projectRoot, reinvokeAgent, originalPrompt, artifactPath, } = opts;
|
|
378
|
+
const mechanismName = opts.mechanismName ?? "noop";
|
|
379
|
+
// Default the env-var abort token to BOBER_CHECKPOINT_ABORT_TOKEN when the
|
|
380
|
+
// caller omits it. This ensures the named env var is honored without requiring
|
|
381
|
+
// every call site to thread the value through explicitly.
|
|
382
|
+
const envAbortToken = opts.envAbortToken ?? process.env['BOBER_CHECKPOINT_ABORT_TOKEN'];
|
|
383
|
+
let currentArtifact = opts.artifact;
|
|
384
|
+
let feedbackHistory = [];
|
|
385
|
+
const runsDir = join(projectRoot, ".bober", "runs");
|
|
386
|
+
for (let iteration = 1;; iteration++) {
|
|
387
|
+
// Attach iteration metadata so renderers can surface prior feedback.
|
|
388
|
+
// At iteration 2+, wrap artifact with _iterationMetadata.
|
|
389
|
+
const artifactWithMeta = iteration > 1
|
|
390
|
+
? {
|
|
391
|
+
...(typeof currentArtifact === "object" && currentArtifact !== null
|
|
392
|
+
? currentArtifact
|
|
393
|
+
: {}),
|
|
394
|
+
_iterationMetadata: {
|
|
395
|
+
iteration,
|
|
396
|
+
maxIterations,
|
|
397
|
+
priorFeedback: feedbackHistory,
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
: currentArtifact;
|
|
401
|
+
const outcome = await runWithAudit({
|
|
402
|
+
projectRoot,
|
|
403
|
+
runId,
|
|
404
|
+
checkpointId,
|
|
405
|
+
mechanism: mechanismName,
|
|
406
|
+
iteration,
|
|
407
|
+
fn: () => mechanism.request(checkpointId, artifactWithMeta),
|
|
408
|
+
});
|
|
409
|
+
const decision = routeOutcome(checkpointId, outcome, iteration, maxIterations, feedbackHistory, originalPrompt, envAbortToken);
|
|
410
|
+
if (decision.kind === "approved") {
|
|
411
|
+
return { kind: "approved", iterations: iteration, finalArtifact: currentArtifact };
|
|
412
|
+
}
|
|
413
|
+
if (decision.kind === "edit-applied") {
|
|
414
|
+
if (artifactPath) {
|
|
415
|
+
await applyEditDelta(artifactPath, decision.updatedArtifact, runsDir, runId, checkpointId);
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
kind: "edited",
|
|
419
|
+
iterations: iteration,
|
|
420
|
+
finalArtifact: decision.updatedArtifact,
|
|
421
|
+
editDelta: decision.updatedArtifact,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
if (decision.kind === "abort") {
|
|
425
|
+
await writeAbortMarker(projectRoot, runId, decision.reason);
|
|
426
|
+
const lastFeedback = decision.reason.lastFeedback ?? "";
|
|
427
|
+
return { kind: "aborted", reason: decision.reason, lastFeedback };
|
|
428
|
+
}
|
|
429
|
+
// decision.kind === "retry"
|
|
430
|
+
feedbackHistory = decision.feedbackHistory;
|
|
431
|
+
logger.info(`[feedback-router] Checkpoint "${checkpointId}" rejected at iteration ${iteration}/${maxIterations}. ` +
|
|
432
|
+
`Re-invoking ${CHECKPOINT_TO_AGENT[checkpointId]}...`);
|
|
433
|
+
const agentType = CHECKPOINT_TO_AGENT[checkpointId];
|
|
434
|
+
const newArtifact = await reinvokeAgent(agentType, decision.newPrompt);
|
|
435
|
+
currentArtifact = newArtifact;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
//# sourceMappingURL=feedback-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-router.js","sourceRoot":"","sources":["../../../src/orchestrator/checkpoints/feedback-router.ts"],"names":[],"mappings":"AAAA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AAE,SAAS;gBACrB,aAAa,EAAE,QAAQ,CAAC,eAAe;gBACvC,SAAS,EAAE,QAAQ,CAAC,eAAe;aACpC,CAAC;QACJ,CAAC;QAED,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC9B,MAAM,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC5D,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;YACxD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC;QACpE,CAAC;QAED,4BAA4B;QAC5B,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;QAC3C,MAAM,CAAC,IAAI,CACT,iCAAiC,YAAY,2BAA2B,SAAS,IAAI,aAAa,IAAI;YACpG,eAAe,mBAAmB,CAAC,YAAY,CAAC,KAAK,CACxD,CAAC;QAEF,MAAM,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QACvE,eAAe,GAAG,WAAW,CAAC;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API for the checkpoints module.
|
|
3
|
+
*
|
|
4
|
+
* The coordinator imports from this barrel — never from individual files.
|
|
5
|
+
* The noop mechanism is NOT re-exported here: it is opaque to the coordinator,
|
|
6
|
+
* registered by registry.ts at module init, and retrieved via getCheckpointMechanism("noop").
|
|
7
|
+
*/
|
|
8
|
+
export type { CheckpointId, CheckpointArtifact, CheckpointMechanism, CheckpointOutcome } from "./types.js";
|
|
9
|
+
export { registerCheckpointMechanism, getCheckpointMechanism, getCheckpointMechanismFor, resolveCheckpointMechanismName, type CheckpointOverrideConfig, } from "./registry.js";
|
|
10
|
+
export { CHECKPOINT_SITES, type CheckpointSite } from "./sites.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/checkpoints/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG3G,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API for the checkpoints module.
|
|
3
|
+
*
|
|
4
|
+
* The coordinator imports from this barrel — never from individual files.
|
|
5
|
+
* The noop mechanism is NOT re-exported here: it is opaque to the coordinator,
|
|
6
|
+
* registered by registry.ts at module init, and retrieved via getCheckpointMechanism("noop").
|
|
7
|
+
*/
|
|
8
|
+
// Registry API — re-exported from ./registry.js
|
|
9
|
+
export { registerCheckpointMechanism, getCheckpointMechanism, getCheckpointMechanismFor, resolveCheckpointMechanismName, } from "./registry.js";
|
|
10
|
+
// Site enumeration — re-exported from ./sites.js
|
|
11
|
+
export { CHECKPOINT_SITES } from "./sites.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestrator/checkpoints/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,gDAAgD;AAChD,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,GAE/B,MAAM,eAAe,CAAC;AAEvB,iDAAiD;AACjD,OAAO,EAAE,gBAAgB,EAAuB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI blocking checkpoint mechanism.
|
|
3
|
+
*
|
|
4
|
+
* Prints the checkpoint id + artifact summary + an `a/r/e` prompt to stderr,
|
|
5
|
+
* blocks on stdin via readline until valid input is received, and:
|
|
6
|
+
* - 'a' / 'approve' → { approved: true }
|
|
7
|
+
* - 'r' / 'reject' → prompts for feedback, returns { approved: false, feedback }
|
|
8
|
+
* - 'e' / 'edit' → opens $EDITOR with artifact text, reads back on save,
|
|
9
|
+
* returns { edit: true, editDelta: { before, after } }
|
|
10
|
+
*
|
|
11
|
+
* Falls back to the noop mechanism (auto-approve) when stdin is not a TTY,
|
|
12
|
+
* and writes a warning to stderr.
|
|
13
|
+
*
|
|
14
|
+
* Sprint 8 — colocated in mechanisms/ per Sprint 7 precedent.
|
|
15
|
+
*/
|
|
16
|
+
import type { Readable } from "node:stream";
|
|
17
|
+
import type { CheckpointArtifact, CheckpointId, CheckpointMechanism, CheckpointOutcome } from "../types.js";
|
|
18
|
+
export declare class CliCheckpointMechanism implements CheckpointMechanism {
|
|
19
|
+
private readonly fallback;
|
|
20
|
+
private readonly stdin;
|
|
21
|
+
private readonly editor?;
|
|
22
|
+
/**
|
|
23
|
+
* @param fallback - Injected noop-like mechanism used when stdin is not a TTY.
|
|
24
|
+
* Defaults to a fresh NoopCheckpointMechanism instance.
|
|
25
|
+
* Injecting allows tests to spy on the fallback path.
|
|
26
|
+
* @param stdin - Readable stream to read user input from.
|
|
27
|
+
* Defaults to process.stdin; inject a pre-stuffed Readable
|
|
28
|
+
* for performance benchmarks / non-TTY unit tests.
|
|
29
|
+
* @param editor - Editor command override ($EDITOR env var is used when
|
|
30
|
+
* this is not supplied; falls back to "nano").
|
|
31
|
+
*/
|
|
32
|
+
constructor(fallback?: CheckpointMechanism, stdin?: Readable, editor?: string | undefined);
|
|
33
|
+
request(checkpoint: CheckpointId, artifact: CheckpointArtifact): Promise<CheckpointOutcome>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/orchestrator/checkpoints/mechanisms/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAyDrB,qBAAa,sBAAuB,YAAW,mBAAmB;IAY9D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAb1B;;;;;;;;;OASG;gBAEgB,QAAQ,GAAE,mBAAkC,EAC5C,KAAK,GAAE,QAAoC,EAC3C,MAAM,CAAC,EAAE,MAAM,YAAA;IAG5B,OAAO,CACX,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC;CA8E9B"}
|