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,9 +1,10 @@
|
|
|
1
|
+
import { isGradeDocument, isYamlDocument } from "../shared/document-metadata.js";
|
|
1
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import { buildScheduleIndex } from "../shared/schedule-index.js";
|
|
4
5
|
import { listFilesRecursive } from "../shared/fs.js";
|
|
5
6
|
import { gradeContentHash, gradeFindingCount, readGradeResultForDocument } from "./result.js";
|
|
6
|
-
import { KATA_DIRS, isRecord, legacyInlineContentHash,
|
|
7
|
+
import { KATA_DIRS, isRecord, legacyInlineContentHash, parseGradeDocument, } from "./core.js";
|
|
7
8
|
import { currentGradePipelineState, isIncompleteGradePipelineState, loadGradePipelineStates, } from "./pipeline-state.js";
|
|
8
9
|
import { comparisonSourceKeys, createGradeSourceContext, currentSourceHashes, dependencySourceKeys, gradedComparisonSources, isGeneratedGradeTarget, isTrashedGradeTarget, loadDeliverableCatalog, loadViewpointsIfConfigured, relativePathFromRoot, resolveProject, resolveSafeMarkdownPath, sourceHashesChanged, } from "./targets.js";
|
|
9
10
|
import { getProjectExecutionPath, specdojoRootDir } from "../shared/specdojo-config.js";
|
|
@@ -23,7 +24,7 @@ export function discoverGradeTargets(opts, rootDir = specdojoRootDir()) {
|
|
|
23
24
|
}
|
|
24
25
|
else if (opts.target === "kata") {
|
|
25
26
|
// 対象の列挙は利用リポジトリ限定。eject されていない kata は評価対象にしない。
|
|
26
|
-
candidates = KATA_DIRS.flatMap((dir) => listFilesRecursive(join(rootDir, "docs/ja/specdojo", dir)).filter((entry) => entry
|
|
27
|
+
candidates = KATA_DIRS.flatMap((dir) => listFilesRecursive(join(rootDir, "docs/ja/specdojo", dir)).filter((entry) => isGradeDocument(entry)));
|
|
27
28
|
}
|
|
28
29
|
else {
|
|
29
30
|
candidates = [...loadDeliverableCatalog(opts.project, rootDir).keys()];
|
|
@@ -31,6 +32,18 @@ export function discoverGradeTargets(opts, rootDir = specdojoRootDir()) {
|
|
|
31
32
|
const unique = [...new Set(candidates)]
|
|
32
33
|
.filter((path) => !isGeneratedGradeTarget(path, rootDir))
|
|
33
34
|
.filter((path) => !isTrashedGradeTarget(path, rootDir))
|
|
35
|
+
.filter((path) => {
|
|
36
|
+
if (!isYamlDocument(path))
|
|
37
|
+
return true;
|
|
38
|
+
try {
|
|
39
|
+
parseGradeDocument(readFileSync(path, "utf8"), relativePathFromRoot(path, rootDir));
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.warn(`grade: skipped ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
})
|
|
34
47
|
.sort();
|
|
35
48
|
if (!opts.changedOnly &&
|
|
36
49
|
!opts.dependencyChanged &&
|
|
@@ -94,7 +107,7 @@ export function discoverGradeTargets(opts, rootDir = specdojoRootDir()) {
|
|
|
94
107
|
return unique.filter((path) => {
|
|
95
108
|
const rel = relativePathFromRoot(path, rootDir);
|
|
96
109
|
const content = readFileSync(path, "utf8");
|
|
97
|
-
const document =
|
|
110
|
+
const document = parseGradeDocument(content, rel);
|
|
98
111
|
const pipelineState = currentGradePipelineState(document, rel, pipelineStates.get(rel), opts.target);
|
|
99
112
|
const result = readGradeResultForDocument({
|
|
100
113
|
documentPath: rel,
|
|
@@ -258,7 +271,7 @@ function matchesParsedGradeTargetFilters(document, path, filters, incomplete = f
|
|
|
258
271
|
}
|
|
259
272
|
export function matchesGradeTargetFilters(content, path, filters, pipelineState) {
|
|
260
273
|
validateGradeTargetFilters(filters);
|
|
261
|
-
const document =
|
|
274
|
+
const document = parseGradeDocument(content, path);
|
|
262
275
|
const currentState = currentGradePipelineState(document, path, pipelineState);
|
|
263
276
|
return matchesParsedGradeTargetFilters(document, path, filters, isIncompleteGradePipelineState(currentState));
|
|
264
277
|
}
|
package/dist/grade/targets.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isGradeDocument, isYamlDocument } from "../shared/document-metadata.js";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
3
4
|
import { dirname, extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -6,7 +7,7 @@ import { collectResolvedDeliverables, loadCatalogDocs } from "../catalog/build.j
|
|
|
6
7
|
import { isTrashedPath, resolveBasePath } from "../catalog/paths.js";
|
|
7
8
|
import { listFilesRecursive } from "../shared/fs.js";
|
|
8
9
|
import { gradeContentHash } from "./result.js";
|
|
9
|
-
import { GRADE_TARGETS, KATA_DIRS, KATA_REFERENCE_EXTENSIONS, KATA_REFERENCE_FIELDS, gradedViewpoints, isRecord,
|
|
10
|
+
import { GRADE_TARGETS, KATA_DIRS, KATA_REFERENCE_EXTENSIONS, KATA_REFERENCE_FIELDS, gradedViewpoints, isRecord, parseGradeDocument, } from "./core.js";
|
|
10
11
|
import { commonViewpointsPath, resolveViewpointsDoc } from "../review/plan.js";
|
|
11
12
|
import { assertValidActor, getProjectCatalogPath, getProjectMembersPath, getProjectRolesPath, getProjectSchedulePath, getProjectViewpointsPath, loadConfig, resolveAgentMember, resolveRepoRoot, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
12
13
|
export function resolveProject(projectOption) {
|
|
@@ -83,8 +84,8 @@ function parseKataReference(path, kind) {
|
|
|
83
84
|
try {
|
|
84
85
|
const extension = extname(path).toLowerCase();
|
|
85
86
|
let metadata;
|
|
86
|
-
if (extension === ".md") {
|
|
87
|
-
metadata =
|
|
87
|
+
if (extension === ".md" || isYamlDocument(path)) {
|
|
88
|
+
metadata = parseGradeDocument(readFileSync(path, "utf8"), repoRelativePath(path)).data
|
|
88
89
|
.specdojo;
|
|
89
90
|
}
|
|
90
91
|
else {
|
|
@@ -125,7 +126,7 @@ export function loadKataReferences() {
|
|
|
125
126
|
}
|
|
126
127
|
export function resolveGradeReferencePathsFromCatalog(path, catalog, project) {
|
|
127
128
|
const target = resolveSafeMarkdownPath(path, specdojoRootDir(), project);
|
|
128
|
-
const targetDocument =
|
|
129
|
+
const targetDocument = parseGradeDocument(readFileSync(target, "utf8"), repoRelativePath(target));
|
|
129
130
|
const targetMetadata = targetDocument.data.specdojo;
|
|
130
131
|
const targetId = typeof targetMetadata.id === "string" ? targetMetadata.id.trim() : "";
|
|
131
132
|
if (!targetId)
|
|
@@ -172,7 +173,7 @@ function gradeReferenceExampleFamily(target, path, metadata) {
|
|
|
172
173
|
export function parseGradeReferenceExample(path, target, project) {
|
|
173
174
|
try {
|
|
174
175
|
const absolute = resolveSafeMarkdownPath(path, specdojoRootDir(), project);
|
|
175
|
-
const document =
|
|
176
|
+
const document = parseGradeDocument(readFileSync(absolute, "utf8"), repoRelativePath(absolute));
|
|
176
177
|
const metadata = document.data.specdojo;
|
|
177
178
|
return {
|
|
178
179
|
path: absolute,
|
|
@@ -186,7 +187,7 @@ export function parseGradeReferenceExample(path, target, project) {
|
|
|
186
187
|
}
|
|
187
188
|
export function selectGradeReferenceExampleFromCatalog(opts) {
|
|
188
189
|
const target = resolveSafeMarkdownPath(opts.path, specdojoRootDir(), opts.project);
|
|
189
|
-
const targetDocument =
|
|
190
|
+
const targetDocument = parseGradeDocument(readFileSync(target, "utf8"), repoRelativePath(target));
|
|
190
191
|
const targetMetadata = targetDocument.data.specdojo;
|
|
191
192
|
const family = gradeReferenceExampleFamily(opts.target, target, targetMetadata);
|
|
192
193
|
if (!family)
|
|
@@ -233,8 +234,8 @@ export function resolveSafeMarkdownPath(input, root = specdojoRootDir(), project
|
|
|
233
234
|
}
|
|
234
235
|
if (!roots.some((base) => inside(base, absolute)))
|
|
235
236
|
throw new Error(`Path is outside repository or declared project.repos: ${input}`);
|
|
236
|
-
if (
|
|
237
|
-
throw new Error(`${input}: grade
|
|
237
|
+
if (!isGradeDocument(absolute)) {
|
|
238
|
+
throw new Error(`${input}: grade supports Markdown and YAML documents`);
|
|
238
239
|
}
|
|
239
240
|
if (!existsSync(absolute))
|
|
240
241
|
throw new Error(`Document not found: ${input}`);
|
|
@@ -266,7 +267,7 @@ export function isTrashedGradeTarget(path, rootDir = specdojoRootDir()) {
|
|
|
266
267
|
function criterionId(index) {
|
|
267
268
|
return `DC-${String(index + 1).padStart(3, "0")}`;
|
|
268
269
|
}
|
|
269
|
-
//
|
|
270
|
+
// カタログの評価可能な成果物を絶対パスで引ける形にする。grade の対象探索と
|
|
270
271
|
// done_criteria の解決が同じ集合を見るよう、両者はこの関数を共有する。
|
|
271
272
|
export function loadDeliverableCatalog(projectOption, root = specdojoRootDir()) {
|
|
272
273
|
const { project } = resolveProject(projectOption);
|
|
@@ -280,7 +281,7 @@ export function loadDeliverableCatalog(projectOption, root = specdojoRootDir())
|
|
|
280
281
|
for (const item of resolved) {
|
|
281
282
|
if (item.item.kind === "generated" || !item.item.path)
|
|
282
283
|
continue;
|
|
283
|
-
if (!item.resolvedPath
|
|
284
|
+
if (!isGradeDocument(item.resolvedPath))
|
|
284
285
|
continue;
|
|
285
286
|
if (isTrashedPath(item.resolvedPath))
|
|
286
287
|
continue;
|
|
@@ -447,7 +448,7 @@ export function gradeSourceHashes(documentPath, document, viewpoints, target, co
|
|
|
447
448
|
/** Current hashes of the comparison sources and dependencies that grade apply records for a document. */
|
|
448
449
|
export function resolveGradeSourceHashes(opts, rootDir = specdojoRootDir()) {
|
|
449
450
|
const absolute = resolveSafeMarkdownPath(opts.path, rootDir, opts.project);
|
|
450
|
-
const document =
|
|
451
|
+
const document = parseGradeDocument(readFileSync(absolute, "utf8"), relativePathFromRoot(absolute, rootDir));
|
|
451
452
|
const viewpoints = opts.viewpoints ?? loadViewpointsIfConfigured(opts.project, rootDir);
|
|
452
453
|
return gradeSourceHashes(absolute, document, viewpoints, opts.target, createGradeSourceContext(opts.project, rootDir));
|
|
453
454
|
}
|
package/dist/job/job.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join, relative, resolve } from "node:path";
|
|
5
5
|
import { buildSpecdojoFrontmatter } from "../docs/frontmatter-namespace.js";
|
|
6
|
+
import { recordRef, taskRecordPaths } from "../shared/run-records.js";
|
|
6
7
|
import { listFilesRecursive, writeJson } from "../shared/fs.js";
|
|
7
8
|
import { gitEnvironment } from "../shared/git.js";
|
|
8
9
|
import { formatMarkdownFile } from "../shared/markdown-format.js";
|
|
9
10
|
import { execTemplatePath, injectCommonConventions, MISSING } from "../shared/plan-templates.js";
|
|
10
|
-
import { expandTemplate } from "../shared/text.js";
|
|
11
|
-
import { isJobAgentTask, isJobCommandTask, getPath, loadAllJobs, loadJobDefinition, loadJobRunRecord, parseInputValue, parseJobInputs, renderJobTemplate, resolveJobPaths, validateJobInputValue, } from "./definition.js";
|
|
12
|
-
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
13
11
|
import { selfRunCommand } from "../shared/spawn-self.js";
|
|
12
|
+
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
13
|
+
import { expandTemplate } from "../shared/text.js";
|
|
14
|
+
import { getPath, isJobAgentTask, isJobCommandTask, loadAllJobs, loadJobDefinition, loadJobRunRecord, parseInputValue, parseJobInputs, renderJobTemplate, resolveJobPaths, validateJobInputValue, } from "./definition.js";
|
|
15
|
+
import { jobNoopDirectory, localJobNoopPath } from "./noop.js";
|
|
14
16
|
export { isJobAgentTask, isJobCommandTask, jobDeclaresReview, jobRunUsesReviewedIntegration, loadAllJobs, loadJobDefinition, loadJobRunRecord, parseJobDefinition, parseJobInputs, renderJobTemplate, resolveJobPaths, resolveJobReviewAgentNominations, } from "./definition.js";
|
|
15
17
|
export function jobCheckpoint(paths, jobId) {
|
|
16
18
|
return deriveJobState(paths).jobs[jobId]?.checkpoint ?? {};
|
|
17
19
|
}
|
|
18
20
|
export function deriveJobState(paths) {
|
|
19
21
|
const state = { version: 1, jobs: {} };
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
for (const filePath of [
|
|
23
|
+
...listFilesRecursive(paths.runsPath),
|
|
24
|
+
...listFilesRecursive(jobNoopDirectory(paths.executionPath)),
|
|
25
|
+
]
|
|
23
26
|
.filter((path) => path.endsWith(".json"))
|
|
24
27
|
.sort()) {
|
|
25
28
|
try {
|
|
@@ -230,7 +233,7 @@ export async function generateJobPlan(paths, definition, record) {
|
|
|
230
233
|
const templatePath = execTemplatePath("xep-job-template.md");
|
|
231
234
|
if (!existsSync(templatePath))
|
|
232
235
|
throw new Error(`Template not found: ${templatePath}`);
|
|
233
|
-
const planPath =
|
|
236
|
+
const planPath = taskRecordPaths(paths.executionPath, record.run_id, record.run_id, "job").plan;
|
|
234
237
|
mkdirSync(resolve(planPath, ".."), { recursive: true });
|
|
235
238
|
const commandTask = isJobCommandTask(record.task) ? record.task : undefined;
|
|
236
239
|
const values = {
|
|
@@ -263,10 +266,13 @@ export async function generateJobPlan(paths, definition, record) {
|
|
|
263
266
|
_JOB_INPUTS_: JSON.stringify(record.inputs, null, 2),
|
|
264
267
|
_JOB_TARGETS_: record.task.targets?.map((target) => `- [[${target}]]`).join("\n") ?? "- -",
|
|
265
268
|
_JOB_PATHS_: record.task.paths?.map((path) => `- \`${path}\``).join("\n") ?? "- -",
|
|
266
|
-
_RESULT_REF_: repoRelative(
|
|
269
|
+
_RESULT_REF_: repoRelative(taskRecordPaths(paths.executionPath, record.run_id, record.run_id, "job").result),
|
|
267
270
|
};
|
|
268
271
|
const body = expandTemplate(readFileSync(templatePath, "utf8"), values);
|
|
269
|
-
const content = injectCommonConventions(body, MISSING, new Map()
|
|
272
|
+
const content = injectCommonConventions(body, MISSING, new Map(), "edit", {
|
|
273
|
+
executionPath: paths.executionPath,
|
|
274
|
+
planPath,
|
|
275
|
+
});
|
|
270
276
|
writeFileSync(planPath, content, "utf8");
|
|
271
277
|
await formatMarkdownFile(planPath);
|
|
272
278
|
return planPath;
|
|
@@ -290,8 +296,7 @@ export async function generateJobReviewPlan(paths, definition, record, opts) {
|
|
|
290
296
|
const templatePath = execTemplatePath("xrp-job-template.md");
|
|
291
297
|
if (!existsSync(templatePath))
|
|
292
298
|
throw new Error(`Template not found: ${templatePath}`);
|
|
293
|
-
const planPath =
|
|
294
|
-
const resultPath = join(paths.executionPath, "exec", "results", `${record.run_id}-review-result.md`);
|
|
299
|
+
const { plan: planPath, result: resultPath } = taskRecordPaths(paths.executionPath, record.run_id, `${record.run_id}-review`, "job");
|
|
295
300
|
mkdirSync(resolve(planPath, ".."), { recursive: true });
|
|
296
301
|
const values = {
|
|
297
302
|
_FRONTMATTER_: jobReviewPlanFrontmatter(paths.projectId, definition, record),
|
|
@@ -310,7 +315,10 @@ export async function generateJobReviewPlan(paths, definition, record, opts) {
|
|
|
310
315
|
_RUN_RESULT_REF_: repoRelative(join(paths.executionPath, record.result_ref)),
|
|
311
316
|
};
|
|
312
317
|
const body = expandTemplate(readFileSync(templatePath, "utf8"), values);
|
|
313
|
-
const content = injectCommonConventions(body, MISSING, new Map(), "review"
|
|
318
|
+
const content = injectCommonConventions(body, MISSING, new Map(), "review", {
|
|
319
|
+
executionPath: paths.executionPath,
|
|
320
|
+
planPath,
|
|
321
|
+
});
|
|
314
322
|
writeFileSync(planPath, content, "utf8");
|
|
315
323
|
await formatMarkdownFile(planPath);
|
|
316
324
|
return { planPath, resultPath };
|
|
@@ -374,10 +382,11 @@ export async function materializeJobRun(opts) {
|
|
|
374
382
|
task.description = renderJobTemplate(task.description, context);
|
|
375
383
|
}
|
|
376
384
|
const now = new Date().toISOString();
|
|
377
|
-
const
|
|
385
|
+
const localNoop = localJobNoopPath(paths.executionPath, runId);
|
|
386
|
+
const existingRun = existsSync(localNoop) || existsSync(runPath);
|
|
378
387
|
let record;
|
|
379
388
|
if (existingRun) {
|
|
380
|
-
record = loadJobRunRecord(runPath);
|
|
389
|
+
record = loadJobRunRecord(existsSync(localNoop) ? localNoop : runPath);
|
|
381
390
|
if (record.idempotency_key !== idempotencyKey || record.job_id !== definition.id) {
|
|
382
391
|
throw new Error(`Job Run identity collision: ${runId}`);
|
|
383
392
|
}
|
|
@@ -406,11 +415,16 @@ export async function materializeJobRun(opts) {
|
|
|
406
415
|
inputs,
|
|
407
416
|
task,
|
|
408
417
|
checkpoint_before: checkpoint,
|
|
409
|
-
plan_ref:
|
|
410
|
-
result_ref:
|
|
418
|
+
plan_ref: recordRef(paths.executionPath, taskRecordPaths(paths.executionPath, runId, runId, "job").plan),
|
|
419
|
+
result_ref: recordRef(paths.executionPath, taskRecordPaths(paths.executionPath, runId, runId, "job").result),
|
|
411
420
|
attempts: [],
|
|
412
421
|
};
|
|
413
422
|
}
|
|
423
|
+
record = {
|
|
424
|
+
...record,
|
|
425
|
+
plan_ref: recordRef(paths.executionPath, taskRecordPaths(paths.executionPath, runId, runId, "job").plan),
|
|
426
|
+
result_ref: recordRef(paths.executionPath, taskRecordPaths(paths.executionPath, runId, runId, "job").result),
|
|
427
|
+
};
|
|
414
428
|
if (!existingRun && !opts.dryRun && isJobCommandTask(task) && task.precondition) {
|
|
415
429
|
const precondition = await executeJobPrecondition(task.precondition, specdojoRootDir());
|
|
416
430
|
if (precondition.skipped) {
|
package/dist/job/noop.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, rmSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
4
|
+
import { gitOutput, gitResult, worktreeStatusPaths } from "../shared/git.js";
|
|
5
|
+
import { listFilesRecursive, writeJson } from "../shared/fs.js";
|
|
6
|
+
import { localStateDirectory } from "../shared/local-state.js";
|
|
7
|
+
import { listRunRecords, planConventionsDirectory, runItemDirectory, } from "../shared/run-records.js";
|
|
8
|
+
import { planConventionsFiles } from "../shared/plan-conventions.js";
|
|
9
|
+
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
10
|
+
export function jobNoopDirectory(executionPath, repoRoot = specdojoRootDir()) {
|
|
11
|
+
const key = createHash("sha256").update(relative(repoRoot, executionPath)).digest("hex");
|
|
12
|
+
return join(localStateDirectory(repoRoot), "jobs", key, "noops");
|
|
13
|
+
}
|
|
14
|
+
export function localJobNoopPath(executionPath, runId, repoRoot = specdojoRootDir()) {
|
|
15
|
+
return join(jobNoopDirectory(executionPath, repoRoot), `${runId}.json`);
|
|
16
|
+
}
|
|
17
|
+
function fingerprint(file) {
|
|
18
|
+
if (!existsSync(file))
|
|
19
|
+
return "missing";
|
|
20
|
+
const stat = lstatSync(file);
|
|
21
|
+
const value = stat.isSymbolicLink()
|
|
22
|
+
? readlinkSync(file)
|
|
23
|
+
: stat.isFile()
|
|
24
|
+
? readFileSync(file)
|
|
25
|
+
: "directory";
|
|
26
|
+
return `${stat.mode}:${createHash("sha256").update(value).digest("hex")}`;
|
|
27
|
+
}
|
|
28
|
+
/** Only this Run's bookkeeping is excluded; nested exec events and grade results are output. */
|
|
29
|
+
export function jobBookkeepingPaths(executionPath, record) {
|
|
30
|
+
const directory = runItemDirectory(executionPath, "job", record.run_id);
|
|
31
|
+
const paths = [
|
|
32
|
+
...new Set([
|
|
33
|
+
join(executionPath, "jobs", "runs", `${record.run_id}.json`),
|
|
34
|
+
directory,
|
|
35
|
+
join(executionPath, record.plan_ref),
|
|
36
|
+
join(executionPath, record.result_ref),
|
|
37
|
+
]),
|
|
38
|
+
];
|
|
39
|
+
return paths.filter((file) => !paths.some((parent) => file !== parent && file.startsWith(`${parent}${sep}`)));
|
|
40
|
+
}
|
|
41
|
+
export function snapshotJobOutput(repoRoot, executionPath, record) {
|
|
42
|
+
const artifacts = jobBookkeepingPaths(executionPath, record);
|
|
43
|
+
const conventionsDirectory = planConventionsDirectory(executionPath);
|
|
44
|
+
const previousVersions = new Set(existsSync(conventionsDirectory) ? readdirSync(conventionsDirectory) : []);
|
|
45
|
+
const ignored = artifacts.map((file) => relative(repoRoot, file).split(sep).join("/"));
|
|
46
|
+
ignored.push(relative(repoRoot, conventionsDirectory).split(sep).join("/"), relative(repoRoot, join(executionPath, "exec", ".locks"))
|
|
47
|
+
.split(sep)
|
|
48
|
+
.join("/"));
|
|
49
|
+
const substantive = (file) => !ignored.some((item) => file === item || file.startsWith(`${item}/`)) &&
|
|
50
|
+
!file.split("/").includes("generated");
|
|
51
|
+
const changes = new Map(worktreeStatusPaths(repoRoot)
|
|
52
|
+
.filter(substantive)
|
|
53
|
+
.map((file) => [file, fingerprint(join(repoRoot, file))]));
|
|
54
|
+
const previous = new Map();
|
|
55
|
+
for (const file of artifacts.flatMap((item) => existsSync(item) && lstatSync(item).isDirectory() ? listFilesRecursive(item) : [item])) {
|
|
56
|
+
if (existsSync(file))
|
|
57
|
+
previous.set(file, readFileSync(file));
|
|
58
|
+
}
|
|
59
|
+
// An initialized repository need not have its first commit yet.
|
|
60
|
+
const headResult = gitResult(repoRoot, ["rev-parse", "--verify", "HEAD"]);
|
|
61
|
+
const head = headResult.status === 0 ? String(headResult.stdout).trim() : undefined;
|
|
62
|
+
return {
|
|
63
|
+
hasChanges() {
|
|
64
|
+
const after = new Map(worktreeStatusPaths(repoRoot)
|
|
65
|
+
.filter(substantive)
|
|
66
|
+
.map((file) => [file, fingerprint(join(repoRoot, file))]));
|
|
67
|
+
if ([...new Set([...changes.keys(), ...after.keys()])].some((file) => changes.get(file) !== after.get(file)))
|
|
68
|
+
return true;
|
|
69
|
+
return (!!head &&
|
|
70
|
+
gitOutput(repoRoot, ["diff", "--name-only", "-z", head, "HEAD", "--"])
|
|
71
|
+
.split("\0")
|
|
72
|
+
.filter(Boolean)
|
|
73
|
+
.some(substantive));
|
|
74
|
+
},
|
|
75
|
+
discard(record) {
|
|
76
|
+
// Keep idempotency and checkpoints locally even though no Run artifacts enter Git.
|
|
77
|
+
const local = localJobNoopPath(executionPath, record.run_id, repoRoot);
|
|
78
|
+
mkdirSync(dirname(local), { recursive: true });
|
|
79
|
+
const noop = {
|
|
80
|
+
...record,
|
|
81
|
+
state: "noop",
|
|
82
|
+
attempts: record.attempts.map((attempt, index) => index === record.attempts.length - 1 ? { ...attempt, status: "noop" } : attempt),
|
|
83
|
+
};
|
|
84
|
+
writeJson(local, noop);
|
|
85
|
+
const versions = existsSync(join(executionPath, record.plan_ref))
|
|
86
|
+
? planConventionsFiles(readFileSync(join(executionPath, record.plan_ref), "utf8"), dirname(join(executionPath, record.plan_ref)))
|
|
87
|
+
: [];
|
|
88
|
+
for (const file of artifacts)
|
|
89
|
+
rmSync(file, { recursive: true, force: true });
|
|
90
|
+
for (const [file, content] of previous) {
|
|
91
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
92
|
+
writeFileSync(file, content);
|
|
93
|
+
}
|
|
94
|
+
// Remove only snapshots introduced by this discarded Run. Preserve versions
|
|
95
|
+
// referenced by retained plans, including completed plans.
|
|
96
|
+
const retained = new Set(listRunRecords(executionPath, "plan").flatMap((plan) => planConventionsFiles(readFileSync(plan, "utf8"), dirname(plan))));
|
|
97
|
+
for (const version of versions) {
|
|
98
|
+
if (!previousVersions.has(version.slice(conventionsDirectory.length + 1)) &&
|
|
99
|
+
!retained.has(version))
|
|
100
|
+
rmSync(version);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
package/dist/register/core.js
CHANGED
|
@@ -372,10 +372,12 @@ export function buildRegisterItemContent(opts) {
|
|
|
372
372
|
description: opts.fields.description,
|
|
373
373
|
type: opts.fields.type,
|
|
374
374
|
...(opts.fields.track ? { track: opts.fields.track } : {}),
|
|
375
|
+
...(opts.fields.domains !== undefined ? { domains: opts.fields.domains } : {}),
|
|
375
376
|
priority: opts.fields.priority,
|
|
376
377
|
...(opts.fields.difficulty ? { difficulty: opts.fields.difficulty } : {}),
|
|
377
378
|
owner: opts.fields.owner,
|
|
378
379
|
registeredAt: opts.fields.registeredAt,
|
|
380
|
+
...(opts.fields.startOn !== undefined ? { startOn: opts.fields.startOn } : {}),
|
|
379
381
|
due: opts.fields.due,
|
|
380
382
|
completedAt: opts.fields.completedAt,
|
|
381
383
|
conclusion: opts.fields.conclusion,
|
|
@@ -11,7 +11,7 @@ import { validateRegisterApproachTargetsForProject } from "./approach.js";
|
|
|
11
11
|
import { normalizeDependsOn, validateRegisterDependencies } from "./dependency.js";
|
|
12
12
|
import { normalizeDerivedFrom, validateDerivedFrom } from "./derivation.js";
|
|
13
13
|
import { delegateExternalRegisterAdd } from "./external-project.js";
|
|
14
|
-
import { validateRegisterTrack } from "./epic.js";
|
|
14
|
+
import { validateRegisterDomains, validateRegisterStartOn, validateRegisterTrack } from "./epic.js";
|
|
15
15
|
import { isAuthoringApproach } from "../kata/authoring.js";
|
|
16
16
|
function collectTarget(value, previous = []) {
|
|
17
17
|
return [...previous, value];
|
|
@@ -76,6 +76,7 @@ export function registerCreateCommands(reg, dependencies) {
|
|
|
76
76
|
addProjectOption(addCmd);
|
|
77
77
|
addCmd.requiredOption("--type <type>", `Item type: ${VALID_TYPES.join(" | ")}`);
|
|
78
78
|
addCmd.option("--track <track>", "Track governed by an epic (required for epic)");
|
|
79
|
+
addCmd.option("--domain <domain>", "Catalog domain governed by an epic (repeatable)", collectTarget);
|
|
79
80
|
addCmd.requiredOption("--title <title>", "Short title for the item");
|
|
80
81
|
addCmd.option("--input <text>", "Premise recorded in the ticket (repeatable)", collectTarget);
|
|
81
82
|
addCmd.option("--description <text>", "Description shown in the list", "_TODO_");
|
|
@@ -85,6 +86,7 @@ export function registerCreateCommands(reg, dependencies) {
|
|
|
85
86
|
addCmd.option("--owner <owner>", "Owner or role", "_TODO_");
|
|
86
87
|
addCmd.option("--registered <datetime>", "Registration date-time (RFC 3339 with time zone, or _TODO_; defaults to now in UTC)");
|
|
87
88
|
addCmd.option("--due <date>", "Due date (YYYY-MM-DD, -, or _TODO_)", "_TODO_");
|
|
89
|
+
addCmd.option("--start-on <date>", "Planned epic start date (YYYY-MM-DD; - omits)");
|
|
88
90
|
addCmd.option("--completed <datetime>", "Completion date-time (RFC 3339 with time zone, or -)", "-");
|
|
89
91
|
addCmd.option("--conclusion <text>", "Conclusion or resolution summary", "-");
|
|
90
92
|
addCmd.option("--target-path <path>", "Repository-relative deliverable file path");
|
|
@@ -156,8 +158,12 @@ export function registerCreateCommands(reg, dependencies) {
|
|
|
156
158
|
validateTargetsWithoutApproach: opts.target !== undefined || opts.source !== undefined,
|
|
157
159
|
});
|
|
158
160
|
const track = opts.track?.trim();
|
|
161
|
+
validateRegisterStartOn(opts.type, opts.startOn, true);
|
|
159
162
|
validateRegisterTrack(paths.projectId, opts.type, track);
|
|
163
|
+
const domains = opts.domain?.map((value) => value.trim());
|
|
164
|
+
validateRegisterDomains(opts.type, domains);
|
|
160
165
|
const fields = {
|
|
166
|
+
...(domains !== undefined ? { domains } : {}),
|
|
161
167
|
...(track !== undefined ? { track } : {}),
|
|
162
168
|
type: opts.type,
|
|
163
169
|
title: opts.title,
|
|
@@ -168,6 +174,7 @@ export function registerCreateCommands(reg, dependencies) {
|
|
|
168
174
|
status: opts.status,
|
|
169
175
|
owner: opts.owner,
|
|
170
176
|
registeredAt: registeredAt ?? nowUtcTimestamp(),
|
|
177
|
+
...(opts.startOn !== undefined && opts.startOn !== "-" ? { startOn: opts.startOn } : {}),
|
|
171
178
|
due: opts.due,
|
|
172
179
|
completedAt: completedAt ?? CELL_NONE,
|
|
173
180
|
conclusion: opts.conclusion,
|
|
@@ -258,12 +265,14 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
258
265
|
addProjectOption(updateCmd);
|
|
259
266
|
updateCmd.requiredOption("--id <id>", "Item ID (PJR-XXXX)");
|
|
260
267
|
updateCmd.option("--track <track>", "Replace the track governed by an epic");
|
|
268
|
+
updateCmd.option("--domain <domain>", "Replace epic domains (repeatable; - removes)", collectTarget);
|
|
261
269
|
updateCmd.option("--title <title>", "Update title");
|
|
262
270
|
updateCmd.option("--description <text>", "Update description");
|
|
263
271
|
updateCmd.option("--priority <priority>", `Update priority: ${VALID_PRIORITIES.join(" | ")}`);
|
|
264
272
|
updateCmd.option("--difficulty <difficulty>", `Update difficulty: ${VALID_DIFFICULTIES.join(" | ")}; use - to remove`);
|
|
265
273
|
updateCmd.option("--owner <owner>", "Update owner or role");
|
|
266
274
|
updateCmd.option("--due <date>", "Update due date (YYYY-MM-DD, -, or _TODO_)");
|
|
275
|
+
updateCmd.option("--start-on <date>", "Update planned epic start date (YYYY-MM-DD; - removes)");
|
|
267
276
|
updateCmd.option("--conclusion <text>", "Update conclusion or use - to remove it");
|
|
268
277
|
updateCmd.option("--block-reason <text>", "Update the waiting reason or use - to remove it");
|
|
269
278
|
updateCmd.option("--autopilot <approval>", "Night orchestrator approval: approved, or - to revoke");
|
|
@@ -289,12 +298,14 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
289
298
|
const item = view.item;
|
|
290
299
|
const hasUpdates = [
|
|
291
300
|
"track",
|
|
301
|
+
"domain",
|
|
292
302
|
"title",
|
|
293
303
|
"description",
|
|
294
304
|
"priority",
|
|
295
305
|
"difficulty",
|
|
296
306
|
"owner",
|
|
297
307
|
"due",
|
|
308
|
+
"startOn",
|
|
298
309
|
"conclusion",
|
|
299
310
|
"blockReason",
|
|
300
311
|
"autopilot",
|
|
@@ -311,7 +322,7 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
311
322
|
"topic",
|
|
312
323
|
].some((key) => opts[key] !== undefined);
|
|
313
324
|
if (!hasUpdates) {
|
|
314
|
-
throw new Error("At least one field option must be specified (--track, --title, --description, --priority, --difficulty, --owner, --due, --conclusion, --block-reason, --autopilot, --approach, --target, --source, --input, --from, --depends-on, --commit-type, --commit-scope, --topic)");
|
|
325
|
+
throw new Error("At least one field option must be specified (--track, --domain, --title, --description, --priority, --difficulty, --owner, --due, --start-on, --conclusion, --block-reason, --autopilot, --approach, --target, --source, --input, --from, --depends-on, --commit-type, --commit-scope, --topic)");
|
|
315
326
|
}
|
|
316
327
|
if (opts.priority !== undefined &&
|
|
317
328
|
!VALID_PRIORITIES.includes(opts.priority)) {
|
|
@@ -432,6 +443,9 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
432
443
|
(authoring && opts.source !== undefined && (item.targets?.length ?? 0) > 1);
|
|
433
444
|
const shouldUpdateSources = opts.source !== undefined || (authoring && providedLegacySources.length > 0);
|
|
434
445
|
const approachTargetUpdates = {
|
|
446
|
+
...(opts.startOn !== undefined
|
|
447
|
+
? { start_on: opts.startOn === "-" ? REMOVE_REGISTER_ITEM_FIELD : opts.startOn }
|
|
448
|
+
: {}),
|
|
435
449
|
...(opts.dependsOn !== undefined
|
|
436
450
|
? { depends_on: nextDependsOn ?? REMOVE_REGISTER_ITEM_FIELD }
|
|
437
451
|
: {}),
|
|
@@ -478,10 +492,21 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
478
492
|
: {}),
|
|
479
493
|
};
|
|
480
494
|
const track = opts.track === undefined ? item.track : opts.track.trim();
|
|
481
|
-
|
|
495
|
+
validateRegisterStartOn(item.type, opts.startOn, true);
|
|
496
|
+
validateRegisterTrack(paths.projectId, item.type, track, item.id);
|
|
497
|
+
const domains = opts.domain?.map((value) => value.trim());
|
|
498
|
+
const removeDomains = domains?.length === 1 && domains[0] === "-";
|
|
499
|
+
if (domains !== undefined) {
|
|
500
|
+
validateRegisterDomains(item.type, removeDomains ? [] : domains);
|
|
501
|
+
approachTargetUpdates.domains = removeDomains ? REMOVE_REGISTER_ITEM_FIELD : domains;
|
|
502
|
+
}
|
|
482
503
|
const inputs = normalizeRegisterInput(opts.input, true);
|
|
483
504
|
const updated = {
|
|
484
505
|
...item,
|
|
506
|
+
...(opts.startOn !== undefined
|
|
507
|
+
? { startOn: opts.startOn === "-" ? undefined : opts.startOn }
|
|
508
|
+
: {}),
|
|
509
|
+
...(domains !== undefined ? { domains: removeDomains ? undefined : domains } : {}),
|
|
485
510
|
...(inputs !== undefined ? { inputs } : {}),
|
|
486
511
|
...(track !== undefined ? { track } : {}),
|
|
487
512
|
...(opts.title !== undefined ? { title: opts.title } : {}),
|
|
@@ -12,6 +12,7 @@ import { load } from "../shared/yaml.js";
|
|
|
12
12
|
export const CATALOG_LESS_APPROACHES = [
|
|
13
13
|
"draft",
|
|
14
14
|
"fully-guided",
|
|
15
|
+
"condense",
|
|
15
16
|
"recipe-guided",
|
|
16
17
|
"freeform",
|
|
17
18
|
"retrofit",
|
|
@@ -74,6 +75,10 @@ export function resolveRegisterDeliverableTarget(opts) {
|
|
|
74
75
|
if (opts.catalogPath) {
|
|
75
76
|
try {
|
|
76
77
|
const resolved = resolveDeliverableByDocId(opts.catalogPath, opts.projectId, opts.targetId, opts.repoRoot);
|
|
78
|
+
if (opts.approach === "condense" &&
|
|
79
|
+
!existsSync(resolve(opts.repoRoot, resolved.info.resolvedPath))) {
|
|
80
|
+
throw new Error(`Approach "condense" requires an existing deliverable: ${opts.targetId}`);
|
|
81
|
+
}
|
|
77
82
|
return { info: resolved.info, catalogless: false };
|
|
78
83
|
}
|
|
79
84
|
catch (error) {
|
|
@@ -102,7 +107,10 @@ export function resolveRegisterDeliverableTarget(opts) {
|
|
|
102
107
|
}
|
|
103
108
|
if (!rulebook)
|
|
104
109
|
throw new Error(`Target ${opts.targetId} requires --target-rulebook or specdojo.rulebook`);
|
|
105
|
-
if ((opts.approach === "
|
|
110
|
+
if ((opts.approach === "condense" ||
|
|
111
|
+
opts.approach === "finalize" ||
|
|
112
|
+
opts.approach === "bootstrap-finalize") &&
|
|
113
|
+
!existing) {
|
|
106
114
|
throw new Error(`Approach "${opts.approach}" requires an existing deliverable: ${opts.targetId}`);
|
|
107
115
|
}
|
|
108
116
|
const refs = {
|