@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
|
@@ -38,4 +38,4 @@ stored in the member's `tags` array.
|
|
|
38
38
|
3. GitHub members rarely need extra skills -- gh CLI covers most operations
|
|
39
39
|
4. Bitbucket/Azure DevOps members need provider-specific skills for devops/code-review tags (LLMs lack native API knowledge without skills)
|
|
40
40
|
5. Project-specific skills layer on top of VCS skills
|
|
41
|
-
6. Skills are independent of the member's LLM provider -- a
|
|
41
|
+
6. Skills are independent of the member's LLM provider -- a Codex member needs the same project skills as a Claude member. Skill selection is driven by VCS provider, project, and tags, not LLM provider.
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
| Empty response | Check auth token expiry -> re-provision via `provision_vcs_auth` |
|
|
6
6
|
| Timeout (inactivity) | `timeout_s`: fires when no stdout/stderr output arrives for N seconds (default 300s / 5 min). Applies to all members and all providers - transport-level, not provider-specific. Common cause: test runners and build tools that buffer output (npm test, vitest, cargo build) producing no output for long stretches even while active. Fix: increase `timeout_s` to 600-1200 for build/test dispatches. |
|
|
7
7
|
| Timeout (total) | `max_total_s`: fires after N seconds of total elapsed time regardless of output activity. Provider-agnostic. Use for hard ceilings on long-running jobs. Set alongside `timeout_s` when you need both a silence guard and a wall-clock cap. |
|
|
8
|
-
| Permission denied | Run `compose_permissions` for the member - it produces provider-native config. Claude: check `.claude/settings.local.json`. Agy: check
|
|
8
|
+
| Permission denied | Run `compose_permissions` for the member - it produces provider-native config. Claude: check `.claude/settings.local.json`. Agy: check `.gemini/antigravity-cli/settings.json` in the work folder. Codex: check `.codex/config.toml` approval mode. Copilot: check `.github/copilot/settings.local.json`. |
|
|
9
9
|
| Stuck after reset | Escalate model (cheap->standard->premium). Still stuck? Flag to user |
|
|
10
10
|
| Auth error (401/403) | GitHub App: re-mint via `provision_vcs_auth`. Bitbucket/Azure DevOps: ask user for fresh token, provision, retry. See auth-*.md |
|
|
11
11
|
| Token/password appears in command output | Use `credential_store_set` to store the secret, then reference it as `{{secure.NAME}}` in `execute_command` - Fleet redacts it to `[REDACTED:NAME]` before the LLM sees the output |
|
|
12
12
|
| Need to rotate a credential without re-provisioning | Run `credential_store_delete name=<NAME>` then `credential_store_set name=<NAME>` - the new value is picked up immediately on the next `execute_command` that references `{{secure.NAME}}` |
|
|
13
13
|
| Tool execution issue (unexpected behavior, missing output, silent failure) | Check `APRA_FLEET_DATA_DIR/logs/fleet-<pid>.log` for detailed execution traces. Filter by member with `jq 'select(.member_id == "<uuid>")'` or by tool with `jq 'select(.tag == "<tool>")'`. See the **Fleet Logs** section in SKILL.md for full field reference and `jq` examples. |
|
|
14
|
+
| `bd dolt pull`/`push` fails with "merge conflicts in issues require operator resolution" | Real divergence, not corruption -- do NOT `bd init`/`bd init --from-jsonl`/delete `.beads/`. See `beads-conflict-resolution.md` for the manual dolt SQL recovery playbook. |
|
package/version.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ProviderAdapter, PromptOptions, ParsedResponse, WorkspaceTrustExecFn, EnsureWorkspaceTrustedResult } from './provider.js';
|
|
2
|
-
import type { LlmProvider, SSHExecResult } from '../types.js';
|
|
3
|
-
import type { PromptErrorCategory } from '../utils/prompt-errors.js';
|
|
4
|
-
export declare function getAllowedMcpServers(): string;
|
|
5
|
-
export declare class GeminiProvider implements ProviderAdapter {
|
|
6
|
-
readonly name: LlmProvider;
|
|
7
|
-
readonly processName = "gemini";
|
|
8
|
-
readonly authEnvVar = "GEMINI_API_KEY";
|
|
9
|
-
readonly credentialPath = "~/.gemini/";
|
|
10
|
-
readonly instructionFileName = "GEMINI.md";
|
|
11
|
-
cliCommand(args: string): string;
|
|
12
|
-
versionCommand(): string;
|
|
13
|
-
installCommand(os: 'linux' | 'macos' | 'windows'): string;
|
|
14
|
-
updateCommand(): string;
|
|
15
|
-
buildPromptCommand(opts: PromptOptions): string;
|
|
16
|
-
skipPermissionsFlag(): string;
|
|
17
|
-
permissionModeAutoFlag(): string | null;
|
|
18
|
-
parseResponse(result: SSHExecResult): ParsedResponse;
|
|
19
|
-
supportsResume(): boolean;
|
|
20
|
-
supportsMaxTurns(): boolean;
|
|
21
|
-
resumeFlag(sessionId?: string, resuming?: boolean): string;
|
|
22
|
-
modelTiers(): Record<'cheap' | 'standard' | 'premium', string>;
|
|
23
|
-
modelForTier(tier: 'cheap' | 'standard' | 'premium'): string;
|
|
24
|
-
modelFlag(model: string): string;
|
|
25
|
-
classifyError(output: string): PromptErrorCategory;
|
|
26
|
-
permissionConfigPaths(): string[];
|
|
27
|
-
composePermissionConfig(role: 'doer' | 'reviewer', allow?: string[]): Array<Record<string, unknown> | string>;
|
|
28
|
-
supportsOAuthCopy(): boolean;
|
|
29
|
-
supportsApiKey(): boolean;
|
|
30
|
-
oauthCredentialFiles(): Array<{
|
|
31
|
-
localPath: string;
|
|
32
|
-
remotePath: string;
|
|
33
|
-
}> | null;
|
|
34
|
-
oauthSettingsMerge(): Record<string, unknown> | null;
|
|
35
|
-
oauthEnvVarsToUnset(): string[];
|
|
36
|
-
authEnvVarForToken(_token: string): string;
|
|
37
|
-
wrapWindowsPrompt(setupCmd: string, filePath: string, argList: string, _sessionId?: string, _model?: string): string;
|
|
38
|
-
jsonOutputFlag(): string;
|
|
39
|
-
headlessInvocation(promptLiteral: string): string;
|
|
40
|
-
ensureWorkspaceTrusted(_workFolder: string, _execCommand: WorkspaceTrustExecFn, _agentOs?: 'linux' | 'macos' | 'windows'): Promise<EnsureWorkspaceTrustedResult>;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../src/providers/gemini.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EA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AAuB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,KAAK,GAAE,MAAM,EAAO,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAiBjH,iBAAiB,IAAI,OAAO;IAI5B,cAAc,IAAI,OAAO;IAIzB,oBAAoB,IAAI,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAO/E,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIpD,mBAAmB,IAAI,MAAM,EAAE;IAI/B,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAM1C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAMpH,cAAc,IAAI,MAAM;IAIxB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAI3C,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC;CAMvK"}
|
package/dist/providers/gemini.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as os from 'os';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import { buildResumeFlag, buildSessionIdFlag } from './provider.js';
|
|
5
|
-
import { escapeDoubleQuoted } from '../os/os-commands.js';
|
|
6
|
-
export function getAllowedMcpServers() {
|
|
7
|
-
const settingsPath = path.join(os.homedir(), '.gemini', 'settings.json');
|
|
8
|
-
try {
|
|
9
|
-
const raw = fs.readFileSync(settingsPath, 'utf-8');
|
|
10
|
-
const settings = JSON.parse(raw);
|
|
11
|
-
const mcpServers = settings['mcpServers'];
|
|
12
|
-
if (!mcpServers || typeof mcpServers !== 'object' || Array.isArray(mcpServers)) {
|
|
13
|
-
return 'none';
|
|
14
|
-
}
|
|
15
|
-
const allowed = Object.keys(mcpServers).filter(k => k !== 'apra-fleet');
|
|
16
|
-
return allowed.length > 0 ? allowed.join(',') : 'none';
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return 'none';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function extractUsage(u) {
|
|
23
|
-
if (!u)
|
|
24
|
-
return undefined;
|
|
25
|
-
const input = u.input_tokens ?? u.input;
|
|
26
|
-
const output = u.output_tokens ?? u.output;
|
|
27
|
-
if (typeof input === 'number' && typeof output === 'number') {
|
|
28
|
-
return { input_tokens: input, output_tokens: output };
|
|
29
|
-
}
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
export class GeminiProvider {
|
|
33
|
-
name = 'gemini';
|
|
34
|
-
processName = 'gemini';
|
|
35
|
-
authEnvVar = 'GEMINI_API_KEY';
|
|
36
|
-
credentialPath = '~/.gemini/';
|
|
37
|
-
instructionFileName = 'GEMINI.md';
|
|
38
|
-
cliCommand(args) {
|
|
39
|
-
return `gemini ${args}`;
|
|
40
|
-
}
|
|
41
|
-
versionCommand() {
|
|
42
|
-
return 'gemini --version 2>&1';
|
|
43
|
-
}
|
|
44
|
-
installCommand(os) {
|
|
45
|
-
return 'npm install -g @google/gemini-cli';
|
|
46
|
-
}
|
|
47
|
-
updateCommand() {
|
|
48
|
-
return 'npm update -g @google/gemini-cli';
|
|
49
|
-
}
|
|
50
|
-
buildPromptCommand(opts) {
|
|
51
|
-
const { folder, promptFile, sessionId, resuming, unattended, model, inv, agentName } = opts;
|
|
52
|
-
const escapedFolder = escapeDoubleQuoted(folder);
|
|
53
|
-
let instruction = `Your task is described in ${promptFile} in the current directory. Read that file first, then execute the task.`;
|
|
54
|
-
if (inv) {
|
|
55
|
-
instruction = `[${inv}] ${instruction}`;
|
|
56
|
-
}
|
|
57
|
-
// Gemini activates a subagent via @<name> prepended to the prompt on EVERY dispatch.
|
|
58
|
-
if (agentName) {
|
|
59
|
-
instruction = `@${agentName} ${instruction}`;
|
|
60
|
-
}
|
|
61
|
-
let cmd = `cd "${escapedFolder}" && gemini -p "${instruction}" --output-format json --allowed-mcp-server-names "${getAllowedMcpServers()}"`;
|
|
62
|
-
if (resuming && sessionId) {
|
|
63
|
-
cmd += ` ${buildResumeFlag(sessionId)}`;
|
|
64
|
-
}
|
|
65
|
-
else if (sessionId) {
|
|
66
|
-
cmd += ` ${buildSessionIdFlag(sessionId)}`;
|
|
67
|
-
}
|
|
68
|
-
if (unattended === 'dangerous') {
|
|
69
|
-
cmd += ` ${this.skipPermissionsFlag()}`;
|
|
70
|
-
}
|
|
71
|
-
if (model) {
|
|
72
|
-
cmd += ` --model "${escapeDoubleQuoted(model)}"`;
|
|
73
|
-
}
|
|
74
|
-
return cmd;
|
|
75
|
-
}
|
|
76
|
-
skipPermissionsFlag() {
|
|
77
|
-
return '--yolo';
|
|
78
|
-
}
|
|
79
|
-
permissionModeAutoFlag() {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
parseResponse(result) {
|
|
83
|
-
const raw = result.stdout.trim();
|
|
84
|
-
try {
|
|
85
|
-
const parsed = JSON.parse(raw);
|
|
86
|
-
const usage = extractUsage(parsed.usage ?? parsed.stats ?? parsed.tokens);
|
|
87
|
-
return {
|
|
88
|
-
result: parsed.response ?? parsed.result ?? raw,
|
|
89
|
-
sessionId: result.code === 0 ? (parsed.session_id ?? undefined) : undefined,
|
|
90
|
-
isError: parsed.is_error === true || result.code !== 0,
|
|
91
|
-
raw,
|
|
92
|
-
usage,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
return {
|
|
97
|
-
result: raw,
|
|
98
|
-
sessionId: undefined,
|
|
99
|
-
isError: result.code !== 0,
|
|
100
|
-
raw,
|
|
101
|
-
usage: undefined,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
supportsResume() {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
supportsMaxTurns() {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
resumeFlag(sessionId, resuming) {
|
|
112
|
-
if (!sessionId)
|
|
113
|
-
return '';
|
|
114
|
-
return resuming ? buildResumeFlag(sessionId) : buildSessionIdFlag(sessionId);
|
|
115
|
-
}
|
|
116
|
-
modelTiers() {
|
|
117
|
-
return {
|
|
118
|
-
cheap: 'gemini-3.5-flash-lite',
|
|
119
|
-
standard: 'gemini-3.5-flash',
|
|
120
|
-
premium: 'gemini-3.1-pro-preview',
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
modelForTier(tier) {
|
|
124
|
-
if (tier === 'cheap')
|
|
125
|
-
return 'gemini-3.5-flash-lite';
|
|
126
|
-
if (tier === 'premium')
|
|
127
|
-
return 'gemini-3.1-pro-preview';
|
|
128
|
-
return 'gemini-3.5-flash';
|
|
129
|
-
}
|
|
130
|
-
modelFlag(model) {
|
|
131
|
-
return `--model "${escapeDoubleQuoted(model)}"`;
|
|
132
|
-
}
|
|
133
|
-
classifyError(output) {
|
|
134
|
-
const lower = output.toLowerCase();
|
|
135
|
-
if (/not logged in|unauthorized|\b401\b|authentication_error|expired.*token|permission_error|invalid.*api.*key/i.test(lower)) {
|
|
136
|
-
return 'auth';
|
|
137
|
-
}
|
|
138
|
-
if (/\b500\b|\b502\b|\b503\b|internal server error|api_error/i.test(lower)) {
|
|
139
|
-
return 'server';
|
|
140
|
-
}
|
|
141
|
-
if (/\b429\b|\b529\b|overloaded|rate limit|quota/i.test(lower)) {
|
|
142
|
-
return 'overloaded';
|
|
143
|
-
}
|
|
144
|
-
return 'unknown';
|
|
145
|
-
}
|
|
146
|
-
permissionConfigPaths() {
|
|
147
|
-
return ['.gemini/settings.json', '.gemini/policies/fleet.toml'];
|
|
148
|
-
}
|
|
149
|
-
composePermissionConfig(role, allow = []) {
|
|
150
|
-
// settings.json: merge mode into existing content — do not overwrite.
|
|
151
|
-
// mcpServers: {} disables all MCP servers (overrides global registration of apra-fleet).
|
|
152
|
-
// Note: caller is responsible for reading/merging with existing content to preserve oauth-personal and other user settings.
|
|
153
|
-
const mode = role === 'doer' ? 'auto_edit' : 'default';
|
|
154
|
-
const settings = { mode, mcpServers: {} };
|
|
155
|
-
// fleet.toml: policy rules
|
|
156
|
-
let toml = `[policy]\nmode = "${mode}"\ndescription = "Fleet ${role} permissions"\n`;
|
|
157
|
-
if (allow.length > 0) {
|
|
158
|
-
const toolList = allow.map(p => ` "${p}"`).join(',\n');
|
|
159
|
-
toml += `\n[policy.tools]\nallow = [\n${toolList}\n]\n`;
|
|
160
|
-
}
|
|
161
|
-
return [settings, toml];
|
|
162
|
-
}
|
|
163
|
-
supportsOAuthCopy() {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
supportsApiKey() {
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
oauthCredentialFiles() {
|
|
170
|
-
return [
|
|
171
|
-
{ localPath: '~/.gemini/oauth_creds.json', remotePath: '~/.gemini/oauth_creds.json' },
|
|
172
|
-
{ localPath: '~/.gemini/google_accounts.json', remotePath: '~/.gemini/google_accounts.json' },
|
|
173
|
-
];
|
|
174
|
-
}
|
|
175
|
-
oauthSettingsMerge() {
|
|
176
|
-
return { security: { auth: { selectedType: 'oauth-personal' } } };
|
|
177
|
-
}
|
|
178
|
-
oauthEnvVarsToUnset() {
|
|
179
|
-
return ['GEMINI_API_KEY'];
|
|
180
|
-
}
|
|
181
|
-
authEnvVarForToken(_token) {
|
|
182
|
-
return this.authEnvVar;
|
|
183
|
-
}
|
|
184
|
-
wrapWindowsPrompt(setupCmd, filePath, argList, _sessionId, _model) {
|
|
185
|
-
// Gemini on Windows needs direct shell execution to resolve .cmd script wrappers reliably.
|
|
186
|
-
// We emit the current shell PID immediately to satisfy fleet's lifecycle tracking.
|
|
187
|
-
return `${setupCmd}Write-Output "FLEET_PID:$pid"; ${filePath} ${argList}`;
|
|
188
|
-
}
|
|
189
|
-
jsonOutputFlag() {
|
|
190
|
-
return '--output-format json';
|
|
191
|
-
}
|
|
192
|
-
headlessInvocation(promptLiteral) {
|
|
193
|
-
return `--skip-trust -p "${promptLiteral}"`;
|
|
194
|
-
}
|
|
195
|
-
async ensureWorkspaceTrusted(_workFolder, _execCommand, _agentOs) {
|
|
196
|
-
// apra-fleet-eft.40 provider trust matrix: Gemini has a workspace-trust gate too, but
|
|
197
|
-
// it is ALREADY handled per-dispatch via --skip-trust in headlessInvocation() above --
|
|
198
|
-
// no settings-file seeding is needed or correct here.
|
|
199
|
-
return { seeded: false, detail: 'gemini: trust gate already bypassed per-dispatch via --skip-trust' };
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=gemini.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../src/providers/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,oBAAoB;IAClC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,C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sFAAsF;QACtF,uFAAuF;QACvF,sDAAsD;QACtD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mEAAmE,EAAE,CAAC;IACxG,CAAC;CACF"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
# Coach Role: Just-in-Time Error Resolution (design note)
|
|
2
|
-
|
|
3
|
-
Status: IN DESIGN (user idea 2026-07-20; scope and consent model refined
|
|
4
|
-
same day; explicitly NOT being operationalized yet -- "let's design more
|
|
5
|
-
before we operationalize"). Recorded here so the design survives context
|
|
6
|
-
loss. Update in place as design decisions land.
|
|
7
|
-
|
|
8
|
-
## The idea (user's own framing)
|
|
9
|
-
|
|
10
|
-
Insert a "coach" role INSIDE the auto-sprint workflow -- an LLM agent that
|
|
11
|
-
knows the fleet -> workflow -> auto-sprint technology stack and can address
|
|
12
|
-
classes of errors that are UNFORESEEN by the deterministic engine, just in
|
|
13
|
-
time. Every time it intervenes it (a) collects the important aspects of the
|
|
14
|
-
sprint context and (b) produces a bug report describing the problem AND how
|
|
15
|
-
it was resolved -- feeding field telemetry, future releases, and giving
|
|
16
|
-
users a way to progress instead of wedging. It institutionalizes, inside
|
|
17
|
-
the workflow, the stabilization-observer role a human+agent pair played
|
|
18
|
-
from outside during the eft dogfood runs.
|
|
19
|
-
|
|
20
|
-
## Scope (REFINED): any red state, not just sync failures
|
|
21
|
-
|
|
22
|
-
The coach's jurisdiction is ANY event that leaves the sprint in a red
|
|
23
|
-
state, strictly AFTER existing deterministic handling has been exhausted.
|
|
24
|
-
The error-handling hierarchy is three layers, in order:
|
|
25
|
-
|
|
26
|
-
1. **Typed handlers and ladders (deterministic, free).** errors.mjs typed
|
|
27
|
-
errors, turn-exhaustion resume ladders, Tier-2 conflict resolution,
|
|
28
|
-
busy-lock retries. The coach NEVER preempts these.
|
|
29
|
-
2. **Coach (JIT judgment, tokens).** Invoked only when layer 1 has no
|
|
30
|
-
match or its handling failed -- the unforeseen complement.
|
|
31
|
-
3. **Fail loudly (existing behavior).** If the coach cannot resolve (or
|
|
32
|
-
its per-class/per-run caps are hit), the normal failure path proceeds
|
|
33
|
-
unchanged. The coach never suppresses a failure it could not fix.
|
|
34
|
-
|
|
35
|
-
Red-state interception points (initial taxonomy, extend as discovered):
|
|
36
|
-
- Streak failure after doer dispatch/resume ladder exhaustion
|
|
37
|
-
- Dispatch errors with unrecognized reason (api_error, empty_response,
|
|
38
|
-
transport failures) after existing retries
|
|
39
|
-
- Sync bracket failures (G-push/G-pull/D-push/D-pull) after Tier-2
|
|
40
|
-
- Phase-level failures: deploy failed, integ runner crashed, harvester
|
|
41
|
-
failed
|
|
42
|
-
- Reviewer/planner contract violations after their built-in retry
|
|
43
|
-
- Stall detection firing; state corruption detected; member unreachable;
|
|
44
|
-
auth expiry mid-run
|
|
45
|
-
- Workflow-level abort paths (as evidence collector even when
|
|
46
|
-
unresolvable)
|
|
47
|
-
|
|
48
|
-
## Guardrails: coach.md carries them ALL (REFINED)
|
|
49
|
-
|
|
50
|
-
The contract file (agents/coach.md, upstream in apra-pm) is the single
|
|
51
|
-
home of every guardrail -- not scattered through engine code -- so the
|
|
52
|
-
guardrails ship with the role definition, version together, and appear in
|
|
53
|
-
every dispatch. Engine-side caps are enforcement backstops of the same
|
|
54
|
-
rules, never the only statement of them.
|
|
55
|
-
|
|
56
|
-
Guardrail set (all load-bearing):
|
|
57
|
-
- ACTION ALLOWLIST only: stash/commit WIP to a rescue branch, clear a
|
|
58
|
-
leaked lock, retry a push, restart a dead session, re-run an idempotent
|
|
59
|
-
step. Hard prohibitions: never force-push, never delete branches/files,
|
|
60
|
-
never mutate bead verdicts or close beads, never edit code content,
|
|
61
|
-
never act outside the member's working tree, never install software.
|
|
62
|
-
- SINGLE-SHOT: one intervention attempt per red event; then report and
|
|
63
|
-
fall back. The coach is never coached (no recursion).
|
|
64
|
-
- SAME-CLASS-TWICE POLICY: an error class (by fingerprint) may be coached
|
|
65
|
-
at most N times per run (N=2 initial); after that it must fail loudly
|
|
66
|
-
and demand an engine fix. Healing is a bridge, never a home.
|
|
67
|
-
- EVERY INTERVENTION FILES A REPORT -- no silent saves. Interventions are
|
|
68
|
-
first-class events in sprint state and appear in final-review evidence
|
|
69
|
-
(a PASS with 12 coach saves reads differently from a clean PASS).
|
|
70
|
-
- TARGET-AGNOSTIC: the coach knows the fleet/workflow/auto-sprint STACK,
|
|
71
|
-
never the target repo's specifics (product-vs-dogfood rule).
|
|
72
|
-
- TOKEN DISCIPLINE: invoked only at layer 2 (rare by construction);
|
|
73
|
-
per-run invocation cap; premium tier acceptable given rarity.
|
|
74
|
-
- REPRODUCIBILITY: interventions recorded in replayable form; mock/golden
|
|
75
|
-
tests stub coach outcomes deterministically.
|
|
76
|
-
|
|
77
|
-
## Bug reports and consent (REFINED): sanitize, then ask -- or standing consent
|
|
78
|
-
|
|
79
|
-
The coach always produces a SANITIZED, ANONYMIZED report locally. Whether
|
|
80
|
-
it leaves the machine is a separate, consent-gated step:
|
|
81
|
-
|
|
82
|
-
- Modes (fleet config, e.g. coach.telemetry): "never" | "ask" (default) |
|
|
83
|
-
"always".
|
|
84
|
-
- **ask (default)**: report saved under sprint-logs/coach-reports/; the
|
|
85
|
-
user is asked to consent AFTER THE FACT -- at sprint end (PR body /
|
|
86
|
-
dashboard / CLI summary), with the exact sanitized text shown. The
|
|
87
|
-
zero-auth mechanism: a pre-filled GitHub new-issue URL
|
|
88
|
-
(github.com/Apra-Labs/apra-fleet/issues/new?title=...&body=...) -- one
|
|
89
|
-
click, human-in-the-loop by construction, nothing uploads silently,
|
|
90
|
-
no token handling at all.
|
|
91
|
-
- **always (standing consent, mainly internal/trusting users)**: approved
|
|
92
|
-
once and for all via explicit config; reports auto-filed via gh CLI
|
|
93
|
-
using the user's own gh auth, or a scoped token stored in the fleet
|
|
94
|
-
credential store (referenced as a {{secure.*}} handle, never plaintext).
|
|
95
|
-
Standing consent is per-install, revocable, and recorded in the report
|
|
96
|
-
footer ("filed under standing consent").
|
|
97
|
-
- **never**: local reports only; nothing asks, nothing uploads.
|
|
98
|
-
|
|
99
|
-
Sanitization spec (applies BEFORE the report is even saved locally):
|
|
100
|
-
- Absolute paths -> stable placeholders (<work-folder>/..., <home>/...)
|
|
101
|
-
- Hostnames, usernames, IPs, emails -> redacted tokens
|
|
102
|
-
- Anything matching secret patterns (keys, tokens, {{secure.*}} values,
|
|
103
|
-
env dumps) -> stripped outright, never placeholdered
|
|
104
|
-
- Target-repo identifiers (repo name, branch names, bead titles) ->
|
|
105
|
-
optional redaction tier: internal users may keep them; the default
|
|
106
|
-
anonymizes to <target-repo>, <sprint-branch>
|
|
107
|
-
- Code snippets: not included by default; error text is truncated to the
|
|
108
|
-
minimal reproducing lines
|
|
109
|
-
- A stable ANONYMOUS install id (random UUID, no derivation from machine
|
|
110
|
-
identity) enables cross-report dedup without identifying the user
|
|
111
|
-
|
|
112
|
-
Report content (schema sketch):
|
|
113
|
-
- fingerprint: normalized error-class hash (for dedup and the
|
|
114
|
-
same-class-twice cap)
|
|
115
|
-
- context: engine version, OS, provider, phase, role being dispatched
|
|
116
|
-
- narrative: what failed, diagnosis, actionsTaken[], resolved: bool,
|
|
117
|
-
time lost
|
|
118
|
-
- issueDraft: { title, redactedBody, labels: [coach-report, <class>] }
|
|
119
|
-
- Dedup behavior upstream: same fingerprint appends an occurrence
|
|
120
|
-
comment to the existing issue rather than opening a duplicate.
|
|
121
|
-
|
|
122
|
-
## Implementation sketch (unchanged mechanics, wider trigger)
|
|
123
|
-
|
|
124
|
-
- Contract: agents/coach.md upstream in apra-pm (UPSTREAM DEPENDENCY like
|
|
125
|
-
eft.11: needs an apra-pm PR + submodule pointer bump). Inputs: error
|
|
126
|
-
text, phase, member, recent command history, sprint-state excerpt.
|
|
127
|
-
Tools: Read + tightly-scoped Bash. Output: the report schema above.
|
|
128
|
-
- Engine: a single coachOnRedState() boundary called from every red-state
|
|
129
|
-
interception point listed above (one choke point, not N copies), after
|
|
130
|
-
layer-1 handling. Interventions ledger in sprint state; caps enforced
|
|
131
|
-
engine-side as backstop; telemetry mode read from fleet config.
|
|
132
|
-
- Relation to the outside stabilization loop: coach handles in-run JIT
|
|
133
|
-
recovery; the outside loop remains for engine-level fixes; coach
|
|
134
|
-
reports feed both.
|
|
135
|
-
|
|
136
|
-
## Open design questions (to resolve before operationalizing)
|
|
137
|
-
|
|
138
|
-
1. Consent surface for "ask" mode: sprint-end CLI summary, PR body
|
|
139
|
-
section, dashboard card, or all three? (Recommend: PR body section +
|
|
140
|
-
dashboard card; the PR is where humans already look.)
|
|
141
|
-
2. Does the coach run on the ORCHESTRATOR member or the affected member?
|
|
142
|
-
(Recommend: orchestrator-side dispatch that may execute allowlisted
|
|
143
|
-
commands ON the affected member -- keeps one contract, avoids
|
|
144
|
-
provisioning coach agents everywhere.)
|
|
145
|
-
3. N values: per-class cap (initial 2) and per-run cap (initial 5) --
|
|
146
|
-
validate against real red-state frequency from run logs.
|
|
147
|
-
4. Should coach reports also feed a LOCAL knowledge base consulted on
|
|
148
|
-
later invocations within the same install (self-priming), or is that
|
|
149
|
-
scope creep for v1? (Bias: v2.)
|
|
150
|
-
5. Fingerprint algorithm: normalize paths/ids out of the error text, hash
|
|
151
|
-
the remainder -- needs a worked spec with collision examples.
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Dolt conflict recovery: Tier 2 runbook (apra-fleet-eft.9.6)
|
|
2
|
-
|
|
3
|
-
> **Wiring status (apra-fleet-vkc.1): LIVE.** The Path A -> Path B -> Tier 2
|
|
4
|
-
> recovery ladder described here is no longer test-only. `dolt-recovery-tier2.mjs`
|
|
5
|
-
> exports `buildDoltRecoveryLadder()`, which `dolt-sync.mjs`'s `doltPushAfter()`
|
|
6
|
-
> invokes at its divergence terminal and which `runner.js`'s post-dispatch sync
|
|
7
|
-
> bracket (`syncMemberAfterOrdered`) threads in, so a wedged clone at a real
|
|
8
|
-
> D-push attempts this ladder before surfacing `BEADS_SYNC_CONFLICT`. Path A's
|
|
9
|
-
> resolve-in-place step still requires an injected dolt sql-server runtime;
|
|
10
|
-
> until one is wired into `runner.js`, Path A is reached and cleanly self-defers
|
|
11
|
-
> to Path B (discard-and-re-bootstrap) in production.
|
|
12
|
-
|
|
13
|
-
This is the runbook a REAL agent receives when it is dispatched to resolve a
|
|
14
|
-
wedged beads (dolt) clone that the scripted recovery ladder could not close on
|
|
15
|
-
its own. It is the dolt counterpart of the git conflict ladder's Tier 2
|
|
16
|
-
runbook (`conflict-ladder.mjs`'s `buildConflictResolutionRunbookPrompt`) -- see
|
|
17
|
-
that module's header comment for the git version of the same posture.
|
|
18
|
-
|
|
19
|
-
## When to use this runbook (vs the operator runbook)
|
|
20
|
-
|
|
21
|
-
Use **this** runbook when: a fleet MEMBER's clone is wedged during an automated
|
|
22
|
-
sprint, a human operator at a terminal cannot resolve it, and an agent has been
|
|
23
|
-
dispatched (by `dolt-recovery-tier2.mjs`) as the last-resort escalation after
|
|
24
|
-
the scripted Path A/Path B recovery ladder both failed.
|
|
25
|
-
|
|
26
|
-
Use [the operator runbook](../../../docs/dolt-operator-conflict-runbook.md)
|
|
27
|
-
instead when: you are a human operator with direct terminal/`dolt` CLI access
|
|
28
|
-
to your own local beads clone, and `bd dolt pull` reported a merge conflict.
|
|
29
|
-
That is a different actor (you at a terminal, not a dispatched agent), a
|
|
30
|
-
different clone (your own, not a fleet member's), and a different entry point
|
|
31
|
-
(manual resolution, not automated escalation).
|
|
32
|
-
|
|
33
|
-
See also: the operator runbook links back here for the "I am a dispatched agent,
|
|
34
|
-
not a human at a terminal" case.
|
|
35
|
-
|
|
36
|
-
## Script-first posture: when this is (and is not) dispatched
|
|
37
|
-
|
|
38
|
-
The dolt sync discipline (Plan Part 3.3/3.4, apra-fleet-eft.9) is
|
|
39
|
-
script-first: two scripted recovery paths run with **zero** agent dispatch
|
|
40
|
-
before Tier 2 is ever considered:
|
|
41
|
-
|
|
42
|
-
1. **Path A** (`dolt-recovery.mjs`, apra-fleet-eft.9.4) -- scripted,
|
|
43
|
-
resolve-in-place recovery for a plain single-row conflict in an
|
|
44
|
-
allowlisted table (`issues` by default), gated behind two deterministic
|
|
45
|
-
checks (conflicted table(s) all allowlisted; exactly one conflicted row).
|
|
46
|
-
2. **Path B** (`dolt-recovery-path-b.mjs`, apra-fleet-eft.9.5) -- the
|
|
47
|
-
fallback for whatever Path A's gates reject (a multi-row conflict, a
|
|
48
|
-
conflict outside the allowlist, or a genuine operational failure that
|
|
49
|
-
makes resolve-in-place unsafe): discard the wedged clone's local dolt
|
|
50
|
-
state and re-bootstrap fresh from the shared remote, replaying back the
|
|
51
|
-
one pending mutation that mattered.
|
|
52
|
-
|
|
53
|
-
Tier 2 (this runbook, dispatched by `dolt-recovery-tier2.mjs`'s
|
|
54
|
-
`recoverDoltConflict()`) is the escalation of LAST resort: it is dispatched
|
|
55
|
-
**only** when
|
|
56
|
-
|
|
57
|
-
- Path A's deterministic gate rejected the conflict shape, **and**
|
|
58
|
-
- Path B was also attempted and itself failed (a scripted step -- most
|
|
59
|
-
commonly `bd bootstrap` or the mutation replay -- returned output that is
|
|
60
|
-
not one of the specific, already-classified recognized failure/gotcha
|
|
61
|
-
patterns).
|
|
62
|
-
|
|
63
|
-
The recovery procedure must never proceed blind past an output it does not
|
|
64
|
-
recognize. Every escalation records the wedged state (see below) before
|
|
65
|
-
dispatch -- there is no silent "try something and hope" step anywhere in this
|
|
66
|
-
ladder.
|
|
67
|
-
|
|
68
|
-
## The wedged state you are handed
|
|
69
|
-
|
|
70
|
-
Every Tier 2 dispatch is armed with a recorded **wedged state** snapshot,
|
|
71
|
-
captured immediately before dispatch, with these fields:
|
|
72
|
-
|
|
73
|
-
- `member` -- which fleet member/clone is wedged.
|
|
74
|
-
- `clonePath` -- the local `.beads` embedded dolt data dir this recovery was
|
|
75
|
-
operating against (default `.beads/embeddeddolt`).
|
|
76
|
-
- `conflictShape` -- the last `assessConflictGates()` result Path A computed
|
|
77
|
-
(which table(s) conflicted, how many conflicting rows, which gate(s)
|
|
78
|
-
failed), or `null` if Path A never got far enough to compute one.
|
|
79
|
-
- `lastOutput` -- the raw error/output text of the last scripted step that
|
|
80
|
-
failed (Path B's failure if Path B ran, otherwise Path A's).
|
|
81
|
-
- `stage` -- which stage of the ladder produced this wedged state (e.g.
|
|
82
|
-
`path-b-exhausted`).
|
|
83
|
-
- `recordedAt` -- an ISO timestamp of when the state was captured.
|
|
84
|
-
|
|
85
|
-
Do not guess past what this snapshot tells you -- if it is incomplete or
|
|
86
|
-
ambiguous, say so in your report rather than inventing what you think the
|
|
87
|
-
conflict must have been.
|
|
88
|
-
|
|
89
|
-
## Steps to follow, in order
|
|
90
|
-
|
|
91
|
-
1. Read the wedged state above in full. Confirm you understand `clonePath`,
|
|
92
|
-
`conflictShape`, and `lastOutput` before touching anything.
|
|
93
|
-
2. Run `bd dolt status` (or, if unavailable, inspect `.beads/metadata.json`
|
|
94
|
-
and the embedded dolt data dir directly) to confirm the clone's actual
|
|
95
|
-
current state matches what the wedged-state snapshot describes. If it does
|
|
96
|
-
not (e.g. someone already fixed it), say so and stop -- do not "helpfully"
|
|
97
|
-
redo work that already happened.
|
|
98
|
-
3. If a merge is genuinely still open and conflicted, use `dolt sql-server`
|
|
99
|
-
against the SAME embedded data dir referenced by `clonePath` (see Path A's
|
|
100
|
-
own module doc for the exact server-start / `dolt_allow_commit_conflicts`
|
|
101
|
-
/ `DOLT_MERGE` / `dolt_conflicts` sequence) to inspect every conflicting
|
|
102
|
-
row with real judgment -- not a blind `--ours`/`--theirs` rule. Understand
|
|
103
|
-
BOTH sides of each conflicting row before deciding how to resolve it.
|
|
104
|
-
4. Resolve each conflicting row with `CALL DOLT_CONFLICTS_RESOLVE(...)`
|
|
105
|
-
(table-name arg required) and commit with `CALL DOLT_COMMIT(...)`. Verify
|
|
106
|
-
with `SELECT * FROM dolt_conflicts` that zero rows remain before moving on.
|
|
107
|
-
5. Confirm zero data loss: `SELECT * FROM dolt_log` must show commits from
|
|
108
|
-
BOTH sides of the original conflict.
|
|
109
|
-
6. Flip `.beads/metadata.json` back to `dolt_mode: "embedded"` and stop the
|
|
110
|
-
ephemeral sql-server -- exactly as Path A's own teardown does, and
|
|
111
|
-
regardless of whether you succeeded or not (reversibility always).
|
|
112
|
-
7. `bd dolt pull` then `bd dolt push` to republish the reconciled clone.
|
|
113
|
-
Confirm the push actually succeeds -- your own belief that you fixed it is
|
|
114
|
-
never sufficient; a mechanical re-verification (a clean `bd dolt status`
|
|
115
|
-
and a genuinely successful push) is what decides success, the same
|
|
116
|
-
posture as the git ladder's Tier 2 re-verification in
|
|
117
|
-
`runner.js`'s `syncMemberAfter`.
|
|
118
|
-
8. If, after this, the clone is still wedged or you are not confident the
|
|
119
|
-
conflict was resolved correctly, do **not** force a push or discard data
|
|
120
|
-
to make the error go away. Report exactly what you observed (the
|
|
121
|
-
conflicting row(s), what you tried, and why it did not resolve) so a
|
|
122
|
-
human can take over -- silently discarding real work to unblock a sprint
|
|
123
|
-
is worse than staying blocked.
|
|
124
|
-
|
|
125
|
-
Do not run any `bd` beads-content command unrelated to this recovery (no
|
|
126
|
-
closing/reopening beads) -- this is a pure dolt-clone-recovery dispatch, not a
|
|
127
|
-
development streak.
|