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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { gitEnvironment } from "../shared/git-environment.js";
|
|
6
|
+
import { validateRunRecordLayout } from "./validate-records.js";
|
|
7
|
+
// commit の tree を対象に配置を検査する(PJR-1ZQK)。作業ツリーの検査は、ローカルにしかない
|
|
8
|
+
// 未 commit の run(中断中の plan 単独や空のディレクトリ)も拾うため、push の前の検査には使えない。
|
|
9
|
+
// tree を一時ディレクトリへ書き出し、同じ検査を流す。中身を読むのは `execution: human` を判定する
|
|
10
|
+
// result.md だけで、ほかのファイルは空で置く。
|
|
11
|
+
const GIT_MAX_BUFFER = 256 * 1024 * 1024;
|
|
12
|
+
function git(repoRoot, args, input) {
|
|
13
|
+
const result = spawnSync("git", args, {
|
|
14
|
+
cwd: repoRoot,
|
|
15
|
+
env: gitEnvironment(),
|
|
16
|
+
encoding: "utf8",
|
|
17
|
+
maxBuffer: GIT_MAX_BUFFER,
|
|
18
|
+
...(input === undefined ? {} : { input }),
|
|
19
|
+
});
|
|
20
|
+
if (result.error)
|
|
21
|
+
throw new Error(`git ${args[0]} failed in ${repoRoot}: ${result.error.message}`, {
|
|
22
|
+
cause: result.error,
|
|
23
|
+
});
|
|
24
|
+
if (result.status !== 0)
|
|
25
|
+
throw new Error(`git ${args.join(" ")} failed in ${repoRoot}: ${result.stderr.trim()}`);
|
|
26
|
+
return result.stdout;
|
|
27
|
+
}
|
|
28
|
+
function listTree(repoRoot, commit, paths) {
|
|
29
|
+
const output = git(repoRoot, ["ls-tree", "-r", "-z", "--full-tree", commit, "--", ...paths]);
|
|
30
|
+
return output
|
|
31
|
+
.split("\0")
|
|
32
|
+
.filter(Boolean)
|
|
33
|
+
.map((line) => {
|
|
34
|
+
const tab = line.indexOf("\t");
|
|
35
|
+
const [mode = "", type = "", object = ""] = line.slice(0, tab).split(" ");
|
|
36
|
+
return { mode, type, object, path: line.slice(tab + 1) };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// `git cat-file --batch` の出力(`<oid> blob <size>\n<content>\n` の繰り返し)を順に切り出す。
|
|
40
|
+
function readBlobs(repoRoot, objects) {
|
|
41
|
+
if (objects.length === 0)
|
|
42
|
+
return [];
|
|
43
|
+
const output = spawnSync("git", ["cat-file", "--batch"], {
|
|
44
|
+
cwd: repoRoot,
|
|
45
|
+
env: gitEnvironment(),
|
|
46
|
+
input: `${objects.join("\n")}\n`,
|
|
47
|
+
maxBuffer: GIT_MAX_BUFFER,
|
|
48
|
+
});
|
|
49
|
+
if (output.error || output.status !== 0)
|
|
50
|
+
throw new Error(`git cat-file --batch failed in ${repoRoot}: ${output.error?.message ?? String(output.stderr)}`);
|
|
51
|
+
const buffer = output.stdout;
|
|
52
|
+
const contents = [];
|
|
53
|
+
let offset = 0;
|
|
54
|
+
for (const object of objects) {
|
|
55
|
+
const newline = buffer.indexOf(0x0a, offset);
|
|
56
|
+
const header = buffer.subarray(offset, newline).toString("utf8").split(" ");
|
|
57
|
+
if (header[0] !== object || header[1] !== "blob")
|
|
58
|
+
throw new Error(`unexpected git cat-file output for ${object}: ${header.join(" ")}`);
|
|
59
|
+
const size = Number(header[2]);
|
|
60
|
+
contents.push(buffer.subarray(newline + 1, newline + 1 + size).toString("utf8"));
|
|
61
|
+
offset = newline + 1 + size + 1;
|
|
62
|
+
}
|
|
63
|
+
return contents;
|
|
64
|
+
}
|
|
65
|
+
function materialize(root, entries, contents) {
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
const target = resolve(root, entry.path);
|
|
68
|
+
if (!target.startsWith(`${root}${sep}`) && target !== root)
|
|
69
|
+
throw new Error(`tree path escapes the check directory: ${entry.path}`);
|
|
70
|
+
if (entry.type === "commit") {
|
|
71
|
+
mkdirSync(target, { recursive: true });
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
75
|
+
// symlink は通常のファイルとして数えない。検査が lstat で判定するので、宛先のない link で表す。
|
|
76
|
+
if (entry.mode === "120000")
|
|
77
|
+
symlinkSync("missing-symlink-target", target);
|
|
78
|
+
else
|
|
79
|
+
writeFileSync(target, contents.get(entry.path) ?? "", "utf8");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function validateRunRecordLayoutAtCommit(options) {
|
|
83
|
+
const repoRoot = resolve(options.repoRoot);
|
|
84
|
+
const toRepo = (path) => relative(repoRoot, resolve(path)).replaceAll("\\", "/");
|
|
85
|
+
const executionPath = toRepo(options.executionPath);
|
|
86
|
+
const routineLocks = options.routinesPath ? `${toRepo(options.routinesPath)}/.locks` : undefined;
|
|
87
|
+
const commit = git(repoRoot, [
|
|
88
|
+
"rev-parse",
|
|
89
|
+
"--verify",
|
|
90
|
+
"--end-of-options",
|
|
91
|
+
`${options.commit}^{commit}`,
|
|
92
|
+
]).trim();
|
|
93
|
+
const entries = listTree(repoRoot, commit, routineLocks ? [executionPath, routineLocks] : [executionPath]);
|
|
94
|
+
const results = entries.filter((entry) => entry.type === "blob" && entry.mode !== "120000" && basename(entry.path) === "result.md");
|
|
95
|
+
const blobs = readBlobs(repoRoot, results.map((entry) => entry.object));
|
|
96
|
+
const contents = new Map(results.map((entry, index) => [entry.path, blobs[index] ?? ""]));
|
|
97
|
+
const root = mkdtempSync(join(tmpdir(), "specdojo-record-layout-commit-"));
|
|
98
|
+
try {
|
|
99
|
+
materialize(root, entries, contents);
|
|
100
|
+
return validateRunRecordLayout({
|
|
101
|
+
repoRoot: root,
|
|
102
|
+
executionPath: join(root, executionPath),
|
|
103
|
+
...(options.routinesPath ? { routinesPath: join(root, toRepo(options.routinesPath)) } : {}),
|
|
104
|
+
lockPolicy: "tracked",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
rmSync(root, { recursive: true, force: true });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, lstatSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { readSpecdojoNamespace } from "../shared/frontmatter-namespace.js";
|
|
5
|
+
import { gitEnvironment } from "../shared/git-environment.js";
|
|
6
|
+
import { runRecordLocation, runRecordsDirectory } from "../shared/run-records.js";
|
|
7
|
+
function isRegularFile(path) {
|
|
8
|
+
return existsSync(path) && lstatSync(path).isFile();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Required records missing from one run directory, as absolute paths. A path that is not an
|
|
12
|
+
* exact runs/<origin>/<item ID>/<run ID>/ directory has no requirement. `isFile` lets callers
|
|
13
|
+
* judge a state that is not the working tree, such as the files a commit will contain.
|
|
14
|
+
*/
|
|
15
|
+
export function missingRunRecords(executionPath, directory, options = {}) {
|
|
16
|
+
const isFile = options.isFile ?? isRegularFile;
|
|
17
|
+
const itemHasPair = options.itemHasPair ?? new Map();
|
|
18
|
+
const paths = runRecordLocation(executionPath, directory);
|
|
19
|
+
if (!paths)
|
|
20
|
+
return [];
|
|
21
|
+
const exists = (path) => isFile(path) || existsSync(path);
|
|
22
|
+
// Before evidence existed, a plan/result pair was a complete run.
|
|
23
|
+
if (isFile(paths.plan) && isFile(paths.result) && !exists(paths.state) && !exists(paths.evidence))
|
|
24
|
+
return [];
|
|
25
|
+
// Migration consolidated shared plan/result pairs into another run of the same item.
|
|
26
|
+
if (!exists(paths.plan) &&
|
|
27
|
+
!exists(paths.result) &&
|
|
28
|
+
isFile(paths.state) &&
|
|
29
|
+
isFile(paths.evidence) &&
|
|
30
|
+
hasSiblingPair(executionPath, directory, isFile, itemHasPair))
|
|
31
|
+
return [];
|
|
32
|
+
// Human work is explicitly result-only; absent or malformed metadata gets no exemption.
|
|
33
|
+
const human = isRegularFile(paths.result) &&
|
|
34
|
+
readSpecdojoNamespace(readFileSync(paths.result, "utf8")).execution === "human";
|
|
35
|
+
return (human ? [paths.result] : [paths.plan, paths.result, paths.evidence]).filter((path) => !isFile(path));
|
|
36
|
+
}
|
|
37
|
+
function hasSiblingPair(executionPath, directory, isFile, itemHasPair) {
|
|
38
|
+
const item = dirname(directory);
|
|
39
|
+
const cached = itemHasPair.get(item);
|
|
40
|
+
if (cached !== undefined)
|
|
41
|
+
return cached;
|
|
42
|
+
const found = readdirSync(item, { withFileTypes: true }).some((entry) => {
|
|
43
|
+
if (!entry.isDirectory() || entry.name === basename(directory))
|
|
44
|
+
return false;
|
|
45
|
+
const paths = runRecordLocation(executionPath, join(item, entry.name));
|
|
46
|
+
return paths !== undefined && isFile(paths.plan) && isFile(paths.result);
|
|
47
|
+
});
|
|
48
|
+
itemHasPair.set(item, found);
|
|
49
|
+
return found;
|
|
50
|
+
}
|
|
51
|
+
/** Read-only layout audit. Logs, evidence and checkpoint contents are never read. */
|
|
52
|
+
export function validateRunRecordLayout(options) {
|
|
53
|
+
const { executionPath, repoRoot, routinesPath } = options;
|
|
54
|
+
const issues = [];
|
|
55
|
+
const locks = new Set();
|
|
56
|
+
const report = (path, reason, message) => {
|
|
57
|
+
issues.push({ path: relative(repoRoot, path).replaceAll("\\", "/"), reason, message });
|
|
58
|
+
};
|
|
59
|
+
const entries = (directory) => readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
60
|
+
function collectLocks(path) {
|
|
61
|
+
if (lstatSync(path).isDirectory()) {
|
|
62
|
+
// Empty directory trees cannot contain runtime locks and Git cannot track them.
|
|
63
|
+
const children = entries(path).map((entry) => collectLocks(join(path, entry.name)));
|
|
64
|
+
if (!children.some(Boolean))
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
locks.add(resolve(path));
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
const itemHasPair = new Map();
|
|
71
|
+
function checkRun(directory) {
|
|
72
|
+
for (const path of missingRunRecords(executionPath, directory, { itemHasPair }))
|
|
73
|
+
report(path, "missing", "required run record is missing or not a regular file");
|
|
74
|
+
}
|
|
75
|
+
const runs = resolve(runRecordsDirectory(executionPath));
|
|
76
|
+
// These have independent formats and lifecycles (PJR-VH8D / PJR-9BY9 / PJR-PZBP).
|
|
77
|
+
const separateTrees = new Set([
|
|
78
|
+
"grade/results",
|
|
79
|
+
"grade/generated",
|
|
80
|
+
"jobs/runs",
|
|
81
|
+
"exec/events",
|
|
82
|
+
"exec/trials",
|
|
83
|
+
"exec/plans",
|
|
84
|
+
"exec/results",
|
|
85
|
+
"exec/evidence",
|
|
86
|
+
"conventions",
|
|
87
|
+
"generated",
|
|
88
|
+
"routines/failures",
|
|
89
|
+
]);
|
|
90
|
+
function walk(directory) {
|
|
91
|
+
checkRun(directory);
|
|
92
|
+
for (const entry of entries(directory)) {
|
|
93
|
+
const path = join(directory, entry.name);
|
|
94
|
+
const rel = relative(executionPath, path).replaceAll("\\", "/");
|
|
95
|
+
if (entry.name === ".locks" || entry.name.endsWith(".lock")) {
|
|
96
|
+
collectLocks(path);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (separateTrees.has(rel))
|
|
100
|
+
continue;
|
|
101
|
+
const inRuns = resolve(path).startsWith(`${runs}${sep}`);
|
|
102
|
+
if (entry.isDirectory()) {
|
|
103
|
+
// Validate empty run directories too; reject unknown origins and extra nesting.
|
|
104
|
+
const depth = relative(runs, path).split(/[\\/]/).length;
|
|
105
|
+
if (inRuns && depth >= 3 && !runRecordLocation(executionPath, path)) {
|
|
106
|
+
report(path, "misplaced", "expected runs/<origin>/<item ID>/<run ID>/");
|
|
107
|
+
}
|
|
108
|
+
walk(path);
|
|
109
|
+
}
|
|
110
|
+
else if (inRuns
|
|
111
|
+
? !entry.isFile() || !runRecordLocation(executionPath, directory)
|
|
112
|
+
: /^(?:plan\.md|result\.md|evidence(?:\.attempt-\d+)?\.json|pipeline-state(?:\.attempt-\d+)?\.json)$/.test(basename(path)) || /(?:-(?:plan|result)\.md|\.log)$/.test(entry.name)) {
|
|
113
|
+
report(path, "misplaced", "execution record must be a regular file directly in runs/<origin>/<item ID>/<run ID>/");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (existsSync(executionPath))
|
|
118
|
+
walk(executionPath);
|
|
119
|
+
const oldRoutineLocks = routinesPath && join(routinesPath, ".locks");
|
|
120
|
+
if (oldRoutineLocks && existsSync(oldRoutineLocks))
|
|
121
|
+
collectLocks(oldRoutineLocks);
|
|
122
|
+
if (locks.size && options.lockPolicy === "tracked") {
|
|
123
|
+
for (const path of locks)
|
|
124
|
+
report(path, "lock-not-ignored", "runtime lock is tracked by Git");
|
|
125
|
+
}
|
|
126
|
+
else if (locks.size) {
|
|
127
|
+
const candidates = [...locks].sort();
|
|
128
|
+
// Without --no-index, tracked locks are correctly rejected even if a rule now ignores them.
|
|
129
|
+
const result = spawnSync("git", ["check-ignore", "-z", "--stdin"], {
|
|
130
|
+
cwd: repoRoot,
|
|
131
|
+
env: gitEnvironment(),
|
|
132
|
+
input: `${candidates.join("\0")}\0`,
|
|
133
|
+
encoding: "utf8",
|
|
134
|
+
timeout: 10_000,
|
|
135
|
+
});
|
|
136
|
+
if (result.error || (result.status !== 0 && result.status !== 1)) {
|
|
137
|
+
report(candidates[0], "git-check-failed", "cannot verify lock exclusion with git check-ignore");
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const ignored = new Set(result.stdout.split("\0"));
|
|
141
|
+
for (const path of candidates) {
|
|
142
|
+
if (!ignored.has(path))
|
|
143
|
+
report(path, "lock-not-ignored", "runtime lock is tracked or not ignored by Git");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return issues.sort((a, b) => a.path.localeCompare(b.path) || a.reason.localeCompare(b.reason));
|
|
148
|
+
}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { gradeCheckpointPaths } from "./grade-checkpoint.js";
|
|
2
1
|
import { spawn } from "node:child_process";
|
|
3
2
|
import { existsSync } from "node:fs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { getProjectSchedulePath, loadConfig, resolveAgentMember, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
6
5
|
import { hasMemberCommandSource, loadExecDefaultsConfig, resolveMemberCommand, } from "./agent-config.js";
|
|
7
|
-
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
8
6
|
import { agentGitStateViolation, captureAgentGitStateAcrossRepos, changedAgentGitStateAcrossRepos, qualifiedGitStateFields, } from "./agent-git-state.js";
|
|
9
7
|
import { agentProtectedConfigViolation, captureAgentProtectedConfigAcrossRepos, changedAgentProtectedConfigAcrossRepos, qualifiedRepoPaths, } from "./agent-protected-config.js";
|
|
8
|
+
import { acquireSchedulerLock, foldEventsToState, readAllEventFiles, releaseSchedulerLock, } from "./events.js";
|
|
9
|
+
import { gradeCheckpointPaths } from "./grade-checkpoint.js";
|
|
10
|
+
import { generateSinglePlan } from "./plans.js";
|
|
11
|
+
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
10
12
|
import { recordGitStateBlockAcrossRepos, recordProtectedConfigBlockAcrossRepos, } from "./protection-handoff.js";
|
|
11
|
-
import {
|
|
12
|
-
import { resolveAgentMember } from "../shared/specdojo-config.js";
|
|
13
|
+
import { recordPathForRead, recordStem } from "./run-records.js";
|
|
13
14
|
import { buildTaskPhaseMap, loadPrompt, loadRosterForExecutionPath, resolveTaskPhaseContext, selectCandidates, } from "./run/run.js";
|
|
14
|
-
import { buildScheduleIndex } from "./schedule/schedule.js";
|
|
15
15
|
import { buildInitialStateFromStrategy } from "./schedule/initial.js";
|
|
16
|
-
import {
|
|
16
|
+
import { buildScheduleIndex } from "./schedule/schedule.js";
|
|
17
17
|
import { qualifyTaskId } from "./shared.js";
|
|
18
|
+
import { configuredProductRepos, missingProductWorktrees, plannedProjectWorktreePath, productBranchForTask, productRepoEnvironment, pruneOrphanedProductExecBranches, withAgentExtraRoots, withoutInheritedRepoEnvironment, withProductRepoPrompt, withProductWorktrees, } from "./task-repos.js";
|
|
18
19
|
import { buildTaskView } from "./task-view.js";
|
|
19
|
-
import { findExecWorktree, gitEnvironment, gitOutput, gitResult, resolveWorktreeBase, worktreeNameFromTaskId, } from "./worktree.js";
|
|
20
20
|
import { checkpointAndEnsureWorktree, commitWorktreeChanges, mergeWorktreeIntoCurrent, pruneOrphanedExecBranches, removeWorktree, taskPaths, worktreeStatusPaths, } from "./worktree-ops.js";
|
|
21
|
-
import {
|
|
21
|
+
import { branchOwnedRunRecordPaths } from "./trailing-records.js";
|
|
22
|
+
import { findExecWorktree, gitEnvironment, gitOutput, gitResult, resolveWorktreeBase, worktreeNameFromTaskId, } from "./worktree.js";
|
|
22
23
|
export { isCommitTargetPath, stabilizeCommitTargets } from "./worktree-ops.js";
|
|
23
24
|
const DEFAULT_LOCK_TIMEOUT_MS = 10_000;
|
|
24
25
|
const DEFAULT_LOCK_STALE_MS = 300_000;
|
|
@@ -168,8 +169,8 @@ async function prepare(opts) {
|
|
|
168
169
|
lockStaleMs: DEFAULT_LOCK_STALE_MS,
|
|
169
170
|
});
|
|
170
171
|
const lockedState = requireDoingTask(context.schedulePath, opts.task);
|
|
171
|
-
const planPath =
|
|
172
|
-
const resultPath =
|
|
172
|
+
const planPath = recordPathForRead(context.executionPath, "plan", opts.task);
|
|
173
|
+
const resultPath = recordPathForRead(context.executionPath, "result", opts.task);
|
|
173
174
|
// Plans are generated on demand (exec refresh does not manage them). Generate
|
|
174
175
|
// one if absent; keep an existing plan so a hand-edited plan is not clobbered.
|
|
175
176
|
if (!existsSync(planPath)) {
|
|
@@ -181,6 +182,8 @@ async function prepare(opts) {
|
|
|
181
182
|
viewpointsPath: context.viewpointsPath,
|
|
182
183
|
projectContext: context.projectContext,
|
|
183
184
|
task: buildTaskView(context.schedulePath, context.executionPath, opts.task),
|
|
185
|
+
outPath: planPath,
|
|
186
|
+
stem: recordStem(planPath),
|
|
184
187
|
});
|
|
185
188
|
}
|
|
186
189
|
for (const path of [planPath, resultPath, lockedState.claimEventPath]) {
|
|
@@ -224,7 +227,7 @@ function status(opts) {
|
|
|
224
227
|
return;
|
|
225
228
|
}
|
|
226
229
|
const worktree = withProductWorktrees(found, products, worktreeTaskId);
|
|
227
|
-
const { planRel, resultRel } = taskPaths(context, opts.task);
|
|
230
|
+
const { planRel, resultRel } = taskPaths(context, opts.task, worktree.path);
|
|
228
231
|
const compareBase = gitOutput(context.repoRoot, ["merge-base", "HEAD", branch]).trim();
|
|
229
232
|
const merged = gitResult(context.repoRoot, ["merge-base", "--is-ancestor", branch, "HEAD"]).status === 0;
|
|
230
233
|
const resultChanged = gitResult(worktree.path, ["diff", "--quiet", compareBase, "--", resultRel]).status === 1;
|
|
@@ -287,7 +290,7 @@ async function agent(opts) {
|
|
|
287
290
|
child.once("close", (code) => resolveExit(code ?? 1));
|
|
288
291
|
});
|
|
289
292
|
// 保護機構が block した場合も、対象と提案差分を worktree 側 result の申し送りへ残す。
|
|
290
|
-
const worktreeResultPath = resolve(worktree.path, taskPaths(context, opts.task).resultRel);
|
|
293
|
+
const worktreeResultPath = resolve(worktree.path, taskPaths(context, opts.task, worktree.path).resultRel);
|
|
291
294
|
const protectedConfigChanges = changedAgentProtectedConfigAcrossRepos(protectedConfigBefore);
|
|
292
295
|
if (protectedConfigChanges.length > 0) {
|
|
293
296
|
const reason = agentProtectedConfigViolation(qualifiedRepoPaths(protectedConfigChanges));
|
|
@@ -335,8 +338,8 @@ function merge(opts) {
|
|
|
335
338
|
// carries the commit). Release them so the merge can bring the committed versions in.
|
|
336
339
|
const { claimEventPath } = taskExecutionState(context.schedulePath, opts.task);
|
|
337
340
|
const releaseRootPaths = [
|
|
338
|
-
|
|
339
|
-
|
|
341
|
+
recordPathForRead(context.executionPath, "plan", opts.task),
|
|
342
|
+
recordPathForRead(context.executionPath, "result", opts.task),
|
|
340
343
|
...(claimEventPath ? [claimEventPath] : []),
|
|
341
344
|
...gradeCheckpointPaths(context),
|
|
342
345
|
];
|
|
@@ -345,6 +348,16 @@ function merge(opts) {
|
|
|
345
348
|
worktree,
|
|
346
349
|
taskId: opts.task,
|
|
347
350
|
releaseRootPaths,
|
|
351
|
+
// run の終わりの記帳 commit が先に入れた作業コピーとの競合は、exec branch 側で解決する。
|
|
352
|
+
resolveConflictsWithBranchPaths: [
|
|
353
|
+
...releaseRootPaths,
|
|
354
|
+
...branchOwnedRunRecordPaths({
|
|
355
|
+
repoRoot: context.repoRoot,
|
|
356
|
+
executionPath: context.executionPath,
|
|
357
|
+
branch: worktree.branch,
|
|
358
|
+
taskId: opts.task,
|
|
359
|
+
}),
|
|
360
|
+
],
|
|
348
361
|
ffOnly: opts.ffOnly,
|
|
349
362
|
dryRun: opts.dryRun,
|
|
350
363
|
});
|