specdojo 0.8.0 → 0.9.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 +4 -1
- package/CHANGELOG.md +64 -0
- package/dist/catalog/catalog.js +16 -14
- package/dist/commands/agent.js +5 -3
- package/dist/commands/build.js +69 -10
- package/dist/commands/git.js +206 -0
- package/dist/commands/init.js +4 -2
- package/dist/commands/where.js +25 -0
- package/dist/dashboard/dashboard.js +5 -3
- package/dist/dashboard/routines.js +4 -7
- package/dist/dashboard/timeline.js +14 -14
- package/dist/docs/index-command.js +2 -2
- package/dist/docs/yaml-business-tables.js +243 -0
- package/dist/docs/yaml-interface-tables.js +106 -0
- package/dist/docs/yaml-pages-command.js +5 -3
- package/dist/docs/yaml-pages.js +146 -3
- package/dist/docs/yaml-table-shared.js +70 -0
- package/dist/docs/yaml-tables.js +39 -0
- package/dist/exec/agent-config.js +9 -0
- package/dist/exec/agent-protected-config.js +2 -0
- package/dist/exec/commands.js +31 -18
- package/dist/exec/events.js +34 -14
- package/dist/exec/evidence.js +13 -3
- package/dist/exec/parent-validation.js +56 -3
- package/dist/exec/plans-core.js +21 -2
- package/dist/exec/plans-generation.js +6 -7
- package/dist/exec/post-integration.js +162 -0
- package/dist/exec/queue-command.js +166 -0
- package/dist/exec/queue.js +285 -0
- package/dist/exec/register-foreign-wait.js +84 -0
- package/dist/exec/repo-integration-sync.js +17 -5
- package/dist/exec/reporter.js +2 -2
- package/dist/exec/results.js +24 -4
- package/dist/exec/review-kata.js +4 -1
- package/dist/exec/run/agent-pipeline.js +3 -2
- package/dist/exec/run/agent.js +12 -6
- package/dist/exec/run/change-scope.js +365 -0
- package/dist/exec/run/deferred-cleanup.js +31 -0
- package/dist/exec/run/in-place.js +4 -1
- package/dist/exec/run/job-lock.js +66 -0
- package/dist/exec/run/job-sequence.js +137 -0
- package/dist/exec/run/job.js +56 -19
- package/dist/exec/run/lifecycle-commands.js +1 -1
- package/dist/exec/run/lock.js +22 -1
- package/dist/exec/run/register-command.js +8 -5
- package/dist/exec/run/register-mode.js +68 -8
- package/dist/exec/run/register-resume.js +68 -14
- package/dist/exec/run/register-state.js +13 -8
- package/dist/exec/run/register-worktree.js +140 -125
- package/dist/exec/run/schedule-mode.js +75 -14
- package/dist/exec/run/schedule-prepare.js +3 -0
- package/dist/exec/run/schedule-task.js +88 -38
- package/dist/exec/run/shared.js +5 -0
- package/dist/exec/schedule/schedule.js +116 -4
- package/dist/exec/shared.js +1 -1
- package/dist/exec/smoke.js +190 -0
- package/dist/exec/strategy.js +13 -3
- package/dist/exec/task-view.js +6 -4
- package/dist/exec/trial-commands.js +5 -2
- package/dist/exec/trial-core.js +6 -1
- package/dist/exec/validation-metrics.js +181 -0
- package/dist/exec/worktree-cleanup-lock.js +26 -0
- package/dist/exec/worktree-command.js +9 -1
- package/dist/exec/worktree-ops-commit.js +2 -2
- package/dist/exec/worktree.js +13 -2
- package/dist/grade/command-apply.js +3 -3
- package/dist/grade/command-inspect.js +5 -3
- package/dist/grade/command-plan.js +1 -1
- package/dist/grade/command-run.js +5 -1
- package/dist/grade/run.js +64 -8
- package/dist/job/definition.js +84 -8
- package/dist/job/job.js +79 -23
- package/dist/register/authoring-sources.js +22 -16
- package/dist/register/maintenance-commands.js +2 -2
- package/dist/register/register.js +31 -7
- package/dist/routine/definition.js +9 -0
- package/dist/routine/routine.js +137 -43
- package/dist/routine/status.js +62 -0
- package/dist/schedule/schedule.js +38 -39
- package/dist/shared/agent-types.js +5 -0
- package/dist/shared/cross-process-lock.js +9 -1
- package/dist/shared/dist-freshness.js +8 -2
- package/dist/shared/git-environment.js +2 -1
- package/dist/shared/git.js +44 -1
- package/dist/shared/lefthook-scaffold.js +3 -0
- package/dist/shared/local-config.js +244 -0
- package/dist/shared/specdojo-config.js +34 -20
- package/dist/shared/specdojo-gitignore.js +1 -0
- package/dist/shared/text.js +9 -1
- package/dist/shared/where-alias.js +13 -0
- package/dist/specdojo.js +4 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +2 -0
- package/docs/ja/specdojo/guides/exec-config-guide.md +23 -4
- package/docs/ja/specdojo/guides/exec-operation-guide.md +44 -1
- package/docs/ja/specdojo/guides/job-sequence-guide.md +77 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +3 -3
- package/docs/ja/specdojo/guides/register-operation-guide.md +1 -1
- package/docs/ja/specdojo/guides/routine-operation-guide.md +11 -6
- package/docs/ja/specdojo/guides/schedule-design-guide.md +20 -17
- package/docs/ja/specdojo/guides/waza-guide.md +12 -8
- package/docs/ja/specdojo/recipes/bac-recipe.md +66 -49
- package/docs/ja/specdojo/recipes/bes-recipe.md +90 -54
- package/docs/ja/specdojo/recipes/bps-recipe.md +88 -139
- package/docs/ja/specdojo/recipes/br-recipe.md +40 -47
- package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +97 -109
- package/docs/ja/specdojo/recipes/cdfd-recipe.md +85 -146
- package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +91 -110
- package/docs/ja/specdojo/recipes/cnd-recipe.md +79 -69
- package/docs/ja/specdojo/recipes/cpd-recipe.md +78 -64
- package/docs/ja/specdojo/recipes/cxd-recipe.md +92 -75
- package/docs/ja/specdojo/recipes/ifd-recipe.md +79 -68
- package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +78 -105
- package/docs/ja/specdojo/recipes/ifx-index-recipe.md +105 -71
- package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +60 -49
- package/docs/ja/specdojo/recipes/pm-members-recipe.md +50 -51
- package/docs/ja/specdojo/recipes/pm-organization-recipe.md +59 -51
- package/docs/ja/specdojo/recipes/pm-plan-recipe.md +69 -56
- package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +37 -56
- package/docs/ja/specdojo/recipes/pm-raci-recipe.md +39 -53
- package/docs/ja/specdojo/recipes/pm-roles-recipe.md +52 -79
- package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +64 -93
- package/docs/ja/specdojo/recipes/prj-charter-recipe.md +71 -106
- package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +78 -157
- package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +62 -111
- package/docs/ja/specdojo/recipes/prj-scope-recipe.md +67 -123
- package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +60 -96
- package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +61 -105
- package/docs/ja/specdojo/recipes/stsd-recipe.md +79 -109
- package/docs/ja/specdojo/recipes/sysd-critical-flows-recipe.md +78 -55
- package/docs/ja/specdojo/recipes/sysd-cross-cutting-policy-recipe.md +82 -73
- package/docs/ja/specdojo/recipes/sysd-index-recipe.md +78 -59
- package/docs/ja/specdojo/recipes/tsd-recipe.md +149 -129
- package/docs/ja/specdojo/references/command-reference.md +257 -117
- package/docs/ja/specdojo/references/deliverables-reference.md +21 -12
- package/docs/ja/specdojo/references/specdojo-config-reference.md +37 -2
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +101 -257
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +102 -228
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +19 -28
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +16 -67
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +30 -51
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +41 -61
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +22 -50
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +24 -56
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +13 -38
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +41 -76
- package/docs/ja/specdojo/rulebooks/cdfd-d2-rulebook.md +18 -93
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +18 -52
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +109 -147
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +80 -108
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +21 -46
- package/docs/ja/specdojo/rulebooks/cdr-rulebook.md +144 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +27 -48
- package/docs/ja/specdojo/rulebooks/cdt-rulebook.md +37 -50
- package/docs/ja/specdojo/rulebooks/clis-rulebook.md +52 -69
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +33 -86
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +16 -32
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +45 -131
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +69 -275
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +20 -112
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +23 -56
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +12 -145
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +39 -47
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +37 -56
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +118 -175
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +5 -14
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +22 -66
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +36 -94
- package/docs/ja/specdojo/rulebooks/dss-rulebook.md +59 -81
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +31 -131
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +50 -104
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +51 -61
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +38 -45
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +14 -20
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +26 -38
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +26 -107
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +42 -49
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +14 -22
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +21 -44
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +41 -64
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +14 -38
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +34 -61
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +27 -50
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +70 -199
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +65 -153
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +74 -150
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +11 -23
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +99 -176
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +35 -61
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +75 -117
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +31 -60
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +26 -81
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +32 -70
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +45 -87
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +48 -101
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +44 -80
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +59 -127
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +31 -50
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +42 -109
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +29 -42
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +29 -87
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +62 -84
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +11 -61
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +91 -106
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +25 -34
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +30 -53
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +23 -35
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +27 -45
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +37 -45
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +45 -46
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +37 -48
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +25 -29
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +28 -35
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +36 -41
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +5 -18
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +16 -37
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +23 -97
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +39 -57
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +43 -116
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +16 -51
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +47 -92
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +25 -84
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +44 -107
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +39 -49
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +42 -49
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +64 -89
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +90 -189
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +45 -105
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +6 -12
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +49 -68
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +51 -60
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +46 -50
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +39 -64
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +47 -60
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +69 -70
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +65 -72
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +35 -46
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +49 -66
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +64 -139
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +41 -108
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +49 -144
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +67 -155
- package/docs/ja/specdojo/samples/bds-sample.md +58 -71
- package/docs/ja/specdojo/samples/bes-index-sample.md +20 -37
- package/docs/ja/specdojo/samples/bes-sample.md +43 -53
- package/docs/ja/specdojo/samples/bps-sample.md +42 -54
- package/docs/ja/specdojo/samples/br-sample.md +40 -52
- package/docs/ja/specdojo/samples/ccd-sample.md +0 -1
- package/docs/ja/specdojo/samples/cdr-sample.md +78 -0
- package/docs/ja/specdojo/samples/cdsd-sample.md +47 -63
- package/docs/ja/specdojo/samples/clis-sample.md +70 -77
- package/docs/ja/specdojo/samples/dec-sample.md +2 -3
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +0 -2
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +0 -2
- package/docs/ja/specdojo/samples/job-sequence.yaml +67 -0
- package/docs/ja/specdojo/samples/mip-index-sample.md +98 -20
- package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +26 -19
- package/docs/ja/specdojo/samples/pm-organization-sample.md +39 -50
- package/docs/ja/specdojo/samples/pm-plan-sample.md +61 -67
- package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +31 -45
- package/docs/ja/specdojo/samples/pm-raci-sample.md +31 -37
- package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +32 -48
- package/docs/ja/specdojo/samples/prj-charter-sample.md +42 -59
- package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +55 -61
- package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +30 -33
- package/docs/ja/specdojo/samples/sf-index-sample.md +13 -55
- package/docs/ja/specdojo/samples/sf-sample.md +73 -85
- package/docs/ja/specdojo/samples/sld-sample.md +60 -79
- package/docs/ja/specdojo/samples/uis-sample.md +98 -121
- package/docs/ja/specdojo/standards/job-definition-standard.md +24 -9
- package/docs/ja/specdojo/templates/cdr-template.md +58 -0
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +2 -1
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +42 -5
- package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +35 -0
- package/docs/specdojo/schemas/v1/job-run.schema.yaml +23 -0
- package/docs/specdojo/schemas/v1/job.schema.yaml +63 -2
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +2 -2
- package/package.json +9 -6
- package/templates/antigravity/orchestrator.md +4 -1
- package/templates/claude/agents/specdojo-orchestrator.md +4 -1
- package/templates/codex/agents/specdojo-orchestrator.toml +4 -1
- package/templates/codex/orchestrator.md +4 -1
- package/templates/init-exec-defaults.yaml +13 -0
- package/templates/lefthook/tools/specdojo-pre-commit.mjs +8 -0
- package/templates/opencode/agents/specdojo-orchestrator.md +5 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import { isRecord } from "./yaml-table-shared.js";
|
|
3
|
+
import { renderBdd, renderDct, renderDctIndex, renderMembers, renderMilestones, renderRoles, renderTimeline, renderViewpoints, } from "./yaml-business-tables.js";
|
|
4
|
+
import { renderCommand, renderFileInterface } from "./yaml-interface-tables.js";
|
|
5
|
+
// type とファイル系列の両方で限定し、template・schema・grade 記録などを巻き込まない。
|
|
6
|
+
export function renderTypedYamlTable(path, parsed) {
|
|
7
|
+
if (!isRecord(parsed) || /\/(?:templates|schemas|execution|jobs|routines)\//.test(path))
|
|
8
|
+
return undefined;
|
|
9
|
+
const name = posix.basename(path).replace(/\.ya?ml$/, "");
|
|
10
|
+
if (parsed.type === "template" || parsed.openapi || parsed.asyncapi)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (/^bdd-/.test(name) && parsed.type === "data" && Array.isArray(parsed.entities))
|
|
13
|
+
return renderBdd(parsed);
|
|
14
|
+
if (parsed.type === "project") {
|
|
15
|
+
if (/^pm-roles(?:-|$)/.test(name) && Array.isArray(parsed.roles))
|
|
16
|
+
return renderRoles(parsed);
|
|
17
|
+
if (/^pm-members(?:-|$)/.test(name) && Array.isArray(parsed.members))
|
|
18
|
+
return renderMembers(parsed);
|
|
19
|
+
if (/^tml-/.test(name) && Array.isArray(parsed.tracks))
|
|
20
|
+
return renderTimeline(parsed);
|
|
21
|
+
if (name === "sch-milestones" &&
|
|
22
|
+
parsed.kind === "milestones" &&
|
|
23
|
+
Array.isArray(parsed.milestones))
|
|
24
|
+
return renderMilestones(parsed);
|
|
25
|
+
if (/^dct-index(?:-|$)/.test(name) && Array.isArray(parsed.groups))
|
|
26
|
+
return renderDctIndex(parsed);
|
|
27
|
+
if (/^dct-/.test(name) && typeof parsed.domain === "string" && Array.isArray(parsed.groups))
|
|
28
|
+
return renderDct(parsed);
|
|
29
|
+
}
|
|
30
|
+
if (/^pm-review-viewpoints(?:-|$)/.test(name) &&
|
|
31
|
+
["project", "standard"].includes(String(parsed.type)))
|
|
32
|
+
return renderViewpoints(parsed);
|
|
33
|
+
if (/^ifx-cmd-/.test(name) && parsed.type === "api" && isRecord(parsed.command))
|
|
34
|
+
return renderCommand(parsed);
|
|
35
|
+
const meta = isRecord(parsed["x-spec-meta"]) ? parsed["x-spec-meta"] : parsed;
|
|
36
|
+
if (/^ifx-file-/.test(name) && meta.type === "api" && Array.isArray(parsed.files))
|
|
37
|
+
return renderFileInterface(parsed);
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
@@ -6,6 +6,7 @@ import { getProjectExecutionPath, loadConfig, specdojoRootDir, } from "../shared
|
|
|
6
6
|
import { resolveParentValidationConcurrency, resolveParentValidationAssignments, resolveParentValidationDefinitions, } from "./parent-validation.js";
|
|
7
7
|
import { resolveCommitHookSkips } from "./commit-hook-skips.js";
|
|
8
8
|
import { configureIndexLockWait, DEFAULT_INDEX_LOCK_WAIT_MS } from "../shared/git.js";
|
|
9
|
+
import { resolvePostIntegrationEntries } from "./post-integration.js";
|
|
9
10
|
const PLACEHOLDER_PATTERN = /\{([a-z][a-z0-9_]*)\}/g;
|
|
10
11
|
const BUILTIN_VARIABLE_NAMES = new Set(["nickname", "mode", "proficiency"]);
|
|
11
12
|
// Mirror of the nickname pattern in docs/specdojo/schemas/v1/agent-members.schema.yaml.
|
|
@@ -66,6 +67,13 @@ function buildCommandVariables(provider, member, params) {
|
|
|
66
67
|
// not runnable by exec run). Throws when a template exists but cannot be fully expanded,
|
|
67
68
|
// so a broken definition surfaces as an error instead of launching a malformed command.
|
|
68
69
|
export function resolveMemberCommand(config, member) {
|
|
70
|
+
// Require provider opt-in even for an explicit member command: otherwise a frontier
|
|
71
|
+
// member could silently inherit ordinary defaults or bypass the missing-tier error.
|
|
72
|
+
if (member.proficiency === "frontier" &&
|
|
73
|
+
(!member.provider ||
|
|
74
|
+
!config.providers?.[member.provider]?.command_params?.by_proficiency?.frontier)) {
|
|
75
|
+
throw new Error(`Cannot launch frontier member ${member.nickname}: configure providers.${member.provider ?? "<provider>"}.command_params.by_proficiency.frontier in exec-defaults.yaml (use {} if no extra variables are needed)`);
|
|
76
|
+
}
|
|
69
77
|
const override = member.command?.trim();
|
|
70
78
|
if (override)
|
|
71
79
|
return override;
|
|
@@ -371,6 +379,7 @@ export function loadExecDefaultsConfig(configPath, executionPath) {
|
|
|
371
379
|
};
|
|
372
380
|
}
|
|
373
381
|
resolveParentValidationDefinitions(defaults.pipeline?.parent_validations);
|
|
382
|
+
resolvePostIntegrationEntries(defaults.pipeline?.post_integration);
|
|
374
383
|
resolveParentValidationConcurrency(defaults.pipeline?.parent_validation_concurrency);
|
|
375
384
|
resolveCommitHookSkips(defaults.pipeline?.commit_hook_skips, defaults.pipeline?.parent_validations);
|
|
376
385
|
if (defaults.pipeline?.mechanical_result !== undefined &&
|
|
@@ -51,6 +51,8 @@ const SNAPSHOT_DIRECTORY_ROOTS = [
|
|
|
51
51
|
// 保護対象ディレクトリの配下にあるが、設定ではなく再生成可能な既知の生成物。
|
|
52
52
|
// 任意の gitignore 対象を除外すると、agent が .gitignore と新規設定を同時に作ることで
|
|
53
53
|
// ガードをすり抜けられるため、生成物として用途が確定しているパスだけを列挙する。
|
|
54
|
+
// `.specdojo/specdojo.local.config.json`(PJR-NC9R)は gitignore 済みでも設定であり、repos の
|
|
55
|
+
// 差し替え・追加で commit の許可範囲を変えるため、ここに含めず `.specdojo/` の保護対象に残す。
|
|
54
56
|
// `.opencode/` の 4 件は opencode が起動時に作る実行時生成物で、親 runner / hook / CI の
|
|
55
57
|
// 実行内容を変えない。指示ファイル(`.opencode/AGENTS.md`、`.opencode/agents/**`)は
|
|
56
58
|
// ここに含めず、保護対象のままにする。
|
package/dist/exec/commands.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerDeprecatedWhereAlias } from "../shared/where-alias.js";
|
|
1
2
|
import { Option } from "commander";
|
|
2
3
|
import { existsSync } from "node:fs";
|
|
3
4
|
import { join, resolve as pathResolve } from "node:path";
|
|
@@ -5,6 +6,7 @@ import { validateCatalogLocalIds, validateRulebookKata } from "../catalog/build.
|
|
|
5
6
|
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
6
7
|
import { runProviderScaffold, specdojoPackageRootDir } from "../shared/provider-scaffold.js";
|
|
7
8
|
import { assertValidActor, getProjectViewpointsPath, getProjectRoutinesPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
9
|
+
import { formatLocalConfigLines } from "../shared/local-config.js";
|
|
8
10
|
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
11
|
import { acquireSchedulerLock, canBlockTask, canCancelTask, canClaimTask, canCompleteTask, canReleaseTask, canReopenTask, canUnblockTask, claimOwnerOf, computeReadyIds, readAllEventFiles, releaseSchedulerLock, schedulerLockPath, writeEventFile, } from "./events.js";
|
|
10
12
|
import { registerExecHandoffCommands } from "./handoff.js";
|
|
@@ -19,13 +21,37 @@ import { displayWidth, nowUtcIsoSeconds, padEndDisplay, requireNonEmpty } from "
|
|
|
19
21
|
import { resolveOwnerForLocalId } from "./strategy.js";
|
|
20
22
|
import { buildTaskView } from "./task-view.js";
|
|
21
23
|
import { registerExecTrialCommands } from "./trial.js";
|
|
24
|
+
import { registerExecSmokeCommand } from "./smoke.js";
|
|
25
|
+
import { registerExecQueueCommands, writeActiveQueueSummary } from "./queue-command.js";
|
|
22
26
|
import { registerExecWorktreeCommands } from "./worktree-command.js";
|
|
23
27
|
import { validateRunRecordLayout } from "./validate-records.js";
|
|
24
28
|
import { validateRunRecordLayoutAtCommit } from "./validate-records-commit.js";
|
|
29
|
+
export function printExecPaths(opts) {
|
|
30
|
+
try {
|
|
31
|
+
const resolvedPaths = resolveProjectContext(opts);
|
|
32
|
+
process.stdout.write(`schedule-path: ${resolvedPaths.schedulePath}\n`);
|
|
33
|
+
process.stdout.write(`execution-path: ${resolvedPaths.executionPath}\n`);
|
|
34
|
+
const projectPath = resolvedPaths.schedulePath;
|
|
35
|
+
process.stdout.write(`exec/events : ${eventsDirForProject(projectPath)}\n`);
|
|
36
|
+
process.stdout.write(`generated : ${generatedDirForProject(projectPath)}\n`);
|
|
37
|
+
process.stdout.write(`scheduler-lock: ${schedulerLockPath(projectPath)}\n`);
|
|
38
|
+
// Only with a local config, so the output stays unchanged for checkouts without one.
|
|
39
|
+
const loaded = loadConfig();
|
|
40
|
+
if (loaded.localConfigPath) {
|
|
41
|
+
const lines = formatLocalConfigLines(loaded, resolveProjectId(opts));
|
|
42
|
+
process.stdout.write(lines.map((line) => `${line}\n`).join(""));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
printCommandError(error, false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
25
49
|
export function registerExecCommands(program) {
|
|
26
50
|
const exec = program.command("exec").description("Execution helpers");
|
|
27
51
|
registerExecHandoffCommands(exec);
|
|
28
52
|
registerRecordMigrationCommand(exec);
|
|
53
|
+
registerExecSmokeCommand(exec);
|
|
54
|
+
registerExecQueueCommands(exec);
|
|
29
55
|
const lockedActions = {
|
|
30
56
|
claim: {
|
|
31
57
|
type: "claim",
|
|
@@ -318,7 +344,7 @@ export function registerExecCommands(program) {
|
|
|
318
344
|
}
|
|
319
345
|
});
|
|
320
346
|
const scmd = exec
|
|
321
|
-
.command("scheduler")
|
|
347
|
+
.command("scheduler", { hidden: true })
|
|
322
348
|
.description("Auto-claim next task safely (with project-level lock).");
|
|
323
349
|
addProjectOptions(scmd);
|
|
324
350
|
scmd.requiredOption("--by <actor>", "Actor (agent name)");
|
|
@@ -545,7 +571,7 @@ export function registerExecCommands(program) {
|
|
|
545
571
|
statusCmd.option("--state <state>", "Filter by state: todo|doing|blocked|done|cancelled (default: doing)", "doing");
|
|
546
572
|
statusCmd.action((opts) => {
|
|
547
573
|
try {
|
|
548
|
-
const { schedulePath } = resolveProjectContext(opts);
|
|
574
|
+
const { schedulePath, executionPath } = resolveProjectContext(opts);
|
|
549
575
|
// Compute state directly from events (not from cached state.json)
|
|
550
576
|
const state = loadValidatedExecState(schedulePath);
|
|
551
577
|
if (!state)
|
|
@@ -561,6 +587,7 @@ export function registerExecCommands(program) {
|
|
|
561
587
|
if (entries.length === 0) {
|
|
562
588
|
const byMsg = filterBy ? ` for ${filterBy}` : "";
|
|
563
589
|
process.stdout.write(`No ${filterState} tasks${byMsg}.\n`);
|
|
590
|
+
writeActiveQueueSummary(executionPath);
|
|
564
591
|
exitWithCode(true);
|
|
565
592
|
return;
|
|
566
593
|
}
|
|
@@ -584,26 +611,12 @@ export function registerExecCommands(program) {
|
|
|
584
611
|
// The trailing claimed_at column is left unpadded to avoid stray trailing whitespace.
|
|
585
612
|
process.stdout.write(` ${padEndDisplay(r.taskId, taskWidth)} ${padEndDisplay(r.name, nameWidth)} ${padEndDisplay(r.by, byWidth)} ${r.ts}\n`);
|
|
586
613
|
}
|
|
614
|
+
writeActiveQueueSummary(executionPath);
|
|
587
615
|
exitWithCode(true);
|
|
588
616
|
}
|
|
589
617
|
catch (error) {
|
|
590
618
|
printCommandError(error, false);
|
|
591
619
|
}
|
|
592
620
|
});
|
|
593
|
-
|
|
594
|
-
addProjectOptions(wcmd);
|
|
595
|
-
wcmd.action((opts) => {
|
|
596
|
-
try {
|
|
597
|
-
const resolvedPaths = resolveProjectContext(opts);
|
|
598
|
-
process.stdout.write(`schedule-path: ${resolvedPaths.schedulePath}\n`);
|
|
599
|
-
process.stdout.write(`execution-path: ${resolvedPaths.executionPath}\n`);
|
|
600
|
-
const projectPath = resolvedPaths.schedulePath;
|
|
601
|
-
process.stdout.write(`exec/events : ${eventsDirForProject(projectPath)}\n`);
|
|
602
|
-
process.stdout.write(`generated : ${generatedDirForProject(projectPath)}\n`);
|
|
603
|
-
process.stdout.write(`scheduler-lock: ${schedulerLockPath(projectPath)}\n`);
|
|
604
|
-
}
|
|
605
|
-
catch (error) {
|
|
606
|
-
printCommandError(error, false);
|
|
607
|
-
}
|
|
608
|
-
});
|
|
621
|
+
registerDeprecatedWhereAlias(exec, printExecPaths);
|
|
609
622
|
}
|
package/dist/exec/events.js
CHANGED
|
@@ -76,7 +76,22 @@ function advanceTaskState(state, event) {
|
|
|
76
76
|
}
|
|
77
77
|
return state;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function resumesPipelineBlock(block, unblock) {
|
|
80
|
+
return (block.type === "block" &&
|
|
81
|
+
unblock.type === "unblock" &&
|
|
82
|
+
typeof block.meta?.pipeline_stage === "string" &&
|
|
83
|
+
typeof block.meta?.pipeline_state_ref === "string" &&
|
|
84
|
+
block.meta.pipeline_stage === unblock.meta?.pipeline_stage &&
|
|
85
|
+
block.meta.pipeline_state_ref === unblock.meta?.pipeline_state_ref);
|
|
86
|
+
}
|
|
87
|
+
function advanceEventOrderState(cur, event) {
|
|
88
|
+
return {
|
|
89
|
+
state: advanceTaskState(cur.state, event),
|
|
90
|
+
lastBy: event.by,
|
|
91
|
+
lastBlock: event.type === "block" ? event : cur.lastBlock,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function isTransitionValidForState(state, lastBy, lastBlock, candidate, remaining) {
|
|
80
95
|
const { type } = candidate;
|
|
81
96
|
if (type === "note" || type === "estimate" || type === "link")
|
|
82
97
|
return true;
|
|
@@ -104,6 +119,14 @@ function isTransitionValidForState(state, lastBy, candidate, remaining) {
|
|
|
104
119
|
if (type !== "block" && type !== "complete" && type !== "release" && type !== "cancel") {
|
|
105
120
|
return false;
|
|
106
121
|
}
|
|
122
|
+
// A resume identifies the block it follows. Prefer that block over a later failure in
|
|
123
|
+
// the same second, regardless of the random suffix in either block's filename.
|
|
124
|
+
if (type === "block") {
|
|
125
|
+
const resumedBlocks = remaining.filter((item) => remaining.some((other) => resumesPipelineBlock(item.event, other.event)));
|
|
126
|
+
if (resumedBlocks.length > 0 && !resumedBlocks.some((item) => item.event === candidate)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
107
130
|
if (lastBy &&
|
|
108
131
|
candidate.by !== lastBy &&
|
|
109
132
|
remaining.some((item) => (item.event.type === "block" ||
|
|
@@ -122,6 +145,12 @@ function isTransitionValidForState(state, lastBy, candidate, remaining) {
|
|
|
122
145
|
return true;
|
|
123
146
|
}
|
|
124
147
|
if (state === "blocked") {
|
|
148
|
+
if (type === "unblock" &&
|
|
149
|
+
lastBlock &&
|
|
150
|
+
!resumesPipelineBlock(lastBlock, candidate) &&
|
|
151
|
+
remaining.some((item) => resumesPipelineBlock(lastBlock, item.event))) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
125
154
|
return type === "unblock" || type === "release" || type === "cancel";
|
|
126
155
|
}
|
|
127
156
|
if (state === "done") {
|
|
@@ -139,10 +168,7 @@ function orderSameTimestampEventsByState(items) {
|
|
|
139
168
|
if (end - start === 1) {
|
|
140
169
|
const { event } = items[start];
|
|
141
170
|
const cur = taskStates.get(event.task_id) ?? { state: "todo" };
|
|
142
|
-
taskStates.set(event.task_id,
|
|
143
|
-
state: advanceTaskState(cur.state, event),
|
|
144
|
-
lastBy: event.by,
|
|
145
|
-
});
|
|
171
|
+
taskStates.set(event.task_id, advanceEventOrderState(cur, event));
|
|
146
172
|
start = end;
|
|
147
173
|
continue;
|
|
148
174
|
}
|
|
@@ -159,21 +185,15 @@ function orderSameTimestampEventsByState(items) {
|
|
|
159
185
|
let cur = taskStates.get(taskId) ?? { state: "todo" };
|
|
160
186
|
if (indices.length === 1) {
|
|
161
187
|
const { event } = items[indices[0]];
|
|
162
|
-
taskStates.set(taskId,
|
|
163
|
-
state: advanceTaskState(cur.state, event),
|
|
164
|
-
lastBy: event.by,
|
|
165
|
-
});
|
|
188
|
+
taskStates.set(taskId, advanceEventOrderState(cur, event));
|
|
166
189
|
continue;
|
|
167
190
|
}
|
|
168
191
|
const remaining = indices.map((idx) => items[idx]);
|
|
169
192
|
for (const targetIdx of indices) {
|
|
170
|
-
const validIdx = remaining.findIndex((candidate) => isTransitionValidForState(cur.state, cur.lastBy, candidate.event, remaining));
|
|
193
|
+
const validIdx = remaining.findIndex((candidate) => isTransitionValidForState(cur.state, cur.lastBy, cur.lastBlock, candidate.event, remaining));
|
|
171
194
|
const [chosen] = remaining.splice(validIdx >= 0 ? validIdx : 0, 1);
|
|
172
195
|
items[targetIdx] = chosen;
|
|
173
|
-
cur =
|
|
174
|
-
state: advanceTaskState(cur.state, chosen.event),
|
|
175
|
-
lastBy: chosen.event.by,
|
|
176
|
-
};
|
|
196
|
+
cur = advanceEventOrderState(cur, chosen.event);
|
|
177
197
|
}
|
|
178
198
|
taskStates.set(taskId, cur);
|
|
179
199
|
}
|
package/dist/exec/evidence.js
CHANGED
|
@@ -2,8 +2,9 @@ import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join, relative, sep } from "node:path";
|
|
3
3
|
import { runLogPath, runnerRecordPrefixes, taskEvidencePaths, taskRecordPaths, } from "./run-records.js";
|
|
4
4
|
import { ensureDir, redactSensitiveText, safeSlug } from "./shared.js";
|
|
5
|
-
import { gitOutput } from "./worktree.js";
|
|
5
|
+
import { gitOutput, gitResult } from "./worktree.js";
|
|
6
6
|
import { isCondenseRecords } from "../shared/condense-records.js";
|
|
7
|
+
import { loadConfig } from "../shared/specdojo-config.js";
|
|
7
8
|
const MAX_LOG_BYTES = 64 * 1024;
|
|
8
9
|
export const MAX_CHANGE_FILES = 1_000;
|
|
9
10
|
const MAX_FINAL_MESSAGE_LENGTH = 4_000;
|
|
@@ -386,6 +387,9 @@ export function buildExecutorEvidence(input) {
|
|
|
386
387
|
},
|
|
387
388
|
validations,
|
|
388
389
|
...(report.condenseRecords ? { condense_records: report.condenseRecords } : {}),
|
|
390
|
+
...(input.localConfigOverrides?.length
|
|
391
|
+
? { local_config_overrides: input.localConfigOverrides.map((item) => ({ ...item })) }
|
|
392
|
+
: {}),
|
|
389
393
|
...(report.targetCoverage.length > 0 ? { target_coverage: report.targetCoverage } : {}),
|
|
390
394
|
...(input.rateLimitEvents?.length ? { rate_limit_events: input.rateLimitEvents } : {}),
|
|
391
395
|
final_message: report.finalMessage,
|
|
@@ -458,6 +462,8 @@ export function recordExecutorEvidence(input) {
|
|
|
458
462
|
logRefPath: repoRelative(input.worktreePath, logPath),
|
|
459
463
|
parentValidations: input.parentValidations,
|
|
460
464
|
rateLimitEvents: input.rateLimitEvents,
|
|
465
|
+
// The runner's own config load (the main working tree) decides what the run used.
|
|
466
|
+
localConfigOverrides: loadConfig(input.repoRoot).localOverrides,
|
|
461
467
|
});
|
|
462
468
|
writeFileSync(logPath, logExcerpt, "utf8");
|
|
463
469
|
writeFileSync(evidencePath, `${JSON.stringify(evidence, null, 2)}\n`, "utf8");
|
|
@@ -471,14 +477,18 @@ export function recordCommandEvidence(input) {
|
|
|
471
477
|
`${executionRel}/exec/events/`,
|
|
472
478
|
`${executionRel}/generated/`,
|
|
473
479
|
];
|
|
474
|
-
const
|
|
480
|
+
const inGit = gitResult(input.worktreePath, ["rev-parse", "--is-inside-work-tree"]).status === 0;
|
|
481
|
+
const changes = (inGit ? parseStatusPaths(input.worktreePath) : [])
|
|
475
482
|
.filter((change) => runnerManagedPrefixes.every((prefix) => !change.path.startsWith(prefix)))
|
|
476
483
|
.slice(0, MAX_CHANGE_FILES)
|
|
477
484
|
.map((change) => ({
|
|
478
485
|
path: boundedText(change.path, 1_000),
|
|
479
486
|
status: boundedText(change.status, 40),
|
|
480
487
|
}));
|
|
481
|
-
const
|
|
488
|
+
const hasHead = inGit && gitResult(input.worktreePath, ["rev-parse", "--verify", "HEAD"]).status === 0;
|
|
489
|
+
const diffStat = inGit
|
|
490
|
+
? gitOutput(input.worktreePath, ["diff", "--stat", ...(hasHead ? ["HEAD"] : []), "--"])
|
|
491
|
+
: "";
|
|
482
492
|
const evidenceDir = taskRecordPaths(join(input.worktreePath, executionRel), input.taskId, input.runId).directory;
|
|
483
493
|
ensureDir(evidenceDir);
|
|
484
494
|
const evidencePath = taskRecordPaths(join(input.worktreePath, executionRel), input.taskId, input.runId).evidence;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { performance } from "node:perf_hooks";
|
|
4
|
+
import { StringDecoder } from "node:string_decoder";
|
|
5
|
+
import { recordValidationGateWait, validationMetric, ValidationTestFiles, } from "./validation-metrics.js";
|
|
3
6
|
import { gitEnvironment } from "./worktree.js";
|
|
4
7
|
import { acquirePoolSlot, getActiveExecLocksDir, releaseLock } from "./slot-lock.js";
|
|
5
8
|
import { MAX_CHANGE_FILES, redactSensitiveText } from "./evidence.js";
|
|
@@ -306,21 +309,30 @@ async function invokeParentValidation(definition, cwd) {
|
|
|
306
309
|
const stderrCapture = { chunks: [], totalBytes: 0 };
|
|
307
310
|
let settled = false;
|
|
308
311
|
let timedOut = false;
|
|
312
|
+
const testFiles = new ValidationTestFiles();
|
|
313
|
+
const stdoutDecoder = new StringDecoder("utf8");
|
|
309
314
|
const child = spawn(definition.command, [...definition.args], {
|
|
310
315
|
cwd,
|
|
311
|
-
env: gitEnvironment(),
|
|
316
|
+
env: { ...gitEnvironment(), SPECDOJO_PARENT_VALIDATION_METRICS: "1" },
|
|
312
317
|
shell: false,
|
|
313
318
|
stdio: ["ignore", "pipe", "pipe"],
|
|
314
319
|
windowsHide: true,
|
|
315
320
|
});
|
|
316
321
|
child.stdout.on("data", (chunk) => {
|
|
317
322
|
appendBounded(stdoutCapture, chunk);
|
|
323
|
+
testFiles.observe(stdoutDecoder.write(chunk));
|
|
318
324
|
});
|
|
319
325
|
child.stderr.on("data", (chunk) => {
|
|
320
326
|
appendBounded(stderrCapture, chunk);
|
|
321
327
|
});
|
|
322
328
|
const timer = setTimeout(() => {
|
|
323
329
|
timedOut = true;
|
|
330
|
+
validationMetric("validation-timeout", {
|
|
331
|
+
id: definition.id,
|
|
332
|
+
cwd,
|
|
333
|
+
timeout_ms: definition.timeoutMs,
|
|
334
|
+
...testFiles.snapshot(),
|
|
335
|
+
});
|
|
324
336
|
child.kill("SIGTERM");
|
|
325
337
|
}, definition.timeoutMs);
|
|
326
338
|
const finish = (result) => {
|
|
@@ -397,6 +409,7 @@ export async function runParentValidationBatch(entries, cwd, invoke = invokePare
|
|
|
397
409
|
summary: reason,
|
|
398
410
|
reason,
|
|
399
411
|
});
|
|
412
|
+
validationMetric("validation-skipped", { id: definition.id, repo, reason });
|
|
400
413
|
continue;
|
|
401
414
|
}
|
|
402
415
|
const root = repo === PARENT_VALIDATION_PROJECT_REPO
|
|
@@ -416,8 +429,38 @@ export async function runParentValidationBatch(entries, cwd, invoke = invokePare
|
|
|
416
429
|
});
|
|
417
430
|
continue;
|
|
418
431
|
}
|
|
419
|
-
const
|
|
432
|
+
const startedAt = new Date().toISOString();
|
|
433
|
+
const started = performance.now();
|
|
434
|
+
validationMetric("validation-start", {
|
|
435
|
+
id: definition.id,
|
|
436
|
+
repo,
|
|
437
|
+
started_at: startedAt,
|
|
438
|
+
timeout_ms: definition.timeoutMs,
|
|
439
|
+
});
|
|
440
|
+
let result;
|
|
441
|
+
try {
|
|
442
|
+
result = await invoke(definition, root);
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
validationMetric("validation-end", {
|
|
446
|
+
id: definition.id,
|
|
447
|
+
repo,
|
|
448
|
+
started_at: startedAt,
|
|
449
|
+
duration_ms: performance.now() - started,
|
|
450
|
+
error: String(error),
|
|
451
|
+
});
|
|
452
|
+
throw error;
|
|
453
|
+
}
|
|
420
454
|
const passed = result.exitCode === 0 && !result.error && !result.timedOut;
|
|
455
|
+
validationMetric("validation-end", {
|
|
456
|
+
id: definition.id,
|
|
457
|
+
repo,
|
|
458
|
+
started_at: startedAt,
|
|
459
|
+
duration_ms: performance.now() - started,
|
|
460
|
+
exit_code: result.exitCode,
|
|
461
|
+
timed_out: result.timedOut === true,
|
|
462
|
+
status: passed ? "passed" : "failed",
|
|
463
|
+
});
|
|
421
464
|
validations.push({
|
|
422
465
|
id: definition.id,
|
|
423
466
|
source: "runner",
|
|
@@ -483,14 +526,24 @@ export class ParentValidationGate {
|
|
|
483
526
|
this.lockRoot = lockRoot;
|
|
484
527
|
}
|
|
485
528
|
async run(label, ids, task) {
|
|
529
|
+
const queued = performance.now();
|
|
530
|
+
validationMetric("gate-queued", {
|
|
531
|
+
ids,
|
|
532
|
+
running: [...this.active],
|
|
533
|
+
queued: this.waiters.length,
|
|
534
|
+
});
|
|
486
535
|
await this.acquire(label, ids);
|
|
536
|
+
const localWaitMs = performance.now() - queued;
|
|
487
537
|
try {
|
|
488
|
-
if (!this.lockRoot)
|
|
538
|
+
if (!this.lockRoot) {
|
|
539
|
+
recordValidationGateWait(queued, localWaitMs);
|
|
489
540
|
return await task();
|
|
541
|
+
}
|
|
490
542
|
const slot = await acquirePoolSlot(parentValidationPoolPath(this.lockRoot), this.limit, { actor: "parent-validation", label }, {
|
|
491
543
|
onWait: () => this.log(` Waiting for parent validation slot held by another exec run: ${label} (${ids.join(", ")})\n`),
|
|
492
544
|
});
|
|
493
545
|
try {
|
|
546
|
+
recordValidationGateWait(queued, localWaitMs);
|
|
494
547
|
return await task();
|
|
495
548
|
}
|
|
496
549
|
finally {
|
package/dist/exec/plans-core.js
CHANGED
|
@@ -237,6 +237,25 @@ export function gradeFindingsText(projectId, targetPath, includeCause = false) {
|
|
|
237
237
|
return "- なし";
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
+
// 実践の型を整備する approach。成果物ではなく、成果物が宣言する実践の型そのものを編集対象にする。
|
|
241
|
+
const KATA_MAINTENANCE_APPROACHES = new Set([
|
|
242
|
+
"rulebook-maintenance",
|
|
243
|
+
"recipe-maintenance",
|
|
244
|
+
"sample-maintenance",
|
|
245
|
+
"template-maintenance",
|
|
246
|
+
]);
|
|
247
|
+
// 実践の型の参照を解決するときの成果物の kind。kind: generated の成果物は CLI が生成するため
|
|
248
|
+
// 既定では実践の型を参照しないが、型の整備の段はカタログが宣言する rulebook 自体を整備するので、
|
|
249
|
+
// generated の扱いを外して宣言どおりに解決する(PJR-DM9B)。
|
|
250
|
+
export function kataRefTargetKind(kind, approach) {
|
|
251
|
+
return kind === "generated" && approach && KATA_MAINTENANCE_APPROACHES.has(approach)
|
|
252
|
+
? undefined
|
|
253
|
+
: kind;
|
|
254
|
+
}
|
|
255
|
+
// タスクの approach を踏まえて、成果物が宣言する実践の型の参照を解決する。
|
|
256
|
+
export function deliverableKataRefs(deliverable, approach) {
|
|
257
|
+
return resolveKataRefs(deliverable?.deliverable.rulebook, kataRefTargetKind(deliverable?.deliverable.kind, approach));
|
|
258
|
+
}
|
|
240
259
|
export function gradeFindingTargetPath(approach, deliverable, refs) {
|
|
241
260
|
if (approach === "rulebook-maintenance")
|
|
242
261
|
return refs.rulebook;
|
|
@@ -262,7 +281,7 @@ export function gradeTargetKind(approach) {
|
|
|
262
281
|
// 同じ規則で決めるため、plan 生成と runner の実行対象が食い違わない。
|
|
263
282
|
export function reviewGradeSubject(catalogPath, task) {
|
|
264
283
|
const deliverable = task.local_id && catalogPath ? findDeliverableInfo(catalogPath, task.local_id) : null;
|
|
265
|
-
const refs =
|
|
284
|
+
const refs = deliverableKataRefs(deliverable, task.approach);
|
|
266
285
|
const path = gradeFindingTargetPath(task.approach, deliverable, refs);
|
|
267
286
|
if (!path || path === MISSING)
|
|
268
287
|
return undefined;
|
|
@@ -508,7 +527,7 @@ export function targetDocIds(projectId, deliverable, approach, fallbackLocalId)
|
|
|
508
527
|
const kinds = approach ? (TARGET_REF_KINDS[approach] ?? []) : [];
|
|
509
528
|
if (kinds.length === 0)
|
|
510
529
|
return ids;
|
|
511
|
-
const refs =
|
|
530
|
+
const refs = deliverableKataRefs(deliverable, approach);
|
|
512
531
|
for (const kind of kinds) {
|
|
513
532
|
const refPath = refs[kind];
|
|
514
533
|
if (refPath !== MISSING)
|
|
@@ -2,13 +2,13 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { expandPlanConventions } from "../shared/plan-conventions.js";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { isAuthoringApproach } from "../kata/authoring.js";
|
|
5
|
-
import { resolveDeliverableSchemaRef
|
|
5
|
+
import { resolveDeliverableSchemaRef } from "../kata/kata.js";
|
|
6
6
|
import { registerInputSection } from "../register/input.js";
|
|
7
7
|
import { isPlanningApproach } from "../register/planning.js";
|
|
8
8
|
import { DEFAULT_PROJECT_CONTEXT, specdojoRootDir } from "../shared/specdojo-config.js";
|
|
9
9
|
import { formatMarkdownFile } from "./format.js";
|
|
10
10
|
import { assertPlanMarkdownlint } from "./plan-markdownlint.js";
|
|
11
|
-
import { applicableReviewCriteria, buildInPlaceStem, crossDeliverableTargetDetails, deliverableBasedOn, deliverableBrief, deliverableDependsOn, deliverableName, deliverableOverview, deliverablePath, doneCriteriaChecklist, doneCriteriaGoals, doneCriteriaItems, execDocId, findDeliverableInfo, frontmatter, gradeFindingsText, gradeFindingTargetPath, gradeResultRef, gradeTargetKind, implementationEvidence, injectCommonConventions, kataRefState, loadPlanTemplate, loadRoles, loadViewpoints, MISSING, ownerRoleFields, phaseDescriptionText, projectContextSection, repoRelativePath, reviewDoneCriteriaRows, reviewGradeSummaryText, rulebookIncludesText, targetDocIds, targetDocIdsForTask, } from "./plans-core.js";
|
|
11
|
+
import { applicableReviewCriteria, buildInPlaceStem, crossDeliverableTargetDetails, deliverableBasedOn, deliverableBrief, deliverableDependsOn, deliverableKataRefs, deliverableName, deliverableOverview, deliverablePath, doneCriteriaChecklist, doneCriteriaGoals, doneCriteriaItems, execDocId, findDeliverableInfo, frontmatter, gradeFindingsText, gradeFindingTargetPath, gradeResultRef, gradeTargetKind, implementationEvidence, injectCommonConventions, kataRefState, kataRefTargetKind, loadPlanTemplate, loadRoles, loadViewpoints, MISSING, ownerRoleFields, phaseDescriptionText, projectContextSection, repoRelativePath, reviewDoneCriteriaRows, reviewGradeSummaryText, rulebookIncludesText, targetDocIds, targetDocIdsForTask, } from "./plans-core.js";
|
|
12
12
|
import { kataCauseFindingsText } from "./plans-kata-findings.js";
|
|
13
13
|
import { kataReviewSummary, scheduleKataReviewSubjects } from "./review-kata.js";
|
|
14
14
|
import { isRunRecordPath, resultForPlan, taskRecordPaths } from "./run-records.js";
|
|
@@ -36,8 +36,7 @@ function buildEditPlanMarkdown(template, task, deliverable, roleMap, vpMap, proj
|
|
|
36
36
|
};
|
|
37
37
|
const criteria = deliverable?.deliverable.done_criteria ?? [];
|
|
38
38
|
const ownerRole = ownerRoleFields(task.owner, roleMap, vpMap, deliverable?.deliverable.rulebook);
|
|
39
|
-
const refs = planOverrides?.refs ??
|
|
40
|
-
resolveKataRefs(deliverable?.deliverable.rulebook, deliverable?.deliverable.kind);
|
|
39
|
+
const refs = planOverrides?.refs ?? deliverableKataRefs(deliverable, task.approach);
|
|
41
40
|
const usesOptionalImplementationEvidence = task.approach === "draft" ||
|
|
42
41
|
task.approach === "fully-guided" ||
|
|
43
42
|
task.approach === "recipe-guided";
|
|
@@ -66,7 +65,7 @@ function buildEditPlanMarkdown(template, task, deliverable, roleMap, vpMap, proj
|
|
|
66
65
|
_RESULT_REF_: resultRef,
|
|
67
66
|
_RULEBOOK_REF_: refs.rulebook,
|
|
68
67
|
_RULEBOOK_STATE_: kataRefState(refs.rulebook),
|
|
69
|
-
_RULEBOOK_INCLUDES_: rulebookIncludesText(deliverable?.deliverable.rulebook, deliverable?.deliverable.kind),
|
|
68
|
+
_RULEBOOK_INCLUDES_: rulebookIncludesText(deliverable?.deliverable.rulebook, kataRefTargetKind(deliverable?.deliverable.kind, task.approach)),
|
|
70
69
|
_RECIPE_REF_: refs.recipe,
|
|
71
70
|
_RECIPE_STATE_: kataRefState(refs.recipe),
|
|
72
71
|
_SAMPLE_REF_: refs.sample,
|
|
@@ -162,7 +161,7 @@ function buildReviewPlanMarkdown(template, task, deliverable, criteria, vpMap, p
|
|
|
162
161
|
...(task.approach ? { approach: task.approach } : {}),
|
|
163
162
|
...(targets.length > 0 ? { targets } : {}),
|
|
164
163
|
};
|
|
165
|
-
const refs =
|
|
164
|
+
const refs = deliverableKataRefs(deliverable, task.approach);
|
|
166
165
|
const applicableCriteria = applicableReviewCriteria(criteria, vpMap, deliverable?.deliverable.rulebook);
|
|
167
166
|
const gradeSubjectPath = gradeFindingTargetPath(task.approach, deliverable, refs);
|
|
168
167
|
const values = {
|
|
@@ -180,7 +179,7 @@ function buildReviewPlanMarkdown(template, task, deliverable, criteria, vpMap, p
|
|
|
180
179
|
_DELIVERABLE_PATH_: deliverablePath(deliverable),
|
|
181
180
|
_RESULT_REF_: resultRef,
|
|
182
181
|
_RULEBOOK_REF_: refs.rulebook,
|
|
183
|
-
_RULEBOOK_INCLUDES_: rulebookIncludesText(deliverable?.deliverable.rulebook, deliverable?.deliverable.kind),
|
|
182
|
+
_RULEBOOK_INCLUDES_: rulebookIncludesText(deliverable?.deliverable.rulebook, kataRefTargetKind(deliverable?.deliverable.kind, task.approach)),
|
|
184
183
|
_RECIPE_REF_: refs.recipe,
|
|
185
184
|
_SAMPLE_REF_: refs.sample,
|
|
186
185
|
_TEMPLATE_REF_: refs.template,
|