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
package/dist/commands/build.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Option } from "commander";
|
|
1
2
|
import { spawnSync } from "node:child_process";
|
|
2
3
|
import { loadConfig, loadEnv, specdojoRootDir } from "../shared/specdojo-config.js";
|
|
3
4
|
import { selfRunArgs } from "../shared/spawn-self.js";
|
|
4
5
|
const VALID_SCOPES = [
|
|
5
6
|
"exec",
|
|
6
7
|
"catalog",
|
|
8
|
+
"schedule",
|
|
7
9
|
"register",
|
|
8
10
|
"yaml-pages",
|
|
9
11
|
"dashboard",
|
|
@@ -23,6 +25,8 @@ function isStepApplicable(scope, project) {
|
|
|
23
25
|
return !!(project.schedule_path?.trim() && project.execution_path?.trim());
|
|
24
26
|
case "catalog":
|
|
25
27
|
return !!project.catalog_path?.trim();
|
|
28
|
+
case "schedule":
|
|
29
|
+
return !!project.schedule_path?.trim();
|
|
26
30
|
case "register":
|
|
27
31
|
return !!project.project_register_path?.trim();
|
|
28
32
|
case "dashboard":
|
|
@@ -47,11 +51,40 @@ export function resolveRegisterProjectIds(config, projectId, isProjectExplicit)
|
|
|
47
51
|
.filter((id) => isStepApplicable("register", config.projects[id]))
|
|
48
52
|
.sort();
|
|
49
53
|
}
|
|
50
|
-
export function resolveSteps(scope, projectArgs, project, registerProjectIds) {
|
|
54
|
+
export function resolveSteps(scope, projectArgs, project, registerProjectIds, opts = {}) {
|
|
55
|
+
// schedule build は管理対象の track YAML を上書きし得るため、従来の一括 build には
|
|
56
|
+
// 加えず、track を明示した --only schedule のときだけ実行する。
|
|
57
|
+
if (scope === "schedule") {
|
|
58
|
+
const track = opts.track?.trim();
|
|
59
|
+
if (!track)
|
|
60
|
+
throw new Error("--only schedule requires --track <track>");
|
|
61
|
+
return isStepApplicable(scope, project)
|
|
62
|
+
? [
|
|
63
|
+
{
|
|
64
|
+
scope,
|
|
65
|
+
label: "schedule build",
|
|
66
|
+
subArgs: [
|
|
67
|
+
"schedule",
|
|
68
|
+
"build",
|
|
69
|
+
...projectArgs,
|
|
70
|
+
"--track",
|
|
71
|
+
track,
|
|
72
|
+
...(opts.force ? ["--force"] : []),
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
: [];
|
|
77
|
+
}
|
|
51
78
|
const registerSteps = registerProjectIds.map((id) => ({
|
|
52
79
|
scope: "register",
|
|
53
80
|
label: registerProjectIds.length > 1 ? `register build (${id})` : "register build",
|
|
54
|
-
subArgs: [
|
|
81
|
+
subArgs: [
|
|
82
|
+
"register",
|
|
83
|
+
"build",
|
|
84
|
+
"--project",
|
|
85
|
+
id,
|
|
86
|
+
...(opts.registerScope ? ["--scope", opts.registerScope] : []),
|
|
87
|
+
],
|
|
55
88
|
}));
|
|
56
89
|
const candidates = [
|
|
57
90
|
{
|
|
@@ -68,7 +101,7 @@ export function resolveSteps(scope, projectArgs, project, registerProjectIds) {
|
|
|
68
101
|
{
|
|
69
102
|
scope: "yaml-pages",
|
|
70
103
|
label: "yaml-pages build",
|
|
71
|
-
subArgs: ["yaml-pages", "build"],
|
|
104
|
+
subArgs: ["yaml-pages", "build", ...(opts.root ? ["--root", opts.root] : [])],
|
|
72
105
|
},
|
|
73
106
|
// dashboard は execution/generated/dashboard.md + timeline Gantt SVG を生成する。
|
|
74
107
|
// state.json / ready.json(exec refresh)と tml-index / rtn-*.yaml / routine-state.json
|
|
@@ -81,7 +114,12 @@ export function resolveSteps(scope, projectArgs, project, registerProjectIds) {
|
|
|
81
114
|
{
|
|
82
115
|
scope: "index",
|
|
83
116
|
label: "index build",
|
|
84
|
-
subArgs: [
|
|
117
|
+
subArgs: [
|
|
118
|
+
"index",
|
|
119
|
+
"build",
|
|
120
|
+
...(opts.root ? ["--root", opts.root] : []),
|
|
121
|
+
...(opts.output ? ["--output", opts.output] : []),
|
|
122
|
+
],
|
|
85
123
|
},
|
|
86
124
|
];
|
|
87
125
|
const active = scope === "all" ? candidates : candidates.filter((s) => s.scope === scope);
|
|
@@ -103,14 +141,35 @@ function logError(msg) {
|
|
|
103
141
|
export function registerBuildCommand(program) {
|
|
104
142
|
program
|
|
105
143
|
.command("build")
|
|
106
|
-
.description("Run
|
|
144
|
+
.description("Run default build steps (exec → catalog → register → yaml-pages → dashboard → index); select one with --only")
|
|
107
145
|
.option("--project <id>", "Project ID (specdojo.config.json)")
|
|
108
|
-
.
|
|
146
|
+
.addOption(new Option("--only <category>", "Build only this category")
|
|
147
|
+
.choices(VALID_SCOPES.filter((scope) => scope !== "all"))
|
|
148
|
+
.conflicts("scope"))
|
|
149
|
+
.addOption(new Option("--scope <scope>", "Compatibility alias for --only (all runs every default step)")
|
|
150
|
+
.choices(VALID_SCOPES)
|
|
151
|
+
.hideHelp())
|
|
152
|
+
.option("--track <track>", "Track name (required for --only schedule)")
|
|
153
|
+
.option("--force", "Overwrite existing track YAML (only with --only schedule)")
|
|
154
|
+
.option("--root <path>", "Root directory to scan (only with --only index or yaml-pages)")
|
|
155
|
+
.option("--output <path>", "Index output path (only with --only index)")
|
|
156
|
+
.addOption(new Option("--register-scope <scope>", "Views to generate (only with --only register)").choices(["register", "controls", "all"]))
|
|
109
157
|
.option("--dry-run", "Print commands without executing", false)
|
|
110
158
|
.action((opts) => {
|
|
111
|
-
const scope = opts.scope;
|
|
112
|
-
|
|
113
|
-
|
|
159
|
+
const scope = (opts.only ?? opts.scope ?? "all");
|
|
160
|
+
const optionError = scope === "schedule" && !opts.track?.trim()
|
|
161
|
+
? "--only schedule requires --track <track>"
|
|
162
|
+
: scope !== "schedule" && (opts.track !== undefined || opts.force !== undefined)
|
|
163
|
+
? "--track and --force require --only schedule"
|
|
164
|
+
: opts.root !== undefined && scope !== "index" && scope !== "yaml-pages"
|
|
165
|
+
? "--root requires --only index or --only yaml-pages"
|
|
166
|
+
: opts.output !== undefined && scope !== "index"
|
|
167
|
+
? "--output requires --only index"
|
|
168
|
+
: opts.registerScope !== undefined && scope !== "register"
|
|
169
|
+
? "--register-scope requires --only register"
|
|
170
|
+
: undefined;
|
|
171
|
+
if (optionError) {
|
|
172
|
+
logError(optionError);
|
|
114
173
|
process.exitCode = 1;
|
|
115
174
|
return;
|
|
116
175
|
}
|
|
@@ -130,7 +189,7 @@ export function registerBuildCommand(program) {
|
|
|
130
189
|
}
|
|
131
190
|
const projectArgs = projectId ? ["--project", projectId] : [];
|
|
132
191
|
const registerProjectIds = resolveRegisterProjectIds(config, projectId, !!opts.project?.trim());
|
|
133
|
-
const steps = resolveSteps(scope, projectArgs, project, registerProjectIds);
|
|
192
|
+
const steps = resolveSteps(scope, projectArgs, project, registerProjectIds, opts);
|
|
134
193
|
if (steps.length === 0) {
|
|
135
194
|
logError(`No applicable steps for scope "${scope}". ` +
|
|
136
195
|
`Check that required paths are configured in specdojo.config.json.`);
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { constants as osConstants } from "node:os";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { registerLifecyclePoolPath } from "../register/lifecycle-lock.js";
|
|
6
|
+
import { CrossProcessMutex, GIT_LOCK_TOKENS_ENV, isLiveLock, livePoolHolders, } from "../shared/cross-process-lock.js";
|
|
7
|
+
import { gitEnvironment } from "../shared/git-environment.js";
|
|
8
|
+
import { restoreIndexAfterPathspecCommit } from "../shared/git.js";
|
|
9
|
+
import { getProjectExecutionPath, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
10
|
+
const READ_COMMANDS = new Set([
|
|
11
|
+
"status",
|
|
12
|
+
"log",
|
|
13
|
+
"diff",
|
|
14
|
+
"show",
|
|
15
|
+
"grep",
|
|
16
|
+
"ls-files",
|
|
17
|
+
"ls-tree",
|
|
18
|
+
"rev-parse",
|
|
19
|
+
"rev-list",
|
|
20
|
+
"describe",
|
|
21
|
+
"shortlog",
|
|
22
|
+
"name-rev",
|
|
23
|
+
"merge-base",
|
|
24
|
+
"cat-file",
|
|
25
|
+
"version",
|
|
26
|
+
"help",
|
|
27
|
+
]);
|
|
28
|
+
const VALUE_OPTIONS = ["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--config-env"];
|
|
29
|
+
const FLAG_OPTIONS = new Set([
|
|
30
|
+
"--bare",
|
|
31
|
+
"--no-pager",
|
|
32
|
+
"--paginate",
|
|
33
|
+
"-p",
|
|
34
|
+
"-P",
|
|
35
|
+
"--no-replace-objects",
|
|
36
|
+
"--literal-pathspecs",
|
|
37
|
+
"--glob-pathspecs",
|
|
38
|
+
"--noglob-pathspecs",
|
|
39
|
+
"--icase-pathspecs",
|
|
40
|
+
"--no-optional-locks",
|
|
41
|
+
"--no-lazy-fetch",
|
|
42
|
+
"--no-advice",
|
|
43
|
+
]);
|
|
44
|
+
export function inspectGitArguments(args) {
|
|
45
|
+
const globals = [];
|
|
46
|
+
let customConfig = false;
|
|
47
|
+
let index = 0;
|
|
48
|
+
while (index < args.length && args[index].startsWith("-")) {
|
|
49
|
+
const arg = args[index++];
|
|
50
|
+
if (arg === "--version" || arg === "--help" || arg === "-h") {
|
|
51
|
+
return { globals, needsLock: false };
|
|
52
|
+
}
|
|
53
|
+
const valueOption = VALUE_OPTIONS.find((option) => arg === option ||
|
|
54
|
+
(option.startsWith("--") ? arg.startsWith(`${option}=`) : arg.startsWith(option)));
|
|
55
|
+
if (valueOption) {
|
|
56
|
+
globals.push(arg);
|
|
57
|
+
if (arg === valueOption) {
|
|
58
|
+
if (index === args.length)
|
|
59
|
+
throw new Error(`Missing value for git ${arg}`);
|
|
60
|
+
globals.push(args[index++]);
|
|
61
|
+
}
|
|
62
|
+
if (valueOption === "-c" || valueOption === "--config-env")
|
|
63
|
+
customConfig = true;
|
|
64
|
+
}
|
|
65
|
+
else if (FLAG_OPTIONS.has(arg) || arg.startsWith("--exec-path=")) {
|
|
66
|
+
globals.push(arg);
|
|
67
|
+
if (arg.startsWith("--exec-path="))
|
|
68
|
+
customConfig = true;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new Error(`Unsupported git global option: ${arg}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const command = args[index];
|
|
75
|
+
// Aliases, unknown commands and output-writing variants join the same queue as writes.
|
|
76
|
+
const writesOutput = args
|
|
77
|
+
.slice(index + 1)
|
|
78
|
+
.some((arg) => arg === "--output" || arg.startsWith("--output="));
|
|
79
|
+
return { globals, needsLock: customConfig || !READ_COMMANDS.has(command) || writesOutput };
|
|
80
|
+
}
|
|
81
|
+
// `commit ... -- <pathspec>` の pathspec を返す。`--` の無い commit や commit 以外は空を返す。
|
|
82
|
+
// pathspec 付きの commit は一時 index で行われ、hook が整形した内容が本来の index に残るため、
|
|
83
|
+
// 呼び出し側が commit の後に index を戻す対象にする(PJR-Y3XS)。
|
|
84
|
+
export function commitPathspecs(args) {
|
|
85
|
+
const { globals } = inspectGitArguments(args);
|
|
86
|
+
if (args[globals.length] !== "commit")
|
|
87
|
+
return [];
|
|
88
|
+
const rest = args.slice(globals.length + 1);
|
|
89
|
+
const separator = rest.indexOf("--");
|
|
90
|
+
return separator === -1 ? [] : rest.slice(separator + 1);
|
|
91
|
+
}
|
|
92
|
+
// Avoid loading .env: a transparent Git wrapper must not alter the caller's credentials or env.
|
|
93
|
+
export function gitExecutionPath(root, projectOption) {
|
|
94
|
+
const configPath = join(root, ".specdojo", "specdojo.config.json");
|
|
95
|
+
if (!existsSync(configPath))
|
|
96
|
+
throw new Error(`No config found: ${configPath}`);
|
|
97
|
+
const config = JSON.parse(readFileSync(configPath, "utf8"));
|
|
98
|
+
if (config?.version !== 1 || !config.projects || typeof config.projects !== "object") {
|
|
99
|
+
throw new Error(`Invalid SpecDojo config: ${configPath}`);
|
|
100
|
+
}
|
|
101
|
+
const projectId = projectOption ||
|
|
102
|
+
process.env.SPECDOJO_PROJECT ||
|
|
103
|
+
config.current_project ||
|
|
104
|
+
Object.keys(config.projects)[0];
|
|
105
|
+
const project = config.projects[projectId];
|
|
106
|
+
if (!project || typeof project !== "object")
|
|
107
|
+
throw new Error(`Unknown project: ${projectId}`);
|
|
108
|
+
return resolve(root, getProjectExecutionPath(project));
|
|
109
|
+
}
|
|
110
|
+
function gitRoot(globals, cwd) {
|
|
111
|
+
const result = spawnSync("git", [...globals, "rev-parse", "--show-toplevel"], {
|
|
112
|
+
cwd,
|
|
113
|
+
env: gitEnvironment(),
|
|
114
|
+
encoding: "utf8",
|
|
115
|
+
});
|
|
116
|
+
if (result.error)
|
|
117
|
+
throw result.error;
|
|
118
|
+
if (result.status !== 0)
|
|
119
|
+
throw new Error(result.stderr.trim() || "Unable to resolve Git worktree");
|
|
120
|
+
return result.stdout.trim();
|
|
121
|
+
}
|
|
122
|
+
export function unlockedGitWarning(executionPath, env) {
|
|
123
|
+
const locksDir = join(executionPath, "exec", ".locks");
|
|
124
|
+
const runActive = isLiveLock(join(locksDir, "exec-run.lock")) ||
|
|
125
|
+
livePoolHolders(join(locksDir, "exec-run-join")).length > 0;
|
|
126
|
+
if (!runActive)
|
|
127
|
+
return undefined;
|
|
128
|
+
const tokens = new Set((env[GIT_LOCK_TOKENS_ENV] ?? "").split(","));
|
|
129
|
+
const held = livePoolHolders(registerLifecyclePoolPath(executionPath)).some((slot) => slot.owner && tokens.has(slot.owner.token));
|
|
130
|
+
return held
|
|
131
|
+
? undefined
|
|
132
|
+
: "[specdojo] warning: exec run is active; use specdojo git -- commit ... to serialize with runner integration.\n";
|
|
133
|
+
}
|
|
134
|
+
export function runGitChild(args, cwd, needsLock) {
|
|
135
|
+
return new Promise((resolveExit, reject) => {
|
|
136
|
+
const env = { ...gitEnvironment(), ...(needsLock ? {} : { GIT_OPTIONAL_LOCKS: "0" }) };
|
|
137
|
+
const child = spawn("git", args, { cwd, env, stdio: "inherit" });
|
|
138
|
+
// Keep the lifecycle lock until Git (including hooks) exits, even when the wrapper is signalled.
|
|
139
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"];
|
|
140
|
+
const handlers = signals.map((signal) => () => {
|
|
141
|
+
child.kill(signal);
|
|
142
|
+
});
|
|
143
|
+
signals.forEach((signal, index) => process.on(signal, handlers[index]));
|
|
144
|
+
const cleanup = () => {
|
|
145
|
+
signals.forEach((signal, index) => process.off(signal, handlers[index]));
|
|
146
|
+
};
|
|
147
|
+
child.once("error", (error) => {
|
|
148
|
+
cleanup();
|
|
149
|
+
reject(error);
|
|
150
|
+
});
|
|
151
|
+
child.once("close", (code, signal) => {
|
|
152
|
+
cleanup();
|
|
153
|
+
resolveExit(code ?? (signal ? 128 + osConstants.signals[signal] : 1));
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export async function runSerializedGit(args, options = {}) {
|
|
158
|
+
if (args.length === 0)
|
|
159
|
+
throw new Error("Usage: specdojo git [--project <id>] -- <git arguments>");
|
|
160
|
+
const cwd = options.cwd ?? process.cwd();
|
|
161
|
+
const { globals, needsLock } = inspectGitArguments(args);
|
|
162
|
+
if (!needsLock)
|
|
163
|
+
return runGitChild(args, cwd, false);
|
|
164
|
+
const executionPath = gitExecutionPath(gitRoot(globals, cwd), options.project);
|
|
165
|
+
const mutex = new CrossProcessMutex(registerLifecyclePoolPath(executionPath), {
|
|
166
|
+
actor: "specdojo-git",
|
|
167
|
+
label: "git write",
|
|
168
|
+
}, {
|
|
169
|
+
onWait: () => process.stderr.write("Waiting for the exec-lifecycle lock held by another operation\n"),
|
|
170
|
+
});
|
|
171
|
+
const pathspecs = commitPathspecs(args);
|
|
172
|
+
return mutex.runExclusive(async () => {
|
|
173
|
+
const code = await runGitChild(args, cwd, true);
|
|
174
|
+
if (code !== 0 || pathspecs.length === 0)
|
|
175
|
+
return code;
|
|
176
|
+
const restored = restoreIndexAfterPathspecCommit(cwd, pathspecs, globals);
|
|
177
|
+
if (restored.length > 0) {
|
|
178
|
+
process.stderr.write(`[specdojo] restored hook-formatted paths left in the index after commit: ${restored.join(", ")}\n`);
|
|
179
|
+
}
|
|
180
|
+
return code;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export function registerGitCommand(program) {
|
|
184
|
+
program
|
|
185
|
+
.command("git")
|
|
186
|
+
.description("Run Git writes under the runner lifecycle lock; pass Git arguments after --")
|
|
187
|
+
.option("--project <id>", "Project whose lifecycle lock is used")
|
|
188
|
+
.option("--warn-unlocked", "Pre-commit check: warn about unlocked commits during exec run")
|
|
189
|
+
.argument("[gitArgs...]", "Git arguments after --")
|
|
190
|
+
.action(async (args, options) => {
|
|
191
|
+
try {
|
|
192
|
+
if (options.warnUnlocked) {
|
|
193
|
+
const warning = unlockedGitWarning(gitExecutionPath(specdojoRootDir(), options.project), process.env);
|
|
194
|
+
if (warning)
|
|
195
|
+
process.stderr.write(warning);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
process.exitCode = await runSerializedGit(args, options);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
203
|
+
process.exitCode = options.warnUnlocked ? 0 : 1;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createInterface } from "node:readline/promises";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
4
5
|
import { dump, load } from "../shared/yaml.js";
|
|
5
6
|
import { runScaffold } from "../catalog/scaffold.js";
|
|
6
7
|
import { runDevcontainerScaffold } from "../devcontainer/scaffold.js";
|
|
@@ -356,14 +357,16 @@ function writeExecConfiguration(repoRoot, packageRoot, providers, dryRun) {
|
|
|
356
357
|
const executor = members.find((member) => member.provider === provider &&
|
|
357
358
|
member.stage_role === "executor" &&
|
|
358
359
|
member.mode === "edit" &&
|
|
359
|
-
member.proficiency !== "expert"
|
|
360
|
+
member.proficiency !== "expert" &&
|
|
361
|
+
member.proficiency !== "frontier");
|
|
360
362
|
const expertExecutor = members.find((member) => member.provider === provider &&
|
|
361
363
|
member.stage_role === "executor" &&
|
|
362
364
|
member.mode === "edit" &&
|
|
363
365
|
member.proficiency === "expert");
|
|
364
366
|
const reporter = members.find((member) => member.provider === provider &&
|
|
365
367
|
member.stage_role === "reporter" &&
|
|
366
|
-
member.proficiency !== "expert"
|
|
368
|
+
member.proficiency !== "expert" &&
|
|
369
|
+
member.proficiency !== "frontier");
|
|
367
370
|
if (!executor || !reporter) {
|
|
368
371
|
throw new Error(`init-agent-members.yaml must define an edit executor and reporter for ${provider}`);
|
|
369
372
|
}
|
|
@@ -509,6 +512,9 @@ function scaffoldCatalog(repoRoot, packageRoot, config, answers, dryRun) {
|
|
|
509
512
|
}
|
|
510
513
|
export async function runInit(options, deps) {
|
|
511
514
|
const repoRoot = specdojoRootDir();
|
|
515
|
+
if (resolve(repoRoot) === resolve(tmpdir())) {
|
|
516
|
+
throw new Error("Refusing to initialize specdojo directly under temporary directory root.");
|
|
517
|
+
}
|
|
512
518
|
const packageRoot = specdojoPackageRootDir();
|
|
513
519
|
const interactive = !options.yes && !!process.stdin.isTTY && !process.env.CI;
|
|
514
520
|
const prompter = deps?.prompter ??
|
|
@@ -5,6 +5,7 @@ import { join, relative } from "node:path";
|
|
|
5
5
|
import { resolveProjectPaths } from "../exec/project.js";
|
|
6
6
|
import { loadRegisterItems, resolveRegisterPaths } from "../register/register.js";
|
|
7
7
|
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
8
|
+
import { gitEnvironment } from "../shared/git-environment.js";
|
|
8
9
|
export function selectApprovedNightItems(items, limit) {
|
|
9
10
|
return items
|
|
10
11
|
.filter((item) => item.autopilot === "approved" &&
|
|
@@ -75,8 +76,9 @@ export function renderNightReport(options) {
|
|
|
75
76
|
return `---
|
|
76
77
|
specdojo:
|
|
77
78
|
id: ${options.projectId}:night-orchestrator-report-${stamp}
|
|
78
|
-
type:
|
|
79
|
+
type: project
|
|
79
80
|
status: draft
|
|
81
|
+
rulebook: none
|
|
80
82
|
---
|
|
81
83
|
|
|
82
84
|
# 夜間 orchestrator 朝報告 ${options.startedAt.slice(0, 10)}
|
|
@@ -85,13 +87,13 @@ specdojo:
|
|
|
85
87
|
- 完了: \`${options.completedAt}\`
|
|
86
88
|
- 停止理由: ${safeCell(options.stopReason)}
|
|
87
89
|
|
|
88
|
-
## 集計
|
|
90
|
+
## 1. 集計
|
|
89
91
|
|
|
90
92
|
- close: ${list(closed)}
|
|
91
93
|
- \`waiting\`: ${list(waiting)}
|
|
92
94
|
- 新しい承認待ち: ${list(approvals)}
|
|
93
95
|
|
|
94
|
-
## 実行結果
|
|
96
|
+
## 2. 実行結果
|
|
95
97
|
|
|
96
98
|
| 項目 | 結果 | 遷移 | 理由 |
|
|
97
99
|
| ---- | ---- | ---- | ---- |
|
|
@@ -109,7 +111,7 @@ async function runCaptured(command, args) {
|
|
|
109
111
|
return await new Promise((resolveRun, reject) => {
|
|
110
112
|
const child = spawn(command, args, {
|
|
111
113
|
cwd: specdojoRootDir(),
|
|
112
|
-
env:
|
|
114
|
+
env: gitEnvironment(),
|
|
113
115
|
stdio: "pipe",
|
|
114
116
|
});
|
|
115
117
|
let stdout = "";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Argument } from "commander";
|
|
2
|
+
import { printCatalogPaths } from "../catalog/catalog.js";
|
|
3
|
+
import { printTimelinePaths } from "../dashboard/timeline.js";
|
|
4
|
+
import { printExecPaths } from "../exec/commands.js";
|
|
5
|
+
import { printJobPaths } from "../job/job.js";
|
|
6
|
+
import { printRoutinePaths } from "../routine/routine.js";
|
|
7
|
+
import { printSchedulePaths } from "../schedule/schedule.js";
|
|
8
|
+
const pathPrinters = {
|
|
9
|
+
exec: printExecPaths,
|
|
10
|
+
catalog: printCatalogPaths,
|
|
11
|
+
schedule: printSchedulePaths,
|
|
12
|
+
timeline: printTimelinePaths,
|
|
13
|
+
job: printJobPaths,
|
|
14
|
+
routine: printRoutinePaths,
|
|
15
|
+
};
|
|
16
|
+
export function registerWhereCommand(program) {
|
|
17
|
+
program
|
|
18
|
+
.command("where")
|
|
19
|
+
.description("Print resolved project paths and files for a kind")
|
|
20
|
+
.addArgument(new Argument("<kind>", "Kind of paths to display").choices(Object.keys(pathPrinters)))
|
|
21
|
+
.option("--project <projectId>", "Project id in specdojo.config.json")
|
|
22
|
+
.action((kind, opts) => {
|
|
23
|
+
pathPrinters[kind](opts);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { readYaml } from "../shared/fs.js";
|
|
1
4
|
import { addWorkingDaysToDate } from "../exec/schedule/calendar.js";
|
|
2
|
-
import {
|
|
5
|
+
import { applyScheduleCalendar, defaultScheduleCalendar } from "../shared/schedule-index.js";
|
|
3
6
|
import { buildTimelineWaves } from "./timeline-build.js";
|
|
4
7
|
// tml-index の tracks を order → wave に集約し、planned_start_date と稼働日カレンダーで各トラックの
|
|
5
8
|
// 予定開始日・終了日を算出する。横軸は日付であり、wave 番号ではない。
|
|
@@ -46,16 +49,14 @@ export function computeTimelineTrackSchedules(index, calendar) {
|
|
|
46
49
|
}));
|
|
47
50
|
return { schedule, plannedStartDate: index.planned_start_date };
|
|
48
51
|
}
|
|
49
|
-
//
|
|
50
|
-
// (sch-defaults.yaml と各 sch-*.yaml)の calendar を buildScheduleIndex から復用する。
|
|
51
|
-
// 両方とも YAML 正本から機械的に読み取り、表示文言の解析に依存しない。
|
|
52
|
+
// The project calendar comes exclusively from sch-defaults.yaml.
|
|
52
53
|
export function resolveDashboardCalendar(schedulePath) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
const defaults = join(schedulePath, "sch-defaults.yaml");
|
|
55
|
+
const base = defaultScheduleCalendar();
|
|
56
|
+
if (!existsSync(defaults))
|
|
57
|
+
return base;
|
|
58
|
+
const doc = readYaml(defaults);
|
|
59
|
+
return applyScheduleCalendar(base, doc?.calendar) ?? base;
|
|
59
60
|
}
|
|
60
61
|
// ================================
|
|
61
62
|
// Timeline Gantt SVG (x-axis = date)
|
|
@@ -75,7 +76,7 @@ function statusColor(status) {
|
|
|
75
76
|
return "#d1d5db";
|
|
76
77
|
}
|
|
77
78
|
// 予定日付の無いトラックはバーを持たずラベルのみ表示する(手始め日 or 推定稼働日が未設定)。
|
|
78
|
-
export function buildTimelineGanttSvg(schedule, plannedStartDate, title = "トラック計画ガントチャート") {
|
|
79
|
+
export function buildTimelineGanttSvg(schedule, plannedStartDate, title = "トラック計画ガントチャート", caption = "横軸は日付。予定開始日・予定終了日は tml-index.yaml の planned_start_date と catalog_duration_estimate_days(推定稼働日数)から算出。") {
|
|
79
80
|
const dayWidth = 30;
|
|
80
81
|
const rowHeight = 26;
|
|
81
82
|
const leftPad = 240;
|
|
@@ -87,7 +88,7 @@ export function buildTimelineGanttSvg(schedule, plannedStartDate, title = "ト
|
|
|
87
88
|
if (fullRows.length === 0 || !plannedStartDate) {
|
|
88
89
|
return noDataTimelineSvg(title, plannedStartDate
|
|
89
90
|
? "トラックの予定開始日・終了日を算出できませんでした。"
|
|
90
|
-
: "
|
|
91
|
+
: "開始日を確定できる項目がありません。", schedule);
|
|
91
92
|
}
|
|
92
93
|
const parseMs = (dateOnly) => {
|
|
93
94
|
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
@@ -121,7 +122,7 @@ export function buildTimelineGanttSvg(schedule, plannedStartDate, title = "ト
|
|
|
121
122
|
</style>`);
|
|
122
123
|
parts.push(`<rect x="0" y="0" width="${width}" height="${height}" fill="#fffdf8" />`);
|
|
123
124
|
parts.push(`<text class="tl-title" x="16" y="24">${xmlEscape(title)}</text>`);
|
|
124
|
-
parts.push(`<text class="tl-caption" x="16" y="42"
|
|
125
|
+
parts.push(`<text class="tl-caption" x="16" y="42">${xmlEscape(caption)}</text>`);
|
|
125
126
|
for (let offset = 0; offset < totalDays; offset++) {
|
|
126
127
|
const dayMs = startMs + offset * 86_400_000;
|
|
127
128
|
if (new Date(dayMs).getUTCDate() !== 1)
|
|
@@ -159,17 +160,18 @@ function datePlanNote(row) {
|
|
|
159
160
|
if (!row.startDate)
|
|
160
161
|
return "手始め日未定";
|
|
161
162
|
if (row.endDate === undefined || !row.estimateDays)
|
|
162
|
-
return `着手順 ${row.order}
|
|
163
|
+
return `着手順 ${row.order}(終了日未定)`;
|
|
163
164
|
return `${row.startDate} ~ ${row.endDate}`;
|
|
164
165
|
}
|
|
165
|
-
function noDataTimelineSvg(title, message) {
|
|
166
|
+
function noDataTimelineSvg(title, message, rows = []) {
|
|
166
167
|
const width = 560;
|
|
167
|
-
const height = 120;
|
|
168
|
+
const height = 120 + rows.length * 24;
|
|
168
169
|
return [
|
|
169
170
|
`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="img" aria-label="${xmlEscape(title)}">`,
|
|
170
171
|
`<rect x="0" y="0" width="${width}" height="${height}" fill="#fffdf8" />`,
|
|
171
172
|
`<text class="tl-title" x="16" y="24">${xmlEscape(title)}</text>`,
|
|
172
173
|
`<text x="16" y="72" font-size="13" fill="#64748b">${xmlEscape(message)}</text>`,
|
|
174
|
+
...rows.map((row, index) => `<text x="16" y="${104 + index * 24}" font-size="12">${xmlEscape(row.track)}: 開始日未定 / 終了日 ${xmlEscape(row.endDate ?? "未定")}</text>`),
|
|
173
175
|
`</svg>`,
|
|
174
176
|
].join("\n");
|
|
175
177
|
}
|