specdojo 0.1.0 → 0.2.1
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/LICENSE +22 -0
- package/README.md +142 -35
- package/dist/agent-response.js +27 -0
- package/dist/agent.js +124 -0
- package/dist/build-command.js +149 -0
- package/dist/build-if-stale.js +35 -0
- package/dist/catalog-build.js +1079 -0
- package/dist/catalog-generate.js +226 -0
- package/dist/catalog-paths.js +31 -0
- package/dist/catalog-plan-generate.js +301 -0
- package/dist/catalog-plan-prompt.js +73 -0
- package/dist/catalog-plan.js +471 -0
- package/dist/catalog-scaffold.js +255 -0
- package/dist/catalog-types.js +4 -0
- package/dist/catalog.js +606 -0
- package/dist/dashboard.js +990 -0
- package/dist/deliverable-trash.js +148 -0
- package/dist/deliverable.js +97 -0
- package/dist/dist-freshness.js +150 -0
- package/dist/doc-index.js +424 -0
- package/dist/exec-agent-config.js +172 -0
- package/dist/exec-agent-git-state.js +136 -0
- package/dist/exec-agent-protected-config.js +276 -0
- package/dist/exec-events.js +250 -112
- package/dist/exec-evidence.js +317 -0
- package/dist/exec-format.js +54 -0
- package/dist/exec-limit.js +202 -0
- package/dist/exec-parent-validation.js +169 -0
- package/dist/exec-pipeline-state.js +160 -0
- package/dist/exec-plans.js +1016 -0
- package/dist/exec-project.js +25 -11
- package/dist/exec-protection-handoff.js +169 -0
- package/dist/exec-provider-scaffold.js +99 -0
- package/dist/exec-register-resume.js +196 -0
- package/dist/exec-register.js +281 -0
- package/dist/exec-reporter.js +329 -0
- package/dist/exec-results.js +510 -0
- package/dist/exec-run-lock.js +149 -0
- package/dist/exec-run.js +4953 -0
- package/dist/exec-schedule-calendar.js +86 -9
- package/dist/exec-schedule-cpm.js +30 -12
- package/dist/exec-schedule-gantt-chart-render.js +428 -0
- package/dist/exec-schedule-gantt-chart-scope.js +111 -0
- package/dist/exec-schedule-gantt-chart.js +2 -0
- package/dist/exec-schedule-hash.js +34 -25
- package/dist/exec-schedule-index.js +200 -67
- package/dist/exec-schedule-initial.js +100 -0
- package/dist/exec-schedule-progress.js +51 -26
- package/dist/exec-schedule-ready.js +71 -27
- package/dist/exec-schedule.js +171 -93
- package/dist/exec-shared.js +146 -25
- package/dist/exec-strategy.js +547 -0
- package/dist/exec-task-view.js +64 -0
- package/dist/exec-trial.js +895 -0
- package/dist/exec-worktree-command.js +426 -0
- package/dist/exec-worktree-ops.js +847 -0
- package/dist/exec-worktree.js +359 -0
- package/dist/exec.js +744 -192
- package/dist/frontmatter-namespace.js +48 -0
- package/dist/git-environment.js +23 -0
- package/dist/grade-result.js +137 -0
- package/dist/grade.js +2456 -0
- package/dist/index-command.js +103 -0
- package/dist/job.js +1081 -0
- package/dist/kata-command.js +303 -0
- package/dist/kata.js +187 -0
- package/dist/package-paths.js +33 -0
- package/dist/practice-id.js +24 -0
- package/dist/register-date.js +122 -0
- package/dist/register-events.js +363 -0
- package/dist/register-history.js +323 -0
- package/dist/register-item.js +455 -0
- package/dist/register-migrate-timestamps.js +176 -0
- package/dist/register.js +2199 -0
- package/dist/review-plan.js +199 -0
- package/dist/review-types.js +1 -0
- package/dist/role-types.js +1 -0
- package/dist/routine.js +814 -0
- package/dist/schedule-approach.js +252 -0
- package/dist/schedule-build.js +552 -0
- package/dist/schedule-phase-sets.js +73 -0
- package/dist/schedule-strategy-generate.js +812 -0
- package/dist/schedule-strategy-profiles.js +276 -0
- package/dist/schedule.js +420 -0
- package/dist/spawn-self.js +28 -0
- package/dist/specdojo-config.js +133 -39
- package/dist/specdojo.js +56 -7
- package/dist/template-frontmatter.js +89 -0
- package/dist/template-resolution.js +92 -0
- package/dist/timeline-build.js +334 -0
- package/dist/timeline.js +107 -0
- package/dist/watch.js +313 -0
- package/dist/yaml-pages-command.js +28 -0
- package/dist/yaml-pages.js +180 -0
- package/dist/yaml-schema-modeline.js +49 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +600 -0
- package/docs/ja/specdojo/exec-templates/xep-bootstrap-template.md +120 -0
- package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +37 -0
- package/docs/ja/specdojo/exec-templates/xep-cross-deliverable-dedup-template.md +51 -0
- package/docs/ja/specdojo/exec-templates/xep-freeform-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +109 -0
- package/docs/ja/specdojo/exec-templates/xep-job-template.md +43 -0
- package/docs/ja/specdojo/exec-templates/xep-recipe-guided-template.md +82 -0
- package/docs/ja/specdojo/exec-templates/xep-recipe-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +42 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +49 -0
- package/docs/ja/specdojo/exec-templates/xep-retrofit-template.md +98 -0
- package/docs/ja/specdojo/exec-templates/xep-rulebook-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-sample-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-template-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-template.md +66 -0
- package/docs/ja/specdojo/exec-templates/xer-cross-deliverable-dedup-template.md +31 -0
- package/docs/ja/specdojo/exec-templates/xer-human-bootstrap-finalize-template.md +40 -0
- package/docs/ja/specdojo/exec-templates/xer-human-finalize-template.md +30 -0
- package/docs/ja/specdojo/exec-templates/xer-template.md +19 -0
- package/docs/ja/specdojo/exec-templates/xrp-freeform-template.md +70 -0
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +97 -0
- package/docs/ja/specdojo/exec-templates/xrp-recipe-guided-template.md +76 -0
- package/docs/ja/specdojo/exec-templates/xrp-recipe-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-retrofit-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xrp-rulebook-maintenance-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xrp-sample-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-template-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-template.md +67 -0
- package/docs/ja/specdojo/exec-templates/xrp-viewpoint-detail-template.md +7 -0
- package/docs/ja/specdojo/exec-templates/xrr-template.md +21 -0
- package/docs/ja/specdojo/exec-templates/xrr-viewpoint-detail-template.md +7 -0
- package/docs/ja/specdojo/guides/branch-workflow-guide.md +354 -0
- package/docs/ja/specdojo/guides/docs-editing-guide.md +327 -0
- package/docs/ja/specdojo/guides/docs-structure-guide.md +519 -0
- package/docs/ja/specdojo/guides/exec-config-guide.md +589 -0
- package/docs/ja/specdojo/guides/exec-operation-guide.md +440 -0
- package/docs/ja/specdojo/guides/exec-worktree-guide.md +318 -0
- package/docs/ja/specdojo/guides/kata-guide.md +89 -0
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +127 -0
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +228 -0
- package/docs/ja/specdojo/guides/practice-system-composition-guide.md +111 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +472 -0
- package/docs/ja/specdojo/guides/register-operation-guide.md +418 -0
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +163 -0
- package/docs/ja/specdojo/guides/review-guide.md +428 -0
- package/docs/ja/specdojo/guides/routine-operation-guide.md +282 -0
- package/docs/ja/specdojo/guides/ryu-guide.md +230 -0
- package/docs/ja/specdojo/guides/schedule-design-guide.md +429 -0
- package/docs/ja/specdojo/guides/schedule-operation-guide.md +151 -0
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +257 -0
- package/docs/ja/specdojo/guides/timeline-design-guide.md +160 -0
- package/docs/ja/specdojo/guides/track-design-guide.md +215 -0
- package/docs/ja/specdojo/guides/use-case-guide.md +133 -0
- package/docs/ja/specdojo/guides/waza-guide.md +224 -0
- package/docs/ja/specdojo/index.md +33 -0
- package/docs/ja/specdojo/philosophy/needs-to-implementation-philosophy.md +212 -0
- package/docs/ja/specdojo/philosophy/specdojo-philosophy.md +242 -0
- package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +198 -0
- package/docs/ja/specdojo/recipes/cdfd-recipe.md +218 -0
- package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +198 -0
- package/docs/ja/specdojo/recipes/exec-human-finalize-recipe.md +100 -0
- package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +148 -0
- package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +97 -0
- package/docs/ja/specdojo/recipes/pm-members-recipe.md +149 -0
- package/docs/ja/specdojo/recipes/pm-organization-recipe.md +96 -0
- package/docs/ja/specdojo/recipes/pm-plan-recipe.md +98 -0
- package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +97 -0
- package/docs/ja/specdojo/recipes/pm-raci-recipe.md +96 -0
- package/docs/ja/specdojo/recipes/pm-roles-recipe.md +136 -0
- package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +162 -0
- package/docs/ja/specdojo/recipes/prj-charter-recipe.md +187 -0
- package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +235 -0
- package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +205 -0
- package/docs/ja/specdojo/recipes/prj-overview-recipe.md +289 -0
- package/docs/ja/specdojo/recipes/prj-scope-recipe.md +201 -0
- package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +168 -0
- package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +179 -0
- package/docs/ja/specdojo/recipes/stsd-recipe.md +138 -0
- package/docs/ja/specdojo/references/command-reference.md +718 -0
- package/docs/ja/specdojo/references/deliverables-reference.md +407 -0
- package/docs/ja/specdojo/references/directory-layout-reference.md +280 -0
- package/docs/ja/specdojo/references/specdojo-config-reference.md +133 -0
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +372 -0
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +302 -0
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +331 -0
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +134 -0
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +207 -0
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +102 -0
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +131 -0
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +269 -0
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +187 -0
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +279 -0
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +219 -0
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +233 -0
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +182 -0
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +171 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +105 -0
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +195 -0
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +285 -0
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +292 -0
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +171 -0
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +325 -0
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +266 -0
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +294 -0
- package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +21 -0
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +401 -0
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +311 -0
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +158 -0
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +287 -0
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +62 -0
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +100 -0
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +298 -0
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +379 -0
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +310 -0
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +86 -0
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +297 -0
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +79 -0
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +213 -0
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +311 -0
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +94 -0
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +81 -0
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +118 -0
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +421 -0
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +307 -0
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +312 -0
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +63 -0
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +353 -0
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +179 -0
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +183 -0
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +185 -0
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +185 -0
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +186 -0
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +186 -0
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +61 -0
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +84 -0
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +357 -0
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +80 -0
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +484 -0
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +120 -0
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +293 -0
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +211 -0
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +94 -0
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +190 -0
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +108 -0
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +122 -0
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +146 -0
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +65 -0
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +178 -0
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +232 -0
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +235 -0
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +242 -0
- package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +187 -0
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +201 -0
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +165 -0
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +165 -0
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +202 -0
- package/docs/ja/specdojo/rulebooks/sch-rulebook.md +139 -0
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +63 -0
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +329 -0
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +297 -0
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +132 -0
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +215 -0
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +376 -0
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +313 -0
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +246 -0
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +119 -0
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +188 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +114 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +101 -0
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +103 -0
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +396 -0
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +207 -0
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +387 -0
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +303 -0
- package/docs/ja/specdojo/samples/atc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/atc-sample.md +41 -0
- package/docs/ja/specdojo/samples/bac-sample.md +38 -0
- package/docs/ja/specdojo/samples/bdd-sample.yaml +71 -0
- package/docs/ja/specdojo/samples/bds-sample.md +38 -0
- package/docs/ja/specdojo/samples/bes-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/bes-sample.md +38 -0
- package/docs/ja/specdojo/samples/bps-sample.md +38 -0
- package/docs/ja/specdojo/samples/br-sample.md +40 -0
- package/docs/ja/specdojo/samples/ccd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cdfd-overview-sample.md +284 -0
- package/docs/ja/specdojo/samples/cdfd-sample.md +229 -0
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +146 -0
- package/docs/ja/specdojo/samples/cdsd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cld-sample.md +38 -0
- package/docs/ja/specdojo/samples/cnd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cop-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/cop-sample.md +38 -0
- package/docs/ja/specdojo/samples/cpd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cstd-sample.md +11 -0
- package/docs/ja/specdojo/samples/cxd-sample.md +38 -0
- package/docs/ja/specdojo/samples/dct-index-sample.yaml +39 -0
- package/docs/ja/specdojo/samples/dct-sample.yaml +91 -0
- package/docs/ja/specdojo/samples/dec-sample.md +39 -0
- package/docs/ja/specdojo/samples/dmd-index-sample.md +50 -0
- package/docs/ja/specdojo/samples/dmd-sample.md +74 -0
- package/docs/ja/specdojo/samples/etc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/etc-sample.md +38 -0
- package/docs/ja/specdojo/samples/gl-sample.yaml +37 -0
- package/docs/ja/specdojo/samples/ifd-sample.md +38 -0
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +102 -0
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +107 -0
- package/docs/ja/specdojo/samples/ifx-file-sample.md +38 -0
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +89 -0
- package/docs/ja/specdojo/samples/imp-business-sample.md +66 -0
- package/docs/ja/specdojo/samples/imp-data-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-interface-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-operations-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-test-sample.md +60 -0
- package/docs/ja/specdojo/samples/itc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/itc-sample.md +38 -0
- package/docs/ja/specdojo/samples/mip-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/mm-sample.md +35 -0
- package/docs/ja/specdojo/samples/mtp-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-availability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-integrity-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-operations-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-performance-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-reliability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-usability-sample.md +38 -0
- package/docs/ja/specdojo/samples/ntp-sample.md +38 -0
- package/docs/ja/specdojo/samples/opd-access-control-sample.md +29 -0
- package/docs/ja/specdojo/samples/opd-incident-management-sample.md +31 -0
- package/docs/ja/specdojo/samples/opd-index-sample.md +41 -0
- package/docs/ja/specdojo/samples/opd-monitoring-sample.md +32 -0
- package/docs/ja/specdojo/samples/opd-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-access-control-sample.md +24 -0
- package/docs/ja/specdojo/samples/opr-backup-restore-sample.md +27 -0
- package/docs/ja/specdojo/samples/opr-batch-sample.md +23 -0
- package/docs/ja/specdojo/samples/opr-change-sample.md +24 -0
- package/docs/ja/specdojo/samples/opr-incident-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-index-sample.md +43 -0
- package/docs/ja/specdojo/samples/opr-monitoring-sample.md +27 -0
- package/docs/ja/specdojo/samples/opr-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-support-sample.md +23 -0
- package/docs/ja/specdojo/samples/otp-index-sample.md +66 -0
- package/docs/ja/specdojo/samples/otp-sample.md +68 -0
- package/docs/ja/specdojo/samples/pm-change-request-log-sample.md +47 -0
- package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +46 -0
- package/docs/ja/specdojo/samples/pm-issue-log-sample.md +45 -0
- package/docs/ja/specdojo/samples/pm-members-sample.yaml +103 -0
- package/docs/ja/specdojo/samples/pm-organization-sample.md +46 -0
- package/docs/ja/specdojo/samples/pm-plan-sample.md +57 -0
- package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +52 -0
- package/docs/ja/specdojo/samples/pm-raci-sample.md +57 -0
- package/docs/ja/specdojo/samples/pm-risk-register-sample.md +43 -0
- package/docs/ja/specdojo/samples/pm-roles-sample.yaml +41 -0
- package/docs/ja/specdojo/samples/pr-sample.md +39 -0
- package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +57 -0
- package/docs/ja/specdojo/samples/prj-charter-sample.md +121 -0
- package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +105 -0
- package/docs/ja/specdojo/samples/prj-issues-and-approach-sample.md +78 -0
- package/docs/ja/specdojo/samples/prj-overview-sample.md +95 -0
- package/docs/ja/specdojo/samples/prj-scope-sample.md +71 -0
- package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +60 -0
- package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +62 -0
- package/docs/ja/specdojo/samples/sac-sample.md +38 -0
- package/docs/ja/specdojo/samples/sf-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/sf-sample.md +38 -0
- package/docs/ja/specdojo/samples/sld-sample.md +38 -0
- package/docs/ja/specdojo/samples/stc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/stc-sample.md +38 -0
- package/docs/ja/specdojo/samples/stsd-sample.md +58 -0
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +38 -0
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +38 -0
- package/docs/ja/specdojo/samples/sysd-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/trc-requirements-to-specs-sample.md +56 -0
- package/docs/ja/specdojo/samples/trc-requirements-to-tests-sample.md +56 -0
- package/docs/ja/specdojo/samples/tsd-index-sample.md +29 -0
- package/docs/ja/specdojo/samples/tsd-sample.md +38 -0
- package/docs/ja/specdojo/samples/tsp-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/uis-sample.md +38 -0
- package/docs/ja/specdojo/samples/utc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/utc-sample.md +38 -0
- package/docs/ja/specdojo/schemas/v1/guide-content.schema.yaml +20 -0
- package/docs/ja/specdojo/schemas/v1/philosophy-content.schema.yaml +21 -0
- package/docs/ja/specdojo/schemas/v1/reference-content.schema.yaml +21 -0
- package/docs/ja/specdojo/standards/document-metadata-standard.md +323 -0
- package/docs/ja/specdojo/standards/exec-human-finalize-standard.md +75 -0
- package/docs/ja/specdojo/standards/git-branching-standard.md +227 -0
- package/docs/ja/specdojo/standards/guide-authoring-standard.md +124 -0
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +929 -0
- package/docs/ja/specdojo/standards/job-definition-standard.md +148 -0
- package/docs/ja/specdojo/standards/people-and-organization-definition-standard.md +431 -0
- package/docs/ja/specdojo/standards/philosophy-authoring-standard.md +113 -0
- package/docs/ja/specdojo/standards/recipe-authoring-standard.md +143 -0
- package/docs/ja/specdojo/standards/reference-authoring-standard.md +99 -0
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +140 -0
- package/docs/ja/specdojo/standards/sample-authoring-standard.md +151 -0
- package/docs/ja/specdojo/standards/standard-authoring-standard.md +108 -0
- package/docs/ja/specdojo/standards/template-authoring-standard.md +101 -0
- package/docs/ja/specdojo/standards/test-document-scope-standard.md +176 -0
- package/docs/ja/specdojo/templates/cdfd-overview-template.md +199 -0
- package/docs/ja/specdojo/templates/cdfd-template.md +173 -0
- package/docs/ja/specdojo/templates/cdfd-uc-template.md +148 -0
- package/docs/ja/specdojo/templates/dct-architecture-template.yaml +136 -0
- package/docs/ja/specdojo/templates/dct-business-acceptance-criteria-template.yaml +34 -0
- package/docs/ja/specdojo/templates/dct-business-model-bes-template.yaml +75 -0
- package/docs/ja/specdojo/templates/dct-business-model-bps-template.yaml +49 -0
- package/docs/ja/specdojo/templates/dct-business-model-br-template.yaml +50 -0
- package/docs/ja/specdojo/templates/dct-data-flow-template.yaml +40 -0
- package/docs/ja/specdojo/templates/dct-data-model-bdd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-data-model-ccd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-data-model-cdsd-template.yaml +41 -0
- package/docs/ja/specdojo/templates/dct-data-model-cld-template.yaml +38 -0
- package/docs/ja/specdojo/templates/dct-data-model-sld-template.yaml +38 -0
- package/docs/ja/specdojo/templates/dct-data-model-stsd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-external-interface-specs-template.yaml +114 -0
- package/docs/ja/specdojo/templates/dct-glossary-template.yaml +35 -0
- package/docs/ja/specdojo/templates/dct-impact-analysis-template.yaml +138 -0
- package/docs/ja/specdojo/templates/dct-index-template.md +40 -0
- package/docs/ja/specdojo/templates/dct-migration-planning-template.yaml +148 -0
- package/docs/ja/specdojo/templates/dct-non-functional-requirements-template.yaml +222 -0
- package/docs/ja/specdojo/templates/dct-operations-template.yaml +108 -0
- package/docs/ja/specdojo/templates/dct-project-definition-template.yaml +210 -0
- package/docs/ja/specdojo/templates/dct-project-management-template.yaml +423 -0
- package/docs/ja/specdojo/templates/dct-system-acceptance-criteria-template.yaml +37 -0
- package/docs/ja/specdojo/templates/dct-system-design-template.yaml +82 -0
- package/docs/ja/specdojo/templates/dct-system-functions-template.yaml +58 -0
- package/docs/ja/specdojo/templates/dct-test-specs-template.yaml +261 -0
- package/docs/ja/specdojo/templates/dct-user-interface-model-template.yaml +60 -0
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +88 -0
- package/docs/ja/specdojo/templates/opr-template.md +85 -0
- package/docs/ja/specdojo/templates/pjr-change-request-template.md +60 -0
- package/docs/ja/specdojo/templates/pjr-decision-template.md +61 -0
- package/docs/ja/specdojo/templates/pjr-index-template.md +49 -0
- package/docs/ja/specdojo/templates/pjr-issue-template.md +50 -0
- package/docs/ja/specdojo/templates/pjr-note-template.md +35 -0
- package/docs/ja/specdojo/templates/pjr-question-template.md +53 -0
- package/docs/ja/specdojo/templates/pjr-risk-template.md +49 -0
- package/docs/ja/specdojo/templates/pjr-todo-template.md +41 -0
- package/docs/ja/specdojo/templates/pjr-views-by-owner-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-views-by-priority-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-views-by-status-template.md +22 -0
- package/docs/ja/specdojo/templates/pm-change-request-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-communication-plan-template.md +46 -0
- package/docs/ja/specdojo/templates/pm-decision-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-issue-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-members-template.yaml +105 -0
- package/docs/ja/specdojo/templates/pm-organization-template.md +44 -0
- package/docs/ja/specdojo/templates/pm-plan-template.md +52 -0
- package/docs/ja/specdojo/templates/pm-quality-management-plan-template.md +46 -0
- package/docs/ja/specdojo/templates/pm-raci-template.md +51 -0
- package/docs/ja/specdojo/templates/pm-risk-register-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-roles-template.yaml +53 -0
- package/docs/ja/specdojo/templates/prj-assumptions-constraints-dependencies-template.md +59 -0
- package/docs/ja/specdojo/templates/prj-charter-template.md +116 -0
- package/docs/ja/specdojo/templates/prj-comparison-of-alternatives-template.md +116 -0
- package/docs/ja/specdojo/templates/prj-issues-and-approach-template.md +89 -0
- package/docs/ja/specdojo/templates/prj-overview-template.md +85 -0
- package/docs/ja/specdojo/templates/prj-scope-template.md +75 -0
- package/docs/ja/specdojo/templates/prj-stakeholder-register-template.md +64 -0
- package/docs/ja/specdojo/templates/prj-success-criteria-and-acceptance-criteria-template.md +60 -0
- package/docs/ja/specdojo/templates/stsd-template.md +57 -0
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +230 -0
- package/docs/specdojo/schemas/v1/common-frontmatter.schema.yaml +77 -0
- package/docs/specdojo/schemas/v1/dct-index.schema.yaml +85 -0
- package/docs/specdojo/schemas/v1/dct-plan.schema.yaml +324 -0
- package/docs/specdojo/schemas/v1/dct.schema.yaml +368 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +91 -0
- package/docs/specdojo/schemas/v1/esil.schema.yaml +142 -0
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +101 -0
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +272 -0
- package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +162 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +126 -0
- package/docs/specdojo/schemas/v1/exec-reporter-output.schema.yaml +151 -0
- package/docs/specdojo/schemas/v1/exec-result-frontmatter.schema.yaml +144 -0
- package/docs/specdojo/schemas/v1/grade-done-criteria.schema.yaml +79 -0
- package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +60 -0
- package/docs/specdojo/schemas/v1/grade-result.schema.yaml +118 -0
- package/docs/specdojo/schemas/v1/guide-frontmatter.schema.yaml +19 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +293 -0
- package/docs/specdojo/schemas/v1/job-run.schema.yaml +90 -0
- package/docs/specdojo/schemas/v1/job.schema.yaml +198 -0
- package/docs/specdojo/schemas/v1/philosophy-frontmatter.schema.yaml +19 -0
- package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +56 -0
- package/docs/specdojo/schemas/v1/pm-members.schema.yaml +252 -0
- package/docs/specdojo/schemas/v1/pm-review-viewpoints.schema.yaml +387 -0
- package/docs/specdojo/schemas/v1/pm-roles.schema.yaml +106 -0
- package/docs/specdojo/schemas/v1/recipe-frontmatter.schema.yaml +27 -0
- package/docs/specdojo/schemas/v1/reference-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +106 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +204 -0
- package/docs/specdojo/schemas/v1/routine-run.schema.yaml +36 -0
- package/docs/specdojo/schemas/v1/routine.schema.yaml +87 -0
- package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +61 -0
- package/docs/specdojo/schemas/v1/sch-common.schema.yaml +258 -0
- package/docs/specdojo/schemas/v1/sch-defaults.schema.yaml +48 -0
- package/docs/specdojo/schemas/v1/sch-milestones.schema.yaml +64 -0
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +772 -0
- package/docs/specdojo/schemas/v1/sch-track.schema.yaml +66 -0
- package/docs/specdojo/schemas/v1/standard-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/tml-index.schema.yaml +103 -0
- package/package.json +121 -24
- package/templates/antigravity/README.md +35 -0
- package/templates/antigravity/exec-defaults-snippet.yaml +38 -0
- package/templates/antigravity/orchestrator.md +146 -0
- package/templates/antigravity/pm-members-snippet.yaml +55 -0
- package/templates/claude/README.md +46 -0
- package/templates/claude/agents/claude-expert-review-executor.md +14 -0
- package/templates/claude/agents/claude-review-executor.md +14 -0
- package/templates/claude/agents/specdojo-orchestrator.md +153 -0
- package/templates/claude/settings.edit.json +6 -0
- package/templates/claude/settings.report.json +6 -0
- package/templates/claude/settings.review.json +7 -0
- package/templates/codex/README.md +61 -0
- package/templates/codex/agents/codex-executor.toml +12 -0
- package/templates/codex/agents/codex-expert-executor.toml +12 -0
- package/templates/codex/agents/codex-expert-review-executor.toml +10 -0
- package/templates/codex/agents/codex-review-executor.toml +10 -0
- package/templates/codex/agents/specdojo-orchestrator.toml +154 -0
- package/templates/codex/orchestrator.md +146 -0
- package/templates/copilot/README.md +41 -0
- package/templates/copilot/exec-defaults-snippet.yaml +28 -0
- package/templates/copilot/pm-members-snippet.yaml +44 -0
- package/templates/opencode/README.md +41 -0
- package/templates/opencode/agents/opencode-executor.md +59 -0
- package/templates/opencode/agents/opencode-reporter.md +26 -0
- package/templates/opencode/agents/opencode-review-executor.md +48 -0
- package/templates/opencode/agents/specdojo-orchestrator.md +193 -0
- package/dist/exec-schedule-timeline-render.js +0 -201
- package/dist/exec-schedule-timeline.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatDateOnlyUtc } from
|
|
1
|
+
import { formatDateOnlyUtc } from "./exec-shared.js";
|
|
2
2
|
function scheduleAnchorDateUtc() {
|
|
3
3
|
return Date.UTC(2000, 0, 1, 0, 0, 0, 0);
|
|
4
4
|
}
|
|
@@ -16,6 +16,7 @@ export function isWorkingDateUtc(dt, calendar) {
|
|
|
16
16
|
return calendar.workdays.has(dt.getUTCDay()) && !calendar.holidays.has(dateOnly);
|
|
17
17
|
}
|
|
18
18
|
function advanceToNextWorkingInstantUtc(dt, calendar) {
|
|
19
|
+
assertCalendarHasWorkingDay(calendar);
|
|
19
20
|
while (true) {
|
|
20
21
|
if (!isWorkingDateUtc(dt, calendar)) {
|
|
21
22
|
dt.setUTCDate(dt.getUTCDate() + 1);
|
|
@@ -32,7 +33,7 @@ function advanceToNextWorkingInstantUtc(dt, calendar) {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
export function addWorkingDayOffset(startDate, dayOffset, calendar) {
|
|
35
|
-
const [year, month, day] = startDate.split(
|
|
36
|
+
const [year, month, day] = startDate.split("-").map(Number);
|
|
36
37
|
const dt = new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0));
|
|
37
38
|
advanceToNextWorkingInstantUtc(dt, calendar);
|
|
38
39
|
let remainingMinutes = Math.round(dayOffset * workingMinutesPerDay(calendar));
|
|
@@ -51,6 +52,25 @@ export function addWorkingDayOffset(startDate, dayOffset, calendar) {
|
|
|
51
52
|
advanceToNextWorkingInstantUtc(dt, calendar);
|
|
52
53
|
return dt;
|
|
53
54
|
}
|
|
55
|
+
export function workingDayOffsetForDate(startDate, targetDate, calendar) {
|
|
56
|
+
const toMidnightUtc = (dateOnly) => {
|
|
57
|
+
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
58
|
+
return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0));
|
|
59
|
+
};
|
|
60
|
+
const cursor = toMidnightUtc(startDate);
|
|
61
|
+
const target = toMidnightUtc(targetDate);
|
|
62
|
+
advanceToNextWorkingInstantUtc(cursor, calendar);
|
|
63
|
+
advanceToNextWorkingInstantUtc(target, calendar);
|
|
64
|
+
if (target.getTime() <= cursor.getTime())
|
|
65
|
+
return 0;
|
|
66
|
+
let count = 0;
|
|
67
|
+
while (cursor.getTime() < target.getTime()) {
|
|
68
|
+
if (isWorkingDateUtc(cursor, calendar))
|
|
69
|
+
count += 1;
|
|
70
|
+
cursor.setUTCDate(cursor.getUTCDate() + 1);
|
|
71
|
+
}
|
|
72
|
+
return count;
|
|
73
|
+
}
|
|
54
74
|
export function buildWorkingTaskSegments(startDate, startOffset, durationDays, calendar) {
|
|
55
75
|
const cursor = addWorkingDayOffset(startDate, startOffset, calendar);
|
|
56
76
|
let remainingMinutes = Math.round(durationDays * workingMinutesPerDay(calendar));
|
|
@@ -69,25 +89,82 @@ export function buildWorkingTaskSegments(startDate, startOffset, durationDays, c
|
|
|
69
89
|
}
|
|
70
90
|
return segments;
|
|
71
91
|
}
|
|
72
|
-
function
|
|
92
|
+
function ganttChartAnchorDate(startDate) {
|
|
73
93
|
if (!startDate)
|
|
74
94
|
return new Date(scheduleAnchorDateUtc());
|
|
75
|
-
const [year, month, day] = startDate.split(
|
|
95
|
+
const [year, month, day] = startDate.split("-").map(Number);
|
|
76
96
|
return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0));
|
|
77
97
|
}
|
|
78
98
|
export function dateForWorkingOffset(dayOffset, startDate, calendar) {
|
|
79
99
|
return startDate
|
|
80
100
|
? addWorkingDayOffset(startDate, dayOffset, calendar)
|
|
81
|
-
: new Date(scheduleAnchorDateUtc() +
|
|
101
|
+
: new Date(scheduleAnchorDateUtc() +
|
|
102
|
+
Math.round(dayOffset * workingMinutesPerDay(calendar)) * 60 * 1000);
|
|
82
103
|
}
|
|
83
|
-
export function
|
|
104
|
+
export function ganttChartPositionX(dt, ganttChartStart, calendar, dayWidth) {
|
|
84
105
|
const midnight = new Date(dt.getTime());
|
|
85
106
|
midnight.setUTCHours(0, 0, 0, 0);
|
|
86
|
-
const dayIndex = Math.floor((midnight.getTime() -
|
|
107
|
+
const dayIndex = Math.floor((midnight.getTime() - ganttChartStart.getTime()) / 86400000);
|
|
87
108
|
const minutesFromMidnight = dt.getUTCHours() * 60 + dt.getUTCMinutes();
|
|
88
109
|
const relative = Math.max(0, Math.min(1, minutesFromMidnight / workingMinutesPerDay(calendar)));
|
|
89
110
|
return (dayIndex + relative) * dayWidth;
|
|
90
111
|
}
|
|
91
|
-
export function
|
|
92
|
-
return
|
|
112
|
+
export function ganttChartStartDate(startDate) {
|
|
113
|
+
return ganttChartAnchorDate(startDate);
|
|
114
|
+
}
|
|
115
|
+
function parseDateOnlyUtc(dateOnly) {
|
|
116
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateOnly)) {
|
|
117
|
+
throw new Error(`invalid date-only value: ${dateOnly}`);
|
|
118
|
+
}
|
|
119
|
+
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
120
|
+
const parsed = new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0));
|
|
121
|
+
if (formatDateOnlyUtc(parsed) !== dateOnly) {
|
|
122
|
+
throw new Error(`invalid date-only value: ${dateOnly}`);
|
|
123
|
+
}
|
|
124
|
+
return parsed;
|
|
125
|
+
}
|
|
126
|
+
function assertCalendarHasWorkingDay(calendar) {
|
|
127
|
+
if (![...calendar.workdays].some((day) => Number.isInteger(day) && day >= 0 && day <= 6)) {
|
|
128
|
+
throw new Error("calendar.workdays must contain at least one weekday");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// 計画開始日(yyyy-mm-dd)から推定稼働日数を暦日へ伸ばした予定終了日(yyyy-mm-dd)を返す。
|
|
132
|
+
// 稼働日のみ数え、休日・週末は飛ばす。dayOffset <= 0 の場合 start 当日を返す。
|
|
133
|
+
// 用途: Timeline 用 Gantt chart の各トラックの予定開始日・予定終了日の算出。
|
|
134
|
+
export function addWorkingDaysToDate(startDate, dayOffset, calendar) {
|
|
135
|
+
if (!Number.isFinite(dayOffset) || dayOffset <= 0)
|
|
136
|
+
return startDate;
|
|
137
|
+
assertCalendarHasWorkingDay(calendar);
|
|
138
|
+
const target = parseDateOnlyUtc(startDate);
|
|
139
|
+
let remaining = Math.round(dayOffset);
|
|
140
|
+
while (remaining > 0) {
|
|
141
|
+
const next = new Date(target.getTime() + 86_400_000);
|
|
142
|
+
if (!Number.isFinite(next.getTime())) {
|
|
143
|
+
throw new Error(`working-day calculation exceeded the supported date range: ${startDate}`);
|
|
144
|
+
}
|
|
145
|
+
// 非稼働日でもカーソルは必ず進める。進めないと週末・休日で無限ループになる。
|
|
146
|
+
target.setTime(next.getTime());
|
|
147
|
+
if (isWorkingDateUtc(next, calendar)) {
|
|
148
|
+
remaining -= 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return formatDateOnlyUtc(target);
|
|
152
|
+
}
|
|
153
|
+
// 開始日・終了日を含めず、2 つの日付間にある稼働日数を返す。target <= start なら 0。
|
|
154
|
+
export function countWorkingDaysBetween(startDate, targetDate, calendar) {
|
|
155
|
+
const cursor = parseDateOnlyUtc(startDate);
|
|
156
|
+
const endMs = parseDateOnlyUtc(targetDate).getTime();
|
|
157
|
+
if (endMs <= cursor.getTime())
|
|
158
|
+
return 0;
|
|
159
|
+
assertCalendarHasWorkingDay(calendar);
|
|
160
|
+
let count = 0;
|
|
161
|
+
while (true) {
|
|
162
|
+
const next = new Date(cursor.getTime() + 86_400_000);
|
|
163
|
+
if (next.getTime() >= endMs)
|
|
164
|
+
break;
|
|
165
|
+
if (isWorkingDateUtc(next, calendar))
|
|
166
|
+
count += 1;
|
|
167
|
+
cursor.setTime(next.getTime());
|
|
168
|
+
}
|
|
169
|
+
return count;
|
|
93
170
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { toArtifactPath, toScheduleFilePath } from
|
|
1
|
+
import { toArtifactPath, toScheduleFilePath } from "./exec-shared.js";
|
|
2
|
+
import { workingDayOffsetForDate } from "./exec-schedule-calendar.js";
|
|
2
3
|
export function topoSort(schedule) {
|
|
3
4
|
const indeg = new Map();
|
|
4
5
|
const out = new Map();
|
|
@@ -8,7 +9,7 @@ export function topoSort(schedule) {
|
|
|
8
9
|
}
|
|
9
10
|
for (const node of schedule.nodes.values()) {
|
|
10
11
|
for (const dep of node.depends_on) {
|
|
11
|
-
out.get(dep)
|
|
12
|
+
out.get(dep)?.push(node.id);
|
|
12
13
|
indeg.set(node.id, (indeg.get(node.id) ?? 0) + 1);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -40,11 +41,23 @@ export function topoSort(schedule) {
|
|
|
40
41
|
export function computeCpm(schedule, projectPath) {
|
|
41
42
|
const { order, cycle } = topoSort(schedule);
|
|
42
43
|
if (cycle && cycle.length)
|
|
43
|
-
throw new Error(`schedule dependency cycle detected: ${cycle.join(
|
|
44
|
+
throw new Error(`schedule dependency cycle detected: ${cycle.join(", ")}`);
|
|
44
45
|
const nodes = {};
|
|
46
|
+
// schedule_file(生パス)ごとの start_date を、project_start_date を基準にした
|
|
47
|
+
// 稼働日オフセットへ変換する。track が明示した start_date より前に開始しないための
|
|
48
|
+
// es 下限(床)として使う。project_start_date が無い場合はオフセット 0。
|
|
49
|
+
const fileStartOffsets = new Map();
|
|
50
|
+
if (schedule.start_date) {
|
|
51
|
+
for (const [file, date] of schedule.file_start_dates) {
|
|
52
|
+
fileStartOffsets.set(file, workingDayOffsetForDate(schedule.start_date, date, schedule.calendar));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
45
55
|
for (const id of order) {
|
|
46
56
|
const n = schedule.nodes.get(id);
|
|
47
|
-
const
|
|
57
|
+
const startFloor = fileStartOffsets.get(n.schedule_file) ?? 0;
|
|
58
|
+
const es = n.depends_on.length === 0
|
|
59
|
+
? startFloor
|
|
60
|
+
: Math.max(startFloor, ...n.depends_on.map((d) => nodes[d].ef));
|
|
48
61
|
const ef = es + n.duration_days;
|
|
49
62
|
nodes[id] = {
|
|
50
63
|
id,
|
|
@@ -59,9 +72,10 @@ export function computeCpm(schedule, projectPath) {
|
|
|
59
72
|
slack: 0,
|
|
60
73
|
depends_on: n.depends_on,
|
|
61
74
|
schedule_file: toScheduleFilePath(projectPath, n.schedule_file),
|
|
75
|
+
...(n.tags ? { tags: n.tags } : {}),
|
|
62
76
|
};
|
|
63
77
|
}
|
|
64
|
-
const projectDuration = Math.max(...Object.values(nodes).map(n => n.ef), 0);
|
|
78
|
+
const projectDuration = Math.max(...Object.values(nodes).map((n) => n.ef), 0);
|
|
65
79
|
const succ = new Map();
|
|
66
80
|
for (const id of schedule.nodes.keys())
|
|
67
81
|
succ.set(id, []);
|
|
@@ -72,17 +86,21 @@ export function computeCpm(schedule, projectPath) {
|
|
|
72
86
|
const rev = [...order].reverse();
|
|
73
87
|
for (const id of rev) {
|
|
74
88
|
const s = succ.get(id);
|
|
75
|
-
const lf = s.length === 0 ? projectDuration : Math.min(...s.map(child => nodes[child].ls));
|
|
89
|
+
const lf = s.length === 0 ? projectDuration : Math.min(...s.map((child) => nodes[child].ls));
|
|
76
90
|
const ls = lf - nodes[id].duration_days;
|
|
77
91
|
nodes[id].lf = lf;
|
|
78
92
|
nodes[id].ls = ls;
|
|
79
93
|
nodes[id].slack = ls - nodes[id].es;
|
|
80
94
|
}
|
|
81
95
|
const critical = new Set(Object.values(nodes)
|
|
82
|
-
.filter(n => n.slack === 0)
|
|
83
|
-
.map(n => n.id));
|
|
84
|
-
const
|
|
85
|
-
|
|
96
|
+
.filter((n) => n.slack === 0)
|
|
97
|
+
.map((n) => n.id));
|
|
98
|
+
const criticalNodes = Object.values(nodes).filter((n) => critical.has(n.id));
|
|
99
|
+
// track 床の導入で起点 es は必ずしも 0 にならないため、critical ノードの
|
|
100
|
+
// 最小 es を起点として検出する(単一 track では従来どおり es === 0)。
|
|
101
|
+
const minCriticalEs = criticalNodes.length ? Math.min(...criticalNodes.map((n) => n.es)) : 0;
|
|
102
|
+
const starts = criticalNodes
|
|
103
|
+
.filter((n) => n.es === minCriticalEs)
|
|
86
104
|
.sort((a, b) => a.id.localeCompare(b.id));
|
|
87
105
|
const path = [];
|
|
88
106
|
if (starts.length) {
|
|
@@ -90,8 +108,8 @@ export function computeCpm(schedule, projectPath) {
|
|
|
90
108
|
path.push(cur);
|
|
91
109
|
while (true) {
|
|
92
110
|
const nexts = (succ.get(cur) ?? [])
|
|
93
|
-
.filter(x => critical.has(x))
|
|
94
|
-
.filter(x => nodes[x].es === nodes[cur].ef)
|
|
111
|
+
.filter((x) => critical.has(x))
|
|
112
|
+
.filter((x) => nodes[x].es === nodes[cur].ef)
|
|
95
113
|
.sort((a, b) => a.localeCompare(b));
|
|
96
114
|
if (!nexts.length)
|
|
97
115
|
break;
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { formatDateOnlyUtc, formatDays } from "./exec-shared.js";
|
|
2
|
+
import { buildWorkingTaskSegments, dateForWorkingOffset, ganttChartStartDate, isWorkingDateUtc, workingMinutesPerDay, } from "./exec-schedule-calendar.js";
|
|
3
|
+
function xmlEscape(text) {
|
|
4
|
+
return text
|
|
5
|
+
.replace(/&/g, "&")
|
|
6
|
+
.replace(/</g, "<")
|
|
7
|
+
.replace(/>/g, ">")
|
|
8
|
+
.replace(/"/g, """);
|
|
9
|
+
}
|
|
10
|
+
function dayLabelUtc(dt) {
|
|
11
|
+
const mm = (dt.getUTCMonth() + 1).toString().padStart(2, "0");
|
|
12
|
+
const dd = dt.getUTCDate().toString().padStart(2, "0");
|
|
13
|
+
return `${mm}/${dd}`;
|
|
14
|
+
}
|
|
15
|
+
function stateColor(state, critical) {
|
|
16
|
+
if (state === "gate")
|
|
17
|
+
return "#7c3aed";
|
|
18
|
+
if (state === "milestone")
|
|
19
|
+
return "#b45309";
|
|
20
|
+
if (state === "done")
|
|
21
|
+
return "#16a34a";
|
|
22
|
+
if (state === "doing")
|
|
23
|
+
return "#2563eb";
|
|
24
|
+
if (state === "blocked")
|
|
25
|
+
return "#f59e0b";
|
|
26
|
+
if (state === "cancelled")
|
|
27
|
+
return "#6b7280";
|
|
28
|
+
if (critical)
|
|
29
|
+
return "#dc2626";
|
|
30
|
+
return "#d1d5db";
|
|
31
|
+
}
|
|
32
|
+
export function buildGanttChartSvg(cpm, schedule, stateSnapshot, options) {
|
|
33
|
+
const title = options?.title ?? "プロジェクトガントチャート";
|
|
34
|
+
const rows = Object.values(cpm.nodes).sort((a, b) => a.es - b.es || a.id.localeCompare(b.id));
|
|
35
|
+
const criticalSet = new Set(cpm.critical_path);
|
|
36
|
+
// コード列(col1)に表示する文字列。タスクは local_id-phase_suffix、
|
|
37
|
+
// ゲート・マイルストーンは row.id をそのまま使う(描画ループと同じ導出規則)。
|
|
38
|
+
const col1LabelFor = (row) => {
|
|
39
|
+
if (row.kind !== "task")
|
|
40
|
+
return row.id;
|
|
41
|
+
const scheduleNode = schedule.nodes.get(row.id);
|
|
42
|
+
const localId = scheduleNode?.local_id ?? "";
|
|
43
|
+
const phaseSuffix = scheduleNode?.phase_suffix ?? "";
|
|
44
|
+
return localId && phaseSuffix ? `${localId}-${phaseSuffix}` : localId || phaseSuffix || row.id;
|
|
45
|
+
};
|
|
46
|
+
// フェーズセット列(col3)に表示する文字列。strategy.yaml の phase_sets
|
|
47
|
+
// キー(例: retrofit-pass-2)で、同じフェーズの1回目・2回目などを区別する。
|
|
48
|
+
// ゲート・マイルストーンには対応する phase_set がないため空文字にする。
|
|
49
|
+
const col3LabelFor = (row) => {
|
|
50
|
+
if (row.kind !== "task")
|
|
51
|
+
return "";
|
|
52
|
+
return schedule.nodes.get(row.id)?.phase_set ?? "";
|
|
53
|
+
};
|
|
54
|
+
// Left panel column boundaries — col1(コード列)・col3(フェーズセット列)は、
|
|
55
|
+
// このチャートに登場する最長の文字列がクリップされずに収まる幅へ動的に広げる。
|
|
56
|
+
// col2(成果物名・168px)・col4(フェーズ名・142px)の幅は従来値を維持する。
|
|
57
|
+
const monospaceCharWidthPx = 6.5;
|
|
58
|
+
const col1MinWidth = 114;
|
|
59
|
+
const col3MinWidth = 90;
|
|
60
|
+
const colTextPadding = 6;
|
|
61
|
+
const maxCol1Chars = rows.reduce((max, row) => Math.max(max, col1LabelFor(row).length), 0);
|
|
62
|
+
const col1Width = Math.max(col1MinWidth, Math.ceil(maxCol1Chars * monospaceCharWidthPx) + colTextPadding);
|
|
63
|
+
const maxCol3Chars = rows.reduce((max, row) => Math.max(max, col3LabelFor(row).length), 0);
|
|
64
|
+
const col3Width = Math.max(col3MinWidth, Math.ceil(maxCol3Chars * monospaceCharWidthPx) + colTextPadding);
|
|
65
|
+
const col2Width = 168;
|
|
66
|
+
const col4Width = 142;
|
|
67
|
+
const col1X = 8;
|
|
68
|
+
const col1DivX = col1X + col1Width;
|
|
69
|
+
const col2X = col1DivX + 4;
|
|
70
|
+
const col2DivX = col2X + col2Width;
|
|
71
|
+
const col3X = col2DivX + 4;
|
|
72
|
+
const col3DivX = col3X + col3Width;
|
|
73
|
+
const col4X = col3DivX + 4;
|
|
74
|
+
const leftPad = col4X + col4Width;
|
|
75
|
+
const topPad = 108;
|
|
76
|
+
const bottomPad = 32;
|
|
77
|
+
const rowHeight = 24;
|
|
78
|
+
const sectionHeight = 30;
|
|
79
|
+
const sectionGap = 8;
|
|
80
|
+
const dayWidth = 56;
|
|
81
|
+
const ganttChartStart = ganttChartStartDate(cpm.project_start_date);
|
|
82
|
+
const isInitialComplete = (r) => r.tags?.includes("initial-complete") ?? false;
|
|
83
|
+
const milestoneRows = rows.filter((r) => r.kind === "milestone");
|
|
84
|
+
const taskRowsByFile = new Map();
|
|
85
|
+
let firstTaskFile = null;
|
|
86
|
+
for (const row of rows) {
|
|
87
|
+
if (row.kind !== "task")
|
|
88
|
+
continue;
|
|
89
|
+
if (isInitialComplete(row))
|
|
90
|
+
continue; // handled separately
|
|
91
|
+
if (!firstTaskFile)
|
|
92
|
+
firstTaskFile = row.schedule_file;
|
|
93
|
+
const group = taskRowsByFile.get(row.schedule_file);
|
|
94
|
+
if (group)
|
|
95
|
+
group.push(row);
|
|
96
|
+
else
|
|
97
|
+
taskRowsByFile.set(row.schedule_file, [row]);
|
|
98
|
+
}
|
|
99
|
+
// Insert each gate row immediately after its last dependency task in the first task file section
|
|
100
|
+
const gateRows = rows.filter((r) => r.kind === "gate");
|
|
101
|
+
const insertedGateIds = new Set();
|
|
102
|
+
if (firstTaskFile && gateRows.length > 0) {
|
|
103
|
+
const fileRows = taskRowsByFile.get(firstTaskFile) ?? [];
|
|
104
|
+
const rowIndexById = new Map(fileRows.map((r, i) => [r.id, i]));
|
|
105
|
+
// Sort gates by their insertion position descending so back-to-front splicing keeps indices stable
|
|
106
|
+
const insertions = gateRows
|
|
107
|
+
.map((gate) => {
|
|
108
|
+
const depIndices = gate.depends_on
|
|
109
|
+
.map((depId) => rowIndexById.get(depId) ?? -1)
|
|
110
|
+
.filter((idx) => idx >= 0);
|
|
111
|
+
return {
|
|
112
|
+
gate,
|
|
113
|
+
insertAfter: depIndices.length > 0 ? Math.max(...depIndices) : fileRows.length - 1,
|
|
114
|
+
};
|
|
115
|
+
})
|
|
116
|
+
.sort((a, b) => b.insertAfter - a.insertAfter);
|
|
117
|
+
for (const { gate, insertAfter } of insertions) {
|
|
118
|
+
fileRows.splice(insertAfter + 1, 0, gate);
|
|
119
|
+
insertedGateIds.add(gate.id);
|
|
120
|
+
}
|
|
121
|
+
taskRowsByFile.set(firstTaskFile, fileRows);
|
|
122
|
+
}
|
|
123
|
+
// Gates with no task section to attach to (e.g. milestones-only scope) are rendered
|
|
124
|
+
// alongside milestones so the節目 stays visible.
|
|
125
|
+
const orphanGateRows = gateRows.filter((r) => !insertedGateIds.has(r.id));
|
|
126
|
+
const dayIndexOf = (dt) => Math.floor((dt.getTime() - ganttChartStart.getTime()) / 86400000);
|
|
127
|
+
// タスクバー・マイルストーン・ゲートが載る日(ganttChartStart からの日インデックス)。
|
|
128
|
+
// アクティブでない日の連続区間は時間軸で圧縮表示する。
|
|
129
|
+
const activeDays = new Set();
|
|
130
|
+
const taskSegments = new Map();
|
|
131
|
+
let ganttChartEnd = new Date(ganttChartStart.getTime());
|
|
132
|
+
for (const row of rows) {
|
|
133
|
+
if (row.kind === "task") {
|
|
134
|
+
const segments = cpm.project_start_date
|
|
135
|
+
? buildWorkingTaskSegments(cpm.project_start_date, row.es, row.duration_days, schedule.calendar)
|
|
136
|
+
: [
|
|
137
|
+
{
|
|
138
|
+
start: dateForWorkingOffset(row.es, cpm.project_start_date, schedule.calendar),
|
|
139
|
+
end: dateForWorkingOffset(row.ef, cpm.project_start_date, schedule.calendar),
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
taskSegments.set(row.id, segments);
|
|
143
|
+
const end = segments[segments.length - 1]?.end;
|
|
144
|
+
if (end && end > ganttChartEnd)
|
|
145
|
+
ganttChartEnd = end;
|
|
146
|
+
if (isInitialComplete(row))
|
|
147
|
+
continue; // no bar → does not activate days
|
|
148
|
+
for (const segment of segments) {
|
|
149
|
+
const from = dayIndexOf(segment.start);
|
|
150
|
+
// end が翌日 00:00 のとき翌日を誤って含めないよう 1ms 戻す
|
|
151
|
+
const to = dayIndexOf(new Date(segment.end.getTime() - 1));
|
|
152
|
+
for (let k = from; k <= to; k += 1)
|
|
153
|
+
activeDays.add(k);
|
|
154
|
+
}
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const milestoneAt = dateForWorkingOffset(row.es, cpm.project_start_date, schedule.calendar);
|
|
158
|
+
if (milestoneAt > ganttChartEnd)
|
|
159
|
+
ganttChartEnd = milestoneAt;
|
|
160
|
+
activeDays.add(dayIndexOf(milestoneAt));
|
|
161
|
+
}
|
|
162
|
+
const totalDays = Math.max(1, Math.ceil((ganttChartEnd.getTime() - ganttChartStart.getTime()) / 86400000) + 1);
|
|
163
|
+
// 圧縮軸レイアウト: 非アクティブ日が minCompressRun 日以上連続する区間を
|
|
164
|
+
// 1 本の gap カラムに畳む。それ以外は従来どおり dayWidth の day カラム。
|
|
165
|
+
const minCompressRun = 3;
|
|
166
|
+
const gapWidth = 48;
|
|
167
|
+
const columns = [];
|
|
168
|
+
const dayX = new Map();
|
|
169
|
+
let cursorX = 0;
|
|
170
|
+
let dayCursor = 0;
|
|
171
|
+
while (dayCursor < totalDays) {
|
|
172
|
+
if (!activeDays.has(dayCursor)) {
|
|
173
|
+
let runEnd = dayCursor;
|
|
174
|
+
while (runEnd < totalDays && !activeDays.has(runEnd))
|
|
175
|
+
runEnd += 1;
|
|
176
|
+
const runLength = runEnd - dayCursor;
|
|
177
|
+
if (runLength >= minCompressRun) {
|
|
178
|
+
columns.push({ kind: "gap", fromDay: dayCursor, days: runLength, x: cursorX });
|
|
179
|
+
for (let k = dayCursor; k < runEnd; k += 1)
|
|
180
|
+
dayX.set(k, cursorX);
|
|
181
|
+
cursorX += gapWidth;
|
|
182
|
+
dayCursor = runEnd;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
columns.push({ kind: "day", dayIndex: dayCursor, x: cursorX });
|
|
187
|
+
dayX.set(dayCursor, cursorX);
|
|
188
|
+
cursorX += dayWidth;
|
|
189
|
+
dayCursor += 1;
|
|
190
|
+
}
|
|
191
|
+
const chartWidth = cursorX;
|
|
192
|
+
const width = leftPad + chartWidth + 40;
|
|
193
|
+
const xForDate = (dt) => {
|
|
194
|
+
const midnight = new Date(dt.getTime());
|
|
195
|
+
midnight.setUTCHours(0, 0, 0, 0);
|
|
196
|
+
const dayIndex = dayIndexOf(midnight);
|
|
197
|
+
const baseX = dayX.get(dayIndex) ?? 0;
|
|
198
|
+
const minutesFromMidnight = dt.getUTCHours() * 60 + dt.getUTCMinutes();
|
|
199
|
+
const relative = Math.max(0, Math.min(1, minutesFromMidnight / workingMinutesPerDay(schedule.calendar)));
|
|
200
|
+
return leftPad + baseX + relative * dayWidth;
|
|
201
|
+
};
|
|
202
|
+
const layoutRows = [];
|
|
203
|
+
// Milestones at the top (with orphan gates that had no task section to attach to)
|
|
204
|
+
if (milestoneRows.length > 0 || orphanGateRows.length > 0) {
|
|
205
|
+
layoutRows.push({ type: "section", label: "マイルストーン" });
|
|
206
|
+
for (const row of milestoneRows)
|
|
207
|
+
layoutRows.push({ type: "node", row });
|
|
208
|
+
for (const row of orphanGateRows)
|
|
209
|
+
layoutRows.push({ type: "node", row });
|
|
210
|
+
}
|
|
211
|
+
// Tasks (+ gates merged in) grouped by file
|
|
212
|
+
// initial-complete rows appear first in the first task file section (no bar)
|
|
213
|
+
const initialCompleteRows = rows.filter((r) => r.kind === "task" && isInitialComplete(r));
|
|
214
|
+
let initialCompleteInserted = false;
|
|
215
|
+
for (const [scheduleFile, fileRows] of taskRowsByFile.entries()) {
|
|
216
|
+
layoutRows.push({
|
|
217
|
+
type: "section",
|
|
218
|
+
label: schedule.section_labels[scheduleFile] ?? scheduleFile,
|
|
219
|
+
});
|
|
220
|
+
if (!initialCompleteInserted && initialCompleteRows.length > 0) {
|
|
221
|
+
for (const row of initialCompleteRows)
|
|
222
|
+
layoutRows.push({ type: "node", row });
|
|
223
|
+
initialCompleteInserted = true;
|
|
224
|
+
}
|
|
225
|
+
for (const row of fileRows)
|
|
226
|
+
layoutRows.push({ type: "node", row });
|
|
227
|
+
}
|
|
228
|
+
const height = topPad +
|
|
229
|
+
layoutRows.reduce((sum, entry) => sum + (entry.type === "section" ? sectionHeight + sectionGap : rowHeight), 0) +
|
|
230
|
+
bottomPad;
|
|
231
|
+
const parts = [];
|
|
232
|
+
parts.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="img" aria-label="${xmlEscape(title)}">`);
|
|
233
|
+
parts.push(`<style>
|
|
234
|
+
text { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #1f2937; }
|
|
235
|
+
.title { font-size: 18px; font-weight: 700; fill: #0f172a; }
|
|
236
|
+
.caption { font-size: 11px; fill: #64748b; }
|
|
237
|
+
.section { font-size: 13px; font-weight: 700; fill: #0f172a; }
|
|
238
|
+
.label { font-size: 12px; font-weight: 600; fill: #1f2937; }
|
|
239
|
+
.label-artifact { font-size: 11px; font-weight: 400; fill: #6b7280; }
|
|
240
|
+
.label-id { font-size: 10px; font-family: ui-monospace, 'Courier New', monospace; fill: #9ca3af; }
|
|
241
|
+
.label-phase-set { font-size: 10px; font-family: ui-monospace, 'Courier New', monospace; fill: #6b7280; }
|
|
242
|
+
.axis { font-size: 11px; fill: #475569; }
|
|
243
|
+
.col-div { stroke: #d7dee7; stroke-width: 1; }
|
|
244
|
+
.grid { stroke: #d7dee7; stroke-width: 1; }
|
|
245
|
+
.row-grid { stroke: #edf2f7; stroke-width: 1; }
|
|
246
|
+
.shade { fill: #f8fafc; }
|
|
247
|
+
.holiday { fill: #eff6ff; }
|
|
248
|
+
.legend-label { font-size: 11px; fill: #475569; }
|
|
249
|
+
.month-grid { stroke: #94a3b8; stroke-width: 2; }
|
|
250
|
+
.gap { fill: #f1f5f9; }
|
|
251
|
+
.gap-div { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 3; }
|
|
252
|
+
.gap-label { font-size: 10px; fill: #64748b; }
|
|
253
|
+
</style>`);
|
|
254
|
+
parts.push(`<defs>
|
|
255
|
+
<clipPath id="clip-col1"><rect x="${col1X}" y="0" width="${col1DivX - col1X}" height="${height}" /></clipPath>
|
|
256
|
+
<clipPath id="clip-col2"><rect x="${col2X}" y="0" width="${col2DivX - col2X}" height="${height}" /></clipPath>
|
|
257
|
+
<clipPath id="clip-col3"><rect x="${col3X}" y="0" width="${col3DivX - col3X}" height="${height}" /></clipPath>
|
|
258
|
+
<clipPath id="clip-col4"><rect x="${col4X}" y="0" width="${leftPad - col4X}" height="${height}" /></clipPath>
|
|
259
|
+
</defs>`);
|
|
260
|
+
parts.push(`<rect x="0" y="0" width="${width}" height="${height}" fill="#fffdf8" />`);
|
|
261
|
+
parts.push(`<rect x="0" y="0" width="${leftPad}" height="${height}" fill="#fffaf0" />`);
|
|
262
|
+
parts.push(`<rect x="${leftPad}" y="0" width="${chartWidth + 40}" height="${height}" fill="#ffffff" />`);
|
|
263
|
+
parts.push(`<text class="title" x="16" y="28">${xmlEscape(title)}</text>`);
|
|
264
|
+
parts.push(`<text class="caption" x="16" y="48">1 タスク 1 行で表示します。1 日の長さは ${schedule.calendar.work_hours_per_day} 時間で、休日と週末は空白のままとし、次の稼働日に作業を再開します。タスクが無い期間は ⋯ で圧縮表示します。</text>`);
|
|
265
|
+
parts.push(`<rect x="0" y="${topPad - 36}" width="${width}" height="28" fill="#fff7ed" />`);
|
|
266
|
+
const legendY = 74;
|
|
267
|
+
const legend = [
|
|
268
|
+
{ label: "todo", color: "#d1d5db" },
|
|
269
|
+
{ label: "doing", color: "#2563eb" },
|
|
270
|
+
{ label: "done", color: "#16a34a" },
|
|
271
|
+
{ label: "blocked", color: "#f59e0b" },
|
|
272
|
+
{ label: "critical", color: "#dc2626" },
|
|
273
|
+
{ label: "gate", color: "#7c3aed" },
|
|
274
|
+
];
|
|
275
|
+
let legendX = 16;
|
|
276
|
+
for (const item of legend) {
|
|
277
|
+
parts.push(`<rect x="${legendX}" y="${legendY - 10}" width="14" height="14" rx="3" fill="${item.color}" />`);
|
|
278
|
+
parts.push(`<text class="legend-label" x="${legendX + 20}" y="${legendY + 4}">${xmlEscape(item.label)}</text>`);
|
|
279
|
+
legendX += 76;
|
|
280
|
+
}
|
|
281
|
+
parts.push(`<rect x="${legendX}" y="${legendY - 10}" width="14" height="14" fill="#eff6ff" />`);
|
|
282
|
+
parts.push(`<text class="legend-label" x="${legendX + 20}" y="${legendY + 4}">holiday</text>`);
|
|
283
|
+
legendX += 90;
|
|
284
|
+
parts.push(`<rect x="${legendX}" y="${legendY - 10}" width="14" height="14" fill="#f8fafc" stroke="#d7dee7" />`);
|
|
285
|
+
parts.push(`<text class="legend-label" x="${legendX + 20}" y="${legendY + 4}">weekend</text>`);
|
|
286
|
+
// Column header labels
|
|
287
|
+
parts.push(`<text class="axis" x="${col1X}" y="${topPad - 18}">コード</text>`);
|
|
288
|
+
parts.push(`<text class="axis" x="${col2X}" y="${topPad - 18}">成果物名</text>`);
|
|
289
|
+
parts.push(`<text class="axis" x="${col3X}" y="${topPad - 18}">フェーズセット</text>`);
|
|
290
|
+
parts.push(`<text class="axis" x="${col4X}" y="${topPad - 18}">フェーズ</text>`);
|
|
291
|
+
for (const column of columns) {
|
|
292
|
+
if (column.kind === "gap") {
|
|
293
|
+
const x = leftPad + column.x;
|
|
294
|
+
// 圧縮区間: 薄い塗り + 破線の区切り + 「⋯ N日」ラベル
|
|
295
|
+
parts.push(`<rect class="gap" x="${x}" y="${topPad - 20}" width="${gapWidth}" height="${height - topPad}" />`);
|
|
296
|
+
parts.push(`<line class="gap-div" x1="${x}" y1="${topPad - 20}" x2="${x}" y2="${height - bottomPad}" />`);
|
|
297
|
+
parts.push(`<line class="gap-div" x1="${x + gapWidth}" y1="${topPad - 20}" x2="${x + gapWidth}" y2="${height - bottomPad}" />`);
|
|
298
|
+
parts.push(`<text class="gap-label" x="${x + gapWidth / 2}" y="${topPad - 18}" text-anchor="middle">⋯${column.days}日</text>`);
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
const dayStart = new Date(ganttChartStart.getTime() + column.dayIndex * 86400000);
|
|
302
|
+
const x = leftPad + column.x;
|
|
303
|
+
const isWorking = isWorkingDateUtc(dayStart, schedule.calendar);
|
|
304
|
+
const dayOfWeek = dayStart.getUTCDay();
|
|
305
|
+
const isWeekend = dayOfWeek === 0 || dayOfWeek === 6;
|
|
306
|
+
const isMonthStart = dayStart.getUTCDate() === 1;
|
|
307
|
+
const isHoliday = schedule.calendar.holidays.has(formatDateOnlyUtc(dayStart));
|
|
308
|
+
if (isHoliday) {
|
|
309
|
+
parts.push(`<rect class="holiday" x="${x}" y="${topPad - 20}" width="${dayWidth}" height="${height - topPad}" />`);
|
|
310
|
+
}
|
|
311
|
+
else if (!isWorking || isWeekend) {
|
|
312
|
+
parts.push(`<rect class="shade" x="${x}" y="${topPad - 20}" width="${dayWidth}" height="${height - topPad}" />`);
|
|
313
|
+
}
|
|
314
|
+
parts.push(`<line class="${isMonthStart ? "month-grid" : "grid"}" x1="${x}" y1="${topPad - 20}" x2="${x}" y2="${height - bottomPad}" />`);
|
|
315
|
+
parts.push(`<text class="axis" x="${x + 6}" y="${topPad - 18}">${xmlEscape(dayLabelUtc(dayStart))}</text>`);
|
|
316
|
+
}
|
|
317
|
+
parts.push(`<line class="grid" x1="${leftPad + chartWidth}" y1="${topPad - 20}" x2="${leftPad + chartWidth}" y2="${height - bottomPad}" />`);
|
|
318
|
+
// Vertical column dividers in left panel
|
|
319
|
+
parts.push(`<line class="col-div" x1="${col1DivX}" y1="${topPad - 22}" x2="${col1DivX}" y2="${height - bottomPad}" />`);
|
|
320
|
+
parts.push(`<line class="col-div" x1="${col2DivX}" y1="${topPad - 22}" x2="${col2DivX}" y2="${height - bottomPad}" />`);
|
|
321
|
+
parts.push(`<line class="col-div" x1="${col3DivX}" y1="${topPad - 22}" x2="${col3DivX}" y2="${height - bottomPad}" />`);
|
|
322
|
+
let currentY = topPad;
|
|
323
|
+
for (const entry of layoutRows) {
|
|
324
|
+
if (entry.type === "section") {
|
|
325
|
+
parts.push(`<rect x="0" y="${currentY - 18}" width="${width}" height="${sectionHeight}" fill="#f1f5f9" />`);
|
|
326
|
+
parts.push(`<text class="section" x="16" y="${currentY}">${xmlEscape(entry.label)}</text>`);
|
|
327
|
+
parts.push(`<line class="grid" x1="0" y1="${currentY + 8}" x2="${width}" y2="${currentY + 8}" />`);
|
|
328
|
+
currentY += sectionHeight + sectionGap;
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
const row = entry.row;
|
|
332
|
+
const rowTop = currentY - 14;
|
|
333
|
+
const rowMid = currentY - 2;
|
|
334
|
+
const taskState = row.kind === "task"
|
|
335
|
+
? (stateSnapshot?.tasks[row.id]?.state ?? "todo")
|
|
336
|
+
: row.kind === "gate"
|
|
337
|
+
? "gate"
|
|
338
|
+
: "milestone";
|
|
339
|
+
const fill = stateColor(taskState, criticalSet.has(row.id));
|
|
340
|
+
const scheduleNode = schedule.nodes.get(row.id);
|
|
341
|
+
if (row.kind === "gate") {
|
|
342
|
+
parts.push(`<rect x="0" y="${currentY - 14}" width="${width}" height="${rowHeight}" fill="#f3e8ff" />`);
|
|
343
|
+
}
|
|
344
|
+
if (row.kind === "task" && isInitialComplete(row)) {
|
|
345
|
+
parts.push(`<rect x="0" y="${currentY - 14}" width="${width}" height="${rowHeight}" fill="#f8fafc" />`);
|
|
346
|
+
}
|
|
347
|
+
if (row.kind === "task") {
|
|
348
|
+
const shortId = col1LabelFor(row);
|
|
349
|
+
const artifactName = scheduleNode?.artifact_name ?? "";
|
|
350
|
+
const phaseSet = col3LabelFor(row);
|
|
351
|
+
const taskName = row.name ?? "";
|
|
352
|
+
parts.push(`<text class="label-id" x="${col1X}" y="${currentY}" clip-path="url(#clip-col1)">${xmlEscape(shortId)}</text>`);
|
|
353
|
+
if (artifactName)
|
|
354
|
+
parts.push(`<text class="label-artifact" x="${col2X}" y="${currentY}" clip-path="url(#clip-col2)">${xmlEscape(artifactName)}</text>`);
|
|
355
|
+
if (phaseSet)
|
|
356
|
+
parts.push(`<text class="label-phase-set" x="${col3X}" y="${currentY}" clip-path="url(#clip-col3)">${xmlEscape(phaseSet)}</text>`);
|
|
357
|
+
if (taskName)
|
|
358
|
+
parts.push(`<text class="label" x="${col4X}" y="${currentY}" clip-path="url(#clip-col4)">${xmlEscape(taskName)}</text>`);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
const domainName = scheduleNode?.artifact_name ?? "";
|
|
362
|
+
const milestoneName = row.name ?? "";
|
|
363
|
+
parts.push(`<text class="label-id" x="${col1X}" y="${currentY}" clip-path="url(#clip-col1)">${xmlEscape(row.id)}</text>`);
|
|
364
|
+
if (domainName)
|
|
365
|
+
parts.push(`<text class="label-artifact" x="${col2X}" y="${currentY}" clip-path="url(#clip-col2)">${xmlEscape(domainName)}</text>`);
|
|
366
|
+
if (milestoneName)
|
|
367
|
+
parts.push(`<text class="label" x="${col4X}" y="${currentY}" clip-path="url(#clip-col4)">${xmlEscape(milestoneName)}</text>`);
|
|
368
|
+
}
|
|
369
|
+
parts.push(`<line class="row-grid" x1="0" y1="${currentY + 8}" x2="${width}" y2="${currentY + 8}" />`);
|
|
370
|
+
if (row.kind === "task" && isInitialComplete(row)) {
|
|
371
|
+
// No Gantt bar for completed deliverables — row label only
|
|
372
|
+
}
|
|
373
|
+
else if (row.kind === "task") {
|
|
374
|
+
const segments = taskSegments.get(row.id) ?? [];
|
|
375
|
+
for (const segment of segments) {
|
|
376
|
+
const startX = xForDate(segment.start);
|
|
377
|
+
const endX = xForDate(segment.end);
|
|
378
|
+
const widthPx = Math.max(2, endX - startX);
|
|
379
|
+
const stroke = criticalSet.has(row.id)
|
|
380
|
+
? "#991b1b"
|
|
381
|
+
: taskState === "todo"
|
|
382
|
+
? "#9ca3af"
|
|
383
|
+
: taskState === "blocked"
|
|
384
|
+
? "#b45309"
|
|
385
|
+
: "#334155";
|
|
386
|
+
parts.push(`<rect x="${startX}" y="${rowTop}" width="${widthPx}" height="12" rx="4" fill="${fill}" stroke="${stroke}" stroke-width="${criticalSet.has(row.id) ? 1.25 : 0.75}" opacity="0.94" />`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
else if (row.kind === "gate") {
|
|
390
|
+
const at = dateForWorkingOffset(row.es, cpm.project_start_date, schedule.calendar);
|
|
391
|
+
const cx = xForDate(at);
|
|
392
|
+
// Vertical bar with top/bottom caps (gate/barrier symbol)
|
|
393
|
+
parts.push(`<rect x="${cx - 2}" y="${rowTop}" width="4" height="12" fill="${fill}" opacity="0.9" />`);
|
|
394
|
+
parts.push(`<rect x="${cx - 7}" y="${rowTop}" width="14" height="3" rx="1" fill="${fill}" opacity="0.9" />`);
|
|
395
|
+
parts.push(`<rect x="${cx - 7}" y="${rowTop + 9}" width="14" height="3" rx="1" fill="${fill}" opacity="0.9" />`);
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
const at = dateForWorkingOffset(row.es, cpm.project_start_date, schedule.calendar);
|
|
399
|
+
const cx = xForDate(at);
|
|
400
|
+
parts.push(`<polygon points="${cx},${rowMid - 7} ${cx + 7},${rowMid} ${cx},${rowMid + 7} ${cx - 7},${rowMid}" fill="${fill}" />`);
|
|
401
|
+
}
|
|
402
|
+
currentY += rowHeight;
|
|
403
|
+
}
|
|
404
|
+
parts.push(`</svg>`);
|
|
405
|
+
return parts.join("\n");
|
|
406
|
+
}
|
|
407
|
+
export function buildGanttChartMarkdown(cpm, summary, options) {
|
|
408
|
+
const title = options?.title ?? "ガントチャート";
|
|
409
|
+
const svgFileName = options?.svgFileName ?? "gantt-chart.svg";
|
|
410
|
+
const scopeLabel = options?.scopeLabel ?? "full_schedule";
|
|
411
|
+
const lines = [];
|
|
412
|
+
lines.push(`# ${title}`);
|
|
413
|
+
lines.push("");
|
|
414
|
+
lines.push(...summary.progressSummaryLines);
|
|
415
|
+
lines.push(`- schedule_path: \`${cpm.schedule_path}\``);
|
|
416
|
+
if (cpm.project_start_date)
|
|
417
|
+
lines.push(`- project_start_date: \`${cpm.project_start_date}\``);
|
|
418
|
+
lines.push(`- project_duration_days: \`${formatDays(cpm.project_duration_days)}\``);
|
|
419
|
+
lines.push(`- scope: \`${scopeLabel}\``);
|
|
420
|
+
lines.push(`- critical_path_task_count: \`${summary.criticalPathTaskCount}\``);
|
|
421
|
+
lines.push(`- progress_percent: \`${summary.progressPercent}%\``);
|
|
422
|
+
lines.push(`- done_tasks: \`${summary.doneTasks}\``);
|
|
423
|
+
lines.push(`- task_state_counts: \`${summary.taskStateCounts}\``);
|
|
424
|
+
lines.push("");
|
|
425
|
+
lines.push(``);
|
|
426
|
+
lines.push("");
|
|
427
|
+
return lines.join("\n");
|
|
428
|
+
}
|