@apralabs/apra-fleet 0.4.1 → 0.4.3
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 +53 -12
- package/dist/agents/backlog-groomer.md +42 -21
- package/dist/agents/ci-watcher.md +14 -0
- package/dist/agents/deployer.md +59 -46
- package/dist/agents/doer.md +157 -134
- package/dist/agents/harvester.md +31 -32
- package/dist/agents/integ-test-runner.md +92 -113
- package/dist/agents/kb-reconciler.md +40 -42
- package/dist/agents/plan-reviewer.md +139 -63
- package/dist/agents/planner.md +176 -100
- package/dist/agents/regression-test-runner.md +77 -81
- package/dist/agents/reviewer.md +69 -85
- package/dist/agents/schemas/integ-test-runner-output.json +1 -1
- package/dist/agents/schemas/plan-reviewer-output.json +37 -0
- package/dist/agents/schemas/regression-test-runner-output.json +4 -17
- package/dist/cli/agent-transform.d.ts +83 -2
- package/dist/cli/agent-transform.d.ts.map +1 -1
- package/dist/cli/agent-transform.js +266 -21
- package/dist/cli/agent-transform.js.map +1 -1
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +29 -11
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +7 -5
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +44 -43
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +33 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +294 -61
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/kb-directives.d.ts.map +1 -1
- package/dist/cli/kb-directives.js +2 -1
- package/dist/cli/kb-directives.js.map +1 -1
- package/dist/cli/register-member.d.ts.map +1 -1
- package/dist/cli/register-member.js +7 -3
- package/dist/cli/register-member.js.map +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 +5 -3
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/watch.d.ts +26 -3
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +41 -9
- package/dist/cli/watch.js.map +1 -1
- package/dist/commands/kb-server.d.ts +3 -0
- package/dist/commands/kb-server.d.ts.map +1 -1
- package/dist/commands/kb-server.js +43 -3
- package/dist/commands/kb-server.js.map +1 -1
- package/dist/index.js +3 -3
- 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 +6 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +36 -3
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +68 -2
- 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 +98 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -0
- package/dist/os/windows-gitbash.js +259 -0
- package/dist/os/windows-gitbash.js.map +1 -0
- package/dist/os/windows.d.ts +6 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +73 -8
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +118 -8
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +580 -55
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +83 -4
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +365 -12
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +7 -4
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +24 -4
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +7 -4
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +27 -4
- package/dist/providers/copilot.js.map +1 -1
- 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 +7 -4
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +22 -4
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +6 -3
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +27 -4
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +215 -11
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +58 -2
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.js +2 -2
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/agy-project.d.ts +102 -0
- package/dist/services/agy-project.d.ts.map +1 -0
- package/dist/services/agy-project.js +356 -0
- package/dist/services/agy-project.js.map +1 -0
- package/dist/services/auth-socket.js +4 -4
- package/dist/services/auth-web.js +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 +33 -4
- package/dist/services/cloud/lifecycle.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 +47 -10
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/exit-drain.d.ts +44 -0
- package/dist/services/exit-drain.d.ts.map +1 -0
- package/dist/services/exit-drain.js +52 -0
- package/dist/services/exit-drain.js.map +1 -0
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +32 -4
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/http-transport.d.ts +1 -0
- package/dist/services/http-transport.d.ts.map +1 -1
- package/dist/services/http-transport.js +48 -1
- package/dist/services/http-transport.js.map +1 -1
- package/dist/services/knowledge/kb-config.d.ts +42 -0
- package/dist/services/knowledge/kb-config.d.ts.map +1 -0
- package/dist/services/knowledge/kb-config.js +54 -0
- package/dist/services/knowledge/kb-config.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +7 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -1
- package/dist/services/knowledge/kb-providers.js +191 -17
- package/dist/services/knowledge/kb-providers.js.map +1 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts +32 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +1 -0
- package/dist/services/knowledge/require-sqlite-project.js +38 -0
- package/dist/services/knowledge/require-sqlite-project.js.map +1 -0
- package/dist/services/member-home.d.ts +1 -1
- package/dist/services/member-home.d.ts.map +1 -1
- package/dist/services/member-home.js +15 -12
- package/dist/services/member-home.js.map +1 -1
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +7 -8
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/orphan-recovery.d.ts +6 -3
- package/dist/services/orphan-recovery.d.ts.map +1 -1
- package/dist/services/orphan-recovery.js +17 -14
- package/dist/services/orphan-recovery.js.map +1 -1
- package/dist/services/preflight-check.js +2 -2
- package/dist/services/preflight-check.js.map +1 -1
- package/dist/services/secret-token.d.ts +38 -0
- package/dist/services/secret-token.d.ts.map +1 -0
- package/dist/services/secret-token.js +51 -0
- package/dist/services/secret-token.js.map +1 -0
- package/dist/services/service-manager/types.d.ts +3 -1
- package/dist/services/service-manager/types.d.ts.map +1 -1
- package/dist/services/service-manager/windows.d.ts +14 -2
- package/dist/services/service-manager/windows.d.ts.map +1 -1
- package/dist/services/service-manager/windows.js +65 -7
- package/dist/services/service-manager/windows.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/services/ssh.js +60 -4
- 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/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +26 -15
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +53 -4
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +212 -34
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +35 -42
- 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 +119 -8
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/substitution-engine.js +2 -2
- package/dist/services/substitution-engine.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +5 -3
- 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 +67 -2
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +281 -15
- 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 +24 -0
- 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/skills/fleet-sprint-cli/SKILL.md +20 -1
- package/dist/skills/pm/SKILL.md +1 -2
- package/dist/skills/pm/cost.md +0 -4
- package/dist/skills/pm/fleet-addendum.md +2 -3
- package/dist/tools/check-status.d.ts +7 -4
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +5 -3
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/cloud-control.js +2 -2
- package/dist/tools/cloud-control.js.map +1 -1
- package/dist/tools/compose-permissions.d.ts +6 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +211 -50
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/credential-store-set.js +1 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +56 -29
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +15 -2
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +1214 -873
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/kb-capture.d.ts +2 -2
- package/dist/tools/kb-capture.d.ts.map +1 -1
- package/dist/tools/kb-capture.js +29 -5
- package/dist/tools/kb-capture.js.map +1 -1
- package/dist/tools/kb-export.d.ts +2 -2
- package/dist/tools/kb-export.d.ts.map +1 -1
- package/dist/tools/kb-export.js +3 -28
- package/dist/tools/kb-export.js.map +1 -1
- package/dist/tools/kb-feedback.d.ts.map +1 -1
- package/dist/tools/kb-feedback.js +3 -1
- package/dist/tools/kb-feedback.js.map +1 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -1
- package/dist/tools/kb-freshness-sweep.js +3 -1
- package/dist/tools/kb-freshness-sweep.js.map +1 -1
- package/dist/tools/kb-import.d.ts.map +1 -1
- package/dist/tools/kb-import.js +2 -1
- package/dist/tools/kb-import.js.map +1 -1
- package/dist/tools/kb-list.d.ts.map +1 -1
- package/dist/tools/kb-list.js +3 -1
- package/dist/tools/kb-list.js.map +1 -1
- package/dist/tools/kb-query.d.ts +2 -2
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -1
- package/dist/tools/kb-reconcile-prefilter.js +3 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -1
- package/dist/tools/kb-resolve-contradiction.js +3 -1
- package/dist/tools/kb-resolve-contradiction.js.map +1 -1
- package/dist/tools/kb-setup.d.ts.map +1 -1
- package/dist/tools/kb-setup.js +125 -20
- package/dist/tools/kb-setup.js.map +1 -1
- package/dist/tools/kb-stats.d.ts.map +1 -1
- package/dist/tools/kb-stats.js +64 -43
- package/dist/tools/kb-stats.js.map +1 -1
- package/dist/tools/list-members.d.ts +2 -2
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +7 -2
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts +2 -2
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +22 -3
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts +58 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +71 -18
- 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 +17 -2
- package/dist/tools/monitor-task.js.map +1 -1
- package/dist/tools/provision-auth.d.ts +80 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +147 -59
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +96 -3
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +254 -88
- 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 +141 -16
- 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 +29 -4
- package/dist/tools/remove-member.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 +2 -2
- package/dist/tools/setup-git-app.d.ts.map +1 -1
- package/dist/tools/setup-git-app.js +11 -7
- package/dist/tools/setup-git-app.js.map +1 -1
- package/dist/tools/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +2 -1
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/shutdown-server.d.ts +2 -0
- package/dist/tools/shutdown-server.d.ts.map +1 -1
- package/dist/tools/shutdown-server.js +23 -1
- package/dist/tools/shutdown-server.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 +61 -12
- package/dist/tools/update-member.js.map +1 -1
- package/dist/tools/vcs-credential-exec.d.ts +127 -0
- package/dist/tools/vcs-credential-exec.d.ts.map +1 -0
- package/dist/tools/vcs-credential-exec.js +197 -0
- package/dist/tools/vcs-credential-exec.js.map +1 -0
- package/dist/types.d.ts +24 -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/log-helpers.d.ts.map +1 -1
- package/dist/utils/log-helpers.js +2 -2
- package/dist/utils/log-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.d.ts.map +1 -1
- package/dist/utils/prompt-errors.js +7 -1
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/shell-escape.d.ts +16 -0
- package/dist/utils/shell-escape.d.ts.map +1 -1
- package/dist/utils/shell-escape.js +22 -2
- package/dist/utils/shell-escape.js.map +1 -1
- package/dist/utils/vcs-provider-detect.d.ts +65 -0
- package/dist/utils/vcs-provider-detect.d.ts.map +1 -0
- package/dist/utils/vcs-provider-detect.js +109 -0
- package/dist/utils/vcs-provider-detect.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts +20 -17
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +91 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +180 -32
- package/package.json +7 -5
- package/packages/apra-fleet-client/src/client/api.mjs +403 -12
- package/packages/apra-fleet-client/src/client/errors.mjs +6 -2
- package/packages/apra-fleet-se/apra-pm/agents/_shared/GRAPH-SEMANTICS.md +10 -2
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +42 -21
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +14 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +59 -46
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +157 -134
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +31 -32
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +92 -113
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +40 -42
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +139 -63
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +176 -100
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +77 -81
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +69 -85
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json +37 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +1 -2
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -4
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +2 -3
- package/packages/apra-fleet-se/bin/cli.mjs +280 -3
- package/packages/apra-fleet-se/bin/serve.mjs +114 -5
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +481 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +491 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +282 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +208 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +638 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +301 -0
- package/packages/apra-fleet-se/fleet-sprint/branch-ensure.mjs +96 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +8 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +199 -34
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +516 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +184 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +1121 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-safety-guard.mjs +216 -4
- 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 +10 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +285 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +3 -3
- package/packages/apra-fleet-se/fleet-sprint/docs/run-sprint-cycle-prelude-decision.md +215 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +12 -12
- package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
- package/packages/apra-fleet-se/fleet-sprint/dolt-literal-guard.mjs +56 -1
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +275 -99
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +1054 -39
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +308 -0
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +501 -0
- package/packages/apra-fleet-se/fleet-sprint/fatal-diagnostics.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/full-db-fetch-guard.mjs +102 -0
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +556 -0
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +495 -0
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +564 -0
- package/packages/apra-fleet-se/fleet-sprint/inline-ladder-guard.mjs +216 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +728 -0
- package/packages/apra-fleet-se/fleet-sprint/mcp-result.mjs +75 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +252 -0
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +581 -0
- package/packages/apra-fleet-se/fleet-sprint/member-target.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/newtask-text.mjs +266 -0
- package/packages/apra-fleet-se/fleet-sprint/parent-notes-staleness.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +136 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +822 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +294 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +403 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +180 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +358 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +390 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +323 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +232 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +174 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +197 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +305 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +559 -0
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +1416 -0
- package/packages/apra-fleet-se/fleet-sprint/round-session.mjs +100 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1672 -9072
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +159 -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/shell-command-guard.mjs +304 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +20 -1
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +21 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +454 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +239 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +163 -0
- package/packages/apra-fleet-se/fleet-sprint/unbracketed-push-guard.mjs +234 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +211 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +1279 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +204 -19
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +707 -12
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +28 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +191 -43
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +333 -6
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +165 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +167 -37
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +559 -0
- package/packages/apra-fleet-se/package.json +1 -1
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +178 -1
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +478 -32
- package/skills/fleet/SKILL.md +27 -16
- package/skills/fleet/auth-azdevops.md +57 -7
- package/skills/fleet/auth-bitbucket.md +5 -5
- package/skills/fleet/auth-github.md +7 -6
- package/skills/fleet/beads-conflict-resolution.md +141 -0
- package/skills/fleet/beads.md +16 -12
- package/skills/fleet/onboarding.md +6 -6
- package/skills/fleet/permissions.md +11 -7
- package/skills/fleet/profiles/node.json +1 -1
- package/skills/fleet/skill-matrix.md +1 -1
- package/skills/fleet/troubleshooting.md +4 -3
- package/version.json +1 -1
- package/dist/providers/gemini.d.ts +0 -52
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -236
- package/dist/providers/gemini.js.map +0 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -23
|
@@ -481,6 +481,86 @@ export function isInfraDispatchFailure(err) {
|
|
|
481
481
|
return INFRA_DISPATCH_REASONS.has(err?.details?.reason);
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
+
// ---------------------------------------------------------------------------
|
|
485
|
+
// apra-fleet-hzeb.4.1 -- usage-limit dispatch classification
|
|
486
|
+
// ---------------------------------------------------------------------------
|
|
487
|
+
//
|
|
488
|
+
// execute_prompt relays a provider's usage-limit signal (e.g. Claude's 429
|
|
489
|
+
// classified via detectUsageLimit) as a structured `details.reason ===
|
|
490
|
+
// 'usage_limit'` on the AgentDispatchError it throws (src/tools/execute-
|
|
491
|
+
// prompt.ts), mirroring the existing `details.reason` classifiers above
|
|
492
|
+
// (isInfraDispatchFailure, isNonRetryableDispatchError). This is the ONLY
|
|
493
|
+
// vocabulary a caller may key on -- NEVER regex on message text, since a
|
|
494
|
+
// usage-limit message is provider-specific prose that can drift or be
|
|
495
|
+
// localized (see isInfraDispatchFailure's own header for the same
|
|
496
|
+
// discipline).
|
|
497
|
+
export const USAGE_LIMIT_DISPATCH_REASON = 'usage_limit';
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* True when a dispatch error is a provider usage-limit hit, keyed off the
|
|
501
|
+
* server's structured `details.reason` -- never on message text.
|
|
502
|
+
* @param {unknown} err
|
|
503
|
+
* @returns {boolean}
|
|
504
|
+
*/
|
|
505
|
+
export function isUsageLimitDispatchError(err) {
|
|
506
|
+
return err?.details?.reason === USAGE_LIMIT_DISPATCH_REASON;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* The provider's usage-limit signal object (see providers/provider.ts's
|
|
511
|
+
* UsageLimitSignal contract) carried on a usage-limit dispatch error, or
|
|
512
|
+
* `null` when the error carries none (e.g. it is not a usage-limit error at
|
|
513
|
+
* all, or a provider that classified the reason but supplied no signal
|
|
514
|
+
* detail).
|
|
515
|
+
* @param {unknown} err
|
|
516
|
+
* @returns {object|null}
|
|
517
|
+
*/
|
|
518
|
+
export function usageLimitOf(err) {
|
|
519
|
+
return err?.details?.usageLimit ?? null;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Thrown by the fleet-sprint usage-limit pause/resume controller
|
|
524
|
+
* (apra-fleet-hzeb.4.2, the follow-up to this task) when a dispatch has been
|
|
525
|
+
* paused and re-probed until its budget (USAGE_LIMIT_MAX_WAIT_S /
|
|
526
|
+
* USAGE_LIMIT_MAX_REPROBES in role-policies.mjs) is exhausted with no
|
|
527
|
+
* successful resume. Registered in isTypedAbortError() (abort.mjs) so a
|
|
528
|
+
* give-up routes through finalizeAbort() / an [ABORTED] PR, exactly like
|
|
529
|
+
* every other unrecoverable sprint-abort class in that curated list -- a
|
|
530
|
+
* member permanently rate-limited past every allowed wait/reprobe is exactly
|
|
531
|
+
* as terminal as a stalled sprint or an unmergeable divergence.
|
|
532
|
+
*
|
|
533
|
+
* @property {string|null} member - the member whose dispatch hit the usage limit
|
|
534
|
+
* @property {string|null} roleLabel - the role/label of the dispatch that was paused
|
|
535
|
+
* @property {number|null} firstHitAt - epoch ms of the first usage-limit hit
|
|
536
|
+
* @property {number|null} lastResumeAt - epoch ms of the provider's last reported resumeAt
|
|
537
|
+
* @property {number} reprobes - how many re-probe attempts were made before giving up
|
|
538
|
+
* @property {number} waitedMs - total wall-clock time spent paused across all reprobes
|
|
539
|
+
*/
|
|
540
|
+
export class UsageLimitWaitExhaustedError extends WorkflowError {
|
|
541
|
+
/**
|
|
542
|
+
* @param {string} message
|
|
543
|
+
* @param {{ member?: string|null, roleLabel?: string|null, firstHitAt?: number|null, lastResumeAt?: number|null, reprobes?: number, waitedMs?: number, details?: object, cause?: unknown }} [opts]
|
|
544
|
+
*/
|
|
545
|
+
constructor(message, opts = {}) {
|
|
546
|
+
const {
|
|
547
|
+
member = null, roleLabel = null, firstHitAt = null, lastResumeAt = null,
|
|
548
|
+
reprobes = 0, waitedMs = 0, details, cause,
|
|
549
|
+
} = opts;
|
|
550
|
+
super(message, {
|
|
551
|
+
code: 'USAGE_LIMIT_WAIT_EXHAUSTED',
|
|
552
|
+
details: { member, roleLabel, firstHitAt, lastResumeAt, reprobes, waitedMs, ...details },
|
|
553
|
+
cause,
|
|
554
|
+
});
|
|
555
|
+
this.member = member;
|
|
556
|
+
this.roleLabel = roleLabel;
|
|
557
|
+
this.firstHitAt = firstHitAt;
|
|
558
|
+
this.lastResumeAt = lastResumeAt;
|
|
559
|
+
this.reprobes = reprobes;
|
|
560
|
+
this.waitedMs = waitedMs;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
484
564
|
// ---------------------------------------------------------------------------
|
|
485
565
|
// apra-fleet-eft.75.2 -- sprint-launch machine-local pidfile mutex
|
|
486
566
|
// ---------------------------------------------------------------------------
|
|
@@ -614,3 +694,231 @@ export class PostDispatchSyncError extends WorkflowError {
|
|
|
614
694
|
export function isPostDispatchSyncFailure(err) {
|
|
615
695
|
return err instanceof PostDispatchSyncError;
|
|
616
696
|
}
|
|
697
|
+
|
|
698
|
+
// ---------------------------------------------------------------------------
|
|
699
|
+
// apra-fleet-p2to.4.2 -- resume could not re-reserve every member
|
|
700
|
+
// ---------------------------------------------------------------------------
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Thrown when a cooperative resume (after a pause released this sprint's member
|
|
704
|
+
* reservations) cannot re-acquire one or more members because another sprint
|
|
705
|
+
* claimed them while this one was paused -- an OWNER-CHECKED re-reserve, so we
|
|
706
|
+
* refuse to silently continue on top of a member some other sprint now owns.
|
|
707
|
+
*
|
|
708
|
+
* The whole point of this error is that it NAMES the unavailable members, so an
|
|
709
|
+
* operator reading the failed resume knows exactly which members to free (or
|
|
710
|
+
* which other sprint to stop) before retrying the resume -- rather than a
|
|
711
|
+
* generic "resume failed" with no actionable detail.
|
|
712
|
+
*
|
|
713
|
+
* @property {string[]} members - the members that could NOT be re-reserved on
|
|
714
|
+
* resume (each already reserved by a different sprint).
|
|
715
|
+
*/
|
|
716
|
+
export class MemberReservationResumeError extends WorkflowError {
|
|
717
|
+
/**
|
|
718
|
+
* @param {string[]} unavailableMembers
|
|
719
|
+
* @param {{ details?: object, cause?: unknown }} [opts]
|
|
720
|
+
*/
|
|
721
|
+
constructor(unavailableMembers = [], opts = {}) {
|
|
722
|
+
const members = Array.isArray(unavailableMembers) ? unavailableMembers : [];
|
|
723
|
+
const { details, cause } = opts;
|
|
724
|
+
super(
|
|
725
|
+
`[Workflow Error] Resume failed: could not re-reserve ${members.length} member(s) ` +
|
|
726
|
+
`released at pause -- ${members.join(', ')} ` +
|
|
727
|
+
`${members.length === 1 ? 'is' : 'are'} now reserved by another sprint. ` +
|
|
728
|
+
`Free ${members.length === 1 ? 'it' : 'them'} (or stop the other sprint) before resuming.`,
|
|
729
|
+
{
|
|
730
|
+
code: 'MEMBER_RESERVATION_RESUME_FAILED',
|
|
731
|
+
details: { members, ...details },
|
|
732
|
+
cause,
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
this.members = members;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// ---------------------------------------------------------------------------
|
|
740
|
+
// apra-fleet-3swo.4.9 -- sync-bracket mutual-exclusion violation
|
|
741
|
+
// ---------------------------------------------------------------------------
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Thrown by git-sync.mjs's createSyncBrackets() when two brackets sharing the
|
|
745
|
+
* same `exclusiveKey` genuinely OVERLAP rather than nest -- i.e. the bracket
|
|
746
|
+
* that opened FIRST closes while a bracket that opened LATER (for the same
|
|
747
|
+
* key) is still open. Proper nesting (LIFO open/close for the same key) never
|
|
748
|
+
* throws this; only a crossing close does, which is precisely the shape a
|
|
749
|
+
* broken bracket pairing (or a regression in the external serialization gate
|
|
750
|
+
* that is supposed to keep code-writing dispatches sequential, e.g. runner.js
|
|
751
|
+
* 's `globalDoerTurn`) would produce. Every OTHER key stays fully
|
|
752
|
+
* independent: two brackets with different `exclusiveKey`s (or no key at all)
|
|
753
|
+
* may overlap in any order and never trigger this -- that is legitimate,
|
|
754
|
+
* relied-upon concurrency (e.g. multiple members' D-pushes serialized by
|
|
755
|
+
* their own dolt push mutex, not by this counter).
|
|
756
|
+
*
|
|
757
|
+
* @property {string} exclusiveKey - the shared key the two brackets collided on.
|
|
758
|
+
* @property {string} closingLabel - the bracket that was closing when the
|
|
759
|
+
* violation was detected.
|
|
760
|
+
* @property {string[]} stillOpenLabels - the other bracket(s) sharing this key
|
|
761
|
+
* that were still open at that moment.
|
|
762
|
+
*/
|
|
763
|
+
export class ConcurrentSyncBracketError extends WorkflowError {
|
|
764
|
+
/**
|
|
765
|
+
* @param {string} message
|
|
766
|
+
* @param {{ exclusiveKey: string, closingLabel: string, stillOpenLabels: string[], details?: object, cause?: unknown }} opts
|
|
767
|
+
*/
|
|
768
|
+
constructor(message, opts = {}) {
|
|
769
|
+
const { exclusiveKey, closingLabel, stillOpenLabels = [], details, cause } = opts;
|
|
770
|
+
super(message, {
|
|
771
|
+
code: 'CONCURRENT_SYNC_BRACKET',
|
|
772
|
+
details: { exclusiveKey, closingLabel, stillOpenLabels, ...details },
|
|
773
|
+
cause,
|
|
774
|
+
});
|
|
775
|
+
this.exclusiveKey = exclusiveKey;
|
|
776
|
+
this.closingLabel = closingLabel;
|
|
777
|
+
this.stillOpenLabels = stillOpenLabels;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
// ---------------------------------------------------------------------------
|
|
782
|
+
// Pre-sprint validation refusals
|
|
783
|
+
// ---------------------------------------------------------------------------
|
|
784
|
+
//
|
|
785
|
+
// Every refusal raised by runSprintCycle's pre-sprint validation block, as a
|
|
786
|
+
// closed machine-readable vocabulary. Before this existed the block threw bare
|
|
787
|
+
// `Error`s whose only discriminator was their prose, so a caller could not
|
|
788
|
+
// tell "there is genuinely no ready work" (an operator-facing, often benign
|
|
789
|
+
// outcome) from "this orchestrator's bd clone cannot see the target beads at
|
|
790
|
+
// all" (a sync fault) or "the scope is deadlocked" (a graph fault) without
|
|
791
|
+
// substring-matching a human-readable sentence.
|
|
792
|
+
//
|
|
793
|
+
// TARGET_NOT_VISIBLE One or more target issue ids are not present in the
|
|
794
|
+
// orchestrator member's own bd clone AT ALL. NOT the
|
|
795
|
+
// same as those beads being closed: they are invisible
|
|
796
|
+
// here, usually because they were created/mutated on a
|
|
797
|
+
// different clone that was never dolt-pushed to the
|
|
798
|
+
// shared remote. A SYNC fault, fixable by syncing.
|
|
799
|
+
// NOTHING_TO_DO The scope resolves to zero open/in-progress/blocked/
|
|
800
|
+
// deferred beads -- every target issue is genuinely
|
|
801
|
+
// done. Benign: there is no work, not a fault.
|
|
802
|
+
// CYCLE_REPAIR_FAILED The scope is deadlocked by parent-child + blocks
|
|
803
|
+
// cycle(s), the precise offending edges were computed,
|
|
804
|
+
// and the mechanical auto-repair (`bd dep remove`)
|
|
805
|
+
// ITSELF failed. Distinct from DEADLOCKED: the fix is
|
|
806
|
+
// known and was attempted, but could not be applied.
|
|
807
|
+
// DEADLOCKED Not-done beads remain in scope but none are ready,
|
|
808
|
+
// and the repairable cycle shape does not explain it.
|
|
809
|
+
// Needs a human to break the dependency deadlock.
|
|
810
|
+
//
|
|
811
|
+
// NOT in this vocabulary, deliberately: the VERIFY-ONLY sprint path. An empty
|
|
812
|
+
// ready set with implementation-complete beads routed to verify PROCEEDS, so
|
|
813
|
+
// it is not a refusal and must never raise. Nor is the stale-in-progress
|
|
814
|
+
// reclaim a refusal -- it runs BEFORE any of these are raised, precisely
|
|
815
|
+
// because an empty `--ready` set can be an artifact of an interrupted run
|
|
816
|
+
// rather than an absence of work.
|
|
817
|
+
export const PRE_SPRINT_REFUSAL_REASONS = Object.freeze({
|
|
818
|
+
TARGET_NOT_VISIBLE: 'TARGET_NOT_VISIBLE',
|
|
819
|
+
NOTHING_TO_DO: 'NOTHING_TO_DO',
|
|
820
|
+
CYCLE_REPAIR_FAILED: 'CYCLE_REPAIR_FAILED',
|
|
821
|
+
DEADLOCKED: 'DEADLOCKED',
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Thrown when runSprintCycle's pre-sprint validation refuses to start a
|
|
826
|
+
* sprint. Adds a machine-readable `reason` discriminator (one of
|
|
827
|
+
* PRE_SPRINT_REFUSAL_REASONS) to what was previously an untyped `Error`
|
|
828
|
+
* distinguishable only by its prose.
|
|
829
|
+
*
|
|
830
|
+
* The human-readable message is deliberately UNCHANGED from the prose each
|
|
831
|
+
* refusal already emitted -- this adds a type and a discriminator, it does not
|
|
832
|
+
* restyle the operator-facing text.
|
|
833
|
+
*
|
|
834
|
+
* Like the other sprint-fatal errors here it is never caught inside the
|
|
835
|
+
* pre-sprint block, so it unwinds runWithContext()'s promise and fails the run
|
|
836
|
+
* before any dispatch occurs.
|
|
837
|
+
*
|
|
838
|
+
* @property {string} reason - one of PRE_SPRINT_REFUSAL_REASONS
|
|
839
|
+
* @property {string|null} scope - the sprint filter the refusal was raised for
|
|
840
|
+
* @property {string[]} [invisibleTargets] - TARGET_NOT_VISIBLE: the ids missing
|
|
841
|
+
* from the orchestrator member's clone
|
|
842
|
+
* @property {Array<{blockedIssue: string, blockedBy: string}>} [cyclePairs] -
|
|
843
|
+
* CYCLE_REPAIR_FAILED: the parent-child + blocks edge pairs whose removal
|
|
844
|
+
* was attempted
|
|
845
|
+
* @property {string[]} [deadlockedIds] - DEADLOCKED: the not-done bead ids that
|
|
846
|
+
* remain in scope with none ready
|
|
847
|
+
*/
|
|
848
|
+
export class PreSprintValidationError extends WorkflowError {
|
|
849
|
+
/**
|
|
850
|
+
* @param {string} message
|
|
851
|
+
* @param {{ reason: string, scope?: string|null, invisibleTargets?: string[], cyclePairs?: Array<{blockedIssue: string, blockedBy: string}>, deadlockedIds?: string[], details?: object, cause?: unknown }} opts
|
|
852
|
+
*/
|
|
853
|
+
constructor(message, opts = {}) {
|
|
854
|
+
const { reason, scope = null, invisibleTargets, cyclePairs, deadlockedIds, details, cause } = opts;
|
|
855
|
+
if (!Object.prototype.hasOwnProperty.call(PRE_SPRINT_REFUSAL_REASONS, String(reason))) {
|
|
856
|
+
// A refusal with no recognized discriminator is the exact failure
|
|
857
|
+
// this type exists to prevent, so it fails loudly at construction
|
|
858
|
+
// rather than shipping an untyped refusal wearing a typed name.
|
|
859
|
+
throw new TypeError(
|
|
860
|
+
`PreSprintValidationError requires a reason from PRE_SPRINT_REFUSAL_REASONS ` +
|
|
861
|
+
`(${Object.keys(PRE_SPRINT_REFUSAL_REASONS).join(', ')}); got ${JSON.stringify(reason)}`
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
super(message, {
|
|
865
|
+
code: 'PRE_SPRINT_VALIDATION',
|
|
866
|
+
details: { reason, scope, invisibleTargets, cyclePairs, deadlockedIds, ...details },
|
|
867
|
+
cause,
|
|
868
|
+
});
|
|
869
|
+
this.reason = reason;
|
|
870
|
+
this.scope = scope;
|
|
871
|
+
if (invisibleTargets) this.invisibleTargets = invisibleTargets;
|
|
872
|
+
if (cyclePairs) this.cyclePairs = cyclePairs;
|
|
873
|
+
if (deadlockedIds) this.deadlockedIds = deadlockedIds;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// ---------------------------------------------------------------------------
|
|
878
|
+
// Beads identity (which .beads a member's bd actually resolves to)
|
|
879
|
+
// ---------------------------------------------------------------------------
|
|
880
|
+
|
|
881
|
+
export const BEADS_IDENTITY_FAILURE_REASONS = Object.freeze({
|
|
882
|
+
MISMATCH: 'MISMATCH',
|
|
883
|
+
});
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Thrown by verifyBeadsIdentity (beads-identity-check.mjs) BEFORE any
|
|
887
|
+
* mutating bd command when a member's probed identity (`bd where` / `bd
|
|
888
|
+
* config get sync.remote` / `git remote get-url origin`) DIFFERS from the
|
|
889
|
+
* expected one (the supervisor's expectation, or the orchestrator member's
|
|
890
|
+
* own identity) on a field that resolved on both sides. A probe that fails
|
|
891
|
+
* or cannot be parsed is a logged warning, never this error: only a proven
|
|
892
|
+
* mismatch is a data-corruption risk worth refusing the sprint for.
|
|
893
|
+
*
|
|
894
|
+
* A WorkflowError so main()'s terminal record names the reason, but
|
|
895
|
+
* deliberately NOT a typed abort: nothing has been dispatched or mutated, so
|
|
896
|
+
* there is no partial work for finalizeAbort() to push or open a PR for.
|
|
897
|
+
*
|
|
898
|
+
* @property {string} reason - one of BEADS_IDENTITY_FAILURE_REASONS
|
|
899
|
+
* @property {string} member - the member whose identity mismatched
|
|
900
|
+
* @property {Array<{field: string, expected: string, actual: string}>} [mismatches]
|
|
901
|
+
*/
|
|
902
|
+
export class BeadsIdentityError extends WorkflowError {
|
|
903
|
+
/**
|
|
904
|
+
* @param {string} message
|
|
905
|
+
* @param {{ reason: string, member: string, mismatches?: Array<{field: string, expected: string, actual: string}>, details?: object, cause?: unknown }} opts
|
|
906
|
+
*/
|
|
907
|
+
constructor(message, opts = {}) {
|
|
908
|
+
const { reason, member, mismatches, details, cause } = opts;
|
|
909
|
+
if (!Object.prototype.hasOwnProperty.call(BEADS_IDENTITY_FAILURE_REASONS, String(reason))) {
|
|
910
|
+
throw new TypeError(
|
|
911
|
+
`BeadsIdentityError requires a reason from BEADS_IDENTITY_FAILURE_REASONS ` +
|
|
912
|
+
`(${Object.keys(BEADS_IDENTITY_FAILURE_REASONS).join(', ')}); got ${JSON.stringify(reason)}`
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
super(message, {
|
|
916
|
+
code: 'BEADS_IDENTITY',
|
|
917
|
+
details: { reason, member, mismatches, ...details },
|
|
918
|
+
cause,
|
|
919
|
+
});
|
|
920
|
+
this.reason = reason;
|
|
921
|
+
this.member = member;
|
|
922
|
+
if (mismatches) this.mismatches = mismatches;
|
|
923
|
+
}
|
|
924
|
+
}
|