@apralabs/apra-fleet 0.4.0 → 0.4.2
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/README.md +159 -13
- package/dist/agents/backlog-groomer.md +31 -19
- package/dist/agents/ci-watcher.md +16 -1
- package/dist/agents/deployer.md +37 -47
- package/dist/agents/doer.md +147 -114
- package/dist/agents/harvester.md +41 -34
- package/dist/agents/integ-test-runner.md +98 -114
- package/dist/agents/kb-reconciler.md +205 -0
- package/dist/agents/plan-reviewer.md +45 -44
- package/dist/agents/planner.md +121 -50
- package/dist/agents/regression-test-runner.md +84 -81
- package/dist/agents/reviewer.md +118 -44
- package/dist/agents/schemas/doer-output.json +63 -3
- package/dist/agents/schemas/harvester-output.json +59 -2
- package/dist/agents/schemas/integ-test-runner-output.json +3 -3
- package/dist/agents/schemas/kb-reconciler-output.json +87 -0
- package/dist/agents/schemas/planner-output.json +65 -0
- package/dist/agents/schemas/regression-test-runner-output.json +4 -17
- package/dist/agents/schemas/reviewer-output.json +105 -8
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +1 -2
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +3 -3
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +4 -13
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +1 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +141 -44
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/join.js +1 -1
- package/dist/cli/join.js.map +1 -1
- package/dist/cli/kb-commit.d.ts +12 -0
- package/dist/cli/kb-commit.d.ts.map +1 -0
- package/dist/cli/kb-commit.js +53 -0
- package/dist/cli/kb-commit.js.map +1 -0
- package/dist/cli/kb-directives.d.ts +17 -0
- package/dist/cli/kb-directives.d.ts.map +1 -0
- package/dist/cli/kb-directives.js +146 -0
- package/dist/cli/kb-directives.js.map +1 -0
- package/dist/cli/kb-import.d.ts +13 -0
- package/dist/cli/kb-import.d.ts.map +1 -0
- package/dist/cli/kb-import.js +56 -0
- package/dist/cli/kb-import.js.map +1 -0
- package/dist/cli/register-member.js +1 -1
- package/dist/cli/start.d.ts.map +1 -1
- package/dist/cli/start.js +7 -0
- package/dist/cli/start.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +16 -3
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/watch.d.ts +76 -4
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +150 -17
- package/dist/cli/watch.js.map +1 -1
- package/dist/commands/kb-server.d.ts +8 -0
- package/dist/commands/kb-server.d.ts.map +1 -0
- package/dist/commands/kb-server.js +221 -0
- package/dist/commands/kb-server.js.map +1 -0
- package/dist/index.js +77 -2
- package/dist/index.js.map +1 -1
- package/dist/os/git-bash-candidates.d.ts +35 -0
- package/dist/os/git-bash-candidates.d.ts.map +1 -0
- package/dist/os/git-bash-candidates.js +46 -0
- package/dist/os/git-bash-candidates.js.map +1 -0
- package/dist/os/index.d.ts +13 -4
- package/dist/os/index.d.ts.map +1 -1
- package/dist/os/index.js +17 -2
- package/dist/os/index.js.map +1 -1
- package/dist/os/linux.d.ts +1 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +19 -2
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +12 -0
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/os-commands.js.map +1 -1
- package/dist/os/windows-gitbash.d.ts +93 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -0
- package/dist/os/windows-gitbash.js +244 -0
- package/dist/os/windows-gitbash.js.map +1 -0
- package/dist/os/windows.d.ts +35 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +93 -35
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +15 -3
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +145 -11
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +14 -3
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +69 -22
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +14 -3
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +34 -8
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +14 -3
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +33 -8
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/email/headers.d.ts +15 -0
- package/dist/providers/email/headers.d.ts.map +1 -0
- package/dist/providers/email/headers.js +42 -0
- package/dist/providers/email/headers.js.map +1 -0
- package/dist/providers/email/index.d.ts +18 -0
- package/dist/providers/email/index.d.ts.map +1 -0
- package/dist/providers/email/index.js +60 -0
- package/dist/providers/email/index.js.map +1 -0
- package/dist/providers/email/provider.d.ts +49 -0
- package/dist/providers/email/provider.d.ts.map +1 -0
- package/dist/providers/email/provider.js +2 -0
- package/dist/providers/email/provider.js.map +1 -0
- package/dist/providers/email/sendgrid.d.ts +12 -0
- package/dist/providers/email/sendgrid.d.ts.map +1 -0
- package/dist/providers/email/sendgrid.js +67 -0
- package/dist/providers/email/sendgrid.js.map +1 -0
- package/dist/providers/email/smtp.d.ts +65 -0
- package/dist/providers/email/smtp.d.ts.map +1 -0
- package/dist/providers/email/smtp.js +373 -0
- package/dist/providers/email/smtp.js.map +1 -0
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +0 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/none.d.ts +14 -3
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +26 -2
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +14 -3
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +60 -6
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +91 -5
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +45 -1
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.d.ts.map +1 -1
- package/dist/services/agent-provisioner.js +5 -8
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/cloud/activity.js +2 -2
- package/dist/services/cloud/activity.js.map +1 -1
- package/dist/services/cloud/lifecycle.d.ts.map +1 -1
- package/dist/services/cloud/lifecycle.js +3 -0
- package/dist/services/cloud/lifecycle.js.map +1 -1
- package/dist/services/cloud/task-wrapper.d.ts +18 -0
- package/dist/services/cloud/task-wrapper.d.ts.map +1 -1
- package/dist/services/cloud/task-wrapper.js +157 -0
- package/dist/services/cloud/task-wrapper.js.map +1 -1
- package/dist/services/context-admission.d.ts.map +1 -1
- package/dist/services/context-admission.js +9 -7
- package/dist/services/context-admission.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +22 -3
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +11 -2
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/knowledge/audn.d.ts +37 -0
- package/dist/services/knowledge/audn.d.ts.map +1 -0
- package/dist/services/knowledge/audn.js +219 -0
- package/dist/services/knowledge/audn.js.map +1 -0
- package/dist/services/knowledge/file-hash.d.ts +11 -0
- package/dist/services/knowledge/file-hash.d.ts.map +1 -0
- package/dist/services/knowledge/file-hash.js +123 -0
- package/dist/services/knowledge/file-hash.js.map +1 -0
- package/dist/services/knowledge/http-provider.d.ts +46 -0
- package/dist/services/knowledge/http-provider.d.ts.map +1 -0
- package/dist/services/knowledge/http-provider.js +254 -0
- package/dist/services/knowledge/http-provider.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +15 -0
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -0
- package/dist/services/knowledge/kb-providers.js +92 -0
- package/dist/services/knowledge/kb-providers.js.map +1 -0
- package/dist/services/knowledge/kb-scope-input.d.ts +5 -0
- package/dist/services/knowledge/kb-scope-input.d.ts.map +1 -0
- package/dist/services/knowledge/kb-scope-input.js +11 -0
- package/dist/services/knowledge/kb-scope-input.js.map +1 -0
- package/dist/services/knowledge/kb-service.d.ts +3 -0
- package/dist/services/knowledge/kb-service.d.ts.map +1 -0
- package/dist/services/knowledge/kb-service.js +2 -0
- package/dist/services/knowledge/kb-service.js.map +1 -0
- package/dist/services/knowledge/path-validation.d.ts +2 -0
- package/dist/services/knowledge/path-validation.d.ts.map +1 -0
- package/dist/services/knowledge/path-validation.js +13 -0
- package/dist/services/knowledge/path-validation.js.map +1 -0
- package/dist/services/knowledge/pre-init.d.ts +14 -0
- package/dist/services/knowledge/pre-init.d.ts.map +1 -0
- package/dist/services/knowledge/pre-init.js +147 -0
- package/dist/services/knowledge/pre-init.js.map +1 -0
- package/dist/services/knowledge/project-slug.d.ts +2 -0
- package/dist/services/knowledge/project-slug.d.ts.map +1 -0
- package/dist/services/knowledge/project-slug.js +49 -0
- package/dist/services/knowledge/project-slug.js.map +1 -0
- package/dist/services/knowledge/sqlite-provider.d.ts +147 -0
- package/dist/services/knowledge/sqlite-provider.d.ts.map +1 -0
- package/dist/services/knowledge/sqlite-provider.js +1646 -0
- package/dist/services/knowledge/sqlite-provider.js.map +1 -0
- package/dist/services/knowledge/types.d.ts +163 -0
- package/dist/services/knowledge/types.d.ts.map +1 -0
- package/dist/services/knowledge/types.js +9 -0
- package/dist/services/knowledge/types.js.map +1 -0
- package/dist/services/member-home.d.ts +89 -0
- package/dist/services/member-home.d.ts.map +1 -0
- package/dist/services/member-home.js +259 -0
- package/dist/services/member-home.js.map +1 -0
- package/dist/services/member-remote-url.d.ts +34 -0
- package/dist/services/member-remote-url.d.ts.map +1 -0
- package/dist/services/member-remote-url.js +39 -0
- package/dist/services/member-remote-url.js.map +1 -0
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +0 -5
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/orphan-recovery.d.ts +9 -3
- package/dist/services/orphan-recovery.d.ts.map +1 -1
- package/dist/services/orphan-recovery.js +22 -8
- package/dist/services/orphan-recovery.js.map +1 -1
- package/dist/services/preflight-check.d.ts +56 -0
- package/dist/services/preflight-check.d.ts.map +1 -0
- package/dist/services/preflight-check.js +277 -0
- package/dist/services/preflight-check.js.map +1 -0
- package/dist/services/shell-probe.d.ts +131 -0
- package/dist/services/shell-probe.d.ts.map +1 -0
- package/dist/services/shell-probe.js +210 -0
- package/dist/services/shell-probe.js.map +1 -0
- package/dist/services/singleton.d.ts +2 -0
- package/dist/services/singleton.d.ts.map +1 -1
- package/dist/services/singleton.js +1 -1
- package/dist/services/singleton.js.map +1 -1
- package/dist/services/ssh.js +2 -2
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/find-log-file.d.ts.map +1 -1
- package/dist/services/stall/find-log-file.js +22 -16
- package/dist/services/stall/find-log-file.js.map +1 -1
- package/dist/services/stall/log-path-resolver.d.ts +11 -8
- package/dist/services/stall/log-path-resolver.d.ts.map +1 -1
- package/dist/services/stall/log-path-resolver.js +17 -40
- package/dist/services/stall/log-path-resolver.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +6 -5
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +32 -0
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +149 -6
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts +34 -0
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +160 -35
- package/dist/services/stall/stall-poller.js.map +1 -1
- package/dist/services/strategy.d.ts +9 -0
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +41 -7
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +87 -1
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/user-config.js +1 -1
- package/dist/services/user-config.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +1 -1
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +105 -10
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/bitbucket.d.ts.map +1 -1
- package/dist/services/vcs/bitbucket.js +16 -0
- package/dist/services/vcs/bitbucket.js.map +1 -1
- package/dist/services/vcs/github.d.ts.map +1 -1
- package/dist/services/vcs/github.js +56 -1
- package/dist/services/vcs/github.js.map +1 -1
- package/dist/services/vcs/types.d.ts +123 -2
- package/dist/services/vcs/types.d.ts.map +1 -1
- package/dist/services/version-check.d.ts +22 -0
- package/dist/services/version-check.d.ts.map +1 -0
- package/dist/services/version-check.js +103 -0
- package/dist/services/version-check.js.map +1 -0
- package/dist/skills/fleet-sprint-cli/SKILL.md +15 -3
- package/dist/skills/pm/SKILL.md +0 -1
- package/dist/skills/pm/beads.md +6 -0
- package/dist/skills/pm/cost.md +0 -1
- package/dist/skills/pm/fleet-addendum.md +6 -1
- package/dist/skills/pm/index.md +56 -0
- package/dist/skills/pm/kb-reconcile.md +132 -0
- package/dist/skills/pm/kb-review.md +109 -0
- package/dist/tools/check-status.d.ts +47 -0
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +245 -3
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/child-id-allocator.d.ts +2 -2
- package/dist/tools/cloud-control.js +2 -2
- package/dist/tools/cloud-control.js.map +1 -1
- package/dist/tools/code-intelligence-codebase-memory.d.ts +11 -0
- package/dist/tools/code-intelligence-codebase-memory.d.ts.map +1 -0
- package/dist/tools/code-intelligence-codebase-memory.js +270 -0
- package/dist/tools/code-intelligence-codebase-memory.js.map +1 -0
- package/dist/tools/code-intelligence-freshness.d.ts +2 -0
- package/dist/tools/code-intelligence-freshness.d.ts.map +1 -0
- package/dist/tools/code-intelligence-freshness.js +26 -0
- package/dist/tools/code-intelligence-freshness.js.map +1 -0
- package/dist/tools/code-intelligence-gitnexus.d.ts +14 -0
- package/dist/tools/code-intelligence-gitnexus.d.ts.map +1 -0
- package/dist/tools/code-intelligence-gitnexus.js +475 -0
- package/dist/tools/code-intelligence-gitnexus.js.map +1 -0
- package/dist/tools/code-intelligence-kb-enrich.d.ts +2 -0
- package/dist/tools/code-intelligence-kb-enrich.d.ts.map +1 -0
- package/dist/tools/code-intelligence-kb-enrich.js +65 -0
- package/dist/tools/code-intelligence-kb-enrich.js.map +1 -0
- package/dist/tools/code-intelligence-reindex.d.ts +7 -0
- package/dist/tools/code-intelligence-reindex.d.ts.map +1 -0
- package/dist/tools/code-intelligence-reindex.js +106 -0
- package/dist/tools/code-intelligence-reindex.js.map +1 -0
- package/dist/tools/code-intelligence-telemetry.d.ts +5 -0
- package/dist/tools/code-intelligence-telemetry.d.ts.map +1 -0
- package/dist/tools/code-intelligence-telemetry.js +52 -0
- package/dist/tools/code-intelligence-telemetry.js.map +1 -0
- package/dist/tools/code-intelligence-tests.d.ts +2 -0
- package/dist/tools/code-intelligence-tests.d.ts.map +1 -0
- package/dist/tools/code-intelligence-tests.js +24 -0
- package/dist/tools/code-intelligence-tests.js.map +1 -0
- package/dist/tools/code-intelligence.d.ts +114 -0
- package/dist/tools/code-intelligence.d.ts.map +1 -0
- package/dist/tools/code-intelligence.js +124 -0
- package/dist/tools/code-intelligence.js.map +1 -0
- package/dist/tools/compose-permissions.d.ts +26 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +257 -33
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/execute-command.d.ts +2 -0
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +114 -28
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +13 -1
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +310 -61
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/kb-capture.d.ts +53 -0
- package/dist/tools/kb-capture.d.ts.map +1 -0
- package/dist/tools/kb-capture.js +130 -0
- package/dist/tools/kb-capture.js.map +1 -0
- package/dist/tools/kb-context.d.ts +17 -0
- package/dist/tools/kb-context.d.ts.map +1 -0
- package/dist/tools/kb-context.js +29 -0
- package/dist/tools/kb-context.js.map +1 -0
- package/dist/tools/kb-export.d.ts +19 -0
- package/dist/tools/kb-export.d.ts.map +1 -0
- package/dist/tools/kb-export.js +344 -0
- package/dist/tools/kb-export.js.map +1 -0
- package/dist/tools/kb-feedback.d.ts +23 -0
- package/dist/tools/kb-feedback.d.ts.map +1 -0
- package/dist/tools/kb-feedback.js +43 -0
- package/dist/tools/kb-feedback.js.map +1 -0
- package/dist/tools/kb-freshness-sweep.d.ts +14 -0
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -0
- package/dist/tools/kb-freshness-sweep.js +29 -0
- package/dist/tools/kb-freshness-sweep.js.map +1 -0
- package/dist/tools/kb-harvest.d.ts +20 -0
- package/dist/tools/kb-harvest.d.ts.map +1 -0
- package/dist/tools/kb-harvest.js +143 -0
- package/dist/tools/kb-harvest.js.map +1 -0
- package/dist/tools/kb-import.d.ts +44 -0
- package/dist/tools/kb-import.d.ts.map +1 -0
- package/dist/tools/kb-import.js +239 -0
- package/dist/tools/kb-import.js.map +1 -0
- package/dist/tools/kb-invalidate.d.ts +19 -0
- package/dist/tools/kb-invalidate.d.ts.map +1 -0
- package/dist/tools/kb-invalidate.js +34 -0
- package/dist/tools/kb-invalidate.js.map +1 -0
- package/dist/tools/kb-list.d.ts +32 -0
- package/dist/tools/kb-list.d.ts.map +1 -0
- package/dist/tools/kb-list.js +43 -0
- package/dist/tools/kb-list.js.map +1 -0
- package/dist/tools/kb-promote.d.ts +20 -0
- package/dist/tools/kb-promote.d.ts.map +1 -0
- package/dist/tools/kb-promote.js +20 -0
- package/dist/tools/kb-promote.js.map +1 -0
- package/dist/tools/kb-query.d.ts +35 -0
- package/dist/tools/kb-query.d.ts.map +1 -0
- package/dist/tools/kb-query.js +111 -0
- package/dist/tools/kb-query.js.map +1 -0
- package/dist/tools/kb-reconcile-prefilter.d.ts +14 -0
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -0
- package/dist/tools/kb-reconcile-prefilter.js +26 -0
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -0
- package/dist/tools/kb-resolve-contradiction.d.ts +23 -0
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -0
- package/dist/tools/kb-resolve-contradiction.js +37 -0
- package/dist/tools/kb-resolve-contradiction.js.map +1 -0
- package/dist/tools/kb-session-prime.d.ts +26 -0
- package/dist/tools/kb-session-prime.d.ts.map +1 -0
- package/dist/tools/kb-session-prime.js +392 -0
- package/dist/tools/kb-session-prime.js.map +1 -0
- package/dist/tools/kb-setup.d.ts +20 -0
- package/dist/tools/kb-setup.d.ts.map +1 -0
- package/dist/tools/kb-setup.js +49 -0
- package/dist/tools/kb-setup.js.map +1 -0
- package/dist/tools/kb-stats.d.ts +20 -0
- package/dist/tools/kb-stats.d.ts.map +1 -0
- package/dist/tools/kb-stats.js +115 -0
- package/dist/tools/kb-stats.js.map +1 -0
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +6 -2
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +13 -3
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +13 -1
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/monitor-task.d.ts.map +1 -1
- package/dist/tools/monitor-task.js +38 -5
- package/dist/tools/monitor-task.js.map +1 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +15 -8
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +5 -2
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +58 -52
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +21 -12
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +70 -3
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.d.ts.map +1 -1
- package/dist/tools/remove-member.js +19 -5
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/report-status.d.ts.map +1 -1
- package/dist/tools/report-status.js +2 -1
- package/dist/tools/report-status.js.map +1 -1
- package/dist/tools/revoke-vcs-auth.js +2 -2
- package/dist/tools/revoke-vcs-auth.js.map +1 -1
- package/dist/tools/send-email.d.ts +69 -0
- package/dist/tools/send-email.d.ts.map +1 -0
- package/dist/tools/send-email.js +177 -0
- package/dist/tools/send-email.js.map +1 -0
- package/dist/tools/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +4 -1
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/stop-prompt.js +2 -2
- package/dist/tools/stop-prompt.js.map +1 -1
- package/dist/tools/update-agent-cli.js +2 -2
- package/dist/tools/update-agent-cli.js.map +1 -1
- package/dist/tools/update-member.d.ts +21 -12
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +43 -2
- package/dist/tools/update-member.js.map +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agent-helpers.d.ts +36 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -1
- package/dist/utils/agent-helpers.js +39 -1
- package/dist/utils/agent-helpers.js.map +1 -1
- package/dist/utils/platform.d.ts +7 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +11 -1
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/prompt-errors.js +1 -1
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/session-caller.d.ts +28 -0
- package/dist/utils/session-caller.d.ts.map +1 -0
- package/dist/utils/session-caller.js +24 -0
- package/dist/utils/session-caller.js.map +1 -0
- package/dist/utils/work-folder-validation.d.ts +39 -0
- package/dist/utils/work-folder-validation.d.ts.map +1 -0
- package/dist/utils/work-folder-validation.js +60 -0
- package/dist/utils/work-folder-validation.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +5 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +550 -23
- package/package.json +7 -4
- package/packages/apra-fleet-client/src/client/api.mjs +210 -7
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +31 -19
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +16 -1
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -47
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +147 -114
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +41 -34
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +98 -114
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +205 -0
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +45 -44
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +121 -50
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +84 -81
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +118 -44
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +63 -3
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +59 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +3 -3
- package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +65 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +105 -8
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +6 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +6 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +56 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +132 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +109 -0
- package/packages/apra-fleet-se/bin/cli.mjs +139 -3
- package/packages/apra-fleet-se/bin/serve.mjs +49 -2
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +182 -38
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +23 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +258 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1487 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +399 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +1148 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +229 -112
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +91 -6
- package/packages/apra-fleet-se/fleet-sprint/runner.js +2469 -238
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +154 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +15 -3
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +51 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +657 -12
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +60 -30
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +205 -2
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +164 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +141 -26
- package/packages/apra-fleet-se/package.json +1 -0
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +294 -14
- package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +443 -35
- package/skills/fleet/SKILL.md +20 -9
- package/skills/fleet/auth-azdevops.md +44 -5
- package/skills/fleet/auth-bitbucket.md +3 -3
- package/skills/fleet/auth-github.md +2 -2
- package/skills/fleet/beads-conflict-resolution.md +141 -0
- package/skills/fleet/beads.md +16 -12
- package/skills/fleet/knowledge-agent.md +66 -0
- package/skills/fleet/onboarding.md +4 -4
- package/skills/fleet/permissions.md +32 -8
- package/skills/fleet/profiles/base-dev.json +10 -1
- package/skills/fleet/profiles/base-reviewer.json +8 -1
- package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
- package/skills/fleet/skill-matrix.md +1 -1
- package/skills/fleet/troubleshooting.md +2 -1
- package/version.json +1 -1
- package/dist/providers/gemini.d.ts +0 -42
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -202
- package/dist/providers/gemini.js.map +0 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -151
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-tier2-runbook.md +0 -127
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-path-b.mjs +0 -339
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-tier2.mjs +0 -360
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery.mjs +0 -363
|
@@ -1339,7 +1339,8 @@ const REVIEW_SCHEMA = {
|
|
|
1339
1339
|
],
|
|
1340
1340
|
"properties": {
|
|
1341
1341
|
"title": {
|
|
1342
|
-
"type": "string"
|
|
1342
|
+
"type": "string",
|
|
1343
|
+
"description": "Plain text only: letters, digits, space, and . , : ; ! ? ( ) ' _ / [ ] - -- nothing else. No backticks, double quotes, $, or backslash (the title is interpolated into a shell command downstream). Do NOT wrap a command/flag/filename in backticks here -- write it plain (e.g. \"Surface the Windows service registration mode in apra-fleet status\") or move the formatted detail into description instead, which has no such restriction. NOT enforced as a hard schema constraint here (deliberately no \"pattern\"): a single out-of-allowlist newTask title must never make ajv reject/retry the WHOLE structured verdict (verdict, notes, reopenIds, and the other newTasks) -- see validateNewTask() in fleet-sprint/runner.js, the actual (per-item, non-fatal) enforcement point, applied after parsing."
|
|
1343
1344
|
},
|
|
1344
1345
|
"description": {
|
|
1345
1346
|
"type": "string"
|
|
@@ -1349,6 +1350,80 @@ const REVIEW_SCHEMA = {
|
|
|
1349
1350
|
}
|
|
1350
1351
|
}
|
|
1351
1352
|
}
|
|
1353
|
+
},
|
|
1354
|
+
"kb_promotions": {
|
|
1355
|
+
"type": "array",
|
|
1356
|
+
"description": "Entries this reviewer VERIFIED against the tree and is promoting to CONFIRMED. Reviewer-only: promotion is the sole path that mints CONFIRMED, and widening capture does not widen promotion. The engine makes the kb_promote calls.",
|
|
1357
|
+
"items": {
|
|
1358
|
+
"type": "object",
|
|
1359
|
+
"required": [
|
|
1360
|
+
"id",
|
|
1361
|
+
"reason"
|
|
1362
|
+
],
|
|
1363
|
+
"properties": {
|
|
1364
|
+
"id": {
|
|
1365
|
+
"type": "string",
|
|
1366
|
+
"description": "The entry id, copied verbatim from the 'KNOWLEDGE BANK -- promotion candidates' block in your dispatch prompt. That block is the ONLY source of promotable ids -- do not call a kb_* tool to find one, and never invent one.",
|
|
1367
|
+
"minLength": 1
|
|
1368
|
+
},
|
|
1369
|
+
"reason": {
|
|
1370
|
+
"type": "string",
|
|
1371
|
+
"description": "The evidence for this promotion -- what you actually checked. kb_promote refuses a trivial reason.",
|
|
1372
|
+
"minLength": 20
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
"kb_captures": {
|
|
1378
|
+
"type": "array",
|
|
1379
|
+
"description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
|
|
1380
|
+
"items": {
|
|
1381
|
+
"type": "object",
|
|
1382
|
+
"required": [
|
|
1383
|
+
"type",
|
|
1384
|
+
"title",
|
|
1385
|
+
"summary",
|
|
1386
|
+
"content",
|
|
1387
|
+
"source_files"
|
|
1388
|
+
],
|
|
1389
|
+
"properties": {
|
|
1390
|
+
"type": {
|
|
1391
|
+
"type": "string",
|
|
1392
|
+
"enum": [
|
|
1393
|
+
"knowledge",
|
|
1394
|
+
"learning",
|
|
1395
|
+
"runbook"
|
|
1396
|
+
]
|
|
1397
|
+
},
|
|
1398
|
+
"title": {
|
|
1399
|
+
"type": "string",
|
|
1400
|
+
"minLength": 8
|
|
1401
|
+
},
|
|
1402
|
+
"summary": {
|
|
1403
|
+
"type": "string",
|
|
1404
|
+
"minLength": 20
|
|
1405
|
+
},
|
|
1406
|
+
"content": {
|
|
1407
|
+
"type": "string",
|
|
1408
|
+
"description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
|
|
1409
|
+
"minLength": 40
|
|
1410
|
+
},
|
|
1411
|
+
"source_files": {
|
|
1412
|
+
"type": "array",
|
|
1413
|
+
"description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
|
|
1414
|
+
"items": {
|
|
1415
|
+
"type": "string"
|
|
1416
|
+
},
|
|
1417
|
+
"minItems": 1
|
|
1418
|
+
},
|
|
1419
|
+
"symbols": {
|
|
1420
|
+
"type": "array",
|
|
1421
|
+
"items": {
|
|
1422
|
+
"type": "string"
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1352
1427
|
}
|
|
1353
1428
|
}
|
|
1354
1429
|
};
|
|
@@ -1430,6 +1505,57 @@ const DOER_STATUS_SCHEMA = {
|
|
|
1430
1505
|
},
|
|
1431
1506
|
"notes": {
|
|
1432
1507
|
"type": "string"
|
|
1508
|
+
},
|
|
1509
|
+
"kb_captures": {
|
|
1510
|
+
"type": "array",
|
|
1511
|
+
"description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
|
|
1512
|
+
"items": {
|
|
1513
|
+
"type": "object",
|
|
1514
|
+
"required": [
|
|
1515
|
+
"type",
|
|
1516
|
+
"title",
|
|
1517
|
+
"summary",
|
|
1518
|
+
"content",
|
|
1519
|
+
"source_files"
|
|
1520
|
+
],
|
|
1521
|
+
"properties": {
|
|
1522
|
+
"type": {
|
|
1523
|
+
"type": "string",
|
|
1524
|
+
"enum": [
|
|
1525
|
+
"knowledge",
|
|
1526
|
+
"learning",
|
|
1527
|
+
"runbook"
|
|
1528
|
+
]
|
|
1529
|
+
},
|
|
1530
|
+
"title": {
|
|
1531
|
+
"type": "string",
|
|
1532
|
+
"minLength": 8
|
|
1533
|
+
},
|
|
1534
|
+
"summary": {
|
|
1535
|
+
"type": "string",
|
|
1536
|
+
"minLength": 20
|
|
1537
|
+
},
|
|
1538
|
+
"content": {
|
|
1539
|
+
"type": "string",
|
|
1540
|
+
"description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
|
|
1541
|
+
"minLength": 40
|
|
1542
|
+
},
|
|
1543
|
+
"source_files": {
|
|
1544
|
+
"type": "array",
|
|
1545
|
+
"description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
|
|
1546
|
+
"items": {
|
|
1547
|
+
"type": "string"
|
|
1548
|
+
},
|
|
1549
|
+
"minItems": 1
|
|
1550
|
+
},
|
|
1551
|
+
"symbols": {
|
|
1552
|
+
"type": "array",
|
|
1553
|
+
"items": {
|
|
1554
|
+
"type": "string"
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1433
1559
|
}
|
|
1434
1560
|
}
|
|
1435
1561
|
};
|
|
@@ -1486,14 +1612,14 @@ const INTEG_RUN_SCHEMA = {
|
|
|
1486
1612
|
},
|
|
1487
1613
|
"deployedSha": {
|
|
1488
1614
|
"type": "string",
|
|
1489
|
-
"description": "The
|
|
1615
|
+
"description": "The git commit the verification actually ran against. Optional for backward compatibility, but an orchestrator that supplied a deployed SHA in the dispatch prompt treats a missing or mismatching value as INCONCLUSIVE evidence (never a pass). See integ-test-runner.md Step 4."
|
|
1490
1616
|
},
|
|
1491
1617
|
"verifySetClosed": {
|
|
1492
1618
|
"type": "array",
|
|
1493
1619
|
"items": {
|
|
1494
1620
|
"type": "string"
|
|
1495
1621
|
},
|
|
1496
|
-
"description": "
|
|
1622
|
+
"description": "Verify-set bead ids (any issue_type, Step 1b) closed this run. Optional for backward compatibility -- absent/omitted on a dispatch that named no verify-set ids."
|
|
1497
1623
|
},
|
|
1498
1624
|
"verifySetLeftOpen": {
|
|
1499
1625
|
"type": "array",
|
|
@@ -1512,7 +1638,7 @@ const INTEG_RUN_SCHEMA = {
|
|
|
1512
1638
|
}
|
|
1513
1639
|
}
|
|
1514
1640
|
},
|
|
1515
|
-
"description": "
|
|
1641
|
+
"description": "Verify-set bead ids (Step 1b) left open this run, with why (gap bug filed, or inconclusive). Optional for backward compatibility."
|
|
1516
1642
|
},
|
|
1517
1643
|
"observedFailures": {
|
|
1518
1644
|
"type": "array",
|
|
@@ -1563,7 +1689,7 @@ const REGRESSION_RUN_SCHEMA = {
|
|
|
1563
1689
|
},
|
|
1564
1690
|
"smokePassed": {
|
|
1565
1691
|
"type": "boolean",
|
|
1566
|
-
"description": "Result of playbook Part 2 -- the
|
|
1692
|
+
"description": "Result of playbook Part 2 -- the sandbox smoke test."
|
|
1567
1693
|
},
|
|
1568
1694
|
"bugsFiled": {
|
|
1569
1695
|
"type": "array",
|
|
@@ -1578,21 +1704,8 @@ const REGRESSION_RUN_SCHEMA = {
|
|
|
1578
1704
|
},
|
|
1579
1705
|
"smokeEvidence": {
|
|
1580
1706
|
"type": "object",
|
|
1581
|
-
"
|
|
1582
|
-
"
|
|
1583
|
-
"versionStdout": {
|
|
1584
|
-
"type": "string",
|
|
1585
|
-
"description": "Verbatim stdout of running the toy CLI's --version on the sprint branch."
|
|
1586
|
-
},
|
|
1587
|
-
"canaryStatus": {
|
|
1588
|
-
"type": "string",
|
|
1589
|
-
"description": "The status field from `bd show gh-toy-4ef` (e.g. \"closed\")."
|
|
1590
|
-
},
|
|
1591
|
-
"toyRepoHeadSha": {
|
|
1592
|
-
"type": "string",
|
|
1593
|
-
"description": "The toy repo's head commit SHA after the toy sprint."
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1707
|
+
"additionalProperties": true,
|
|
1708
|
+
"description": "Optional structured evidence from Part 2 (the target repo's own smoke test), so the result is machine-checkable instead of self-reported prose. This schema does not define its shape -- the target repo's regression-test-playbook.md (Part 2 / smoke test section) does. Omit if that playbook defines no structured evidence."
|
|
1596
1709
|
}
|
|
1597
1710
|
}
|
|
1598
1711
|
};
|
|
@@ -1641,6 +1754,145 @@ const HARVEST_SCHEMA = {
|
|
|
1641
1754
|
},
|
|
1642
1755
|
"notes": {
|
|
1643
1756
|
"type": "string"
|
|
1757
|
+
},
|
|
1758
|
+
"kb_captures": {
|
|
1759
|
+
"type": "array",
|
|
1760
|
+
"description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
|
|
1761
|
+
"items": {
|
|
1762
|
+
"type": "object",
|
|
1763
|
+
"required": [
|
|
1764
|
+
"type",
|
|
1765
|
+
"title",
|
|
1766
|
+
"summary",
|
|
1767
|
+
"content",
|
|
1768
|
+
"source_files"
|
|
1769
|
+
],
|
|
1770
|
+
"properties": {
|
|
1771
|
+
"type": {
|
|
1772
|
+
"type": "string",
|
|
1773
|
+
"enum": [
|
|
1774
|
+
"knowledge",
|
|
1775
|
+
"learning",
|
|
1776
|
+
"runbook"
|
|
1777
|
+
]
|
|
1778
|
+
},
|
|
1779
|
+
"title": {
|
|
1780
|
+
"type": "string",
|
|
1781
|
+
"minLength": 8
|
|
1782
|
+
},
|
|
1783
|
+
"summary": {
|
|
1784
|
+
"type": "string",
|
|
1785
|
+
"minLength": 20
|
|
1786
|
+
},
|
|
1787
|
+
"content": {
|
|
1788
|
+
"type": "string",
|
|
1789
|
+
"description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
|
|
1790
|
+
"minLength": 40
|
|
1791
|
+
},
|
|
1792
|
+
"source_files": {
|
|
1793
|
+
"type": "array",
|
|
1794
|
+
"description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
|
|
1795
|
+
"items": {
|
|
1796
|
+
"type": "string"
|
|
1797
|
+
},
|
|
1798
|
+
"minItems": 1
|
|
1799
|
+
},
|
|
1800
|
+
"symbols": {
|
|
1801
|
+
"type": "array",
|
|
1802
|
+
"items": {
|
|
1803
|
+
"type": "string"
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
const PLANNER_SCHEMA = {
|
|
1812
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1813
|
+
"$id": "apra-pm/planner-output@1",
|
|
1814
|
+
"title": "planner output",
|
|
1815
|
+
"description": "Canonical machine-readable output contract for the planner role. See agents/planner.md Step 4 (Validate your own DAG) and Step 0 (Knowledge Bank) for the prose contract this mirrors. The planner previously had no schema at all -- its dispatch ended 'Confirm with any text when done' -- so this is the contract that makes its output routable rather than free prose.",
|
|
1816
|
+
"type": "object",
|
|
1817
|
+
"required": [
|
|
1818
|
+
"status",
|
|
1819
|
+
"notes"
|
|
1820
|
+
],
|
|
1821
|
+
"properties": {
|
|
1822
|
+
"status": {
|
|
1823
|
+
"type": "string",
|
|
1824
|
+
"enum": [
|
|
1825
|
+
"OK",
|
|
1826
|
+
"BLOCKED"
|
|
1827
|
+
]
|
|
1828
|
+
},
|
|
1829
|
+
"notes": {
|
|
1830
|
+
"type": "string"
|
|
1831
|
+
},
|
|
1832
|
+
"featureIds": {
|
|
1833
|
+
"type": "array",
|
|
1834
|
+
"description": "Feature-level bead ids created or updated this round.",
|
|
1835
|
+
"items": {
|
|
1836
|
+
"type": "string"
|
|
1837
|
+
}
|
|
1838
|
+
},
|
|
1839
|
+
"taskIds": {
|
|
1840
|
+
"type": "array",
|
|
1841
|
+
"description": "Task-level bead ids created or updated this round.",
|
|
1842
|
+
"items": {
|
|
1843
|
+
"type": "string"
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
"kb_captures": {
|
|
1847
|
+
"type": "array",
|
|
1848
|
+
"description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
|
|
1849
|
+
"items": {
|
|
1850
|
+
"type": "object",
|
|
1851
|
+
"required": [
|
|
1852
|
+
"type",
|
|
1853
|
+
"title",
|
|
1854
|
+
"summary",
|
|
1855
|
+
"content",
|
|
1856
|
+
"source_files"
|
|
1857
|
+
],
|
|
1858
|
+
"properties": {
|
|
1859
|
+
"type": {
|
|
1860
|
+
"type": "string",
|
|
1861
|
+
"enum": [
|
|
1862
|
+
"knowledge",
|
|
1863
|
+
"learning",
|
|
1864
|
+
"runbook"
|
|
1865
|
+
]
|
|
1866
|
+
},
|
|
1867
|
+
"title": {
|
|
1868
|
+
"type": "string",
|
|
1869
|
+
"minLength": 8
|
|
1870
|
+
},
|
|
1871
|
+
"summary": {
|
|
1872
|
+
"type": "string",
|
|
1873
|
+
"minLength": 20
|
|
1874
|
+
},
|
|
1875
|
+
"content": {
|
|
1876
|
+
"type": "string",
|
|
1877
|
+
"description": "Full detail of the entry. REQUIRED -- kbCaptureSchema declares content as z.string().min(1), so a capture without it is rejected at the MCP boundary and persists nothing (apra-fleet-23c).",
|
|
1878
|
+
"minLength": 40
|
|
1879
|
+
},
|
|
1880
|
+
"source_files": {
|
|
1881
|
+
"type": "array",
|
|
1882
|
+
"description": "Files that make this claim checkable. At least one is REQUIRED -- SqliteProvider.capture() rejects an entry with no basis, because the freshness sweep can never stale it.",
|
|
1883
|
+
"items": {
|
|
1884
|
+
"type": "string"
|
|
1885
|
+
},
|
|
1886
|
+
"minItems": 1
|
|
1887
|
+
},
|
|
1888
|
+
"symbols": {
|
|
1889
|
+
"type": "array",
|
|
1890
|
+
"items": {
|
|
1891
|
+
"type": "string"
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1644
1896
|
}
|
|
1645
1897
|
}
|
|
1646
1898
|
};
|
|
@@ -1739,6 +1991,244 @@ async function parallel(tasks) {
|
|
|
1739
1991
|
return Promise.all(tasks);
|
|
1740
1992
|
}
|
|
1741
1993
|
|
|
1994
|
+
// -------------------------------------------------------- KB priming
|
|
1995
|
+
//
|
|
1996
|
+
// Dispatches a cheap agent to call kb_session_prime (and kb_import on first
|
|
1997
|
+
// call) and returns the top entries. The workflow injects these entries
|
|
1998
|
+
// directly into agent prompts -- agents never need to call KB tools themselves.
|
|
1999
|
+
|
|
2000
|
+
const KB_PRIMER_SCHEMA = {
|
|
2001
|
+
type: 'object',
|
|
2002
|
+
required: ['entries', 'sessionWarm', 'imported'],
|
|
2003
|
+
properties: {
|
|
2004
|
+
sessionWarm: { type: 'boolean' },
|
|
2005
|
+
imported: { type: 'boolean' },
|
|
2006
|
+
entries: {
|
|
2007
|
+
type: 'array',
|
|
2008
|
+
items: {
|
|
2009
|
+
type: 'object',
|
|
2010
|
+
required: ['title', 'summary'],
|
|
2011
|
+
properties: {
|
|
2012
|
+
title: { type: 'string' },
|
|
2013
|
+
summary: { type: 'string' },
|
|
2014
|
+
confidence: { type: 'string' },
|
|
2015
|
+
symbols: { type: 'array', items: { type: 'string' } },
|
|
2016
|
+
source_files: { type: 'array', items: { type: 'string' } },
|
|
2017
|
+
type: { type: 'string' },
|
|
2018
|
+
},
|
|
2019
|
+
},
|
|
2020
|
+
},
|
|
2021
|
+
},
|
|
2022
|
+
};
|
|
2023
|
+
|
|
2024
|
+
let _kbImported = false;
|
|
2025
|
+
|
|
2026
|
+
async function primeKB(repoPath) {
|
|
2027
|
+
const importStep = _kbImported ? '' :
|
|
2028
|
+
`Step 2: Import the bible into the KB database.\n` +
|
|
2029
|
+
` a. First check if "${repoPath}/.fleet/kb-canonical.json" exists (use Bash: test -f).\n` +
|
|
2030
|
+
` b. If it does NOT exist, run: echo $APRA_FLEET_DATA_DIR (using Bash) to get the data dir.\n` +
|
|
2031
|
+
` Then check if "$APRA_FLEET_DATA_DIR/kb-canonical.json" exists.\n` +
|
|
2032
|
+
` c. Call mcp__apra-fleet__kb_import with repo set to "${repoPath}".\n` +
|
|
2033
|
+
` If the bible was found at the data dir path (step b), also pass\n` +
|
|
2034
|
+
` path set to that full path (e.g. "/tmp/sprint-test/data-b/kb-canonical.json").\n` +
|
|
2035
|
+
` d. If neither path has the bible, or the tool is unavailable, set imported=false and continue.\n`;
|
|
2036
|
+
const stepNum = _kbImported ? 2 : 3;
|
|
2037
|
+
try {
|
|
2038
|
+
const result = await dispatch(
|
|
2039
|
+
`You are a knowledge-base primer. Your ONLY job is to load KB tools, ` +
|
|
2040
|
+
`optionally import the bible, call kb_session_prime, and return the results.\n\n` +
|
|
2041
|
+
`Step 1: Call ToolSearch with query "select:mcp__apra-fleet__kb_session_prime` +
|
|
2042
|
+
(_kbImported ? `"` : `,mcp__apra-fleet__kb_import"`) +
|
|
2043
|
+
` to load the tool schema(s).\n` +
|
|
2044
|
+
importStep +
|
|
2045
|
+
`Step ${stepNum}: Call mcp__apra-fleet__kb_session_prime with:\n` +
|
|
2046
|
+
` repo_path: "${repoPath}"\n` +
|
|
2047
|
+
`Step ${stepNum + 1}: Parse the JSON string result. Extract the top_entries array.\n` +
|
|
2048
|
+
` For each entry return: title, summary, confidence, symbols, source_files, type.\n` +
|
|
2049
|
+
` Do NOT return the content field.\n` +
|
|
2050
|
+
` Set sessionWarm from the result. Set imported to true if you ran kb_import successfully.\n\n` +
|
|
2051
|
+
`If ToolSearch returns no KB tools, return {entries:[], sessionWarm:false, imported:false}.\n` +
|
|
2052
|
+
`Return the structured result. Do not summarize or interpret.`,
|
|
2053
|
+
{
|
|
2054
|
+
model: MODEL_HAIKU,
|
|
2055
|
+
label: 'kb-primer',
|
|
2056
|
+
phase: 'Plan',
|
|
2057
|
+
schema: KB_PRIMER_SCHEMA,
|
|
2058
|
+
maxTurns: 10,
|
|
2059
|
+
}
|
|
2060
|
+
);
|
|
2061
|
+
if (result && result.imported) _kbImported = true;
|
|
2062
|
+
return result;
|
|
2063
|
+
} catch (e) {
|
|
2064
|
+
log(`KB primer failed: ${String(e).slice(0, 120)} -- proceeding without KB`);
|
|
2065
|
+
return null;
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
// --- Engine-executed KB capture and promote (KB trust pipeline, Phase 2) ---
|
|
2070
|
+
//
|
|
2071
|
+
// Judgment stays with the role agent; EXECUTION moves to the engine. A role
|
|
2072
|
+
// returns kb_captures / kb_promotions in its structured output and never calls
|
|
2073
|
+
// a KB tool itself. Three consequences the old prose-only contract could not
|
|
2074
|
+
// give: promotion no longer depends on an agent remembering Step 5, every
|
|
2075
|
+
// promotion is logged with its stated evidence, and the engine can refuse a
|
|
2076
|
+
// promotion BEFORE it is attempted.
|
|
2077
|
+
//
|
|
2078
|
+
// RUNTIME CONSTRAINT: this workflow is executed by Claude's Workflow tool in a
|
|
2079
|
+
// VM with no filesystem, no require(), and no MCP tool access -- only dispatched
|
|
2080
|
+
// subagents can call tools (see scripts/gen-auto-sprint-schemas.mjs's header for
|
|
2081
|
+
// the same constraint biting a previous revision). fleet-sprint/runner.js runs
|
|
2082
|
+
// under a different engine and DOES get an injected callTool, so it calls the KB
|
|
2083
|
+
// tools directly. Here the engine validates and logs, then hands the vetted
|
|
2084
|
+
// payload to one cheap executor agent whose only job is to make the calls.
|
|
2085
|
+
|
|
2086
|
+
// Promotion is the only path that mints CONFIRMED. Widening capture to four
|
|
2087
|
+
// roles deliberately does NOT widen promotion.
|
|
2088
|
+
const KB_PROMOTER_ROLES = new Set(['reviewer']);
|
|
2089
|
+
|
|
2090
|
+
const KB_MIN_PROMOTE_REASON = 20;
|
|
2091
|
+
|
|
2092
|
+
const KB_EXEC_SCHEMA = {
|
|
2093
|
+
type: 'object',
|
|
2094
|
+
required: ['captured', 'promoted'],
|
|
2095
|
+
properties: {
|
|
2096
|
+
captured: { type: 'number' },
|
|
2097
|
+
promoted: { type: 'number' },
|
|
2098
|
+
failed: { type: 'number' },
|
|
2099
|
+
notes: { type: 'string' },
|
|
2100
|
+
},
|
|
2101
|
+
};
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Validate what a role returned. Anything that would be refused downstream is
|
|
2105
|
+
* dropped HERE, with a reason logged, so a bad payload never becomes a tool call.
|
|
2106
|
+
* Returns { captures, promotions, rejected } -- all plain data.
|
|
2107
|
+
*/
|
|
2108
|
+
function vetKbWork(role, result) {
|
|
2109
|
+
const captures = [];
|
|
2110
|
+
const promotions = [];
|
|
2111
|
+
const rejected = [];
|
|
2112
|
+
|
|
2113
|
+
const rawCaptures = (result && Array.isArray(result.kb_captures)) ? result.kb_captures : [];
|
|
2114
|
+
for (const c of rawCaptures) {
|
|
2115
|
+
if (!c || typeof c.title !== 'string' || typeof c.summary !== 'string') {
|
|
2116
|
+
rejected.push(`${role}: capture missing title/summary`);
|
|
2117
|
+
continue;
|
|
2118
|
+
}
|
|
2119
|
+
// Mirrors the Phase 1 provider invariant: an entry with no basis can never
|
|
2120
|
+
// be staled by the freshness sweep, so nothing could ever falsify it.
|
|
2121
|
+
if (!Array.isArray(c.source_files) || c.source_files.length === 0) {
|
|
2122
|
+
rejected.push(`${role}: capture "${c.title}" cites no source files`);
|
|
2123
|
+
continue;
|
|
2124
|
+
}
|
|
2125
|
+
if (!['knowledge', 'learning', 'runbook'].includes(c.type)) {
|
|
2126
|
+
rejected.push(`${role}: capture "${c.title}" has unsupported type ${String(c.type)}`);
|
|
2127
|
+
continue;
|
|
2128
|
+
}
|
|
2129
|
+
// apra-fleet-23c: kbCaptureSchema requires content (z.string().min(1)).
|
|
2130
|
+
// Omitting it meant every kb_capture failed zod validation at the MCP
|
|
2131
|
+
// boundary and persisted nothing. (This block had drifted out of sync with
|
|
2132
|
+
// the canonical copy in lib/vet-kb-work.mjs -- restored to match exactly.)
|
|
2133
|
+
if (typeof c.content !== 'string' || c.content.trim().length === 0) {
|
|
2134
|
+
rejected.push(`${role}: capture "${c.title}" has no content`);
|
|
2135
|
+
continue;
|
|
2136
|
+
}
|
|
2137
|
+
captures.push({
|
|
2138
|
+
type: c.type,
|
|
2139
|
+
title: c.title,
|
|
2140
|
+
summary: c.summary,
|
|
2141
|
+
content: c.content,
|
|
2142
|
+
source_files: c.source_files,
|
|
2143
|
+
symbols: Array.isArray(c.symbols) ? c.symbols : [],
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
const rawPromotions = (result && Array.isArray(result.kb_promotions)) ? result.kb_promotions : [];
|
|
2148
|
+
if (rawPromotions.length > 0 && !KB_PROMOTER_ROLES.has(role)) {
|
|
2149
|
+
rejected.push(`${role}: kb_promotions refused -- promotion is reviewer-only`);
|
|
2150
|
+
} else {
|
|
2151
|
+
for (const p of rawPromotions) {
|
|
2152
|
+
if (!p || typeof p.id !== 'string' || p.id.length === 0) {
|
|
2153
|
+
rejected.push(`${role}: promotion missing id`);
|
|
2154
|
+
continue;
|
|
2155
|
+
}
|
|
2156
|
+
if (typeof p.reason !== 'string' || p.reason.trim().length < KB_MIN_PROMOTE_REASON) {
|
|
2157
|
+
rejected.push(`${role}: promotion ${p.id} has no recorded evidence`);
|
|
2158
|
+
continue;
|
|
2159
|
+
}
|
|
2160
|
+
promotions.push({ id: p.id, reason: p.reason.trim() });
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
return { captures, promotions, rejected };
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* Execute vetted KB work. Returns null when there is nothing to do, so the
|
|
2169
|
+
* common case costs no dispatch at all.
|
|
2170
|
+
*/
|
|
2171
|
+
async function runKbWork(repoPath, role, result) {
|
|
2172
|
+
const { captures, promotions, rejected } = vetKbWork(role, result);
|
|
2173
|
+
|
|
2174
|
+
for (const r of rejected) log(`KB refused -- ${r}`);
|
|
2175
|
+
// Every promotion is logged with its stated evidence, whether or not the call
|
|
2176
|
+
// later succeeds. This log IS the audit trail the bible never had.
|
|
2177
|
+
for (const p of promotions) log(`KB promote ${p.id} (${role}): ${p.reason}`);
|
|
2178
|
+
|
|
2179
|
+
if (captures.length === 0 && promotions.length === 0) return null;
|
|
2180
|
+
|
|
2181
|
+
try {
|
|
2182
|
+
return await dispatch(
|
|
2183
|
+
`You are a knowledge-base executor. Your ONLY job is to make the KB tool ` +
|
|
2184
|
+
`calls listed below and report counts. Make NO judgment about whether an ` +
|
|
2185
|
+
`entry is correct -- that decision has already been made and validated.\n\n` +
|
|
2186
|
+
`Step 1: Call ToolSearch with query ` +
|
|
2187
|
+
`"select:mcp__apra-fleet__kb_capture,mcp__apra-fleet__kb_promote".\n` +
|
|
2188
|
+
`Step 2: For EACH object in captures below, call mcp__apra-fleet__kb_capture ` +
|
|
2189
|
+
`with repo_path "${repoPath}" and that object's fields verbatim. Do not ` +
|
|
2190
|
+
`reword, merge, split or invent entries.\n` +
|
|
2191
|
+
`Step 3: For EACH object in promotions below, call mcp__apra-fleet__kb_promote ` +
|
|
2192
|
+
`with repo_path "${repoPath}" and that object's id and reason verbatim.\n` +
|
|
2193
|
+
`Step 4: Return the counts. A call refused by the tool counts in failed, ` +
|
|
2194
|
+
`not captured/promoted -- report it, do not retry it with altered fields.\n\n` +
|
|
2195
|
+
`captures: ${JSON.stringify(captures)}\n` +
|
|
2196
|
+
`promotions: ${JSON.stringify(promotions)}\n\n` +
|
|
2197
|
+
`If ToolSearch returns no KB tools, return {captured:0, promoted:0, failed:0}.`,
|
|
2198
|
+
{
|
|
2199
|
+
model: MODEL_HAIKU,
|
|
2200
|
+
label: `kb-exec-${role}`,
|
|
2201
|
+
phase: 'Develop',
|
|
2202
|
+
schema: KB_EXEC_SCHEMA,
|
|
2203
|
+
maxTurns: 20,
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
} catch (e) {
|
|
2207
|
+
log(`KB executor failed for ${role}: ${String(e).slice(0, 120)} -- continuing`);
|
|
2208
|
+
return null;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
const KB_CHAR_BUDGET = 4000;
|
|
2213
|
+
|
|
2214
|
+
function buildKBContext(kbResult) {
|
|
2215
|
+
if (!kbResult || !Array.isArray(kbResult.entries) || kbResult.entries.length === 0) {
|
|
2216
|
+
return '';
|
|
2217
|
+
}
|
|
2218
|
+
let block = `\n--- Project Knowledge Bank (${kbResult.entries.length} entries) ---\n` +
|
|
2219
|
+
`Trust CONFIRMED entries fully. Use INFERRED entries as hints, not facts.\n\n`;
|
|
2220
|
+
let len = block.length;
|
|
2221
|
+
for (const e of kbResult.entries) {
|
|
2222
|
+
const line = `- [${(e.confidence || 'CONFIRMED').toUpperCase()}] ${e.title}: ${e.summary}` +
|
|
2223
|
+
(e.symbols && e.symbols.length ? ` (symbols: ${e.symbols.join(', ')})` : '') + '\n';
|
|
2224
|
+
if (len + line.length > KB_CHAR_BUDGET) break;
|
|
2225
|
+
block += line;
|
|
2226
|
+
len += line.length;
|
|
2227
|
+
}
|
|
2228
|
+
block += `--- End Project Knowledge ---\n\n`;
|
|
2229
|
+
return block;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
1742
2232
|
// bd may prepend a `warning: ...` line to its --json stdout (notably bd 1.1.0's
|
|
1743
2233
|
// "warning: beads.role not configured (GH#2950)"). In a normal terminal that goes to
|
|
1744
2234
|
// stderr, but inside the workflow's sandboxed shell-dispatch subagents stderr merges
|
|
@@ -2260,11 +2750,32 @@ const stamp = async (name) => {
|
|
|
2260
2750
|
};
|
|
2261
2751
|
await stamp('setup');
|
|
2262
2752
|
|
|
2753
|
+
// ---- KB PRIMING (once at sprint start; refreshed per cycle) ----
|
|
2754
|
+
let kbContext = '';
|
|
2755
|
+
{
|
|
2756
|
+
const kbResult = await primeKB(repo);
|
|
2757
|
+
if (kbResult) {
|
|
2758
|
+
kbContext = buildKBContext(kbResult);
|
|
2759
|
+
log(`KB primed: ${(kbResult.entries || []).length} entries, imported=${kbResult.imported}`);
|
|
2760
|
+
} else {
|
|
2761
|
+
log('KB priming unavailable -- proceeding without KB context');
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2263
2765
|
while (cycleCount < maxCycles) {
|
|
2264
2766
|
cycleCount++;
|
|
2265
2767
|
cycleCostUsd = 0;
|
|
2266
2768
|
log(`\n=== Cycle ${cycleCount}/${maxCycles} | goal: ${goal} ===`);
|
|
2267
2769
|
|
|
2770
|
+
// ---- KB REFRESH (per cycle -- picks up entries captured in previous cycles) ----
|
|
2771
|
+
if (cycleCount > 1) {
|
|
2772
|
+
const kbRefresh = await primeKB(repo);
|
|
2773
|
+
if (kbRefresh) {
|
|
2774
|
+
kbContext = buildKBContext(kbRefresh);
|
|
2775
|
+
log(`KB refreshed: ${(kbRefresh.entries || []).length} entries`);
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2268
2779
|
// ---------------------------------------------------------------- RESUME CHECK + CYCLE CHECKPOINT
|
|
2269
2780
|
|
|
2270
2781
|
phase('Plan');
|
|
@@ -2327,6 +2838,7 @@ while (cycleCount < maxCycles) {
|
|
|
2327
2838
|
let plannerResult = null;
|
|
2328
2839
|
if (!skipPlanner) {
|
|
2329
2840
|
plannerResult = await dispatch(
|
|
2841
|
+
kbContext +
|
|
2330
2842
|
`Repo: ${repo}\nBranch: ${branch}\nBase branch: ${base_branch}\n` +
|
|
2331
2843
|
`Sprint goals: ${rootSummary}\n` +
|
|
2332
2844
|
(requirementsFile ? `Additional context: ${requirementsFile}\n` : '') +
|
|
@@ -2389,8 +2901,10 @@ while (cycleCount < maxCycles) {
|
|
|
2389
2901
|
`Do NOT add new scope beyond the original sprint goals and open bugs/enhancements.\n` +
|
|
2390
2902
|
`Do NOT re-create tasks that are already closed.\n`
|
|
2391
2903
|
: '') +
|
|
2392
|
-
`
|
|
2393
|
-
|
|
2904
|
+
`Return status "OK" when the DAG is in place, or "BLOCKED" with notes if you\n` +
|
|
2905
|
+
`could not create it. List the feature and task ids you created in featureIds\n` +
|
|
2906
|
+
`and taskIds.`,
|
|
2907
|
+
{ model: MODEL_OPUS, label: plannerLabel, phase: 'Plan', schema: PLANNER_SCHEMA, agentType: 'planner',
|
|
2394
2908
|
context: `planning sprint goals ${rootSummary}` }
|
|
2395
2909
|
);
|
|
2396
2910
|
|
|
@@ -2398,6 +2912,7 @@ while (cycleCount < maxCycles) {
|
|
|
2398
2912
|
log(`Planner returned null on cycle ${cycleCount} round ${pi} -- retrying`);
|
|
2399
2913
|
continue;
|
|
2400
2914
|
}
|
|
2915
|
+
await runKbWork(repo, 'planner', plannerResult);
|
|
2401
2916
|
}
|
|
2402
2917
|
|
|
2403
2918
|
const planReviewerLabel = `plan-reviewer-c${cycleCount}-r${pi}`;
|
|
@@ -2637,6 +3152,7 @@ while (cycleCount < maxCycles) {
|
|
|
2637
3152
|
|
|
2638
3153
|
const doerOutcomes = await parallel(okWt.map(w =>
|
|
2639
3154
|
dispatch(
|
|
3155
|
+
kbContext +
|
|
2640
3156
|
`You are working in an ISOLATED git worktree -- other doers run concurrently in their own worktrees.\n` +
|
|
2641
3157
|
`Worktree path: ${repo}/${w.path} (cd into it first; you are on temp branch ${w.branch})\n` +
|
|
2642
3158
|
`Work ONLY task ${w.id}. Do NOT work any other task.\n\n` +
|
|
@@ -2651,7 +3167,10 @@ while (cycleCount < maxCycles) {
|
|
|
2651
3167
|
`Return status "VERIFY" when done. Return status "BLOCKED" only for your runbook's blocked cases (missing secret) -- never any other status.`,
|
|
2652
3168
|
{ model: w.model, label: `doer-c${cycleCount}-i${devIter}-${w.id}`, phase: 'Develop', schema: DOER_STATUS_SCHEMA,
|
|
2653
3169
|
agentType: 'doer', context: `task ${w.id} (worktree)` }
|
|
2654
|
-
).then(
|
|
3170
|
+
).then(async r => {
|
|
3171
|
+
await runKbWork(repo, 'doer', r);
|
|
3172
|
+
return { w, ok: !!r && r.status === 'VERIFY' };
|
|
3173
|
+
}).catch(() => ({ w, ok: false }))
|
|
2655
3174
|
));
|
|
2656
3175
|
|
|
2657
3176
|
// Merge sequentially into the sprint branch (deterministic id order from computeDoerBatch).
|
|
@@ -2726,6 +3245,7 @@ while (cycleCount < maxCycles) {
|
|
|
2726
3245
|
log(`Doer c${cycleCount}-i${devIter}: ${labelTaskIds(fittedIds)} [model=${streak.model}${streakEstUsd != null ? ` est=$${streakEstUsd.toFixed(4)}` : ''}]`);
|
|
2727
3246
|
|
|
2728
3247
|
const doerResult = await dispatch(
|
|
3248
|
+
kbContext +
|
|
2729
3249
|
`Repo: ${repo}\nBranch: ${branch}\n\n` +
|
|
2730
3250
|
(devFeedback
|
|
2731
3251
|
? `Reviewer feedback from the previous iteration (read feedback.md in ${repo} for full details):\n${devFeedback}\nAddress every finding before closing tasks.\n\n`
|
|
@@ -2744,6 +3264,7 @@ while (cycleCount < maxCycles) {
|
|
|
2744
3264
|
{ model: streak.model, label: doerLabel, phase: 'Develop', schema: DOER_STATUS_SCHEMA, agentType: 'doer',
|
|
2745
3265
|
context: `tasks ${fittedIds.join(', ')}` }
|
|
2746
3266
|
);
|
|
3267
|
+
await runKbWork(repo, 'doer', doerResult);
|
|
2747
3268
|
|
|
2748
3269
|
if (!doerResult) {
|
|
2749
3270
|
log(`Doer returned null (streak ${streak.model}) -- resetting orphaned in_progress tasks and retrying`);
|
|
@@ -2799,6 +3320,7 @@ while (cycleCount < maxCycles) {
|
|
|
2799
3320
|
// One reviewer pass covering all streaks worked this iteration.
|
|
2800
3321
|
const reviewerLabel = `reviewer-c${cycleCount}-i${devIter}: ${labelTaskIds(workedIds)}`;
|
|
2801
3322
|
const review = await dispatch(
|
|
3323
|
+
kbContext +
|
|
2802
3324
|
`Repo: ${repo}\nBranch: ${branch}\nBase branch: ${base_branch}\n` +
|
|
2803
3325
|
`Sprint goals: ${rootSummary}\nTasks worked this iteration: ${workedIds.join(', ')}\n\n` +
|
|
2804
3326
|
`Review ONLY the work done for the tasks listed above.\n` +
|
|
@@ -2815,6 +3337,7 @@ while (cycleCount < maxCycles) {
|
|
|
2815
3337
|
context: `reviewing tasks ${workedIds.join(', ')}` }
|
|
2816
3338
|
);
|
|
2817
3339
|
log(`Reviewer c${cycleCount}-i${devIter}: ${(review && review.verdict) || 'null'} -- ${labelTaskIds(workedIds)}`);
|
|
3340
|
+
await runKbWork(repo, 'reviewer', review);
|
|
2818
3341
|
|
|
2819
3342
|
if (!approved(review)) {
|
|
2820
3343
|
devFeedback = (review && review.notes) || '';
|
|
@@ -3049,6 +3572,7 @@ await dispatchShell(
|
|
|
3049
3572
|
|
|
3050
3573
|
const finalReviewLabel = 'final-reviewer';
|
|
3051
3574
|
const finalReview = await dispatch(
|
|
3575
|
+
kbContext +
|
|
3052
3576
|
`Repo: ${repo}\nBranch: ${branch}\nBase branch: ${base_branch}\n` +
|
|
3053
3577
|
`Sprint goals: ${rootSummary}\nGoal: ${goal}\n` +
|
|
3054
3578
|
(abortReason ? `Sprint ended early: ${abortReason}. Review what was completed.\n` : '') +
|
|
@@ -3062,6 +3586,7 @@ const finalReview = await dispatch(
|
|
|
3062
3586
|
{ model: MODEL_OPUS, label: finalReviewLabel, phase: 'Harvest', schema: REVIEW_SCHEMA, agentType: 'reviewer' }
|
|
3063
3587
|
);
|
|
3064
3588
|
log(`Final review: ${finalReview && finalReview.verdict || 'null'}`);
|
|
3589
|
+
await runKbWork(repo, 'reviewer', finalReview);
|
|
3065
3590
|
|
|
3066
3591
|
if (!approved(finalReview)) {
|
|
3067
3592
|
const notes = (finalReview && finalReview.notes) || '';
|
|
@@ -3159,6 +3684,7 @@ const analysisArtifactFile = `sprint-logs/${sprintLogBranch}-${effectiveStartedA
|
|
|
3159
3684
|
|
|
3160
3685
|
const harvestLabel = 'harvester';
|
|
3161
3686
|
const harvestResult = await dispatch(
|
|
3687
|
+
kbContext +
|
|
3162
3688
|
`Repo: ${repo}\nBranch: ${branch}\nBase branch: ${base_branch}\n` +
|
|
3163
3689
|
`Sprint goals: ${rootSummary}\nCycles completed: ${cycleCount}\nGoal met: ${goalMet}\n` +
|
|
3164
3690
|
`sprintLogFile: ${sprintLogFile}\n` +
|
|
@@ -3178,6 +3704,7 @@ const harvestResult = await dispatch(
|
|
|
3178
3704
|
`Return status "OK" if successful, "FAILED" with notes otherwise.`,
|
|
3179
3705
|
{ model: MODEL_SONNET, label: harvestLabel, phase: 'Harvest', schema: HARVEST_SCHEMA, agentType: 'harvester' }
|
|
3180
3706
|
);
|
|
3707
|
+
await runKbWork(repo, 'harvester', harvestResult);
|
|
3181
3708
|
|
|
3182
3709
|
if (!harvestResult || harvestResult.status !== 'OK') {
|
|
3183
3710
|
log(`Harvest failed: ${(harvestResult && harvestResult.notes) || 'null'} -- writing analysis fallback`);
|