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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function isRecord(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function records(value) {
|
|
5
|
+
return Array.isArray(value) ? value.filter(isRecord) : [];
|
|
6
|
+
}
|
|
7
|
+
export function code(value) {
|
|
8
|
+
const runs = value.match(/`+/g) ?? [];
|
|
9
|
+
const fence = "`".repeat(Math.max(1, ...runs.map((run) => run.length + 1)));
|
|
10
|
+
return `${fence} ${value} ${fence}`.replace(/^` ([^`]+) `$/, "`$1`");
|
|
11
|
+
}
|
|
12
|
+
// Markdown の参照とコードを保ち、YAML に含まれるパスのプレースホルダを HTML として解釈させない。
|
|
13
|
+
function text(value) {
|
|
14
|
+
return value
|
|
15
|
+
.split(/(`+[^`]*`+|\[\[[^\]]+\]\]|\[[^\]]*\]\([^)]*\)|https?:\/\/[^\s<>]+)/g)
|
|
16
|
+
.map((part, index) => {
|
|
17
|
+
if (index % 2 === 1)
|
|
18
|
+
return /^https?:/.test(part) ? `<${part}>` : part;
|
|
19
|
+
return part
|
|
20
|
+
.replace(/&/g, "&")
|
|
21
|
+
.replace(/</g, "<")
|
|
22
|
+
.replace(/>/g, ">")
|
|
23
|
+
.replace(/\b[a-zA-Z0-9]+(?:_[a-zA-Z0-9]+)+\b/g, (identifier) => code(identifier));
|
|
24
|
+
})
|
|
25
|
+
.join("");
|
|
26
|
+
}
|
|
27
|
+
export function valueText(value) {
|
|
28
|
+
if (value === undefined || value === null || value === "")
|
|
29
|
+
return "-";
|
|
30
|
+
if (value instanceof Date)
|
|
31
|
+
return value.toISOString().slice(0, 10);
|
|
32
|
+
if (Array.isArray(value))
|
|
33
|
+
return value.length ? value.map(valueText).join(" / ") : "-";
|
|
34
|
+
if (isRecord(value)) {
|
|
35
|
+
return (Object.entries(value)
|
|
36
|
+
.map(([key, entry]) => `${code(key)}: ${valueText(entry)}`)
|
|
37
|
+
.join(" / ") || "-");
|
|
38
|
+
}
|
|
39
|
+
return text(String(value));
|
|
40
|
+
}
|
|
41
|
+
export function cell(value) {
|
|
42
|
+
return value
|
|
43
|
+
.replace(/\s*[\r\n]+\s*/g, " ")
|
|
44
|
+
.replace(/(\\*)\|/g, (_match, slashes) => `${slashes}${slashes.length % 2 === 0 ? "\\" : ""}|`);
|
|
45
|
+
}
|
|
46
|
+
export function table(headers, rows) {
|
|
47
|
+
return [
|
|
48
|
+
"<!-- prettier-ignore -->",
|
|
49
|
+
`| ${headers.join(" | ")} |`,
|
|
50
|
+
`| ${headers.map(() => "---").join(" | ")} |`,
|
|
51
|
+
...rows.map((row) => `| ${row.map((entry) => cell(entry) || "-").join(" | ")} |`),
|
|
52
|
+
].join("\n");
|
|
53
|
+
}
|
|
54
|
+
export function recordTable(items, columns) {
|
|
55
|
+
return table(columns.map(([, label]) => label), items.map((item) => columns.map(([key]) => valueText(item[key]))));
|
|
56
|
+
}
|
|
57
|
+
export function properties(value, columns) {
|
|
58
|
+
const entries = isRecord(value) ? value : {};
|
|
59
|
+
const selected = columns ?? Object.keys(entries).map((key) => [key, code(key)]);
|
|
60
|
+
return table(["項目", "内容"], selected.map(([key, label]) => [label, valueText(entries[key])]));
|
|
61
|
+
}
|
|
62
|
+
export class TableBody {
|
|
63
|
+
sections = [];
|
|
64
|
+
section(title, body) {
|
|
65
|
+
this.sections.push(`## ${this.sections.length + 1}. ${title}\n\n${body}`);
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return [...this.sections, `## ${this.sections.length + 1}. YAML の正本\n`].join("\n\n");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import { isRecord } from "./yaml-table-shared.js";
|
|
3
|
+
import { renderBdd, renderDct, renderDctIndex, renderMembers, renderMilestones, renderRoles, renderTimeline, renderViewpoints, } from "./yaml-business-tables.js";
|
|
4
|
+
import { renderCommand, renderFileInterface } from "./yaml-interface-tables.js";
|
|
5
|
+
// type とファイル系列の両方で限定し、template・schema・grade 記録などを巻き込まない。
|
|
6
|
+
export function renderTypedYamlTable(path, parsed) {
|
|
7
|
+
if (!isRecord(parsed) || /\/(?:templates|schemas|execution|jobs|routines)\//.test(path))
|
|
8
|
+
return undefined;
|
|
9
|
+
const name = posix.basename(path).replace(/\.ya?ml$/, "");
|
|
10
|
+
if (parsed.type === "template" || parsed.openapi || parsed.asyncapi)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (/^bdd-/.test(name) && parsed.type === "data" && Array.isArray(parsed.entities))
|
|
13
|
+
return renderBdd(parsed);
|
|
14
|
+
if (parsed.type === "project") {
|
|
15
|
+
if (/^pm-roles(?:-|$)/.test(name) && Array.isArray(parsed.roles))
|
|
16
|
+
return renderRoles(parsed);
|
|
17
|
+
if (/^pm-members(?:-|$)/.test(name) && Array.isArray(parsed.members))
|
|
18
|
+
return renderMembers(parsed);
|
|
19
|
+
if (/^tml-/.test(name) && Array.isArray(parsed.tracks))
|
|
20
|
+
return renderTimeline(parsed);
|
|
21
|
+
if (name === "sch-milestones" &&
|
|
22
|
+
parsed.kind === "milestones" &&
|
|
23
|
+
Array.isArray(parsed.milestones))
|
|
24
|
+
return renderMilestones(parsed);
|
|
25
|
+
if (/^dct-index(?:-|$)/.test(name) && Array.isArray(parsed.groups))
|
|
26
|
+
return renderDctIndex(parsed);
|
|
27
|
+
if (/^dct-/.test(name) && typeof parsed.domain === "string" && Array.isArray(parsed.groups))
|
|
28
|
+
return renderDct(parsed);
|
|
29
|
+
}
|
|
30
|
+
if (/^pm-review-viewpoints(?:-|$)/.test(name) &&
|
|
31
|
+
["project", "standard"].includes(String(parsed.type)))
|
|
32
|
+
return renderViewpoints(parsed);
|
|
33
|
+
if (/^ifx-cmd-/.test(name) && parsed.type === "api" && isRecord(parsed.command))
|
|
34
|
+
return renderCommand(parsed);
|
|
35
|
+
const meta = isRecord(parsed["x-spec-meta"]) ? parsed["x-spec-meta"] : parsed;
|
|
36
|
+
if (/^ifx-file-/.test(name) && meta.type === "api" && Array.isArray(parsed.files))
|
|
37
|
+
return renderFileInterface(parsed);
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
@@ -4,6 +4,9 @@ import { listFilesRecursive, readYaml } from "./shared.js";
|
|
|
4
4
|
import { acquirePoolSlot, releaseLock } from "./slot-lock.js";
|
|
5
5
|
import { getProjectExecutionPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
6
6
|
import { resolveParentValidationConcurrency, resolveParentValidationAssignments, resolveParentValidationDefinitions, } from "./parent-validation.js";
|
|
7
|
+
import { resolveCommitHookSkips } from "./commit-hook-skips.js";
|
|
8
|
+
import { configureIndexLockWait, DEFAULT_INDEX_LOCK_WAIT_MS } from "../shared/git.js";
|
|
9
|
+
import { resolvePostIntegrationEntries } from "./post-integration.js";
|
|
7
10
|
const PLACEHOLDER_PATTERN = /\{([a-z][a-z0-9_]*)\}/g;
|
|
8
11
|
const BUILTIN_VARIABLE_NAMES = new Set(["nickname", "mode", "proficiency"]);
|
|
9
12
|
// Mirror of the nickname pattern in docs/specdojo/schemas/v1/agent-members.schema.yaml.
|
|
@@ -64,6 +67,13 @@ function buildCommandVariables(provider, member, params) {
|
|
|
64
67
|
// not runnable by exec run). Throws when a template exists but cannot be fully expanded,
|
|
65
68
|
// so a broken definition surfaces as an error instead of launching a malformed command.
|
|
66
69
|
export function resolveMemberCommand(config, member) {
|
|
70
|
+
// Require provider opt-in even for an explicit member command: otherwise a frontier
|
|
71
|
+
// member could silently inherit ordinary defaults or bypass the missing-tier error.
|
|
72
|
+
if (member.proficiency === "frontier" &&
|
|
73
|
+
(!member.provider ||
|
|
74
|
+
!config.providers?.[member.provider]?.command_params?.by_proficiency?.frontier)) {
|
|
75
|
+
throw new Error(`Cannot launch frontier member ${member.nickname}: configure providers.${member.provider ?? "<provider>"}.command_params.by_proficiency.frontier in exec-defaults.yaml (use {} if no extra variables are needed)`);
|
|
76
|
+
}
|
|
67
77
|
const override = member.command?.trim();
|
|
68
78
|
if (override)
|
|
69
79
|
return override;
|
|
@@ -176,6 +186,18 @@ export function resolveRegisterPostReview(config) {
|
|
|
176
186
|
}
|
|
177
187
|
return raw;
|
|
178
188
|
}
|
|
189
|
+
export const DEFAULT_GIT_INDEX_LOCK_WAIT_SECONDS = DEFAULT_INDEX_LOCK_WAIT_MS / 1000;
|
|
190
|
+
// How long the runner's Git operations wait for another process to release index.lock. Invalid
|
|
191
|
+
// values are rejected so a typo cannot turn the wait off or make it unbounded.
|
|
192
|
+
export function resolveGitIndexLockWaitSeconds(config) {
|
|
193
|
+
const raw = config.run?.git_index_lock_wait_seconds;
|
|
194
|
+
if (raw === undefined)
|
|
195
|
+
return DEFAULT_GIT_INDEX_LOCK_WAIT_SECONDS;
|
|
196
|
+
if (typeof raw !== "number" || !Number.isInteger(raw) || raw < 0) {
|
|
197
|
+
throw new Error(`run.git_index_lock_wait_seconds in exec-defaults must be a non-negative integer: ${String(raw)}`);
|
|
198
|
+
}
|
|
199
|
+
return raw;
|
|
200
|
+
}
|
|
179
201
|
// Resolve how many `exec run` processes may run at once for one project. Invalid values fall back
|
|
180
202
|
// to the default so a typo cannot silently disable the busy guard.
|
|
181
203
|
export function resolveMaxConcurrentRuns(config) {
|
|
@@ -357,8 +379,17 @@ export function loadExecDefaultsConfig(configPath, executionPath) {
|
|
|
357
379
|
};
|
|
358
380
|
}
|
|
359
381
|
resolveParentValidationDefinitions(defaults.pipeline?.parent_validations);
|
|
382
|
+
resolvePostIntegrationEntries(defaults.pipeline?.post_integration);
|
|
360
383
|
resolveParentValidationConcurrency(defaults.pipeline?.parent_validation_concurrency);
|
|
384
|
+
resolveCommitHookSkips(defaults.pipeline?.commit_hook_skips, defaults.pipeline?.parent_validations);
|
|
385
|
+
if (defaults.pipeline?.mechanical_result !== undefined &&
|
|
386
|
+
typeof defaults.pipeline.mechanical_result !== "boolean") {
|
|
387
|
+
throw new Error("pipeline.mechanical_result in exec-defaults must be a boolean");
|
|
388
|
+
}
|
|
361
389
|
resolveRegisterExecution(defaults);
|
|
390
|
+
// 統合・記帳の git 操作は src/shared/git.ts の gitResult を通るため、読み込んだ設定を
|
|
391
|
+
// この process の index.lock の待ち時間として反映する(PJR-964D)。
|
|
392
|
+
configureIndexLockWait(resolveGitIndexLockWaitSeconds(defaults) * 1000);
|
|
362
393
|
resolvePinnedRateLimitPolicy(defaults);
|
|
363
394
|
for (const provider of Object.keys(defaults.providers ?? {})) {
|
|
364
395
|
if (defaults.providers?.[provider]?.rate_limit_policy) {
|
package/dist/exec/agent-plan.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { existsSync, mkdirSync,
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { readPlanFile } from "../shared/plan-conventions.js";
|
|
2
3
|
import { dirname, resolve } from "node:path";
|
|
3
4
|
import { defaultExecDefaultsPath, loadExecDefaultsConfig, resolveMemberCommand, resolveRateLimitDetection, resolveRateLimitPolicy, } from "./agent-config.js";
|
|
4
5
|
import { resolveProjectPaths } from "./project.js";
|
|
@@ -70,7 +71,7 @@ export function readAgentPlan(planPath) {
|
|
|
70
71
|
if (!existsSync(absolutePath)) {
|
|
71
72
|
throw new Error(`--plan not found: ${planPath}`);
|
|
72
73
|
}
|
|
73
|
-
const prompt =
|
|
74
|
+
const prompt = readPlanFile(absolutePath);
|
|
74
75
|
if (!prompt.trim()) {
|
|
75
76
|
throw new Error(`--plan is empty: ${planPath}`);
|
|
76
77
|
}
|
|
@@ -51,6 +51,8 @@ const SNAPSHOT_DIRECTORY_ROOTS = [
|
|
|
51
51
|
// 保護対象ディレクトリの配下にあるが、設定ではなく再生成可能な既知の生成物。
|
|
52
52
|
// 任意の gitignore 対象を除外すると、agent が .gitignore と新規設定を同時に作ることで
|
|
53
53
|
// ガードをすり抜けられるため、生成物として用途が確定しているパスだけを列挙する。
|
|
54
|
+
// `.specdojo/specdojo.local.config.json`(PJR-NC9R)は gitignore 済みでも設定であり、repos の
|
|
55
|
+
// 差し替え・追加で commit の許可範囲を変えるため、ここに含めず `.specdojo/` の保護対象に残す。
|
|
54
56
|
// `.opencode/` の 4 件は opencode が起動時に作る実行時生成物で、親 runner / hook / CI の
|
|
55
57
|
// 実行内容を変えない。指示ファイル(`.opencode/AGENTS.md`、`.opencode/agents/**`)は
|
|
56
58
|
// ここに含めず、保護対象のままにする。
|
package/dist/exec/commands.js
CHANGED
|
@@ -1,26 +1,57 @@
|
|
|
1
|
+
import { registerDeprecatedWhereAlias } from "../shared/where-alias.js";
|
|
2
|
+
import { Option } from "commander";
|
|
1
3
|
import { existsSync } from "node:fs";
|
|
2
4
|
import { join, resolve as pathResolve } from "node:path";
|
|
3
5
|
import { validateCatalogLocalIds, validateRulebookKata } from "../catalog/build.js";
|
|
4
|
-
import {
|
|
5
|
-
import { eventsDirForProject, generatedDirForProject } from "./project.js";
|
|
6
|
-
import { assertValidActor, getProjectViewpointsPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
7
|
-
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, selectNextTask, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
8
|
-
import { readReadySnapshot } from "./schedule/ready.js";
|
|
9
|
-
import { displayWidth, nowUtcIsoSeconds, padEndDisplay, requireNonEmpty } from "./shared.js";
|
|
10
|
-
import { archivePlan, buildInPlaceStem, generateDeliverablePlan, generateSinglePlan, resolveDeliverableTarget, stemFromPlanPath, } from "./plans.js";
|
|
6
|
+
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
11
7
|
import { runProviderScaffold, specdojoPackageRootDir } from "../shared/provider-scaffold.js";
|
|
8
|
+
import { assertValidActor, getProjectViewpointsPath, getProjectRoutinesPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
9
|
+
import { formatLocalConfigLines } from "../shared/local-config.js";
|
|
10
|
+
import { DEFAULT_EVENT_MESSAGES, KNOWN_OWNER_LABELS, KNOWN_OWNER_LABELS_TEXT, addCommonAddOptions, addForceOption, addLockOptions, addOwnerOptions, addProjectOptions, addTakeOverOption, ensureActorCanClaimNext, findRosterMember, loadRosterForOpts, loadValidatedExecState, parseApproach, parseTaskMode, printCommandError, resolveClaimOwner, resolveForceOverride, resolveProjectContext, resolveProjectId, resolveSchedulerStrategy, runLockedEventCommand, runReleaseAllBlocked, runSimpleEventCommand, scaffoldClaimResult, } from "./core.js";
|
|
11
|
+
import { acquireSchedulerLock, canBlockTask, canCancelTask, canClaimTask, canCompleteTask, canReleaseTask, canReopenTask, canUnblockTask, claimOwnerOf, computeReadyIds, readAllEventFiles, releaseSchedulerLock, schedulerLockPath, writeEventFile, } from "./events.js";
|
|
12
|
+
import { registerExecHandoffCommands } from "./handoff.js";
|
|
13
|
+
import { registerRecordMigrationCommand } from "./migrate-records.js";
|
|
14
|
+
import { archivePlan, buildInPlaceStem, generateDeliverablePlan, generateSinglePlan, resolveDeliverableTarget, stemFromPlanPath, } from "./plans.js";
|
|
15
|
+
import { eventsDirForProject, generatedDirForProject } from "./project.js";
|
|
12
16
|
import { generateRegisterPlan, normalizePjrId, resolveRegisterRunTarget } from "./register.js";
|
|
13
|
-
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
14
17
|
import { registerCycleCommand, registerResumeCommand, registerRunCommand, registerSlotsCommand, } from "./run/run.js";
|
|
18
|
+
import { readReadySnapshot } from "./schedule/ready.js";
|
|
19
|
+
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, selectNextTask, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
20
|
+
import { displayWidth, nowUtcIsoSeconds, padEndDisplay, requireNonEmpty } from "./shared.js";
|
|
21
|
+
import { resolveOwnerForLocalId } from "./strategy.js";
|
|
15
22
|
import { buildTaskView } from "./task-view.js";
|
|
16
|
-
import { registerExecWorktreeCommands } from "./worktree-command.js";
|
|
17
23
|
import { registerExecTrialCommands } from "./trial.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
24
|
+
import { registerExecSmokeCommand } from "./smoke.js";
|
|
25
|
+
import { registerExecQueueCommands, writeActiveQueueSummary } from "./queue-command.js";
|
|
26
|
+
import { registerExecWorktreeCommands } from "./worktree-command.js";
|
|
27
|
+
import { validateRunRecordLayout } from "./validate-records.js";
|
|
28
|
+
import { validateRunRecordLayoutAtCommit } from "./validate-records-commit.js";
|
|
29
|
+
export function printExecPaths(opts) {
|
|
30
|
+
try {
|
|
31
|
+
const resolvedPaths = resolveProjectContext(opts);
|
|
32
|
+
process.stdout.write(`schedule-path: ${resolvedPaths.schedulePath}\n`);
|
|
33
|
+
process.stdout.write(`execution-path: ${resolvedPaths.executionPath}\n`);
|
|
34
|
+
const projectPath = resolvedPaths.schedulePath;
|
|
35
|
+
process.stdout.write(`exec/events : ${eventsDirForProject(projectPath)}\n`);
|
|
36
|
+
process.stdout.write(`generated : ${generatedDirForProject(projectPath)}\n`);
|
|
37
|
+
process.stdout.write(`scheduler-lock: ${schedulerLockPath(projectPath)}\n`);
|
|
38
|
+
// Only with a local config, so the output stays unchanged for checkouts without one.
|
|
39
|
+
const loaded = loadConfig();
|
|
40
|
+
if (loaded.localConfigPath) {
|
|
41
|
+
const lines = formatLocalConfigLines(loaded, resolveProjectId(opts));
|
|
42
|
+
process.stdout.write(lines.map((line) => `${line}\n`).join(""));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
printCommandError(error, false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
21
49
|
export function registerExecCommands(program) {
|
|
22
50
|
const exec = program.command("exec").description("Execution helpers");
|
|
23
51
|
registerExecHandoffCommands(exec);
|
|
52
|
+
registerRecordMigrationCommand(exec);
|
|
53
|
+
registerExecSmokeCommand(exec);
|
|
54
|
+
registerExecQueueCommands(exec);
|
|
24
55
|
const lockedActions = {
|
|
25
56
|
claim: {
|
|
26
57
|
type: "claim",
|
|
@@ -44,7 +75,10 @@ export function registerExecCommands(program) {
|
|
|
44
75
|
},
|
|
45
76
|
unblock: {
|
|
46
77
|
type: "unblock",
|
|
47
|
-
check: ({ schedule, snapshot }, taskId) => canUnblockTask(schedule, snapshot, taskId
|
|
78
|
+
check: ({ schedule, snapshot }, taskId, actor, opts) => canUnblockTask(schedule, snapshot, taskId, {
|
|
79
|
+
requested: !!opts.takeOver,
|
|
80
|
+
isHuman: findRosterMember(loadRosterForOpts(opts), actor)?.type === "human",
|
|
81
|
+
}),
|
|
48
82
|
},
|
|
49
83
|
release: {
|
|
50
84
|
type: "release",
|
|
@@ -79,6 +113,8 @@ export function registerExecCommands(program) {
|
|
|
79
113
|
addOwnerOptions(cmd);
|
|
80
114
|
if (t === "complete" || t === "block" || t === "release")
|
|
81
115
|
addForceOption(cmd);
|
|
116
|
+
if (t === "unblock")
|
|
117
|
+
addTakeOverOption(cmd);
|
|
82
118
|
if (t === "release") {
|
|
83
119
|
cmd.option("--reset-worktree", "Discard the task's exec worktree and branch after releasing (force removal)", false);
|
|
84
120
|
cmd.option("--all-blocked", "Release every blocked task in the project back to todo (ignores --task)", false);
|
|
@@ -97,13 +133,53 @@ export function registerExecCommands(program) {
|
|
|
97
133
|
cmd.action((opts) => runSimpleEventCommand(opts, t));
|
|
98
134
|
}
|
|
99
135
|
}
|
|
100
|
-
const vcmd = exec
|
|
136
|
+
const vcmd = exec
|
|
137
|
+
.command("validate")
|
|
138
|
+
.description("Validate schedule, events and run record layout");
|
|
101
139
|
addProjectOptions(vcmd);
|
|
140
|
+
vcmd.option("--records-only", "Check only run record layout and runtime lock exclusion", false);
|
|
141
|
+
vcmd.addOption(new Option("--schedule-only", "Check only schedule and events (used before running tasks)")
|
|
142
|
+
.default(false)
|
|
143
|
+
.conflicts("recordsOnly"));
|
|
144
|
+
vcmd.option("--commit <rev>", "With --records-only, check the run records in the tree of <rev> instead of the working tree");
|
|
102
145
|
vcmd.action((opts) => {
|
|
103
146
|
try {
|
|
104
|
-
const { schedulePath, catalogPath } = resolveProjectContext(opts);
|
|
147
|
+
const { schedulePath, catalogPath, executionPath } = resolveProjectContext(opts);
|
|
148
|
+
const { config } = loadConfig();
|
|
149
|
+
const project = config?.projects[resolveProjectId(opts)];
|
|
150
|
+
const routinesPath = project && getProjectRoutinesPath(project);
|
|
151
|
+
if (opts.commit !== undefined && !opts.recordsOnly)
|
|
152
|
+
throw new Error("--commit requires --records-only");
|
|
153
|
+
const layoutOptions = {
|
|
154
|
+
executionPath,
|
|
155
|
+
repoRoot: specdojoRootDir(),
|
|
156
|
+
...(routinesPath ? { routinesPath: pathResolve(specdojoRootDir(), routinesPath) } : {}),
|
|
157
|
+
};
|
|
158
|
+
const layoutIssues = opts.scheduleOnly
|
|
159
|
+
? []
|
|
160
|
+
: typeof opts.commit === "string"
|
|
161
|
+
? validateRunRecordLayoutAtCommit({ ...layoutOptions, commit: opts.commit })
|
|
162
|
+
: validateRunRecordLayout(layoutOptions);
|
|
163
|
+
if (opts.recordsOnly) {
|
|
164
|
+
for (const issue of layoutIssues)
|
|
165
|
+
process.stdout.write(`ERROR: ${issue.path}: [${issue.reason}] ${issue.message}\n`);
|
|
166
|
+
if (!layoutIssues.length)
|
|
167
|
+
process.stdout.write(`OK: run record layout validation passed${typeof opts.commit === "string" ? ` (${opts.commit})` : ""}\n`);
|
|
168
|
+
exitWithCode(layoutIssues.length === 0);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
105
171
|
const res = validateAll(schedulePath);
|
|
172
|
+
for (const issue of layoutIssues) {
|
|
173
|
+
const message = `${issue.path}: [${issue.reason}] ${issue.message}`;
|
|
174
|
+
if (issue.reason !== "missing")
|
|
175
|
+
res.errors.push(message);
|
|
176
|
+
}
|
|
177
|
+
res.ok = res.errors.length === 0;
|
|
106
178
|
printValidateResult(res);
|
|
179
|
+
for (const issue of layoutIssues) {
|
|
180
|
+
if (issue.reason === "missing")
|
|
181
|
+
process.stdout.write(`WARN: ${issue.path}: [${issue.reason}] ${issue.message}\n`);
|
|
182
|
+
}
|
|
107
183
|
// Scheduled tasks resolve their deliverable by bare local_id, so warn when a
|
|
108
184
|
// local_id is not unique project-wide across the catalogs.
|
|
109
185
|
if (catalogPath && existsSync(catalogPath)) {
|
|
@@ -239,12 +315,12 @@ export function registerExecCommands(program) {
|
|
|
239
315
|
});
|
|
240
316
|
const archiveCmd = exec
|
|
241
317
|
.command("archive")
|
|
242
|
-
.description("
|
|
318
|
+
.description("Keep a completed run plan in its run directory, or delete it");
|
|
243
319
|
addProjectOptions(archiveCmd);
|
|
244
320
|
archiveCmd.option("--task <taskId>", "Scheduled task ID whose plan to archive");
|
|
245
321
|
archiveCmd.option("--deliverable <localId>", "Catalog deliverable local_id (unique project-wide)");
|
|
246
322
|
archiveCmd.option("--plan <path>", "Plan file to archive (for unique-named in-place plans)");
|
|
247
|
-
archiveCmd.option("--delete", "Delete the plan instead of
|
|
323
|
+
archiveCmd.option("--delete", "Delete the plan instead of retaining it", false);
|
|
248
324
|
archiveCmd.action((opts) => {
|
|
249
325
|
try {
|
|
250
326
|
const { executionPath, catalogPath } = resolveProjectContext(opts);
|
|
@@ -254,8 +330,6 @@ export function registerExecCommands(program) {
|
|
|
254
330
|
if ([hasTask, hasDeliverable, hasPlan].filter(Boolean).length !== 1) {
|
|
255
331
|
throw new Error("Specify exactly one of --task, --deliverable, or --plan.");
|
|
256
332
|
}
|
|
257
|
-
// `archivePlan` rebuilds `<slug>-plan.md`; for --plan the stem recovered from the filename
|
|
258
|
-
// is that slug, so a unique-named in-place plan archives to done/ like a fixed-name one.
|
|
259
333
|
const slug = hasPlan
|
|
260
334
|
? stemFromPlanPath(opts.plan.trim())
|
|
261
335
|
: hasTask
|
|
@@ -270,7 +344,7 @@ export function registerExecCommands(program) {
|
|
|
270
344
|
}
|
|
271
345
|
});
|
|
272
346
|
const scmd = exec
|
|
273
|
-
.command("scheduler")
|
|
347
|
+
.command("scheduler", { hidden: true })
|
|
274
348
|
.description("Auto-claim next task safely (with project-level lock).");
|
|
275
349
|
addProjectOptions(scmd);
|
|
276
350
|
scmd.requiredOption("--by <actor>", "Actor (agent name)");
|
|
@@ -497,7 +571,7 @@ export function registerExecCommands(program) {
|
|
|
497
571
|
statusCmd.option("--state <state>", "Filter by state: todo|doing|blocked|done|cancelled (default: doing)", "doing");
|
|
498
572
|
statusCmd.action((opts) => {
|
|
499
573
|
try {
|
|
500
|
-
const { schedulePath } = resolveProjectContext(opts);
|
|
574
|
+
const { schedulePath, executionPath } = resolveProjectContext(opts);
|
|
501
575
|
// Compute state directly from events (not from cached state.json)
|
|
502
576
|
const state = loadValidatedExecState(schedulePath);
|
|
503
577
|
if (!state)
|
|
@@ -508,11 +582,12 @@ export function registerExecCommands(program) {
|
|
|
508
582
|
const filterBy = typeof opts.by === "string" ? opts.by.trim() : undefined;
|
|
509
583
|
const entries = Object.entries(snapshot.tasks)
|
|
510
584
|
.filter(([, cs]) => cs.state === filterState)
|
|
511
|
-
.filter(([, cs]) => !filterBy || cs
|
|
585
|
+
.filter(([, cs]) => !filterBy || claimOwnerOf(cs) === filterBy)
|
|
512
586
|
.sort(([a], [b]) => a.localeCompare(b));
|
|
513
587
|
if (entries.length === 0) {
|
|
514
588
|
const byMsg = filterBy ? ` for ${filterBy}` : "";
|
|
515
589
|
process.stdout.write(`No ${filterState} tasks${byMsg}.\n`);
|
|
590
|
+
writeActiveQueueSummary(executionPath);
|
|
516
591
|
exitWithCode(true);
|
|
517
592
|
return;
|
|
518
593
|
}
|
|
@@ -521,7 +596,7 @@ export function registerExecCommands(program) {
|
|
|
521
596
|
const rows = entries.map(([taskId, cs]) => ({
|
|
522
597
|
taskId,
|
|
523
598
|
name: schedule.nodes.get(taskId)?.name ?? "-",
|
|
524
|
-
by: cs
|
|
599
|
+
by: claimOwnerOf(cs) ?? "-",
|
|
525
600
|
ts: cs.last_ts ?? "-",
|
|
526
601
|
}));
|
|
527
602
|
// Size every column to its longest value (including the header) so nothing is truncated.
|
|
@@ -536,26 +611,12 @@ export function registerExecCommands(program) {
|
|
|
536
611
|
// The trailing claimed_at column is left unpadded to avoid stray trailing whitespace.
|
|
537
612
|
process.stdout.write(` ${padEndDisplay(r.taskId, taskWidth)} ${padEndDisplay(r.name, nameWidth)} ${padEndDisplay(r.by, byWidth)} ${r.ts}\n`);
|
|
538
613
|
}
|
|
614
|
+
writeActiveQueueSummary(executionPath);
|
|
539
615
|
exitWithCode(true);
|
|
540
616
|
}
|
|
541
617
|
catch (error) {
|
|
542
618
|
printCommandError(error, false);
|
|
543
619
|
}
|
|
544
620
|
});
|
|
545
|
-
|
|
546
|
-
addProjectOptions(wcmd);
|
|
547
|
-
wcmd.action((opts) => {
|
|
548
|
-
try {
|
|
549
|
-
const resolvedPaths = resolveProjectContext(opts);
|
|
550
|
-
process.stdout.write(`schedule-path: ${resolvedPaths.schedulePath}\n`);
|
|
551
|
-
process.stdout.write(`execution-path: ${resolvedPaths.executionPath}\n`);
|
|
552
|
-
const projectPath = resolvedPaths.schedulePath;
|
|
553
|
-
process.stdout.write(`exec/events : ${eventsDirForProject(projectPath)}\n`);
|
|
554
|
-
process.stdout.write(`generated : ${generatedDirForProject(projectPath)}\n`);
|
|
555
|
-
process.stdout.write(`scheduler-lock: ${schedulerLockPath(projectPath)}\n`);
|
|
556
|
-
}
|
|
557
|
-
catch (error) {
|
|
558
|
-
printCommandError(error, false);
|
|
559
|
-
}
|
|
560
|
-
});
|
|
621
|
+
registerDeprecatedWhereAlias(exec, printExecPaths);
|
|
561
622
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { parentValidationLabels, recordedParentValidationLabel } from "./parent-validation.js";
|
|
2
|
+
import { recordedRunValidations } from "./pipeline-state.js";
|
|
3
|
+
// LEFTHOOK_EXCLUDE はコンマ区切りのため、hook のコマンド名にコンマや空白を許さない。
|
|
4
|
+
const HOOK_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
/** Validates `pipeline.commit_hook_skips` against the configured parent validations. */
|
|
9
|
+
export function resolveCommitHookSkips(value, parentValidationEntries) {
|
|
10
|
+
if (value === undefined)
|
|
11
|
+
return [];
|
|
12
|
+
if (!Array.isArray(value)) {
|
|
13
|
+
throw new Error("pipeline.commit_hook_skips in exec-defaults must be an array");
|
|
14
|
+
}
|
|
15
|
+
const labels = new Set(parentValidationLabels(parentValidationEntries));
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
return value.map((entry, index) => {
|
|
18
|
+
const where = `pipeline.commit_hook_skips[${index}] in exec-defaults`;
|
|
19
|
+
if (!isRecord(entry))
|
|
20
|
+
throw new Error(`${where} must be { hook, covered_by }`);
|
|
21
|
+
const unknownKeys = Object.keys(entry).filter((key) => key !== "hook" && key !== "covered_by");
|
|
22
|
+
if (unknownKeys.length > 0) {
|
|
23
|
+
throw new Error(`${where}: unknown key(s) ${unknownKeys.sort().join(", ")}`);
|
|
24
|
+
}
|
|
25
|
+
if (typeof entry.hook !== "string" || !HOOK_NAME_PATTERN.test(entry.hook)) {
|
|
26
|
+
throw new Error(`${where}.hook must match ${String(HOOK_NAME_PATTERN)}`);
|
|
27
|
+
}
|
|
28
|
+
if (seen.has(entry.hook))
|
|
29
|
+
throw new Error(`${where}: duplicate hook ${entry.hook}`);
|
|
30
|
+
seen.add(entry.hook);
|
|
31
|
+
const coveredBy = entry.covered_by;
|
|
32
|
+
if (!Array.isArray(coveredBy) ||
|
|
33
|
+
coveredBy.length === 0 ||
|
|
34
|
+
!coveredBy.every((label) => typeof label === "string")) {
|
|
35
|
+
throw new Error(`${where}.covered_by must be a non-empty array of parent validation ids`);
|
|
36
|
+
}
|
|
37
|
+
const unknownLabels = coveredBy.filter((label) => !labels.has(label));
|
|
38
|
+
if (unknownLabels.length > 0) {
|
|
39
|
+
throw new Error(`${where}.covered_by is not in pipeline.parent_validations: ${unknownLabels.join(", ")}`);
|
|
40
|
+
}
|
|
41
|
+
return { hook: entry.hook, covered_by: [...coveredBy] };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Hook commands the integration commit may skip: those whose every covering parent validation
|
|
46
|
+
* is recorded by the runner as `passed`. A validation skipped by change type (`not_applicable`)
|
|
47
|
+
* does not cover the hook, so the hook still runs when its own glob matches.
|
|
48
|
+
*/
|
|
49
|
+
export function integrationCommitHookExclusions(skips, validations) {
|
|
50
|
+
const passed = new Set(validations
|
|
51
|
+
.filter((validation) => validation.source === "runner" && validation.status === "passed")
|
|
52
|
+
.map(recordedParentValidationLabel));
|
|
53
|
+
return skips
|
|
54
|
+
.filter((skip) => skip.covered_by.every((label) => passed.has(label)))
|
|
55
|
+
.map((skip) => skip.hook);
|
|
56
|
+
}
|
|
57
|
+
/** Environment for the integration commit; merges with an inherited LEFTHOOK_EXCLUDE. */
|
|
58
|
+
export function lefthookExcludeEnvironment(hooks, inherited = process.env.LEFTHOOK_EXCLUDE) {
|
|
59
|
+
if (hooks.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
const names = [
|
|
62
|
+
...new Set([
|
|
63
|
+
...(inherited ?? "")
|
|
64
|
+
.split(",")
|
|
65
|
+
.map((name) => name.trim())
|
|
66
|
+
.filter(Boolean),
|
|
67
|
+
...hooks,
|
|
68
|
+
]),
|
|
69
|
+
];
|
|
70
|
+
return { LEFTHOOK_EXCLUDE: names.join(",") };
|
|
71
|
+
}
|
|
72
|
+
/** Hook commands to skip in a run's integration commit, from its recorded parent validations. */
|
|
73
|
+
export function integrationCommitSkipHooks(params) {
|
|
74
|
+
const skips = resolveCommitHookSkips(params.pipeline?.commit_hook_skips, params.pipeline?.parent_validations);
|
|
75
|
+
if (skips.length === 0)
|
|
76
|
+
return [];
|
|
77
|
+
return integrationCommitHookExclusions(skips, recordedRunValidations(params.worktreePath, params.pipelineStatePath));
|
|
78
|
+
}
|
package/dist/exec/core.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { acquireSchedulerLock, buildEvent, canReleaseTask, collectRepeatable, findDoingTasksForActor, foldEventsToState, readAllEventFiles, releaseSchedulerLock, writeEventFile, } from "./events.js";
|
|
2
|
-
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
3
1
|
import { assertValidActor, loadConfig, loadMemberRoster, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { qualifyTaskId, requireNonEmpty } from "./shared.js";
|
|
2
|
+
import { acquireSchedulerLock, buildEvent, canReleaseTask, collectRepeatable, findDoingTasksForActor, foldEventsToState, readAllEventFiles, releaseSchedulerLock, writeEventFile, } from "./events.js";
|
|
6
3
|
import { finalizeResultSectionsForDeliverable, targetDocIdsForScheduledTask } from "./plans.js";
|
|
4
|
+
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
7
5
|
import { resetResultForClaim, scaffoldResult } from "./results.js";
|
|
8
|
-
import {
|
|
9
|
-
import { configuredProductRepos } from "./task-repos.js";
|
|
6
|
+
import { recordPathForRead, recordRef } from "./run-records.js";
|
|
10
7
|
import { buildInitialStateFromStrategy } from "./schedule/initial.js";
|
|
8
|
+
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
9
|
+
import { qualifyTaskId, requireNonEmpty } from "./shared.js";
|
|
11
10
|
import { buildPhaseModeIndex, resolveApproach, resolveTaskExecution, resolveTaskMode, } from "./strategy.js";
|
|
11
|
+
import { configuredProductRepos } from "./task-repos.js";
|
|
12
|
+
import { discardStaleExecWorktree } from "./worktree-ops.js";
|
|
12
13
|
export const KNOWN_OWNER_LABELS = ["PO", "PM", "BA", "ARC", "DEV", "QE", "UX", "OPS"];
|
|
13
14
|
export const KNOWN_OWNER_LABELS_TEXT = KNOWN_OWNER_LABELS.join("|");
|
|
14
15
|
const KNOWN_APPROACHES = [
|
|
15
16
|
"draft",
|
|
16
17
|
"fully-guided",
|
|
18
|
+
"condense",
|
|
17
19
|
"recipe-guided",
|
|
18
20
|
"freeform",
|
|
19
21
|
"bootstrap",
|
|
@@ -58,6 +60,9 @@ export function addLockOptions(cmd) {
|
|
|
58
60
|
export function addForceOption(cmd) {
|
|
59
61
|
return cmd.option("--force", "Human actor only: override the guard on a task held by another actor", false);
|
|
60
62
|
}
|
|
63
|
+
export function addTakeOverOption(cmd) {
|
|
64
|
+
return cmd.option("--take-over", "Human actor only: become the claim owner instead of keeping the current owner (e.g. an agent run)", false);
|
|
65
|
+
}
|
|
61
66
|
export function addOwnerOptions(cmd) {
|
|
62
67
|
return cmd
|
|
63
68
|
.option("--owner <owner>", `Planned owner label for assignment checks (${KNOWN_OWNER_LABELS_TEXT}; defaults to SPECDOJO_OWNER, roster owner, or actor)`)
|
|
@@ -216,7 +221,11 @@ export async function scaffoldClaimResult(opts) {
|
|
|
216
221
|
taskId: opts.taskId,
|
|
217
222
|
mode,
|
|
218
223
|
projectId: opts.projectId,
|
|
219
|
-
...(execution === "agent"
|
|
224
|
+
...(execution === "agent"
|
|
225
|
+
? {
|
|
226
|
+
planRef: recordRef(opts.executionPath, recordPathForRead(opts.executionPath, "plan", opts.taskId)),
|
|
227
|
+
}
|
|
228
|
+
: {}),
|
|
220
229
|
agent: opts.actor,
|
|
221
230
|
startedAt: opts.startedAt,
|
|
222
231
|
execution,
|
|
@@ -304,6 +313,9 @@ export async function runLockedEventCommand(opts, action) {
|
|
|
304
313
|
event.meta.owner_override = true;
|
|
305
314
|
}
|
|
306
315
|
}
|
|
316
|
+
if (action.type === "unblock" && resolvedOpts.takeOver) {
|
|
317
|
+
event.meta = { ...(event.meta ?? {}), take_over: true };
|
|
318
|
+
}
|
|
307
319
|
if (opts.dryRun) {
|
|
308
320
|
process.stdout.write(`[dry-run] ${JSON.stringify(event, null, 2)}\n`);
|
|
309
321
|
if (action.type === "release" && opts.resetWorktree) {
|