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,22 +1,24 @@
|
|
|
1
1
|
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
2
|
-
import {
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { loadRegisterItems, resolveRegisterPaths } from "../../register/register.js";
|
|
4
|
+
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
3
5
|
import { loadExecDefaultsConfig, ProviderConcurrencyGate } from "../agent-config.js";
|
|
6
|
+
import { buildInPlaceStem } from "../plans.js";
|
|
4
7
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
8
|
+
import { findResumableRegisterRun } from "../register-resume.js";
|
|
9
|
+
import { formatRegisterRunSummary, parseRegisterIds, parseRegisterSelectionFilter, registerRunExitCode, requireRunnableRegisterItem, resolveRegisterRunTarget, selectRegisterItems, ticketPathFromItem, } from "../register.js";
|
|
10
|
+
import { findRunRecord, taskRecordPaths } from "../run-records.js";
|
|
5
11
|
import { qualifyTaskId } from "../shared.js";
|
|
6
|
-
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
7
|
-
import { execLifecyclePoolPath, execLocksDir } from "./lock.js";
|
|
8
12
|
import { CrossProcessMutex } from "../slot-lock.js";
|
|
9
|
-
import { buildInPlaceStem } from "../plans.js";
|
|
10
|
-
import { formatRegisterRunSummary, parseRegisterIds, parseRegisterSelectionFilter, registerRunExitCode, requireRunnableRegisterItem, resolveRegisterRunTarget, selectRegisterItems, } from "../register.js";
|
|
11
|
-
import { loadRegisterItems, resolveRegisterPaths } from "../../register/register.js";
|
|
12
13
|
import { findExecWorktree, resolveWorktreeBase } from "../worktree.js";
|
|
13
|
-
import { findResumableRegisterRun } from "../register-resume.js";
|
|
14
|
-
import { configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, runCompletionDrivenWorkerPool, } from "./shared.js";
|
|
15
14
|
import { loadRosterForExecutionPath } from "./agent.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
15
|
+
import { execLifecyclePoolPath, execLocksDir } from "./lock.js";
|
|
16
|
+
import { ChangeScopeGate, inferChangeScope, parseUnknownScopePolicy, scopePlanMetadata, } from "./change-scope.js";
|
|
17
|
+
import { applyRegisterDifficultyRouting, isRegisterPipelineRequested, parseRegisterExecutorSelection, resolveRegisterCommand, resolveRegisterPipelineCommand, runSingleRegisterItem, selectedRegisterExecutor, } from "./register-core.js";
|
|
19
18
|
import { resolveRegisterPostReviewAgents } from "./register-post-review.js";
|
|
19
|
+
import { resumeSingleRegisterItemWorktree } from "./register-resume.js";
|
|
20
|
+
import { runSingleRegisterItemWorktree } from "./register-worktree.js";
|
|
21
|
+
import { configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, resolvePinnedRateLimitRunOptions, runCompletionDrivenWorkerPool, } from "./shared.js";
|
|
20
22
|
// register 項目の実行(複数ID)。in-place モードは指定順に1件ずつ直列実行し、各IDが plan/result
|
|
21
23
|
// 生成・start・agent実行・review/waiting 遷移まで完結してから次へ進む。worktree モードは成果物を
|
|
22
24
|
// worktree に隔離し、状態遷移を root で直列化する(--parallel で並列化可能)。失敗時は
|
|
@@ -92,8 +94,8 @@ export async function runRegisterMode(opts) {
|
|
|
92
94
|
}
|
|
93
95
|
: routed;
|
|
94
96
|
};
|
|
95
|
-
// Validate
|
|
96
|
-
// state.
|
|
97
|
+
// Validate every item's effective stages and recovery before creating any worktree or changing
|
|
98
|
+
// register state. CLI overrides can make a routed fallback identical to the primary agent.
|
|
97
99
|
if (!opts.resume) {
|
|
98
100
|
for (const pjrId of ids) {
|
|
99
101
|
const itemOpts = optsForItem(pjrId);
|
|
@@ -101,6 +103,15 @@ export async function runRegisterMode(opts) {
|
|
|
101
103
|
(!itemOpts.executorBy && itemOpts.reporterBy)) {
|
|
102
104
|
throw new Error("--register pipeline execution requires both --executor-by and --reporter-by, either explicitly or from the item's difficulty route.");
|
|
103
105
|
}
|
|
106
|
+
if (itemOpts.executorBy || itemOpts.reporterBy) {
|
|
107
|
+
const agents = resolveRegisterPipelineCommand(roster, itemOpts, execDefaults);
|
|
108
|
+
if (itemOpts.executorBy) {
|
|
109
|
+
resolvePinnedRateLimitRunOptions(itemOpts, execDefaults, roster, "executor", agents.executor);
|
|
110
|
+
}
|
|
111
|
+
if (itemOpts.reporterBy) {
|
|
112
|
+
resolvePinnedRateLimitRunOptions(itemOpts, execDefaults, roster, "reporter", agents.reporterCandidates[0]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
104
115
|
}
|
|
105
116
|
}
|
|
106
117
|
const useWorktree = !!opts.worktree;
|
|
@@ -156,7 +167,7 @@ export async function runRegisterMode(opts) {
|
|
|
156
167
|
process.stdout.write(`[dry-run] actor: ${actor}\n`);
|
|
157
168
|
process.stdout.write(`[dry-run] command: ${command}\n`);
|
|
158
169
|
}
|
|
159
|
-
process.stdout.write(`[dry-run] plan: ${
|
|
170
|
+
process.stdout.write(`[dry-run] plan: ${taskRecordPaths(executionPath, item.id, stem).plan}\n`);
|
|
160
171
|
if (postReviewAgents) {
|
|
161
172
|
process.stdout.write(`[dry-run] post-review executor: ${postReviewAgents.executor.actor}\n`);
|
|
162
173
|
process.stdout.write(`[dry-run] post-review reporter: ${postReviewAgents.reporterCandidates[0]?.actor}\n`);
|
|
@@ -196,9 +207,58 @@ export async function runRegisterMode(opts) {
|
|
|
196
207
|
const summaries = [];
|
|
197
208
|
// 再開は既存 worktree の reporter 段だけを実行する。それ以外の経路(plan 生成・executor 実行)
|
|
198
209
|
// は通らないため、通常実行と同じ並列・直列の枠だけを共有する。
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
const scopeGate = new ChangeScopeGate(executionPath, parseUnknownScopePolicy(opts.unknownScope));
|
|
211
|
+
const runItem = async (pjrId, lifecycleLock) => {
|
|
212
|
+
const { item, registerPaths: paths } = resolveRegisterRunTarget(projectId, pjrId);
|
|
213
|
+
const ticket = ticketPathFromItem(item, paths.projectRegisterPath);
|
|
214
|
+
const planPath = findRunRecord(executionPath, "plan", pjrId);
|
|
215
|
+
const plan = planPath && existsSync(planPath) ? readFileSync(planPath, "utf8") : "";
|
|
216
|
+
const metadata = scopePlanMetadata(plan);
|
|
217
|
+
const scope = inferChangeScope({
|
|
218
|
+
targets: [...new Set([...(item.targets ?? []), ...(metadata.targets ?? [])])],
|
|
219
|
+
approach: item.approach ?? metadata.approach,
|
|
220
|
+
targetPath: item.targetPath,
|
|
221
|
+
text: [ticket && existsSync(ticket) ? readFileSync(ticket, "utf8") : "", plan],
|
|
222
|
+
projectId,
|
|
223
|
+
repoRoot,
|
|
224
|
+
catalogPath: context.catalogPath,
|
|
225
|
+
schedulePath,
|
|
226
|
+
});
|
|
227
|
+
let lease;
|
|
228
|
+
let integrated = false;
|
|
229
|
+
try {
|
|
230
|
+
// Wait outside the lifecycle lock: its holder must be able to integrate and release us.
|
|
231
|
+
lease = await scopeGate.acquire(pjrId, scope);
|
|
232
|
+
const itemOpts = {
|
|
233
|
+
...optsForItem(pjrId),
|
|
234
|
+
changeScopeWaits: lease.waits,
|
|
235
|
+
onScopeIntegrated: async () => {
|
|
236
|
+
integrated = true;
|
|
237
|
+
await lease?.finish(true);
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
const summary = opts.resume
|
|
241
|
+
? await resumeSingleRegisterItemWorktree(context, itemOpts, pjrId, lifecycleLock)
|
|
242
|
+
: await runSingleRegisterItemWorktree(context, itemOpts, pjrId, lifecycleLock);
|
|
243
|
+
integrated ||= summary.outcome === "success";
|
|
244
|
+
return summary;
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
248
|
+
process.stderr.write(`${reason}\n`);
|
|
249
|
+
return {
|
|
250
|
+
id: pjrId,
|
|
251
|
+
title: item.title,
|
|
252
|
+
outcome: "failure",
|
|
253
|
+
transition: "none",
|
|
254
|
+
commit: "off",
|
|
255
|
+
reason,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
finally {
|
|
259
|
+
await lease?.finish(integrated);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
202
262
|
// worktree 実行の root 側の手順(start 遷移・checkpoint・merge・wait commit・派生ビューの
|
|
203
263
|
// 再生成)は、同じ project の別プロセス(--join run)とも重ならないよう、ロックディレクトリの
|
|
204
264
|
// mutex で直列化する。一方の run が root に記帳ファイルを書いている途中で、もう一方の統合が
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
1
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
3
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
3
|
-
import { resolveMemberCommand } from "../agent-config.js";
|
|
4
4
|
import { buildSpecdojoFrontmatter } from "../../docs/frontmatter-namespace.js";
|
|
5
|
+
import { registerWorkTableIssueMessage, registerWorkTableIssues, } from "../../register/work-table.js";
|
|
5
6
|
import { formatMarkdownFile } from "../../shared/markdown-format.js";
|
|
6
7
|
import { expandTemplate } from "../../shared/text.js";
|
|
7
|
-
import {
|
|
8
|
-
import { scaffoldResult, stripLeadingListMarker, updateResultStatus } from "../results.js";
|
|
8
|
+
import { resolveMemberCommand } from "../agent-config.js";
|
|
9
9
|
import { readPipelineState } from "../pipeline-state.js";
|
|
10
|
+
import { execTemplatePath } from "../plans.js";
|
|
10
11
|
import { sanitizeRegisterConclusion } from "../register.js";
|
|
11
|
-
import {
|
|
12
|
+
import { scaffoldResult, stripLeadingListMarker, updateResultStatus } from "../results.js";
|
|
13
|
+
import { runLogPath, taskRecordPaths } from "../run-records.js";
|
|
12
14
|
import { worktreeStatusPaths } from "../worktree-ops.js";
|
|
15
|
+
import { gitOutput } from "../worktree.js";
|
|
13
16
|
import { runAgentPipeline } from "./agent-pipeline.js";
|
|
14
17
|
import { expandPromptRefs } from "./agent.js";
|
|
15
18
|
import { registerReporterManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
@@ -20,7 +23,7 @@ const ACCEPTED_POST_REVIEW_VERDICTS = new Set(["complete", "complete-with-findin
|
|
|
20
23
|
const POST_REVIEW_VERDICTS = new Set(["complete", "complete-with-findings", "incomplete"]);
|
|
21
24
|
const AUTO_CLOSE_REGISTER_TYPES = new Set(["todo", "issue"]);
|
|
22
25
|
export function registerPostReviewDisposition(params) {
|
|
23
|
-
const { itemType, verdict, runnerImplementationChanged = false } = params;
|
|
26
|
+
const { itemType, verdict, runnerImplementationChanged = false, workTableIssue } = params;
|
|
24
27
|
if (verdict === "incomplete" || !verdict) {
|
|
25
28
|
return {
|
|
26
29
|
transition: "waiting",
|
|
@@ -35,6 +38,10 @@ export function registerPostReviewDisposition(params) {
|
|
|
35
38
|
explanation: `review verdict is not accepted: ${verdict}`,
|
|
36
39
|
};
|
|
37
40
|
}
|
|
41
|
+
// 作業内容の表が実績に合っていなければ、review が通っても完了にしない。
|
|
42
|
+
if (workTableIssue) {
|
|
43
|
+
return { transition: "waiting", outcome: "failure", explanation: workTableIssue };
|
|
44
|
+
}
|
|
38
45
|
if (!AUTO_CLOSE_REGISTER_TYPES.has(itemType)) {
|
|
39
46
|
return {
|
|
40
47
|
transition: "review",
|
|
@@ -139,8 +146,7 @@ export async function generateRegisterPostReviewPlan(params) {
|
|
|
139
146
|
const { context, item, stem } = params;
|
|
140
147
|
const taskId = `${item.id}-post-review`;
|
|
141
148
|
const reviewStem = `${stem}-post-review`;
|
|
142
|
-
const planPath =
|
|
143
|
-
const resultPath = join(context.executionPath, "exec", "results", `${reviewStem}-result.md`);
|
|
149
|
+
const { plan: planPath, result: resultPath } = taskRecordPaths(context.executionPath, item.id, reviewStem);
|
|
144
150
|
const templatePath = execTemplatePath("xrp-register-post-run-template.md");
|
|
145
151
|
const frontmatter = buildSpecdojoFrontmatter([
|
|
146
152
|
`id: ${context.projectId}:xrp-${reviewStem}`,
|
|
@@ -300,7 +306,7 @@ export async function runRegisterPostReview(params) {
|
|
|
300
306
|
executor: agents.executor,
|
|
301
307
|
reporterCandidates: agents.reporterCandidates,
|
|
302
308
|
planPath: generated.planPath,
|
|
303
|
-
planPrompt: expandPromptRefs(
|
|
309
|
+
planPrompt: expandPromptRefs(readPlanFile(generated.planPath)),
|
|
304
310
|
resultPath: generated.resultPath,
|
|
305
311
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
306
312
|
execDefaults: reviewExecDefaults,
|
|
@@ -349,10 +355,16 @@ export async function runRegisterPostReview(params) {
|
|
|
349
355
|
await updateResultStatus(generated.resultPath, "complete", new Date().toISOString());
|
|
350
356
|
}
|
|
351
357
|
const runnerImplementationChanged = changesModifyRunningSpecDojo(context.repoRoot, changedPathsBetween(context.repoRoot, params.baseCommit, params.outputCommit));
|
|
358
|
+
const workTableIssues = existsSync(params.ticketPath)
|
|
359
|
+
? registerWorkTableIssues(readFileSync(params.ticketPath, "utf8"))
|
|
360
|
+
: [];
|
|
352
361
|
const disposition = registerPostReviewDisposition({
|
|
353
362
|
itemType: item.type,
|
|
354
363
|
verdict,
|
|
355
364
|
runnerImplementationChanged,
|
|
365
|
+
...(workTableIssues.length > 0
|
|
366
|
+
? { workTableIssue: registerWorkTableIssueMessage(item.id, workTableIssues) }
|
|
367
|
+
: {}),
|
|
356
368
|
});
|
|
357
369
|
const rationale = sanitizeRegisterConclusion(`post-run review verdict ${verdict}: ${reviewRationale(generated.resultPath)}; ${disposition.explanation}`);
|
|
358
370
|
if (disposition.transition === "done") {
|
|
@@ -392,7 +404,7 @@ export async function runRegisterPostReview(params) {
|
|
|
392
404
|
normalized.startsWith(evidencePrefix));
|
|
393
405
|
})
|
|
394
406
|
.map((path) => resolve(context.repoRoot, path));
|
|
395
|
-
const commitFailureLogPath =
|
|
407
|
+
const commitFailureLogPath = runLogPath(reviewStatePath, "post-review-commit.log");
|
|
396
408
|
try {
|
|
397
409
|
commitRegisterState(context.repoRoot, registerPaths, `exec(register ${item.id}): post-review ${verdict}`, params.ticketPath, managed, commitFailureLogPath);
|
|
398
410
|
}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
2
|
+
import { executorStageResumeHint } from "../evidence.js";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
1
6
|
import { loadConfig } from "../../shared/specdojo-config.js";
|
|
7
|
+
import { failedParentValidationReason } from "../parent-validation.js";
|
|
8
|
+
import { integratedRepoNames } from "../pipeline-state.js";
|
|
2
9
|
import { resolveProductBranches } from "../product-branches.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
import { qualifyTaskId } from "../shared.js";
|
|
10
|
+
import { adoptForeignWaitRecords, countForeignCommits, findForeignWaitRecords, } from "../register-foreign-wait.js";
|
|
11
|
+
import { findResumableRegisterRun, resolveRegisterResumeArtifacts, } from "../register-resume.js";
|
|
7
12
|
import { requireRunnableRegisterItem, resolveRegisterRunTarget, sanitizeRegisterConclusion, ticketPathFromItem, } from "../register.js";
|
|
13
|
+
import { syncTaskWorktreesWithIntegrationTargets, } from "../repo-integration.js";
|
|
8
14
|
import { readResultFrontmatterSnapshot } from "../results.js";
|
|
9
|
-
import {
|
|
15
|
+
import { qualifyTaskId } from "../shared.js";
|
|
10
16
|
import { configuredProductRepos, missingProductWorktrees, resumeIntegrationBranches, withProductWorktrees, } from "../task-repos.js";
|
|
11
17
|
import { currentBranch, isExecBranchMergedIntoCurrent } from "../worktree-ops.js";
|
|
12
|
-
import {
|
|
13
|
-
import { failedParentValidationReason } from "../parent-validation.js";
|
|
14
|
-
import { findResumableRegisterRun, resolveRegisterResumeArtifacts, } from "../register-resume.js";
|
|
15
|
-
import { integratedRepoNames } from "../pipeline-state.js";
|
|
16
|
-
import { resolveAgentOverride, resolvePinnedRateLimitRunOptions, rateLimitRecoveryReason, } from "./shared.js";
|
|
17
|
-
import { expandPromptRefs } from "./agent.js";
|
|
18
|
+
import { findExecWorktree } from "../worktree.js";
|
|
18
19
|
import { refreshParentValidationsForReporterResume, runAgentPipeline, runReporterStage, } from "./agent-pipeline.js";
|
|
20
|
+
import { expandPromptRefs } from "./agent.js";
|
|
19
21
|
import { repoRelativePath } from "./mode-shared.js";
|
|
20
|
-
import {
|
|
21
|
-
import { copyRepoPaths,
|
|
22
|
+
import { registerReporterManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
23
|
+
import { copyRepoPaths, overlayRegisterTicketLifecycle, rebuildRootRegisterViews, registerBookkeepingPaths, registerTransitionPaths, } from "./register-state.js";
|
|
22
24
|
import { finalizeRegisterWorktreeRun } from "./register-worktree.js";
|
|
25
|
+
import { isWorktreeCleanupInProgress, worktreeCleanupInProgressReason, } from "../worktree-cleanup-lock.js";
|
|
26
|
+
import { rateLimitRecoveryReason, resolveAgentOverride, resolvePinnedRateLimitRunOptions, } from "./shared.js";
|
|
23
27
|
// reporter 再開に使う agent を解決する。--reporter-by を優先し、省略時は再開対象 run の
|
|
24
28
|
// pipeline-state に記録された reporter actor(通常は前回と同じ agent)へフォールバックする。
|
|
25
29
|
export function resolveRegisterResumeReporter(roster, opts, execDefaults, recordedActor) {
|
|
@@ -78,6 +82,21 @@ export function resolveRegisterResumeExecutor(roster, opts, execDefaults, record
|
|
|
78
82
|
},
|
|
79
83
|
};
|
|
80
84
|
}
|
|
85
|
+
// PJR-EWZG: 再開の前の同期で、項目自身の記帳ファイルの競合は統合先(waiting の記録)を採る。
|
|
86
|
+
// ただし個票は、wait の commit が結果なしでやり直されたり失敗したりして統合先に executor の
|
|
87
|
+
// 本文が無い場合も、exec branch の本文(executor が書いた対応結果など)を保ち、frontmatter の
|
|
88
|
+
// 状態の欄だけを統合先に揃える。
|
|
89
|
+
export function registerResumeConflictPaths(repoRoot, bookkeepingPaths, ticketRelPath) {
|
|
90
|
+
const relPaths = bookkeepingPaths.map((path) => repoRelativePath(repoRoot, path));
|
|
91
|
+
const projectResolvedPaths = new Map();
|
|
92
|
+
if (ticketRelPath) {
|
|
93
|
+
projectResolvedPaths.set(ticketRelPath, (execContent, targetContent) => overlayRegisterTicketLifecycle(execContent, targetContent, ticketRelPath));
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
projectTheirsPaths: relPaths.filter((path) => path !== ticketRelPath),
|
|
97
|
+
projectResolvedPaths,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
81
100
|
// 統合段だけの再開。executor と reporter が成功済みで、commit → merge → worktree 撤去のいずれかが
|
|
82
101
|
// 失敗した run を、agent を1つも起動せずに統合からやり直す。worktree の成果物と evidence をそのまま
|
|
83
102
|
// 使い、成功なら通常実行と同じ review 遷移、merge 前の失敗なら waiting へ戻す。すでに merge
|
|
@@ -120,7 +139,7 @@ export async function resumeRegisterIntegration(params) {
|
|
|
120
139
|
// reporter が記入済みの result をそのまま使う。agent は起動しないため、成果は success 扱いで
|
|
121
140
|
// 統合だけを実行する(result が未記入なら finalize 側の downgrade が blocked に落とす)。
|
|
122
141
|
const resultScaffold = readResultFrontmatterSnapshot(worktreeResultPath);
|
|
123
|
-
|
|
142
|
+
return finalizeRegisterWorktreeRun({
|
|
124
143
|
context: params.context,
|
|
125
144
|
opts: params.opts,
|
|
126
145
|
registerPaths: params.registerPaths,
|
|
@@ -134,11 +153,11 @@ export async function resumeRegisterIntegration(params) {
|
|
|
134
153
|
stderr: validationFailure ?? "",
|
|
135
154
|
...(validationFailure ? { runnerBlockReason: validationFailure } : {}),
|
|
136
155
|
actor,
|
|
137
|
-
bookkeepingPaths: params.bookkeepingPaths
|
|
156
|
+
bookkeepingPaths: params.bookkeepingPaths,
|
|
138
157
|
pipelineStatePath: target.statePath,
|
|
139
158
|
resumedIntegration: true,
|
|
159
|
+
lifecycleLock: params.lifecycleLock,
|
|
140
160
|
});
|
|
141
|
-
return params.lifecycleLock ? params.lifecycleLock.runExclusive(finalize) : finalize();
|
|
142
161
|
}
|
|
143
162
|
// register 項目1件の再開。途中で止まった run を、既存 worktree と evidence を保持したまま
|
|
144
163
|
// 止まった段からやり直す。running のまま残った executor は同じ plan/result と worktree 上で
|
|
@@ -179,6 +198,10 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
179
198
|
if (!foundWorktree) {
|
|
180
199
|
return refuse(`no exec worktree to resume for ${item.id}; run the item again instead`);
|
|
181
200
|
}
|
|
201
|
+
// 前の統合の後の撤去がロックの外で進んでいる間は、同じ worktree を再開しない(PJR-NHT7)。
|
|
202
|
+
if (isWorktreeCleanupInProgress(executionPath, worktreeTaskId)) {
|
|
203
|
+
return refuse(worktreeCleanupInProgressReason(worktreeTaskId));
|
|
204
|
+
}
|
|
182
205
|
const lookup = findResumableRegisterRun({
|
|
183
206
|
repoRoot,
|
|
184
207
|
worktreePath: foundWorktree.path,
|
|
@@ -217,6 +240,35 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
217
240
|
return refuse(`product worktrees are missing for ${item.id}: ${missingProducts.join(", ")}; ` +
|
|
218
241
|
`run the item again instead`);
|
|
219
242
|
}
|
|
243
|
+
// PJR-97KE: job の worktree の中で止まった子の run は、wait の記録が job の branch にしかない。
|
|
244
|
+
// 本体から再開する場合は、register の遷移と agent の起動より前に、その記録を本体へ取り込む。
|
|
245
|
+
const foreignWait = findForeignWaitRecords({ repoRoot, worktree, itemId: item.id });
|
|
246
|
+
if (foreignWait) {
|
|
247
|
+
const adopt = () => {
|
|
248
|
+
try {
|
|
249
|
+
const count = countForeignCommits(repoRoot, foreignWait);
|
|
250
|
+
adoptForeignWaitRecords({
|
|
251
|
+
repoRoot,
|
|
252
|
+
schedulePath,
|
|
253
|
+
itemId: item.id,
|
|
254
|
+
records: foreignWait,
|
|
255
|
+
});
|
|
256
|
+
process.stdout.write(` [resume] merged the wait records of ${item.id} from ${foreignWait.target} ` +
|
|
257
|
+
`(${foreignWait.commit.slice(0, 12)}, ${count} commit(s) not yet in ${currentBranch(repoRoot)})\n`);
|
|
258
|
+
rebuildRootRegisterViews(projectId, item.id);
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
return (`cannot bring the wait records of run ${target.runId} from ${foreignWait.target} ` +
|
|
263
|
+
`into the current branch: ${error instanceof Error ? error.message : String(error)}; ` +
|
|
264
|
+
`resolve it and resume again, resume inside the worktree of ${foreignWait.target}, ` +
|
|
265
|
+
`or discard the run with --force-restart (without --resume)`);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
const adoptFailure = lifecycleLock ? await lifecycleLock.runExclusive(adopt) : adopt();
|
|
269
|
+
if (adoptFailure)
|
|
270
|
+
return refuse(adoptFailure);
|
|
271
|
+
}
|
|
220
272
|
const artifacts = resolveRegisterResumeArtifacts({
|
|
221
273
|
repoRoot,
|
|
222
274
|
worktreePath: worktree.path,
|
|
@@ -225,10 +277,12 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
225
277
|
state: target.state,
|
|
226
278
|
});
|
|
227
279
|
if (!artifacts)
|
|
228
|
-
return refuse(`cannot restore the plan/result of run ${target.runId}`
|
|
280
|
+
return refuse(`cannot restore the plan/result of run ${target.runId}; ` +
|
|
281
|
+
`discard the run with --force-restart (without --resume)`);
|
|
229
282
|
const worktreeResultPath = resolve(worktree.path, artifacts.resultRef);
|
|
230
283
|
if (!existsSync(worktreeResultPath)) {
|
|
231
|
-
return refuse(`result not found in the worktree: ${artifacts.resultRef}`
|
|
284
|
+
return refuse(`result not found in the worktree: ${artifacts.resultRef}; ` +
|
|
285
|
+
`discard the run with --force-restart (without --resume)`);
|
|
232
286
|
}
|
|
233
287
|
// root 側の実行管理ファイル。plan / result は前回の wait commit で統合ブランチに入っている。
|
|
234
288
|
// begin は個票と event を root へ写し、派生ビューを再生成する。その後の差分を拾うため、
|
|
@@ -287,7 +341,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
287
341
|
worktree,
|
|
288
342
|
projectTarget,
|
|
289
343
|
message: `exec(register ${item.id}): merge integration target before resume`,
|
|
290
|
-
|
|
344
|
+
...registerResumeConflictPaths(repoRoot, bookkeepingPaths(), ticketPath ? repoRelativePath(repoRoot, ticketPath) : null),
|
|
291
345
|
integratedProducts: integratedRepoNames(target.state),
|
|
292
346
|
});
|
|
293
347
|
}
|
|
@@ -329,12 +383,18 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
329
383
|
syncedIntegrationTargets,
|
|
330
384
|
});
|
|
331
385
|
}
|
|
332
|
-
// plan
|
|
333
|
-
//
|
|
386
|
+
// plan は原則として root(統合ブランチ)の checkpoint 済みファイルを正本にする。
|
|
387
|
+
// ただし --resume-from executor の再開では、利用者が worktree 内で直した plan を
|
|
388
|
+
// 優先して読み込む。runAgentPipeline へ渡す planPath は plan_ref の計算基準になるため
|
|
389
|
+
// root 側のパスを維持する。
|
|
334
390
|
const planPath = resolve(repoRoot, artifacts.planRef);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
391
|
+
const worktreePlanPath = resolve(worktree.path, artifacts.planRef);
|
|
392
|
+
const promptPlanPath = target.stage === "executor" && existsSync(worktreePlanPath) ? worktreePlanPath : planPath;
|
|
393
|
+
if (!existsSync(promptPlanPath))
|
|
394
|
+
return refuse(`plan not found for the resumed run: ${artifacts.planRef}; merge the branch that holds ` +
|
|
395
|
+
`the wait commit of run ${target.runId} into ${currentBranch(repoRoot)} and resume again, ` +
|
|
396
|
+
`or discard the run with --force-restart (without --resume)`);
|
|
397
|
+
const prompt = expandPromptRefs(readPlanFile(promptPlanPath));
|
|
338
398
|
if (target.stage === "executor") {
|
|
339
399
|
const executor = resolveRegisterResumeExecutor(context.roster, opts, context.execDefaults, target.state.stages.executor.actor);
|
|
340
400
|
if (executor.kind === "error")
|
|
@@ -343,7 +403,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
343
403
|
if (reporter.kind === "error")
|
|
344
404
|
return refuse(reporter.message);
|
|
345
405
|
process.stdout.write(`Register item: ${item.id} — ${item.title} [${item.type}]\n`);
|
|
346
|
-
process.stdout.write(` Resuming executor from run ${target.runId} in
|
|
406
|
+
process.stdout.write(` Resuming executor from run ${target.runId} in the existing run directory\n` +
|
|
347
407
|
` CWD: ${worktree.path}\n Agent: ${executor.candidate.actor} (executor)\n`);
|
|
348
408
|
const beginFailure = await begin(executor.candidate.actor, "executor resumed");
|
|
349
409
|
if (beginFailure)
|
|
@@ -361,8 +421,10 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
361
421
|
planPrompt: prompt,
|
|
362
422
|
resultPath: worktreeResultPath,
|
|
363
423
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
424
|
+
executorResumeHint: executorStageResumeHint({ kind: "register", itemId: item.id }),
|
|
364
425
|
execDefaults: context.execDefaults,
|
|
365
426
|
resumedExecutor: true,
|
|
427
|
+
runId: target.runId,
|
|
366
428
|
initialChangeTargets: target.initialChanges,
|
|
367
429
|
resumeHandoff: target.handoff,
|
|
368
430
|
providerConcurrencyGate: context.providerConcurrencyGate,
|
|
@@ -371,7 +433,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
371
433
|
executorRateLimitOptions: resolvePinnedRateLimitRunOptions(opts, context.execDefaults, context.roster, "executor", executor.candidate),
|
|
372
434
|
reporterRateLimitOptions: resolvePinnedRateLimitRunOptions(opts, context.execDefaults, context.roster, "reporter", reporter.candidate),
|
|
373
435
|
});
|
|
374
|
-
|
|
436
|
+
return finalizeRegisterWorktreeRun({
|
|
375
437
|
context,
|
|
376
438
|
opts,
|
|
377
439
|
registerPaths,
|
|
@@ -385,11 +447,12 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
385
447
|
stderr: outcome.blockReason ?? "",
|
|
386
448
|
runnerBlockReason: outcome.blockReason,
|
|
387
449
|
actor: executor.candidate.actor,
|
|
388
|
-
bookkeepingPaths
|
|
450
|
+
bookkeepingPaths,
|
|
389
451
|
pipelineStatePath: resolve(worktree.path, outcome.stateRef),
|
|
390
452
|
transitionReason: rateLimitRecoveryReason(outcome.rateLimitEvents) || undefined,
|
|
453
|
+
resumedExecutor: true,
|
|
454
|
+
lifecycleLock,
|
|
391
455
|
});
|
|
392
|
-
return lifecycleLock ? lifecycleLock.runExclusive(finalize) : finalize();
|
|
393
456
|
}
|
|
394
457
|
const reporter = resolveRegisterResumeReporter(context.roster, opts, context.execDefaults, target.state.stages.reporter.actor);
|
|
395
458
|
if (reporter.kind === "error")
|
|
@@ -418,6 +481,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
418
481
|
planPrompt: prompt,
|
|
419
482
|
resultPath: worktreeResultPath,
|
|
420
483
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
484
|
+
executorResumeHint: executorStageResumeHint({ kind: "register", itemId: item.id }),
|
|
421
485
|
execDefaults: context.execDefaults,
|
|
422
486
|
evidence,
|
|
423
487
|
evidencePath: resolve(worktree.path, target.evidenceRef),
|
|
@@ -427,7 +491,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
427
491
|
rateLimitOptions: resolvePinnedRateLimitRunOptions(opts, context.execDefaults, context.roster, "reporter", reporter.candidate),
|
|
428
492
|
productWorktrees: worktree.repos,
|
|
429
493
|
});
|
|
430
|
-
|
|
494
|
+
return finalizeRegisterWorktreeRun({
|
|
431
495
|
context,
|
|
432
496
|
opts,
|
|
433
497
|
registerPaths,
|
|
@@ -440,9 +504,9 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
440
504
|
agentResult: outcome.runResult,
|
|
441
505
|
stderr: outcome.blockReason ?? "",
|
|
442
506
|
actor: reporter.candidate.actor,
|
|
443
|
-
bookkeepingPaths
|
|
507
|
+
bookkeepingPaths,
|
|
444
508
|
pipelineStatePath: target.statePath,
|
|
445
509
|
transitionReason: rateLimitRecoveryReason(outcome.state.stages.reporter.rate_limit_events ?? []) || undefined,
|
|
510
|
+
lifecycleLock,
|
|
446
511
|
});
|
|
447
|
-
return lifecycleLock ? lifecycleLock.runExclusive(finalize) : finalize();
|
|
448
512
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
2
1
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
2
|
import { basename, dirname, resolve } from "node:path";
|
|
4
|
-
import { sanitizeRegisterConclusion, } from "../register.js";
|
|
5
3
|
import { applyRegisterItemFields, CELL_NONE, readRegisterItemContent, registerItemFieldsFromItem, } from "../../register/item.js";
|
|
6
|
-
import {
|
|
4
|
+
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
5
|
+
import { sanitizeRegisterConclusion, } from "../register.js";
|
|
6
|
+
import { isRunRecordPath } from "../run-records.js";
|
|
7
7
|
import { abortMerge, currentBranch, normalizeResultWhitespace, releaseRootWorkingCopies, stabilizeCommitTargets, stageCommitTargets, unstageCommitTargets, worktreeStatusPaths, } from "../worktree-ops.js";
|
|
8
|
+
import { appendGitFailureLog, appendGitResultFailureLog, formatGitResultFailure, gitOutput, gitResult, summarizeGitHookFailure, } from "../worktree.js";
|
|
8
9
|
import { pathInsideWorktree } from "./agent.js";
|
|
9
10
|
import { repoRelativePath } from "./mode-shared.js";
|
|
10
|
-
import {
|
|
11
|
+
import { registerEventPathForTicket, registerRunnerManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
11
12
|
// register の状態遷移(start/review/wait)が変更した調整状態(pjr-index と派生ビュー)だけを
|
|
12
13
|
// 抽出する。worktree モードでは成功時の遷移を exec branch、失敗時の wait を root で commit
|
|
13
14
|
// する。plan/result は checkpoint と worktree merge が扱うため、ここでは含めない。
|
|
@@ -102,7 +103,20 @@ export function copyRepoPaths(sourceRoot, targetRoot, repoRoot, paths) {
|
|
|
102
103
|
// event は agent が編集した未検証の本文を含みうるため、root に残してある checkpoint 版を
|
|
103
104
|
// wait 遷移の入力にする。派生ビューは遷移後に root で再生成する。
|
|
104
105
|
export function registerFailureArtifactPaths(repoRoot, paths) {
|
|
105
|
-
return paths.filter((path) => /(?:^|\/)exec\/(?:plans|results)\//.test(repoRelativePath(repoRoot, path))
|
|
106
|
+
return paths.filter((path) => /(?:^|\/)exec\/(?:plans|results)\//.test(repoRelativePath(repoRoot, path)) ||
|
|
107
|
+
isRunRecordPath(path));
|
|
108
|
+
}
|
|
109
|
+
// 個票の本文(executor が書いた対応結果など)は bodyContent を保ち、frontmatter の状態の欄
|
|
110
|
+
// (登録簿の項目の欄と block_reason)だけを lifecycleContent の値へ揃える。lifecycleContent を
|
|
111
|
+
// 解析できない場合は例外を投げる。
|
|
112
|
+
export function overlayRegisterTicketLifecycle(bodyContent, lifecycleContent, ticketRelPath) {
|
|
113
|
+
const parsed = readRegisterItemContent(lifecycleContent, basename(ticketRelPath));
|
|
114
|
+
if (!parsed)
|
|
115
|
+
throw new Error(`could not parse register item: ${ticketRelPath}`);
|
|
116
|
+
return applyRegisterItemFields(bodyContent, {
|
|
117
|
+
...registerItemFieldsFromItem(parsed.item),
|
|
118
|
+
block_reason: parsed.blockReason === CELL_NONE ? null : parsed.blockReason,
|
|
119
|
+
});
|
|
106
120
|
}
|
|
107
121
|
// wait commit の個票は検証済みの root 本文を使う一方、exec branch には agent が編集した本文を
|
|
108
122
|
// 残す。root の frontmatter から lifecycle フィールドだけを重ね、resume 後も waiting 状態と
|
|
@@ -119,14 +133,7 @@ export function restorePreservedRegisterTicket(worktreePath, repoRoot, preserved
|
|
|
119
133
|
return;
|
|
120
134
|
}
|
|
121
135
|
try {
|
|
122
|
-
const
|
|
123
|
-
const parsed = readRegisterItemContent(rootContent, basename(rel));
|
|
124
|
-
if (!parsed)
|
|
125
|
-
throw new Error(`could not parse register item: ${rel}`);
|
|
126
|
-
const content = applyRegisterItemFields(preserved.content, {
|
|
127
|
-
...registerItemFieldsFromItem(parsed.item),
|
|
128
|
-
block_reason: parsed.blockReason === CELL_NONE ? null : parsed.blockReason,
|
|
129
|
-
});
|
|
136
|
+
const content = overlayRegisterTicketLifecycle(preserved.content, readFileSync(rootTicketPath, "utf8"), rel);
|
|
130
137
|
mkdirSync(dirname(worktreeTicketPath), { recursive: true });
|
|
131
138
|
writeFileSync(worktreeTicketPath, content, "utf8");
|
|
132
139
|
}
|
|
@@ -176,7 +183,7 @@ export function rebuildRootRegisterViews(projectId, itemId) {
|
|
|
176
183
|
// worktree が無い(checkpoint 前の失敗)場合は root の実行管理ファイルをそのまま commit する。
|
|
177
184
|
export function registerWaitSummary(params) {
|
|
178
185
|
const { repoRoot, projectId, registerPaths, item, ticketPath, actor, worktree } = params;
|
|
179
|
-
const blockReason = sanitizeRegisterConclusion(params.reason);
|
|
186
|
+
const blockReason = sanitizeRegisterConclusion(params.reason, params.reasonMaxLength);
|
|
180
187
|
const bookkeepingPaths = [...params.bookkeepingPaths];
|
|
181
188
|
const preservedTicketPath = worktree && ticketPath ? pathInsideWorktree(repoRoot, worktree.path, ticketPath) : undefined;
|
|
182
189
|
const preservedTicket = ticketPath && preservedTicketPath && existsSync(preservedTicketPath)
|
|
@@ -259,7 +266,8 @@ export function commitRegisterWaitState(params) {
|
|
|
259
266
|
}
|
|
260
267
|
}
|
|
261
268
|
export function isRegisterResultPath(repoRoot, path) {
|
|
262
|
-
return /\/exec\/results\/[^/]+-result\.md$/.test(repoRelativePath(repoRoot, path))
|
|
269
|
+
return (/\/exec\/results\/[^/]+-result\.md$/.test(repoRelativePath(repoRoot, path)) ||
|
|
270
|
+
(isRunRecordPath(path) && path.endsWith("/result.md")));
|
|
263
271
|
}
|
|
264
272
|
// wait commit と、その時点までに統合先へ入った変更を exec branch へ通常 merge する。
|
|
265
273
|
// worktree の記帳パスには、root へ複製した blocked result などが未 commit のまま残っている。
|