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,27 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withPlanConventionsFiles } from "../../shared/plan-conventions.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
4
4
|
import { loadExecDefaultsConfig, providerSlotPoolPath, resolveMaxConcurrency, resolveMaxConcurrentRuns, } from "../agent-config.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { acquireSchedulerLock, buildEvent, claimOwnerOf, foldEventsToState, readAllEventFiles, releaseSchedulerLock, writeEventFile, } from "../events.js";
|
|
6
|
+
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
7
7
|
import { selectDueDeferredLimitTasks } from "../limit.js";
|
|
8
|
-
import {
|
|
8
|
+
import { parentValidationPoolPath, resolveParentValidationConcurrency, } from "../parent-validation.js";
|
|
9
|
+
import { integratedRepoNames, loadPipelineResumeCheckpoint, } from "../pipeline-state.js";
|
|
10
|
+
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
11
|
+
import { loadRegisterResumeCandidates, selectScheduleExecutorResume, } from "../register-resume.js";
|
|
12
|
+
import { readResultFrontmatterSnapshot, updateResultStatus } from "../results.js";
|
|
13
|
+
import { recordPathForRead } from "../run-records.js";
|
|
9
14
|
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
15
|
+
import { buildScheduleIndex } from "../schedule/schedule.js";
|
|
10
16
|
import { qualifyTaskId } from "../shared.js";
|
|
11
|
-
import {
|
|
12
|
-
import { collectExecLockUsage, execLocksDir, formatExecLockUsage } from "./lock.js";
|
|
17
|
+
import { configuredProductRepos, withProductWorktrees } from "../task-repos.js";
|
|
13
18
|
import { buildTaskView } from "../task-view.js";
|
|
14
|
-
import {
|
|
19
|
+
import { PROJECT_REPO_NAME, mergeInProgress } from "../repo-integration-git.js";
|
|
20
|
+
import { syncTaskWorktreesWithIntegrationTargets, } from "../repo-integration-sync.js";
|
|
15
21
|
import { findExecWorktree, resolveWorktreeBase } from "../worktree.js";
|
|
16
|
-
import {
|
|
17
|
-
import { parentValidationPoolPath, resolveParentValidationConcurrency, } from "../parent-validation.js";
|
|
18
|
-
import { loadPipelineResumeCheckpoint } from "../pipeline-state.js";
|
|
19
|
-
import { buildTaskPhaseMap, configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, withProjectExecRunLock, } from "./shared.js";
|
|
22
|
+
import { currentBranch, isExecBranchMergedIntoCurrent } from "../worktree-ops.js";
|
|
20
23
|
import { loadRosterForExecutionPath, pathInsideWorktree } from "./agent.js";
|
|
24
|
+
import { collectExecLockUsage, execLocksDir, formatExecLockUsage } from "./lock.js";
|
|
25
|
+
import { spawnBlock, spawnIndexBuild, spawnRefresh, spawnValidate, stageActorMeta, } from "./mode-shared.js";
|
|
26
|
+
import { rebuildStaleGeneratedTracksForCycle, resolveClaimingActor, runBatchMode, } from "./schedule-mode.js";
|
|
21
27
|
import { findClaimEventPath, prepareSingleTask, } from "./schedule-prepare.js";
|
|
22
28
|
import { runPreparedTask } from "./schedule-task.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
29
|
+
import { withTrailingRunRecords } from "./trailing-records.js";
|
|
30
|
+
import { branchOwnedRunRecordPaths } from "../trailing-records.js";
|
|
31
|
+
import { repoRelative } from "../../shared/git.js";
|
|
32
|
+
import { buildTaskPhaseMap, configuredWorktreeBase, parseParallel, resolveExecDefaultsPath, withProjectExecRunLock, } from "./shared.js";
|
|
25
33
|
// 同じ project の exec run が共有する枠(主 run・--join run・register lifecycle・provider の
|
|
26
34
|
// max_concurrency・親検証)の上限と現在の使用数を表示する。ロックは取得しない。
|
|
27
35
|
export function formatExecSlotsReport(executionPath, execDefaults) {
|
|
@@ -152,7 +160,7 @@ export async function runCycleMode(opts) {
|
|
|
152
160
|
// Step 4/5: validate + refresh schedule state before selecting Ready tasks.
|
|
153
161
|
process.stdout.write("[cycle] step 4/5: validate + refresh schedule state\n");
|
|
154
162
|
if (dryRun) {
|
|
155
|
-
process.stdout.write(" [dry-run] specdojo exec validate\n");
|
|
163
|
+
process.stdout.write(" [dry-run] specdojo exec validate --schedule-only\n");
|
|
156
164
|
process.stdout.write(" [dry-run] specdojo exec refresh\n");
|
|
157
165
|
stepOutcomes.push("refresh=success");
|
|
158
166
|
}
|
|
@@ -230,7 +238,7 @@ export function registerCycleCommand(exec) {
|
|
|
230
238
|
cmd.option("--dry-run", "Print resolved steps without executing", false);
|
|
231
239
|
cmd.action(async (opts) => {
|
|
232
240
|
try {
|
|
233
|
-
await withProjectExecRunLock(opts, "cycle", () => runCycleMode(opts));
|
|
241
|
+
await withProjectExecRunLock(opts, "cycle", () => withTrailingRunRecords(opts, "cycle", () => runCycleMode(opts)));
|
|
234
242
|
}
|
|
235
243
|
catch (error) {
|
|
236
244
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -266,23 +274,27 @@ export function prepareScheduleIntegrationResume(params) {
|
|
|
266
274
|
checkpoint.state.stages.reporter.status !== "succeeded") {
|
|
267
275
|
throw new Error(`integration resume requires succeeded executor and reporter stages for ${task.id}`);
|
|
268
276
|
}
|
|
269
|
-
const resultPath =
|
|
277
|
+
const resultPath = recordPathForRead(executionPath, "result", task.id);
|
|
270
278
|
const worktreeResultPath = pathInsideWorktree(repoRoot, worktree.path, resultPath);
|
|
271
279
|
if (!existsSync(resultPath) || !existsSync(worktreeResultPath)) {
|
|
272
280
|
throw new Error(`result is missing for integration resume: ${task.id}-result.md`);
|
|
273
281
|
}
|
|
274
282
|
// 統合再開でも、root に未 commit のまま残る claim / plan / result の作業コピーを merge 前に
|
|
275
283
|
// 解放できるよう、通常実行と同じ checkpoint パスを持たせる。
|
|
276
|
-
const claimEventPath = findClaimEventPath(schedulePath, task.id
|
|
277
|
-
|
|
278
|
-
|
|
284
|
+
const claimEventPath = findClaimEventPath(schedulePath, task.id, {
|
|
285
|
+
repoRoot,
|
|
286
|
+
worktreePath: worktree.path,
|
|
287
|
+
});
|
|
288
|
+
const checkpointPaths = withPlanConventionsFiles([
|
|
289
|
+
recordPathForRead(executionPath, "plan", task.id),
|
|
279
290
|
resultPath,
|
|
280
291
|
...(claimEventPath ? [claimEventPath] : []),
|
|
281
292
|
...gradeCheckpointPaths({ repoRoot, executionPath }),
|
|
282
|
-
];
|
|
293
|
+
]);
|
|
283
294
|
return {
|
|
284
295
|
task,
|
|
285
296
|
actor,
|
|
297
|
+
claimActor: claimOwnerOf(taskState) ?? actor,
|
|
286
298
|
agentCandidates: [],
|
|
287
299
|
plan: "",
|
|
288
300
|
prompt: "",
|
|
@@ -295,12 +307,90 @@ export function prepareScheduleIntegrationResume(params) {
|
|
|
295
307
|
pipelineStateRef: stateRef,
|
|
296
308
|
};
|
|
297
309
|
}
|
|
310
|
+
// 統合の段(reporter の後の commit・検査・merge)まで進んでから止まった run か。
|
|
311
|
+
function stoppedInIntegration(state) {
|
|
312
|
+
return (state.stages.reporter.status === "succeeded" || (state.stages.integrate?.attempts ?? 0) > 0);
|
|
313
|
+
}
|
|
314
|
+
// task 自身の run の記録(repo 相対)。block の後の記帳 commit(PJR-DVNV)が統合先へ入れた
|
|
315
|
+
// 作業コピーは、exec branch 側の同じ記録と両側の追加として競合する。再開の取り込みでは exec branch
|
|
316
|
+
// 側を採る。統合の merge と同じ向きで、再開した executor はこの記録を引き継いで書き直し、後の統合も
|
|
317
|
+
// 統合先の側に変更が無いため競合しない。
|
|
318
|
+
function taskRunRecordPaths(params) {
|
|
319
|
+
const paths = params.branches.flatMap((branch) => branchOwnedRunRecordPaths({ ...params, branch }).map((path) => repoRelative(params.repoRoot, path)));
|
|
320
|
+
return [...new Set(paths)].sort();
|
|
321
|
+
}
|
|
322
|
+
// 統合の段で止まった task を executor へ戻す前の準備(PJR-ED0K)。worktree が merge の途中なら、
|
|
323
|
+
// 解消に `git merge --abort` が要り stage 済みの成果を失うため、状態を変えずに止める。止まって
|
|
324
|
+
// いなければ、統合先(project は root の現在ブランチ)の直しを exec branch へ取り込む。
|
|
325
|
+
// 未 commit の成果と run の記録は取り込みの前に控えて戻し、戻せない場合は取り込み前へ戻して止める。
|
|
326
|
+
export function prepareExecutorResumeFromIntegration(params) {
|
|
327
|
+
const { taskId, worktree, repoRoot } = params;
|
|
328
|
+
const context = {
|
|
329
|
+
repoRoot,
|
|
330
|
+
schedulePath: params.schedulePath,
|
|
331
|
+
executionPath: params.executionPath,
|
|
332
|
+
};
|
|
333
|
+
if (isExecBranchMergedIntoCurrent({ context, worktree })) {
|
|
334
|
+
throw new Error(`cannot resume the executor for ${taskId}: ${worktree.branch} is already merged; ` +
|
|
335
|
+
`run exec resume --task ${taskId} to finish the integration cleanup`);
|
|
336
|
+
}
|
|
337
|
+
const merging = [
|
|
338
|
+
...(worktree.repos ?? [])
|
|
339
|
+
.filter((product) => existsSync(product.path) && mergeInProgress(product.path))
|
|
340
|
+
.map((product) => product.name),
|
|
341
|
+
...(mergeInProgress(worktree.path) ? [PROJECT_REPO_NAME] : []),
|
|
342
|
+
];
|
|
343
|
+
if (merging.length > 0) {
|
|
344
|
+
throw new Error(`cannot resume the executor for ${taskId}: a merge is in progress in ${merging.join(", ")} ` +
|
|
345
|
+
`(${worktree.path}); aborting it would discard staged changes. Commit or resolve the ` +
|
|
346
|
+
`merge in the worktree, then run exec resume --task ${taskId} --resume-from executor again`);
|
|
347
|
+
}
|
|
348
|
+
if (params.dryRun)
|
|
349
|
+
return [];
|
|
350
|
+
process.stdout.write(` Syncing integration targets before executor resume: ${taskId}\n`);
|
|
351
|
+
let synced;
|
|
352
|
+
try {
|
|
353
|
+
const projectTarget = currentBranch(repoRoot);
|
|
354
|
+
synced = syncTaskWorktreesWithIntegrationTargets({
|
|
355
|
+
worktree,
|
|
356
|
+
projectTarget,
|
|
357
|
+
message: `exec(${taskId}): merge integration target before executor resume`,
|
|
358
|
+
projectOursPaths: taskRunRecordPaths({
|
|
359
|
+
repoRoot,
|
|
360
|
+
executionPath: params.executionPath,
|
|
361
|
+
branches: [worktree.branch, projectTarget],
|
|
362
|
+
taskId,
|
|
363
|
+
}),
|
|
364
|
+
integratedProducts: integratedRepoNames(params.state),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
throw new Error(`cannot sync the worktree with the integration target before executor resume of ` +
|
|
369
|
+
`${taskId}: ${error instanceof Error ? error.message : String(error)}; ` +
|
|
370
|
+
`resolve it in ${worktree.path} and run exec resume --task ${taskId} --resume-from executor again`, { cause: error });
|
|
371
|
+
}
|
|
372
|
+
for (const entry of synced) {
|
|
373
|
+
process.stdout.write(` [sync] ${entry.repo}: ${entry.status} (${entry.target})` +
|
|
374
|
+
`${entry.detail ? ` — ${entry.detail}` : ""}\n`);
|
|
375
|
+
}
|
|
376
|
+
return synced;
|
|
377
|
+
}
|
|
378
|
+
function validateScheduleResumeOptions(opts) {
|
|
379
|
+
if (opts.resumeFrom !== undefined) {
|
|
380
|
+
if (opts.resumeFrom !== "executor")
|
|
381
|
+
throw new Error('--resume-from must be "executor".');
|
|
382
|
+
if (!opts.task || opts.due) {
|
|
383
|
+
throw new Error("--resume-from requires --task and cannot be combined with --due.");
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
298
387
|
// Resume tasks left in "doing" state by an interrupted run. Unlike --auto (which selects from
|
|
299
388
|
// ready.json and provably excludes "doing"/"blocked" tasks), resume folds the event log to find
|
|
300
389
|
// in-flight tasks and re-runs each on its existing worktree, reusing the claiming actor and the
|
|
301
390
|
// partially-filled result (scaffoldResult is idempotent; the worktree is reused). No validate/build
|
|
302
391
|
// pass — selection comes from events, not the generated cache.
|
|
303
392
|
export async function runResumeMode(opts) {
|
|
393
|
+
validateScheduleResumeOptions(opts);
|
|
304
394
|
const resolvedPaths = resolveProjectPaths({ project: opts.project });
|
|
305
395
|
activateResolvedProjectPaths(resolvedPaths);
|
|
306
396
|
const { schedulePath, executionPath, catalogPath, rolesPath, viewpointsPath, projectContext } = resolvedPaths;
|
|
@@ -319,7 +409,58 @@ export async function runResumeMode(opts) {
|
|
|
319
409
|
const events = readAllEventFiles(schedulePath);
|
|
320
410
|
const initTasks = buildInitialStateFromStrategy(schedulePath, schedule);
|
|
321
411
|
let snapshot = foldEventsToState(events, schedule, schedulePath, initTasks);
|
|
412
|
+
const initialTaskStates = new Map(Object.entries(snapshot.tasks).map(([id, state]) => [
|
|
413
|
+
id,
|
|
414
|
+
{ ...state, ...(state.meta ? { meta: { ...state.meta } } : {}) },
|
|
415
|
+
]));
|
|
322
416
|
let doingIds;
|
|
417
|
+
let executorResume;
|
|
418
|
+
let executorWorktree;
|
|
419
|
+
let pendingExecutorUnblock;
|
|
420
|
+
// Validate before changing lifecycle state or generating a plan. Interrupted doing tasks may
|
|
421
|
+
// have no block metadata, so discover their latest run in the existing worktree as register does.
|
|
422
|
+
if (opts.resumeFrom === "executor" && opts.task) {
|
|
423
|
+
const task = buildTaskView(schedulePath, executionPath, opts.task);
|
|
424
|
+
if (!task.agent_pipeline)
|
|
425
|
+
throw new Error("--resume-from requires an agent_pipeline task.");
|
|
426
|
+
const taskState = snapshot.tasks[opts.task];
|
|
427
|
+
const blockedStage = taskState?.state === "blocked" ? taskState.meta?.pipeline_stage : undefined;
|
|
428
|
+
// A blocked executor stage is accepted here; selectScheduleExecutorResume admits it only when
|
|
429
|
+
// the runner rejected the executor report before the reporter (PJR-1GCD).
|
|
430
|
+
if (taskState?.state !== "doing" &&
|
|
431
|
+
blockedStage !== "reporter" &&
|
|
432
|
+
blockedStage !== "integrate" &&
|
|
433
|
+
blockedStage !== "executor") {
|
|
434
|
+
throw new Error("--resume-from executor requires a doing task or a blocked reporter, integrate, or executor stage.");
|
|
435
|
+
}
|
|
436
|
+
const worktreeTaskId = qualifyTaskId(projectId, opts.task);
|
|
437
|
+
const found = findExecWorktree(repoRoot, worktreeTaskId);
|
|
438
|
+
if (!found)
|
|
439
|
+
throw new Error(`no exec worktree to resume executor for ${opts.task}`);
|
|
440
|
+
const lookup = selectScheduleExecutorResume(loadRegisterResumeCandidates({
|
|
441
|
+
repoRoot,
|
|
442
|
+
worktreePath: found.path,
|
|
443
|
+
executionPath,
|
|
444
|
+
taskId: opts.task,
|
|
445
|
+
}));
|
|
446
|
+
if (lookup.kind !== "resumable")
|
|
447
|
+
throw new Error(lookup.reason);
|
|
448
|
+
if (lookup.target.stage !== "executor")
|
|
449
|
+
throw new Error("no executor stage to resume");
|
|
450
|
+
executorResume = lookup.target;
|
|
451
|
+
executorWorktree = withProductWorktrees(found, configuredProductRepos(schedulePath), worktreeTaskId);
|
|
452
|
+
if (stoppedInIntegration(executorResume.state)) {
|
|
453
|
+
prepareExecutorResumeFromIntegration({
|
|
454
|
+
taskId: opts.task,
|
|
455
|
+
worktree: executorWorktree,
|
|
456
|
+
state: executorResume.state,
|
|
457
|
+
repoRoot,
|
|
458
|
+
schedulePath,
|
|
459
|
+
executionPath,
|
|
460
|
+
dryRun,
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
}
|
|
323
464
|
if (opts.due) {
|
|
324
465
|
let lockDir = "";
|
|
325
466
|
try {
|
|
@@ -380,20 +521,32 @@ export async function runResumeMode(opts) {
|
|
|
380
521
|
blockedPipelineStage === "integrate") &&
|
|
381
522
|
typeof taskState.meta?.pipeline_state_ref === "string";
|
|
382
523
|
if (canResumeBlockedPipeline) {
|
|
383
|
-
const actor = taskState
|
|
524
|
+
const actor = claimOwnerOf(taskState) ?? opts.by ?? "exec-pipeline-resume";
|
|
384
525
|
if (!dryRun) {
|
|
385
|
-
const
|
|
526
|
+
const resumeMeta = {
|
|
527
|
+
...taskState.meta,
|
|
528
|
+
...(executorResume
|
|
529
|
+
? { pipeline_stage: "executor", pipeline_state_ref: executorResume.stateRef }
|
|
530
|
+
: {}),
|
|
531
|
+
};
|
|
532
|
+
const meta = Object.entries(resumeMeta).map(([key, value]) => `${key}=${String(value)}`);
|
|
386
533
|
meta.push("pipeline_resume_claimed=true");
|
|
387
|
-
|
|
534
|
+
const event = buildEvent("unblock", {
|
|
388
535
|
task: opts.task,
|
|
389
536
|
by: actor,
|
|
390
|
-
msg:
|
|
391
|
-
? "resume
|
|
392
|
-
: blockedPipelineStage === "
|
|
393
|
-
? "resume
|
|
394
|
-
:
|
|
537
|
+
msg: opts.resumeFrom === "executor"
|
|
538
|
+
? "resume executor from persisted pipeline state (--resume-from executor)"
|
|
539
|
+
: blockedPipelineStage === "integrate"
|
|
540
|
+
? "resume integration from persisted pipeline state"
|
|
541
|
+
: blockedPipelineStage === "reporter"
|
|
542
|
+
? "resume reporter from persisted pipeline state"
|
|
543
|
+
: "resume executor from persisted pipeline state",
|
|
395
544
|
meta,
|
|
396
|
-
})
|
|
545
|
+
});
|
|
546
|
+
if (executorResume || opts.executorBy)
|
|
547
|
+
pendingExecutorUnblock = event;
|
|
548
|
+
else
|
|
549
|
+
writeEventFile(schedulePath, event);
|
|
397
550
|
}
|
|
398
551
|
snapshot.tasks[opts.task] = {
|
|
399
552
|
...taskState,
|
|
@@ -426,11 +579,12 @@ export async function runResumeMode(opts) {
|
|
|
426
579
|
try {
|
|
427
580
|
const task = buildTaskView(schedulePath, executionPath, taskId);
|
|
428
581
|
const resolved = resolveClaimingActor(snapshot.tasks[taskId], opts.by);
|
|
429
|
-
|
|
582
|
+
// --resume-from executor は統合の段で止まった task でも executor から再実行する。
|
|
583
|
+
const prepared = !executorResume && snapshot.tasks[taskId]?.meta?.pipeline_stage === "integrate"
|
|
430
584
|
? prepareScheduleIntegrationResume({
|
|
431
585
|
task,
|
|
432
586
|
taskState: snapshot.tasks[taskId],
|
|
433
|
-
actor: resolved.actor ?? snapshot.tasks[taskId]
|
|
587
|
+
actor: resolved.actor ?? claimOwnerOf(snapshot.tasks[taskId]) ?? "exec-pipeline-resume",
|
|
434
588
|
projectId,
|
|
435
589
|
repoRoot,
|
|
436
590
|
executionPath,
|
|
@@ -438,16 +592,78 @@ export async function runResumeMode(opts) {
|
|
|
438
592
|
})
|
|
439
593
|
: await prepareSingleTask(task, projectId, repoRoot, schedulePath, executionPath, roster, localIdToPhaseSets, phaseSetSuffixToId, resolved.actor, { edit: opts.editBy, review: opts.reviewBy }, { executor: opts.executorBy, reporter: opts.reporterBy }, resolved.actor, dryRun, true, // skipClaim: the task is already "doing" and remains claimed
|
|
440
594
|
worktreeBase, planGenPaths, execDefaults, undefined, {
|
|
441
|
-
stage:
|
|
442
|
-
? "
|
|
443
|
-
: snapshot.tasks[taskId]?.meta?.pipeline_stage === "
|
|
444
|
-
? "
|
|
445
|
-
:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
595
|
+
stage: executorResume
|
|
596
|
+
? "executor"
|
|
597
|
+
: snapshot.tasks[taskId]?.meta?.pipeline_stage === "reporter"
|
|
598
|
+
? "reporter"
|
|
599
|
+
: snapshot.tasks[taskId]?.meta?.pipeline_stage === "executor"
|
|
600
|
+
? "executor"
|
|
601
|
+
: undefined,
|
|
602
|
+
stateRef: executorResume?.stateRef ??
|
|
603
|
+
(typeof snapshot.tasks[taskId]?.meta?.pipeline_state_ref === "string"
|
|
604
|
+
? snapshot.tasks[taskId]?.meta?.pipeline_state_ref
|
|
605
|
+
: undefined),
|
|
606
|
+
...(executorResume
|
|
607
|
+
? { executorTarget: executorResume, worktree: executorWorktree }
|
|
608
|
+
: {}),
|
|
449
609
|
}, opts);
|
|
450
610
|
if (typeof prepared !== "string") {
|
|
611
|
+
const priorTaskState = initialTaskStates.get(taskId);
|
|
612
|
+
const previousActor = claimOwnerOf(priorTaskState);
|
|
613
|
+
const resumingExecutorStage = prepared.pipelineResumeStage !== "reporter" &&
|
|
614
|
+
prepared.pipelineResumeStage !== "integrate";
|
|
615
|
+
if (resumingExecutorStage &&
|
|
616
|
+
previousActor &&
|
|
617
|
+
prepared.actor &&
|
|
618
|
+
prepared.actor !== previousActor) {
|
|
619
|
+
if (!dryRun) {
|
|
620
|
+
const releaseEvent = buildEvent("release", {
|
|
621
|
+
task: taskId,
|
|
622
|
+
by: previousActor,
|
|
623
|
+
msg: opts.resumeFrom === "executor"
|
|
624
|
+
? `release claim to switch executor to ${prepared.actor} (--resume-from executor)`
|
|
625
|
+
: `release claim to switch executor to ${prepared.actor}`,
|
|
626
|
+
meta: ["pipeline_resume_released=true", `replaced_by=${prepared.actor}`],
|
|
627
|
+
});
|
|
628
|
+
const resumeMeta = {
|
|
629
|
+
...(priorTaskState?.meta ?? {}),
|
|
630
|
+
...(executorResume
|
|
631
|
+
? { pipeline_stage: "executor", pipeline_state_ref: executorResume.stateRef }
|
|
632
|
+
: {}),
|
|
633
|
+
pipeline_resume_claimed: "true",
|
|
634
|
+
previous_actor: previousActor,
|
|
635
|
+
};
|
|
636
|
+
const meta = Object.entries(resumeMeta).map(([key, value]) => `${key}=${String(value)}`);
|
|
637
|
+
const claimEvent = buildEvent("claim", {
|
|
638
|
+
task: taskId,
|
|
639
|
+
by: prepared.actor,
|
|
640
|
+
msg: opts.resumeFrom === "executor"
|
|
641
|
+
? `claim task as resumed executor ${prepared.actor} (--resume-from executor)`
|
|
642
|
+
: `claim task as resumed executor ${prepared.actor}`,
|
|
643
|
+
meta,
|
|
644
|
+
});
|
|
645
|
+
writeEventFile(schedulePath, releaseEvent);
|
|
646
|
+
writeEventFile(schedulePath, claimEvent);
|
|
647
|
+
}
|
|
648
|
+
pendingExecutorUnblock = undefined;
|
|
649
|
+
snapshot.tasks[taskId] = {
|
|
650
|
+
...snapshot.tasks[taskId],
|
|
651
|
+
state: "doing",
|
|
652
|
+
last_by: prepared.actor,
|
|
653
|
+
claimed_by: prepared.actor,
|
|
654
|
+
last_type: "claim",
|
|
655
|
+
};
|
|
656
|
+
prepared.claimActor = prepared.actor;
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
if (pendingExecutorUnblock) {
|
|
660
|
+
if (!dryRun)
|
|
661
|
+
writeEventFile(schedulePath, pendingExecutorUnblock);
|
|
662
|
+
pendingExecutorUnblock = undefined;
|
|
663
|
+
}
|
|
664
|
+
// The claim stays with its holder when --by or a stage override runs another agent.
|
|
665
|
+
prepared.claimActor = snapshot.tasks[taskId]?.last_by ?? prepared.claimActor;
|
|
666
|
+
}
|
|
451
667
|
const attempts = snapshot.tasks[taskId]?.meta?.limit_attempts;
|
|
452
668
|
prepared.priorLimitAttempts =
|
|
453
669
|
typeof attempts === "string" && /^\d+$/.test(attempts)
|
|
@@ -462,7 +678,7 @@ export async function runResumeMode(opts) {
|
|
|
462
678
|
const message = error instanceof Error ? error.message : String(error);
|
|
463
679
|
process.stderr.write(`[resume] setup error for ${taskId}: ${message}\n`);
|
|
464
680
|
if (opts.due && !dryRun) {
|
|
465
|
-
spawnBlock(projectId, taskId, snapshot.tasks[taskId]
|
|
681
|
+
spawnBlock(projectId, taskId, claimOwnerOf(snapshot.tasks[taskId]) ?? "exec-limit-resume", `resume setup error: ${message}`);
|
|
466
682
|
}
|
|
467
683
|
process.exitCode = 1;
|
|
468
684
|
}
|
|
@@ -479,7 +695,10 @@ export async function runResumeMode(opts) {
|
|
|
479
695
|
const completedAt = new Date().toISOString();
|
|
480
696
|
if (prepared.resultPath)
|
|
481
697
|
await updateResultStatus(prepared.resultPath, "blocked", completedAt);
|
|
482
|
-
spawnBlock(projectId, prepared.task.id, prepared.
|
|
698
|
+
spawnBlock(projectId, prepared.task.id, prepared.claimActor, `runner error: ${message}`, {
|
|
699
|
+
limit_deferred: "false",
|
|
700
|
+
...stageActorMeta(prepared.claimActor, prepared.actor),
|
|
701
|
+
});
|
|
483
702
|
}
|
|
484
703
|
process.exitCode = 1;
|
|
485
704
|
}
|
|
@@ -496,6 +715,7 @@ export function registerResumeCommand(exec) {
|
|
|
496
715
|
cmd.option("--project <projectId>", "Project id in .specdojo/specdojo.config.json");
|
|
497
716
|
cmd.option("--task <taskId>", 'Resume only this task ("doing", blocked pipeline stage, or due with --due)');
|
|
498
717
|
cmd.option("--due", "Atomically claim and resume only retryable limit blocks whose resume time has arrived", false);
|
|
718
|
+
cmd.option("--resume-from <stage>", "Restart at executor, preserving existing work (requires --task; cannot be combined with --due)");
|
|
499
719
|
cmd.option("--by <nickname>", "Select an agent-members.yaml agent (default: the agent that claimed the task)");
|
|
500
720
|
cmd.option("--edit-by <nickname>", "agent-members.yaml nickname for edit-mode tasks (overrides the claiming actor)");
|
|
501
721
|
cmd.option("--review-by <nickname>", "agent-members.yaml nickname for review-mode tasks (overrides the claiming actor)");
|
|
@@ -511,6 +731,7 @@ export function registerResumeCommand(exec) {
|
|
|
511
731
|
cmd.option("--dry-run", "Print resolved commands without executing", false);
|
|
512
732
|
cmd.action(async (opts) => {
|
|
513
733
|
try {
|
|
734
|
+
validateScheduleResumeOptions(opts);
|
|
514
735
|
if (opts.by && opts.executorBy) {
|
|
515
736
|
process.stdout.write("Specify either --by or --executor-by, not both.\n");
|
|
516
737
|
process.exitCode = 1;
|
|
@@ -521,7 +742,7 @@ export function registerResumeCommand(exec) {
|
|
|
521
742
|
process.exitCode = 1;
|
|
522
743
|
return;
|
|
523
744
|
}
|
|
524
|
-
await withProjectExecRunLock(opts, "resume", () => runResumeMode(opts));
|
|
745
|
+
await withProjectExecRunLock(opts, "resume", () => withTrailingRunRecords(opts, "resume", () => runResumeMode(opts)));
|
|
525
746
|
}
|
|
526
747
|
catch (error) {
|
|
527
748
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { relative, sep } from "node:path";
|
|
4
4
|
import { selfRunArgs } from "../../shared/spawn-self.js";
|
|
5
5
|
import { specdojoRootDir } from "../../shared/specdojo-config.js";
|
|
6
6
|
import { readPipelineState, updatePipelineRepoIntegration, updatePipelineStage, writePipelineState, } from "../pipeline-state.js";
|
|
7
|
+
import { runLogPath } from "../run-records.js";
|
|
7
8
|
export function spawnSelf(args, cwd = specdojoRootDir()) {
|
|
8
9
|
const [exe, fullArgs] = selfRunArgs(args);
|
|
9
10
|
const result = spawnSync(exe, fullArgs, { stdio: "inherit", cwd });
|
|
10
11
|
return result.status === 0;
|
|
11
12
|
}
|
|
12
13
|
export function spawnValidate(projectId) {
|
|
13
|
-
|
|
14
|
+
// Run records can still be incomplete at startup or resume, and the run lock is held.
|
|
15
|
+
// Audit persisted records explicitly or in CI, independently of schedule readiness.
|
|
16
|
+
const args = ["exec", "validate", "--schedule-only"];
|
|
14
17
|
if (projectId)
|
|
15
18
|
args.push("--project", projectId);
|
|
16
19
|
return spawnSelf(args);
|
|
@@ -82,6 +85,11 @@ export function pipelineRecoveryMeta(input) {
|
|
|
82
85
|
...(input.runId ? { pipeline_run_id: input.runId } : {}),
|
|
83
86
|
};
|
|
84
87
|
}
|
|
88
|
+
// The runner blocks a failed task as the actor holding its claim, because another agent may have
|
|
89
|
+
// run the failed stage (fallback, --executor-by, --reporter-by). Record both actors on the event.
|
|
90
|
+
export function stageActorMeta(claimActor, stageActor) {
|
|
91
|
+
return { claim_actor: claimActor, stage_actor: stageActor || claimActor };
|
|
92
|
+
}
|
|
85
93
|
export function spawnBlock(projectId, taskId, by, reason, meta = { limit_deferred: "false" }) {
|
|
86
94
|
const args = ["exec", "block", "--task", taskId, "--by", by, "--msg", reason];
|
|
87
95
|
for (const [key, value] of Object.entries(meta))
|
|
@@ -136,5 +144,5 @@ export function recordRepoIntegration(statePath, repo, patch) {
|
|
|
136
144
|
}
|
|
137
145
|
}
|
|
138
146
|
export function integrateLogPath(statePath) {
|
|
139
|
-
return statePath ?
|
|
147
|
+
return statePath ? runLogPath(statePath, "integrate.log") : undefined;
|
|
140
148
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { parseProductBranchOverrides } from "../product-branches.js";
|
|
2
1
|
import { loadExecDefaultsConfig, resolveRegisterPostReview } from "../agent-config.js";
|
|
2
|
+
import { parseProductBranchOverrides } from "../product-branches.js";
|
|
3
3
|
import { resolveProjectPaths } from "../project.js";
|
|
4
4
|
import { isRegisterFailureMode } from "../register.js";
|
|
5
5
|
import { configuredProductRepos } from "../task-repos.js";
|
|
6
|
-
import { EXCLUSIVE_EXEC_RUN, parseParallel, resolveExecDefaultsPath, resolveRegisterWorktree, withProjectExecRunLock, } from "./shared.js";
|
|
7
|
-
import { runBatchMode, runManualMode } from "./schedule-mode.js";
|
|
8
6
|
import { runInPlaceMode } from "./in-place.js";
|
|
9
7
|
import { runJobMode } from "./job.js";
|
|
10
8
|
import { spawnRefresh, spawnValidate } from "./mode-shared.js";
|
|
11
9
|
import { resolveRegisterPipelineCommand } from "./register-core.js";
|
|
12
10
|
import { runRegisterMode } from "./register-mode.js";
|
|
11
|
+
import { runBatchMode, runManualMode } from "./schedule-mode.js";
|
|
12
|
+
import { EXCLUSIVE_EXEC_RUN, parseParallel, resolveExecDefaultsPath, resolveRegisterWorktree, withProjectExecRunLock, } from "./shared.js";
|
|
13
|
+
import { withTrailingRunRecords } from "./trailing-records.js";
|
|
13
14
|
export function registerRunCommand(exec) {
|
|
14
15
|
const rcmd = exec
|
|
15
16
|
.command("run")
|
|
@@ -17,6 +18,7 @@ export function registerRunCommand(exec) {
|
|
|
17
18
|
rcmd.option("--project <projectId>", "Project id in .specdojo/specdojo.config.json");
|
|
18
19
|
rcmd.option("--by <nickname>", "Select an agent-members.yaml agent for a manual target");
|
|
19
20
|
rcmd.option("--auto", "Automatically select and run next ready task", false);
|
|
21
|
+
rcmd.option("--track <track>", "Limit --auto selection to one schedule track");
|
|
20
22
|
rcmd.option("--task <taskId>", "Task ID to run (manual selection)");
|
|
21
23
|
rcmd.option("--deliverable <localId>", "Catalog deliverable local_id target (unique project-wide)");
|
|
22
24
|
rcmd.option("--plan <path>", "Run an existing plan file (in-place; no generation)");
|
|
@@ -39,7 +41,7 @@ export function registerRunCommand(exec) {
|
|
|
39
41
|
rcmd.option("--worktree", "Use a git worktree and integrate back (requires --task, --register, or --job; Job runs are committed and reviewed before merge)", false);
|
|
40
42
|
rcmd.option("--in-place", "Run a register item in the current working tree (overrides run.register_execution; cannot be combined with --worktree)", false);
|
|
41
43
|
rcmd.option("--track-state", "Record claim/complete events (requires --task; --by optional, actor auto-derived from the resolved agent)", false);
|
|
42
|
-
rcmd.option("--archive-on-success", "
|
|
44
|
+
rcmd.option("--archive-on-success", "Keep the completed plan in its run directory after a successful in-place run", false);
|
|
43
45
|
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
46
|
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]);
|
|
45
47
|
rcmd.option("--parallel <n>", "Number of worktree instances to run in parallel", "1");
|
|
@@ -71,6 +73,11 @@ export function registerRunCommand(exec) {
|
|
|
71
73
|
const hasJob = !!opts.job;
|
|
72
74
|
const isManual = hasTask || hasDeliverable || hasPlan || hasRegister || hasJob;
|
|
73
75
|
const isBatch = isAuto;
|
|
76
|
+
if (opts.track !== undefined && !isAuto) {
|
|
77
|
+
process.stdout.write("--track requires --auto.\n");
|
|
78
|
+
process.exitCode = 1;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
74
81
|
if (hasRegisterIds && hasRegisterFilter) {
|
|
75
82
|
process.stdout.write("Specify either --register or --register-filter, not both.\n");
|
|
76
83
|
process.exitCode = 1;
|
|
@@ -270,12 +277,7 @@ export function registerRunCommand(exec) {
|
|
|
270
277
|
return;
|
|
271
278
|
}
|
|
272
279
|
process.stdout.write("[run] refresh: ok\n");
|
|
273
|
-
|
|
274
|
-
await runBatchMode(opts);
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
await runManualMode(opts);
|
|
278
|
-
}
|
|
280
|
+
await withTrailingRunRecords(opts, "run", () => isBatch ? runBatchMode(opts) : runManualMode(opts));
|
|
279
281
|
}, registerWorktreeLockSharing);
|
|
280
282
|
}
|
|
281
283
|
catch (error) {
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readPlanFile } from "../../shared/plan-conventions.js";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
-
import { basename } from "node:path";
|
|
4
|
-
import {
|
|
3
|
+
import { basename, dirname } from "node:path";
|
|
4
|
+
import { isAuthoringApproach } from "../../kata/authoring.js";
|
|
5
|
+
import { registerDependencyBlockReason } from "../../register/dependency.js";
|
|
6
|
+
import { registerEventFilePath } from "../../register/events.js";
|
|
7
|
+
import { displayIdFromTicketFilename } from "../../register/item.js";
|
|
5
8
|
import { resolveAgentMember, } from "../../shared/specdojo-config.js";
|
|
9
|
+
import { resolveMemberCommand, } from "../agent-config.js";
|
|
6
10
|
import { buildInPlaceStem } from "../plans.js";
|
|
7
11
|
import { generateRegisterPlan, normalizePjrId, requireRunnableRegisterItem, resolveRegisterRunTarget, sanitizeRegisterConclusion, selectRegisterCommitPaths, selectRegisterRunArtifactResidue, ticketPathFromItem, } from "../register.js";
|
|
8
|
-
import { registerEventFilePath } from "../../register/events.js";
|
|
9
|
-
import { displayIdFromTicketFilename } from "../../register/item.js";
|
|
10
12
|
import { isResultUnfilled, readResultFrontmatterSnapshot, scaffoldResult, updateResultStatus, } from "../results.js";
|
|
11
|
-
import {
|
|
13
|
+
import { recordRef } from "../run-records.js";
|
|
14
|
+
import { configuredProductCheckouts } from "../task-repos.js";
|
|
12
15
|
import { stabilizeCommitTargets, stageCommitTargets, unstageCommitTargets, worktreeStatusPaths, } from "../worktree-ops.js";
|
|
13
|
-
import {
|
|
14
|
-
import { expandPromptRefs } from "./agent.js";
|
|
16
|
+
import { formatGitResultFailure, gitOutput, gitResult } from "../worktree.js";
|
|
15
17
|
import { runAgentPipeline } from "./agent-pipeline.js";
|
|
18
|
+
import { expandPromptRefs } from "./agent.js";
|
|
19
|
+
import { planConventionsFiles } from "../../shared/plan-conventions.js";
|
|
16
20
|
import { spawnAgentInPlace } from "./in-place.js";
|
|
17
21
|
import { commitSubject, repoRelativePath, spawnSelf } from "./mode-shared.js";
|
|
18
|
-
import {
|
|
19
|
-
import { configuredProductCheckouts } from "../task-repos.js";
|
|
22
|
+
import { rateLimitRecoveryReason, resolveAgentOverride, resolvePinnedRateLimitRunOptions, selectCandidates, } from "./shared.js";
|
|
20
23
|
// CLI choices are the highest-priority layer. A difficulty route only supplies omitted stage and
|
|
21
24
|
// recovery options; without a matching route the historical priority-based selection is kept.
|
|
22
25
|
export function applyRegisterDifficultyRouting(item, opts, execDefaults) {
|
|
@@ -214,7 +217,10 @@ export function registerRunnerManagedPaths(repoRoot, registerPaths, planPath, re
|
|
|
214
217
|
// 状態遷移の書き込み先は個票(正本)。pjr-index と派生ビューは生成物として同時に更新される。
|
|
215
218
|
// 移行完了後の pjr-index.md は非追跡の生成物になり存在しないため、存在する場合のみ対象に含める
|
|
216
219
|
// (存在しないパスを git add すると pathspec エラーになる)。
|
|
217
|
-
const
|
|
220
|
+
const versions = existsSync(planPath)
|
|
221
|
+
? planConventionsFiles(readFileSync(planPath, "utf8"), dirname(planPath))
|
|
222
|
+
: [];
|
|
223
|
+
const managed = [planPath, resultPath, ...versions, ...additionalManagedPaths];
|
|
218
224
|
if (existsSync(registerPaths.pjrIndexPath))
|
|
219
225
|
managed.push(registerPaths.pjrIndexPath);
|
|
220
226
|
if (ticketPath)
|
|
@@ -289,14 +295,14 @@ export async function runSingleRegisterItem(context, opts, pjrId) {
|
|
|
289
295
|
item,
|
|
290
296
|
stem,
|
|
291
297
|
});
|
|
292
|
-
const prompt = expandPromptRefs(
|
|
298
|
+
const prompt = expandPromptRefs(readPlanFile(planPath));
|
|
293
299
|
const { resultPath, supersededPaths } = await scaffoldResult({
|
|
294
300
|
executionPath,
|
|
295
301
|
taskId: item.id,
|
|
296
302
|
mode: "edit",
|
|
297
303
|
projectId,
|
|
298
304
|
origin: "register",
|
|
299
|
-
planRef:
|
|
305
|
+
planRef: recordRef(executionPath, planPath),
|
|
300
306
|
agent: actor,
|
|
301
307
|
startedAt: new Date().toISOString(),
|
|
302
308
|
stem,
|
|
@@ -328,6 +334,7 @@ export async function runSingleRegisterItem(context, opts, pjrId) {
|
|
|
328
334
|
executor: pipelineAgents.executor,
|
|
329
335
|
reporterCandidates: pipelineAgents.reporterCandidates,
|
|
330
336
|
planPath,
|
|
337
|
+
runId: stem,
|
|
331
338
|
planPrompt: prompt,
|
|
332
339
|
resultPath,
|
|
333
340
|
registerPaths: registerReporterManagedPaths(registerPaths),
|