specdojo 0.1.0 → 0.2.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/LICENSE +22 -0
- package/README.md +82 -38
- package/dist/agent-response.js +27 -0
- package/dist/agent.js +124 -0
- package/dist/build-command.js +149 -0
- package/dist/build-if-stale.js +35 -0
- package/dist/catalog-build.js +1079 -0
- package/dist/catalog-generate.js +226 -0
- package/dist/catalog-paths.js +31 -0
- package/dist/catalog-plan-generate.js +301 -0
- package/dist/catalog-plan-prompt.js +73 -0
- package/dist/catalog-plan.js +471 -0
- package/dist/catalog-scaffold.js +255 -0
- package/dist/catalog-types.js +4 -0
- package/dist/catalog.js +606 -0
- package/dist/dashboard.js +980 -0
- package/dist/deliverable-trash.js +148 -0
- package/dist/deliverable.js +97 -0
- package/dist/dist-freshness.js +150 -0
- package/dist/doc-index.js +424 -0
- package/dist/exec-agent-config.js +172 -0
- package/dist/exec-agent-git-state.js +136 -0
- package/dist/exec-agent-protected-config.js +276 -0
- package/dist/exec-events.js +250 -112
- package/dist/exec-evidence.js +317 -0
- package/dist/exec-format.js +45 -0
- package/dist/exec-limit.js +202 -0
- package/dist/exec-parent-validation.js +169 -0
- package/dist/exec-pipeline-state.js +160 -0
- package/dist/exec-plans.js +1016 -0
- package/dist/exec-project.js +25 -11
- package/dist/exec-protection-handoff.js +169 -0
- package/dist/exec-provider-scaffold.js +99 -0
- package/dist/exec-register-resume.js +196 -0
- package/dist/exec-register.js +281 -0
- package/dist/exec-reporter.js +329 -0
- package/dist/exec-results.js +510 -0
- package/dist/exec-run-lock.js +149 -0
- package/dist/exec-run.js +4953 -0
- package/dist/exec-schedule-calendar.js +86 -9
- package/dist/exec-schedule-cpm.js +30 -12
- package/dist/exec-schedule-gantt-chart-render.js +428 -0
- package/dist/exec-schedule-gantt-chart-scope.js +111 -0
- package/dist/exec-schedule-gantt-chart.js +2 -0
- package/dist/exec-schedule-hash.js +34 -25
- package/dist/exec-schedule-index.js +200 -67
- package/dist/exec-schedule-initial.js +100 -0
- package/dist/exec-schedule-progress.js +51 -26
- package/dist/exec-schedule-ready.js +71 -27
- package/dist/exec-schedule.js +171 -93
- package/dist/exec-shared.js +146 -25
- package/dist/exec-strategy.js +547 -0
- package/dist/exec-task-view.js +64 -0
- package/dist/exec-trial.js +895 -0
- package/dist/exec-worktree-command.js +426 -0
- package/dist/exec-worktree-ops.js +847 -0
- package/dist/exec-worktree.js +359 -0
- package/dist/exec.js +744 -192
- package/dist/frontmatter-namespace.js +48 -0
- package/dist/git-environment.js +23 -0
- package/dist/grade-result.js +137 -0
- package/dist/grade.js +2456 -0
- package/dist/index-command.js +103 -0
- package/dist/job.js +1081 -0
- package/dist/kata-command.js +303 -0
- package/dist/kata.js +187 -0
- package/dist/package-paths.js +15 -0
- package/dist/practice-id.js +24 -0
- package/dist/register-date.js +122 -0
- package/dist/register-events.js +363 -0
- package/dist/register-history.js +323 -0
- package/dist/register-item.js +455 -0
- package/dist/register-migrate-timestamps.js +176 -0
- package/dist/register.js +2199 -0
- package/dist/review-plan.js +199 -0
- package/dist/review-types.js +1 -0
- package/dist/role-types.js +1 -0
- package/dist/routine.js +814 -0
- package/dist/schedule-approach.js +252 -0
- package/dist/schedule-build.js +552 -0
- package/dist/schedule-phase-sets.js +73 -0
- package/dist/schedule-strategy-generate.js +812 -0
- package/dist/schedule-strategy-profiles.js +276 -0
- package/dist/schedule.js +420 -0
- package/dist/spawn-self.js +28 -0
- package/dist/specdojo-config.js +133 -39
- package/dist/specdojo.js +55 -7
- package/dist/template-frontmatter.js +89 -0
- package/dist/template-resolution.js +92 -0
- package/dist/timeline-build.js +334 -0
- package/dist/timeline.js +107 -0
- package/dist/watch.js +313 -0
- package/dist/yaml-pages-command.js +28 -0
- package/dist/yaml-pages.js +180 -0
- package/dist/yaml-schema-modeline.js +49 -0
- package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +600 -0
- package/docs/ja/specdojo/exec-templates/xep-bootstrap-template.md +120 -0
- package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +37 -0
- package/docs/ja/specdojo/exec-templates/xep-cross-deliverable-dedup-template.md +51 -0
- package/docs/ja/specdojo/exec-templates/xep-freeform-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +109 -0
- package/docs/ja/specdojo/exec-templates/xep-job-template.md +43 -0
- package/docs/ja/specdojo/exec-templates/xep-recipe-guided-template.md +82 -0
- package/docs/ja/specdojo/exec-templates/xep-recipe-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +42 -0
- package/docs/ja/specdojo/exec-templates/xep-register-template.md +49 -0
- package/docs/ja/specdojo/exec-templates/xep-retrofit-template.md +98 -0
- package/docs/ja/specdojo/exec-templates/xep-rulebook-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-sample-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-template-maintenance-template.md +86 -0
- package/docs/ja/specdojo/exec-templates/xep-template.md +66 -0
- package/docs/ja/specdojo/exec-templates/xer-cross-deliverable-dedup-template.md +31 -0
- package/docs/ja/specdojo/exec-templates/xer-human-bootstrap-finalize-template.md +40 -0
- package/docs/ja/specdojo/exec-templates/xer-human-finalize-template.md +30 -0
- package/docs/ja/specdojo/exec-templates/xer-template.md +19 -0
- package/docs/ja/specdojo/exec-templates/xrp-freeform-template.md +70 -0
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +97 -0
- package/docs/ja/specdojo/exec-templates/xrp-recipe-guided-template.md +76 -0
- package/docs/ja/specdojo/exec-templates/xrp-recipe-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-retrofit-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xrp-rulebook-maintenance-template.md +74 -0
- package/docs/ja/specdojo/exec-templates/xrp-sample-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-template-maintenance-template.md +73 -0
- package/docs/ja/specdojo/exec-templates/xrp-template.md +67 -0
- package/docs/ja/specdojo/exec-templates/xrp-viewpoint-detail-template.md +7 -0
- package/docs/ja/specdojo/exec-templates/xrr-template.md +21 -0
- package/docs/ja/specdojo/exec-templates/xrr-viewpoint-detail-template.md +7 -0
- package/docs/ja/specdojo/guides/branch-workflow-guide.md +354 -0
- package/docs/ja/specdojo/guides/docs-editing-guide.md +327 -0
- package/docs/ja/specdojo/guides/docs-structure-guide.md +519 -0
- package/docs/ja/specdojo/guides/exec-config-guide.md +589 -0
- package/docs/ja/specdojo/guides/exec-operation-guide.md +440 -0
- package/docs/ja/specdojo/guides/exec-worktree-guide.md +318 -0
- package/docs/ja/specdojo/guides/kata-guide.md +89 -0
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +127 -0
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +228 -0
- package/docs/ja/specdojo/guides/practice-system-composition-guide.md +111 -0
- package/docs/ja/specdojo/guides/quick-start-guide.md +473 -0
- package/docs/ja/specdojo/guides/register-operation-guide.md +418 -0
- package/docs/ja/specdojo/guides/review-guide.md +428 -0
- package/docs/ja/specdojo/guides/routine-operation-guide.md +282 -0
- package/docs/ja/specdojo/guides/ryu-guide.md +230 -0
- package/docs/ja/specdojo/guides/schedule-design-guide.md +429 -0
- package/docs/ja/specdojo/guides/schedule-operation-guide.md +151 -0
- package/docs/ja/specdojo/guides/specdojo-overview-guide.md +257 -0
- package/docs/ja/specdojo/guides/timeline-design-guide.md +160 -0
- package/docs/ja/specdojo/guides/track-design-guide.md +215 -0
- package/docs/ja/specdojo/guides/use-case-guide.md +133 -0
- package/docs/ja/specdojo/guides/waza-guide.md +224 -0
- package/docs/ja/specdojo/index.md +33 -0
- package/docs/ja/specdojo/philosophy/needs-to-implementation-philosophy.md +212 -0
- package/docs/ja/specdojo/philosophy/specdojo-philosophy.md +242 -0
- package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +198 -0
- package/docs/ja/specdojo/recipes/cdfd-recipe.md +218 -0
- package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +198 -0
- package/docs/ja/specdojo/recipes/exec-human-finalize-recipe.md +100 -0
- package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +148 -0
- package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +97 -0
- package/docs/ja/specdojo/recipes/pm-members-recipe.md +149 -0
- package/docs/ja/specdojo/recipes/pm-organization-recipe.md +96 -0
- package/docs/ja/specdojo/recipes/pm-plan-recipe.md +98 -0
- package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +97 -0
- package/docs/ja/specdojo/recipes/pm-raci-recipe.md +96 -0
- package/docs/ja/specdojo/recipes/pm-roles-recipe.md +136 -0
- package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +162 -0
- package/docs/ja/specdojo/recipes/prj-charter-recipe.md +187 -0
- package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +235 -0
- package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +205 -0
- package/docs/ja/specdojo/recipes/prj-overview-recipe.md +289 -0
- package/docs/ja/specdojo/recipes/prj-scope-recipe.md +201 -0
- package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +168 -0
- package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +179 -0
- package/docs/ja/specdojo/recipes/stsd-recipe.md +138 -0
- package/docs/ja/specdojo/references/command-reference.md +718 -0
- package/docs/ja/specdojo/references/deliverables-reference.md +407 -0
- package/docs/ja/specdojo/references/directory-layout-reference.md +280 -0
- package/docs/ja/specdojo/references/specdojo-config-reference.md +133 -0
- package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +372 -0
- package/docs/ja/specdojo/rulebooks/atc-rulebook.md +302 -0
- package/docs/ja/specdojo/rulebooks/bac-rulebook.md +331 -0
- package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +134 -0
- package/docs/ja/specdojo/rulebooks/bds-rulebook.md +207 -0
- package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +102 -0
- package/docs/ja/specdojo/rulebooks/bes-rulebook.md +131 -0
- package/docs/ja/specdojo/rulebooks/bps-rulebook.md +269 -0
- package/docs/ja/specdojo/rulebooks/br-rulebook.md +187 -0
- package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +279 -0
- package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +219 -0
- package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +233 -0
- package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +182 -0
- package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +171 -0
- package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +105 -0
- package/docs/ja/specdojo/rulebooks/cld-rulebook.md +195 -0
- package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +285 -0
- package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +292 -0
- package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +171 -0
- package/docs/ja/specdojo/rulebooks/cop-rulebook.md +325 -0
- package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +266 -0
- package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +294 -0
- package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +21 -0
- package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +401 -0
- package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +311 -0
- package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +158 -0
- package/docs/ja/specdojo/rulebooks/dct-rulebook.md +287 -0
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +62 -0
- package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +100 -0
- package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +298 -0
- package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +379 -0
- package/docs/ja/specdojo/rulebooks/etc-rulebook.md +310 -0
- package/docs/ja/specdojo/rulebooks/gl-rulebook.md +86 -0
- package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +297 -0
- package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +79 -0
- package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +213 -0
- package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +311 -0
- package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +94 -0
- package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +81 -0
- package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +118 -0
- package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +421 -0
- package/docs/ja/specdojo/rulebooks/itc-rulebook.md +307 -0
- package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +312 -0
- package/docs/ja/specdojo/rulebooks/mm-rulebook.md +63 -0
- package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +353 -0
- package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +179 -0
- package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +183 -0
- package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +185 -0
- package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +185 -0
- package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +186 -0
- package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +186 -0
- package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +184 -0
- package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +61 -0
- package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +84 -0
- package/docs/ja/specdojo/rulebooks/opd-rulebook.md +357 -0
- package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +80 -0
- package/docs/ja/specdojo/rulebooks/opr-rulebook.md +484 -0
- package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +120 -0
- package/docs/ja/specdojo/rulebooks/otp-rulebook.md +293 -0
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +211 -0
- package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +94 -0
- package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +190 -0
- package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +108 -0
- package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +122 -0
- package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +116 -0
- package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +146 -0
- package/docs/ja/specdojo/rulebooks/pr-rulebook.md +65 -0
- package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +178 -0
- package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +232 -0
- package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +235 -0
- package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +242 -0
- package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +187 -0
- package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +201 -0
- package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +165 -0
- package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +165 -0
- package/docs/ja/specdojo/rulebooks/sac-rulebook.md +202 -0
- package/docs/ja/specdojo/rulebooks/sch-rulebook.md +139 -0
- package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +63 -0
- package/docs/ja/specdojo/rulebooks/sf-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/sld-rulebook.md +93 -0
- package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +329 -0
- package/docs/ja/specdojo/rulebooks/stc-rulebook.md +297 -0
- package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +132 -0
- package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +215 -0
- package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +376 -0
- package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +313 -0
- package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +246 -0
- package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +119 -0
- package/docs/ja/specdojo/rulebooks/tml-rulebook.md +188 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +114 -0
- package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +117 -0
- package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +101 -0
- package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +103 -0
- package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +396 -0
- package/docs/ja/specdojo/rulebooks/uis-rulebook.md +207 -0
- package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +387 -0
- package/docs/ja/specdojo/rulebooks/utc-rulebook.md +303 -0
- package/docs/ja/specdojo/samples/atc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/atc-sample.md +41 -0
- package/docs/ja/specdojo/samples/bac-sample.md +38 -0
- package/docs/ja/specdojo/samples/bdd-sample.yaml +71 -0
- package/docs/ja/specdojo/samples/bds-sample.md +38 -0
- package/docs/ja/specdojo/samples/bes-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/bes-sample.md +38 -0
- package/docs/ja/specdojo/samples/bps-sample.md +38 -0
- package/docs/ja/specdojo/samples/br-sample.md +40 -0
- package/docs/ja/specdojo/samples/ccd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cdfd-overview-sample.md +284 -0
- package/docs/ja/specdojo/samples/cdfd-sample.md +229 -0
- package/docs/ja/specdojo/samples/cdfd-uc-sample.md +146 -0
- package/docs/ja/specdojo/samples/cdsd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cld-sample.md +38 -0
- package/docs/ja/specdojo/samples/cnd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cop-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/cop-sample.md +38 -0
- package/docs/ja/specdojo/samples/cpd-sample.md +38 -0
- package/docs/ja/specdojo/samples/cstd-sample.md +11 -0
- package/docs/ja/specdojo/samples/cxd-sample.md +38 -0
- package/docs/ja/specdojo/samples/dct-index-sample.yaml +39 -0
- package/docs/ja/specdojo/samples/dct-sample.yaml +91 -0
- package/docs/ja/specdojo/samples/dec-sample.md +39 -0
- package/docs/ja/specdojo/samples/dmd-index-sample.md +50 -0
- package/docs/ja/specdojo/samples/dmd-sample.md +74 -0
- package/docs/ja/specdojo/samples/etc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/etc-sample.md +38 -0
- package/docs/ja/specdojo/samples/gl-sample.yaml +37 -0
- package/docs/ja/specdojo/samples/ifd-sample.md +38 -0
- package/docs/ja/specdojo/samples/ifx-api-sample.yaml +102 -0
- package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +107 -0
- package/docs/ja/specdojo/samples/ifx-file-sample.md +38 -0
- package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +89 -0
- package/docs/ja/specdojo/samples/imp-business-sample.md +66 -0
- package/docs/ja/specdojo/samples/imp-data-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-interface-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-operations-sample.md +60 -0
- package/docs/ja/specdojo/samples/imp-test-sample.md +60 -0
- package/docs/ja/specdojo/samples/itc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/itc-sample.md +38 -0
- package/docs/ja/specdojo/samples/mip-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/mm-sample.md +35 -0
- package/docs/ja/specdojo/samples/mtp-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-availability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-integrity-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-operations-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-performance-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-reliability-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +38 -0
- package/docs/ja/specdojo/samples/nfr-usability-sample.md +38 -0
- package/docs/ja/specdojo/samples/ntp-sample.md +38 -0
- package/docs/ja/specdojo/samples/opd-access-control-sample.md +29 -0
- package/docs/ja/specdojo/samples/opd-incident-management-sample.md +31 -0
- package/docs/ja/specdojo/samples/opd-index-sample.md +41 -0
- package/docs/ja/specdojo/samples/opd-monitoring-sample.md +32 -0
- package/docs/ja/specdojo/samples/opd-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-access-control-sample.md +24 -0
- package/docs/ja/specdojo/samples/opr-backup-restore-sample.md +27 -0
- package/docs/ja/specdojo/samples/opr-batch-sample.md +23 -0
- package/docs/ja/specdojo/samples/opr-change-sample.md +24 -0
- package/docs/ja/specdojo/samples/opr-incident-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-index-sample.md +43 -0
- package/docs/ja/specdojo/samples/opr-monitoring-sample.md +27 -0
- package/docs/ja/specdojo/samples/opr-sample.md +38 -0
- package/docs/ja/specdojo/samples/opr-support-sample.md +23 -0
- package/docs/ja/specdojo/samples/otp-index-sample.md +66 -0
- package/docs/ja/specdojo/samples/otp-sample.md +68 -0
- package/docs/ja/specdojo/samples/pm-change-request-log-sample.md +47 -0
- package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +46 -0
- package/docs/ja/specdojo/samples/pm-issue-log-sample.md +45 -0
- package/docs/ja/specdojo/samples/pm-members-sample.yaml +103 -0
- package/docs/ja/specdojo/samples/pm-organization-sample.md +46 -0
- package/docs/ja/specdojo/samples/pm-plan-sample.md +57 -0
- package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +52 -0
- package/docs/ja/specdojo/samples/pm-raci-sample.md +57 -0
- package/docs/ja/specdojo/samples/pm-risk-register-sample.md +43 -0
- package/docs/ja/specdojo/samples/pm-roles-sample.yaml +41 -0
- package/docs/ja/specdojo/samples/pr-sample.md +39 -0
- package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +57 -0
- package/docs/ja/specdojo/samples/prj-charter-sample.md +121 -0
- package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +105 -0
- package/docs/ja/specdojo/samples/prj-issues-and-approach-sample.md +78 -0
- package/docs/ja/specdojo/samples/prj-overview-sample.md +95 -0
- package/docs/ja/specdojo/samples/prj-scope-sample.md +71 -0
- package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +60 -0
- package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +62 -0
- package/docs/ja/specdojo/samples/sac-sample.md +38 -0
- package/docs/ja/specdojo/samples/sf-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/sf-sample.md +38 -0
- package/docs/ja/specdojo/samples/sld-sample.md +38 -0
- package/docs/ja/specdojo/samples/stc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/stc-sample.md +38 -0
- package/docs/ja/specdojo/samples/stsd-sample.md +58 -0
- package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +38 -0
- package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +38 -0
- package/docs/ja/specdojo/samples/sysd-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/trc-requirements-to-specs-sample.md +56 -0
- package/docs/ja/specdojo/samples/trc-requirements-to-tests-sample.md +56 -0
- package/docs/ja/specdojo/samples/tsd-index-sample.md +29 -0
- package/docs/ja/specdojo/samples/tsd-sample.md +38 -0
- package/docs/ja/specdojo/samples/tsp-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/uis-sample.md +38 -0
- package/docs/ja/specdojo/samples/utc-index-sample.md +38 -0
- package/docs/ja/specdojo/samples/utc-sample.md +38 -0
- package/docs/ja/specdojo/schemas/v1/guide-content.schema.yaml +20 -0
- package/docs/ja/specdojo/schemas/v1/philosophy-content.schema.yaml +21 -0
- package/docs/ja/specdojo/schemas/v1/reference-content.schema.yaml +21 -0
- package/docs/ja/specdojo/standards/document-metadata-standard.md +323 -0
- package/docs/ja/specdojo/standards/exec-human-finalize-standard.md +75 -0
- package/docs/ja/specdojo/standards/git-branching-standard.md +227 -0
- package/docs/ja/specdojo/standards/guide-authoring-standard.md +124 -0
- package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +929 -0
- package/docs/ja/specdojo/standards/job-definition-standard.md +148 -0
- package/docs/ja/specdojo/standards/people-and-organization-definition-standard.md +431 -0
- package/docs/ja/specdojo/standards/philosophy-authoring-standard.md +113 -0
- package/docs/ja/specdojo/standards/recipe-authoring-standard.md +143 -0
- package/docs/ja/specdojo/standards/reference-authoring-standard.md +99 -0
- package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +140 -0
- package/docs/ja/specdojo/standards/sample-authoring-standard.md +151 -0
- package/docs/ja/specdojo/standards/standard-authoring-standard.md +108 -0
- package/docs/ja/specdojo/standards/template-authoring-standard.md +101 -0
- package/docs/ja/specdojo/standards/test-document-scope-standard.md +176 -0
- package/docs/ja/specdojo/templates/cdfd-overview-template.md +199 -0
- package/docs/ja/specdojo/templates/cdfd-template.md +173 -0
- package/docs/ja/specdojo/templates/cdfd-uc-template.md +148 -0
- package/docs/ja/specdojo/templates/dct-architecture-template.yaml +136 -0
- package/docs/ja/specdojo/templates/dct-business-acceptance-criteria-template.yaml +34 -0
- package/docs/ja/specdojo/templates/dct-business-model-bes-template.yaml +75 -0
- package/docs/ja/specdojo/templates/dct-business-model-bps-template.yaml +49 -0
- package/docs/ja/specdojo/templates/dct-business-model-br-template.yaml +50 -0
- package/docs/ja/specdojo/templates/dct-data-flow-template.yaml +40 -0
- package/docs/ja/specdojo/templates/dct-data-model-bdd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-data-model-ccd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-data-model-cdsd-template.yaml +41 -0
- package/docs/ja/specdojo/templates/dct-data-model-cld-template.yaml +38 -0
- package/docs/ja/specdojo/templates/dct-data-model-sld-template.yaml +38 -0
- package/docs/ja/specdojo/templates/dct-data-model-stsd-template.yaml +46 -0
- package/docs/ja/specdojo/templates/dct-external-interface-specs-template.yaml +114 -0
- package/docs/ja/specdojo/templates/dct-glossary-template.yaml +35 -0
- package/docs/ja/specdojo/templates/dct-impact-analysis-template.yaml +138 -0
- package/docs/ja/specdojo/templates/dct-index-template.md +40 -0
- package/docs/ja/specdojo/templates/dct-migration-planning-template.yaml +148 -0
- package/docs/ja/specdojo/templates/dct-non-functional-requirements-template.yaml +222 -0
- package/docs/ja/specdojo/templates/dct-operations-template.yaml +108 -0
- package/docs/ja/specdojo/templates/dct-project-definition-template.yaml +210 -0
- package/docs/ja/specdojo/templates/dct-project-management-template.yaml +423 -0
- package/docs/ja/specdojo/templates/dct-system-acceptance-criteria-template.yaml +37 -0
- package/docs/ja/specdojo/templates/dct-system-design-template.yaml +82 -0
- package/docs/ja/specdojo/templates/dct-system-functions-template.yaml +58 -0
- package/docs/ja/specdojo/templates/dct-test-specs-template.yaml +261 -0
- package/docs/ja/specdojo/templates/dct-user-interface-model-template.yaml +60 -0
- package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +88 -0
- package/docs/ja/specdojo/templates/opr-template.md +85 -0
- package/docs/ja/specdojo/templates/pjr-change-request-template.md +60 -0
- package/docs/ja/specdojo/templates/pjr-decision-template.md +61 -0
- package/docs/ja/specdojo/templates/pjr-index-template.md +49 -0
- package/docs/ja/specdojo/templates/pjr-issue-template.md +50 -0
- package/docs/ja/specdojo/templates/pjr-note-template.md +35 -0
- package/docs/ja/specdojo/templates/pjr-question-template.md +53 -0
- package/docs/ja/specdojo/templates/pjr-risk-template.md +49 -0
- package/docs/ja/specdojo/templates/pjr-todo-template.md +41 -0
- package/docs/ja/specdojo/templates/pjr-views-by-owner-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-views-by-priority-template.md +22 -0
- package/docs/ja/specdojo/templates/pjr-views-by-status-template.md +22 -0
- package/docs/ja/specdojo/templates/pm-change-request-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-communication-plan-template.md +46 -0
- package/docs/ja/specdojo/templates/pm-decision-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-issue-log-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-members-template.yaml +105 -0
- package/docs/ja/specdojo/templates/pm-organization-template.md +44 -0
- package/docs/ja/specdojo/templates/pm-plan-template.md +52 -0
- package/docs/ja/specdojo/templates/pm-quality-management-plan-template.md +46 -0
- package/docs/ja/specdojo/templates/pm-raci-template.md +51 -0
- package/docs/ja/specdojo/templates/pm-risk-register-template.md +20 -0
- package/docs/ja/specdojo/templates/pm-roles-template.yaml +53 -0
- package/docs/ja/specdojo/templates/prj-assumptions-constraints-dependencies-template.md +59 -0
- package/docs/ja/specdojo/templates/prj-charter-template.md +116 -0
- package/docs/ja/specdojo/templates/prj-comparison-of-alternatives-template.md +116 -0
- package/docs/ja/specdojo/templates/prj-issues-and-approach-template.md +89 -0
- package/docs/ja/specdojo/templates/prj-overview-template.md +85 -0
- package/docs/ja/specdojo/templates/prj-scope-template.md +75 -0
- package/docs/ja/specdojo/templates/prj-stakeholder-register-template.md +64 -0
- package/docs/ja/specdojo/templates/prj-success-criteria-and-acceptance-criteria-template.md +60 -0
- package/docs/ja/specdojo/templates/stsd-template.md +57 -0
- package/docs/specdojo/schemas/v1/bdd.schema.yaml +230 -0
- package/docs/specdojo/schemas/v1/common-frontmatter.schema.yaml +77 -0
- package/docs/specdojo/schemas/v1/dct-index.schema.yaml +85 -0
- package/docs/specdojo/schemas/v1/dct-plan.schema.yaml +324 -0
- package/docs/specdojo/schemas/v1/dct.schema.yaml +368 -0
- package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +91 -0
- package/docs/specdojo/schemas/v1/esil.schema.yaml +142 -0
- package/docs/specdojo/schemas/v1/exec-common.schema.yaml +101 -0
- package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +272 -0
- package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +162 -0
- package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +126 -0
- package/docs/specdojo/schemas/v1/exec-reporter-output.schema.yaml +151 -0
- package/docs/specdojo/schemas/v1/exec-result-frontmatter.schema.yaml +144 -0
- package/docs/specdojo/schemas/v1/grade-done-criteria.schema.yaml +79 -0
- package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +60 -0
- package/docs/specdojo/schemas/v1/grade-result.schema.yaml +118 -0
- package/docs/specdojo/schemas/v1/guide-frontmatter.schema.yaml +19 -0
- package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +293 -0
- package/docs/specdojo/schemas/v1/job-run.schema.yaml +90 -0
- package/docs/specdojo/schemas/v1/job.schema.yaml +198 -0
- package/docs/specdojo/schemas/v1/philosophy-frontmatter.schema.yaml +19 -0
- package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +56 -0
- package/docs/specdojo/schemas/v1/pm-members.schema.yaml +252 -0
- package/docs/specdojo/schemas/v1/pm-review-viewpoints.schema.yaml +387 -0
- package/docs/specdojo/schemas/v1/pm-roles.schema.yaml +106 -0
- package/docs/specdojo/schemas/v1/recipe-frontmatter.schema.yaml +27 -0
- package/docs/specdojo/schemas/v1/reference-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +106 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +204 -0
- package/docs/specdojo/schemas/v1/routine-run.schema.yaml +36 -0
- package/docs/specdojo/schemas/v1/routine.schema.yaml +87 -0
- package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +61 -0
- package/docs/specdojo/schemas/v1/sch-common.schema.yaml +258 -0
- package/docs/specdojo/schemas/v1/sch-defaults.schema.yaml +48 -0
- package/docs/specdojo/schemas/v1/sch-milestones.schema.yaml +64 -0
- package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +772 -0
- package/docs/specdojo/schemas/v1/sch-track.schema.yaml +66 -0
- package/docs/specdojo/schemas/v1/standard-frontmatter.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/tml-index.schema.yaml +103 -0
- package/package.json +120 -24
- package/templates/claude/README.md +46 -0
- package/templates/claude/agents/claude-expert-review-executor.md +14 -0
- package/templates/claude/agents/claude-review-executor.md +14 -0
- package/templates/claude/settings.edit.json +6 -0
- package/templates/claude/settings.report.json +6 -0
- package/templates/claude/settings.review.json +7 -0
- package/templates/codex/README.md +61 -0
- package/templates/codex/agents/codex-executor.toml +12 -0
- package/templates/codex/agents/codex-expert-executor.toml +12 -0
- package/templates/codex/agents/codex-expert-review-executor.toml +10 -0
- package/templates/codex/agents/codex-review-executor.toml +10 -0
- package/templates/copilot/README.md +41 -0
- package/templates/copilot/exec-defaults-snippet.yaml +28 -0
- package/templates/copilot/pm-members-snippet.yaml +44 -0
- package/templates/opencode/README.md +41 -0
- package/templates/opencode/agents/opencode-executor.md +59 -0
- package/templates/opencode/agents/opencode-reporter.md +26 -0
- package/templates/opencode/agents/opencode-review-executor.md +48 -0
- package/dist/exec-schedule-timeline-render.js +0 -201
- package/dist/exec-schedule-timeline.js +0 -2
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
+
import { copyFileSync, existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { defaultExecDefaultsPath, loadExecDefaultsConfig, resolveMemberCommand, resolveRateLimitDetection, } from "./exec-agent-config.js";
|
|
6
|
+
import { agentProtectedConfigViolation, captureAgentProtectedConfigSnapshot, changedAgentProtectedConfigPaths, isAgentProtectedConfigPath, } from "./exec-agent-protected-config.js";
|
|
7
|
+
import { agentGitStateViolation, captureAgentGitStateSnapshot, changedAgentGitStateFields, } from "./exec-agent-git-state.js";
|
|
8
|
+
import { recordExecutorEvidence, } from "./exec-evidence.js";
|
|
9
|
+
import { activateResolvedProjectPaths, resolveProjectPaths } from "./exec-project.js";
|
|
10
|
+
import { buildExecutorPrompt, isRateLimitError, loadRosterForExecutionPath, runConfiguredParentValidations, } from "./exec-run.js";
|
|
11
|
+
import { parsePlanTaskIdentity } from "./exec-plans.js";
|
|
12
|
+
import { runReporterWithFormatRetry } from "./exec-reporter.js";
|
|
13
|
+
import { ensureDir, safeSlug } from "./exec-shared.js";
|
|
14
|
+
import { ensureExecWorktree, execBranchExists, findExecWorktree, gitEnvironment, gitOutput, gitResult, resolveWorktreeBase, worktreeNameFromTaskId, } from "./exec-worktree.js";
|
|
15
|
+
import { getProjectSchedulePath, loadConfig, specdojoRootDir, } from "./specdojo-config.js";
|
|
16
|
+
const TRIAL_PROMPT_SUFFIX = `
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Agent comparison trial instructions
|
|
21
|
+
|
|
22
|
+
This is an isolated comparison trial. Edit and validate the artifacts required by the plan, but
|
|
23
|
+
do not update task lifecycle state or create/update the result file. End the final response with
|
|
24
|
+
exactly one machine-readable executor evidence envelope as documented by SpecDojo.
|
|
25
|
+
`;
|
|
26
|
+
function sha256(value) {
|
|
27
|
+
return createHash("sha256").update(value).digest("hex");
|
|
28
|
+
}
|
|
29
|
+
function normalizePlanPathCandidate(value) {
|
|
30
|
+
const candidate = value
|
|
31
|
+
.trim()
|
|
32
|
+
.replace(/^\.\//u, "")
|
|
33
|
+
.replace(/:\d+(?::\d+)?$/u, "")
|
|
34
|
+
.replace(/[.,;]$/u, "");
|
|
35
|
+
if (!candidate ||
|
|
36
|
+
candidate.startsWith("/") ||
|
|
37
|
+
candidate.includes("://") ||
|
|
38
|
+
/[\s<>{}*?$]/u.test(candidate) ||
|
|
39
|
+
candidate === ".env" ||
|
|
40
|
+
candidate.startsWith("secrets/")) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (/^(?:\.specdojo|docs|scripts|src|tests|tools)\//u.test(candidate) ||
|
|
44
|
+
/^(?:lefthook\.yml|package\.json|tsconfig[^/]*\.json|vitest[^/]*\.ts)$/u.test(candidate)) {
|
|
45
|
+
return candidate;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
export function extractPlanRepoPaths(plan) {
|
|
50
|
+
const candidates = [];
|
|
51
|
+
for (const match of plan.matchAll(/`([^`\n]+)`/gu))
|
|
52
|
+
candidates.push(match[1]);
|
|
53
|
+
for (const match of plan.matchAll(/\]\(([^)\s]+)(?:\s+[^)]*)?\)/gu))
|
|
54
|
+
candidates.push(match[1]);
|
|
55
|
+
return [
|
|
56
|
+
...new Set(candidates
|
|
57
|
+
.map(normalizePlanPathCandidate)
|
|
58
|
+
.filter((candidate) => candidate !== null)),
|
|
59
|
+
].sort();
|
|
60
|
+
}
|
|
61
|
+
function objectExistsAtCommit(repoRoot, commit, path) {
|
|
62
|
+
return gitResult(repoRoot, ["cat-file", "-e", `${commit}:${path}`]).status === 0;
|
|
63
|
+
}
|
|
64
|
+
export function buildTrialBaseValidation(params) {
|
|
65
|
+
const referencedPaths = extractPlanRepoPaths(params.planContent).map((path) => ({
|
|
66
|
+
path,
|
|
67
|
+
exists_at_base: objectExistsAtCommit(params.repoRoot, params.resolvedCommit, path),
|
|
68
|
+
}));
|
|
69
|
+
const missingReferencedPaths = referencedPaths
|
|
70
|
+
.filter((entry) => !entry.exists_at_base)
|
|
71
|
+
.map((entry) => entry.path);
|
|
72
|
+
const planPathExistsAtBase = objectExistsAtCommit(params.repoRoot, params.resolvedCommit, params.planPath);
|
|
73
|
+
const warnings = [];
|
|
74
|
+
const baseIsAncestorOfHead = gitResult(params.repoRoot, [
|
|
75
|
+
"merge-base",
|
|
76
|
+
"--is-ancestor",
|
|
77
|
+
params.resolvedCommit,
|
|
78
|
+
params.headCommit,
|
|
79
|
+
]).status === 0;
|
|
80
|
+
if (!baseIsAncestorOfHead) {
|
|
81
|
+
warnings.push("The base commit is not an ancestor of HEAD; the current HEAD cannot be used as a linear reference result.");
|
|
82
|
+
}
|
|
83
|
+
if (!planPathExistsAtBase) {
|
|
84
|
+
warnings.push("The plan file is not present at the base commit; the current plan content will still be supplied to every trial.");
|
|
85
|
+
}
|
|
86
|
+
if (missingReferencedPaths.length > 0) {
|
|
87
|
+
warnings.push(`Referenced paths missing at the base commit: ${missingReferencedPaths.join(", ")}`);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
requested_revision: params.requestedRevision,
|
|
91
|
+
resolved_commit: params.resolvedCommit,
|
|
92
|
+
head_commit_at_start: params.headCommit,
|
|
93
|
+
base_is_ancestor_of_head: baseIsAncestorOfHead,
|
|
94
|
+
defaulted_to_head: params.defaultedToHead,
|
|
95
|
+
plan_path_exists_at_base: planPathExistsAtBase,
|
|
96
|
+
compatible: baseIsAncestorOfHead && missingReferencedPaths.length === 0,
|
|
97
|
+
referenced_paths: referencedPaths,
|
|
98
|
+
missing_referenced_paths: missingReferencedPaths,
|
|
99
|
+
warnings,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function classifyReporterFailure(result, reason) {
|
|
103
|
+
if (result === "rate_limit")
|
|
104
|
+
return "rate_limit";
|
|
105
|
+
return reason.startsWith("reporter output invalid after")
|
|
106
|
+
? "invalid_output"
|
|
107
|
+
: "invocation_failure";
|
|
108
|
+
}
|
|
109
|
+
function hasValidExecutorEnvelope(stdout) {
|
|
110
|
+
const matches = [
|
|
111
|
+
...stdout.matchAll(/<specdojo_executor_evidence>\s*([\s\S]*?)\s*<\/specdojo_executor_evidence>/gu),
|
|
112
|
+
];
|
|
113
|
+
const raw = matches.at(-1)?.[1];
|
|
114
|
+
if (!raw)
|
|
115
|
+
return false;
|
|
116
|
+
try {
|
|
117
|
+
const value = JSON.parse(raw);
|
|
118
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
119
|
+
return false;
|
|
120
|
+
const report = value;
|
|
121
|
+
return typeof report.final_message === "string" && Array.isArray(report.validations);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function repoRelative(repoRoot, path) {
|
|
128
|
+
const value = relative(repoRoot, path);
|
|
129
|
+
if (!value || value === ".." || value.startsWith(`..${sep}`)) {
|
|
130
|
+
throw new Error(`Path is outside repository root: ${path}`);
|
|
131
|
+
}
|
|
132
|
+
return value.split(sep).join("/");
|
|
133
|
+
}
|
|
134
|
+
function comparisonDir(executionPath, comparisonId) {
|
|
135
|
+
return join(executionPath, "exec", "trials", safeSlug(comparisonId));
|
|
136
|
+
}
|
|
137
|
+
function comparisonPath(executionPath, comparisonId) {
|
|
138
|
+
return join(comparisonDir(executionPath, comparisonId), "comparison.json");
|
|
139
|
+
}
|
|
140
|
+
function writeComparison(path, value) {
|
|
141
|
+
ensureDir(dirname(path));
|
|
142
|
+
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
143
|
+
writeFileSync(temporary, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
144
|
+
renameSync(temporary, path);
|
|
145
|
+
}
|
|
146
|
+
function readComparison(path) {
|
|
147
|
+
if (!existsSync(path))
|
|
148
|
+
throw new Error(`Comparison not found: ${path}`);
|
|
149
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
150
|
+
}
|
|
151
|
+
function configuredWorktreeBase(schedulePath) {
|
|
152
|
+
const { config } = loadConfig();
|
|
153
|
+
if (!config)
|
|
154
|
+
return undefined;
|
|
155
|
+
const rootDir = specdojoRootDir();
|
|
156
|
+
for (const project of Object.values(config.projects)) {
|
|
157
|
+
if (resolve(rootDir, getProjectSchedulePath(project)) === schedulePath) {
|
|
158
|
+
return project.run?.worktree_base;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
function parsePositiveInteger(value, flag) {
|
|
164
|
+
if (!value || !/^\d+$/.test(value) || Number(value) < 1) {
|
|
165
|
+
throw new Error(`${flag} must be a positive integer: ${value ?? ""}`);
|
|
166
|
+
}
|
|
167
|
+
return Number(value);
|
|
168
|
+
}
|
|
169
|
+
function parseRating(value, flag) {
|
|
170
|
+
if (value === undefined)
|
|
171
|
+
return undefined;
|
|
172
|
+
if (!/^[1-5]$/.test(value))
|
|
173
|
+
throw new Error(`${flag} must be an integer from 1 to 5.`);
|
|
174
|
+
return Number(value);
|
|
175
|
+
}
|
|
176
|
+
function resolveMember(roster, nickname, stageRole) {
|
|
177
|
+
const member = roster?.members.find((candidate) => candidate.type === "agent" && candidate.nickname === nickname);
|
|
178
|
+
if (!member)
|
|
179
|
+
throw new Error(`Agent nickname not found in pm-members.yaml: ${nickname}`);
|
|
180
|
+
if (member.disabled)
|
|
181
|
+
throw new Error(`Agent is disabled in pm-members.yaml: ${nickname}`);
|
|
182
|
+
if ((stageRole === "reporter" && member.stage_role !== "reporter") ||
|
|
183
|
+
(stageRole === "executor" && member.stage_role === "reporter")) {
|
|
184
|
+
throw new Error(`Agent must have stage_role: ${stageRole}: ${nickname}`);
|
|
185
|
+
}
|
|
186
|
+
return member;
|
|
187
|
+
}
|
|
188
|
+
function spawnAgent(command, prompt, cwd, env) {
|
|
189
|
+
return new Promise((resolveOutcome) => {
|
|
190
|
+
const protectedConfigBefore = captureAgentProtectedConfigSnapshot(cwd);
|
|
191
|
+
const gitStateBefore = captureAgentGitStateSnapshot(cwd);
|
|
192
|
+
const child = spawn(command, { cwd, env, shell: true, stdio: ["pipe", "pipe", "pipe"] });
|
|
193
|
+
let stdout = "";
|
|
194
|
+
let stderr = "";
|
|
195
|
+
let settled = false;
|
|
196
|
+
child.stdin.on("error", () => undefined);
|
|
197
|
+
child.stdout.setEncoding("utf8");
|
|
198
|
+
child.stderr.setEncoding("utf8");
|
|
199
|
+
child.stdout.on("data", (chunk) => {
|
|
200
|
+
stdout += chunk;
|
|
201
|
+
process.stdout.write(chunk);
|
|
202
|
+
});
|
|
203
|
+
child.stderr.on("data", (chunk) => {
|
|
204
|
+
stderr += chunk;
|
|
205
|
+
process.stderr.write(chunk);
|
|
206
|
+
});
|
|
207
|
+
const finish = (outcome) => {
|
|
208
|
+
if (settled)
|
|
209
|
+
return;
|
|
210
|
+
settled = true;
|
|
211
|
+
const protectedChanges = changedAgentProtectedConfigPaths(cwd, protectedConfigBefore);
|
|
212
|
+
if (protectedChanges.length > 0) {
|
|
213
|
+
outcome.stderr += `${agentProtectedConfigViolation(protectedChanges)}\n`;
|
|
214
|
+
outcome.exitCode = 1;
|
|
215
|
+
}
|
|
216
|
+
const gitStateChanges = changedAgentGitStateFields(cwd, gitStateBefore);
|
|
217
|
+
if (gitStateChanges.length > 0) {
|
|
218
|
+
outcome.stderr += `${agentGitStateViolation(gitStateChanges)}\n`;
|
|
219
|
+
outcome.exitCode = 1;
|
|
220
|
+
}
|
|
221
|
+
resolveOutcome(outcome);
|
|
222
|
+
};
|
|
223
|
+
child.once("error", (error) => {
|
|
224
|
+
stderr += `${error.message}\n`;
|
|
225
|
+
finish({ exitCode: null, stdout, stderr });
|
|
226
|
+
});
|
|
227
|
+
child.once("close", (exitCode) => finish({ exitCode, stdout, stderr }));
|
|
228
|
+
child.stdin.end(prompt);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function worktreeEnvironment(repoRoot, worktreePath, schedulePath, executionPath) {
|
|
232
|
+
return {
|
|
233
|
+
...gitEnvironment(),
|
|
234
|
+
SPECDOJO_SCHEDULE_PATH: resolve(worktreePath, repoRelative(repoRoot, schedulePath)),
|
|
235
|
+
SPECDOJO_EXECUTION_PATH: resolve(worktreePath, repoRelative(repoRoot, executionPath)),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function blankTrial(params) {
|
|
239
|
+
const trialId = safeSlug(params.trialId ?? params.agent);
|
|
240
|
+
const worktreeTaskId = `${params.projectId}:trial:${params.comparisonId}:${trialId}`;
|
|
241
|
+
const name = worktreeNameFromTaskId(worktreeTaskId);
|
|
242
|
+
return {
|
|
243
|
+
trial_id: trialId,
|
|
244
|
+
agent: params.agent,
|
|
245
|
+
reporter_agent: params.reporter ?? null,
|
|
246
|
+
worktree: resolve(params.worktreeBase, name),
|
|
247
|
+
branch: `exec/${name}`,
|
|
248
|
+
status: "pending",
|
|
249
|
+
started_at: null,
|
|
250
|
+
completed_at: null,
|
|
251
|
+
duration_ms: null,
|
|
252
|
+
executor: {
|
|
253
|
+
exit_code: null,
|
|
254
|
+
attempts: 0,
|
|
255
|
+
duration_ms: null,
|
|
256
|
+
structured_output: false,
|
|
257
|
+
validations_reported: 0,
|
|
258
|
+
validations_passed: 0,
|
|
259
|
+
validations_failed: 0,
|
|
260
|
+
validations_not_run: 0,
|
|
261
|
+
files_changed: 0,
|
|
262
|
+
evidence_ref: null,
|
|
263
|
+
final_message: "",
|
|
264
|
+
validations: [],
|
|
265
|
+
changes: [],
|
|
266
|
+
diff_summary: "",
|
|
267
|
+
},
|
|
268
|
+
parent_validation: {
|
|
269
|
+
configured_ids: [...(params.parentValidationIds ?? [])],
|
|
270
|
+
status: params.parentValidationIds?.length ? "not_run" : "not_configured",
|
|
271
|
+
duration_ms: null,
|
|
272
|
+
validations_passed: 0,
|
|
273
|
+
validations_failed: 0,
|
|
274
|
+
validations_not_run: 0,
|
|
275
|
+
},
|
|
276
|
+
reporter: {
|
|
277
|
+
status: "not_run",
|
|
278
|
+
structured_output: false,
|
|
279
|
+
format_attempts: 0,
|
|
280
|
+
format_retries: 0,
|
|
281
|
+
outcome: null,
|
|
282
|
+
output: null,
|
|
283
|
+
failure_category: null,
|
|
284
|
+
failure_reason: "",
|
|
285
|
+
},
|
|
286
|
+
subjective: {
|
|
287
|
+
judgment_quality: null,
|
|
288
|
+
writing_quality: null,
|
|
289
|
+
scope_adherence: null,
|
|
290
|
+
notes: "",
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
export function buildComparisonRecord(params) {
|
|
295
|
+
const reporterMode = params.pairs ? "paired" : params.reporter ? "shared" : "none";
|
|
296
|
+
const definitions = params.pairs ??
|
|
297
|
+
(params.agents ?? []).map((agent) => ({ executor: agent, reporter: params.reporter }));
|
|
298
|
+
const trialIds = definitions.map(({ executor, reporter }) => safeSlug(reporterMode === "paired" ? `${executor}-${reporter}` : executor));
|
|
299
|
+
if (new Set(trialIds).size !== trialIds.length) {
|
|
300
|
+
throw new Error("Trial executor/reporter selections must produce distinct trial ids.");
|
|
301
|
+
}
|
|
302
|
+
const baseValidation = params.baseValidation ??
|
|
303
|
+
{
|
|
304
|
+
requested_revision: "HEAD",
|
|
305
|
+
resolved_commit: params.baseCommit,
|
|
306
|
+
head_commit_at_start: params.baseCommit,
|
|
307
|
+
base_is_ancestor_of_head: true,
|
|
308
|
+
defaulted_to_head: true,
|
|
309
|
+
plan_path_exists_at_base: true,
|
|
310
|
+
compatible: true,
|
|
311
|
+
referenced_paths: [],
|
|
312
|
+
missing_referenced_paths: [],
|
|
313
|
+
warnings: [],
|
|
314
|
+
};
|
|
315
|
+
return {
|
|
316
|
+
schema_version: 1,
|
|
317
|
+
comparison_id: params.comparisonId,
|
|
318
|
+
project_id: params.projectId,
|
|
319
|
+
task_id: params.taskId,
|
|
320
|
+
status: "active",
|
|
321
|
+
created_at: params.createdAt,
|
|
322
|
+
completed_at: null,
|
|
323
|
+
base_commit: params.baseCommit,
|
|
324
|
+
base: baseValidation,
|
|
325
|
+
reporter_mode: reporterMode,
|
|
326
|
+
plan: {
|
|
327
|
+
path: params.planPath,
|
|
328
|
+
sha256: sha256(params.planContent),
|
|
329
|
+
prompt_sha256: sha256(params.prompt),
|
|
330
|
+
},
|
|
331
|
+
selected_trial_id: null,
|
|
332
|
+
trials: definitions.map(({ executor, reporter }, index) => blankTrial({
|
|
333
|
+
projectId: params.projectId,
|
|
334
|
+
comparisonId: params.comparisonId,
|
|
335
|
+
agent: executor,
|
|
336
|
+
trialId: trialIds[index],
|
|
337
|
+
reporter,
|
|
338
|
+
worktreeBase: params.worktreeBase,
|
|
339
|
+
parentValidationIds: params.parentValidationIds,
|
|
340
|
+
})),
|
|
341
|
+
agent_selection: {
|
|
342
|
+
policy: "manual",
|
|
343
|
+
target: "pm-members.yaml",
|
|
344
|
+
rationale: "A single comparison does not automatically change agent assignment. A human reviews objective and subjective results, then updates pm-members.yaml priority/capabilities when repeated evidence supports the change.",
|
|
345
|
+
},
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
export function updateObjectiveMetrics(trial, evidence, structuredOutput) {
|
|
349
|
+
trial.executor.structured_output = structuredOutput;
|
|
350
|
+
trial.executor.files_changed = evidence.diff_summary.files_changed;
|
|
351
|
+
trial.executor.final_message = evidence.final_message;
|
|
352
|
+
trial.executor.validations = evidence.validations;
|
|
353
|
+
trial.executor.changes = evidence.changes;
|
|
354
|
+
trial.executor.diff_summary = evidence.diff_summary.summary;
|
|
355
|
+
const executorValidations = evidence.validations.filter((validation) => validation.source !== "runner");
|
|
356
|
+
trial.executor.validations_reported = executorValidations.length;
|
|
357
|
+
trial.executor.validations_passed = 0;
|
|
358
|
+
trial.executor.validations_failed = 0;
|
|
359
|
+
trial.executor.validations_not_run = 0;
|
|
360
|
+
for (const validation of executorValidations) {
|
|
361
|
+
if (validation.status === "passed")
|
|
362
|
+
trial.executor.validations_passed++;
|
|
363
|
+
else if (validation.status === "failed")
|
|
364
|
+
trial.executor.validations_failed++;
|
|
365
|
+
else
|
|
366
|
+
trial.executor.validations_not_run++;
|
|
367
|
+
}
|
|
368
|
+
const parentValidations = evidence.validations.filter((validation) => validation.source === "runner");
|
|
369
|
+
trial.parent_validation.validations_passed = parentValidations.filter((validation) => validation.status === "passed").length;
|
|
370
|
+
trial.parent_validation.validations_failed = parentValidations.filter((validation) => validation.status === "failed").length;
|
|
371
|
+
trial.parent_validation.validations_not_run = parentValidations.filter((validation) => validation.status === "not_run").length;
|
|
372
|
+
}
|
|
373
|
+
async function runOneTrial(params) {
|
|
374
|
+
const { trial, worktree } = params;
|
|
375
|
+
const startedAt = new Date();
|
|
376
|
+
trial.status = "running";
|
|
377
|
+
trial.started_at = startedAt.toISOString();
|
|
378
|
+
writeComparison(params.recordPath, params.record);
|
|
379
|
+
const outcome = await spawnAgent(params.executorCommand, params.prompt, worktree.path, worktreeEnvironment(params.repoRoot, worktree.path, params.schedulePath, params.executionPath));
|
|
380
|
+
const executorCompletedAt = new Date();
|
|
381
|
+
trial.executor.duration_ms = executorCompletedAt.getTime() - startedAt.getTime();
|
|
382
|
+
trial.parent_validation.configured_ids = [...params.parentValidationIds];
|
|
383
|
+
let parentValidations = [];
|
|
384
|
+
if (params.parentValidationIds.length === 0) {
|
|
385
|
+
trial.parent_validation.status = "not_configured";
|
|
386
|
+
}
|
|
387
|
+
else if (outcome.exitCode !== 0) {
|
|
388
|
+
trial.parent_validation.status = "not_run";
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
const parentValidationStartedAt = Date.now();
|
|
392
|
+
parentValidations = await runConfiguredParentValidations(params.execDefaults, worktree.path);
|
|
393
|
+
trial.parent_validation.duration_ms = Date.now() - parentValidationStartedAt;
|
|
394
|
+
trial.parent_validation.status = parentValidations.some((validation) => validation.status !== "passed")
|
|
395
|
+
? "failed"
|
|
396
|
+
: "passed";
|
|
397
|
+
}
|
|
398
|
+
const runId = `${safeSlug(params.record.comparison_id)}-${trial.trial_id}`;
|
|
399
|
+
const evidenceRecorded = recordExecutorEvidence({
|
|
400
|
+
repoRoot: params.repoRoot,
|
|
401
|
+
worktreePath: worktree.path,
|
|
402
|
+
executionPath: params.executionPath,
|
|
403
|
+
taskId: params.record.task_id,
|
|
404
|
+
runId,
|
|
405
|
+
actor: trial.agent,
|
|
406
|
+
status: outcome.exitCode === 0 ? "succeeded" : "failed",
|
|
407
|
+
startedAt: startedAt.toISOString(),
|
|
408
|
+
completedAt: executorCompletedAt.toISOString(),
|
|
409
|
+
exitCode: outcome.exitCode,
|
|
410
|
+
attempts: 1,
|
|
411
|
+
stdout: outcome.stdout,
|
|
412
|
+
stderr: outcome.stderr,
|
|
413
|
+
parentValidations,
|
|
414
|
+
});
|
|
415
|
+
const centralizedEvidenceDir = join(comparisonDir(params.executionPath, params.record.comparison_id), "trials", trial.trial_id);
|
|
416
|
+
ensureDir(centralizedEvidenceDir);
|
|
417
|
+
const centralizedLogPath = join(centralizedEvidenceDir, "executor.log");
|
|
418
|
+
const worktreeLogPath = join(dirname(evidenceRecorded.evidencePath), "executor.log");
|
|
419
|
+
copyFileSync(worktreeLogPath, centralizedLogPath);
|
|
420
|
+
const centralizedEvidencePath = join(centralizedEvidenceDir, "evidence.json");
|
|
421
|
+
evidenceRecorded.evidence.log_refs = evidenceRecorded.evidence.log_refs.map((ref) => ({
|
|
422
|
+
...ref,
|
|
423
|
+
path: repoRelative(params.repoRoot, centralizedLogPath),
|
|
424
|
+
}));
|
|
425
|
+
writeFileSync(centralizedEvidencePath, `${JSON.stringify(evidenceRecorded.evidence, null, 2)}\n`, "utf8");
|
|
426
|
+
trial.executor.exit_code = outcome.exitCode;
|
|
427
|
+
trial.executor.attempts = 1;
|
|
428
|
+
trial.executor.evidence_ref = repoRelative(params.repoRoot, centralizedEvidencePath);
|
|
429
|
+
updateObjectiveMetrics(trial, evidenceRecorded.evidence, hasValidExecutorEnvelope(outcome.stdout));
|
|
430
|
+
let reporterSucceeded = true;
|
|
431
|
+
if (outcome.exitCode === 0 && params.reporterCommand) {
|
|
432
|
+
const reporter = await runReporterWithFormatRetry({
|
|
433
|
+
plan: params.plan,
|
|
434
|
+
evidence: evidenceRecorded.evidence,
|
|
435
|
+
mode: parsePlanTaskIdentity(params.plan)?.mode ?? "edit",
|
|
436
|
+
invoke: async (reporterPrompt) => {
|
|
437
|
+
const reporterOutcome = await spawnAgent(params.reporterCommand, reporterPrompt, worktree.path, worktreeEnvironment(params.repoRoot, worktree.path, params.schedulePath, params.executionPath));
|
|
438
|
+
const result = reporterOutcome.exitCode === 0
|
|
439
|
+
? "success"
|
|
440
|
+
: isRateLimitError(reporterOutcome.exitCode, `${reporterOutcome.stdout}\n${reporterOutcome.stderr}`, params.reporterRateLimitDetection)
|
|
441
|
+
? "rate_limit"
|
|
442
|
+
: "failure";
|
|
443
|
+
return {
|
|
444
|
+
result,
|
|
445
|
+
stdout: reporterOutcome.stdout,
|
|
446
|
+
stderr: reporterOutcome.stderr,
|
|
447
|
+
};
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
trial.reporter.format_attempts = reporter.formatAttempts;
|
|
451
|
+
trial.reporter.format_retries = Math.max(0, reporter.formatAttempts - 1);
|
|
452
|
+
if (reporter.result === "success") {
|
|
453
|
+
trial.reporter.structured_output = true;
|
|
454
|
+
trial.reporter.outcome = reporter.output.outcome;
|
|
455
|
+
trial.reporter.output = reporter.output;
|
|
456
|
+
reporterSucceeded = reporter.output.outcome === "complete";
|
|
457
|
+
if (reporterSucceeded) {
|
|
458
|
+
trial.reporter.status = "succeeded";
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
trial.reporter.status = "blocked";
|
|
462
|
+
trial.reporter.failure_category = "reported_blocked";
|
|
463
|
+
trial.reporter.failure_reason = reporter.output.block_reason;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
trial.reporter.status = "failed";
|
|
468
|
+
trial.reporter.failure_category = classifyReporterFailure(reporter.result, reporter.reason);
|
|
469
|
+
trial.reporter.failure_reason = reporter.reason;
|
|
470
|
+
reporterSucceeded = false;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
const completedAt = new Date();
|
|
474
|
+
trial.completed_at = completedAt.toISOString();
|
|
475
|
+
trial.duration_ms = completedAt.getTime() - startedAt.getTime();
|
|
476
|
+
trial.status =
|
|
477
|
+
outcome.exitCode === 0 &&
|
|
478
|
+
trial.executor.validations_failed === 0 &&
|
|
479
|
+
trial.parent_validation.status !== "failed" &&
|
|
480
|
+
trial.parent_validation.status !== "not_run" &&
|
|
481
|
+
reporterSucceeded
|
|
482
|
+
? "succeeded"
|
|
483
|
+
: "failed";
|
|
484
|
+
writeComparison(params.recordPath, params.record);
|
|
485
|
+
}
|
|
486
|
+
async function runPool(items, parallel) {
|
|
487
|
+
let next = 0;
|
|
488
|
+
const workers = Array.from({ length: Math.min(parallel, items.length) }, async () => {
|
|
489
|
+
while (next < items.length) {
|
|
490
|
+
const index = next++;
|
|
491
|
+
await items[index]();
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
await Promise.all(workers);
|
|
495
|
+
}
|
|
496
|
+
function parseTrialPair(value) {
|
|
497
|
+
const separator = value.indexOf("=");
|
|
498
|
+
const executor = value.slice(0, separator).trim();
|
|
499
|
+
const reporter = value.slice(separator + 1).trim();
|
|
500
|
+
if (separator < 1 || !executor || !reporter || reporter.includes("=")) {
|
|
501
|
+
throw new Error(`--pair must use <executor>=<reporter>: ${value}`);
|
|
502
|
+
}
|
|
503
|
+
return { executor, reporter };
|
|
504
|
+
}
|
|
505
|
+
function resolveTrialDefinitions(opts) {
|
|
506
|
+
const agentValues = (opts.agent ?? []).map((value) => value.trim()).filter(Boolean);
|
|
507
|
+
const pairValues = (opts.pair ?? []).map((value) => value.trim()).filter(Boolean);
|
|
508
|
+
if (agentValues.length > 0 && pairValues.length > 0) {
|
|
509
|
+
throw new Error("Use either --agent or --pair, not both.");
|
|
510
|
+
}
|
|
511
|
+
if (pairValues.length > 0) {
|
|
512
|
+
if (opts.reporterBy)
|
|
513
|
+
throw new Error("--pair cannot be combined with --reporter-by.");
|
|
514
|
+
const pairs = pairValues.map(parseTrialPair);
|
|
515
|
+
const keys = pairs.map((pair) => `${pair.executor}\0${pair.reporter}`);
|
|
516
|
+
if (new Set(keys).size < 2 || new Set(keys).size !== keys.length) {
|
|
517
|
+
throw new Error("exec trial run requires at least two distinct --pair values.");
|
|
518
|
+
}
|
|
519
|
+
return { agents: [...new Set(pairs.map((pair) => pair.executor))], pairs };
|
|
520
|
+
}
|
|
521
|
+
const agents = [...new Set(agentValues)];
|
|
522
|
+
if (agents.length < 2) {
|
|
523
|
+
throw new Error("exec trial run requires at least two distinct --agent values or --pair values.");
|
|
524
|
+
}
|
|
525
|
+
return { agents };
|
|
526
|
+
}
|
|
527
|
+
function resolveBaseCommit(repoRoot, revision) {
|
|
528
|
+
const result = gitResult(repoRoot, [
|
|
529
|
+
"rev-parse",
|
|
530
|
+
"--verify",
|
|
531
|
+
"--end-of-options",
|
|
532
|
+
`${revision}^{commit}`,
|
|
533
|
+
]);
|
|
534
|
+
if (result.status !== 0)
|
|
535
|
+
throw new Error(`Trial base is not a commit: ${revision}`);
|
|
536
|
+
return String(result.stdout).trim();
|
|
537
|
+
}
|
|
538
|
+
async function runTrials(opts) {
|
|
539
|
+
const paths = resolveProjectPaths({ project: opts.project });
|
|
540
|
+
activateResolvedProjectPaths(paths);
|
|
541
|
+
const repoRoot = specdojoRootDir();
|
|
542
|
+
const projectId = paths.projectId ?? opts.project?.trim();
|
|
543
|
+
if (!projectId)
|
|
544
|
+
throw new Error("exec trial run requires a project id.");
|
|
545
|
+
const planPath = resolve(opts.plan);
|
|
546
|
+
if (!existsSync(planPath))
|
|
547
|
+
throw new Error(`Plan not found: ${planPath}`);
|
|
548
|
+
const planContent = readFileSync(planPath, "utf8");
|
|
549
|
+
const identity = parsePlanTaskIdentity(planContent);
|
|
550
|
+
if (!identity)
|
|
551
|
+
throw new Error("Trial plan must have SpecDojo task_id/mode/project_id frontmatter.");
|
|
552
|
+
if (identity.projectId && identity.projectId !== projectId) {
|
|
553
|
+
throw new Error(`Plan project_id ${identity.projectId} does not match --project ${projectId}.`);
|
|
554
|
+
}
|
|
555
|
+
const { agents, pairs } = resolveTrialDefinitions(opts);
|
|
556
|
+
const parallel = parsePositiveInteger(opts.parallel ?? "1", "--parallel");
|
|
557
|
+
const comparisonId = safeSlug(opts.comparison?.trim() ||
|
|
558
|
+
`${identity.taskId}-${new Date().toISOString()}-${randomUUID().slice(0, 8)}`);
|
|
559
|
+
const recordPath = comparisonPath(paths.executionPath, comparisonId);
|
|
560
|
+
if (existsSync(recordPath))
|
|
561
|
+
throw new Error(`Comparison already exists: ${comparisonId}`);
|
|
562
|
+
const worktreeBase = resolveWorktreeBase(repoRoot, opts.worktreeBase, configuredWorktreeBase(paths.schedulePath));
|
|
563
|
+
const roster = loadRosterForExecutionPath(paths.executionPath);
|
|
564
|
+
const defaults = loadExecDefaultsConfig(opts.execDefaults ?? defaultExecDefaultsPath(), paths.executionPath);
|
|
565
|
+
const executorCommands = new Map();
|
|
566
|
+
for (const agent of agents) {
|
|
567
|
+
const command = resolveMemberCommand(defaults, resolveMember(roster, agent, "executor"));
|
|
568
|
+
if (!command)
|
|
569
|
+
throw new Error(`Agent command could not be resolved: ${agent}`);
|
|
570
|
+
executorCommands.set(agent, command);
|
|
571
|
+
}
|
|
572
|
+
const reporterCommands = new Map();
|
|
573
|
+
const reporterRateLimitDetections = new Map();
|
|
574
|
+
if (opts.reporterBy) {
|
|
575
|
+
const reporterMember = resolveMember(roster, opts.reporterBy, "reporter");
|
|
576
|
+
const reporterCommand = resolveMemberCommand(defaults, reporterMember);
|
|
577
|
+
if (!reporterCommand)
|
|
578
|
+
throw new Error(`Reporter command could not be resolved: ${opts.reporterBy}`);
|
|
579
|
+
reporterCommands.set(opts.reporterBy, reporterCommand);
|
|
580
|
+
reporterRateLimitDetections.set(opts.reporterBy, resolveRateLimitDetection(defaults, reporterMember.provider));
|
|
581
|
+
}
|
|
582
|
+
for (const reporter of new Set(pairs?.map((pair) => pair.reporter) ?? [])) {
|
|
583
|
+
const reporterMember = resolveMember(roster, reporter, "reporter");
|
|
584
|
+
const reporterCommand = resolveMemberCommand(defaults, reporterMember);
|
|
585
|
+
if (!reporterCommand)
|
|
586
|
+
throw new Error(`Reporter command could not be resolved: ${reporter}`);
|
|
587
|
+
reporterCommands.set(reporter, reporterCommand);
|
|
588
|
+
reporterRateLimitDetections.set(reporter, resolveRateLimitDetection(defaults, reporterMember.provider));
|
|
589
|
+
}
|
|
590
|
+
const parentValidationIds = defaults.pipeline?.parent_validations ?? [];
|
|
591
|
+
const prompt = `${buildExecutorPrompt(planContent, parentValidationIds).trimEnd()}${TRIAL_PROMPT_SUFFIX}`;
|
|
592
|
+
const requestedRevision = opts.base?.trim() || "HEAD";
|
|
593
|
+
const headCommit = resolveBaseCommit(repoRoot, "HEAD");
|
|
594
|
+
const baseCommit = resolveBaseCommit(repoRoot, requestedRevision);
|
|
595
|
+
const planRepoPath = repoRelative(repoRoot, planPath);
|
|
596
|
+
const baseValidation = buildTrialBaseValidation({
|
|
597
|
+
repoRoot,
|
|
598
|
+
requestedRevision,
|
|
599
|
+
resolvedCommit: baseCommit,
|
|
600
|
+
headCommit,
|
|
601
|
+
defaultedToHead: !opts.base?.trim(),
|
|
602
|
+
planPath: planRepoPath,
|
|
603
|
+
planContent,
|
|
604
|
+
});
|
|
605
|
+
const record = buildComparisonRecord({
|
|
606
|
+
comparisonId,
|
|
607
|
+
projectId,
|
|
608
|
+
taskId: identity.taskId,
|
|
609
|
+
createdAt: new Date().toISOString(),
|
|
610
|
+
baseCommit,
|
|
611
|
+
baseValidation,
|
|
612
|
+
planPath: planRepoPath,
|
|
613
|
+
planContent,
|
|
614
|
+
prompt,
|
|
615
|
+
agents,
|
|
616
|
+
pairs,
|
|
617
|
+
reporter: opts.reporterBy,
|
|
618
|
+
worktreeBase,
|
|
619
|
+
parentValidationIds,
|
|
620
|
+
});
|
|
621
|
+
if (opts.dryRun) {
|
|
622
|
+
process.stdout.write(`${JSON.stringify(record, null, 2)}\n`);
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
writeComparison(recordPath, record);
|
|
626
|
+
const prepared = new Map();
|
|
627
|
+
for (const trial of record.trials) {
|
|
628
|
+
const worktreeTaskId = `${projectId}:trial:${comparisonId}:${trial.trial_id}`;
|
|
629
|
+
if (findExecWorktree(repoRoot, worktreeTaskId) || execBranchExists(repoRoot, worktreeTaskId)) {
|
|
630
|
+
throw new Error(`Trial worktree or branch already exists: ${trial.branch}`);
|
|
631
|
+
}
|
|
632
|
+
const worktree = ensureExecWorktree({
|
|
633
|
+
repoRoot,
|
|
634
|
+
worktreeBase,
|
|
635
|
+
taskId: worktreeTaskId,
|
|
636
|
+
startPoint: record.base_commit,
|
|
637
|
+
});
|
|
638
|
+
prepared.set(trial.trial_id, worktree);
|
|
639
|
+
trial.status = "prepared";
|
|
640
|
+
writeComparison(recordPath, record);
|
|
641
|
+
}
|
|
642
|
+
await runPool(record.trials.map((trial) => async () => {
|
|
643
|
+
const worktree = prepared.get(trial.trial_id);
|
|
644
|
+
if (!worktree)
|
|
645
|
+
throw new Error(`Prepared worktree missing: ${trial.trial_id}`);
|
|
646
|
+
await runOneTrial({
|
|
647
|
+
record,
|
|
648
|
+
recordPath,
|
|
649
|
+
trial,
|
|
650
|
+
worktree,
|
|
651
|
+
plan: planContent,
|
|
652
|
+
prompt,
|
|
653
|
+
executorCommand: executorCommands.get(trial.agent),
|
|
654
|
+
reporterCommand: trial.reporter_agent
|
|
655
|
+
? reporterCommands.get(trial.reporter_agent)
|
|
656
|
+
: undefined,
|
|
657
|
+
reporterRateLimitDetection: trial.reporter_agent
|
|
658
|
+
? reporterRateLimitDetections.get(trial.reporter_agent)
|
|
659
|
+
: undefined,
|
|
660
|
+
parentValidationIds,
|
|
661
|
+
execDefaults: defaults,
|
|
662
|
+
repoRoot,
|
|
663
|
+
schedulePath: paths.schedulePath,
|
|
664
|
+
executionPath: paths.executionPath,
|
|
665
|
+
});
|
|
666
|
+
}), parallel);
|
|
667
|
+
process.stdout.write(`Comparison recorded: ${repoRelative(repoRoot, recordPath)}\n`);
|
|
668
|
+
}
|
|
669
|
+
function resolveRecord(opts) {
|
|
670
|
+
const paths = resolveProjectPaths({ project: opts.project });
|
|
671
|
+
activateResolvedProjectPaths(paths);
|
|
672
|
+
const path = comparisonPath(paths.executionPath, opts.comparison);
|
|
673
|
+
return { record: readComparison(path), path, repoRoot: specdojoRootDir() };
|
|
674
|
+
}
|
|
675
|
+
function findTrial(record, selector) {
|
|
676
|
+
const matches = record.trials.filter((trial) => trial.trial_id === selector || trial.agent === selector);
|
|
677
|
+
if (matches.length !== 1)
|
|
678
|
+
throw new Error(`Trial not found or ambiguous: ${selector}`);
|
|
679
|
+
return matches[0];
|
|
680
|
+
}
|
|
681
|
+
function statusTrials(opts) {
|
|
682
|
+
const { record } = resolveRecord(opts);
|
|
683
|
+
process.stdout.write(`Comparison ${record.comparison_id} [${record.status}] task=${record.task_id}\n`);
|
|
684
|
+
process.stdout.write(`plan sha256=${record.plan.sha256} prompt sha256=${record.plan.prompt_sha256}\n`);
|
|
685
|
+
process.stdout.write(`base=${record.base_commit} requested=${record.base?.requested_revision ?? "(legacy)"} head_reference=${record.base?.head_commit_at_start ?? "unknown"} compatible=${record.base?.compatible ?? "unknown"} reporter_mode=${record.reporter_mode ?? "shared-or-none"}\n`);
|
|
686
|
+
for (const warning of record.base?.warnings ?? []) {
|
|
687
|
+
process.stdout.write(`base warning: ${warning}\n`);
|
|
688
|
+
}
|
|
689
|
+
for (const trial of record.trials) {
|
|
690
|
+
const reporterStatus = trial.reporter.status ?? (trial.reporter.structured_output ? "succeeded" : "not_run");
|
|
691
|
+
const parentValidation = trial.parent_validation ?? {
|
|
692
|
+
status: "not_configured",
|
|
693
|
+
duration_ms: null,
|
|
694
|
+
validations_passed: 0,
|
|
695
|
+
validations_failed: 0,
|
|
696
|
+
validations_not_run: 0,
|
|
697
|
+
};
|
|
698
|
+
process.stdout.write(`${trial.trial_id}\t${trial.status}\ttime(executor/parent/total)=${trial.executor.duration_ms ?? "-"}/${parentValidation.duration_ms ?? "-"}/${trial.duration_ms ?? "-"}ms\tfiles=${trial.executor.files_changed}\texecutor-validations(reported/passed/failed/not_run)=${trial.executor.validations_reported ?? trial.executor.validations.length}/${trial.executor.validations_passed}/${trial.executor.validations_failed}/${trial.executor.validations_not_run}\tparent-validations(status/passed/failed/not_run)=${parentValidation.status}/${parentValidation.validations_passed}/${parentValidation.validations_failed}/${parentValidation.validations_not_run}\treporter=${reporterStatus}/${trial.reporter.format_attempts}/${trial.reporter.failure_category ?? "-"}\n`);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function rateTrial(opts) {
|
|
702
|
+
const { record, path } = resolveRecord(opts);
|
|
703
|
+
const trial = findTrial(record, opts.trial);
|
|
704
|
+
const judgment = parseRating(opts.judgmentQuality, "--judgment-quality");
|
|
705
|
+
const writing = parseRating(opts.writingQuality, "--writing-quality");
|
|
706
|
+
const scope = parseRating(opts.scopeAdherence, "--scope-adherence");
|
|
707
|
+
if (judgment !== undefined)
|
|
708
|
+
trial.subjective.judgment_quality = judgment;
|
|
709
|
+
if (writing !== undefined)
|
|
710
|
+
trial.subjective.writing_quality = writing;
|
|
711
|
+
if (scope !== undefined)
|
|
712
|
+
trial.subjective.scope_adherence = scope;
|
|
713
|
+
if (opts.notes !== undefined)
|
|
714
|
+
trial.subjective.notes = opts.notes.trim();
|
|
715
|
+
writeComparison(path, record);
|
|
716
|
+
process.stdout.write(`Rated trial: ${trial.trial_id}\n`);
|
|
717
|
+
}
|
|
718
|
+
function changedPaths(worktreePath) {
|
|
719
|
+
const output = gitOutput(worktreePath, [
|
|
720
|
+
"status",
|
|
721
|
+
"--porcelain=v1",
|
|
722
|
+
"-z",
|
|
723
|
+
"--untracked-files=all",
|
|
724
|
+
]);
|
|
725
|
+
const paths = [];
|
|
726
|
+
for (const record of output.split("\0").filter(Boolean)) {
|
|
727
|
+
if (record.length >= 4)
|
|
728
|
+
paths.push(record.slice(3));
|
|
729
|
+
}
|
|
730
|
+
return paths;
|
|
731
|
+
}
|
|
732
|
+
function removeTrialWorktree(repoRoot, trial, deleteUnmerged) {
|
|
733
|
+
const registered = findExecWorktree(repoRoot, trial.branch.slice("exec/".length));
|
|
734
|
+
const worktreePath = registered?.path ?? trial.worktree;
|
|
735
|
+
if (existsSync(worktreePath)) {
|
|
736
|
+
gitOutput(repoRoot, ["worktree", "remove", "--force", worktreePath]);
|
|
737
|
+
}
|
|
738
|
+
if (gitResult(repoRoot, ["show-ref", "--verify", "--quiet", `refs/heads/${trial.branch}`])
|
|
739
|
+
.status === 0) {
|
|
740
|
+
gitOutput(repoRoot, ["branch", deleteUnmerged ? "-D" : "-d", trial.branch]);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function commitSelectedTrial(repoRoot, record, trial) {
|
|
744
|
+
const protectedPaths = changedPaths(trial.worktree).filter(isAgentProtectedConfigPath);
|
|
745
|
+
if (protectedPaths.length > 0)
|
|
746
|
+
throw new Error(agentProtectedConfigViolation(protectedPaths));
|
|
747
|
+
gitOutput(trial.worktree, ["add", "-A"]);
|
|
748
|
+
const staged = gitResult(trial.worktree, ["diff", "--cached", "--quiet"]);
|
|
749
|
+
if (staged.status === 1) {
|
|
750
|
+
const commit = gitResult(trial.worktree, [
|
|
751
|
+
"commit",
|
|
752
|
+
"-m",
|
|
753
|
+
`feat(trial): adopt ${record.task_id} from ${trial.agent}`,
|
|
754
|
+
]);
|
|
755
|
+
if (commit.status !== 0) {
|
|
756
|
+
gitResult(trial.worktree, ["reset", "--quiet"]);
|
|
757
|
+
throw new Error(`Trial commit failed: ${commit.stderr || commit.stdout}`);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
else if (staged.status !== 0) {
|
|
761
|
+
throw new Error("Failed to inspect selected trial changes.");
|
|
762
|
+
}
|
|
763
|
+
const ahead = Number(gitOutput(trial.worktree, ["rev-list", "--count", `${record.base_commit}..HEAD`]).trim());
|
|
764
|
+
if (!Number.isFinite(ahead) || ahead < 1)
|
|
765
|
+
throw new Error("Selected trial has no changes to adopt.");
|
|
766
|
+
}
|
|
767
|
+
function adoptTrial(opts) {
|
|
768
|
+
const { record, path, repoRoot } = resolveRecord(opts);
|
|
769
|
+
if (record.status !== "active")
|
|
770
|
+
throw new Error(`Comparison is already ${record.status}.`);
|
|
771
|
+
const selected = findTrial(record, opts.trial);
|
|
772
|
+
if (selected.status !== "succeeded")
|
|
773
|
+
throw new Error(`Only a succeeded trial can be adopted: ${selected.trial_id}`);
|
|
774
|
+
if (opts.dryRun) {
|
|
775
|
+
process.stdout.write(`[dry-run] adopt ${selected.branch}; discard ${record.trials.length - 1} other trial(s)\n`);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
commitSelectedTrial(repoRoot, record, selected);
|
|
779
|
+
try {
|
|
780
|
+
gitOutput(repoRoot, ["merge", "--no-ff", "--no-edit", selected.branch]);
|
|
781
|
+
}
|
|
782
|
+
catch (error) {
|
|
783
|
+
gitResult(repoRoot, ["merge", "--abort"]);
|
|
784
|
+
throw error;
|
|
785
|
+
}
|
|
786
|
+
removeTrialWorktree(repoRoot, selected, false);
|
|
787
|
+
selected.status = "adopted";
|
|
788
|
+
for (const trial of record.trials) {
|
|
789
|
+
if (trial === selected)
|
|
790
|
+
continue;
|
|
791
|
+
removeTrialWorktree(repoRoot, trial, true);
|
|
792
|
+
trial.status = "discarded";
|
|
793
|
+
}
|
|
794
|
+
record.status = "adopted";
|
|
795
|
+
record.selected_trial_id = selected.trial_id;
|
|
796
|
+
record.completed_at = new Date().toISOString();
|
|
797
|
+
writeComparison(path, record);
|
|
798
|
+
process.stdout.write(`Adopted trial ${selected.trial_id}; discarded remaining trial worktrees.\n`);
|
|
799
|
+
}
|
|
800
|
+
function discardTrials(opts) {
|
|
801
|
+
const { record, path, repoRoot } = resolveRecord(opts);
|
|
802
|
+
if (record.status !== "active")
|
|
803
|
+
throw new Error(`Comparison is already ${record.status}.`);
|
|
804
|
+
for (const trial of record.trials) {
|
|
805
|
+
removeTrialWorktree(repoRoot, trial, true);
|
|
806
|
+
trial.status = "discarded";
|
|
807
|
+
}
|
|
808
|
+
record.status = "discarded";
|
|
809
|
+
record.completed_at = new Date().toISOString();
|
|
810
|
+
writeComparison(path, record);
|
|
811
|
+
process.stdout.write(`Discarded all trial worktrees; comparison record retained.\n`);
|
|
812
|
+
}
|
|
813
|
+
function commandError(error) {
|
|
814
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
815
|
+
process.exitCode = 1;
|
|
816
|
+
}
|
|
817
|
+
export function registerExecTrialCommands(exec) {
|
|
818
|
+
const trial = exec.command("trial").description("Compare multiple agents on one immutable plan");
|
|
819
|
+
trial
|
|
820
|
+
.command("run")
|
|
821
|
+
.requiredOption("--project <projectId>", "Project id")
|
|
822
|
+
.requiredOption("--plan <path>", "Existing SpecDojo plan used unchanged by every trial")
|
|
823
|
+
.option("--agent <nicknames...>", "Two or more executor agent nicknames")
|
|
824
|
+
.option("--pair <executor=reporter...>", "Two or more executor/reporter pairs (alternative to --agent)")
|
|
825
|
+
.option("--reporter-by <nickname>", "Shared reporter agent used to assess structured output")
|
|
826
|
+
.option("--base <revision>", "Commit used as the trial worktree start point (default: HEAD)")
|
|
827
|
+
.option("--comparison <id>", "Stable comparison id (generated when omitted)")
|
|
828
|
+
.option("--parallel <n>", "Maximum concurrent trials", "1")
|
|
829
|
+
.option("--worktree-base <path>", "Override worktree base directory")
|
|
830
|
+
.option("--exec-defaults <path>", "Path to exec-defaults.yaml")
|
|
831
|
+
.option("--dry-run", "Print the planned comparison without creating worktrees", false)
|
|
832
|
+
.action(async (opts) => {
|
|
833
|
+
try {
|
|
834
|
+
await runTrials(opts);
|
|
835
|
+
}
|
|
836
|
+
catch (error) {
|
|
837
|
+
commandError(error);
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
trial
|
|
841
|
+
.command("status")
|
|
842
|
+
.requiredOption("--project <projectId>", "Project id")
|
|
843
|
+
.requiredOption("--comparison <id>", "Comparison id")
|
|
844
|
+
.action((opts) => {
|
|
845
|
+
try {
|
|
846
|
+
statusTrials(opts);
|
|
847
|
+
}
|
|
848
|
+
catch (error) {
|
|
849
|
+
commandError(error);
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
trial
|
|
853
|
+
.command("rate")
|
|
854
|
+
.requiredOption("--project <projectId>", "Project id")
|
|
855
|
+
.requiredOption("--comparison <id>", "Comparison id")
|
|
856
|
+
.requiredOption("--trial <idOrAgent>", "Trial id or agent nickname")
|
|
857
|
+
.option("--judgment-quality <1-5>", "Human judgment-quality rating")
|
|
858
|
+
.option("--writing-quality <1-5>", "Human writing-quality rating")
|
|
859
|
+
.option("--scope-adherence <1-5>", "Human scope-adherence rating")
|
|
860
|
+
.option("--notes <text>", "Human evaluation notes")
|
|
861
|
+
.action((opts) => {
|
|
862
|
+
try {
|
|
863
|
+
rateTrial(opts);
|
|
864
|
+
}
|
|
865
|
+
catch (error) {
|
|
866
|
+
commandError(error);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
trial
|
|
870
|
+
.command("adopt")
|
|
871
|
+
.requiredOption("--project <projectId>", "Project id")
|
|
872
|
+
.requiredOption("--comparison <id>", "Comparison id")
|
|
873
|
+
.requiredOption("--trial <idOrAgent>", "Succeeded trial to merge")
|
|
874
|
+
.option("--dry-run", "Print adopt/discard actions", false)
|
|
875
|
+
.action((opts) => {
|
|
876
|
+
try {
|
|
877
|
+
adoptTrial(opts);
|
|
878
|
+
}
|
|
879
|
+
catch (error) {
|
|
880
|
+
commandError(error);
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
trial
|
|
884
|
+
.command("discard")
|
|
885
|
+
.requiredOption("--project <projectId>", "Project id")
|
|
886
|
+
.requiredOption("--comparison <id>", "Comparison id")
|
|
887
|
+
.action((opts) => {
|
|
888
|
+
try {
|
|
889
|
+
discardTrials(opts);
|
|
890
|
+
}
|
|
891
|
+
catch (error) {
|
|
892
|
+
commandError(error);
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|