agentplane 0.3.9 → 0.3.11
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/assets/AGENTS.md +4 -2
- package/assets/agents/CODER.json +1 -1
- package/assets/policy/dod.core.md +1 -1
- package/assets/policy/governance.md +5 -3
- package/assets/policy/incidents.md +19 -77
- package/assets/policy/workflow.branch_pr.md +2 -0
- package/assets/policy/workflow.direct.md +3 -1
- package/bin/agentplane.js +56 -1
- package/bin/runtime-watch.js +1 -0
- package/bin/stale-dist-policy.d.ts +1 -1
- package/bin/stale-dist-policy.js +13 -0
- package/dist/.build-manifest.json +462 -202
- package/dist/cli/bootstrap-guide.d.ts +1 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +20 -1
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +2 -1
- package/dist/cli/command-invocations.d.ts.map +1 -1
- package/dist/cli/command-invocations.js +6 -1
- package/dist/cli/command-snippets.d.ts +2 -0
- package/dist/cli/command-snippets.d.ts.map +1 -1
- package/dist/cli/command-snippets.js +2 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +10 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +3 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +10 -0
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +13 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.js +44 -1
- package/dist/cli/run-cli.js +2 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +12 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +4 -0
- package/dist/commands/branch/cleanup-merged.d.ts +2 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +132 -28
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +60 -1
- package/dist/commands/cleanup/merged.command.d.ts +2 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +24 -0
- package/dist/commands/doctor/branch-pr.d.ts +4 -0
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -0
- package/dist/commands/doctor/branch-pr.js +96 -0
- package/dist/commands/doctor/fixes.d.ts +5 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +70 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +6 -1
- package/dist/commands/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +11 -0
- package/dist/commands/finish.spec.d.ts +11 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +51 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +23 -6
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +24 -2
- package/dist/commands/guard/impl/env.d.ts +1 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +1 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +98 -1
- package/dist/commands/incidents/advise.command.d.ts +15 -0
- package/dist/commands/incidents/advise.command.d.ts.map +1 -0
- package/dist/commands/incidents/advise.command.js +139 -0
- package/dist/commands/incidents/collect.command.d.ts +11 -0
- package/dist/commands/incidents/collect.command.d.ts.map +1 -0
- package/dist/commands/incidents/collect.command.js +72 -0
- package/dist/commands/incidents/incidents.command.d.ts +5 -0
- package/dist/commands/incidents/incidents.command.d.ts.map +1 -0
- package/dist/commands/incidents/incidents.command.js +21 -0
- package/dist/commands/incidents/shared.d.ts +76 -0
- package/dist/commands/incidents/shared.d.ts.map +1 -0
- package/dist/commands/incidents/shared.js +261 -0
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +249 -75
- package/dist/commands/pr/close-superseded.d.ts +9 -0
- package/dist/commands/pr/close-superseded.d.ts.map +1 -0
- package/dist/commands/pr/close-superseded.js +129 -0
- package/dist/commands/pr/close.d.ts +11 -0
- package/dist/commands/pr/close.d.ts.map +1 -0
- package/dist/commands/pr/close.js +116 -0
- package/dist/commands/pr/index.d.ts +2 -0
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +2 -0
- package/dist/commands/pr/integrate/artifacts.d.ts +7 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
- package/dist/commands/pr/integrate/artifacts.js +66 -1
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +20 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts +8 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.js +59 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +40 -12
- package/dist/commands/pr/integrate/internal/merge.d.ts +4 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +59 -15
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +13 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +25 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +3 -2
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +107 -19
- package/dist/commands/pr/internal/freshness.d.ts +20 -0
- package/dist/commands/pr/internal/freshness.d.ts.map +1 -0
- package/dist/commands/pr/internal/freshness.js +50 -0
- package/dist/commands/pr/internal/gh-api.d.ts +6 -0
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -0
- package/dist/commands/pr/internal/gh-api.js +80 -0
- package/dist/commands/pr/internal/note-store.d.ts +18 -0
- package/dist/commands/pr/internal/note-store.d.ts.map +1 -0
- package/dist/commands/pr/internal/note-store.js +66 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +13 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +13 -0
- package/dist/commands/pr/internal/review-template.d.ts +24 -4
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
- package/dist/commands/pr/internal/review-template.js +221 -33
- package/dist/commands/pr/internal/sync.d.ts +41 -0
- package/dist/commands/pr/internal/sync.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync.js +598 -0
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +37 -4
- package/dist/commands/pr/open.d.ts +1 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +18 -54
- package/dist/commands/pr/pr.command.d.ts +15 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +124 -5
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +58 -74
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/cache-prune.js +14 -0
- package/dist/commands/recipes/impl/commands/install.js +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +1 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +12 -17
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +1 -1
- package/dist/commands/shared/approval-requirements.d.ts +5 -7
- package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
- package/dist/commands/shared/approval-requirements.js +3 -73
- package/dist/commands/shared/gh-transport.d.ts +16 -0
- package/dist/commands/shared/gh-transport.d.ts.map +1 -0
- package/dist/commands/shared/gh-transport.js +71 -0
- package/dist/commands/shared/git-diff.d.ts +3 -1
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +10 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +15 -0
- package/dist/commands/shared/git-worktree.d.ts +2 -0
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +22 -2
- package/dist/commands/shared/network-approval.d.ts +2 -0
- package/dist/commands/shared/network-approval.d.ts.map +1 -1
- package/dist/commands/shared/network-approval.js +1 -1
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts +9 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -0
- package/dist/commands/shared/post-commit-pr-artifacts.js +22 -0
- package/dist/commands/shared/pr-meta.d.ts +29 -0
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +152 -3
- package/dist/commands/shared/task-backend.d.ts +9 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -22
- package/dist/commands/shared/task-local-freshness.d.ts +13 -0
- package/dist/commands/shared/task-local-freshness.d.ts.map +1 -0
- package/dist/commands/shared/task-local-freshness.js +20 -0
- package/dist/commands/shared/task-mutation.d.ts +2 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +7 -0
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +1 -0
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +34 -1
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +1 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +7 -11
- package/dist/commands/task/findings-add.command.d.ts +20 -0
- package/dist/commands/task/findings-add.command.d.ts.map +1 -0
- package/dist/commands/task/findings-add.command.js +165 -0
- package/dist/commands/task/findings.command.d.ts +7 -0
- package/dist/commands/task/findings.command.d.ts.map +1 -0
- package/dist/commands/task/findings.command.js +20 -0
- package/dist/commands/task/findings.d.ts +63 -0
- package/dist/commands/task/findings.d.ts.map +1 -0
- package/dist/commands/task/findings.js +188 -0
- package/dist/commands/task/finish-shared.d.ts +1 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +60 -3
- package/dist/commands/task/finish.d.ts +10 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +143 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts +11 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.command.js +414 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +49 -1
- package/dist/commands/task/hosted-merge-sync.d.ts +38 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +249 -17
- package/dist/commands/task/index.d.ts +1 -0
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +1 -0
- package/dist/commands/task/new.d.ts +1 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +140 -30
- package/dist/commands/task/new.spec.d.ts.map +1 -1
- package/dist/commands/task/new.spec.js +7 -0
- package/dist/commands/task/normalize.command.d.ts +2 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +45 -0
- package/dist/commands/task/normalize.d.ts +2 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +85 -8
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +7 -10
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +1 -0
- package/dist/commands/task/shared/docs.d.ts +6 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +14 -0
- package/dist/commands/task/shared/transition-command.d.ts +2 -0
- package/dist/commands/task/shared/transition-command.d.ts.map +1 -1
- package/dist/commands/task/shared/transition-command.js +1 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +11 -1
- package/dist/commands/task/shared.d.ts +1 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +1 -1
- package/dist/commands/task/start-ready.d.ts.map +1 -1
- package/dist/commands/task/start-ready.js +98 -1
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +18 -10
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +4 -0
- package/dist/commands/task/verify-command-shared.d.ts +19 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
- package/dist/commands/task/verify-command-shared.js +152 -1
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +15 -2
- package/dist/commands/task/verify-record.d.ts +36 -0
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +193 -11
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +15 -2
- package/dist/commands/task/verify-show.command.d.ts +1 -1
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +28 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +6 -1
- package/dist/commands/verify.run.d.ts.map +1 -1
- package/dist/commands/verify.run.js +12 -0
- package/dist/commands/verify.spec.d.ts +2 -6
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +30 -3
- package/dist/policy/engine.d.ts +3 -1
- package/dist/policy/engine.d.ts.map +1 -1
- package/dist/policy/engine.js +5 -6
- package/dist/policy/taxonomy.d.ts +17 -0
- package/dist/policy/taxonomy.d.ts.map +1 -0
- package/dist/policy/taxonomy.js +302 -0
- package/dist/policy/types.d.ts +2 -1
- package/dist/policy/types.d.ts.map +1 -1
- package/dist/runner/artifacts.d.ts.map +1 -1
- package/dist/runner/artifacts.js +2 -0
- package/dist/runner/context/base-prompts.d.ts +25 -0
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +182 -54
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +5 -0
- package/dist/runner/types.d.ts +12 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -1
- package/dist/runner/usecases/scenario-materialize-task.js +81 -11
- package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-inspect.js +9 -7
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
- package/dist/runner/usecases/task-run-lifecycle-shared.js +8 -6
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +59 -12
- package/dist/runtime/approvals/index.d.ts +3 -0
- package/dist/runtime/approvals/index.d.ts.map +1 -0
- package/dist/runtime/approvals/index.js +1 -0
- package/dist/runtime/approvals/runtime.d.ts +12 -0
- package/dist/runtime/approvals/runtime.d.ts.map +1 -0
- package/dist/runtime/approvals/runtime.js +154 -0
- package/dist/runtime/approvals/types.d.ts +31 -0
- package/dist/runtime/approvals/types.d.ts.map +1 -0
- package/dist/runtime/approvals/types.js +1 -0
- package/dist/runtime/behavior/index.d.ts +3 -0
- package/dist/runtime/behavior/index.d.ts.map +1 -0
- package/dist/runtime/behavior/index.js +1 -0
- package/dist/runtime/behavior/resolve.d.ts +7 -0
- package/dist/runtime/behavior/resolve.d.ts.map +1 -0
- package/dist/runtime/behavior/resolve.js +66 -0
- package/dist/runtime/behavior/types.d.ts +25 -0
- package/dist/runtime/behavior/types.d.ts.map +1 -0
- package/dist/runtime/behavior/types.js +1 -0
- package/dist/runtime/capabilities/backend.d.ts +7 -0
- package/dist/runtime/capabilities/backend.d.ts.map +1 -0
- package/dist/runtime/capabilities/backend.js +104 -0
- package/dist/runtime/capabilities/index.d.ts +6 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +4 -0
- package/dist/runtime/capabilities/recipe.d.ts +10 -0
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -0
- package/dist/runtime/capabilities/recipe.js +123 -0
- package/dist/runtime/capabilities/registry.d.ts +6 -0
- package/dist/runtime/capabilities/registry.d.ts.map +1 -0
- package/dist/runtime/capabilities/registry.js +69 -0
- package/dist/runtime/capabilities/runner.d.ts +8 -0
- package/dist/runtime/capabilities/runner.d.ts.map +1 -0
- package/dist/runtime/capabilities/runner.js +73 -0
- package/dist/runtime/capabilities/types.d.ts +28 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +1 -0
- package/dist/runtime/execution-profile/index.d.ts +3 -0
- package/dist/runtime/execution-profile/index.d.ts.map +1 -0
- package/dist/runtime/execution-profile/index.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +9 -0
- package/dist/runtime/execution-profile/resolve.d.ts.map +1 -0
- package/dist/runtime/execution-profile/resolve.js +80 -0
- package/dist/runtime/execution-profile/types.d.ts +27 -0
- package/dist/runtime/execution-profile/types.d.ts.map +1 -0
- package/dist/runtime/execution-profile/types.js +1 -0
- package/dist/runtime/explain/index.d.ts +3 -0
- package/dist/runtime/explain/index.d.ts.map +1 -0
- package/dist/runtime/explain/index.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +14 -0
- package/dist/runtime/explain/resolve.d.ts.map +1 -0
- package/dist/runtime/explain/resolve.js +50 -0
- package/dist/runtime/explain/types.d.ts +28 -0
- package/dist/runtime/explain/types.d.ts.map +1 -0
- package/dist/runtime/explain/types.js +1 -0
- package/dist/runtime/harness/index.d.ts +4 -0
- package/dist/runtime/harness/index.d.ts.map +1 -0
- package/dist/runtime/harness/index.js +2 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts +4 -0
- package/dist/runtime/harness/resolve-from-command-context.d.ts.map +1 -0
- package/dist/runtime/harness/resolve-from-command-context.js +11 -0
- package/dist/runtime/harness/resolve.d.ts +13 -0
- package/dist/runtime/harness/resolve.d.ts.map +1 -0
- package/dist/runtime/harness/resolve.js +146 -0
- package/dist/runtime/harness/types.d.ts +65 -0
- package/dist/runtime/harness/types.d.ts.map +1 -0
- package/dist/runtime/harness/types.js +1 -0
- package/dist/runtime/incidents/index.d.ts +3 -0
- package/dist/runtime/incidents/index.d.ts.map +1 -0
- package/dist/runtime/incidents/index.js +1 -0
- package/dist/runtime/incidents/resolve.d.ts +26 -0
- package/dist/runtime/incidents/resolve.d.ts.map +1 -0
- package/dist/runtime/incidents/resolve.js +683 -0
- package/dist/runtime/incidents/types.d.ts +84 -0
- package/dist/runtime/incidents/types.d.ts.map +1 -0
- package/dist/runtime/incidents/types.js +1 -0
- package/dist/runtime/protocol/index.d.ts +3 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +2 -0
- package/dist/runtime/protocol/resolve.d.ts +16 -0
- package/dist/runtime/protocol/resolve.d.ts.map +1 -0
- package/dist/runtime/protocol/resolve.js +36 -0
- package/dist/runtime/protocol/types.d.ts +36 -0
- package/dist/runtime/protocol/types.d.ts.map +1 -0
- package/dist/runtime/protocol/types.js +1 -0
- package/dist/runtime/task-intake/index.d.ts +3 -0
- package/dist/runtime/task-intake/index.d.ts.map +1 -0
- package/dist/runtime/task-intake/index.js +1 -0
- package/dist/runtime/task-intake/resolve.d.ts +48 -0
- package/dist/runtime/task-intake/resolve.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +316 -0
- package/dist/runtime/task-intake/types.d.ts +117 -0
- package/dist/runtime/task-intake/types.d.ts.map +1 -0
- package/dist/runtime/task-intake/types.js +1 -0
- package/dist/shared/env.d.ts +1 -0
- package/dist/shared/env.d.ts.map +1 -1
- package/dist/shared/env.js +22 -1
- package/dist/shared/protected-paths.d.ts +4 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +8 -4
- package/dist/usecases/context/resolve-context.d.ts +55 -6
- package/dist/usecases/context/resolve-context.d.ts.map +1 -1
- package/dist/usecases/context/resolve-context.js +96 -6
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
- package/dist/usecases/task/task-list-usecase.js +8 -2
- package/dist/usecases/task/task-new-usecase.js +4 -4
- package/package.json +2 -2
|
@@ -11,4 +11,11 @@ export declare function readAndValidatePrArtifacts(opts: {
|
|
|
11
11
|
}): Promise<{
|
|
12
12
|
verifyLogText: string | null;
|
|
13
13
|
}>;
|
|
14
|
+
export declare function ensureCommittedPrArtifactsOnBranch(opts: {
|
|
15
|
+
resolved: {
|
|
16
|
+
gitRoot: string;
|
|
17
|
+
};
|
|
18
|
+
prDir: string;
|
|
19
|
+
branch: string;
|
|
20
|
+
}): Promise<void>;
|
|
14
21
|
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/artifacts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/artifacts.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAYnE,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC,CAkDD;AAED,wBAAsB,kCAAkC,CAAC,IAAI,EAAE;IAC7D,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkEhB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
3
3
|
import { CliError } from "../../../shared/errors.js";
|
|
4
|
-
import { readPrArtifact } from "../internal/pr-paths.js";
|
|
4
|
+
import { readPrArtifact, readPrArtifactFromBranch } from "../internal/pr-paths.js";
|
|
5
|
+
import { findWorktreeForBranch } from "../../shared/git-worktree.js";
|
|
5
6
|
import { validateReviewContents } from "../internal/review-template.js";
|
|
6
7
|
export async function readAndValidatePrArtifacts(opts) {
|
|
7
8
|
const readPrArtifactTyped = readPrArtifact;
|
|
@@ -9,6 +10,7 @@ export async function readAndValidatePrArtifacts(opts) {
|
|
|
9
10
|
const diffstatPath = path.join(prDir, "diffstat.txt");
|
|
10
11
|
const verifyLogPath = path.join(prDir, "verify.log");
|
|
11
12
|
const reviewPath = path.join(prDir, "review.md");
|
|
13
|
+
const worktreePath = await findWorktreeForBranch(opts.resolved.gitRoot, opts.branch);
|
|
12
14
|
const errors = [];
|
|
13
15
|
const relDiffstat = path.relative(opts.resolved.gitRoot, diffstatPath);
|
|
14
16
|
const relVerifyLog = path.relative(opts.resolved.gitRoot, verifyLogPath);
|
|
@@ -18,6 +20,7 @@ export async function readAndValidatePrArtifacts(opts) {
|
|
|
18
20
|
prDir,
|
|
19
21
|
fileName: "diffstat.txt",
|
|
20
22
|
branch: opts.branch,
|
|
23
|
+
worktreePath,
|
|
21
24
|
});
|
|
22
25
|
if (diffstatText === null)
|
|
23
26
|
errors.push(`Missing ${relDiffstat}`);
|
|
@@ -26,6 +29,7 @@ export async function readAndValidatePrArtifacts(opts) {
|
|
|
26
29
|
prDir,
|
|
27
30
|
fileName: "verify.log",
|
|
28
31
|
branch: opts.branch,
|
|
32
|
+
worktreePath,
|
|
29
33
|
});
|
|
30
34
|
if (verifyLogText === null)
|
|
31
35
|
errors.push(`Missing ${relVerifyLog}`);
|
|
@@ -34,6 +38,7 @@ export async function readAndValidatePrArtifacts(opts) {
|
|
|
34
38
|
prDir,
|
|
35
39
|
fileName: "review.md",
|
|
36
40
|
branch: opts.branch,
|
|
41
|
+
worktreePath,
|
|
37
42
|
});
|
|
38
43
|
if (reviewText === null)
|
|
39
44
|
errors.push(`Missing ${relReview}`);
|
|
@@ -48,3 +53,63 @@ export async function readAndValidatePrArtifacts(opts) {
|
|
|
48
53
|
}
|
|
49
54
|
return { verifyLogText };
|
|
50
55
|
}
|
|
56
|
+
export async function ensureCommittedPrArtifactsOnBranch(opts) {
|
|
57
|
+
const readCommittedPrArtifact = readPrArtifactFromBranch;
|
|
58
|
+
const { prDir } = opts;
|
|
59
|
+
const diffstatPath = path.join(prDir, "diffstat.txt");
|
|
60
|
+
const verifyLogPath = path.join(prDir, "verify.log");
|
|
61
|
+
const reviewPath = path.join(prDir, "review.md");
|
|
62
|
+
const metaPath = path.join(prDir, "meta.json");
|
|
63
|
+
const errors = [];
|
|
64
|
+
const relMeta = path.relative(opts.resolved.gitRoot, metaPath);
|
|
65
|
+
const relDiffstat = path.relative(opts.resolved.gitRoot, diffstatPath);
|
|
66
|
+
const relVerifyLog = path.relative(opts.resolved.gitRoot, verifyLogPath);
|
|
67
|
+
const relReview = path.relative(opts.resolved.gitRoot, reviewPath);
|
|
68
|
+
const metaText = await readCommittedPrArtifact({
|
|
69
|
+
resolved: opts.resolved,
|
|
70
|
+
prDir,
|
|
71
|
+
fileName: "meta.json",
|
|
72
|
+
branch: opts.branch,
|
|
73
|
+
});
|
|
74
|
+
if (metaText === null)
|
|
75
|
+
errors.push(`Missing committed ${relMeta} on branch ${opts.branch}`);
|
|
76
|
+
const diffstatText = await readCommittedPrArtifact({
|
|
77
|
+
resolved: opts.resolved,
|
|
78
|
+
prDir,
|
|
79
|
+
fileName: "diffstat.txt",
|
|
80
|
+
branch: opts.branch,
|
|
81
|
+
});
|
|
82
|
+
if (diffstatText === null) {
|
|
83
|
+
errors.push(`Missing committed ${relDiffstat} on branch ${opts.branch}`);
|
|
84
|
+
}
|
|
85
|
+
const verifyLogText = await readCommittedPrArtifact({
|
|
86
|
+
resolved: opts.resolved,
|
|
87
|
+
prDir,
|
|
88
|
+
fileName: "verify.log",
|
|
89
|
+
branch: opts.branch,
|
|
90
|
+
});
|
|
91
|
+
if (verifyLogText === null) {
|
|
92
|
+
errors.push(`Missing committed ${relVerifyLog} on branch ${opts.branch}`);
|
|
93
|
+
}
|
|
94
|
+
const reviewText = await readCommittedPrArtifact({
|
|
95
|
+
resolved: opts.resolved,
|
|
96
|
+
prDir,
|
|
97
|
+
fileName: "review.md",
|
|
98
|
+
branch: opts.branch,
|
|
99
|
+
});
|
|
100
|
+
if (reviewText === null) {
|
|
101
|
+
errors.push(`Missing committed ${relReview} on branch ${opts.branch}`);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
validateReviewContents(reviewText, errors);
|
|
105
|
+
}
|
|
106
|
+
if (errors.length > 0) {
|
|
107
|
+
throw new CliError({
|
|
108
|
+
exitCode: exitCodeForError("E_VALIDATION"),
|
|
109
|
+
code: "E_VALIDATION",
|
|
110
|
+
message: `Task branch ${opts.branch} is missing committed PR artifacts required for integrate.\n` +
|
|
111
|
+
`${errors.join("\n")}\n` +
|
|
112
|
+
"Commit the task README/PR artifacts on the task branch (for example via `agentplane pr open` + git add/commit) before rerunning integrate.",
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/cmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/cmd.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AASnE,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkNlB"}
|
|
@@ -3,10 +3,12 @@ import { mapBackendError } from "../../../cli/error-map.js";
|
|
|
3
3
|
import { createCliEmitter } from "../../../cli/output.js";
|
|
4
4
|
import { CliError } from "../../../shared/errors.js";
|
|
5
5
|
import { cleanupIntegratedBranch } from "./internal/cleanup.js";
|
|
6
|
+
import { renderPostIntegrateBootstrapFailureGuidance, renderPostIntegrateBootstrapGuidance, shouldRecommendPostIntegrateBootstrap, } from "./internal/bootstrap-guidance.js";
|
|
6
7
|
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
7
8
|
import { gitRevParse } from "../../shared/git-ops.js";
|
|
8
9
|
import { finalizeIntegrate } from "./internal/finalize.js";
|
|
9
10
|
import { runMergeCommit, runRebaseFastForward, runSquashMerge } from "./internal/merge.js";
|
|
11
|
+
import { maybeRunPostIntegrateBootstrap } from "./internal/post-integrate-bootstrap.js";
|
|
10
12
|
import { prepareIntegrate } from "./internal/prepare.js";
|
|
11
13
|
import { resolveWorktreeForIntegrate } from "./internal/worktree.js";
|
|
12
14
|
import { runVerifyCommands } from "./verify.js";
|
|
@@ -74,6 +76,8 @@ export async function cmdIntegrate(opts) {
|
|
|
74
76
|
branch,
|
|
75
77
|
headBeforeMerge,
|
|
76
78
|
taskId: task.id,
|
|
79
|
+
taskTitle: task.title,
|
|
80
|
+
taskTags: task.tags,
|
|
77
81
|
workflowDir: loadedConfig.paths.workflow_dir,
|
|
78
82
|
changedPaths,
|
|
79
83
|
genericTokens: loadedConfig.commit.generic_tokens,
|
|
@@ -84,6 +88,8 @@ export async function cmdIntegrate(opts) {
|
|
|
84
88
|
gitRoot: resolved.gitRoot,
|
|
85
89
|
branch,
|
|
86
90
|
taskId: task.id,
|
|
91
|
+
taskTitle: task.title,
|
|
92
|
+
taskTags: task.tags,
|
|
87
93
|
workflowDir: loadedConfig.paths.workflow_dir,
|
|
88
94
|
changedPaths,
|
|
89
95
|
});
|
|
@@ -155,6 +161,20 @@ export async function cmdIntegrate(opts) {
|
|
|
155
161
|
tempWorktreePath = null;
|
|
156
162
|
createdTempWorktree = false;
|
|
157
163
|
}
|
|
164
|
+
if (shouldRecommendPostIntegrateBootstrap(changedPaths)) {
|
|
165
|
+
const bootstrapResult = await maybeRunPostIntegrateBootstrap({
|
|
166
|
+
gitRoot: resolved.gitRoot,
|
|
167
|
+
changedPaths,
|
|
168
|
+
});
|
|
169
|
+
if (!opts.quiet) {
|
|
170
|
+
if (bootstrapResult.status === "skipped") {
|
|
171
|
+
output.warn(renderPostIntegrateBootstrapGuidance());
|
|
172
|
+
}
|
|
173
|
+
else if (bootstrapResult.status === "failed") {
|
|
174
|
+
output.warn(renderPostIntegrateBootstrapFailureGuidance(bootstrapResult.error));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
158
178
|
return 0;
|
|
159
179
|
}
|
|
160
180
|
catch (err) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function shouldRecommendPostIntegrateBootstrap(changedPaths: string[]): boolean;
|
|
2
|
+
export declare function shouldAutoBootstrapAfterIntegrate(opts: {
|
|
3
|
+
changedPaths: string[];
|
|
4
|
+
gitRoot: string;
|
|
5
|
+
}): boolean;
|
|
6
|
+
export declare function renderPostIntegrateBootstrapGuidance(): string;
|
|
7
|
+
export declare function renderPostIntegrateBootstrapFailureGuidance(reason: string): string;
|
|
8
|
+
//# sourceMappingURL=bootstrap-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-guidance.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/bootstrap-guidance.ts"],"names":[],"mappings":"AA4CA,wBAAgB,qCAAqC,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAErF;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACtD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CASV;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAK7D;AAED,wBAAgB,2CAA2C,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKlF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { isRuntimeRelevantWatchedFile } from "../../../../../bin/runtime-watch.js";
|
|
4
|
+
const WATCHED_RUNTIME_PACKAGES = [
|
|
5
|
+
{
|
|
6
|
+
packageRoot: "packages/agentplane",
|
|
7
|
+
watchedPaths: [
|
|
8
|
+
"src",
|
|
9
|
+
"bin/agentplane.js",
|
|
10
|
+
"bin/dist-guard.js",
|
|
11
|
+
"bin/runtime-context.js",
|
|
12
|
+
"bin/stale-dist-policy.js",
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
packageRoot: "packages/core",
|
|
17
|
+
watchedPaths: ["src"],
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
function normalizeRepoPath(filePath) {
|
|
21
|
+
return filePath.replaceAll("\\", "/");
|
|
22
|
+
}
|
|
23
|
+
function isWatchedRuntimeSourcePath(filePath) {
|
|
24
|
+
const normalized = normalizeRepoPath(filePath);
|
|
25
|
+
for (const watchedPackage of WATCHED_RUNTIME_PACKAGES) {
|
|
26
|
+
for (const watchedPath of watchedPackage.watchedPaths) {
|
|
27
|
+
if (watchedPath === "src") {
|
|
28
|
+
const sourcePrefix = `${watchedPackage.packageRoot}/src/`;
|
|
29
|
+
if (!normalized.startsWith(sourcePrefix))
|
|
30
|
+
continue;
|
|
31
|
+
const packageRelativePath = normalized.slice(watchedPackage.packageRoot.length + 1);
|
|
32
|
+
return isRuntimeRelevantWatchedFile(packageRelativePath);
|
|
33
|
+
}
|
|
34
|
+
if (normalized === `${watchedPackage.packageRoot}/${watchedPath}`) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
export function shouldRecommendPostIntegrateBootstrap(changedPaths) {
|
|
42
|
+
return changedPaths.some((changedPath) => isWatchedRuntimeSourcePath(changedPath));
|
|
43
|
+
}
|
|
44
|
+
export function shouldAutoBootstrapAfterIntegrate(opts) {
|
|
45
|
+
if (!shouldRecommendPostIntegrateBootstrap(opts.changedPaths)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return (existsSync(path.join(opts.gitRoot, "package.json")) &&
|
|
49
|
+
existsSync(path.join(opts.gitRoot, "packages", "agentplane", "package.json")) &&
|
|
50
|
+
existsSync(path.join(opts.gitRoot, "scripts", "bootstrap-framework-dev.mjs")));
|
|
51
|
+
}
|
|
52
|
+
export function renderPostIntegrateBootstrapGuidance() {
|
|
53
|
+
return ("This merge changed watched runtime sources. Run `bun run framework:dev:bootstrap` " +
|
|
54
|
+
"before the next command so the repo-local build stays current.");
|
|
55
|
+
}
|
|
56
|
+
export function renderPostIntegrateBootstrapFailureGuidance(reason) {
|
|
57
|
+
return ("This merge changed watched runtime sources and the automatic repo-local runtime refresh " +
|
|
58
|
+
`failed (${reason}). Run \`bun run framework:dev:bootstrap\` manually before the next command.`);
|
|
59
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/finalize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAiBrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/finalize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAiBrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAUtE,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;IAEzB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwGhB"}
|
|
@@ -8,11 +8,13 @@ import { gitDiffStat } from "../../../shared/git-diff.js";
|
|
|
8
8
|
import { appendVerifyLog, buildIntegratedPrMeta, parsePrMeta, } from "../../../shared/pr-meta.js";
|
|
9
9
|
import { readCommitInfo } from "../../../task/shared.js";
|
|
10
10
|
import { createTaskCloseCommit, writeFinishedTasks } from "../../../task/finish-shared.js";
|
|
11
|
+
import { collectTaskIncidents, renderIncidentCollectionPlanOutcome, } from "../../../incidents/shared.js";
|
|
11
12
|
function nowIso() {
|
|
12
13
|
return new Date().toISOString();
|
|
13
14
|
}
|
|
14
15
|
export async function finalizeIntegrate(opts) {
|
|
15
16
|
const output = createCliEmitter();
|
|
17
|
+
const taskAlreadyDone = String(opts.task.status || "TODO").toUpperCase() === "DONE";
|
|
16
18
|
if (!(await fileExists(opts.prDir))) {
|
|
17
19
|
throw new CliError({
|
|
18
20
|
exitCode: 3,
|
|
@@ -52,20 +54,45 @@ export async function finalizeIntegrate(opts) {
|
|
|
52
54
|
: "skipped";
|
|
53
55
|
const finishBody = `Verified: Integrated via ${opts.mergeStrategy}; verify=${verifyDesc}; pr=${path.relative(opts.gitRoot, opts.prDir)}.`;
|
|
54
56
|
const resultSummary = `integrate: ${opts.mergeStrategy} ${opts.branch}`;
|
|
55
|
-
|
|
56
|
-
await writeFinishedTasks({
|
|
57
|
+
await collectTaskIncidents({
|
|
57
58
|
ctx: opts.ctx,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
body: finishBody,
|
|
62
|
-
force: false,
|
|
63
|
-
resultProvided: true,
|
|
64
|
-
resultSummary,
|
|
65
|
-
riskLevel: undefined,
|
|
66
|
-
breaking: false,
|
|
67
|
-
taskCommitInfo,
|
|
59
|
+
taskId: opts.taskId,
|
|
60
|
+
task: opts.task,
|
|
61
|
+
write: false,
|
|
68
62
|
});
|
|
63
|
+
if (!taskAlreadyDone) {
|
|
64
|
+
const taskCommitInfo = await readCommitInfo(opts.gitRoot, opts.mergeHash);
|
|
65
|
+
await writeFinishedTasks({
|
|
66
|
+
ctx: opts.ctx,
|
|
67
|
+
loadedTasks: [{ taskId: opts.taskId, task: opts.task }],
|
|
68
|
+
metaTaskId: opts.taskId,
|
|
69
|
+
author: "INTEGRATOR",
|
|
70
|
+
body: finishBody,
|
|
71
|
+
force: false,
|
|
72
|
+
resultProvided: true,
|
|
73
|
+
resultSummary,
|
|
74
|
+
riskLevel: undefined,
|
|
75
|
+
breaking: false,
|
|
76
|
+
taskCommitInfo,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const collectedIncidents = await collectTaskIncidents({
|
|
80
|
+
ctx: opts.ctx,
|
|
81
|
+
taskId: opts.taskId,
|
|
82
|
+
task: opts.task,
|
|
83
|
+
write: true,
|
|
84
|
+
});
|
|
85
|
+
if (!opts.quiet) {
|
|
86
|
+
output.info(renderIncidentCollectionPlanOutcome(collectedIncidents.plan, {
|
|
87
|
+
wrote: collectedIncidents.wrote,
|
|
88
|
+
context: "finish",
|
|
89
|
+
promotedIds: collectedIncidents.plan.promotable.map((item) => item.entry.id),
|
|
90
|
+
registryPaths: collectedIncidents.registryPaths,
|
|
91
|
+
}));
|
|
92
|
+
if (taskAlreadyDone) {
|
|
93
|
+
output.info("task already DONE; integrating only missing PR metadata and close artifacts");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
69
96
|
await createTaskCloseCommit({
|
|
70
97
|
ctx: opts.ctx,
|
|
71
98
|
cwd: opts.cwd,
|
|
@@ -73,6 +100,7 @@ export async function finalizeIntegrate(opts) {
|
|
|
73
100
|
taskId: opts.taskId,
|
|
74
101
|
baseBranchOverride: opts.base,
|
|
75
102
|
quiet: opts.quiet,
|
|
103
|
+
allowPolicy: collectedIncidents.wrote,
|
|
76
104
|
});
|
|
77
105
|
if (!opts.quiet) {
|
|
78
106
|
output.success("integrate", opts.taskId, `merge=${opts.mergeHash.slice(0, 12)}`);
|
|
@@ -5,6 +5,8 @@ export declare function runSquashMerge(opts: {
|
|
|
5
5
|
branch: string;
|
|
6
6
|
headBeforeMerge: string;
|
|
7
7
|
taskId: string;
|
|
8
|
+
taskTitle: string;
|
|
9
|
+
taskTags: string[];
|
|
8
10
|
workflowDir: string;
|
|
9
11
|
changedPaths: string[];
|
|
10
12
|
genericTokens: string[];
|
|
@@ -13,6 +15,8 @@ export declare function runMergeCommit(opts: {
|
|
|
13
15
|
gitRoot: string;
|
|
14
16
|
branch: string;
|
|
15
17
|
taskId: string;
|
|
18
|
+
taskTitle: string;
|
|
19
|
+
taskTags: string[];
|
|
16
20
|
workflowDir: string;
|
|
17
21
|
changedPaths: string[];
|
|
18
22
|
}): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/merge.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/merge.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AA+JzD,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqFlB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,OAAO,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC,CA8DD"}
|
|
@@ -5,8 +5,37 @@ import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
|
5
5
|
import { CliError } from "../../../../shared/errors.js";
|
|
6
6
|
import { execFileAsync, gitEnv } from "../../../shared/git.js";
|
|
7
7
|
import { gitRevParse } from "../../../shared/git-ops.js";
|
|
8
|
+
import { buildGithubPrTitle } from "../../internal/review-template.js";
|
|
8
9
|
import { computeVerifyState, runVerifyCommands } from "../verify.js";
|
|
9
10
|
const noopPromise = () => Promise.resolve();
|
|
11
|
+
function integrateCommitEnv(taskId) {
|
|
12
|
+
return {
|
|
13
|
+
...gitEnv(),
|
|
14
|
+
AGENTPLANE_TASK_ID: taskId,
|
|
15
|
+
AGENTPLANE_ALLOW_BASE: "1",
|
|
16
|
+
AGENTPLANE_ALLOW_TASKS: "1",
|
|
17
|
+
AGENTPLANE_ALLOW_CONFIG: "1",
|
|
18
|
+
AGENTPLANE_DEV_ALLOW_STALE_DIST: "1",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isTaskArtifactPath(filePath) {
|
|
22
|
+
const normalized = filePath.replaceAll("\\", "/");
|
|
23
|
+
return normalized.startsWith(".agentplane/tasks/") || normalized.startsWith("tasks/");
|
|
24
|
+
}
|
|
25
|
+
function fallbackIntegrateSummary(opts) {
|
|
26
|
+
const suffix = extractTaskSuffix(opts.taskId);
|
|
27
|
+
return buildGithubPrTitle({
|
|
28
|
+
id: opts.taskId,
|
|
29
|
+
title: opts.taskTitle,
|
|
30
|
+
tags: opts.taskTags,
|
|
31
|
+
description: "",
|
|
32
|
+
status: "TODO",
|
|
33
|
+
priority: "med",
|
|
34
|
+
owner: "UNKNOWN",
|
|
35
|
+
depends_on: [],
|
|
36
|
+
verify: [],
|
|
37
|
+
}).replace(new RegExp(String.raw ` \(${suffix}\)$`, "u"), "");
|
|
38
|
+
}
|
|
10
39
|
async function listUntrackedTaskArtifacts(opts) {
|
|
11
40
|
const { stdout } = await execFileAsync("git", ["status", "--short", "--untracked-files=all", "--", opts.taskPrefix], {
|
|
12
41
|
cwd: opts.gitRoot,
|
|
@@ -19,6 +48,16 @@ async function listUntrackedTaskArtifacts(opts) {
|
|
|
19
48
|
.map((line) => line.slice(3).trim())
|
|
20
49
|
.filter(Boolean);
|
|
21
50
|
}
|
|
51
|
+
async function listCommitChangedPaths(opts) {
|
|
52
|
+
const { stdout } = await execFileAsync("git", ["show", "--name-only", "--format=", opts.revision], {
|
|
53
|
+
cwd: opts.gitRoot,
|
|
54
|
+
env: gitEnv(),
|
|
55
|
+
});
|
|
56
|
+
return stdout
|
|
57
|
+
.split("\n")
|
|
58
|
+
.map((line) => line.trim())
|
|
59
|
+
.filter(Boolean);
|
|
60
|
+
}
|
|
22
61
|
async function moveCollidingTaskArtifacts(opts) {
|
|
23
62
|
const taskPrefix = `${opts.workflowDir.replaceAll("\\", "/")}/${opts.taskId}`;
|
|
24
63
|
const candidatePaths = opts.changedPaths.filter((changedPath) => changedPath === taskPrefix || changedPath.startsWith(`${taskPrefix}/`));
|
|
@@ -118,16 +157,20 @@ export async function runSquashMerge(opts) {
|
|
|
118
157
|
taskId: opts.taskId,
|
|
119
158
|
genericTokens: opts.genericTokens,
|
|
120
159
|
});
|
|
121
|
-
|
|
160
|
+
let shouldFallback = !subjectPolicy.ok;
|
|
161
|
+
if (!shouldFallback) {
|
|
162
|
+
const headPaths = await listCommitChangedPaths({
|
|
163
|
+
gitRoot: opts.gitRoot,
|
|
164
|
+
revision: opts.branch,
|
|
165
|
+
});
|
|
166
|
+
shouldFallback =
|
|
167
|
+
headPaths.length > 0 && headPaths.every((filePath) => isTaskArtifactPath(filePath));
|
|
168
|
+
}
|
|
169
|
+
if (shouldFallback) {
|
|
122
170
|
const suffix = extractTaskSuffix(opts.taskId);
|
|
123
|
-
subject = `🧩 ${suffix} integrate:
|
|
171
|
+
subject = `🧩 ${suffix} integrate: ${fallbackIntegrateSummary(opts)}`;
|
|
124
172
|
}
|
|
125
|
-
const env =
|
|
126
|
-
...process.env,
|
|
127
|
-
AGENTPLANE_TASK_ID: opts.taskId,
|
|
128
|
-
AGENTPLANE_ALLOW_BASE: "1",
|
|
129
|
-
AGENTPLANE_ALLOW_TASKS: "0",
|
|
130
|
-
};
|
|
173
|
+
const env = integrateCommitEnv(opts.taskId);
|
|
131
174
|
try {
|
|
132
175
|
await execFileAsync("git", ["commit", "-m", subject], {
|
|
133
176
|
cwd: opts.gitRoot,
|
|
@@ -154,14 +197,15 @@ export async function runMergeCommit(opts) {
|
|
|
154
197
|
taskId: opts.taskId,
|
|
155
198
|
changedPaths: opts.changedPaths,
|
|
156
199
|
});
|
|
157
|
-
const env =
|
|
158
|
-
...process.env,
|
|
159
|
-
AGENTPLANE_TASK_ID: opts.taskId,
|
|
160
|
-
AGENTPLANE_ALLOW_BASE: "1",
|
|
161
|
-
AGENTPLANE_ALLOW_TASKS: "0",
|
|
162
|
-
};
|
|
200
|
+
const env = integrateCommitEnv(opts.taskId);
|
|
163
201
|
try {
|
|
164
|
-
await execFileAsync("git", [
|
|
202
|
+
await execFileAsync("git", [
|
|
203
|
+
"merge",
|
|
204
|
+
"--no-ff",
|
|
205
|
+
opts.branch,
|
|
206
|
+
"-m",
|
|
207
|
+
`🔀 ${suffix} integrate: ${fallbackIntegrateSummary(opts)}`,
|
|
208
|
+
], { cwd: opts.gitRoot, env });
|
|
165
209
|
}
|
|
166
210
|
catch (err) {
|
|
167
211
|
await execFileAsync("git", ["merge", "--abort"], { cwd: opts.gitRoot, env: gitEnv() });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PostIntegrateBootstrapResult = {
|
|
2
|
+
status: "skipped";
|
|
3
|
+
} | {
|
|
4
|
+
status: "ran";
|
|
5
|
+
} | {
|
|
6
|
+
status: "failed";
|
|
7
|
+
error: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function maybeRunPostIntegrateBootstrap(opts: {
|
|
10
|
+
gitRoot: string;
|
|
11
|
+
changedPaths: string[];
|
|
12
|
+
}): Promise<PostIntegrateBootstrapResult>;
|
|
13
|
+
//# sourceMappingURL=post-integrate-bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-integrate-bootstrap.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/post-integrate-bootstrap.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,4BAA4B,GACpC;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GACjB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAUxC,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAcxC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { execFileAsync } from "../../../shared/git.js";
|
|
2
|
+
import { shouldAutoBootstrapAfterIntegrate } from "./bootstrap-guidance.js";
|
|
3
|
+
function compactError(err) {
|
|
4
|
+
if (err instanceof Error) {
|
|
5
|
+
const text = err.message.trim();
|
|
6
|
+
return text.length > 0 ? text : err.name;
|
|
7
|
+
}
|
|
8
|
+
return String(err);
|
|
9
|
+
}
|
|
10
|
+
export async function maybeRunPostIntegrateBootstrap(opts) {
|
|
11
|
+
if (!shouldAutoBootstrapAfterIntegrate(opts)) {
|
|
12
|
+
return { status: "skipped" };
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
await execFileAsync("bun", ["run", "framework:dev:bootstrap"], {
|
|
16
|
+
cwd: opts.gitRoot,
|
|
17
|
+
env: { ...process.env },
|
|
18
|
+
maxBuffer: 50 * 1024 * 1024,
|
|
19
|
+
});
|
|
20
|
+
return { status: "ran" };
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return { status: "failed", error: compactError(err) };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TaskData } from "../../../../backends/task-backend.js";
|
|
2
|
+
import { type CommandContext } from "../../../shared/task-backend.js";
|
|
2
3
|
import { type PrMeta } from "../../../shared/pr-meta.js";
|
|
3
4
|
export type PreparedIntegrate = {
|
|
4
5
|
ctx: CommandContext;
|
|
5
6
|
resolved: CommandContext["resolvedProject"];
|
|
6
7
|
loadedConfig: CommandContext["config"];
|
|
7
|
-
task:
|
|
8
|
+
task: TaskData;
|
|
8
9
|
baseBranch: string;
|
|
9
10
|
currentBranch: string;
|
|
10
11
|
prDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/prepare.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAUrE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EAAgC,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGvF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC5C,YAAY,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,EAAE,QAAQ,CAAC;IAEf,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IAEtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IAEtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IAEb,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyO7B"}
|