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
package/dist/exec/agent-plan.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { existsSync, mkdirSync,
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { readPlanFile } from "../shared/plan-conventions.js";
|
|
2
3
|
import { dirname, resolve } from "node:path";
|
|
3
4
|
import { defaultExecDefaultsPath, loadExecDefaultsConfig, resolveMemberCommand, resolveRateLimitDetection, resolveRateLimitPolicy, } from "./agent-config.js";
|
|
4
5
|
import { resolveProjectPaths } from "./project.js";
|
|
@@ -70,7 +71,7 @@ export function readAgentPlan(planPath) {
|
|
|
70
71
|
if (!existsSync(absolutePath)) {
|
|
71
72
|
throw new Error(`--plan not found: ${planPath}`);
|
|
72
73
|
}
|
|
73
|
-
const prompt =
|
|
74
|
+
const prompt = readPlanFile(absolutePath);
|
|
74
75
|
if (!prompt.trim()) {
|
|
75
76
|
throw new Error(`--plan is empty: ${planPath}`);
|
|
76
77
|
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { specdojoPackageRootDir } from "../shared/package-paths.js";
|
|
4
|
+
import { isAgentProtectedConfigPath, PROTECTED_DIRECTORY_PREFIXES, PROTECTED_EXACT_PATHS, } from "./agent-protected-config.js";
|
|
5
|
+
export function antigravityRole(value) {
|
|
6
|
+
if (["edit", "review", "report", "orchestrator"].includes(value)) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
throw new Error(`Invalid Antigravity role: ${value}`);
|
|
10
|
+
}
|
|
11
|
+
function canonicalRoot(root) {
|
|
12
|
+
const absolute = resolve(root);
|
|
13
|
+
const normalized = (existsSync(absolute) ? realpathSync(absolute) : absolute).replaceAll("\\", "/");
|
|
14
|
+
// The permission syntax has no escaping for parentheses or the global wildcard.
|
|
15
|
+
if (/[()*\r\n]/u.test(normalized)) {
|
|
16
|
+
throw new Error(`Unsupported Antigravity workspace path: ${normalized}`);
|
|
17
|
+
}
|
|
18
|
+
return normalized.replace(/\/$/u, "") + "/";
|
|
19
|
+
}
|
|
20
|
+
/** One settings object per launch: never read or modify the user's global settings. */
|
|
21
|
+
export function buildAntigravitySession(options) {
|
|
22
|
+
const { role, cwd } = options;
|
|
23
|
+
const roots = [...new Set([cwd, ...options.repoRoots].map(canonicalRoot))];
|
|
24
|
+
const localProfile = join(cwd, ".specdojo", "antigravity", `settings.${role}.json`);
|
|
25
|
+
const profilePath = existsSync(localProfile)
|
|
26
|
+
? localProfile
|
|
27
|
+
: join(specdojoPackageRootDir(), "templates", "antigravity", `settings.${role}.json`);
|
|
28
|
+
const profile = JSON.parse(readFileSync(profilePath, "utf8"));
|
|
29
|
+
if (!profile || typeof profile !== "object" || Array.isArray(profile)) {
|
|
30
|
+
throw new Error(`Invalid Antigravity settings: ${profilePath}`);
|
|
31
|
+
}
|
|
32
|
+
const settings = profile;
|
|
33
|
+
const permissions = { allow: [], deny: [], ask: [] };
|
|
34
|
+
if (settings.permissions !== undefined) {
|
|
35
|
+
if (!settings.permissions ||
|
|
36
|
+
typeof settings.permissions !== "object" ||
|
|
37
|
+
Array.isArray(settings.permissions)) {
|
|
38
|
+
throw new Error(`Invalid permissions in ${profilePath}`);
|
|
39
|
+
}
|
|
40
|
+
for (const name of ["allow", "deny", "ask"]) {
|
|
41
|
+
const rules = settings.permissions[name] ?? [];
|
|
42
|
+
if (!Array.isArray(rules) || rules.some((rule) => typeof rule !== "string")) {
|
|
43
|
+
throw new Error(`Invalid permissions.${name} in ${profilePath}`);
|
|
44
|
+
}
|
|
45
|
+
permissions[name] = [...rules];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
for (const root of roots) {
|
|
49
|
+
permissions.allow.push(`read_file(${root})`);
|
|
50
|
+
if (role === "edit" || role === "orchestrator")
|
|
51
|
+
permissions.allow.push(`write_file(${root})`);
|
|
52
|
+
for (const secret of [
|
|
53
|
+
".env",
|
|
54
|
+
".env.local",
|
|
55
|
+
".env.development",
|
|
56
|
+
".env.production",
|
|
57
|
+
".env.test",
|
|
58
|
+
".env.staging",
|
|
59
|
+
".envrc",
|
|
60
|
+
"secrets/",
|
|
61
|
+
".ssh/",
|
|
62
|
+
".aws/",
|
|
63
|
+
".gemini/",
|
|
64
|
+
]) {
|
|
65
|
+
permissions.deny.push(`read_file(${root}${secret})`);
|
|
66
|
+
}
|
|
67
|
+
permissions.deny.push(`write_file(${root}.git)`);
|
|
68
|
+
if (role !== "orchestrator") {
|
|
69
|
+
const discovered = existsSync(root)
|
|
70
|
+
? readdirSync(root).filter(isAgentProtectedConfigPath)
|
|
71
|
+
: [];
|
|
72
|
+
for (const protectedPath of new Set([
|
|
73
|
+
...PROTECTED_DIRECTORY_PREFIXES,
|
|
74
|
+
...PROTECTED_EXACT_PATHS,
|
|
75
|
+
...discovered,
|
|
76
|
+
])) {
|
|
77
|
+
if (/[()*\r\n]/u.test(protectedPath)) {
|
|
78
|
+
throw new Error(`Unsupported Antigravity protected path: ${protectedPath}`);
|
|
79
|
+
}
|
|
80
|
+
permissions.deny.push(`write_file(${root}${protectedPath})`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (role === "review" || role === "report") {
|
|
85
|
+
// A command or MCP tool can write independently of write_file permissions.
|
|
86
|
+
permissions.deny.push("write_file(*)", "command(*)", "unsandboxed(*)", "mcp(*)", "execute_url(*)");
|
|
87
|
+
}
|
|
88
|
+
permissions.deny.push("command(sudo)", "command(rm -rf)");
|
|
89
|
+
for (const bin of ["", "/usr/bin/", "/usr/local/bin/"]) {
|
|
90
|
+
permissions.deny.push(`command(${bin}git push)`, `command(${bin}gh)`);
|
|
91
|
+
if (role !== "orchestrator") {
|
|
92
|
+
for (const action of ["add", "commit", "config", "reset"])
|
|
93
|
+
permissions.deny.push(`command(${bin}git ${action})`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const name of ["allow", "deny", "ask"])
|
|
97
|
+
permissions[name] = [...new Set(permissions[name])];
|
|
98
|
+
return {
|
|
99
|
+
roots,
|
|
100
|
+
settings: { ...settings, agentMode: "", toolPermission: "request-review", permissions },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function antigravitySessionArguments(options) {
|
|
104
|
+
const { roots, settings } = buildAntigravitySession(options);
|
|
105
|
+
const args = [];
|
|
106
|
+
for (let index = 0; index < options.providerArgs.length; index++) {
|
|
107
|
+
const arg = options.providerArgs[index];
|
|
108
|
+
// Go-style flag parsers may also accept a single dash for long options.
|
|
109
|
+
const flag = arg.startsWith("-") && !arg.startsWith("--") && arg.length > 2 ? `-${arg}` : arg;
|
|
110
|
+
if (arg === "--")
|
|
111
|
+
throw new Error("Antigravity provider argument terminator is not supported");
|
|
112
|
+
if ([
|
|
113
|
+
"-p",
|
|
114
|
+
"-i",
|
|
115
|
+
"--print",
|
|
116
|
+
"--prompt",
|
|
117
|
+
"--prompt-interactive",
|
|
118
|
+
"--model",
|
|
119
|
+
"--effort",
|
|
120
|
+
"--input-format",
|
|
121
|
+
"--output-format",
|
|
122
|
+
"--json-schema",
|
|
123
|
+
"--print-timeout",
|
|
124
|
+
"--log-file",
|
|
125
|
+
].includes(flag)) {
|
|
126
|
+
const value = options.providerArgs[++index];
|
|
127
|
+
if (value === undefined)
|
|
128
|
+
throw new Error(`Missing value for ${arg}`);
|
|
129
|
+
args.push(arg, value);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (flag === "--add-dir" || flag.startsWith("--add-dir=")) {
|
|
133
|
+
const dir = flag === "--add-dir" ? options.providerArgs[++index] : flag.slice("--add-dir=".length);
|
|
134
|
+
if (!dir || !roots.includes(canonicalRoot(resolve(options.cwd, dir)))) {
|
|
135
|
+
throw new Error(`Undeclared Antigravity workspace: ${dir ?? "(missing)"}`);
|
|
136
|
+
}
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (/^--(?:settings|dangerously-skip-permissions|mode|project|new-project|continue|conversation|agent)(?:=|$)/u.test(flag) ||
|
|
140
|
+
arg === "-c") {
|
|
141
|
+
throw new Error(`Antigravity session permissions cannot be overridden: ${arg}`);
|
|
142
|
+
}
|
|
143
|
+
if (!arg.startsWith("-")) {
|
|
144
|
+
throw new Error(`Use -p or -i for Antigravity prompts; unexpected argument: ${arg}`);
|
|
145
|
+
}
|
|
146
|
+
args.push(arg);
|
|
147
|
+
}
|
|
148
|
+
return [
|
|
149
|
+
...args,
|
|
150
|
+
...roots.flatMap((root) => ["--add-dir", root.replace(/\/$/u, "") || "/"]),
|
|
151
|
+
"--settings",
|
|
152
|
+
JSON.stringify(settings),
|
|
153
|
+
];
|
|
154
|
+
}
|
package/dist/exec/commands.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
+
import { Option } from "commander";
|
|
1
2
|
import { existsSync } from "node:fs";
|
|
2
3
|
import { join, resolve as pathResolve } from "node:path";
|
|
3
4
|
import { validateCatalogLocalIds, validateRulebookKata } from "../catalog/build.js";
|
|
4
|
-
import {
|
|
5
|
-
import { eventsDirForProject, generatedDirForProject } from "./project.js";
|
|
6
|
-
import { assertValidActor, getProjectViewpointsPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
7
|
-
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, selectNextTask, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
8
|
-
import { readReadySnapshot } from "./schedule/ready.js";
|
|
9
|
-
import { displayWidth, nowUtcIsoSeconds, padEndDisplay, requireNonEmpty } from "./shared.js";
|
|
10
|
-
import { archivePlan, buildInPlaceStem, generateDeliverablePlan, generateSinglePlan, resolveDeliverableTarget, stemFromPlanPath, } from "./plans.js";
|
|
5
|
+
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
11
6
|
import { runProviderScaffold, specdojoPackageRootDir } from "../shared/provider-scaffold.js";
|
|
7
|
+
import { assertValidActor, getProjectViewpointsPath, getProjectRoutinesPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
8
|
+
import { DEFAULT_EVENT_MESSAGES, KNOWN_OWNER_LABELS, KNOWN_OWNER_LABELS_TEXT, addCommonAddOptions, addForceOption, addLockOptions, addOwnerOptions, addProjectOptions, addTakeOverOption, ensureActorCanClaimNext, findRosterMember, loadRosterForOpts, loadValidatedExecState, parseApproach, parseTaskMode, printCommandError, resolveClaimOwner, resolveForceOverride, resolveProjectContext, resolveProjectId, resolveSchedulerStrategy, runLockedEventCommand, runReleaseAllBlocked, runSimpleEventCommand, scaffoldClaimResult, } from "./core.js";
|
|
9
|
+
import { acquireSchedulerLock, canBlockTask, canCancelTask, canClaimTask, canCompleteTask, canReleaseTask, canReopenTask, canUnblockTask, claimOwnerOf, computeReadyIds, readAllEventFiles, releaseSchedulerLock, schedulerLockPath, writeEventFile, } from "./events.js";
|
|
10
|
+
import { registerExecHandoffCommands } from "./handoff.js";
|
|
11
|
+
import { registerRecordMigrationCommand } from "./migrate-records.js";
|
|
12
|
+
import { archivePlan, buildInPlaceStem, generateDeliverablePlan, generateSinglePlan, resolveDeliverableTarget, stemFromPlanPath, } from "./plans.js";
|
|
13
|
+
import { eventsDirForProject, generatedDirForProject } from "./project.js";
|
|
12
14
|
import { generateRegisterPlan, normalizePjrId, resolveRegisterRunTarget } from "./register.js";
|
|
13
|
-
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
14
15
|
import { registerCycleCommand, registerResumeCommand, registerRunCommand, registerSlotsCommand, } from "./run/run.js";
|
|
16
|
+
import { readReadySnapshot } from "./schedule/ready.js";
|
|
17
|
+
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, selectNextTask, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
18
|
+
import { displayWidth, nowUtcIsoSeconds, padEndDisplay, requireNonEmpty } from "./shared.js";
|
|
19
|
+
import { resolveOwnerForLocalId } from "./strategy.js";
|
|
15
20
|
import { buildTaskView } from "./task-view.js";
|
|
16
|
-
import { registerExecWorktreeCommands } from "./worktree-command.js";
|
|
17
21
|
import { registerExecTrialCommands } from "./trial.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
22
|
+
import { registerExecWorktreeCommands } from "./worktree-command.js";
|
|
23
|
+
import { validateRunRecordLayout } from "./validate-records.js";
|
|
24
|
+
import { validateRunRecordLayoutAtCommit } from "./validate-records-commit.js";
|
|
21
25
|
export function registerExecCommands(program) {
|
|
22
26
|
const exec = program.command("exec").description("Execution helpers");
|
|
23
27
|
registerExecHandoffCommands(exec);
|
|
28
|
+
registerRecordMigrationCommand(exec);
|
|
24
29
|
const lockedActions = {
|
|
25
30
|
claim: {
|
|
26
31
|
type: "claim",
|
|
@@ -44,7 +49,10 @@ export function registerExecCommands(program) {
|
|
|
44
49
|
},
|
|
45
50
|
unblock: {
|
|
46
51
|
type: "unblock",
|
|
47
|
-
check: ({ schedule, snapshot }, taskId) => canUnblockTask(schedule, snapshot, taskId
|
|
52
|
+
check: ({ schedule, snapshot }, taskId, actor, opts) => canUnblockTask(schedule, snapshot, taskId, {
|
|
53
|
+
requested: !!opts.takeOver,
|
|
54
|
+
isHuman: findRosterMember(loadRosterForOpts(opts), actor)?.type === "human",
|
|
55
|
+
}),
|
|
48
56
|
},
|
|
49
57
|
release: {
|
|
50
58
|
type: "release",
|
|
@@ -79,6 +87,8 @@ export function registerExecCommands(program) {
|
|
|
79
87
|
addOwnerOptions(cmd);
|
|
80
88
|
if (t === "complete" || t === "block" || t === "release")
|
|
81
89
|
addForceOption(cmd);
|
|
90
|
+
if (t === "unblock")
|
|
91
|
+
addTakeOverOption(cmd);
|
|
82
92
|
if (t === "release") {
|
|
83
93
|
cmd.option("--reset-worktree", "Discard the task's exec worktree and branch after releasing (force removal)", false);
|
|
84
94
|
cmd.option("--all-blocked", "Release every blocked task in the project back to todo (ignores --task)", false);
|
|
@@ -97,13 +107,53 @@ export function registerExecCommands(program) {
|
|
|
97
107
|
cmd.action((opts) => runSimpleEventCommand(opts, t));
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
|
-
const vcmd = exec
|
|
110
|
+
const vcmd = exec
|
|
111
|
+
.command("validate")
|
|
112
|
+
.description("Validate schedule, events and run record layout");
|
|
101
113
|
addProjectOptions(vcmd);
|
|
114
|
+
vcmd.option("--records-only", "Check only run record layout and runtime lock exclusion", false);
|
|
115
|
+
vcmd.addOption(new Option("--schedule-only", "Check only schedule and events (used before running tasks)")
|
|
116
|
+
.default(false)
|
|
117
|
+
.conflicts("recordsOnly"));
|
|
118
|
+
vcmd.option("--commit <rev>", "With --records-only, check the run records in the tree of <rev> instead of the working tree");
|
|
102
119
|
vcmd.action((opts) => {
|
|
103
120
|
try {
|
|
104
|
-
const { schedulePath, catalogPath } = resolveProjectContext(opts);
|
|
121
|
+
const { schedulePath, catalogPath, executionPath } = resolveProjectContext(opts);
|
|
122
|
+
const { config } = loadConfig();
|
|
123
|
+
const project = config?.projects[resolveProjectId(opts)];
|
|
124
|
+
const routinesPath = project && getProjectRoutinesPath(project);
|
|
125
|
+
if (opts.commit !== undefined && !opts.recordsOnly)
|
|
126
|
+
throw new Error("--commit requires --records-only");
|
|
127
|
+
const layoutOptions = {
|
|
128
|
+
executionPath,
|
|
129
|
+
repoRoot: specdojoRootDir(),
|
|
130
|
+
...(routinesPath ? { routinesPath: pathResolve(specdojoRootDir(), routinesPath) } : {}),
|
|
131
|
+
};
|
|
132
|
+
const layoutIssues = opts.scheduleOnly
|
|
133
|
+
? []
|
|
134
|
+
: typeof opts.commit === "string"
|
|
135
|
+
? validateRunRecordLayoutAtCommit({ ...layoutOptions, commit: opts.commit })
|
|
136
|
+
: validateRunRecordLayout(layoutOptions);
|
|
137
|
+
if (opts.recordsOnly) {
|
|
138
|
+
for (const issue of layoutIssues)
|
|
139
|
+
process.stdout.write(`ERROR: ${issue.path}: [${issue.reason}] ${issue.message}\n`);
|
|
140
|
+
if (!layoutIssues.length)
|
|
141
|
+
process.stdout.write(`OK: run record layout validation passed${typeof opts.commit === "string" ? ` (${opts.commit})` : ""}\n`);
|
|
142
|
+
exitWithCode(layoutIssues.length === 0);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
105
145
|
const res = validateAll(schedulePath);
|
|
146
|
+
for (const issue of layoutIssues) {
|
|
147
|
+
const message = `${issue.path}: [${issue.reason}] ${issue.message}`;
|
|
148
|
+
if (issue.reason !== "missing")
|
|
149
|
+
res.errors.push(message);
|
|
150
|
+
}
|
|
151
|
+
res.ok = res.errors.length === 0;
|
|
106
152
|
printValidateResult(res);
|
|
153
|
+
for (const issue of layoutIssues) {
|
|
154
|
+
if (issue.reason === "missing")
|
|
155
|
+
process.stdout.write(`WARN: ${issue.path}: [${issue.reason}] ${issue.message}\n`);
|
|
156
|
+
}
|
|
107
157
|
// Scheduled tasks resolve their deliverable by bare local_id, so warn when a
|
|
108
158
|
// local_id is not unique project-wide across the catalogs.
|
|
109
159
|
if (catalogPath && existsSync(catalogPath)) {
|
|
@@ -239,12 +289,12 @@ export function registerExecCommands(program) {
|
|
|
239
289
|
});
|
|
240
290
|
const archiveCmd = exec
|
|
241
291
|
.command("archive")
|
|
242
|
-
.description("
|
|
292
|
+
.description("Keep a completed run plan in its run directory, or delete it");
|
|
243
293
|
addProjectOptions(archiveCmd);
|
|
244
294
|
archiveCmd.option("--task <taskId>", "Scheduled task ID whose plan to archive");
|
|
245
295
|
archiveCmd.option("--deliverable <localId>", "Catalog deliverable local_id (unique project-wide)");
|
|
246
296
|
archiveCmd.option("--plan <path>", "Plan file to archive (for unique-named in-place plans)");
|
|
247
|
-
archiveCmd.option("--delete", "Delete the plan instead of
|
|
297
|
+
archiveCmd.option("--delete", "Delete the plan instead of retaining it", false);
|
|
248
298
|
archiveCmd.action((opts) => {
|
|
249
299
|
try {
|
|
250
300
|
const { executionPath, catalogPath } = resolveProjectContext(opts);
|
|
@@ -254,8 +304,6 @@ export function registerExecCommands(program) {
|
|
|
254
304
|
if ([hasTask, hasDeliverable, hasPlan].filter(Boolean).length !== 1) {
|
|
255
305
|
throw new Error("Specify exactly one of --task, --deliverable, or --plan.");
|
|
256
306
|
}
|
|
257
|
-
// `archivePlan` rebuilds `<slug>-plan.md`; for --plan the stem recovered from the filename
|
|
258
|
-
// is that slug, so a unique-named in-place plan archives to done/ like a fixed-name one.
|
|
259
307
|
const slug = hasPlan
|
|
260
308
|
? stemFromPlanPath(opts.plan.trim())
|
|
261
309
|
: hasTask
|
|
@@ -508,7 +556,7 @@ export function registerExecCommands(program) {
|
|
|
508
556
|
const filterBy = typeof opts.by === "string" ? opts.by.trim() : undefined;
|
|
509
557
|
const entries = Object.entries(snapshot.tasks)
|
|
510
558
|
.filter(([, cs]) => cs.state === filterState)
|
|
511
|
-
.filter(([, cs]) => !filterBy || cs
|
|
559
|
+
.filter(([, cs]) => !filterBy || claimOwnerOf(cs) === filterBy)
|
|
512
560
|
.sort(([a], [b]) => a.localeCompare(b));
|
|
513
561
|
if (entries.length === 0) {
|
|
514
562
|
const byMsg = filterBy ? ` for ${filterBy}` : "";
|
|
@@ -521,7 +569,7 @@ export function registerExecCommands(program) {
|
|
|
521
569
|
const rows = entries.map(([taskId, cs]) => ({
|
|
522
570
|
taskId,
|
|
523
571
|
name: schedule.nodes.get(taskId)?.name ?? "-",
|
|
524
|
-
by: cs
|
|
572
|
+
by: claimOwnerOf(cs) ?? "-",
|
|
525
573
|
ts: cs.last_ts ?? "-",
|
|
526
574
|
}));
|
|
527
575
|
// Size every column to its longest value (including the header) so nothing is truncated.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { parentValidationLabels, recordedParentValidationLabel } from "./parent-validation.js";
|
|
2
|
+
import { recordedRunValidations } from "./pipeline-state.js";
|
|
3
|
+
// LEFTHOOK_EXCLUDE はコンマ区切りのため、hook のコマンド名にコンマや空白を許さない。
|
|
4
|
+
const HOOK_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
/** Validates `pipeline.commit_hook_skips` against the configured parent validations. */
|
|
9
|
+
export function resolveCommitHookSkips(value, parentValidationEntries) {
|
|
10
|
+
if (value === undefined)
|
|
11
|
+
return [];
|
|
12
|
+
if (!Array.isArray(value)) {
|
|
13
|
+
throw new Error("pipeline.commit_hook_skips in exec-defaults must be an array");
|
|
14
|
+
}
|
|
15
|
+
const labels = new Set(parentValidationLabels(parentValidationEntries));
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
return value.map((entry, index) => {
|
|
18
|
+
const where = `pipeline.commit_hook_skips[${index}] in exec-defaults`;
|
|
19
|
+
if (!isRecord(entry))
|
|
20
|
+
throw new Error(`${where} must be { hook, covered_by }`);
|
|
21
|
+
const unknownKeys = Object.keys(entry).filter((key) => key !== "hook" && key !== "covered_by");
|
|
22
|
+
if (unknownKeys.length > 0) {
|
|
23
|
+
throw new Error(`${where}: unknown key(s) ${unknownKeys.sort().join(", ")}`);
|
|
24
|
+
}
|
|
25
|
+
if (typeof entry.hook !== "string" || !HOOK_NAME_PATTERN.test(entry.hook)) {
|
|
26
|
+
throw new Error(`${where}.hook must match ${String(HOOK_NAME_PATTERN)}`);
|
|
27
|
+
}
|
|
28
|
+
if (seen.has(entry.hook))
|
|
29
|
+
throw new Error(`${where}: duplicate hook ${entry.hook}`);
|
|
30
|
+
seen.add(entry.hook);
|
|
31
|
+
const coveredBy = entry.covered_by;
|
|
32
|
+
if (!Array.isArray(coveredBy) ||
|
|
33
|
+
coveredBy.length === 0 ||
|
|
34
|
+
!coveredBy.every((label) => typeof label === "string")) {
|
|
35
|
+
throw new Error(`${where}.covered_by must be a non-empty array of parent validation ids`);
|
|
36
|
+
}
|
|
37
|
+
const unknownLabels = coveredBy.filter((label) => !labels.has(label));
|
|
38
|
+
if (unknownLabels.length > 0) {
|
|
39
|
+
throw new Error(`${where}.covered_by is not in pipeline.parent_validations: ${unknownLabels.join(", ")}`);
|
|
40
|
+
}
|
|
41
|
+
return { hook: entry.hook, covered_by: [...coveredBy] };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Hook commands the integration commit may skip: those whose every covering parent validation
|
|
46
|
+
* is recorded by the runner as `passed`. A validation skipped by change type (`not_applicable`)
|
|
47
|
+
* does not cover the hook, so the hook still runs when its own glob matches.
|
|
48
|
+
*/
|
|
49
|
+
export function integrationCommitHookExclusions(skips, validations) {
|
|
50
|
+
const passed = new Set(validations
|
|
51
|
+
.filter((validation) => validation.source === "runner" && validation.status === "passed")
|
|
52
|
+
.map(recordedParentValidationLabel));
|
|
53
|
+
return skips
|
|
54
|
+
.filter((skip) => skip.covered_by.every((label) => passed.has(label)))
|
|
55
|
+
.map((skip) => skip.hook);
|
|
56
|
+
}
|
|
57
|
+
/** Environment for the integration commit; merges with an inherited LEFTHOOK_EXCLUDE. */
|
|
58
|
+
export function lefthookExcludeEnvironment(hooks, inherited = process.env.LEFTHOOK_EXCLUDE) {
|
|
59
|
+
if (hooks.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
const names = [
|
|
62
|
+
...new Set([
|
|
63
|
+
...(inherited ?? "")
|
|
64
|
+
.split(",")
|
|
65
|
+
.map((name) => name.trim())
|
|
66
|
+
.filter(Boolean),
|
|
67
|
+
...hooks,
|
|
68
|
+
]),
|
|
69
|
+
];
|
|
70
|
+
return { LEFTHOOK_EXCLUDE: names.join(",") };
|
|
71
|
+
}
|
|
72
|
+
/** Hook commands to skip in a run's integration commit, from its recorded parent validations. */
|
|
73
|
+
export function integrationCommitSkipHooks(params) {
|
|
74
|
+
const skips = resolveCommitHookSkips(params.pipeline?.commit_hook_skips, params.pipeline?.parent_validations);
|
|
75
|
+
if (skips.length === 0)
|
|
76
|
+
return [];
|
|
77
|
+
return integrationCommitHookExclusions(skips, recordedRunValidations(params.worktreePath, params.pipelineStatePath));
|
|
78
|
+
}
|
package/dist/exec/core.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { acquireSchedulerLock, buildEvent, canReleaseTask, collectRepeatable, findDoingTasksForActor, foldEventsToState, readAllEventFiles, releaseSchedulerLock, writeEventFile, } from "./events.js";
|
|
2
|
-
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
3
1
|
import { assertValidActor, loadConfig, loadMemberRoster, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { qualifyTaskId, requireNonEmpty } from "./shared.js";
|
|
2
|
+
import { acquireSchedulerLock, buildEvent, canReleaseTask, collectRepeatable, findDoingTasksForActor, foldEventsToState, readAllEventFiles, releaseSchedulerLock, writeEventFile, } from "./events.js";
|
|
6
3
|
import { finalizeResultSectionsForDeliverable, targetDocIdsForScheduledTask } from "./plans.js";
|
|
4
|
+
import { activateResolvedProjectPaths, resolveProjectPaths } from "./project.js";
|
|
7
5
|
import { resetResultForClaim, scaffoldResult } from "./results.js";
|
|
8
|
-
import {
|
|
9
|
-
import { configuredProductRepos } from "./task-repos.js";
|
|
6
|
+
import { recordPathForRead, recordRef } from "./run-records.js";
|
|
10
7
|
import { buildInitialStateFromStrategy } from "./schedule/initial.js";
|
|
8
|
+
import { buildScheduleIndex, computeCpm, exitWithCode, printValidateResult, validateAll, writeCpmFiles, writeGeneratedCore, writeScheduleHashAndDiff, } from "./schedule/schedule.js";
|
|
9
|
+
import { qualifyTaskId, requireNonEmpty } from "./shared.js";
|
|
11
10
|
import { buildPhaseModeIndex, resolveApproach, resolveTaskExecution, resolveTaskMode, } from "./strategy.js";
|
|
11
|
+
import { configuredProductRepos } from "./task-repos.js";
|
|
12
|
+
import { discardStaleExecWorktree } from "./worktree-ops.js";
|
|
12
13
|
export const KNOWN_OWNER_LABELS = ["PO", "PM", "BA", "ARC", "DEV", "QE", "UX", "OPS"];
|
|
13
14
|
export const KNOWN_OWNER_LABELS_TEXT = KNOWN_OWNER_LABELS.join("|");
|
|
14
15
|
const KNOWN_APPROACHES = [
|
|
15
16
|
"draft",
|
|
16
17
|
"fully-guided",
|
|
18
|
+
"condense",
|
|
17
19
|
"recipe-guided",
|
|
18
20
|
"freeform",
|
|
19
21
|
"bootstrap",
|
|
@@ -58,6 +60,9 @@ export function addLockOptions(cmd) {
|
|
|
58
60
|
export function addForceOption(cmd) {
|
|
59
61
|
return cmd.option("--force", "Human actor only: override the guard on a task held by another actor", false);
|
|
60
62
|
}
|
|
63
|
+
export function addTakeOverOption(cmd) {
|
|
64
|
+
return cmd.option("--take-over", "Human actor only: become the claim owner instead of keeping the current owner (e.g. an agent run)", false);
|
|
65
|
+
}
|
|
61
66
|
export function addOwnerOptions(cmd) {
|
|
62
67
|
return cmd
|
|
63
68
|
.option("--owner <owner>", `Planned owner label for assignment checks (${KNOWN_OWNER_LABELS_TEXT}; defaults to SPECDOJO_OWNER, roster owner, or actor)`)
|
|
@@ -216,7 +221,11 @@ export async function scaffoldClaimResult(opts) {
|
|
|
216
221
|
taskId: opts.taskId,
|
|
217
222
|
mode,
|
|
218
223
|
projectId: opts.projectId,
|
|
219
|
-
...(execution === "agent"
|
|
224
|
+
...(execution === "agent"
|
|
225
|
+
? {
|
|
226
|
+
planRef: recordRef(opts.executionPath, recordPathForRead(opts.executionPath, "plan", opts.taskId)),
|
|
227
|
+
}
|
|
228
|
+
: {}),
|
|
220
229
|
agent: opts.actor,
|
|
221
230
|
startedAt: opts.startedAt,
|
|
222
231
|
execution,
|
|
@@ -304,6 +313,9 @@ export async function runLockedEventCommand(opts, action) {
|
|
|
304
313
|
event.meta.owner_override = true;
|
|
305
314
|
}
|
|
306
315
|
}
|
|
316
|
+
if (action.type === "unblock" && resolvedOpts.takeOver) {
|
|
317
|
+
event.meta = { ...(event.meta ?? {}), take_over: true };
|
|
318
|
+
}
|
|
307
319
|
if (opts.dryRun) {
|
|
308
320
|
process.stdout.write(`[dry-run] ${JSON.stringify(event, null, 2)}\n`);
|
|
309
321
|
if (action.type === "release" && opts.resetWorktree) {
|