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,538 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PreflightContextInjector — ADR-9 Primary KPI Lever.
|
|
3
|
+
*
|
|
4
|
+
* Runs deterministic per-role graph queries before each agent spawn.
|
|
5
|
+
* Formats results as markdown and prepends to the agent's first message.
|
|
6
|
+
*
|
|
7
|
+
* Key invariants:
|
|
8
|
+
* - DETERMINISTIC: same contract + role → same output. No LLM in this path.
|
|
9
|
+
* - NEVER BLOCKS SPAWN: 5s timeout + try/catch; returns firstMessage unchanged on failure.
|
|
10
|
+
* - RESEARCHER-PHASE2 ISOLATION: NEVER uses contract.title/description/feature text.
|
|
11
|
+
* Uses ONLY overrides.questionKeywords.
|
|
12
|
+
* - graph.enabled=false or engineHealth!='ready' → returns firstMessage unchanged.
|
|
13
|
+
*/
|
|
14
|
+
import { execa } from "execa";
|
|
15
|
+
import { enforceBudget } from "./preflight-budgets.js";
|
|
16
|
+
import { graphPipelineLifecycle } from "./pipeline-lifecycle.js";
|
|
17
|
+
// ── Query batch definitions ────────────────────────────────────────
|
|
18
|
+
/**
|
|
19
|
+
* Per-role deterministic query batch factory functions.
|
|
20
|
+
*
|
|
21
|
+
* Each function receives a PreflightInput and returns a PrefetchSpec[].
|
|
22
|
+
* The batch is deterministic: same input → same specs → same output.
|
|
23
|
+
*
|
|
24
|
+
* CRITICAL: 'researcher-phase2' uses ONLY input.questionKeywords.
|
|
25
|
+
* It MUST NOT access contract.title, contract.description, or contract.feature.
|
|
26
|
+
* The PreflightInput for this role is built exclusively from overrides.questionKeywords.
|
|
27
|
+
*/
|
|
28
|
+
export const QUERY_BATCHES = {
|
|
29
|
+
// planner and researcher-phase1 do not use graph tools — no preflight queries.
|
|
30
|
+
planner: () => [],
|
|
31
|
+
"researcher-phase1": () => [],
|
|
32
|
+
architect: (c) => {
|
|
33
|
+
const specs = [
|
|
34
|
+
{ key: "overview", op: "overview", args: {} },
|
|
35
|
+
];
|
|
36
|
+
for (let i = 0; i < c.symbols.length; i++) {
|
|
37
|
+
specs.push({
|
|
38
|
+
key: `imports-of-${i}`,
|
|
39
|
+
op: "query",
|
|
40
|
+
args: { pattern: "imports_of", target: symbolToNodeRef(c.symbols[i]) },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return specs;
|
|
44
|
+
},
|
|
45
|
+
curator: (c) => {
|
|
46
|
+
const specs = [];
|
|
47
|
+
if (c.keywords.length > 0) {
|
|
48
|
+
specs.push({
|
|
49
|
+
key: "search",
|
|
50
|
+
op: "search",
|
|
51
|
+
args: { q: c.keywords.join(" ") },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
for (let i = 0; i < c.symbols.length; i++) {
|
|
55
|
+
specs.push({
|
|
56
|
+
key: `callers-of-${i}`,
|
|
57
|
+
op: "query",
|
|
58
|
+
args: { pattern: "callers_of", target: symbolToNodeRef(c.symbols[i]) },
|
|
59
|
+
});
|
|
60
|
+
specs.push({
|
|
61
|
+
key: `tests-for-curator-${i}`,
|
|
62
|
+
op: "query",
|
|
63
|
+
args: { pattern: "tests_for", target: symbolToNodeRef(c.symbols[i]) },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return specs;
|
|
67
|
+
},
|
|
68
|
+
generator: (c) => {
|
|
69
|
+
const specs = [];
|
|
70
|
+
for (let i = 0; i < c.symbols.length; i++) {
|
|
71
|
+
specs.push({
|
|
72
|
+
key: `impact-${i}`,
|
|
73
|
+
op: "impact",
|
|
74
|
+
args: { target: symbolToNodeRef(c.symbols[i]) },
|
|
75
|
+
});
|
|
76
|
+
specs.push({
|
|
77
|
+
key: `tests-for-gen-${i}`,
|
|
78
|
+
op: "query",
|
|
79
|
+
args: { pattern: "tests_for", target: symbolToNodeRef(c.symbols[i]) },
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return specs;
|
|
83
|
+
},
|
|
84
|
+
evaluator: (c) => [
|
|
85
|
+
{
|
|
86
|
+
key: "changes",
|
|
87
|
+
op: "changes",
|
|
88
|
+
args: { since: c.baselineSha || "HEAD~1" },
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
"researcher-phase2": (c) => {
|
|
92
|
+
// ISOLATION GUARANTEE: uses ONLY c.questionKeywords.
|
|
93
|
+
// c.symbols and c.keywords are ALWAYS empty for this role (enforced in inject()).
|
|
94
|
+
const specs = [
|
|
95
|
+
{ key: "overview", op: "overview", args: {} },
|
|
96
|
+
];
|
|
97
|
+
if (c.questionKeywords.length > 0) {
|
|
98
|
+
specs.push({
|
|
99
|
+
key: "search",
|
|
100
|
+
op: "search",
|
|
101
|
+
args: { q: c.questionKeywords.join(" ") },
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return specs;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
// ── Helper: derive PreflightInput from a SprintContract ───────────
|
|
108
|
+
/**
|
|
109
|
+
* Derive PreflightInput fields from a SprintContract.
|
|
110
|
+
*
|
|
111
|
+
* SprintContract does NOT have symbols/keywords/questionKeywords/baselineSha fields.
|
|
112
|
+
* This function derives them defensively:
|
|
113
|
+
*
|
|
114
|
+
* - symbols: file basenames from estimatedFiles, stripped of extensions.
|
|
115
|
+
* These are the files the sprint will touch — a good proxy for affected symbols.
|
|
116
|
+
* - keywords: unique tokens (length >= 4) from title + description, top 8.
|
|
117
|
+
* Used by Curator search to find relevant code.
|
|
118
|
+
* - questionKeywords: ALWAYS empty here. Populated only via overrides.questionKeywords
|
|
119
|
+
* (for researcher-phase2 call sites that pass Phase 1 question tokens).
|
|
120
|
+
* - baselineSha: defaults to "HEAD~1"; can be overridden via overrides.baselineSha.
|
|
121
|
+
*/
|
|
122
|
+
export function deriveFromContract(contract) {
|
|
123
|
+
if (!contract) {
|
|
124
|
+
return { symbols: [], keywords: [], questionKeywords: [], baselineSha: "HEAD~1" };
|
|
125
|
+
}
|
|
126
|
+
// symbols: extract file basenames from estimatedFiles, remove extensions
|
|
127
|
+
const symbols = contract.estimatedFiles
|
|
128
|
+
.map((p) => {
|
|
129
|
+
const parts = p.split("/");
|
|
130
|
+
return parts[parts.length - 1] ?? p;
|
|
131
|
+
})
|
|
132
|
+
.map((b) => b.replace(/\.[tj]sx?$/, ""))
|
|
133
|
+
.filter((s) => s.length > 0);
|
|
134
|
+
// keywords: unique tokens from title + description (minLen=4, top 8)
|
|
135
|
+
const text = `${contract.title} ${contract.description}`;
|
|
136
|
+
const keywords = uniqueTokens(text, { minLen: 4, max: 8 });
|
|
137
|
+
return {
|
|
138
|
+
symbols,
|
|
139
|
+
keywords,
|
|
140
|
+
questionKeywords: [], // NEVER derived from contract — must come from overrides
|
|
141
|
+
baselineSha: "HEAD~1",
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Extract unique meaningful tokens from text.
|
|
146
|
+
* Lowercases, strips non-alphanumeric, deduplicates, limits by minLen and count.
|
|
147
|
+
*/
|
|
148
|
+
function uniqueTokens(text, opts) {
|
|
149
|
+
const seen = new Set();
|
|
150
|
+
const tokens = [];
|
|
151
|
+
for (const word of text.toLowerCase().split(/[\s\-_/.,;:()[\]{}'"!?]+/)) {
|
|
152
|
+
if (word.length >= opts.minLen && !seen.has(word)) {
|
|
153
|
+
seen.add(word);
|
|
154
|
+
tokens.push(word);
|
|
155
|
+
if (tokens.length >= opts.max)
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return tokens;
|
|
160
|
+
}
|
|
161
|
+
/** Build a minimal NodeRef from a symbol name string (for query/impact targets). */
|
|
162
|
+
function symbolToNodeRef(symbol) {
|
|
163
|
+
return { id: symbol, kind: "function", file: symbol, line: 0, symbol };
|
|
164
|
+
}
|
|
165
|
+
// ── Stale banner construction ──────────────────────────────────────
|
|
166
|
+
/**
|
|
167
|
+
* Build a stale-data banner by probing git for both SHAs and commit delta.
|
|
168
|
+
*
|
|
169
|
+
* Format: `_⚠ Graph indexed at SHA <X>; current HEAD is <Y> (N commits behind). Context may be outdated._`
|
|
170
|
+
*
|
|
171
|
+
* Both SHAs are shortened to 7 chars. Commits-behind is computed via
|
|
172
|
+
* `git rev-list --count <lastSha>..<HEAD>`. Falls back gracefully if git
|
|
173
|
+
* is unavailable or the manifest has no lastSyncedHeadSha.
|
|
174
|
+
*/
|
|
175
|
+
async function buildStaleBanner(projectRoot, artifactStore) {
|
|
176
|
+
try {
|
|
177
|
+
const manifest = await artifactStore.readManifest();
|
|
178
|
+
const lastSha = manifest?.lastSyncedHeadSha;
|
|
179
|
+
// Get current HEAD SHA
|
|
180
|
+
const headResult = await execa("git", ["rev-parse", "HEAD"], {
|
|
181
|
+
cwd: projectRoot,
|
|
182
|
+
reject: false,
|
|
183
|
+
timeout: 2000,
|
|
184
|
+
});
|
|
185
|
+
const currentSha = headResult.exitCode === 0 ? headResult.stdout.trim() : null;
|
|
186
|
+
if (!lastSha && !currentSha) {
|
|
187
|
+
return `_⚠ Graph data may be outdated. Context may be stale._`;
|
|
188
|
+
}
|
|
189
|
+
const shortLast = lastSha ? lastSha.slice(0, 7) : "unknown";
|
|
190
|
+
const shortCurrent = currentSha ? currentSha.slice(0, 7) : "unknown";
|
|
191
|
+
// Get commits-behind count
|
|
192
|
+
let commitsBehind = 0;
|
|
193
|
+
if (lastSha && currentSha && lastSha !== currentSha) {
|
|
194
|
+
try {
|
|
195
|
+
const revResult = await execa("git", ["rev-list", "--count", `${lastSha}..HEAD`], { cwd: projectRoot, reject: false, timeout: 2000 });
|
|
196
|
+
if (revResult.exitCode === 0) {
|
|
197
|
+
commitsBehind = parseInt(revResult.stdout.trim(), 10) || 0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Ignore git errors — we'll fall back to no commit count
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const behindStr = commitsBehind > 0 ? ` (${commitsBehind} commits behind)` : "";
|
|
205
|
+
return `_⚠ Graph indexed at SHA ${shortLast}; current HEAD is ${shortCurrent}${behindStr}. Context may be outdated._`;
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return `_⚠ Graph data may be outdated. Context may be stale._`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// ── Markdown formatters ────────────────────────────────────────────
|
|
212
|
+
function formatNodeRefs(nodes) {
|
|
213
|
+
if (nodes.length === 0)
|
|
214
|
+
return "_No results._";
|
|
215
|
+
return nodes.map((n) => `- ${n.file}:${n.line} (${n.kind}) ${n.symbol}`).join("\n");
|
|
216
|
+
}
|
|
217
|
+
function formatSearchHits(hits) {
|
|
218
|
+
if (hits.length === 0)
|
|
219
|
+
return "_No results._";
|
|
220
|
+
return hits
|
|
221
|
+
.map((h) => `- ${h.node.file}:${h.node.line} (${h.node.kind}) ${h.node.symbol} — score: ${h.score.toFixed(2)}`)
|
|
222
|
+
.join("\n");
|
|
223
|
+
}
|
|
224
|
+
function formatImpactReport(report) {
|
|
225
|
+
const lines = [];
|
|
226
|
+
lines.push(`**Root:** ${report.root.file}:${report.root.line} (${report.root.kind}) ${report.root.symbol}`);
|
|
227
|
+
if (report.affected.length > 0) {
|
|
228
|
+
lines.push(`\n**Affected (${report.affected.length}):**`);
|
|
229
|
+
lines.push(...report.affected.map((n) => `- ${n.file}:${n.line} (${n.kind}) ${n.symbol}`));
|
|
230
|
+
}
|
|
231
|
+
if (report.testsAffected.length > 0) {
|
|
232
|
+
lines.push(`\n**Tests affected (${report.testsAffected.length}):**`);
|
|
233
|
+
lines.push(...report.testsAffected.map((n) => `- ${n.file}:${n.line} (${n.kind}) ${n.symbol}`));
|
|
234
|
+
}
|
|
235
|
+
return lines.join("\n") || "_No impact data._";
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Format a single successful query result as a markdown `### Section` block.
|
|
239
|
+
*
|
|
240
|
+
* @param key The PrefetchSpec key (used to derive section heading).
|
|
241
|
+
* @param spec The original PrefetchSpec (for metadata about op/args).
|
|
242
|
+
* @param data The raw graph result data.
|
|
243
|
+
*/
|
|
244
|
+
function formatResultSection(_key, spec, data) {
|
|
245
|
+
const heading = headingForSpec(spec);
|
|
246
|
+
const body = bodyForData(spec, data);
|
|
247
|
+
return `### ${heading}\n\n${body}`;
|
|
248
|
+
}
|
|
249
|
+
function headingForSpec(spec) {
|
|
250
|
+
switch (spec.op) {
|
|
251
|
+
case "overview":
|
|
252
|
+
return "Overview";
|
|
253
|
+
case "search": {
|
|
254
|
+
const args = spec.args;
|
|
255
|
+
return `Search: "${args.q ?? ""}"`;
|
|
256
|
+
}
|
|
257
|
+
case "query": {
|
|
258
|
+
const args = spec.args;
|
|
259
|
+
const symbol = args.target?.symbol ?? args.target?.id ?? "";
|
|
260
|
+
switch (args.pattern) {
|
|
261
|
+
case "callers_of":
|
|
262
|
+
return `Callers of ${symbol}`;
|
|
263
|
+
case "imports_of":
|
|
264
|
+
return `Imports of ${symbol}`;
|
|
265
|
+
case "tests_for":
|
|
266
|
+
return `Tests covering ${symbol}`;
|
|
267
|
+
case "callees_of":
|
|
268
|
+
return `Callees of ${symbol}`;
|
|
269
|
+
default:
|
|
270
|
+
return `Query: ${args.pattern ?? "unknown"}`;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
case "impact": {
|
|
274
|
+
const args = spec.args;
|
|
275
|
+
const sym = typeof args.target === "string"
|
|
276
|
+
? args.target
|
|
277
|
+
: args.target?.symbol ?? "unknown";
|
|
278
|
+
return `Impact radius of ${sym}`;
|
|
279
|
+
}
|
|
280
|
+
case "changes": {
|
|
281
|
+
const args = spec.args;
|
|
282
|
+
return `Changes since ${args.since ?? "baseline"}`;
|
|
283
|
+
}
|
|
284
|
+
case "reviewContext":
|
|
285
|
+
return "Review Context";
|
|
286
|
+
default:
|
|
287
|
+
return "Graph Result";
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function bodyForData(spec, data) {
|
|
291
|
+
switch (spec.op) {
|
|
292
|
+
case "overview":
|
|
293
|
+
case "reviewContext":
|
|
294
|
+
return typeof data === "string" ? data : JSON.stringify(data, null, 2);
|
|
295
|
+
case "search":
|
|
296
|
+
return formatSearchHits(data);
|
|
297
|
+
case "query":
|
|
298
|
+
case "changes":
|
|
299
|
+
return formatNodeRefs(data);
|
|
300
|
+
case "impact":
|
|
301
|
+
return formatImpactReport(data);
|
|
302
|
+
default:
|
|
303
|
+
return typeof data === "string" ? data : JSON.stringify(data, null, 2);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// ── PreflightContextInjector ───────────────────────────────────────
|
|
307
|
+
/**
|
|
308
|
+
* Builds and injects deterministic graph context into agent first messages.
|
|
309
|
+
*
|
|
310
|
+
* Constructor takes a GraphClient (may be null if engine not ready) and a
|
|
311
|
+
* GraphSection config. inject() is the only public method.
|
|
312
|
+
*
|
|
313
|
+
* Usage in agent files:
|
|
314
|
+
* ```typescript
|
|
315
|
+
* const injector = new PreflightContextInjector(graphPipelineLifecycle.getGraphClient(), config.graph);
|
|
316
|
+
* const msg = await injector.inject("curator", contract, userMessage);
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
export class PreflightContextInjector {
|
|
320
|
+
client;
|
|
321
|
+
config;
|
|
322
|
+
incidents;
|
|
323
|
+
projectRoot;
|
|
324
|
+
artifactStore;
|
|
325
|
+
constructor(client, config, incidents, projectRoot, artifactStore) {
|
|
326
|
+
this.client = client;
|
|
327
|
+
this.config = config;
|
|
328
|
+
this.incidents = incidents;
|
|
329
|
+
this.projectRoot = projectRoot;
|
|
330
|
+
this.artifactStore = artifactStore;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Inject pre-flight graph context into a first message.
|
|
334
|
+
*
|
|
335
|
+
* Fast-path: returns firstMessage UNCHANGED when:
|
|
336
|
+
* - graph.enabled !== true
|
|
337
|
+
* - client is null
|
|
338
|
+
* - engineHealth !== 'ready'
|
|
339
|
+
*
|
|
340
|
+
* Timeout: 5000ms. On timeout or any error, logs an incident and returns
|
|
341
|
+
* firstMessage unchanged. Agent spawn is NEVER blocked.
|
|
342
|
+
*
|
|
343
|
+
* Researcher-Phase2 isolation: NEVER uses contract.title/description/feature.
|
|
344
|
+
* Uses ONLY overrides.questionKeywords. Passing a non-null contract for
|
|
345
|
+
* researcher-phase2 is defensively handled — feature text is still NOT used.
|
|
346
|
+
*
|
|
347
|
+
* @param role Agent role string.
|
|
348
|
+
* @param contract Sprint contract (or null for research phase / architect).
|
|
349
|
+
* @param firstMessage The agent's first user message.
|
|
350
|
+
* @param overrides Optional overrides: questionKeywords, baselineSha.
|
|
351
|
+
*/
|
|
352
|
+
async inject(role, contract, firstMessage, overrides) {
|
|
353
|
+
// Fast-path: disabled or no client
|
|
354
|
+
if (!this.config?.enabled || !this.client) {
|
|
355
|
+
return firstMessage;
|
|
356
|
+
}
|
|
357
|
+
// Fast-path: engine not ready
|
|
358
|
+
const health = graphPipelineLifecycle.engineHealth();
|
|
359
|
+
if (health !== "ready") {
|
|
360
|
+
return firstMessage;
|
|
361
|
+
}
|
|
362
|
+
try {
|
|
363
|
+
const result = await Promise.race([
|
|
364
|
+
this.runInject(role, contract, firstMessage, overrides),
|
|
365
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("preflight-timeout-5000ms")), 5000)),
|
|
366
|
+
]);
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
catch (err) {
|
|
370
|
+
// Log incident; return ORIGINAL firstMessage so spawn proceeds.
|
|
371
|
+
try {
|
|
372
|
+
if (this.incidents) {
|
|
373
|
+
await this.incidents.append({
|
|
374
|
+
ts: new Date().toISOString(),
|
|
375
|
+
event: "preflight-failure",
|
|
376
|
+
role,
|
|
377
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
// Swallow — incident write failure must not break spawn
|
|
383
|
+
}
|
|
384
|
+
return firstMessage;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
/** Core injection logic — called by inject() within the timeout race. */
|
|
388
|
+
async runInject(role, contract, firstMessage, overrides) {
|
|
389
|
+
// Build the PreflightInput for this role.
|
|
390
|
+
// CRITICAL: researcher-phase2 NEVER uses contract fields — isolation invariant.
|
|
391
|
+
let input;
|
|
392
|
+
if (role === "researcher-phase2") {
|
|
393
|
+
// Isolation: ALWAYS build from overrides.questionKeywords only.
|
|
394
|
+
// Even if contract is non-null, we do NOT touch its title/description/feature.
|
|
395
|
+
input = {
|
|
396
|
+
symbols: [],
|
|
397
|
+
keywords: [],
|
|
398
|
+
questionKeywords: overrides?.questionKeywords ?? [],
|
|
399
|
+
baselineSha: "",
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
else if (contract) {
|
|
403
|
+
input = deriveFromContract(contract);
|
|
404
|
+
if (overrides?.questionKeywords) {
|
|
405
|
+
input.questionKeywords = overrides.questionKeywords;
|
|
406
|
+
}
|
|
407
|
+
if (overrides?.baselineSha) {
|
|
408
|
+
input.baselineSha = overrides.baselineSha;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
// null contract for non-Phase2 roles (e.g., Architect before planning)
|
|
413
|
+
input = { symbols: [], keywords: [], questionKeywords: [], baselineSha: "HEAD~1" };
|
|
414
|
+
if (overrides?.questionKeywords) {
|
|
415
|
+
input.questionKeywords = overrides.questionKeywords;
|
|
416
|
+
}
|
|
417
|
+
if (overrides?.baselineSha) {
|
|
418
|
+
input.baselineSha = overrides.baselineSha;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
// Get the query batch for this role
|
|
422
|
+
const batchFactory = QUERY_BATCHES[role];
|
|
423
|
+
const specs = batchFactory(input);
|
|
424
|
+
// If no specs (e.g. no symbols and no keywords), return unchanged
|
|
425
|
+
if (specs.length === 0) {
|
|
426
|
+
return firstMessage;
|
|
427
|
+
}
|
|
428
|
+
// Execute the batch via GraphClient.prefetch
|
|
429
|
+
const results = await this.client.prefetch(specs);
|
|
430
|
+
// Build markdown sections from successful results
|
|
431
|
+
const sections = [];
|
|
432
|
+
let anyFailed = false;
|
|
433
|
+
for (const spec of specs) {
|
|
434
|
+
const result = results[spec.key];
|
|
435
|
+
if (!result) {
|
|
436
|
+
anyFailed = true;
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
if (result.ok) {
|
|
440
|
+
const section = formatResultSection(spec.key, spec, result.data);
|
|
441
|
+
sections.push(section);
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
anyFailed = true;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
// If ALL queries failed and we have no content, return a minimal note
|
|
448
|
+
if (sections.length === 0) {
|
|
449
|
+
const warning = "_⚠ Some graph queries unavailable; agent may need to fall back to grep where applicable._";
|
|
450
|
+
return `${firstMessage}\n\n## Codebase Context (graph)\n\n${warning}`;
|
|
451
|
+
}
|
|
452
|
+
// Assemble markdown body
|
|
453
|
+
let bodyMarkdown = sections.join("\n\n");
|
|
454
|
+
if (anyFailed) {
|
|
455
|
+
bodyMarkdown += "\n\n_⚠ Some graph queries unavailable; agent may need to fall back to grep where applicable._";
|
|
456
|
+
}
|
|
457
|
+
// Apply token budget
|
|
458
|
+
const budget = this.getBudgetForRole(role);
|
|
459
|
+
const { out: budgetedBody } = enforceBudget(bodyMarkdown, budget);
|
|
460
|
+
// Build stale banner (if applicable and artifactStore available)
|
|
461
|
+
let staleBanner = "";
|
|
462
|
+
if (this.artifactStore && this.projectRoot) {
|
|
463
|
+
try {
|
|
464
|
+
const staleness = await this.artifactStore.staleness();
|
|
465
|
+
if (staleness.stale) {
|
|
466
|
+
const banner = await buildStaleBanner(this.projectRoot, this.artifactStore);
|
|
467
|
+
if (banner)
|
|
468
|
+
staleBanner = `${banner}\n\n`;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
catch {
|
|
472
|
+
// Stale check failure must not break injection
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
// Assemble final markdown: stale banner + header + body
|
|
476
|
+
const contextSection = `${staleBanner}## Codebase Context (graph)\n\n${budgetedBody}`;
|
|
477
|
+
// Prepend context section to firstMessage
|
|
478
|
+
return `${contextSection}\n\n${firstMessage}`;
|
|
479
|
+
}
|
|
480
|
+
/** Look up the token budget for a given role from config, with fallback to defaults. */
|
|
481
|
+
getBudgetForRole(role) {
|
|
482
|
+
const budgets = this.config
|
|
483
|
+
?.preflightBudgets;
|
|
484
|
+
if (!budgets) {
|
|
485
|
+
// Fallback defaults (planner and researcher-phase1 have budget 0 — not gated roles)
|
|
486
|
+
const DEFAULTS = {
|
|
487
|
+
planner: 0,
|
|
488
|
+
"researcher-phase1": 0,
|
|
489
|
+
architect: 4000,
|
|
490
|
+
curator: 2000,
|
|
491
|
+
generator: 1000,
|
|
492
|
+
evaluator: 1500,
|
|
493
|
+
"researcher-phase2": 3000,
|
|
494
|
+
};
|
|
495
|
+
return DEFAULTS[role];
|
|
496
|
+
}
|
|
497
|
+
// Map camelCase config key to role string
|
|
498
|
+
const camelKey = {
|
|
499
|
+
planner: "planner",
|
|
500
|
+
"researcher-phase1": "researcherPhase1",
|
|
501
|
+
architect: "architect",
|
|
502
|
+
curator: "curator",
|
|
503
|
+
generator: "generator",
|
|
504
|
+
evaluator: "evaluator",
|
|
505
|
+
"researcher-phase2": "researcherPhase2",
|
|
506
|
+
};
|
|
507
|
+
const key = camelKey[role];
|
|
508
|
+
const val = budgets[key];
|
|
509
|
+
if (typeof val === "number" && val > 0)
|
|
510
|
+
return val;
|
|
511
|
+
// fallback defaults
|
|
512
|
+
const DEFAULTS = {
|
|
513
|
+
planner: 0,
|
|
514
|
+
"researcher-phase1": 0,
|
|
515
|
+
architect: 4000,
|
|
516
|
+
curator: 2000,
|
|
517
|
+
generator: 1000,
|
|
518
|
+
evaluator: 1500,
|
|
519
|
+
"researcher-phase2": 3000,
|
|
520
|
+
};
|
|
521
|
+
return DEFAULTS[role];
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
// ── Keyword extraction helper (exported for pipeline.ts call sites) ─
|
|
525
|
+
/**
|
|
526
|
+
* Extract meaningful search keywords from a block of text (e.g. Phase 1 questions).
|
|
527
|
+
*
|
|
528
|
+
* Used by pipeline.ts to derive overrides.questionKeywords for researcher-phase2
|
|
529
|
+
* from the Phase 1 questions array.
|
|
530
|
+
*
|
|
531
|
+
* Returns up to 10 unique tokens of length >= 5, lowercased.
|
|
532
|
+
* Does NOT preserve the original text — the output is transformed tokens only,
|
|
533
|
+
* which is safe to pass to researcher-phase2 (no feature text leak).
|
|
534
|
+
*/
|
|
535
|
+
export function extractKeywords(text) {
|
|
536
|
+
return uniqueTokens(text, { minLen: 5, max: 10 });
|
|
537
|
+
}
|
|
538
|
+
//# sourceMappingURL=preflight-injector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight-injector.js","sourceRoot":"","sources":["../../src/graph/preflight-injector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,C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AE,IAAI;gBACf,mBAAmB,EAAE,IAAI;aAC1B,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QAED,0CAA0C;QAC1C,MAAM,QAAQ,GAAmC;YAC/C,OAAO,EAAE,SAAS;YAClB,mBAAmB,EAAE,kBAAkB;YACvC,SAAS,EAAE,WAAW;YACtB,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,WAAW;YACtB,SAAS,EAAE,WAAW;YACtB,mBAAmB,EAAE,kBAAkB;SACxC,CAAC;QACF,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;QAEnD,oBAAoB;QACpB,MAAM,QAAQ,GAAmC;YAC/C,OAAO,EAAE,CAAC;YACV,mBAAmB,EAAE,CAAC;YACtB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,mBAAmB,EAAE,IAAI;SAC1B,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACF;AAED,uEAAuE;AAEvE;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PrereqResult } from "./types.js";
|
|
2
|
+
export declare const TOKENSAVE_VERSION_RANGE = ">=6.0.0-beta.1 <7.0.0";
|
|
3
|
+
export declare class TokensavePrereqCheck {
|
|
4
|
+
private readonly binary;
|
|
5
|
+
constructor(binary?: string);
|
|
6
|
+
check(): Promise<PrereqResult>;
|
|
7
|
+
/** Platform-aware install hint. Strings are verbatim from s1-c2 — DO NOT paraphrase. */
|
|
8
|
+
private installHint;
|
|
9
|
+
/** Must name both detected and required versions (s1-c2). */
|
|
10
|
+
private incompatibleHint;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=prereq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prereq.d.ts","sourceRoot":"","sources":["../../src/graph/prereq.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAE/D,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,GAAE,MAAoB;IAEnD,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC;IAsCpC,wFAAwF;IACxF,OAAO,CAAC,WAAW;IAWnB,6DAA6D;IAC7D,OAAO,CAAC,gBAAgB;CAGzB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { execa } from "execa";
|
|
2
|
+
import semver from "semver";
|
|
3
|
+
export const TOKENSAVE_VERSION_RANGE = ">=6.0.0-beta.1 <7.0.0";
|
|
4
|
+
export class TokensavePrereqCheck {
|
|
5
|
+
binary;
|
|
6
|
+
constructor(binary = "tokensave") {
|
|
7
|
+
this.binary = binary;
|
|
8
|
+
}
|
|
9
|
+
async check() {
|
|
10
|
+
let result;
|
|
11
|
+
try {
|
|
12
|
+
result = await execa(this.binary, ["--version"], {
|
|
13
|
+
reject: false,
|
|
14
|
+
timeout: 5000,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return { ok: false, reason: "MISSING", hint: this.installHint() };
|
|
19
|
+
}
|
|
20
|
+
if (result.exitCode !== 0 || result.failed) {
|
|
21
|
+
return { ok: false, reason: "MISSING", hint: this.installHint() };
|
|
22
|
+
}
|
|
23
|
+
const firstLine = (result.stdout ?? "").split("\n")[0] ?? "";
|
|
24
|
+
// Accept "tokensave 6.0.0-beta.1" or "6.0.0-beta.1"
|
|
25
|
+
const match = firstLine.match(/(\d+\.\d+\.\d+(?:-[\w.]+)?)/);
|
|
26
|
+
const version = match ? match[1] : null;
|
|
27
|
+
if (!version || !semver.valid(version)) {
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
reason: "INCOMPATIBLE",
|
|
31
|
+
hint: this.incompatibleHint(firstLine || "unknown"),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (!semver.satisfies(version, TOKENSAVE_VERSION_RANGE, {
|
|
35
|
+
includePrerelease: true,
|
|
36
|
+
})) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
reason: "INCOMPATIBLE",
|
|
40
|
+
hint: this.incompatibleHint(version),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return { ok: true, version };
|
|
44
|
+
}
|
|
45
|
+
/** Platform-aware install hint. Strings are verbatim from s1-c2 — DO NOT paraphrase. */
|
|
46
|
+
installHint() {
|
|
47
|
+
switch (process.platform) {
|
|
48
|
+
case "darwin":
|
|
49
|
+
return "brew install aovestdipaperino/tap/tokensave";
|
|
50
|
+
case "win32":
|
|
51
|
+
return "scoop bucket add tokensave https://github.com/aovestdipaperino/scoop-bucket && scoop install tokensave";
|
|
52
|
+
default:
|
|
53
|
+
return "cargo install tokensave";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Must name both detected and required versions (s1-c2). */
|
|
57
|
+
incompatibleHint(detected) {
|
|
58
|
+
return `tokensave ${detected} is incompatible; required range: ${TOKENSAVE_VERSION_RANGE}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=prereq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prereq.js","sourceRoot":"","sources":["../../src/graph/prereq.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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