@apralabs/apra-fleet 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -5
- package/dist/agents/backlog-groomer.md +25 -0
- package/dist/agents/ci-watcher.md +11 -0
- package/dist/agents/deployer.md +37 -2
- package/dist/agents/doer.md +36 -12
- package/dist/agents/harvester.md +11 -0
- package/dist/agents/integ-test-runner.md +11 -0
- package/dist/agents/kb-reconciler.md +9 -0
- package/dist/agents/plan-reviewer.md +110 -22
- package/dist/agents/planner.md +125 -37
- package/dist/agents/regression-test-runner.md +11 -0
- package/dist/agents/reviewer.md +13 -2
- package/dist/agents/schemas/plan-reviewer-output.json +37 -0
- package/dist/cli/agent-transform.d.ts +83 -2
- package/dist/cli/agent-transform.d.ts.map +1 -1
- package/dist/cli/agent-transform.js +266 -21
- package/dist/cli/agent-transform.js.map +1 -1
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +28 -9
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +7 -5
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +44 -34
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +33 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +290 -23
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/kb-directives.d.ts.map +1 -1
- package/dist/cli/kb-directives.js +2 -1
- package/dist/cli/kb-directives.js.map +1 -1
- package/dist/cli/register-member.d.ts.map +1 -1
- package/dist/cli/register-member.js +6 -2
- package/dist/cli/register-member.js.map +1 -1
- package/dist/commands/kb-server.d.ts +3 -0
- package/dist/commands/kb-server.d.ts.map +1 -1
- package/dist/commands/kb-server.js +43 -3
- package/dist/commands/kb-server.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/os/linux.d.ts +6 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +35 -2
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +61 -2
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/windows-gitbash.d.ts +5 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -1
- package/dist/os/windows-gitbash.js +15 -0
- package/dist/os/windows-gitbash.js.map +1 -1
- package/dist/os/windows.d.ts +6 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +46 -3
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +115 -6
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +569 -53
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +81 -3
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +344 -10
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +4 -2
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +19 -2
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +4 -2
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +20 -2
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/none.d.ts +4 -2
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +17 -2
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +3 -1
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +22 -2
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +201 -6
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +56 -0
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agy-project.d.ts +102 -0
- package/dist/services/agy-project.d.ts.map +1 -0
- package/dist/services/agy-project.js +356 -0
- package/dist/services/agy-project.js.map +1 -0
- package/dist/services/auth-socket.js +4 -4
- package/dist/services/auth-web.js +1 -1
- package/dist/services/cloud/lifecycle.d.ts.map +1 -1
- package/dist/services/cloud/lifecycle.js +33 -4
- package/dist/services/cloud/lifecycle.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +35 -17
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/exit-drain.d.ts +44 -0
- package/dist/services/exit-drain.d.ts.map +1 -0
- package/dist/services/exit-drain.js +52 -0
- package/dist/services/exit-drain.js.map +1 -0
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +32 -4
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/http-transport.d.ts +1 -0
- package/dist/services/http-transport.d.ts.map +1 -1
- package/dist/services/http-transport.js +48 -1
- package/dist/services/http-transport.js.map +1 -1
- package/dist/services/knowledge/kb-config.d.ts +42 -0
- package/dist/services/knowledge/kb-config.d.ts.map +1 -0
- package/dist/services/knowledge/kb-config.js +54 -0
- package/dist/services/knowledge/kb-config.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +7 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -1
- package/dist/services/knowledge/kb-providers.js +191 -17
- package/dist/services/knowledge/kb-providers.js.map +1 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts +32 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +1 -0
- package/dist/services/knowledge/require-sqlite-project.js +38 -0
- package/dist/services/knowledge/require-sqlite-project.js.map +1 -0
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +7 -3
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/secret-token.d.ts +38 -0
- package/dist/services/secret-token.d.ts.map +1 -0
- package/dist/services/secret-token.js +51 -0
- package/dist/services/secret-token.js.map +1 -0
- package/dist/services/service-manager/types.d.ts +3 -1
- package/dist/services/service-manager/types.d.ts.map +1 -1
- package/dist/services/service-manager/windows.d.ts +14 -2
- package/dist/services/service-manager/windows.d.ts.map +1 -1
- package/dist/services/service-manager/windows.js +65 -7
- package/dist/services/service-manager/windows.js.map +1 -1
- package/dist/services/ssh.d.ts.map +1 -1
- package/dist/services/ssh.js +58 -2
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +20 -10
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +53 -4
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +212 -34
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +79 -2
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/substitution-engine.js +2 -2
- package/dist/services/substitution-engine.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +5 -3
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +66 -1
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +192 -21
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/types.d.ts +1 -1
- package/dist/skills/fleet-sprint-cli/SKILL.md +18 -0
- package/dist/skills/pm/SKILL.md +1 -1
- package/dist/skills/pm/cost.md +0 -3
- package/dist/skills/pm/fleet-addendum.md +2 -2
- package/dist/tools/check-status.d.ts +7 -4
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +2 -0
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/compose-permissions.d.ts +6 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +182 -34
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/credential-store-set.js +1 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +31 -20
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +15 -2
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +1196 -892
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/kb-capture.d.ts +2 -2
- package/dist/tools/kb-capture.d.ts.map +1 -1
- package/dist/tools/kb-capture.js +29 -5
- package/dist/tools/kb-capture.js.map +1 -1
- package/dist/tools/kb-export.d.ts +2 -2
- package/dist/tools/kb-export.d.ts.map +1 -1
- package/dist/tools/kb-export.js +3 -28
- package/dist/tools/kb-export.js.map +1 -1
- package/dist/tools/kb-feedback.d.ts.map +1 -1
- package/dist/tools/kb-feedback.js +3 -1
- package/dist/tools/kb-feedback.js.map +1 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -1
- package/dist/tools/kb-freshness-sweep.js +3 -1
- package/dist/tools/kb-freshness-sweep.js.map +1 -1
- package/dist/tools/kb-import.d.ts.map +1 -1
- package/dist/tools/kb-import.js +2 -1
- package/dist/tools/kb-import.js.map +1 -1
- package/dist/tools/kb-list.d.ts.map +1 -1
- package/dist/tools/kb-list.js +3 -1
- package/dist/tools/kb-list.js.map +1 -1
- package/dist/tools/kb-query.d.ts +2 -2
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -1
- package/dist/tools/kb-reconcile-prefilter.js +3 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -1
- package/dist/tools/kb-resolve-contradiction.js +3 -1
- package/dist/tools/kb-resolve-contradiction.js.map +1 -1
- package/dist/tools/kb-setup.d.ts.map +1 -1
- package/dist/tools/kb-setup.js +125 -20
- package/dist/tools/kb-setup.js.map +1 -1
- package/dist/tools/kb-stats.d.ts.map +1 -1
- package/dist/tools/kb-stats.js +64 -43
- package/dist/tools/kb-stats.js.map +1 -1
- package/dist/tools/list-members.d.ts +2 -2
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +1 -0
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts +2 -2
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +17 -0
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts +58 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +61 -20
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/provision-auth.d.ts +80 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +142 -54
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +91 -1
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +209 -49
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +12 -9
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +99 -12
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.d.ts.map +1 -1
- package/dist/tools/remove-member.js +27 -2
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/send-email.d.ts +2 -2
- package/dist/tools/setup-git-app.d.ts.map +1 -1
- package/dist/tools/setup-git-app.js +11 -7
- package/dist/tools/setup-git-app.js.map +1 -1
- package/dist/tools/shutdown-server.d.ts +2 -0
- package/dist/tools/shutdown-server.d.ts.map +1 -1
- package/dist/tools/shutdown-server.js +23 -1
- package/dist/tools/shutdown-server.js.map +1 -1
- package/dist/tools/update-member.d.ts +12 -9
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +43 -11
- package/dist/tools/update-member.js.map +1 -1
- package/dist/tools/vcs-credential-exec.d.ts +127 -0
- package/dist/tools/vcs-credential-exec.d.ts.map +1 -0
- package/dist/tools/vcs-credential-exec.js +197 -0
- package/dist/tools/vcs-credential-exec.js.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/log-helpers.d.ts.map +1 -1
- package/dist/utils/log-helpers.js +2 -2
- package/dist/utils/log-helpers.js.map +1 -1
- package/dist/utils/prompt-errors.d.ts.map +1 -1
- package/dist/utils/prompt-errors.js +7 -1
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/shell-escape.d.ts +16 -0
- package/dist/utils/shell-escape.d.ts.map +1 -1
- package/dist/utils/shell-escape.js +22 -2
- package/dist/utils/shell-escape.js.map +1 -1
- package/dist/utils/vcs-provider-detect.d.ts +65 -0
- package/dist/utils/vcs-provider-detect.d.ts.map +1 -0
- package/dist/utils/vcs-provider-detect.js +109 -0
- package/dist/utils/vcs-provider-detect.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts +20 -17
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +87 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +176 -15
- package/package.json +6 -4
- package/packages/apra-fleet-client/src/client/api.mjs +319 -17
- package/packages/apra-fleet-client/src/client/errors.mjs +6 -2
- package/packages/apra-fleet-se/apra-pm/agents/_shared/GRAPH-SEMANTICS.md +10 -2
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +25 -0
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -2
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +36 -12
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +9 -0
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +110 -22
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +125 -37
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +13 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json +37 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +1 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -3
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +2 -2
- package/packages/apra-fleet-se/bin/cli.mjs +149 -1
- package/packages/apra-fleet-se/bin/serve.mjs +78 -4
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +481 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +491 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +282 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +208 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +638 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +301 -0
- package/packages/apra-fleet-se/fleet-sprint/branch-ensure.mjs +96 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +8 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +61 -14
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +516 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +184 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +1121 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-safety-guard.mjs +216 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +1 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +276 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +1 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/run-sprint-cycle-prelude-decision.md +215 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-literal-guard.mjs +56 -1
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +996 -32
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +267 -0
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +501 -0
- package/packages/apra-fleet-se/fleet-sprint/fatal-diagnostics.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/full-db-fetch-guard.mjs +102 -0
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +556 -0
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +495 -0
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +564 -0
- package/packages/apra-fleet-se/fleet-sprint/inline-ladder-guard.mjs +216 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +728 -0
- package/packages/apra-fleet-se/fleet-sprint/mcp-result.mjs +75 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +252 -0
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +581 -0
- package/packages/apra-fleet-se/fleet-sprint/member-target.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/newtask-text.mjs +266 -0
- package/packages/apra-fleet-se/fleet-sprint/parent-notes-staleness.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +136 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +822 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +294 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +403 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +180 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +358 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +390 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +323 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +232 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +174 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +197 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +305 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +559 -0
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +1416 -0
- package/packages/apra-fleet-se/fleet-sprint/round-session.mjs +100 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1467 -9798
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +17 -12
- package/packages/apra-fleet-se/fleet-sprint/shell-command-guard.mjs +304 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +18 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +21 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +454 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +239 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +163 -0
- package/packages/apra-fleet-se/fleet-sprint/unbracketed-push-guard.mjs +234 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +211 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +1279 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +153 -19
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +71 -21
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +28 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +131 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +140 -16
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +1 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +77 -2
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +559 -0
- package/packages/apra-fleet-se/package.json +1 -1
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +17 -6
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +49 -7
- package/skills/fleet/SKILL.md +8 -8
- package/skills/fleet/auth-azdevops.md +14 -3
- package/skills/fleet/auth-bitbucket.md +2 -2
- package/skills/fleet/auth-github.md +5 -4
- package/skills/fleet/onboarding.md +3 -3
- package/skills/fleet/permissions.md +5 -1
- package/skills/fleet/profiles/node.json +1 -1
- package/skills/fleet/troubleshooting.md +3 -3
- package/version.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// The dispatch-outcome classification surface for fleet-sprint
|
|
2
|
+
// (apra-fleet-3swo.6.15). Extracted out of runner.js; runner.js re-exports
|
|
3
|
+
// every symbol it previously exported from this region, so existing
|
|
4
|
+
// importers of fleet-sprint/runner.js resolve unchanged.
|
|
5
|
+
//
|
|
6
|
+
// This module owns:
|
|
7
|
+
// - isTerminalSprintFailure: classifies whether a thrown error is a
|
|
8
|
+
// terminal typed sprint failure (gates the terminal run-state record so
|
|
9
|
+
// the supervisor watchdog can tell FINISHED-with-a-reason from CRASHED).
|
|
10
|
+
// - isNoMutationDispatchFailure: classifies whether a thrown dispatch error
|
|
11
|
+
// means the dispatch delivered no usable result and therefore produced no
|
|
12
|
+
// code/beads mutation to publish (gates skipping the post-dispatch sync
|
|
13
|
+
// teardown).
|
|
14
|
+
// - isPermissionScopePostDispatchSyncFailure: classifies whether a COMPLETED
|
|
15
|
+
// dispatch's post-dispatch sync failed for the specific, never-self-
|
|
16
|
+
// healable reason that the member's VCS credential lacks a permission
|
|
17
|
+
// (apra-fleet-2wdc.3/.4) -- gates the Develop phase's "publish blocked,
|
|
18
|
+
// do not treat as a failed dispatch, do not re-dispatch" handling.
|
|
19
|
+
// - withDispatchWatchdog: the client-side dispatch watchdog that races an
|
|
20
|
+
// already-in-flight dispatch promise against a local timer.
|
|
21
|
+
//
|
|
22
|
+
// Kept DISTINCT from dispatch-role.mjs on purpose: dispatch-role.mjs is the
|
|
23
|
+
// dispatchRole engine that PERFORMS a dispatch; these three classify or bound
|
|
24
|
+
// the OUTCOME of one, and dispatchRole itself consumes them. Folding them into
|
|
25
|
+
// dispatch-role.mjs would make the engine import its own callers' policy.
|
|
26
|
+
|
|
27
|
+
import { AgentOutputError, AgentDispatchError, FleetTransportError, WorkflowError, BudgetExceededError, CancelledError } from '@apralabs/apra-fleet-workflow';
|
|
28
|
+
import { isTypedAbortError } from './abort.mjs';
|
|
29
|
+
import { isPostDispatchSyncFailure } from './errors.mjs';
|
|
30
|
+
|
|
31
|
+
// Deliberately BROADER than isTypedAbortError(): every terminal WorkflowError
|
|
32
|
+
// except a cooperative cancellation. The two predicates answer two different
|
|
33
|
+
// questions in main()'s catch and must not be collapsed:
|
|
34
|
+
// - isTerminalSprintFailure() gates the terminal run-state record, which
|
|
35
|
+
// exists so the supervisor watchdog can classify a run whose PID is gone as
|
|
36
|
+
// FINISHED-with-a-reason rather than CRASHED. EVERY terminal typed failure
|
|
37
|
+
// needs that, not just the aborts -- e.g. a Planner AgentDispatchError from
|
|
38
|
+
// a dead interactive session must surface a reason, not look like a crash.
|
|
39
|
+
// - isTypedAbortError() gates finalizeAbort()'s branch push + [ABORTED] PR,
|
|
40
|
+
// which is only worth doing where there is a genuine sprint abort whose
|
|
41
|
+
// partial work a human should look at.
|
|
42
|
+
// An untyped throw (a plain Error/TypeError -- i.e. a real bug) is deliberately
|
|
43
|
+
// NOT terminal here: it keeps flowing to the CLI's top-level catch with no
|
|
44
|
+
// record, so the watchdog still reports it as CRASHED.
|
|
45
|
+
export function isTerminalSprintFailure(err) {
|
|
46
|
+
if (!err || err instanceof CancelledError) return false;
|
|
47
|
+
return err instanceof WorkflowError || isTypedAbortError(err);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// AgentDispatchError reasons that mean the agent PROVABLY RAN before the
|
|
51
|
+
// dispatch failed, so its (possibly partial) code/beads work still has to be
|
|
52
|
+
// published and its teardown must run normally:
|
|
53
|
+
// - 'max_turns_exhausted': the resumable partial-work case -- the agent hit
|
|
54
|
+
// its turn ceiling after doing real work;
|
|
55
|
+
// - 'watchdog_timeout': withDispatchWatchdog() fired locally on an
|
|
56
|
+
// already-in-flight dispatch. The prompt was DELIVERED and the member is
|
|
57
|
+
// alive-but-silent, so the turn may have run to completion (a stalled
|
|
58
|
+
// planner can have created the whole DAG) with only the RESULT lost. The
|
|
59
|
+
// watchdog abandons the dispatch promise, not the member's work.
|
|
60
|
+
const AGENT_RAN_DISPATCH_REASONS = new Set(['max_turns_exhausted', 'watchdog_timeout']);
|
|
61
|
+
|
|
62
|
+
// True when a thrown dispatch error means the dispatch delivered no usable
|
|
63
|
+
// result and therefore produced no code/beads mutation to publish: a failed
|
|
64
|
+
// agent dispatch (AgentDispatchError, minus the AGENT_RAN_DISPATCH_REASONS
|
|
65
|
+
// above), a dispatch-channel transport failure (FleetTransportError), or a
|
|
66
|
+
// PRE-dispatch typed sprint abort. The orchestrator's post-dispatch sync
|
|
67
|
+
// teardown is then wasted work and is skipped (see withGitSync).
|
|
68
|
+
//
|
|
69
|
+
// Deliberately EXCLUDED:
|
|
70
|
+
// - AgentOutputError: the LLM RESPONDED and only its output was
|
|
71
|
+
// empty/unparseable/schema-invalid. A schema-invalid response routinely
|
|
72
|
+
// follows real committed work (the agent did the job, then botched the
|
|
73
|
+
// report), so its teardown must run. This is the status quo -- the class
|
|
74
|
+
// was never named here and, post-apra-fleet-9ta.1, isTypedAbortError() is
|
|
75
|
+
// false for it -- pinned explicitly so a future edit cannot silently
|
|
76
|
+
// re-sweep it in;
|
|
77
|
+
// - every POST-dispatch typed abort. The predicate used to fold in the whole
|
|
78
|
+
// of isTypedAbortError(), but only errors thrown from INSIDE withGitSync's
|
|
79
|
+
// `dispatchFn` can ever reach it, and the curated abort set is dominated by
|
|
80
|
+
// aborts the runner raises AFTER a dispatch already returned and mutated
|
|
81
|
+
// beads (SprintPlanRejectedError, ReviewerContractViolationError,
|
|
82
|
+
// StalledSprintError) or by divergences the SYNC brackets themselves throw
|
|
83
|
+
// (GitDivergedError/DoltDivergedError), none of which are reachable here.
|
|
84
|
+
// BudgetExceededError is the one genuinely pre-dispatch member: agent()/
|
|
85
|
+
// command() throw it from inside the dispatch closure BEFORE any dispatch
|
|
86
|
+
// is issued (packages/apra-fleet-workflow/src/workflow/errors.mjs), so it
|
|
87
|
+
// alone provably mutated nothing.
|
|
88
|
+
export function isNoMutationDispatchFailure(err) {
|
|
89
|
+
if (!err) return false;
|
|
90
|
+
if (err instanceof AgentOutputError) return false;
|
|
91
|
+
if (err instanceof AgentDispatchError && err.details && AGENT_RAN_DISPATCH_REASONS.has(err.details.reason)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return err instanceof AgentDispatchError || err instanceof FleetTransportError || err instanceof BudgetExceededError;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// (apra-fleet-2wdc.4) True when `err` is a PostDispatchSyncError (the LLM
|
|
98
|
+
// turn COMPLETED; only the post-dispatch G-push/D-push teardown failed --
|
|
99
|
+
// see errors.mjs's PostDispatchSyncError) whose failure is SPECIFICALLY the
|
|
100
|
+
// permission-scope git refusal apra-fleet-2wdc.3 taught the classifier to
|
|
101
|
+
// recognise (github.mjs's workflow-file refusal today; any future provider
|
|
102
|
+
// that opts into vcs-providers/index.mjs's `permissionScope` hook tomorrow).
|
|
103
|
+
//
|
|
104
|
+
// WHY A TEXT MATCH, NOT A STRUCTURED FLAG. git-topology.mjs's runGitStep()
|
|
105
|
+
// carries `permissionScope: true` on its OWN return value, but member-sync.mjs
|
|
106
|
+
// (syncMemberAfter/syncMemberAfterOrdered -- deliberately NOT edited by this
|
|
107
|
+
// task) reads only `push.kind`/`push.error` off that result and throws a
|
|
108
|
+
// plain GitSyncError whose `message` is built from `push.error`. That string
|
|
109
|
+
// is exactly runGitStep's `${error}\n${referral}`, so the referral's stable
|
|
110
|
+
// lead-in -- "[Sync] permission-scope git failure for member" -- survives
|
|
111
|
+
// intact through GitSyncError.message -> (as `cause`) -> PostDispatchSyncError
|
|
112
|
+
// .message (git-sync.mjs interpolates `syncErr.message` into its own message).
|
|
113
|
+
// Matching that phrase is therefore reading the SAME classification
|
|
114
|
+
// git-topology.mjs already computed, one level removed, without adding a new
|
|
115
|
+
// structured field to member-sync.mjs's thrown errors.
|
|
116
|
+
//
|
|
117
|
+
// Checks both `err.message` (the interpolated chain covers it already) and
|
|
118
|
+
// `err.cause` explicitly, so this stays correct even if a future change
|
|
119
|
+
// stops re-interpolating the full chain into the top-level message.
|
|
120
|
+
const PERMISSION_SCOPE_SYNC_FAILURE_MARKER = /permission-scope git failure/i;
|
|
121
|
+
|
|
122
|
+
export function isPermissionScopePostDispatchSyncFailure(err) {
|
|
123
|
+
if (!isPostDispatchSyncFailure(err)) return false;
|
|
124
|
+
const cause = err.cause;
|
|
125
|
+
const text = `${err.message || ''} ${cause && cause.message ? cause.message : ''} ${cause && cause.gitOutput ? cause.gitOutput : ''}`;
|
|
126
|
+
return PERMISSION_SCOPE_SYNC_FAILURE_MARKER.test(text);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// Client-side dispatch watchdog
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
//
|
|
133
|
+
// A member process can stay alive while producing no further output after a
|
|
134
|
+
// prompt is delivered -- a state no liveness check detects. `timeout_s` is
|
|
135
|
+
// threaded to execute_prompt on every dispatch, but server-side enforcement
|
|
136
|
+
// cannot be the only guard against an alive-but-silent orchestrator, so this
|
|
137
|
+
// adds a client-side backstop that depends on nothing the server does.
|
|
138
|
+
//
|
|
139
|
+
// withDispatchWatchdog() races an already-in-flight dispatch promise against a
|
|
140
|
+
// local timer of `timeoutS` plus this grace period, the grace existing so the
|
|
141
|
+
// server's own timeout gets first refusal at producing a clean error. If the
|
|
142
|
+
// dispatch has not settled by then, the race rejects with a typed
|
|
143
|
+
// AgentDispatchError (reason 'watchdog_timeout') rather than leaving the caller
|
|
144
|
+
// awaiting silently, and that typed error follows the same abort routing as
|
|
145
|
+
// every other typed dispatch failure here. Promise.race() attaches its own
|
|
146
|
+
// handler to the abandoned dispatch promise, so a late settlement after the
|
|
147
|
+
// watchdog fired is dropped rather than becoming an unhandled rejection.
|
|
148
|
+
const DISPATCH_WATCHDOG_GRACE_S = 30;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @param {Promise<any>} dispatchPromise - an ALREADY-STARTED dispatch (e.g. an agent() call).
|
|
152
|
+
* @param {{ timeoutS: number, member?: string, label?: string, log?: (msg: string) => void }} opts
|
|
153
|
+
* @returns {Promise<any>}
|
|
154
|
+
*/
|
|
155
|
+
export function withDispatchWatchdog(dispatchPromise, opts = {}) {
|
|
156
|
+
const { timeoutS, member = 'unknown', label = 'dispatch', log = () => {} } = opts;
|
|
157
|
+
const budgetMs = (timeoutS + DISPATCH_WATCHDOG_GRACE_S) * 1000;
|
|
158
|
+
let timer;
|
|
159
|
+
const watchdogPromise = new Promise((_resolve, reject) => {
|
|
160
|
+
timer = setTimeout(() => {
|
|
161
|
+
// "its configured watchdog budget", not a named field: this
|
|
162
|
+
// budget is role-policies.mjs's resolved elapsed-ceiling value
|
|
163
|
+
// (timeouts.maxTotalS when set and longer, else timeouts.timeoutS
|
|
164
|
+
// -- see resolveWatchdogTimeout, apra-fleet-3swo.7.12 Final Review
|
|
165
|
+
// reopen), so naming dispatch_timeout_s specifically here would be
|
|
166
|
+
// wrong for a role like integ-test-runner whose watchdog resolves
|
|
167
|
+
// to a different, longer budget.
|
|
168
|
+
const message = `[dispatch-watchdog] ${label} to member '${member}' produced no result within ${timeoutS}s (+${DISPATCH_WATCHDOG_GRACE_S}s grace) -- treating this attempt as a stalled/dead session and aborting it (no code path may leave this orchestrator alive-but-silent past its configured watchdog budget).`;
|
|
169
|
+
log(message);
|
|
170
|
+
reject(new AgentDispatchError(
|
|
171
|
+
`[Workflow Error] ${label} timed out (watchdog): no response from '${member}' within ${timeoutS}s (+${DISPATCH_WATCHDOG_GRACE_S}s grace).`,
|
|
172
|
+
{ details: { reason: 'watchdog_timeout', member, timeoutS, graceS: DISPATCH_WATCHDOG_GRACE_S } }
|
|
173
|
+
));
|
|
174
|
+
}, budgetMs);
|
|
175
|
+
// The timer is deliberately NOT unref'd. A never-settling dispatch can
|
|
176
|
+
// leave this timer as the only work on the event loop; an unref'd timer
|
|
177
|
+
// would then let the loop drain before it fires, so the abort would
|
|
178
|
+
// never happen and the process would hang -- exactly what this watchdog
|
|
179
|
+
// exists to prevent. Keeping it ref'd holds the loop open until the
|
|
180
|
+
// abort fires; a dispatch that settles first is released by the
|
|
181
|
+
// clearTimeout() below, so a fast dispatch never delays process exit.
|
|
182
|
+
});
|
|
183
|
+
return Promise.race([dispatchPromise, watchdogPromise]).finally(() => clearTimeout(timer));
|
|
184
|
+
}
|