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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings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CAI5C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlE"}
|
|
@@ -6,6 +6,7 @@ import { readDirectWorkLock } from "../../../shared/direct-work-lock.js";
|
|
|
6
6
|
import { CliError } from "../../../shared/errors.js";
|
|
7
7
|
import { parseGitLogHashSubject } from "../../../shared/git-log.js";
|
|
8
8
|
import { commitFromComment } from "../../guard/index.js";
|
|
9
|
+
import { refreshBranchPrArtifactsAfterTaskCommit } from "../../shared/post-commit-pr-artifacts.js";
|
|
9
10
|
import { requiresVerificationByPrimary, toStringArray } from "./tags.js";
|
|
10
11
|
const execFileAsync = promisify(execFile);
|
|
11
12
|
export function appendTaskEvent(task, event) {
|
|
@@ -40,6 +41,7 @@ export function ensureVerificationSatisfiedIfRequired(task, config) {
|
|
|
40
41
|
if (state === "ok")
|
|
41
42
|
return;
|
|
42
43
|
const hint = `use \`agentplane verify ${task.id} --ok|--rework --by <ID> --note <TEXT>\` ` +
|
|
44
|
+
`and add \`--observation <TEXT> --impact <TEXT> --resolution <TEXT>\` when you want a structured finding ` +
|
|
43
45
|
`or \`agentplane task verify ok|rework ${task.id} --by <ID> --note <TEXT>\``;
|
|
44
46
|
throw new CliError({
|
|
45
47
|
exitCode: 3,
|
|
@@ -153,7 +155,7 @@ export async function runTaskTransitionCommentCommit(opts) {
|
|
|
153
155
|
author: opts.author,
|
|
154
156
|
})
|
|
155
157
|
: undefined;
|
|
156
|
-
|
|
158
|
+
const result = await commitFromComment({
|
|
157
159
|
ctx: opts.ctx,
|
|
158
160
|
cwd: opts.cwd,
|
|
159
161
|
rootOverride: opts.rootOverride,
|
|
@@ -173,6 +175,14 @@ export async function runTaskTransitionCommentCommit(opts) {
|
|
|
173
175
|
quiet: opts.quiet,
|
|
174
176
|
config: opts.ctx.config,
|
|
175
177
|
});
|
|
178
|
+
await refreshBranchPrArtifactsAfterTaskCommit({
|
|
179
|
+
ctx: opts.ctx,
|
|
180
|
+
cwd: opts.cwd,
|
|
181
|
+
rootOverride: opts.rootOverride,
|
|
182
|
+
taskId: opts.taskId,
|
|
183
|
+
quiet: opts.quiet,
|
|
184
|
+
});
|
|
185
|
+
return result;
|
|
176
186
|
}
|
|
177
187
|
export async function readHeadCommit(cwd) {
|
|
178
188
|
const { stdout } = await execFileAsync("git", ["log", "-1", "--pretty=%H%x00%s"], { cwd });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, type PrimaryTagResolution, type TaskTagPolicy, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { type DependencyState, dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
5
|
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,+BAA+B,EAC/B,wCAAwC,EACxC,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,GACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,+BAA+B,EAC/B,wCAAwC,EACxC,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,GACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
5
|
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-ready.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start-ready.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-ready.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start-ready.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAkGpF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ClB"}
|
|
@@ -1,8 +1,90 @@
|
|
|
1
|
+
import { mkdir, readFile, realpath } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
1
4
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
|
-
import { successMessage } from "../../cli/output.js";
|
|
5
|
+
import { infoMessage, successMessage } from "../../cli/output.js";
|
|
3
6
|
import { CliError } from "../../shared/errors.js";
|
|
7
|
+
import { renderIncidentAdvice } from "../../runtime/incidents/index.js";
|
|
8
|
+
import { writeTextIfChanged } from "../../shared/write-if-changed.js";
|
|
4
9
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
10
|
+
import { adviseTaskIncidents } from "../incidents/shared.js";
|
|
11
|
+
import { findWorktreeForBranch, listWorktrees, parseTaskIdFromBranch, parseTaskIdFromCloseBranch, } from "../shared/git-worktree.js";
|
|
5
12
|
import { cmdStart } from "./start.js";
|
|
13
|
+
async function syncTaskReadmeAcrossRelevantWorktrees(opts) {
|
|
14
|
+
const canonicalizeWorktreePath = async (value) => {
|
|
15
|
+
try {
|
|
16
|
+
return await realpath(value);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return path.resolve(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const currentRoot = path.resolve(opts.rootOverride ?? opts.ctx.resolvedProject.gitRoot);
|
|
23
|
+
const currentCanonicalRoot = await canonicalizeWorktreePath(currentRoot);
|
|
24
|
+
const workflowDir = opts.ctx.config.paths.workflow_dir;
|
|
25
|
+
const sourceReadmePath = path.join(currentRoot, workflowDir, opts.taskId, "README.md");
|
|
26
|
+
let sourceText = "";
|
|
27
|
+
try {
|
|
28
|
+
sourceText = await readFile(sourceReadmePath, "utf8");
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const worktrees = await listWorktrees(currentRoot).catch(() => []);
|
|
34
|
+
const normalizedWorktrees = await Promise.all(worktrees.map(async (entry) => ({
|
|
35
|
+
...entry,
|
|
36
|
+
canonicalPath: await canonicalizeWorktreePath(entry.path),
|
|
37
|
+
})));
|
|
38
|
+
const targetRoots = new Set();
|
|
39
|
+
const baseBranch = await resolveBaseBranch({
|
|
40
|
+
cwd: opts.cwd,
|
|
41
|
+
rootOverride: opts.rootOverride ?? null,
|
|
42
|
+
cliBaseOpt: null,
|
|
43
|
+
mode: opts.ctx.config.workflow_mode,
|
|
44
|
+
});
|
|
45
|
+
if (baseBranch) {
|
|
46
|
+
const baseWorktree = await findWorktreeForBranch(currentRoot, baseBranch);
|
|
47
|
+
if (baseWorktree) {
|
|
48
|
+
const canonicalBaseWorktree = await canonicalizeWorktreePath(baseWorktree);
|
|
49
|
+
if (canonicalBaseWorktree !== currentCanonicalRoot) {
|
|
50
|
+
targetRoots.add(canonicalBaseWorktree);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (targetRoots.size === 0) {
|
|
55
|
+
const mainWorktree = normalizedWorktrees.find((entry) => entry.branch === "main" || entry.branch === "refs/heads/main");
|
|
56
|
+
if (mainWorktree && mainWorktree.canonicalPath !== currentCanonicalRoot) {
|
|
57
|
+
targetRoots.add(mainWorktree.canonicalPath);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (targetRoots.size === 0) {
|
|
61
|
+
const nonTaskWorktrees = normalizedWorktrees.filter((entry) => {
|
|
62
|
+
if (!entry.branch)
|
|
63
|
+
return false;
|
|
64
|
+
if (entry.canonicalPath === currentCanonicalRoot)
|
|
65
|
+
return false;
|
|
66
|
+
if (parseTaskIdFromBranch(opts.ctx.config.branch.task_prefix, entry.branch))
|
|
67
|
+
return false;
|
|
68
|
+
if (parseTaskIdFromCloseBranch(entry.branch))
|
|
69
|
+
return false;
|
|
70
|
+
return true;
|
|
71
|
+
});
|
|
72
|
+
if (nonTaskWorktrees.length === 1) {
|
|
73
|
+
targetRoots.add(nonTaskWorktrees[0].canonicalPath);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const matchingTaskWorktrees = normalizedWorktrees.filter((entry) => typeof entry.branch === "string" &&
|
|
77
|
+
parseTaskIdFromBranch(opts.ctx.config.branch.task_prefix, entry.branch) === opts.taskId &&
|
|
78
|
+
entry.canonicalPath !== currentCanonicalRoot);
|
|
79
|
+
if (matchingTaskWorktrees.length === 1) {
|
|
80
|
+
targetRoots.add(matchingTaskWorktrees[0].canonicalPath);
|
|
81
|
+
}
|
|
82
|
+
for (const targetRoot of targetRoots) {
|
|
83
|
+
const targetReadmePath = path.join(targetRoot, workflowDir, opts.taskId, "README.md");
|
|
84
|
+
await mkdir(path.dirname(targetReadmePath), { recursive: true });
|
|
85
|
+
await writeTextIfChanged(targetReadmePath, sourceText);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
6
88
|
export async function cmdTaskStartReady(opts) {
|
|
7
89
|
try {
|
|
8
90
|
const ctx = opts.ctx ??
|
|
@@ -24,8 +106,23 @@ export async function cmdTaskStartReady(opts) {
|
|
|
24
106
|
yes: opts.yes,
|
|
25
107
|
quiet: true,
|
|
26
108
|
});
|
|
109
|
+
await syncTaskReadmeAcrossRelevantWorktrees({
|
|
110
|
+
ctx,
|
|
111
|
+
cwd: opts.cwd,
|
|
112
|
+
rootOverride: opts.rootOverride,
|
|
113
|
+
taskId: opts.taskId,
|
|
114
|
+
});
|
|
27
115
|
if (!opts.quiet) {
|
|
28
116
|
process.stdout.write(`${successMessage("ready", opts.taskId)}\n`);
|
|
117
|
+
const advice = await adviseTaskIncidents({
|
|
118
|
+
ctx,
|
|
119
|
+
taskId: opts.taskId,
|
|
120
|
+
limit: 3,
|
|
121
|
+
});
|
|
122
|
+
if (advice.matches.length > 0) {
|
|
123
|
+
process.stdout.write(`${infoMessage("incident advice for analogous tasks")}\n`);
|
|
124
|
+
process.stdout.write(`${renderIncidentAdvice(advice.matches)}\n`);
|
|
125
|
+
}
|
|
29
126
|
}
|
|
30
127
|
return result;
|
|
31
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAyDpF,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FlB"}
|
|
@@ -3,7 +3,8 @@ import { successMessage } from "../../cli/output.js";
|
|
|
3
3
|
import { CliError } from "../../shared/errors.js";
|
|
4
4
|
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
5
5
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ensurePrArtifactsSynced } from "../pr/internal/sync.js";
|
|
7
|
+
import { applyTaskStatusTransitionCommand, assertVerifyStepsFilled, ensurePlanApprovedIfRequired, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection, normalizeTaskDocVersion, nowIso, prepareTaskTransitionComment, requiresVerifyStepsByPrimary, requireStructuredComment, runTaskTransitionCommentCommit, taskObservationSectionName, toStringArray, } from "./shared.js";
|
|
7
8
|
function assertStartDocRequirements(task, config) {
|
|
8
9
|
if (config.agents?.approvals?.require_plan === true)
|
|
9
10
|
return;
|
|
@@ -16,15 +17,12 @@ function assertStartDocRequirements(task, config) {
|
|
|
16
17
|
const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
|
|
17
18
|
const doc = typeof task.doc === "string" ? task.doc : "";
|
|
18
19
|
if (verifyRequired || isSpike) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"(fill it before starting work when plan approval is disabled)",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
20
|
+
assertVerifyStepsFilled({
|
|
21
|
+
taskId: task.id,
|
|
22
|
+
sectionText: extractDocSection(doc, "Verify Steps"),
|
|
23
|
+
action: "start work",
|
|
24
|
+
guidance: "fill it before starting work when plan approval is disabled",
|
|
25
|
+
});
|
|
28
26
|
}
|
|
29
27
|
if (!isSpike)
|
|
30
28
|
return;
|
|
@@ -65,6 +63,7 @@ export async function cmdStart(opts) {
|
|
|
65
63
|
ctx,
|
|
66
64
|
taskId: opts.taskId,
|
|
67
65
|
quiet: opts.quiet,
|
|
66
|
+
policyAction: "task_start",
|
|
68
67
|
build: (current) => {
|
|
69
68
|
assertStartDocRequirements(current, ctx.config);
|
|
70
69
|
ensurePlanApprovedIfRequired(current, ctx.config);
|
|
@@ -109,6 +108,15 @@ export async function cmdStart(opts) {
|
|
|
109
108
|
resolveExecutorAgent: true,
|
|
110
109
|
});
|
|
111
110
|
}
|
|
111
|
+
if (ctx.config.workflow_mode === "branch_pr") {
|
|
112
|
+
await ensurePrArtifactsSynced({
|
|
113
|
+
ctx,
|
|
114
|
+
cwd: opts.cwd,
|
|
115
|
+
rootOverride: opts.rootOverride,
|
|
116
|
+
taskId: opts.taskId,
|
|
117
|
+
author: opts.author,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
112
120
|
if (!opts.quiet) {
|
|
113
121
|
const suffix = commitInfo ? ` (commit=${commitInfo.hash.slice(0, 12)})` : "";
|
|
114
122
|
process.stdout.write(`${successMessage("started", `${opts.taskId}${suffix}`)}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,CAkDjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,kBAAkB,CAOtD,CAAC"}
|
|
@@ -39,6 +39,10 @@ export const taskSpec = {
|
|
|
39
39
|
cmd: 'agentplane task hosted-close --event-json "$GITHUB_EVENT_PATH"',
|
|
40
40
|
why: "Apply deterministic task closure from a merged hosted PR event on an automation branch.",
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
cmd: "agentplane task hosted-close-pr 202604091218-JREJ4K",
|
|
44
|
+
why: "Open the hosted closure PR after a manual handoff comment leaves only the remote task-close branch.",
|
|
45
|
+
},
|
|
42
46
|
{
|
|
43
47
|
cmd: "agentplane task resume-context <task-id>",
|
|
44
48
|
why: "Inspect deterministic recovery context before resuming or retrying a run.",
|
|
@@ -2,15 +2,34 @@ import type { CommandSpec, OptionSpec, ParsedRaw } from "../../cli/spec/spec.js"
|
|
|
2
2
|
export type VerifyCommonParsed = {
|
|
3
3
|
by: string;
|
|
4
4
|
note: string;
|
|
5
|
+
noteFile?: string;
|
|
5
6
|
details?: string;
|
|
6
7
|
file?: string;
|
|
7
8
|
quiet: boolean;
|
|
9
|
+
collectIncidents: boolean;
|
|
10
|
+
observation?: string;
|
|
11
|
+
impact?: string;
|
|
12
|
+
resolution?: string;
|
|
13
|
+
localOnly: boolean;
|
|
14
|
+
repoFixable: boolean;
|
|
15
|
+
incidentScope?: string;
|
|
16
|
+
incidentTags: string[];
|
|
17
|
+
incidentMatch: string[];
|
|
18
|
+
incidentAdvice?: string;
|
|
19
|
+
incidentRule?: string;
|
|
8
20
|
};
|
|
21
|
+
export declare const verifyFindingOptions: readonly OptionSpec[];
|
|
9
22
|
export declare const verifyCommonOptions: readonly OptionSpec[];
|
|
10
23
|
export declare function validateVerifyDetailsFileExclusive<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
11
24
|
command?: string;
|
|
12
25
|
message?: string;
|
|
13
26
|
}): void;
|
|
14
27
|
export declare function validateVerifyNonEmptyInput<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, name: "by" | "note"): void;
|
|
28
|
+
export declare function validateVerifyNoteSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
29
|
+
command?: string;
|
|
30
|
+
}): void;
|
|
31
|
+
export declare function validateVerifyFindingSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
32
|
+
command?: string;
|
|
33
|
+
}): void;
|
|
15
34
|
export declare function parseVerifyCommonOptions(raw: ParsedRaw): VerifyCommonParsed;
|
|
16
35
|
//# sourceMappingURL=verify-command-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,UAAU,EA+D5C,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAE,SAAS,UAAU,EAwC3C,CAAC;AAEX,wBAAgB,kCAAkC,CAAC,OAAO,EACxD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,IAAI,CAQN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,GAClB,IAAI,CAKN;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAC9C,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,IAAI,CA+BN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,IAAI,CAkCN;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,GAAG,kBAAkB,CAuB3E"}
|
|
@@ -1,13 +1,82 @@
|
|
|
1
1
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
export const verifyFindingOptions = [
|
|
3
|
+
{
|
|
4
|
+
kind: "string",
|
|
5
|
+
name: "observation",
|
|
6
|
+
valueHint: "<text>",
|
|
7
|
+
description: "Structured finding observation to append with the verification.",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "impact",
|
|
12
|
+
valueHint: "<text>",
|
|
13
|
+
description: "Structured finding impact to append with the verification.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "string",
|
|
17
|
+
name: "resolution",
|
|
18
|
+
valueHint: "<text>",
|
|
19
|
+
description: "Structured finding resolution to append with the verification.",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "boolean",
|
|
23
|
+
name: "local-only",
|
|
24
|
+
default: false,
|
|
25
|
+
description: "Keep the finding task-local; omit incident-candidate promotion.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
kind: "boolean",
|
|
29
|
+
name: "repo-fixable",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Mark the structured finding as repo-fixable so incidents collect can promote it.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "string",
|
|
35
|
+
name: "incident-scope",
|
|
36
|
+
valueHint: "<text>",
|
|
37
|
+
description: "Optional incident scope for the appended finding.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
kind: "string",
|
|
41
|
+
name: "incident-tag",
|
|
42
|
+
valueHint: "<tag>",
|
|
43
|
+
repeatable: true,
|
|
44
|
+
description: "Repeatable incident tag for the appended finding.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
kind: "string",
|
|
48
|
+
name: "incident-match",
|
|
49
|
+
valueHint: "<term>",
|
|
50
|
+
repeatable: true,
|
|
51
|
+
description: "Repeatable incident match term for the appended finding.",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "string",
|
|
55
|
+
name: "incident-advice",
|
|
56
|
+
valueHint: "<text>",
|
|
57
|
+
description: "Optional operator advice for the appended finding.",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
kind: "string",
|
|
61
|
+
name: "incident-rule",
|
|
62
|
+
valueHint: "<text>",
|
|
63
|
+
description: "Optional incident rule for the appended finding.",
|
|
64
|
+
},
|
|
65
|
+
];
|
|
2
66
|
export const verifyCommonOptions = [
|
|
3
67
|
{ kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
|
|
4
68
|
{
|
|
5
69
|
kind: "string",
|
|
6
70
|
name: "note",
|
|
7
71
|
valueHint: "<text>",
|
|
8
|
-
required: true,
|
|
9
72
|
description: "Short verification note.",
|
|
10
73
|
},
|
|
74
|
+
{
|
|
75
|
+
kind: "string",
|
|
76
|
+
name: "note-file",
|
|
77
|
+
valueHint: "<path>",
|
|
78
|
+
description: "Read the verification note from a file path (mutually exclusive with --note).",
|
|
79
|
+
},
|
|
11
80
|
{
|
|
12
81
|
kind: "string",
|
|
13
82
|
name: "details",
|
|
@@ -26,6 +95,13 @@ export const verifyCommonOptions = [
|
|
|
26
95
|
default: false,
|
|
27
96
|
description: "Suppress normal output (still prints errors).",
|
|
28
97
|
},
|
|
98
|
+
{
|
|
99
|
+
kind: "boolean",
|
|
100
|
+
name: "collect-incidents",
|
|
101
|
+
default: false,
|
|
102
|
+
description: "After recording verification, collect promotable findings into incidents.md immediately.",
|
|
103
|
+
},
|
|
104
|
+
...verifyFindingOptions,
|
|
29
105
|
];
|
|
30
106
|
export function validateVerifyDetailsFileExclusive(raw, spec, opts) {
|
|
31
107
|
if (typeof raw.opts.details === "string" && typeof raw.opts.file === "string") {
|
|
@@ -42,12 +118,87 @@ export function validateVerifyNonEmptyInput(raw, spec, name) {
|
|
|
42
118
|
throw usageError({ spec, message: `Invalid value for --${name}: empty.` });
|
|
43
119
|
}
|
|
44
120
|
}
|
|
121
|
+
export function validateVerifyNoteSource(raw, spec, opts) {
|
|
122
|
+
const inlineNote = raw.opts.note;
|
|
123
|
+
const noteFile = raw.opts["note-file"];
|
|
124
|
+
if (typeof inlineNote === "string" && typeof noteFile === "string") {
|
|
125
|
+
throw usageError({
|
|
126
|
+
spec,
|
|
127
|
+
command: opts?.command,
|
|
128
|
+
message: "Options --note and --note-file are mutually exclusive.",
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (typeof noteFile === "string" && noteFile.trim().length === 0) {
|
|
132
|
+
throw usageError({
|
|
133
|
+
spec,
|
|
134
|
+
command: opts?.command,
|
|
135
|
+
message: "Invalid value for --note-file: empty.",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (typeof inlineNote === "string" && inlineNote.trim().length === 0) {
|
|
139
|
+
throw usageError({
|
|
140
|
+
spec,
|
|
141
|
+
command: opts?.command,
|
|
142
|
+
message: "Invalid value for --note: empty.",
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (typeof inlineNote !== "string" && typeof noteFile !== "string") {
|
|
146
|
+
throw usageError({
|
|
147
|
+
spec,
|
|
148
|
+
command: opts?.command,
|
|
149
|
+
message: "Provide exactly one of --note or --note-file.",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function validateVerifyFindingSource(raw, spec, opts) {
|
|
154
|
+
const hasFindingField = [
|
|
155
|
+
raw.opts.observation,
|
|
156
|
+
raw.opts.impact,
|
|
157
|
+
raw.opts.resolution,
|
|
158
|
+
raw.opts["incident-scope"],
|
|
159
|
+
raw.opts["incident-advice"],
|
|
160
|
+
raw.opts["incident-rule"],
|
|
161
|
+
].some((value) => typeof value === "string" && value.trim().length > 0);
|
|
162
|
+
const hasFindingCollections = Array.isArray(raw.opts["incident-tag"]) && raw.opts["incident-tag"].length > 0
|
|
163
|
+
? true
|
|
164
|
+
: Array.isArray(raw.opts["incident-match"]) && raw.opts["incident-match"].length > 0;
|
|
165
|
+
const hasFindingToggle = raw.opts["local-only"] === true || raw.opts["repo-fixable"] === true;
|
|
166
|
+
if (!hasFindingField && !hasFindingCollections && !hasFindingToggle)
|
|
167
|
+
return;
|
|
168
|
+
const observation = raw.opts.observation;
|
|
169
|
+
const impact = raw.opts.impact;
|
|
170
|
+
const resolution = raw.opts.resolution;
|
|
171
|
+
if (typeof observation !== "string" ||
|
|
172
|
+
observation.trim().length === 0 ||
|
|
173
|
+
typeof impact !== "string" ||
|
|
174
|
+
impact.trim().length === 0 ||
|
|
175
|
+
typeof resolution !== "string" ||
|
|
176
|
+
resolution.trim().length === 0) {
|
|
177
|
+
throw usageError({
|
|
178
|
+
spec,
|
|
179
|
+
command: opts?.command,
|
|
180
|
+
message: "Provide --observation, --impact, and --resolution together when appending a structured finding.",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
45
184
|
export function parseVerifyCommonOptions(raw) {
|
|
46
185
|
return {
|
|
47
186
|
by: typeof raw.opts.by === "string" ? raw.opts.by : "",
|
|
48
187
|
note: typeof raw.opts.note === "string" ? raw.opts.note : "",
|
|
188
|
+
noteFile: typeof raw.opts["note-file"] === "string" ? raw.opts["note-file"] : undefined,
|
|
49
189
|
details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
|
|
50
190
|
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
51
191
|
quiet: raw.opts.quiet === true,
|
|
192
|
+
collectIncidents: raw.opts["collect-incidents"] === true,
|
|
193
|
+
observation: typeof raw.opts.observation === "string" ? raw.opts.observation : undefined,
|
|
194
|
+
impact: typeof raw.opts.impact === "string" ? raw.opts.impact : undefined,
|
|
195
|
+
resolution: typeof raw.opts.resolution === "string" ? raw.opts.resolution : undefined,
|
|
196
|
+
localOnly: raw.opts["local-only"] === true,
|
|
197
|
+
repoFixable: raw.opts["repo-fixable"] === true,
|
|
198
|
+
incidentScope: typeof raw.opts["incident-scope"] === "string" ? raw.opts["incident-scope"] : undefined,
|
|
199
|
+
incidentTags: raw.opts["incident-tag"] ?? [],
|
|
200
|
+
incidentMatch: raw.opts["incident-match"] ?? [],
|
|
201
|
+
incidentAdvice: typeof raw.opts["incident-advice"] === "string" ? raw.opts["incident-advice"] : undefined,
|
|
202
|
+
incidentRule: typeof raw.opts["incident-rule"] === "string" ? raw.opts["incident-rule"] : undefined,
|
|
52
203
|
};
|
|
53
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,
|
|
1
|
+
{"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAwB5D,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC3E,KAAK,UAAU,EAAE,GAAG,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC,CAyBvE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cmdTaskVerifyOk } from "./verify-record.js";
|
|
2
|
-
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyFindingSource, validateVerifyNonEmptyInput, validateVerifyNoteSource, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
3
3
|
export const taskVerifyOkSpec = {
|
|
4
4
|
id: ["task", "verify", "ok"],
|
|
5
5
|
group: "Task",
|
|
@@ -17,7 +17,8 @@ export const taskVerifyOkSpec = {
|
|
|
17
17
|
message: "Provide at most one of --details or --file.",
|
|
18
18
|
});
|
|
19
19
|
validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "by");
|
|
20
|
-
|
|
20
|
+
validateVerifyNoteSource(raw, taskVerifyOkSpec);
|
|
21
|
+
validateVerifyFindingSource(raw, taskVerifyOkSpec);
|
|
21
22
|
},
|
|
22
23
|
parse: (raw) => ({
|
|
23
24
|
taskId: String(raw.args["task-id"]),
|
|
@@ -33,9 +34,21 @@ export function makeRunTaskVerifyOkHandler(getCtx) {
|
|
|
33
34
|
taskId: p.taskId,
|
|
34
35
|
by: p.by,
|
|
35
36
|
note: p.note,
|
|
37
|
+
noteFile: p.noteFile,
|
|
36
38
|
details: p.details,
|
|
37
39
|
file: p.file,
|
|
40
|
+
collectIncidents: p.collectIncidents,
|
|
38
41
|
quiet: p.quiet,
|
|
42
|
+
observation: p.observation,
|
|
43
|
+
impact: p.impact,
|
|
44
|
+
resolution: p.resolution,
|
|
45
|
+
localOnly: p.localOnly,
|
|
46
|
+
repoFixable: p.repoFixable,
|
|
47
|
+
incidentScope: p.incidentScope,
|
|
48
|
+
incidentTags: p.incidentTags,
|
|
49
|
+
incidentMatch: p.incidentMatch,
|
|
50
|
+
incidentAdvice: p.incidentAdvice,
|
|
51
|
+
incidentRule: p.incidentRule,
|
|
39
52
|
});
|
|
40
53
|
};
|
|
41
54
|
}
|
|
@@ -7,8 +7,20 @@ export declare function cmdTaskVerifyOk(opts: {
|
|
|
7
7
|
taskId: string;
|
|
8
8
|
by: string;
|
|
9
9
|
note: string;
|
|
10
|
+
noteFile?: string;
|
|
10
11
|
details?: string;
|
|
11
12
|
file?: string;
|
|
13
|
+
collectIncidents?: boolean;
|
|
14
|
+
observation?: string;
|
|
15
|
+
impact?: string;
|
|
16
|
+
resolution?: string;
|
|
17
|
+
localOnly: boolean;
|
|
18
|
+
repoFixable: boolean;
|
|
19
|
+
incidentScope?: string;
|
|
20
|
+
incidentTags: string[];
|
|
21
|
+
incidentMatch: string[];
|
|
22
|
+
incidentAdvice?: string;
|
|
23
|
+
incidentRule?: string;
|
|
12
24
|
quiet: boolean;
|
|
13
25
|
}): Promise<number>;
|
|
14
26
|
export declare function cmdTaskVerifyRework(opts: {
|
|
@@ -18,8 +30,20 @@ export declare function cmdTaskVerifyRework(opts: {
|
|
|
18
30
|
taskId: string;
|
|
19
31
|
by: string;
|
|
20
32
|
note: string;
|
|
33
|
+
noteFile?: string;
|
|
21
34
|
details?: string;
|
|
22
35
|
file?: string;
|
|
36
|
+
collectIncidents?: boolean;
|
|
37
|
+
observation?: string;
|
|
38
|
+
impact?: string;
|
|
39
|
+
resolution?: string;
|
|
40
|
+
localOnly?: boolean;
|
|
41
|
+
repoFixable?: boolean;
|
|
42
|
+
incidentScope?: string;
|
|
43
|
+
incidentTags?: string[];
|
|
44
|
+
incidentMatch?: string[];
|
|
45
|
+
incidentAdvice?: string;
|
|
46
|
+
incidentRule?: string;
|
|
23
47
|
quiet: boolean;
|
|
24
48
|
}): Promise<number>;
|
|
25
49
|
export declare function cmdVerifyParsed(opts: {
|
|
@@ -30,8 +54,20 @@ export declare function cmdVerifyParsed(opts: {
|
|
|
30
54
|
state: VerifyState;
|
|
31
55
|
by: string;
|
|
32
56
|
note: string;
|
|
57
|
+
noteFile?: string;
|
|
33
58
|
details?: string;
|
|
34
59
|
file?: string;
|
|
60
|
+
collectIncidents?: boolean;
|
|
61
|
+
observation?: string;
|
|
62
|
+
impact?: string;
|
|
63
|
+
resolution?: string;
|
|
64
|
+
localOnly?: boolean;
|
|
65
|
+
repoFixable?: boolean;
|
|
66
|
+
incidentScope?: string;
|
|
67
|
+
incidentTags?: string[];
|
|
68
|
+
incidentMatch?: string[];
|
|
69
|
+
incidentAdvice?: string;
|
|
70
|
+
incidentRule?: string;
|
|
35
71
|
quiet: boolean;
|
|
36
72
|
}): Promise<number>;
|
|
37
73
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"AAaA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAepF,KAAK,WAAW,GAAG,IAAI,GAAG,cAAc,CAAC;AAoSzC,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBlB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,M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