@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
|
@@ -75,7 +75,7 @@ export async function runReplanPhase({
|
|
|
75
75
|
validated,
|
|
76
76
|
targetIssues,
|
|
77
77
|
requirementsContent,
|
|
78
|
-
|
|
78
|
+
backlogMember,
|
|
79
79
|
// The git/beads sync bracket the post-replan D-push goes through, plus the
|
|
80
80
|
// dashboard refresh that follows it.
|
|
81
81
|
gitSync,
|
|
@@ -84,11 +84,16 @@ export async function runReplanPhase({
|
|
|
84
84
|
verifySetThisCycle,
|
|
85
85
|
pendingRejectedNewTasks,
|
|
86
86
|
// Per-round inputs. `devRounds` arrives already incremented (see header);
|
|
87
|
-
// `replanIds` and `replannedThisCycle` are mutated in place.
|
|
87
|
+
// `replanIds` and `replannedThisCycle` are mutated in place. `perBeadFeedback`
|
|
88
|
+
// (declared in runner.js runSprintCycle, a Map of beadId -> reviewer verdict.notes, populated in
|
|
89
|
+
// phases/review.mjs's applyGuardedReopens onReopened hook) is READ ONLY
|
|
90
|
+
// here -- this phase never mutates it -- to source the findings that
|
|
91
|
+
// triggered this scoped replan for the planner prompt below.
|
|
88
92
|
devRounds,
|
|
89
93
|
eligibleReplan,
|
|
90
94
|
replanIds,
|
|
91
95
|
replannedThisCycle,
|
|
96
|
+
perBeadFeedback,
|
|
92
97
|
}) {
|
|
93
98
|
const replanScopeIds = eligibleReplan.map((b) => b.id);
|
|
94
99
|
phase(`Replan C${cycle} R${devRounds}`);
|
|
@@ -103,6 +108,33 @@ export async function runReplanPhase({
|
|
|
103
108
|
// the outcome of this pass.
|
|
104
109
|
for (const id of replanScopeIds) replannedThisCycle.add(id);
|
|
105
110
|
|
|
111
|
+
// The code-reviewer findings that TRIGGERED this scoped replan, sourced
|
|
112
|
+
// from perBeadFeedback, one section per DISTINCT notes text. review.mjs
|
|
113
|
+
// stores the same verdict.notes under every id one verdict reopens, so
|
|
114
|
+
// identical text is emitted once under a header listing every bead id it
|
|
115
|
+
// applies to (first-seen order) instead of being repeated per bead and
|
|
116
|
+
// burning the REPLAN_FINDINGS_MAX_LENGTH budget. Every id in
|
|
117
|
+
// replanScopeIds is guaranteed to have a perBeadFeedback entry --
|
|
118
|
+
// foldReplanIds (beads-transitions.mjs) only admits a replanIds id that
|
|
119
|
+
// was ALSO actually reopened, and review.mjs sets perBeadFeedback for
|
|
120
|
+
// every id it reopens -- so a missing map entry is not a case to guard
|
|
121
|
+
// against here; the only "no findings" case is a genuinely blank
|
|
122
|
+
// verdict.notes string, filtered out below. buildPlannerPrompt renders
|
|
123
|
+
// this only when non-null/non-blank, and bounds it deterministically at
|
|
124
|
+
// REPLAN_FINDINGS_MAX_LENGTH.
|
|
125
|
+
/** @type {Map<string, string[]>} trimmed notes text -> bead ids it applies to */
|
|
126
|
+
const idsByNotes = new Map();
|
|
127
|
+
for (const id of replanScopeIds) {
|
|
128
|
+
const notes = perBeadFeedback.get(id);
|
|
129
|
+
if (typeof notes !== 'string' || notes.trim().length === 0) continue;
|
|
130
|
+
const key = notes.trim();
|
|
131
|
+
const ids = idsByNotes.get(key);
|
|
132
|
+
if (ids) ids.push(id);
|
|
133
|
+
else idsByNotes.set(key, [id]);
|
|
134
|
+
}
|
|
135
|
+
const findingsParts = [...idsByNotes].map(([notes, ids]) => `${ids.join(', ')}:\n${notes}`);
|
|
136
|
+
const replanFindings = findingsParts.length > 0 ? findingsParts.join('\n\n') : null;
|
|
137
|
+
|
|
106
138
|
// --- Scoped planner pass ---
|
|
107
139
|
// apra-fleet-3swo.5.3: the 'scoped-replan-planner' row of
|
|
108
140
|
// role-policies.mjs, executed by dispatchRole. That row owns
|
|
@@ -131,6 +163,7 @@ export async function runReplanPhase({
|
|
|
131
163
|
requirementsContent,
|
|
132
164
|
feedback: null,
|
|
133
165
|
replanScope: replanScopeIds,
|
|
166
|
+
replanFindings,
|
|
134
167
|
// The scoped replan is a real planner dispatch like the
|
|
135
168
|
// main Plan phase, so a pending rejected newTask must
|
|
136
169
|
// resurface here too.
|
|
@@ -192,6 +225,6 @@ export async function runReplanPhase({
|
|
|
192
225
|
// and refresh the dashboard before re-evaluating the loop top.
|
|
193
226
|
// Routed through the single dolt-sync module's AFTER bracket
|
|
194
227
|
// (apra-fleet-417.2.1); behavior is identical.
|
|
195
|
-
await gitSync.syncBeadsAfter(
|
|
228
|
+
await gitSync.syncBeadsAfter(backlogMember, { pushBeads: true });
|
|
196
229
|
await updateDashboard();
|
|
197
230
|
}
|
|
@@ -65,10 +65,34 @@
|
|
|
65
65
|
// which stays there because the Re-Review and Final Review phases call it too.
|
|
66
66
|
// =============================================================================
|
|
67
67
|
|
|
68
|
-
import { applyGuardedReopens, foldReplanIds } from '../beads-transitions.mjs';
|
|
68
|
+
import { applyGuardedReopens, foldReplanIds, ensureRedBranchFixTask, isInGoalPriority } from '../beads-transitions.mjs';
|
|
69
69
|
import {
|
|
70
70
|
validateNewTask, appendRejectedFindingToParentNotes, persistNewTaskBestEffort,
|
|
71
71
|
} from '../abort.mjs';
|
|
72
|
+
import { applyReviewerDecision, reviewerReopenEntries } from '../decisions.mjs';
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The bead ids a round's Review covers: the union of every streak outcome's
|
|
76
|
+
* `closedIds` (the ENGINE's read-back of the shared beads DB -- the
|
|
77
|
+
* verify-streak-closed step on success, verifyDoerStreakClosed on the error
|
|
78
|
+
* path; never the doer's own claim), de-duplicated, minus outcomes whose
|
|
79
|
+
* closes were not published (`publishBlocked` for a permission-scope G-push
|
|
80
|
+
* refusal, `postDispatchSyncFailed` for any other post-dispatch sync failure:
|
|
81
|
+
* a failed G-push skips the D-push, so those closes never reached the shared
|
|
82
|
+
* DB). A failed or BLOCKED streak therefore still contributes the beads it
|
|
83
|
+
* verifiably closed; one that closed nothing contributes nothing.
|
|
84
|
+
*
|
|
85
|
+
* @param {object[]} streakOutcomes
|
|
86
|
+
* @returns {string[]} de-duplicated bead ids, in first-seen order
|
|
87
|
+
*/
|
|
88
|
+
export function reviewScopeBeadIds(streakOutcomes) {
|
|
89
|
+
const seen = new Set();
|
|
90
|
+
for (const o of streakOutcomes || []) {
|
|
91
|
+
if (!o || o.publishBlocked || o.postDispatchSyncFailed) continue;
|
|
92
|
+
for (const id of Array.isArray(o.closedIds) ? o.closedIds : []) seen.add(id);
|
|
93
|
+
}
|
|
94
|
+
return [...seen];
|
|
95
|
+
}
|
|
72
96
|
|
|
73
97
|
/**
|
|
74
98
|
* Runs ONE Review round: reviewer dispatch plus the orchestrator-applied
|
|
@@ -93,10 +117,13 @@ export async function runReviewPhase({
|
|
|
93
117
|
cycle,
|
|
94
118
|
validated,
|
|
95
119
|
targetIssues,
|
|
96
|
-
|
|
120
|
+
backlogMember,
|
|
97
121
|
// The git/beads sync bracket this phase's post-mutation D-push goes
|
|
98
122
|
// through.
|
|
99
123
|
gitSync,
|
|
124
|
+
// Per-sprint resolved state (../sprint-state.mjs): a NEEDS-DECISION
|
|
125
|
+
// verdict records its pending decision and set-aside here.
|
|
126
|
+
sprintState,
|
|
100
127
|
// Per-cycle state. `replanIds`, `replannedThisCycle`, `perBeadFeedback` and
|
|
101
128
|
// `rejectedNewTasks` are mutated in place (see header).
|
|
102
129
|
replanIds,
|
|
@@ -117,6 +144,9 @@ export async function runReviewPhase({
|
|
|
117
144
|
dispatchReview,
|
|
118
145
|
bdListScoped,
|
|
119
146
|
goalMax,
|
|
147
|
+
// Bead ids this sprint has dispatched or closed: a below-goal reopen of
|
|
148
|
+
// one of them is applied, not deferred (see isDeferredScopeReopen).
|
|
149
|
+
workedOnIds,
|
|
120
150
|
recordReopen,
|
|
121
151
|
childIdAllocator,
|
|
122
152
|
sprintMutexId,
|
|
@@ -130,19 +160,21 @@ export async function runReviewPhase({
|
|
|
130
160
|
// Sort by (title, id) -- not raw outcome-recording order -- so this
|
|
131
161
|
// evidence-gathering step is deterministic. See the readyTitleById
|
|
132
162
|
// comment just above.
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
|
|
163
|
+
// Review scope = every bead the engine's own read-back confirmed
|
|
164
|
+
// closed AND published (see reviewScopeBeadIds), including beads a
|
|
165
|
+
// failed or BLOCKED streak closed before it stopped.
|
|
166
|
+
const assignedBeadIds = reviewScopeBeadIds(streakOutcomes)
|
|
136
167
|
.slice().sort((a, b) => {
|
|
137
168
|
const ta = readyTitleById.get(a) || a;
|
|
138
169
|
const tb = readyTitleById.get(b) || b;
|
|
139
170
|
return ta.localeCompare(tb) || a.localeCompare(b);
|
|
140
171
|
});
|
|
141
172
|
const acceptanceCriteriaJson = assignedBeadIds.length > 0
|
|
142
|
-
? await command(`bd show ${assignedBeadIds.join(' ')} --json`, { member_name:
|
|
173
|
+
? await command(`bd show ${assignedBeadIds.join(' ')} --json`, { member_name: backlogMember, silent: true })
|
|
143
174
|
: '[]';
|
|
144
175
|
|
|
145
|
-
// Empty-guard: when
|
|
176
|
+
// Empty-guard: when no bead was verified closed this round (every
|
|
177
|
+
// streak failed before closing anything), assignedBeadIds
|
|
146
178
|
// is [] and there is nothing for the Reviewer to look at. Skip the
|
|
147
179
|
// dispatch entirely rather than sending an empty-scope review: an
|
|
148
180
|
// empty review is prone to returning CHANGES_NEEDED with empty
|
|
@@ -153,7 +185,7 @@ export async function runReviewPhase({
|
|
|
153
185
|
// still runs, so the loop correctly continues instead of prematurely
|
|
154
186
|
// treating the cycle as organically complete.
|
|
155
187
|
if (assignedBeadIds.length === 0) {
|
|
156
|
-
log(`Develop C${cycle} R${devRounds}: all streaks this round failed with no beadIds assigned -- skipping Review dispatch (nothing to review). Failed-streak beads remain ready for the next Develop round.`);
|
|
188
|
+
log(`Develop C${cycle} R${devRounds}: all streaks this round failed with no beadIds assigned -- skipping Review dispatch (nothing to review: no bead was verified closed this round). Failed-streak beads remain ready for the next Develop round.`);
|
|
157
189
|
} else {
|
|
158
190
|
// dispatchReview() applies the shared contract-violation
|
|
159
191
|
// retry-once-then-throw rule (see its own doc comment and
|
|
@@ -194,9 +226,11 @@ export async function runReviewPhase({
|
|
|
194
226
|
// reopened (out of scope, or simply absent from reopenIds) can
|
|
195
227
|
// never short-circuit the loop.
|
|
196
228
|
const reopenedIds = new Set(await applyGuardedReopens({
|
|
197
|
-
|
|
229
|
+
// reopenIds, plus a NEEDS-DECISION bead (../decisions.mjs).
|
|
230
|
+
entries: reviewerReopenEntries(verdict, assignedBeadIds),
|
|
198
231
|
bdListScoped, goalMax, goal: validated.goal, log, command,
|
|
199
|
-
member:
|
|
232
|
+
member: backlogMember,
|
|
233
|
+
workedOnIds,
|
|
200
234
|
logPrefix: 'Reviewer reopenIds',
|
|
201
235
|
buildReopenCommand: ({ id }) => ({
|
|
202
236
|
cmd: `bd update ${id} --status=open`,
|
|
@@ -211,6 +245,15 @@ export async function runReviewPhase({
|
|
|
211
245
|
perBeadFeedback.set(id, verdict.notes);
|
|
212
246
|
},
|
|
213
247
|
}));
|
|
248
|
+
// A NEEDS-DECISION verdict: record the decision for an operator and set
|
|
249
|
+
// the named bead aside -- see ../decisions.mjs. A closed bead was
|
|
250
|
+
// reopened just above, through the same guarded reopen call
|
|
251
|
+
// (reviewerReopenEntries).
|
|
252
|
+
await applyReviewerDecision({
|
|
253
|
+
verdict, scopeIds: assignedBeadIds, reopenedIds, sprintState, command,
|
|
254
|
+
member: backlogMember, bdListScoped, cycle, round: devRounds,
|
|
255
|
+
site: `Review C${cycle} R${devRounds}`, log,
|
|
256
|
+
});
|
|
214
257
|
// Fold this round's reviewer `replanIds` (absent/undefined on
|
|
215
258
|
// verdicts that do not use it, so a no-op then) into the cycle's
|
|
216
259
|
// running union, consulted at the top of the next iteration's
|
|
@@ -233,6 +276,10 @@ export async function runReviewPhase({
|
|
|
233
276
|
})) {
|
|
234
277
|
replanIds.add(id);
|
|
235
278
|
}
|
|
279
|
+
// newTasks that landed at an in-goal priority -- one of these (or a
|
|
280
|
+
// surviving reopen) is what keeps a red branch from being left with no
|
|
281
|
+
// dispatchable work (see ensureRedBranchFixTask below).
|
|
282
|
+
let inGoalNewTaskCount = 0;
|
|
236
283
|
for (const newTask of verdict.newTasks) {
|
|
237
284
|
// Validate BEFORE interpolation -- see validateNewTask() above
|
|
238
285
|
// for why this is an allowlist, not escaping. A rejection is
|
|
@@ -255,7 +302,7 @@ export async function runReviewPhase({
|
|
|
255
302
|
// never an abort).
|
|
256
303
|
try {
|
|
257
304
|
await appendRejectedFindingToParentNotes({
|
|
258
|
-
command, member:
|
|
305
|
+
command, member: backlogMember, parentId: targetIssues[0],
|
|
259
306
|
newTask, reason: validation.reason, cycle, log,
|
|
260
307
|
});
|
|
261
308
|
} catch (noteErr) {
|
|
@@ -272,12 +319,12 @@ export async function runReviewPhase({
|
|
|
272
319
|
// parent never derive the same child id. Under the null client
|
|
273
320
|
// (lone sprint) childId is null and bd derives the id as before.
|
|
274
321
|
const persisted = await persistNewTaskBestEffort({
|
|
275
|
-
command, member:
|
|
322
|
+
command, member: backlogMember, parentId: targetIssues[0],
|
|
276
323
|
newTask, cycle, log, stage: 'develop-review',
|
|
277
324
|
createFn: async () => {
|
|
278
|
-
const floor = await computeChildFloor({ command, member:
|
|
325
|
+
const floor = await computeChildFloor({ command, member: backlogMember, parentId: targetIssues[0], log });
|
|
279
326
|
await createChildBeadWithAllocatedId({
|
|
280
|
-
command, allocator: childIdAllocator, member:
|
|
327
|
+
command, allocator: childIdAllocator, member: backlogMember,
|
|
281
328
|
title, description, priority, parentId: targetIssues[0],
|
|
282
329
|
sprintId: sprintMutexId, floor, log,
|
|
283
330
|
label: `Create follow-up task from reviewer newTasks: ${title}`,
|
|
@@ -292,13 +339,41 @@ export async function runReviewPhase({
|
|
|
292
339
|
// unchanged description.
|
|
293
340
|
if (persisted) {
|
|
294
341
|
pendingRejectedNewTasks = clearResubmittedNewTask(pendingRejectedNewTasks, { title, description });
|
|
342
|
+
if (isInGoalPriority(priority, goalMax)) inGoalNewTaskCount += 1;
|
|
295
343
|
}
|
|
296
344
|
}
|
|
297
345
|
|
|
346
|
+
// A red branch must never be left with zero open work: when the verdict
|
|
347
|
+
// reports failing build/tests and no reopen or in-goal newTask survived
|
|
348
|
+
// (all filtered by the goal-scope guard, or none named), file one in-goal
|
|
349
|
+
// fix task carrying the reviewer's notes.
|
|
350
|
+
await ensureRedBranchFixTask({
|
|
351
|
+
verdict,
|
|
352
|
+
reopenedCount: reopenedIds.size,
|
|
353
|
+
inGoalNewTaskCount,
|
|
354
|
+
skippedReopenIds: (verdict.reopenIds || []).filter((id) => typeof id === 'string' && !reopenedIds.has(id)),
|
|
355
|
+
goal: validated.goal,
|
|
356
|
+
site: `Review C${cycle} R${devRounds}`,
|
|
357
|
+
bdListScoped, log,
|
|
358
|
+
createTask: (task) => persistNewTaskBestEffort({
|
|
359
|
+
command, member: backlogMember, parentId: targetIssues[0],
|
|
360
|
+
newTask: task, cycle, log, stage: 'develop-review-red-branch',
|
|
361
|
+
createFn: async () => {
|
|
362
|
+
const floor = await computeChildFloor({ command, member: backlogMember, parentId: targetIssues[0], log });
|
|
363
|
+
return createChildBeadWithAllocatedId({
|
|
364
|
+
command, allocator: childIdAllocator, member: backlogMember,
|
|
365
|
+
title: task.title, description: task.description, priority: task.priority,
|
|
366
|
+
parentId: targetIssues[0], sprintId: sprintMutexId, floor, log,
|
|
367
|
+
label: `Create red-branch fix task: ${task.title}`,
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
}),
|
|
371
|
+
});
|
|
372
|
+
|
|
298
373
|
// The orchestrator just MUTATED beads (reopens + newTask creates) in
|
|
299
374
|
// its own clone -- D-push so members observe them on their next
|
|
300
375
|
// dispatch's D-pull.
|
|
301
|
-
await gitSync.syncBeadsAfter(
|
|
376
|
+
await gitSync.syncBeadsAfter(backlogMember, { pushBeads: true });
|
|
302
377
|
} // end assignedBeadIds.length > 0 (Review dispatch + orchestrator-applied transitions)
|
|
303
378
|
|
|
304
379
|
return { lastReviewVerdict, reviewedThisCycle, pendingRejectedNewTasks };
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// Sprint pull-request title/body builder for the Publish PR step and the
|
|
2
|
+
// [ABORTED] PR path (abort.mjs). Pure: no I/O, no clock reads unless the
|
|
3
|
+
// caller omits `now`.
|
|
4
|
+
//
|
|
5
|
+
// WHY THIS EXISTS. The PR body used to embed the final reviewer's notes
|
|
6
|
+
// through sanitizePrText() (sprint-report.mjs), a single-line shell-argument
|
|
7
|
+
// sanitizer that maps every newline to a space and collapses all whitespace
|
|
8
|
+
// -- so a reviewer's paragraphs and bullet list reached the PR as one
|
|
9
|
+
// unreadable paragraph. The body never needed that: every provider's
|
|
10
|
+
// create/update-pull-request builder JSON-encodes the body (newlines become
|
|
11
|
+
// the two characters `\n`) and quotes the JSON per member shell
|
|
12
|
+
// (vcs-providers/shell-helpers.mjs shQuoteJson), so a multi-line body is
|
|
13
|
+
// already transport-safe. What untrusted text DOES still need is
|
|
14
|
+
// markdown/transport hygiene, which sanitizePrMarkdown() below provides while
|
|
15
|
+
// keeping line structure.
|
|
16
|
+
//
|
|
17
|
+
// RUN HISTORY. Each sprint end rewrites the PR title/body with its own
|
|
18
|
+
// verdict; earlier runs are carried forward compactly in a hidden,
|
|
19
|
+
// engine-written HTML comment block (RUN_HISTORY_MARKER) that the next run
|
|
20
|
+
// parses back. A body without the block (a PR created before this format, or
|
|
21
|
+
// hand-edited) simply starts a fresh history.
|
|
22
|
+
//
|
|
23
|
+
// ASCII only.
|
|
24
|
+
|
|
25
|
+
import { PR_DESCRIPTION_MAX_LENGTH } from './vcs-module.mjs';
|
|
26
|
+
import { formatSetAsideItems, formatWaitedLine } from './set-aside.mjs';
|
|
27
|
+
|
|
28
|
+
/** Opening token of the hidden run-history block. Versioned so a future
|
|
29
|
+
* format change can tell its own blocks from this one. */
|
|
30
|
+
export const RUN_HISTORY_MARKER = 'fleet-sprint:run-history v1';
|
|
31
|
+
|
|
32
|
+
/** Total runs (current + previous) kept in the history block. */
|
|
33
|
+
export const RUN_HISTORY_MAX_ENTRIES = 8;
|
|
34
|
+
|
|
35
|
+
/** Upper bound on the reviewer-notes section before the whole-body budget
|
|
36
|
+
* (PR_DESCRIPTION_MAX_LENGTH) is even considered. */
|
|
37
|
+
export const PR_NOTES_MAX_LENGTH = 2000;
|
|
38
|
+
|
|
39
|
+
const VERDICTS = new Set(['PASS', 'FAIL', 'ABORTED']);
|
|
40
|
+
const RUN_ID_UNSAFE_RE = /[^A-Za-z0-9._:/-]/g;
|
|
41
|
+
const RUN_ID_MAX = 64;
|
|
42
|
+
const DATE_RE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}Z)?$/;
|
|
43
|
+
const HUMAN_REVIEW_LINE = 'Do NOT auto-merge -- see pm skill R12; a human must review and merge this PR.';
|
|
44
|
+
|
|
45
|
+
// Common typographic code points LLM text carries, mapped to ASCII so the
|
|
46
|
+
// body stays ASCII end to end (PowerShell 5.1 argv and some REST stacks do
|
|
47
|
+
// not round-trip arbitrary UTF-8 reliably). Anything else non-ASCII becomes
|
|
48
|
+
// '?'.
|
|
49
|
+
const ASCII_MAP = new Map([
|
|
50
|
+
[0x2018, "'"], [0x2019, "'"], [0x201A, "'"], [0x201B, "'"],
|
|
51
|
+
[0x201C, '"'], [0x201D, '"'], [0x201E, '"'], [0x201F, '"'],
|
|
52
|
+
[0x2010, '-'], [0x2011, '-'], [0x2012, '-'], [0x2013, '-'], [0x2014, '--'], [0x2015, '--'],
|
|
53
|
+
[0x2026, '...'], [0x2022, '-'], [0x00B7, '-'], [0x00A0, ' '], [0x2009, ' '], [0x202F, ' '],
|
|
54
|
+
[0x2192, '->'], [0x2190, '<-'], [0x21D2, '=>'], [0x2264, '<='], [0x2265, '>='], [0x2260, '!='],
|
|
55
|
+
[0x2713, '[OK]'], [0x2714, '[OK]'], [0x2705, '[OK]'], [0x2717, '[X]'], [0x2718, '[X]'], [0x274C, '[X]'],
|
|
56
|
+
[0x00D7, 'x'],
|
|
57
|
+
].map(([cp, ascii]) => [String.fromCodePoint(cp), ascii]));
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Makes untrusted (LLM-authored) text safe to place inside the PR body while
|
|
61
|
+
* PRESERVING its paragraphs, bullet lists and line breaks:
|
|
62
|
+
* - CRLF/CR -> LF; tabs -> two spaces; other control characters dropped;
|
|
63
|
+
* - non-ASCII mapped to ASCII (see ASCII_MAP) or '?';
|
|
64
|
+
* - '<' -> '<' so no raw HTML, HTML comment (which could swallow the rest
|
|
65
|
+
* of the body or forge the run-history block) or autolink passes through;
|
|
66
|
+
* - '{{' / '}}' broken apart: the server-side credential handoff substitutes
|
|
67
|
+
* '{{...}}' placeholders anywhere in the dispatched command, so a note
|
|
68
|
+
* must never be able to spell one;
|
|
69
|
+
* - ATX headings ('# x') and setext '===' underlines escaped so the notes
|
|
70
|
+
* cannot outrank the body's own section headings;
|
|
71
|
+
* - runs of 3+ blank lines collapsed to one blank line.
|
|
72
|
+
* Code fences are balanced separately (closeOpenFences) AFTER any truncation.
|
|
73
|
+
* @param {unknown} text
|
|
74
|
+
* @returns {string}
|
|
75
|
+
*/
|
|
76
|
+
export function sanitizePrMarkdown(text) {
|
|
77
|
+
let s = String(text ?? '').replace(/\r\n?/g, '\n').replace(/\t/g, ' ');
|
|
78
|
+
let out = '';
|
|
79
|
+
for (const ch of s) {
|
|
80
|
+
const code = ch.codePointAt(0);
|
|
81
|
+
if (ch === '\n') out += ch;
|
|
82
|
+
else if (code < 0x20 || code === 0x7f) continue;
|
|
83
|
+
else if (code < 0x7f) out += ch;
|
|
84
|
+
else out += ASCII_MAP.has(ch) ? ASCII_MAP.get(ch) : '?';
|
|
85
|
+
}
|
|
86
|
+
s = out.replace(/</g, '<');
|
|
87
|
+
while (/\{\{|\}\}/.test(s)) s = s.replace(/\{\{/g, '{ {').replace(/\}\}/g, '} }');
|
|
88
|
+
s = s.split('\n').map((line) => line
|
|
89
|
+
.replace(/[ ]+$/, '')
|
|
90
|
+
.replace(/^( {0,3})(#{1,6})(?=\s|$)/, (_m, indent, marks) => indent + '\\' + marks)
|
|
91
|
+
.replace(/^( {0,3})(=+)$/, (_m, indent, marks) => indent + '\\' + marks))
|
|
92
|
+
.join('\n');
|
|
93
|
+
return s.replace(/\n{3,}/g, '\n\n').trim();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Appends a closing fence when `text` leaves a ``` / ~~~ code fence open, so
|
|
97
|
+
* untrusted notes can never swallow the sections that follow them. */
|
|
98
|
+
export function closeOpenFences(text) {
|
|
99
|
+
let open = null;
|
|
100
|
+
for (const line of String(text).split('\n')) {
|
|
101
|
+
const m = /^ {0,3}(`{3,}|~{3,})/.exec(line);
|
|
102
|
+
if (!m) continue;
|
|
103
|
+
if (!open) {
|
|
104
|
+
open = m[1];
|
|
105
|
+
} else if (m[1][0] === open[0] && m[1].length >= open.length && /^ {0,3}(`{3,}|~{3,})\s*$/.test(line)) {
|
|
106
|
+
open = null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return open ? `${text}\n${open}` : text;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Caps already-sanitized notes at `max` characters, cutting at a line
|
|
113
|
+
* boundary when one is reasonably close, with a visible marker. */
|
|
114
|
+
export function capNotes(text, max) {
|
|
115
|
+
const total = text.length;
|
|
116
|
+
if (total <= max) return closeOpenFences(text);
|
|
117
|
+
let cut = text.slice(0, Math.max(0, max));
|
|
118
|
+
const nl = cut.lastIndexOf('\n');
|
|
119
|
+
if (nl > max * 0.5) cut = cut.slice(0, nl);
|
|
120
|
+
cut = closeOpenFences(cut.replace(/\s+$/, ''));
|
|
121
|
+
return `${cut}\n\n*[... reviewer notes truncated: ${cut.length} of ${total} characters shown ...]*`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Normalizes a run id to the history-safe charset. */
|
|
125
|
+
export function normalizeRunId(runId) {
|
|
126
|
+
const v = String(runId ?? '').trim().replace(RUN_ID_UNSAFE_RE, '-').slice(0, RUN_ID_MAX);
|
|
127
|
+
return v || 'unnamed-run';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** UTC minute stamp, e.g. 2026-10-01T09:30Z. */
|
|
131
|
+
export function runStamp(now = new Date()) {
|
|
132
|
+
return `${now.toISOString().slice(0, 16)}Z`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Reads the run-history block back out of an existing PR body. Returns [] for
|
|
137
|
+
* a body with no block, a malformed block, or no valid entries -- never
|
|
138
|
+
* throws. Every entry is re-validated (the body is editable by anyone with
|
|
139
|
+
* PR write access), so only well-formed { run, date, verdict } survive.
|
|
140
|
+
* @param {unknown} body
|
|
141
|
+
* @returns {Array<{ run: string, date: string, verdict: string }>}
|
|
142
|
+
*/
|
|
143
|
+
export function parseRunHistory(body) {
|
|
144
|
+
const text = String(body ?? '');
|
|
145
|
+
// \r?\n: a body saved from a web editor (GitHub's PR edit box) comes back
|
|
146
|
+
// with CRLF line endings; that must not silently reset the history.
|
|
147
|
+
const re = /<!-- fleet-sprint:run-history v1\r?\n([\s\S]*?)\r?\n-->/g;
|
|
148
|
+
let last = null;
|
|
149
|
+
for (const m of text.matchAll(re)) last = m[1];
|
|
150
|
+
if (last === null) return [];
|
|
151
|
+
let parsed;
|
|
152
|
+
try {
|
|
153
|
+
parsed = JSON.parse(last);
|
|
154
|
+
} catch {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
if (!Array.isArray(parsed)) return [];
|
|
158
|
+
const out = [];
|
|
159
|
+
for (const e of parsed) {
|
|
160
|
+
if (!e || typeof e !== 'object') continue;
|
|
161
|
+
const run = typeof e.run === 'string' ? normalizeRunId(e.run) : null;
|
|
162
|
+
const date = typeof e.date === 'string' && DATE_RE.test(e.date) ? e.date : null;
|
|
163
|
+
const verdict = typeof e.verdict === 'string' && VERDICTS.has(e.verdict) ? e.verdict : null;
|
|
164
|
+
if (run && date && verdict) out.push({ run, date, verdict });
|
|
165
|
+
if (out.length >= RUN_HISTORY_MAX_ENTRIES) break;
|
|
166
|
+
}
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** `fleet-sprint [<VERDICT>]: <branch>`. PRs opened before the rename carry the
|
|
171
|
+
* older `Auto-sprint [<VERDICT>]: <branch>` form; nothing in-repo matches on the
|
|
172
|
+
* title (an existing PR is found by head branch), so both forms coexist safely. */
|
|
173
|
+
export function buildSprintPrTitle({ verdict, branch }) {
|
|
174
|
+
return `fleet-sprint [${verdict}]: ${branch}`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Markdown inline code span. Only ever applied to engine-validated tokens
|
|
178
|
+
* (branch names, normalized run ids), which cannot contain a backtick. */
|
|
179
|
+
function codeSpan(text) {
|
|
180
|
+
// shell-guard-allow: markdown inline-code backticks in PR body text (JSON-encoded into a curl -d payload by the VCS builders), never a command string evaluated by a shell.
|
|
181
|
+
return '`' + text + '`';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function inline(text) {
|
|
185
|
+
return sanitizePrMarkdown(text).replace(/\s*\n\s*/g, ' ');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Builds the sprint PR body as markdown.
|
|
190
|
+
*
|
|
191
|
+
* @param {object} opts
|
|
192
|
+
* @param {'PASS'|'FAIL'|'ABORTED'} opts.verdict
|
|
193
|
+
* @param {string} [opts.goal]
|
|
194
|
+
* @param {string} opts.branch
|
|
195
|
+
* @param {string} [opts.baseBranch]
|
|
196
|
+
* @param {string} [opts.runId]
|
|
197
|
+
* @param {Date} [opts.now]
|
|
198
|
+
* @param {string} [opts.notes] untrusted free text (reviewer notes / abort detail)
|
|
199
|
+
* @param {string} [opts.notesHeading]
|
|
200
|
+
* @param {string[]} [opts.details] engine-authored detail lines, rendered as list items
|
|
201
|
+
* @param {object[]} [opts.setAside] the run's set-aside records (./set-aside.mjs
|
|
202
|
+
* collectSetAsideEntries), rendered as a "Set aside this run" section; the
|
|
203
|
+
* section is omitted when empty
|
|
204
|
+
* @param {object[]} [opts.waited] the run's wait records (./set-aside.mjs
|
|
205
|
+
* collectWaitEntries), rendered as one "Waited this run" line after the
|
|
206
|
+
* set-aside section; omitted when empty
|
|
207
|
+
* @param {string} [opts.costAnalysis] engine-computed cost block, rendered in a fenced Cost section
|
|
208
|
+
* @param {string} [opts.previousBody] the existing PR's body, for history carry-forward
|
|
209
|
+
* @param {number} [opts.maxLength]
|
|
210
|
+
* @returns {string}
|
|
211
|
+
*/
|
|
212
|
+
export function buildSprintPrBody({
|
|
213
|
+
verdict, goal, branch, baseBranch, runId, now = new Date(),
|
|
214
|
+
notes, notesHeading = 'Reviewer notes', details = [], setAside = [], waited = [], costAnalysis = '', previousBody = '',
|
|
215
|
+
maxLength = PR_DESCRIPTION_MAX_LENGTH,
|
|
216
|
+
}) {
|
|
217
|
+
const v = VERDICTS.has(verdict) ? verdict : 'FAIL';
|
|
218
|
+
const run = normalizeRunId(runId);
|
|
219
|
+
const stamp = runStamp(now);
|
|
220
|
+
const history = [{ run, date: stamp, verdict: v }];
|
|
221
|
+
for (const e of parseRunHistory(previousBody)) {
|
|
222
|
+
if (history.length >= RUN_HISTORY_MAX_ENTRIES) break;
|
|
223
|
+
history.push(e);
|
|
224
|
+
}
|
|
225
|
+
const previous = history.slice(1);
|
|
226
|
+
|
|
227
|
+
const head = [
|
|
228
|
+
`## Sprint verdict: ${v}`,
|
|
229
|
+
'',
|
|
230
|
+
goal ? `- **Goal:** ${inline(goal)}` : null,
|
|
231
|
+
`- **Branch:** ${codeSpan(inline(branch))}${baseBranch ? ` -> ${codeSpan(inline(baseBranch))}` : ''}`,
|
|
232
|
+
`- **Run:** ${codeSpan(run)} (${stamp})`,
|
|
233
|
+
'',
|
|
234
|
+
`### ${notesHeading}`,
|
|
235
|
+
'',
|
|
236
|
+
].filter((l) => l !== null).join('\n');
|
|
237
|
+
|
|
238
|
+
const detailLines = (details || []).filter(Boolean).map((d) => `- ${inline(d)}`);
|
|
239
|
+
const setAsideLines = formatSetAsideItems(setAside).map((d) => `- ${inline(d)}`);
|
|
240
|
+
const waitedLine = formatWaitedLine(waited);
|
|
241
|
+
// The cost block replaces the per-sprint CHANGELOG entry the harvester used
|
|
242
|
+
// to write (a shared prepend-only file that conflicted on every merge).
|
|
243
|
+
const cost = sanitizePrMarkdown(costAnalysis);
|
|
244
|
+
const costFence = '`'.repeat(Math.max(3, ...(cost.match(/`+/g) || []).map((r) => r.length + 1)));
|
|
245
|
+
const tail = [
|
|
246
|
+
'',
|
|
247
|
+
setAsideLines.length ? '### Set aside this run\n' : null,
|
|
248
|
+
setAsideLines.length ? setAsideLines.join('\n') : null,
|
|
249
|
+
setAsideLines.length ? '' : null,
|
|
250
|
+
waitedLine ? `${inline(waitedLine)}\n` : null,
|
|
251
|
+
detailLines.length ? '### Details\n' : null,
|
|
252
|
+
detailLines.length ? detailLines.join('\n') : null,
|
|
253
|
+
detailLines.length ? '' : null,
|
|
254
|
+
cost ? `### Cost\n\n${costFence}\n${cost}\n${costFence}\n` : null,
|
|
255
|
+
'---',
|
|
256
|
+
'',
|
|
257
|
+
HUMAN_REVIEW_LINE,
|
|
258
|
+
previous.length ? '\n### Previous runs\n' : null,
|
|
259
|
+
previous.length ? previous.map((e) => `- ${codeSpan(e.run)} (${e.date}): ${e.verdict}`).join('\n') : null,
|
|
260
|
+
'',
|
|
261
|
+
`<!-- ${RUN_HISTORY_MARKER}`,
|
|
262
|
+
JSON.stringify(history),
|
|
263
|
+
'-->',
|
|
264
|
+
].filter((l) => l !== null).join('\n');
|
|
265
|
+
|
|
266
|
+
const cleanNotes = sanitizePrMarkdown(notes);
|
|
267
|
+
const budget = Math.min(PR_NOTES_MAX_LENGTH, maxLength - head.length - tail.length - 120);
|
|
268
|
+
const notesBlock = cleanNotes ? capNotes(cleanNotes, Math.max(200, budget)) : '*No notes were provided.*';
|
|
269
|
+
// Blank lines around the notes keep them their own block: notes ending in
|
|
270
|
+
// a paragraph directly above '---' would otherwise turn into a heading.
|
|
271
|
+
return `${head}\n${notesBlock}\n${tail}`;
|
|
272
|
+
}
|