@apralabs/apra-fleet 0.4.3 → 0.4.5
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 +114 -33
- package/dist/agents/backlog-groomer.md +80 -27
- package/dist/agents/ci-watcher.md +42 -22
- package/dist/agents/deployer.md +59 -24
- package/dist/agents/doer.md +111 -41
- package/dist/agents/harvester.md +60 -48
- package/dist/agents/integ-test-runner.md +45 -23
- package/dist/agents/kb-reconciler.md +34 -7
- package/dist/agents/plan-reviewer.md +54 -24
- package/dist/agents/planner.md +71 -43
- package/dist/agents/regression-test-runner.md +106 -78
- package/dist/agents/reviewer.md +170 -57
- package/dist/agents/schemas/backlog-groomer-output.json +1 -1
- package/dist/agents/schemas/deployer-output.json +5 -0
- package/dist/agents/schemas/doer-output.json +110 -2
- package/dist/agents/schemas/harvester-input.json +1 -5
- package/dist/agents/schemas/planner-output.json +1 -1
- package/dist/agents/schemas/regression-test-runner-output.json +41 -7
- package/dist/agents/schemas/reviewer-output.json +166 -5
- package/dist/cli/agent-transform.d.ts +7 -0
- package/dist/cli/agent-transform.js +46 -1
- package/dist/cli/auth.d.ts +1 -0
- package/dist/cli/auth.js +42 -8
- package/dist/cli/beads-install.d.ts +35 -0
- package/dist/cli/beads-install.js +125 -0
- package/dist/cli/beads-pin.d.ts +5 -0
- package/dist/cli/beads-pin.js +26 -0
- package/dist/cli/call.d.ts +27 -0
- package/dist/cli/call.js +177 -0
- package/dist/cli/claude-mod.d.ts +75 -0
- package/dist/cli/claude-mod.js +288 -0
- package/dist/cli/config.d.ts +24 -1
- package/dist/cli/config.js +69 -2
- package/dist/cli/dolt-install.d.ts +19 -3
- package/dist/cli/dolt-install.js +51 -16
- package/dist/cli/fleet-se-guard.d.ts +59 -0
- package/dist/cli/fleet-se-guard.js +231 -0
- package/dist/cli/install-guard.d.ts +63 -0
- package/dist/cli/install-guard.js +156 -4
- package/dist/cli/install.d.ts +89 -21
- package/dist/cli/install.js +778 -160
- package/dist/cli/kb-commit.d.ts +2 -1
- package/dist/cli/kb-commit.js +1 -1
- package/dist/cli/kb-import.d.ts +2 -1
- package/dist/cli/kb-import.js +1 -1
- package/dist/cli/kb-profile.d.ts +16 -0
- package/dist/cli/kb-profile.js +81 -0
- package/dist/cli/register-member.js +20 -3
- package/dist/cli/remove-member.d.ts +4 -0
- package/dist/cli/remove-member.js +63 -0
- package/dist/cli/secret.js +9 -0
- package/dist/cli/start.js +62 -4
- package/dist/cli/status.d.ts +3 -0
- package/dist/cli/status.js +45 -12
- package/dist/cli/stop.js +64 -9
- package/dist/cli/uninstall.js +112 -16
- package/dist/cli/update.d.ts +4 -0
- package/dist/cli/update.js +52 -5
- package/dist/cli/watch.js +1 -1
- package/dist/cli/workflow.js +3 -2
- package/dist/commands/kb-server.d.ts +10 -1
- package/dist/commands/kb-server.js +292 -11
- package/dist/hub-service/http-server.d.ts +5 -1
- package/dist/hub-service/http-server.js +55 -5
- package/dist/index.js +177 -9
- package/dist/os/child-env-bound.d.ts +77 -0
- package/dist/os/child-env-bound.js +171 -0
- package/dist/os/git-executable.d.ts +57 -0
- package/dist/os/git-executable.js +85 -0
- package/dist/os/go-concurrency.d.ts +44 -0
- package/dist/os/go-concurrency.js +53 -0
- package/dist/os/index.d.ts +1 -0
- package/dist/os/index.js +1 -0
- package/dist/os/linux.d.ts +9 -2
- package/dist/os/linux.js +50 -15
- package/dist/os/macos.d.ts +1 -1
- package/dist/os/macos.js +2 -11
- package/dist/os/os-commands.d.ts +42 -2
- package/dist/os/os-commands.js +2 -0
- package/dist/os/windows-executable.d.ts +53 -0
- package/dist/os/windows-executable.js +185 -0
- package/dist/os/windows-gitbash.d.ts +24 -14
- package/dist/os/windows-gitbash.js +56 -18
- package/dist/os/windows-wrapper.d.ts +0 -4
- package/dist/os/windows-wrapper.js +2 -1
- package/dist/os/windows.d.ts +7 -2
- package/dist/os/windows.js +109 -32
- package/dist/paths.d.ts +30 -0
- package/dist/paths.js +52 -0
- package/dist/providers/agy.d.ts +6 -2
- package/dist/providers/agy.js +245 -106
- package/dist/providers/claude-permission-denial.d.ts +7 -0
- package/dist/providers/claude-permission-denial.js +137 -0
- package/dist/providers/claude.d.ts +86 -38
- package/dist/providers/claude.js +426 -164
- package/dist/providers/codex.js +5 -1
- package/dist/providers/copilot.js +5 -1
- package/dist/providers/opencode.d.ts +10 -2
- package/dist/providers/opencode.js +114 -53
- package/dist/providers/provider.d.ts +171 -33
- package/dist/providers/provider.js +164 -3
- package/dist/services/agent-provisioner.d.ts +29 -0
- package/dist/services/agent-provisioner.js +107 -0
- package/dist/services/agent-shadow.d.ts +96 -0
- package/dist/services/agent-shadow.js +479 -0
- package/dist/services/agy-project.d.ts +9 -2
- package/dist/services/agy-project.js +22 -19
- package/dist/services/auth-socket.d.ts +43 -0
- package/dist/services/auth-socket.js +97 -26
- package/dist/services/auth-web.js +1 -1
- package/dist/services/budget-awareness.d.ts +11 -11
- package/dist/services/budget-awareness.js +15 -3
- package/dist/services/claude-local-scope-mcp.d.ts +19 -0
- package/dist/services/claude-local-scope-mcp.js +91 -0
- package/dist/services/cloud/aws.js +2 -1
- package/dist/services/cloud/lifecycle.js +19 -2
- package/dist/services/cloud/task-wrapper.d.ts +0 -9
- package/dist/services/cloud/task-wrapper.js +15 -6
- package/dist/services/credential-store.d.ts +33 -0
- package/dist/services/credential-store.js +79 -2
- package/dist/services/event-loop-watchdog.d.ts +32 -0
- package/dist/services/event-loop-watchdog.js +140 -0
- package/dist/services/http-transport.d.ts +78 -1
- package/dist/services/http-transport.js +347 -52
- package/dist/services/in-flight-agents.d.ts +2 -0
- package/dist/services/in-flight-agents.js +4 -0
- package/dist/services/kb-tool-profile.d.ts +36 -0
- package/dist/services/kb-tool-profile.js +88 -0
- package/dist/services/knowledge/bible-basis-filter.d.ts +53 -0
- package/dist/services/knowledge/bible-basis-filter.js +134 -0
- package/dist/services/knowledge/bible-blob-id.d.ts +44 -0
- package/dist/services/knowledge/bible-blob-id.js +122 -0
- package/dist/services/knowledge/bible-import.d.ts +173 -0
- package/dist/services/knowledge/bible-import.js +344 -0
- package/dist/services/knowledge/file-hash.d.ts +31 -0
- package/dist/services/knowledge/file-hash.js +155 -24
- package/dist/services/knowledge/http-provider.d.ts +305 -21
- package/dist/services/knowledge/http-provider.js +801 -119
- package/dist/services/knowledge/kb-config.d.ts +65 -1
- package/dist/services/knowledge/kb-config.js +143 -3
- package/dist/services/knowledge/kb-http-auth-state.d.ts +26 -0
- package/dist/services/knowledge/kb-http-auth-state.js +40 -0
- package/dist/services/knowledge/kb-maintainer-grant.d.ts +15 -0
- package/dist/services/knowledge/kb-maintainer-grant.js +34 -0
- package/dist/services/knowledge/kb-providers.d.ts +13 -2
- package/dist/services/knowledge/kb-providers.js +75 -37
- package/dist/services/knowledge/kb-removed-scope-keys.d.ts +28 -0
- package/dist/services/knowledge/kb-removed-scope-keys.js +59 -0
- package/dist/services/knowledge/kb-scopes.d.ts +14 -0
- package/dist/services/knowledge/kb-scopes.js +47 -0
- package/dist/services/knowledge/kb-self.d.ts +204 -0
- package/dist/services/knowledge/kb-self.js +358 -0
- package/dist/services/knowledge/member-bible-view.d.ts +21 -0
- package/dist/services/knowledge/member-bible-view.js +207 -0
- package/dist/services/knowledge/path-validation.d.ts +7 -0
- package/dist/services/knowledge/path-validation.js +11 -0
- package/dist/services/knowledge/pre-init.js +1 -0
- package/dist/services/knowledge/project-slug.js +5 -4
- package/dist/services/knowledge/repository-header.d.ts +77 -0
- package/dist/services/knowledge/repository-header.js +233 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts +1 -1
- package/dist/services/knowledge/require-sqlite-project.js +1 -1
- package/dist/services/knowledge/sqlite-provider.d.ts +233 -11
- package/dist/services/knowledge/sqlite-provider.js +719 -45
- package/dist/services/knowledge/types.d.ts +59 -3
- package/dist/services/member-access-secret.d.ts +70 -0
- package/dist/services/member-access-secret.js +195 -0
- package/dist/services/member-busy.d.ts +12 -0
- package/dist/services/member-busy.js +20 -0
- package/dist/services/member-call-counts.d.ts +24 -0
- package/dist/services/member-call-counts.js +58 -0
- package/dist/services/member-config-io.d.ts +193 -0
- package/dist/services/member-config-io.js +446 -0
- package/dist/services/member-fleet-install.d.ts +710 -0
- package/dist/services/member-fleet-install.js +1896 -0
- package/dist/services/member-secret-env.d.ts +42 -0
- package/dist/services/member-secret-env.js +68 -0
- package/dist/services/member-tool-allowlist.d.ts +49 -0
- package/dist/services/member-tool-allowlist.js +115 -0
- package/dist/services/model-pricing.d.ts +19 -0
- package/dist/services/model-pricing.js +54 -8
- package/dist/services/port-holder.d.ts +86 -0
- package/dist/services/port-holder.js +352 -0
- package/dist/services/preflight-check.js +2 -0
- package/dist/services/registry.d.ts +13 -2
- package/dist/services/registry.js +27 -1
- package/dist/services/relay-strategy.d.ts +2 -0
- package/dist/services/relay-strategy.js +8 -0
- package/dist/services/server-lifecycle.d.ts +26 -0
- package/dist/services/server-lifecycle.js +85 -0
- package/dist/services/service-manager/index.d.ts +7 -1
- package/dist/services/service-manager/index.js +17 -4
- package/dist/services/service-manager/linux.d.ts +1 -1
- package/dist/services/service-manager/linux.js +15 -7
- package/dist/services/service-manager/macos.d.ts +11 -1
- package/dist/services/service-manager/macos.js +45 -7
- package/dist/services/service-manager/service-path.d.ts +24 -0
- package/dist/services/service-manager/service-path.js +55 -0
- package/dist/services/service-manager/types.d.ts +54 -3
- package/dist/services/service-manager/types.js +29 -0
- package/dist/services/service-manager/windows.d.ts +187 -3
- package/dist/services/service-manager/windows.js +684 -50
- package/dist/services/service-notice.d.ts +21 -0
- package/dist/services/service-notice.js +81 -0
- package/dist/services/service-start-guard.d.ts +20 -0
- package/dist/services/service-start-guard.js +86 -0
- package/dist/services/session-cost.d.ts +24 -0
- package/dist/services/session-cost.js +105 -0
- package/dist/services/session-mcp-config.d.ts +83 -0
- package/dist/services/session-mcp-config.js +211 -0
- package/dist/services/session-registry.d.ts +13 -0
- package/dist/services/session-registry.js +13 -0
- package/dist/services/session-roots.d.ts +67 -0
- package/dist/services/session-roots.js +126 -0
- package/dist/services/sftp.d.ts +34 -0
- package/dist/services/sftp.js +304 -76
- package/dist/services/shell-probe.d.ts +0 -24
- package/dist/services/shell-probe.js +28 -3
- package/dist/services/singleton.d.ts +68 -2
- package/dist/services/singleton.js +168 -11
- package/dist/services/sprint-coordination.js +9 -3
- package/dist/services/ssh.d.ts +27 -0
- package/dist/services/ssh.js +229 -38
- package/dist/services/stall/find-log-file.js +12 -5
- package/dist/services/stall/index.d.ts +1 -1
- package/dist/services/stall/read-log-tail.d.ts +23 -0
- package/dist/services/stall/read-log-tail.js +33 -2
- package/dist/services/stall/stall-detector.d.ts +25 -1
- package/dist/services/stall/stall-detector.js +85 -6
- package/dist/services/stall/stall-poller.d.ts +16 -0
- package/dist/services/stall/stall-poller.js +50 -6
- package/dist/services/statusline.d.ts +21 -0
- package/dist/services/statusline.js +97 -1
- package/dist/services/stopped-marker.d.ts +16 -0
- package/dist/services/stopped-marker.js +55 -0
- package/dist/services/strategy.d.ts +33 -1
- package/dist/services/strategy.js +86 -17
- package/dist/services/supervisor-service-cleanup.d.ts +52 -0
- package/dist/services/supervisor-service-cleanup.js +333 -0
- package/dist/services/tool-registry.d.ts +8 -1
- package/dist/services/tool-registry.js +251 -62
- package/dist/services/tool-scope.d.ts +91 -0
- package/dist/services/tool-scope.js +124 -0
- package/dist/services/vcs/azure-devops.js +10 -0
- package/dist/services/vcs/bitbucket.d.ts +22 -1
- package/dist/services/vcs/bitbucket.js +163 -17
- package/dist/services/vcs/types.d.ts +25 -2
- package/dist/services/watch/project-resolver.js +3 -1
- package/dist/skills/auto-sprint-args/SKILL.md +2 -2
- package/dist/skills/fleet-sprint-cli/SKILL.md +39 -15
- package/dist/skills/pm/SKILL.md +3 -3
- package/dist/skills/pm/cost.md +5 -1
- package/dist/skills/pm/index.md +11 -9
- package/dist/skills/pm/kb-reconcile.md +29 -14
- package/dist/skills/pm/kb-review.md +1 -0
- package/dist/skills/pm/sprint.md +7 -6
- package/dist/tools/check-status.d.ts +104 -5
- package/dist/tools/check-status.js +326 -57
- package/dist/tools/child-id-allocator.d.ts +2 -2
- package/dist/tools/child-id-allocator.js +1 -1
- package/dist/tools/code-index-heal.d.ts +8 -0
- package/dist/tools/code-index-heal.js +21 -0
- package/dist/tools/code-index-state.d.ts +45 -0
- package/dist/tools/code-index-state.js +115 -0
- package/dist/tools/code-intelligence-codebase-memory.js +6 -33
- package/dist/tools/code-intelligence-freshness.js +1 -1
- package/dist/tools/code-intelligence-gitnexus.d.ts +49 -0
- package/dist/tools/code-intelligence-gitnexus.js +488 -55
- package/dist/tools/code-intelligence-kb-enrich.js +7 -6
- package/dist/tools/code-intelligence-readiness.d.ts +156 -0
- package/dist/tools/code-intelligence-readiness.js +291 -0
- package/dist/tools/code-intelligence-reindex.d.ts +219 -0
- package/dist/tools/code-intelligence-reindex.js +602 -50
- package/dist/tools/code-intelligence-telemetry.d.ts +6 -1
- package/dist/tools/code-intelligence-telemetry.js +12 -3
- package/dist/tools/code-intelligence.d.ts +81 -31
- package/dist/tools/code-intelligence.js +156 -52
- package/dist/tools/compose-permissions.d.ts +57 -2
- package/dist/tools/compose-permissions.js +497 -44
- package/dist/tools/execute-command.d.ts +11 -0
- package/dist/tools/execute-command.js +92 -18
- package/dist/tools/execute-prompt.d.ts +59 -15
- package/dist/tools/execute-prompt.js +550 -135
- package/dist/tools/fleet-snapshot.d.ts +21 -0
- package/dist/tools/fleet-snapshot.js +78 -0
- package/dist/tools/kb-bible-commit.d.ts +79 -0
- package/dist/tools/kb-bible-commit.js +348 -0
- package/dist/tools/kb-capture.d.ts +15 -11
- package/dist/tools/kb-capture.js +42 -11
- package/dist/tools/kb-context.d.ts +27 -7
- package/dist/tools/kb-context.js +85 -14
- package/dist/tools/kb-demote.d.ts +27 -0
- package/dist/tools/kb-demote.js +37 -0
- package/dist/tools/kb-export.d.ts +128 -7
- package/dist/tools/kb-export.js +273 -67
- package/dist/tools/kb-feedback.d.ts +15 -9
- package/dist/tools/kb-feedback.js +27 -11
- package/dist/tools/kb-freshness-sweep.d.ts +11 -7
- package/dist/tools/kb-freshness-sweep.js +7 -7
- package/dist/tools/kb-harvest.d.ts +11 -7
- package/dist/tools/kb-harvest.js +35 -16
- package/dist/tools/kb-import.d.ts +42 -10
- package/dist/tools/kb-import.js +185 -160
- package/dist/tools/kb-invalidate.d.ts +26 -11
- package/dist/tools/kb-invalidate.js +118 -12
- package/dist/tools/kb-list.d.ts +14 -10
- package/dist/tools/kb-list.js +61 -13
- package/dist/tools/kb-promote.d.ts +11 -7
- package/dist/tools/kb-promote.js +16 -8
- package/dist/tools/kb-query.d.ts +24 -11
- package/dist/tools/kb-query.js +230 -23
- package/dist/tools/kb-reconcile-prefilter.d.ts +11 -7
- package/dist/tools/kb-reconcile-prefilter.js +10 -8
- package/dist/tools/kb-resolve-contradiction.d.ts +11 -7
- package/dist/tools/kb-resolve-contradiction.js +7 -7
- package/dist/tools/kb-session-prime.d.ts +14 -7
- package/dist/tools/kb-session-prime.js +127 -47
- package/dist/tools/kb-setup.d.ts +31 -4
- package/dist/tools/kb-setup.js +172 -20
- package/dist/tools/kb-stats.d.ts +11 -10
- package/dist/tools/kb-stats.js +22 -41
- package/dist/tools/list-members.js +6 -3
- package/dist/tools/member-detail.d.ts +3 -0
- package/dist/tools/member-detail.js +95 -20
- package/dist/tools/member-reservation.d.ts +2 -2
- package/dist/tools/provision-auth.d.ts +39 -1
- package/dist/tools/provision-auth.js +269 -47
- package/dist/tools/provision-vcs-auth.d.ts +30 -5
- package/dist/tools/provision-vcs-auth.js +53 -7
- package/dist/tools/receive-files.js +8 -3
- package/dist/tools/register-member.d.ts +34 -8
- package/dist/tools/register-member.js +76 -58
- package/dist/tools/remove-member.js +110 -32
- package/dist/tools/send-email.d.ts +2 -2
- package/dist/tools/send-files.js +9 -6
- package/dist/tools/send-message.d.ts +3 -0
- package/dist/tools/send-message.js +15 -2
- package/dist/tools/session-stats.d.ts +17 -0
- package/dist/tools/session-stats.js +27 -0
- package/dist/tools/shutdown-server.js +5 -0
- package/dist/tools/stop-prompt.js +3 -1
- package/dist/tools/update-agent-cli.d.ts +19 -0
- package/dist/tools/update-agent-cli.js +59 -2
- package/dist/tools/update-member.d.ts +13 -10
- package/dist/tools/update-member.js +138 -7
- package/dist/tools/vcs-credential-exec.d.ts +45 -3
- package/dist/tools/vcs-credential-exec.js +98 -13
- package/dist/types.d.ts +98 -1
- package/dist/utils/agent-helpers.js +2 -0
- package/dist/utils/auth-env.d.ts +15 -4
- package/dist/utils/auth-env.js +52 -23
- package/dist/utils/find-on-path.d.ts +37 -0
- package/dist/utils/find-on-path.js +85 -0
- package/dist/utils/log-helpers.d.ts +37 -0
- package/dist/utils/log-helpers.js +106 -20
- package/dist/utils/owner-only-fs.d.ts +56 -0
- package/dist/utils/owner-only-fs.js +98 -0
- package/dist/utils/process-utils.d.ts +28 -0
- package/dist/utils/process-utils.js +72 -0
- package/dist/utils/prompt-errors.js +4 -1
- package/dist/utils/redact-known-secrets.d.ts +17 -0
- package/dist/utils/redact-known-secrets.js +70 -0
- package/dist/utils/session-caller.d.ts +4 -2
- package/dist/utils/session-caller.js +3 -2
- package/dist/utils/shell-escape.d.ts +42 -3
- package/dist/utils/shell-escape.js +70 -4
- package/dist/utils/skill-matrix.js +1 -1
- package/dist/utils/ssh-error-messages.js +3 -0
- package/dist/utils/vcs-provider-detect.js +2 -2
- package/dist/utils/workspace-trust.d.ts +24 -1
- package/dist/utils/workspace-trust.js +21 -17
- package/dist/workflows/auto-sprint.js +468 -52
- package/package.json +15 -9
- package/packages/apra-fleet-client/package.json +2 -2
- package/packages/apra-fleet-client/src/client/api.mjs +722 -38
- package/packages/apra-fleet-client/src/client/auto-start.mjs +434 -0
- package/packages/apra-fleet-client/src/client/client.mjs +9 -0
- package/packages/apra-fleet-client/src/client/factory.mjs +23 -4
- package/packages/apra-fleet-client/src/client/reconnecting-transport.mjs +170 -0
- package/packages/apra-fleet-client/src/client/server-resolution.mjs +267 -30
- package/packages/apra-fleet-client/src/client/transport.mjs +43 -3
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +80 -27
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +42 -22
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +59 -24
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +111 -41
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +60 -48
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +45 -23
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +34 -7
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +54 -24
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +71 -43
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +106 -78
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +170 -57
- package/packages/apra-fleet-se/apra-pm/agents/schemas/backlog-groomer-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/deployer-output.json +5 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +110 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-input.json +1 -5
- package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +41 -7
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +166 -5
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +3 -3
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +5 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +11 -9
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +29 -14
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +1 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/sprint.md +7 -6
- package/packages/apra-fleet-se/bin/cli.mjs +282 -79
- package/packages/apra-fleet-se/bin/serve.mjs +186 -15
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +234 -46
- package/packages/apra-fleet-se/fleet-sprint/backlog-role.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/bd-sync-command.mjs +69 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +229 -53
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +576 -33
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +9 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-lock-probe.mjs +176 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-memory-hygiene.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-reachability.mjs +126 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +271 -7
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +154 -8
- package/packages/apra-fleet-se/fleet-sprint/ci-gate.mjs +353 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +12 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +142 -3
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +48 -8
- package/packages/apra-fleet-se/fleet-sprint/decision-notify.mjs +338 -0
- package/packages/apra-fleet-se/fleet-sprint/decision-wait.mjs +731 -0
- package/packages/apra-fleet-se/fleet-sprint/decisions.mjs +372 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-accounting.mjs +270 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +22 -2
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +244 -22
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +56 -15
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +6 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/fleet-sprint-diagram.md +3 -3
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +9 -3
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +651 -37
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +282 -15
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +4 -4
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +207 -10
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +169 -10
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +88 -5
- package/packages/apra-fleet-se/fleet-sprint/kb-hints.mjs +181 -0
- package/packages/apra-fleet-se/fleet-sprint/kb-injection.mjs +64 -0
- package/packages/apra-fleet-se/fleet-sprint/kb-maintainer.mjs +298 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +1896 -305
- package/packages/apra-fleet-se/fleet-sprint/lower-quality.mjs +39 -0
- package/packages/apra-fleet-se/fleet-sprint/member-align.mjs +391 -0
- package/packages/apra-fleet-se/fleet-sprint/member-call.mjs +374 -0
- package/packages/apra-fleet-se/fleet-sprint/member-init-probe.mjs +644 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +454 -1
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +250 -29
- package/packages/apra-fleet-se/fleet-sprint/orphan-reclaim.mjs +153 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +129 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +302 -52
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +1 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +142 -21
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +118 -36
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +6 -6
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +27 -18
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +99 -52
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +58 -10
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +16 -11
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +36 -3
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +90 -15
- package/packages/apra-fleet-se/fleet-sprint/pr-body.mjs +272 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +113 -28
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +19 -1
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1631 -213
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +26 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +183 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +138 -0
- package/packages/apra-fleet-se/fleet-sprint/set-aside.mjs +288 -0
- package/packages/apra-fleet-se/fleet-sprint/shell-command-guard.mjs +44 -1
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +39 -15
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +87 -32
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +158 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +132 -11
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +31 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +7 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +774 -35
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +134 -7
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +99 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +811 -17
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +223 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +138 -1
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +8 -4
- package/packages/apra-fleet-se/fleet-sprint/verify-block.mjs +152 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +460 -23
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +59 -3
- package/packages/apra-fleet-se/package.json +2 -2
- package/packages/apra-fleet-se/src/supervisor/api.mjs +1059 -0
- package/packages/apra-fleet-se/src/supervisor/backlog-member.mjs +332 -0
- package/packages/apra-fleet-se/src/supervisor/backlog.mjs +982 -0
- package/packages/apra-fleet-se/src/supervisor/beads-identity.mjs +246 -0
- package/packages/apra-fleet-se/src/supervisor/beads-view.mjs +438 -0
- package/packages/apra-fleet-se/src/supervisor/child-port.mjs +36 -0
- package/packages/apra-fleet-se/src/supervisor/dashboard.mjs +1662 -0
- package/packages/apra-fleet-se/src/supervisor/dolt-mutex.mjs +370 -0
- package/packages/apra-fleet-se/src/supervisor/dolt-orphan-sweep.mjs +338 -0
- package/packages/apra-fleet-se/src/supervisor/fleet-members.mjs +292 -0
- package/packages/apra-fleet-se/src/supervisor/history-view.mjs +276 -0
- package/packages/apra-fleet-se/src/supervisor/history.mjs +335 -0
- package/packages/apra-fleet-se/src/supervisor/id-allocator.mjs +611 -0
- package/packages/apra-fleet-se/src/supervisor/launch-form.mjs +444 -0
- package/packages/apra-fleet-se/src/supervisor/ledger.mjs +629 -0
- package/packages/apra-fleet-se/src/supervisor/lib/exec-bd.mjs +303 -0
- package/packages/apra-fleet-se/src/supervisor/log-timestamp.mjs +51 -0
- package/packages/apra-fleet-se/src/supervisor/log-view.mjs +159 -0
- package/packages/apra-fleet-se/src/supervisor/proxy.mjs +499 -0
- package/packages/apra-fleet-se/src/supervisor/readopt.mjs +136 -0
- package/packages/apra-fleet-se/src/supervisor/reconcile.mjs +263 -0
- package/packages/apra-fleet-se/src/supervisor/rename-with-retry.mjs +87 -0
- package/packages/apra-fleet-se/src/supervisor/scope-overlap.mjs +327 -0
- package/packages/apra-fleet-se/src/supervisor/self-log.mjs +133 -0
- package/packages/apra-fleet-se/src/supervisor/server.mjs +542 -0
- package/packages/apra-fleet-se/src/supervisor/spawner.mjs +544 -0
- package/packages/apra-fleet-se/src/supervisor/sprint-identity.mjs +96 -0
- package/packages/apra-fleet-se/src/supervisor/watchdog.mjs +993 -0
- package/packages/apra-fleet-workflow/package.json +3 -2
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +150 -14
- package/packages/apra-fleet-workflow/src/viewer/request-guard.mjs +222 -0
- package/packages/apra-fleet-workflow/src/viewer/run-summary.mjs +127 -0
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +105 -7
- package/packages/apra-fleet-workflow/src/workflow/pricing.mjs +75 -25
- package/plugins/claude-code/fleet-status/.claude-plugin/plugin.json +7 -0
- package/plugins/claude-code/fleet-status/hooks/hooks.json +1 -0
- package/plugins/claude-code/fleet-status/hooks/register.tsx +906 -0
- package/plugins/claude-code/fleet-status/types/index.d.ts +88 -0
- package/skills/fleet/auth-bitbucket.md +47 -20
- package/skills/fleet/onboarding.md +1 -1
- package/skills/fleet/permissions.md +9 -0
- package/skills/fleet/profiles/tag-kb-reconciler.json +2 -6
- package/skills/fleet/skill-matrix.md +3 -3
- package/version.json +1 -1
- package/dist/cli/agent-transform.d.ts.map +0 -1
- package/dist/cli/agent-transform.js.map +0 -1
- package/dist/cli/auth.d.ts.map +0 -1
- package/dist/cli/auth.js.map +0 -1
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/dolt-install.d.ts.map +0 -1
- package/dist/cli/dolt-install.js.map +0 -1
- package/dist/cli/install-guard.d.ts.map +0 -1
- package/dist/cli/install-guard.js.map +0 -1
- package/dist/cli/install.d.ts.map +0 -1
- package/dist/cli/install.js.map +0 -1
- package/dist/cli/join.d.ts.map +0 -1
- package/dist/cli/join.js.map +0 -1
- package/dist/cli/kb-commit.d.ts.map +0 -1
- package/dist/cli/kb-commit.js.map +0 -1
- package/dist/cli/kb-directives.d.ts.map +0 -1
- package/dist/cli/kb-directives.js.map +0 -1
- package/dist/cli/kb-import.d.ts.map +0 -1
- package/dist/cli/kb-import.js.map +0 -1
- package/dist/cli/register-member.d.ts.map +0 -1
- package/dist/cli/register-member.js.map +0 -1
- package/dist/cli/restart.d.ts.map +0 -1
- package/dist/cli/restart.js.map +0 -1
- package/dist/cli/secret.d.ts.map +0 -1
- package/dist/cli/secret.js.map +0 -1
- package/dist/cli/spoke.d.ts.map +0 -1
- package/dist/cli/spoke.js.map +0 -1
- package/dist/cli/start.d.ts.map +0 -1
- package/dist/cli/start.js.map +0 -1
- package/dist/cli/status.d.ts.map +0 -1
- package/dist/cli/status.js.map +0 -1
- package/dist/cli/stop.d.ts.map +0 -1
- package/dist/cli/stop.js.map +0 -1
- package/dist/cli/uninstall.d.ts.map +0 -1
- package/dist/cli/uninstall.js.map +0 -1
- package/dist/cli/update.d.ts.map +0 -1
- package/dist/cli/update.js.map +0 -1
- package/dist/cli/watch.d.ts.map +0 -1
- package/dist/cli/watch.js.map +0 -1
- package/dist/cli/workflow-assets.d.ts.map +0 -1
- package/dist/cli/workflow-assets.js.map +0 -1
- package/dist/cli/workflow.d.ts.map +0 -1
- package/dist/cli/workflow.js.map +0 -1
- package/dist/commands/kb-server.d.ts.map +0 -1
- package/dist/commands/kb-server.js.map +0 -1
- package/dist/delivery-mode.d.ts.map +0 -1
- package/dist/delivery-mode.js.map +0 -1
- package/dist/hub-service/activity.d.ts.map +0 -1
- package/dist/hub-service/activity.js.map +0 -1
- package/dist/hub-service/audit-log.d.ts.map +0 -1
- package/dist/hub-service/audit-log.js.map +0 -1
- package/dist/hub-service/db/pool.d.ts.map +0 -1
- package/dist/hub-service/db/pool.js.map +0 -1
- package/dist/hub-service/enrollment.d.ts.map +0 -1
- package/dist/hub-service/enrollment.js.map +0 -1
- package/dist/hub-service/envelope-routes.d.ts.map +0 -1
- package/dist/hub-service/envelope-routes.js.map +0 -1
- package/dist/hub-service/handlers/installers.d.ts.map +0 -1
- package/dist/hub-service/handlers/installers.js.map +0 -1
- package/dist/hub-service/http-server.d.ts.map +0 -1
- package/dist/hub-service/http-server.js.map +0 -1
- package/dist/hub-service/hub-jwt.d.ts.map +0 -1
- package/dist/hub-service/hub-jwt.js.map +0 -1
- package/dist/hub-service/jwt-revocation.d.ts.map +0 -1
- package/dist/hub-service/jwt-revocation.js.map +0 -1
- package/dist/hub-service/machines.d.ts.map +0 -1
- package/dist/hub-service/machines.js.map +0 -1
- package/dist/hub-service/main.d.ts.map +0 -1
- package/dist/hub-service/main.js.map +0 -1
- package/dist/hub-service/member-tokens.d.ts.map +0 -1
- package/dist/hub-service/member-tokens.js.map +0 -1
- package/dist/hub-service/member-view.d.ts.map +0 -1
- package/dist/hub-service/member-view.js.map +0 -1
- package/dist/hub-service/members.d.ts.map +0 -1
- package/dist/hub-service/members.js.map +0 -1
- package/dist/hub-service/presence.d.ts.map +0 -1
- package/dist/hub-service/presence.js.map +0 -1
- package/dist/hub-service/project-view.d.ts.map +0 -1
- package/dist/hub-service/project-view.js.map +0 -1
- package/dist/hub-service/projects.d.ts.map +0 -1
- package/dist/hub-service/projects.js.map +0 -1
- package/dist/hub-service/relay-queue.d.ts.map +0 -1
- package/dist/hub-service/relay-queue.js.map +0 -1
- package/dist/hub-service/session-jwt.d.ts.map +0 -1
- package/dist/hub-service/session-jwt.js.map +0 -1
- package/dist/hub-service/usage.d.ts.map +0 -1
- package/dist/hub-service/usage.js.map +0 -1
- package/dist/hub-service/users.d.ts.map +0 -1
- package/dist/hub-service/users.js.map +0 -1
- package/dist/hub-service/workspaces.d.ts.map +0 -1
- package/dist/hub-service/workspaces.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/onboarding/text.d.ts.map +0 -1
- package/dist/onboarding/text.js.map +0 -1
- package/dist/os/git-bash-candidates.d.ts.map +0 -1
- package/dist/os/git-bash-candidates.js.map +0 -1
- package/dist/os/index.d.ts.map +0 -1
- package/dist/os/index.js.map +0 -1
- package/dist/os/linux.d.ts.map +0 -1
- package/dist/os/linux.js.map +0 -1
- package/dist/os/macos.d.ts.map +0 -1
- package/dist/os/macos.js.map +0 -1
- package/dist/os/os-commands.d.ts.map +0 -1
- package/dist/os/os-commands.js.map +0 -1
- package/dist/os/windows-gitbash.d.ts.map +0 -1
- package/dist/os/windows-gitbash.js.map +0 -1
- package/dist/os/windows-wrapper.d.ts.map +0 -1
- package/dist/os/windows-wrapper.js.map +0 -1
- package/dist/os/windows.d.ts.map +0 -1
- package/dist/os/windows.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/providers/agy.d.ts.map +0 -1
- package/dist/providers/agy.js.map +0 -1
- package/dist/providers/claude.d.ts.map +0 -1
- package/dist/providers/claude.js.map +0 -1
- package/dist/providers/codex.d.ts.map +0 -1
- package/dist/providers/codex.js.map +0 -1
- package/dist/providers/copilot.d.ts.map +0 -1
- package/dist/providers/copilot.js.map +0 -1
- package/dist/providers/email/headers.d.ts.map +0 -1
- package/dist/providers/email/headers.js.map +0 -1
- package/dist/providers/email/index.d.ts.map +0 -1
- package/dist/providers/email/index.js.map +0 -1
- package/dist/providers/email/provider.d.ts.map +0 -1
- package/dist/providers/email/provider.js.map +0 -1
- package/dist/providers/email/sendgrid.d.ts.map +0 -1
- package/dist/providers/email/sendgrid.js.map +0 -1
- package/dist/providers/email/smtp.d.ts.map +0 -1
- package/dist/providers/email/smtp.js.map +0 -1
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/none.d.ts.map +0 -1
- package/dist/providers/none.js.map +0 -1
- package/dist/providers/opencode.d.ts.map +0 -1
- package/dist/providers/opencode.js.map +0 -1
- package/dist/providers/provider.d.ts.map +0 -1
- package/dist/providers/provider.js.map +0 -1
- package/dist/services/agent-provisioner.d.ts.map +0 -1
- package/dist/services/agent-provisioner.js.map +0 -1
- package/dist/services/agy-project.d.ts.map +0 -1
- package/dist/services/agy-project.js.map +0 -1
- package/dist/services/auth-socket.d.ts.map +0 -1
- package/dist/services/auth-socket.js.map +0 -1
- package/dist/services/auth-web.d.ts.map +0 -1
- package/dist/services/auth-web.js.map +0 -1
- package/dist/services/budget-awareness.d.ts.map +0 -1
- package/dist/services/budget-awareness.js.map +0 -1
- package/dist/services/cloud/activity.d.ts.map +0 -1
- package/dist/services/cloud/activity.js.map +0 -1
- package/dist/services/cloud/aws.d.ts.map +0 -1
- package/dist/services/cloud/aws.js.map +0 -1
- package/dist/services/cloud/cost.d.ts.map +0 -1
- package/dist/services/cloud/cost.js.map +0 -1
- package/dist/services/cloud/idle-manager.d.ts.map +0 -1
- package/dist/services/cloud/idle-manager.js.map +0 -1
- package/dist/services/cloud/lifecycle.d.ts.map +0 -1
- package/dist/services/cloud/lifecycle.js.map +0 -1
- package/dist/services/cloud/task-wrapper.d.ts.map +0 -1
- package/dist/services/cloud/task-wrapper.js.map +0 -1
- package/dist/services/cloud/types.d.ts.map +0 -1
- package/dist/services/cloud/types.js.map +0 -1
- package/dist/services/cloud-sync.d.ts.map +0 -1
- package/dist/services/cloud-sync.js.map +0 -1
- package/dist/services/context-admission.d.ts.map +0 -1
- package/dist/services/context-admission.js.map +0 -1
- package/dist/services/credential-cleanup.d.ts.map +0 -1
- package/dist/services/credential-cleanup.js.map +0 -1
- package/dist/services/credential-store.d.ts.map +0 -1
- package/dist/services/credential-store.js.map +0 -1
- package/dist/services/event-bus.d.ts.map +0 -1
- package/dist/services/event-bus.js.map +0 -1
- package/dist/services/exit-drain.d.ts.map +0 -1
- package/dist/services/exit-drain.js.map +0 -1
- package/dist/services/file-chunker.d.ts.map +0 -1
- package/dist/services/file-chunker.js.map +0 -1
- package/dist/services/file-transfer-relay.d.ts.map +0 -1
- package/dist/services/file-transfer-relay.js.map +0 -1
- package/dist/services/file-transfer.d.ts.map +0 -1
- package/dist/services/file-transfer.js.map +0 -1
- package/dist/services/git-config.d.ts.map +0 -1
- package/dist/services/git-config.js.map +0 -1
- package/dist/services/github-app.d.ts.map +0 -1
- package/dist/services/github-app.js.map +0 -1
- package/dist/services/http-transport.d.ts.map +0 -1
- package/dist/services/http-transport.js.map +0 -1
- package/dist/services/hub-client.d.ts.map +0 -1
- package/dist/services/hub-client.js.map +0 -1
- package/dist/services/icons.d.ts.map +0 -1
- package/dist/services/icons.js.map +0 -1
- package/dist/services/jwt.d.ts.map +0 -1
- package/dist/services/jwt.js.map +0 -1
- package/dist/services/knowledge/audn.d.ts.map +0 -1
- package/dist/services/knowledge/audn.js.map +0 -1
- package/dist/services/knowledge/file-hash.d.ts.map +0 -1
- package/dist/services/knowledge/file-hash.js.map +0 -1
- package/dist/services/knowledge/http-provider.d.ts.map +0 -1
- package/dist/services/knowledge/http-provider.js.map +0 -1
- package/dist/services/knowledge/kb-config.d.ts.map +0 -1
- package/dist/services/knowledge/kb-config.js.map +0 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +0 -1
- package/dist/services/knowledge/kb-providers.js.map +0 -1
- package/dist/services/knowledge/kb-scope-input.d.ts +0 -5
- package/dist/services/knowledge/kb-scope-input.d.ts.map +0 -1
- package/dist/services/knowledge/kb-scope-input.js +0 -11
- package/dist/services/knowledge/kb-scope-input.js.map +0 -1
- package/dist/services/knowledge/kb-service.d.ts.map +0 -1
- package/dist/services/knowledge/kb-service.js.map +0 -1
- package/dist/services/knowledge/path-validation.d.ts.map +0 -1
- package/dist/services/knowledge/path-validation.js.map +0 -1
- package/dist/services/knowledge/pre-init.d.ts.map +0 -1
- package/dist/services/knowledge/pre-init.js.map +0 -1
- package/dist/services/knowledge/project-slug.d.ts.map +0 -1
- package/dist/services/knowledge/project-slug.js.map +0 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +0 -1
- package/dist/services/knowledge/require-sqlite-project.js.map +0 -1
- package/dist/services/knowledge/sqlite-provider.d.ts.map +0 -1
- package/dist/services/knowledge/sqlite-provider.js.map +0 -1
- package/dist/services/knowledge/types.d.ts.map +0 -1
- package/dist/services/knowledge/types.js.map +0 -1
- package/dist/services/known-hosts.d.ts.map +0 -1
- package/dist/services/known-hosts.js.map +0 -1
- package/dist/services/known-sessions.d.ts.map +0 -1
- package/dist/services/known-sessions.js.map +0 -1
- package/dist/services/member-home.d.ts.map +0 -1
- package/dist/services/member-home.js.map +0 -1
- package/dist/services/member-remote-url.d.ts.map +0 -1
- package/dist/services/member-remote-url.js.map +0 -1
- package/dist/services/model-pricing.d.ts.map +0 -1
- package/dist/services/model-pricing.js.map +0 -1
- package/dist/services/onboarding.d.ts.map +0 -1
- package/dist/services/onboarding.js.map +0 -1
- package/dist/services/orphan-recovery.d.ts.map +0 -1
- package/dist/services/orphan-recovery.js.map +0 -1
- package/dist/services/pending-responses.d.ts.map +0 -1
- package/dist/services/pending-responses.js.map +0 -1
- package/dist/services/preflight-check.d.ts.map +0 -1
- package/dist/services/preflight-check.js.map +0 -1
- package/dist/services/registry.d.ts.map +0 -1
- package/dist/services/registry.js.map +0 -1
- package/dist/services/relay-context.d.ts.map +0 -1
- package/dist/services/relay-context.js.map +0 -1
- package/dist/services/relay-executor.d.ts.map +0 -1
- package/dist/services/relay-executor.js.map +0 -1
- package/dist/services/relay-request.d.ts.map +0 -1
- package/dist/services/relay-request.js.map +0 -1
- package/dist/services/relay-strategy.d.ts.map +0 -1
- package/dist/services/relay-strategy.js.map +0 -1
- package/dist/services/secret-token.d.ts.map +0 -1
- package/dist/services/secret-token.js.map +0 -1
- package/dist/services/service-manager/index.d.ts.map +0 -1
- package/dist/services/service-manager/index.js.map +0 -1
- package/dist/services/service-manager/linux.d.ts.map +0 -1
- package/dist/services/service-manager/linux.js.map +0 -1
- package/dist/services/service-manager/macos.d.ts.map +0 -1
- package/dist/services/service-manager/macos.js.map +0 -1
- package/dist/services/service-manager/types.d.ts.map +0 -1
- package/dist/services/service-manager/types.js.map +0 -1
- package/dist/services/service-manager/windows.d.ts.map +0 -1
- package/dist/services/service-manager/windows.js.map +0 -1
- package/dist/services/session-registry.d.ts.map +0 -1
- package/dist/services/session-registry.js.map +0 -1
- package/dist/services/sftp.d.ts.map +0 -1
- package/dist/services/sftp.js.map +0 -1
- package/dist/services/shell-probe.d.ts.map +0 -1
- package/dist/services/shell-probe.js.map +0 -1
- package/dist/services/singleton.d.ts.map +0 -1
- package/dist/services/singleton.js.map +0 -1
- package/dist/services/sprint-coordination.d.ts.map +0 -1
- package/dist/services/sprint-coordination.js.map +0 -1
- package/dist/services/ssh.d.ts.map +0 -1
- package/dist/services/ssh.js.map +0 -1
- package/dist/services/stall/find-log-file.d.ts.map +0 -1
- package/dist/services/stall/find-log-file.js.map +0 -1
- package/dist/services/stall/index.d.ts.map +0 -1
- package/dist/services/stall/index.js.map +0 -1
- package/dist/services/stall/log-path-resolver.d.ts.map +0 -1
- package/dist/services/stall/log-path-resolver.js.map +0 -1
- package/dist/services/stall/read-log-tail.d.ts.map +0 -1
- package/dist/services/stall/read-log-tail.js.map +0 -1
- package/dist/services/stall/stall-detector.d.ts.map +0 -1
- package/dist/services/stall/stall-detector.js.map +0 -1
- package/dist/services/stall/stall-poller.d.ts.map +0 -1
- package/dist/services/stall/stall-poller.js.map +0 -1
- package/dist/services/stall/time-utils.d.ts.map +0 -1
- package/dist/services/stall/time-utils.js.map +0 -1
- package/dist/services/statusline.d.ts.map +0 -1
- package/dist/services/statusline.js.map +0 -1
- package/dist/services/strategy.d.ts.map +0 -1
- package/dist/services/strategy.js.map +0 -1
- package/dist/services/substitution-engine.d.ts.map +0 -1
- package/dist/services/substitution-engine.js.map +0 -1
- package/dist/services/task-cleanup.d.ts.map +0 -1
- package/dist/services/task-cleanup.js.map +0 -1
- package/dist/services/token-issuer.d.ts.map +0 -1
- package/dist/services/token-issuer.js.map +0 -1
- package/dist/services/tool-registry.d.ts.map +0 -1
- package/dist/services/tool-registry.js.map +0 -1
- package/dist/services/update-check.d.ts.map +0 -1
- package/dist/services/update-check.js.map +0 -1
- package/dist/services/user-config.d.ts.map +0 -1
- package/dist/services/user-config.js.map +0 -1
- package/dist/services/vcs/azure-devops.d.ts.map +0 -1
- package/dist/services/vcs/azure-devops.js.map +0 -1
- package/dist/services/vcs/bitbucket.d.ts.map +0 -1
- package/dist/services/vcs/bitbucket.js.map +0 -1
- package/dist/services/vcs/constants.d.ts.map +0 -1
- package/dist/services/vcs/constants.js.map +0 -1
- package/dist/services/vcs/github.d.ts.map +0 -1
- package/dist/services/vcs/github.js.map +0 -1
- package/dist/services/vcs/types.d.ts.map +0 -1
- package/dist/services/vcs/types.js.map +0 -1
- package/dist/services/version-check.d.ts.map +0 -1
- package/dist/services/version-check.js.map +0 -1
- package/dist/services/watch/fleet-log.d.ts.map +0 -1
- package/dist/services/watch/fleet-log.js.map +0 -1
- package/dist/services/watch/project-resolver.d.ts.map +0 -1
- package/dist/services/watch/project-resolver.js.map +0 -1
- package/dist/services/watch/transcript-formatter.d.ts.map +0 -1
- package/dist/services/watch/transcript-formatter.js.map +0 -1
- package/dist/smoke-test.d.ts.map +0 -1
- package/dist/smoke-test.js.map +0 -1
- package/dist/tools/check-status.d.ts.map +0 -1
- package/dist/tools/check-status.js.map +0 -1
- package/dist/tools/child-id-allocator.d.ts.map +0 -1
- package/dist/tools/child-id-allocator.js.map +0 -1
- package/dist/tools/cloud-control.d.ts.map +0 -1
- package/dist/tools/cloud-control.js.map +0 -1
- package/dist/tools/code-intelligence-codebase-memory.d.ts.map +0 -1
- package/dist/tools/code-intelligence-codebase-memory.js.map +0 -1
- package/dist/tools/code-intelligence-freshness.d.ts.map +0 -1
- package/dist/tools/code-intelligence-freshness.js.map +0 -1
- package/dist/tools/code-intelligence-gitnexus.d.ts.map +0 -1
- package/dist/tools/code-intelligence-gitnexus.js.map +0 -1
- package/dist/tools/code-intelligence-kb-enrich.d.ts.map +0 -1
- package/dist/tools/code-intelligence-kb-enrich.js.map +0 -1
- package/dist/tools/code-intelligence-reindex.d.ts.map +0 -1
- package/dist/tools/code-intelligence-reindex.js.map +0 -1
- package/dist/tools/code-intelligence-telemetry.d.ts.map +0 -1
- package/dist/tools/code-intelligence-telemetry.js.map +0 -1
- package/dist/tools/code-intelligence-tests.d.ts.map +0 -1
- package/dist/tools/code-intelligence-tests.js.map +0 -1
- package/dist/tools/code-intelligence.d.ts.map +0 -1
- package/dist/tools/code-intelligence.js.map +0 -1
- package/dist/tools/compose-permissions.d.ts.map +0 -1
- package/dist/tools/compose-permissions.js.map +0 -1
- package/dist/tools/credential-store-delete.d.ts.map +0 -1
- package/dist/tools/credential-store-delete.js.map +0 -1
- package/dist/tools/credential-store-list.d.ts.map +0 -1
- package/dist/tools/credential-store-list.js.map +0 -1
- package/dist/tools/credential-store-set.d.ts.map +0 -1
- package/dist/tools/credential-store-set.js.map +0 -1
- package/dist/tools/credential-store-update.d.ts.map +0 -1
- package/dist/tools/credential-store-update.js.map +0 -1
- package/dist/tools/dolt-push-mutex.d.ts.map +0 -1
- package/dist/tools/dolt-push-mutex.js.map +0 -1
- package/dist/tools/execute-command.d.ts.map +0 -1
- package/dist/tools/execute-command.js.map +0 -1
- package/dist/tools/execute-prompt.d.ts.map +0 -1
- package/dist/tools/execute-prompt.js.map +0 -1
- package/dist/tools/get-member-model-pricing.d.ts.map +0 -1
- package/dist/tools/get-member-model-pricing.js.map +0 -1
- package/dist/tools/kb-capture.d.ts.map +0 -1
- package/dist/tools/kb-capture.js.map +0 -1
- package/dist/tools/kb-context.d.ts.map +0 -1
- package/dist/tools/kb-context.js.map +0 -1
- package/dist/tools/kb-export.d.ts.map +0 -1
- package/dist/tools/kb-export.js.map +0 -1
- package/dist/tools/kb-feedback.d.ts.map +0 -1
- package/dist/tools/kb-feedback.js.map +0 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +0 -1
- package/dist/tools/kb-freshness-sweep.js.map +0 -1
- package/dist/tools/kb-harvest.d.ts.map +0 -1
- package/dist/tools/kb-harvest.js.map +0 -1
- package/dist/tools/kb-import.d.ts.map +0 -1
- package/dist/tools/kb-import.js.map +0 -1
- package/dist/tools/kb-invalidate.d.ts.map +0 -1
- package/dist/tools/kb-invalidate.js.map +0 -1
- package/dist/tools/kb-list.d.ts.map +0 -1
- package/dist/tools/kb-list.js.map +0 -1
- package/dist/tools/kb-promote.d.ts.map +0 -1
- package/dist/tools/kb-promote.js.map +0 -1
- package/dist/tools/kb-query.d.ts.map +0 -1
- package/dist/tools/kb-query.js.map +0 -1
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +0 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +0 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +0 -1
- package/dist/tools/kb-resolve-contradiction.js.map +0 -1
- package/dist/tools/kb-session-prime.d.ts.map +0 -1
- package/dist/tools/kb-session-prime.js.map +0 -1
- package/dist/tools/kb-setup.d.ts.map +0 -1
- package/dist/tools/kb-setup.js.map +0 -1
- package/dist/tools/kb-stats.d.ts.map +0 -1
- package/dist/tools/kb-stats.js.map +0 -1
- package/dist/tools/list-members.d.ts.map +0 -1
- package/dist/tools/list-members.js.map +0 -1
- package/dist/tools/member-detail.d.ts.map +0 -1
- package/dist/tools/member-detail.js.map +0 -1
- package/dist/tools/member-reservation.d.ts.map +0 -1
- package/dist/tools/member-reservation.js.map +0 -1
- package/dist/tools/monitor-task.d.ts.map +0 -1
- package/dist/tools/monitor-task.js.map +0 -1
- package/dist/tools/provision-auth.d.ts.map +0 -1
- package/dist/tools/provision-auth.js.map +0 -1
- package/dist/tools/provision-vcs-auth.d.ts.map +0 -1
- package/dist/tools/provision-vcs-auth.js.map +0 -1
- package/dist/tools/receive-files.d.ts.map +0 -1
- package/dist/tools/receive-files.js.map +0 -1
- package/dist/tools/register-member.d.ts.map +0 -1
- package/dist/tools/register-member.js.map +0 -1
- package/dist/tools/remove-member.d.ts.map +0 -1
- package/dist/tools/remove-member.js.map +0 -1
- package/dist/tools/report-status.d.ts.map +0 -1
- package/dist/tools/report-status.js.map +0 -1
- package/dist/tools/respond-to-message.d.ts.map +0 -1
- package/dist/tools/respond-to-message.js.map +0 -1
- package/dist/tools/revoke-vcs-auth.d.ts.map +0 -1
- package/dist/tools/revoke-vcs-auth.js.map +0 -1
- package/dist/tools/send-email.d.ts.map +0 -1
- package/dist/tools/send-email.js.map +0 -1
- package/dist/tools/send-files.d.ts.map +0 -1
- package/dist/tools/send-files.js.map +0 -1
- package/dist/tools/send-message.d.ts.map +0 -1
- package/dist/tools/send-message.js.map +0 -1
- package/dist/tools/setup-git-app.d.ts.map +0 -1
- package/dist/tools/setup-git-app.js.map +0 -1
- package/dist/tools/setup-ssh-key.d.ts.map +0 -1
- package/dist/tools/setup-ssh-key.js.map +0 -1
- package/dist/tools/shutdown-server.d.ts.map +0 -1
- package/dist/tools/shutdown-server.js.map +0 -1
- package/dist/tools/stop-prompt.d.ts.map +0 -1
- package/dist/tools/stop-prompt.js.map +0 -1
- package/dist/tools/update-agent-cli.d.ts.map +0 -1
- package/dist/tools/update-agent-cli.js.map +0 -1
- package/dist/tools/update-member.d.ts.map +0 -1
- package/dist/tools/update-member.js.map +0 -1
- package/dist/tools/vcs-credential-exec.d.ts.map +0 -1
- package/dist/tools/vcs-credential-exec.js.map +0 -1
- package/dist/tools/version.d.ts.map +0 -1
- package/dist/tools/version.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/agent-helpers.d.ts.map +0 -1
- package/dist/utils/agent-helpers.js.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/auth-env.d.ts.map +0 -1
- package/dist/utils/auth-env.js.map +0 -1
- package/dist/utils/collect-secret.d.ts.map +0 -1
- package/dist/utils/collect-secret.js.map +0 -1
- package/dist/utils/credential-validation.d.ts.map +0 -1
- package/dist/utils/credential-validation.js.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/deep-merge.d.ts.map +0 -1
- package/dist/utils/deep-merge.js.map +0 -1
- package/dist/utils/file-permissions.d.ts.map +0 -1
- package/dist/utils/file-permissions.js.map +0 -1
- package/dist/utils/gpu-parser.d.ts.map +0 -1
- package/dist/utils/gpu-parser.js.map +0 -1
- package/dist/utils/log-helpers.d.ts.map +0 -1
- package/dist/utils/log-helpers.js.map +0 -1
- package/dist/utils/oob-timeout.d.ts.map +0 -1
- package/dist/utils/oob-timeout.js.map +0 -1
- package/dist/utils/opencode-model-validation.d.ts.map +0 -1
- package/dist/utils/opencode-model-validation.js.map +0 -1
- package/dist/utils/pid-helpers.d.ts.map +0 -1
- package/dist/utils/pid-helpers.js.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/process-utils.d.ts.map +0 -1
- package/dist/utils/process-utils.js.map +0 -1
- package/dist/utils/prompt-errors.d.ts.map +0 -1
- package/dist/utils/prompt-errors.js.map +0 -1
- package/dist/utils/resolve-member.d.ts.map +0 -1
- package/dist/utils/resolve-member.js.map +0 -1
- package/dist/utils/secure-input.d.ts.map +0 -1
- package/dist/utils/secure-input.js.map +0 -1
- package/dist/utils/session-caller.d.ts.map +0 -1
- package/dist/utils/session-caller.js.map +0 -1
- package/dist/utils/shell-escape.d.ts.map +0 -1
- package/dist/utils/shell-escape.js.map +0 -1
- package/dist/utils/skill-matrix.d.ts.map +0 -1
- package/dist/utils/skill-matrix.js.map +0 -1
- package/dist/utils/ssh-error-messages.d.ts.map +0 -1
- package/dist/utils/ssh-error-messages.js.map +0 -1
- package/dist/utils/vcs-provider-detect.d.ts.map +0 -1
- package/dist/utils/vcs-provider-detect.js.map +0 -1
- package/dist/utils/work-folder-validation.d.ts.map +0 -1
- package/dist/utils/work-folder-validation.js.map +0 -1
- package/dist/utils/workspace-trust.d.ts.map +0 -1
- package/dist/utils/workspace-trust.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
|
@@ -57,7 +57,21 @@ export function isTerminalSprintFailure(err) {
|
|
|
57
57
|
// alive-but-silent, so the turn may have run to completion (a stalled
|
|
58
58
|
// planner can have created the whole DAG) with only the RESULT lost. The
|
|
59
59
|
// watchdog abandons the dispatch promise, not the member's work.
|
|
60
|
-
|
|
60
|
+
// - 'max_total_time': the server stopped a dispatch that had been running
|
|
61
|
+
// until its max_total_s ceiling -- the prompt was delivered and the agent
|
|
62
|
+
// worked for the whole budget, so partial work may exist. EXCEPT when the
|
|
63
|
+
// server marked it dispatched:false (details.dispatched === false): the
|
|
64
|
+
// budget ran out during setup, before anything was sent, so nothing ran.
|
|
65
|
+
// - 'permission_denied': the agent ran its turn and some of its tool calls
|
|
66
|
+
// were refused for lack of a grant (the dispatch engine heals it via
|
|
67
|
+
// compose_permissions). Calls it WAS allowed may have committed work.
|
|
68
|
+
// ('agent_never_started' is deliberately NOT here: the member process never
|
|
69
|
+
// produced a session, so nothing ran and nothing was mutated.)
|
|
70
|
+
const AGENT_RAN_DISPATCH_REASONS = new Set(['max_turns_exhausted', 'watchdog_timeout', 'max_total_time', 'permission_denied']);
|
|
71
|
+
|
|
72
|
+
function agentRan(details) {
|
|
73
|
+
return AGENT_RAN_DISPATCH_REASONS.has(details.reason) && details.dispatched !== false;
|
|
74
|
+
}
|
|
61
75
|
|
|
62
76
|
// True when a thrown dispatch error means the dispatch delivered no usable
|
|
63
77
|
// result and therefore produced no code/beads mutation to publish: a failed
|
|
@@ -85,10 +99,16 @@ const AGENT_RAN_DISPATCH_REASONS = new Set(['max_turns_exhausted', 'watchdog_tim
|
|
|
85
99
|
// command() throw it from inside the dispatch closure BEFORE any dispatch
|
|
86
100
|
// is issued (packages/apra-fleet-workflow/src/workflow/errors.mjs), so it
|
|
87
101
|
// alone provably mutated nothing.
|
|
102
|
+
//
|
|
103
|
+
// NOT a guarantee the member checkout is untouched: a transport drop can sever
|
|
104
|
+
// the channel while the member keeps working. The doer retry ladder therefore
|
|
105
|
+
// does not trust this predicate for its reset-onto-remote-tip decision; that
|
|
106
|
+
// reset salvages local work to a fleet-salvage/ side ref first (see the comment
|
|
107
|
+
// at retryFollowsPossibleMutation in dispatch-role.mjs).
|
|
88
108
|
export function isNoMutationDispatchFailure(err) {
|
|
89
109
|
if (!err) return false;
|
|
90
110
|
if (err instanceof AgentOutputError) return false;
|
|
91
|
-
if (err instanceof AgentDispatchError && err.details &&
|
|
111
|
+
if (err instanceof AgentDispatchError && err.details && agentRan(err.details)) {
|
|
92
112
|
return false;
|
|
93
113
|
}
|
|
94
114
|
return err instanceof AgentDispatchError || err instanceof FleetTransportError || err instanceof BudgetExceededError;
|
|
@@ -2,10 +2,15 @@ import { policyFor, PRE_DISPATCH_STEPS_IN_BRACKET } from './role-policies.mjs';
|
|
|
2
2
|
import {
|
|
3
3
|
isNonRetryableDispatchError,
|
|
4
4
|
isAuthDispatchError,
|
|
5
|
+
SECRET_DELIVERY_UNAVAILABLE_REASON,
|
|
6
|
+
SECRET_DELIVERY_UNAVAILABLE_REMEDY,
|
|
5
7
|
isPostDispatchSyncFailure,
|
|
6
8
|
isInfraDispatchFailure,
|
|
7
9
|
isUsageLimitDispatchError,
|
|
8
10
|
usageLimitOf,
|
|
11
|
+
isPermissionDeniedDispatchError,
|
|
12
|
+
permissionDeniedOf,
|
|
13
|
+
MemberPermissionDeniedError,
|
|
9
14
|
} from './errors.mjs';
|
|
10
15
|
import { AgentOutputError, AgentDispatchError, FleetTransportError, WorkflowError } from '@apralabs/apra-fleet-workflow';
|
|
11
16
|
|
|
@@ -71,14 +76,14 @@ const PLAN_REVIEWER_MAX_TURNS = 500;
|
|
|
71
76
|
const SCOPED_REPLAN_PLANNER_MAX_TURNS = 500;
|
|
72
77
|
/** Scoped replan plan-reviewer turn base. */
|
|
73
78
|
const SCOPED_REPLAN_REVIEWER_MAX_TURNS = 500;
|
|
74
|
-
/** Harvester turn base: it writes docs
|
|
79
|
+
/** Harvester turn base: it writes docs across the whole epic. */
|
|
75
80
|
const HARVESTER_MAX_TURNS = 500;
|
|
76
81
|
/** Deployer turn base: it runs real deploy commands per a runbook. */
|
|
77
82
|
const DEPLOYER_MAX_TURNS = 500;
|
|
78
83
|
/**
|
|
79
|
-
* Regression turn base:
|
|
80
|
-
*
|
|
81
|
-
*
|
|
84
|
+
* Regression turn base: one dispatch runs the target's whole regression
|
|
85
|
+
* playbook, which can poll a long-running suite (roughly one turn per
|
|
86
|
+
* liveness poll) for the better part of an hour.
|
|
82
87
|
*/
|
|
83
88
|
const REGRESSION_TEST_MAX_TURNS = 500;
|
|
84
89
|
/**
|
|
@@ -223,9 +228,21 @@ function turnBaseValue(name) {
|
|
|
223
228
|
return base;
|
|
224
229
|
}
|
|
225
230
|
|
|
231
|
+
/** The session id a failed dispatch's error reports, or null. */
|
|
232
|
+
function sessionIdOfError(err) {
|
|
233
|
+
const id = err && err.details && err.details.sessionId;
|
|
234
|
+
return typeof id === 'string' && id ? id : null;
|
|
235
|
+
}
|
|
236
|
+
|
|
226
237
|
/**
|
|
227
238
|
* The resume argument, resolved from `policy.resumeArg`:
|
|
228
|
-
* 'same-session' --
|
|
239
|
+
* 'same-session' -- opts.resumeSessionId, the EXPLICIT id of the session just
|
|
240
|
+
* run (the failed dispatch's err.details.sessionId). NEVER
|
|
241
|
+
* `true`: the server resolves `true` to the member's last
|
|
242
|
+
* SUCCESSFUL session, which on a member shared by several
|
|
243
|
+
* roles can be a reviewer's or planner's session. With no id
|
|
244
|
+
* it yields false (the caller starts a fresh full-prompt
|
|
245
|
+
* session instead of resuming)
|
|
229
246
|
* 'fresh-session' -- false (a self-contained one-off instruction)
|
|
230
247
|
* 'round-session' -- opts.resumeArg, the runner's per-round session lookup
|
|
231
248
|
* 'worklist' -- opts.resumeArg, the doer's per-worklist resume argument
|
|
@@ -244,7 +261,9 @@ function turnBaseValue(name) {
|
|
|
244
261
|
*/
|
|
245
262
|
export function resolveResumeArg(resumeArg, opts) {
|
|
246
263
|
if (!resumeArg) return false;
|
|
247
|
-
if (resumeArg.kind === 'same-session')
|
|
264
|
+
if (resumeArg.kind === 'same-session') {
|
|
265
|
+
return typeof opts.resumeSessionId === 'string' && opts.resumeSessionId ? opts.resumeSessionId : false;
|
|
266
|
+
}
|
|
248
267
|
if (resumeArg.kind === 'fresh-session') return false;
|
|
249
268
|
// A runner-supplied argument: already `false` or an explicit session id at
|
|
250
269
|
// every call site today. `?? false` keeps the never-undefined guarantee if
|
|
@@ -556,9 +575,16 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
556
575
|
// In-bracket pre-dispatch steps, then the caller's own preparation.
|
|
557
576
|
const inBracket = await runPreDispatchSteps(ctx, dispatch, member, opts, extra, 'in-bracket');
|
|
558
577
|
if (inBracket) return inBracket.value;
|
|
559
|
-
const prepared = opts.prepare ? await opts.prepare({ dispatch, ...extra }) : {};
|
|
578
|
+
const prepared = opts.prepare ? { ...(await opts.prepare({ dispatch, ...extra })) } : {};
|
|
579
|
+
// A fresh-session fallback (no explicit session id to resume) must
|
|
580
|
+
// never carry a resume argument, whatever prepare offered.
|
|
581
|
+
if (extra.freshSession) prepared.resumeArg = false;
|
|
560
582
|
const localBindings = { ...bindingsFor(extra.resumeAttempt || 0), ...(prepared.bindings || {}) };
|
|
561
|
-
const localOpts =
|
|
583
|
+
const localOpts = {
|
|
584
|
+
...opts,
|
|
585
|
+
...(prepared.resumeArg !== undefined ? { resumeArg: prepared.resumeArg } : {}),
|
|
586
|
+
resumeSessionId: extra.resumeSessionId || null,
|
|
587
|
+
};
|
|
562
588
|
const options = {
|
|
563
589
|
agentType: dispatch.agentType ?? undefined,
|
|
564
590
|
model: resolveModelTier(ctx, dispatch.model, localBindings),
|
|
@@ -569,6 +595,11 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
569
595
|
resume: resolveResumeArg(dispatch.resumeArg, localOpts),
|
|
570
596
|
onSessionId: opts.onSessionId,
|
|
571
597
|
label: prepared.label ?? defaultLabel,
|
|
598
|
+
// Strict permission handling: a refused tool call fails the
|
|
599
|
+
// dispatch (permission_denied) so no role trusts a result made
|
|
600
|
+
// without the refused tool's output, and the progressive heal
|
|
601
|
+
// (onPermissionDenied) can grant the missing permission.
|
|
602
|
+
fail_on_permission_denial: true,
|
|
572
603
|
};
|
|
573
604
|
for (const key of Object.keys(options)) {
|
|
574
605
|
if (options[key] === undefined) delete options[key];
|
|
@@ -633,8 +664,17 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
633
664
|
// turns can fix, so the escalation stops there.
|
|
634
665
|
let resumeAttempt = 0;
|
|
635
666
|
let lastResumeErr = err;
|
|
667
|
+
// The EXPLICIT id of the session the failed dispatch ran in. A
|
|
668
|
+
// resume targets exactly this id; with none, the resume becomes a
|
|
669
|
+
// fresh session carrying the FULL role prompt (never resume: true,
|
|
670
|
+
// which could reattach another role's session on a shared member).
|
|
671
|
+
let resumeSessionId = sessionIdOfError(err);
|
|
672
|
+
// The id of a session the server answered session_not_found for
|
|
673
|
+
// (named in the fresh-fallback log), or null.
|
|
674
|
+
let lostSessionId = null;
|
|
636
675
|
while (resumeAttempt < Math.max(retry.resumeAttempts, resumesOnInfra ? 1 : 0)) {
|
|
637
676
|
resumeAttempt += 1;
|
|
677
|
+
const freshFallback = !resumeSessionId;
|
|
638
678
|
// A resume follows an agent that DID run (max_turns_exhausted is
|
|
639
679
|
// a resumable partial-work case, not a no-mutation failure), so
|
|
640
680
|
// it always runs the full pre-dispatch sync -- no attemptOpts.
|
|
@@ -647,34 +687,71 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
647
687
|
// dispatch in the log.
|
|
648
688
|
const shortCircuit = await runPreDispatchSteps(ctx, secondary, member, opts, { resumeAttempt });
|
|
649
689
|
if (shortCircuit) return shortCircuit.value;
|
|
690
|
+
// The announcement never claims "resuming the same session" for
|
|
691
|
+
// a fresh fallback: there is no session to resume then, and the
|
|
692
|
+
// line just below says why.
|
|
693
|
+
const resumeTurns = resolveMaxTurns(secondary.maxTurns, bindingsFor(resumeAttempt));
|
|
694
|
+
const continuation = freshFallback ? 'continuing in a FRESH session' : 'resuming the same session';
|
|
650
695
|
if (resumeAttempt === 1 && resumesOnExhaustion) {
|
|
651
696
|
ctx.log(
|
|
652
697
|
`${roleLabel} exhausted its turn limit ` +
|
|
653
|
-
`(max_turns=${resolveMaxTurns(policy.maxTurns, bindingsFor(0))}) --
|
|
654
|
-
`
|
|
698
|
+
`(max_turns=${resolveMaxTurns(policy.maxTurns, bindingsFor(0))}) -- ${continuation} ` +
|
|
699
|
+
`with max_turns=${resumeTurns}.`
|
|
655
700
|
);
|
|
656
701
|
} else if (resumeAttempt === 1) {
|
|
657
702
|
ctx.log(
|
|
658
703
|
`${roleLabel}: infrastructure dispatch failure ` +
|
|
659
704
|
`(${(err.details && err.details.reason) || 'unknown'}) -- the member produced no result ` +
|
|
660
|
-
|
|
705
|
+
`envelope. This is NOT a failure verdict; ${continuation} once to recover ` +
|
|
661
706
|
'before recording anything.'
|
|
662
707
|
);
|
|
663
708
|
} else {
|
|
664
709
|
ctx.log(
|
|
665
|
-
`${roleLabel} exhausted its turn limit again --
|
|
666
|
-
`max_turns=${
|
|
710
|
+
`${roleLabel} exhausted its turn limit again -- ${continuation} with ` +
|
|
711
|
+
`max_turns=${resumeTurns} ` +
|
|
667
712
|
`(attempt ${resumeAttempt}/${retry.resumeAttempts}).`
|
|
668
713
|
);
|
|
669
714
|
}
|
|
715
|
+
if (freshFallback) {
|
|
716
|
+
ctx.log(
|
|
717
|
+
`${roleLabel}: starting a FRESH session with the full role prompt instead of resuming -- ` +
|
|
718
|
+
(lostSessionId
|
|
719
|
+
? `the session to resume was not found on the member (the server reported session_not_found for session '${lostSessionId}').`
|
|
720
|
+
: 'the failed dispatch reported no session id, so there is no explicit session to resume.')
|
|
721
|
+
);
|
|
722
|
+
} else {
|
|
723
|
+
ctx.log(`${roleLabel}: resuming explicit session '${resumeSessionId}'.`);
|
|
724
|
+
}
|
|
670
725
|
resumesIssued += 1;
|
|
671
726
|
try {
|
|
672
|
-
return await runDispatch(
|
|
727
|
+
return await runDispatch(
|
|
728
|
+
secondary,
|
|
729
|
+
freshFallback ? opts.prompt : opts.resumePrompt,
|
|
730
|
+
freshFallback ? opts.label : opts.resumeLabel,
|
|
731
|
+
undefined,
|
|
732
|
+
{ resumeAttempt, resumeSessionId, freshSession: freshFallback },
|
|
733
|
+
);
|
|
673
734
|
} catch (resumeErr) {
|
|
674
735
|
lastResumeErr = resumeErr;
|
|
675
736
|
const exhaustedAgain = resumeErr instanceof AgentDispatchError
|
|
676
737
|
&& resumeErr.details && resumeErr.details.reason === 'max_turns_exhausted';
|
|
677
|
-
|
|
738
|
+
// The explicit session is gone: fall back to a fresh
|
|
739
|
+
// full-prompt session, without charging the ladder.
|
|
740
|
+
const sessionNotFound = resumeErr instanceof AgentDispatchError
|
|
741
|
+
&& resumeErr.details && resumeErr.details.reason === 'session_not_found';
|
|
742
|
+
if (sessionNotFound && !freshFallback) {
|
|
743
|
+
lostSessionId = resumeSessionId;
|
|
744
|
+
resumeSessionId = null;
|
|
745
|
+
resumeAttempt -= 1;
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
if (retry.maxTurnsResume && exhaustedAgain) {
|
|
749
|
+
// A re-exhaustion moves the resume target to the NEW
|
|
750
|
+
// session's id (none -> a fresh full-prompt session).
|
|
751
|
+
resumeSessionId = sessionIdOfError(resumeErr);
|
|
752
|
+
lostSessionId = null;
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
678
755
|
throw resumeErr;
|
|
679
756
|
}
|
|
680
757
|
}
|
|
@@ -694,12 +771,27 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
694
771
|
// session it hit the limit on (warm context kept) rather than starting a
|
|
695
772
|
// fresh one. Only reached when the failing attempt reported a sessionId and
|
|
696
773
|
// the role actually has a max-turns resume secondary; otherwise the caller
|
|
697
|
-
// re-runs runAttempt fresh.
|
|
698
|
-
|
|
774
|
+
// re-runs runAttempt fresh. If the server no longer knows that session
|
|
775
|
+
// (session_not_found -- e.g. the member restarted during the wait), the
|
|
776
|
+
// role starts a FRESH session with its FULL prompt instead, and says so:
|
|
777
|
+
// the short resume prompt is meaningless without the old context.
|
|
778
|
+
const redispatchViaUsageLimitResume = async (attemptOpts, sessionId) => {
|
|
699
779
|
const secondary = policy.secondary;
|
|
700
780
|
const shortCircuit = await runPreDispatchSteps(ctx, secondary, member, opts, { resumeAttempt: 1 });
|
|
701
781
|
if (shortCircuit) return shortCircuit.value;
|
|
702
|
-
|
|
782
|
+
// Resumes the session the limit hit, by its explicit id.
|
|
783
|
+
try {
|
|
784
|
+
return await runDispatch(secondary, opts.resumePrompt ?? opts.prompt, opts.resumeLabel ?? opts.label, attemptOpts, { resumeAttempt: 1, resumeSessionId: sessionId });
|
|
785
|
+
} catch (resumeErr) {
|
|
786
|
+
const sessionNotFound = resumeErr instanceof AgentDispatchError
|
|
787
|
+
&& resumeErr.details && resumeErr.details.reason === 'session_not_found';
|
|
788
|
+
if (!sessionNotFound) throw resumeErr;
|
|
789
|
+
ctx.log(
|
|
790
|
+
`${roleLabel}: the server reported session_not_found for session '${sessionId}' after the usage-limit ` +
|
|
791
|
+
'wait -- starting a FRESH session with the full role prompt instead.'
|
|
792
|
+
);
|
|
793
|
+
return runDispatch(secondary, opts.prompt, opts.label ?? opts.resumeLabel, attemptOpts, { resumeAttempt: 1, freshSession: true });
|
|
794
|
+
}
|
|
703
795
|
};
|
|
704
796
|
|
|
705
797
|
let lastErr = null;
|
|
@@ -725,9 +817,88 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
725
817
|
// resume ladder. A usage-limit re-dispatch does NOT consume a ladder
|
|
726
818
|
// attempt (see the hook below), so it also skips the retry backoff.
|
|
727
819
|
let usageLimitRedispatch = null;
|
|
820
|
+
// The explicit id of the session the usage limit hit (for the resume above).
|
|
821
|
+
let usageLimitSessionId = null;
|
|
822
|
+
// A permission-refusal heal is PROGRESSIVE: each refusal is handed to
|
|
823
|
+
// ctx.onPermissionDenied, which grants what the member is missing (within
|
|
824
|
+
// its composed policy) and reports healed:true only when a new grant
|
|
825
|
+
// landed; the attempt is then re-run without charging the ladder (and
|
|
826
|
+
// without the backoff). The hook owns every stop rule (auto-mode refusal,
|
|
827
|
+
// no progress, per-member and per-ladder caps); this ladder only counts
|
|
828
|
+
// its own heals for the per-ladder cap.
|
|
829
|
+
let permissionHeals = 0;
|
|
830
|
+
let permissionHealRedispatch = false;
|
|
831
|
+
// Resolves null when the heal succeeded (re-run the attempt), else the
|
|
832
|
+
// MemberPermissionDeniedError that ends the sprint.
|
|
833
|
+
const healPermissionDenial = async (err) => {
|
|
834
|
+
const denial = permissionDeniedOf(err);
|
|
835
|
+
const actions = denial && denial.denials.length
|
|
836
|
+
? denial.denials.map((d) => (d.target ? `${d.action} "${d.target}"` : d.action))
|
|
837
|
+
: ((denial && denial.actions) || []);
|
|
838
|
+
const actionText = actions.length ? actions.join(', ') : 'unknown actions';
|
|
839
|
+
const suggested = (denial && denial.suggestedGrants) || [];
|
|
840
|
+
const fail = (step, why, heal) => {
|
|
841
|
+
const composeRole = (heal && heal.composeRole) || 'the role of its sprint roles';
|
|
842
|
+
const rejected = (heal && heal.rejectedGrants) || [];
|
|
843
|
+
const grantFix = rejected.length
|
|
844
|
+
? ` and grant ${JSON.stringify(rejected)} if that role should have them (they are outside the role policy, so the sprint never auto-grants them)`
|
|
845
|
+
: (suggested.length ? ` (suggested grants: ${JSON.stringify(suggested)})` : '');
|
|
846
|
+
if (step === 'not_healable') {
|
|
847
|
+
return new MemberPermissionDeniedError(
|
|
848
|
+
`${roleLabel} dispatch on member '${member}' was refused tool calls by its permission mode's safety checks: ${actionText}. ` +
|
|
849
|
+
`${why} The reply was not complete, so this is not a ${roleLabel} result. ` +
|
|
850
|
+
'No grant is added for a classifier or deny-rule refusal. To fix: review the refused calls; if the action is really intended, ' +
|
|
851
|
+
`grant it on member '${member}' by hand (compose_permissions grant) or change the role's task, then rerun the sprint.`,
|
|
852
|
+
{
|
|
853
|
+
member, role: policy.role, actions, suggestedGrants: [], rejectedGrants: [], step,
|
|
854
|
+
details: { hint: denial ? denial.hint : '' }, cause: err,
|
|
855
|
+
},
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
return new MemberPermissionDeniedError(
|
|
859
|
+
`${roleLabel} dispatch on member '${member}' was refused tool calls for lack of a permission grant: ${actionText}. ` +
|
|
860
|
+
`${why} This is a missing-permission failure, not a ${roleLabel} result. ` +
|
|
861
|
+
`To fix: run compose_permissions for member '${member}' with role ${composeRole}${grantFix}, then rerun the sprint.`,
|
|
862
|
+
{
|
|
863
|
+
member,
|
|
864
|
+
role: policy.role,
|
|
865
|
+
actions,
|
|
866
|
+
suggestedGrants: suggested,
|
|
867
|
+
rejectedGrants: rejected,
|
|
868
|
+
step,
|
|
869
|
+
details: { hint: denial ? denial.hint : '' },
|
|
870
|
+
cause: err,
|
|
871
|
+
},
|
|
872
|
+
);
|
|
873
|
+
};
|
|
874
|
+
if (typeof ctx.onPermissionDenied !== 'function') {
|
|
875
|
+
return fail('heal', 'No permission heal is wired for this run, so nothing re-composed the member.', null);
|
|
876
|
+
}
|
|
877
|
+
let heal;
|
|
878
|
+
try {
|
|
879
|
+
heal = await ctx.onPermissionDenied({ member, role: policy.role, roleLabel, denial, ladderHeals: permissionHeals });
|
|
880
|
+
} catch (healErr) {
|
|
881
|
+
heal = { healed: false, reason: healErr && healErr.message ? healErr.message : String(healErr) };
|
|
882
|
+
}
|
|
883
|
+
if (!heal || !heal.healed) {
|
|
884
|
+
const step = (heal && heal.step) || 'heal';
|
|
885
|
+
const why = step === 'heal'
|
|
886
|
+
? `The permission heal failed: ${(heal && heal.reason) || 'no result'}.`
|
|
887
|
+
: `The permission heal can make no further progress: ${(heal && heal.reason) || step}.`;
|
|
888
|
+
return fail(step, why, heal);
|
|
889
|
+
}
|
|
890
|
+
permissionHeals += 1;
|
|
891
|
+
ctx.log(
|
|
892
|
+
`${roleLabel} dispatch: member '${member}' was refused ${actionText}; granted ` +
|
|
893
|
+
`${(heal.grants || []).join(', ') || 'its missing permissions'} -- retrying (heal ${permissionHeals} of this dispatch, not charged to the ladder).`
|
|
894
|
+
);
|
|
895
|
+
return null;
|
|
896
|
+
};
|
|
728
897
|
|
|
729
898
|
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
730
|
-
|
|
899
|
+
const skipBackoff = Boolean(usageLimitRedispatch) || permissionHealRedispatch;
|
|
900
|
+
permissionHealRedispatch = false;
|
|
901
|
+
if (!skipBackoff && backoffMs && backoffMs[attempt - 1] > 0) {
|
|
731
902
|
ctx.log(
|
|
732
903
|
`${roleLabel} dispatch: waiting ${backoffMs[attempt - 1] / 1000}s before retry attempt ` +
|
|
733
904
|
`${attempt}/${backoffMs.length}...`
|
|
@@ -745,6 +916,19 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
745
916
|
// never fast-forward. Only after a failure that may have committed:
|
|
746
917
|
// an auth/trust failure provably ran nothing, so its retry keeps
|
|
747
918
|
// plain ff-only pre-dispatch sync.
|
|
919
|
+
//
|
|
920
|
+
// This is deliberately BROADER than isNoMutationDispatchFailure
|
|
921
|
+
// (dispatch-failure.mjs): a stall kill or a transport drop is
|
|
922
|
+
// classed no-mutation there (so the post-dispatch push is skipped),
|
|
923
|
+
// yet the member may still have committed or edited files before
|
|
924
|
+
// the channel died. The two are reconciled by making the reset
|
|
925
|
+
// itself non-destructive rather than by re-classifying those
|
|
926
|
+
// failures: syncMemberBefore's resetToRemoteTip mode always pins
|
|
927
|
+
// unpublished commits and uncommitted tracked changes on a local
|
|
928
|
+
// fleet-salvage/ side ref first and refuses to reset if it cannot
|
|
929
|
+
// (salvageBeforeReset in member-sync.mjs). Treating a failure as
|
|
930
|
+
// possibly-mutating here is therefore always safe, and nothing a
|
|
931
|
+
// killed attempt left behind is lost to the retry.
|
|
748
932
|
const retryFollowsPossibleMutation = attempt > 1 && lastErr
|
|
749
933
|
&& !isNonRetryableDispatchError(lastErr);
|
|
750
934
|
const attemptOpts = {
|
|
@@ -763,7 +947,7 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
763
947
|
const redispatchMode = usageLimitRedispatch;
|
|
764
948
|
usageLimitRedispatch = null;
|
|
765
949
|
value = redispatchMode === 'resume'
|
|
766
|
-
? await redispatchViaUsageLimitResume(attemptOpts)
|
|
950
|
+
? await redispatchViaUsageLimitResume(attemptOpts, usageLimitSessionId)
|
|
767
951
|
: await runAttempt(attemptOpts);
|
|
768
952
|
if (opts.afterAttempt) await opts.afterAttempt(value);
|
|
769
953
|
// A postResult step may REJECT the result (the reviewer's
|
|
@@ -825,6 +1009,28 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
825
1009
|
skipPreDispatchSyncNext = ctx.isNoMutationDispatchFailure(err);
|
|
826
1010
|
}
|
|
827
1011
|
|
|
1012
|
+
// An agent permission refusal (reason 'permission_denied': the
|
|
1013
|
+
// member CLI refused tool calls for lack of a grant) is a
|
|
1014
|
+
// MISSING-PERMISSION failure, for every role -- never a role
|
|
1015
|
+
// outcome. It is never degraded (a plan-reviewer's refusal text
|
|
1016
|
+
// must not become a CHANGES_NEEDED verdict and charge a planning
|
|
1017
|
+
// round), never retried blindly (the same config refuses the same
|
|
1018
|
+
// call), and healed progressively: ctx.onPermissionDenied grants
|
|
1019
|
+
// the missing permission within the member's composed policy, then
|
|
1020
|
+
// the attempt is re-run without charging the ladder; a refusal of
|
|
1021
|
+
// a different tool next time is healed the same way. When the hook
|
|
1022
|
+
// can make no further progress (auto-mode refusal, refused again
|
|
1023
|
+
// after its grant, outside policy, cap reached) or no hook is
|
|
1024
|
+
// wired, the sprint ends with MemberPermissionDeniedError naming
|
|
1025
|
+
// member, the denied actions and the fix.
|
|
1026
|
+
if (!completedButSyncFailed && isPermissionDeniedDispatchError(err)) {
|
|
1027
|
+
const healError = await healPermissionDenial(err);
|
|
1028
|
+
if (healError) throw healError;
|
|
1029
|
+
permissionHealRedispatch = true;
|
|
1030
|
+
attempt -= 1;
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
828
1034
|
// Usage-limit pause/resume (apra-fleet-hzeb.4.2). A provider
|
|
829
1035
|
// rate/usage limit is neither a failure of this role nor something a
|
|
830
1036
|
// retry ladder can out-wait on its own budget -- it needs a real
|
|
@@ -863,6 +1069,7 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
863
1069
|
const canResumeSession = Boolean(failedSessionId) && retry.resumeAttempts > 0
|
|
864
1070
|
&& policy.secondary && policy.secondary.kind === 'max-turns-resume';
|
|
865
1071
|
usageLimitRedispatch = canResumeSession ? 'resume' : 'fresh';
|
|
1072
|
+
usageLimitSessionId = canResumeSession ? failedSessionId : null;
|
|
866
1073
|
attempt -= 1;
|
|
867
1074
|
continue;
|
|
868
1075
|
}
|
|
@@ -872,6 +1079,15 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
872
1079
|
throw (outcome && outcome.error) || err;
|
|
873
1080
|
}
|
|
874
1081
|
|
|
1082
|
+
// A member that cannot receive its stored credentials fails the same
|
|
1083
|
+
// way on every attempt, on EVERY ladder (abortOnNonRetryable or not):
|
|
1084
|
+
// stop after the first failure and name the remedy. No self-heal.
|
|
1085
|
+
if (!completedButSyncFailed && err?.details?.reason === SECRET_DELIVERY_UNAVAILABLE_REASON) {
|
|
1086
|
+
ctx.log(`${roleLabel} dispatch failed: member '${member}' cannot receive its stored credentials (${SECRET_DELIVERY_UNAVAILABLE_REASON}); not retrying. Remedy: ${SECRET_DELIVERY_UNAVAILABLE_REMEDY}. Detail: ${err.message}`);
|
|
1087
|
+
if (!err.message.includes(SECRET_DELIVERY_UNAVAILABLE_REMEDY)) err.message += ` [${SECRET_DELIVERY_UNAVAILABLE_REMEDY}]`;
|
|
1088
|
+
if (retry.rethrowsUnhealedNonRetryable) throw err;
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
875
1091
|
// Auth/workspace-trust failures are deterministic -- no retry can
|
|
876
1092
|
// succeed -- so a ladder that declares abortOnNonRetryable ends
|
|
877
1093
|
// rather than burning its remaining attempts on the same wall.
|
|
@@ -899,12 +1115,18 @@ export async function dispatchRole(ctx, roleName, opts = {}) {
|
|
|
899
1115
|
}
|
|
900
1116
|
ctx.log(
|
|
901
1117
|
`${roleLabel} dispatch threw a non-retryable error (auth/trust): ${err.message}. Aborting ` +
|
|
902
|
-
|
|
1118
|
+
`retries -- fix member '${member}' credentials/trust and re-run (for an LLM auth failure: re-login on the source machine with /login, then provision_llm_auth; or provision an API key).`
|
|
903
1119
|
);
|
|
904
1120
|
// A ladder whose own failure legitimately fails the whole
|
|
905
1121
|
// sprint propagates instead of degrading: with the dispatch
|
|
906
1122
|
// channel walled off there is no judgement to fabricate.
|
|
907
|
-
if (retry.rethrowsUnhealedNonRetryable)
|
|
1123
|
+
if (retry.rethrowsUnhealedNonRetryable) {
|
|
1124
|
+
if (isAuthDispatchError(err) && err && typeof err.message === 'string'
|
|
1125
|
+
&& !err.message.includes('provision_llm_auth')) {
|
|
1126
|
+
err.message += ` [LLM auth heal failed for member '${member}': re-login on the source machine with /login, then provision_llm_auth; or provision an API key]`;
|
|
1127
|
+
}
|
|
1128
|
+
throw err;
|
|
1129
|
+
}
|
|
908
1130
|
break;
|
|
909
1131
|
}
|
|
910
1132
|
|
|
@@ -29,7 +29,10 @@ apra-fleet workflow fleet-sprint \
|
|
|
29
29
|
This is the ONE command for every install method -- git-clone dev checkout,
|
|
30
30
|
`npm install -g @apralabs/apra-fleet`, and the pre-built standalone binary
|
|
31
31
|
all resolve it identically; there is no separate npm-only invocation to
|
|
32
|
-
learn. The
|
|
32
|
+
learn. The standalone installer does not add `apra-fleet` to PATH: run it
|
|
33
|
+
as `~/.apra-fleet/bin/apra-fleet` (PowerShell:
|
|
34
|
+
`& "$HOME\.apra-fleet\bin\apra-fleet.exe"`) or add that folder to PATH.
|
|
35
|
+
The launcher resolves the workflow from
|
|
33
36
|
`~/.apra-fleet/workflows/fleet-sprint` (installed by `apra-fleet install`,
|
|
34
37
|
self-healed on demand). Everything after the workflow name is passed
|
|
35
38
|
through verbatim, so `apra-fleet workflow fleet-sprint --help` prints the
|
|
@@ -72,7 +75,10 @@ Start-Process -FilePath "apra-fleet" -ArgumentList "workflow","fleet-sprint", `
|
|
|
72
75
|
-WindowStyle Hidden -PassThru
|
|
73
76
|
```
|
|
74
77
|
|
|
75
|
-
On start it prints the dashboard URL (`http://
|
|
78
|
+
On start it prints the dashboard URL (`http://127.0.0.1:<viewer-port>`). The
|
|
79
|
+
dashboard viewer and the supervisor (`fleet-se serve`) bind loopback only by
|
|
80
|
+
default; `fleet-se serve --host <addr>` (e.g. `0.0.0.0`) is the explicit opt-in
|
|
81
|
+
to expose the unauthenticated supervisor API off-box.
|
|
76
82
|
Watch progress there rather than tailing raw stdout.
|
|
77
83
|
|
|
78
84
|
## Arguments
|
|
@@ -81,28 +87,31 @@ Watch progress there rather than tailing raw stdout.
|
|
|
81
87
|
|---|---|---|---|---|
|
|
82
88
|
| `--issue <ids>` | `-i` | yes | -- | Target issue ID(s), comma separated (e.g. `epic-1,epic-2`). Scope resolves to each id's full descendant subtree -- see the epics section below. |
|
|
83
89
|
| `--members <ids>` | `-m` | yes | -- | Member IDs/names to use, comma separated. Members act as repo targets for parallelism. |
|
|
84
|
-
| `--branch <name>` | `-b` | yes | -- | Sprint branch to develop on. Created from `--base` if it does not exist; reused as-is if it does. |
|
|
90
|
+
| `--branch <name>` | `-b` | yes | -- | Sprint branch to develop on. Created from `--base` if it does not exist; reused as-is if it does. Must differ from `--base`: the comparison ignores case and `refs/heads/`, `origin/` and `refs/remotes/origin/` prefixes, and an equal pair is rejected at launch. |
|
|
85
91
|
| `--base <name>` | `-B` | yes | -- | Base branch the sprint branch is created from, and the branch the eventual PR targets. |
|
|
86
92
|
| `--goal <goal>` | `-g` | no | `P1/P2` | Sprint goal constraint. One of `P1`, `P1/P2`, `P1/P2/P3`. |
|
|
87
93
|
| `--max-cycles <n>` | `-c` | no | `5` | Max plan/develop/review cycles. |
|
|
88
94
|
| `--allow-missing-members` | | no | off | Warn and continue if some `--members` are not registered with the fleet. Without it, any missing member aborts the sprint. |
|
|
89
95
|
| `--requirements-file <path>` | | no | -- | Path to a requirements file threaded into the planner's prompt. |
|
|
90
|
-
| `--role-map <json\|@file>` | | no | -- | JSON object mapping role -> member[], e.g. `'{"doer":["m1","m2"]}'`. Inline JSON or `@path/to/file.json`. |
|
|
96
|
+
| `--role-map <json\|@file>` | | no | -- | JSON object mapping role -> member[], e.g. `'{"doer":["m1","m2"]}'`. Inline JSON or `@path/to/file.json`. The `backlog` key names the member whose beads clone the engine runs its own `bd`/`git` commands against (`orchestrator` is its deprecated alias: accepted with a warning in 0.4.4, removed in v0.5). Without `backlog` the engine picks one and logs `backlog: <member> (auto-selected: <reason>)`. |
|
|
91
97
|
| `--viewer-port <port>` | | no | `8080` | Port for the local dashboard viewer. |
|
|
92
98
|
| `--budget <usd>` | | no | unlimited | USD ceiling for this run's total estimated spend. |
|
|
93
99
|
| `--dispatch-timeout-s <s>` | | no | `9000` | Per-dispatch total time budget in seconds -- the hard ceiling on every agent dispatch (integ-test dispatch ceiling is 2x, regression-test ceiling is 3x). Minimum 60. The inactivity/stall threshold used to detect a hung dispatch is derived from this value but capped separately at 30 minutes, so raising this budget for a large sprint does not also grant a stalled dispatch a correspondingly longer grace period before it is killed. Lower it for small sprints so a hung dispatch costs minutes, not 2.5 hours. |
|
|
94
|
-
| `--
|
|
100
|
+
| `--usage-limit-max-wait-s <s>` | | no | engine default | Total seconds a dispatch may stay paused on a provider usage limit, across all reprobes, before the run ends with a typed abort. Minimum 60. |
|
|
101
|
+
| `--usage-limit-max-reprobes <n>` | | no | engine default | Max usage-limit reprobes before giving up, independent of elapsed wait. Minimum 1. |
|
|
102
|
+
| `--skip-regression` | | no | off | Skip the once-per-sprint regression pass. Logged, and stated in the sprint analysis and the PR body. Integration tests still run. |
|
|
103
|
+
| `--sync` | | no | off | Synced topology mode (orchestrator-bracketed git sync): members may sit on differing HEADs but must share the same origin URL and pass a `bd dolt pull` probe. Omitted uses shared-workspace mode: at launch every member is aligned to the sprint branch automatically (WIP preserved in a named stash), then must share the same HEAD. |
|
|
95
104
|
| `--help` | `-h` | | | Show the engine's help. |
|
|
96
105
|
|
|
97
106
|
Unrecognized flags fail loudly rather than being silently ignored, so a typo
|
|
98
107
|
like `--max-cycle` aborts instead of quietly applying the default.
|
|
99
108
|
|
|
100
|
-
**A shared/`unreservable`
|
|
109
|
+
**A shared/`unreservable` backlog member goes in `--role-map` ONLY, never
|
|
101
110
|
in `--members`.** `--members` (and `--role-map` values for git-having roles
|
|
102
111
|
like doer/reviewer/harvester) still get git-identity/topology-checked and, on
|
|
103
112
|
resume, git-resynced. A member registered `unreservable: true` (e.g. a
|
|
104
|
-
beads-only
|
|
105
|
-
those checks only when it appears exclusively via `roleMap.orchestrator` --
|
|
113
|
+
beads-only backlog member shared across concurrent sprints) is exempted from
|
|
114
|
+
those checks only when it appears exclusively via `roleMap.backlog` (deprecated alias `roleMap.orchestrator`) --
|
|
106
115
|
listing it in `--members` too is redundant and not required, and defeats the
|
|
107
116
|
exemption for anything outside the topology precondition (e.g. a paused/
|
|
108
117
|
resumed sprint's resync step still runs real git commands against every
|
|
@@ -115,10 +124,28 @@ resumed sprint's resync step still runs real git commands against every
|
|
|
115
124
|
- Every `--members` name must be registered with the fleet
|
|
116
125
|
(`list_members`); an unregistered member aborts the sprint unless
|
|
117
126
|
`--allow-missing-members` is passed.
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
`fleet
|
|
121
|
-
|
|
127
|
+
- Every member the sprint uses (including the backlog member and
|
|
128
|
+
deployer/ci-watcher-only members) needs `bd` runnable in its work folder
|
|
129
|
+
(`apra-fleet install` provides it). Before any dispatch the engine checks
|
|
130
|
+
each member's beads: a missing `bd` aborts the sprint, a beads-reading
|
|
131
|
+
member with no beads
|
|
132
|
+
database yet is set up from the expected beads remote (or the sprint aborts
|
|
133
|
+
if that set-up fails), and a member resolving to a different beads project
|
|
134
|
+
aborts. Each error names the member and the fix.
|
|
135
|
+
- Multi-member sprints do not need members aligned by hand: at launch
|
|
136
|
+
(without `--sync`) every member is fetched and checked out on the sprint
|
|
137
|
+
branch (from `origin/<branch>`, else `origin/<base>`), uncommitted work is
|
|
138
|
+
preserved in a named `fleet-sprint[<branch>]` stash, and one `[Align]` line
|
|
139
|
+
per member is logged before the same-HEAD check (`checkMemberTopology`)
|
|
140
|
+
runs. The launch refuses -- before moving any member -- only for what
|
|
141
|
+
cannot be reconciled: an unreachable member, differing origin URLs, a base
|
|
142
|
+
missing on origin, a fetch auth failure, or a diverged sprint branch. See
|
|
143
|
+
`fleet-sprint-diagram.md` for the supported-topology notes.
|
|
144
|
+
- A GitHub target needs a GitHub App configured on the fleet
|
|
145
|
+
(`setup_git_app`; see `docs/github-app-setup.md` in the apra-fleet repo):
|
|
146
|
+
the publish step mints its own `push+pr` credential through it. With only
|
|
147
|
+
a PAT the sprint still pushes the branch, but logs `[Publish PR Skipped]
|
|
148
|
+
... GitHub App not configured` and opens no PR.
|
|
122
149
|
- If a member's LLM session is stale or unauthenticated (dispatch fails with
|
|
123
150
|
`empty_response`, or "member CLI likely died"), re-run `provision_llm_auth`
|
|
124
151
|
for that member before retrying.
|
|
@@ -165,8 +192,12 @@ the full algorithm and worked examples.
|
|
|
165
192
|
|
|
166
193
|
## Recovering a wedged member reservation (launched via the supervisor)
|
|
167
194
|
|
|
168
|
-
If a sprint was launched through the supervisor (`
|
|
169
|
-
|
|
195
|
+
If a sprint was launched through the supervisor (`POST /api/sprints`; the
|
|
196
|
+
supervisor is `bin/serve.mjs`, which no install puts on PATH -- start it with
|
|
197
|
+
`node ~/.apra-fleet/workflows/fleet-sprint/bin/serve.mjs`, or in PowerShell
|
|
198
|
+
`node "$HOME\.apra-fleet\workflows\fleet-sprint\bin\serve.mjs"`, from the
|
|
199
|
+
project folder holding `.beads` or with `--beads-dir <project folder>`)
|
|
200
|
+
and its child process crashes or is killed, the supervisor's
|
|
170
201
|
reservation ledger does **not** release that sprint's claim on its own during
|
|
171
202
|
normal runtime -- only a supervisor restart, or an explicit operator call,
|
|
172
203
|
clears it. Symptom: relaunching against the same member(s) is rejected with
|
|
@@ -202,5 +233,15 @@ mcp__apra-fleet__member_reservation action: "force_release" member_name: "<mem
|
|
|
202
233
|
```
|
|
203
234
|
|
|
204
235
|
A crashed sprint can leave either axis wedged independently of the other --
|
|
205
|
-
check both.
|
|
236
|
+
check both.
|
|
237
|
+
|
|
238
|
+
After a supervisor restart or an apra-fleet upgrade (for example one run
|
|
239
|
+
with `--ignore-running-sprints` while a sprint was live), the ledger is
|
|
240
|
+
already empty, so the curl above answers `404 no live reservation for
|
|
241
|
+
sprint '<id>'` -- that axis is clear, skip it. The 409 then comes only from
|
|
242
|
+
the fleet server's `reservedBy`, and the name it prints is whatever id the
|
|
243
|
+
dead sprint reserved with (often its branch name), so it does not appear in
|
|
244
|
+
`GET /api/sprints`. Run the `member_reservation` force_release above once
|
|
245
|
+
per member listed in the 409. It is a fleet MCP tool (call it from your
|
|
246
|
+
agent); the supervisor has no HTTP route for it. See `packages/apra-fleet-se/docs/architecture.md` ("Supervisor:
|
|
206
247
|
process model" / "Manual force-release") for the full mechanism.
|
|
@@ -1572,7 +1572,12 @@ process per sprint). Two properties matter:
|
|
|
1572
1572
|
together): `noteMemberCommand()`, called from the runner's central
|
|
1573
1573
|
`command()` wrapper for any `bd config set` / `bd dolt remote` / `bd init` /
|
|
1574
1574
|
`bd bootstrap` the orchestrator issues on that member; the auth self-heal
|
|
1575
|
-
firing inside `runDoltStep`; and `repair()`.
|
|
1575
|
+
firing inside `runDoltStep`; and `repair()`. The beads preflight's member
|
|
1576
|
+
set-up (beads-identity-check.mjs `setupMemberBeads`: `bd config set
|
|
1577
|
+
sync.remote <expected>` + `bd bootstrap`, or `bd dolt remote add origin` +
|
|
1578
|
+
`bd dolt pull` on an existing database, for a beads-reading member with no
|
|
1579
|
+
database or no sync.remote) is such an orchestrator-issued command and goes
|
|
1580
|
+
through that wrapper, so it hits this seam before the first D-pull.
|
|
1576
1581
|
- **The per-dispatch seam is SOFT (round 4).** A dispatched agent runs its
|
|
1577
1582
|
`bd` commands in its own session on the member, never through the
|
|
1578
1583
|
`command()` wrapper, so `noteMemberCommand()` cannot see them; the runner's
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fleet-sprint Workflow Architecture
|
|
2
2
|
|
|
3
3
|
This diagram illustrates the complex, multi-agent lifecycle of a single sprint. It highlights the outer iterative cycle (Sprint Cycles) and the inner tight feedback loops (Planning Loop, Development Loop).
|
|
4
4
|
|
|
@@ -74,7 +74,7 @@ The runner spreads roles across members: the orchestrator issues every `bd` comm
|
|
|
74
74
|
Two topology modes are supported, selected explicitly at sprint start:
|
|
75
75
|
|
|
76
76
|
- **`legacy` mode** -- no cross-member sync layer. Orchestrator `bd` commands
|
|
77
|
-
hit the
|
|
77
|
+
hit the backlog member's beads DB; a doer's `bd close` hits its own
|
|
78
78
|
member's DB; the sprint git branch is only coherent if all members share
|
|
79
79
|
the same working state. This coheres for **single-member** sprints (one
|
|
80
80
|
member does everything) or a **verified shared-workspace fleet** (all
|
|
@@ -88,7 +88,7 @@ Two topology modes are supported, selected explicitly at sprint start:
|
|
|
88
88
|
|
|
89
89
|
Guards enforcing whichever mode is selected:
|
|
90
90
|
|
|
91
|
-
1. **Branch-ensure everywhere** (both modes) -- before the first doer round the runner git-ensures the sprint branch (`git fetch` + `git checkout -B`) on every member in the union of the
|
|
91
|
+
1. **Branch-ensure everywhere** (both modes) -- before the first doer round the runner git-ensures the sprint branch (`git fetch` + `git checkout -B`) on every member in the union of the backlog/doer/reviewer pools (not just the backlog member), then non-destructively re-checks-out the branch at the start of later cycles (never resetting committed work back to base).
|
|
92
92
|
2. **Topology precondition** (`checkMemberTopology`, called from `bin/cli.mjs`) -- in `legacy` mode, compares `git rev-parse HEAD` across the configured members and refuses to start on a mismatch; in `synced` mode, HEADs are allowed to differ but every member must share the same git remote origin and pass a live `bd dolt pull` probe. Single-member sprints trivially pass either check.
|
|
93
93
|
|
|
94
94
|
See `packages/apra-fleet-se/docs/architecture.md` -> "Multi-member topology", "Orchestrator-bracketed git sync", and "Dolt sync discipline" for the full rationale.
|