specdojo 0.4.7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/agents/specdojo-orchestrator.md +16 -9
- package/CHANGELOG.md +106 -0
- package/dist/catalog/generate.js +144 -13
- package/dist/commands/init.js +4 -0
- package/dist/commands/night-orchestrator.js +33 -4
- package/dist/dashboard/dashboard.js +5 -6
- package/dist/dashboard/timeline-build.js +5 -1
- package/dist/dashboard/timeline.js +6 -3
- package/dist/deliverable/deliverable.js +77 -4
- package/dist/docs/yaml-pages.js +17 -17
- package/dist/exec/core.js +3 -0
- package/dist/exec/parent-validation.js +7 -0
- package/dist/exec/pipeline-state.js +5 -2
- package/dist/exec/plans-core.js +49 -3
- package/dist/exec/plans-generation.js +48 -8
- package/dist/exec/plans-grade-findings.js +16 -0
- package/dist/exec/plans-planning.js +43 -0
- package/dist/exec/plans-storage.js +6 -2
- package/dist/exec/product-branch-records.js +105 -0
- package/dist/exec/product-branches.js +52 -0
- package/dist/exec/register-product-message.js +50 -0
- package/dist/exec/register.js +22 -1
- package/dist/exec/repo-integration-sync.js +11 -0
- package/dist/exec/repo-integration.js +58 -6
- package/dist/exec/repo-trace.js +19 -4
- package/dist/exec/results.js +11 -5
- package/dist/exec/run/register-command.js +16 -0
- package/dist/exec/run/register-core.js +11 -0
- package/dist/exec/run/register-mode.js +19 -1
- package/dist/exec/run/register-resume.js +33 -1
- package/dist/exec/run/register-worktree.js +52 -8
- package/dist/exec/run/schedule-prepare.js +7 -3
- package/dist/exec/strategy.js +4 -1
- package/dist/exec/task-repos.js +92 -16
- package/dist/exec/worktree-command.js +2 -2
- package/dist/exec/worktree-ops-commit.js +7 -1
- package/dist/exec/worktree.js +3 -3
- package/dist/grade/apply.js +6 -2
- package/dist/grade/markdown.js +7 -2
- package/dist/grade/plan.js +6 -4
- package/dist/register/approach.js +19 -0
- package/dist/register/catalog-status.js +49 -0
- package/dist/register/core.js +8 -0
- package/dist/register/create-commands.js +86 -4
- package/dist/register/deliverable-target.js +24 -17
- package/dist/register/dependency.js +123 -0
- package/dist/register/derivation.js +2 -2
- package/dist/register/epic.js +42 -0
- package/dist/register/event-merge.js +9 -2
- package/dist/register/events.js +10 -0
- package/dist/register/external-project.js +6 -0
- package/dist/register/input.js +168 -0
- package/dist/register/item.js +71 -0
- package/dist/register/maintenance-commands.js +7 -1
- package/dist/register/planning.js +37 -0
- package/dist/register/register.js +7 -3
- package/dist/register/renumber.js +16 -4
- package/dist/register/update.js +6 -0
- package/dist/register/views.js +55 -4
- package/dist/schedule/approach.js +9 -0
- package/dist/schedule/schedule.js +3 -1
- package/dist/schedule/strategy-generate-scope.js +5 -1
- package/dist/schedule/strategy-generate.js +1 -0
- package/dist/schedule/strategy-profiles.js +22 -2
- package/dist/shared/agent-types.js +7 -1
- package/dist/shared/branch-template.js +26 -0
- package/dist/shared/commit-message-template.js +38 -0
- package/dist/shared/commit-types.js +15 -0
- package/dist/shared/grade-result.js +23 -5
- package/dist/shared/markdownlint-config.js +38 -0
- package/dist/shared/markdownlint-scaffold.js +2 -9
- package/dist/shared/specdojo-config.js +42 -4
- package/dist/shared/specdojo-gitignore.js +4 -0
- package/docs/ja/specdojo/exec-templates/xep-catalog-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xep-draft-template.md +93 -0
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +9 -2
- package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xep-strategy-planning-template.md +24 -0
- package/docs/ja/specdojo/exec-templates/xer-human-bootstrap-finalize-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xer-human-draft-template.md +23 -0
- package/docs/ja/specdojo/exec-templates/xer-human-finalize-template.md +2 -0
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +7 -4
- package/docs/ja/specdojo/guides/docs-editing-guide.md +14 -1
- package/docs/ja/specdojo/guides/docs-structure-guide.md +10 -8
- package/docs/ja/specdojo/guides/exec-config-guide.md +3 -1
- package/docs/ja/specdojo/guides/exec-operation-guide.md +111 -16
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +19 -1
- package/docs/ja/specdojo/guides/practice-system-composition-guide.md +2 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +37 -14
- package/docs/ja/specdojo/guides/register-operation-guide.md +58 -16
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +1 -1
- package/docs/ja/specdojo/guides/ryu-guide.md +114 -23
- package/docs/ja/specdojo/guides/schedule-design-guide.md +31 -4
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +16 -16
- package/docs/ja/specdojo/guides/timeline-design-guide.md +37 -33
- package/docs/ja/specdojo/recipes/exec-human-finalize-recipe.md +1 -0
- package/docs/ja/specdojo/recipes/tsd-recipe.md +206 -0
- package/docs/ja/specdojo/references/command-reference.md +86 -15
- package/docs/ja/specdojo/references/specdojo-config-reference.md +81 -8
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +5 -4
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +8 -7
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +9 -0
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +9 -6
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +3 -1
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +2 -0
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +4 -2
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +10 -9
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +10 -9
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +7 -6
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +54 -36
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/sch-rulebook.md +4 -1
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +7 -6
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +9 -8
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +80 -61
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +111 -63
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +3 -2
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +1 -0
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +1 -0
- package/docs/ja/specdojo/samples/atc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/atc-sample.md +1 -1
- package/docs/ja/specdojo/samples/bac-sample.md +1 -1
- package/docs/ja/specdojo/samples/bdd-sample.yaml +1 -1
- package/docs/ja/specdojo/samples/bds-sample.md +1 -1
- package/docs/ja/specdojo/samples/bes-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/bes-sample.md +1 -1
- package/docs/ja/specdojo/samples/ccd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdfd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +1 -1
- package/docs/ja/specdojo/samples/cdsd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cld-sample.md +1 -1
- package/docs/ja/specdojo/samples/cnd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cop-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/cop-sample.md +1 -1
- package/docs/ja/specdojo/samples/cpd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cstd-sample.md +1 -1
- package/docs/ja/specdojo/samples/cxd-sample.md +1 -1
- package/docs/ja/specdojo/samples/dct-sample.yaml +5 -1
- package/docs/ja/specdojo/samples/dmd-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/dmd-sample.md +1 -1
- package/docs/ja/specdojo/samples/etc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/etc-sample.md +1 -1
- package/docs/ja/specdojo/samples/gl-sample.yaml +2 -0
- package/docs/ja/specdojo/samples/ifd-sample.md +1 -1
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +1 -0
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +1 -1
- package/docs/ja/specdojo/samples/ifx-file-sample.md +1 -1
- package/docs/ja/specdojo/samples/ifx-index-sample.yaml +1 -0
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +2 -1
- package/docs/ja/specdojo/samples/itc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/itc-sample.md +1 -1
- package/docs/ja/specdojo/samples/mtp-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-availability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-integrity-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-operations-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-performance-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-reliability-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +1 -1
- package/docs/ja/specdojo/samples/nfr-usability-sample.md +1 -1
- package/docs/ja/specdojo/samples/ntp-sample.md +1 -1
- package/docs/ja/specdojo/samples/opd-sample.md +1 -1
- package/docs/ja/specdojo/samples/opr-sample.md +1 -1
- package/docs/ja/specdojo/samples/otp-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/otp-sample.md +1 -1
- package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +1 -1
- package/docs/ja/specdojo/samples/sac-sample.md +1 -1
- package/docs/ja/specdojo/samples/sf-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/sf-sample.md +1 -1
- package/docs/ja/specdojo/samples/sld-sample.md +1 -1
- package/docs/ja/specdojo/samples/stc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/stc-sample.md +1 -1
- package/docs/ja/specdojo/samples/stsd-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +1 -1
- package/docs/ja/specdojo/samples/sysd-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/tsd-index-sample.md +22 -16
- package/docs/ja/specdojo/samples/tsd-sample.md +241 -21
- package/docs/ja/specdojo/samples/tsp-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/uis-sample.md +1 -1
- package/docs/ja/specdojo/samples/utc-index-sample.md +1 -1
- package/docs/ja/specdojo/samples/utc-sample.md +1 -1
- package/docs/ja/specdojo/standards/document-metadata-standard.md +44 -3
- package/docs/ja/specdojo/standards/exec-human-finalize-standard.md +1 -0
- package/docs/ja/specdojo/standards/guide-authoring-standard.md +2 -1
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +2 -0
- package/docs/ja/specdojo/standards/philosophy-authoring-standard.md +1 -0
- package/docs/ja/specdojo/standards/recipe-authoring-standard.md +2 -1
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +18 -12
- package/docs/ja/specdojo/standards/sample-authoring-standard.md +1 -0
- package/docs/ja/specdojo/standards/standard-authoring-standard.md +2 -1
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +1 -1
- package/docs/ja/specdojo/templates/pjr-change-request-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-dependent-items-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-epic-items-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-epic-template.md +44 -0
- package/docs/ja/specdojo/templates/pjr-index-template.md +4 -2
- package/docs/ja/specdojo/templates/pjr-issue-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-question-template.md +11 -5
- package/docs/ja/specdojo/templates/pjr-risk-template.md +10 -4
- package/docs/ja/specdojo/templates/pjr-todo-template.md +10 -4
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/dct.schema.yaml +9 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +24 -16
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +5 -1
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +1 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/gl.schema.yaml +8 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +5 -1
- package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +2 -1
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +21 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +75 -3
- package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +5 -0
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +1 -0
- package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +43 -0
- package/package.json +4 -3
- package/templates/antigravity/orchestrator.md +16 -9
- package/templates/claude/agents/specdojo-orchestrator.md +16 -9
- package/templates/codex/agents/specdojo-orchestrator.toml +16 -9
- package/templates/codex/orchestrator.md +16 -9
- package/templates/copilot/README.md +2 -1
- package/templates/devcontainer/remote-host/specdojo-tmux.sh.sample +14 -8
- package/templates/opencode/agents/specdojo-orchestrator.md +16 -9
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { resolveItemCommitTypeAndScope } from "../register/item.js";
|
|
3
|
+
import { DEFAULT_BRANCH_TEMPLATE, expandBranchTemplate } from "../shared/branch-template.js";
|
|
4
|
+
import { worktreeNameFromTaskId } from "./worktree.js";
|
|
5
|
+
import { assertProductBranchAvailable, recordedProductBranch } from "./product-branch-records.js";
|
|
6
|
+
import { parseIntegrationBranchOverrides } from "./task-repos.js";
|
|
7
|
+
export function parseProductBranchOverrides(values) {
|
|
8
|
+
try {
|
|
9
|
+
return parseIntegrationBranchOverrides(values);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
throw new Error((error instanceof Error ? error.message : String(error)).replaceAll("--integration-branch", "--branch"));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Resolve and preflight names before register start or stale-worktree removal. */
|
|
16
|
+
export function resolveProductBranches(products, params) {
|
|
17
|
+
const overrides = parseProductBranchOverrides(params.overrides);
|
|
18
|
+
for (const repo of overrides.keys()) {
|
|
19
|
+
if (!products.some((product) => product.name === repo)) {
|
|
20
|
+
throw new Error(`--branch references undeclared product repository: ${repo}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return products.map((product) => {
|
|
24
|
+
const persisted = recordedProductBranch(product.repoRoot, params.taskId);
|
|
25
|
+
const override = overrides.get(product.name);
|
|
26
|
+
const resumedBranch = persisted ?? `exec/${worktreeNameFromTaskId(params.taskId)}`;
|
|
27
|
+
if (params.resume && override && override !== resumedBranch) {
|
|
28
|
+
throw new Error(`--branch cannot change the resumed run branch for ${product.name}: ${resumedBranch}`);
|
|
29
|
+
}
|
|
30
|
+
const { type, scope } = resolveItemCommitTypeAndScope(params.item, {
|
|
31
|
+
projectConfig: params.projectConfig,
|
|
32
|
+
repoConfig: params.projectConfig?.repos?.find((repo) => repo.name === product.name),
|
|
33
|
+
});
|
|
34
|
+
const topic = params.ticketPath
|
|
35
|
+
? basename(params.ticketPath)
|
|
36
|
+
.replace(/^pjr-[a-z0-9]{4}-/, "")
|
|
37
|
+
.replace(/\.md$/, "")
|
|
38
|
+
: params.item.id.toLowerCase();
|
|
39
|
+
const branch = (params.resume ? resumedBranch : undefined) ??
|
|
40
|
+
override ??
|
|
41
|
+
expandBranchTemplate(product.branchTemplate ?? DEFAULT_BRANCH_TEMPLATE, {
|
|
42
|
+
project: params.projectId,
|
|
43
|
+
id: params.item.id,
|
|
44
|
+
topic,
|
|
45
|
+
type,
|
|
46
|
+
scope: scope ?? "",
|
|
47
|
+
title: params.item.title.replace(/\s+/g, " ").trim(),
|
|
48
|
+
});
|
|
49
|
+
assertProductBranchAvailable(product.repoRoot, params.taskId, branch);
|
|
50
|
+
return { ...product, branch };
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { resolveItemCommitTypeAndScope } from "../register/item.js";
|
|
3
|
+
import { expandCommitMessageTemplate } from "../shared/commit-message-template.js";
|
|
4
|
+
import { commitSubject } from "./run/mode-shared.js";
|
|
5
|
+
import { refsTrailer } from "./repo-trace.js";
|
|
6
|
+
import { productIntegrationTarget } from "./task-repos.js";
|
|
7
|
+
/** Build only product messages; project bookkeeping keeps its existing subjects. */
|
|
8
|
+
export function registerProductMessage(params) {
|
|
9
|
+
const { item, projectId, repoConfig, product } = params;
|
|
10
|
+
const template = params.kind === "commit"
|
|
11
|
+
? repoConfig?.commit_subject_template
|
|
12
|
+
: repoConfig?.merge_message_template;
|
|
13
|
+
const { type, scope } = resolveItemCommitTypeAndScope(item, {
|
|
14
|
+
projectConfig: params.projectConfig,
|
|
15
|
+
repoConfig,
|
|
16
|
+
});
|
|
17
|
+
const topic = params.ticketPath
|
|
18
|
+
? basename(params.ticketPath)
|
|
19
|
+
.replace(/^pjr-[a-z0-9]{4}-/, "")
|
|
20
|
+
.replace(/\.md$/, "")
|
|
21
|
+
: item.id.toLowerCase();
|
|
22
|
+
const expanded = template === undefined
|
|
23
|
+
? commitSubject(`exec(register ${item.id}): `, item.title)
|
|
24
|
+
: expandCommitMessageTemplate(template, {
|
|
25
|
+
id: item.id,
|
|
26
|
+
project: projectId,
|
|
27
|
+
topic,
|
|
28
|
+
type,
|
|
29
|
+
scope: scope ?? "",
|
|
30
|
+
title: item.title.replace(/\s+/g, " ").trim(),
|
|
31
|
+
branch: product.branch,
|
|
32
|
+
target: productIntegrationTarget(product),
|
|
33
|
+
});
|
|
34
|
+
// Commit templates are subjects; merge templates may also provide a body.
|
|
35
|
+
const [first = "", ...body] = expanded.replace(/\r\n?/g, "\n").trim().split("\n");
|
|
36
|
+
const message = params.kind === "commit"
|
|
37
|
+
? commitSubject("", expanded)
|
|
38
|
+
: [commitSubject("", first), ...body].join("\n");
|
|
39
|
+
const trailer = refsTrailer(projectId, item.id);
|
|
40
|
+
// Keep exactly one required trailer at the end, even if the template supplied it earlier.
|
|
41
|
+
const withoutTrailer = message
|
|
42
|
+
.split("\n")
|
|
43
|
+
.filter((line) => line.trim() !== trailer)
|
|
44
|
+
.join("\n")
|
|
45
|
+
.trimEnd();
|
|
46
|
+
if (!withoutTrailer.split("\n")[0]?.trim()) {
|
|
47
|
+
throw new Error(`${product.name}: ${params.kind} message template expanded to an empty subject`);
|
|
48
|
+
}
|
|
49
|
+
return `${withoutTrailer}\n\n${trailer}`;
|
|
50
|
+
}
|
package/dist/exec/register.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readRegisterInput, registerInputSection } from "../register/input.js";
|
|
1
2
|
import { resolveRegisterDeliverableTarget, } from "../register/deliverable-target.js";
|
|
2
3
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { basename, extname, join, relative, resolve } from "node:path";
|
|
@@ -15,6 +16,8 @@ import { formatMarkdownFile } from "./format.js";
|
|
|
15
16
|
import { loadConfig, specdojoRootDir } from "../shared/specdojo-config.js";
|
|
16
17
|
import { resolveAuthoringSources, } from "../register/authoring-sources.js";
|
|
17
18
|
import { repoEnvironmentVariableName } from "./task-repos.js";
|
|
19
|
+
import { isPlanningApproach } from "../register/planning.js";
|
|
20
|
+
import { planningPlanFields } from "./plans-planning.js";
|
|
18
21
|
const EDIT_TYPES = new Set(["todo", "issue", "change-request"]);
|
|
19
22
|
const INVESTIGATE_TYPES = new Set(["question", "risk"]);
|
|
20
23
|
export function registerItemCategory(itemType) {
|
|
@@ -374,6 +377,9 @@ export async function generateRegisterPlan(opts) {
|
|
|
374
377
|
const { item } = opts;
|
|
375
378
|
const category = requireRunnableRegisterItem(item);
|
|
376
379
|
const ticketPath = ticketPathFromItem(item, opts.registerPaths.projectRegisterPath);
|
|
380
|
+
const inputs = ticketPath && existsSync(ticketPath)
|
|
381
|
+
? readRegisterInput(readFileSync(ticketPath, "utf8"))
|
|
382
|
+
: item.inputs;
|
|
377
383
|
if (item.approach) {
|
|
378
384
|
validateRegisterApproachTargets({
|
|
379
385
|
repoRoot: specdojoRootDir(),
|
|
@@ -395,7 +401,20 @@ export async function generateRegisterPlan(opts) {
|
|
|
395
401
|
let cataloglessConditions = "";
|
|
396
402
|
let planTargets = [targetId];
|
|
397
403
|
let authoring;
|
|
398
|
-
if (
|
|
404
|
+
if (isPlanningApproach(item.approach)) {
|
|
405
|
+
const project = loadConfig(specdojoRootDir()).config?.projects[opts.projectId] ?? {};
|
|
406
|
+
const fields = planningPlanFields({
|
|
407
|
+
repoRoot: specdojoRootDir(),
|
|
408
|
+
projectId: opts.projectId,
|
|
409
|
+
project,
|
|
410
|
+
catalogPath: opts.catalogPath ?? "",
|
|
411
|
+
approach: item.approach,
|
|
412
|
+
target: targetId,
|
|
413
|
+
});
|
|
414
|
+
refs = fields.refs;
|
|
415
|
+
cataloglessConditions = fields.conditions;
|
|
416
|
+
}
|
|
417
|
+
else if (newKataKind) {
|
|
399
418
|
const sourceRefs = [...(item.targets ?? []).slice(1), ...(item.sources ?? [])];
|
|
400
419
|
const project = loadConfig(specdojoRootDir()).config?.projects[opts.projectId] ?? {};
|
|
401
420
|
const resolvedSources = resolveAuthoringSources({
|
|
@@ -493,6 +512,7 @@ export async function generateRegisterPlan(opts) {
|
|
|
493
512
|
deliverable,
|
|
494
513
|
...(refs ? { refs } : {}),
|
|
495
514
|
...(authoring ? { authoring } : {}),
|
|
515
|
+
registerInput: inputs,
|
|
496
516
|
additionalConditions: [
|
|
497
517
|
cataloglessConditions,
|
|
498
518
|
registerCompletionConditions(item, ticketPath),
|
|
@@ -530,6 +550,7 @@ export async function generateRegisterPlan(opts) {
|
|
|
530
550
|
_PJR_DUE_: item.due,
|
|
531
551
|
_PJR_TICKET_REF_: ticketPath ? `\`${repoRelativePath(ticketPath)}\`` : "-",
|
|
532
552
|
_RESULT_REF_: resultRef,
|
|
553
|
+
_REGISTER_INPUT_: registerInputSection(inputs),
|
|
533
554
|
_GRADE_FINDINGS_: ticketPath ? registerGradeFindingsText(opts.projectId, ticketPath) : "- なし",
|
|
534
555
|
_AUTOPILOT_CONSTRAINTS_: registerAutopilotConstraints(item),
|
|
535
556
|
};
|
|
@@ -229,6 +229,17 @@ export function syncTaskWorktreesWithIntegrationTargets(params) {
|
|
|
229
229
|
const synced = [];
|
|
230
230
|
for (const product of params.worktree.repos ?? []) {
|
|
231
231
|
const target = productIntegrationTarget(product);
|
|
232
|
+
if (product.integrationStrategy === "branch-only" || product.integrationStrategy === "ff") {
|
|
233
|
+
synced.push({
|
|
234
|
+
repo: product.name,
|
|
235
|
+
target,
|
|
236
|
+
status: "skipped",
|
|
237
|
+
detail: product.integrationStrategy === "ff"
|
|
238
|
+
? "fast-forward only (ff)"
|
|
239
|
+
: "product-side review (branch-only)",
|
|
240
|
+
});
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
232
243
|
if (params.integratedProducts?.has(product.name)) {
|
|
233
244
|
synced.push({ repo: product.name, target, status: "skipped", detail: "already integrated" });
|
|
234
245
|
continue;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { productBranchRecords } from "./product-branch-records.js";
|
|
1
2
|
import { appendFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
3
|
import { dirname, resolve } from "node:path";
|
|
3
4
|
import { acquireSchedulerLock, releaseSchedulerLock } from "./events.js";
|
|
@@ -148,7 +149,7 @@ export function commitProductWorktrees(params) {
|
|
|
148
149
|
if (!existsSync(product.path))
|
|
149
150
|
continue;
|
|
150
151
|
const outcome = commitProductWorktree(product, {
|
|
151
|
-
message: params.message,
|
|
152
|
+
message: typeof params.message === "function" ? params.message(product) : params.message,
|
|
152
153
|
targetPaths: targetPaths.get(product.name),
|
|
153
154
|
failureLogPath: params.failureLogPath,
|
|
154
155
|
});
|
|
@@ -198,6 +199,11 @@ export function productMergeState(product) {
|
|
|
198
199
|
]);
|
|
199
200
|
if (ancestor.status !== 0)
|
|
200
201
|
return "pending";
|
|
202
|
+
if (product.integrationStrategy === "ff") {
|
|
203
|
+
const record = productBranchRecords(product.repoRoot).find((entry) => entry.branch === product.branch);
|
|
204
|
+
if (record?.startCommit)
|
|
205
|
+
return record.startCommit === gitText(tip.stdout).trim() ? "unchanged" : "merged";
|
|
206
|
+
}
|
|
201
207
|
const firstParent = gitOutput(product.repoRoot, ["rev-list", "--first-parent", target])
|
|
202
208
|
.split("\n")
|
|
203
209
|
.map((line) => line.trim());
|
|
@@ -245,6 +251,10 @@ export function productMergeBlockers(product) {
|
|
|
245
251
|
blockers.push(block(`uncommitted changes outside the commit scope: ` +
|
|
246
252
|
leftover.map((path) => `${product.name}:${path}`).join(", ")));
|
|
247
253
|
}
|
|
254
|
+
// Product-side review owns mergeability and the integration target's checkout.
|
|
255
|
+
// The exec worktree must still be clean before its project-side result is accepted.
|
|
256
|
+
if (product.integrationStrategy === "branch-only")
|
|
257
|
+
return blockers;
|
|
248
258
|
const target = productIntegrationTarget(product);
|
|
249
259
|
if (target === "HEAD" || !branchExists(product.repoRoot, target)) {
|
|
250
260
|
blockers.push(block(`integration branch ${target === "HEAD" ? "(detached HEAD)" : target} is not a local ` +
|
|
@@ -257,6 +267,12 @@ export function productMergeBlockers(product) {
|
|
|
257
267
|
}
|
|
258
268
|
if (productMergeState(product) !== "pending")
|
|
259
269
|
return blockers;
|
|
270
|
+
if (product.integrationStrategy === "ff" &&
|
|
271
|
+
gitResult(product.repoRoot, ["merge-base", "--is-ancestor", target, product.branch]).status !==
|
|
272
|
+
0) {
|
|
273
|
+
blockers.push(block(`cannot fast-forward ${target} to ${product.branch}: histories have diverged; no rebase or merge is performed`));
|
|
274
|
+
return blockers;
|
|
275
|
+
}
|
|
260
276
|
const merged = mergeTree(product.repoRoot, target, product.branch);
|
|
261
277
|
if (merged.kind === "conflicts") {
|
|
262
278
|
blockers.push(block(`merge conflicts with ${target}: ${merged.paths.join(", ")}`));
|
|
@@ -325,8 +341,8 @@ export function projectMergeBlockers(params) {
|
|
|
325
341
|
}
|
|
326
342
|
// ── プロダクトの merge ─────────────────────────────────────────────────────
|
|
327
343
|
/**
|
|
328
|
-
*
|
|
329
|
-
*
|
|
344
|
+
* Integrate the product branch and return the resulting tip. The ff strategy only advances the
|
|
345
|
+
* target to the product tip, without creating a commit. For merge, when the target is checked out,
|
|
330
346
|
* `git merge --no-ff` updates that working tree; a failed merge is aborted. Otherwise the merge
|
|
331
347
|
* commit is written with `merge-tree` / `commit-tree` and the branch is moved with a
|
|
332
348
|
* compare-and-swap `update-ref`, so a concurrent update of the target is never overwritten.
|
|
@@ -336,6 +352,29 @@ export function mergeProductIntoTarget(params) {
|
|
|
336
352
|
const target = productIntegrationTarget(product);
|
|
337
353
|
const checkout = checkoutOfBranch(product.repoRoot, target);
|
|
338
354
|
const header = `=== ${new Date().toISOString()} ${product.name}: merge ${product.branch} into ${target} ===`;
|
|
355
|
+
if (product.integrationStrategy === "ff") {
|
|
356
|
+
const parent = gitOutput(product.repoRoot, ["rev-parse", `refs/heads/${target}`]).trim();
|
|
357
|
+
const tip = gitOutput(product.repoRoot, ["rev-parse", `${product.branch}^{commit}`]).trim();
|
|
358
|
+
if (gitResult(product.repoRoot, ["merge-base", "--is-ancestor", parent, tip]).status !== 0) {
|
|
359
|
+
throw new Error(`cannot fast-forward ${target} to ${product.branch}: histories have diverged; no rebase or merge is performed`);
|
|
360
|
+
}
|
|
361
|
+
const result = checkout
|
|
362
|
+
? gitResult(checkout, ["merge", "--ff-only", tip])
|
|
363
|
+
: gitResult(product.repoRoot, [
|
|
364
|
+
"update-ref",
|
|
365
|
+
"-m",
|
|
366
|
+
`exec: fast-forward ${product.branch}`,
|
|
367
|
+
`refs/heads/${target}`,
|
|
368
|
+
tip,
|
|
369
|
+
parent,
|
|
370
|
+
]);
|
|
371
|
+
if (result.status !== 0) {
|
|
372
|
+
const detail = gitText(result.stderr).trim() || gitText(result.stdout).trim();
|
|
373
|
+
appendGitFailureLog(params.failureLogPath, [header, `fast-forward failed: ${detail}`, ""]);
|
|
374
|
+
throw new Error(`cannot fast-forward ${target} to ${product.branch}: ${detail}`);
|
|
375
|
+
}
|
|
376
|
+
return tip;
|
|
377
|
+
}
|
|
339
378
|
if (checkout) {
|
|
340
379
|
const result = gitResult(checkout, ["merge", "--no-ff", "-m", message, product.branch]);
|
|
341
380
|
if (result.status === 0)
|
|
@@ -419,7 +458,8 @@ function errorMessage(error) {
|
|
|
419
458
|
*
|
|
420
459
|
* 1. check every product that still has commits to integrate and the project (`checkProject`); if
|
|
421
460
|
* any repository cannot be integrated, nothing is merged
|
|
422
|
-
* 2.
|
|
461
|
+
* 2. process products in declaration order: retain branch-only exec branches, otherwise merge,
|
|
462
|
+
* skipping those already merged (resume)
|
|
423
463
|
* 3. run `beforeProjectMerge` (record and commit the project-side state) and `mergeProject`
|
|
424
464
|
*
|
|
425
465
|
* Each repository's state is passed to `record`. The project is recorded as merged before
|
|
@@ -436,7 +476,7 @@ export function integrateTaskRepositories(params) {
|
|
|
436
476
|
const record = params.record ?? (() => undefined);
|
|
437
477
|
const order = [...products.map((product) => product.name), PROJECT_REPO_NAME];
|
|
438
478
|
const done = new Set();
|
|
439
|
-
//
|
|
479
|
+
// 処理済み(merge 済み、変更なし、または branch-only の保持)のリポジトリ。
|
|
440
480
|
const integratedLabels = () => order.filter((name) => done.has(name));
|
|
441
481
|
const pendingNames = () => order.filter((name) => !done.has(name));
|
|
442
482
|
const fail = (repo, cause) => {
|
|
@@ -450,6 +490,10 @@ export function integrateTaskRepositories(params) {
|
|
|
450
490
|
};
|
|
451
491
|
const states = new Map();
|
|
452
492
|
for (const product of products) {
|
|
493
|
+
if (product.integrationStrategy === "branch-only") {
|
|
494
|
+
states.set(product.name, "pending");
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
453
497
|
const state = productMergeState(product);
|
|
454
498
|
states.set(product.name, state);
|
|
455
499
|
if (state === "pending")
|
|
@@ -492,6 +536,12 @@ export function integrateTaskRepositories(params) {
|
|
|
492
536
|
for (const product of products) {
|
|
493
537
|
if (states.get(product.name) !== "pending")
|
|
494
538
|
continue;
|
|
539
|
+
if (product.integrationStrategy === "branch-only") {
|
|
540
|
+
done.add(product.name);
|
|
541
|
+
record(product.name, { status: "branch-only", commit: null, merged_at: null });
|
|
542
|
+
process.stdout.write(` [integrate] ${product.name}: not merged; retained exec branch ${product.branch}\n`);
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
495
545
|
let lockDir = "";
|
|
496
546
|
let commit;
|
|
497
547
|
try {
|
|
@@ -504,7 +554,9 @@ export function integrateTaskRepositories(params) {
|
|
|
504
554
|
}
|
|
505
555
|
commit = mergeProductIntoTarget({
|
|
506
556
|
product,
|
|
507
|
-
message: params.productMergeMessage
|
|
557
|
+
message: typeof params.productMergeMessage === "function"
|
|
558
|
+
? params.productMergeMessage(product)
|
|
559
|
+
: (params.productMergeMessage ?? params.mergeMessage),
|
|
508
560
|
failureLogPath: params.failureLogPath,
|
|
509
561
|
});
|
|
510
562
|
}
|
package/dist/exec/repo-trace.js
CHANGED
|
@@ -46,6 +46,8 @@ function integrationCommitOf(product, target) {
|
|
|
46
46
|
if (tip.status !== 0)
|
|
47
47
|
return null;
|
|
48
48
|
const tipSha = String(tip.stdout).trim();
|
|
49
|
+
if (product.integrationStrategy === "ff")
|
|
50
|
+
return tipSha;
|
|
49
51
|
const lines = gitOutput(product.repoRoot, [
|
|
50
52
|
"rev-list",
|
|
51
53
|
"--first-parent",
|
|
@@ -65,11 +67,12 @@ function pullRequestOf(repoRoot, commit) {
|
|
|
65
67
|
/** Integration snapshot of one product repository, read from the Git state after integration. */
|
|
66
68
|
export function productIntegrationTrace(product) {
|
|
67
69
|
const integrationBranch = productIntegrationTarget(product);
|
|
68
|
-
const state = productMergeState(product);
|
|
70
|
+
const state = product.integrationStrategy === "branch-only" ? "branch-only" : productMergeState(product);
|
|
69
71
|
const commit = state === "merged" ? integrationCommitOf(product, integrationBranch) : null;
|
|
70
72
|
return {
|
|
71
73
|
repo: product.name,
|
|
72
74
|
integrationBranch,
|
|
75
|
+
execBranch: product.branch,
|
|
73
76
|
state,
|
|
74
77
|
commit,
|
|
75
78
|
pullRequest: commit ? pullRequestOf(product.repoRoot, commit) : null,
|
|
@@ -81,6 +84,8 @@ function traceRows(key, traces, recordedAt) {
|
|
|
81
84
|
`\`${key}\``,
|
|
82
85
|
`\`${trace.repo}\``,
|
|
83
86
|
`\`${trace.integrationBranch}\``,
|
|
87
|
+
`\`${trace.execBranch}\``,
|
|
88
|
+
trace.state,
|
|
84
89
|
trace.pullRequest ?? NOT_APPLICABLE,
|
|
85
90
|
trace.commit
|
|
86
91
|
? `\`${trace.commit}\``
|
|
@@ -103,14 +108,24 @@ function renderTable(header, rows) {
|
|
|
103
108
|
}
|
|
104
109
|
/** Body of the trace section (without the heading). */
|
|
105
110
|
export function renderResultTraceBody(params) {
|
|
106
|
-
const table = renderTable([
|
|
111
|
+
const table = renderTable([
|
|
112
|
+
"trace key",
|
|
113
|
+
"repository",
|
|
114
|
+
"integration branch",
|
|
115
|
+
"exec branch",
|
|
116
|
+
"state",
|
|
117
|
+
"PR",
|
|
118
|
+
"commit snapshot",
|
|
119
|
+
"recorded at",
|
|
120
|
+
], traceRows(params.traceKey, params.traces, params.recordedAt));
|
|
107
121
|
// PJR-9KST: result は利用側プロジェクトの markdownlint 設定で検査され、既定の MD013(80 文字)が
|
|
108
122
|
// 効くことがある。説明文は文ごとに改行して短く保ち、行長を内容で決められない表だけ MD013 を外す。
|
|
109
123
|
return [
|
|
110
|
-
"runner
|
|
124
|
+
"runner がプロダクトリポジトリの処理後に記録した状態と、統合先の commit snapshot です。",
|
|
111
125
|
"プロジェクトリポジトリの統合は、この result を含む merge commit で確認します。",
|
|
112
126
|
`その merge commit には \`Refs: ${params.traceKey}\` を付けます。`,
|
|
113
|
-
"
|
|
127
|
+
"`branch-only` の行は未統合です。exec branch を保持し、push と PR 作成はプロダクト側で行います。",
|
|
128
|
+
"PR が `not applicable` の行では、runner は PR を作成していません。",
|
|
114
129
|
"",
|
|
115
130
|
"<!-- markdownlint-disable MD013 -->",
|
|
116
131
|
"",
|
package/dist/exec/results.js
CHANGED
|
@@ -105,9 +105,12 @@ function execResultDocId(projectId, mode, localBase) {
|
|
|
105
105
|
const localId = `${prefix}-${localBase.toLowerCase()}`;
|
|
106
106
|
return projectId ? `${projectId}:${localId}` : localId;
|
|
107
107
|
}
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
function loadResultTemplate(mode, approach) {
|
|
108
|
+
// Human draft results guide scaffold/context entry; finalize results guide confirmation.
|
|
109
|
+
// Other approaches use their specialized result or the standard mode template.
|
|
110
|
+
function loadResultTemplate(mode, approach, execution) {
|
|
111
|
+
if (mode === "edit" && execution === "human" && approach === "draft") {
|
|
112
|
+
return readFileSync(resolveSpecdojoPath("docs/ja/specdojo/exec-templates/xer-human-draft-template.md"), "utf8");
|
|
113
|
+
}
|
|
111
114
|
if (mode === "edit" && approach === "cross-deliverable-dedup") {
|
|
112
115
|
const crossDeliverablePath = resolveSpecdojoPathIfExists("docs/ja/specdojo/exec-templates/xer-cross-deliverable-dedup-template.md");
|
|
113
116
|
if (crossDeliverablePath)
|
|
@@ -160,7 +163,7 @@ async function supersedePriorResults(resultsDir, taskId, nextResultPath, superse
|
|
|
160
163
|
const APPROACH_SECTION_WITH_APPROACH = [
|
|
161
164
|
"## 4. 進め方と実践の型の適用",
|
|
162
165
|
"",
|
|
163
|
-
"_TODO_: `approach` に従ってどう進めたか、その進め方の中で実践の型(rulebook / recipe / sample / template)をどう適用したかを記入する(`fully-guided` で rulebook / recipe / sample
|
|
166
|
+
"_TODO_: `approach` に従ってどう進めたか、その進め方の中で実践の型(rulebook / recipe / sample / template)をどう適用したかを記入する(`draft` で任された範囲・提案値ごとの出典と選定理由・反映した元の指示、`fully-guided` で rulebook / recipe / sample に沿って既存成果物をどう磨き込んだか、`recipe-guided` で recipe のみを基準にした内容、`freeform` で実践の型より優先した実例やプロジェクト文脈、`retrofit` で実際に参照した実装パス・抽出した現在動作・反映/新設判断・未反映の乖離・未確認範囲、`rulebook-authoring` などの authoring 系で手本から一般化した内容・変更しなかった手本・参照の付け替えまたは見送り、`rulebook-maintenance` などの maintenance 系で見直した実践の型とその根拠、など)。実践の型を基準にしなかった場合は、その判断と代わりに根拠にした内容も記入する。複数文書間に矛盾があり rulebook を正として判断した箇所、参照範囲から外れていた文書とその代わりに根拠にした内容があれば、あわせて記録する。",
|
|
164
167
|
].join("\n");
|
|
165
168
|
const APPROACH_SECTION_WITHOUT_APPROACH = [
|
|
166
169
|
"## 4. 進め方",
|
|
@@ -178,7 +181,7 @@ export async function scaffoldResult(opts) {
|
|
|
178
181
|
const resultsDir = join(executionPath, "exec", "results");
|
|
179
182
|
if (!existsSync(resultsDir))
|
|
180
183
|
mkdirSync(resultsDir, { recursive: true });
|
|
181
|
-
const template = loadResultTemplate(mode, approach);
|
|
184
|
+
const template = loadResultTemplate(mode, approach, opts.execution);
|
|
182
185
|
const meta = {
|
|
183
186
|
id: execResultDocId(projectId, mode, stem),
|
|
184
187
|
type: "exec-result",
|
|
@@ -770,10 +773,13 @@ export function parseResultTaskIdentity(resultContent) {
|
|
|
770
773
|
const execution = meta.execution === "human" || meta.execution === "agent" ? meta.execution : undefined;
|
|
771
774
|
const approach = meta.approach &&
|
|
772
775
|
[
|
|
776
|
+
"draft",
|
|
773
777
|
"fully-guided",
|
|
774
778
|
"recipe-guided",
|
|
775
779
|
"freeform",
|
|
776
780
|
"bootstrap",
|
|
781
|
+
"catalog-planning",
|
|
782
|
+
"strategy-planning",
|
|
777
783
|
"rulebook-authoring",
|
|
778
784
|
"recipe-authoring",
|
|
779
785
|
"sample-authoring",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseProductBranchOverrides } from "../product-branches.js";
|
|
1
2
|
import { loadExecDefaultsConfig, resolveRegisterPostReview } from "../agent-config.js";
|
|
2
3
|
import { resolveProjectPaths } from "../project.js";
|
|
3
4
|
import { isRegisterFailureMode } from "../register.js";
|
|
@@ -40,6 +41,7 @@ export function registerRunCommand(exec) {
|
|
|
40
41
|
rcmd.option("--track-state", "Record claim/complete events (requires --task; --by optional, actor auto-derived from the resolved agent)", false);
|
|
41
42
|
rcmd.option("--archive-on-success", "Archive the generated plan to exec/plans/done/ after a successful in-place run", false);
|
|
42
43
|
rcmd.option("--integration-branch <repo=branch>", "With register worktree mode: integrate the declared product repository <repo> into the local branch <branch> for this run (repeatable; overrides repos[].integration_branch; resume reuses the value recorded at the start)", (value, previous = []) => [...previous, value]);
|
|
44
|
+
rcmd.option("--branch <repo=name>", "With register worktree mode: override a declared product work branch (repeatable; resume keeps the recorded branch)", (value, previous = []) => [...previous, value]);
|
|
43
45
|
rcmd.option("--parallel <n>", "Number of worktree instances to run in parallel", "1");
|
|
44
46
|
rcmd.option("--worktree-base <path>", "Override worktree base directory");
|
|
45
47
|
rcmd.option("--strategy <s>", "Task selection strategy: critical-first|fifo (default: critical-first)");
|
|
@@ -124,6 +126,20 @@ export function registerRunCommand(exec) {
|
|
|
124
126
|
process.exitCode = 1;
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
129
|
+
const branches = parseProductBranchOverrides(opts.branch);
|
|
130
|
+
if (branches.size > 0) {
|
|
131
|
+
if (!(hasRegister && opts.worktree)) {
|
|
132
|
+
process.stdout.write("--branch requires --register (or --register-filter) in worktree mode.\n");
|
|
133
|
+
process.exitCode = 1;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const products = configuredProductRepos(resolveProjectPaths({ project: opts.project }).schedulePath);
|
|
137
|
+
for (const repo of branches.keys()) {
|
|
138
|
+
if (!products.some((product) => product.name === repo)) {
|
|
139
|
+
throw new Error(`--branch references undeclared product repository: ${repo}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
127
143
|
const integrationBranches = opts.integrationBranch ?? [];
|
|
128
144
|
if (integrationBranches.length > 0) {
|
|
129
145
|
if (!(hasRegister && opts.worktree)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
1
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { basename } from "node:path";
|
|
3
4
|
import { resolveMemberCommand, } from "../agent-config.js";
|
|
@@ -244,6 +245,16 @@ export function registerReporterManagedPaths(registerPaths) {
|
|
|
244
245
|
export async function runSingleRegisterItem(context, opts, pjrId) {
|
|
245
246
|
const { projectId, schedulePath, executionPath, repoRoot } = context;
|
|
246
247
|
const { registerPaths, item } = resolveRegisterRunTarget(projectId, pjrId);
|
|
248
|
+
const dependencyReason = registerDependencyBlockReason(registerPaths, item);
|
|
249
|
+
if (dependencyReason)
|
|
250
|
+
return {
|
|
251
|
+
id: item.id,
|
|
252
|
+
title: item.title,
|
|
253
|
+
outcome: "skipped",
|
|
254
|
+
transition: "none",
|
|
255
|
+
commit: "skipped",
|
|
256
|
+
reason: dependencyReason,
|
|
257
|
+
};
|
|
247
258
|
// 状態遷移の書き込み先(登録項目の正本)。commit 対象に必ず含める。
|
|
248
259
|
const ticketPath = ticketPathFromItem(item, registerPaths.projectRegisterPath);
|
|
249
260
|
requireRunnableRegisterItem(item);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
import { loadExecDefaultsConfig, ProviderConcurrencyGate } from "../agent-config.js";
|
|
3
4
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
@@ -38,12 +39,29 @@ export async function runRegisterMode(opts) {
|
|
|
38
39
|
limit: opts.registerLimit,
|
|
39
40
|
})
|
|
40
41
|
: undefined;
|
|
42
|
+
const registerPaths = resolveRegisterPaths({ project: projectId });
|
|
41
43
|
const selectedIds = selectionFilter
|
|
42
|
-
? selectRegisterItems(loadRegisterItems(
|
|
44
|
+
? selectRegisterItems(loadRegisterItems(registerPaths).map((view) => view.item), { ...selectionFilter, limit: undefined })
|
|
45
|
+
.filter((item) => {
|
|
46
|
+
const reason = registerDependencyBlockReason(registerPaths, item);
|
|
47
|
+
if (reason)
|
|
48
|
+
process.stdout.write(`Skipping ${item.id}: ${reason}\n`);
|
|
49
|
+
return !reason;
|
|
50
|
+
})
|
|
51
|
+
.slice(0, selectionFilter.limit)
|
|
52
|
+
.map((item) => item.id)
|
|
43
53
|
: undefined;
|
|
44
54
|
const { ids, duplicates } = selectedIds
|
|
45
55
|
? { ids: selectedIds, duplicates: [] }
|
|
46
56
|
: parseRegisterIds(opts.register);
|
|
57
|
+
if (!selectionFilter) {
|
|
58
|
+
for (const id of ids) {
|
|
59
|
+
const target = resolveRegisterRunTarget(projectId, id);
|
|
60
|
+
const reason = registerDependencyBlockReason(target.registerPaths, target.item);
|
|
61
|
+
if (reason)
|
|
62
|
+
throw new Error(`Cannot run ${id}: ${reason}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
47
65
|
const executorSelection = parseRegisterExecutorSelection(opts.executorBy, ids);
|
|
48
66
|
if (ids.length === 0) {
|
|
49
67
|
process.stdout.write("No matching register items.\n");
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { loadConfig } from "../../shared/specdojo-config.js";
|
|
2
|
+
import { resolveProductBranches } from "../product-branches.js";
|
|
3
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
1
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
5
|
import { resolve } from "node:path";
|
|
3
6
|
import { qualifyTaskId } from "../shared.js";
|
|
@@ -147,6 +150,16 @@ export async function resumeRegisterIntegration(params) {
|
|
|
147
150
|
export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lifecycleLock) {
|
|
148
151
|
const { projectId, schedulePath, executionPath, repoRoot } = context;
|
|
149
152
|
const { registerPaths, item } = resolveRegisterRunTarget(projectId, pjrId);
|
|
153
|
+
const dependencyReason = registerDependencyBlockReason(registerPaths, item);
|
|
154
|
+
if (dependencyReason)
|
|
155
|
+
return {
|
|
156
|
+
id: item.id,
|
|
157
|
+
title: item.title,
|
|
158
|
+
outcome: "skipped",
|
|
159
|
+
transition: "none",
|
|
160
|
+
commit: "skipped",
|
|
161
|
+
reason: dependencyReason,
|
|
162
|
+
};
|
|
150
163
|
const ticketPath = ticketPathFromItem(item, registerPaths.projectRegisterPath);
|
|
151
164
|
requireRunnableRegisterItem(item);
|
|
152
165
|
// 再開できない場合は register の状態も worktree も変更せず、理由だけを返す。
|
|
@@ -182,7 +195,15 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
182
195
|
let integrationBranchOverrides;
|
|
183
196
|
try {
|
|
184
197
|
const overrides = resumeIntegrationBranches(target.state.integration_branches, opts.integrationBranch);
|
|
185
|
-
products = configuredProductRepos(schedulePath, overrides)
|
|
198
|
+
products = resolveProductBranches(configuredProductRepos(schedulePath, overrides), {
|
|
199
|
+
projectId,
|
|
200
|
+
taskId: worktreeTaskId,
|
|
201
|
+
item,
|
|
202
|
+
ticketPath,
|
|
203
|
+
projectConfig: loadConfig().config?.projects[projectId],
|
|
204
|
+
overrides: opts.branch,
|
|
205
|
+
resume: true,
|
|
206
|
+
});
|
|
186
207
|
integrationBranchOverrides = overrides.size > 0 ? Object.fromEntries(overrides) : undefined;
|
|
187
208
|
}
|
|
188
209
|
catch (error) {
|
|
@@ -227,6 +248,17 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
227
248
|
// 実行中の状態が root からも見えるようにする(merge 前に解放する)。
|
|
228
249
|
const begin = async (actor, transitionReason) => {
|
|
229
250
|
const start = () => {
|
|
251
|
+
const current = resolveRegisterRunTarget(projectId, pjrId);
|
|
252
|
+
const reason = registerDependencyBlockReason(current.registerPaths, current.item);
|
|
253
|
+
if (reason)
|
|
254
|
+
return {
|
|
255
|
+
id: item.id,
|
|
256
|
+
title: item.title,
|
|
257
|
+
outcome: "skipped",
|
|
258
|
+
transition: "none",
|
|
259
|
+
commit: "skipped",
|
|
260
|
+
reason,
|
|
261
|
+
};
|
|
230
262
|
if (!spawnRegisterTransition(projectId, ["start", "--id", item.id, "--by", actor, "--reason", transitionReason], worktree.path)) {
|
|
231
263
|
return refuse(`register start failed: ${item.id}`);
|
|
232
264
|
}
|