specdojo 0.6.0 → 0.8.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 +3 -2
- package/CHANGELOG.md +193 -0
- package/README.md +2 -2
- package/dist/catalog/build.js +24 -1
- package/dist/catalog/plan.js +1 -1
- package/dist/catalog/scaffold.js +4 -1
- package/dist/commands/agent.js +33 -0
- package/dist/commands/init.js +6 -1
- package/dist/commands/night-orchestrator.js +6 -4
- package/dist/commands/orchestrator.js +10 -1
- package/dist/dashboard/dashboard-timeline.js +18 -16
- package/dist/dashboard/dashboard.js +612 -259
- package/dist/dashboard/epic-plan.js +81 -0
- package/dist/dashboard/exec-records.js +16 -20
- package/dist/dashboard/routines.js +8 -6
- package/dist/dashboard/timeline-build.js +5 -9
- package/dist/dashboard/timeline.js +9 -4
- package/dist/devcontainer/command.js +18 -0
- package/dist/devcontainer/host-script.js +21 -0
- package/dist/devcontainer/scaffold.js +22 -3
- package/dist/docs/frontmatter-namespace.js +1 -48
- package/dist/docs/yaml-pages.js +125 -3
- package/dist/exec/agent-config.js +22 -0
- package/dist/exec/agent-plan.js +3 -2
- package/dist/exec/antigravity-session.js +154 -0
- package/dist/exec/commands.js +69 -21
- package/dist/exec/commit-hook-skips.js +78 -0
- package/dist/exec/core.js +19 -7
- package/dist/exec/events.js +159 -8
- package/dist/exec/evidence.js +64 -16
- package/dist/exec/handoff.js +9 -13
- package/dist/exec/limit.js +1 -1
- package/dist/exec/mechanical-result.js +45 -0
- package/dist/exec/migrate-records.js +249 -0
- package/dist/exec/parent-validation.js +160 -12
- package/dist/exec/pipeline-state.js +27 -5
- package/dist/exec/plan-markdownlint.js +89 -0
- package/dist/exec/plans-condense-findings.js +89 -0
- package/dist/exec/plans-core.js +24 -17
- package/dist/exec/plans-generation.js +52 -25
- package/dist/exec/plans-grade-findings.js +8 -3
- package/dist/exec/plans-kata-findings.js +61 -0
- package/dist/exec/plans-planning.js +3 -3
- package/dist/exec/plans-storage.js +12 -24
- package/dist/exec/register-resume.js +69 -42
- package/dist/exec/register.js +26 -22
- package/dist/exec/repo-integration-sync.js +8 -4
- package/dist/exec/repo-integration.js +21 -1
- package/dist/exec/reporter.js +121 -23
- package/dist/exec/results.js +85 -24
- package/dist/exec/review-completion.js +47 -0
- package/dist/exec/review-kata.js +109 -0
- package/dist/exec/run/agent-pipeline.js +75 -6
- package/dist/exec/run/agent.js +20 -7
- package/dist/exec/run/in-place.js +69 -32
- package/dist/exec/run/job.js +81 -24
- package/dist/exec/run/lifecycle-commands.js +264 -43
- package/dist/exec/run/mode-shared.js +11 -3
- package/dist/exec/run/register-command.js +12 -10
- package/dist/exec/run/register-core.js +20 -13
- package/dist/exec/run/register-mode.js +12 -12
- package/dist/exec/run/register-post-review.js +21 -9
- package/dist/exec/run/register-resume.js +28 -18
- package/dist/exec/run/register-state.js +10 -7
- package/dist/exec/run/register-worktree.js +60 -30
- package/dist/exec/run/schedule-mode.js +26 -6
- package/dist/exec/run/schedule-prepare.js +228 -45
- package/dist/exec/run/schedule-task.js +132 -25
- package/dist/exec/run/shared.js +4 -3
- package/dist/exec/run/trailing-records.js +35 -0
- package/dist/exec/run-records.js +2 -0
- package/dist/exec/strategy.js +1 -0
- package/dist/exec/trailing-records.js +242 -0
- package/dist/exec/trial-commands.js +3 -2
- package/dist/exec/validate-records-commit.js +110 -0
- package/dist/exec/validate-records.js +148 -0
- package/dist/exec/worktree-command.js +29 -16
- package/dist/exec/worktree-ops-commit.js +118 -59
- package/dist/exec/worktree-ops-lifecycle.js +77 -44
- package/dist/exec/worktree-ops-merge.js +13 -2
- package/dist/exec/worktree-ops.js +2 -2
- package/dist/exec/worktree.js +19 -2
- package/dist/grade/apply.js +32 -6
- package/dist/grade/command-inspect.js +2 -2
- package/dist/grade/command-run.js +2 -0
- package/dist/grade/command-shared.js +1 -1
- package/dist/grade/core.js +18 -5
- package/dist/grade/markdown.js +3 -3
- package/dist/grade/pipeline-state.js +15 -11
- package/dist/grade/plan.js +37 -17
- package/dist/grade/result.js +3 -3
- package/dist/grade/run.js +23 -3
- package/dist/grade/target-discovery.js +17 -4
- package/dist/grade/targets.js +12 -11
- package/dist/job/job.js +31 -17
- package/dist/job/noop.js +104 -0
- package/dist/register/core.js +2 -0
- package/dist/register/create-commands.js +28 -3
- package/dist/register/deliverable-target.js +9 -1
- package/dist/register/epic.js +104 -26
- package/dist/register/event-merge.js +3 -0
- package/dist/register/events.js +4 -0
- package/dist/register/external-project.js +3 -0
- package/dist/register/item.js +6 -0
- package/dist/register/maintenance-commands.js +4 -1
- package/dist/register/planning.js +7 -14
- package/dist/register/register.js +74 -32
- package/dist/register/track-domains.js +34 -0
- package/dist/register/track-plan.js +78 -0
- package/dist/register/transition-commands.js +8 -0
- package/dist/register/work-table.js +64 -0
- package/dist/review/grade.js +35 -13
- package/dist/routine/definition.js +4 -3
- package/dist/routine/failure.js +30 -0
- package/dist/routine/routine.js +56 -32
- package/dist/routine/storage.js +33 -0
- package/dist/schedule/schedule.js +1 -0
- package/dist/schedule/strategy-generate-document.js +26 -14
- package/dist/schedule/strategy-generate-scope.js +17 -45
- package/dist/schedule/strategy-generate.js +33 -3
- package/dist/schedule/strategy-profiles.js +86 -12
- package/dist/shared/agent-types.js +2 -0
- package/dist/shared/condense-records.js +25 -0
- package/dist/shared/deprecation.js +8 -0
- package/dist/shared/document-metadata.js +20 -0
- package/dist/shared/finding-cause.js +20 -0
- package/dist/shared/frontmatter-namespace.js +48 -0
- package/dist/shared/git.js +149 -15
- package/dist/shared/grade-result.js +17 -1
- package/dist/shared/local-state.js +20 -0
- package/dist/shared/markdownlint-config.js +8 -3
- package/dist/shared/plan-conventions.js +129 -0
- package/dist/shared/plan-templates.js +57 -41
- package/dist/shared/provider-scaffold.js +2 -0
- package/dist/shared/run-records.js +224 -0
- package/dist/shared/specdojo-config.js +39 -21
- package/dist/shared/specdojo-gitignore.js +1 -0
- package/dist/shared/text.js +65 -5
- package/dist/shared/timeline-index.js +2 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +11 -2
- package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +4 -74
- package/docs/ja/specdojo/exec-templates/xep-condense-template.md +50 -0
- package/docs/ja/specdojo/exec-templates/xep-draft-template.md +17 -5
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +16 -3
- package/docs/ja/specdojo/exec-templates/xep-recipe-guided-template.md +15 -5
- package/docs/ja/specdojo/exec-templates/xep-recipe-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +1 -1
- package/docs/ja/specdojo/exec-templates/xep-rulebook-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-sample-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xep-template-maintenance-template.md +6 -0
- package/docs/ja/specdojo/exec-templates/xer-condense-template.md +25 -0
- package/docs/ja/specdojo/exec-templates/xp-common-conventions-template.md +50 -0
- package/docs/ja/specdojo/exec-templates/xrp-common-conventions-template.md +30 -0
- package/docs/ja/specdojo/guides/branch-workflow-guide.md +1 -1
- package/docs/ja/specdojo/guides/docs-editing-guide.md +48 -0
- package/docs/ja/specdojo/guides/docs-structure-guide.md +48 -15
- package/docs/ja/specdojo/guides/exec-config-guide.md +61 -28
- package/docs/ja/specdojo/guides/exec-operation-guide.md +61 -13
- package/docs/ja/specdojo/guides/exec-worktree-guide.md +20 -11
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +4 -2
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +92 -55
- package/docs/ja/specdojo/guides/project-move-guide.md +381 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +589 -807
- package/docs/ja/specdojo/guides/register-operation-guide.md +26 -4
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +33 -4
- package/docs/ja/specdojo/guides/review-guide.md +22 -19
- package/docs/ja/specdojo/guides/routine-operation-guide.md +14 -8
- package/docs/ja/specdojo/guides/ryu-guide.md +23 -13
- package/docs/ja/specdojo/guides/schedule-design-guide.md +7 -4
- package/docs/ja/specdojo/guides/schedule-operation-guide.md +41 -3
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +5 -4
- package/docs/ja/specdojo/guides/timeline-design-guide.md +27 -144
- package/docs/ja/specdojo/guides/use-case-guide.md +471 -74
- package/docs/ja/specdojo/recipes/bac-recipe.md +94 -0
- package/docs/ja/specdojo/recipes/bes-recipe.md +105 -0
- package/docs/ja/specdojo/recipes/br-recipe.md +84 -0
- package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +88 -86
- package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +108 -122
- package/docs/ja/specdojo/recipes/cnd-recipe.md +125 -0
- package/docs/ja/specdojo/recipes/cpd-recipe.md +126 -0
- package/docs/ja/specdojo/recipes/cxd-recipe.md +145 -0
- package/docs/ja/specdojo/recipes/ifd-recipe.md +134 -0
- package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +135 -86
- package/docs/ja/specdojo/recipes/ifx-index-recipe.md +130 -0
- package/docs/ja/specdojo/recipes/pm-organization-recipe.md +29 -26
- package/docs/ja/specdojo/recipes/pm-plan-recipe.md +35 -26
- package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +38 -28
- package/docs/ja/specdojo/recipes/pm-raci-recipe.md +39 -31
- package/docs/ja/specdojo/recipes/pm-roles-recipe.md +26 -28
- package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +10 -8
- package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +18 -17
- package/docs/ja/specdojo/recipes/stsd-recipe.md +100 -62
- package/docs/ja/specdojo/recipes/sysd-critical-flows-recipe.md +106 -0
- package/docs/ja/specdojo/recipes/sysd-cross-cutting-policy-recipe.md +137 -0
- package/docs/ja/specdojo/recipes/sysd-index-recipe.md +122 -0
- package/docs/ja/specdojo/references/command-reference.md +146 -99
- package/docs/ja/specdojo/references/deliverables-reference.md +9 -4
- package/docs/ja/specdojo/references/directory-layout-reference.md +3 -2
- package/docs/ja/specdojo/references/specdojo-config-reference.md +17 -16
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +72 -290
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +212 -79
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +138 -154
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +147 -59
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +100 -96
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +88 -108
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +126 -211
- package/docs/ja/specdojo/rulebooks/cdfd-d2-rulebook.md +367 -0
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +6 -5
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +96 -100
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +38 -47
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +132 -106
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +102 -68
- package/docs/ja/specdojo/rulebooks/cdt-rulebook.md +152 -0
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +9 -184
- package/docs/ja/specdojo/rulebooks/clis-rulebook.md +187 -0
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +93 -247
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +104 -241
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +124 -257
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +87 -98
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +9 -7
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/dss-rulebook.md +193 -0
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +100 -54
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +69 -252
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +91 -76
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +252 -226
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +118 -40
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +11 -11
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +9 -9
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +4 -4
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +11 -11
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +11 -11
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +4 -3
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +34 -29
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +8 -8
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +2 -2
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +50 -56
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +46 -55
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +57 -54
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +50 -65
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +2 -2
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +70 -97
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +2 -1
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +47 -56
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +61 -135
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +116 -32
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +118 -61
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +152 -57
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +51 -39
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +101 -46
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +72 -329
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +74 -263
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +78 -195
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +4 -9
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +3 -4
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +3 -3
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +140 -143
- package/docs/ja/specdojo/samples/bac-sample.md +106 -21
- package/docs/ja/specdojo/samples/bdd-sample.yaml +143 -35
- package/docs/ja/specdojo/samples/bds-sample.md +100 -21
- package/docs/ja/specdojo/samples/bes-index-sample.md +59 -20
- package/docs/ja/specdojo/samples/bes-sample.md +80 -21
- package/docs/ja/specdojo/samples/br-sample.md +68 -14
- package/docs/ja/specdojo/samples/ccd-sample.md +81 -19
- package/docs/ja/specdojo/samples/cdfd-overview-sample.md +248 -140
- package/docs/ja/specdojo/samples/cdfd-sample.md +172 -99
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +130 -97
- package/docs/ja/specdojo/samples/cdsd-sample.md +89 -20
- package/docs/ja/specdojo/samples/cdt-sample.md +116 -0
- package/docs/ja/specdojo/samples/cld-sample.md +3 -30
- package/docs/ja/specdojo/samples/clis-sample.md +132 -0
- package/docs/ja/specdojo/samples/cnd-sample.md +127 -21
- package/docs/ja/specdojo/samples/cpd-sample.md +136 -22
- package/docs/ja/specdojo/samples/cxd-sample.md +108 -22
- package/docs/ja/specdojo/samples/dct-index-sample.yaml +63 -17
- package/docs/ja/specdojo/samples/dss-sample.md +175 -0
- package/docs/ja/specdojo/samples/gl-sample.yaml +50 -14
- package/docs/ja/specdojo/samples/ifd-sample.md +105 -21
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +91 -60
- package/docs/ja/specdojo/samples/ifx-file-sample.md +462 -21
- package/docs/ja/specdojo/samples/ifx-index-sample.yaml +87 -19
- package/docs/ja/specdojo/samples/pm-members-sample.yaml +37 -13
- package/docs/ja/specdojo/samples/pm-organization-sample.md +52 -20
- package/docs/ja/specdojo/samples/pm-plan-sample.md +84 -26
- package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +55 -22
- package/docs/ja/specdojo/samples/pm-raci-sample.md +69 -28
- package/docs/ja/specdojo/samples/pm-roles-sample.yaml +13 -12
- package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +50 -26
- package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +89 -62
- package/docs/ja/specdojo/samples/sf-index-sample.md +89 -20
- package/docs/ja/specdojo/samples/sf-sample.md +121 -21
- package/docs/ja/specdojo/samples/sld-sample.md +107 -21
- package/docs/ja/specdojo/samples/stsd-sample.md +54 -26
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +166 -21
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +178 -21
- package/docs/ja/specdojo/samples/sysd-index-sample.md +82 -21
- package/docs/ja/specdojo/samples/tml-sample.yaml +4 -1
- package/docs/ja/specdojo/samples/uis-sample.md +164 -20
- package/docs/ja/specdojo/standards/document-metadata-standard.md +33 -4
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +3 -1
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +1 -0
- package/docs/ja/specdojo/templates/bac-template.md +76 -0
- package/docs/ja/specdojo/templates/bes-template.md +56 -0
- package/docs/ja/specdojo/templates/br-template.md +64 -0
- package/docs/ja/specdojo/templates/cdfd-overview-template.md +161 -83
- package/docs/ja/specdojo/templates/cdfd-template.md +81 -54
- package/docs/ja/specdojo/templates/cdfd-uc-template.md +130 -89
- package/docs/ja/specdojo/templates/cnd-template.md +137 -0
- package/docs/ja/specdojo/templates/cpd-template.md +129 -0
- package/docs/ja/specdojo/templates/cxd-template.md +105 -0
- package/docs/ja/specdojo/templates/dct-data-model-cdt-template.yaml +40 -0
- package/docs/ja/specdojo/templates/dct-data-model-cld-template.yaml +7 -14
- package/docs/ja/specdojo/templates/dct-index-template.md +9 -20
- package/docs/ja/specdojo/templates/dct-project-management-template.yaml +5 -1
- package/docs/ja/specdojo/templates/ifd-template.md +86 -0
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +44 -28
- package/docs/ja/specdojo/templates/ifx-index-template.yaml +40 -0
- package/docs/ja/specdojo/templates/opr-template.md +2 -4
- package/docs/ja/specdojo/templates/pm-organization-template.md +9 -3
- package/docs/ja/specdojo/templates/pm-plan-template.md +4 -4
- package/docs/ja/specdojo/templates/pm-quality-management-plan-template.md +17 -9
- package/docs/ja/specdojo/templates/pm-raci-template.md +24 -13
- package/docs/ja/specdojo/templates/pm-roles-template.yaml +3 -2
- package/docs/ja/specdojo/templates/prj-assumptions-constraints-dependencies-template.md +6 -3
- package/docs/ja/specdojo/templates/prj-comparison-of-alternatives-template.md +22 -19
- package/docs/ja/specdojo/templates/stsd-template.md +46 -21
- package/docs/ja/specdojo/templates/sysd-critical-flows-template.md +94 -0
- package/docs/ja/specdojo/templates/sysd-cross-cutting-policy-template.md +122 -0
- package/docs/ja/specdojo/templates/sysd-index-template.md +89 -0
- package/docs/specdojo/lib/yaml-metadata.cjs +7 -0
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +25 -57
- package/docs/specdojo/schemas/v1/condense-records.schema.yaml +26 -0
- package/docs/specdojo/schemas/v1/dct.schema.yaml +10 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +3 -0
- package/docs/specdojo/schemas/v1/esil.schema.yaml +7 -141
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +3 -0
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +54 -3
- package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +3 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +14 -0
- package/docs/specdojo/schemas/v1/exec-result-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/finding-cause.schema.yaml +22 -0
- package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/grade-result.schema.yaml +2 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +65 -5
- package/docs/specdojo/schemas/v1/ifx-index.schema.yaml +142 -0
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +2 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +17 -1
- package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +1 -0
- package/package.json +6 -3
- package/templates/antigravity/README.md +19 -46
- package/templates/antigravity/exec-defaults-snippet.yaml +5 -6
- package/templates/antigravity/orchestrator.md +3 -2
- package/templates/antigravity/settings.edit.json +73 -0
- package/templates/antigravity/settings.orchestrator.json +15 -0
- package/templates/antigravity/settings.report.json +7 -0
- package/templates/antigravity/settings.review.json +7 -0
- package/templates/claude/agents/specdojo-orchestrator.md +3 -2
- package/templates/codex/agents/specdojo-orchestrator.toml +3 -2
- package/templates/codex/orchestrator.md +3 -2
- package/templates/devcontainer/remote-host/devcontainer-tmux.sh +217 -0
- package/templates/devcontainer/remote-host/specdojo-tmux.sh.sample +8 -96
- package/templates/devcontainer/remote-host/ssh-config.sample +3 -1
- package/templates/devcontainer/tmux.conf +6 -0
- package/templates/init-agent-members.yaml +1 -0
- package/templates/init-exec-defaults.yaml +1 -1
- package/templates/opencode/agents/specdojo-orchestrator.md +3 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
2
|
-
import {
|
|
2
|
+
import { loadRegisterItems, resolveRegisterPaths } from "../../register/register.js";
|
|
3
|
+
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
3
4
|
import { loadExecDefaultsConfig, ProviderConcurrencyGate } from "../agent-config.js";
|
|
5
|
+
import { buildInPlaceStem } from "../plans.js";
|
|
4
6
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
7
|
+
import { findResumableRegisterRun } from "../register-resume.js";
|
|
8
|
+
import { formatRegisterRunSummary, parseRegisterIds, parseRegisterSelectionFilter, registerRunExitCode, requireRunnableRegisterItem, resolveRegisterRunTarget, selectRegisterItems, } from "../register.js";
|
|
9
|
+
import { taskRecordPaths } from "../run-records.js";
|
|
5
10
|
import { qualifyTaskId } from "../shared.js";
|
|
6
|
-
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
7
|
-
import { execLifecyclePoolPath, execLocksDir } from "./lock.js";
|
|
8
11
|
import { CrossProcessMutex } from "../slot-lock.js";
|
|
9
|
-
import { buildInPlaceStem } from "../plans.js";
|
|
10
|
-
import { formatRegisterRunSummary, parseRegisterIds, parseRegisterSelectionFilter, registerRunExitCode, requireRunnableRegisterItem, resolveRegisterRunTarget, selectRegisterItems, } from "../register.js";
|
|
11
|
-
import { loadRegisterItems, resolveRegisterPaths } from "../../register/register.js";
|
|
12
12
|
import { findExecWorktree, resolveWorktreeBase } from "../worktree.js";
|
|
13
|
-
import { findResumableRegisterRun } from "../register-resume.js";
|
|
14
|
-
import { configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, runCompletionDrivenWorkerPool, } from "./shared.js";
|
|
15
13
|
import { loadRosterForExecutionPath } from "./agent.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { resumeSingleRegisterItemWorktree } from "./register-resume.js";
|
|
14
|
+
import { execLifecyclePoolPath, execLocksDir } from "./lock.js";
|
|
15
|
+
import { applyRegisterDifficultyRouting, isRegisterPipelineRequested, parseRegisterExecutorSelection, resolveRegisterCommand, resolveRegisterPipelineCommand, runSingleRegisterItem, selectedRegisterExecutor, } from "./register-core.js";
|
|
19
16
|
import { resolveRegisterPostReviewAgents } from "./register-post-review.js";
|
|
17
|
+
import { resumeSingleRegisterItemWorktree } from "./register-resume.js";
|
|
18
|
+
import { runSingleRegisterItemWorktree } from "./register-worktree.js";
|
|
19
|
+
import { configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, runCompletionDrivenWorkerPool, } from "./shared.js";
|
|
20
20
|
// register 項目の実行(複数ID)。in-place モードは指定順に1件ずつ直列実行し、各IDが plan/result
|
|
21
21
|
// 生成・start・agent実行・review/waiting 遷移まで完結してから次へ進む。worktree モードは成果物を
|
|
22
22
|
// worktree に隔離し、状態遷移を root で直列化する(--parallel で並列化可能)。失敗時は
|
|
@@ -156,7 +156,7 @@ export async function runRegisterMode(opts) {
|
|
|
156
156
|
process.stdout.write(`[dry-run] actor: ${actor}\n`);
|
|
157
157
|
process.stdout.write(`[dry-run] command: ${command}\n`);
|
|
158
158
|
}
|
|
159
|
-
process.stdout.write(`[dry-run] plan: ${
|
|
159
|
+
process.stdout.write(`[dry-run] plan: ${taskRecordPaths(executionPath, item.id, stem).plan}\n`);
|
|
160
160
|
if (postReviewAgents) {
|
|
161
161
|
process.stdout.write(`[dry-run] post-review executor: ${postReviewAgents.executor.actor}\n`);
|
|
162
162
|
process.stdout.write(`[dry-run] post-review reporter: ${postReviewAgents.reporterCandidates[0]?.actor}\n`);
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
1
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
3
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
3
|
-
import { resolveMemberCommand } from "../agent-config.js";
|
|
4
4
|
import { buildSpecdojoFrontmatter } from "../../docs/frontmatter-namespace.js";
|
|
5
|
+
import { registerWorkTableIssueMessage, registerWorkTableIssues, } from "../../register/work-table.js";
|
|
5
6
|
import { formatMarkdownFile } from "../../shared/markdown-format.js";
|
|
6
7
|
import { expandTemplate } from "../../shared/text.js";
|
|
7
|
-
import {
|
|
8
|
-
import { scaffoldResult, stripLeadingListMarker, updateResultStatus } from "../results.js";
|
|
8
|
+
import { resolveMemberCommand } from "../agent-config.js";
|
|
9
9
|
import { readPipelineState } from "../pipeline-state.js";
|
|
10
|
+
import { execTemplatePath } from "../plans.js";
|
|
10
11
|
import { sanitizeRegisterConclusion } from "../register.js";
|
|
11
|
-
import {
|
|
12
|
+
import { scaffoldResult, stripLeadingListMarker, updateResultStatus } from "../results.js";
|
|
13
|
+
import { runLogPath, taskRecordPaths } from "../run-records.js";
|
|
12
14
|
import { worktreeStatusPaths } from "../worktree-ops.js";
|
|
15
|
+
import { gitOutput } from "../worktree.js";
|
|
13
16
|
import { runAgentPipeline } from "./agent-pipeline.js";
|
|
14
17
|
import { expandPromptRefs } from "./agent.js";
|
|
15
18
|
import { registerReporterManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
@@ -20,7 +23,7 @@ const ACCEPTED_POST_REVIEW_VERDICTS = new Set(["complete", "complete-with-findin
|
|
|
20
23
|
const POST_REVIEW_VERDICTS = new Set(["complete", "complete-with-findings", "incomplete"]);
|
|
21
24
|
const AUTO_CLOSE_REGISTER_TYPES = new Set(["todo", "issue"]);
|
|
22
25
|
export function registerPostReviewDisposition(params) {
|
|
23
|
-
const { itemType, verdict, runnerImplementationChanged = false } = params;
|
|
26
|
+
const { itemType, verdict, runnerImplementationChanged = false, workTableIssue } = params;
|
|
24
27
|
if (verdict === "incomplete" || !verdict) {
|
|
25
28
|
return {
|
|
26
29
|
transition: "waiting",
|
|
@@ -35,6 +38,10 @@ export function registerPostReviewDisposition(params) {
|
|
|
35
38
|
explanation: `review verdict is not accepted: ${verdict}`,
|
|
36
39
|
};
|
|
37
40
|
}
|
|
41
|
+
// 作業内容の表が実績に合っていなければ、review が通っても完了にしない。
|
|
42
|
+
if (workTableIssue) {
|
|
43
|
+
return { transition: "waiting", outcome: "failure", explanation: workTableIssue };
|
|
44
|
+
}
|
|
38
45
|
if (!AUTO_CLOSE_REGISTER_TYPES.has(itemType)) {
|
|
39
46
|
return {
|
|
40
47
|
transition: "review",
|
|
@@ -139,8 +146,7 @@ export async function generateRegisterPostReviewPlan(params) {
|
|
|
139
146
|
const { context, item, stem } = params;
|
|
140
147
|
const taskId = `${item.id}-post-review`;
|
|
141
148
|
const reviewStem = `${stem}-post-review`;
|
|
142
|
-
const planPath =
|
|
143
|
-
const resultPath = join(context.executionPath, "exec", "results", `${reviewStem}-result.md`);
|
|
149
|
+
const { plan: planPath, result: resultPath } = taskRecordPaths(context.executionPath, item.id, reviewStem);
|
|
144
150
|
const templatePath = execTemplatePath("xrp-register-post-run-template.md");
|
|
145
151
|
const frontmatter = buildSpecdojoFrontmatter([
|
|
146
152
|
`id: ${context.projectId}:xrp-${reviewStem}`,
|
|
@@ -300,7 +306,7 @@ export async function runRegisterPostReview(params) {
|
|
|
300
306
|
executor: agents.executor,
|
|
301
307
|
reporterCandidates: agents.reporterCandidates,
|
|
302
308
|
planPath: generated.planPath,
|
|
303
|
-
planPrompt: expandPromptRefs(
|
|
309
|
+
planPrompt: expandPromptRefs(readPlanFile(generated.planPath)),
|
|
304
310
|
resultPath: generated.resultPath,
|
|
305
311
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
306
312
|
execDefaults: reviewExecDefaults,
|
|
@@ -349,10 +355,16 @@ export async function runRegisterPostReview(params) {
|
|
|
349
355
|
await updateResultStatus(generated.resultPath, "complete", new Date().toISOString());
|
|
350
356
|
}
|
|
351
357
|
const runnerImplementationChanged = changesModifyRunningSpecDojo(context.repoRoot, changedPathsBetween(context.repoRoot, params.baseCommit, params.outputCommit));
|
|
358
|
+
const workTableIssues = existsSync(params.ticketPath)
|
|
359
|
+
? registerWorkTableIssues(readFileSync(params.ticketPath, "utf8"))
|
|
360
|
+
: [];
|
|
352
361
|
const disposition = registerPostReviewDisposition({
|
|
353
362
|
itemType: item.type,
|
|
354
363
|
verdict,
|
|
355
364
|
runnerImplementationChanged,
|
|
365
|
+
...(workTableIssues.length > 0
|
|
366
|
+
? { workTableIssue: registerWorkTableIssueMessage(item.id, workTableIssues) }
|
|
367
|
+
: {}),
|
|
356
368
|
});
|
|
357
369
|
const rationale = sanitizeRegisterConclusion(`post-run review verdict ${verdict}: ${reviewRationale(generated.resultPath)}; ${disposition.explanation}`);
|
|
358
370
|
if (disposition.transition === "done") {
|
|
@@ -392,7 +404,7 @@ export async function runRegisterPostReview(params) {
|
|
|
392
404
|
normalized.startsWith(evidencePrefix));
|
|
393
405
|
})
|
|
394
406
|
.map((path) => resolve(context.repoRoot, path));
|
|
395
|
-
const commitFailureLogPath =
|
|
407
|
+
const commitFailureLogPath = runLogPath(reviewStatePath, "post-review-commit.log");
|
|
396
408
|
try {
|
|
397
409
|
commitRegisterState(context.repoRoot, registerPaths, `exec(register ${item.id}): post-review ${verdict}`, params.ticketPath, managed, commitFailureLogPath);
|
|
398
410
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
2
|
+
import { executorStageResumeHint } from "../evidence.js";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
1
6
|
import { loadConfig } from "../../shared/specdojo-config.js";
|
|
7
|
+
import { failedParentValidationReason } from "../parent-validation.js";
|
|
8
|
+
import { integratedRepoNames } from "../pipeline-state.js";
|
|
2
9
|
import { resolveProductBranches } from "../product-branches.js";
|
|
3
|
-
import {
|
|
4
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
import { qualifyTaskId } from "../shared.js";
|
|
10
|
+
import { findResumableRegisterRun, resolveRegisterResumeArtifacts, } from "../register-resume.js";
|
|
7
11
|
import { requireRunnableRegisterItem, resolveRegisterRunTarget, sanitizeRegisterConclusion, ticketPathFromItem, } from "../register.js";
|
|
12
|
+
import { syncTaskWorktreesWithIntegrationTargets, } from "../repo-integration.js";
|
|
8
13
|
import { readResultFrontmatterSnapshot } from "../results.js";
|
|
9
|
-
import {
|
|
14
|
+
import { qualifyTaskId } from "../shared.js";
|
|
10
15
|
import { configuredProductRepos, missingProductWorktrees, resumeIntegrationBranches, withProductWorktrees, } from "../task-repos.js";
|
|
11
16
|
import { currentBranch, isExecBranchMergedIntoCurrent } from "../worktree-ops.js";
|
|
12
|
-
import {
|
|
13
|
-
import { failedParentValidationReason } from "../parent-validation.js";
|
|
14
|
-
import { findResumableRegisterRun, resolveRegisterResumeArtifacts, } from "../register-resume.js";
|
|
15
|
-
import { integratedRepoNames } from "../pipeline-state.js";
|
|
16
|
-
import { resolveAgentOverride, resolvePinnedRateLimitRunOptions, rateLimitRecoveryReason, } from "./shared.js";
|
|
17
|
-
import { expandPromptRefs } from "./agent.js";
|
|
17
|
+
import { findExecWorktree } from "../worktree.js";
|
|
18
18
|
import { refreshParentValidationsForReporterResume, runAgentPipeline, runReporterStage, } from "./agent-pipeline.js";
|
|
19
|
+
import { expandPromptRefs } from "./agent.js";
|
|
19
20
|
import { repoRelativePath } from "./mode-shared.js";
|
|
20
|
-
import {
|
|
21
|
-
import { copyRepoPaths,
|
|
21
|
+
import { registerReporterManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
22
|
+
import { copyRepoPaths, rebuildRootRegisterViews, registerBookkeepingPaths, registerTransitionPaths, } from "./register-state.js";
|
|
22
23
|
import { finalizeRegisterWorktreeRun } from "./register-worktree.js";
|
|
24
|
+
import { rateLimitRecoveryReason, resolveAgentOverride, resolvePinnedRateLimitRunOptions, } from "./shared.js";
|
|
23
25
|
// reporter 再開に使う agent を解決する。--reporter-by を優先し、省略時は再開対象 run の
|
|
24
26
|
// pipeline-state に記録された reporter actor(通常は前回と同じ agent)へフォールバックする。
|
|
25
27
|
export function resolveRegisterResumeReporter(roster, opts, execDefaults, recordedActor) {
|
|
@@ -329,12 +331,16 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
329
331
|
syncedIntegrationTargets,
|
|
330
332
|
});
|
|
331
333
|
}
|
|
332
|
-
// plan
|
|
333
|
-
//
|
|
334
|
+
// plan は原則として root(統合ブランチ)の checkpoint 済みファイルを正本にする。
|
|
335
|
+
// ただし --resume-from executor の再開では、利用者が worktree 内で直した plan を
|
|
336
|
+
// 優先して読み込む。runAgentPipeline へ渡す planPath は plan_ref の計算基準になるため
|
|
337
|
+
// root 側のパスを維持する。
|
|
334
338
|
const planPath = resolve(repoRoot, artifacts.planRef);
|
|
335
|
-
|
|
339
|
+
const worktreePlanPath = resolve(worktree.path, artifacts.planRef);
|
|
340
|
+
const promptPlanPath = target.stage === "executor" && existsSync(worktreePlanPath) ? worktreePlanPath : planPath;
|
|
341
|
+
if (!existsSync(promptPlanPath))
|
|
336
342
|
return refuse(`plan not found for the resumed run: ${artifacts.planRef}`);
|
|
337
|
-
const prompt = expandPromptRefs(
|
|
343
|
+
const prompt = expandPromptRefs(readPlanFile(promptPlanPath));
|
|
338
344
|
if (target.stage === "executor") {
|
|
339
345
|
const executor = resolveRegisterResumeExecutor(context.roster, opts, context.execDefaults, target.state.stages.executor.actor);
|
|
340
346
|
if (executor.kind === "error")
|
|
@@ -343,7 +349,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
343
349
|
if (reporter.kind === "error")
|
|
344
350
|
return refuse(reporter.message);
|
|
345
351
|
process.stdout.write(`Register item: ${item.id} — ${item.title} [${item.type}]\n`);
|
|
346
|
-
process.stdout.write(` Resuming executor from run ${target.runId} in
|
|
352
|
+
process.stdout.write(` Resuming executor from run ${target.runId} in the existing run directory\n` +
|
|
347
353
|
` CWD: ${worktree.path}\n Agent: ${executor.candidate.actor} (executor)\n`);
|
|
348
354
|
const beginFailure = await begin(executor.candidate.actor, "executor resumed");
|
|
349
355
|
if (beginFailure)
|
|
@@ -361,8 +367,10 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
361
367
|
planPrompt: prompt,
|
|
362
368
|
resultPath: worktreeResultPath,
|
|
363
369
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
370
|
+
executorResumeHint: executorStageResumeHint({ kind: "register", itemId: item.id }),
|
|
364
371
|
execDefaults: context.execDefaults,
|
|
365
372
|
resumedExecutor: true,
|
|
373
|
+
runId: target.runId,
|
|
366
374
|
initialChangeTargets: target.initialChanges,
|
|
367
375
|
resumeHandoff: target.handoff,
|
|
368
376
|
providerConcurrencyGate: context.providerConcurrencyGate,
|
|
@@ -388,6 +396,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
388
396
|
bookkeepingPaths: bookkeepingPaths(),
|
|
389
397
|
pipelineStatePath: resolve(worktree.path, outcome.stateRef),
|
|
390
398
|
transitionReason: rateLimitRecoveryReason(outcome.rateLimitEvents) || undefined,
|
|
399
|
+
resumedExecutor: true,
|
|
391
400
|
});
|
|
392
401
|
return lifecycleLock ? lifecycleLock.runExclusive(finalize) : finalize();
|
|
393
402
|
}
|
|
@@ -418,6 +427,7 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
|
|
|
418
427
|
planPrompt: prompt,
|
|
419
428
|
resultPath: worktreeResultPath,
|
|
420
429
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
430
|
+
executorResumeHint: executorStageResumeHint({ kind: "register", itemId: item.id }),
|
|
421
431
|
execDefaults: context.execDefaults,
|
|
422
432
|
evidence,
|
|
423
433
|
evidencePath: resolve(worktree.path, target.evidenceRef),
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
2
1
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
2
|
import { basename, dirname, resolve } from "node:path";
|
|
4
|
-
import { sanitizeRegisterConclusion, } from "../register.js";
|
|
5
3
|
import { applyRegisterItemFields, CELL_NONE, readRegisterItemContent, registerItemFieldsFromItem, } from "../../register/item.js";
|
|
6
|
-
import {
|
|
4
|
+
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
5
|
+
import { sanitizeRegisterConclusion, } from "../register.js";
|
|
6
|
+
import { isRunRecordPath } from "../run-records.js";
|
|
7
7
|
import { abortMerge, currentBranch, normalizeResultWhitespace, releaseRootWorkingCopies, stabilizeCommitTargets, stageCommitTargets, unstageCommitTargets, worktreeStatusPaths, } from "../worktree-ops.js";
|
|
8
|
+
import { appendGitFailureLog, appendGitResultFailureLog, formatGitResultFailure, gitOutput, gitResult, summarizeGitHookFailure, } from "../worktree.js";
|
|
8
9
|
import { pathInsideWorktree } from "./agent.js";
|
|
9
10
|
import { repoRelativePath } from "./mode-shared.js";
|
|
10
|
-
import {
|
|
11
|
+
import { registerEventPathForTicket, registerRunnerManagedPaths, spawnRegisterTransition, } from "./register-core.js";
|
|
11
12
|
// register の状態遷移(start/review/wait)が変更した調整状態(pjr-index と派生ビュー)だけを
|
|
12
13
|
// 抽出する。worktree モードでは成功時の遷移を exec branch、失敗時の wait を root で commit
|
|
13
14
|
// する。plan/result は checkpoint と worktree merge が扱うため、ここでは含めない。
|
|
@@ -102,7 +103,8 @@ export function copyRepoPaths(sourceRoot, targetRoot, repoRoot, paths) {
|
|
|
102
103
|
// event は agent が編集した未検証の本文を含みうるため、root に残してある checkpoint 版を
|
|
103
104
|
// wait 遷移の入力にする。派生ビューは遷移後に root で再生成する。
|
|
104
105
|
export function registerFailureArtifactPaths(repoRoot, paths) {
|
|
105
|
-
return paths.filter((path) => /(?:^|\/)exec\/(?:plans|results)\//.test(repoRelativePath(repoRoot, path))
|
|
106
|
+
return paths.filter((path) => /(?:^|\/)exec\/(?:plans|results)\//.test(repoRelativePath(repoRoot, path)) ||
|
|
107
|
+
isRunRecordPath(path));
|
|
106
108
|
}
|
|
107
109
|
// wait commit の個票は検証済みの root 本文を使う一方、exec branch には agent が編集した本文を
|
|
108
110
|
// 残す。root の frontmatter から lifecycle フィールドだけを重ね、resume 後も waiting 状態と
|
|
@@ -176,7 +178,7 @@ export function rebuildRootRegisterViews(projectId, itemId) {
|
|
|
176
178
|
// worktree が無い(checkpoint 前の失敗)場合は root の実行管理ファイルをそのまま commit する。
|
|
177
179
|
export function registerWaitSummary(params) {
|
|
178
180
|
const { repoRoot, projectId, registerPaths, item, ticketPath, actor, worktree } = params;
|
|
179
|
-
const blockReason = sanitizeRegisterConclusion(params.reason);
|
|
181
|
+
const blockReason = sanitizeRegisterConclusion(params.reason, params.reasonMaxLength);
|
|
180
182
|
const bookkeepingPaths = [...params.bookkeepingPaths];
|
|
181
183
|
const preservedTicketPath = worktree && ticketPath ? pathInsideWorktree(repoRoot, worktree.path, ticketPath) : undefined;
|
|
182
184
|
const preservedTicket = ticketPath && preservedTicketPath && existsSync(preservedTicketPath)
|
|
@@ -259,7 +261,8 @@ export function commitRegisterWaitState(params) {
|
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
export function isRegisterResultPath(repoRoot, path) {
|
|
262
|
-
return /\/exec\/results\/[^/]+-result\.md$/.test(repoRelativePath(repoRoot, path))
|
|
264
|
+
return (/\/exec\/results\/[^/]+-result\.md$/.test(repoRelativePath(repoRoot, path)) ||
|
|
265
|
+
(isRunRecordPath(path) && path.endsWith("/result.md")));
|
|
263
266
|
}
|
|
264
267
|
// wait commit と、その時点までに統合先へ入った変更を exec branch へ通常 merge する。
|
|
265
268
|
// worktree の記帳パスには、root へ複製した blocked result などが未 commit のまま残っている。
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
2
|
+
import { executorStageResumeHint } from "../evidence.js";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { isAuthoringApproach } from "../../kata/authoring.js";
|
|
6
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
6
7
|
import { loadConfig, resolveAgentMember, } from "../../shared/specdojo-config.js";
|
|
8
|
+
import { integrationCommitSkipHooks } from "../commit-hook-skips.js";
|
|
9
|
+
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
10
|
+
import { pipelineStateLocation, readPipelineState } from "../pipeline-state.js";
|
|
11
|
+
import { buildInPlaceStem } from "../plans.js";
|
|
7
12
|
import { resolveProductBranches } from "../product-branches.js";
|
|
8
13
|
import { registerProductMessage } from "../register-product-message.js";
|
|
9
|
-
import {
|
|
14
|
+
import { findResumableRegisterRun } from "../register-resume.js";
|
|
10
15
|
import { generateRegisterPlan, requireRunnableRegisterItem, resolveRegisterRunTarget, sanitizeRegisterConclusion, ticketPathFromItem, } from "../register.js";
|
|
16
|
+
import { commitProductWorktrees, integrateTaskRepositories, PROJECT_REPO_NAME, projectMergeBlockers, RepoIntegrationError, } from "../repo-integration.js";
|
|
17
|
+
import { productIntegrationTrace, recordResultTrace, registerProjectMergeMessage, traceKey, } from "../repo-trace.js";
|
|
11
18
|
import { readResultFrontmatterSnapshot, scaffoldResult, updateResultStatus } from "../results.js";
|
|
12
|
-
import {
|
|
19
|
+
import { recordPathForRead, recordRef, taskRecordPaths } from "../run-records.js";
|
|
20
|
+
import { qualifyTaskId } from "../shared.js";
|
|
13
21
|
import { configuredProductRepos, integrationBranchOverrideRecord, reserveProductBranches, withProductRepoPrompt, } from "../task-repos.js";
|
|
14
|
-
import { checkpointAndEnsureWorktree, commitTargetPaths, commitWorktreeChanges, discardStaleExecWorktree, isExecBranchMergedIntoCurrent, mergeWorktreeIntoCurrent, removeWorktree, taskTargetsAtHead, WorktreeRemovedBranchDeletionError, worktreeStatusPaths, } from "../worktree-ops.js";
|
|
15
|
-
import {
|
|
16
|
-
import { productIntegrationTrace, recordResultTrace, registerProjectMergeMessage, traceKey, } from "../repo-trace.js";
|
|
17
|
-
import { pipelineStateLocation, readPipelineState } from "../pipeline-state.js";
|
|
18
|
-
import { findResumableRegisterRun } from "../register-resume.js";
|
|
19
|
-
import { isAuthoringApproach } from "../../kata/authoring.js";
|
|
20
|
-
import { resolvePinnedRateLimitRunOptions, rateLimitRecoveryReason, } from "./shared.js";
|
|
21
|
-
import { agentEnvironment, expandPromptRefs, extractBlockReason, pathInsideWorktree, reportProductWorktrees, runWithRetry, } from "./agent.js";
|
|
22
|
+
import { checkpointAndEnsureWorktree, assertCommitScope, commitTargetPaths, commitWorktreeChanges, discardStaleExecWorktree, isExecBranchMergedIntoCurrent, mergeWorktreeIntoCurrent, removeWorktree, taskTargetsAtHead, WorktreeRemovedBranchDeletionError, UncommittedChangesError, worktreeStatusPaths, } from "../worktree-ops.js";
|
|
23
|
+
import { findExecWorktree, gitOutput, } from "../worktree.js";
|
|
22
24
|
import { runAgentPipeline } from "./agent-pipeline.js";
|
|
23
|
-
import {
|
|
25
|
+
import { agentEnvironment, expandPromptRefs, extractBlockReason, pathInsideWorktree, reportProductWorktrees, runWithRetry, } from "./agent.js";
|
|
24
26
|
import { commitSubject, integrateLogPath, recordIntegrateStage, recordRepoIntegration, repoRelativePath, } from "./mode-shared.js";
|
|
25
|
-
import {
|
|
26
|
-
import { commitRegisterState, registerPathsInsideWorktree, rebuildRootRegisterViews, registerWaitSummary, } from "./register-state.js";
|
|
27
|
+
import { isRegisterPipelineRequested, registerReporterManagedPaths, registerRunnerManagedPaths, resolveRegisterCommand, resolveRegisterPipelineCommand, spawnRegisterTransition, } from "./register-core.js";
|
|
27
28
|
import { runRegisterPostReview } from "./register-post-review.js";
|
|
29
|
+
import { commitRegisterState, rebuildRootRegisterViews, registerPathsInsideWorktree, registerWaitSummary, } from "./register-state.js";
|
|
30
|
+
import { downgradeUnfilledResult } from "./schedule-prepare.js";
|
|
31
|
+
import { rateLimitRecoveryReason, resolvePinnedRateLimitRunOptions, } from "./shared.js";
|
|
28
32
|
// 全体再実行が既存 run の未統合成果を破棄しないための保護。既存 worktree に再開可能な run
|
|
29
33
|
// (executor 成功済みで reporter か統合が未完了)が残っている場合だけ理由を返し、呼び出し側が
|
|
30
34
|
// 破壊的操作(discardStaleExecWorktree)の手前で中断できるようにする。--force-restart で無効化できる。
|
|
@@ -85,13 +89,14 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
85
89
|
const worktreeTicketPath = ticketPath
|
|
86
90
|
? pathInsideWorktree(repoRoot, worktree.path, ticketPath)
|
|
87
91
|
: null;
|
|
88
|
-
const waitSummary = (reason) => registerWaitSummary({
|
|
92
|
+
const waitSummary = (reason, reasonMaxLength) => registerWaitSummary({
|
|
89
93
|
repoRoot,
|
|
90
94
|
projectId,
|
|
91
95
|
registerPaths,
|
|
92
96
|
item,
|
|
93
97
|
ticketPath,
|
|
94
98
|
reason,
|
|
99
|
+
reasonMaxLength,
|
|
95
100
|
actor,
|
|
96
101
|
worktree,
|
|
97
102
|
bookkeepingPaths: params.bookkeepingPaths,
|
|
@@ -109,7 +114,7 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
109
114
|
item,
|
|
110
115
|
ticketPath,
|
|
111
116
|
stem,
|
|
112
|
-
editPlanPath:
|
|
117
|
+
editPlanPath: recordPathForRead(context.executionPath, "plan", stem),
|
|
113
118
|
editResultPath: resolve(repoRoot, repoRelativePath(worktree.path, params.worktreeResultPath)),
|
|
114
119
|
baseCommit,
|
|
115
120
|
outputCommit,
|
|
@@ -128,6 +133,8 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
128
133
|
};
|
|
129
134
|
const completedAt = new Date().toISOString();
|
|
130
135
|
const worktreeResultPath = params.worktreeResultPath;
|
|
136
|
+
const scopeLogPath = integrateLogPath(params.pipelineStatePath) ??
|
|
137
|
+
taskRecordPaths(resolve(worktree.path, repoRelativePath(repoRoot, executionPath)), item.id, stem).log("integrate.log");
|
|
131
138
|
const { result: effectiveResult, unfilledBlock } = downgradeUnfilledResult(agentResult, worktreeResultPath, "edit", params.resultScaffold);
|
|
132
139
|
if (effectiveResult === "success") {
|
|
133
140
|
// A prior integration attempt may have completed the merge and failed only while removing the
|
|
@@ -138,6 +145,7 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
138
145
|
isExecBranchMergedIntoCurrent({ context: wtContext, worktree })) {
|
|
139
146
|
const { baseCommit, outputCommit } = integratedRegisterCommitRange(repoRoot, worktree.branch);
|
|
140
147
|
try {
|
|
148
|
+
assertCommitScope(wtContext, worktree, stem, { scopeLogPath });
|
|
141
149
|
const lifecyclePaths = new Set([worktreeResultPath, params.pipelineStatePath]
|
|
142
150
|
.filter((path) => !!path)
|
|
143
151
|
.map((path) => repoRelativePath(worktree.path, path)));
|
|
@@ -164,7 +172,7 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
164
172
|
process.stderr.write(`Warning: ${error.message}; run exec worktree prune.\n`);
|
|
165
173
|
}
|
|
166
174
|
else {
|
|
167
|
-
const reason = sanitizeRegisterConclusion(`integrate cleanup failed: ${error instanceof Error ? error.message : String(error)}
|
|
175
|
+
const reason = sanitizeRegisterConclusion(`integrate cleanup failed: ${error instanceof Error ? error.message : String(error)}`, error instanceof UncommittedChangesError ? 4000 : undefined);
|
|
168
176
|
const integrateFailedAt = new Date().toISOString();
|
|
169
177
|
recordIntegrateStage(params.pipelineStatePath, integrateFailedAt, () => ({
|
|
170
178
|
status: "failed",
|
|
@@ -178,6 +186,9 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
178
186
|
transition: "review",
|
|
179
187
|
commit: "incomplete",
|
|
180
188
|
reason,
|
|
189
|
+
...(error instanceof UncommittedChangesError
|
|
190
|
+
? { uncommittedFiles: error.files.length }
|
|
191
|
+
: {}),
|
|
181
192
|
};
|
|
182
193
|
}
|
|
183
194
|
}
|
|
@@ -224,11 +235,15 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
224
235
|
try {
|
|
225
236
|
const productNames = (worktree.repos ?? []).map((product) => product.name);
|
|
226
237
|
try {
|
|
238
|
+
assertCommitScope(wtContext, worktree, stem, {
|
|
239
|
+
scopeLogPath,
|
|
240
|
+
allowEditedPlan: params.resumedExecutor === true,
|
|
241
|
+
});
|
|
227
242
|
const productOutcomes = commitProductWorktrees({
|
|
228
243
|
worktree,
|
|
229
244
|
message: (product) => productMessage(product, "commit"),
|
|
230
245
|
targets: taskTargetsAtHead(wtContext, worktree, stem),
|
|
231
|
-
scopeLogPath
|
|
246
|
+
scopeLogPath,
|
|
232
247
|
failureLogPath: integrateLogPath(params.pipelineStatePath),
|
|
233
248
|
resultPath: worktreeResultPath,
|
|
234
249
|
});
|
|
@@ -238,10 +253,16 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
238
253
|
worktree,
|
|
239
254
|
taskId: stem,
|
|
240
255
|
message: subject,
|
|
241
|
-
scopeLogPath
|
|
256
|
+
scopeLogPath,
|
|
242
257
|
failureLogPath: integrateLogPath(params.pipelineStatePath),
|
|
243
258
|
productsIntegratedByCaller: true,
|
|
244
259
|
productRootNewFiles,
|
|
260
|
+
allowEditedPlan: params.resumedExecutor === true,
|
|
261
|
+
skipHooks: integrationCommitSkipHooks({
|
|
262
|
+
pipeline: context.execDefaults.pipeline,
|
|
263
|
+
worktreePath: worktree.path,
|
|
264
|
+
pipelineStatePath: params.pipelineStatePath,
|
|
265
|
+
}),
|
|
245
266
|
});
|
|
246
267
|
}
|
|
247
268
|
catch (error) {
|
|
@@ -251,6 +272,8 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
251
272
|
status: "failed",
|
|
252
273
|
error: message,
|
|
253
274
|
});
|
|
275
|
+
if (error instanceof UncommittedChangesError)
|
|
276
|
+
throw error;
|
|
254
277
|
throw new RepoIntegrationError({
|
|
255
278
|
repo,
|
|
256
279
|
cause: message,
|
|
@@ -343,7 +366,7 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
343
366
|
process.stderr.write(`Warning: ${error.message}; run exec worktree prune.\n`);
|
|
344
367
|
}
|
|
345
368
|
else {
|
|
346
|
-
const reason = sanitizeRegisterConclusion(`integrate failed: ${error instanceof Error ? error.message : String(error)}
|
|
369
|
+
const reason = sanitizeRegisterConclusion(`integrate failed: ${error instanceof Error ? error.message : String(error)}`, error instanceof UncommittedChangesError ? 4000 : undefined);
|
|
347
370
|
const integrateFailedAt = new Date().toISOString();
|
|
348
371
|
recordIntegrateStage(params.pipelineStatePath, integrateFailedAt, () => ({
|
|
349
372
|
status: "failed",
|
|
@@ -363,12 +386,20 @@ export async function finalizeRegisterWorktreeRun(params) {
|
|
|
363
386
|
transition: "review",
|
|
364
387
|
commit: "incomplete",
|
|
365
388
|
reason,
|
|
389
|
+
...(error instanceof UncommittedChangesError
|
|
390
|
+
? { uncommittedFiles: error.files.length }
|
|
391
|
+
: {}),
|
|
366
392
|
};
|
|
367
393
|
}
|
|
368
394
|
await updateResultStatus(worktreeResultPath, "blocked", completedAt, reason);
|
|
369
395
|
process.stdout.write(` Blocked: ${item.id} (worktree kept: ${worktree.path})\n`);
|
|
370
|
-
const
|
|
371
|
-
|
|
396
|
+
const scopeError = error instanceof UncommittedChangesError;
|
|
397
|
+
const summary = waitSummary(reason, scopeError ? 4000 : undefined);
|
|
398
|
+
return {
|
|
399
|
+
...summary,
|
|
400
|
+
commit: "incomplete",
|
|
401
|
+
...(scopeError ? { uncommittedFiles: error.files.length } : {}),
|
|
402
|
+
};
|
|
372
403
|
}
|
|
373
404
|
}
|
|
374
405
|
// review は merge で root の個票に入る。非追跡の派生ビューだけ root で作り直す。
|
|
@@ -440,9 +471,7 @@ export async function runSingleRegisterItemWorktree(context, opts, pjrId, lifecy
|
|
|
440
471
|
const resolvedProvider = provider ?? resolveAgentMember(context.roster, actor)?.provider;
|
|
441
472
|
const stem = buildInPlaceStem(pjrId.toLowerCase());
|
|
442
473
|
const worktreeTaskId = qualifyTaskId(projectId, item.id);
|
|
443
|
-
const pipelineRunId = pipelineAgents
|
|
444
|
-
? `${new Date().toISOString().replace(/[-:.]/g, "")}-${randomHex(4)}`
|
|
445
|
-
: undefined;
|
|
474
|
+
const pipelineRunId = pipelineAgents ? stem : undefined;
|
|
446
475
|
// PJR-98G4: repos を宣言した project では、プロダクトの worktree も同じタスクの下に作る。
|
|
447
476
|
// PJR-XRAB: --integration-branch は設定の integration_branch より優先する。
|
|
448
477
|
const products = resolveProductBranches(configuredProductRepos(schedulePath, opts.integrationBranch), {
|
|
@@ -498,14 +527,14 @@ export async function runSingleRegisterItemWorktree(context, opts, pjrId, lifecy
|
|
|
498
527
|
item,
|
|
499
528
|
stem,
|
|
500
529
|
});
|
|
501
|
-
const prompt = expandPromptRefs(
|
|
530
|
+
const prompt = expandPromptRefs(readPlanFile(planPath));
|
|
502
531
|
const { resultPath, supersededPaths } = await scaffoldResult({
|
|
503
532
|
executionPath,
|
|
504
533
|
taskId: item.id,
|
|
505
534
|
mode: "edit",
|
|
506
535
|
projectId,
|
|
507
536
|
origin: "register",
|
|
508
|
-
planRef:
|
|
537
|
+
planRef: recordRef(executionPath, planPath),
|
|
509
538
|
agent: actor,
|
|
510
539
|
startedAt: new Date().toISOString(),
|
|
511
540
|
stem,
|
|
@@ -605,6 +634,7 @@ export async function runSingleRegisterItemWorktree(context, opts, pjrId, lifecy
|
|
|
605
634
|
planPrompt: prompt,
|
|
606
635
|
resultPath: worktreeResultPathForPipeline,
|
|
607
636
|
registerPaths: registerReporterManagedPaths(registerPaths),
|
|
637
|
+
executorResumeHint: executorStageResumeHint({ kind: "register", itemId: item.id }),
|
|
608
638
|
execDefaults: context.execDefaults,
|
|
609
639
|
providerConcurrencyGate: context.providerConcurrencyGate,
|
|
610
640
|
productWorktrees: worktree.repos,
|
|
@@ -2,9 +2,10 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { basename, join } from "node:path";
|
|
3
3
|
import { createProviderCapacityTracker, loadExecDefaultsConfig } from "../agent-config.js";
|
|
4
4
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
5
|
-
import { readAllEventFiles, foldEventsToState } from "../events.js";
|
|
5
|
+
import { claimOwnerOf, readAllEventFiles, foldEventsToState } from "../events.js";
|
|
6
6
|
import { buildScheduleIndex, findStaleGeneratedTracks } from "../schedule/schedule.js";
|
|
7
7
|
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
8
|
+
import { scheduleTrackNames } from "../schedule/gantt-chart-scope.js";
|
|
8
9
|
import { readReadySnapshot } from "../schedule/ready.js";
|
|
9
10
|
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
10
11
|
import { extractLocalId, extractPhaseSuffix } from "../../schedule/phase-sets.js";
|
|
@@ -52,6 +53,14 @@ export async function runBatchMode(opts) {
|
|
|
52
53
|
const repoRoot = specdojoRootDir();
|
|
53
54
|
const worktreeBase = resolveWorktreeBase(repoRoot, opts.worktreeBase, configuredWorktreeBase(schedulePath));
|
|
54
55
|
const parallel = parseParallel(opts.parallel);
|
|
56
|
+
// Validate against the schedule, including tracks with no Ready tasks, before any claim.
|
|
57
|
+
const track = opts.track;
|
|
58
|
+
if (track !== undefined) {
|
|
59
|
+
const tracks = scheduleTrackNames(buildScheduleIndex(schedulePath));
|
|
60
|
+
if (!tracks.includes(track)) {
|
|
61
|
+
throw new Error(`Unknown schedule track: ${track}. Available tracks: ${tracks.join(", ")}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
55
64
|
const execDefaults = loadExecDefaultsConfig(resolveExecDefaultsPath(opts, schedulePath), executionPath);
|
|
56
65
|
const roster = loadRosterForExecutionPath(executionPath);
|
|
57
66
|
const { localIdToPhaseSets, phaseSetSuffixToId } = buildTaskPhaseMap(schedulePath);
|
|
@@ -67,12 +76,23 @@ export async function runBatchMode(opts) {
|
|
|
67
76
|
return { preparedTasks: [], readyCount: 0 };
|
|
68
77
|
}
|
|
69
78
|
const readySnapshot = readReadySnapshot(readyJsonPath);
|
|
70
|
-
const
|
|
79
|
+
const strategyIds = strategy === "fifo"
|
|
71
80
|
? readySnapshot.strategies.fifo.ordered_task_ids
|
|
72
81
|
: readySnapshot.strategies["critical-first"].ordered_task_ids;
|
|
82
|
+
const taskMap = new Map(readySnapshot.tasks.map((t) => [t.id, t]));
|
|
83
|
+
// Filter every snapshot before preparation, so setup failures and loop refills cannot
|
|
84
|
+
// escape the requested track. Use schedule_file rather than parsing hyphenated task IDs.
|
|
85
|
+
const orderedIds = track === undefined
|
|
86
|
+
? strategyIds
|
|
87
|
+
: strategyIds.filter((id) => {
|
|
88
|
+
const task = taskMap.get(id);
|
|
89
|
+
if (!task)
|
|
90
|
+
return false;
|
|
91
|
+
const file = basename(task.schedule_file);
|
|
92
|
+
return file === `sch-track-${track}.yaml` || file === `sch-track-${track}.yml`;
|
|
93
|
+
});
|
|
73
94
|
if (orderedIds.length === 0)
|
|
74
95
|
return { preparedTasks: [], readyCount: 0 };
|
|
75
|
-
const taskMap = new Map(readySnapshot.tasks.map((t) => [t.id, t]));
|
|
76
96
|
const preparedTasks = [];
|
|
77
97
|
for (const taskId of orderedIds) {
|
|
78
98
|
if (preparedTasks.length >= limit)
|
|
@@ -194,10 +214,10 @@ export async function runBatchMode(opts) {
|
|
|
194
214
|
export function resolveClaimingActor(taskState, byOverride) {
|
|
195
215
|
if (byOverride)
|
|
196
216
|
return { actor: byOverride, resumed: false };
|
|
197
|
-
|
|
217
|
+
// The claim owner, not last_by: a human's plain unblock or note must not hand the run to them.
|
|
218
|
+
const actor = taskState?.state === "doing" ? claimOwnerOf(taskState) : undefined;
|
|
219
|
+
if (!actor)
|
|
198
220
|
return { actor: undefined, resumed: false };
|
|
199
|
-
}
|
|
200
|
-
const actor = taskState.last_by;
|
|
201
221
|
process.stdout.write(` Resuming with claiming actor: ${actor}\n`);
|
|
202
222
|
return { actor, resumed: true };
|
|
203
223
|
}
|