@apralabs/apra-fleet 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -12
- package/dist/agents/backlog-groomer.md +42 -21
- package/dist/agents/ci-watcher.md +14 -0
- package/dist/agents/deployer.md +59 -46
- package/dist/agents/doer.md +157 -134
- package/dist/agents/harvester.md +31 -32
- package/dist/agents/integ-test-runner.md +92 -113
- package/dist/agents/kb-reconciler.md +40 -42
- package/dist/agents/plan-reviewer.md +139 -63
- package/dist/agents/planner.md +176 -100
- package/dist/agents/regression-test-runner.md +77 -81
- package/dist/agents/reviewer.md +69 -85
- package/dist/agents/schemas/integ-test-runner-output.json +1 -1
- package/dist/agents/schemas/plan-reviewer-output.json +37 -0
- package/dist/agents/schemas/regression-test-runner-output.json +4 -17
- package/dist/cli/agent-transform.d.ts +83 -2
- package/dist/cli/agent-transform.d.ts.map +1 -1
- package/dist/cli/agent-transform.js +266 -21
- package/dist/cli/agent-transform.js.map +1 -1
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +29 -11
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +7 -5
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +44 -43
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +33 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +294 -61
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/kb-directives.d.ts.map +1 -1
- package/dist/cli/kb-directives.js +2 -1
- package/dist/cli/kb-directives.js.map +1 -1
- package/dist/cli/register-member.d.ts.map +1 -1
- package/dist/cli/register-member.js +7 -3
- package/dist/cli/register-member.js.map +1 -1
- package/dist/cli/start.d.ts.map +1 -1
- package/dist/cli/start.js +7 -0
- package/dist/cli/start.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +5 -3
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/watch.d.ts +26 -3
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +41 -9
- package/dist/cli/watch.js.map +1 -1
- package/dist/commands/kb-server.d.ts +3 -0
- package/dist/commands/kb-server.d.ts.map +1 -1
- package/dist/commands/kb-server.js +43 -3
- package/dist/commands/kb-server.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/os/git-bash-candidates.d.ts +35 -0
- package/dist/os/git-bash-candidates.d.ts.map +1 -0
- package/dist/os/git-bash-candidates.js +46 -0
- package/dist/os/git-bash-candidates.js.map +1 -0
- package/dist/os/index.d.ts +13 -4
- package/dist/os/index.d.ts.map +1 -1
- package/dist/os/index.js +17 -2
- package/dist/os/index.js.map +1 -1
- package/dist/os/linux.d.ts +6 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +36 -3
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +68 -2
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/os-commands.js.map +1 -1
- package/dist/os/windows-gitbash.d.ts +98 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -0
- package/dist/os/windows-gitbash.js +259 -0
- package/dist/os/windows-gitbash.js.map +1 -0
- package/dist/os/windows.d.ts +6 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +73 -8
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +118 -8
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +580 -55
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +83 -4
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +365 -12
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +7 -4
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +24 -4
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +7 -4
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +27 -4
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +0 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/none.d.ts +7 -4
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +22 -4
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +6 -3
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +27 -4
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +215 -11
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +58 -2
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.js +2 -2
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/agy-project.d.ts +102 -0
- package/dist/services/agy-project.d.ts.map +1 -0
- package/dist/services/agy-project.js +356 -0
- package/dist/services/agy-project.js.map +1 -0
- package/dist/services/auth-socket.js +4 -4
- package/dist/services/auth-web.js +1 -1
- package/dist/services/cloud/activity.js +2 -2
- package/dist/services/cloud/activity.js.map +1 -1
- package/dist/services/cloud/lifecycle.d.ts.map +1 -1
- package/dist/services/cloud/lifecycle.js +33 -4
- package/dist/services/cloud/lifecycle.js.map +1 -1
- package/dist/services/context-admission.d.ts.map +1 -1
- package/dist/services/context-admission.js +9 -7
- package/dist/services/context-admission.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +47 -10
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/exit-drain.d.ts +44 -0
- package/dist/services/exit-drain.d.ts.map +1 -0
- package/dist/services/exit-drain.js +52 -0
- package/dist/services/exit-drain.js.map +1 -0
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +32 -4
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/http-transport.d.ts +1 -0
- package/dist/services/http-transport.d.ts.map +1 -1
- package/dist/services/http-transport.js +48 -1
- package/dist/services/http-transport.js.map +1 -1
- package/dist/services/knowledge/kb-config.d.ts +42 -0
- package/dist/services/knowledge/kb-config.d.ts.map +1 -0
- package/dist/services/knowledge/kb-config.js +54 -0
- package/dist/services/knowledge/kb-config.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +7 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -1
- package/dist/services/knowledge/kb-providers.js +191 -17
- package/dist/services/knowledge/kb-providers.js.map +1 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts +32 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +1 -0
- package/dist/services/knowledge/require-sqlite-project.js +38 -0
- package/dist/services/knowledge/require-sqlite-project.js.map +1 -0
- package/dist/services/member-home.d.ts +1 -1
- package/dist/services/member-home.d.ts.map +1 -1
- package/dist/services/member-home.js +15 -12
- package/dist/services/member-home.js.map +1 -1
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +7 -8
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/orphan-recovery.d.ts +6 -3
- package/dist/services/orphan-recovery.d.ts.map +1 -1
- package/dist/services/orphan-recovery.js +17 -14
- package/dist/services/orphan-recovery.js.map +1 -1
- package/dist/services/preflight-check.js +2 -2
- package/dist/services/preflight-check.js.map +1 -1
- package/dist/services/secret-token.d.ts +38 -0
- package/dist/services/secret-token.d.ts.map +1 -0
- package/dist/services/secret-token.js +51 -0
- package/dist/services/secret-token.js.map +1 -0
- package/dist/services/service-manager/types.d.ts +3 -1
- package/dist/services/service-manager/types.d.ts.map +1 -1
- package/dist/services/service-manager/windows.d.ts +14 -2
- package/dist/services/service-manager/windows.d.ts.map +1 -1
- package/dist/services/service-manager/windows.js +65 -7
- package/dist/services/service-manager/windows.js.map +1 -1
- package/dist/services/shell-probe.d.ts +131 -0
- package/dist/services/shell-probe.d.ts.map +1 -0
- package/dist/services/shell-probe.js +210 -0
- package/dist/services/shell-probe.js.map +1 -0
- package/dist/services/singleton.d.ts +2 -0
- package/dist/services/singleton.d.ts.map +1 -1
- package/dist/services/singleton.js +1 -1
- package/dist/services/singleton.js.map +1 -1
- package/dist/services/ssh.d.ts.map +1 -1
- package/dist/services/ssh.js +60 -4
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/find-log-file.d.ts.map +1 -1
- package/dist/services/stall/find-log-file.js +22 -16
- package/dist/services/stall/find-log-file.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +26 -15
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +53 -4
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +212 -34
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +35 -42
- package/dist/services/stall/stall-poller.js.map +1 -1
- package/dist/services/strategy.d.ts +9 -0
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +119 -8
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/substitution-engine.js +2 -2
- package/dist/services/substitution-engine.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +5 -3
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/user-config.js +1 -1
- package/dist/services/user-config.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +67 -2
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +281 -15
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/bitbucket.d.ts.map +1 -1
- package/dist/services/vcs/bitbucket.js +16 -0
- package/dist/services/vcs/bitbucket.js.map +1 -1
- package/dist/services/vcs/github.d.ts.map +1 -1
- package/dist/services/vcs/github.js +24 -0
- package/dist/services/vcs/github.js.map +1 -1
- package/dist/services/vcs/types.d.ts +123 -2
- package/dist/services/vcs/types.d.ts.map +1 -1
- package/dist/skills/fleet-sprint-cli/SKILL.md +20 -1
- package/dist/skills/pm/SKILL.md +1 -2
- package/dist/skills/pm/cost.md +0 -4
- package/dist/skills/pm/fleet-addendum.md +2 -3
- package/dist/tools/check-status.d.ts +7 -4
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +5 -3
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/cloud-control.js +2 -2
- package/dist/tools/cloud-control.js.map +1 -1
- package/dist/tools/compose-permissions.d.ts +6 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +211 -50
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/credential-store-set.js +1 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +56 -29
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +15 -2
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +1214 -873
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/kb-capture.d.ts +2 -2
- package/dist/tools/kb-capture.d.ts.map +1 -1
- package/dist/tools/kb-capture.js +29 -5
- package/dist/tools/kb-capture.js.map +1 -1
- package/dist/tools/kb-export.d.ts +2 -2
- package/dist/tools/kb-export.d.ts.map +1 -1
- package/dist/tools/kb-export.js +3 -28
- package/dist/tools/kb-export.js.map +1 -1
- package/dist/tools/kb-feedback.d.ts.map +1 -1
- package/dist/tools/kb-feedback.js +3 -1
- package/dist/tools/kb-feedback.js.map +1 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -1
- package/dist/tools/kb-freshness-sweep.js +3 -1
- package/dist/tools/kb-freshness-sweep.js.map +1 -1
- package/dist/tools/kb-import.d.ts.map +1 -1
- package/dist/tools/kb-import.js +2 -1
- package/dist/tools/kb-import.js.map +1 -1
- package/dist/tools/kb-list.d.ts.map +1 -1
- package/dist/tools/kb-list.js +3 -1
- package/dist/tools/kb-list.js.map +1 -1
- package/dist/tools/kb-query.d.ts +2 -2
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -1
- package/dist/tools/kb-reconcile-prefilter.js +3 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -1
- package/dist/tools/kb-resolve-contradiction.js +3 -1
- package/dist/tools/kb-resolve-contradiction.js.map +1 -1
- package/dist/tools/kb-setup.d.ts.map +1 -1
- package/dist/tools/kb-setup.js +125 -20
- package/dist/tools/kb-setup.js.map +1 -1
- package/dist/tools/kb-stats.d.ts.map +1 -1
- package/dist/tools/kb-stats.js +64 -43
- package/dist/tools/kb-stats.js.map +1 -1
- package/dist/tools/list-members.d.ts +2 -2
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +7 -2
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts +2 -2
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +22 -3
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts +58 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +71 -18
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/monitor-task.d.ts.map +1 -1
- package/dist/tools/monitor-task.js +17 -2
- package/dist/tools/monitor-task.js.map +1 -1
- package/dist/tools/provision-auth.d.ts +80 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +147 -59
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +96 -3
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +254 -88
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +21 -12
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +141 -16
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.d.ts.map +1 -1
- package/dist/tools/remove-member.js +29 -4
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/revoke-vcs-auth.js +2 -2
- package/dist/tools/revoke-vcs-auth.js.map +1 -1
- package/dist/tools/send-email.d.ts +2 -2
- package/dist/tools/setup-git-app.d.ts.map +1 -1
- package/dist/tools/setup-git-app.js +11 -7
- package/dist/tools/setup-git-app.js.map +1 -1
- package/dist/tools/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +2 -1
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/shutdown-server.d.ts +2 -0
- package/dist/tools/shutdown-server.d.ts.map +1 -1
- package/dist/tools/shutdown-server.js +23 -1
- package/dist/tools/shutdown-server.js.map +1 -1
- package/dist/tools/stop-prompt.js +2 -2
- package/dist/tools/stop-prompt.js.map +1 -1
- package/dist/tools/update-agent-cli.js +2 -2
- package/dist/tools/update-agent-cli.js.map +1 -1
- package/dist/tools/update-member.d.ts +21 -12
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +61 -12
- package/dist/tools/update-member.js.map +1 -1
- package/dist/tools/vcs-credential-exec.d.ts +127 -0
- package/dist/tools/vcs-credential-exec.d.ts.map +1 -0
- package/dist/tools/vcs-credential-exec.js +197 -0
- package/dist/tools/vcs-credential-exec.js.map +1 -0
- package/dist/types.d.ts +24 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agent-helpers.d.ts +36 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -1
- package/dist/utils/agent-helpers.js +39 -1
- package/dist/utils/agent-helpers.js.map +1 -1
- package/dist/utils/log-helpers.d.ts.map +1 -1
- package/dist/utils/log-helpers.js +2 -2
- package/dist/utils/log-helpers.js.map +1 -1
- package/dist/utils/platform.d.ts +7 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +11 -1
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/prompt-errors.d.ts.map +1 -1
- package/dist/utils/prompt-errors.js +7 -1
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/shell-escape.d.ts +16 -0
- package/dist/utils/shell-escape.d.ts.map +1 -1
- package/dist/utils/shell-escape.js +22 -2
- package/dist/utils/shell-escape.js.map +1 -1
- package/dist/utils/vcs-provider-detect.d.ts +65 -0
- package/dist/utils/vcs-provider-detect.d.ts.map +1 -0
- package/dist/utils/vcs-provider-detect.js +109 -0
- package/dist/utils/vcs-provider-detect.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts +20 -17
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +91 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +180 -32
- package/package.json +7 -5
- package/packages/apra-fleet-client/src/client/api.mjs +403 -12
- package/packages/apra-fleet-client/src/client/errors.mjs +6 -2
- package/packages/apra-fleet-se/apra-pm/agents/_shared/GRAPH-SEMANTICS.md +10 -2
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +42 -21
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +14 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +59 -46
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +157 -134
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +31 -32
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +92 -113
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +40 -42
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +139 -63
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +176 -100
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +77 -81
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +69 -85
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json +37 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +1 -2
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -4
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +2 -3
- package/packages/apra-fleet-se/bin/cli.mjs +280 -3
- package/packages/apra-fleet-se/bin/serve.mjs +114 -5
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +481 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +491 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +282 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +208 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +638 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +301 -0
- package/packages/apra-fleet-se/fleet-sprint/branch-ensure.mjs +96 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +8 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +199 -34
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +516 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +184 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +1121 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-safety-guard.mjs +216 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +23 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +10 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +285 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +3 -3
- package/packages/apra-fleet-se/fleet-sprint/docs/run-sprint-cycle-prelude-decision.md +215 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +12 -12
- package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
- package/packages/apra-fleet-se/fleet-sprint/dolt-literal-guard.mjs +56 -1
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +275 -99
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +1054 -39
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +308 -0
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +501 -0
- package/packages/apra-fleet-se/fleet-sprint/fatal-diagnostics.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/full-db-fetch-guard.mjs +102 -0
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +556 -0
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +495 -0
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +564 -0
- package/packages/apra-fleet-se/fleet-sprint/inline-ladder-guard.mjs +216 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +728 -0
- package/packages/apra-fleet-se/fleet-sprint/mcp-result.mjs +75 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +252 -0
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +581 -0
- package/packages/apra-fleet-se/fleet-sprint/member-target.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/newtask-text.mjs +266 -0
- package/packages/apra-fleet-se/fleet-sprint/parent-notes-staleness.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +136 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +822 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +294 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +403 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +180 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +358 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +390 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +323 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +232 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +174 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +197 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +305 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +559 -0
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +1416 -0
- package/packages/apra-fleet-se/fleet-sprint/round-session.mjs +100 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1672 -9072
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +159 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
- package/packages/apra-fleet-se/fleet-sprint/shell-command-guard.mjs +304 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +20 -1
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +21 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +454 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +239 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +163 -0
- package/packages/apra-fleet-se/fleet-sprint/unbracketed-push-guard.mjs +234 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +211 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +1279 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +204 -19
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +707 -12
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +28 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +191 -43
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +333 -6
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +165 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +167 -37
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +559 -0
- package/packages/apra-fleet-se/package.json +1 -1
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +178 -1
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +478 -32
- package/skills/fleet/SKILL.md +27 -16
- package/skills/fleet/auth-azdevops.md +57 -7
- package/skills/fleet/auth-bitbucket.md +5 -5
- package/skills/fleet/auth-github.md +7 -6
- package/skills/fleet/beads-conflict-resolution.md +141 -0
- package/skills/fleet/beads.md +16 -12
- package/skills/fleet/onboarding.md +6 -6
- package/skills/fleet/permissions.md +11 -7
- package/skills/fleet/profiles/node.json +1 -1
- package/skills/fleet/skill-matrix.md +1 -1
- package/skills/fleet/troubleshooting.md +4 -3
- package/version.json +1 -1
- package/dist/providers/gemini.d.ts +0 -52
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -236
- package/dist/providers/gemini.js.map +0 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -23
|
@@ -94,31 +94,37 @@ export function validateRole(role) {
|
|
|
94
94
|
// 2. Role-owned schema loader (apra-fleet-unw.22, packaging-safe per apra-fleet-bun)
|
|
95
95
|
// ---------------------------------------------------------------------------
|
|
96
96
|
//
|
|
97
|
-
// Schema resolution is layout-aware and
|
|
98
|
-
//
|
|
99
|
-
// correctly regardless of how it ended up
|
|
100
|
-
// clone (this repo, today), a standalone `npm
|
|
101
|
-
// se`, or bundled into the root
|
|
102
|
-
// sprint.mjs. `resolveSchemasDir()`
|
|
97
|
+
// Schema resolution is layout-aware and freshness-first between the two
|
|
98
|
+
// bundled/local candidates (apra-fleet-ot2z.20), because apra-fleet-se must
|
|
99
|
+
// resolve its apra-pm role schemas correctly regardless of how it ended up
|
|
100
|
+
// on disk: a full monorepo git clone (this repo, today), a standalone `npm
|
|
101
|
+
// install @apralabs/apra-fleet-se`, or bundled into the root
|
|
102
|
+
// @apralabs/apra-fleet package's dist/auto-sprint.mjs. `resolveSchemasDir()`
|
|
103
|
+
// below tries, in order:
|
|
103
104
|
//
|
|
104
105
|
// 1. process.env.APRA_FLEET_SE_SCHEMAS_DIR, if set -- an explicit
|
|
105
|
-
// override, used as-is with no further fallback
|
|
106
|
-
//
|
|
107
|
-
// an exact schemas directory.
|
|
108
|
-
// 2. <root>/dist/agents/schemas
|
|
109
|
-
// pm.mjs
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
106
|
+
// override, used as-is with no further fallback and no freshness
|
|
107
|
+
// lookup at all. Tests use this to point at a fixture directory; any
|
|
108
|
+
// deployment may also use it to pin an exact schemas directory.
|
|
109
|
+
// 2. If only one of <root>/dist/agents/schemas (the sibling directory
|
|
110
|
+
// scripts/dist-pm.mjs populates at the root package's
|
|
111
|
+
// `prepublishOnly`, cpSync of packages/apra-fleet-se/apra-pm/agents ->
|
|
112
|
+
// dist/agents, which includes its schemas/ subdir) or
|
|
113
|
+
// packages/apra-fleet-se/apra-pm/agents/schemas (the package-local
|
|
114
|
+
// apra-pm directory) exists, resolve that one. This is the path every
|
|
115
|
+
// real deployment (standalone install, dist bundle, clean CI checkout)
|
|
116
|
+
// takes.
|
|
117
|
+
// 3. If BOTH exist, resolve the NEWER one, where a directory's freshness
|
|
118
|
+
// is the MAXIMUM mtime over the .json files it contains, searched
|
|
119
|
+
// recursively (not the directory's own mtime, which only moves on
|
|
120
|
+
// entry create/delete/rename and would miss an in-place edit to an
|
|
121
|
+
// existing schema file). Ties resolve to dist, preserving the
|
|
122
|
+
// pre-apra-fleet-ot2z.20 behaviour.
|
|
117
123
|
//
|
|
118
|
-
// If
|
|
119
|
-
// `loadVendorSchema` already treats a null/absent directory as the
|
|
120
|
-
// quiet graceful-degradation case (every schema falls back to its
|
|
121
|
-
// written literal in section 3) -- unchanged from before apra-fleet-bun.
|
|
124
|
+
// If neither candidate exists as a directory, `resolveSchemasDir()` returns
|
|
125
|
+
// `null`; `loadVendorSchema` already treats a null/absent directory as the
|
|
126
|
+
// expected, quiet graceful-degradation case (every schema falls back to its
|
|
127
|
+
// hand-written literal in section 3) -- unchanged from before apra-fleet-bun.
|
|
122
128
|
const PACKAGE_ROOT = path.join(__dirname, '..');
|
|
123
129
|
const REPO_ROOT = path.join(PACKAGE_ROOT, '..', '..');
|
|
124
130
|
// Exported (not just module-local) so a drift guard test can compare the two
|
|
@@ -135,23 +141,65 @@ function isDirectory(candidate) {
|
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Default freshness lookup for `resolveSchemasDir()`'s both-exist branch:
|
|
146
|
+
* the maximum mtime (ms) over every `.json` file found by a recursive walk
|
|
147
|
+
* of `dir`. Tolerates an unreadable or empty directory by treating it as
|
|
148
|
+
* freshness 0 rather than throwing -- a directory disappearing or being
|
|
149
|
+
* unreadable between the `exists()` check and this walk must not crash
|
|
150
|
+
* schema resolution.
|
|
151
|
+
* @param {string} dir
|
|
152
|
+
* @returns {number}
|
|
153
|
+
*/
|
|
154
|
+
function newestJsonMtimeMs(dir) {
|
|
155
|
+
let newest = 0;
|
|
156
|
+
let entries;
|
|
157
|
+
try {
|
|
158
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
159
|
+
} catch {
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
162
|
+
for (const entry of entries) {
|
|
163
|
+
const entryPath = path.join(dir, entry.name);
|
|
164
|
+
if (entry.isDirectory()) {
|
|
165
|
+
newest = Math.max(newest, newestJsonMtimeMs(entryPath));
|
|
166
|
+
} else if (entry.isFile() && entry.name.endsWith('.json')) {
|
|
167
|
+
try {
|
|
168
|
+
newest = Math.max(newest, fs.statSync(entryPath).mtimeMs);
|
|
169
|
+
} catch {
|
|
170
|
+
// Unreadable file between readdir and stat -- ignore it.
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return newest;
|
|
175
|
+
}
|
|
176
|
+
|
|
138
177
|
/**
|
|
139
178
|
* Resolves the directory to load vendored role schemas from, per the
|
|
140
|
-
*
|
|
179
|
+
* freshness-first precedence documented above. Exported (and
|
|
141
180
|
* side-effect-injectable via `deps`) so tests can exercise every branch in
|
|
142
181
|
* isolation without needing real directories on disk for each case.
|
|
143
|
-
* @param {{ env?: Record<string, string | undefined>, exists?: (candidate: string) => boolean }} [deps]
|
|
182
|
+
* @param {{ env?: Record<string, string | undefined>, exists?: (candidate: string) => boolean, newestJsonMtimeMs?: (dir: string) => number }} [deps]
|
|
144
183
|
* @returns {string | null}
|
|
145
184
|
*/
|
|
146
185
|
export function resolveSchemasDir(deps = {}) {
|
|
147
186
|
const env = deps.env || process.env;
|
|
148
187
|
const exists = deps.exists || isDirectory;
|
|
188
|
+
const freshnessOf = deps.newestJsonMtimeMs || newestJsonMtimeMs;
|
|
149
189
|
|
|
150
190
|
const override = env.APRA_FLEET_SE_SCHEMAS_DIR;
|
|
151
191
|
if (override) return override;
|
|
152
192
|
|
|
153
|
-
|
|
154
|
-
|
|
193
|
+
const distExists = exists(DIST_BUNDLED_SCHEMAS_DIR);
|
|
194
|
+
const localExists = exists(PACKAGE_LOCAL_SCHEMAS_DIR);
|
|
195
|
+
|
|
196
|
+
if (distExists && localExists) {
|
|
197
|
+
const localFreshness = freshnessOf(PACKAGE_LOCAL_SCHEMAS_DIR);
|
|
198
|
+
const distFreshness = freshnessOf(DIST_BUNDLED_SCHEMAS_DIR);
|
|
199
|
+
return localFreshness > distFreshness ? PACKAGE_LOCAL_SCHEMAS_DIR : DIST_BUNDLED_SCHEMAS_DIR;
|
|
200
|
+
}
|
|
201
|
+
if (distExists) return DIST_BUNDLED_SCHEMAS_DIR;
|
|
202
|
+
if (localExists) return PACKAGE_LOCAL_SCHEMAS_DIR;
|
|
155
203
|
|
|
156
204
|
return null;
|
|
157
205
|
}
|
|
@@ -233,9 +281,12 @@ export function majorVersionFromId(id) {
|
|
|
233
281
|
export function assertVersionPin(role, schema, expectedMajor) {
|
|
234
282
|
const actualMajor = majorVersionFromId(schema && schema.$id);
|
|
235
283
|
if (actualMajor !== expectedMajor) {
|
|
284
|
+
// GENERIC-BOUNDARY-EXCEPTION: developer-facing Error about this product's own vendored schema --
|
|
285
|
+
// thrown at module load and read by an apra-fleet developer, never dispatched to a sprint
|
|
286
|
+
// agent; it must name the package whose vendored schema drifted (docs/generic-engine-boundary.md).
|
|
236
287
|
throw new Error(
|
|
237
288
|
`[contracts] Version-pin mismatch for role "${role}": this module was written against ` +
|
|
238
|
-
`schema $id major version ${expectedMajor}, but the vendored schema's $id is ` +
|
|
289
|
+
`schema $id major version ${expectedMajor}, but the vendored schema's $id is ` + // shell-guard-allow: "$id" here and on the next line is the JSON Schema $id property name (schema.$id), not a shell variable expansion -- this text is a thrown JS Error, never dispatched as a command string.
|
|
239
290
|
`${JSON.stringify(schema && schema.$id)}. A packages/apra-fleet-se/apra-pm package update changed this ` +
|
|
240
291
|
`role's contract -- update contracts.mjs (and re-verify every call site that consumes ` +
|
|
241
292
|
`this schema) before accepting the new vendored version.`,
|
|
@@ -375,6 +426,47 @@ const FALLBACK_planReviewerVerdict = {
|
|
|
375
426
|
properties: {
|
|
376
427
|
verdict: { type: 'string', enum: ['APPROVED', 'CHANGES_NEEDED'] },
|
|
377
428
|
notes: { type: 'string' },
|
|
429
|
+
// apra-fleet-3swo.7.8: optional, deliberately NOT in `required` below
|
|
430
|
+
// -- mirrors packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json.
|
|
431
|
+
// Machine-readable per-bead findings, so a CHANGES_NEEDED verdict can
|
|
432
|
+
// be routed to the beads it concerns WITHOUT scanning free-text notes
|
|
433
|
+
// for literal bead ids (the job extractContestedBeadIds does today in
|
|
434
|
+
// fleet-sprint/newtask-text.mjs; retiring that scraper is a separate
|
|
435
|
+
// task). An EMPTY array is meaningful -- it is the explicit
|
|
436
|
+
// "plan-wide objection, no individual bead named" signal, which is the
|
|
437
|
+
// same thing the prose scan expressed by matching no id. An ABSENT
|
|
438
|
+
// field is schema-valid and means "this verdict predates the findings
|
|
439
|
+
// contract", so the consumer may still fall back to notes for one
|
|
440
|
+
// release; keeping it out of `required` is what makes that fallback
|
|
441
|
+
// window possible.
|
|
442
|
+
findings: {
|
|
443
|
+
type: 'array',
|
|
444
|
+
items: {
|
|
445
|
+
type: 'object',
|
|
446
|
+
properties: {
|
|
447
|
+
id: { type: 'string' },
|
|
448
|
+
kind: {
|
|
449
|
+
type: 'string',
|
|
450
|
+
enum: [
|
|
451
|
+
'coverage',
|
|
452
|
+
'missing_test_task',
|
|
453
|
+
'acceptance_criteria',
|
|
454
|
+
'task_size',
|
|
455
|
+
'dependency_wiring',
|
|
456
|
+
'scope_creep',
|
|
457
|
+
'duplicate_work',
|
|
458
|
+
'feasibility',
|
|
459
|
+
'ready_work',
|
|
460
|
+
'model_metadata',
|
|
461
|
+
'lane_cohesion',
|
|
462
|
+
'other',
|
|
463
|
+
],
|
|
464
|
+
},
|
|
465
|
+
detail: { type: 'string', minLength: 1 },
|
|
466
|
+
},
|
|
467
|
+
required: ['id', 'kind', 'detail'],
|
|
468
|
+
},
|
|
469
|
+
},
|
|
378
470
|
taskAssignments: { type: 'array', items: taskAssignmentSchema },
|
|
379
471
|
},
|
|
380
472
|
required: ['verdict', 'notes', 'taskAssignments'],
|
|
@@ -533,11 +625,7 @@ const FALLBACK_regressionReport = {
|
|
|
533
625
|
summary: { type: 'string' },
|
|
534
626
|
smokeEvidence: {
|
|
535
627
|
type: 'object',
|
|
536
|
-
|
|
537
|
-
versionStdout: { type: 'string' },
|
|
538
|
-
canaryStatus: { type: 'string' },
|
|
539
|
-
toyRepoHeadSha: { type: 'string' },
|
|
540
|
-
},
|
|
628
|
+
additionalProperties: true,
|
|
541
629
|
},
|
|
542
630
|
},
|
|
543
631
|
required: ['passed', 'suitePassed', 'smokePassed', 'bugsFiled', 'summary'],
|
|
@@ -883,6 +971,53 @@ function longestBacktickRun(content) {
|
|
|
883
971
|
return matches.reduce((max, run) => Math.max(max, run.length), 0);
|
|
884
972
|
}
|
|
885
973
|
|
|
974
|
+
/**
|
|
975
|
+
* The pattern src/services/secret-token.ts (SECRET_TOKEN_RE) matches to
|
|
976
|
+
* reject a dispatch outright / redact untrusted content. Mirrored here as a
|
|
977
|
+
* literal rather than imported: this module deliberately has no dependency
|
|
978
|
+
* on the fleet server sources. Accepts both the canonical {{secret.NAME}}
|
|
979
|
+
* spelling and the deprecated {{secure.NAME}} one.
|
|
980
|
+
*/
|
|
981
|
+
const SECRET_TOKEN_RE_G = /\{\{(secret|secure)\.([a-zA-Z0-9_-]{1,64})\}\}/g;
|
|
982
|
+
|
|
983
|
+
const SECRET_REDACTION_NOTE = 'NOTE: secret-token braces were redacted from the block above '
|
|
984
|
+
+ '(secret.NAME is shown without its surrounding double braces). Write the braced form when '
|
|
985
|
+
+ 'you actually use the token in an execute_command call.';
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Strips the surrounding double braces from any secret-token reference
|
|
989
|
+
* (either {{secret.NAME}} or the deprecated {{secure.NAME}}) in untrusted
|
|
990
|
+
* content, keeping the "secret.NAME"/"secure.NAME" text so it still reads.
|
|
991
|
+
*
|
|
992
|
+
* Why this must happen before the content reaches a prompt: execute_prompt
|
|
993
|
+
* rejects the ENTIRE dispatch -- no LLM call, an error string returned in
|
|
994
|
+
* place of a reply -- if the prompt matches that token pattern anywhere.
|
|
995
|
+
* The guard is right for caller-authored prompts, but injected content is
|
|
996
|
+
* not caller-authored: a knowledge-bank entry or an acceptance criterion
|
|
997
|
+
* that merely NAMES the token carries no secret, yet would silently fail
|
|
998
|
+
* every dispatch in a sprint. Redaction, not removal: the name is the part
|
|
999
|
+
* that makes the entry useful.
|
|
1000
|
+
* @param {string} content
|
|
1001
|
+
* @returns {{text: string, redacted: boolean}}
|
|
1002
|
+
*/
|
|
1003
|
+
function redactSecretTokens(content) {
|
|
1004
|
+
let text = content;
|
|
1005
|
+
let redacted = false;
|
|
1006
|
+
// Run to a fixed point rather than a single pass: replacing the inner
|
|
1007
|
+
// token in `{{{{secret.A}}}}` leaves `{{secret.A}}`, so the surrounding
|
|
1008
|
+
// braces close over the redacted name and rebuild exactly the pattern
|
|
1009
|
+
// being removed. Untrusted content is attacker-influenced free-text, so
|
|
1010
|
+
// one pass is not enough. Guaranteed to terminate -- every replacement
|
|
1011
|
+
// removes four brace characters, so `text` strictly shrinks.
|
|
1012
|
+
for (;;) {
|
|
1013
|
+
const next = text.replace(SECRET_TOKEN_RE_G, (_match, kind, name) => `${kind}.${name}`);
|
|
1014
|
+
if (next === text) break;
|
|
1015
|
+
text = next;
|
|
1016
|
+
redacted = true;
|
|
1017
|
+
}
|
|
1018
|
+
return { text, redacted };
|
|
1019
|
+
}
|
|
1020
|
+
|
|
886
1021
|
/**
|
|
887
1022
|
* Wraps `content` in a clearly delimited fenced block labeled as untrusted
|
|
888
1023
|
* inter-agent output, per feedback.md finding A7. Pure function: no I/O,
|
|
@@ -908,14 +1043,16 @@ export function wrapUntrustedBlock(sourceLabel, content) {
|
|
|
908
1043
|
if (typeof content !== 'string') {
|
|
909
1044
|
throw new TypeError('[contracts] wrapUntrustedBlock requires content to be a string');
|
|
910
1045
|
}
|
|
911
|
-
const
|
|
1046
|
+
const { text: safeContent, redacted } = redactSecretTokens(content);
|
|
1047
|
+
const fenceLength = Math.max(MIN_FENCE_LENGTH, longestBacktickRun(safeContent) + 1);
|
|
912
1048
|
const fence = '`'.repeat(fenceLength);
|
|
913
1049
|
return [
|
|
914
1050
|
UNTRUSTED_BLOCK_PREAMBLE,
|
|
915
1051
|
`Source: ${sourceLabel}`,
|
|
916
1052
|
`${fence}${UNTRUSTED_BLOCK_FENCE_LABEL}`,
|
|
917
|
-
|
|
1053
|
+
safeContent,
|
|
918
1054
|
fence,
|
|
1055
|
+
...(redacted ? [SECRET_REDACTION_NOTE] : []),
|
|
919
1056
|
].join('\n');
|
|
920
1057
|
}
|
|
921
1058
|
|
|
@@ -938,3 +1075,31 @@ export function appendSchemaInstruction(prompt, schema) {
|
|
|
938
1075
|
}
|
|
939
1076
|
return `${prompt}\n\nOnly provide your response strictly as per this JSON schema:\n${JSON.stringify(schema, null, 2)}`;
|
|
940
1077
|
}
|
|
1078
|
+
|
|
1079
|
+
// ---------------------------------------------------------------------------
|
|
1080
|
+
// 7. Credential-store name validation (apra-fleet-5co8.2.3)
|
|
1081
|
+
// ---------------------------------------------------------------------------
|
|
1082
|
+
//
|
|
1083
|
+
// Pattern for valid credential-store entry names, shared with src/tools/ (see
|
|
1084
|
+
// credential-store-set.ts). Used by the per-sprint Azure DevOps PAT secret
|
|
1085
|
+
// name override validation (runner.js's validateArgs).
|
|
1086
|
+
|
|
1087
|
+
const CREDENTIAL_STORE_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Validates a credential-store entry name against the pattern used by
|
|
1091
|
+
* credential_store_set (alphanumeric, underscores, hyphens, 1-64 chars).
|
|
1092
|
+
* Throws with a clear message on rejection.
|
|
1093
|
+
* @param {unknown} name
|
|
1094
|
+
* @param {string} label - human-readable arg name, used in the error message
|
|
1095
|
+
* @returns {string}
|
|
1096
|
+
*/
|
|
1097
|
+
export function validateCredentialStoreName(name, label) {
|
|
1098
|
+
if (typeof name !== 'string' || name.length === 0 || !CREDENTIAL_STORE_NAME_PATTERN.test(name)) {
|
|
1099
|
+
throw new Error(
|
|
1100
|
+
`[Arg Contract] Invalid ${label} "${name}": must match ${CREDENTIAL_STORE_NAME_PATTERN} ` +
|
|
1101
|
+
`(alphanumeric, underscores, hyphens, 1-64 chars).`
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
return name;
|
|
1105
|
+
}
|