specdojo 0.4.6 → 0.5.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 +14 -9
- package/CHANGELOG.md +62 -0
- package/dist/catalog/document-target.js +75 -0
- package/dist/commands/agent.js +2 -80
- package/dist/commands/init.js +3 -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/docs/yaml-pages.js +17 -17
- package/dist/exec/agent-config.js +28 -16
- package/dist/exec/agent-plan.js +108 -0
- package/dist/exec/commands.js +3 -3
- package/dist/exec/core.js +2 -0
- package/dist/exec/grade-checkpoint.js +12 -0
- package/dist/exec/pipeline-state.js +5 -2
- package/dist/exec/plans-core.js +7 -67
- package/dist/exec/plans-generation.js +28 -7
- package/dist/exec/plans-grade-findings.js +16 -0
- package/dist/exec/plans-planning.js +43 -0
- package/dist/exec/plans-storage.js +5 -2
- package/dist/exec/project.js +4 -1
- package/dist/exec/register.js +82 -6
- package/dist/exec/repo-integration-sync.js +9 -0
- package/dist/exec/repo-integration.js +17 -2
- package/dist/exec/repo-trace.js +17 -4
- package/dist/exec/results.js +2 -0
- package/dist/exec/run/lifecycle-commands.js +2 -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 +23 -0
- package/dist/exec/run/register-state.js +4 -1
- package/dist/exec/run/register-worktree.js +28 -1
- package/dist/exec/run/schedule-prepare.js +7 -1
- package/dist/exec/strategy.js +2 -0
- package/dist/exec/task-repos.js +18 -4
- package/dist/exec/worktree-command.js +8 -1
- package/dist/exec/worktree-ops-commit.js +7 -1
- package/dist/exec/worktree-ops-merge.js +40 -1
- package/dist/grade/apply.js +13 -7
- package/dist/grade/command-inspect.js +2 -1
- package/dist/grade/command-run.js +39 -0
- package/dist/grade/grade.js +3 -1
- package/dist/grade/markdown.js +11 -6
- package/dist/grade/pipeline-state.js +8 -6
- package/dist/grade/plan.js +14 -10
- package/dist/grade/run.js +307 -0
- package/dist/grade/target-discovery.js +1 -1
- package/dist/grade/targets.js +44 -22
- package/dist/register/approach.js +35 -0
- package/dist/register/catalog-status.js +49 -0
- package/dist/register/core.js +5 -0
- package/dist/register/create-commands.js +83 -5
- package/dist/register/deliverable-target.js +215 -0
- 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 +5 -2
- package/dist/register/events.js +8 -0
- package/dist/register/external-project.js +4 -0
- package/dist/register/item.js +18 -0
- package/dist/register/maintenance-commands.js +7 -1
- package/dist/register/planning.js +37 -0
- package/dist/register/register.js +5 -1
- package/dist/register/renumber.js +12 -4
- package/dist/register/views.js +55 -4
- package/dist/review/grade.js +19 -17
- 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 +1 -1
- package/dist/shared/agent-plan.js +1 -0
- package/dist/shared/agent-types.js +3 -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/provider-scaffold.js +5 -3
- package/dist/shared/specdojo-config.js +10 -3
- package/dist/shared/specdojo-gitignore.js +4 -0
- package/dist/specdojo.js +5 -1
- package/docs/ja/specdojo/exec-templates/xep-catalog-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xep-strategy-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xrp-freeform-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-recipe-guided-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-recipe-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-retrofit-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-rulebook-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-sample-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-template-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-template.md +2 -2
- 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 +44 -12
- package/docs/ja/specdojo/guides/exec-operation-guide.md +20 -15
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +19 -1
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +3 -1
- package/docs/ja/specdojo/guides/practice-system-composition-guide.md +2 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +59 -16
- package/docs/ja/specdojo/guides/register-operation-guide.md +44 -15
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +15 -1
- package/docs/ja/specdojo/guides/review-guide.md +2 -2
- package/docs/ja/specdojo/guides/ryu-guide.md +12 -0
- 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/tsd-recipe.md +198 -0
- package/docs/ja/specdojo/references/command-reference.md +92 -29
- package/docs/ja/specdojo/references/specdojo-config-reference.md +49 -16
- 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 +1 -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 +56 -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 +1 -0
- 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/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 +28 -3
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +2 -0
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +16 -11
- package/docs/ja/specdojo/standards/sample-authoring-standard.md +1 -0
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +1 -1
- 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/specdojo/schemas/v1/bdd.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +24 -16
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +4 -1
- 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/grade-pipeline-state.schema.yaml +1 -1
- 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 +20 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +73 -4
- package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +5 -0
- package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +21 -3
- package/package.json +2 -2
- package/templates/antigravity/orchestrator.md +14 -9
- package/templates/claude/agents/specdojo-orchestrator.md +14 -9
- package/templates/codex/agents/specdojo-orchestrator.toml +14 -9
- package/templates/codex/orchestrator.md +14 -9
- package/templates/copilot/README.md +2 -1
- package/templates/devcontainer/devcontainer.json +1 -0
- package/templates/init-agent-members.yaml +46 -3
- package/templates/opencode/README.md +118 -14
- package/templates/opencode/agents/specdojo-orchestrator.md +15 -10
- package/templates/opencode/opencode.json +25 -0
|
@@ -71,12 +71,12 @@ export function renumberReferences(content, fromDocId, toDocId) {
|
|
|
71
71
|
// から参照する project 修飾形の両方を対象にする。
|
|
72
72
|
function renumberDerivedFromReferences(content, filename, sourceProjectId, fromId, toId) {
|
|
73
73
|
const parsed = readRegisterItemContent(content, filename);
|
|
74
|
-
if (!parsed
|
|
74
|
+
if (!parsed)
|
|
75
75
|
return { content, changed: false };
|
|
76
76
|
const docId = readSpecdojoFields(content).id;
|
|
77
77
|
const referencingProjectId = typeof docId === "string" && docId.includes(":") ? docId.split(":", 1)[0] : undefined;
|
|
78
78
|
let changed = false;
|
|
79
|
-
const
|
|
79
|
+
const rewrite = (ref) => {
|
|
80
80
|
if (referencingProjectId === sourceProjectId && ref === fromId) {
|
|
81
81
|
changed = true;
|
|
82
82
|
return toId;
|
|
@@ -86,9 +86,17 @@ function renumberDerivedFromReferences(content, filename, sourceProjectId, fromI
|
|
|
86
86
|
return `${sourceProjectId}:${toId}`;
|
|
87
87
|
}
|
|
88
88
|
return ref;
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
|
+
const derivedFrom = parsed.item.derivedFrom?.map(rewrite);
|
|
91
|
+
const dependsOn = parsed.item.dependsOn?.map(rewrite);
|
|
90
92
|
return changed
|
|
91
|
-
? {
|
|
93
|
+
? {
|
|
94
|
+
content: applyRegisterItemFields(content, {
|
|
95
|
+
...(derivedFrom ? { derived_from: derivedFrom } : {}),
|
|
96
|
+
...(dependsOn ? { depends_on: dependsOn } : {}),
|
|
97
|
+
}),
|
|
98
|
+
changed,
|
|
99
|
+
}
|
|
92
100
|
: { content, changed };
|
|
93
101
|
}
|
|
94
102
|
// topic 変更で書き換える全ファイルを事前に算出する。参照の更新範囲は renumber と
|
package/dist/register/views.js
CHANGED
|
@@ -149,9 +149,9 @@ function markdownLink(label, fromDirectory, targetPath) {
|
|
|
149
149
|
const href = path.startsWith(".") ? path : `./${path}`;
|
|
150
150
|
return `[${toCell(label)}](${href})`;
|
|
151
151
|
}
|
|
152
|
-
function generateDerivedItemsFile(paths, items) {
|
|
152
|
+
function generateDerivedItemsFile(paths, items, relationField = "derivedFrom") {
|
|
153
153
|
const sourceDocs = new Map(items.flatMap((view) => (view.ticketPath ? [[view.id, view.ticketPath]] : [])));
|
|
154
|
-
const rows = collectDerivedRegisterRelations(paths, items).map((relation) => {
|
|
154
|
+
const rows = collectDerivedRegisterRelations(paths, items, relationField).map((relation) => {
|
|
155
155
|
const sourcePath = sourceDocs.get(relation.sourceId);
|
|
156
156
|
const sourceCell = sourcePath
|
|
157
157
|
? markdownLink(relation.sourceId, paths.generatedPath, sourcePath)
|
|
@@ -172,11 +172,15 @@ function generateDerivedItemsFile(paths, items) {
|
|
|
172
172
|
});
|
|
173
173
|
const table = [
|
|
174
174
|
"<!-- prettier-ignore -->",
|
|
175
|
-
|
|
175
|
+
relationField === "dependsOn"
|
|
176
|
+
? "| 先行項目 | 後続項目 | 分類 | ステータス | タイトル |"
|
|
177
|
+
: "| 元の項目 | 派生先 | 分類 | ステータス | タイトル |",
|
|
176
178
|
"| --- | --- | --- | --- | --- |",
|
|
177
179
|
...rows,
|
|
178
180
|
].join("\n");
|
|
179
|
-
const template = loadViewTemplate("
|
|
181
|
+
const template = loadViewTemplate(relationField === "dependsOn"
|
|
182
|
+
? "pjr-dependent-items-template.md"
|
|
183
|
+
: "pjr-derived-items-template.md", paths.projectId);
|
|
180
184
|
return injectViewSlots(template, { "derived-items": table });
|
|
181
185
|
}
|
|
182
186
|
function generateTypeFilterView(items, type, templateFileName, projectId, heading) {
|
|
@@ -186,6 +190,47 @@ function generateTypeFilterView(items, type, templateFileName, projectId, headin
|
|
|
186
190
|
table: ["<!-- prettier-ignore -->", makeTable(filtered, heading)].join("\n"),
|
|
187
191
|
});
|
|
188
192
|
}
|
|
193
|
+
function generateEpicItemsFile(paths, items) {
|
|
194
|
+
const relations = collectDerivedRegisterRelations(paths, items);
|
|
195
|
+
const groups = items
|
|
196
|
+
.filter((view) => view.item.type === "epic")
|
|
197
|
+
.map((epic, index) => {
|
|
198
|
+
const label = epic.ticketPath
|
|
199
|
+
? markdownLink(epic.id, paths.generatedPath, epic.ticketPath)
|
|
200
|
+
: epic.id;
|
|
201
|
+
const children = relations.filter((relation) => relation.sourceId === epic.id);
|
|
202
|
+
const rows = children.map((child) => {
|
|
203
|
+
const id = child.derivedProjectId === paths.projectId
|
|
204
|
+
? child.derivedItem.id
|
|
205
|
+
: `${child.derivedProjectId}:${child.derivedItem.id}`;
|
|
206
|
+
return `| ${[
|
|
207
|
+
markdownLink(id, paths.generatedPath, child.derivedTicketPath),
|
|
208
|
+
child.derivedItem.type,
|
|
209
|
+
child.derivedItem.status,
|
|
210
|
+
child.derivedItem.title,
|
|
211
|
+
]
|
|
212
|
+
.map(toCell)
|
|
213
|
+
.join(" | ")} |`;
|
|
214
|
+
});
|
|
215
|
+
return [
|
|
216
|
+
`### 1.${index + 1}. ${label} ${toCell(epic.item.title)}`,
|
|
217
|
+
"",
|
|
218
|
+
`track: ${toCell(epic.item.track ?? "-")} / ステータス: ${toCell(epic.item.status)}`,
|
|
219
|
+
"",
|
|
220
|
+
...(rows.length === 0
|
|
221
|
+
? ["子項目なし"]
|
|
222
|
+
: [
|
|
223
|
+
"<!-- prettier-ignore -->",
|
|
224
|
+
"| 子項目 | 分類 | ステータス | タイトル |",
|
|
225
|
+
"| --- | --- | --- | --- |",
|
|
226
|
+
...rows,
|
|
227
|
+
]),
|
|
228
|
+
].join("\n");
|
|
229
|
+
});
|
|
230
|
+
return injectViewSlots(loadViewTemplate("pjr-epic-items-template.md", paths.projectId), {
|
|
231
|
+
"epic-items": groups.join("\n\n") || "該当なし",
|
|
232
|
+
});
|
|
233
|
+
}
|
|
189
234
|
export const VALID_BUILD_SCOPES = ["register", "controls", "all"];
|
|
190
235
|
export function generateDerivedViewFiles(paths, scope) {
|
|
191
236
|
// 項目の値は個票 frontmatter(正本)から集める。列見出しは template から採用するため、
|
|
@@ -220,6 +265,12 @@ export function generateDerivedViewFiles(paths, scope) {
|
|
|
220
265
|
}, {
|
|
221
266
|
path: join(paths.generatedPath, "pjr-derived-items.md"),
|
|
222
267
|
content: generateDerivedItemsFile(paths, itemViews),
|
|
268
|
+
}, {
|
|
269
|
+
path: join(paths.generatedPath, "pjr-dependent-items.md"),
|
|
270
|
+
content: generateDerivedItemsFile(paths, itemViews, "dependsOn"),
|
|
271
|
+
}, {
|
|
272
|
+
path: join(paths.generatedPath, "pjr-epic-items.md"),
|
|
273
|
+
content: generateEpicItemsFile(paths, itemViews),
|
|
223
274
|
});
|
|
224
275
|
}
|
|
225
276
|
if (scope === "controls" || scope === "all") {
|
package/dist/review/grade.js
CHANGED
|
@@ -2,8 +2,8 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { gitEnvironment } from "../shared/git-environment.js";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { gradeContentHash, gradeFindingDisplayMessage, gradeResultPathForDocument, parseGradeResult, } from "../shared/grade-result.js";
|
|
6
|
-
export const REVIEW_GRADE_SCRIPT = join("tools", "grade", "run-per-document.sh");
|
|
7
7
|
function errorMessage(error) {
|
|
8
8
|
return error instanceof Error ? error.message : String(error);
|
|
9
9
|
}
|
|
@@ -59,10 +59,10 @@ export function reviewGradeFreshness(opts) {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Decide whether the runner grades the subject before the review plan is written. A fresh grade is
|
|
62
|
-
* reused; an unresolved subject
|
|
62
|
+
* reused; an unresolved subject cannot be graded.
|
|
63
63
|
*/
|
|
64
64
|
export function decideReviewGradeAction(opts) {
|
|
65
|
-
const { freshness,
|
|
65
|
+
const { freshness, dryRun } = opts;
|
|
66
66
|
if (freshness.state === "fresh")
|
|
67
67
|
return { run: false, outcome: { action: "skipped" } };
|
|
68
68
|
if (freshness.state === "unresolved") {
|
|
@@ -70,15 +70,6 @@ export function decideReviewGradeAction(opts) {
|
|
|
70
70
|
}
|
|
71
71
|
if (dryRun)
|
|
72
72
|
return { run: false, outcome: { action: "not-run", detail: "dry-run のため実行しない" } };
|
|
73
|
-
if (!scriptAvailable) {
|
|
74
|
-
return {
|
|
75
|
-
run: false,
|
|
76
|
-
outcome: {
|
|
77
|
-
action: "not-run",
|
|
78
|
-
detail: `grade の実行スクリプトがリポジトリにない: ${REVIEW_GRADE_SCRIPT.split("\\").join("/")}`,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
73
|
return { run: true };
|
|
83
74
|
}
|
|
84
75
|
export function reviewGradeRunId(taskId, now) {
|
|
@@ -91,7 +82,8 @@ export function reviewGradeRunId(taskId, now) {
|
|
|
91
82
|
}
|
|
92
83
|
export function reviewGradeArgs(opts) {
|
|
93
84
|
const args = [
|
|
94
|
-
|
|
85
|
+
"grade",
|
|
86
|
+
"run",
|
|
95
87
|
"--run-id",
|
|
96
88
|
opts.runId,
|
|
97
89
|
"--project",
|
|
@@ -103,6 +95,10 @@ export function reviewGradeArgs(opts) {
|
|
|
103
95
|
if (opts.target === "kata")
|
|
104
96
|
args.push("--kind", "all");
|
|
105
97
|
args.push("--path", opts.subjectPath);
|
|
98
|
+
if (opts.by)
|
|
99
|
+
args.push("--by", opts.by);
|
|
100
|
+
if (opts.execDefaultsPath)
|
|
101
|
+
args.push("--exec-defaults", opts.execDefaultsPath);
|
|
106
102
|
return args;
|
|
107
103
|
}
|
|
108
104
|
const defaultInvoke = (command, args, cwd) => new Promise((resolvePromise) => {
|
|
@@ -140,7 +136,6 @@ export async function ensureReviewGrade(opts) {
|
|
|
140
136
|
});
|
|
141
137
|
const decision = decideReviewGradeAction({
|
|
142
138
|
freshness,
|
|
143
|
-
scriptAvailable: existsSync(join(opts.repoRoot, REVIEW_GRADE_SCRIPT)),
|
|
144
139
|
dryRun: opts.dryRun,
|
|
145
140
|
});
|
|
146
141
|
if (!decision.run)
|
|
@@ -151,21 +146,28 @@ export async function ensureReviewGrade(opts) {
|
|
|
151
146
|
projectId: opts.projectId,
|
|
152
147
|
target: opts.target,
|
|
153
148
|
subjectPath: opts.subjectPath,
|
|
149
|
+
by: opts.by,
|
|
150
|
+
execDefaultsPath: opts.execDefaultsPath,
|
|
154
151
|
});
|
|
155
152
|
const invoke = opts.invoke ?? defaultInvoke;
|
|
156
153
|
try {
|
|
157
|
-
|
|
154
|
+
// Resolve the entrypoint from this package, never from the consumer repository.
|
|
155
|
+
const javascript = fileURLToPath(new URL("../specdojo.js", import.meta.url));
|
|
156
|
+
const entryArgs = existsSync(javascript)
|
|
157
|
+
? [javascript]
|
|
158
|
+
: ["--import", "tsx", fileURLToPath(new URL("../specdojo.ts", import.meta.url))];
|
|
159
|
+
const { exitCode, stderr } = await invoke(process.execPath, [...entryArgs, ...args], opts.repoRoot);
|
|
158
160
|
if (exitCode === 0)
|
|
159
161
|
return { action: "executed", runId };
|
|
160
162
|
const reason = lastLine(stderr);
|
|
161
163
|
return {
|
|
162
164
|
action: "failed",
|
|
163
165
|
runId,
|
|
164
|
-
detail:
|
|
166
|
+
detail: `${opts.subjectPath}: exit ${exitCode}${reason ? `: ${reason}` : ""}`,
|
|
165
167
|
};
|
|
166
168
|
}
|
|
167
169
|
catch (error) {
|
|
168
|
-
return { action: "failed", runId, detail: errorMessage(error) };
|
|
170
|
+
return { action: "failed", runId, detail: `${opts.subjectPath}: ${errorMessage(error)}` };
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
function outcomeLine(outcome) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
2
2
|
import { existsSync, readdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dump } from "../shared/yaml.js";
|
|
4
|
-
import { getProjectCatalogPath, getProjectRolesPath, getProjectSchedulePath, getProjectTimelinePath, loadConfig, loadEnv, loadMemberRoster, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
4
|
+
import { getProjectCatalogPath, getProjectRolesPath, getProjectSchedulePath, getProjectTimelinePath, getProjectRegisterPath, loadConfig, loadEnv, loadMemberRoster, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
5
5
|
import { buildScheduleTrack, } from "./build.js";
|
|
6
6
|
import { readYaml } from "../shared/fs.js";
|
|
7
7
|
import { resolveSpecdojoPath } from "../docs/template-resolution.js";
|
|
@@ -255,11 +255,13 @@ function registerScheduleStrategyCommands(sch) {
|
|
|
255
255
|
if (!context.catalogPath) {
|
|
256
256
|
throw new Error(`catalog_path not set for project '${context.projectId}'.`);
|
|
257
257
|
}
|
|
258
|
+
const registerPath = getProjectRegisterPath(context.project);
|
|
258
259
|
const result = generateStrategy({
|
|
259
260
|
repoRoot: context.baseDir,
|
|
260
261
|
schedulePath: context.schedulePath,
|
|
261
262
|
catalogPath: context.catalogPath,
|
|
262
263
|
timelinePath: context.timelinePath,
|
|
264
|
+
...(registerPath ? { registerPath: resolve(context.baseDir, registerPath) } : {}),
|
|
263
265
|
...(context.rolesPath ? { rolesPath: context.rolesPath } : {}),
|
|
264
266
|
projectId: context.projectId,
|
|
265
267
|
track,
|
|
@@ -5,6 +5,7 @@ import { resolveBasePath } from "../catalog/paths.js";
|
|
|
5
5
|
import { collectCatalogFilesByDomain } from "../shared/catalog-files.js";
|
|
6
6
|
import { readYaml } from "../shared/fs.js";
|
|
7
7
|
import { loadTimelineIndex } from "../shared/timeline-index.js";
|
|
8
|
+
import { resolveTimelineCatalogStatus } from "../register/catalog-status.js";
|
|
8
9
|
export function isRecord(value) {
|
|
9
10
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
11
|
}
|
|
@@ -44,6 +45,9 @@ export function resolveTrackScopeCatalogs(opts) {
|
|
|
44
45
|
const indexFile = join(timelinePath, "tml-index.yaml");
|
|
45
46
|
if (existsSync(indexFile)) {
|
|
46
47
|
const { index, errors: loadErrors } = loadTimelineIndex(indexFile);
|
|
48
|
+
const derived = resolveTimelineCatalogStatus(index.tracks, opts.registerPath);
|
|
49
|
+
index.tracks = derived.tracks;
|
|
50
|
+
warnings.push(...derived.warnings);
|
|
47
51
|
if (loadErrors.length > 0) {
|
|
48
52
|
warnings.push(`${basename(indexFile)}: ${loadErrors.join(" / ")}`);
|
|
49
53
|
}
|
|
@@ -63,7 +67,7 @@ export function resolveTrackScopeCatalogs(opts) {
|
|
|
63
67
|
}
|
|
64
68
|
if (plan.catalog_status !== "primary") {
|
|
65
69
|
warnings.push(`timeline: track '${track}' の catalog_status は '${plan.catalog_status}'。` +
|
|
66
|
-
|
|
70
|
+
`カタログ作成 todo の完了を確認して timeline build を実行する。todo がない domain は手書きの計画値を使う。`);
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
else {
|
|
@@ -250,7 +250,7 @@ export const STRATEGY_PROFILES = {
|
|
|
250
250
|
};
|
|
251
251
|
export function profileFor(approach) {
|
|
252
252
|
if (!(approach in STRATEGY_PROFILES)) {
|
|
253
|
-
throw new Error(`Approach "${approach}" has no schedule strategy profile; kata authoring approaches are register-only`);
|
|
253
|
+
throw new Error(`Approach "${approach}" has no schedule strategy profile; kata authoring and planning approaches are register-only`);
|
|
254
254
|
}
|
|
255
255
|
return STRATEGY_PROFILES[approach];
|
|
256
256
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
// cross-deliverable-dedup は明示した成果物群を横断して正本を選び、重複を要約と参照へ置換する。
|
|
8
8
|
// finalize は human が成果物のみを最終確認して status を ready へ確定する進め方、
|
|
9
9
|
// bootstrap-finalize は bootstrap と対になり、成果物と参考資料一式をまとめて確定する進め方。
|
|
10
|
+
// catalog-planning / strategy-planning は register の domain / track 単位で計画を生成する。
|
|
10
11
|
export const APPROACHES = [
|
|
11
12
|
"fully-guided",
|
|
12
13
|
"recipe-guided",
|
|
13
14
|
"freeform",
|
|
14
15
|
"bootstrap",
|
|
16
|
+
"catalog-planning",
|
|
17
|
+
"strategy-planning",
|
|
15
18
|
"rulebook-authoring",
|
|
16
19
|
"recipe-authoring",
|
|
17
20
|
"sample-authoring",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
-
import { join, resolve } from "node:path";
|
|
2
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
3
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { load } from "./yaml.js";
|
|
5
|
-
import { getProjectExecutionPath, loadConfig, specdojoRootDir } from "./specdojo-config.js";
|
|
5
|
+
import { getProjectExecutionPath, loadConfig, resolveRepoRoot, specdojoRootDir, } from "./specdojo-config.js";
|
|
6
6
|
const DOCUMENT_ID_RE = /^[a-z0-9][a-z0-9-:]*$/;
|
|
7
7
|
export const SEVERITIES = ["blocker", "major", "minor", "note"];
|
|
8
8
|
function isRecord(value) {
|
|
@@ -24,7 +24,7 @@ export function markdownDocumentId(content, path) {
|
|
|
24
24
|
return id;
|
|
25
25
|
}
|
|
26
26
|
export function resolveGradeResultsDirectory(projectOption, rootDir = specdojoRootDir()) {
|
|
27
|
-
const { config } = loadConfig();
|
|
27
|
+
const { config } = loadConfig(rootDir);
|
|
28
28
|
if (!config)
|
|
29
29
|
throw new Error("grade commands require .specdojo/specdojo.config.json");
|
|
30
30
|
const projectId = projectOption?.trim() || config.current_project || Object.keys(config.projects)[0] || "";
|
|
@@ -48,7 +48,25 @@ export function gradeResultPathForDocument(opts) {
|
|
|
48
48
|
const rootDir = opts.rootDir ?? specdojoRootDir();
|
|
49
49
|
const absolute = resolve(rootDir, opts.documentPath);
|
|
50
50
|
const content = readFileSync(absolute, "utf8");
|
|
51
|
-
|
|
51
|
+
const { config } = loadConfig(rootDir);
|
|
52
|
+
const projectId = opts.project?.trim() || config?.current_project || Object.keys(config?.projects ?? {})[0];
|
|
53
|
+
const project = projectId ? config?.projects[projectId] : undefined;
|
|
54
|
+
const documentRealPath = realpathSync(absolute);
|
|
55
|
+
// 宣言済み repo の実体で判定し、相対・絶対パスや worktree の配置によらず同じ場所を使う。
|
|
56
|
+
const repo = (project?.repos ?? [])
|
|
57
|
+
.map((entry) => {
|
|
58
|
+
const root = resolveRepoRoot(rootDir, entry);
|
|
59
|
+
return { name: entry.name, root: existsSync(root) ? realpathSync(root) : root };
|
|
60
|
+
})
|
|
61
|
+
.sort((a, b) => b.root.length - a.root.length)
|
|
62
|
+
.find(({ root }) => {
|
|
63
|
+
const rel = relative(root, documentRealPath);
|
|
64
|
+
return rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
65
|
+
});
|
|
66
|
+
const resultsDirectory = opts.resultsDirectory
|
|
67
|
+
? resolve(rootDir, opts.resultsDirectory)
|
|
68
|
+
: resolveGradeResultsDirectory(opts.project, rootDir);
|
|
69
|
+
return gradeResultPath(repo ? join(resultsDirectory, repo.name) : resultsDirectory, markdownDocumentId(content, opts.documentPath));
|
|
52
70
|
}
|
|
53
71
|
export function parseGradeResult(content, path) {
|
|
54
72
|
const parsed = load(content);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { existsSync, readdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { dump } from "js-yaml";
|
|
4
|
+
// Keep the fallback result check and every scaffold on the same document rules.
|
|
5
|
+
export const DEFAULT_MARKDOWNLINT_CONFIG = {
|
|
6
|
+
MD013: false,
|
|
7
|
+
MD024: false,
|
|
8
|
+
MD033: false,
|
|
9
|
+
MD036: false,
|
|
10
|
+
MD041: false,
|
|
11
|
+
MD060: false,
|
|
12
|
+
};
|
|
13
|
+
// These are the project files read by markdownlint-cli (CLI2 uses a separate config).
|
|
14
|
+
export function hasMarkdownlintConfig(repoRoot) {
|
|
15
|
+
if (["jsonc", "json", "yaml", "yml"].some((ext) => existsSync(join(repoRoot, `.markdownlint.${ext}`))))
|
|
16
|
+
return true;
|
|
17
|
+
// markdownlint-cli also discovers .markdownlintrc in parent directories.
|
|
18
|
+
for (let dir = repoRoot;; dir = dirname(dir)) {
|
|
19
|
+
if (existsSync(join(dir, ".markdownlintrc")))
|
|
20
|
+
return true;
|
|
21
|
+
if (dirname(dir) === dir)
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function ensureMarkdownlintConfig(repoRoot, dryRun) {
|
|
26
|
+
const hasExistingConfig = readdirSync(repoRoot).some((file) => file.startsWith(".markdownlint.") || file.startsWith(".markdownlint-cli2."));
|
|
27
|
+
if (hasMarkdownlintConfig(repoRoot) || hasExistingConfig) {
|
|
28
|
+
process.stdout.write("Kept existing markdownlint settings.\n");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const content = dump(DEFAULT_MARKDOWNLINT_CONFIG);
|
|
32
|
+
if (dryRun) {
|
|
33
|
+
process.stdout.write(`[dry-run] would write: .markdownlint.yaml\n${content}`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
writeFileSync(join(repoRoot, ".markdownlint.yaml"), content, { encoding: "utf8", flag: "wx" });
|
|
37
|
+
process.stdout.write("Written: .markdownlint.yaml\n");
|
|
38
|
+
}
|
|
@@ -2,14 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { readdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { dump } from "js-yaml";
|
|
5
|
-
|
|
6
|
-
MD013: false,
|
|
7
|
-
MD024: false,
|
|
8
|
-
MD033: false,
|
|
9
|
-
MD036: false,
|
|
10
|
-
MD041: false,
|
|
11
|
-
MD060: false,
|
|
12
|
-
};
|
|
5
|
+
import { DEFAULT_MARKDOWNLINT_CONFIG } from "./markdownlint-config.js";
|
|
13
6
|
// Slide boundaries and per-slide frontmatter interrupt normal Markdown blocks.
|
|
14
7
|
// Each slide may start with its own H1 or use a heading level chosen for its layout.
|
|
15
8
|
const SLIDEV_CONFIG = {
|
|
@@ -24,7 +17,7 @@ export async function writeMarkdownlintConfigs(opts) {
|
|
|
24
17
|
const legacyConfigs = files.filter((file) => file.startsWith(".markdownlint."));
|
|
25
18
|
const cli2Configs = files.filter((file) => file.startsWith(".markdownlint-cli2."));
|
|
26
19
|
const hasRc = existsSync(path.join(opts.repoRoot, ".markdownlintrc"));
|
|
27
|
-
const rcContent = `${JSON.stringify(
|
|
20
|
+
const rcContent = `${JSON.stringify(DEFAULT_MARKDOWNLINT_CONFIG, null, 2)}\n`;
|
|
28
21
|
const cli2Content = dump({
|
|
29
22
|
config: { extends: ".markdownlintrc" },
|
|
30
23
|
...(opts.slidevKataPatterns?.length
|
|
@@ -75,9 +75,11 @@ export async function buildProviderScaffoldPlan(opts) {
|
|
|
75
75
|
relFile === PROVIDER_GLOBAL_SETTINGS[provider]?.templateRelPath) {
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
const destinationRelPath =
|
|
79
|
-
?
|
|
80
|
-
:
|
|
78
|
+
const destinationRelPath = provider === "opencode" && relFile === "opencode.json"
|
|
79
|
+
? "opencode.json"
|
|
80
|
+
: relFile.startsWith("agents/") || relFile.startsWith("rules/")
|
|
81
|
+
? `.${provider}/${relFile}`
|
|
82
|
+
: `.specdojo/${provider}/${relFile}`;
|
|
81
83
|
entries.push({
|
|
82
84
|
sourcePath: path.join(templateDir, ...relFile.split("/")),
|
|
83
85
|
destinationPath: path.join(repoRoot, ...destinationRelPath.split("/")),
|
|
@@ -6,6 +6,7 @@ import Ajv2020Module from "ajv/dist/2020.js";
|
|
|
6
6
|
import { runProviderScaffold, specdojoPackageRootDir } from "./provider-scaffold.js";
|
|
7
7
|
import { runWorkspaceScaffold } from "./workspace-scaffold.js";
|
|
8
8
|
import { runLefthookScaffold } from "./lefthook-scaffold.js";
|
|
9
|
+
import { ensureMarkdownlintConfig } from "./markdownlint-config.js";
|
|
9
10
|
import { runSlidevScaffold, SLIDEV_KATA_PATTERNS } from "./slidev-scaffold.js";
|
|
10
11
|
import { ensureGitignore, formatGitignoreReport, gitignorePatternsForLayouts, } from "./specdojo-gitignore.js";
|
|
11
12
|
/** Default IANA time zone for register date derivation when run.register_date_timezone is unset. */
|
|
@@ -254,7 +255,7 @@ export function getProjectRepos(project) {
|
|
|
254
255
|
function isRecord(value) {
|
|
255
256
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
256
257
|
}
|
|
257
|
-
const REPO_KEYS = new Set(["name", "path", "integration_branch", "setup"]);
|
|
258
|
+
const REPO_KEYS = new Set(["name", "path", "integration_branch", "integration_strategy", "setup"]);
|
|
258
259
|
const REPO_SETUP_KEYS = new Set(["install", "build"]);
|
|
259
260
|
const EXTERNAL_PROJECT_KEYS = new Set(["path", "project_id"]);
|
|
260
261
|
/** Resolve a configured external-project repository from the SpecDojo root. */
|
|
@@ -381,6 +382,11 @@ export function validateProjectRepos(projectId, project, projectIds, rootDir) {
|
|
|
381
382
|
!isOmittedOrNonEmptyString(repo.integration_branch)) {
|
|
382
383
|
errors.push(`${at}.integration_branch must be a non-empty string when present`);
|
|
383
384
|
}
|
|
385
|
+
if (repo.integration_strategy !== undefined &&
|
|
386
|
+
repo.integration_strategy !== "merge" &&
|
|
387
|
+
repo.integration_strategy !== "branch-only") {
|
|
388
|
+
errors.push(`${at}.integration_strategy must be "merge" or "branch-only" when present`);
|
|
389
|
+
}
|
|
384
390
|
const setup = repo.setup;
|
|
385
391
|
if (setup !== undefined) {
|
|
386
392
|
if (!isRecord(setup)) {
|
|
@@ -727,11 +733,12 @@ export function registerConfigCommands(program) {
|
|
|
727
733
|
cfg
|
|
728
734
|
.command("init")
|
|
729
735
|
.description("Create .specdojo/specdojo.config.json template (does not overwrite existing) " +
|
|
730
|
-
"and
|
|
731
|
-
.option("--dry-run", "Show the planned config
|
|
736
|
+
"and initialize .gitignore and markdownlint settings")
|
|
737
|
+
.option("--dry-run", "Show the planned config, .gitignore and markdownlint settings without writing", false)
|
|
732
738
|
.action((opts) => {
|
|
733
739
|
const dryRun = !!opts.dryRun;
|
|
734
740
|
const { configPath, config } = loadConfig();
|
|
741
|
+
ensureMarkdownlintConfig(specdojoRootDir(), dryRun);
|
|
735
742
|
if (config) {
|
|
736
743
|
process.stdout.write(`Already exists: ${configPath}\n`);
|
|
737
744
|
writeGitignoreForConfig(config, dryRun);
|
|
@@ -10,6 +10,10 @@ export const DEFAULT_GITIGNORE_PATTERNS = [
|
|
|
10
10
|
"docs/**/generated/*",
|
|
11
11
|
"!docs/**/generated/.gitkeep",
|
|
12
12
|
"docs/**/execution/exec/.locks/",
|
|
13
|
+
"/.vitepress/dist/",
|
|
14
|
+
"/.vitepress/cache/",
|
|
15
|
+
"/.vitepress/mermaid/",
|
|
16
|
+
"/.vitepress/kata-staging/",
|
|
13
17
|
];
|
|
14
18
|
// repo-root 相対の posix パスへ正規化する。リポジトリ外(絶対パス・`..`)や root 自身は
|
|
15
19
|
// 除外対象にできないため undefined を返す。
|
package/dist/specdojo.js
CHANGED
|
@@ -19,6 +19,7 @@ import { registerYamlPagesCommands } from "./docs/yaml-pages-command.js";
|
|
|
19
19
|
import { registerDashboardCommands } from "./dashboard/dashboard.js";
|
|
20
20
|
import { registerGradeCommand } from "./grade/grade.js";
|
|
21
21
|
import { registerAgentCommands } from "./commands/agent.js";
|
|
22
|
+
import { resolveGradingPlanActor, runAgentPlan } from "./exec/agent-plan.js";
|
|
22
23
|
import { registerKataCommands } from "./kata/command.js";
|
|
23
24
|
import { registerDevcontainerCommands } from "./devcontainer/command.js";
|
|
24
25
|
import { registerInitCommand } from "./commands/init.js";
|
|
@@ -58,7 +59,10 @@ async function main() {
|
|
|
58
59
|
registerBuildCommand(program);
|
|
59
60
|
registerYamlPagesCommands(program);
|
|
60
61
|
registerDashboardCommands(program);
|
|
61
|
-
registerGradeCommand(program
|
|
62
|
+
registerGradeCommand(program, {
|
|
63
|
+
resolveActor: resolveGradingPlanActor,
|
|
64
|
+
executePlan: runAgentPlan,
|
|
65
|
+
});
|
|
62
66
|
registerAgentCommands(program);
|
|
63
67
|
registerKataCommands(program);
|
|
64
68
|
registerDevcontainerCommands(program);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
_FRONTMATTER_
|
|
2
|
+
|
|
3
|
+
# Edit Plan: _TASK_ID_ カタログの判定計画と生成
|
|
4
|
+
|
|
5
|
+
## 1. このフェーズで行うこと
|
|
6
|
+
|
|
7
|
+
_PHASE_DESCRIPTION_
|
|
8
|
+
|
|
9
|
+
対象単位・参照資料・実行コマンド・完了条件は「個票の追加完了条件」に展開する。
|
|
10
|
+
|
|
11
|
+
- result: `_RESULT_REF_`
|
|
12
|
+
|
|
13
|
+
## 2. 完了手順
|
|
14
|
+
|
|
15
|
+
1. 参照する kata・既存カタログと個票を読み、追加完了条件の手順を実行する。
|
|
16
|
+
2. 共通規約に従って必要な整形・静的検査を行う。
|
|
17
|
+
3. 個票の作業内容・対応結果を更新し、実行記録に判断根拠・変更ファイル・検証結果を残す。pipeline の executor は result を編集せず報告へ記入する。
|
|
18
|
+
|
|
19
|
+
## 3. 異常終了の条件
|
|
20
|
+
|
|
21
|
+
- 入力不足、対象不明、解消できない判定事項、生成・検査失敗があれば停止し、理由と次のアクションを報告する。
|
|
22
|
+
- 登録簿と個票のステータスを変更しない。
|
|
23
|
+
|
|
24
|
+
_COMMON_CONVENTIONS_
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
_FRONTMATTER_
|
|
2
|
+
|
|
3
|
+
# Edit Plan: _TASK_ID_ Schedule strategy と track の生成
|
|
4
|
+
|
|
5
|
+
## 1. このフェーズで行うこと
|
|
6
|
+
|
|
7
|
+
_PHASE_DESCRIPTION_
|
|
8
|
+
|
|
9
|
+
対象単位・参照資料・実行コマンド・完了条件は「個票の追加完了条件」に展開する。
|
|
10
|
+
|
|
11
|
+
- result: `_RESULT_REF_`
|
|
12
|
+
|
|
13
|
+
## 2. 完了手順
|
|
14
|
+
|
|
15
|
+
1. 参照する kata・既存カタログと個票を読み、追加完了条件の手順を実行する。
|
|
16
|
+
2. 共通規約に従って必要な整形・静的検査を行う。
|
|
17
|
+
3. 個票の作業内容・対応結果を更新し、実行記録に判断根拠・変更ファイル・検証結果を残す。pipeline の executor は result を編集せず報告へ記入する。
|
|
18
|
+
|
|
19
|
+
## 3. 異常終了の条件
|
|
20
|
+
|
|
21
|
+
- 入力不足、対象不明、解消できない判定事項、生成・検査失敗があれば停止し、理由と次のアクションを報告する。
|
|
22
|
+
- 登録簿と個票のステータスを変更しない。
|
|
23
|
+
|
|
24
|
+
_COMMON_CONVENTIONS_
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -40,8 +40,8 @@ _GRADE_SUMMARY_
|
|
|
40
40
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
41
41
|
|
|
42
42
|
<!-- prettier-ignore-start -->
|
|
43
|
-
| ID
|
|
44
|
-
| --- |
|
|
43
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
45
|
_DONE_CRITERIA_ROWS_
|
|
46
46
|
<!-- prettier-ignore-end -->
|
|
47
47
|
|
|
@@ -35,8 +35,8 @@ _GRADE_SUMMARY_
|
|
|
35
35
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
36
36
|
|
|
37
37
|
<!-- prettier-ignore-start -->
|
|
38
|
-
| ID
|
|
39
|
-
| --- |
|
|
38
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
40
|
_DONE_CRITERIA_ROWS_
|
|
41
41
|
<!-- prettier-ignore-end -->
|
|
42
42
|
|