@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
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
// apra-fleet-eft.9.5 (Plan 3.4 -- Dolt conflict recovery ladder, Path B).
|
|
2
|
-
//
|
|
3
|
-
// Path B is the FALLBACK dolt recovery for a wedged clone that Path A
|
|
4
|
-
// (dolt-recovery.mjs, apra-fleet-eft.9.4) refuses to touch: either the
|
|
5
|
-
// conflict shape failed one of Path A's two deterministic gates
|
|
6
|
-
// (multi-row, or a table outside the allowlist), or a genuine operational
|
|
7
|
-
// failure made resolve-in-place unsafe. Where Path A resolves the conflict
|
|
8
|
-
// in place with zero data loss, Path B is deliberately more destructive but
|
|
9
|
-
// simpler and more robust: DISCARD the wedged clone's local dolt state
|
|
10
|
-
// entirely and re-bootstrap fresh from the shared remote, then replay back
|
|
11
|
-
// in the ONE local mutation that mattered (the doer streak's own write that
|
|
12
|
-
// triggered the D-push in the first place). Everything else the loser
|
|
13
|
-
// clone had locally that never made it to the remote is discarded on
|
|
14
|
-
// purpose -- by construction (single-writer token passing, one streak
|
|
15
|
-
// between D-pull and D-push) that is always small, and it is enumerated in
|
|
16
|
-
// the log rather than silently dropped.
|
|
17
|
-
//
|
|
18
|
-
// -----------------------------------------------------------------------------
|
|
19
|
-
// The VERIFIED runbook (implemented exactly, in this order):
|
|
20
|
-
//
|
|
21
|
-
// 1. Guard (Windows gotcha #1): assert config.yaml exists and still
|
|
22
|
-
// carries a non-empty `sync.remote` BEFORE touching anything. On
|
|
23
|
-
// Windows, `bd bootstrap` derives a broken `git+C:/...` URL when
|
|
24
|
-
// sync.remote is absent from config.yaml -- config.yaml is therefore
|
|
25
|
-
// the one file this recovery NEVER removes, but if it already lacks
|
|
26
|
-
// sync.remote the same breakage would occur regardless of how careful
|
|
27
|
-
// we are, so this is checked and escalated (never silently proceeded
|
|
28
|
-
// past) rather than discovered after the fact.
|
|
29
|
-
// 2. Enumerate: log every piece of local-only state about to be
|
|
30
|
-
// discarded (opts.listLocalState), so the loser clone's other
|
|
31
|
-
// unsynced writes are never silently dropped from the record even
|
|
32
|
-
// though they are not recovered.
|
|
33
|
-
// 3. Discard: remove `.beads/embeddeddolt`, `.beads/metadata.json`,
|
|
34
|
-
// `.beads/backup` -- KEEPING config.yaml untouched.
|
|
35
|
-
// 4. Re-bootstrap: `BD_NON_INTERACTIVE=1 bd bootstrap --yes` against the
|
|
36
|
-
// now-clean `.beads` dir (config.yaml + its sync.remote still in
|
|
37
|
-
// place is what lets bootstrap re-clone the shared remote correctly).
|
|
38
|
-
// 5. Windows gotcha #2 guard: if that bootstrap attempt fails because a
|
|
39
|
-
// leftover EMPTY database is still on disk (isBootstrapEmptyDbFailure
|
|
40
|
-
// classifies this from bootstrap's own output text), remove
|
|
41
|
-
// `.beads/embeddeddolt` again and retry bootstrap exactly ONCE more --
|
|
42
|
-
// bounded, never an unbounded retry loop.
|
|
43
|
-
// 6. Replay: re-issue the ONE pending mutation (opts.pendingMutation) --
|
|
44
|
-
// the loser clone's own local write -- against the freshly bootstrapped
|
|
45
|
-
// clone, so it is not lost even though everything else local was
|
|
46
|
-
// discarded in step 3.
|
|
47
|
-
// 7. Republish: `bd dolt push` the replayed mutation back to the shared
|
|
48
|
-
// remote.
|
|
49
|
-
//
|
|
50
|
-
// Any genuine operational failure (guard failure, bootstrap failure that
|
|
51
|
-
// survives the one bounded retry, a failed mutation replay, or a push still
|
|
52
|
-
// rejected) throws a typed DoltSyncError/DoltDivergedError so the caller
|
|
53
|
-
// (Tier 2 escalation, apra-fleet-eft.9.6) can route it onward -- Path B never
|
|
54
|
-
// silently swallows a failure the way it deliberately discards non-critical
|
|
55
|
-
// local state.
|
|
56
|
-
// =============================================================================
|
|
57
|
-
|
|
58
|
-
import { DoltDivergedError, DoltSyncError } from './errors.mjs';
|
|
59
|
-
|
|
60
|
-
/** The three paths Path B ALWAYS removes (in this order), never anything
|
|
61
|
-
* else. `.beads/config.yaml` (with its `sync.remote`) is deliberately never
|
|
62
|
-
* in this list -- see Windows gotcha #1 in the module doc above. */
|
|
63
|
-
export const DEFAULT_PATH_B_REMOVE_PATHS = [
|
|
64
|
-
'.beads/embeddeddolt',
|
|
65
|
-
'.beads/metadata.json',
|
|
66
|
-
'.beads/backup',
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
/** The one path this recovery must NEVER remove. */
|
|
70
|
-
export const DEFAULT_CONFIG_PATH = '.beads/config.yaml';
|
|
71
|
-
|
|
72
|
-
/** Default local-backup dir enumerated (not removed by this module directly
|
|
73
|
-
* -- it is one of DEFAULT_PATH_B_REMOVE_PATHS -- but its contents are
|
|
74
|
-
* listed BEFORE removal so the discard is enumerated, not silent). */
|
|
75
|
-
export const DEFAULT_BACKUP_DIR = '.beads/backup';
|
|
76
|
-
|
|
77
|
-
/** Default embedded dolt data dir, re-removed on the bounded Windows
|
|
78
|
-
* gotcha #2 retry (a leftover empty DB there makes the first bootstrap
|
|
79
|
-
* retry fail until it is removed again). */
|
|
80
|
-
export const DEFAULT_EMBEDDED_DATA_DIR = '.beads/embeddeddolt';
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Substrings in a failed `bd bootstrap` attempt that mark it as the verified
|
|
84
|
-
* Windows gotcha #2: a leftover EMPTY database left on disk (e.g. by a
|
|
85
|
-
* partially-completed prior bootstrap) makes the retry fail until
|
|
86
|
-
* `.beads/embeddeddolt` is removed again. Distinguished from any other
|
|
87
|
-
* bootstrap failure, which is NOT retried and instead thrown.
|
|
88
|
-
* @type {RegExp[]}
|
|
89
|
-
*/
|
|
90
|
-
const BOOTSTRAP_EMPTY_DB_PATTERNS = [
|
|
91
|
-
/database already exists/i,
|
|
92
|
-
/directory not empty/i,
|
|
93
|
-
/already initiali[sz]ed/i,
|
|
94
|
-
/empty (database|db)/i,
|
|
95
|
-
/existing (dolt )?data ?dir/i,
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Does this `bd bootstrap` failure output describe the verified Windows
|
|
100
|
-
* gotcha #2 (leftover empty DB), as opposed to any other bootstrap failure
|
|
101
|
-
* that must not be blindly retried?
|
|
102
|
-
*
|
|
103
|
-
* @param {string} output
|
|
104
|
-
* @returns {boolean}
|
|
105
|
-
*/
|
|
106
|
-
export function isBootstrapEmptyDbFailure(output) {
|
|
107
|
-
const text = String(output == null ? '' : output);
|
|
108
|
-
return BOOTSTRAP_EMPTY_DB_PATTERNS.some((re) => re.test(text));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Naive (dependency-free) check for a non-empty `sync.remote` in a
|
|
113
|
-
* config.yaml's raw text. Deliberately not a full YAML parse (no yaml
|
|
114
|
-
* dependency in this package) -- Path B only ever needs a yes/no guard on
|
|
115
|
-
* this one field, and callers/tests can inject their own `readConfig` for
|
|
116
|
-
* anything more precise.
|
|
117
|
-
*
|
|
118
|
-
* Recognizes BOTH forms `bd` itself writes for this key -- verified against
|
|
119
|
-
* a real bd-managed config.yaml (this repo's own .beads/config.yaml uses the
|
|
120
|
-
* flat form exclusively; the nested form was this function's original,
|
|
121
|
-
* untested assumption and never actually matched real output):
|
|
122
|
-
* - flat dotted key, one line: sync.remote: "git+https://...\"" or
|
|
123
|
-
* sync.remote: git+https://... (quoted or bare scalar)
|
|
124
|
-
* - nested block: sync:\n remote: git+https://...
|
|
125
|
-
* Without matching the flat form, this guard always reported false against
|
|
126
|
-
* every real config.yaml in this codebase, permanently blocking Path B
|
|
127
|
-
* behind a false "no sync.remote set" escalation to Tier 2 (apra-fleet-vkc.1
|
|
128
|
-
* post-review fix, found via a live manufactured-conflict test on
|
|
129
|
-
* fleet-win-dev1 -- not caught earlier because the existing tests only ever
|
|
130
|
-
* injected the nested form as a mock).
|
|
131
|
-
*
|
|
132
|
-
* @param {string} raw
|
|
133
|
-
* @returns {boolean}
|
|
134
|
-
*/
|
|
135
|
-
export function hasSyncRemoteInYaml(raw) {
|
|
136
|
-
const text = String(raw == null ? '' : raw);
|
|
137
|
-
const flatMatch = text.match(/^sync\.remote:\s*(.*)$/m);
|
|
138
|
-
if (flatMatch) {
|
|
139
|
-
const value = flatMatch[1].trim().replace(/^"(.*)"$/, '$1').replace(/^'(.*)'$/, '$1').trim();
|
|
140
|
-
if (value.length > 0) return true;
|
|
141
|
-
}
|
|
142
|
-
const syncBlockMatch = text.match(/^sync:\s*\n((?:[ \t]+.*\n?)*)/m);
|
|
143
|
-
if (!syncBlockMatch) return false;
|
|
144
|
-
return /remote:\s*\S+/.test(syncBlockMatch[1]);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Default `readConfig()`: reads DEFAULT_CONFIG_PATH off disk and reports
|
|
149
|
-
* whether it exists and carries a non-empty `sync.remote`. Injectable
|
|
150
|
-
* (opts.readConfig) in tests so no real filesystem is touched.
|
|
151
|
-
*
|
|
152
|
-
* @param {string} [configPath]
|
|
153
|
-
* @returns {Promise<{ exists: boolean, raw: string|null, hasSyncRemote: boolean }>}
|
|
154
|
-
*/
|
|
155
|
-
export async function defaultReadConfig(configPath = DEFAULT_CONFIG_PATH) {
|
|
156
|
-
const fs = await import('node:fs/promises');
|
|
157
|
-
let raw = null;
|
|
158
|
-
try {
|
|
159
|
-
raw = await fs.readFile(configPath, 'utf8');
|
|
160
|
-
} catch {
|
|
161
|
-
return { exists: false, raw: null, hasSyncRemote: false };
|
|
162
|
-
}
|
|
163
|
-
return { exists: true, raw, hasSyncRemote: hasSyncRemoteInYaml(raw) };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Default `removePath()`: `fs.rm(path, { recursive: true, force: true })`.
|
|
168
|
-
* Cross-platform (works identically on Windows and POSIX) -- deliberately
|
|
169
|
-
* NOT a shelled-out `rm -rf`, which does not exist natively on Windows.
|
|
170
|
-
* Injectable (opts.removePath) in tests so no real filesystem is touched.
|
|
171
|
-
*
|
|
172
|
-
* @param {string} targetPath
|
|
173
|
-
* @returns {Promise<void>}
|
|
174
|
-
*/
|
|
175
|
-
export async function defaultRemovePath(targetPath) {
|
|
176
|
-
const fs = await import('node:fs/promises');
|
|
177
|
-
await fs.rm(targetPath, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Default `listLocalState()`: enumerates the contents of the local backup
|
|
182
|
-
* dir (the one piece of loser-clone-only state most likely to hold real,
|
|
183
|
-
* never-to-be-recovered local writes) so the discard is logged rather than
|
|
184
|
-
* silent. Injectable (opts.listLocalState) in tests so no real filesystem is
|
|
185
|
-
* touched.
|
|
186
|
-
*
|
|
187
|
-
* @param {string} [backupDir]
|
|
188
|
-
* @returns {Promise<string[]>}
|
|
189
|
-
*/
|
|
190
|
-
export async function defaultListLocalState(backupDir = DEFAULT_BACKUP_DIR) {
|
|
191
|
-
const fs = await import('node:fs/promises');
|
|
192
|
-
try {
|
|
193
|
-
const entries = await fs.readdir(backupDir);
|
|
194
|
-
if (entries.length === 0) {
|
|
195
|
-
return [`local backup dir '${backupDir}' is empty (nothing else to discard there)`];
|
|
196
|
-
}
|
|
197
|
-
return [`local backup dir '${backupDir}' contains ${entries.length} file(s), about to be discarded: ${entries.join(', ')}`];
|
|
198
|
-
} catch {
|
|
199
|
-
return [`local backup dir '${backupDir}' does not exist (nothing to enumerate there)`];
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Path B: discard-and-re-bootstrap fallback dolt conflict recovery, with
|
|
205
|
-
* mutation replay and the two verified Windows gotchas guarded. Runs the
|
|
206
|
-
* VERIFIED runbook end-to-end via injected command()/removePath()/
|
|
207
|
-
* readConfig()/listLocalState() -- no agent dispatch.
|
|
208
|
-
*
|
|
209
|
-
* Return contract (never partial): on success returns
|
|
210
|
-
* `{ ok:true, recovered:true, mutationReplayed, removedPaths, discarded, reason }`.
|
|
211
|
-
* Any genuine operational failure (config guard, bootstrap failure surviving
|
|
212
|
-
* the one bounded retry, a failed mutation replay, or a still-rejected
|
|
213
|
-
* republish push) throws DoltSyncError/DoltDivergedError so the caller
|
|
214
|
-
* (apra-fleet-eft.9.6 Tier 2 escalation) can route it onward.
|
|
215
|
-
*
|
|
216
|
-
* @param {{
|
|
217
|
-
* member: string,
|
|
218
|
-
* command: (cmd: string, opts?: object) => Promise<{ ok: boolean, output?: string, error?: string|null }>,
|
|
219
|
-
* readConfig?: (configPath?: string) => Promise<{ exists: boolean, raw: string|null, hasSyncRemote: boolean }>,
|
|
220
|
-
* removePath?: (targetPath: string) => Promise<void>,
|
|
221
|
-
* listLocalState?: () => Promise<string[]>,
|
|
222
|
-
* configPath?: string,
|
|
223
|
-
* removePaths?: string[],
|
|
224
|
-
* embeddedDataDir?: string,
|
|
225
|
-
* pendingMutation?: { description: string, cmd: string } | null,
|
|
226
|
-
* log?: (msg: string) => void,
|
|
227
|
-
* }} opts
|
|
228
|
-
* @returns {Promise<{ ok: boolean, recovered: boolean, mutationReplayed: boolean, removedPaths: string[], discarded: string[], reason: string }>}
|
|
229
|
-
*/
|
|
230
|
-
export async function recoverDoltConflictPathB(opts = {}) {
|
|
231
|
-
const {
|
|
232
|
-
member,
|
|
233
|
-
command,
|
|
234
|
-
readConfig = defaultReadConfig,
|
|
235
|
-
removePath = defaultRemovePath,
|
|
236
|
-
listLocalState = defaultListLocalState,
|
|
237
|
-
configPath = DEFAULT_CONFIG_PATH,
|
|
238
|
-
removePaths = DEFAULT_PATH_B_REMOVE_PATHS,
|
|
239
|
-
embeddedDataDir = DEFAULT_EMBEDDED_DATA_DIR,
|
|
240
|
-
pendingMutation = null,
|
|
241
|
-
log = () => {},
|
|
242
|
-
} = opts;
|
|
243
|
-
|
|
244
|
-
if (typeof command !== 'function') throw new Error('recoverDoltConflictPathB requires an injected command() in opts');
|
|
245
|
-
if (typeof readConfig !== 'function') throw new Error('recoverDoltConflictPathB requires an injected readConfig() in opts');
|
|
246
|
-
if (typeof removePath !== 'function') throw new Error('recoverDoltConflictPathB requires an injected removePath() in opts');
|
|
247
|
-
if (typeof listLocalState !== 'function') throw new Error('recoverDoltConflictPathB requires an injected listLocalState() in opts');
|
|
248
|
-
|
|
249
|
-
// --- Step 1: Windows gotcha #1 guard -- config.yaml must exist and
|
|
250
|
-
// already carry a non-empty sync.remote BEFORE we touch anything. We
|
|
251
|
-
// never remove config.yaml, but if it already lacks sync.remote the
|
|
252
|
-
// broken git+C:/ URL derivation would happen regardless of that care. ---
|
|
253
|
-
const configBefore = await readConfig(configPath);
|
|
254
|
-
if (!configBefore || !configBefore.exists) {
|
|
255
|
-
throw new DoltSyncError(
|
|
256
|
-
`[Dolt] Path B guard failed for member '${member}': '${configPath}' does not exist -- cannot safely re-bootstrap (Windows gotcha #1: bootstrap derives a broken git+C:/ URL without sync.remote). Escalating rather than proceeding blind.`,
|
|
257
|
-
{ member, doltOutput: null },
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
if (!configBefore.hasSyncRemote) {
|
|
261
|
-
throw new DoltSyncError(
|
|
262
|
-
`[Dolt] Path B guard failed for member '${member}': '${configPath}' has no 'sync.remote' set -- re-bootstrapping would hit the verified Windows gotcha #1 (broken git+C:/ URL derivation). Escalating rather than proceeding blind.`,
|
|
263
|
-
{ member, doltOutput: configBefore.raw },
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
log(`[Dolt] Path B guard passed for member '${member}': '${configPath}' present with sync.remote set -- safe to discard and re-bootstrap.`);
|
|
267
|
-
|
|
268
|
-
// --- Step 2: enumerate what is about to be discarded (never silent) ---
|
|
269
|
-
const discarded = await listLocalState();
|
|
270
|
-
for (const line of discarded) {
|
|
271
|
-
log(`[Dolt] Path B for member '${member}': DISCARDING (will NOT be recovered) -- ${line}`);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// --- Step 3: discard the wedged clone's local dolt state, keeping
|
|
275
|
-
// config.yaml untouched ---
|
|
276
|
-
const removedPaths = [];
|
|
277
|
-
for (const p of removePaths) {
|
|
278
|
-
log(`[Dolt] Path B for member '${member}': removing '${p}'.`);
|
|
279
|
-
await removePath(p);
|
|
280
|
-
removedPaths.push(p);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// --- Step 4: re-bootstrap fresh from the shared remote ---
|
|
284
|
-
const bootstrapCmd = 'BD_NON_INTERACTIVE=1 bd bootstrap --yes';
|
|
285
|
-
let bootstrap = await command(bootstrapCmd, { member_name: member, silent: true, failSoft: true, label: `Path B bootstrap for '${member}'` });
|
|
286
|
-
|
|
287
|
-
// --- Step 5: Windows gotcha #2 -- a leftover empty DB fails the first
|
|
288
|
-
// bootstrap attempt until embeddeddolt is removed again. Bounded: exactly
|
|
289
|
-
// ONE retry, never an unbounded loop. ---
|
|
290
|
-
if (bootstrap && bootstrap.ok === false && isBootstrapEmptyDbFailure(bootstrap.error || bootstrap.output)) {
|
|
291
|
-
log(`[Dolt] Path B for member '${member}': bootstrap failed with the verified Windows gotcha #2 (leftover empty DB) -- removing '${embeddedDataDir}' again and retrying bootstrap ONCE.`);
|
|
292
|
-
await removePath(embeddedDataDir);
|
|
293
|
-
bootstrap = await command(bootstrapCmd, { member_name: member, silent: true, failSoft: true, label: `Path B bootstrap retry (gotcha #2) for '${member}'` });
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (bootstrap && bootstrap.ok === false) {
|
|
297
|
-
throw new DoltSyncError(
|
|
298
|
-
`[Dolt] Path B bootstrap failed for member '${member}' and did not recover after the bounded gotcha #2 retry: ${bootstrap.error}`,
|
|
299
|
-
{ member, doltOutput: bootstrap.error },
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
log(`[Dolt] Path B for member '${member}': re-bootstrapped clean from the shared remote.`);
|
|
303
|
-
|
|
304
|
-
// --- Step 6: replay the one pending mutation, so it is not lost even
|
|
305
|
-
// though everything else local was just discarded ---
|
|
306
|
-
let mutationReplayed = false;
|
|
307
|
-
if (pendingMutation && pendingMutation.cmd) {
|
|
308
|
-
log(`[Dolt] Path B for member '${member}': replaying the one pending mutation -- ${pendingMutation.description || pendingMutation.cmd}`);
|
|
309
|
-
const replay = await command(pendingMutation.cmd, { member_name: member, silent: true, failSoft: true, label: `Path B mutation replay for '${member}'` });
|
|
310
|
-
if (replay && replay.ok === false) {
|
|
311
|
-
throw new DoltSyncError(
|
|
312
|
-
`[Dolt] Path B re-bootstrapped member '${member}' but replaying the pending mutation failed -- it would be lost: ${replay.error}`,
|
|
313
|
-
{ member, doltOutput: replay.error },
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
mutationReplayed = true;
|
|
317
|
-
} else {
|
|
318
|
-
log(`[Dolt] Path B for member '${member}': no pending mutation to replay.`);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// --- Step 7: republish the replayed clone ---
|
|
322
|
-
const push = await command('bd dolt push', { member_name: member, silent: true, failSoft: true, label: `Path B post-recovery D-push for '${member}'` });
|
|
323
|
-
if (push && push.ok === false) {
|
|
324
|
-
throw new DoltDivergedError(
|
|
325
|
-
`[Dolt] Path B recovered and replayed member '${member}' but the republishing push was still rejected: ${push.error}`,
|
|
326
|
-
{ member, doltOutput: push.error, operation: 'path-b-push' },
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
log(`[Dolt] Path B SUCCEEDED for member '${member}': discarded and re-bootstrapped clean, replayed ${mutationReplayed ? 'the pending mutation' : 'no pending mutation'}, and republished.`);
|
|
331
|
-
return {
|
|
332
|
-
ok: true,
|
|
333
|
-
recovered: true,
|
|
334
|
-
mutationReplayed,
|
|
335
|
-
removedPaths,
|
|
336
|
-
discarded,
|
|
337
|
-
reason: `Path B discarded and re-bootstrapped member '${member}'${mutationReplayed ? ', replayed the pending mutation,' : ''} and republished`,
|
|
338
|
-
};
|
|
339
|
-
}
|