specdojo 0.7.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 +153 -0
- package/dist/catalog/build.js +24 -1
- package/dist/catalog/plan.js +1 -1
- package/dist/catalog/scaffold.js +4 -1
- package/dist/commands/init.js +5 -1
- package/dist/commands/night-orchestrator.js +6 -4
- 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/scaffold.js +18 -0
- 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/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 +153 -12
- package/dist/exec/pipeline-state.js +27 -5
- package/dist/exec/plans-condense-findings.js +89 -0
- package/dist/exec/plans-core.js +24 -17
- package/dist/exec/plans-generation.js +48 -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 +55 -56
- 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 +188 -36
- package/dist/exec/run/mode-shared.js +11 -3
- package/dist/exec/run/register-command.js +6 -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 +4 -4
- package/dist/exec/run/schedule-prepare.js +201 -59
- package/dist/exec/run/schedule-task.js +129 -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 +119 -48
- package/dist/exec/worktree-ops-lifecycle.js +77 -48
- 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 +43 -9
- 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 +142 -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/run-records.js +224 -0
- package/dist/shared/specdojo-config.js +39 -21
- package/dist/shared/text.js +65 -5
- package/dist/shared/timeline-index.js +2 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +9 -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 +12 -0
- package/docs/ja/specdojo/guides/docs-structure-guide.md +48 -15
- package/docs/ja/specdojo/guides/exec-config-guide.md +47 -16
- package/docs/ja/specdojo/guides/exec-operation-guide.md +53 -17
- package/docs/ja/specdojo/guides/exec-worktree-guide.md +20 -11
- 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 +70 -14
- package/docs/ja/specdojo/guides/register-operation-guide.md +25 -5
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +2 -0
- 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 +27 -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 +92 -155
- 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-uc-recipe.md +36 -24
- 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 +79 -64
- 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-uc-rulebook.md +56 -35
- 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-sample.md +172 -99
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +9 -7
- 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-template.md +81 -54
- package/docs/ja/specdojo/templates/cdfd-uc-template.md +9 -5
- 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 +53 -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/package.json +2 -2
- package/templates/antigravity/orchestrator.md +3 -2
- 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/tmux.conf +6 -0
- package/templates/opencode/agents/specdojo-orchestrator.md +3 -2
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { basename, join } from "node:path";
|
|
3
3
|
import { createProviderCapacityTracker, loadExecDefaultsConfig } from "../agent-config.js";
|
|
4
4
|
import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
|
|
5
|
-
import { readAllEventFiles, foldEventsToState } from "../events.js";
|
|
5
|
+
import { claimOwnerOf, readAllEventFiles, foldEventsToState } from "../events.js";
|
|
6
6
|
import { buildScheduleIndex, findStaleGeneratedTracks } from "../schedule/schedule.js";
|
|
7
7
|
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
8
8
|
import { scheduleTrackNames } from "../schedule/gantt-chart-scope.js";
|
|
@@ -214,10 +214,10 @@ export async function runBatchMode(opts) {
|
|
|
214
214
|
export function resolveClaimingActor(taskState, byOverride) {
|
|
215
215
|
if (byOverride)
|
|
216
216
|
return { actor: byOverride, resumed: false };
|
|
217
|
-
|
|
217
|
+
// The claim owner, not last_by: a human's plain unblock or note must not hand the run to them.
|
|
218
|
+
const actor = taskState?.state === "doing" ? claimOwnerOf(taskState) : undefined;
|
|
219
|
+
if (!actor)
|
|
218
220
|
return { actor: undefined, resumed: false };
|
|
219
|
-
}
|
|
220
|
-
const actor = taskState.last_by;
|
|
221
221
|
process.stdout.write(` Resuming with claiming actor: ${actor}\n`);
|
|
222
222
|
return { actor, resumed: true };
|
|
223
223
|
}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
|
+
import { withPlanConventionsFiles } from "../../shared/plan-conventions.js";
|
|
1
2
|
import { existsSync } from "node:fs";
|
|
2
3
|
import { join } from "node:path";
|
|
4
|
+
import { ensureReviewGrade, reviewGradeFreshness, } from "../../review/grade.js";
|
|
5
|
+
import { findDeliverableInfo, reviewGradeSummaryText } from "../plans-core.js";
|
|
6
|
+
import { enforceKataReviewVerdict, kataReviewSummary, scheduleKataReviewSubjects, } from "../review-kata.js";
|
|
3
7
|
import { resolveMemberCommand } from "../agent-config.js";
|
|
4
|
-
import { canCompleteTask,
|
|
5
|
-
import { buildScheduleIndex } from "../schedule/schedule.js";
|
|
6
|
-
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
7
|
-
import { qualifyTaskId, randomHex } from "../shared.js";
|
|
8
|
-
import { generateSinglePlan, finalizeResultSectionsForDeliverable, targetDocIdsForScheduledTask, reviewGradeSubject, } from "../plans.js";
|
|
9
|
-
import { ensureReviewGrade } from "../../review/grade.js";
|
|
8
|
+
import { canCompleteTask, foldEventsToState, readAllEventFiles } from "../events.js";
|
|
10
9
|
import { gradeCheckpointPaths } from "../grade-checkpoint.js";
|
|
10
|
+
import { pipelineStateLocation } from "../pipeline-state.js";
|
|
11
|
+
import { finalizeResultSectionsForDeliverable, generateSinglePlan, reviewGradeSubject, targetDocIdsForScheduledTask, } from "../plans.js";
|
|
11
12
|
import { isResultUnfilled, readResultFrontmatterSnapshot, scaffoldResult } from "../results.js";
|
|
12
|
-
import {
|
|
13
|
+
import { findRunRecord, recordPathForRead, recordRef, recordStem } from "../run-records.js";
|
|
14
|
+
import { buildInitialStateFromStrategy } from "../schedule/initial.js";
|
|
15
|
+
import { buildScheduleIndex } from "../schedule/schedule.js";
|
|
16
|
+
import { qualifyTaskId } from "../shared.js";
|
|
13
17
|
import { configuredProductRepos, plannedProjectWorktreePath, preflightProductBranches, productBranchForTask, } from "../task-repos.js";
|
|
14
|
-
import { checkpointAndEnsureWorktree, discardStaleExecWorktree } from "../worktree-ops.js";
|
|
15
|
-
import {
|
|
16
|
-
import { collectBusyActors, pinnedExecutor, pinnedReporter, resolveAgentOverride, resolveExecDefaultsPath, resolvePinnedRateLimitRunOptions, resolveTaskPhaseContext, selectCandidates, } from "./shared.js";
|
|
18
|
+
import { checkpointAndEnsureWorktree, discardStaleExecWorktree, refreshWorktreeCheckpoint, } from "../worktree-ops.js";
|
|
19
|
+
import { findExecWorktree, worktreeNameFromTaskId } from "../worktree.js";
|
|
17
20
|
import { buildExecutorPrompt, executorRequirements, loadPrompt, pathInsideWorktree, reportProductWorktrees, reporterRequirements, resolveReporterAgentCandidates, } from "./agent.js";
|
|
18
21
|
import { integrateLogPath, spawnClaim, spawnRelease } from "./mode-shared.js";
|
|
19
|
-
|
|
22
|
+
import { collectBusyActors, pinnedExecutor, pinnedReporter, resolveAgentOverride, resolveExecDefaultsPath, resolvePinnedRateLimitRunOptions, resolveTaskPhaseContext, selectCandidates, } from "./shared.js";
|
|
23
|
+
export function findClaimEventPath(schedulePath, taskId, worktreeRef) {
|
|
20
24
|
const claims = readAllEventFiles(schedulePath).filter((item) => item.event.task_id === taskId && item.event.type === "claim");
|
|
25
|
+
if (worktreeRef && existsSync(worktreeRef.worktreePath)) {
|
|
26
|
+
for (let i = claims.length - 1; i >= 0; i -= 1) {
|
|
27
|
+
const candidate = claims[i].path;
|
|
28
|
+
if (existsSync(pathInsideWorktree(worktreeRef.repoRoot, worktreeRef.worktreePath, candidate))) {
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
21
33
|
return claims[claims.length - 1]?.path ?? null;
|
|
22
34
|
}
|
|
23
35
|
// review フェーズの前段で runner が対象文書へ grade を実行する(PJR-KCMH、PJR-2ZVS 3.6)。
|
|
24
36
|
// executor には実行させない。評価結果が最新(content_hash 一致)なら再実行しない。
|
|
25
|
-
// grade
|
|
37
|
+
// grade は失敗すると再試行する。それでも失敗した場合も review は止めず、結果を plan に示すが、
|
|
38
|
+
// runner はそのタスクを done にせず blocked にする(PJR-M18B)。
|
|
26
39
|
export async function gradeBeforeReviewPlan(params) {
|
|
27
40
|
const { task, projectId } = params;
|
|
28
41
|
if ((task.mode ?? "edit") !== "review" || !projectId)
|
|
@@ -30,29 +43,115 @@ export async function gradeBeforeReviewPlan(params) {
|
|
|
30
43
|
const subject = reviewGradeSubject(params.catalogPath ?? "", task);
|
|
31
44
|
if (!subject) {
|
|
32
45
|
process.stdout.write(" [grade] skipped: grade subject is not resolvable\n");
|
|
33
|
-
return { action: "not-run", detail: "評価対象のパスを解決できない" };
|
|
34
46
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
if (subject)
|
|
48
|
+
process.stdout.write(` [grade] checking ${subject.path} (--target ${subject.target})\n`);
|
|
49
|
+
const outcome = subject
|
|
50
|
+
? await ensureReviewGrade({
|
|
51
|
+
taskId: qualifyTaskId(projectId, task.id),
|
|
52
|
+
projectId,
|
|
53
|
+
subjectPath: subject.path,
|
|
54
|
+
target: subject.target,
|
|
55
|
+
repoRoot: params.repoRoot,
|
|
56
|
+
dryRun: params.dryRun,
|
|
57
|
+
by: params.by,
|
|
58
|
+
execDefaultsPath: params.execDefaultsPath,
|
|
59
|
+
})
|
|
60
|
+
: { action: "not-run", detail: "評価対象のパスを解決できない" };
|
|
61
|
+
const deliverable = task.local_id && params.catalogPath
|
|
62
|
+
? findDeliverableInfo(params.catalogPath, task.local_id)
|
|
63
|
+
: null;
|
|
64
|
+
for (const kata of scheduleKataReviewSubjects(task, deliverable, projectId)) {
|
|
65
|
+
if (kata.path === subject?.path && subject?.target === "kata")
|
|
66
|
+
continue;
|
|
67
|
+
process.stdout.write(` [grade] checking ${kata.label}: ${kata.path} (--target kata)\n`);
|
|
68
|
+
const kataOutcome = await ensureReviewGrade({
|
|
69
|
+
taskId: qualifyTaskId(projectId, task.id),
|
|
70
|
+
projectId,
|
|
71
|
+
subjectPath: kata.path === "_MISSING_" ? "" : kata.path,
|
|
72
|
+
target: "kata",
|
|
73
|
+
repoRoot: params.repoRoot,
|
|
74
|
+
dryRun: params.dryRun,
|
|
75
|
+
by: params.by,
|
|
76
|
+
execDefaultsPath: params.execDefaultsPath,
|
|
77
|
+
});
|
|
78
|
+
if (kataOutcome.action === "failed" || kataOutcome.action === "not-run") {
|
|
79
|
+
process.stdout.write(` [grade] ${kata.label}: ${kataOutcome.detail}\n`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
46
82
|
const summary = outcome.action === "skipped"
|
|
47
83
|
? "skipped: content_hash matches the stored grade"
|
|
48
84
|
: outcome.action === "executed"
|
|
49
85
|
? `executed: run id ${outcome.runId}`
|
|
50
86
|
: outcome.action === "failed"
|
|
51
|
-
? `failed: run id ${outcome.runId}; ${outcome.detail}`
|
|
87
|
+
? `failed after ${outcome.attempts} attempt(s): run id ${outcome.runId}; ${outcome.detail}`
|
|
52
88
|
: `not run: ${outcome.detail}`;
|
|
53
89
|
process.stdout.write(` [grade] ${summary}\n`);
|
|
54
90
|
return outcome;
|
|
55
91
|
}
|
|
92
|
+
// Root-side grade sidecars of the deliverable and kata subjects that the review judges.
|
|
93
|
+
export function reviewGradeSidecarPaths(params) {
|
|
94
|
+
const { task, projectId } = params;
|
|
95
|
+
const deliverable = task.local_id && params.catalogPath
|
|
96
|
+
? findDeliverableInfo(params.catalogPath, task.local_id)
|
|
97
|
+
: null;
|
|
98
|
+
const subjectPaths = [
|
|
99
|
+
reviewGradeSubject(params.catalogPath ?? "", task)?.path,
|
|
100
|
+
...scheduleKataReviewSubjects(task, deliverable, projectId).map((kata) => kata.path),
|
|
101
|
+
].filter((path) => !!path && path !== "_MISSING_");
|
|
102
|
+
const sidecars = subjectPaths.flatMap((subjectPath) => {
|
|
103
|
+
const freshness = reviewGradeFreshness({ subjectPath, projectId, rootDir: params.repoRoot });
|
|
104
|
+
return "sidecarPath" in freshness && freshness.sidecarPath ? [freshness.sidecarPath] : [];
|
|
105
|
+
});
|
|
106
|
+
return [...new Set(sidecars)].sort();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A resumed review reuses the exec branch, which still holds the grade from its first checkpoint.
|
|
110
|
+
* Bring the grade the runner just checked into the branch so the review agent and the completion
|
|
111
|
+
* check judge the same grade as the runner (PJR-ZSRD). Returns the refreshed repo-relative paths.
|
|
112
|
+
*/
|
|
113
|
+
export function refreshReviewGradeCheckpoint(params) {
|
|
114
|
+
const { task, projectId } = params;
|
|
115
|
+
if ((task.mode ?? "edit") !== "review" || !projectId)
|
|
116
|
+
return [];
|
|
117
|
+
const refreshed = refreshWorktreeCheckpoint({
|
|
118
|
+
repoRoot: params.repoRoot,
|
|
119
|
+
worktreePath: params.worktree.path,
|
|
120
|
+
paths: reviewGradeSidecarPaths({ ...params, projectId }),
|
|
121
|
+
commitMessage: `exec(${task.id}): refresh grade before resumed review`,
|
|
122
|
+
failureLogPath: params.failureLogPath,
|
|
123
|
+
});
|
|
124
|
+
for (const path of refreshed)
|
|
125
|
+
process.stdout.write(` [grade] refreshed in worktree: ${path}\n`);
|
|
126
|
+
return refreshed;
|
|
127
|
+
}
|
|
128
|
+
// The stored plan keeps the grade summary of its first run. Tell the resumed review which grade
|
|
129
|
+
// the runner checked now so it does not judge from the outdated section.
|
|
130
|
+
export function resumedReviewGradeNote(task, projectId, catalogPath, outcome) {
|
|
131
|
+
const subject = reviewGradeSubject(catalogPath ?? "", task);
|
|
132
|
+
const deliverable = task.local_id && catalogPath ? findDeliverableInfo(catalogPath, task.local_id) : null;
|
|
133
|
+
const summary = [
|
|
134
|
+
subject ? reviewGradeSummaryText(projectId, subject.path, outcome) : "",
|
|
135
|
+
kataReviewSummary(scheduleKataReviewSubjects(task, deliverable, projectId), projectId),
|
|
136
|
+
]
|
|
137
|
+
.filter(Boolean)
|
|
138
|
+
.join("\n\n");
|
|
139
|
+
return [
|
|
140
|
+
"## 再開の前に runner が確認した評価結果",
|
|
141
|
+
"",
|
|
142
|
+
"runner は再開の前に grade を確認し、最新の評価結果サイドカーをこの worktree に取り込んだ。plan の `評価結果` の節は前回の実行の時点のものであり、判定にはこの節と評価結果サイドカーを使う。",
|
|
143
|
+
"",
|
|
144
|
+
summary,
|
|
145
|
+
].join("\n");
|
|
146
|
+
}
|
|
147
|
+
export function enforceScheduleKataReview(params) {
|
|
148
|
+
if (params.task.mode !== "review" || !params.projectId)
|
|
149
|
+
return;
|
|
150
|
+
const deliverable = params.task.local_id && params.catalogPath
|
|
151
|
+
? findDeliverableInfo(params.catalogPath, params.task.local_id)
|
|
152
|
+
: null;
|
|
153
|
+
enforceKataReviewVerdict(params.resultPath, scheduleKataReviewSubjects(params.task, deliverable, params.projectId), params.projectId, params.rootDir);
|
|
154
|
+
}
|
|
56
155
|
export async function prepareSingleTask(task, projectId, repoRoot, schedulePath, executionPath, roster, localIdToPhaseSets, phaseSetSuffixToId, agentNicknameOverride, modeAgentOverrides, stageAgentOverrides, actorOverride, dryRun, skipClaim, worktreeBase, planGenPaths, execDefaults, hasProviderCapacity, pipelineResume, rateLimitOverrides = {}) {
|
|
57
156
|
const mode = task.mode ?? "edit";
|
|
58
157
|
process.stdout.write(`Task: ${task.id}${task.name ? ` — ${task.name}` : ""} [${mode}]\n`);
|
|
@@ -81,7 +180,9 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
81
180
|
]
|
|
82
181
|
: [];
|
|
83
182
|
let actor = actorOverride ?? "auto-agent";
|
|
84
|
-
if (overrideResolution.kind === "command" &&
|
|
183
|
+
if (overrideResolution.kind === "command" &&
|
|
184
|
+
overrideResolution.actor &&
|
|
185
|
+
(!skipClaim || (Boolean(stageAgentOverrides.executor) && pipelineResume?.stage !== "reporter"))) {
|
|
85
186
|
actor = overrideResolution.actor;
|
|
86
187
|
}
|
|
87
188
|
if (agentCandidates.length === 0) {
|
|
@@ -163,36 +264,66 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
163
264
|
const reporterRateLimitOptions = reporterPinned && reporterCandidates?.[0]
|
|
164
265
|
? resolvePinnedRateLimitRunOptions(rateLimitOverrides, execDefaults, roster, "reporter", reporterCandidates[0])
|
|
165
266
|
: undefined;
|
|
267
|
+
// A resumed claim stays with the actor that already holds it, even when a stage override
|
|
268
|
+
// selects another agent to run.
|
|
269
|
+
const claimActor = skipClaim ? (actorOverride ?? actor) : actor;
|
|
270
|
+
// The runner grades before any review agent starts, including an executor resume (PJR-ZSRD).
|
|
271
|
+
const reviewGradeOutcome = await gradeBeforeReviewPlan({
|
|
272
|
+
task,
|
|
273
|
+
projectId,
|
|
274
|
+
catalogPath: planGenPaths.catalogPath,
|
|
275
|
+
repoRoot,
|
|
276
|
+
dryRun,
|
|
277
|
+
by: agentCandidates[0]?.actor,
|
|
278
|
+
execDefaultsPath: resolveExecDefaultsPath(rateLimitOverrides, schedulePath),
|
|
279
|
+
});
|
|
280
|
+
const withResumedGradeNote = (text, refreshed) => refreshed.length > 0 && projectId
|
|
281
|
+
? `${text.trimEnd()}\n\n${resumedReviewGradeNote(task, projectId, planGenPaths.catalogPath, reviewGradeOutcome)}\n`
|
|
282
|
+
: text;
|
|
166
283
|
if (pipelineResume?.executorTarget) {
|
|
167
284
|
const { executorTarget, worktree } = pipelineResume;
|
|
168
285
|
if (!worktree)
|
|
169
286
|
throw new Error(`no exec worktree to resume executor for ${task.id}`);
|
|
170
287
|
const worktreeExecutionPath = pathInsideWorktree(repoRoot, worktree.path, executionPath);
|
|
171
|
-
const
|
|
172
|
-
|
|
288
|
+
const refreshed = dryRun
|
|
289
|
+
? []
|
|
290
|
+
: refreshReviewGradeCheckpoint({
|
|
291
|
+
task,
|
|
292
|
+
projectId,
|
|
293
|
+
catalogPath: planGenPaths.catalogPath,
|
|
294
|
+
repoRoot,
|
|
295
|
+
worktree,
|
|
296
|
+
});
|
|
297
|
+
const storedPlan = loadPrompt(worktreeExecutionPath, task.id);
|
|
298
|
+
const planPrompt = storedPlan ? withResumedGradeNote(storedPlan, refreshed) : storedPlan;
|
|
299
|
+
const resultPath = recordPathForRead(executionPath, "result", task.id);
|
|
173
300
|
const worktreeResultPath = pathInsideWorktree(repoRoot, worktree.path, resultPath);
|
|
174
301
|
if (!planPrompt || !existsSync(resultPath) || !existsSync(worktreeResultPath)) {
|
|
175
302
|
throw new Error(`plan or result is missing for executor resume: ${task.id}`);
|
|
176
303
|
}
|
|
177
|
-
const claimEventPath = findClaimEventPath(schedulePath, task.id
|
|
304
|
+
const claimEventPath = findClaimEventPath(schedulePath, task.id, {
|
|
305
|
+
repoRoot,
|
|
306
|
+
worktreePath: worktree.path,
|
|
307
|
+
});
|
|
178
308
|
if (!claimEventPath)
|
|
179
309
|
throw new Error(`claim event is missing for executor resume: ${task.id}`);
|
|
180
310
|
reportProductWorktrees(worktree);
|
|
181
311
|
return {
|
|
182
312
|
task,
|
|
183
313
|
actor,
|
|
314
|
+
claimActor,
|
|
184
315
|
agentCandidates,
|
|
185
316
|
plan: planPrompt,
|
|
186
317
|
prompt: buildExecutorPrompt(planPrompt, execDefaults.pipeline?.parent_validations),
|
|
187
318
|
worktree,
|
|
188
319
|
resultPath,
|
|
189
320
|
resultScaffold: readResultFrontmatterSnapshot(resultPath),
|
|
190
|
-
checkpointPaths: [
|
|
191
|
-
|
|
321
|
+
checkpointPaths: withPlanConventionsFiles([
|
|
322
|
+
recordPathForRead(executionPath, "plan", task.id),
|
|
192
323
|
resultPath,
|
|
193
324
|
claimEventPath,
|
|
194
325
|
...gradeCheckpointPaths({ repoRoot, executionPath }),
|
|
195
|
-
],
|
|
326
|
+
]),
|
|
196
327
|
pipelineRunId: executorTarget.runId,
|
|
197
328
|
pipelineResumeStage: "executor",
|
|
198
329
|
pipelineStateRef: executorTarget.stateRef,
|
|
@@ -201,28 +332,22 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
201
332
|
reporterCandidates,
|
|
202
333
|
executorRateLimitOptions,
|
|
203
334
|
reporterRateLimitOptions,
|
|
335
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
336
|
+
...(refreshed.length > 0 ? { reviewGradeRefreshed: refreshed } : {}),
|
|
204
337
|
};
|
|
205
338
|
}
|
|
206
|
-
const reviewGradeOutcome = await gradeBeforeReviewPlan({
|
|
207
|
-
task,
|
|
208
|
-
projectId,
|
|
209
|
-
catalogPath: planGenPaths.catalogPath,
|
|
210
|
-
repoRoot,
|
|
211
|
-
dryRun,
|
|
212
|
-
by: agentCandidates[0]?.actor,
|
|
213
|
-
execDefaultsPath: resolveExecDefaultsPath(rateLimitOverrides, schedulePath),
|
|
214
|
-
});
|
|
215
339
|
// Plans are generated on demand here; `exec refresh` does not manage them.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
340
|
+
if (!skipClaim || !findRunRecord(executionPath, "plan", task.id))
|
|
341
|
+
await generateSinglePlan({
|
|
342
|
+
executionPath,
|
|
343
|
+
projectId: projectId ?? "",
|
|
344
|
+
catalogPath: planGenPaths.catalogPath ?? "",
|
|
345
|
+
rolesPath: planGenPaths.rolesPath,
|
|
346
|
+
viewpointsPath: planGenPaths.viewpointsPath,
|
|
347
|
+
projectContext: planGenPaths.projectContext,
|
|
348
|
+
task,
|
|
349
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
350
|
+
});
|
|
226
351
|
const planPrompt = loadPrompt(executionPath, task.id);
|
|
227
352
|
if (!planPrompt) {
|
|
228
353
|
process.stdout.write(` Plan not found for ${task.id}.\n`);
|
|
@@ -232,7 +357,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
232
357
|
? buildExecutorPrompt(planPrompt, execDefaults.pipeline?.parent_validations)
|
|
233
358
|
: planPrompt;
|
|
234
359
|
const pipelineRunId = task.agent_pipeline
|
|
235
|
-
?
|
|
360
|
+
? recordStem(recordPathForRead(executionPath, "plan", task.id))
|
|
236
361
|
: undefined;
|
|
237
362
|
const worktreeTaskId = qualifyTaskId(projectId, task.id);
|
|
238
363
|
const worktreeName = worktreeNameFromTaskId(worktreeTaskId);
|
|
@@ -264,6 +389,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
264
389
|
return {
|
|
265
390
|
task,
|
|
266
391
|
actor,
|
|
392
|
+
claimActor,
|
|
267
393
|
agentCandidates,
|
|
268
394
|
plan: planPrompt,
|
|
269
395
|
prompt,
|
|
@@ -274,6 +400,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
274
400
|
reporterCandidates,
|
|
275
401
|
executorRateLimitOptions,
|
|
276
402
|
reporterRateLimitOptions,
|
|
403
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
277
404
|
};
|
|
278
405
|
}
|
|
279
406
|
if (skipClaim) {
|
|
@@ -286,7 +413,7 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
286
413
|
return "failure";
|
|
287
414
|
}
|
|
288
415
|
}
|
|
289
|
-
const planRef =
|
|
416
|
+
const planRef = recordRef(executionPath, recordPathForRead(executionPath, "plan", task.id));
|
|
290
417
|
const startedAt = new Date().toISOString();
|
|
291
418
|
const finalizeSections = task.approach === "finalize" || task.approach === "bootstrap-finalize"
|
|
292
419
|
? finalizeResultSectionsForDeliverable(planGenPaths.catalogPath ?? "", task.local_id, task.approach)
|
|
@@ -307,7 +434,8 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
307
434
|
// Keep the execution checkpoint visible at root, but commit it only on the exec branch. The
|
|
308
435
|
// successful merge later brings plan/result/claim and deliverables to root in one first-parent
|
|
309
436
|
// commit (see runPreparedTask).
|
|
310
|
-
const
|
|
437
|
+
const existingWorktree = skipClaim ? findExecWorktree(repoRoot, worktreeTaskId) : null;
|
|
438
|
+
const claimEventPath = findClaimEventPath(schedulePath, task.id, existingWorktree ? { repoRoot, worktreePath: existingWorktree.path } : undefined);
|
|
311
439
|
if (!claimEventPath) {
|
|
312
440
|
process.stdout.write(` Claim event not found for ${task.id}\n`);
|
|
313
441
|
return "failure";
|
|
@@ -325,12 +453,12 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
325
453
|
process.stdout.write(` [run] discarded stale worktree/branch: ${discarded}\n`);
|
|
326
454
|
}
|
|
327
455
|
}
|
|
328
|
-
const checkpointPaths = [
|
|
329
|
-
|
|
456
|
+
const checkpointPaths = withPlanConventionsFiles([
|
|
457
|
+
recordPathForRead(executionPath, "plan", task.id),
|
|
330
458
|
resultPath,
|
|
331
459
|
claimEventPath,
|
|
332
460
|
...gradeCheckpointPaths({ repoRoot, executionPath }),
|
|
333
|
-
];
|
|
461
|
+
]);
|
|
334
462
|
const checkpointFailureLogPath = pipelineRunId
|
|
335
463
|
? integrateLogPath(pipelineStateLocation({
|
|
336
464
|
repoRoot,
|
|
@@ -365,12 +493,24 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
365
493
|
const setupAction = worktree.created ? "setup" : "reuse";
|
|
366
494
|
process.stdout.write(` [run] ${setupAction}: worktree ${worktree.path} (${worktree.branch})\n`);
|
|
367
495
|
reportProductWorktrees(worktree);
|
|
496
|
+
// A fresh claim checkpoints the current grade; a resume keeps the branch and needs a refresh.
|
|
497
|
+
const reviewGradeRefreshed = skipClaim
|
|
498
|
+
? refreshReviewGradeCheckpoint({
|
|
499
|
+
task,
|
|
500
|
+
projectId,
|
|
501
|
+
catalogPath: planGenPaths.catalogPath,
|
|
502
|
+
repoRoot,
|
|
503
|
+
worktree,
|
|
504
|
+
failureLogPath: checkpointFailureLogPath,
|
|
505
|
+
})
|
|
506
|
+
: [];
|
|
368
507
|
return {
|
|
369
508
|
task,
|
|
370
509
|
actor,
|
|
510
|
+
claimActor,
|
|
371
511
|
agentCandidates,
|
|
372
|
-
plan: planPrompt,
|
|
373
|
-
prompt,
|
|
512
|
+
plan: withResumedGradeNote(planPrompt, reviewGradeRefreshed),
|
|
513
|
+
prompt: withResumedGradeNote(prompt, reviewGradeRefreshed),
|
|
374
514
|
worktree,
|
|
375
515
|
resultPath,
|
|
376
516
|
resultScaffold: readResultFrontmatterSnapshot(resultPath),
|
|
@@ -381,6 +521,8 @@ export async function prepareSingleTask(task, projectId, repoRoot, schedulePath,
|
|
|
381
521
|
reporterCandidates,
|
|
382
522
|
executorRateLimitOptions,
|
|
383
523
|
reporterRateLimitOptions,
|
|
524
|
+
...(reviewGradeOutcome ? { reviewGradeOutcome } : {}),
|
|
525
|
+
...(reviewGradeRefreshed.length > 0 ? { reviewGradeRefreshed } : {}),
|
|
384
526
|
};
|
|
385
527
|
}
|
|
386
528
|
// An agent can exit 0 without doing the work (e.g. a permission-denied tool call is fed back as a
|