@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
|
@@ -40,12 +40,40 @@ const AUTH_EXPIRED = [
|
|
|
40
40
|
/Invalid or expired app password/i,
|
|
41
41
|
];
|
|
42
42
|
|
|
43
|
+
/** Bitbucket Cloud's own hosts, ANCHORED (never a substring test -- the same
|
|
44
|
+
* reasoning as ./azure-devops.mjs's HOST_RE, and unlike GitHub Enterprise
|
|
45
|
+
* Server which has no fixed domain):
|
|
46
|
+
* - bitbucket.org https and ssh remotes
|
|
47
|
+
* - www.bitbucket.org the www alias (bitbucket.org redirects it, and a
|
|
48
|
+
* remote copy-pasted from a browser address bar can
|
|
49
|
+
* carry it)
|
|
50
|
+
* - altssh.bitbucket.org the alternate-port ssh host
|
|
51
|
+
* A self-hosted Bitbucket Data Center install has an arbitrary domain and is
|
|
52
|
+
* deliberately left to GenericGitVCS's catch-all rather than guessed at.
|
|
53
|
+
*
|
|
54
|
+
* apra-fleet-5oo: declaring this makes resolveVcsProviderForHost() name
|
|
55
|
+
* 'bitbucket' for a Bitbucket remote, which is what lets runner.js's
|
|
56
|
+
* dispatch-time VCS-provider fallback detect it. Behaviour-neutral for
|
|
57
|
+
* VCSModule.capabilities(): this provider declares no capabilitiesForHost,
|
|
58
|
+
* and the caller's default (canOpenPullRequest:false) matches what
|
|
59
|
+
* GenericGitVCS returned for these hosts before.
|
|
60
|
+
*
|
|
61
|
+
* Kept character-for-character in step with
|
|
62
|
+
* src/utils/vcs-provider-detect.ts's BITBUCKET_HOST_RE -- the two halves of
|
|
63
|
+
* the same decision must never disagree about who owns a host. */
|
|
64
|
+
const HOST_RE = /^(?:www\.|altssh\.)?bitbucket\.org$/i;
|
|
65
|
+
|
|
66
|
+
function matchesHost(host) {
|
|
67
|
+
return typeof host === 'string' && HOST_RE.test(host.trim());
|
|
68
|
+
}
|
|
69
|
+
|
|
43
70
|
export const BitbucketVCS = Object.freeze({
|
|
44
71
|
name: 'bitbucket',
|
|
45
72
|
extends: 'generic-git',
|
|
46
73
|
rules: Object.freeze({
|
|
47
74
|
[K.AUTH_EXPIRED]: AUTH_EXPIRED,
|
|
48
75
|
}),
|
|
76
|
+
matchesHost,
|
|
49
77
|
defaultAuthMode: null,
|
|
50
78
|
builders: null,
|
|
51
79
|
});
|
|
@@ -50,10 +50,30 @@ const EMPTY_REMOTE = [
|
|
|
50
50
|
/no branches found in remote/i,
|
|
51
51
|
];
|
|
52
52
|
|
|
53
|
-
/** Verbatim DOLT_REMOTE_UNREACHABLE_PATTERNS.
|
|
53
|
+
/** Verbatim DOLT_REMOTE_UNREACHABLE_PATTERNS.
|
|
54
|
+
*
|
|
55
|
+
* The first two patterns are guarded with a leading `(?!.*fork\/exec)`
|
|
56
|
+
* lookahead (checked against the WHOLE remaining string, hence `[\s\S]*`
|
|
57
|
+
* rather than `.*`, so it also spans the multi-line raw output these
|
|
58
|
+
* errors come as): Dolt wraps a git subprocess-spawn failure (the OS
|
|
59
|
+
* refusing to even start git.exe, e.g. a transient Windows CreateProcess
|
|
60
|
+
* resource error) in this SAME generic "could not be accessed"/"failed to
|
|
61
|
+
* get remote db" wrapper text it uses for a genuinely dead/misconfigured
|
|
62
|
+
* remote. Confirmed live: a `fork/exec ... git.exe: Not enough memory
|
|
63
|
+
* resources` failure was misclassified as REMOTE_UNREACHABLE (permanent,
|
|
64
|
+
* "retrying cannot succeed") purely from that wrapper phrasing, even
|
|
65
|
+
* though the remote was correctly configured and reachable -- an
|
|
66
|
+
* unmodified retry of the identical command succeeded outright, repeatedly.
|
|
67
|
+
* A `fork/exec` line is Dolt's/Go's structural marker for "the OS refused
|
|
68
|
+
* to start the child process", as opposed to git actually running and
|
|
69
|
+
* reporting a real remote problem -- so its presence anywhere in the
|
|
70
|
+
* output means this ISN'T evidence of a dead remote, and the classifier
|
|
71
|
+
* must fall through to the TRANSIENT check below instead. A genuinely
|
|
72
|
+
* dead/misconfigured remote (no fork/exec line present) is unaffected and
|
|
73
|
+
* still classifies here exactly as before. */
|
|
54
74
|
const REMOTE_UNREACHABLE = [
|
|
55
|
-
|
|
56
|
-
|
|
75
|
+
/^(?![\s\S]*fork\/exec)[\s\S]*could not be accessed/i,
|
|
76
|
+
/^(?![\s\S]*fork\/exec)[\s\S]*failed to get remote db/i,
|
|
57
77
|
/stat [^:]+: no such file or directory/i,
|
|
58
78
|
];
|
|
59
79
|
|
|
@@ -91,8 +111,17 @@ const DIVERGED = [
|
|
|
91
111
|
/working set (is )?not clean/i,
|
|
92
112
|
];
|
|
93
113
|
|
|
94
|
-
/** Verbatim DOLT_TRANSIENT_PATTERNS.
|
|
114
|
+
/** Verbatim DOLT_TRANSIENT_PATTERNS.
|
|
115
|
+
*
|
|
116
|
+
* fork/exec: the OS refused to start git.exe itself (e.g. a transient
|
|
117
|
+
* Windows CreateProcess resource error) -- see the REMOTE_UNREACHABLE
|
|
118
|
+
* guard above, which this pattern is the other half of. Deliberately
|
|
119
|
+
* broad (any fork/exec line, not just the "Not enough memory resources"
|
|
120
|
+
* wording observed live) since any process-spawn-refusal is the same
|
|
121
|
+
* class of transient, retry-worthy failure regardless of the OS's exact
|
|
122
|
+
* phrasing for why it refused. */
|
|
95
123
|
const TRANSIENT = [
|
|
124
|
+
/fork\/exec /i,
|
|
96
125
|
/could not resolve host/i,
|
|
97
126
|
/unable to (access|connect)/i,
|
|
98
127
|
/connection (timed out|reset|refused)/i,
|
|
@@ -26,30 +26,12 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { VCS_FAILURE_KINDS as K } from '../errors.mjs';
|
|
29
|
+
import { shQuote, shQuoteJson, curlBinary, assertToken } from './shell-helpers.mjs';
|
|
29
30
|
|
|
30
31
|
const GITHUB_API = 'https://api.github.com';
|
|
31
32
|
const REDACTED = '***REDACTED***';
|
|
32
33
|
const REPO_RE = /^[\w.-]+\/[\w.-]+$/;
|
|
33
34
|
|
|
34
|
-
/** Single-quote a string for embedding in a shell command. The built curl
|
|
35
|
-
* command is dispatched through the member's own shell -- POSIX sh/bash
|
|
36
|
-
* closes/reopens the quote around an embedded single quote ('\''), but
|
|
37
|
-
* Windows PowerShell (the shell every Windows member's commands actually
|
|
38
|
-
* run through -- see wrapPowerShellEncoded()/isWindows in
|
|
39
|
-
* src/tools/remove-member.ts) escapes an embedded single quote inside a
|
|
40
|
-
* single-quoted string by DOUBLING it (''), not by backslash-closing. Using
|
|
41
|
-
* the POSIX form on a Windows member breaks the quoting outright (observed
|
|
42
|
-
* live: Publish PR crashing on any title/body containing an apostrophe).
|
|
43
|
-
* `os` is one of resolveMemberOs()'s return values ('windows'/'linux'/
|
|
44
|
-
* 'darwin'); anything other than 'windows' keeps the POSIX behavior
|
|
45
|
-
* byte-identical to before this branch existed. */
|
|
46
|
-
function shQuote(value, os) {
|
|
47
|
-
if (os === 'windows') {
|
|
48
|
-
return `'${String(value).replace(/'/g, "''")}'`;
|
|
49
|
-
}
|
|
50
|
-
return `'${String(value).replace(/'/g, `'\\''`)}'`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
35
|
function assertRepo(repo) {
|
|
54
36
|
const value = String(repo ?? '').trim();
|
|
55
37
|
if (!REPO_RE.test(value)) {
|
|
@@ -58,18 +40,10 @@ function assertRepo(repo) {
|
|
|
58
40
|
return value;
|
|
59
41
|
}
|
|
60
42
|
|
|
61
|
-
function assertToken(token) {
|
|
62
|
-
const value = String(token ?? '');
|
|
63
|
-
if (!value) {
|
|
64
|
-
throw new Error('ERROR: VCSModule: no token supplied -- caller must mint one via provision_vcs_auth before calling VCSModule.');
|
|
65
|
-
}
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
43
|
/** Build the GitHub REST "create pull request" curl command.
|
|
70
44
|
* POST /repos/{owner}/{repo}/pulls -- see
|
|
71
45
|
* https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request */
|
|
72
|
-
function buildGitHubCreatePrCommand({ repo, base, head, title, body, token, os }) {
|
|
46
|
+
function buildGitHubCreatePrCommand({ repo, base, head, title, body, token, os, shell }) {
|
|
73
47
|
const safeRepo = assertRepo(repo);
|
|
74
48
|
const safeToken = assertToken(token);
|
|
75
49
|
if (!base) throw new Error('ERROR: VCSModule: "base" branch is required to build a create-pull-request command.');
|
|
@@ -82,13 +56,13 @@ function buildGitHubCreatePrCommand({ repo, base, head, title, body, token, os }
|
|
|
82
56
|
const url = `${GITHUB_API}/repos/${safeRepo}/pulls`;
|
|
83
57
|
|
|
84
58
|
const buildCurl = (authToken) => [
|
|
85
|
-
|
|
86
|
-
`-H ${shQuote(`Authorization: Bearer ${authToken}`, os)}`,
|
|
87
|
-
`-H ${shQuote('Accept: application/vnd.github+json', os)}`,
|
|
88
|
-
`-H ${shQuote('Content-Type: application/json', os)}`,
|
|
89
|
-
`-H ${shQuote('X-GitHub-Api-Version: 2022-11-28', os)}`,
|
|
90
|
-
`-d ${
|
|
91
|
-
`-w ${shQuote('\n%{http_code}', os)}`,
|
|
59
|
+
`${curlBinary(os)} -sS -X POST`,
|
|
60
|
+
`-H ${shQuote(`Authorization: Bearer ${authToken}`, os, shell)}`,
|
|
61
|
+
`-H ${shQuote('Accept: application/vnd.github+json', os, shell)}`,
|
|
62
|
+
`-H ${shQuote('Content-Type: application/json', os, shell)}`,
|
|
63
|
+
`-H ${shQuote('X-GitHub-Api-Version: 2022-11-28', os, shell)}`,
|
|
64
|
+
`-d ${shQuoteJson(payloadJson, os, shell)}`,
|
|
65
|
+
`-w ${shQuote('\n%{http_code}', os, shell)}`,
|
|
92
66
|
url,
|
|
93
67
|
].join(' ');
|
|
94
68
|
|
|
@@ -116,7 +90,7 @@ function buildGitHubCreatePrCommand({ repo, base, head, title, body, token, os }
|
|
|
116
90
|
* raised (rather than opening a second PR for the same head).
|
|
117
91
|
* POST /repos/{owner}/{repo}/issues/{issue_number}/comments -- see
|
|
118
92
|
* https://docs.github.com/en/rest/issues/comments#create-an-issue-comment */
|
|
119
|
-
function buildGitHubCommentCommand({ repo, issue_number: issueNumber, body, token, os }) {
|
|
93
|
+
function buildGitHubCommentCommand({ repo, issue_number: issueNumber, body, token, os, shell }) {
|
|
120
94
|
const safeRepo = assertRepo(repo);
|
|
121
95
|
const safeToken = assertToken(token);
|
|
122
96
|
if (!issueNumber) throw new Error('ERROR: VCSModule: "issue_number" is required to build a comment command.');
|
|
@@ -126,13 +100,13 @@ function buildGitHubCommentCommand({ repo, issue_number: issueNumber, body, toke
|
|
|
126
100
|
const url = `${GITHUB_API}/repos/${safeRepo}/issues/${issueNumber}/comments`;
|
|
127
101
|
|
|
128
102
|
const buildCurl = (authToken) => [
|
|
129
|
-
|
|
130
|
-
`-H ${shQuote(`Authorization: Bearer ${authToken}`, os)}`,
|
|
131
|
-
`-H ${shQuote('Accept: application/vnd.github+json', os)}`,
|
|
132
|
-
`-H ${shQuote('Content-Type: application/json', os)}`,
|
|
133
|
-
`-H ${shQuote('X-GitHub-Api-Version: 2022-11-28', os)}`,
|
|
134
|
-
`-d ${
|
|
135
|
-
`-w ${shQuote('\n%{http_code}', os)}`,
|
|
103
|
+
`${curlBinary(os)} -sS -X POST`,
|
|
104
|
+
`-H ${shQuote(`Authorization: Bearer ${authToken}`, os, shell)}`,
|
|
105
|
+
`-H ${shQuote('Accept: application/vnd.github+json', os, shell)}`,
|
|
106
|
+
`-H ${shQuote('Content-Type: application/json', os, shell)}`,
|
|
107
|
+
`-H ${shQuote('X-GitHub-Api-Version: 2022-11-28', os, shell)}`,
|
|
108
|
+
`-d ${shQuoteJson(payloadJson, os, shell)}`,
|
|
109
|
+
`-w ${shQuote('\n%{http_code}', os, shell)}`,
|
|
136
110
|
url,
|
|
137
111
|
].join(' ');
|
|
138
112
|
|
|
@@ -147,6 +121,46 @@ function buildGitHubCommentCommand({ repo, issue_number: issueNumber, body, toke
|
|
|
147
121
|
};
|
|
148
122
|
}
|
|
149
123
|
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Pull-request RESPONSE mapping (apra-fleet-lzfv.4)
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
//
|
|
128
|
+
// GitHub's create-pull-request 2xx body carries the PR number as `number` and
|
|
129
|
+
// the browsable page as `html_url`. That mapping was previously IMPLICIT -- a
|
|
130
|
+
// consumer (runner.js's raiseVcsPrForMember) read `html_url` off the body
|
|
131
|
+
// directly, which is a GitHub dialect literal living in a provider-agnostic
|
|
132
|
+
// caller. It is declared here instead, so a provider whose body speaks a
|
|
133
|
+
// different dialect (see ./azure-devops.mjs: `pullRequestId`, and no web-URL
|
|
134
|
+
// field at all) is read through the SAME descriptor hook rather than a caller
|
|
135
|
+
// branch. See ./index.mjs for the contract.
|
|
136
|
+
|
|
137
|
+
const PR_ID_FIELD = 'number';
|
|
138
|
+
const PR_WEB_URL_FIELD = 'html_url';
|
|
139
|
+
|
|
140
|
+
/** Map a GitHub create-pull-request response body to { id, url }. Reads the
|
|
141
|
+
* DECLARED field names above rather than hardcoding them a second time, and
|
|
142
|
+
* reproduces runner.js's historical behavior exactly: a missing or non-string
|
|
143
|
+
* `html_url` yields `url: null` rather than a guessed URL. `ctx` is unused --
|
|
144
|
+
* GitHub's body already carries the browsable URL. */
|
|
145
|
+
function mapPullRequestResponse(body, _ctx) {
|
|
146
|
+
const source = (body && typeof body === 'object') ? body : {};
|
|
147
|
+
const rawId = source[PR_ID_FIELD];
|
|
148
|
+
let id = null;
|
|
149
|
+
if (typeof rawId === 'number' && Number.isFinite(rawId)) id = rawId;
|
|
150
|
+
else if (typeof rawId === 'string' && /^\d+$/.test(rawId.trim())) id = Number(rawId.trim());
|
|
151
|
+
const rawUrl = source[PR_WEB_URL_FIELD];
|
|
152
|
+
return { id, url: typeof rawUrl === 'string' ? rawUrl : null };
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const pullRequestResponse = Object.freeze({
|
|
156
|
+
idField: PR_ID_FIELD,
|
|
157
|
+
webUrlField: PR_WEB_URL_FIELD,
|
|
158
|
+
// The web URL is READ from the body, never constructed, so there is no
|
|
159
|
+
// template -- contrast ./azure-devops.mjs.
|
|
160
|
+
webUrlTemplate: null,
|
|
161
|
+
map: mapPullRequestResponse,
|
|
162
|
+
});
|
|
163
|
+
|
|
150
164
|
/** GitHub's credential-rejection literals. "remote: Invalid username or
|
|
151
165
|
* token/password" is what a git push over HTTPS gets back from GitHub with a
|
|
152
166
|
* dead PAT; "Bad credentials" is the REST API's equivalent, which reaches us
|
|
@@ -167,6 +181,101 @@ const AUTH_EXPIRED = [
|
|
|
167
181
|
// self-heal. Widening the taxonomy is a real behavior change and belongs in its
|
|
168
182
|
// own bead with its own tests, not smuggled in under a no-verdict-change
|
|
169
183
|
// consolidation.
|
|
184
|
+
//
|
|
185
|
+
// The ONE exception, added deliberately and with its own tests: the
|
|
186
|
+
// workflow-file permission refusal below. It is not merely "unknown today" --
|
|
187
|
+
// it is actively MISREAD today (see the block comment on
|
|
188
|
+
// WORKFLOW_PERMISSION_REFUSAL), which is a different situation from the
|
|
189
|
+
// under-matched texts listed above.
|
|
190
|
+
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
// Workflow-file permission refusal (the permission-scope axis)
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
//
|
|
195
|
+
// git's stderr for a push that touches .github/workflows/** with a credential
|
|
196
|
+
// that was never granted the Workflows permission looks like:
|
|
197
|
+
//
|
|
198
|
+
// ! [remote rejected] feat/x -> feat/x (refusing to allow a GitHub App to
|
|
199
|
+
// create or update workflow .github/workflows/ci.yml without workflows
|
|
200
|
+
// permission)
|
|
201
|
+
// error: failed to push some refs to 'https://github.com/owner/repo.git'
|
|
202
|
+
//
|
|
203
|
+
// Two things about that text matter, and both are why this rule needs the
|
|
204
|
+
// `permissionScope` hook below rather than a plain entry in `rules`:
|
|
205
|
+
//
|
|
206
|
+
// 1. The trailing "error: failed to push some refs to ..." line is git's
|
|
207
|
+
// UNIVERSAL reaction to ANY rejected push -- a non-fast-forward, a
|
|
208
|
+
// protected-branch refusal, a hook rejection, this. GenericGitVCS's
|
|
209
|
+
// DIVERGED table matches it, and DIVERGED outranks both AUTH kinds in
|
|
210
|
+
// KIND_PRECEDENCE, so precedence alone reads this as a divergence and the
|
|
211
|
+
// caller answers a permission refusal with a doomed `pull --rebase`.
|
|
212
|
+
// 2. The identity was understood perfectly; the PRINCIPAL simply was never
|
|
213
|
+
// granted the permission. Re-minting the SAME credential (which is all the
|
|
214
|
+
// provision_vcs_auth self-heal does) produces a token with the SAME
|
|
215
|
+
// permission set and the SAME refusal, forever.
|
|
216
|
+
//
|
|
217
|
+
// So this is AUTH_DENIED ("identity understood, access refused" -- errors.mjs)
|
|
218
|
+
// and it must WIN over the DIVERGED tail, and it must NOT be self-healed. Both
|
|
219
|
+
// of those follow from declaring it under `permissionScope` (see
|
|
220
|
+
// ./index.mjs's descriptor contract); the SAME array is also listed under
|
|
221
|
+
// rules[AUTH_DENIED] so the kind is discoverable by pattern-table readers and
|
|
222
|
+
// by any caller that walks `rules` directly.
|
|
223
|
+
//
|
|
224
|
+
// Wordings: GitHub emits a different subject noun per credential type. The
|
|
225
|
+
// GitHub App and Personal Access Token wordings are the two the fleet can
|
|
226
|
+
// actually produce (fleet-minted installation tokens, and an operator-supplied
|
|
227
|
+
// PAT); the OAuth App wording is the same refusal from a credential type the
|
|
228
|
+
// fleet does not mint but a member may nonetheless be configured with, and
|
|
229
|
+
// leaving it out would silently return it to the DIVERGED misreading above.
|
|
230
|
+
// The trailing noun differs too ("without workflows permission" for an App,
|
|
231
|
+
// "without workflow scope" for a PAT/OAuth App), so the patterns stop at the
|
|
232
|
+
// stable "to create or update workflow" stem rather than pinning the tail.
|
|
233
|
+
const WORKFLOW_PERMISSION_REFUSAL = [
|
|
234
|
+
/refusing to allow a GitHub App to create or update workflow/i,
|
|
235
|
+
/refusing to allow a Personal Access Token to create or update workflow/i,
|
|
236
|
+
/refusing to allow an? OAuth App to create or update workflow/i,
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
/** The operator referral for a workflow-permission refusal: WHICH workflow
|
|
240
|
+
* file(s) were refused, WHAT the credential is missing, and the remedy --
|
|
241
|
+
* stated as an operator action, never as "it will retry", because nothing
|
|
242
|
+
* here retries.
|
|
243
|
+
*
|
|
244
|
+
* Stateless: the /g regex is constructed fresh on every call (a hoisted /g
|
|
245
|
+
* regex would carry `lastIndex` between classifyFailure calls and make the
|
|
246
|
+
* same input describe differently on a second call -- see the PURITY note in
|
|
247
|
+
* this file's header and in ./generic-git.mjs).
|
|
248
|
+
*
|
|
249
|
+
* @param {string} raw - the raw stderr the refusal was classified from
|
|
250
|
+
* @returns {string} an ASCII operator-facing referral
|
|
251
|
+
*/
|
|
252
|
+
function describeWorkflowPermissionRefusal(raw) {
|
|
253
|
+
const text = String(raw == null ? '' : raw);
|
|
254
|
+
const matched = text.match(/\.github\/workflows\/[A-Za-z0-9._/-]+/g) || [];
|
|
255
|
+
// Strip punctuation git/GitHub wraps the path in (a quote, a closing
|
|
256
|
+
// paren's neighbouring period, ...) and de-duplicate while preserving the
|
|
257
|
+
// order the refusal listed them in.
|
|
258
|
+
const paths = [...new Set(matched.map((p) => p.replace(/[.,'"]+$/, '')))];
|
|
259
|
+
const which = paths.length > 0
|
|
260
|
+
? `workflow file(s) ${paths.join(', ')}`
|
|
261
|
+
: 'one or more files under .github/workflows/';
|
|
262
|
+
return (
|
|
263
|
+
`GitHub refused this push because the credential the member is pushing with was never granted the 'workflows' permission, ` +
|
|
264
|
+
`so it may not create or update ${which}. This is a permission-scope refusal, not a stale credential and not a divergence: ` +
|
|
265
|
+
`re-minting the same credential yields the same permission set and the same refusal, so no self-heal, no retry and no pull --rebase is attempted. ` +
|
|
266
|
+
'OPERATOR REMEDY (required before this push can ever succeed): grant the fleet GitHub App the "Workflows" repository permission ' +
|
|
267
|
+
'(Read and write) in its App settings, accept the updated permission request on the repository installation, then re-register/re-provision ' +
|
|
268
|
+
'the member with a git_access level that requests that permission. Until an operator does that, re-running the sprint will not help.'
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** The permission-scope axis for GitHub (see ./index.mjs's descriptor
|
|
273
|
+
* contract). Declared as the SAME array that rules[AUTH_DENIED] carries, so
|
|
274
|
+
* the two can never drift apart. */
|
|
275
|
+
const permissionScope = Object.freeze({
|
|
276
|
+
rules: Object.freeze(WORKFLOW_PERMISSION_REFUSAL),
|
|
277
|
+
describe: describeWorkflowPermissionRefusal,
|
|
278
|
+
});
|
|
170
279
|
|
|
171
280
|
/** Best-effort GitHub provider code, purely DIAGNOSTIC: never branch on it --
|
|
172
281
|
* branch on `kind`. Returns the HTTP status git/curl surfaced (e.g. '403'
|
|
@@ -201,6 +310,34 @@ function matchesHost(host) {
|
|
|
201
310
|
return typeof host === 'string' && /github/i.test(host);
|
|
202
311
|
}
|
|
203
312
|
|
|
313
|
+
/** github.com and its ssh/www aliases -- ANCHORED. Kept character-for-
|
|
314
|
+
* character in step with src/utils/vcs-provider-detect.ts's
|
|
315
|
+
* GITHUB_HOST_RE (the registration-time half of the same decision). */
|
|
316
|
+
const AUTH_HOST_RE = /^(?:www\.|ssh\.)?github\.com$/i;
|
|
317
|
+
|
|
318
|
+
/** Host-recognition for the CREDENTIAL-PROVISIONING axis
|
|
319
|
+
* (resolveVcsAuthProviderForHost() in ./index.mjs), deliberately NARROWER
|
|
320
|
+
* than matchesHost() above.
|
|
321
|
+
*
|
|
322
|
+
* matchesHost() is a substring test on purpose: it answers "can this host
|
|
323
|
+
* open a pull request?" for capabilities(), and a GitHub Enterprise Server
|
|
324
|
+
* install has no fixed domain, so the vendor name in the hostname is the
|
|
325
|
+
* only portable signal (pinned by test/vcs-capabilities-table.test.mjs).
|
|
326
|
+
* Answering YES there costs nothing -- the worst case is a PR attempt that
|
|
327
|
+
* fails.
|
|
328
|
+
*
|
|
329
|
+
* Auto-PROVISIONING is a different risk class entirely: it mints a real
|
|
330
|
+
* GitHub App push credential and points it at the host. A substring test
|
|
331
|
+
* would let a lookalike domain ("mygithubmirror.attacker.io",
|
|
332
|
+
* "github.com.evil.example") claim this provider and receive that
|
|
333
|
+
* credential -- exactly the leak src/utils/vcs-provider-detect.ts anchors
|
|
334
|
+
* against on the registration-time path. So GitHub Enterprise is NOT
|
|
335
|
+
* auto-detected for auth on either side: an operator registers a GHE
|
|
336
|
+
* member with an explicit `vcs_provider`. */
|
|
337
|
+
function matchesHostForAuth(host) {
|
|
338
|
+
return typeof host === 'string' && AUTH_HOST_RE.test(host.trim());
|
|
339
|
+
}
|
|
340
|
+
|
|
204
341
|
/** Every host this provider matches can open a PR via the REST call
|
|
205
342
|
* buildGitHubCreatePrCommand() builds -- github.com and GitHub Enterprise
|
|
206
343
|
* Server alike speak the same `/repos/{owner}/{repo}/pulls` shape. */
|
|
@@ -213,9 +350,17 @@ export const GitHubVCS = Object.freeze({
|
|
|
213
350
|
extends: 'generic-git',
|
|
214
351
|
rules: Object.freeze({
|
|
215
352
|
[K.AUTH_EXPIRED]: AUTH_EXPIRED,
|
|
353
|
+
// apra-fleet: the workflow-file permission refusal. AUTH_DENIED
|
|
354
|
+
// because the identity was understood and the PRINCIPAL lacks the
|
|
355
|
+
// permission -- see WORKFLOW_PERMISSION_REFUSAL above. The same array
|
|
356
|
+
// is declared under `permissionScope` below, which is what makes it
|
|
357
|
+
// outrank git's generic DIVERGED tail and skip the auth self-heal.
|
|
358
|
+
[K.AUTH_DENIED]: WORKFLOW_PERMISSION_REFUSAL,
|
|
216
359
|
}),
|
|
360
|
+
permissionScope,
|
|
217
361
|
extractProviderCode,
|
|
218
362
|
matchesHost,
|
|
363
|
+
matchesHostForAuth,
|
|
219
364
|
capabilitiesForHost,
|
|
220
365
|
// apra-fleet-647.1.5.1: GitHub's own default auth mode (App, never PAT --
|
|
221
366
|
// see vcs-module.mjs resolveProvider()'s header note on why this must stay
|
|
@@ -226,6 +371,9 @@ export const GitHubVCS = Object.freeze({
|
|
|
226
371
|
// makes a provider part of resolveProvider()'s/buildVcsCommand()'s known
|
|
227
372
|
// vocabulary -- see ./index.mjs's isAuthBackend().
|
|
228
373
|
defaultAuthMode: 'github-app',
|
|
374
|
+
// apra-fleet-lzfv.4: GitHub's create-pull-request response dialect, stated
|
|
375
|
+
// explicitly instead of left implicit in a caller (see above).
|
|
376
|
+
pullRequestResponse,
|
|
229
377
|
builders: Object.freeze({
|
|
230
378
|
'create-pull-request': buildGitHubCreatePrCommand,
|
|
231
379
|
comment: buildGitHubCommentCommand,
|