specdojo 0.4.7 → 0.6.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 +16 -9
- package/CHANGELOG.md +106 -0
- package/dist/catalog/generate.js +144 -13
- package/dist/commands/init.js +4 -0
- package/dist/commands/night-orchestrator.js +33 -4
- package/dist/dashboard/dashboard.js +5 -6
- package/dist/dashboard/timeline-build.js +5 -1
- package/dist/dashboard/timeline.js +6 -3
- package/dist/deliverable/deliverable.js +77 -4
- package/dist/docs/yaml-pages.js +17 -17
- package/dist/exec/core.js +3 -0
- package/dist/exec/parent-validation.js +7 -0
- package/dist/exec/pipeline-state.js +5 -2
- package/dist/exec/plans-core.js +49 -3
- package/dist/exec/plans-generation.js +48 -8
- package/dist/exec/plans-grade-findings.js +16 -0
- package/dist/exec/plans-planning.js +43 -0
- package/dist/exec/plans-storage.js +6 -2
- package/dist/exec/product-branch-records.js +105 -0
- package/dist/exec/product-branches.js +52 -0
- package/dist/exec/register-product-message.js +50 -0
- package/dist/exec/register.js +22 -1
- package/dist/exec/repo-integration-sync.js +11 -0
- package/dist/exec/repo-integration.js +58 -6
- package/dist/exec/repo-trace.js +19 -4
- package/dist/exec/results.js +11 -5
- package/dist/exec/run/register-command.js +16 -0
- package/dist/exec/run/register-core.js +11 -0
- package/dist/exec/run/register-mode.js +19 -1
- package/dist/exec/run/register-resume.js +33 -1
- package/dist/exec/run/register-worktree.js +52 -8
- package/dist/exec/run/schedule-prepare.js +7 -3
- package/dist/exec/strategy.js +4 -1
- package/dist/exec/task-repos.js +92 -16
- package/dist/exec/worktree-command.js +2 -2
- package/dist/exec/worktree-ops-commit.js +7 -1
- package/dist/exec/worktree.js +3 -3
- package/dist/grade/apply.js +6 -2
- package/dist/grade/markdown.js +7 -2
- package/dist/grade/plan.js +6 -4
- package/dist/register/approach.js +19 -0
- package/dist/register/catalog-status.js +49 -0
- package/dist/register/core.js +8 -0
- package/dist/register/create-commands.js +86 -4
- package/dist/register/deliverable-target.js +24 -17
- package/dist/register/dependency.js +123 -0
- package/dist/register/derivation.js +2 -2
- package/dist/register/epic.js +42 -0
- package/dist/register/event-merge.js +9 -2
- package/dist/register/events.js +10 -0
- package/dist/register/external-project.js +6 -0
- package/dist/register/input.js +168 -0
- package/dist/register/item.js +71 -0
- package/dist/register/maintenance-commands.js +7 -1
- package/dist/register/planning.js +37 -0
- package/dist/register/register.js +7 -3
- package/dist/register/renumber.js +16 -4
- package/dist/register/update.js +6 -0
- package/dist/register/views.js +55 -4
- package/dist/schedule/approach.js +9 -0
- package/dist/schedule/schedule.js +3 -1
- package/dist/schedule/strategy-generate-scope.js +5 -1
- package/dist/schedule/strategy-generate.js +1 -0
- package/dist/schedule/strategy-profiles.js +22 -2
- package/dist/shared/agent-types.js +7 -1
- package/dist/shared/branch-template.js +26 -0
- package/dist/shared/commit-message-template.js +38 -0
- package/dist/shared/commit-types.js +15 -0
- package/dist/shared/grade-result.js +23 -5
- package/dist/shared/markdownlint-config.js +38 -0
- package/dist/shared/markdownlint-scaffold.js +2 -9
- package/dist/shared/specdojo-config.js +42 -4
- package/dist/shared/specdojo-gitignore.js +4 -0
- package/docs/ja/specdojo/exec-templates/xep-catalog-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xep-draft-template.md +93 -0
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +9 -2
- package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xep-strategy-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xer-human-bootstrap-finalize-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xer-human-draft-template.md +23 -0
- package/docs/ja/specdojo/exec-templates/xer-human-finalize-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +7 -4
- package/docs/ja/specdojo/guides/docs-editing-guide.md +14 -1
- package/docs/ja/specdojo/guides/docs-structure-guide.md +10 -8
- package/docs/ja/specdojo/guides/exec-config-guide.md +3 -1
- package/docs/ja/specdojo/guides/exec-operation-guide.md +111 -16
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +19 -1
- package/docs/ja/specdojo/guides/practice-system-composition-guide.md +2 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +37 -14
- package/docs/ja/specdojo/guides/register-operation-guide.md +58 -16
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +1 -1
- package/docs/ja/specdojo/guides/ryu-guide.md +114 -23
- package/docs/ja/specdojo/guides/schedule-design-guide.md +31 -4
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +16 -16
- package/docs/ja/specdojo/guides/timeline-design-guide.md +37 -33
- package/docs/ja/specdojo/recipes/exec-human-finalize-recipe.md +1 -0
- package/docs/ja/specdojo/recipes/tsd-recipe.md +206 -0
- package/docs/ja/specdojo/references/command-reference.md +86 -15
- package/docs/ja/specdojo/references/specdojo-config-reference.md +81 -8
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +5 -4
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +8 -7
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +9 -0
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +9 -6
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +3 -1
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +2 -0
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +4 -2
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +10 -9
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +10 -9
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +7 -6
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +54 -36
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/sch-rulebook.md +4 -1
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +7 -6
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +80 -61
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +111 -63
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +1 -0
- package/docs/ja/specdojo/samples/atc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/atc-sample.md +1 -1
- package/docs/ja/specdojo/samples/bac-sample.md +1 -1
- package/docs/ja/specdojo/samples/bdd-sample.yaml +1 -1
- package/docs/ja/specdojo/samples/bds-sample.md +1 -1
- package/docs/ja/specdojo/samples/bes-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/bes-sample.md +1 -1
- package/docs/ja/specdojo/samples/ccd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdfd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdsd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cld-sample.md +1 -1
- package/docs/ja/specdojo/samples/cnd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cop-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/cop-sample.md +1 -1
- package/docs/ja/specdojo/samples/cpd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cstd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cxd-sample.md +1 -1
- package/docs/ja/specdojo/samples/dct-sample.yaml +5 -1
- package/docs/ja/specdojo/samples/dmd-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/dmd-sample.md +1 -1
- package/docs/ja/specdojo/samples/etc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/etc-sample.md +1 -1
- package/docs/ja/specdojo/samples/gl-sample.yaml +2 -0
- package/docs/ja/specdojo/samples/ifd-sample.md +1 -1
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +1 -0
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +1 -1
- package/docs/ja/specdojo/samples/ifx-file-sample.md +1 -1
- package/docs/ja/specdojo/samples/ifx-index-sample.yaml +1 -0
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +2 -1
- package/docs/ja/specdojo/samples/itc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/itc-sample.md +1 -1
- package/docs/ja/specdojo/samples/mtp-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-availability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-integrity-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-operations-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-performance-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-reliability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-usability-sample.md +1 -1
- package/docs/ja/specdojo/samples/ntp-sample.md +1 -1
- package/docs/ja/specdojo/samples/opd-sample.md +1 -1
- package/docs/ja/specdojo/samples/opr-sample.md +1 -1
- package/docs/ja/specdojo/samples/otp-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/otp-sample.md +1 -1
- package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +1 -1
- package/docs/ja/specdojo/samples/sac-sample.md +1 -1
- package/docs/ja/specdojo/samples/sf-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/sf-sample.md +1 -1
- package/docs/ja/specdojo/samples/sld-sample.md +1 -1
- package/docs/ja/specdojo/samples/stc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/stc-sample.md +1 -1
- package/docs/ja/specdojo/samples/stsd-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/tsd-index-sample.md +22 -16
- package/docs/ja/specdojo/samples/tsd-sample.md +241 -21
- package/docs/ja/specdojo/samples/tsp-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/uis-sample.md +1 -1
- package/docs/ja/specdojo/samples/utc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/utc-sample.md +1 -1
- package/docs/ja/specdojo/standards/document-metadata-standard.md +44 -3
- package/docs/ja/specdojo/standards/exec-human-finalize-standard.md +1 -0
- package/docs/ja/specdojo/standards/guide-authoring-standard.md +2 -1
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +2 -0
- package/docs/ja/specdojo/standards/philosophy-authoring-standard.md +1 -0
- package/docs/ja/specdojo/standards/recipe-authoring-standard.md +2 -1
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +18 -12
- package/docs/ja/specdojo/standards/sample-authoring-standard.md +1 -0
- package/docs/ja/specdojo/standards/standard-authoring-standard.md +2 -1
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +1 -1
- package/docs/ja/specdojo/templates/pjr-change-request-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-dependent-items-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-epic-items-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-epic-template.md +44 -0
- package/docs/ja/specdojo/templates/pjr-index-template.md +4 -2
- package/docs/ja/specdojo/templates/pjr-issue-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-question-template.md +11 -5
- package/docs/ja/specdojo/templates/pjr-risk-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-todo-template.md +10 -4
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/dct.schema.yaml +9 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +24 -16
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +5 -1
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +1 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/gl.schema.yaml +8 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +5 -1
- package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +2 -1
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +21 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +75 -3
- package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +5 -0
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +1 -0
- package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +43 -0
- package/package.json +4 -3
- package/templates/antigravity/orchestrator.md +16 -9
- package/templates/claude/agents/specdojo-orchestrator.md +16 -9
- package/templates/codex/agents/specdojo-orchestrator.toml +16 -9
- package/templates/codex/orchestrator.md +16 -9
- package/templates/copilot/README.md +2 -1
- package/templates/devcontainer/remote-host/specdojo-tmux.sh.sample +14 -8
- package/templates/opencode/agents/specdojo-orchestrator.md +16 -9
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { addProjectOption, printCommandError, resolveCatalogPath } from "../catalog/catalog.js";
|
|
3
|
-
import { runGenerate } from "../catalog/generate.js";
|
|
4
|
-
import {
|
|
3
|
+
import { runGenerate, runGenerateTarget } from "../catalog/generate.js";
|
|
4
|
+
import { deriveProjectId } from "../catalog/scaffold.js";
|
|
5
|
+
import { loadConfig, specdojoRootDir } from "../shared/specdojo-config.js";
|
|
5
6
|
import { resolveSpecdojoPath } from "../docs/template-resolution.js";
|
|
6
7
|
import { applyTrash, planTrash } from "./trash.js";
|
|
8
|
+
function resolveTargetProjectId(opts, catalogPath, targetId) {
|
|
9
|
+
if (opts.projectId?.trim())
|
|
10
|
+
return opts.projectId.trim();
|
|
11
|
+
if (opts.project?.trim())
|
|
12
|
+
return opts.project.trim();
|
|
13
|
+
if (process.env.SPECDOJO_PROJECT?.trim())
|
|
14
|
+
return process.env.SPECDOJO_PROJECT.trim();
|
|
15
|
+
if (catalogPath) {
|
|
16
|
+
const derived = deriveProjectId(catalogPath);
|
|
17
|
+
if (derived)
|
|
18
|
+
return derived;
|
|
19
|
+
}
|
|
20
|
+
const config = loadConfig().config;
|
|
21
|
+
if (config && Object.keys(config.projects).length > 0) {
|
|
22
|
+
return Object.keys(config.projects)[0];
|
|
23
|
+
}
|
|
24
|
+
if (targetId.includes(":")) {
|
|
25
|
+
return targetId.slice(0, targetId.indexOf(":"));
|
|
26
|
+
}
|
|
27
|
+
throw new Error("No project specified. Use --project <id> or --project-id <id>.");
|
|
28
|
+
}
|
|
7
29
|
function collectCommaSeparated(value, previous) {
|
|
8
30
|
return [
|
|
9
31
|
...previous,
|
|
@@ -23,11 +45,24 @@ export function registerDeliverableCommands(program) {
|
|
|
23
45
|
addProjectOption(scaffold);
|
|
24
46
|
scaffold.option("--project-id <projectId>", "Project ID to embed (e.g. prj-0001); derived from each dct-*.yaml if omitted");
|
|
25
47
|
scaffold.option("--dct <name>", "Limit to specific dct-*.yaml (repeatable / comma-separated; with or without 'dct-' prefix and '.yaml')", collectCommaSeparated, []);
|
|
48
|
+
scaffold.option("--target <targetId>", "Scaffold only a single deliverable by document id");
|
|
49
|
+
scaffold.option("--target-path <targetPath>", "Repository-relative file path for catalog-less deliverable");
|
|
50
|
+
scaffold.option("--target-rulebook <targetRulebook>", "Rulebook document id for catalog-less deliverable");
|
|
26
51
|
scaffold.option("--force", "Overwrite existing files", false);
|
|
27
52
|
scaffold.option("--dry-run", "Print planned files without writing", false);
|
|
28
53
|
scaffold.action((opts) => {
|
|
29
54
|
try {
|
|
30
|
-
const
|
|
55
|
+
const dctList = opts.dct ?? [];
|
|
56
|
+
const hasDct = dctList.length > 0;
|
|
57
|
+
const target = typeof opts.target === "string" ? opts.target.trim() : "";
|
|
58
|
+
const targetPath = typeof opts.targetPath === "string" ? opts.targetPath.trim() : undefined;
|
|
59
|
+
const targetRulebook = typeof opts.targetRulebook === "string" ? opts.targetRulebook.trim() : undefined;
|
|
60
|
+
if (target && hasDct) {
|
|
61
|
+
throw new Error("Cannot specify both --target and --dct");
|
|
62
|
+
}
|
|
63
|
+
if (!target && (targetPath || targetRulebook)) {
|
|
64
|
+
throw new Error("--target-path and --target-rulebook require --target");
|
|
65
|
+
}
|
|
31
66
|
const templatesPath = resolveSpecdojoPath("docs/ja/specdojo/templates");
|
|
32
67
|
const rulebooksPath = resolveSpecdojoPath("docs/ja/specdojo/rulebooks");
|
|
33
68
|
if (!existsSync(templatesPath)) {
|
|
@@ -36,6 +71,44 @@ export function registerDeliverableCommands(program) {
|
|
|
36
71
|
if (!existsSync(rulebooksPath)) {
|
|
37
72
|
throw new Error(`Rulebooks directory not found: ${rulebooksPath}`);
|
|
38
73
|
}
|
|
74
|
+
if (target) {
|
|
75
|
+
const repoRoot = specdojoRootDir();
|
|
76
|
+
let catalogPath;
|
|
77
|
+
try {
|
|
78
|
+
catalogPath = resolveCatalogPath(opts);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (!targetPath || !targetRulebook) {
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const projectId = resolveTargetProjectId(opts, catalogPath, target);
|
|
86
|
+
const { written, skipped, errors } = runGenerateTarget({
|
|
87
|
+
catalogPath,
|
|
88
|
+
templatesPath,
|
|
89
|
+
rulebooksPath,
|
|
90
|
+
repoRoot,
|
|
91
|
+
projectId,
|
|
92
|
+
targetId: target,
|
|
93
|
+
targetPath,
|
|
94
|
+
targetRulebook,
|
|
95
|
+
force: !!opts.force,
|
|
96
|
+
dryRun: !!opts.dryRun,
|
|
97
|
+
resourceRoots: { repositoryRoot: repoRoot },
|
|
98
|
+
});
|
|
99
|
+
const createdLabel = opts.dryRun ? "Would create" : "Created";
|
|
100
|
+
for (const error of errors)
|
|
101
|
+
process.stdout.write(`ERROR: ${error}\n`);
|
|
102
|
+
for (const path of written)
|
|
103
|
+
process.stdout.write(`${createdLabel}: ${path}\n`);
|
|
104
|
+
for (const path of skipped) {
|
|
105
|
+
process.stdout.write(`Skipped (already exists; use --force to overwrite): ${path}\n`);
|
|
106
|
+
}
|
|
107
|
+
if (errors.length > 0)
|
|
108
|
+
process.exitCode = 1;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const catalogPath = resolveCatalogPath(opts);
|
|
39
112
|
const { written, skipped, errors } = runGenerate({
|
|
40
113
|
catalogPath,
|
|
41
114
|
templatesPath,
|
|
@@ -44,7 +117,7 @@ export function registerDeliverableCommands(program) {
|
|
|
44
117
|
projectId: opts.projectId ?? null,
|
|
45
118
|
force: !!opts.force,
|
|
46
119
|
dryRun: !!opts.dryRun,
|
|
47
|
-
dctNames:
|
|
120
|
+
dctNames: dctList,
|
|
48
121
|
resourceRoots: { repositoryRoot: specdojoRootDir() },
|
|
49
122
|
});
|
|
50
123
|
const createdLabel = opts.dryRun ? "Would create" : "Created";
|
package/dist/docs/yaml-pages.js
CHANGED
|
@@ -66,13 +66,9 @@ function deriveMeta(yamlRelPath, content) {
|
|
|
66
66
|
.replace(/[^a-z0-9:_-]/g, "-");
|
|
67
67
|
const rawId = readMeta("id");
|
|
68
68
|
const id = typeof rawId === "string" && DOC_ID_RE.test(rawId) ? rawId : fileBase;
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
const type =
|
|
72
|
-
? "sample"
|
|
73
|
-
: yamlRelPath.includes("/templates/")
|
|
74
|
-
? "template"
|
|
75
|
-
: "project";
|
|
69
|
+
// 分類は配置パスから推測せず正本の値を引き継ぐ。欠落・旧値は YAML 検証で扱う。
|
|
70
|
+
const rawType = readMeta("type");
|
|
71
|
+
const type = typeof rawType === "string" ? rawType : undefined;
|
|
76
72
|
const rawStatus = readMeta("status");
|
|
77
73
|
const status = typeof rawStatus === "string" && STATUS_VALUES.has(rawStatus)
|
|
78
74
|
? rawStatus
|
|
@@ -83,13 +79,23 @@ function deriveMeta(yamlRelPath, content) {
|
|
|
83
79
|
const info = isRecord(record["info"]) ? record["info"] : {};
|
|
84
80
|
const rawTitle = readMeta("title") ?? info["title"];
|
|
85
81
|
const title = typeof rawTitle === "string" && rawTitle.trim() !== "" ? rawTitle.trim() : undefined;
|
|
86
|
-
return {
|
|
82
|
+
return {
|
|
83
|
+
id,
|
|
84
|
+
...(type !== undefined ? { type } : {}),
|
|
85
|
+
status,
|
|
86
|
+
rulebook,
|
|
87
|
+
...(title ? { title } : {}),
|
|
88
|
+
};
|
|
87
89
|
}
|
|
88
90
|
// 表示ページの Markdown を組み立てる。YAML 本文はコードブロックで埋め込み、
|
|
89
91
|
// 本文中のバッククォート連続より長いフェンスを使って壊れないようにする。
|
|
90
92
|
export function renderYamlPage(yamlRelPath, content) {
|
|
91
93
|
const { title, ...meta } = deriveMeta(yamlRelPath, content);
|
|
92
|
-
|
|
94
|
+
// ジョブ定義・評価記録など、成果物の type を持たない YAML も索引に含まれる。
|
|
95
|
+
// その表示ページは成果物メタ情報を宣言せず、正本の型検証に委ねる。
|
|
96
|
+
const header = meta.type === undefined
|
|
97
|
+
? []
|
|
98
|
+
: ["---", dump({ specdojo: meta }, { lineWidth: -1 }).trimEnd(), "---", ""];
|
|
93
99
|
const fileName = posix.basename(yamlRelPath);
|
|
94
100
|
const heading = title ?? fileName;
|
|
95
101
|
const note = `> このページは \`${yamlRelPath}\` から生成された表示用ページです。正本は YAML ファイルであり、このページは再生成できます。`;
|
|
@@ -104,10 +110,7 @@ export function renderYamlPage(yamlRelPath, content) {
|
|
|
104
110
|
}
|
|
105
111
|
if (isDctTemplateCatalog(yamlRelPath, parsed)) {
|
|
106
112
|
return [
|
|
107
|
-
|
|
108
|
-
frontmatter,
|
|
109
|
-
"---",
|
|
110
|
-
"",
|
|
113
|
+
...header,
|
|
111
114
|
`# ${heading}`,
|
|
112
115
|
"",
|
|
113
116
|
note,
|
|
@@ -123,10 +126,7 @@ export function renderYamlPage(yamlRelPath, content) {
|
|
|
123
126
|
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
124
127
|
const body = content.endsWith("\n") ? content : `${content}\n`;
|
|
125
128
|
return [
|
|
126
|
-
|
|
127
|
-
frontmatter,
|
|
128
|
-
"---",
|
|
129
|
-
"",
|
|
129
|
+
...header,
|
|
130
130
|
`# ${heading}`,
|
|
131
131
|
"",
|
|
132
132
|
note,
|
package/dist/exec/core.js
CHANGED
|
@@ -12,10 +12,13 @@ import { buildPhaseModeIndex, resolveApproach, resolveTaskExecution, resolveTask
|
|
|
12
12
|
export const KNOWN_OWNER_LABELS = ["PO", "PM", "BA", "ARC", "DEV", "QE", "UX", "OPS"];
|
|
13
13
|
export const KNOWN_OWNER_LABELS_TEXT = KNOWN_OWNER_LABELS.join("|");
|
|
14
14
|
const KNOWN_APPROACHES = [
|
|
15
|
+
"draft",
|
|
15
16
|
"fully-guided",
|
|
16
17
|
"recipe-guided",
|
|
17
18
|
"freeform",
|
|
18
19
|
"bootstrap",
|
|
20
|
+
"catalog-planning",
|
|
21
|
+
"strategy-planning",
|
|
19
22
|
"rulebook-authoring",
|
|
20
23
|
"recipe-authoring",
|
|
21
24
|
"sample-authoring",
|
|
@@ -57,6 +57,13 @@ const PARENT_VALIDATION_REGISTRY = {
|
|
|
57
57
|
displayCommand: "npm run lint:md",
|
|
58
58
|
timeoutMs: 10 * 60 * 1_000,
|
|
59
59
|
},
|
|
60
|
+
"lint-mermaid": {
|
|
61
|
+
id: "lint-mermaid",
|
|
62
|
+
command: process.platform === "win32" ? "npm.cmd" : "npm",
|
|
63
|
+
args: ["run", "lint:mermaid"],
|
|
64
|
+
displayCommand: "npm run lint:mermaid",
|
|
65
|
+
timeoutMs: 10 * 60 * 1_000,
|
|
66
|
+
},
|
|
60
67
|
build: {
|
|
61
68
|
id: "build",
|
|
62
69
|
command: process.platform === "win32" ? "npm.cmd" : "npm",
|
|
@@ -77,6 +77,7 @@ function isRepoIntegrationState(value) {
|
|
|
77
77
|
return ((repo.status === "pending" ||
|
|
78
78
|
repo.status === "merged" ||
|
|
79
79
|
repo.status === "unchanged" ||
|
|
80
|
+
repo.status === "branch-only" ||
|
|
80
81
|
repo.status === "failed") &&
|
|
81
82
|
(typeof repo.commit === "string" || repo.commit === null) &&
|
|
82
83
|
(typeof repo.merged_at === "string" || repo.merged_at === null) &&
|
|
@@ -176,13 +177,15 @@ export function updatePipelineRepoIntegration(state, repo, patch, updatedAt) {
|
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
179
|
-
* Names of
|
|
180
|
+
* Names of repositories whose handling completed (`merged`, `unchanged` or `branch-only`) under
|
|
180
181
|
* `stages.integrate.repos`. A state without per-repository records yields an empty set.
|
|
181
182
|
*/
|
|
182
183
|
export function integratedRepoNames(state) {
|
|
183
184
|
const repos = state.stages.integrate?.repos ?? {};
|
|
184
185
|
return new Set(Object.entries(repos)
|
|
185
|
-
.filter(([, entry]) => entry.status === "merged" ||
|
|
186
|
+
.filter(([, entry]) => entry.status === "merged" ||
|
|
187
|
+
entry.status === "unchanged" ||
|
|
188
|
+
entry.status === "branch-only")
|
|
186
189
|
.map(([name]) => name));
|
|
187
190
|
}
|
|
188
191
|
function resolveArtifactRef(worktreePath, ref) {
|
package/dist/exec/plans-core.js
CHANGED
|
@@ -7,14 +7,15 @@ import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
|
7
7
|
import { kataDirsForKinds, resolveIncludedRulebooks, resolveKataRefs } from "../kata/kata.js";
|
|
8
8
|
import { resolveBasePath, resolveDeliverablePath } from "../catalog/paths.js";
|
|
9
9
|
import { isDctPlanFileName } from "../catalog/plan.js";
|
|
10
|
-
import { buildSpecdojoFrontmatter } from "../docs/frontmatter-namespace.js";
|
|
10
|
+
import { readSpecdojoNamespace, buildSpecdojoFrontmatter } from "../docs/frontmatter-namespace.js";
|
|
11
11
|
import { qualifyPracticeId, SPECDOJO_PRACTICE_AUTHORITY } from "../shared/practice-id.js";
|
|
12
12
|
import { MISSING } from "../shared/plan-templates.js";
|
|
13
13
|
export { MISSING, execTemplatePath, execTemplatesDir, injectCommonConventions, loadPlanTemplate, } from "../shared/plan-templates.js";
|
|
14
14
|
import { resolveViewpointsDoc, viewpointAppliesToDocument } from "../review/plan.js";
|
|
15
15
|
import { listFilesRecursive, nowUtcIsoSeconds, randomHex, tsForFilenameUtc } from "./shared.js";
|
|
16
|
-
import {
|
|
16
|
+
import { gradeResultPathForDocument, readGradeResultForDocument } from "../shared/grade-result.js";
|
|
17
17
|
import { renderReviewGradeSummary, reviewGradeFreshness } from "../review/grade.js";
|
|
18
|
+
import { planGradeFindingText } from "./plans-grade-findings.js";
|
|
18
19
|
export function execDocId(projectId, prefix, localBase) {
|
|
19
20
|
const localId = `${prefix}-${localBase.toLowerCase()}`;
|
|
20
21
|
return projectId ? `${projectId}:${localId}` : localId;
|
|
@@ -228,7 +229,7 @@ export function gradeFindingsText(projectId, targetPath) {
|
|
|
228
229
|
if (!result || result.findings.length === 0)
|
|
229
230
|
return "- なし";
|
|
230
231
|
return result.findings
|
|
231
|
-
.map((finding) => `- ${finding.id}
|
|
232
|
+
.map((finding) => `- ${finding.id} ${planGradeFindingText(finding)}`)
|
|
232
233
|
.join("\n");
|
|
233
234
|
}
|
|
234
235
|
catch {
|
|
@@ -314,6 +315,33 @@ export function deliverableDependsOn(deliverable, projectId, catalogPath) {
|
|
|
314
315
|
});
|
|
315
316
|
return `\n${lines.join("\n")}`;
|
|
316
317
|
}
|
|
318
|
+
// based_on is declared evidence, not a new dependency edge. Keep the document's IDs verbatim.
|
|
319
|
+
export function deliverableBasedOn(deliverable) {
|
|
320
|
+
if (!deliverable)
|
|
321
|
+
return "なし";
|
|
322
|
+
const path = resolve(specdojoRootDir(), deliverable.resolvedPath);
|
|
323
|
+
if (!/\.(md|mdx|yaml|yml|json)$/.test(path) || !existsSync(path))
|
|
324
|
+
return "なし";
|
|
325
|
+
let metadata;
|
|
326
|
+
try {
|
|
327
|
+
const content = readFileSync(path, "utf8");
|
|
328
|
+
const parsed = /\.mdx?$/.test(path)
|
|
329
|
+
? readSpecdojoNamespace(content)
|
|
330
|
+
: load(content);
|
|
331
|
+
metadata = (parsed?.specdojo ?? parsed);
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
// Invalid metadata is reported by document validation; it must not prevent plan generation.
|
|
335
|
+
return "なし";
|
|
336
|
+
}
|
|
337
|
+
const refs = metadata?.based_on;
|
|
338
|
+
if (!Array.isArray(refs))
|
|
339
|
+
return "なし";
|
|
340
|
+
const ids = [
|
|
341
|
+
...new Set(refs.filter((ref) => typeof ref === "string" && !!ref.trim())),
|
|
342
|
+
];
|
|
343
|
+
return ids.length ? ids.map((ref) => `[[${ref}]]`).join("、") : "なし";
|
|
344
|
+
}
|
|
317
345
|
const PROJECT_CONTEXT_EXCLUDED_APPROACHES = new Set([
|
|
318
346
|
"cross-deliverable-dedup",
|
|
319
347
|
"rulebook-authoring",
|
|
@@ -356,6 +384,24 @@ export function projectContextSection(refs, deliverable, approach, projectId) {
|
|
|
356
384
|
export function deliverableOverview(deliverable) {
|
|
357
385
|
return deliverable?.deliverable.overview ?? MISSING;
|
|
358
386
|
}
|
|
387
|
+
export function deliverableBrief(deliverable) {
|
|
388
|
+
const brief = deliverable?.deliverable.brief?.trim();
|
|
389
|
+
if (!brief)
|
|
390
|
+
return "";
|
|
391
|
+
if (!brief.includes("\n")) {
|
|
392
|
+
return brief;
|
|
393
|
+
}
|
|
394
|
+
if (brief.startsWith("-")) {
|
|
395
|
+
return `\n ${brief
|
|
396
|
+
.split("\n")
|
|
397
|
+
.map((line) => line.trimEnd())
|
|
398
|
+
.join("\n ")}`;
|
|
399
|
+
}
|
|
400
|
+
return brief
|
|
401
|
+
.split("\n")
|
|
402
|
+
.map((line, idx) => (idx === 0 ? line : ` ${line}`))
|
|
403
|
+
.join("\n");
|
|
404
|
+
}
|
|
359
405
|
export function implementationEvidence(deliverable) {
|
|
360
406
|
const refs = deliverable?.deliverable.evidence_refs ?? [];
|
|
361
407
|
if (refs.length === 0)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerInputSection } from "../register/input.js";
|
|
1
2
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import { DEFAULT_PROJECT_CONTEXT } from "../shared/specdojo-config.js";
|
|
@@ -5,7 +6,8 @@ import { resolveDeliverableSchemaRef, resolveKataRefs } from "../kata/kata.js";
|
|
|
5
6
|
import { formatMarkdownFile } from "./format.js";
|
|
6
7
|
import { expandTemplate } from "./shared.js";
|
|
7
8
|
import { isAuthoringApproach } from "../kata/authoring.js";
|
|
8
|
-
import {
|
|
9
|
+
import { isPlanningApproach } from "../register/planning.js";
|
|
10
|
+
import { MISSING, applicableReviewCriteria, crossDeliverableTargetDetails, deliverableDependsOn, deliverableBasedOn, deliverableBrief, deliverableName, deliverableOverview, deliverablePath, doneCriteriaChecklist, doneCriteriaGoals, doneCriteriaItems, execDocId, findDeliverableInfo, frontmatter, gradeFindingsText, gradeFindingTargetPath, gradeResultRef, gradeTargetKind, implementationEvidence, injectCommonConventions, kataRefState, loadPlanTemplate, loadRoles, loadViewpoints, ownerRoleFields, phaseDescriptionText, projectContextSection, repoRelativePath, reviewDoneCriteriaRows, reviewGradeSummaryText, rulebookIncludesText, targetDocIds, targetDocIdsForTask, } from "./plans-core.js";
|
|
9
11
|
function buildEditPlanMarkdown(template, task, deliverable, roleMap, vpMap, projectId, catalogPath, projectContext, resultRef, stem, crossDeliverables = new Map(), planOverrides) {
|
|
10
12
|
const cpm = task.cpm;
|
|
11
13
|
const onCriticalPath = cpm !== undefined && cpm.slack === 0;
|
|
@@ -37,6 +39,11 @@ function buildEditPlanMarkdown(template, task, deliverable, roleMap, vpMap, proj
|
|
|
37
39
|
_PHASE_DESCRIPTION_: phaseDescriptionText(task),
|
|
38
40
|
_DELIVERABLE_NAME_: deliverableName(deliverable),
|
|
39
41
|
_DELIVERABLE_DEPENDS_ON_: deliverableDependsOn(deliverable, projectId, catalogPath),
|
|
42
|
+
_DELIVERABLE_BASED_ON_: deliverableBasedOn(deliverable),
|
|
43
|
+
_REGISTER_INPUT_: registerInputSection(planOverrides?.registerInput)
|
|
44
|
+
? "下記「個票の入力(前提)」を参照。"
|
|
45
|
+
: "なし",
|
|
46
|
+
_DELIVERABLE_BRIEF_: deliverableBrief(deliverable),
|
|
40
47
|
_PROJECT_CONTEXT_: projectContextSection(projectContext, deliverable, task.approach, projectId),
|
|
41
48
|
_DELIVERABLE_OVERVIEW_: deliverableOverview(deliverable),
|
|
42
49
|
_IMPLEMENTATION_EVIDENCE_: deliverable?.catalogless
|
|
@@ -78,18 +85,39 @@ function buildEditPlanMarkdown(template, task, deliverable, roleMap, vpMap, proj
|
|
|
78
85
|
.filter((line) => !["recipe", "sample", "template"].some((kind) => refs[kind] === MISSING && line.includes(`_${kind.toUpperCase()}_REF_`)))
|
|
79
86
|
.join("\n")
|
|
80
87
|
: template;
|
|
81
|
-
|
|
88
|
+
const hasBrief = Boolean(deliverable?.deliverable.brief?.trim());
|
|
89
|
+
const templateWithoutBrief = hasBrief
|
|
90
|
+
? effectiveTemplate
|
|
91
|
+
: effectiveTemplate
|
|
92
|
+
.split("\n")
|
|
93
|
+
.filter((line) => !line.includes("_DELIVERABLE_BRIEF_"))
|
|
94
|
+
.join("\n");
|
|
95
|
+
const visibleTemplate = planOverrides?.origin === "register" && !planOverrides.registerInput?.length
|
|
96
|
+
? templateWithoutBrief
|
|
97
|
+
.split("\n")
|
|
98
|
+
.filter((line) => !line.includes("_REGISTER_INPUT_"))
|
|
99
|
+
.join("\n")
|
|
100
|
+
: templateWithoutBrief;
|
|
101
|
+
let body = expandTemplate(visibleTemplate, values);
|
|
82
102
|
if (deliverable?.catalogless && task.approach === "retrofit") {
|
|
83
103
|
body = body.replace("成果物カタログの `evidence_refs` から展開した", "個票に明記する");
|
|
84
104
|
}
|
|
105
|
+
const inputSection = registerInputSection(planOverrides?.registerInput);
|
|
106
|
+
if (inputSection) {
|
|
107
|
+
body = body.includes("_COMMON_CONVENTIONS_")
|
|
108
|
+
? body.replace("_COMMON_CONVENTIONS_", `${inputSection}\n_COMMON_CONVENTIONS_`)
|
|
109
|
+
: `${body.trimEnd()}\n\n${inputSection}`;
|
|
110
|
+
}
|
|
85
111
|
if (!planOverrides?.additionalConditions)
|
|
86
112
|
return body;
|
|
87
113
|
const section = [
|
|
88
114
|
"## 個票の追加完了条件",
|
|
89
115
|
"",
|
|
90
|
-
|
|
91
|
-
? "
|
|
92
|
-
:
|
|
116
|
+
isPlanningApproach(task.approach)
|
|
117
|
+
? "次の生成手順・完了条件と、個票が定める追加条件を満たす。"
|
|
118
|
+
: deliverable?.catalogless
|
|
119
|
+
? "個票が定める次の条件と rulebook を満たす。"
|
|
120
|
+
: "成果物カタログの `done_criteria` に加え、登録簿の個票が定める次の条件も満たす。",
|
|
93
121
|
"",
|
|
94
122
|
planOverrides.additionalConditions.trim(),
|
|
95
123
|
"",
|
|
@@ -127,6 +155,9 @@ function buildReviewPlanMarkdown(template, task, deliverable, criteria, vpMap, p
|
|
|
127
155
|
_PHASE_DESCRIPTION_: phaseDescriptionText(task),
|
|
128
156
|
_DELIVERABLE_NAME_: deliverableName(deliverable),
|
|
129
157
|
_DELIVERABLE_DEPENDS_ON_: deliverableDependsOn(deliverable, projectId, catalogPath),
|
|
158
|
+
_DELIVERABLE_BASED_ON_: deliverableBasedOn(deliverable),
|
|
159
|
+
_REGISTER_INPUT_: "なし",
|
|
160
|
+
_DELIVERABLE_BRIEF_: deliverableBrief(deliverable),
|
|
130
161
|
_PROJECT_CONTEXT_: projectContextSection(projectContext, deliverable, task.approach, projectId),
|
|
131
162
|
_DELIVERABLE_OVERVIEW_: deliverableOverview(deliverable),
|
|
132
163
|
_IMPLEMENTATION_EVIDENCE_: implementationEvidence(deliverable),
|
|
@@ -143,12 +174,20 @@ function buildReviewPlanMarkdown(template, task, deliverable, criteria, vpMap, p
|
|
|
143
174
|
_GRADE_SUMMARY_: reviewGradeSummaryText(projectId, gradeSubjectPath, reviewGradeOutcome),
|
|
144
175
|
_DONE_CRITERIA_ROWS_: reviewDoneCriteriaRows(applicableCriteria),
|
|
145
176
|
};
|
|
146
|
-
|
|
177
|
+
const hasBrief = Boolean(deliverable?.deliverable.brief?.trim());
|
|
178
|
+
const visibleTemplate = hasBrief
|
|
179
|
+
? template
|
|
180
|
+
: template
|
|
181
|
+
.split("\n")
|
|
182
|
+
.filter((line) => !line.includes("_DELIVERABLE_BRIEF_"))
|
|
183
|
+
.join("\n");
|
|
184
|
+
return expandTemplate(visibleTemplate, values);
|
|
147
185
|
}
|
|
148
186
|
async function writeTaskPlan(ctx, task, override) {
|
|
149
187
|
const mode = task.mode ?? "edit";
|
|
150
|
-
if (isAuthoringApproach(task.approach)
|
|
151
|
-
|
|
188
|
+
if ((isAuthoringApproach(task.approach) || isPlanningApproach(task.approach)) &&
|
|
189
|
+
override?.origin !== "register") {
|
|
190
|
+
throw new Error(`Approach ${task.approach} is register-only because schedule targets cannot express its target contract`);
|
|
152
191
|
}
|
|
153
192
|
const localId = task.local_id;
|
|
154
193
|
const targetLocalIds = [...new Set(task.target_local_ids ?? [])];
|
|
@@ -250,6 +289,7 @@ export async function generateRegisterApproachPlan(opts) {
|
|
|
250
289
|
targets: opts.targets,
|
|
251
290
|
...(opts.refs ? { refs: opts.refs } : {}),
|
|
252
291
|
...(opts.authoring ? { authoring: opts.authoring } : {}),
|
|
292
|
+
registerInput: opts.registerInput,
|
|
253
293
|
additionalConditions: opts.additionalConditions,
|
|
254
294
|
...(opts.outPath ? { outPath: opts.outPath } : {}),
|
|
255
295
|
stem: opts.stem,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { gradeFindingDisplayMessage } from "../shared/grade-result.js";
|
|
2
|
+
// 引用した文書や finding 本文の Markdown を、plan 自身のリンクとして解釈させない。
|
|
3
|
+
function inlineCode(value) {
|
|
4
|
+
const text = value.replace(/\r\n?|\n/g, " ").trim();
|
|
5
|
+
const longestRun = Math.max(0, ...(text.match(/`+/g) ?? []).map((run) => run.length));
|
|
6
|
+
const delimiter = "`".repeat(longestRun + 1);
|
|
7
|
+
// 端のバッククォートと区切りが結合しないよう、表示時に除去される空白を加える。
|
|
8
|
+
const padding = /^`|`$/.test(text) ? " " : "";
|
|
9
|
+
return `${delimiter}${padding}${text}${padding}${delimiter}`;
|
|
10
|
+
}
|
|
11
|
+
export function planGradeFindingText(finding) {
|
|
12
|
+
const anchor = inlineCode(JSON.stringify(finding.anchor));
|
|
13
|
+
const message = inlineCode(gradeFindingDisplayMessage(finding));
|
|
14
|
+
// register の箇条書き先頭でも [判定情報]: 本文 が参照リンク定義にならないようにする。
|
|
15
|
+
return `\\[${finding.severity}/${finding.rule}; line=${finding.line}; anchor=${anchor}\\]: ${message}`;
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import { loadCatalogDocs } from "../catalog/build.js";
|
|
4
|
+
import { loadTemplatesForDomain, resolvePlanPath } from "../catalog/plan.js";
|
|
5
|
+
import { resolveSpecdojoPath } from "../docs/template-resolution.js";
|
|
6
|
+
import { resolveKataRefs } from "../kata/kata.js";
|
|
7
|
+
import { planningTarget } from "../register/planning.js";
|
|
8
|
+
import { getProjectSchedulePath, getProjectTimelinePath, } from "../shared/specdojo-config.js";
|
|
9
|
+
export function planningPlanFields(opts) {
|
|
10
|
+
const unit = planningTarget(opts.approach, opts.target);
|
|
11
|
+
const path = (file) => relative(opts.repoRoot, file).replaceAll("\\", "/");
|
|
12
|
+
const catalogs = existsSync(opts.catalogPath) ? loadCatalogDocs(opts.catalogPath) : [];
|
|
13
|
+
const catalogRefs = catalogs
|
|
14
|
+
.map(({ doc, filePath }) => `- \`${doc.id}\`: \`${path(filePath)}\`(domain: \`${doc.domain}\`)`)
|
|
15
|
+
.join("\n") || "- なし。必要な上流入力を個票から確認する。";
|
|
16
|
+
const catalog = opts.approach === "catalog-planning";
|
|
17
|
+
const refs = resolveKataRefs(catalog ? "specdojo:dct-rulebook" : "specdojo:sch-rulebook");
|
|
18
|
+
const common = [
|
|
19
|
+
`### 作業単位と既存カタログ`,
|
|
20
|
+
"",
|
|
21
|
+
`対象: \`${opts.target}\`(project: \`${opts.projectId}\`)。既存カタログは読み取り、scope と依存関係の判断に取り込む。`,
|
|
22
|
+
"",
|
|
23
|
+
catalogRefs,
|
|
24
|
+
"",
|
|
25
|
+
"### 参照する実践の型",
|
|
26
|
+
"",
|
|
27
|
+
...Object.entries(refs).map(([kind, ref]) => `- ${kind}: \`${ref}\``),
|
|
28
|
+
"",
|
|
29
|
+
];
|
|
30
|
+
const projectArg = `--project ${opts.projectId}`;
|
|
31
|
+
if (catalog) {
|
|
32
|
+
const templates = loadTemplatesForDomain(resolveSpecdojoPath("docs/ja/specdojo/templates"), unit, opts.repoRoot);
|
|
33
|
+
if (templates.length === 0)
|
|
34
|
+
throw new Error(`No catalog template found for domain '${unit}'`);
|
|
35
|
+
const plan = path(resolvePlanPath(opts.catalogPath, unit));
|
|
36
|
+
common.push("### 判定・生成手順と完了条件", "", ...templates.map((template) => `- domain の雛形: \`${template.template.id}\`(\`${template.relPath}\`)`), "", `1. \`specdojo catalog plan prompt ${projectArg} --domain ${unit}\` を実行し、その入力文書・判定規約に従う。データフローがない場合は、個票が指定する上流資料を \`--input <path>\` で明示する。入力不足なら停止して必要資料を申し送る。`, "2. agent の判定を YAML に出力する。インスタンス・根拠・除外・未確定事項を記録する。既存カタログと kata を優先して参照し、テンプレート由来の構造を独自に再作成しない。", `3. \`specdojo catalog plan scaffold ${projectArg} --domain ${unit} --from <agent-output>.yaml\` で \`${plan}\` に検証保存する。prompt に入力を追加した場合は同じ \`--input\` を渡す。`, `4. \`specdojo catalog plan validate ${projectArg} --domain ${unit}\` を通す。blocking な \`open_questions\` を解消する。`, `5. \`specdojo catalog scaffold ${projectArg} --domain ${unit} --plan\` で \`dct-${unit}.yaml\`(物理分割時は全 part)を生成する。\`dct-index.yaml\` の \`size\` がない場合は個票の範囲に合わせて \`--size <small|medium|large>\` を明示する。既存ファイルは差分を確認し、必要な場合だけ \`--force\` を使う。`, `6. \`specdojo catalog validate ${projectArg}\` を通す。先に \`dct-index.yaml\` の全 domain の索引を整備し、生成した domain を登録する(物理分割も同じ domain の一項目とする)。判定計画とカタログの保存、参照・依存・完了条件の整合を完了基準とする。`, "7. 個票の作業内容・対応結果と実行記録に判断・検証結果を記録する。todo の close は runner と人が行う。close 後の `timeline build` が domain を `primary` と導く。`tml-index.yaml` は変更しない。");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const strategy = join(getProjectSchedulePath(opts.project), `sch-strategy-${unit}.yaml`).replaceAll("\\", "/");
|
|
40
|
+
common.push("### scope・intent の宣言と完了条件", "", `1. \`${join(getProjectTimelinePath(opts.project), "tml-index.yaml").replaceAll("\\", "/")}\` があれば対象 track の domains と依存・着手順を確認する。\`timeline build\` の register 由来の状態と既存カタログも確認する。`, `2. \`${strategy}\` に \`scope.catalogs\`(ID・リポジトリルートからのパス)、\`scope.include_kinds\` と \`approach_rules\` を宣言する。既存 scope の意図を保ち、各成果物の \`local_ids\` と \`intent\`(例: author-deliverable / bootstrap-kata-set / confirm-deliverable)、必要時の \`kata_target\` / \`bootstrap_scope\` を根拠付きで決める。`, "3. 主担当を `owner_rules` または生成時の `--owner` / `--default-owner` で明示する。`done_criteria.roles` を主担当と解釈しない。必要な kata の grade が不足なら先に評価し、不明な判断を推測で補わない。", " 人の文脈記入から始める場合は `intent: draft-with-context` を選ぶ。必要な kata がすべて利用可能なら `draft` profile(context → draft → refine → review → finalize)になる。context と finalize は human、他は agent とし、refine は `fully-guided` で磨き込む。", ` context の担当者は \`specdojo exec claim ${projectArg} --task <context-task-id> --by <human>\` で着手し、\`specdojo deliverable scaffold ${projectArg} --target <doc-id>\` で雛形を作る。既存成果物は上書きしない。本文の \`_CONTEXT_:\` に固定前提・制約・調査や選定を任せる範囲を書く(例: \`_CONTEXT_: 既存 API を維持し、認証方式の候補を調べて提案してほしい。\`)。result に記入内容を残して \`specdojo exec complete ${projectArg} --task <context-task-id> --by <human>\` で draft へ渡す。human 用の plan は生成しない。`, `4. \`specdojo schedule strategy generate ${projectArg} --track ${unit}\` を実行し、scope・intent・担当・依存関係に関するエラーを解消する。既存 strategy の変更は差分を確認し、必要な場合だけ \`--force\` を指定する。`, `5. \`specdojo schedule build ${projectArg} --track ${unit}\` を通し、\`sch-track-${unit}.yaml\` が生成され、scope の成果物とタスクの対応・依存が一致することを確認する。`, "6. strategy と track の保存、scope 全件の intent と担当の解決、生成・検証の成功を完了基準とし、個票の作業内容・対応結果と実行記録へ判断と検証を記録する。カタログ本体と `tml-index.yaml` は変更しない。");
|
|
41
|
+
}
|
|
42
|
+
return { refs, conditions: common.join("\n") };
|
|
43
|
+
}
|
|
@@ -3,8 +3,9 @@ import { join, relative } from "node:path";
|
|
|
3
3
|
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
4
4
|
import { nowUtcIsoSeconds, randomHex, tsForFilenameUtc } from "./shared.js";
|
|
5
5
|
import { readSpecdojoNamespace } from "../docs/frontmatter-namespace.js";
|
|
6
|
-
import {
|
|
6
|
+
import { gradeResultPathForDocument, readGradeResultForDocument } from "../shared/grade-result.js";
|
|
7
7
|
import { lookupDocIndex } from "../docs/doc-index.js";
|
|
8
|
+
import { planGradeFindingText } from "./plans-grade-findings.js";
|
|
8
9
|
export function archivePlan(opts, dependencies = {}) {
|
|
9
10
|
const plansDir = join(opts.executionPath, "exec", "plans");
|
|
10
11
|
const from = join(plansDir, `${opts.slug}-plan.md`);
|
|
@@ -39,10 +40,13 @@ export function loadPlan(executionPath, taskId) {
|
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
42
|
const PLAN_APPROACHES = [
|
|
43
|
+
"draft",
|
|
42
44
|
"fully-guided",
|
|
43
45
|
"recipe-guided",
|
|
44
46
|
"freeform",
|
|
45
47
|
"bootstrap",
|
|
48
|
+
"catalog-planning",
|
|
49
|
+
"strategy-planning",
|
|
46
50
|
"rulebook-authoring",
|
|
47
51
|
"recipe-authoring",
|
|
48
52
|
"sample-authoring",
|
|
@@ -132,7 +136,7 @@ export function registerGradeFindingsText(projectId, ticketPath) {
|
|
|
132
136
|
lines.push(` - 他 ${result.findings.length - MAX_FINDINGS} 件の finding があります。詳細はサイドカーを参照してください。`);
|
|
133
137
|
break;
|
|
134
138
|
}
|
|
135
|
-
lines.push(` -
|
|
139
|
+
lines.push(` - ${planGradeFindingText(finding)}`);
|
|
136
140
|
findingCount++;
|
|
137
141
|
}
|
|
138
142
|
docCount++;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { existsSync, linkSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { isValidBranchName } from "../shared/branch-template.js";
|
|
5
|
+
import { gitOutput, gitResult, worktreeNameFromTaskId } from "./worktree.js";
|
|
6
|
+
function recordDirectory(repoRoot) {
|
|
7
|
+
const common = gitOutput(repoRoot, ["rev-parse", "--git-common-dir"]).trim();
|
|
8
|
+
return resolve(repoRoot, common, "specdojo", "product-branches");
|
|
9
|
+
}
|
|
10
|
+
function recordPath(repoRoot, branch) {
|
|
11
|
+
return join(recordDirectory(repoRoot), `${createHash("sha256").update(branch).digest("hex")}.json`);
|
|
12
|
+
}
|
|
13
|
+
export function productBranchRecords(repoRoot) {
|
|
14
|
+
const directory = recordDirectory(repoRoot);
|
|
15
|
+
if (!existsSync(directory))
|
|
16
|
+
return [];
|
|
17
|
+
return readdirSync(directory)
|
|
18
|
+
.filter((name) => name.endsWith(".json"))
|
|
19
|
+
.map((name) => {
|
|
20
|
+
const record = JSON.parse(readFileSync(join(directory, name), "utf8"));
|
|
21
|
+
if (!record ||
|
|
22
|
+
typeof record !== "object" ||
|
|
23
|
+
!("taskId" in record) ||
|
|
24
|
+
!("branch" in record) ||
|
|
25
|
+
typeof record.taskId !== "string" ||
|
|
26
|
+
typeof record.branch !== "string") {
|
|
27
|
+
throw new Error(`Invalid runner product branch record: ${name}`);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
taskId: record.taskId,
|
|
31
|
+
branch: record.branch,
|
|
32
|
+
...("startCommit" in record && typeof record.startCommit === "string"
|
|
33
|
+
? { startCommit: record.startCommit }
|
|
34
|
+
: {}),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function recordedProductBranch(repoRoot, taskId) {
|
|
39
|
+
const records = productBranchRecords(repoRoot).filter((record) => record.taskId === taskId);
|
|
40
|
+
if (records.length > 1)
|
|
41
|
+
throw new Error(`Multiple runner product branches recorded for ${taskId}`);
|
|
42
|
+
return records[0]?.branch;
|
|
43
|
+
}
|
|
44
|
+
export function productBranchExists(repoRoot, branch) {
|
|
45
|
+
return (gitResult(repoRoot, ["show-ref", "--verify", "--quiet", `refs/heads/${branch}`]).status === 0);
|
|
46
|
+
}
|
|
47
|
+
/** A legacy name is usable only when no other task has explicitly claimed it. */
|
|
48
|
+
export function existingProductTaskBranch(repoRoot, taskId) {
|
|
49
|
+
const recorded = recordedProductBranch(repoRoot, taskId);
|
|
50
|
+
if (recorded)
|
|
51
|
+
return recorded;
|
|
52
|
+
const legacy = `exec/${worktreeNameFromTaskId(taskId)}`;
|
|
53
|
+
if (productBranchRecords(repoRoot).some((record) => record.branch === legacy))
|
|
54
|
+
return undefined;
|
|
55
|
+
return productBranchExists(repoRoot, legacy) ? legacy : undefined;
|
|
56
|
+
}
|
|
57
|
+
/** Legacy runs may be adopted only under their exact conventional branch name. */
|
|
58
|
+
export function assertProductBranchAvailable(repoRoot, taskId, branch) {
|
|
59
|
+
if (!isValidBranchName(repoRoot, branch)) {
|
|
60
|
+
throw new Error(`Invalid product branch name: ${branch}; use --branch <repo>=<name>`);
|
|
61
|
+
}
|
|
62
|
+
const owner = productBranchRecords(repoRoot).find((record) => record.branch === branch)?.taskId;
|
|
63
|
+
const legacy = branch === `exec/${worktreeNameFromTaskId(taskId)}`;
|
|
64
|
+
if ((owner && owner !== taskId) || (!owner && !legacy && productBranchExists(repoRoot, branch))) {
|
|
65
|
+
throw new Error(`Product branch ${branch} already exists or is reserved for ${owner ?? "another item"}; ` +
|
|
66
|
+
`change topic or use exec run --branch <repo>=<name> (no automatic suffix is added)`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** Exclusive creation also prevents concurrent tasks from reserving the same branch. */
|
|
70
|
+
export function reserveProductBranch(repoRoot, taskId, branch, startPoint = "HEAD") {
|
|
71
|
+
assertProductBranchAvailable(repoRoot, taskId, branch);
|
|
72
|
+
const previous = recordedProductBranch(repoRoot, taskId);
|
|
73
|
+
if (previous && previous !== branch) {
|
|
74
|
+
throw new Error(`Product branch for ${taskId} is already recorded as ${previous}; resume that branch or discard the old lifecycle before choosing ${branch}`);
|
|
75
|
+
}
|
|
76
|
+
mkdirSync(recordDirectory(repoRoot), { recursive: true });
|
|
77
|
+
const path = recordPath(repoRoot, branch);
|
|
78
|
+
if (existsSync(path))
|
|
79
|
+
return;
|
|
80
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
81
|
+
try {
|
|
82
|
+
const startCommit = gitOutput(repoRoot, [
|
|
83
|
+
"rev-parse",
|
|
84
|
+
"--verify",
|
|
85
|
+
`${startPoint}^{commit}`,
|
|
86
|
+
]).trim();
|
|
87
|
+
// Publish a complete record atomically; readers never observe partial JSON.
|
|
88
|
+
writeFileSync(temporary, JSON.stringify({ taskId, branch, startCommit }), { flag: "wx" });
|
|
89
|
+
linkSync(temporary, path);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error.code !== "EEXIST")
|
|
93
|
+
throw error;
|
|
94
|
+
assertProductBranchAvailable(repoRoot, taskId, branch);
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
if (existsSync(temporary))
|
|
98
|
+
unlinkSync(temporary);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export function forgetProductBranch(repoRoot, branch) {
|
|
102
|
+
const path = recordPath(repoRoot, branch);
|
|
103
|
+
if (existsSync(path))
|
|
104
|
+
unlinkSync(path);
|
|
105
|
+
}
|