@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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# /pm kb-review
|
|
2
|
+
|
|
3
|
+
Surface all contradiction-flagged KB entries and resolve them interactively.
|
|
4
|
+
|
|
5
|
+
Note: `/pm kb-review` also surfaces pending `user-directive` proposals (via
|
|
6
|
+
`kb_query({ flagged_only: true })`) and instructs the human to run
|
|
7
|
+
`apra-fleet kb approve-directive <id>` or `reject-directive <id>` -- these are
|
|
8
|
+
CLI-only resolutions, never `kb_promote`.
|
|
9
|
+
|
|
10
|
+
## When to run
|
|
11
|
+
|
|
12
|
+
- After any sprint completes, as part of KB hygiene.
|
|
13
|
+
- When an agent reports a `flagged` audn_decision from `kb_capture`.
|
|
14
|
+
- Periodically, to keep the KB free of unresolved contradictions.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### Step 1: Fetch flagged entries
|
|
19
|
+
|
|
20
|
+
Call `kb_query(flagged_only=true)`.
|
|
21
|
+
|
|
22
|
+
- If the response says "No flagged contradictions found -- KB is clean.", report that to the user and stop.
|
|
23
|
+
- Otherwise, collect all returned entries.
|
|
24
|
+
|
|
25
|
+
### Step 2: Group into contradiction pairs
|
|
26
|
+
|
|
27
|
+
For each entry with `contradiction_of` set, pair it with the entry whose `id` matches `contradiction_of`.
|
|
28
|
+
Entries with `flagged_for_review=true` and no `contradiction_of` are the original (challenged) entries.
|
|
29
|
+
|
|
30
|
+
Group: `{ original: entry_A, challenger: entry_B }` where `entry_B.contradiction_of = entry_A.id`.
|
|
31
|
+
|
|
32
|
+
### Step 3: Present each pair to the user
|
|
33
|
+
|
|
34
|
+
For each pair, show:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Contradiction pair (N of M):
|
|
38
|
+
|
|
39
|
+
[ORIGINAL] id: <id> confidence: <confidence> created: <created_at>
|
|
40
|
+
Title: <title>
|
|
41
|
+
Summary: <summary>
|
|
42
|
+
Content: <content>
|
|
43
|
+
|
|
44
|
+
[CHALLENGER] id: <id> confidence: <confidence> created: <created_at>
|
|
45
|
+
Title: <title>
|
|
46
|
+
Summary: <summary>
|
|
47
|
+
Content: <content>
|
|
48
|
+
|
|
49
|
+
Resolution options:
|
|
50
|
+
A - Keep original, discard challenger
|
|
51
|
+
B - Keep challenger, discard original
|
|
52
|
+
M - Merge both into a new entry (you provide merged content)
|
|
53
|
+
D - Delete both (neither is correct)
|
|
54
|
+
S - Skip (defer to later)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Wait for the user's response before proceeding to the next pair.
|
|
58
|
+
|
|
59
|
+
### Step 4: Apply resolution
|
|
60
|
+
|
|
61
|
+
Supersede is OPT-IN: you must name the entry you are retiring via
|
|
62
|
+
`supersedes=<id>`. It is honored only when AUDN independently matches that same
|
|
63
|
+
entry (same type, overlapping symbols and source_files), so the corrective
|
|
64
|
+
capture must still carry the SAME title/symbols/source_files as its target --
|
|
65
|
+
otherwise nothing is retired and you get a second live entry instead. A capture
|
|
66
|
+
without `supersedes` never retires anything.
|
|
67
|
+
|
|
68
|
+
**A -- Keep original:**
|
|
69
|
+
- `kb_promote(original.id, reason="contradiction resolved: original kept")` -- upgrades its confidence.
|
|
70
|
+
- `kb_capture` a new entry with the SAME title/symbols/source_files as the challenger, corrected content that carries no contradiction keyword or polarity word (or AUDN will flag it again instead of updating), `confidence=UNVERIFIED`, and `supersedes=<challenger.id>`. That retires the challenger.
|
|
71
|
+
|
|
72
|
+
**B -- Keep challenger:**
|
|
73
|
+
- `kb_promote(challenger.id, reason="contradiction resolved: challenger kept")`.
|
|
74
|
+
- `kb_capture` a corrected entry with the SAME title/symbols/source_files as the original, corrected content free of contradiction/polarity words, and `supersedes=<original.id>`. That retires the original.
|
|
75
|
+
|
|
76
|
+
**M -- Merge:**
|
|
77
|
+
- Ask the user to provide the merged content.
|
|
78
|
+
- `kb_capture` a new entry with merged content and `supersedes=<id of whichever entry it replaces>`. Repeat for the second entry if both must be retired -- `supersedes` names ONE entry, so retiring both takes two captures.
|
|
79
|
+
- `kb_promote` the newly captured entry id.
|
|
80
|
+
|
|
81
|
+
**D -- Delete both:**
|
|
82
|
+
- `kb_capture` a retraction entry: `title=<original title>`, `content="Retracted: neither entry describes current behavior."` (no contradiction keyword or polarity word, or AUDN will flag it again instead of updating), `confidence=UNVERIFIED`, `supersedes=<original.id>`.
|
|
83
|
+
- `kb_capture` same for the challenger, with `supersedes=<challenger.id>`.
|
|
84
|
+
|
|
85
|
+
**S -- Skip:**
|
|
86
|
+
- No action. Note it in the session summary.
|
|
87
|
+
|
|
88
|
+
**Verified actual behavior (T3.7, F11 e2e proof) -- read this before reporting "resolved":**
|
|
89
|
+
- Superseding an entry (via the corrective `kb_capture` above with `supersedes` set, AUDN decision `update`) sets its `superseded_at` and `stale=1`. That entry then drops out of every future `kb_query({flagged_only:true})` listing -- the tool always excludes superseded entries.
|
|
90
|
+
- `kb_promote` does **NOT** clear `flagged_for_review` and does **NOT** clear `contradiction_of`. This means the entry you KEPT (promoted, not superseded) stays visible in `kb_query({flagged_only:true})` forever -- it is not automatically delisted just because it was resolved. Do not expect the pair to fully disappear from the flagged list; expect only the superseded side to disappear. Recognize an already-resolved pair by its counterpart's absence (or by checking `promoted_at`/`confidence` on the id you kept), not by the pair vanishing entirely.
|
|
91
|
+
- A `kb_feedback`-downvoted entry (`stale=1` + `flagged_for_review=1`, never superseded) stays listed under `flagged_only` until it is separately resolved the same way -- superseded via a corrective capture, or otherwise retired. Simply promoting a *different* entry never clears it.
|
|
92
|
+
|
|
93
|
+
### Step 5: Report
|
|
94
|
+
|
|
95
|
+
After all pairs are processed, report:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
KB Review complete.
|
|
99
|
+
- Pairs resolved: N
|
|
100
|
+
- Pairs skipped: M
|
|
101
|
+
- Total flagged entries cleared: K
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
"Cleared" here means the SUPERSEDED side of each resolved pair (the one whose
|
|
105
|
+
`superseded_at` got set) -- per the verified behavior in Step 4, the kept/
|
|
106
|
+
promoted side of a resolved pair remains in `kb_query({flagged_only:true})`
|
|
107
|
+
indefinitely, so K is normally N, not 2N. Do not report a pair as fully gone
|
|
108
|
+
from the flagged list; report it as resolved (one side superseded, the other
|
|
109
|
+
promoted).
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getServerInfoPath,
|
|
17
17
|
} from '@apralabs/apra-fleet-client/server-resolution';
|
|
18
18
|
import { beadsExtension } from '../fleet-sprint/viewer-extensions.mjs';
|
|
19
|
-
import { validateIssueId, validateBranchName, checkMemberTopology, createMemberReservationClient } from '../fleet-sprint/runner.js';
|
|
19
|
+
import { validateIssueId, validateBranchName, checkMemberTopology, createMemberReservationClient, resyncReacquiredMember, commandResultToSoftGit } from '../fleet-sprint/runner.js';
|
|
20
20
|
import { normalizeRole } from '../fleet-sprint/contracts.mjs';
|
|
21
21
|
|
|
22
22
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -303,7 +303,7 @@ export async function resolveRoleMap(rawValue, deps = {}) {
|
|
|
303
303
|
* }} opts
|
|
304
304
|
* @returns {object}
|
|
305
305
|
*/
|
|
306
|
-
export function buildRunnerArgs({ targetIssues, members, branch, baseBranch, goal, maxCycles, requirementsFile, roleMap, budget, dispatchTimeoutS, serviceUrl }) {
|
|
306
|
+
export function buildRunnerArgs({ targetIssues, members, branch, baseBranch, goal, maxCycles, requirementsFile, roleMap, budget, dispatchTimeoutS, serviceUrl, runId }) {
|
|
307
307
|
const args = {
|
|
308
308
|
target_issues: targetIssues,
|
|
309
309
|
members,
|
|
@@ -321,6 +321,12 @@ export function buildRunnerArgs({ targetIssues, members, branch, baseBranch, goa
|
|
|
321
321
|
// HTTP-backed dolt-mutex/id-allocator clients (fleet-sprint/runner.js
|
|
322
322
|
// ~5013-5052). Omitted when not supplied -- unchanged fallback behavior.
|
|
323
323
|
if (serviceUrl !== undefined) args.serviceUrl = serviceUrl;
|
|
324
|
+
// apra-fleet-5co8.37: this launch's reservation identity (the supervisor's
|
|
325
|
+
// --run-id, or the branch name for a direct launch -- the SAME key members
|
|
326
|
+
// are reserved under below). runner.js threads it into the deployer's
|
|
327
|
+
// dispatch so deploy.md's active-sprints gate can recognize this sprint's
|
|
328
|
+
// OWN reservation instead of stopping on it.
|
|
329
|
+
if (runId !== undefined) args.run_id = runId;
|
|
324
330
|
return args;
|
|
325
331
|
}
|
|
326
332
|
|
|
@@ -445,6 +451,39 @@ export function attachViewerErrorHandler(server, port, opts = {}) {
|
|
|
445
451
|
return server;
|
|
446
452
|
}
|
|
447
453
|
|
|
454
|
+
// (apra-fleet-p2to.4.2) Owner-checked re-reserve executed on the workflow's
|
|
455
|
+
// 'resumed' event. reReserveForResume() re-grabs every member released at pause
|
|
456
|
+
// and, on the happy path, re-syncs each; if any member was claimed by another
|
|
457
|
+
// sprint while we were paused it throws a MemberReservationResumeError that
|
|
458
|
+
// NAMES exactly those members.
|
|
459
|
+
//
|
|
460
|
+
// The prior review (PR #397) reopened this bead because the 'resumed' handler
|
|
461
|
+
// wrapped that call in `.catch(console.error)`, which SWALLOWED the naming
|
|
462
|
+
// throw: the sprint then resumed anyway while holding ZERO reservations, and
|
|
463
|
+
// the designed clean-failure path never fired. This helper is the fix -- it
|
|
464
|
+
// does NOT swallow. On failure it re-pauses the run (requestPause) so no further
|
|
465
|
+
// dispatch lands on a member this sprint no longer owns, and then RETHROWS so
|
|
466
|
+
// the failure -- and precisely which members block the resume -- is surfaced to
|
|
467
|
+
// the operator instead of lost to a console.error line. Extracted and exported
|
|
468
|
+
// so the rethrow-and-name behavior is unit-testable without a live engine.
|
|
469
|
+
export async function reReserveOnResume({ sprintReservation, resyncMember, requestPause, log = () => {} } = {}) {
|
|
470
|
+
try {
|
|
471
|
+
return await sprintReservation.reReserveForResume({ resyncMember });
|
|
472
|
+
} catch (err) {
|
|
473
|
+
const msg = err && err.message ? err.message : String(err);
|
|
474
|
+
// Re-park the run: the resume cannot proceed on a reservation set we no
|
|
475
|
+
// longer fully own. This keeps the sprint from silently continuing on
|
|
476
|
+
// zero reservations (the exact regression the review flagged).
|
|
477
|
+
if (typeof requestPause === 'function') {
|
|
478
|
+
requestPause(`resume blocked -- ${msg}`);
|
|
479
|
+
}
|
|
480
|
+
log(`[member-reservation] resume failed (run re-paused; free the named members and resume again): ${msg}`);
|
|
481
|
+
// Surface, do not swallow: the operator must see which members block the
|
|
482
|
+
// resume (MemberReservationResumeError.members names them).
|
|
483
|
+
throw err;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
448
487
|
async function main() {
|
|
449
488
|
const { values } = parseCliArgs(process.argv.slice(2));
|
|
450
489
|
|
|
@@ -570,11 +609,19 @@ async function main() {
|
|
|
570
609
|
|
|
571
610
|
// 2. Validate members exist via the fleet's list_members tool.
|
|
572
611
|
let validMembers = [];
|
|
612
|
+
// apra-fleet: names flagged unreservable in the SAME list_members read --
|
|
613
|
+
// hoisted out of this try block so the topology filter below (item 4) can
|
|
614
|
+
// key on the actual unreservable flag, not on roleMap.orchestrator
|
|
615
|
+
// membership (which would also match a real, git-having dispatch member
|
|
616
|
+
// that is ADDITIONALLY role-mapped as orchestrator, and wrongly skip its
|
|
617
|
+
// legitimate same-HEAD topology check).
|
|
618
|
+
let unreservableNames = new Set();
|
|
573
619
|
try {
|
|
574
620
|
const listRes = await fleetApi.listMembers({ format: 'json' });
|
|
575
621
|
const text = listRes && listRes.content && listRes.content[0] ? listRes.content[0].text : JSON.stringify(listRes);
|
|
576
622
|
const parsed = JSON.parse(text);
|
|
577
623
|
const registeredNames = new Set((parsed.members || []).map(m => m.name));
|
|
624
|
+
unreservableNames = new Set((parsed.members || []).filter(m => m && m.unreservable).map(m => m.name));
|
|
578
625
|
const result = resolveMemberValidation({ rawMembers, registeredNames, allowMissingMembers });
|
|
579
626
|
if (!result.ok) {
|
|
580
627
|
console.error(result.message);
|
|
@@ -637,8 +684,31 @@ async function main() {
|
|
|
637
684
|
}
|
|
638
685
|
return res && res.content && res.content[0] ? res.content[0].text : '';
|
|
639
686
|
};
|
|
687
|
+
// apra-fleet: exclude any member flagged `unreservable` from this
|
|
688
|
+
// git-identity/git-remote probe -- such a member (e.g. a shared
|
|
689
|
+
// fleet-sprint orchestrator, docs/design-orchestrator-worktree-model-v2.md)
|
|
690
|
+
// may have no real checkout at all, and `git rev-parse HEAD` on one
|
|
691
|
+
// hard-fails the launch (process.exit(1) just below). Deliberately keyed
|
|
692
|
+
// on the `unreservable` FLAG, not on roleMap.orchestrator membership: a
|
|
693
|
+
// real, git-having dispatch member that is ADDITIONALLY role-mapped as
|
|
694
|
+
// orchestrator (a supported topology, runner.js's branchEnsureMembers
|
|
695
|
+
// dedupe comment) must still pass its legitimate same-HEAD check against
|
|
696
|
+
// the other dispatch members -- filtering on roleMap.orchestrator alone
|
|
697
|
+
// would silently skip that check instead of just skipping a git-less
|
|
698
|
+
// member. This only matters when an operator also lists a shared member
|
|
699
|
+
// in --members (redundant with roleMap.orchestrator, and not required);
|
|
700
|
+
// a normal launch that passes the shared orchestrator ONLY via
|
|
701
|
+
// roleMap.orchestrator was never affected.
|
|
702
|
+
const topologyMembersFiltered = validMembers.filter((m) => !unreservableNames.has(m));
|
|
703
|
+
// Degrade back to the unfiltered list if excluding unreservable members
|
|
704
|
+
// would empty it out entirely -- checkMemberTopology refuses to start on
|
|
705
|
+
// an empty member list, and an operator who names ONLY unreservable
|
|
706
|
+
// members in --members (unusual, but not this check's job to forbid) gets
|
|
707
|
+
// the ORIGINAL single-member-trivial-pass behavior rather than a topology
|
|
708
|
+
// error about having no members at all.
|
|
709
|
+
const topologyMembers = topologyMembersFiltered.length > 0 ? topologyMembersFiltered : validMembers;
|
|
640
710
|
const topology = await checkMemberTopology({
|
|
641
|
-
members:
|
|
711
|
+
members: topologyMembers,
|
|
642
712
|
mode: syncedMode ? 'synced' : 'legacy',
|
|
643
713
|
getIdentity: (member) => runCommand('git rev-parse HEAD', member),
|
|
644
714
|
getOriginUrl: (member) => runCommand('git remote get-url origin', member),
|
|
@@ -690,6 +760,13 @@ async function main() {
|
|
|
690
760
|
// explicitly rather than picking up the new core defaults.
|
|
691
761
|
stateSnapshotDir: 'sprint-logs',
|
|
692
762
|
stateSnapshotPrefix: 'sprint_',
|
|
763
|
+
// apra-fleet-dm5.2: publish the fields buildRunTitle() (apra-fleet-
|
|
764
|
+
// dm5.1) reads off state.args so the viewer header shows
|
|
765
|
+
// "<members> working <targetIssues> (<goal>)" instead of just the
|
|
766
|
+
// workflow name for a fleet-sprint run. Purely additive -- the core
|
|
767
|
+
// viewer's state.args stays optional/null for any other workflow
|
|
768
|
+
// that doesn't pass launchArgs, and no existing state key changes.
|
|
769
|
+
launchArgs: { members: validMembers, targetIssues, goal },
|
|
693
770
|
});
|
|
694
771
|
|
|
695
772
|
// apra-fleet-unw2.16, N14 (e): the viewer port was hardcoded with no
|
|
@@ -728,6 +805,64 @@ async function main() {
|
|
|
728
805
|
});
|
|
729
806
|
await sprintReservation.reserveAll();
|
|
730
807
|
|
|
808
|
+
// apra-fleet-p2to.4.2: reservation handling across a cooperative
|
|
809
|
+
// pause/resume (apra-fleet-p2to.1's engine primitive). On 'paused' hand
|
|
810
|
+
// every member back so another sprint may use it while this one is parked;
|
|
811
|
+
// on 'resumed' re-acquire them OWNER-CHECKED (a member another sprint
|
|
812
|
+
// grabbed while we were paused fails the resume, NAMING it) and re-sync
|
|
813
|
+
// every re-acquired member (git fetch + decideEnsureBranchAction probe +
|
|
814
|
+
// bd dolt pull) unconditionally before work continues. The 'paused' handler
|
|
815
|
+
// is best-effort (a release hiccup must never fail a pause). The 'resumed'
|
|
816
|
+
// handler, by contrast, FAILS the resume when a member was taken while
|
|
817
|
+
// paused: reReserveForResume's throw (an unavailable member) is surfaced --
|
|
818
|
+
// the run is re-paused and the error rethrown -- so the operator sees
|
|
819
|
+
// exactly which members block the resume instead of the sprint silently
|
|
820
|
+
// continuing on zero reservations.
|
|
821
|
+
// `ok` is derived from the command's real exit code (via
|
|
822
|
+
// commandResultToSoftGit), NOT from an isError flag: execute_command never
|
|
823
|
+
// sets isError on a non-zero exit, so reading it here would make every git
|
|
824
|
+
// command -- including the `git merge-base --is-ancestor` tip comparison --
|
|
825
|
+
// look successful and silently reset committed-but-unpushed work. See
|
|
826
|
+
// commandResultToSoftGit()'s doc comment in runner.js.
|
|
827
|
+
const runGitSoft = async (cmd, member) => {
|
|
828
|
+
const res = await fleetApi.executeCommand({ command: cmd, member_name: member });
|
|
829
|
+
return commandResultToSoftGit(res);
|
|
830
|
+
};
|
|
831
|
+
workflow.on('paused', () => {
|
|
832
|
+
sprintReservation.releaseForPause().catch((err) =>
|
|
833
|
+
console.error('[member-reservation] release-on-pause failed:', err && err.message ? err.message : err));
|
|
834
|
+
});
|
|
835
|
+
// (apra-fleet-p2to.1.3) The re-reserve + per-member resync is registered as
|
|
836
|
+
// an AWAITABLE pre-resume hook, not a fire-and-forget 'resumed' listener.
|
|
837
|
+
// requestResume() drains this hook as a hard barrier -- while the run is
|
|
838
|
+
// still paused, so no post-resume agent()/command() dispatch can land ahead
|
|
839
|
+
// of it -- and only then releases the gate waiters and emits 'resumed'. The
|
|
840
|
+
// re-reserve therefore completes strictly BEFORE the first post-resume
|
|
841
|
+
// dispatch, closing the race the old 'resumed' handler left open.
|
|
842
|
+
//
|
|
843
|
+
// reReserveOnResume() does NOT swallow a re-reserve failure (the old
|
|
844
|
+
// `.catch(console.error)` did, silently resuming on zero reservations). It
|
|
845
|
+
// rethrows the MemberReservationResumeError that NAMES the unavailable
|
|
846
|
+
// members; because the hook runs before requestResume() clears pause state,
|
|
847
|
+
// that rejection leaves the run parked (still paused) and propagates out of
|
|
848
|
+
// requestResume() to the resume caller instead of being lost -- the operator
|
|
849
|
+
// sees exactly which members block the resume. requestPause() is still
|
|
850
|
+
// passed for the exported helper's standalone contract; here it is a no-op
|
|
851
|
+
// because the run has not yet been unpaused.
|
|
852
|
+
workflow.setPreResumeHook(() => reReserveOnResume({
|
|
853
|
+
sprintReservation,
|
|
854
|
+
resyncMember: (member) => resyncReacquiredMember({
|
|
855
|
+
member,
|
|
856
|
+
branch: branchName,
|
|
857
|
+
baseBranch,
|
|
858
|
+
runGit: (cmd) => runGitSoft(cmd, member),
|
|
859
|
+
doltPull: (m) => runCommand('bd dolt pull', m),
|
|
860
|
+
log: (msg) => console.log(msg),
|
|
861
|
+
}),
|
|
862
|
+
requestPause: (reason) => workflow.requestPause(reason),
|
|
863
|
+
log: (msg) => console.error(msg),
|
|
864
|
+
}));
|
|
865
|
+
|
|
731
866
|
let reservationReleased = false;
|
|
732
867
|
const releaseReservationOnce = async () => {
|
|
733
868
|
if (reservationReleased) return;
|
|
@@ -762,6 +897,7 @@ async function main() {
|
|
|
762
897
|
budget,
|
|
763
898
|
dispatchTimeoutS,
|
|
764
899
|
serviceUrl,
|
|
900
|
+
runId: effectiveRunId,
|
|
765
901
|
}),
|
|
766
902
|
// apra-fleet-eft.75.1: wires this already-connected mcpClient
|
|
767
903
|
// through to runner.js's createMemberSessionGuard (see its doc
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
// =============================================================================
|
|
19
19
|
|
|
20
20
|
import { parseArgs } from 'node:util';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
import fs from 'node:fs';
|
|
21
23
|
import { pathToFileURL } from 'node:url';
|
|
22
24
|
import { createSupervisor, DEFAULT_SERVICE_PORT, readJsonBody, sendJson } from '../src/supervisor/server.mjs';
|
|
23
25
|
import { createLedger } from '../src/supervisor/ledger.mjs';
|
|
@@ -46,7 +48,8 @@ import { createBacklog, registerBacklogRoutes } from '../src/supervisor/backlog.
|
|
|
46
48
|
import { createDashboard, registerDashboardRoutes } from '../src/supervisor/dashboard.mjs';
|
|
47
49
|
import { createSprintController, registerSprintRoutes, defaultMemberOverlapGuard, ApiError } from '../src/supervisor/api.mjs';
|
|
48
50
|
import { createScopeGuard, formatScopeConflict } from '../src/supervisor/scope-overlap.mjs';
|
|
49
|
-
import { listFleetMembers } from '../src/supervisor/fleet-members.mjs';
|
|
51
|
+
import { listFleetMembers, executeFleetCommand } from '../src/supervisor/fleet-members.mjs';
|
|
52
|
+
import { createDoltOrphanSweep, normalizeMsysPathForPlatform } from '../src/supervisor/dolt-orphan-sweep.mjs';
|
|
50
53
|
import { resolveFleetServerConnection } from './cli.mjs';
|
|
51
54
|
|
|
52
55
|
const SERVE_USAGE = `
|
|
@@ -58,6 +61,14 @@ termination signal (Ctrl-C / SIGTERM).
|
|
|
58
61
|
Options:
|
|
59
62
|
--port <port> HTTP service port for the supervisor API. Default: ${DEFAULT_SERVICE_PORT}.
|
|
60
63
|
-h, --help Show this help message.
|
|
64
|
+
|
|
65
|
+
Environment:
|
|
66
|
+
FLEET_SE_DATA_DIR Service data dir (ledger/history/logs).
|
|
67
|
+
FLEET_SE_SWEEP_OWNER_DATA_DIR Scope the dolt-orphan-sweep to ephemeral
|
|
68
|
+
dolt sql-servers whose --data-dir is under
|
|
69
|
+
this path, so an isolated supervisor
|
|
70
|
+
instance never kills another instance's
|
|
71
|
+
server. Unset = machine-wide (default).
|
|
61
72
|
`.trim();
|
|
62
73
|
|
|
63
74
|
/**
|
|
@@ -252,7 +263,43 @@ export async function serveMain(argv = process.argv.slice(2)) {
|
|
|
252
263
|
// above for why no separate launch-form seam is constructed here).
|
|
253
264
|
const dashboard = createDashboard({ ledger, watchdog, backlog });
|
|
254
265
|
|
|
255
|
-
|
|
266
|
+
// docs/dolt-sync-redesign.md Part 3.3: kill any orphaned ephemeral
|
|
267
|
+
// `dolt sql-server` a mid-settle orchestrator death left behind on a
|
|
268
|
+
// member (settle's own finally covers every other path). Both
|
|
269
|
+
// collaborators use the same short-lived-MCP-connection pattern as
|
|
270
|
+
// listFleetMembers -- the supervisor never holds a standing fleet
|
|
271
|
+
// transport.
|
|
272
|
+
// apra-fleet-5co8.33: `FLEET_SE_SWEEP_OWNER_DATA_DIR` is the deps-level
|
|
273
|
+
// scope seam for that sweep. Unset (production default) the probe/kill
|
|
274
|
+
// command stays machine-wide -- it must be, because the ephemeral server's
|
|
275
|
+
// `--data-dir` belongs to the MEMBER (dolt-settle.mjs reads it from
|
|
276
|
+
// `bd dolt status` there), so a remote member's data dir has no relation to
|
|
277
|
+
// this supervisor's own FLEET_SE_DATA_DIR and deriving a prefix from the
|
|
278
|
+
// latter would silently make the sweep a no-op everywhere. Set (an isolated
|
|
279
|
+
// instance -- e.g. regression-test-playbook.md's sandbox supervisor, whose
|
|
280
|
+
// HOME and members all live under one root) it constrains candidates to
|
|
281
|
+
// processes whose `--data-dir` is under that root, so this instance can
|
|
282
|
+
// never kill another live supervisor's ephemeral server.
|
|
283
|
+
const sweepOwnerDataDir = process.env.FLEET_SE_SWEEP_OWNER_DATA_DIR
|
|
284
|
+
? path.resolve(normalizeMsysPathForPlatform(process.env.FLEET_SE_SWEEP_OWNER_DATA_DIR))
|
|
285
|
+
: null;
|
|
286
|
+
if (sweepOwnerDataDir) {
|
|
287
|
+
console.log(`[dolt-orphan-sweep] owner-scoped to data dirs under '${sweepOwnerDataDir}' (FLEET_SE_SWEEP_OWNER_DATA_DIR).`);
|
|
288
|
+
// apra-fleet-5co8.36: a confident scope claim above is worse than
|
|
289
|
+
// useless if the resolved prefix does not actually exist -- that is
|
|
290
|
+
// exactly what an un-normalized MSYS path used to produce. Warn
|
|
291
|
+
// loudly rather than let the sweep silently match nothing.
|
|
292
|
+
if (!fs.existsSync(sweepOwnerDataDir)) {
|
|
293
|
+
console.warn(`[dolt-orphan-sweep] WARNING: FLEET_SE_SWEEP_OWNER_DATA_DIR resolved to '${sweepOwnerDataDir}', which does not exist on disk -- the owner-scoped sweep will match no process and silently degrade to matching nothing.`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const doltOrphanSweep = createDoltOrphanSweep({
|
|
297
|
+
listMembers: () => listFleetMembers({ resolveConnection: resolveFleetServerConnection }),
|
|
298
|
+
execCommand: ({ member, command }) => executeFleetCommand({ member, command, resolveConnection: resolveFleetServerConnection }),
|
|
299
|
+
ownerDataDirPrefix: sweepOwnerDataDir,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const supervisor = createSupervisor({ port, ledger, spawner, watchdog, dashboard, idAllocator, doltMutex, doltOrphanSweep });
|
|
256
303
|
registerIdAllocatorRoutes(supervisor, idAllocator, { readJsonBody, sendJson });
|
|
257
304
|
registerDoltMutexRoutes(supervisor, doltMutex, { readJsonBody, sendJson });
|
|
258
305
|
|