specdojo 0.7.0 → 0.9.0
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/.github/agents/specdojo-orchestrator.md +7 -3
- package/CHANGELOG.md +217 -0
- package/dist/catalog/build.js +24 -1
- package/dist/catalog/catalog.js +16 -14
- package/dist/catalog/plan.js +1 -1
- package/dist/catalog/scaffold.js +4 -1
- package/dist/commands/agent.js +5 -3
- package/dist/commands/build.js +69 -10
- package/dist/commands/git.js +206 -0
- package/dist/commands/init.js +9 -3
- package/dist/commands/night-orchestrator.js +6 -4
- package/dist/commands/where.js +25 -0
- package/dist/dashboard/dashboard-timeline.js +18 -16
- package/dist/dashboard/dashboard.js +616 -261
- package/dist/dashboard/epic-plan.js +81 -0
- package/dist/dashboard/exec-records.js +16 -20
- package/dist/dashboard/routines.js +11 -12
- package/dist/dashboard/timeline-build.js +5 -9
- package/dist/dashboard/timeline.js +23 -18
- package/dist/devcontainer/scaffold.js +18 -0
- package/dist/docs/frontmatter-namespace.js +1 -48
- package/dist/docs/index-command.js +2 -2
- package/dist/docs/yaml-business-tables.js +243 -0
- package/dist/docs/yaml-interface-tables.js +106 -0
- package/dist/docs/yaml-pages-command.js +5 -3
- package/dist/docs/yaml-pages.js +268 -3
- package/dist/docs/yaml-table-shared.js +70 -0
- package/dist/docs/yaml-tables.js +39 -0
- package/dist/exec/agent-config.js +31 -0
- package/dist/exec/agent-plan.js +3 -2
- package/dist/exec/agent-protected-config.js +2 -0
- package/dist/exec/commands.js +100 -39
- package/dist/exec/commit-hook-skips.js +78 -0
- package/dist/exec/core.js +19 -7
- package/dist/exec/events.js +179 -8
- package/dist/exec/evidence.js +77 -19
- package/dist/exec/handoff.js +9 -13
- package/dist/exec/limit.js +1 -1
- package/dist/exec/mechanical-result.js +45 -0
- package/dist/exec/migrate-records.js +249 -0
- package/dist/exec/parent-validation.js +209 -15
- package/dist/exec/pipeline-state.js +27 -5
- package/dist/exec/plans-condense-findings.js +89 -0
- package/dist/exec/plans-core.js +45 -19
- package/dist/exec/plans-generation.js +52 -30
- package/dist/exec/plans-grade-findings.js +8 -3
- package/dist/exec/plans-kata-findings.js +61 -0
- package/dist/exec/plans-planning.js +3 -3
- package/dist/exec/plans-storage.js +12 -24
- package/dist/exec/post-integration.js +162 -0
- package/dist/exec/queue-command.js +166 -0
- package/dist/exec/queue.js +285 -0
- package/dist/exec/register-foreign-wait.js +84 -0
- package/dist/exec/register-resume.js +55 -56
- package/dist/exec/register.js +26 -22
- package/dist/exec/repo-integration-sync.js +21 -5
- package/dist/exec/repo-integration.js +21 -1
- package/dist/exec/reporter.js +121 -23
- package/dist/exec/results.js +106 -25
- package/dist/exec/review-completion.js +47 -0
- package/dist/exec/review-kata.js +112 -0
- package/dist/exec/run/agent-pipeline.js +78 -8
- package/dist/exec/run/agent.js +32 -13
- package/dist/exec/run/change-scope.js +365 -0
- package/dist/exec/run/deferred-cleanup.js +31 -0
- package/dist/exec/run/in-place.js +73 -33
- package/dist/exec/run/job-lock.js +66 -0
- package/dist/exec/run/job-sequence.js +137 -0
- package/dist/exec/run/job.js +135 -41
- package/dist/exec/run/lifecycle-commands.js +189 -37
- package/dist/exec/run/lock.js +22 -1
- package/dist/exec/run/mode-shared.js +11 -3
- package/dist/exec/run/register-command.js +14 -15
- package/dist/exec/run/register-core.js +20 -13
- package/dist/exec/run/register-mode.js +77 -17
- package/dist/exec/run/register-post-review.js +21 -9
- package/dist/exec/run/register-resume.js +95 -31
- package/dist/exec/run/register-state.js +23 -15
- package/dist/exec/run/register-worktree.js +184 -139
- package/dist/exec/run/schedule-mode.js +79 -18
- package/dist/exec/run/schedule-prepare.js +204 -59
- package/dist/exec/run/schedule-task.js +203 -49
- package/dist/exec/run/shared.js +9 -3
- package/dist/exec/run/trailing-records.js +35 -0
- package/dist/exec/run-records.js +2 -0
- package/dist/exec/schedule/schedule.js +116 -4
- package/dist/exec/shared.js +1 -1
- package/dist/exec/smoke.js +190 -0
- package/dist/exec/strategy.js +14 -3
- package/dist/exec/task-view.js +6 -4
- package/dist/exec/trailing-records.js +242 -0
- package/dist/exec/trial-commands.js +8 -4
- package/dist/exec/trial-core.js +6 -1
- package/dist/exec/validate-records-commit.js +110 -0
- package/dist/exec/validate-records.js +148 -0
- package/dist/exec/validation-metrics.js +181 -0
- package/dist/exec/worktree-cleanup-lock.js +26 -0
- package/dist/exec/worktree-command.js +38 -17
- package/dist/exec/worktree-ops-commit.js +119 -48
- package/dist/exec/worktree-ops-lifecycle.js +77 -48
- package/dist/exec/worktree-ops-merge.js +13 -2
- package/dist/exec/worktree-ops.js +2 -2
- package/dist/exec/worktree.js +32 -4
- package/dist/grade/apply.js +32 -6
- package/dist/grade/command-apply.js +3 -3
- package/dist/grade/command-inspect.js +7 -5
- package/dist/grade/command-plan.js +1 -1
- package/dist/grade/command-run.js +7 -1
- package/dist/grade/command-shared.js +1 -1
- package/dist/grade/core.js +18 -5
- package/dist/grade/markdown.js +3 -3
- package/dist/grade/pipeline-state.js +15 -11
- package/dist/grade/plan.js +37 -17
- package/dist/grade/result.js +3 -3
- package/dist/grade/run.js +87 -11
- package/dist/grade/target-discovery.js +17 -4
- package/dist/grade/targets.js +12 -11
- package/dist/job/definition.js +84 -8
- package/dist/job/job.js +109 -39
- package/dist/job/noop.js +104 -0
- package/dist/register/authoring-sources.js +22 -16
- package/dist/register/core.js +2 -0
- package/dist/register/create-commands.js +28 -3
- package/dist/register/deliverable-target.js +9 -1
- package/dist/register/epic.js +104 -26
- package/dist/register/event-merge.js +3 -0
- package/dist/register/events.js +4 -0
- package/dist/register/external-project.js +3 -0
- package/dist/register/item.js +6 -0
- package/dist/register/maintenance-commands.js +6 -3
- package/dist/register/planning.js +7 -14
- package/dist/register/register.js +74 -16
- package/dist/register/track-domains.js +34 -0
- package/dist/register/track-plan.js +78 -0
- package/dist/register/transition-commands.js +8 -0
- package/dist/register/work-table.js +64 -0
- package/dist/review/grade.js +35 -13
- package/dist/routine/definition.js +13 -3
- package/dist/routine/failure.js +30 -0
- package/dist/routine/routine.js +189 -71
- package/dist/routine/status.js +62 -0
- package/dist/routine/storage.js +33 -0
- package/dist/schedule/schedule.js +39 -39
- package/dist/schedule/strategy-generate-document.js +26 -14
- package/dist/schedule/strategy-generate-scope.js +17 -45
- package/dist/schedule/strategy-generate.js +33 -3
- package/dist/schedule/strategy-profiles.js +86 -12
- package/dist/shared/agent-types.js +7 -0
- package/dist/shared/condense-records.js +25 -0
- package/dist/shared/cross-process-lock.js +9 -1
- package/dist/shared/deprecation.js +8 -0
- package/dist/shared/dist-freshness.js +8 -2
- package/dist/shared/document-metadata.js +20 -0
- package/dist/shared/finding-cause.js +20 -0
- package/dist/shared/frontmatter-namespace.js +48 -0
- package/dist/shared/git-environment.js +2 -1
- package/dist/shared/git.js +186 -16
- package/dist/shared/grade-result.js +17 -1
- package/dist/shared/lefthook-scaffold.js +3 -0
- package/dist/shared/local-config.js +244 -0
- package/dist/shared/local-state.js +20 -0
- package/dist/shared/markdownlint-config.js +8 -3
- package/dist/shared/plan-conventions.js +129 -0
- package/dist/shared/plan-templates.js +57 -41
- package/dist/shared/run-records.js +224 -0
- package/dist/shared/specdojo-config.js +73 -41
- package/dist/shared/specdojo-gitignore.js +1 -0
- package/dist/shared/text.js +74 -6
- package/dist/shared/timeline-index.js +2 -0
- package/dist/shared/where-alias.js +13 -0
- package/dist/specdojo.js +4 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +11 -2
- package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +4 -74
- package/docs/ja/specdojo/exec-templates/xep-condense-template.md +50 -0
- package/docs/ja/specdojo/exec-templates/xep-draft-template.md +17 -5
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +16 -3
- package/docs/ja/specdojo/exec-templates/xep-recipe-guided-template.md +15 -5
- package/docs/ja/specdojo/exec-templates/xep-recipe-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +1 -1
- package/docs/ja/specdojo/exec-templates/xep-rulebook-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-sample-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-template-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xer-condense-template.md +25 -0
- package/docs/ja/specdojo/exec-templates/xp-common-conventions-template.md +50 -0
- package/docs/ja/specdojo/exec-templates/xrp-common-conventions-template.md +30 -0
- package/docs/ja/specdojo/guides/branch-workflow-guide.md +1 -1
- package/docs/ja/specdojo/guides/docs-editing-guide.md +12 -0
- package/docs/ja/specdojo/guides/docs-structure-guide.md +48 -15
- package/docs/ja/specdojo/guides/exec-config-guide.md +69 -19
- package/docs/ja/specdojo/guides/exec-operation-guide.md +97 -18
- package/docs/ja/specdojo/guides/exec-worktree-guide.md +20 -11
- package/docs/ja/specdojo/guides/job-sequence-guide.md +77 -0
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +92 -55
- package/docs/ja/specdojo/guides/project-move-guide.md +381 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +73 -17
- package/docs/ja/specdojo/guides/register-operation-guide.md +26 -6
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +2 -0
- package/docs/ja/specdojo/guides/review-guide.md +22 -19
- package/docs/ja/specdojo/guides/routine-operation-guide.md +23 -12
- package/docs/ja/specdojo/guides/ryu-guide.md +23 -13
- package/docs/ja/specdojo/guides/schedule-design-guide.md +27 -21
- package/docs/ja/specdojo/guides/schedule-operation-guide.md +27 -3
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +5 -4
- package/docs/ja/specdojo/guides/timeline-design-guide.md +27 -144
- package/docs/ja/specdojo/guides/use-case-guide.md +92 -155
- package/docs/ja/specdojo/guides/waza-guide.md +12 -8
- package/docs/ja/specdojo/recipes/bac-recipe.md +111 -0
- package/docs/ja/specdojo/recipes/bes-recipe.md +141 -0
- package/docs/ja/specdojo/recipes/bps-recipe.md +88 -139
- package/docs/ja/specdojo/recipes/br-recipe.md +77 -0
- package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +97 -109
- package/docs/ja/specdojo/recipes/cdfd-recipe.md +85 -146
- package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +92 -99
- package/docs/ja/specdojo/recipes/cnd-recipe.md +135 -0
- package/docs/ja/specdojo/recipes/cpd-recipe.md +140 -0
- package/docs/ja/specdojo/recipes/cxd-recipe.md +162 -0
- package/docs/ja/specdojo/recipes/ifd-recipe.md +145 -0
- package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +112 -90
- package/docs/ja/specdojo/recipes/ifx-index-recipe.md +164 -0
- package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +60 -49
- package/docs/ja/specdojo/recipes/pm-members-recipe.md +50 -51
- package/docs/ja/specdojo/recipes/pm-organization-recipe.md +59 -48
- package/docs/ja/specdojo/recipes/pm-plan-recipe.md +72 -50
- package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +40 -49
- package/docs/ja/specdojo/recipes/pm-raci-recipe.md +42 -48
- package/docs/ja/specdojo/recipes/pm-roles-recipe.md +52 -81
- package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +64 -91
- package/docs/ja/specdojo/recipes/prj-charter-recipe.md +71 -106
- package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +78 -156
- package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +62 -111
- package/docs/ja/specdojo/recipes/prj-scope-recipe.md +67 -123
- package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +60 -96
- package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +61 -105
- package/docs/ja/specdojo/recipes/stsd-recipe.md +88 -80
- package/docs/ja/specdojo/recipes/sysd-critical-flows-recipe.md +129 -0
- package/docs/ja/specdojo/recipes/sysd-cross-cutting-policy-recipe.md +146 -0
- package/docs/ja/specdojo/recipes/sysd-index-recipe.md +141 -0
- package/docs/ja/specdojo/recipes/tsd-recipe.md +149 -129
- package/docs/ja/specdojo/references/command-reference.md +303 -148
- package/docs/ja/specdojo/references/deliverables-reference.md +30 -16
- package/docs/ja/specdojo/references/directory-layout-reference.md +3 -2
- package/docs/ja/specdojo/references/specdojo-config-reference.md +54 -18
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +101 -257
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +102 -228
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +63 -290
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +162 -80
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +118 -155
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +128 -60
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +70 -94
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +24 -56
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +58 -103
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +103 -223
- package/docs/ja/specdojo/rulebooks/cdfd-d2-rulebook.md +18 -93
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +18 -52
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +109 -147
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +80 -108
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +51 -55
- package/docs/ja/specdojo/rulebooks/cdr-rulebook.md +144 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +81 -68
- package/docs/ja/specdojo/rulebooks/cdt-rulebook.md +139 -0
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +9 -184
- package/docs/ja/specdojo/rulebooks/clis-rulebook.md +170 -0
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +33 -86
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +79 -249
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +45 -131
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +69 -275
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +20 -112
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +79 -249
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +12 -145
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +115 -256
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +79 -109
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +119 -174
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +6 -14
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +22 -66
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +36 -94
- package/docs/ja/specdojo/rulebooks/dss-rulebook.md +171 -0
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +31 -131
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +50 -104
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +93 -57
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +63 -253
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +14 -20
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +79 -76
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +182 -237
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +111 -40
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +14 -22
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +23 -46
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +41 -64
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +16 -40
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +34 -61
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +27 -50
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +70 -199
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +65 -153
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +74 -150
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +12 -23
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +99 -176
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +35 -61
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +75 -117
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +31 -60
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +26 -81
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +32 -70
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +45 -87
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +48 -101
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +44 -80
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +59 -127
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +31 -50
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +42 -109
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +29 -42
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +29 -87
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +62 -84
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +11 -61
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +92 -102
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +25 -34
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +30 -53
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +23 -35
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +27 -45
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +45 -59
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +56 -66
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +54 -62
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +46 -65
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +28 -35
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +65 -97
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +6 -18
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +48 -78
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +23 -97
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +61 -153
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +43 -116
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +16 -51
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +47 -92
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +25 -84
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +44 -107
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +106 -32
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +111 -61
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +129 -59
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +90 -189
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +45 -105
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +46 -40
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +104 -68
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +64 -330
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +70 -263
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +58 -200
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +47 -60
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +4 -9
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +69 -71
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +65 -72
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +35 -46
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +49 -66
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +64 -139
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +91 -161
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +49 -144
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +67 -155
- package/docs/ja/specdojo/samples/bac-sample.md +106 -21
- package/docs/ja/specdojo/samples/bdd-sample.yaml +143 -35
- package/docs/ja/specdojo/samples/bds-sample.md +87 -21
- package/docs/ja/specdojo/samples/bes-index-sample.md +42 -20
- package/docs/ja/specdojo/samples/bes-sample.md +70 -21
- package/docs/ja/specdojo/samples/bps-sample.md +42 -54
- package/docs/ja/specdojo/samples/br-sample.md +57 -15
- package/docs/ja/specdojo/samples/ccd-sample.md +80 -19
- package/docs/ja/specdojo/samples/cdfd-sample.md +172 -99
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +9 -7
- package/docs/ja/specdojo/samples/cdr-sample.md +78 -0
- package/docs/ja/specdojo/samples/cdsd-sample.md +73 -20
- package/docs/ja/specdojo/samples/cdt-sample.md +116 -0
- package/docs/ja/specdojo/samples/cld-sample.md +3 -30
- package/docs/ja/specdojo/samples/clis-sample.md +125 -0
- package/docs/ja/specdojo/samples/cnd-sample.md +127 -21
- package/docs/ja/specdojo/samples/cpd-sample.md +136 -22
- package/docs/ja/specdojo/samples/cxd-sample.md +108 -22
- package/docs/ja/specdojo/samples/dct-index-sample.yaml +63 -17
- package/docs/ja/specdojo/samples/dec-sample.md +2 -3
- package/docs/ja/specdojo/samples/dss-sample.md +175 -0
- package/docs/ja/specdojo/samples/gl-sample.yaml +50 -14
- package/docs/ja/specdojo/samples/ifd-sample.md +105 -21
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +0 -2
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +91 -60
- package/docs/ja/specdojo/samples/ifx-file-sample.md +462 -21
- package/docs/ja/specdojo/samples/ifx-index-sample.yaml +87 -19
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +0 -2
- package/docs/ja/specdojo/samples/job-sequence.yaml +67 -0
- package/docs/ja/specdojo/samples/mip-index-sample.md +98 -20
- package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +26 -19
- package/docs/ja/specdojo/samples/pm-members-sample.yaml +37 -13
- package/docs/ja/specdojo/samples/pm-organization-sample.md +42 -21
- package/docs/ja/specdojo/samples/pm-plan-sample.md +78 -26
- package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +41 -22
- package/docs/ja/specdojo/samples/pm-raci-sample.md +63 -28
- package/docs/ja/specdojo/samples/pm-roles-sample.yaml +13 -12
- package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +33 -25
- package/docs/ja/specdojo/samples/prj-charter-sample.md +42 -59
- package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +83 -62
- package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +30 -33
- package/docs/ja/specdojo/samples/sf-index-sample.md +47 -20
- package/docs/ja/specdojo/samples/sf-sample.md +109 -21
- package/docs/ja/specdojo/samples/sld-sample.md +88 -21
- package/docs/ja/specdojo/samples/stsd-sample.md +54 -26
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +166 -21
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +178 -21
- package/docs/ja/specdojo/samples/sysd-index-sample.md +82 -21
- package/docs/ja/specdojo/samples/tml-sample.yaml +4 -1
- package/docs/ja/specdojo/samples/uis-sample.md +141 -20
- package/docs/ja/specdojo/standards/document-metadata-standard.md +33 -4
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +3 -1
- package/docs/ja/specdojo/standards/job-definition-standard.md +24 -9
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +1 -0
- package/docs/ja/specdojo/templates/bac-template.md +76 -0
- package/docs/ja/specdojo/templates/bes-template.md +56 -0
- package/docs/ja/specdojo/templates/br-template.md +64 -0
- package/docs/ja/specdojo/templates/cdfd-template.md +81 -54
- package/docs/ja/specdojo/templates/cdfd-uc-template.md +9 -5
- package/docs/ja/specdojo/templates/cdr-template.md +58 -0
- package/docs/ja/specdojo/templates/cnd-template.md +137 -0
- package/docs/ja/specdojo/templates/cpd-template.md +129 -0
- package/docs/ja/specdojo/templates/cxd-template.md +105 -0
- package/docs/ja/specdojo/templates/dct-data-model-cdt-template.yaml +40 -0
- package/docs/ja/specdojo/templates/dct-data-model-cld-template.yaml +7 -14
- package/docs/ja/specdojo/templates/dct-index-template.md +9 -20
- package/docs/ja/specdojo/templates/dct-project-management-template.yaml +5 -1
- package/docs/ja/specdojo/templates/ifd-template.md +86 -0
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +44 -28
- package/docs/ja/specdojo/templates/ifx-index-template.yaml +40 -0
- package/docs/ja/specdojo/templates/opr-template.md +2 -4
- package/docs/ja/specdojo/templates/pm-organization-template.md +9 -3
- package/docs/ja/specdojo/templates/pm-plan-template.md +4 -4
- package/docs/ja/specdojo/templates/pm-quality-management-plan-template.md +17 -9
- package/docs/ja/specdojo/templates/pm-raci-template.md +24 -13
- package/docs/ja/specdojo/templates/pm-roles-template.yaml +3 -2
- package/docs/ja/specdojo/templates/prj-assumptions-constraints-dependencies-template.md +6 -3
- package/docs/ja/specdojo/templates/prj-comparison-of-alternatives-template.md +22 -19
- package/docs/ja/specdojo/templates/stsd-template.md +46 -21
- package/docs/ja/specdojo/templates/sysd-critical-flows-template.md +94 -0
- package/docs/ja/specdojo/templates/sysd-cross-cutting-policy-template.md +122 -0
- package/docs/ja/specdojo/templates/sysd-index-template.md +89 -0
- package/docs/specdojo/lib/yaml-metadata.cjs +7 -0
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +25 -57
- package/docs/specdojo/schemas/v1/condense-records.schema.yaml +26 -0
- package/docs/specdojo/schemas/v1/dct.schema.yaml +10 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +3 -0
- package/docs/specdojo/schemas/v1/esil.schema.yaml +7 -141
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +5 -1
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +95 -8
- package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +38 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +14 -0
- package/docs/specdojo/schemas/v1/exec-result-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/finding-cause.schema.yaml +22 -0
- package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/grade-result.schema.yaml +2 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +65 -5
- package/docs/specdojo/schemas/v1/ifx-index.schema.yaml +142 -0
- package/docs/specdojo/schemas/v1/job-run.schema.yaml +23 -0
- package/docs/specdojo/schemas/v1/job.schema.yaml +63 -2
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +2 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +17 -1
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +2 -2
- package/package.json +10 -7
- package/templates/antigravity/orchestrator.md +7 -3
- package/templates/claude/agents/specdojo-orchestrator.md +7 -3
- package/templates/codex/agents/specdojo-orchestrator.toml +7 -3
- package/templates/codex/orchestrator.md +7 -3
- package/templates/devcontainer/tmux.conf +6 -0
- package/templates/init-exec-defaults.yaml +13 -0
- package/templates/lefthook/tools/specdojo-pre-commit.mjs +8 -0
- package/templates/opencode/agents/specdojo-orchestrator.md +8 -4
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { basename, join } from "node:path";
|
|
3
3
|
import { createProviderCapacityTracker, loadExecDefaultsConfig } from "../agent-config.js";
|
|
4
4
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
5
|
-
import { readAllEventFiles, foldEventsToState } from "../events.js";
|
|
6
|
-
import { buildScheduleIndex, findStaleGeneratedTracks } from "../schedule/schedule.js";
|
|
5
|
+
import { claimOwnerOf, readAllEventFiles, foldEventsToState } from "../events.js";
|
|
6
|
+
import { buildScheduleIndex, findEditedGeneratedTrackWarnings, findStaleGeneratedTracks, } from "../schedule/schedule.js";
|
|
7
7
|
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
8
8
|
import { scheduleTrackNames } from "../schedule/gantt-chart-scope.js";
|
|
9
9
|
import { readReadySnapshot } from "../schedule/ready.js";
|
|
10
10
|
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
11
11
|
import { extractLocalId, extractPhaseSuffix } from "../../schedule/phase-sets.js";
|
|
12
12
|
import { resolveWorktreeBase } from "../worktree.js";
|
|
13
|
-
import { buildPhaseModeIndex,
|
|
13
|
+
import { buildPhaseModeIndex, resolveAgentPipeline, resolveApproach, resolveScheduledTaskAgent, resolveTaskCapabilities, resolveTaskExecution, resolveTaskMode, resolveTaskProficiency, } from "../strategy.js";
|
|
14
14
|
import { SerialAsyncLock, buildTaskPhaseMap, configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, runCompletionDrivenWorkerPool, } from "./shared.js";
|
|
15
15
|
import { loadRosterForExecutionPath } from "./agent.js";
|
|
16
16
|
import { prepareSingleTask } from "./schedule-prepare.js";
|
|
17
17
|
import { runPreparedTask, runPreparedTaskSafely, } from "./schedule-task.js";
|
|
18
18
|
import { spawnIndexBuild, spawnRefresh, spawnScheduleBuild } from "./mode-shared.js";
|
|
19
|
+
import { ChangeScopeGate, inferChangeScope, parseUnknownScopePolicy, scopePlanMetadata, } from "./change-scope.js";
|
|
20
|
+
import { targetDocIdsForScheduledTask } from "../plans.js";
|
|
21
|
+
import { findRunRecord } from "../run-records.js";
|
|
19
22
|
// Rebuild only generated tracks whose strategy input is missing a generated track or has a newer
|
|
20
23
|
// mtime. The same structured detector feeds exec validate warnings, keeping manual validation and
|
|
21
24
|
// cycle automation on one freshness rule. No output is emitted when every track is fresh.
|
|
@@ -61,6 +64,11 @@ export async function runBatchMode(opts) {
|
|
|
61
64
|
throw new Error(`Unknown schedule track: ${track}. Available tracks: ${tracks.join(", ")}`);
|
|
62
65
|
}
|
|
63
66
|
}
|
|
67
|
+
// A directly edited track only warns: runs resolve agents from the strategy regardless, and the
|
|
68
|
+
// same difference also appears after a catalog change that has not been rebuilt yet.
|
|
69
|
+
for (const warning of findEditedGeneratedTrackWarnings(schedulePath, repoRoot)) {
|
|
70
|
+
process.stdout.write(`[run] WARN: ${warning}\n`);
|
|
71
|
+
}
|
|
64
72
|
const execDefaults = loadExecDefaultsConfig(resolveExecDefaultsPath(opts, schedulePath), executionPath);
|
|
65
73
|
const roster = loadRosterForExecutionPath(executionPath);
|
|
66
74
|
const { localIdToPhaseSets, phaseSetSuffixToId } = buildTaskPhaseMap(schedulePath);
|
|
@@ -69,6 +77,12 @@ export async function runBatchMode(opts) {
|
|
|
69
77
|
const maxRounds = opts.maxRounds ? Math.max(1, parseInt(opts.maxRounds, 10) || 1) : null;
|
|
70
78
|
const dryRun = !!opts.dryRun;
|
|
71
79
|
const strategy = opts.strategy ?? "critical-first";
|
|
80
|
+
const scopeGate = new ChangeScopeGate(executionPath, parseUnknownScopePolicy(opts.unknownScope));
|
|
81
|
+
const scopeLeases = new Map();
|
|
82
|
+
const attempted = new Set();
|
|
83
|
+
// A non-loop run still launches at most --parallel tasks, but defers overlapping preparation
|
|
84
|
+
// until a prior task integrates instead of forking both worktrees from the same HEAD.
|
|
85
|
+
let batchBudget = parallel;
|
|
72
86
|
const prepareReadyTasks = async (capacity, limit) => {
|
|
73
87
|
if (!existsSync(readyJsonPath)) {
|
|
74
88
|
process.stdout.write(`ready.json not found: ${readyJsonPath}\nRun: specdojo exec refresh\n`);
|
|
@@ -95,29 +109,70 @@ export async function runBatchMode(opts) {
|
|
|
95
109
|
return { preparedTasks: [], readyCount: 0 };
|
|
96
110
|
const preparedTasks = [];
|
|
97
111
|
for (const taskId of orderedIds) {
|
|
98
|
-
if (preparedTasks.length >= limit)
|
|
112
|
+
if (preparedTasks.length >= limit || (!loop && batchBudget <= 0))
|
|
99
113
|
break;
|
|
100
114
|
const task = taskMap.get(taskId);
|
|
101
|
-
if (!task)
|
|
115
|
+
if (!task || attempted.has(taskId) || scopeLeases.has(taskId))
|
|
102
116
|
continue;
|
|
117
|
+
let lease;
|
|
103
118
|
try {
|
|
104
|
-
|
|
119
|
+
if (!dryRun) {
|
|
120
|
+
const planPath = findRunRecord(executionPath, "plan", taskId);
|
|
121
|
+
const plan = planPath ? readFileSync(planPath, "utf8") : "";
|
|
122
|
+
const metadata = scopePlanMetadata(plan);
|
|
123
|
+
const scope = inferChangeScope({
|
|
124
|
+
targets: [
|
|
125
|
+
...new Set([
|
|
126
|
+
...(metadata.targets ?? []),
|
|
127
|
+
...(targetDocIdsForScheduledTask(catalogPath ?? "", task, projectId ?? "") ?? []),
|
|
128
|
+
]),
|
|
129
|
+
],
|
|
130
|
+
approach: task.approach ?? metadata.approach,
|
|
131
|
+
text: plan,
|
|
132
|
+
projectId: projectId ?? "",
|
|
133
|
+
repoRoot,
|
|
134
|
+
catalogPath,
|
|
135
|
+
schedulePath,
|
|
136
|
+
});
|
|
137
|
+
const acquired = await scopeGate.tryAcquire(taskId, scope);
|
|
138
|
+
if (!acquired)
|
|
139
|
+
continue;
|
|
140
|
+
lease = acquired;
|
|
141
|
+
}
|
|
142
|
+
const prepared = await prepareSingleTask(task, projectId, repoRoot, schedulePath, executionPath, roster, localIdToPhaseSets, phaseSetSuffixToId, opts.by, { edit: opts.editBy, review: opts.reviewBy }, { executor: opts.executorBy, reporter: opts.reporterBy }, opts.by, dryRun, false, worktreeBase, planGenPaths, execDefaults, capacity.hasCapacity, undefined, { ...opts, changeScopeWaits: lease?.waits });
|
|
105
143
|
// "deferred": every candidate provider is at its cap; try it again after a slot frees.
|
|
106
|
-
if (prepared === "deferred")
|
|
144
|
+
if (prepared === "deferred") {
|
|
145
|
+
await lease?.finish(true);
|
|
107
146
|
continue;
|
|
147
|
+
}
|
|
148
|
+
attempted.add(taskId);
|
|
108
149
|
if (typeof prepared !== "string") {
|
|
109
150
|
preparedTasks.push(prepared);
|
|
151
|
+
if (lease) {
|
|
152
|
+
const reserved = lease;
|
|
153
|
+
scopeLeases.set(taskId, reserved);
|
|
154
|
+
prepared.onScopeIntegrated = () => reserved.finish(true);
|
|
155
|
+
}
|
|
110
156
|
capacity.reserve(prepared.agentCandidates[0]?.provider);
|
|
157
|
+
batchBudget--;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
await lease?.finish(prepared === "success");
|
|
161
|
+
if (prepared === "failure")
|
|
162
|
+
process.exitCode = 1;
|
|
111
163
|
}
|
|
112
164
|
}
|
|
113
165
|
catch (error) {
|
|
166
|
+
attempted.add(taskId);
|
|
167
|
+
await lease?.finish(false);
|
|
114
168
|
const message = error instanceof Error ? error.message : String(error);
|
|
115
169
|
process.stderr.write(`[run] setup error for ${task.id}: ${message}\n`);
|
|
170
|
+
process.exitCode = 1;
|
|
116
171
|
}
|
|
117
172
|
}
|
|
118
173
|
return { preparedTasks, readyCount: orderedIds.length };
|
|
119
174
|
};
|
|
120
|
-
if (
|
|
175
|
+
if (dryRun) {
|
|
121
176
|
const capacity = createProviderCapacityTracker(execDefaults);
|
|
122
177
|
const { preparedTasks, readyCount } = await prepareReadyTasks(capacity, parallel);
|
|
123
178
|
if (preparedTasks.length === 0) {
|
|
@@ -142,14 +197,16 @@ export async function runBatchMode(opts) {
|
|
|
142
197
|
const scheduleAvailable = async (openSlots) => {
|
|
143
198
|
if (stopNewTasks || openSlots <= 0)
|
|
144
199
|
return [];
|
|
145
|
-
if (
|
|
200
|
+
if (!loop && batchBudget <= 0)
|
|
201
|
+
return [];
|
|
202
|
+
if (loop && maxRounds !== null && schedulingPass >= maxRounds) {
|
|
146
203
|
process.stdout.write(`[run] reached max-rounds ${maxRounds} — drain running tasks\n`);
|
|
147
204
|
stopNewTasks = true;
|
|
148
205
|
return [];
|
|
149
206
|
}
|
|
150
207
|
schedulingPass++;
|
|
151
208
|
const roundSuffix = ` (round ${schedulingPass}${maxRounds !== null ? `/${maxRounds}` : "/-"})`;
|
|
152
|
-
if (schedulingPass > 1) {
|
|
209
|
+
if (loop && schedulingPass > 1) {
|
|
153
210
|
// Rebuild doc-index before refresh so deliverables created by the previous round (e.g. a
|
|
154
211
|
// newly authored document referenced by wikilink) are resolvable when this round's tasks
|
|
155
212
|
// are prepared, instead of only becoming resolvable on a later, out-of-band index build.
|
|
@@ -187,7 +244,9 @@ export async function runBatchMode(opts) {
|
|
|
187
244
|
maxParallel: parallel,
|
|
188
245
|
fillSlots: (openSlots) => lifecycleLock.runExclusive(() => scheduleAvailable(openSlots)),
|
|
189
246
|
runItem: (prepared) => runPreparedTaskSafely(prepared, projectId, repoRoot, schedulePath, executionPath, catalogPath, execDefaults, dryRun, lifecycleLock),
|
|
190
|
-
onSettled: (prepared, outcome) => {
|
|
247
|
+
onSettled: async (prepared, outcome) => {
|
|
248
|
+
await scopeLeases.get(prepared.task.id)?.finish(outcome.result === "success");
|
|
249
|
+
scopeLeases.delete(prepared.task.id);
|
|
191
250
|
capacity.release(prepared.agentCandidates[0]?.provider);
|
|
192
251
|
if (outcome.result === "failure")
|
|
193
252
|
process.exitCode = 1;
|
|
@@ -214,10 +273,10 @@ export async function runBatchMode(opts) {
|
|
|
214
273
|
export function resolveClaimingActor(taskState, byOverride) {
|
|
215
274
|
if (byOverride)
|
|
216
275
|
return { actor: byOverride, resumed: false };
|
|
217
|
-
|
|
276
|
+
// The claim owner, not last_by: a human's plain unblock or note must not hand the run to them.
|
|
277
|
+
const actor = taskState?.state === "doing" ? claimOwnerOf(taskState) : undefined;
|
|
278
|
+
if (!actor)
|
|
218
279
|
return { actor: undefined, resumed: false };
|
|
219
|
-
}
|
|
220
|
-
const actor = taskState.last_by;
|
|
221
280
|
process.stdout.write(` Resuming with claiming actor: ${actor}\n`);
|
|
222
281
|
return { actor, resumed: true };
|
|
223
282
|
}
|
|
@@ -279,9 +338,11 @@ export async function runManualMode(opts) {
|
|
|
279
338
|
task.agent_pipeline =
|
|
280
339
|
task.agent_pipeline ??
|
|
281
340
|
resolveAgentPipeline(task.local_id, task.id, phaseModeIndex, task.phase_suffix, task.phase_set);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
341
|
+
const agent = resolveScheduledTaskAgent(task, phaseModeIndex);
|
|
342
|
+
if (agent === undefined)
|
|
343
|
+
delete task.agent;
|
|
344
|
+
else
|
|
345
|
+
task.agent = agent;
|
|
285
346
|
}
|
|
286
347
|
// If the task is already in "doing" state and --by is not specified,
|
|
287
348
|
// use the actor who claimed it and their command to avoid re-selecting a different agent.
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
+
import { withPlanConventionsFiles } from "../../shared/plan-conventions.js";
|
|
2
|
+
import { appendScopeWaitNotes } from "./change-scope.js";
|
|
1
3
|
import { existsSync } from "node:fs";
|
|
2
4
|
import { join } from "node:path";
|
|
5
|
+
import { ensureReviewGrade, reviewGradeFreshness, } from "../../review/grade.js";
|
|
6
|
+
import { findDeliverableInfo, reviewGradeSummaryText } from "../plans-core.js";
|
|
7
|
+
import { enforceKataReviewVerdict, kataReviewSummary, scheduleKataReviewSubjects, } from "../review-kata.js";
|
|
3
8
|
import { resolveMemberCommand } from "../agent-config.js";
|
|
4
|
-
import { canCompleteTask,
|
|
5
|
-
import { buildScheduleIndex } from "../schedule/schedule.js";
|
|
6
|
-
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
7
|
-
import { qualifyTaskId, randomHex } from "../shared.js";
|
|
8
|
-
import { generateSinglePlan, finalizeResultSectionsForDeliverable, targetDocIdsForScheduledTask, reviewGradeSubject, } from "../plans.js";
|
|
9
|
-
import { ensureReviewGrade } from "../../review/grade.js";
|
|
9
|
+
import { canCompleteTask, foldEventsToState, readAllEventFiles } from "../events.js";
|
|
10
10
|
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
11
|
+
import { pipelineStateLocation } from "../pipeline-state.js";
|
|
12
|
+
import { finalizeResultSectionsForDeliverable, generateSinglePlan, reviewGradeSubject, targetDocIdsForScheduledTask, } from "../plans.js";
|
|
11
13
|
import { isResultUnfilled, readResultFrontmatterSnapshot, scaffoldResult } from "../results.js";
|
|
12
|
-
import {
|
|
14
|
+
import { findRunRecord, recordPathForRead, recordRef, recordStem } from "../run-records.js";
|
|
15
|
+
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
16
|
+
import { buildScheduleIndex } from "../schedule/schedule.js";
|
|
17
|
+
import { qualifyTaskId } from "../shared.js";
|
|
13
18
|
import { configuredProductRepos, plannedProjectWorktreePath, preflightProductBranches, productBranchForTask, } from "../task-repos.js";
|
|
14
|
-
import { checkpointAndEnsureWorktree, discardStaleExecWorktree } from "../worktree-ops.js";
|
|
15
|
-
import {
|
|
16
|
-
import { collectBusyActors, pinnedExecutor, pinnedReporter, resolveAgentOverride, resolveExecDefaultsPath, resolvePinnedRateLimitRunOptions, resolveTaskPhaseContext, selectCandidates, } from "./shared.js";
|
|
19
|
+
import { checkpointAndEnsureWorktree, discardStaleExecWorktree, refreshWorktreeCheckpoint, } from "../worktree-ops.js";
|
|
20
|
+
import { findExecWorktree, worktreeNameFromTaskId } from "../worktree.js";
|
|
17
21
|
import { buildExecutorPrompt, executorRequirements, loadPrompt, pathInsideWorktree, reportProductWorktrees, reporterRequirements, resolveReporterAgentCandidates, } from "./agent.js";
|
|
18
22
|
import { integrateLogPath, spawnClaim, spawnRelease } from "./mode-shared.js";
|
|
19
|
-
|
|
23
|
+
import { collectBusyActors, pinnedExecutor, pinnedReporter, resolveAgentOverride, resolveExecDefaultsPath, resolvePinnedRateLimitRunOptions, resolveTaskPhaseContext, selectCandidates, } from "./shared.js";
|
|
24
|
+
export function findClaimEventPath(schedulePath, taskId, worktreeRef) {
|
|
20
25
|
const claims = readAllEventFiles(schedulePath).filter((item) => item.event.task_id === taskId && item.event.type === "claim");
|
|
26
|
+
if (worktreeRef && existsSync(worktreeRef.worktreePath)) {
|
|
27
|
+
for (let i = claims.length - 1; i >= 0; i -= 1) {
|
|
28
|
+
const candidate = claims[i].path;
|
|
29
|
+
if (existsSync(pathInsideWorktree(worktreeRef.repoRoot, worktreeRef.worktreePath, candidate))) {
|
|
30
|
+
return candidate;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
21
34
|
return claims[claims.length - 1]?.path ?? null;
|
|
22
35
|
}
|
|
23
36
|
// review フェーズの前段で runner が対象文書へ grade を実行する(PJR-KCMH、PJR-2ZVS 3.6)。
|
|
24
37
|
// executor には実行させない。評価結果が最新(content_hash 一致)なら再実行しない。
|
|
25
|
-
// grade
|
|
38
|
+
// grade は失敗すると再試行する。それでも失敗した場合も review は止めず、結果を plan に示すが、
|
|
39
|
+
// runner はそのタスクを done にせず blocked にする(PJR-M18B)。
|
|
26
40
|
export async function gradeBeforeReviewPlan(params) {
|
|
27
41
|
const { task, projectId } = params;
|
|
28
42
|
if ((task.mode ?? "edit") !== "review" || !projectId)
|
|
@@ -30,29 +44,115 @@ export async function gradeBeforeReviewPlan(params) {
|
|
|
30
44
|
const subject = reviewGradeSubject(params.catalogPath ?? "", task);
|
|
31
45
|
if (!subject) {
|
|
32
46
|
process.stdout.write(" [grade] skipped: grade subject is not resolvable\n");
|
|
33
|
-
return { action: "not-run", detail: "評価対象のパスを解決できない" };
|
|
34
47
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
if (subject)
|
|
49
|
+
process.stdout.write(` [grade] checking ${subject.path} (--target ${subject.target})\n`);
|
|
50
|
+
const outcome = subject
|
|
51
|
+
? await ensureReviewGrade({
|
|
52
|
+
taskId: qualifyTaskId(projectId, task.id),
|
|
53
|
+
projectId,
|
|
54
|
+
subjectPath: subject.path,
|
|
55
|
+
target: subject.target,
|
|
56
|
+
repoRoot: params.repoRoot,
|
|
57
|
+
dryRun: params.dryRun,
|
|
58
|
+
by: params.by,
|
|
59
|
+
execDefaultsPath: params.execDefaultsPath,
|
|
60
|
+
})
|
|
61
|
+
: { action: "not-run", detail: "評価対象のパスを解決できない" };
|
|
62
|
+
const deliverable = task.local_id && params.catalogPath
|
|
63
|
+
? findDeliverableInfo(params.catalogPath, task.local_id)
|
|
64
|
+
: null;
|
|
65
|
+
for (const kata of scheduleKataReviewSubjects(task, deliverable, projectId)) {
|
|
66
|
+
if (kata.path === subject?.path && subject?.target === "kata")
|
|
67
|
+
continue;
|
|
68
|
+
process.stdout.write(` [grade] checking ${kata.label}: ${kata.path} (--target kata)\n`);
|
|
69
|
+
const kataOutcome = await ensureReviewGrade({
|
|
70
|
+
taskId: qualifyTaskId(projectId, task.id),
|
|
71
|
+
projectId,
|
|
72
|
+
subjectPath: kata.path === "_MISSING_" ? "" : kata.path,
|
|
73
|
+
target: "kata",
|
|
74
|
+
repoRoot: params.repoRoot,
|
|
75
|
+
dryRun: params.dryRun,
|
|
76
|
+
by: params.by,
|
|
77
|
+
execDefaultsPath: params.execDefaultsPath,
|
|
78
|
+
});
|
|
79
|
+
if (kataOutcome.action === "failed" || kataOutcome.action === "not-run") {
|
|
80
|
+
process.stdout.write(` [grade] ${kata.label}: ${kataOutcome.detail}\n`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
46
83
|
const summary = outcome.action === "skipped"
|
|
47
84
|
? "skipped: content_hash matches the stored grade"
|
|
48
85
|
: outcome.action === "executed"
|
|
49
86
|
? `executed: run id ${outcome.runId}`
|
|
50
87
|
: outcome.action === "failed"
|
|
51
|
-
? `failed: run id ${outcome.runId}; ${outcome.detail}`
|
|
88
|
+
? `failed after ${outcome.attempts} attempt(s): run id ${outcome.runId}; ${outcome.detail}`
|
|
52
89
|
: `not run: ${outcome.detail}`;
|
|
53
90
|
process.stdout.write(` [grade] ${summary}\n`);
|
|
54
91
|
return outcome;
|
|
55
92
|
}
|
|
93
|
+
// Root-side grade sidecars of the deliverable and kata subjects that the review judges.
|
|
94
|
+
export function reviewGradeSidecarPaths(params) {
|
|
95
|
+
const { task, projectId } = params;
|
|
96
|
+
const deliverable = task.local_id && params.catalogPath
|
|
97
|
+
? findDeliverableInfo(params.catalogPath, task.local_id)
|
|
98
|
+
: null;
|
|
99
|
+
const subjectPaths = [
|
|
100
|
+
reviewGradeSubject(params.catalogPath ?? "", task)?.path,
|
|
101
|
+
...scheduleKataReviewSubjects(task, deliverable, projectId).map((kata) => kata.path),
|
|
102
|
+
].filter((path) => !!path && path !== "_MISSING_");
|
|
103
|
+
const sidecars = subjectPaths.flatMap((subjectPath) => {
|
|
104
|
+
const freshness = reviewGradeFreshness({ subjectPath, projectId, rootDir: params.repoRoot });
|
|
105
|
+
return "sidecarPath" in freshness && freshness.sidecarPath ? [freshness.sidecarPath] : [];
|
|
106
|
+
});
|
|
107
|
+
return [...new Set(sidecars)].sort();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A resumed review reuses the exec branch, which still holds the grade from its first checkpoint.
|
|
111
|
+
* Bring the grade the runner just checked into the branch so the review agent and the completion
|
|
112
|
+
* check judge the same grade as the runner (PJR-ZSRD). Returns the refreshed repo-relative paths.
|
|
113
|
+
*/
|
|
114
|
+
export function refreshReviewGradeCheckpoint(params) {
|
|
115
|
+
const { task, projectId } = params;
|
|
116
|
+
if ((task.mode ?? "edit") !== "review" || !projectId)
|
|
117
|
+
return [];
|
|
118
|
+
const refreshed = refreshWorktreeCheckpoint({
|
|
119
|
+
repoRoot: params.repoRoot,
|
|
120
|
+
worktreePath: params.worktree.path,
|
|
121
|
+
paths: reviewGradeSidecarPaths({ ...params, projectId }),
|
|
122
|
+
commitMessage: `exec(${task.id}): refresh grade before resumed review`,
|
|
123
|
+
failureLogPath: params.failureLogPath,
|
|
124
|
+
});
|
|
125
|
+
for (const path of refreshed)
|
|
126
|
+
process.stdout.write(` [grade] refreshed in worktree: ${path}\n`);
|
|
127
|
+
return refreshed;
|
|
128
|
+
}
|
|
129
|
+
// The stored plan keeps the grade summary of its first run. Tell the resumed review which grade
|
|
130
|
+
// the runner checked now so it does not judge from the outdated section.
|
|
131
|
+
export function resumedReviewGradeNote(task, projectId, catalogPath, outcome) {
|
|
132
|
+
const subject = reviewGradeSubject(catalogPath ?? "", task);
|
|
133
|
+
const deliverable = task.local_id && catalogPath ? findDeliverableInfo(catalogPath, task.local_id) : null;
|
|
134
|
+
const summary = [
|
|
135
|
+
subject ? reviewGradeSummaryText(projectId, subject.path, outcome) : "",
|
|
136
|
+
kataReviewSummary(scheduleKataReviewSubjects(task, deliverable, projectId), projectId),
|
|
137
|
+
]
|
|
138
|
+
.filter(Boolean)
|
|
139
|
+
.join("\n\n");
|
|
140
|
+
return [
|
|
141
|
+
"## 再開の前に runner が確認した評価結果",
|
|
142
|
+
"",
|
|
143
|
+
"runner は再開の前に grade を確認し、最新の評価結果サイドカーをこの worktree に取り込んだ。plan の `評価結果` の節は前回の実行の時点のものであり、判定にはこの節と評価結果サイドカーを使う。",
|
|
144
|
+
"",
|
|
145
|
+
summary,
|
|
146
|
+
].join("\n");
|
|
147
|
+
}
|
|
148
|
+
export function enforceScheduleKataReview(params) {
|
|
149
|
+
if (params.task.mode !== "review" || !params.projectId)
|
|
150
|
+
return;
|
|
151
|
+
const deliverable = params.task.local_id && params.catalogPath
|
|
152
|
+
? findDeliverableInfo(params.catalogPath, params.task.local_id)
|
|
153
|
+
: null;
|
|
154
|
+
enforceKataReviewVerdict(params.resultPath, scheduleKataReviewSubjects(params.task, deliverable, params.projectId), params.projectId, params.rootDir);
|
|
155
|
+
}
|
|
56
156
|
export async function prepareSingleTask(task, projectId, repoRoot, schedulePath, executionPath, roster, localIdToPhaseSets, phaseSetSuffixToId, agentNicknameOverride, modeAgentOverrides, stageAgentOverrides, actorOverride, dryRun, skipClaim, worktreeBase, planGenPaths, execDefaults, hasProviderCapacity, pipelineResume, rateLimitOverrides = {}) {
|
|
57
157
|
const mode = task.mode ?? "edit";
|
|
58
158
|
process.stdout.write(`Task: ${task.id}${task.name ? ` — ${task.name}` : ""} [${mode}]\n`);
|
|
@@ -81,7 +181,9 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
81
181
|
]
|
|
82
182
|
: [];
|
|
83
183
|
let actor = actorOverride ?? "auto-agent";
|
|
84
|
-
if (overrideResolution.kind === "command" &&
|
|
184
|
+
if (overrideResolution.kind === "command" &&
|
|
185
|
+
overrideResolution.actor &&
|
|
186
|
+
(!skipClaim || (Boolean(stageAgentOverrides.executor) && pipelineResume?.stage !== "reporter"))) {
|
|
85
187
|
actor = overrideResolution.actor;
|
|
86
188
|
}
|
|
87
189
|
if (agentCandidates.length === 0) {
|
|
@@ -163,36 +265,66 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
163
265
|
const reporterRateLimitOptions = reporterPinned && reporterCandidates?.[0]
|
|
164
266
|
? resolvePinnedRateLimitRunOptions(rateLimitOverrides, execDefaults, roster, "reporter", reporterCandidates[0])
|
|
165
267
|
: undefined;
|
|
268
|
+
// A resumed claim stays with the actor that already holds it, even when a stage override
|
|
269
|
+
// selects another agent to run.
|
|
270
|
+
const claimActor = skipClaim ? (actorOverride ?? actor) : actor;
|
|
271
|
+
// The runner grades before any review agent starts, including an executor resume (PJR-ZSRD).
|
|
272
|
+
const reviewGradeOutcome = await gradeBeforeReviewPlan({
|
|
273
|
+
task,
|
|
274
|
+
projectId,
|
|
275
|
+
catalogPath: planGenPaths.catalogPath,
|
|
276
|
+
repoRoot,
|
|
277
|
+
dryRun,
|
|
278
|
+
by: agentCandidates[0]?.actor,
|
|
279
|
+
execDefaultsPath: resolveExecDefaultsPath(rateLimitOverrides, schedulePath),
|
|
280
|
+
});
|
|
281
|
+
const withResumedGradeNote = (text, refreshed) => refreshed.length > 0 && projectId
|
|
282
|
+
? `${text.trimEnd()}\n\n${resumedReviewGradeNote(task, projectId, planGenPaths.catalogPath, reviewGradeOutcome)}\n`
|
|
283
|
+
: text;
|
|
166
284
|
if (pipelineResume?.executorTarget) {
|
|
167
285
|
const { executorTarget, worktree } = pipelineResume;
|
|
168
286
|
if (!worktree)
|
|
169
287
|
throw new Error(`no exec worktree to resume executor for ${task.id}`);
|
|
170
288
|
const worktreeExecutionPath = pathInsideWorktree(repoRoot, worktree.path, executionPath);
|
|
171
|
-
const
|
|
172
|
-
|
|
289
|
+
const refreshed = dryRun
|
|
290
|
+
? []
|
|
291
|
+
: refreshReviewGradeCheckpoint({
|
|
292
|
+
task,
|
|
293
|
+
projectId,
|
|
294
|
+
catalogPath: planGenPaths.catalogPath,
|
|
295
|
+
repoRoot,
|
|
296
|
+
worktree,
|
|
297
|
+
});
|
|
298
|
+
const storedPlan = loadPrompt(worktreeExecutionPath, task.id);
|
|
299
|
+
const planPrompt = storedPlan ? withResumedGradeNote(storedPlan, refreshed) : storedPlan;
|
|
300
|
+
const resultPath = recordPathForRead(executionPath, "result", task.id);
|
|
173
301
|
const worktreeResultPath = pathInsideWorktree(repoRoot, worktree.path, resultPath);
|
|
174
302
|
if (!planPrompt || !existsSync(resultPath) || !existsSync(worktreeResultPath)) {
|
|
175
303
|
throw new Error(`plan or result is missing for executor resume: ${task.id}`);
|
|
176
304
|
}
|
|
177
|
-
const claimEventPath = findClaimEventPath(schedulePath, task.id
|
|
305
|
+
const claimEventPath = findClaimEventPath(schedulePath, task.id, {
|
|
306
|
+
repoRoot,
|
|
307
|
+
worktreePath: worktree.path,
|
|
308
|
+
});
|
|
178
309
|
if (!claimEventPath)
|
|
179
310
|
throw new Error(`claim event is missing for executor resume: ${task.id}`);
|
|
180
311
|
reportProductWorktrees(worktree);
|
|
181
312
|
return {
|
|
182
313
|
task,
|
|
183
314
|
actor,
|
|
315
|
+
claimActor,
|
|
184
316
|
agentCandidates,
|
|
185
317
|
plan: planPrompt,
|
|
186
318
|
prompt: buildExecutorPrompt(planPrompt, execDefaults.pipeline?.parent_validations),
|
|
187
319
|
worktree,
|
|
188
320
|
resultPath,
|
|
189
321
|
resultScaffold: readResultFrontmatterSnapshot(resultPath),
|
|
190
|
-
checkpointPaths: [
|
|
191
|
-
|
|
322
|
+
checkpointPaths: withPlanConventionsFiles([
|
|
323
|
+
recordPathForRead(executionPath, "plan", task.id),
|
|
192
324
|
resultPath,
|
|
193
325
|
claimEventPath,
|
|
194
326
|
...gradeCheckpointPaths({ repoRoot, executionPath }),
|
|
195
|
-
],
|
|
327
|
+
]),
|
|
196
328
|
pipelineRunId: executorTarget.runId,
|
|
197
329
|
pipelineResumeStage: "executor",
|
|
198
330
|
pipelineStateRef: executorTarget.stateRef,
|
|
@@ -201,28 +333,24 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
201
333
|
reporterCandidates,
|
|
202
334
|
executorRateLimitOptions,
|
|
203
335
|
reporterRateLimitOptions,
|
|
336
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
337
|
+
...(refreshed.length > 0 ? { reviewGradeRefreshed: refreshed } : {}),
|
|
204
338
|
};
|
|
205
339
|
}
|
|
206
|
-
const reviewGradeOutcome = await gradeBeforeReviewPlan({
|
|
207
|
-
task,
|
|
208
|
-
projectId,
|
|
209
|
-
catalogPath: planGenPaths.catalogPath,
|
|
210
|
-
repoRoot,
|
|
211
|
-
dryRun,
|
|
212
|
-
by: agentCandidates[0]?.actor,
|
|
213
|
-
execDefaultsPath: resolveExecDefaultsPath(rateLimitOverrides, schedulePath),
|
|
214
|
-
});
|
|
215
340
|
// Plans are generated on demand here; `exec refresh` does not manage them.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
341
|
+
if (!skipClaim || !findRunRecord(executionPath, "plan", task.id))
|
|
342
|
+
await generateSinglePlan({
|
|
343
|
+
executionPath,
|
|
344
|
+
projectId: projectId ?? "",
|
|
345
|
+
catalogPath: planGenPaths.catalogPath ?? "",
|
|
346
|
+
rolesPath: planGenPaths.rolesPath,
|
|
347
|
+
viewpointsPath: planGenPaths.viewpointsPath,
|
|
348
|
+
projectContext: planGenPaths.projectContext,
|
|
349
|
+
task,
|
|
350
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
351
|
+
});
|
|
352
|
+
if (!dryRun)
|
|
353
|
+
appendScopeWaitNotes(recordPathForRead(executionPath, "plan", task.id), rateLimitOverrides.changeScopeWaits);
|
|
226
354
|
const planPrompt = loadPrompt(executionPath, task.id);
|
|
227
355
|
if (!planPrompt) {
|
|
228
356
|
process.stdout.write(` Plan not found for ${task.id}.\n`);
|
|
@@ -232,7 +360,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
232
360
|
? buildExecutorPrompt(planPrompt, execDefaults.pipeline?.parent_validations)
|
|
233
361
|
: planPrompt;
|
|
234
362
|
const pipelineRunId = task.agent_pipeline
|
|
235
|
-
?
|
|
363
|
+
? recordStem(recordPathForRead(executionPath, "plan", task.id))
|
|
236
364
|
: undefined;
|
|
237
365
|
const worktreeTaskId = qualifyTaskId(projectId, task.id);
|
|
238
366
|
const worktreeName = worktreeNameFromTaskId(worktreeTaskId);
|
|
@@ -264,6 +392,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
264
392
|
return {
|
|
265
393
|
task,
|
|
266
394
|
actor,
|
|
395
|
+
claimActor,
|
|
267
396
|
agentCandidates,
|
|
268
397
|
plan: planPrompt,
|
|
269
398
|
prompt,
|
|
@@ -274,6 +403,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
274
403
|
reporterCandidates,
|
|
275
404
|
executorRateLimitOptions,
|
|
276
405
|
reporterRateLimitOptions,
|
|
406
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
277
407
|
};
|
|
278
408
|
}
|
|
279
409
|
if (skipClaim) {
|
|
@@ -286,7 +416,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
286
416
|
return "failure";
|
|
287
417
|
}
|
|
288
418
|
}
|
|
289
|
-
const planRef =
|
|
419
|
+
const planRef = recordRef(executionPath, recordPathForRead(executionPath, "plan", task.id));
|
|
290
420
|
const startedAt = new Date().toISOString();
|
|
291
421
|
const finalizeSections = task.approach === "finalize" || task.approach === "bootstrap-finalize"
|
|
292
422
|
? finalizeResultSectionsForDeliverable(planGenPaths.catalogPath ?? "", task.local_id, task.approach)
|
|
@@ -307,7 +437,8 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
307
437
|
// Keep the execution checkpoint visible at root, but commit it only on the exec branch. The
|
|
308
438
|
// successful merge later brings plan/result/claim and deliverables to root in one first-parent
|
|
309
439
|
// commit (see runPreparedTask).
|
|
310
|
-
const
|
|
440
|
+
const existingWorktree = skipClaim ? findExecWorktree(repoRoot, worktreeTaskId) : null;
|
|
441
|
+
const claimEventPath = findClaimEventPath(schedulePath, task.id, existingWorktree ? { repoRoot, worktreePath: existingWorktree.path } : undefined);
|
|
311
442
|
if (!claimEventPath) {
|
|
312
443
|
process.stdout.write(` Claim event not found for ${task.id}\n`);
|
|
313
444
|
return "failure";
|
|
@@ -325,12 +456,12 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
325
456
|
process.stdout.write(` [run] discarded stale worktree/branch: ${discarded}\n`);
|
|
326
457
|
}
|
|
327
458
|
}
|
|
328
|
-
const checkpointPaths = [
|
|
329
|
-
|
|
459
|
+
const checkpointPaths = withPlanConventionsFiles([
|
|
460
|
+
recordPathForRead(executionPath, "plan", task.id),
|
|
330
461
|
resultPath,
|
|
331
462
|
claimEventPath,
|
|
332
463
|
...gradeCheckpointPaths({ repoRoot, executionPath }),
|
|
333
|
-
];
|
|
464
|
+
]);
|
|
334
465
|
const checkpointFailureLogPath = pipelineRunId
|
|
335
466
|
? integrateLogPath(pipelineStateLocation({
|
|
336
467
|
repoRoot,
|
|
@@ -365,12 +496,24 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
365
496
|
const setupAction = worktree.created ? "setup" : "reuse";
|
|
366
497
|
process.stdout.write(` [run] ${setupAction}: worktree ${worktree.path} (${worktree.branch})\n`);
|
|
367
498
|
reportProductWorktrees(worktree);
|
|
499
|
+
// A fresh claim checkpoints the current grade; a resume keeps the branch and needs a refresh.
|
|
500
|
+
const reviewGradeRefreshed = skipClaim
|
|
501
|
+
? refreshReviewGradeCheckpoint({
|
|
502
|
+
task,
|
|
503
|
+
projectId,
|
|
504
|
+
catalogPath: planGenPaths.catalogPath,
|
|
505
|
+
repoRoot,
|
|
506
|
+
worktree,
|
|
507
|
+
failureLogPath: checkpointFailureLogPath,
|
|
508
|
+
})
|
|
509
|
+
: [];
|
|
368
510
|
return {
|
|
369
511
|
task,
|
|
370
512
|
actor,
|
|
513
|
+
claimActor,
|
|
371
514
|
agentCandidates,
|
|
372
|
-
plan: planPrompt,
|
|
373
|
-
prompt,
|
|
515
|
+
plan: withResumedGradeNote(planPrompt, reviewGradeRefreshed),
|
|
516
|
+
prompt: withResumedGradeNote(prompt, reviewGradeRefreshed),
|
|
374
517
|
worktree,
|
|
375
518
|
resultPath,
|
|
376
519
|
resultScaffold: readResultFrontmatterSnapshot(resultPath),
|
|
@@ -381,6 +524,8 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
381
524
|
reporterCandidates,
|
|
382
525
|
executorRateLimitOptions,
|
|
383
526
|
reporterRateLimitOptions,
|
|
527
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
528
|
+
...(reviewGradeRefreshed.length > 0 ? { reviewGradeRefreshed } : {}),
|
|
384
529
|
};
|
|
385
530
|
}
|
|
386
531
|
// An agent can exit 0 without doing the work (e.g. a permission-denied tool call is fed back as a
|