@bhargavvc/sdd-cc 1.35.0 → 1.42.4
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/README.ja-JP.md +54 -52
- package/README.ko-KR.md +47 -45
- package/README.md +86 -733
- package/README.pt-BR.md +14 -12
- package/README.zh-CN.md +31 -29
- package/agents/sdd-ai-researcher.md +2 -2
- package/agents/sdd-code-fixer.md +169 -17
- package/agents/sdd-code-reviewer.md +40 -8
- package/agents/sdd-codebase-mapper.md +89 -6
- package/agents/sdd-debug-session-manager.md +314 -0
- package/agents/sdd-debugger.md +147 -80
- package/agents/sdd-doc-classifier.md +168 -0
- package/agents/sdd-doc-synthesizer.md +204 -0
- package/agents/sdd-doc-verifier.md +20 -4
- package/agents/sdd-doc-writer.md +22 -9
- package/agents/sdd-domain-researcher.md +2 -2
- package/agents/sdd-eval-auditor.md +30 -3
- package/agents/sdd-eval-planner.md +2 -2
- package/agents/sdd-executor.md +203 -43
- package/agents/sdd-framework-selector.md +1 -1
- package/agents/sdd-integration-checker.md +30 -3
- package/agents/sdd-intel-updater.md +51 -23
- package/agents/sdd-nyquist-auditor.md +31 -4
- package/agents/sdd-pattern-mapper.md +335 -0
- package/agents/sdd-phase-researcher.md +195 -32
- package/agents/sdd-plan-checker.md +135 -24
- package/agents/sdd-planner.md +190 -205
- package/agents/sdd-project-researcher.md +7 -7
- package/agents/sdd-research-synthesizer.md +6 -6
- package/agents/sdd-roadmapper.md +19 -10
- package/agents/sdd-security-auditor.md +33 -6
- package/agents/sdd-ui-auditor.md +23 -7
- package/agents/sdd-ui-checker.md +16 -7
- package/agents/sdd-ui-researcher.md +8 -8
- package/agents/sdd-verifier.md +124 -27
- package/bin/install.js +5016 -372
- package/bin/sdd-sdk.js +37 -0
- package/commands/sdd/add-tests.md +5 -4
- package/commands/sdd/ai-integration-phase.md +4 -3
- package/commands/sdd/audit-fix.md +2 -1
- package/commands/sdd/audit-milestone.md +3 -2
- package/commands/sdd/autonomous.md +3 -3
- package/commands/sdd/capture.md +62 -0
- package/commands/sdd/cleanup.md +2 -1
- package/commands/sdd/code-review.md +8 -4
- package/commands/sdd/commit.md +39 -0
- package/commands/sdd/complete-milestone.md +15 -8
- package/commands/sdd/config.md +58 -0
- package/commands/sdd/debug.md +21 -155
- package/commands/sdd/discuss-phase.md +18 -11
- package/commands/sdd/docs-update.md +3 -2
- package/commands/sdd/eval-review.md +4 -3
- package/commands/sdd/execute-phase.md +5 -4
- package/commands/sdd/explore.md +3 -3
- package/commands/sdd/extract-learnings.md +23 -0
- package/commands/sdd/fast.md +4 -3
- package/commands/sdd/forensics.md +3 -2
- package/commands/sdd/graphify.md +199 -0
- package/commands/sdd/health.md +12 -3
- package/commands/sdd/help.md +1 -1
- package/commands/sdd/import.md +10 -5
- package/commands/sdd/inbox.md +39 -0
- package/commands/sdd/ingest-docs.md +42 -0
- package/commands/sdd/manager.md +8 -3
- package/commands/sdd/map-codebase.md +18 -6
- package/commands/sdd/milestone-summary.md +1 -1
- package/commands/sdd/mvp-phase.md +45 -0
- package/commands/sdd/new-milestone.md +4 -3
- package/commands/sdd/new-project.md +4 -3
- package/commands/sdd/ns-context.md +23 -0
- package/commands/sdd/ns-ideate.md +24 -0
- package/commands/sdd/ns-manage.md +29 -0
- package/commands/sdd/ns-project.md +22 -0
- package/commands/sdd/ns-review.md +26 -0
- package/commands/sdd/ns-workflow.md +28 -0
- package/commands/sdd/pause-work.md +6 -1
- package/commands/sdd/phase.md +56 -0
- package/commands/sdd/plan-phase.md +15 -5
- package/commands/sdd/plan-review-convergence.md +59 -0
- package/commands/sdd/pr-branch.md +2 -1
- package/commands/sdd/profile-user.md +1 -1
- package/commands/sdd/progress.md +27 -5
- package/commands/sdd/quick.md +128 -3
- package/commands/sdd/resume-work.md +2 -12
- package/commands/sdd/review-backlog.md +3 -2
- package/commands/sdd/review.md +3 -2
- package/commands/sdd/secure-phase.md +3 -2
- package/commands/sdd/settings.md +2 -9
- package/commands/sdd/ship.md +2 -1
- package/commands/sdd/sketch.md +60 -0
- package/commands/sdd/spec-phase.md +63 -0
- package/commands/sdd/spike.md +57 -0
- package/commands/sdd/stats.md +2 -1
- package/commands/sdd/surface.md +129 -0
- package/commands/sdd/thread.md +8 -111
- package/commands/sdd/ui-phase.md +3 -2
- package/commands/sdd/ui-review.md +3 -2
- package/commands/sdd/ultraplan-phase.md +34 -0
- package/commands/sdd/undo.md +2 -1
- package/commands/sdd/update.md +21 -10
- package/commands/sdd/validate-phase.md +3 -2
- package/commands/sdd/verify-work.md +5 -4
- package/commands/sdd/workspace.md +52 -0
- package/commands/sdd/workstreams.md +12 -11
- package/hooks/dist/sdd-check-update-worker.js +116 -0
- package/hooks/dist/sdd-check-update.js +13 -88
- package/hooks/dist/sdd-context-monitor.js +28 -1
- package/hooks/dist/sdd-phase-boundary.sh +23 -3
- package/hooks/dist/sdd-read-guard.js +21 -2
- package/hooks/dist/sdd-read-injection-scanner.js +152 -0
- package/hooks/dist/sdd-session-state.sh +38 -12
- package/hooks/dist/sdd-statusline.js +324 -28
- package/hooks/dist/sdd-update-banner.js +134 -0
- package/hooks/dist/sdd-validate-commit.sh +15 -5
- package/hooks/dist/sdd-workflow-guard.js +2 -2
- package/hooks/lib/git-cmd.js +150 -0
- package/hooks/sdd-check-update-worker.js +116 -0
- package/hooks/sdd-check-update.js +13 -88
- package/hooks/sdd-context-monitor.js +28 -1
- package/hooks/sdd-phase-boundary.sh +23 -3
- package/hooks/sdd-read-guard.js +21 -2
- package/hooks/sdd-read-injection-scanner.js +152 -0
- package/hooks/sdd-session-state.sh +38 -12
- package/hooks/sdd-statusline.js +324 -28
- package/hooks/sdd-update-banner.js +134 -0
- package/hooks/sdd-validate-commit.sh +15 -5
- package/hooks/sdd-workflow-guard.js +2 -2
- package/package.json +32 -7
- package/scripts/audit-workflow-script-paths.cjs +73 -0
- package/scripts/build-hooks.js +98 -4
- package/scripts/changeset/cli.cjs +269 -0
- package/scripts/changeset/github-release-notes.cjs +198 -0
- package/scripts/changeset/lint.cjs +110 -0
- package/scripts/changeset/new.cjs +137 -0
- package/scripts/changeset/parse.cjs +60 -0
- package/scripts/changeset/render.cjs +34 -0
- package/scripts/changeset/serialize.cjs +74 -0
- package/scripts/command-contract-helpers.cjs +61 -0
- package/scripts/diff-touches-shipped-paths.cjs +147 -0
- package/scripts/fix-slash-commands.cjs +106 -0
- package/scripts/gen-inventory-manifest.cjs +109 -0
- package/scripts/lint-command-contract.cjs +108 -0
- package/scripts/lint-descriptions.cjs +83 -0
- package/scripts/lint-no-source-grep-extras.cjs +81 -0
- package/scripts/lint-no-source-grep.cjs +174 -0
- package/scripts/lint-shell-command-projection-drift.cjs +57 -0
- package/scripts/lint-skill-deps.cjs +180 -0
- package/scripts/pr-template-policy.cjs +169 -0
- package/scripts/prompt-injection-scan.sh +2 -0
- package/scripts/rebrand-gsd-to-sdd.sh +4 -3
- package/scripts/strip-prose-atrefs.cjs +106 -0
- package/scripts/verify-tarball-sdk-dist.sh +69 -0
- package/sdd/bin/check-latest-version.cjs +104 -0
- package/sdd/bin/lib/active-workstream-store.cjs +85 -0
- package/sdd/bin/lib/adr-parser.cjs +394 -0
- package/sdd/bin/lib/artifacts.cjs +53 -0
- package/sdd/bin/lib/audit.cjs +755 -0
- package/sdd/bin/lib/cjs-command-router-adapter.cjs +39 -0
- package/sdd/bin/lib/clusters.cjs +136 -0
- package/sdd/bin/lib/command-aliases.generated.cjs +838 -0
- package/sdd/bin/lib/commands.cjs +108 -98
- package/sdd/bin/lib/config-schema.cjs +135 -0
- package/sdd/bin/lib/config.cjs +253 -68
- package/sdd/bin/lib/context-utilization.cjs +47 -0
- package/sdd/bin/lib/core.cjs +997 -607
- package/sdd/bin/lib/decisions.cjs +48 -0
- package/sdd/bin/lib/docs.cjs +36 -33
- package/sdd/bin/lib/drift.cjs +379 -0
- package/sdd/bin/lib/fallow-runner.cjs +109 -0
- package/sdd/bin/lib/frontmatter.cjs +19 -11
- package/sdd/bin/lib/gap-checker.cjs +197 -0
- package/sdd/bin/lib/graphify.cjs +577 -0
- package/sdd/bin/lib/init-command-router.cjs +70 -0
- package/sdd/bin/lib/init.cjs +603 -102
- package/sdd/bin/lib/install-profiles.cjs +572 -0
- package/sdd/bin/lib/installer-migration-authoring.cjs +117 -0
- package/sdd/bin/lib/installer-migration-report.cjs +328 -0
- package/sdd/bin/lib/installer-migrations/000-first-time-baseline.cjs +220 -0
- package/sdd/bin/lib/installer-migrations/001-legacy-orphan-files.cjs +41 -0
- package/sdd/bin/lib/installer-migrations/002-codex-legacy-hooks-json.cjs +80 -0
- package/sdd/bin/lib/installer-migrations.cjs +703 -0
- package/sdd/bin/lib/intel.cjs +35 -52
- package/sdd/bin/lib/learnings.cjs +2 -1
- package/sdd/bin/lib/milestone.cjs +313 -283
- package/sdd/bin/lib/model-catalog.cjs +136 -0
- package/sdd/bin/lib/model-profiles.cjs +25 -70
- package/sdd/bin/lib/phase-command-router.cjs +96 -0
- package/sdd/bin/lib/phase.cjs +556 -102
- package/sdd/bin/lib/phases-command-router.cjs +39 -0
- package/sdd/bin/lib/plan-scan.cjs +138 -0
- package/sdd/bin/lib/planning-workspace.cjs +361 -0
- package/sdd/bin/lib/profile-output.cjs +109 -43
- package/sdd/bin/lib/profile-pipeline.cjs +1 -1
- package/sdd/bin/lib/review-reviewer-selection.cjs +125 -0
- package/sdd/bin/lib/roadmap-command-router.cjs +23 -0
- package/sdd/bin/lib/roadmap.cjs +278 -17
- package/sdd/bin/lib/runtime-homes.cjs +178 -0
- package/sdd/bin/lib/sdd2-import.cjs +3 -3
- package/sdd/bin/lib/secrets.cjs +33 -0
- package/sdd/bin/lib/security.cjs +8 -7
- package/sdd/bin/lib/shell-command-projection.cjs +548 -0
- package/sdd/bin/lib/state-command-router.cjs +100 -0
- package/sdd/bin/lib/state-document.cjs +12 -0
- package/sdd/bin/lib/state-document.generated.cjs +127 -0
- package/sdd/bin/lib/state.cjs +720 -218
- package/sdd/bin/lib/surface.cjs +398 -0
- package/sdd/bin/lib/template.cjs +4 -2
- package/sdd/bin/lib/uat.cjs +9 -2
- package/sdd/bin/lib/validate-command-router.cjs +55 -0
- package/sdd/bin/lib/verify-command-router.cjs +34 -0
- package/sdd/bin/lib/verify.cjs +464 -137
- package/sdd/bin/lib/workstream-inventory.cjs +159 -0
- package/sdd/bin/lib/workstream-name-policy.cjs +33 -0
- package/sdd/bin/lib/workstream.cjs +73 -195
- package/sdd/bin/lib/worktree-safety.cjs +563 -0
- package/sdd/bin/sdd-tools.cjs +386 -252
- package/sdd/bin/verify-reapply-patches.cjs +247 -0
- package/sdd/contexts/review.md +1 -0
- package/sdd/references/artifact-types.md +18 -0
- package/sdd/references/autonomous-smart-discuss.md +277 -0
- package/sdd/references/checkpoints.md +36 -0
- package/sdd/references/context-budget.md +85 -49
- package/sdd/references/continuation-format.md +26 -22
- package/sdd/references/debugger-philosophy.md +76 -0
- package/sdd/references/decimal-phase-calculation.md +5 -5
- package/sdd/references/doc-conflict-engine.md +91 -0
- package/sdd/references/domain-probes.md +1 -1
- package/sdd/references/execute-mvp-tdd.md +81 -0
- package/sdd/references/executor-examples.md +110 -0
- package/sdd/references/gate-prompts.md +2 -2
- package/sdd/references/git-integration.md +10 -7
- package/sdd/references/git-planning-commit.md +6 -4
- package/sdd/references/mandatory-initial-read.md +2 -0
- package/sdd/references/model-profiles.md +106 -6
- package/sdd/references/mvp-concepts.md +49 -0
- package/sdd/references/phase-argument-parsing.md +3 -3
- package/sdd/references/planner-antipatterns.md +89 -0
- package/sdd/references/planner-chunked.md +49 -0
- package/sdd/references/planner-human-verify-mode.md +57 -0
- package/sdd/references/planner-mvp-mode.md +53 -0
- package/sdd/references/planner-revision.md +1 -1
- package/sdd/references/planner-source-audit.md +73 -0
- package/sdd/references/planning-config.md +30 -13
- package/sdd/references/project-skills-discovery.md +19 -0
- package/sdd/references/scout-codebase.md +51 -0
- package/sdd/references/skeleton-template.md +48 -0
- package/sdd/references/sketch-interactivity.md +41 -0
- package/sdd/references/sketch-theme-system.md +94 -0
- package/sdd/references/sketch-tooling.md +45 -0
- package/sdd/references/sketch-variant-patterns.md +81 -0
- package/sdd/references/spidr-splitting.md +69 -0
- package/sdd/references/tdd.md +67 -0
- package/sdd/references/thinking-partner.md +1 -1
- package/sdd/references/universal-anti-patterns.md +4 -4
- package/sdd/references/user-story-template.md +58 -0
- package/sdd/references/verification-overrides.md +3 -3
- package/sdd/references/verify-mvp-mode.md +85 -0
- package/sdd/references/workstream-flag.md +11 -11
- package/sdd/references/worktree-path-safety.md +89 -0
- package/sdd/templates/AI-SPEC.md +1 -1
- package/sdd/templates/DEBUG.md +8 -3
- package/sdd/templates/README.md +77 -0
- package/sdd/templates/UAT.md +4 -4
- package/sdd/templates/VALIDATION.md +1 -1
- package/sdd/templates/claude-md.md +5 -5
- package/sdd/templates/config.json +16 -2
- package/sdd/templates/debug-subagent-prompt.md +1 -1
- package/sdd/templates/dev-preferences.md +1 -1
- package/sdd/templates/discovery.md +2 -2
- package/sdd/templates/phase-prompt.md +1 -1
- package/sdd/templates/planner-subagent-prompt.md +3 -3
- package/sdd/templates/project.md +1 -1
- package/sdd/templates/research.md +41 -1
- package/sdd/templates/spec.md +307 -0
- package/sdd/templates/state.md +9 -1
- package/sdd/workflows/add-backlog.md +90 -0
- package/sdd/workflows/add-phase.md +7 -7
- package/sdd/workflows/add-tests.md +12 -12
- package/sdd/workflows/add-todo.md +4 -4
- package/sdd/workflows/ai-integration-phase.md +26 -16
- package/sdd/workflows/analyze-dependencies.md +3 -3
- package/sdd/workflows/audit-fix.md +23 -3
- package/sdd/workflows/audit-milestone.md +37 -20
- package/sdd/workflows/audit-uat.md +3 -3
- package/sdd/workflows/autonomous.md +31 -301
- package/sdd/workflows/check-todos.md +6 -6
- package/sdd/workflows/cleanup.md +1 -1
- package/sdd/workflows/code-review-fix.md +20 -16
- package/sdd/workflows/code-review.md +114 -16
- package/sdd/workflows/commit.md +166 -0
- package/sdd/workflows/complete-milestone.md +68 -15
- package/sdd/workflows/debug.md +231 -0
- package/sdd/workflows/diagnose-issues.md +8 -6
- package/sdd/workflows/discovery-phase.md +3 -3
- package/sdd/workflows/discuss-phase/modes/advisor.md +175 -0
- package/sdd/workflows/discuss-phase/modes/all.md +28 -0
- package/sdd/workflows/discuss-phase/modes/analyze.md +44 -0
- package/sdd/workflows/discuss-phase/modes/auto.md +56 -0
- package/sdd/workflows/discuss-phase/modes/batch.md +52 -0
- package/sdd/workflows/discuss-phase/modes/chain.md +97 -0
- package/sdd/workflows/discuss-phase/modes/default.md +141 -0
- package/sdd/workflows/discuss-phase/modes/power.md +44 -0
- package/sdd/workflows/discuss-phase/modes/text.md +55 -0
- package/sdd/workflows/discuss-phase/templates/checkpoint.json +18 -0
- package/sdd/workflows/discuss-phase/templates/context.md +136 -0
- package/sdd/workflows/discuss-phase/templates/discussion-log.md +50 -0
- package/sdd/workflows/discuss-phase-assumptions.md +24 -21
- package/sdd/workflows/discuss-phase-power.md +3 -3
- package/sdd/workflows/discuss-phase.md +203 -905
- package/sdd/workflows/do.md +25 -21
- package/sdd/workflows/docs-update.md +23 -17
- package/sdd/workflows/edit-phase.md +294 -0
- package/sdd/workflows/eval-review.md +7 -7
- package/sdd/workflows/execute-phase/steps/codebase-drift-gate.md +81 -0
- package/sdd/workflows/execute-phase/steps/per-plan-worktree-gate.md +94 -0
- package/sdd/workflows/execute-phase/steps/post-merge-gate.md +116 -0
- package/sdd/workflows/execute-phase.md +650 -252
- package/sdd/workflows/execute-plan.md +75 -35
- package/sdd/workflows/explore.md +7 -3
- package/sdd/workflows/extract-learnings.md +242 -0
- package/sdd/workflows/fast.md +13 -12
- package/sdd/workflows/forensics.md +19 -6
- package/sdd/workflows/graduation.md +195 -0
- package/sdd/workflows/health.md +49 -7
- package/sdd/workflows/help.md +340 -149
- package/sdd/workflows/import.md +20 -43
- package/sdd/workflows/inbox.md +5 -5
- package/sdd/workflows/ingest-docs.md +339 -0
- package/sdd/workflows/insert-phase.md +33 -12
- package/sdd/workflows/list-phase-assumptions.md +2 -2
- package/sdd/workflows/list-workspaces.md +2 -2
- package/sdd/workflows/manager.md +38 -11
- package/sdd/workflows/map-codebase.md +87 -23
- package/sdd/workflows/milestone-summary.md +8 -8
- package/sdd/workflows/mvp-phase.md +221 -0
- package/sdd/workflows/new-milestone.md +163 -23
- package/sdd/workflows/new-project.md +254 -53
- package/sdd/workflows/new-workspace.md +8 -8
- package/sdd/workflows/next.md +85 -18
- package/sdd/workflows/note.md +2 -2
- package/sdd/workflows/pause-work.md +13 -9
- package/sdd/workflows/plan-milestone-gaps.md +18 -11
- package/sdd/workflows/plan-phase.md +767 -94
- package/sdd/workflows/plan-review-convergence.md +329 -0
- package/sdd/workflows/plant-seed.md +146 -89
- package/sdd/workflows/pr-branch.md +1 -1
- package/sdd/workflows/profile-user.md +15 -15
- package/sdd/workflows/progress.md +198 -56
- package/sdd/workflows/quick.md +318 -54
- package/{commands/sdd → sdd/workflows}/reapply-patches.md +102 -23
- package/sdd/workflows/remove-phase.md +10 -10
- package/sdd/workflows/remove-workspace.md +21 -6
- package/sdd/workflows/resume-project.md +26 -23
- package/sdd/workflows/review.md +151 -20
- package/sdd/workflows/scan.md +5 -3
- package/sdd/workflows/secure-phase.md +26 -13
- package/sdd/workflows/settings-advanced.md +579 -0
- package/sdd/workflows/settings-integrations.md +281 -0
- package/sdd/workflows/settings.md +202 -23
- package/sdd/workflows/ship.md +131 -16
- package/sdd/workflows/sketch-wrap-up.md +285 -0
- package/sdd/workflows/sketch.md +360 -0
- package/sdd/workflows/spec-phase.md +262 -0
- package/sdd/workflows/spike-wrap-up.md +306 -0
- package/sdd/workflows/spike.md +452 -0
- package/sdd/workflows/stats.md +21 -2
- package/sdd/workflows/sync-skills.md +182 -0
- package/sdd/workflows/thread.md +221 -0
- package/sdd/workflows/transition.md +52 -30
- package/sdd/workflows/ui-phase.md +37 -20
- package/sdd/workflows/ui-review.md +12 -10
- package/sdd/workflows/ultraplan-phase.md +198 -0
- package/sdd/workflows/undo.md +9 -9
- package/sdd/workflows/update.md +187 -17
- package/sdd/workflows/validate-phase.md +12 -10
- package/sdd/workflows/verify-phase.md +112 -27
- package/sdd/workflows/verify-work.md +97 -28
- package/sdk/dist/cli-transport.d.ts +19 -0
- package/sdk/dist/cli-transport.d.ts.map +1 -0
- package/sdk/dist/cli-transport.js +104 -0
- package/sdk/dist/cli-transport.js.map +1 -0
- package/sdk/dist/cli.d.ts +46 -0
- package/sdk/dist/cli.d.ts.map +1 -0
- package/sdk/dist/cli.js +511 -0
- package/sdk/dist/cli.js.map +1 -0
- package/sdk/dist/config.d.ts +84 -0
- package/sdk/dist/config.d.ts.map +1 -0
- package/sdk/dist/config.js +135 -0
- package/sdk/dist/config.js.map +1 -0
- package/sdk/dist/context-engine.d.ts +49 -0
- package/sdk/dist/context-engine.d.ts.map +1 -0
- package/sdk/dist/context-engine.js +142 -0
- package/sdk/dist/context-engine.js.map +1 -0
- package/sdk/dist/context-truncation.d.ts +33 -0
- package/sdk/dist/context-truncation.d.ts.map +1 -0
- package/sdk/dist/context-truncation.js +197 -0
- package/sdk/dist/context-truncation.js.map +1 -0
- package/sdk/dist/errors.d.ts +46 -0
- package/sdk/dist/errors.d.ts.map +1 -0
- package/sdk/dist/errors.js +64 -0
- package/sdk/dist/errors.js.map +1 -0
- package/sdk/dist/event-stream.d.ts +53 -0
- package/sdk/dist/event-stream.d.ts.map +1 -0
- package/sdk/dist/event-stream.js +321 -0
- package/sdk/dist/event-stream.js.map +1 -0
- package/sdk/dist/golden/capture.d.ts +15 -0
- package/sdk/dist/golden/capture.d.ts.map +1 -0
- package/sdk/dist/golden/capture.js +67 -0
- package/sdk/dist/golden/capture.js.map +1 -0
- package/sdk/dist/golden/golden-integration-covered.d.ts +6 -0
- package/sdk/dist/golden/golden-integration-covered.d.ts.map +1 -0
- package/sdk/dist/golden/golden-integration-covered.js +30 -0
- package/sdk/dist/golden/golden-integration-covered.js.map +1 -0
- package/sdk/dist/golden/golden-mutation-covered.d.ts +7 -0
- package/sdk/dist/golden/golden-mutation-covered.d.ts.map +1 -0
- package/sdk/dist/golden/golden-mutation-covered.js +17 -0
- package/sdk/dist/golden/golden-mutation-covered.js.map +1 -0
- package/sdk/dist/golden/golden-policy.d.ts +10 -0
- package/sdk/dist/golden/golden-policy.d.ts.map +1 -0
- package/sdk/dist/golden/golden-policy.js +98 -0
- package/sdk/dist/golden/golden-policy.js.map +1 -0
- package/sdk/dist/golden/init-golden-normalize.d.ts +8 -0
- package/sdk/dist/golden/init-golden-normalize.d.ts.map +1 -0
- package/sdk/dist/golden/init-golden-normalize.js +14 -0
- package/sdk/dist/golden/init-golden-normalize.js.map +1 -0
- package/sdk/dist/golden/read-only-golden-rows.d.ts +20 -0
- package/sdk/dist/golden/read-only-golden-rows.d.ts.map +1 -0
- package/sdk/dist/golden/read-only-golden-rows.js +67 -0
- package/sdk/dist/golden/read-only-golden-rows.js.map +1 -0
- package/sdk/dist/golden/registry-canonical-commands.d.ts +6 -0
- package/sdk/dist/golden/registry-canonical-commands.d.ts.map +1 -0
- package/sdk/dist/golden/registry-canonical-commands.js +30 -0
- package/sdk/dist/golden/registry-canonical-commands.js.map +1 -0
- package/sdk/dist/index.d.ts +125 -0
- package/sdk/dist/index.d.ts.map +1 -0
- package/sdk/dist/index.js +298 -0
- package/sdk/dist/index.js.map +1 -0
- package/sdk/dist/init-runner.d.ts +90 -0
- package/sdk/dist/init-runner.d.ts.map +1 -0
- package/sdk/dist/init-runner.js +613 -0
- package/sdk/dist/init-runner.js.map +1 -0
- package/sdk/dist/logger.d.ts +50 -0
- package/sdk/dist/logger.d.ts.map +1 -0
- package/sdk/dist/logger.js +70 -0
- package/sdk/dist/logger.js.map +1 -0
- package/sdk/dist/model-catalog.d.ts +31 -0
- package/sdk/dist/model-catalog.d.ts.map +1 -0
- package/sdk/dist/model-catalog.js +31 -0
- package/sdk/dist/model-catalog.js.map +1 -0
- package/sdk/dist/phase-prompt.d.ts +72 -0
- package/sdk/dist/phase-prompt.d.ts.map +1 -0
- package/sdk/dist/phase-prompt.js +213 -0
- package/sdk/dist/phase-prompt.js.map +1 -0
- package/sdk/dist/phase-runner.d.ts +145 -0
- package/sdk/dist/phase-runner.d.ts.map +1 -0
- package/sdk/dist/phase-runner.js +1206 -0
- package/sdk/dist/phase-runner.js.map +1 -0
- package/sdk/dist/plan-parser.d.ts +55 -0
- package/sdk/dist/plan-parser.d.ts.map +1 -0
- package/sdk/dist/plan-parser.js +389 -0
- package/sdk/dist/plan-parser.js.map +1 -0
- package/sdk/dist/planning-journal.d.ts +64 -0
- package/sdk/dist/planning-journal.d.ts.map +1 -0
- package/sdk/dist/planning-journal.js +88 -0
- package/sdk/dist/planning-journal.js.map +1 -0
- package/sdk/dist/planning-runtime.d.ts +67 -0
- package/sdk/dist/planning-runtime.d.ts.map +1 -0
- package/sdk/dist/planning-runtime.js +58 -0
- package/sdk/dist/planning-runtime.js.map +1 -0
- package/sdk/dist/prompt-builder.d.ts +44 -0
- package/sdk/dist/prompt-builder.d.ts.map +1 -0
- package/sdk/dist/prompt-builder.js +180 -0
- package/sdk/dist/prompt-builder.js.map +1 -0
- package/sdk/dist/prompt-sanitizer.d.ts +35 -0
- package/sdk/dist/prompt-sanitizer.d.ts.map +1 -0
- package/sdk/dist/prompt-sanitizer.js +101 -0
- package/sdk/dist/prompt-sanitizer.js.map +1 -0
- package/sdk/dist/query/active-workstream-store.d.ts +7 -0
- package/sdk/dist/query/active-workstream-store.d.ts.map +1 -0
- package/sdk/dist/query/active-workstream-store.js +56 -0
- package/sdk/dist/query/active-workstream-store.js.map +1 -0
- package/sdk/dist/query/agent-failure-classifier.d.ts +38 -0
- package/sdk/dist/query/agent-failure-classifier.d.ts.map +1 -0
- package/sdk/dist/query/agent-failure-classifier.js +83 -0
- package/sdk/dist/query/agent-failure-classifier.js.map +1 -0
- package/sdk/dist/query/audit-open.d.ts +46 -0
- package/sdk/dist/query/audit-open.d.ts.map +1 -0
- package/sdk/dist/query/audit-open.js +662 -0
- package/sdk/dist/query/audit-open.js.map +1 -0
- package/sdk/dist/query/check-auto-mode.d.ts +13 -0
- package/sdk/dist/query/check-auto-mode.d.ts.map +1 -0
- package/sdk/dist/query/check-auto-mode.js +40 -0
- package/sdk/dist/query/check-auto-mode.js.map +1 -0
- package/sdk/dist/query/check-completion.d.ts +10 -0
- package/sdk/dist/query/check-completion.d.ts.map +1 -0
- package/sdk/dist/query/check-completion.js +157 -0
- package/sdk/dist/query/check-completion.js.map +1 -0
- package/sdk/dist/query/check-decision-coverage.d.ts +33 -0
- package/sdk/dist/query/check-decision-coverage.d.ts.map +1 -0
- package/sdk/dist/query/check-decision-coverage.js +472 -0
- package/sdk/dist/query/check-decision-coverage.js.map +1 -0
- package/sdk/dist/query/check-gates.d.ts +10 -0
- package/sdk/dist/query/check-gates.d.ts.map +1 -0
- package/sdk/dist/query/check-gates.js +89 -0
- package/sdk/dist/query/check-gates.js.map +1 -0
- package/sdk/dist/query/check-ship-ready.d.ts +10 -0
- package/sdk/dist/query/check-ship-ready.d.ts.map +1 -0
- package/sdk/dist/query/check-ship-ready.js +93 -0
- package/sdk/dist/query/check-ship-ready.js.map +1 -0
- package/sdk/dist/query/check-verification-status.d.ts +10 -0
- package/sdk/dist/query/check-verification-status.d.ts.map +1 -0
- package/sdk/dist/query/check-verification-status.js +142 -0
- package/sdk/dist/query/check-verification-status.js.map +1 -0
- package/sdk/dist/query/command-aliases.generated.d.ts +31 -0
- package/sdk/dist/query/command-aliases.generated.d.ts.map +1 -0
- package/sdk/dist/query/command-aliases.generated.js +135 -0
- package/sdk/dist/query/command-aliases.generated.js.map +1 -0
- package/sdk/dist/query/command-catalog.d.ts +9 -0
- package/sdk/dist/query/command-catalog.d.ts.map +1 -0
- package/sdk/dist/query/command-catalog.js +17 -0
- package/sdk/dist/query/command-catalog.js.map +1 -0
- package/sdk/dist/query/command-definition.d.ts +19 -0
- package/sdk/dist/query/command-definition.d.ts.map +1 -0
- package/sdk/dist/query/command-definition.js +44 -0
- package/sdk/dist/query/command-definition.js.map +1 -0
- package/sdk/dist/query/command-family-handlers.d.ts +3 -0
- package/sdk/dist/query/command-family-handlers.d.ts.map +1 -0
- package/sdk/dist/query/command-family-handlers.js +94 -0
- package/sdk/dist/query/command-family-handlers.js.map +1 -0
- package/sdk/dist/query/command-manifest.d.ts +2 -0
- package/sdk/dist/query/command-manifest.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.init.d.ts +6 -0
- package/sdk/dist/query/command-manifest.init.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.init.js +23 -0
- package/sdk/dist/query/command-manifest.init.js.map +1 -0
- package/sdk/dist/query/command-manifest.js +17 -0
- package/sdk/dist/query/command-manifest.js.map +1 -0
- package/sdk/dist/query/command-manifest.non-family.d.ts +9 -0
- package/sdk/dist/query/command-manifest.non-family.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.non-family.js +59 -0
- package/sdk/dist/query/command-manifest.non-family.js.map +1 -0
- package/sdk/dist/query/command-manifest.phase.d.ts +6 -0
- package/sdk/dist/query/command-manifest.phase.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.phase.js +15 -0
- package/sdk/dist/query/command-manifest.phase.js.map +1 -0
- package/sdk/dist/query/command-manifest.phases.d.ts +7 -0
- package/sdk/dist/query/command-manifest.phases.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.phases.js +10 -0
- package/sdk/dist/query/command-manifest.phases.js.map +1 -0
- package/sdk/dist/query/command-manifest.roadmap.d.ts +6 -0
- package/sdk/dist/query/command-manifest.roadmap.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.roadmap.js +10 -0
- package/sdk/dist/query/command-manifest.roadmap.js.map +1 -0
- package/sdk/dist/query/command-manifest.state.d.ts +9 -0
- package/sdk/dist/query/command-manifest.state.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.state.js +30 -0
- package/sdk/dist/query/command-manifest.state.js.map +1 -0
- package/sdk/dist/query/command-manifest.types.d.ts +12 -0
- package/sdk/dist/query/command-manifest.types.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.types.js +2 -0
- package/sdk/dist/query/command-manifest.types.js.map +1 -0
- package/sdk/dist/query/command-manifest.validate.d.ts +6 -0
- package/sdk/dist/query/command-manifest.validate.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.validate.js +10 -0
- package/sdk/dist/query/command-manifest.validate.js.map +1 -0
- package/sdk/dist/query/command-manifest.verify.d.ts +6 -0
- package/sdk/dist/query/command-manifest.verify.d.ts.map +1 -0
- package/sdk/dist/query/command-manifest.verify.js +14 -0
- package/sdk/dist/query/command-manifest.verify.js.map +1 -0
- package/sdk/dist/query/command-static-catalog-domain.d.ts +3 -0
- package/sdk/dist/query/command-static-catalog-domain.d.ts.map +1 -0
- package/sdk/dist/query/command-static-catalog-domain.js +116 -0
- package/sdk/dist/query/command-static-catalog-domain.js.map +1 -0
- package/sdk/dist/query/command-static-catalog-foundation.d.ts +7 -0
- package/sdk/dist/query/command-static-catalog-foundation.d.ts.map +1 -0
- package/sdk/dist/query/command-static-catalog-foundation.js +98 -0
- package/sdk/dist/query/command-static-catalog-foundation.js.map +1 -0
- package/sdk/dist/query/command-topology.d.ts +32 -0
- package/sdk/dist/query/command-topology.d.ts.map +1 -0
- package/sdk/dist/query/command-topology.js +66 -0
- package/sdk/dist/query/command-topology.js.map +1 -0
- package/sdk/dist/query/commands-list.d.ts +14 -0
- package/sdk/dist/query/commands-list.d.ts.map +1 -0
- package/sdk/dist/query/commands-list.js +18 -0
- package/sdk/dist/query/commands-list.js.map +1 -0
- package/sdk/dist/query/commit.d.ts +79 -0
- package/sdk/dist/query/commit.d.ts.map +1 -0
- package/sdk/dist/query/commit.js +340 -0
- package/sdk/dist/query/commit.js.map +1 -0
- package/sdk/dist/query/config-gates.d.ts +12 -0
- package/sdk/dist/query/config-gates.d.ts.map +1 -0
- package/sdk/dist/query/config-gates.js +66 -0
- package/sdk/dist/query/config-gates.js.map +1 -0
- package/sdk/dist/query/config-mutation.d.ts +86 -0
- package/sdk/dist/query/config-mutation.d.ts.map +1 -0
- package/sdk/dist/query/config-mutation.js +518 -0
- package/sdk/dist/query/config-mutation.js.map +1 -0
- package/sdk/dist/query/config-query.d.ts +57 -0
- package/sdk/dist/query/config-query.d.ts.map +1 -0
- package/sdk/dist/query/config-query.js +208 -0
- package/sdk/dist/query/config-query.js.map +1 -0
- package/sdk/dist/query/config-schema.d.ts +36 -0
- package/sdk/dist/query/config-schema.d.ts.map +1 -0
- package/sdk/dist/query/config-schema.js +147 -0
- package/sdk/dist/query/config-schema.js.map +1 -0
- package/sdk/dist/query/decisions.d.ts +58 -0
- package/sdk/dist/query/decisions.d.ts.map +1 -0
- package/sdk/dist/query/decisions.js +161 -0
- package/sdk/dist/query/decisions.js.map +1 -0
- package/sdk/dist/query/detect-custom-files.d.ts +11 -0
- package/sdk/dist/query/detect-custom-files.d.ts.map +1 -0
- package/sdk/dist/query/detect-custom-files.js +89 -0
- package/sdk/dist/query/detect-custom-files.js.map +1 -0
- package/sdk/dist/query/detect-phase-type.d.ts +9 -0
- package/sdk/dist/query/detect-phase-type.d.ts.map +1 -0
- package/sdk/dist/query/detect-phase-type.js +124 -0
- package/sdk/dist/query/detect-phase-type.js.map +1 -0
- package/sdk/dist/query/docs-init.d.ts +26 -0
- package/sdk/dist/query/docs-init.d.ts.map +1 -0
- package/sdk/dist/query/docs-init.js +231 -0
- package/sdk/dist/query/docs-init.js.map +1 -0
- package/sdk/dist/query/fallow-audit.d.ts +44 -0
- package/sdk/dist/query/fallow-audit.d.ts.map +1 -0
- package/sdk/dist/query/fallow-audit.js +44 -0
- package/sdk/dist/query/fallow-audit.js.map +1 -0
- package/sdk/dist/query/frontmatter-mutation.d.ts +77 -0
- package/sdk/dist/query/frontmatter-mutation.d.ts.map +1 -0
- package/sdk/dist/query/frontmatter-mutation.js +317 -0
- package/sdk/dist/query/frontmatter-mutation.js.map +1 -0
- package/sdk/dist/query/frontmatter.d.ts +93 -0
- package/sdk/dist/query/frontmatter.d.ts.map +1 -0
- package/sdk/dist/query/frontmatter.js +365 -0
- package/sdk/dist/query/frontmatter.js.map +1 -0
- package/sdk/dist/query/helpers.d.ts +191 -0
- package/sdk/dist/query/helpers.d.ts.map +1 -0
- package/sdk/dist/query/helpers.js +613 -0
- package/sdk/dist/query/helpers.js.map +1 -0
- package/sdk/dist/query/index.d.ts +8 -0
- package/sdk/dist/query/index.d.ts.map +1 -0
- package/sdk/dist/query/index.js +6 -0
- package/sdk/dist/query/index.js.map +1 -0
- package/sdk/dist/query/init-complex.d.ts +47 -0
- package/sdk/dist/query/init-complex.d.ts.map +1 -0
- package/sdk/dist/query/init-complex.js +718 -0
- package/sdk/dist/query/init-complex.js.map +1 -0
- package/sdk/dist/query/init.d.ts +106 -0
- package/sdk/dist/query/init.d.ts.map +1 -0
- package/sdk/dist/query/init.js +1159 -0
- package/sdk/dist/query/init.js.map +1 -0
- package/sdk/dist/query/intel.d.ts +43 -0
- package/sdk/dist/query/intel.d.ts.map +1 -0
- package/sdk/dist/query/intel.js +416 -0
- package/sdk/dist/query/intel.js.map +1 -0
- package/sdk/dist/query/mutation-event-decorator.d.ts +5 -0
- package/sdk/dist/query/mutation-event-decorator.d.ts.map +1 -0
- package/sdk/dist/query/mutation-event-decorator.js +28 -0
- package/sdk/dist/query/mutation-event-decorator.js.map +1 -0
- package/sdk/dist/query/mutation-event-mapper.d.ts +4 -0
- package/sdk/dist/query/mutation-event-mapper.d.ts.map +1 -0
- package/sdk/dist/query/mutation-event-mapper.js +70 -0
- package/sdk/dist/query/mutation-event-mapper.js.map +1 -0
- package/sdk/dist/query/mvp.d.ts +113 -0
- package/sdk/dist/query/mvp.d.ts.map +1 -0
- package/sdk/dist/query/mvp.js +225 -0
- package/sdk/dist/query/mvp.js.map +1 -0
- package/sdk/dist/query/phase-filesystem-adapter.d.ts +4 -0
- package/sdk/dist/query/phase-filesystem-adapter.d.ts.map +1 -0
- package/sdk/dist/query/phase-filesystem-adapter.js +33 -0
- package/sdk/dist/query/phase-filesystem-adapter.js.map +1 -0
- package/sdk/dist/query/phase-lifecycle-policy.d.ts +34 -0
- package/sdk/dist/query/phase-lifecycle-policy.d.ts.map +1 -0
- package/sdk/dist/query/phase-lifecycle-policy.js +138 -0
- package/sdk/dist/query/phase-lifecycle-policy.js.map +1 -0
- package/sdk/dist/query/phase-lifecycle.d.ts +116 -0
- package/sdk/dist/query/phase-lifecycle.d.ts.map +1 -0
- package/sdk/dist/query/phase-lifecycle.js +1486 -0
- package/sdk/dist/query/phase-lifecycle.js.map +1 -0
- package/sdk/dist/query/phase-list-queries.d.ts +18 -0
- package/sdk/dist/query/phase-list-queries.d.ts.map +1 -0
- package/sdk/dist/query/phase-list-queries.js +129 -0
- package/sdk/dist/query/phase-list-queries.js.map +1 -0
- package/sdk/dist/query/phase-ready.d.ts +9 -0
- package/sdk/dist/query/phase-ready.d.ts.map +1 -0
- package/sdk/dist/query/phase-ready.js +132 -0
- package/sdk/dist/query/phase-ready.js.map +1 -0
- package/sdk/dist/query/phase-roadmap-mutation.d.ts +13 -0
- package/sdk/dist/query/phase-roadmap-mutation.d.ts.map +1 -0
- package/sdk/dist/query/phase-roadmap-mutation.js +65 -0
- package/sdk/dist/query/phase-roadmap-mutation.js.map +1 -0
- package/sdk/dist/query/phase.d.ts +48 -0
- package/sdk/dist/query/phase.d.ts.map +1 -0
- package/sdk/dist/query/phase.js +451 -0
- package/sdk/dist/query/phase.js.map +1 -0
- package/sdk/dist/query/pipeline.d.ts +53 -0
- package/sdk/dist/query/pipeline.d.ts.map +1 -0
- package/sdk/dist/query/pipeline.js +198 -0
- package/sdk/dist/query/pipeline.js.map +1 -0
- package/sdk/dist/query/plan-scan.d.ts +14 -0
- package/sdk/dist/query/plan-scan.d.ts.map +1 -0
- package/sdk/dist/query/plan-scan.js +70 -0
- package/sdk/dist/query/plan-scan.js.map +1 -0
- package/sdk/dist/query/plan-task-structure.d.ts +9 -0
- package/sdk/dist/query/plan-task-structure.d.ts.map +1 -0
- package/sdk/dist/query/plan-task-structure.js +59 -0
- package/sdk/dist/query/plan-task-structure.js.map +1 -0
- package/sdk/dist/query/profile-extract-messages.d.ts +40 -0
- package/sdk/dist/query/profile-extract-messages.d.ts.map +1 -0
- package/sdk/dist/query/profile-extract-messages.js +195 -0
- package/sdk/dist/query/profile-extract-messages.js.map +1 -0
- package/sdk/dist/query/profile-output.d.ts +11 -0
- package/sdk/dist/query/profile-output.d.ts.map +1 -0
- package/sdk/dist/query/profile-output.js +873 -0
- package/sdk/dist/query/profile-output.js.map +1 -0
- package/sdk/dist/query/profile-questionnaire-data.d.ts +21 -0
- package/sdk/dist/query/profile-questionnaire-data.d.ts.map +1 -0
- package/sdk/dist/query/profile-questionnaire-data.js +171 -0
- package/sdk/dist/query/profile-questionnaire-data.js.map +1 -0
- package/sdk/dist/query/profile-sample.d.ts +22 -0
- package/sdk/dist/query/profile-sample.d.ts.map +1 -0
- package/sdk/dist/query/profile-sample.js +136 -0
- package/sdk/dist/query/profile-sample.js.map +1 -0
- package/sdk/dist/query/profile-scan-sessions.d.ts +49 -0
- package/sdk/dist/query/profile-scan-sessions.d.ts.map +1 -0
- package/sdk/dist/query/profile-scan-sessions.js +137 -0
- package/sdk/dist/query/profile-scan-sessions.js.map +1 -0
- package/sdk/dist/query/profile.d.ts +61 -0
- package/sdk/dist/query/profile.d.ts.map +1 -0
- package/sdk/dist/query/profile.js +307 -0
- package/sdk/dist/query/profile.js.map +1 -0
- package/sdk/dist/query/progress.d.ts +77 -0
- package/sdk/dist/query/progress.d.ts.map +1 -0
- package/sdk/dist/query/progress.js +481 -0
- package/sdk/dist/query/progress.js.map +1 -0
- package/sdk/dist/query/query-cli-adapter.d.ts +8 -0
- package/sdk/dist/query/query-cli-adapter.d.ts.map +1 -0
- package/sdk/dist/query/query-cli-adapter.js +32 -0
- package/sdk/dist/query/query-cli-adapter.js.map +1 -0
- package/sdk/dist/query/query-cli-output.d.ts +9 -0
- package/sdk/dist/query/query-cli-output.d.ts.map +1 -0
- package/sdk/dist/query/query-cli-output.js +28 -0
- package/sdk/dist/query/query-cli-output.js.map +1 -0
- package/sdk/dist/query/query-command-diagnosis.d.ts +6 -0
- package/sdk/dist/query/query-command-diagnosis.d.ts.map +1 -0
- package/sdk/dist/query/query-command-diagnosis.js +6 -0
- package/sdk/dist/query/query-command-diagnosis.js.map +1 -0
- package/sdk/dist/query/query-command-resolution-strategy.d.ts +29 -0
- package/sdk/dist/query/query-command-resolution-strategy.d.ts.map +1 -0
- package/sdk/dist/query/query-command-resolution-strategy.js +103 -0
- package/sdk/dist/query/query-command-resolution-strategy.js.map +1 -0
- package/sdk/dist/query/query-command-semantics.d.ts +7 -0
- package/sdk/dist/query/query-command-semantics.d.ts.map +1 -0
- package/sdk/dist/query/query-command-semantics.js +7 -0
- package/sdk/dist/query/query-command-semantics.js.map +1 -0
- package/sdk/dist/query/query-dispatch-contract.d.ts +21 -0
- package/sdk/dist/query/query-dispatch-contract.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-contract.js +2 -0
- package/sdk/dist/query/query-dispatch-contract.js.map +1 -0
- package/sdk/dist/query/query-dispatch-error-mapper.d.ts +6 -0
- package/sdk/dist/query/query-dispatch-error-mapper.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-error-mapper.js +6 -0
- package/sdk/dist/query/query-dispatch-error-mapper.js.map +1 -0
- package/sdk/dist/query/query-dispatch-formatting.d.ts +6 -0
- package/sdk/dist/query/query-dispatch-formatting.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-formatting.js +6 -0
- package/sdk/dist/query/query-dispatch-formatting.js.map +1 -0
- package/sdk/dist/query/query-dispatch-input-validation.d.ts +6 -0
- package/sdk/dist/query/query-dispatch-input-validation.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-input-validation.js +6 -0
- package/sdk/dist/query/query-dispatch-input-validation.js.map +1 -0
- package/sdk/dist/query/query-dispatch-observability.d.ts +2 -0
- package/sdk/dist/query/query-dispatch-observability.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-observability.js +7 -0
- package/sdk/dist/query/query-dispatch-observability.js.map +1 -0
- package/sdk/dist/query/query-dispatch-plan.d.ts +6 -0
- package/sdk/dist/query/query-dispatch-plan.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-plan.js +6 -0
- package/sdk/dist/query/query-dispatch-plan.js.map +1 -0
- package/sdk/dist/query/query-dispatch-result-builder.d.ts +6 -0
- package/sdk/dist/query/query-dispatch-result-builder.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch-result-builder.js +6 -0
- package/sdk/dist/query/query-dispatch-result-builder.js.map +1 -0
- package/sdk/dist/query/query-dispatch.d.ts +48 -0
- package/sdk/dist/query/query-dispatch.d.ts.map +1 -0
- package/sdk/dist/query/query-dispatch.js +175 -0
- package/sdk/dist/query/query-dispatch.js.map +1 -0
- package/sdk/dist/query/query-error-details-schema.d.ts +19 -0
- package/sdk/dist/query/query-error-details-schema.d.ts.map +1 -0
- package/sdk/dist/query/query-error-details-schema.js +10 -0
- package/sdk/dist/query/query-error-details-schema.js.map +1 -0
- package/sdk/dist/query/query-error-taxonomy.d.ts +38 -0
- package/sdk/dist/query/query-error-taxonomy.d.ts.map +1 -0
- package/sdk/dist/query/query-error-taxonomy.js +74 -0
- package/sdk/dist/query/query-error-taxonomy.js.map +1 -0
- package/sdk/dist/query/query-fallback-bridge-adapter.d.ts +14 -0
- package/sdk/dist/query/query-fallback-bridge-adapter.d.ts.map +1 -0
- package/sdk/dist/query/query-fallback-bridge-adapter.js +33 -0
- package/sdk/dist/query/query-fallback-bridge-adapter.js.map +1 -0
- package/sdk/dist/query/query-fallback-executor.d.ts +11 -0
- package/sdk/dist/query/query-fallback-executor.d.ts.map +1 -0
- package/sdk/dist/query/query-fallback-executor.js +31 -0
- package/sdk/dist/query/query-fallback-executor.js.map +1 -0
- package/sdk/dist/query/query-fallback-output-classifier.d.ts +6 -0
- package/sdk/dist/query/query-fallback-output-classifier.d.ts.map +1 -0
- package/sdk/dist/query/query-fallback-output-classifier.js +27 -0
- package/sdk/dist/query/query-fallback-output-classifier.js.map +1 -0
- package/sdk/dist/query/query-fallback-policy.d.ts +6 -0
- package/sdk/dist/query/query-fallback-policy.d.ts.map +1 -0
- package/sdk/dist/query/query-fallback-policy.js +7 -0
- package/sdk/dist/query/query-fallback-policy.js.map +1 -0
- package/sdk/dist/query/query-native-dispatch-adapter.d.ts +7 -0
- package/sdk/dist/query/query-native-dispatch-adapter.d.ts.map +1 -0
- package/sdk/dist/query/query-native-dispatch-adapter.js +6 -0
- package/sdk/dist/query/query-native-dispatch-adapter.js.map +1 -0
- package/sdk/dist/query/query-policy-capability.d.ts +10 -0
- package/sdk/dist/query/query-policy-capability.d.ts.map +1 -0
- package/sdk/dist/query/query-policy-capability.js +17 -0
- package/sdk/dist/query/query-policy-capability.js.map +1 -0
- package/sdk/dist/query/query-runtime-context.d.ts +19 -0
- package/sdk/dist/query/query-runtime-context.d.ts.map +1 -0
- package/sdk/dist/query/query-runtime-context.js +31 -0
- package/sdk/dist/query/query-runtime-context.js.map +1 -0
- package/sdk/dist/query/query-unknown-command-hints.d.ts +2 -0
- package/sdk/dist/query/query-unknown-command-hints.d.ts.map +1 -0
- package/sdk/dist/query/query-unknown-command-hints.js +6 -0
- package/sdk/dist/query/query-unknown-command-hints.js.map +1 -0
- package/sdk/dist/query/registry-assembly-descriptor.d.ts +12 -0
- package/sdk/dist/query/registry-assembly-descriptor.d.ts.map +1 -0
- package/sdk/dist/query/registry-assembly-descriptor.js +61 -0
- package/sdk/dist/query/registry-assembly-descriptor.js.map +1 -0
- package/sdk/dist/query/registry-assembly-invariants.d.ts +30 -0
- package/sdk/dist/query/registry-assembly-invariants.d.ts.map +1 -0
- package/sdk/dist/query/registry-assembly-invariants.js +77 -0
- package/sdk/dist/query/registry-assembly-invariants.js.map +1 -0
- package/sdk/dist/query/registry-assembly.d.ts +10 -0
- package/sdk/dist/query/registry-assembly.d.ts.map +1 -0
- package/sdk/dist/query/registry-assembly.js +53 -0
- package/sdk/dist/query/registry-assembly.js.map +1 -0
- package/sdk/dist/query/registry.d.ts +90 -0
- package/sdk/dist/query/registry.d.ts.map +1 -0
- package/sdk/dist/query/registry.js +129 -0
- package/sdk/dist/query/registry.js.map +1 -0
- package/sdk/dist/query/requirements-extract-from-plans.d.ts +9 -0
- package/sdk/dist/query/requirements-extract-from-plans.d.ts.map +1 -0
- package/sdk/dist/query/requirements-extract-from-plans.js +76 -0
- package/sdk/dist/query/requirements-extract-from-plans.js.map +1 -0
- package/sdk/dist/query/roadmap-update-plan-progress.d.ts +11 -0
- package/sdk/dist/query/roadmap-update-plan-progress.d.ts.map +1 -0
- package/sdk/dist/query/roadmap-update-plan-progress.js +124 -0
- package/sdk/dist/query/roadmap-update-plan-progress.js.map +1 -0
- package/sdk/dist/query/roadmap.d.ts +137 -0
- package/sdk/dist/query/roadmap.d.ts.map +1 -0
- package/sdk/dist/query/roadmap.js +753 -0
- package/sdk/dist/query/roadmap.js.map +1 -0
- package/sdk/dist/query/route-next-action.d.ts +9 -0
- package/sdk/dist/query/route-next-action.d.ts.map +1 -0
- package/sdk/dist/query/route-next-action.js +318 -0
- package/sdk/dist/query/route-next-action.js.map +1 -0
- package/sdk/dist/query/schema-detect.d.ts +21 -0
- package/sdk/dist/query/schema-detect.d.ts.map +1 -0
- package/sdk/dist/query/schema-detect.js +146 -0
- package/sdk/dist/query/schema-detect.js.map +1 -0
- package/sdk/dist/query/secrets.d.ts +27 -0
- package/sdk/dist/query/secrets.d.ts.map +1 -0
- package/sdk/dist/query/secrets.js +42 -0
- package/sdk/dist/query/secrets.js.map +1 -0
- package/sdk/dist/query/skill-manifest.d.ts +50 -0
- package/sdk/dist/query/skill-manifest.d.ts.map +1 -0
- package/sdk/dist/query/skill-manifest.js +171 -0
- package/sdk/dist/query/skill-manifest.js.map +1 -0
- package/sdk/dist/query/skills.d.ts +27 -0
- package/sdk/dist/query/skills.d.ts.map +1 -0
- package/sdk/dist/query/skills.js +137 -0
- package/sdk/dist/query/skills.js.map +1 -0
- package/sdk/dist/query/state-document.d.ts +14 -0
- package/sdk/dist/query/state-document.d.ts.map +1 -0
- package/sdk/dist/query/state-document.js +110 -0
- package/sdk/dist/query/state-document.js.map +1 -0
- package/sdk/dist/query/state-mutation.d.ts +224 -0
- package/sdk/dist/query/state-mutation.d.ts.map +1 -0
- package/sdk/dist/query/state-mutation.js +1539 -0
- package/sdk/dist/query/state-mutation.js.map +1 -0
- package/sdk/dist/query/state-project-load.d.ts +23 -0
- package/sdk/dist/query/state-project-load.d.ts.map +1 -0
- package/sdk/dist/query/state-project-load.js +75 -0
- package/sdk/dist/query/state-project-load.js.map +1 -0
- package/sdk/dist/query/state.d.ts +78 -0
- package/sdk/dist/query/state.d.ts.map +1 -0
- package/sdk/dist/query/state.js +430 -0
- package/sdk/dist/query/state.js.map +1 -0
- package/sdk/dist/query/summary.d.ts +18 -0
- package/sdk/dist/query/summary.d.ts.map +1 -0
- package/sdk/dist/query/summary.js +249 -0
- package/sdk/dist/query/summary.js.map +1 -0
- package/sdk/dist/query/template.d.ts +46 -0
- package/sdk/dist/query/template.d.ts.map +1 -0
- package/sdk/dist/query/template.js +210 -0
- package/sdk/dist/query/template.js.map +1 -0
- package/sdk/dist/query/uat.d.ts +34 -0
- package/sdk/dist/query/uat.d.ts.map +1 -0
- package/sdk/dist/query/uat.js +339 -0
- package/sdk/dist/query/uat.js.map +1 -0
- package/sdk/dist/query/utils.d.ts +59 -0
- package/sdk/dist/query/utils.d.ts.map +1 -0
- package/sdk/dist/query/utils.js +74 -0
- package/sdk/dist/query/utils.js.map +1 -0
- package/sdk/dist/query/validate.d.ts +67 -0
- package/sdk/dist/query/validate.d.ts.map +1 -0
- package/sdk/dist/query/validate.js +908 -0
- package/sdk/dist/query/validate.js.map +1 -0
- package/sdk/dist/query/verify.d.ts +110 -0
- package/sdk/dist/query/verify.d.ts.map +1 -0
- package/sdk/dist/query/verify.js +631 -0
- package/sdk/dist/query/verify.js.map +1 -0
- package/sdk/dist/query/websearch.d.ts +24 -0
- package/sdk/dist/query/websearch.d.ts.map +1 -0
- package/sdk/dist/query/websearch.js +68 -0
- package/sdk/dist/query/websearch.js.map +1 -0
- package/sdk/dist/query/workspace.d.ts +62 -0
- package/sdk/dist/query/workspace.d.ts.map +1 -0
- package/sdk/dist/query/workspace.js +104 -0
- package/sdk/dist/query/workspace.js.map +1 -0
- package/sdk/dist/query/workstream-inventory.d.ts +52 -0
- package/sdk/dist/query/workstream-inventory.d.ts.map +1 -0
- package/sdk/dist/query/workstream-inventory.js +141 -0
- package/sdk/dist/query/workstream-inventory.js.map +1 -0
- package/sdk/dist/query/workstream.d.ts +35 -0
- package/sdk/dist/query/workstream.d.ts.map +1 -0
- package/sdk/dist/query/workstream.js +298 -0
- package/sdk/dist/query/workstream.js.map +1 -0
- package/sdk/dist/query/worktree.d.ts +3 -0
- package/sdk/dist/query/worktree.d.ts.map +1 -0
- package/sdk/dist/query/worktree.js +36 -0
- package/sdk/dist/query/worktree.js.map +1 -0
- package/sdk/dist/query-command-executor.d.ts +22 -0
- package/sdk/dist/query-command-executor.d.ts.map +1 -0
- package/sdk/dist/query-command-executor.js +22 -0
- package/sdk/dist/query-command-executor.js.map +1 -0
- package/sdk/dist/query-execution-policy.d.ts +24 -0
- package/sdk/dist/query-execution-policy.d.ts.map +1 -0
- package/sdk/dist/query-execution-policy.js +27 -0
- package/sdk/dist/query-execution-policy.js.map +1 -0
- package/sdk/dist/query-failure-classification.d.ts +9 -0
- package/sdk/dist/query-failure-classification.d.ts.map +1 -0
- package/sdk/dist/query-failure-classification.js +32 -0
- package/sdk/dist/query-failure-classification.js.map +1 -0
- package/sdk/dist/query-hotpath-methods.d.ts +19 -0
- package/sdk/dist/query-hotpath-methods.d.ts.map +1 -0
- package/sdk/dist/query-hotpath-methods.js +34 -0
- package/sdk/dist/query-hotpath-methods.js.map +1 -0
- package/sdk/dist/query-native-direct-adapter.d.ts +20 -0
- package/sdk/dist/query-native-direct-adapter.d.ts.map +1 -0
- package/sdk/dist/query-native-direct-adapter.js +52 -0
- package/sdk/dist/query-native-direct-adapter.js.map +1 -0
- package/sdk/dist/query-native-hotpath-adapter.d.ts +15 -0
- package/sdk/dist/query-native-hotpath-adapter.d.ts.map +1 -0
- package/sdk/dist/query-native-hotpath-adapter.js +32 -0
- package/sdk/dist/query-native-hotpath-adapter.js.map +1 -0
- package/sdk/dist/query-raw-output-projection.d.ts +6 -0
- package/sdk/dist/query-raw-output-projection.d.ts.map +1 -0
- package/sdk/dist/query-raw-output-projection.js +67 -0
- package/sdk/dist/query-raw-output-projection.js.map +1 -0
- package/sdk/dist/query-runtime-bridge.d.ts +61 -0
- package/sdk/dist/query-runtime-bridge.d.ts.map +1 -0
- package/sdk/dist/query-runtime-bridge.js +144 -0
- package/sdk/dist/query-runtime-bridge.js.map +1 -0
- package/sdk/dist/query-sdd-tools-path.d.ts +2 -0
- package/sdk/dist/query-sdd-tools-path.d.ts.map +1 -0
- package/sdk/dist/query-sdd-tools-path.js +2 -0
- package/sdk/dist/query-sdd-tools-path.js.map +1 -0
- package/sdk/dist/query-sdd-tools-runtime.d.ts +20 -0
- package/sdk/dist/query-sdd-tools-runtime.d.ts.map +1 -0
- package/sdk/dist/query-sdd-tools-runtime.js +47 -0
- package/sdk/dist/query-sdd-tools-runtime.js.map +1 -0
- package/sdk/dist/query-subprocess-adapter.d.ts +18 -0
- package/sdk/dist/query-subprocess-adapter.d.ts.map +1 -0
- package/sdk/dist/query-subprocess-adapter.js +92 -0
- package/sdk/dist/query-subprocess-adapter.js.map +1 -0
- package/sdk/dist/query-tools-error-factory.d.ts +16 -0
- package/sdk/dist/query-tools-error-factory.d.ts.map +1 -0
- package/sdk/dist/query-tools-error-factory.js +33 -0
- package/sdk/dist/query-tools-error-factory.js.map +1 -0
- package/sdk/dist/research-gate.d.ts +24 -0
- package/sdk/dist/research-gate.d.ts.map +1 -0
- package/sdk/dist/research-gate.js +70 -0
- package/sdk/dist/research-gate.js.map +1 -0
- package/sdk/dist/runtime-gate.d.ts +14 -0
- package/sdk/dist/runtime-gate.d.ts.map +1 -0
- package/sdk/dist/runtime-gate.js +48 -0
- package/sdk/dist/runtime-gate.js.map +1 -0
- package/sdk/dist/sdd-tools-error.d.ts +23 -0
- package/sdk/dist/sdd-tools-error.d.ts.map +1 -0
- package/sdk/dist/sdd-tools-error.js +29 -0
- package/sdk/dist/sdd-tools-error.js.map +1 -0
- package/sdk/dist/sdd-tools.d.ts +97 -0
- package/sdk/dist/sdd-tools.d.ts.map +1 -0
- package/sdk/dist/sdd-tools.js +168 -0
- package/sdk/dist/sdd-tools.js.map +1 -0
- package/sdk/dist/sdd-transport-policy.d.ts +10 -0
- package/sdk/dist/sdd-transport-policy.d.ts.map +1 -0
- package/sdk/dist/sdd-transport-policy.js +32 -0
- package/sdk/dist/sdd-transport-policy.js.map +1 -0
- package/sdk/dist/sdd-transport.d.ts +39 -0
- package/sdk/dist/sdd-transport.d.ts.map +1 -0
- package/sdk/dist/sdd-transport.js +78 -0
- package/sdk/dist/sdd-transport.js.map +1 -0
- package/sdk/dist/sdk-package-compatibility.d.ts +38 -0
- package/sdk/dist/sdk-package-compatibility.d.ts.map +1 -0
- package/sdk/dist/sdk-package-compatibility.js +90 -0
- package/sdk/dist/sdk-package-compatibility.js.map +1 -0
- package/sdk/dist/session-runner.d.ts +40 -0
- package/sdk/dist/session-runner.d.ts.map +1 -0
- package/sdk/dist/session-runner.js +274 -0
- package/sdk/dist/session-runner.js.map +1 -0
- package/sdk/dist/tool-scoping.d.ts +31 -0
- package/sdk/dist/tool-scoping.d.ts.map +1 -0
- package/sdk/dist/tool-scoping.js +54 -0
- package/sdk/dist/tool-scoping.js.map +1 -0
- package/sdk/dist/types.d.ts +794 -0
- package/sdk/dist/types.d.ts.map +1 -0
- package/sdk/dist/types.js +77 -0
- package/sdk/dist/types.js.map +1 -0
- package/sdk/dist/workstream-name-policy.d.ts +13 -0
- package/sdk/dist/workstream-name-policy.d.ts.map +1 -0
- package/sdk/dist/workstream-name-policy.js +24 -0
- package/sdk/dist/workstream-name-policy.js.map +1 -0
- package/sdk/dist/workstream-utils.d.ts +15 -0
- package/sdk/dist/workstream-utils.d.ts.map +1 -0
- package/sdk/dist/workstream-utils.js +21 -0
- package/sdk/dist/workstream-utils.js.map +1 -0
- package/sdk/dist/ws-transport.d.ts +32 -0
- package/sdk/dist/ws-transport.d.ts.map +1 -0
- package/sdk/dist/ws-transport.js +84 -0
- package/sdk/dist/ws-transport.js.map +1 -0
- package/sdk/package-lock.json +2502 -0
- package/sdk/package.json +57 -0
- package/sdk/prompts/templates/project.md +186 -0
- package/sdk/prompts/templates/requirements.md +231 -0
- package/sdk/prompts/templates/research-project/ARCHITECTURE.md +204 -0
- package/sdk/prompts/templates/research-project/FEATURES.md +147 -0
- package/sdk/prompts/templates/research-project/PITFALLS.md +200 -0
- package/sdk/prompts/templates/research-project/STACK.md +120 -0
- package/sdk/prompts/templates/research-project/SUMMARY.md +170 -0
- package/sdk/prompts/templates/roadmap.md +202 -0
- package/sdk/prompts/templates/state.md +175 -0
- package/sdk/shared/model-catalog.json +122 -0
- package/sdk/src/assembled-prompts.test.ts +349 -0
- package/sdk/src/bug-3591-sddtools-runtime-workstream.test.ts +179 -0
- package/sdk/src/cli-transport.test.ts +388 -0
- package/sdk/src/cli-transport.ts +130 -0
- package/sdk/src/cli.test.ts +426 -0
- package/sdk/src/cli.ts +589 -0
- package/sdk/src/config.test.ts +271 -0
- package/sdk/src/config.ts +218 -0
- package/sdk/src/context-engine.test.ts +295 -0
- package/sdk/src/context-engine.ts +170 -0
- package/sdk/src/context-truncation.test.ts +163 -0
- package/sdk/src/context-truncation.ts +233 -0
- package/sdk/src/e2e.integration.test.ts +181 -0
- package/sdk/src/errors.ts +72 -0
- package/sdk/src/event-stream.test.ts +661 -0
- package/sdk/src/event-stream.ts +441 -0
- package/sdk/src/golden/capture.ts +95 -0
- package/sdk/src/golden/fixtures/generate-slug.golden.json +1 -0
- package/sdk/src/golden/fixtures/profile-sample-sessions/demo-project/sample.jsonl +3 -0
- package/sdk/src/golden/fixtures/summary-extract-sample.md +26 -0
- package/sdk/src/golden/fixtures/uat-render-checkpoint-sample.md +15 -0
- package/sdk/src/golden/golden-integration-covered.ts +30 -0
- package/sdk/src/golden/golden-mutation-covered.ts +17 -0
- package/sdk/src/golden/golden-policy.test.ts +8 -0
- package/sdk/src/golden/golden-policy.ts +120 -0
- package/sdk/src/golden/golden.integration.test.ts +677 -0
- package/sdk/src/golden/init-golden-normalize.ts +15 -0
- package/sdk/src/golden/read-only-golden-rows.ts +77 -0
- package/sdk/src/golden/read-only-parity.integration.test.ts +133 -0
- package/sdk/src/golden/registry-canonical-commands.ts +31 -0
- package/sdk/src/index.ts +352 -0
- package/sdk/src/init-e2e.integration.test.ts +138 -0
- package/sdk/src/init-runner.test.ts +740 -0
- package/sdk/src/init-runner.ts +734 -0
- package/sdk/src/lifecycle-e2e.integration.test.ts +258 -0
- package/sdk/src/logger.test.ts +149 -0
- package/sdk/src/logger.ts +113 -0
- package/sdk/src/milestone-runner.test.ts +421 -0
- package/sdk/src/model-catalog.ts +70 -0
- package/sdk/src/phase-prompt.test.ts +535 -0
- package/sdk/src/phase-prompt.ts +259 -0
- package/sdk/src/phase-runner-types.test.ts +421 -0
- package/sdk/src/phase-runner.integration.test.ts +377 -0
- package/sdk/src/phase-runner.test.ts +2720 -0
- package/sdk/src/phase-runner.ts +1442 -0
- package/sdk/src/plan-parser.test.ts +579 -0
- package/sdk/src/plan-parser.ts +431 -0
- package/sdk/src/planning-journal.test.ts +70 -0
- package/sdk/src/planning-journal.ts +153 -0
- package/sdk/src/planning-runtime.test.ts +29 -0
- package/sdk/src/planning-runtime.ts +100 -0
- package/sdk/src/prompt-builder.test.ts +318 -0
- package/sdk/src/prompt-builder.ts +218 -0
- package/sdk/src/prompt-sanitizer.test.ts +260 -0
- package/sdk/src/prompt-sanitizer.ts +116 -0
- package/sdk/src/query/QUERY-HANDLERS.md +349 -0
- package/sdk/src/query/active-workstream-store.ts +50 -0
- package/sdk/src/query/agent-failure-classifier.test.ts +157 -0
- package/sdk/src/query/agent-failure-classifier.ts +105 -0
- package/sdk/src/query/audit-open.ts +722 -0
- package/sdk/src/query/check-auto-mode.test.ts +77 -0
- package/sdk/src/query/check-auto-mode.ts +49 -0
- package/sdk/src/query/check-completion.test.ts +113 -0
- package/sdk/src/query/check-completion.ts +182 -0
- package/sdk/src/query/check-decision-coverage.test.ts +519 -0
- package/sdk/src/query/check-decision-coverage.ts +554 -0
- package/sdk/src/query/check-gates.test.ts +103 -0
- package/sdk/src/query/check-gates.ts +112 -0
- package/sdk/src/query/check-ship-ready.test.ts +111 -0
- package/sdk/src/query/check-ship-ready.ts +104 -0
- package/sdk/src/query/check-verification-status.test.ts +143 -0
- package/sdk/src/query/check-verification-status.ts +160 -0
- package/sdk/src/query/command-aliases.generated.ts +156 -0
- package/sdk/src/query/command-catalog.ts +31 -0
- package/sdk/src/query/command-definition.test.ts +47 -0
- package/sdk/src/query/command-definition.ts +70 -0
- package/sdk/src/query/command-family-handlers.ts +117 -0
- package/sdk/src/query/command-manifest.init.ts +24 -0
- package/sdk/src/query/command-manifest.non-family.ts +85 -0
- package/sdk/src/query/command-manifest.phase.ts +16 -0
- package/sdk/src/query/command-manifest.phases.ts +11 -0
- package/sdk/src/query/command-manifest.roadmap.ts +11 -0
- package/sdk/src/query/command-manifest.state.ts +31 -0
- package/sdk/src/query/command-manifest.ts +17 -0
- package/sdk/src/query/command-manifest.types.ts +13 -0
- package/sdk/src/query/command-manifest.validate.ts +11 -0
- package/sdk/src/query/command-manifest.verify.ts +15 -0
- package/sdk/src/query/command-resolution.test.ts +70 -0
- package/sdk/src/query/command-seam-coverage.test.ts +118 -0
- package/sdk/src/query/command-static-catalog-domain.ts +117 -0
- package/sdk/src/query/command-static-catalog-foundation.ts +103 -0
- package/sdk/src/query/command-topology.test.ts +28 -0
- package/sdk/src/query/command-topology.ts +114 -0
- package/sdk/src/query/commands-list.test.ts +36 -0
- package/sdk/src/query/commands-list.ts +19 -0
- package/sdk/src/query/commit.test.ts +485 -0
- package/sdk/src/query/commit.ts +383 -0
- package/sdk/src/query/config-gates.test.ts +89 -0
- package/sdk/src/query/config-gates.ts +69 -0
- package/sdk/src/query/config-mutation.test.ts +598 -0
- package/sdk/src/query/config-mutation.ts +575 -0
- package/sdk/src/query/config-query.test.ts +367 -0
- package/sdk/src/query/config-query.ts +244 -0
- package/sdk/src/query/config-schema.ts +159 -0
- package/sdk/src/query/decisions.test.ts +215 -0
- package/sdk/src/query/decisions.ts +192 -0
- package/sdk/src/query/decomposed-handlers.test.ts +431 -0
- package/sdk/src/query/detect-custom-files.test.ts +115 -0
- package/sdk/src/query/detect-custom-files.ts +96 -0
- package/sdk/src/query/detect-phase-type.test.ts +105 -0
- package/sdk/src/query/detect-phase-type.ts +141 -0
- package/sdk/src/query/docs-init.ts +258 -0
- package/sdk/src/query/fallow-audit.ts +88 -0
- package/sdk/src/query/frontmatter-array.test.ts +14 -0
- package/sdk/src/query/frontmatter-mutation.test.ts +259 -0
- package/sdk/src/query/frontmatter-mutation.ts +343 -0
- package/sdk/src/query/frontmatter.test.ts +326 -0
- package/sdk/src/query/frontmatter.ts +395 -0
- package/sdk/src/query/helpers.test.ts +615 -0
- package/sdk/src/query/helpers.ts +646 -0
- package/sdk/src/query/index-thin-seam.test.ts +16 -0
- package/sdk/src/query/index.ts +9 -0
- package/sdk/src/query/init-complex.test.ts +616 -0
- package/sdk/src/query/init-complex.ts +799 -0
- package/sdk/src/query/init-progress-precedence.test.ts +177 -0
- package/sdk/src/query/init-workstream-milestone-op.test.ts +321 -0
- package/sdk/src/query/init.test.ts +792 -0
- package/sdk/src/query/init.ts +1262 -0
- package/sdk/src/query/intel.test.ts +90 -0
- package/sdk/src/query/intel.ts +404 -0
- package/sdk/src/query/mutation-event-decorator.test.ts +45 -0
- package/sdk/src/query/mutation-event-decorator.ts +37 -0
- package/sdk/src/query/mutation-event-mapper.test.ts +33 -0
- package/sdk/src/query/mutation-event-mapper.ts +102 -0
- package/sdk/src/query/mvp.test.ts +335 -0
- package/sdk/src/query/mvp.ts +292 -0
- package/sdk/src/query/normalize-query-command.test.ts +102 -0
- package/sdk/src/query/phase-filesystem-adapter.ts +35 -0
- package/sdk/src/query/phase-lifecycle-policy.ts +171 -0
- package/sdk/src/query/phase-lifecycle.test.ts +1750 -0
- package/sdk/src/query/phase-lifecycle.ts +1833 -0
- package/sdk/src/query/phase-list-queries.test.ts +88 -0
- package/sdk/src/query/phase-list-queries.ts +152 -0
- package/sdk/src/query/phase-ready.test.ts +65 -0
- package/sdk/src/query/phase-ready.ts +159 -0
- package/sdk/src/query/phase-roadmap-mutation.ts +77 -0
- package/sdk/src/query/phase.test.ts +651 -0
- package/sdk/src/query/phase.ts +550 -0
- package/sdk/src/query/pipeline.test.ts +169 -0
- package/sdk/src/query/pipeline.ts +243 -0
- package/sdk/src/query/plan-scan.test.ts +35 -0
- package/sdk/src/query/plan-scan.ts +82 -0
- package/sdk/src/query/plan-task-structure.test.ts +65 -0
- package/sdk/src/query/plan-task-structure.ts +63 -0
- package/sdk/src/query/policy-convergence.test.ts +28 -0
- package/sdk/src/query/profile-extract-messages.ts +247 -0
- package/sdk/src/query/profile-output.ts +929 -0
- package/sdk/src/query/profile-questionnaire-data.ts +181 -0
- package/sdk/src/query/profile-sample.ts +184 -0
- package/sdk/src/query/profile-scan-sessions.ts +174 -0
- package/sdk/src/query/profile.test.ts +136 -0
- package/sdk/src/query/profile.ts +337 -0
- package/sdk/src/query/progress.test.ts +156 -0
- package/sdk/src/query/progress.ts +566 -0
- package/sdk/src/query/query-cli-adapter.test.ts +79 -0
- package/sdk/src/query/query-cli-adapter.ts +39 -0
- package/sdk/src/query/query-cli-output.test.ts +33 -0
- package/sdk/src/query/query-cli-output.ts +35 -0
- package/sdk/src/query/query-command-diagnosis.test.ts +22 -0
- package/sdk/src/query/query-command-diagnosis.ts +5 -0
- package/sdk/src/query/query-command-resolution-strategy.test.ts +34 -0
- package/sdk/src/query/query-command-resolution-strategy.ts +121 -0
- package/sdk/src/query/query-command-semantics.test.ts +22 -0
- package/sdk/src/query/query-command-semantics.ts +22 -0
- package/sdk/src/query/query-dispatch-contract.ts +30 -0
- package/sdk/src/query/query-dispatch-error-mapper.test.ts +62 -0
- package/sdk/src/query/query-dispatch-error-mapper.ts +5 -0
- package/sdk/src/query/query-dispatch-formatting.test.ts +28 -0
- package/sdk/src/query/query-dispatch-formatting.ts +5 -0
- package/sdk/src/query/query-dispatch-input-validation.test.ts +23 -0
- package/sdk/src/query/query-dispatch-input-validation.ts +5 -0
- package/sdk/src/query/query-dispatch-observability.test.ts +10 -0
- package/sdk/src/query/query-dispatch-observability.ts +6 -0
- package/sdk/src/query/query-dispatch-plan.test.ts +25 -0
- package/sdk/src/query/query-dispatch-plan.ts +5 -0
- package/sdk/src/query/query-dispatch-result-builder.test.ts +16 -0
- package/sdk/src/query/query-dispatch-result-builder.ts +5 -0
- package/sdk/src/query/query-dispatch.test.ts +399 -0
- package/sdk/src/query/query-dispatch.ts +243 -0
- package/sdk/src/query/query-error-details-schema.ts +29 -0
- package/sdk/src/query/query-error-taxonomy.test.ts +39 -0
- package/sdk/src/query/query-error-taxonomy.ts +117 -0
- package/sdk/src/query/query-fallback-bridge-adapter.test.ts +32 -0
- package/sdk/src/query/query-fallback-bridge-adapter.ts +54 -0
- package/sdk/src/query/query-fallback-executor.test.ts +82 -0
- package/sdk/src/query/query-fallback-executor.ts +44 -0
- package/sdk/src/query/query-fallback-output-classifier.test.ts +36 -0
- package/sdk/src/query/query-fallback-output-classifier.ts +31 -0
- package/sdk/src/query/query-fallback-policy.test.ts +13 -0
- package/sdk/src/query/query-fallback-policy.ts +11 -0
- package/sdk/src/query/query-native-dispatch-adapter.ts +16 -0
- package/sdk/src/query/query-policy-capability.test.ts +10 -0
- package/sdk/src/query/query-policy-capability.ts +26 -0
- package/sdk/src/query/query-policy-snapshot.test.ts +9 -0
- package/sdk/src/query/query-registry-capability.test.ts +14 -0
- package/sdk/src/query/query-runtime-context.ts +44 -0
- package/sdk/src/query/query-unknown-command-hints.test.ts +9 -0
- package/sdk/src/query/query-unknown-command-hints.ts +5 -0
- package/sdk/src/query/registry-assembly-descriptor.ts +87 -0
- package/sdk/src/query/registry-assembly-invariants.ts +127 -0
- package/sdk/src/query/registry-assembly.test.ts +138 -0
- package/sdk/src/query/registry-assembly.ts +78 -0
- package/sdk/src/query/registry.test.ts +208 -0
- package/sdk/src/query/registry.ts +142 -0
- package/sdk/src/query/requirements-extract-from-plans.test.ts +58 -0
- package/sdk/src/query/requirements-extract-from-plans.ts +86 -0
- package/sdk/src/query/roadmap-update-plan-progress.test.ts +233 -0
- package/sdk/src/query/roadmap-update-plan-progress.ts +159 -0
- package/sdk/src/query/roadmap.test.ts +1181 -0
- package/sdk/src/query/roadmap.ts +894 -0
- package/sdk/src/query/route-next-action.test.ts +61 -0
- package/sdk/src/query/route-next-action.ts +345 -0
- package/sdk/src/query/schema-detect.ts +189 -0
- package/sdk/src/query/secrets.test.ts +66 -0
- package/sdk/src/query/secrets.ts +43 -0
- package/sdk/src/query/skill-manifest.test.ts +62 -0
- package/sdk/src/query/skill-manifest.ts +216 -0
- package/sdk/src/query/skills.test.ts +234 -0
- package/sdk/src/query/skills.ts +143 -0
- package/sdk/src/query/state-document.test.ts +197 -0
- package/sdk/src/query/state-document.ts +129 -0
- package/sdk/src/query/state-mutation.test.ts +1198 -0
- package/sdk/src/query/state-mutation.ts +1718 -0
- package/sdk/src/query/state-project-load.ts +80 -0
- package/sdk/src/query/state.test.ts +616 -0
- package/sdk/src/query/state.ts +463 -0
- package/sdk/src/query/sub-repos-root.integration.test.ts +79 -0
- package/sdk/src/query/summary.test.ts +95 -0
- package/sdk/src/query/summary.ts +296 -0
- package/sdk/src/query/template.test.ts +180 -0
- package/sdk/src/query/template.ts +242 -0
- package/sdk/src/query/uat.test.ts +77 -0
- package/sdk/src/query/uat.ts +365 -0
- package/sdk/src/query/utils.test.ts +82 -0
- package/sdk/src/query/utils.ts +106 -0
- package/sdk/src/query/validate.test.ts +831 -0
- package/sdk/src/query/validate.ts +952 -0
- package/sdk/src/query/verify.test.ts +414 -0
- package/sdk/src/query/verify.ts +692 -0
- package/sdk/src/query/websearch.test.ts +31 -0
- package/sdk/src/query/websearch.ts +82 -0
- package/sdk/src/query/workspace.test.ts +120 -0
- package/sdk/src/query/workspace.ts +145 -0
- package/sdk/src/query/workstream-inventory.ts +195 -0
- package/sdk/src/query/workstream.test.ts +153 -0
- package/sdk/src/query/workstream.ts +324 -0
- package/sdk/src/query/worktree.ts +39 -0
- package/sdk/src/query-command-executor.ts +31 -0
- package/sdk/src/query-execution-policy.test.ts +52 -0
- package/sdk/src/query-execution-policy.ts +46 -0
- package/sdk/src/query-failure-classification.test.ts +23 -0
- package/sdk/src/query-failure-classification.ts +42 -0
- package/sdk/src/query-hotpath-methods.ts +48 -0
- package/sdk/src/query-native-direct-adapter.test.ts +35 -0
- package/sdk/src/query-native-direct-adapter.ts +70 -0
- package/sdk/src/query-native-hotpath-adapter.test.ts +43 -0
- package/sdk/src/query-native-hotpath-adapter.ts +45 -0
- package/sdk/src/query-raw-output-projection.test.ts +39 -0
- package/sdk/src/query-raw-output-projection.ts +74 -0
- package/sdk/src/query-runtime-bridge.test.ts +150 -0
- package/sdk/src/query-runtime-bridge.ts +215 -0
- package/sdk/src/query-runtime-seam-coverage.test.ts +20 -0
- package/sdk/src/query-sdd-tools-path.ts +1 -0
- package/sdk/src/query-sdd-tools-runtime.ts +89 -0
- package/sdk/src/query-subprocess-adapter.test.ts +84 -0
- package/sdk/src/query-subprocess-adapter.ts +146 -0
- package/sdk/src/query-tools-error-factory.test.ts +35 -0
- package/sdk/src/query-tools-error-factory.ts +76 -0
- package/sdk/src/research-gate.test.ts +190 -0
- package/sdk/src/research-gate.ts +94 -0
- package/sdk/src/runtime-bridge-options.test.ts +33 -0
- package/sdk/src/runtime-gate.test.ts +84 -0
- package/sdk/src/runtime-gate.ts +52 -0
- package/sdk/src/sdd-tools-error.test.ts +21 -0
- package/sdk/src/sdd-tools-error.ts +65 -0
- package/sdk/src/sdd-tools.test.ts +472 -0
- package/sdk/src/sdd-tools.ts +237 -0
- package/sdk/src/sdd-transport-policy.test.ts +34 -0
- package/sdk/src/sdd-transport-policy.ts +48 -0
- package/sdk/src/sdd-transport.test.ts +292 -0
- package/sdk/src/sdd-transport.ts +117 -0
- package/sdk/src/sdk-package-compatibility.test.ts +97 -0
- package/sdk/src/sdk-package-compatibility.ts +141 -0
- package/sdk/src/session-runner.test.ts +164 -0
- package/sdk/src/session-runner.ts +327 -0
- package/sdk/src/tool-scoping.test.ts +160 -0
- package/sdk/src/tool-scoping.ts +61 -0
- package/sdk/src/types.ts +927 -0
- package/sdk/src/workflow-agent-skills-consistency.test.ts +98 -0
- package/sdk/src/workstream-name-policy.ts +24 -0
- package/sdk/src/workstream-utils.ts +21 -0
- package/sdk/src/ws-flag.test.ts +285 -0
- package/sdk/src/ws-transport.test.ts +161 -0
- package/sdk/src/ws-transport.ts +93 -0
- package/sdk/tsconfig.json +20 -0
- package/commands/sdd/add-backlog.md +0 -76
- package/commands/sdd/add-phase.md +0 -43
- package/commands/sdd/add-todo.md +0 -47
- package/commands/sdd/analyze-dependencies.md +0 -34
- package/commands/sdd/check-todos.md +0 -45
- package/commands/sdd/code-review-fix.md +0 -52
- package/commands/sdd/do.md +0 -30
- package/commands/sdd/from-sdd2.md +0 -45
- package/commands/sdd/insert-phase.md +0 -32
- package/commands/sdd/intel.md +0 -179
- package/commands/sdd/join-discord.md +0 -19
- package/commands/sdd/list-phase-assumptions.md +0 -46
- package/commands/sdd/list-workspaces.md +0 -19
- package/commands/sdd/new-workspace.md +0 -44
- package/commands/sdd/next.md +0 -26
- package/commands/sdd/note.md +0 -34
- package/commands/sdd/plan-milestone-gaps.md +0 -34
- package/commands/sdd/plant-seed.md +0 -28
- package/commands/sdd/remove-phase.md +0 -31
- package/commands/sdd/remove-workspace.md +0 -26
- package/commands/sdd/research-phase.md +0 -195
- package/commands/sdd/scan.md +0 -26
- package/commands/sdd/session-report.md +0 -19
- package/commands/sdd/set-profile.md +0 -12
- package/scripts/sync-upstream.sh +0 -56
- package/sdd/workflows/research-phase.md +0 -82
|
@@ -8,13 +8,13 @@ Orchestrator coordinates, not executes. Each subagent loads the full execute-pla
|
|
|
8
8
|
|
|
9
9
|
<runtime_compatibility>
|
|
10
10
|
**Subagent spawning is runtime-specific:**
|
|
11
|
-
- **Claude Code:** Uses `
|
|
11
|
+
- **Claude Code:** Uses `Agent(subagent_type="sdd-executor", ...)` — blocks until complete, returns result
|
|
12
12
|
- **Copilot:** Subagent spawning does not reliably return completion signals. **Default to
|
|
13
13
|
sequential inline execution**: read and follow execute-plan.md directly for each plan
|
|
14
14
|
instead of spawning parallel agents. Only attempt parallel spawning if the user
|
|
15
15
|
explicitly requests it — and in that case, rely on the spot-check fallback in step 3
|
|
16
16
|
to detect completion.
|
|
17
|
-
- **Other runtimes:** If `
|
|
17
|
+
- **Other runtimes:** If `Agent`/`agent` tool is unavailable, use sequential inline execution as the
|
|
18
18
|
fallback. Check for tool availability at runtime rather than assuming based on runtime name.
|
|
19
19
|
|
|
20
20
|
**Fallback rule:** If a spawned agent completes its work (commits visible, SUMMARY.md exists) but
|
|
@@ -25,7 +25,6 @@ via filesystem and git state.
|
|
|
25
25
|
|
|
26
26
|
<required_reading>
|
|
27
27
|
Read STATE.md before any operation to load project context.
|
|
28
|
-
|
|
29
28
|
@~/.claude/sdd/references/agent-contracts.md
|
|
30
29
|
@~/.claude/sdd/references/context-budget.md
|
|
31
30
|
@~/.claude/sdd/references/gates.md
|
|
@@ -57,6 +56,8 @@ Parse `$ARGUMENTS` before loading any context:
|
|
|
57
56
|
- First positional token → `PHASE_ARG`
|
|
58
57
|
- Optional `--wave N` → `WAVE_FILTER`
|
|
59
58
|
- Optional `--gaps-only` keeps its current meaning
|
|
59
|
+
- Optional `--cross-ai` → `CROSS_AI_FORCE=true` (force all plans through cross-AI execution)
|
|
60
|
+
- Optional `--no-cross-ai` → `CROSS_AI_DISABLED=true` (disable cross-AI for this run, overrides config and frontmatter)
|
|
60
61
|
|
|
61
62
|
If `--wave` is absent, preserve the current behavior of executing all incomplete waves in the phase.
|
|
62
63
|
</step>
|
|
@@ -65,27 +66,52 @@ If `--wave` is absent, preserve the current behavior of executing all incomplete
|
|
|
65
66
|
Load all context in one call:
|
|
66
67
|
|
|
67
68
|
```bash
|
|
68
|
-
INIT=$(
|
|
69
|
+
INIT=$(sdd-sdk query init.execute-phase "${PHASE_ARG}")
|
|
69
70
|
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
70
|
-
AGENT_SKILLS=$(
|
|
71
|
+
AGENT_SKILLS=$(sdd-sdk query agent-skills sdd-executor)
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`, `response_language`.
|
|
74
75
|
|
|
76
|
+
**Model resolution:** If `executor_model` is `"inherit"`, omit the `model=` parameter from all `Agent()` calls — do NOT pass `model="inherit"` to Agent. Omitting the `model=` parameter causes Claude Code to inherit the current orchestrator model automatically. Only set `model=` when `executor_model` is an explicit model name (e.g., `"claude-sonnet-4-6"`, `"claude-opus-4-7"`).
|
|
77
|
+
|
|
75
78
|
**If `response_language` is set:** Include `response_language: {value}` in all spawned subagent prompts so any user-facing output stays in the configured language.
|
|
76
79
|
|
|
77
|
-
Read worktree config:
|
|
80
|
+
Read runtime/worktree config and fail closed before any executor dispatch:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
RUNTIME=$(sdd-sdk query config-get runtime --default claude 2>/dev/null || echo "claude")
|
|
84
|
+
USE_WORKTREES=$(sdd-sdk query config-get workflow.use_worktrees 2>/dev/null || echo "true")
|
|
85
|
+
EXECUTOR_STALL_INTERVAL_MINUTES=$(sdd-sdk query config-get executor.stall_detect_interval_minutes 2>/dev/null || echo "5")
|
|
86
|
+
EXECUTOR_STALL_THRESHOLD_MINUTES=$(sdd-sdk query config-get executor.stall_threshold_minutes 2>/dev/null || echo "10")
|
|
87
|
+
|
|
88
|
+
if [ "$RUNTIME" = "codex" ] && [ "$USE_WORKTREES" != "false" ]; then
|
|
89
|
+
echo "FATAL: Codex execute-phase worktree isolation is unsupported. Set workflow.use_worktrees=false or use a runtime with Agent isolation=\"worktree\" support." >&2
|
|
90
|
+
exit 1
|
|
91
|
+
fi
|
|
92
|
+
```
|
|
93
|
+
Codex maps subagents to `spawn_agent`, which has no direct Codex mapping for Claude Code's `isolation="worktree"` parameter. Failing closed prevents main-checkout edits while the workflow believes agents are isolated.
|
|
94
|
+
|
|
95
|
+
If the project uses git submodules, worktree isolation is unsafe **only when a plan touches a submodule path** — the executor commit protocol cannot correctly handle submodule commits inside isolated worktrees. The previous behavior unconditionally disabled worktree isolation whenever `.gitmodules` existed, which penalised every plan in a submodule project even when the plan was nowhere near a submodule. Compute submodule paths once and intersect them per-plan with the plan's declared `files_modified` frontmatter.
|
|
78
96
|
|
|
79
97
|
```bash
|
|
80
|
-
|
|
98
|
+
# Parse submodule paths from .gitmodules once (empty if no .gitmodules).
|
|
99
|
+
# SUBMODULE_PATHS is a newline-separated list of repo-relative paths.
|
|
100
|
+
if [ -f .gitmodules ]; then
|
|
101
|
+
SUBMODULE_PATHS=$(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null | awk '{print $2}')
|
|
102
|
+
else
|
|
103
|
+
SUBMODULE_PATHS=""
|
|
104
|
+
fi
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
|
|
107
|
+
`SUBMODULE_PATHS` is exported to the `execute_waves` step, where the per-plan decision actually happens (see "Per-plan worktree decision" sub-step inside `execute_waves`). The decision is per-plan because different plans in the same wave can touch different files — only plans whose paths intersect a submodule must drop worktree isolation; plans nowhere near a submodule keep parallel isolation.
|
|
108
|
+
|
|
109
|
+
When `USE_WORKTREES` (project-level) is `false`, all executor agents run without `isolation="worktree"` — they execute sequentially on the main working tree instead of in parallel worktrees. The per-plan decision below has no effect when worktrees are project-disabled.
|
|
84
110
|
|
|
85
111
|
Read context window size for adaptive prompt enrichment:
|
|
86
112
|
|
|
87
113
|
```bash
|
|
88
|
-
CONTEXT_WINDOW=$(
|
|
114
|
+
CONTEXT_WINDOW=$(sdd-sdk query config-get context_window 2>/dev/null || echo "200000")
|
|
89
115
|
```
|
|
90
116
|
|
|
91
117
|
When `CONTEXT_WINDOW >= 500000` (1M-class models), subagent prompts include richer context:
|
|
@@ -93,6 +119,12 @@ When `CONTEXT_WINDOW >= 500000` (1M-class models), subagent prompts include rich
|
|
|
93
119
|
- Verifier agents receive all PLAN.md, SUMMARY.md, CONTEXT.md files plus REQUIREMENTS.md
|
|
94
120
|
- This enables cross-phase awareness and history-aware verification
|
|
95
121
|
|
|
122
|
+
When `CONTEXT_WINDOW < 200000` (sub-200K models), subagent prompts are thinned to reduce static overhead:
|
|
123
|
+
- Executor agents omit extended deviation rule examples and checkpoint examples from inline prompt — load on-demand via @~/.claude/sdd/references/executor-examples.md
|
|
124
|
+
- Planner agents omit extended anti-pattern lists and specificity examples from inline prompt — load on-demand via @~/.claude/sdd/references/planner-antipatterns.md
|
|
125
|
+
- Core rules and decision logic remain inline; only verbose examples and edge-case lists are extracted
|
|
126
|
+
- This reduces executor static overhead by ~40% while preserving behavioral correctness
|
|
127
|
+
|
|
96
128
|
**If `phase_found` is false:** Error — phase directory not found.
|
|
97
129
|
**If `plan_count` is 0:** Error — no plans found in phase.
|
|
98
130
|
**If `state_exists` is false but `.planning/` exists:** Offer reconstruct or continue.
|
|
@@ -101,7 +133,7 @@ When `parallelization` is false, plans within a wave execute sequentially.
|
|
|
101
133
|
|
|
102
134
|
**Runtime detection for Copilot:**
|
|
103
135
|
Check if the current runtime is Copilot by testing for the `@sdd-executor` agent pattern
|
|
104
|
-
or absence of the `
|
|
136
|
+
or absence of the `Agent()` subagent API. If running under Copilot, force sequential inline
|
|
105
137
|
execution regardless of the `parallelization` setting — Copilot's subagent completion
|
|
106
138
|
signals are unreliable (see `<runtime_compatibility>`). Set `COPILOT_SEQUENTIAL=true`
|
|
107
139
|
internally and skip the `execute_waves` step in favor of `check_interactive_mode`'s
|
|
@@ -111,9 +143,49 @@ inline path for each plan.
|
|
|
111
143
|
```bash
|
|
112
144
|
# REQUIRED: prevents stale auto-chain from previous --auto runs
|
|
113
145
|
if [[ ! "$ARGUMENTS" =~ --auto ]]; then
|
|
114
|
-
|
|
146
|
+
sdd-sdk query config-set workflow._auto_chain_active false || true
|
|
115
147
|
fi
|
|
116
148
|
```
|
|
149
|
+
|
|
150
|
+
Resolve `MVP_MODE` once via the centralized `phase.mvp-mode` query verb (precedence chain: CLI flag → ROADMAP `**Mode:** mvp` → `workflow.mvp_mode` config → false):
|
|
151
|
+
```bash
|
|
152
|
+
MVP_FLAG_ARG=""
|
|
153
|
+
if [[ "$ARGUMENTS" =~ (^|[[:space:]])--mvp([[:space:]]|$) ]]; then MVP_FLAG_ARG="--cli-flag"; fi
|
|
154
|
+
MVP_MODE=$(sdd-sdk query phase.mvp-mode "${PHASE_NUMBER}" $MVP_FLAG_ARG --pick active)
|
|
155
|
+
TDD_MODE=$(sdd-sdk query config-get workflow.tdd_mode 2>/dev/null || echo "false")
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
<step name="safe_resume_gate">
|
|
159
|
+
Before trusting `STATE.md` or dispatching any executor, derive `CURRENT_PLAN_ID`
|
|
160
|
+
from the active incomplete plan in `INIT`, then search recent history:
|
|
161
|
+
```bash
|
|
162
|
+
CURRENT_PLAN_ID="{phase_number}-{plan_padded}"
|
|
163
|
+
SUMMARY_PATH="{phase_dir}/{plan_padded}-SUMMARY.md"
|
|
164
|
+
PLAN_COMMITS=$(git log --oneline --grep="${CURRENT_PLAN_ID}" -30)
|
|
165
|
+
```
|
|
166
|
+
If production commits exist and `SUMMARY.md is missing`, stop before spawning a
|
|
167
|
+
new executor; continuing risks duplicate work and stale `STATE.md`/ROADMAP progress.
|
|
168
|
+
Offer these recovery options:
|
|
169
|
+
- `close out manually` — inspect commits, write SUMMARY.md, then update STATE/ROADMAP.
|
|
170
|
+
- `re-execute from scratch` — revert or supersede partial commits before dispatch.
|
|
171
|
+
- `mark-and-skip` — record the anomaly and move on only with explicit confirmation.
|
|
172
|
+
</step>
|
|
173
|
+
|
|
174
|
+
**MVP+TDD gate.** Task-scoped enforcement runs inside plan execution (immediately before each implementation step), where `TASK_FILE`, `PLAN_ID`, and `TASK_ID` are defined. Keep the same predicate and RED-commit contract:
|
|
175
|
+
```bash
|
|
176
|
+
if [ "$MVP_MODE" = "true" ] && [ "$TDD_MODE" = "true" ]; then
|
|
177
|
+
IS_BEHAVIOR_ADDING=$(sdd-sdk query task.is-behavior-adding "$TASK_FILE" --pick is_behavior_adding)
|
|
178
|
+
if [ "$IS_BEHAVIOR_ADDING" = "true" ]; then
|
|
179
|
+
RED_COMMIT=$(git log --oneline --grep="^test(${PHASE_NUMBER}-${PLAN_ID}):" -- "**/*.test.*" "**/*.spec.*" "tests/" | head -1)
|
|
180
|
+
if [ -z "$RED_COMMIT" ]; then
|
|
181
|
+
sdd-sdk query state.update last_gate_trip "${PLAN_ID}/${TASK_ID}" || true
|
|
182
|
+
echo "MVP+TDD GATE TRIPPED: missing RED commit for ${PLAN_ID}/${TASK_ID}"
|
|
183
|
+
exit 1
|
|
184
|
+
fi
|
|
185
|
+
fi
|
|
186
|
+
fi
|
|
187
|
+
```
|
|
188
|
+
Pure doc-only / config-only / test-only tasks return `is_behavior_adding=false` and are exempt. See `execute-mvp-tdd.md` for the halt report format.
|
|
117
189
|
</step>
|
|
118
190
|
|
|
119
191
|
<step name="check_blocking_antipatterns" priority="first">
|
|
@@ -193,9 +265,33 @@ Check `branching_strategy` from init:
|
|
|
193
265
|
|
|
194
266
|
**"none":** Skip, continue on current branch.
|
|
195
267
|
|
|
196
|
-
**"phase" or "milestone":** Use pre-computed `branch_name` from init
|
|
268
|
+
**"phase" or "milestone":** Use pre-computed `branch_name` from init.
|
|
269
|
+
|
|
270
|
+
Fork the new phase branch off `origin/HEAD` (the project's default branch), not the current HEAD — otherwise consecutive phases compound and stay unpushed (#2916). If `$BRANCH_NAME` already exists locally, reuse it as-is.
|
|
271
|
+
|
|
197
272
|
```bash
|
|
198
|
-
git
|
|
273
|
+
DEFAULT_BRANCH=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')
|
|
274
|
+
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
|
|
275
|
+
|
|
276
|
+
if git show-ref --verify --quiet "refs/heads/$BRANCH_NAME"; then
|
|
277
|
+
git switch "$BRANCH_NAME" || { echo "ERROR: Could not switch to existing branch '$BRANCH_NAME'." >&2; exit 1; }
|
|
278
|
+
else
|
|
279
|
+
if ! git fetch --quiet origin "$DEFAULT_BRANCH"; then # #2916
|
|
280
|
+
git show-ref --verify --quiet "refs/remotes/origin/$DEFAULT_BRANCH" \
|
|
281
|
+
|| { echo "ERROR: fetch origin/$DEFAULT_BRANCH failed and no local copy exists. Refusing to create '$BRANCH_NAME' off current HEAD (#2916)." >&2; exit 1; }
|
|
282
|
+
echo "WARNING: fetch origin/$DEFAULT_BRANCH failed; using local copy as base." >&2
|
|
283
|
+
fi
|
|
284
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
285
|
+
echo "WARNING: Uncommitted changes will be carried onto '$BRANCH_NAME' (branched off origin/$DEFAULT_BRANCH, not previous HEAD)."
|
|
286
|
+
else
|
|
287
|
+
git switch --quiet "$DEFAULT_BRANCH" 2>/dev/null && git merge --ff-only --quiet "origin/$DEFAULT_BRANCH" 2>/dev/null || true
|
|
288
|
+
fi
|
|
289
|
+
# Pinned base + fail-fast: on success HEAD is exactly at origin/$DEFAULT_BRANCH,
|
|
290
|
+
# so a post-creation merge-base or "ahead-of" guard would be unreachable. The
|
|
291
|
+
# explicit base argument here is the single source of correctness for #2916.
|
|
292
|
+
git checkout -b "$BRANCH_NAME" "origin/$DEFAULT_BRANCH" \
|
|
293
|
+
|| { echo "ERROR: Could not create '$BRANCH_NAME' from origin/$DEFAULT_BRANCH (#2916)." >&2; exit 1; }
|
|
294
|
+
fi
|
|
199
295
|
```
|
|
200
296
|
|
|
201
297
|
All subsequent commits go to this branch. User handles merging.
|
|
@@ -208,7 +304,7 @@ Report: "Found {plan_count} plans in {phase_dir} ({incomplete_count} incomplete)
|
|
|
208
304
|
|
|
209
305
|
**Update STATE.md for phase start:**
|
|
210
306
|
```bash
|
|
211
|
-
|
|
307
|
+
sdd-sdk query state.begin-phase --phase "${PHASE_NUMBER}" --name "${PHASE_NAME}" --plans "${PLAN_COUNT}"
|
|
212
308
|
```
|
|
213
309
|
This updates Status, Last Activity, Current focus, Current Position, and plan counts in STATE.md so frontmatter and body text reflect the active phase immediately.
|
|
214
310
|
</step>
|
|
@@ -217,7 +313,7 @@ This updates Status, Last Activity, Current focus, Current Position, and plan co
|
|
|
217
313
|
Load plan inventory with wave grouping in one call:
|
|
218
314
|
|
|
219
315
|
```bash
|
|
220
|
-
PLAN_INDEX=$(
|
|
316
|
+
PLAN_INDEX=$(sdd-sdk query phase-plan-index "${PHASE_NUMBER}")
|
|
221
317
|
```
|
|
222
318
|
|
|
223
319
|
Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
|
|
@@ -243,9 +339,100 @@ Report:
|
|
|
243
339
|
```
|
|
244
340
|
</step>
|
|
245
341
|
|
|
342
|
+
<step name="cross_ai_delegation">
|
|
343
|
+
**Optional step 2.5 — Delegate plans to an external AI runtime.**
|
|
344
|
+
|
|
345
|
+
This step runs after plan discovery and before normal wave execution. It identifies plans
|
|
346
|
+
that should be delegated to an external AI command and executes them via stdin-based prompt
|
|
347
|
+
delivery. Plans handled here are removed from the execute_waves plan list so the normal
|
|
348
|
+
executor skips them.
|
|
349
|
+
|
|
350
|
+
**Activation logic:**
|
|
351
|
+
|
|
352
|
+
1. If `CROSS_AI_DISABLED` is true (`--no-cross-ai` flag): skip this step entirely.
|
|
353
|
+
2. If `CROSS_AI_FORCE` is true (`--cross-ai` flag): mark ALL incomplete plans for cross-AI execution.
|
|
354
|
+
3. Otherwise: check each plan's frontmatter for `cross_ai: true` AND verify config
|
|
355
|
+
`workflow.cross_ai_execution` is `true`. Plans matching both conditions are marked for cross-AI.
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
CROSS_AI_ENABLED=$(sdd-sdk query config-get workflow.cross_ai_execution 2>/dev/null || echo "false")
|
|
359
|
+
CROSS_AI_CMD=$(sdd-sdk query config-get workflow.cross_ai_command 2>/dev/null || echo "")
|
|
360
|
+
CROSS_AI_TIMEOUT=$(sdd-sdk query config-get workflow.cross_ai_timeout 2>/dev/null || echo "300")
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**If no plans are marked for cross-AI:** Skip to execute_waves.
|
|
364
|
+
|
|
365
|
+
**If plans are marked but `cross_ai_command` is empty:** Error — tell user to set
|
|
366
|
+
`workflow.cross_ai_command` via `sdd-sdk query config-set workflow.cross_ai_command "<command>"`.
|
|
367
|
+
|
|
368
|
+
**For each cross-AI plan (sequentially):**
|
|
369
|
+
|
|
370
|
+
1. **Construct the task prompt** from the plan file:
|
|
371
|
+
- Extract `<objective>` and `<tasks>` sections from the PLAN.md
|
|
372
|
+
- Append PROJECT.md context (project name, description, tech stack)
|
|
373
|
+
- Format as a self-contained execution prompt
|
|
374
|
+
|
|
375
|
+
2. **Check for dirty working tree before execution:**
|
|
376
|
+
```bash
|
|
377
|
+
if ! git diff --quiet HEAD 2>/dev/null; then
|
|
378
|
+
echo "WARNING: dirty working tree detected — the external AI command may produce uncommitted changes that conflict with existing modifications"
|
|
379
|
+
fi
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
3. **Run the external command** from the project root, writing the prompt to stdin.
|
|
383
|
+
Never shell-interpolate the prompt — always pipe via stdin to prevent injection:
|
|
384
|
+
```bash
|
|
385
|
+
echo "$TASK_PROMPT" | timeout "${CROSS_AI_TIMEOUT}s" ${CROSS_AI_CMD} > "$CANDIDATE_SUMMARY" 2>"$ERROR_LOG"
|
|
386
|
+
EXIT_CODE=$?
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
4. **Evaluate the result:**
|
|
390
|
+
|
|
391
|
+
**Success (exit 0 + valid summary):**
|
|
392
|
+
- Read `$CANDIDATE_SUMMARY` and validate it contains meaningful content
|
|
393
|
+
(not empty, has at least a heading and description — a valid SUMMARY.md structure)
|
|
394
|
+
- Write it as the plan's SUMMARY.md file
|
|
395
|
+
- Update STATE.md plan status to complete
|
|
396
|
+
- Update ROADMAP.md progress
|
|
397
|
+
- Mark plan as handled — skip it in execute_waves
|
|
398
|
+
|
|
399
|
+
**Failure (non-zero exit or invalid summary):**
|
|
400
|
+
- Display the error output and exit code
|
|
401
|
+
- Warn: "The external command may have left uncommitted changes or partial edits
|
|
402
|
+
in the working tree. Review `git status` and `git diff` before proceeding."
|
|
403
|
+
- Offer three choices:
|
|
404
|
+
- **retry** — run the same plan through cross-AI again
|
|
405
|
+
- **skip** — fall back to normal executor for this plan (re-add to execute_waves list)
|
|
406
|
+
- **abort** — stop execution entirely, preserve state for resume
|
|
407
|
+
|
|
408
|
+
5. **After all cross-AI plans processed:** Remove successfully handled plans from the
|
|
409
|
+
incomplete plan list so execute_waves skips them. Any skipped-to-fallback plans remain
|
|
410
|
+
in the list for normal executor processing.
|
|
411
|
+
</step>
|
|
412
|
+
|
|
246
413
|
<step name="execute_waves">
|
|
247
414
|
Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
|
|
248
415
|
|
|
416
|
+
**Stream-idle-timeout prevention — checkpoint heartbeats (#2410):**
|
|
417
|
+
|
|
418
|
+
Multi-plan phases can accumulate enough subagent context that the Claude API
|
|
419
|
+
SSE layer terminates with `Stream idle timeout - partial response received`
|
|
420
|
+
between a large tool_result and the next assistant turn (seen on Claude Code
|
|
421
|
+
+ Opus 4.7 at ~200K+ cache_read). To keep the stream warm, emit short
|
|
422
|
+
assistant-text heartbeats — **no tool call, just a literal line** — at every
|
|
423
|
+
wave and plan boundary. Each heartbeat MUST start with `[checkpoint]` so
|
|
424
|
+
tooling and `/sdd:manager`'s background-completion handler can grep partial
|
|
425
|
+
transcripts. `{P}/{Q}` is the phase-wide completed/total plans counter and
|
|
426
|
+
increases monotonically across waves. `{status}` is `complete` (success),
|
|
427
|
+
`failed` (executor error), or `checkpoint` (human-gate returned).
|
|
428
|
+
|
|
429
|
+
```
|
|
430
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} starting, {wave_plan_count} plan(s), {P}/{Q} plans done
|
|
431
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} starting ({P}/{Q} plans done)
|
|
432
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} {status} ({P}/{Q} plans done)
|
|
433
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} complete, {P}/{Q} plans done ({wave_success}/{wave_plan_count} ok)
|
|
434
|
+
```
|
|
435
|
+
|
|
249
436
|
**For each wave:**
|
|
250
437
|
|
|
251
438
|
1. **Intra-wave files_modified overlap check (BEFORE spawning):**
|
|
@@ -284,7 +471,15 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
284
471
|
|
|
285
472
|
2. **Describe what's being built (BEFORE spawning):**
|
|
286
473
|
|
|
287
|
-
|
|
474
|
+
**First, emit the wave-start checkpoint heartbeat as a literal assistant-text
|
|
475
|
+
line — no tool call (#2410). Do NOT skip this even for single-plan waves; it
|
|
476
|
+
is required before any further reasoning or spawning:**
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} starting, {wave_plan_count} plan(s), {P}/{Q} plans done
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
Then read each plan's `<objective>`. Extract what's being built and why.
|
|
288
483
|
|
|
289
484
|
```
|
|
290
485
|
---
|
|
@@ -300,40 +495,55 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
300
495
|
- Bad: "Executing terrain generation plan"
|
|
301
496
|
- Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
|
|
302
497
|
|
|
498
|
+
2.5. **Per-plan worktree decision (run for each plan in this wave BEFORE its dispatch):**
|
|
499
|
+
|
|
500
|
+
Read and execute `sdd/workflows/execute-phase/steps/per-plan-worktree-gate.md` for each plan. It extracts `PLAN_FILES` from the plan's JSON, intersects against `SUBMODULE_PATHS` (with normalization, bidirectional matching, and glob-prefix handling), and sets `USE_WORKTREES_FOR_PLAN` to `false` when the plan touches a submodule path. Append `plan_id` to a `WAVE_WORKTREE_PLANS` accumulator when `USE_WORKTREES_FOR_PLAN != false`.
|
|
501
|
+
|
|
502
|
+
The dispatch branches in step 3 below MUST gate on `USE_WORKTREES_FOR_PLAN` for the current plan, not on the project-level `USE_WORKTREES`.
|
|
503
|
+
|
|
303
504
|
3. **Spawn executor agents:**
|
|
304
505
|
|
|
506
|
+
**Emit a plan-start heartbeat (literal line, no tool call) immediately before
|
|
507
|
+
each `Agent()` dispatch (#2410):**
|
|
508
|
+
|
|
509
|
+
`[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} starting ({P}/{Q} plans done)`
|
|
510
|
+
|
|
305
511
|
Pass paths only — executors read files themselves with their fresh context window.
|
|
306
512
|
For 200k models, this keeps orchestrator context lean (~10-15%).
|
|
307
513
|
For 1M+ models (Opus 4.6, Sonnet 4.6), richer context can be passed directly.
|
|
308
514
|
|
|
309
|
-
**Worktree mode** (`
|
|
515
|
+
**Worktree mode** (`USE_WORKTREES_FOR_PLAN` is not `false` — evaluated per-plan in step 2.5):
|
|
310
516
|
|
|
311
517
|
Before spawning, capture the current HEAD:
|
|
312
518
|
```bash
|
|
313
519
|
EXPECTED_BASE=$(git rev-parse HEAD)
|
|
520
|
+
DISPATCH_TS=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
521
|
+
EXPECTED_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
522
|
+
if [ "${USE_WORKTREES_FOR_PLAN:-true}" != "false" ] && [ -z "${WAVE_WORKTREE_MANIFEST:-}" ]; then
|
|
523
|
+
WAVE_WORKTREE_MANIFEST=$(mktemp "${TMPDIR:-/tmp}/sdd-worktree-wave-XXXXXX.json")
|
|
524
|
+
printf '{"worktrees":[]}\n' > "$WAVE_WORKTREE_MANIFEST"
|
|
525
|
+
export WAVE_WORKTREE_MANIFEST
|
|
526
|
+
fi
|
|
314
527
|
```
|
|
315
528
|
|
|
316
529
|
**Sequential dispatch for parallel execution (waves with 2+ agents):**
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
calls race for this lock and fail. Sequential dispatch ensures each worktree finishes
|
|
321
|
-
creation before the next begins (the round-trip latency of each tool call provides
|
|
322
|
-
natural spacing), while all agents still **run in parallel** once created.
|
|
530
|
+
Dispatch each `Agent()` call **one at a time with `run_in_background: true`**. Do NOT
|
|
531
|
+
send all Agent calls in a single message: simultaneous `git worktree add` calls race
|
|
532
|
+
on `.git/config.lock`. Agents still run in parallel once their worktrees are created.
|
|
323
533
|
|
|
324
|
-
```
|
|
325
|
-
# CORRECT:
|
|
326
|
-
#
|
|
327
|
-
#
|
|
328
|
-
# WRONG: multiple Task() calls in a single message
|
|
329
|
-
# → simultaneous git worktree add → .git/config.lock contention → failures
|
|
534
|
+
```text
|
|
535
|
+
# CORRECT: one Agent() per message with run_in_background: true
|
|
536
|
+
# WRONG: multiple Agent() calls in one message -> .git/config.lock contention
|
|
330
537
|
```
|
|
331
538
|
|
|
332
|
-
```
|
|
333
|
-
|
|
539
|
+
```text
|
|
540
|
+
Agent(
|
|
334
541
|
subagent_type="sdd-executor",
|
|
335
542
|
description="Execute plan {plan_number} of phase {phase_number}",
|
|
336
|
-
model=
|
|
543
|
+
# Only include model= when executor_model is an explicit model name.
|
|
544
|
+
# When executor_model is "inherit", omit this parameter entirely so
|
|
545
|
+
# Claude Code inherits the orchestrator model automatically.
|
|
546
|
+
model="{executor_model}", # omit this line when executor_model == "inherit"
|
|
337
547
|
isolation="worktree",
|
|
338
548
|
prompt="
|
|
339
549
|
<objective>
|
|
@@ -343,40 +553,37 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
343
553
|
</objective>
|
|
344
554
|
|
|
345
555
|
<worktree_branch_check>
|
|
346
|
-
FIRST ACTION
|
|
347
|
-
|
|
348
|
-
|
|
556
|
+
FIRST ACTION: HEAD assertion MUST run before any reset/checkout. Worktrees
|
|
557
|
+
spawned by Claude Code's `isolation="worktree"` use the `worktree-agent-<id>`
|
|
558
|
+
namespace. If HEAD is on a protected ref (main/master/develop/trunk/release/*)
|
|
559
|
+
or detached, HALT — do NOT self-recover by force-rewinding via `git update-ref`,
|
|
560
|
+
that destroys concurrent commits in multi-active scenarios (#2924). Only after
|
|
561
|
+
Step 1 passes is `git reset --hard` safe (#2015 — affects all platforms).
|
|
349
562
|
```bash
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
base such as `main` instead of the feature branch HEAD), hard-reset to the correct base:
|
|
355
|
-
```bash
|
|
356
|
-
# Safe: this runs before any agent work, so no uncommitted changes to lose
|
|
357
|
-
git reset --hard {EXPECTED_BASE}
|
|
358
|
-
# Verify correction succeeded
|
|
359
|
-
if [ "$(git rev-parse HEAD)" != "{EXPECTED_BASE}" ]; then
|
|
360
|
-
echo "ERROR: Could not correct worktree base — aborting to prevent data loss"
|
|
563
|
+
HEAD_REF=$(git symbolic-ref --quiet HEAD || echo "DETACHED")
|
|
564
|
+
ACTUAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
565
|
+
if [ "$HEAD_REF" = "DETACHED" ] || echo "$ACTUAL_BRANCH" | grep -Eq '^(main|master|develop|trunk|release/.*)$'; then
|
|
566
|
+
echo "FATAL: worktree HEAD on '$ACTUAL_BRANCH' (expected worktree-agent-*); refusing to self-recover via 'git update-ref' (#2924)." >&2
|
|
361
567
|
exit 1
|
|
362
568
|
fi
|
|
569
|
+
if ! echo "$ACTUAL_BRANCH" | grep -Eq '^worktree-agent-[A-Za-z0-9._/-]+$'; then
|
|
570
|
+
echo "FATAL: worktree HEAD '$ACTUAL_BRANCH' is not in the worktree-agent-* namespace; refusing to commit (#2924)." >&2
|
|
571
|
+
exit 1
|
|
572
|
+
fi
|
|
573
|
+
ACTUAL_BASE=$(git merge-base HEAD {EXPECTED_BASE})
|
|
574
|
+
if [ "$ACTUAL_BASE" != "{EXPECTED_BASE}" ]; then
|
|
575
|
+
git reset --hard {EXPECTED_BASE}
|
|
576
|
+
[ "$(git rev-parse HEAD)" != "{EXPECTED_BASE}" ] && { echo "ERROR: could not correct worktree base"; exit 1; }
|
|
577
|
+
fi
|
|
363
578
|
```
|
|
364
|
-
|
|
365
|
-
`reset --hard` is safe here because this is a fresh worktree with no user changes. It
|
|
366
|
-
resets both the HEAD pointer AND the working tree to the correct base commit (#2015).
|
|
367
|
-
|
|
368
|
-
If `ACTUAL_BASE` == `{EXPECTED_BASE}`: the branch base is correct, proceed immediately.
|
|
369
|
-
|
|
370
|
-
This check fixes a known issue where `EnterWorktree` creates branches from
|
|
371
|
-
`main` instead of the current feature branch HEAD (affects all platforms).
|
|
579
|
+
Per-commit HEAD/cwd-drift/path-guard: `agents/sdd-executor.md` steps 0/0a/0b + `references/worktree-path-safety.md` (in <execution_context>).
|
|
372
580
|
</worktree_branch_check>
|
|
373
581
|
|
|
374
582
|
<parallel_execution>
|
|
375
|
-
You are running as a PARALLEL executor agent in a git worktree.
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
For direct git commits: use git commit --no-verify -m "..."
|
|
583
|
+
You are running as a PARALLEL executor agent in a git worktree. Worktree path safety (cwd-drift, absolute-path guards) is in `worktree-path-safety.md` (loaded below).
|
|
584
|
+
Run `git commit` normally — hooks run by default. Do NOT pass `--no-verify`
|
|
585
|
+
unless the orchestrator surfaces `workflow.worktree_skip_hooks=true` in this
|
|
586
|
+
prompt; silent bypass violates project CLAUDE.md guidance (#2924).
|
|
380
587
|
|
|
381
588
|
IMPORTANT: Do NOT modify STATE.md or ROADMAP.md. execute-plan.md
|
|
382
589
|
auto-detects worktree mode (`.git` is a file, not a directory) and skips
|
|
@@ -388,6 +595,7 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
388
595
|
only (STATE.md and ROADMAP.md are excluded automatically). Do NOT skip or defer
|
|
389
596
|
this commit — the orchestrator force-removes the worktree after you return, and
|
|
390
597
|
any uncommitted SUMMARY.md will be permanently lost (#2070).
|
|
598
|
+
REQUIRED ORDER: Write SUMMARY.md → commit → only then any narration. No text between Write and commit (truncation risk; #2070 rescue is not primary defense).
|
|
391
599
|
</parallel_execution>
|
|
392
600
|
|
|
393
601
|
<execution_context>
|
|
@@ -395,6 +603,8 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
395
603
|
@~/.claude/sdd/templates/summary.md
|
|
396
604
|
@~/.claude/sdd/references/checkpoints.md
|
|
397
605
|
@~/.claude/sdd/references/tdd.md
|
|
606
|
+
@~/.claude/sdd/references/worktree-path-safety.md
|
|
607
|
+
${CONTEXT_WINDOW < 200000 ? '' : '@~/.claude/sdd/references/executor-examples.md'}
|
|
398
608
|
</execution_context>
|
|
399
609
|
|
|
400
610
|
<files_to_read>
|
|
@@ -431,18 +641,23 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
431
641
|
)
|
|
432
642
|
```
|
|
433
643
|
|
|
434
|
-
|
|
644
|
+
Immediately after each worktree `Agent()` spawn returns metadata, atomically append `{agent_id, worktree_path, branch, expected_base}` to `WAVE_WORKTREE_MANIFEST`. If any field is missing, stop and ask for recovery instead of scanning all agent worktrees.
|
|
645
|
+
|
|
646
|
+
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above to spawn executor agent(s), stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
|
647
|
+
|
|
648
|
+
**Sequential mode** (`USE_WORKTREES_FOR_PLAN` is `false` — either project-level `USE_WORKTREES=false`, or per-plan submodule intersection forced it false in step 2.5):
|
|
435
649
|
|
|
436
|
-
Omit `isolation="worktree"` from the
|
|
650
|
+
Omit `isolation="worktree"` from the Agent call. Replace the `<parallel_execution>` block with:
|
|
437
651
|
|
|
438
652
|
```
|
|
439
653
|
<sequential_execution>
|
|
440
654
|
You are running as a SEQUENTIAL executor agent on the main working tree.
|
|
441
655
|
Use normal git commits (with hooks). Do NOT use --no-verify.
|
|
656
|
+
REQUIRED ORDER: Write SUMMARY.md → commit → only then any narration. No text between Write and commit (truncation risk; #2070 rescue is not primary defense).
|
|
442
657
|
</sequential_execution>
|
|
443
658
|
```
|
|
444
659
|
|
|
445
|
-
The sequential mode
|
|
660
|
+
The sequential mode Agent prompt uses the same structure as worktree mode but with these differences in success_criteria — since there is only one agent writing at a time, there are no shared-file conflicts:
|
|
446
661
|
|
|
447
662
|
```
|
|
448
663
|
<success_criteria>
|
|
@@ -454,11 +669,21 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
454
669
|
</success_criteria>
|
|
455
670
|
```
|
|
456
671
|
|
|
457
|
-
When worktrees are disabled, execute
|
|
672
|
+
When worktrees are disabled for a plan (per-plan or project-level), that plan's executor runs on the main working tree. If **any** plan in the current wave dropped to sequential mode, execute the affected plan(s) **one at a time** to avoid concurrent writes to the main working tree — plans in the same wave that retained worktree isolation can still run in parallel alongside the sequential ones, but two non-worktree plans in the same wave must serialize. When the project-level `USE_WORKTREES=false`, all plans in the wave serialize regardless of the `PARALLELIZATION` setting.
|
|
458
673
|
|
|
459
674
|
4. **Wait for all agents in wave to complete.**
|
|
460
675
|
|
|
461
|
-
**
|
|
676
|
+
**Plan-complete heartbeat (#2410):** as each executor returns (or is verified
|
|
677
|
+
via spot-check below), emit one line — `complete` advances `{P}`, `failed`
|
|
678
|
+
and `checkpoint` do not but still warm the stream:
|
|
679
|
+
|
|
680
|
+
```
|
|
681
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} complete ({P}/{Q} plans done)
|
|
682
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} failed ({P}/{Q} plans done)
|
|
683
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} checkpoint ({P}/{Q} plans done)
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
**Completion signal fallback (Copilot and runtimes where Agent() may not return):**
|
|
462
687
|
|
|
463
688
|
If a spawned agent does not return a completion signal but appears to have finished
|
|
464
689
|
its work, do NOT block indefinitely. Instead, verify completion via spot-checks:
|
|
@@ -467,6 +692,7 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
467
692
|
# For each plan in this wave, check if the executor finished:
|
|
468
693
|
SUMMARY_EXISTS=$(test -f "{phase_dir}/{plan_number}-{plan_padded}-SUMMARY.md" && echo "true" || echo "false")
|
|
469
694
|
COMMITS_FOUND=$(git log --oneline --all --grep="{phase_number}-{plan_padded}" --since="1 hour ago" | head -1)
|
|
695
|
+
COMMITS_SINCE_DISPATCH=$(git log "${EXPECTED_BRANCH}" --since="${DISPATCH_TS}" --oneline | head -1)
|
|
470
696
|
```
|
|
471
697
|
|
|
472
698
|
**If SUMMARY.md exists AND commits are found:** The agent completed successfully —
|
|
@@ -477,46 +703,75 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
477
703
|
activity. If commits are still appearing, wait longer. If no activity, report
|
|
478
704
|
the plan as failed and route to the failure handler in step 6.
|
|
479
705
|
|
|
480
|
-
**
|
|
481
|
-
|
|
706
|
+
**Configurable stall surveillance (#3212):** Every `${EXECUTOR_STALL_INTERVAL_MINUTES}`
|
|
707
|
+
minutes while waiting, inspect `git log "${EXPECTED_BRANCH}" --since="${DISPATCH_TS}"`
|
|
708
|
+
for activity. If no completion signal, no SUMMARY.md, and no expected-branch
|
|
709
|
+
commits appear for `${EXECUTOR_STALL_THRESHOLD_MINUTES}` minutes, pause and
|
|
710
|
+
ask for one recovery path: `continue waiting`, `kill and retry`, or
|
|
711
|
+
`kill and switch to inline execution`.
|
|
482
712
|
|
|
483
|
-
|
|
713
|
+
**This fallback applies automatically to all runtimes.** Claude Code's Agent() normally
|
|
714
|
+
returns synchronously, but the fallback ensures resilience if it doesn't.
|
|
484
715
|
|
|
485
|
-
|
|
716
|
+
5. **Post-wave hook validation (parallel mode only):** Hooks run on every executor commit by default (#2924); this post-wave run only fires when `workflow.worktree_skip_hooks=true` opted out of per-commit hooks:
|
|
486
717
|
```bash
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
718
|
+
SKIP_HOOKS=$(sdd-sdk query config-get workflow.worktree_skip_hooks 2>/dev/null || echo "false")
|
|
719
|
+
if [ "$SKIP_HOOKS" = "true" ]; then
|
|
720
|
+
# Stash uncommitted changes under a named ref so we always pop (bare `git stash` strands them on hook/script failure). #3542: `refs/stash` is shared across worktrees, so this helper runs ONLY in the orchestrator's main checkout after all wave worktrees have been merged + removed; executors are forbidden from running any `git stash` subcommand (see `<destructive_git_prohibition>` in `agents/sdd-executor.md`).
|
|
721
|
+
STASHED=false
|
|
722
|
+
if (! git diff --quiet || ! git diff --cached --quiet) && git stash push -u -m "sdd-post-wave-hook-$$" >/dev/null 2>&1; then STASHED=true; fi
|
|
723
|
+
git hook run pre-commit 2>&1 || echo "⚠ Pre-commit hooks failed — review before continuing"
|
|
724
|
+
[ "$STASHED" = "true" ] && (git stash pop >/dev/null 2>&1 || echo "⚠ Could not pop sdd-post-wave-hook stash — recover manually")
|
|
725
|
+
fi
|
|
490
726
|
```
|
|
491
727
|
If hooks fail: report the failure and ask "Fix hook issues now?" or "Continue to next wave?"
|
|
492
728
|
|
|
493
729
|
5.5. **Worktree cleanup (when `isolation="worktree"` was used):**
|
|
494
730
|
|
|
731
|
+
**Standard wave contract:** Each wave's worktrees merge to main via the templated path below before the next wave's worktrees fork. The cleanup loop runs once per wave at the end of the wave lifecycle. Worktrees created in wave N must be fully removed before wave N+1 forks new ones.
|
|
732
|
+
|
|
733
|
+
**Cross-wave dependency deviation (supported execution mode):** When the orchestrator legitimately deviates from the standard wave model — for example, a phase with cross-wave plan dependencies that requires custom inter-worktree base-update merges (e.g., `merge: bring 09-01 + 09-02 into 09-03 base`) — the cleanup loop below is NOT automatically re-entered for those custom merges. The deviation path produces correct final history but bypasses this loop, leaving `worktree-agent-*` directories in place. Use the **cleanup-tail snippet** below to remove any residual worktrees after such a deviation.
|
|
734
|
+
|
|
495
735
|
When executor agents ran in worktree isolation, their commits land on temporary branches in separate working trees. After the wave completes, merge these changes back and clean up:
|
|
496
736
|
|
|
737
|
+
**Manifest source of truth (#3384):** Cleanup consumes the `WAVE_WORKTREE_MANIFEST` created and populated during executor dispatch in step 3. Do not recreate or truncate it here.
|
|
738
|
+
|
|
739
|
+
Prefer the bounded helper, which validates branch identity, expected base, deletion
|
|
740
|
+
diffs, merge result, and worktree removal before deleting the temporary branch.
|
|
741
|
+
If the helper reports a blocked cleanup, resolve the reported manifest entry and
|
|
742
|
+
rerun the same command. Do not fall back to broad worktree discovery.
|
|
743
|
+
|
|
497
744
|
```bash
|
|
498
|
-
|
|
499
|
-
|
|
745
|
+
[ -n "${WAVE_WORKTREE_MANIFEST:-}" ] && [ -f "$WAVE_WORKTREE_MANIFEST" ] || {
|
|
746
|
+
echo "BLOCKED: missing WAVE_WORKTREE_MANIFEST; refusing broad worktree cleanup (#3384)." >&2
|
|
747
|
+
exit 1
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
# Guard: pin cleanup back to the primary worktree and fail on branch drift (#3174).
|
|
751
|
+
PRIMARY_WT=$(git worktree list --porcelain | awk '/^worktree /{print substr($0,10); exit}')
|
|
752
|
+
if [ -z "$PRIMARY_WT" ]; then
|
|
753
|
+
echo "FATAL: could not resolve primary worktree before cleanup" >&2
|
|
754
|
+
exit 1
|
|
755
|
+
fi
|
|
756
|
+
if [ -n "$PRIMARY_WT" ] && [ "$(pwd -P 2>/dev/null)" != "$(cd "$PRIMARY_WT" 2>/dev/null && pwd -P)" ]; then echo "⚠ Orchestrator CWD drifted to $(pwd) — pinning to $PRIMARY_WT before worktree cleanup (#3174)"; cd "$PRIMARY_WT" || { echo "FATAL: cannot cd to primary worktree $PRIMARY_WT" >&2; exit 1; }; fi
|
|
757
|
+
ORCH_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
758
|
+
[ -z "${EXPECTED_BRANCH:-}" ] || [ "$ORCH_BRANCH" = "$EXPECTED_BRANCH" ] || { echo "FATAL: orchestrator on '$ORCH_BRANCH' but expected '$EXPECTED_BRANCH' before worktree cleanup — refusing to merge (#3174-class drift)" >&2; exit 1; }
|
|
500
759
|
|
|
501
|
-
|
|
502
|
-
|
|
760
|
+
if command -v sdd-sdk >/dev/null 2>&1; then
|
|
761
|
+
sdd-sdk query worktree.cleanup-wave --manifest "$WAVE_WORKTREE_MANIFEST" || exit 1
|
|
762
|
+
else
|
|
763
|
+
echo "WARN: sdd-sdk unavailable; using manifest-scoped shell fallback (#3384)." >&2
|
|
764
|
+
WT_PATHS_FILE=$(mktemp "${TMPDIR:-/tmp}/sdd-worktree-paths-XXXXXX")
|
|
765
|
+
node -e 'const fs=require("fs");const p=process.env.WAVE_WORKTREE_MANIFEST;try{if(!p)throw new Error("WAVE_WORKTREE_MANIFEST is unset");if(!fs.existsSync(p))throw new Error("manifest does not exist");const s=fs.readFileSync(p,"utf8");if(!s.trim())throw new Error("manifest is empty");const j=JSON.parse(s);for(const w of j.worktrees||[])if(w.worktree_path)console.log(w.worktree_path)}catch(e){console.error(`ERROR: cannot read worktree manifest ${p||"(unset)"}: ${e.message}`);process.exit(1)}' > "$WT_PATHS_FILE" || { echo "BLOCKED: cannot read WAVE_WORKTREE_MANIFEST; refusing cleanup (#3384)." >&2; exit 1; }
|
|
766
|
+
while IFS= read -r WT; do
|
|
767
|
+
[ -z "$WT" ] && continue
|
|
503
768
|
WT_BRANCH=$(git -C "$WT" rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
504
769
|
if [ -n "$WT_BRANCH" ] && [ "$WT_BRANCH" != "HEAD" ]; then
|
|
505
770
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
506
|
-
|
|
507
|
-
# --- Orchestrator file protection (#1756) ---
|
|
508
|
-
# Snapshot orchestrator-owned files BEFORE merge. If the worktree
|
|
509
|
-
# branch outlived a milestone transition, its versions of STATE.md
|
|
510
|
-
# and ROADMAP.md are stale. Main always wins for these files.
|
|
511
771
|
STATE_BACKUP=$(mktemp)
|
|
512
772
|
ROADMAP_BACKUP=$(mktemp)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
# Snapshot list of files on main BEFORE merge to detect resurrections
|
|
517
|
-
PRE_MERGE_FILES=$(git ls-files .planning/)
|
|
518
|
-
|
|
519
|
-
# Pre-merge deletion check: warn if the worktree branch deletes tracked files
|
|
773
|
+
[ -f .planning/STATE.md ] && cp .planning/STATE.md "$STATE_BACKUP" || true
|
|
774
|
+
[ -f .planning/ROADMAP.md ] && cp .planning/ROADMAP.md "$ROADMAP_BACKUP" || true
|
|
520
775
|
DELETIONS=$(git diff --diff-filter=D --name-only HEAD..."$WT_BRANCH" 2>/dev/null || true)
|
|
521
776
|
if [ -n "$DELETIONS" ]; then
|
|
522
777
|
echo "BLOCKED: Worktree branch $WT_BRANCH contains file deletions: $DELETIONS"
|
|
@@ -524,15 +779,23 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
524
779
|
rm -f "$STATE_BACKUP" "$ROADMAP_BACKUP"
|
|
525
780
|
continue
|
|
526
781
|
fi
|
|
527
|
-
|
|
528
|
-
# Merge the worktree branch into the current branch
|
|
529
|
-
git merge "$WT_BRANCH" --no-edit -m "chore: merge executor worktree ($WT_BRANCH)" 2>&1 || {
|
|
782
|
+
git merge "$WT_BRANCH" --no-ff --no-edit -m "chore: merge executor worktree ($WT_BRANCH)" 2>&1 || {
|
|
530
783
|
echo "⚠ Merge conflict from worktree $WT_BRANCH — resolve manually"
|
|
784
|
+
echo " STATE.md backup: $STATE_BACKUP"
|
|
785
|
+
echo " ROADMAP.md backup: $ROADMAP_BACKUP"
|
|
786
|
+
echo " Restore with: cp \$STATE_BACKUP .planning/STATE.md && cp \$ROADMAP_BACKUP .planning/ROADMAP.md"
|
|
787
|
+
break
|
|
788
|
+
}
|
|
789
|
+
MERGE_DEL_COUNT=$(git diff --diff-filter=D --name-only HEAD~1 HEAD 2>/dev/null | grep -vc '^\.planning/' || true)
|
|
790
|
+
if [ "$MERGE_DEL_COUNT" -gt 5 ] && [ "${ALLOW_BULK_DELETE:-0}" != "1" ]; then
|
|
791
|
+
MERGE_DELETIONS=$(git diff --diff-filter=D --name-only HEAD~1 HEAD 2>/dev/null | grep -v '^\.planning/' || true)
|
|
792
|
+
echo "⚠ BLOCKED: Merge of $WT_BRANCH deleted $MERGE_DEL_COUNT files outside .planning/ — reverting to protect repository integrity (#2384)"
|
|
793
|
+
echo "$MERGE_DELETIONS"
|
|
794
|
+
echo " If these deletions are intentional, re-run with ALLOW_BULK_DELETE=1"
|
|
795
|
+
git reset --hard HEAD~1 2>/dev/null || true
|
|
531
796
|
rm -f "$STATE_BACKUP" "$ROADMAP_BACKUP"
|
|
532
797
|
continue
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
# Restore orchestrator-owned files (main always wins)
|
|
798
|
+
fi
|
|
536
799
|
if [ -s "$STATE_BACKUP" ]; then
|
|
537
800
|
cp "$STATE_BACKUP" .planning/STATE.md
|
|
538
801
|
fi
|
|
@@ -540,101 +803,119 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
540
803
|
cp "$ROADMAP_BACKUP" .planning/ROADMAP.md
|
|
541
804
|
fi
|
|
542
805
|
rm -f "$STATE_BACKUP" "$ROADMAP_BACKUP"
|
|
543
|
-
|
|
544
|
-
# Detect files deleted on main but re-added by worktree merge
|
|
545
|
-
# (e.g., archived phase directories that were intentionally removed)
|
|
806
|
+
# Detect files deleted on main but re-added by worktree merge (#2501).
|
|
546
807
|
DELETED_FILES=$(git diff --diff-filter=A --name-only HEAD~1 -- .planning/ 2>/dev/null || true)
|
|
547
808
|
for RESURRECTED in $DELETED_FILES; do
|
|
548
|
-
|
|
549
|
-
if
|
|
809
|
+
WAS_DELETED=$(git log --follow --diff-filter=D --name-only --format="" HEAD~1 -- "$RESURRECTED" 2>/dev/null | grep -c . || true)
|
|
810
|
+
if [ "${WAS_DELETED:-0}" -gt 0 ]; then
|
|
550
811
|
git rm -f "$RESURRECTED" 2>/dev/null || true
|
|
551
812
|
fi
|
|
552
813
|
done
|
|
553
|
-
|
|
554
|
-
# Amend merge commit with restored files if any changed
|
|
555
814
|
if ! git diff --quiet .planning/STATE.md .planning/ROADMAP.md 2>/dev/null || \
|
|
556
815
|
[ -n "$DELETED_FILES" ]; then
|
|
557
|
-
|
|
558
|
-
COMMIT_DOCS=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get commit_docs 2>/dev/null || echo "true")
|
|
816
|
+
COMMIT_DOCS=$(sdd-sdk query config-get commit_docs 2>/dev/null || echo "true")
|
|
559
817
|
if [ "$COMMIT_DOCS" != "false" ]; then
|
|
560
818
|
git add .planning/STATE.md .planning/ROADMAP.md 2>/dev/null || true
|
|
561
819
|
git commit --amend --no-edit 2>/dev/null || true
|
|
562
820
|
fi
|
|
563
821
|
fi
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
822
|
+
# Safety net: rescue uncommitted SUMMARY.md before worktree removal (#2070, #2838).
|
|
823
|
+
while IFS= read -r SUMMARY; do
|
|
824
|
+
[ -z "$SUMMARY" ] && continue
|
|
825
|
+
REL_PATH="${SUMMARY#$WT/}"
|
|
826
|
+
if [ ! -f "$REL_PATH" ] || ! cmp -s "$SUMMARY" "$REL_PATH"; then
|
|
827
|
+
mkdir -p "$(dirname "$REL_PATH")"
|
|
828
|
+
cp "$SUMMARY" "$REL_PATH"
|
|
829
|
+
echo "⚠ Rescued $REL_PATH from worktree before removal"
|
|
830
|
+
fi
|
|
831
|
+
done < <(find "$WT/.planning" -name "*SUMMARY.md" 2>/dev/null)
|
|
832
|
+
REMOVE_OK=false
|
|
833
|
+
if git worktree remove "$WT" --force; then
|
|
834
|
+
REMOVE_OK=true
|
|
835
|
+
else
|
|
836
|
+
WT_NAME=$(basename "$WT")
|
|
837
|
+
if [ -f ".git/worktrees/${WT_NAME}/locked" ]; then
|
|
838
|
+
echo "⚠ Worktree $WT is locked — attempting to unlock and retry"
|
|
839
|
+
git worktree unlock "$WT" 2>/dev/null || true
|
|
840
|
+
if git worktree remove "$WT" --force; then
|
|
841
|
+
REMOVE_OK=true
|
|
842
|
+
else
|
|
843
|
+
echo "⚠ Residual worktree at $WT — manual cleanup required after session exits:"
|
|
844
|
+
echo " git worktree unlock \"$WT\" && git worktree remove \"$WT\" --force && git branch -D \"$WT_BRANCH\""
|
|
845
|
+
fi
|
|
846
|
+
else
|
|
847
|
+
echo "⚠ Residual worktree at $WT (remove failed) — investigate manually"
|
|
848
|
+
fi
|
|
849
|
+
fi
|
|
850
|
+
if [ "$REMOVE_OK" = "true" ]; then
|
|
851
|
+
git branch -D "$WT_BRANCH" 2>/dev/null || true
|
|
852
|
+
else
|
|
853
|
+
echo "⚠ Keeping branch $WT_BRANCH because worktree removal failed (#3384)"
|
|
574
854
|
fi
|
|
855
|
+
fi
|
|
856
|
+
done < "$WT_PATHS_FILE"
|
|
857
|
+
fi
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
**Cleanup-tail snippet (use after any wave whose merges did not flow through the templated path above):**
|
|
575
861
|
|
|
576
|
-
|
|
577
|
-
git worktree remove "$WT" --force 2>/dev/null || true
|
|
862
|
+
If the orchestrator deviated from the standard wave merge path (e.g., custom inter-worktree base-update merges with `merge: bring …` style messages), run this snippet after the custom merges are complete. It reads only `WAVE_WORKTREE_MANIFEST`; do not discover unrelated `worktree-agent-*` worktrees.
|
|
578
863
|
|
|
579
|
-
|
|
864
|
+
```bash
|
|
865
|
+
# Cleanup-tail: pin orchestrator CWD to primary worktree before cleanup-tail (#3174).
|
|
866
|
+
PRIMARY_WT=$(git worktree list --porcelain | awk '/^worktree /{print substr($0,10); exit}')
|
|
867
|
+
if [ -n "$PRIMARY_WT" ] && [ "$(pwd -P 2>/dev/null)" != "$(cd "$PRIMARY_WT" 2>/dev/null && pwd -P)" ]; then echo "⚠ Orchestrator CWD drifted to $(pwd) — pinning to $PRIMARY_WT before cleanup-tail (#3174)"; cd "$PRIMARY_WT" || { echo "FATAL: cannot cd to primary worktree $PRIMARY_WT" >&2; exit 1; }; fi
|
|
868
|
+
# Cleanup-tail: remove residual agent worktrees after a cross-wave-dependency deviation.
|
|
869
|
+
# Uses only the current wave manifest to avoid touching unrelated active agents (#3384).
|
|
870
|
+
WT_PATHS_FILE=$(mktemp "${TMPDIR:-/tmp}/sdd-worktree-paths-XXXXXX")
|
|
871
|
+
node -e 'const fs=require("fs");const p=process.env.WAVE_WORKTREE_MANIFEST;try{if(!p)throw new Error("WAVE_WORKTREE_MANIFEST is unset");if(!fs.existsSync(p))throw new Error("manifest does not exist");const s=fs.readFileSync(p,"utf8");if(!s.trim())throw new Error("manifest is empty");const j=JSON.parse(s);for(const w of j.worktrees||[])if(w.worktree_path)console.log(w.worktree_path)}catch(e){console.error(`ERROR: cannot read worktree manifest ${p||"(unset)"}: ${e.message}`);process.exit(1)}' > "$WT_PATHS_FILE" || { echo "BLOCKED: cannot read WAVE_WORKTREE_MANIFEST; refusing cleanup (#3384)." >&2; exit 1; }
|
|
872
|
+
while IFS= read -r WT; do
|
|
873
|
+
[ -z "$WT" ] && continue
|
|
874
|
+
WT_BRANCH=$(git -C "$WT" rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
875
|
+
[ -z "$WT_BRANCH" ] || [ "$WT_BRANCH" = "HEAD" ] && continue
|
|
876
|
+
echo "Cleaning up residual worktree: $WT (branch: $WT_BRANCH)"
|
|
877
|
+
git worktree unlock "$WT" 2>/dev/null || true
|
|
878
|
+
if ! git worktree remove "$WT" --force; then
|
|
879
|
+
WT_NAME=$(basename "$WT")
|
|
880
|
+
if [ -f ".git/worktrees/${WT_NAME}/locked" ]; then
|
|
881
|
+
echo "⚠ Worktree $WT is locked — unlock failed; manual cleanup required:"
|
|
882
|
+
echo " git worktree unlock \"$WT\" && git worktree remove \"$WT\" --force && git branch -D \"$WT_BRANCH\""
|
|
883
|
+
else
|
|
884
|
+
echo "⚠ Residual worktree at $WT — remove failed; manual cleanup required"
|
|
885
|
+
fi
|
|
886
|
+
else
|
|
580
887
|
git branch -D "$WT_BRANCH" 2>/dev/null || true
|
|
581
888
|
fi
|
|
582
|
-
done
|
|
889
|
+
done < "$WT_PATHS_FILE"
|
|
890
|
+
git worktree prune
|
|
583
891
|
```
|
|
584
892
|
|
|
585
|
-
**
|
|
893
|
+
**When to skip step 5.5:**
|
|
586
894
|
|
|
587
|
-
**If no
|
|
895
|
+
**If no plan in this wave used worktree isolation** (project-level `USE_WORKTREES=false` OR every plan in the wave had `USE_WORKTREES_FOR_PLAN=false` — i.e. `WAVE_WORKTREE_PLANS` from step 2.5 is empty): all agents ran on the main working tree — skip this step entirely.
|
|
588
896
|
|
|
589
|
-
|
|
897
|
+
**If the orchestrator merged via custom messages (cross-wave-dependency deviation):** the templated cleanup loop above was not triggered for those merges. Run the cleanup-tail snippet above instead. After the snippet completes, proceed to step 5.6.
|
|
590
898
|
|
|
591
|
-
|
|
592
|
-
cross-plan integration issues that individual worktree self-checks cannot detect
|
|
593
|
-
(e.g., conflicting type definitions, removed exports, import changes).
|
|
899
|
+
**If at least one plan used worktrees but others did not:** still run this cleanup — it iterates over actual `git worktree list` output and only merges back the worktrees that were created, leaving sequential plans' commits on the main tree untouched.
|
|
594
900
|
|
|
595
|
-
|
|
596
|
-
harness engineering research: agents reliably report Self-Check: PASSED even when
|
|
597
|
-
merging their work creates failures.
|
|
901
|
+
**If no worktrees found at runtime:** Skip silently — agents may have been spawned without worktree isolation, or the orchestrator already cleaned them up.
|
|
598
902
|
|
|
599
|
-
|
|
600
|
-
# Detect test runner and run quick smoke test (timeout: 5 minutes)
|
|
601
|
-
TEST_EXIT=0
|
|
602
|
-
timeout 300 bash -c '
|
|
603
|
-
if [ -f "package.json" ]; then
|
|
604
|
-
npm test 2>&1
|
|
605
|
-
elif [ -f "Cargo.toml" ]; then
|
|
606
|
-
cargo test 2>&1
|
|
607
|
-
elif [ -f "go.mod" ]; then
|
|
608
|
-
go test ./... 2>&1
|
|
609
|
-
elif [ -f "pyproject.toml" ] || [ -f "requirements.txt" ]; then
|
|
610
|
-
python -m pytest -x -q --tb=short 2>&1 || uv run python -m pytest -x -q --tb=short 2>&1
|
|
611
|
-
else
|
|
612
|
-
echo "⚠ No test runner detected — skipping post-merge test gate"
|
|
613
|
-
exit 0
|
|
614
|
-
fi
|
|
615
|
-
'
|
|
616
|
-
TEST_EXIT=$?
|
|
617
|
-
if [ "${TEST_EXIT}" -eq 0 ]; then
|
|
618
|
-
echo "✓ Post-merge test gate passed — no cross-plan conflicts"
|
|
619
|
-
elif [ "${TEST_EXIT}" -eq 124 ]; then
|
|
620
|
-
echo "⚠ Post-merge test gate timed out after 5 minutes"
|
|
621
|
-
else
|
|
622
|
-
echo "✗ Post-merge test gate failed (exit code ${TEST_EXIT})"
|
|
623
|
-
WAVE_FAILURE_COUNT=$((WAVE_FAILURE_COUNT + 1))
|
|
624
|
-
fi
|
|
625
|
-
```
|
|
903
|
+
5.6. **Post-merge build & test gate:**
|
|
626
904
|
|
|
627
|
-
|
|
905
|
+
After merging all worktrees in a wave (parallel mode), or after the last plan completes
|
|
906
|
+
(serial mode), run a build and then the project's test suite to catch cross-plan
|
|
907
|
+
integration issues that individual worktree self-checks cannot detect (e.g., conflicting
|
|
908
|
+
type definitions, removed exports, import changes, link errors).
|
|
628
909
|
|
|
629
|
-
|
|
910
|
+
This addresses the Generator self-evaluation blind spot identified in Anthropic's
|
|
911
|
+
harness engineering research: agents reliably report Self-Check: PASSED even when
|
|
912
|
+
merging their work creates failures.
|
|
630
913
|
|
|
631
|
-
|
|
632
|
-
cumulative failures across waves. Subsequent waves should report:
|
|
633
|
-
`⚠ Note: ${WAVE_FAILURE_COUNT} prior wave(s) had test failures`
|
|
914
|
+
Read and execute `sdd/workflows/execute-phase/steps/post-merge-gate.md`.
|
|
634
915
|
|
|
635
|
-
5.7. **Post-wave shared artifact update (
|
|
916
|
+
5.7. **Post-wave shared artifact update (when at least one plan used worktrees, skip if tests failed):**
|
|
636
917
|
|
|
637
|
-
When executor
|
|
918
|
+
When **any** executor agent in this wave ran with `isolation="worktree"`, that agent skipped STATE.md and ROADMAP.md updates to avoid last-merge-wins overwrites. The orchestrator is the single writer for these files. After worktrees are merged back, update shared artifacts once for every completed plan in the wave (worktree-mode plans **and** sequential plans that ran on the main tree but deferred to the orchestrator for tracking writes).
|
|
638
919
|
|
|
639
920
|
**Only update tracking when tests passed (TEST_EXIT=0).**
|
|
640
921
|
If tests failed or timed out, skip the tracking update — plans should
|
|
@@ -646,12 +927,12 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
646
927
|
if [ "${TEST_EXIT}" -eq 0 ]; then
|
|
647
928
|
# Update ROADMAP plan progress for each completed plan in this wave
|
|
648
929
|
for plan_id in {completed_plan_ids}; do
|
|
649
|
-
|
|
930
|
+
sdd-sdk query roadmap.update-plan-progress "${PHASE_NUMBER}" "${plan_id}" "complete"
|
|
650
931
|
done
|
|
651
932
|
|
|
652
933
|
# Only commit tracking files if they actually changed
|
|
653
934
|
if ! git diff --quiet .planning/ROADMAP.md .planning/STATE.md 2>/dev/null; then
|
|
654
|
-
|
|
935
|
+
sdd-sdk query commit "docs(phase-${PHASE_NUMBER}): update tracking after wave ${N}" --files .planning/ROADMAP.md .planning/STATE.md
|
|
655
936
|
fi
|
|
656
937
|
elif [ "${TEST_EXIT}" -eq 124 ]; then
|
|
657
938
|
echo "⚠ Skipping tracking update — test suite timed out. Plans remain in-progress. Run tests manually to confirm."
|
|
@@ -662,7 +943,7 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
662
943
|
|
|
663
944
|
Where `WAVE_PLAN_IDS` is the space-separated list of plan IDs that completed in this wave.
|
|
664
945
|
|
|
665
|
-
**If `
|
|
946
|
+
**If no plan in this wave used worktrees** (project-level `USE_WORKTREES=false` OR `WAVE_WORKTREE_PLANS` is empty): sequential agents already updated STATE.md and ROADMAP.md themselves — skip this step.
|
|
666
947
|
|
|
667
948
|
5.8. **Handle test gate failures (when `WAVE_FAILURE_COUNT > 0`):**
|
|
668
949
|
|
|
@@ -695,6 +976,15 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
695
976
|
|
|
696
977
|
6. **Report completion — spot-check claims first:**
|
|
697
978
|
|
|
979
|
+
**Wave-close heartbeat (#2410):** after spot-checks finish (pass or fail),
|
|
980
|
+
before the `## Wave {N} Complete` summary, emit as a literal line:
|
|
981
|
+
|
|
982
|
+
```
|
|
983
|
+
[checkpoint] phase {PHASE_NUMBER} wave {N}/{M} complete, {P}/{Q} plans done ({wave_success}/{wave_plan_count} ok)
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
698
988
|
For each SUMMARY.md:
|
|
699
989
|
- Verify first 2 files from `key-files.created` exist on disk
|
|
700
990
|
- Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
|
|
@@ -715,53 +1005,52 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
|
|
|
715
1005
|
---
|
|
716
1006
|
```
|
|
717
1007
|
|
|
718
|
-
- Bad: "Wave 2 complete. Proceeding to Wave 3."
|
|
719
|
-
- Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
|
|
720
|
-
|
|
721
1008
|
7. **Handle failures:**
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
1009
|
+
**Step 7.0 — classify before branching (#3095):**
|
|
1010
|
+
```bash
|
|
1011
|
+
CLASS_JSON=$(sdd-sdk query agent.classify-failure -- "$AGENT_RETURN_BODY")
|
|
1012
|
+
CLASS=$(echo "$CLASS_JSON" | jq -r '.class')
|
|
1013
|
+
SENTINEL=$(echo "$CLASS_JSON" | jq -r '.sentinel // empty')
|
|
1014
|
+
RETRY_AFTER=$(echo "$CLASS_JSON" | jq -r '.retryAfterSeconds // empty')
|
|
1015
|
+
if [ -n "$RETRY_AFTER" ]; then RETRY_HINT=" Provider hinted retry-after: ${RETRY_AFTER}s"; else RETRY_HINT=""; fi
|
|
1016
|
+
```
|
|
1017
|
+
One classifier branch handles sentinels across Claude/Copilot/Codex/Gemini. Reference: `docs/research/provider-rate-limit-signals.md`.
|
|
1018
|
+
**Step 7.1 — `class == "quota-exceeded"`:**
|
|
1019
|
+
Do not offer "retry now". Run step-5 spot-check first; if SUMMARY.md is missing but commits exist, route to safe-resume (`state.verify-against-disk`) instead of immediate redispatch.
|
|
1020
|
+
```text
|
|
1021
|
+
⚠ Plan {plan_id} terminated by provider quota / rate limit
|
|
1022
|
+
Runtime sentinel: {SENTINEL}
|
|
1023
|
+
{RETRY_HINT}
|
|
1024
|
+
Partial commits on worktree branch: {N}
|
|
1025
|
+
SUMMARY.md present: {yes|no}
|
|
1026
|
+
1. Wait for quota reset, then resume (recommended)
|
|
1027
|
+
2. Switch to a different runtime / model and resume
|
|
1028
|
+
3. Abort phase and report partial state
|
|
1029
|
+
```
|
|
1030
|
+
Re-run `/sdd:execute-phase` after quota reset for Option 1.
|
|
1031
|
+
**Step 7.2 — `class == "classify-handoff-bug"`:**
|
|
1032
|
+
If error contains `classifyHandoffIfNeeded is not defined`, treat as Claude runtime bug. Run the same step-5 spot-checks; PASS => treat as success, FAIL => fall through.
|
|
1033
|
+
**Step 7.3 — `class == "unknown-failure"`:**
|
|
1034
|
+
Report failed plan and ask Continue/Stop; continuing may cascade into dependent plan failures.
|
|
726
1035
|
|
|
727
1036
|
7b. **Pre-wave dependency check (waves 2+ only):**
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
If any key-link from a PRIOR wave's artifact fails verification:
|
|
735
|
-
|
|
736
|
-
## Cross-Plan Wiring Gap
|
|
737
|
-
|
|
738
|
-
| Plan | Link | From | Expected Pattern | Status |
|
|
739
|
-
|------|------|------|-----------------|--------|
|
|
740
|
-
| {plan} | {via} | {from} | {pattern} | NOT FOUND |
|
|
741
|
-
|
|
742
|
-
Wave {N} artifacts may not be properly wired. Options:
|
|
743
|
-
1. Investigate and fix before continuing
|
|
744
|
-
2. Continue (may cause cascading failures in wave {N+1})
|
|
745
|
-
|
|
746
|
-
Key-links referencing files in the CURRENT (upcoming) wave are skipped.
|
|
747
|
-
|
|
1037
|
+
Before wave N+1, run `sdd-sdk query verify.key-links {phase_dir}/{plan}-PLAN.md` for each upcoming plan.
|
|
1038
|
+
If any PRIOR-wave artifact link fails, present:
|
|
1039
|
+
- `## Cross-Plan Wiring Gap` with plan/link/from/pattern rows
|
|
1040
|
+
- Options: investigate+fix before continue, or continue with cascade risk
|
|
1041
|
+
Skip key-links that reference files in the CURRENT (upcoming) wave.
|
|
748
1042
|
8. **Execute checkpoint plans between waves** — see `<checkpoint_handling>`.
|
|
749
|
-
|
|
750
1043
|
9. **Proceed to next wave.**
|
|
751
1044
|
</step>
|
|
752
|
-
|
|
753
1045
|
<step name="checkpoint_handling">
|
|
754
1046
|
Plans with `autonomous: false` require user interaction.
|
|
755
|
-
|
|
756
1047
|
**Auto-mode checkpoint handling:**
|
|
757
|
-
|
|
758
|
-
Read auto-advance config (chain flag + user preference):
|
|
1048
|
+
Read auto-advance config (chain flag OR user preference — same boolean as `check.auto-mode`):
|
|
759
1049
|
```bash
|
|
760
|
-
|
|
761
|
-
AUTO_CFG=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
|
|
1050
|
+
AUTO_MODE=$(sdd-sdk query check auto-mode --pick active 2>/dev/null || echo "false")
|
|
762
1051
|
```
|
|
763
1052
|
|
|
764
|
-
When executor returns a checkpoint AND
|
|
1053
|
+
When executor returns a checkpoint AND `AUTO_MODE` is `true`:
|
|
765
1054
|
- **human-verify** → Auto-spawn continuation agent with `{user_response}` = `"approved"`. Log `⚡ Auto-approved checkpoint`.
|
|
766
1055
|
- **decision** → Auto-spawn continuation agent with `{user_response}` = first option from checkpoint details. Log `⚡ Auto-selected: [option]`.
|
|
767
1056
|
- **human-action** → Present to user (existing behavior below). Auth gates cannot be automated.
|
|
@@ -819,7 +1108,7 @@ After all waves:
|
|
|
819
1108
|
|
|
820
1109
|
**Security gate check:**
|
|
821
1110
|
```bash
|
|
822
|
-
SECURITY_CFG=$(
|
|
1111
|
+
SECURITY_CFG=$(sdd-sdk query config-get workflow.security_enforcement --raw 2>/dev/null || echo "true")
|
|
823
1112
|
SECURITY_FILE=$(ls "${PHASE_DIR}"/*-SECURITY.md 2>/dev/null | head -1)
|
|
824
1113
|
```
|
|
825
1114
|
|
|
@@ -829,21 +1118,74 @@ If `SECURITY_CFG` is `true` AND `SECURITY_FILE` is empty (no SECURITY.md yet):
|
|
|
829
1118
|
Include in the next-steps routing output:
|
|
830
1119
|
```
|
|
831
1120
|
⚠ Security enforcement enabled — run before advancing:
|
|
832
|
-
/sdd
|
|
1121
|
+
/sdd:secure-phase {PHASE} ${SDD_WS}
|
|
833
1122
|
```
|
|
834
1123
|
|
|
835
1124
|
If `SECURITY_CFG` is `true` AND SECURITY.md exists: check frontmatter `threats_open`. If > 0:
|
|
836
1125
|
```
|
|
837
1126
|
⚠ Security gate: {threats_open} threats open
|
|
838
|
-
/sdd
|
|
1127
|
+
/sdd:secure-phase {PHASE} — resolve before advancing
|
|
1128
|
+
```
|
|
1129
|
+
</step>
|
|
1130
|
+
|
|
1131
|
+
<step name="tdd_review_checkpoint">
|
|
1132
|
+
**Optional step — TDD collaborative review.**
|
|
1133
|
+
|
|
1134
|
+
```bash
|
|
1135
|
+
TDD_MODE=$(sdd-sdk query config-get workflow.tdd_mode 2>/dev/null || echo "false")
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
**Skip if `TDD_MODE` is `false`.**
|
|
1139
|
+
|
|
1140
|
+
When `TDD_MODE` is `true`, check whether any completed plans in this phase have `type: tdd` in their frontmatter:
|
|
1141
|
+
|
|
1142
|
+
```bash
|
|
1143
|
+
TDD_PLANS=$(grep -rl "^type: tdd" "${PHASE_DIR}"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ')
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
**If `TDD_PLANS` > 0:** Insert end-of-phase collaborative review checkpoint.
|
|
1147
|
+
|
|
1148
|
+
1. Collect all SUMMARY.md files for TDD plans
|
|
1149
|
+
2. For each TDD plan summary, verify the RED/GREEN/REFACTOR gate sequence:
|
|
1150
|
+
- RED gate: A failing test commit exists (`test(...)` commit with MUST-fail evidence)
|
|
1151
|
+
- GREEN gate: An implementation commit exists (`feat(...)` commit making tests pass)
|
|
1152
|
+
- REFACTOR gate: Optional cleanup commit (`refactor(...)` commit, tests still pass)
|
|
1153
|
+
3. If any TDD plan is missing the RED or GREEN gate commits, flag it:
|
|
1154
|
+
```
|
|
1155
|
+
⚠ TDD gate violation: Plan {plan_id} missing {RED|GREEN} phase commit.
|
|
1156
|
+
Expected commit pattern: test({phase}-{plan}): ... → feat({phase}-{plan}): ...
|
|
1157
|
+
```
|
|
1158
|
+
4. Present collaborative review summary:
|
|
1159
|
+
```
|
|
1160
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1161
|
+
TDD REVIEW — Phase {X}
|
|
1162
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1163
|
+
|
|
1164
|
+
TDD Plans: {TDD_PLANS} | Gate violations: {count}
|
|
1165
|
+
|
|
1166
|
+
| Plan | RED | GREEN | REFACTOR | Status |
|
|
1167
|
+
|------|-----|-------|----------|--------|
|
|
1168
|
+
| {id} | ✓ | ✓ | ✓ | Pass |
|
|
1169
|
+
| {id} | ✓ | ✗ | — | FAIL |
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
**Escalation under MVP+TDD.** When `MVP_MODE=true` AND `TDD_MODE=true`, the review verdict escalates from advisory to **blocking**: missing RED or GREEN gate commits prevent marking the phase complete.
|
|
1173
|
+
```text
|
|
1174
|
+
Phase blocked: {N} TDD plan(s) violate the RED→GREEN gate sequence under MVP+TDD.
|
|
1175
|
+
Resolve and re-run /sdd execute-phase, or override with
|
|
1176
|
+
/sdd execute-phase {phase} --force-mvp-gate to ship anyway.
|
|
839
1177
|
```
|
|
1178
|
+
`--force-mvp-gate` is the escape hatch (documented, not yet implemented). Policy is:
|
|
1179
|
+
- `MVP_MODE=true` AND `TDD_MODE=true`: violations are **blocking** unless explicitly overridden.
|
|
1180
|
+
- otherwise: violations are advisory/non-blocking and are surfaced for review.
|
|
1181
|
+
The verifier agent (step `verify_phase_goal`) still checks TDD discipline in both cases.
|
|
840
1182
|
</step>
|
|
841
1183
|
|
|
842
1184
|
<step name="handle_partial_wave_execution">
|
|
843
1185
|
If `WAVE_FILTER` was used, re-run plan discovery after execution:
|
|
844
1186
|
|
|
845
1187
|
```bash
|
|
846
|
-
POST_PLAN_INDEX=$(
|
|
1188
|
+
POST_PLAN_INDEX=$(sdd-sdk query phase-plan-index "${PHASE_NUMBER}")
|
|
847
1189
|
```
|
|
848
1190
|
|
|
849
1191
|
Apply the same "incomplete" filtering rules as earlier:
|
|
@@ -861,8 +1203,8 @@ Apply the same "incomplete" filtering rules as earlier:
|
|
|
861
1203
|
|
|
862
1204
|
Selected wave finished successfully. This phase still has incomplete plans, so phase-level verification and completion were intentionally skipped.
|
|
863
1205
|
|
|
864
|
-
/sdd
|
|
865
|
-
/sdd
|
|
1206
|
+
/sdd:execute-phase {phase} ${SDD_WS} # Continue remaining waves
|
|
1207
|
+
/sdd:execute-phase {phase} --wave {next} ${SDD_WS} # Run the next wave explicitly
|
|
866
1208
|
```
|
|
867
1209
|
|
|
868
1210
|
**If no incomplete plans remain after the selected wave finishes:**
|
|
@@ -875,14 +1217,14 @@ Selected wave finished successfully. This phase still has incomplete plans, so p
|
|
|
875
1217
|
|
|
876
1218
|
**Config gate:**
|
|
877
1219
|
```bash
|
|
878
|
-
CODE_REVIEW_ENABLED=$(
|
|
1220
|
+
CODE_REVIEW_ENABLED=$(sdd-sdk query config-get workflow.code_review 2>/dev/null || echo "true")
|
|
879
1221
|
```
|
|
880
1222
|
|
|
881
1223
|
If `CODE_REVIEW_ENABLED` is `"false"`: display "Code review skipped (workflow.code_review=false)" and proceed to next step.
|
|
882
1224
|
|
|
883
1225
|
**Invoke review:**
|
|
884
1226
|
```
|
|
885
|
-
Skill(skill="sdd
|
|
1227
|
+
Skill(skill="sdd-code-review", args="${PHASE_NUMBER}")
|
|
886
1228
|
```
|
|
887
1229
|
|
|
888
1230
|
**Check results using deterministic path (not glob):**
|
|
@@ -895,7 +1237,7 @@ REVIEW_STATUS=$(sed -n '/^---$/,/^---$/p' "$REVIEW_FILE" | grep "^status:" | hea
|
|
|
895
1237
|
If REVIEW_STATUS is not "clean" and not "skipped" and not empty, display:
|
|
896
1238
|
```
|
|
897
1239
|
Code review found issues. Consider running:
|
|
898
|
-
/sdd
|
|
1240
|
+
/sdd:code-review ${PHASE_NUMBER} --fix
|
|
899
1241
|
```
|
|
900
1242
|
|
|
901
1243
|
**Error handling:** If the Skill invocation fails or throws, catch the error, display "Code review encountered an error (non-blocking): {error}" and proceed to next step. Review failures must never block execution.
|
|
@@ -918,7 +1260,7 @@ fi
|
|
|
918
1260
|
|
|
919
1261
|
**2. Find parent UAT file:**
|
|
920
1262
|
```bash
|
|
921
|
-
PARENT_INFO=$(
|
|
1263
|
+
PARENT_INFO=$(sdd-sdk query find-phase "${PARENT_PHASE}" --raw)
|
|
922
1264
|
# Extract directory from PARENT_INFO JSON, then find UAT file in that directory
|
|
923
1265
|
```
|
|
924
1266
|
|
|
@@ -949,7 +1291,7 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
|
|
|
949
1291
|
|
|
950
1292
|
**6. Commit updated artifacts:**
|
|
951
1293
|
```bash
|
|
952
|
-
|
|
1294
|
+
sdd-sdk query commit "docs(phase-${PARENT_PHASE}): resolve UAT gaps and debug sessions after ${PHASE_NUMBER} gap closure" --files .planning/phases/*${PARENT_PHASE}*/*-UAT.md .planning/debug/resolved/*.md
|
|
953
1295
|
```
|
|
954
1296
|
</step>
|
|
955
1297
|
|
|
@@ -976,16 +1318,27 @@ Collect all unique test file paths into `REGRESSION_FILES`.
|
|
|
976
1318
|
**Step 3: Run regression tests (if any found)**
|
|
977
1319
|
|
|
978
1320
|
```bash
|
|
979
|
-
#
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
elif [ -f "
|
|
985
|
-
|
|
986
|
-
elif [ -f "
|
|
987
|
-
|
|
1321
|
+
# Resolve test command: project config > Makefile > language sniff
|
|
1322
|
+
REG_TEST_CMD=$(sdd-sdk query config-get workflow.test_command --default "" 2>/dev/null || true)
|
|
1323
|
+
if [ -z "$REG_TEST_CMD" ]; then
|
|
1324
|
+
if [ -f "Makefile" ] && grep -q "^test:" Makefile; then
|
|
1325
|
+
REG_TEST_CMD="make test"
|
|
1326
|
+
elif [ -f "Justfile" ] || [ -f "justfile" ]; then
|
|
1327
|
+
REG_TEST_CMD="just test"
|
|
1328
|
+
elif [ -f "package.json" ]; then
|
|
1329
|
+
REG_TEST_CMD="npm test"
|
|
1330
|
+
elif [ -f "Cargo.toml" ]; then
|
|
1331
|
+
REG_TEST_CMD="cargo test"
|
|
1332
|
+
elif [ -f "go.mod" ]; then
|
|
1333
|
+
REG_TEST_CMD="go test ./..."
|
|
1334
|
+
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
|
|
1335
|
+
REG_TEST_CMD="python -m pytest ${REGRESSION_FILES} -q --tb=short"
|
|
1336
|
+
else
|
|
1337
|
+
REG_TEST_CMD="true"
|
|
1338
|
+
fi
|
|
988
1339
|
fi
|
|
1340
|
+
# Detect test runner and run prior phase tests
|
|
1341
|
+
eval "$REG_TEST_CMD" 2>&1
|
|
989
1342
|
```
|
|
990
1343
|
|
|
991
1344
|
**Step 4: Report results**
|
|
@@ -1022,7 +1375,7 @@ build/types pass because TypeScript types come from config, not the live databas
|
|
|
1022
1375
|
**Run after execution completes but BEFORE verification marks success.**
|
|
1023
1376
|
|
|
1024
1377
|
```bash
|
|
1025
|
-
SCHEMA_DRIFT=$(
|
|
1378
|
+
SCHEMA_DRIFT=$(sdd-sdk query verify.schema-drift "${PHASE_NUMBER}" 2>/dev/null)
|
|
1026
1379
|
```
|
|
1027
1380
|
|
|
1028
1381
|
Parse JSON result for: `drift_detected`, `blocking`, `schema_files`, `orms`, `unpushed_orms`, `message`.
|
|
@@ -1081,15 +1434,26 @@ If `TEXT_MODE` is true, present as a plain-text numbered list. Otherwise use Ask
|
|
|
1081
1434
|
**If user selects option 3:** Stop execution. Report partial completion.
|
|
1082
1435
|
</step>
|
|
1083
1436
|
|
|
1437
|
+
<step name="codebase_drift_gate">
|
|
1438
|
+
Post-execution structural drift detection (#2003). Non-blocking by contract:
|
|
1439
|
+
any internal error here MUST fall through to `verify_phase_goal`. The phase
|
|
1440
|
+
is never failed by this gate.
|
|
1441
|
+
|
|
1442
|
+
Load and follow the full step spec from
|
|
1443
|
+
`sdd/workflows/execute-phase/steps/codebase-drift-gate.md` —
|
|
1444
|
+
covers the SDK call, JSON contract, `warn` vs `auto-remap` branches, mapper
|
|
1445
|
+
spawn template, and the two `workflow.drift_*` config keys.
|
|
1446
|
+
</step>
|
|
1447
|
+
|
|
1084
1448
|
<step name="verify_phase_goal">
|
|
1085
1449
|
Verify phase achieved its GOAL, not just completed tasks.
|
|
1086
1450
|
|
|
1087
1451
|
```bash
|
|
1088
|
-
VERIFIER_SKILLS=$(
|
|
1452
|
+
VERIFIER_SKILLS=$(sdd-sdk query agent-skills sdd-verifier)
|
|
1089
1453
|
```
|
|
1090
1454
|
|
|
1091
1455
|
```
|
|
1092
|
-
|
|
1456
|
+
Agent(
|
|
1093
1457
|
description="Verify phase {phase_number} goal achievement",
|
|
1094
1458
|
prompt="Verify phase {phase_number} goal achievement.
|
|
1095
1459
|
Phase directory: {phase_dir}
|
|
@@ -1116,6 +1480,8 @@ ${VERIFIER_SKILLS}",
|
|
|
1116
1480
|
)
|
|
1117
1481
|
```
|
|
1118
1482
|
|
|
1483
|
+
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
|
1484
|
+
|
|
1119
1485
|
Read status:
|
|
1120
1486
|
```bash
|
|
1121
1487
|
grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
|
|
@@ -1124,8 +1490,8 @@ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
|
|
|
1124
1490
|
| Status | Action |
|
|
1125
1491
|
|--------|--------|
|
|
1126
1492
|
| `passed` | → update_roadmap |
|
|
1127
|
-
| `human_needed` |
|
|
1128
|
-
| `gaps_found` | Present gap summary, offer `/sdd
|
|
1493
|
+
| `human_needed` | Persist and present human testing items; keep phase pending until verification reruns as `passed` |
|
|
1494
|
+
| `gaps_found` | Present gap summary, offer `/sdd:plan-phase {phase} --gaps ${SDD_WS}` |
|
|
1129
1495
|
|
|
1130
1496
|
**If human_needed:**
|
|
1131
1497
|
|
|
@@ -1168,7 +1534,7 @@ blocked: 0
|
|
|
1168
1534
|
|
|
1169
1535
|
Commit the file:
|
|
1170
1536
|
```bash
|
|
1171
|
-
|
|
1537
|
+
sdd-sdk query commit "test({phase_num}): persist human verification items as UAT" --files "{phase_dir}/{phase_num}-HUMAN-UAT.md"
|
|
1172
1538
|
```
|
|
1173
1539
|
|
|
1174
1540
|
**Step B: Present to user:**
|
|
@@ -1180,12 +1546,12 @@ All automated checks passed. {N} items need human testing:
|
|
|
1180
1546
|
|
|
1181
1547
|
{From VERIFICATION.md human_verification section}
|
|
1182
1548
|
|
|
1183
|
-
Items saved to `{phase_num}-HUMAN-UAT.md` — they will appear in `/sdd
|
|
1549
|
+
Items saved to `{phase_num}-HUMAN-UAT.md` — they will appear in `/sdd:progress` and `/sdd:audit-uat`.
|
|
1184
1550
|
|
|
1185
1551
|
"approved" → continue | Report issues → gap closure
|
|
1186
1552
|
```
|
|
1187
1553
|
|
|
1188
|
-
**If user says "approved":** Proceed to `update_roadmap`. The HUMAN-UAT.md file persists with `status: partial` and will surface in future progress checks until the user runs `/sdd
|
|
1554
|
+
**If user says "approved":** Proceed to `update_roadmap`. The HUMAN-UAT.md file persists with `status: partial` and will surface in future progress checks until the user runs `/sdd:verify-work` on it.
|
|
1189
1555
|
|
|
1190
1556
|
**If user reports issues:** Proceed to gap closure as currently implemented.
|
|
1191
1557
|
|
|
@@ -1200,24 +1566,24 @@ Items saved to `{phase_num}-HUMAN-UAT.md` — they will appear in `/sdd-progress
|
|
|
1200
1566
|
{Gap summaries from VERIFICATION.md}
|
|
1201
1567
|
|
|
1202
1568
|
---
|
|
1203
|
-
## ▶ Next Up
|
|
1569
|
+
## ▶ Next Up — [${PROJECT_CODE}] ${PROJECT_TITLE}
|
|
1204
1570
|
|
|
1205
1571
|
`/clear` then:
|
|
1206
1572
|
|
|
1207
|
-
`/sdd
|
|
1573
|
+
`/sdd:plan-phase {X} --gaps ${SDD_WS}`
|
|
1208
1574
|
|
|
1209
1575
|
Also: `cat {phase_dir}/{phase_num}-VERIFICATION.md` — full report
|
|
1210
|
-
Also: `/sdd
|
|
1576
|
+
Also: `/sdd:verify-work {X} ${SDD_WS}` — manual testing first
|
|
1211
1577
|
```
|
|
1212
1578
|
|
|
1213
|
-
Gap closure cycle: `/sdd
|
|
1579
|
+
Gap closure cycle: `/sdd:plan-phase {X} --gaps ${SDD_WS}` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/sdd:execute-phase {X} --gaps-only ${SDD_WS}` → verifier re-runs.
|
|
1214
1580
|
</step>
|
|
1215
1581
|
|
|
1216
1582
|
<step name="update_roadmap">
|
|
1217
1583
|
**Mark phase complete and update all tracking files:**
|
|
1218
1584
|
|
|
1219
1585
|
```bash
|
|
1220
|
-
COMPLETION=$(
|
|
1586
|
+
COMPLETION=$(sdd-sdk query phase.complete "${PHASE_NUMBER}")
|
|
1221
1587
|
```
|
|
1222
1588
|
|
|
1223
1589
|
The CLI handles:
|
|
@@ -1236,11 +1602,11 @@ Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`, `warnings
|
|
|
1236
1602
|
|
|
1237
1603
|
{list each warning}
|
|
1238
1604
|
|
|
1239
|
-
These items are tracked and will appear in `/sdd
|
|
1605
|
+
These items are tracked and will appear in `/sdd:progress` and `/sdd:audit-uat`.
|
|
1240
1606
|
```
|
|
1241
1607
|
|
|
1242
1608
|
```bash
|
|
1243
|
-
|
|
1609
|
+
sdd-sdk query commit "docs(phase-{X}): complete phase execution" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md {phase_dir}/*-VERIFICATION.md
|
|
1244
1610
|
```
|
|
1245
1611
|
</step>
|
|
1246
1612
|
|
|
@@ -1252,7 +1618,7 @@ entries from the completed phase to the global learnings store at `~/.sdd/knowle
|
|
|
1252
1618
|
|
|
1253
1619
|
**Check config gate:**
|
|
1254
1620
|
```bash
|
|
1255
|
-
GL_ENABLED=$(
|
|
1621
|
+
GL_ENABLED=$(sdd-sdk query config-get features.global_learnings --raw 2>/dev/null || echo "false")
|
|
1256
1622
|
```
|
|
1257
1623
|
|
|
1258
1624
|
**If `GL_ENABLED` is not `true`:** Skip this step entirely (feature disabled by default).
|
|
@@ -1262,11 +1628,43 @@ GL_ENABLED=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get features.glob
|
|
|
1262
1628
|
1. Check if LEARNINGS.md exists in the phase directory (use the `phase_dir` value from init context)
|
|
1263
1629
|
2. If found, copy to global store:
|
|
1264
1630
|
```bash
|
|
1265
|
-
|
|
1631
|
+
sdd-sdk query learnings.copy 2>/dev/null || echo "⚠ Learnings copy failed — continuing"
|
|
1266
1632
|
```
|
|
1267
1633
|
Copy failure must NOT block phase completion.
|
|
1268
1634
|
</step>
|
|
1269
1635
|
|
|
1636
|
+
<step name="close_phase_todos">
|
|
1637
|
+
**Auto-close pending todos tagged for this phase (#2433).**
|
|
1638
|
+
|
|
1639
|
+
This step runs AFTER `update_roadmap` marks the phase complete. It moves any pending todos that carry `resolves_phase: <current-phase-number>` to the completed directory.
|
|
1640
|
+
|
|
1641
|
+
```bash
|
|
1642
|
+
PHASE_NUM="${PHASE_NUMBER}"
|
|
1643
|
+
PENDING_DIR=".planning/todos/pending"
|
|
1644
|
+
COMPLETED_DIR=".planning/todos/completed"
|
|
1645
|
+
mkdir -p "$COMPLETED_DIR"
|
|
1646
|
+
|
|
1647
|
+
CLOSED=()
|
|
1648
|
+
for TODO_FILE in "$PENDING_DIR"/*.md; do
|
|
1649
|
+
[ -f "$TODO_FILE" ] || continue
|
|
1650
|
+
# Extract resolves_phase from YAML frontmatter (first --- block only)
|
|
1651
|
+
RP=$(awk '/^---/{c++;next} c==1 && /^resolves_phase:/{print $2;exit} c==2{exit}' "$TODO_FILE" 2>/dev/null || true)
|
|
1652
|
+
if [ "$RP" = "$PHASE_NUM" ] || [ "$RP" = "\"$PHASE_NUM\"" ]; then
|
|
1653
|
+
mv "$TODO_FILE" "$COMPLETED_DIR/"
|
|
1654
|
+
CLOSED+=("$(basename "$TODO_FILE")")
|
|
1655
|
+
fi
|
|
1656
|
+
done
|
|
1657
|
+
|
|
1658
|
+
if [ ${#CLOSED[@]} -gt 0 ]; then
|
|
1659
|
+
sdd-sdk query commit "docs(phase-${PHASE_NUMBER}): auto-close ${#CLOSED[@]} todo(s) resolved by this phase" --files .planning/todos/completed/ .planning/STATE.md|| true
|
|
1660
|
+
echo "◆ Closed ${#CLOSED[@]} todo(s) resolved by Phase ${PHASE_NUMBER}:"
|
|
1661
|
+
for f in "${CLOSED[@]}"; do echo " ✓ $f"; done
|
|
1662
|
+
fi
|
|
1663
|
+
```
|
|
1664
|
+
|
|
1665
|
+
**If no todos have `resolves_phase: <this-phase>`:** Skip silently — this step is always additive and never blocks phase completion.
|
|
1666
|
+
</step>
|
|
1667
|
+
|
|
1270
1668
|
<step name="update_project_md">
|
|
1271
1669
|
**Evolve PROJECT.md to reflect phase completion (prevents planning document drift — #956):**
|
|
1272
1670
|
|
|
@@ -1283,7 +1681,7 @@ PROJECT.md falls behind silently over multiple phases.
|
|
|
1283
1681
|
5. Commit the change:
|
|
1284
1682
|
|
|
1285
1683
|
```bash
|
|
1286
|
-
|
|
1684
|
+
sdd-sdk query commit "docs(phase-{X}): evolve PROJECT.md after phase completion" --files .planning/PROJECT.md
|
|
1287
1685
|
```
|
|
1288
1686
|
|
|
1289
1687
|
**Skip this step if** `.planning/PROJECT.md` does not exist.
|
|
@@ -1291,7 +1689,7 @@ node "$HOME/.claude/sdd/bin/sdd-tools.cjs" commit "docs(phase-{X}): evolve PROJE
|
|
|
1291
1689
|
|
|
1292
1690
|
<step name="offer_next">
|
|
1293
1691
|
|
|
1294
|
-
**Exception:** If `gaps_found`, the `verify_phase_goal` step already presents the gap-closure path (`/sdd
|
|
1692
|
+
**Exception:** If `gaps_found`, the `verify_phase_goal` step already presents the gap-closure path (`/sdd:plan-phase {X} --gaps`). No additional routing needed — skip auto-advance.
|
|
1295
1693
|
|
|
1296
1694
|
**No-transition check (spawned by auto-advance chain):**
|
|
1297
1695
|
|
|
@@ -1319,13 +1717,12 @@ STOP. Do not proceed to auto-advance or transition.
|
|
|
1319
1717
|
**Auto-advance detection:**
|
|
1320
1718
|
|
|
1321
1719
|
1. Parse `--auto` flag from $ARGUMENTS
|
|
1322
|
-
2. Read
|
|
1720
|
+
2. Read consolidated auto-mode (`active` = chain flag OR user preference; chain flag already synced in init step):
|
|
1323
1721
|
```bash
|
|
1324
|
-
|
|
1325
|
-
AUTO_CFG=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
|
|
1722
|
+
AUTO_MODE=$(sdd-sdk query check auto-mode --pick active 2>/dev/null || echo "false")
|
|
1326
1723
|
```
|
|
1327
1724
|
|
|
1328
|
-
**If `--auto` flag present OR `
|
|
1725
|
+
**If `--auto` flag present OR `AUTO_MODE` is true (AND verification passed with no gaps):**
|
|
1329
1726
|
|
|
1330
1727
|
```
|
|
1331
1728
|
╔══════════════════════════════════════════╗
|
|
@@ -1334,11 +1731,11 @@ STOP. Do not proceed to auto-advance or transition.
|
|
|
1334
1731
|
╚══════════════════════════════════════════╝
|
|
1335
1732
|
```
|
|
1336
1733
|
|
|
1337
|
-
Execute the transition workflow inline (do NOT use
|
|
1734
|
+
Execute the transition workflow inline (do NOT use Agent — orchestrator context is ~10-15%, transition needs phase completion data already in context):
|
|
1338
1735
|
|
|
1339
1736
|
Read and follow `~/.claude/sdd/workflows/transition.md`, passing through the `--auto` flag so it propagates to the next phase invocation.
|
|
1340
1737
|
|
|
1341
|
-
**If
|
|
1738
|
+
**If neither `--auto` nor `AUTO_MODE` is true:**
|
|
1342
1739
|
|
|
1343
1740
|
**STOP. Do not auto-advance. Do not execute transition. Do not plan next phase. Present options to the user and wait.**
|
|
1344
1741
|
|
|
@@ -1355,10 +1752,10 @@ If CONTEXT.md does **not** exist for the next phase, present:
|
|
|
1355
1752
|
```
|
|
1356
1753
|
## ✓ Phase {X}: {Name} Complete
|
|
1357
1754
|
|
|
1358
|
-
/sdd
|
|
1359
|
-
/sdd
|
|
1360
|
-
/sdd
|
|
1361
|
-
/sdd
|
|
1755
|
+
/sdd:progress ${SDD_WS} — see updated roadmap
|
|
1756
|
+
/sdd:discuss-phase {next} ${SDD_WS} — start here: discuss next phase before planning ← recommended
|
|
1757
|
+
/sdd:plan-phase {next} ${SDD_WS} — plan next phase (skip discuss)
|
|
1758
|
+
/sdd:execute-phase {next} ${SDD_WS} — execute next phase (skip discuss and plan)
|
|
1362
1759
|
```
|
|
1363
1760
|
|
|
1364
1761
|
If CONTEXT.md **exists** for the next phase, present:
|
|
@@ -1366,10 +1763,10 @@ If CONTEXT.md **exists** for the next phase, present:
|
|
|
1366
1763
|
```
|
|
1367
1764
|
## ✓ Phase {X}: {Name} Complete
|
|
1368
1765
|
|
|
1369
|
-
/sdd
|
|
1370
|
-
/sdd
|
|
1371
|
-
/sdd
|
|
1372
|
-
/sdd
|
|
1766
|
+
/sdd:progress ${SDD_WS} — see updated roadmap
|
|
1767
|
+
/sdd:plan-phase {next} ${SDD_WS} — start here: plan next phase (CONTEXT.md already present) ← recommended
|
|
1768
|
+
/sdd:discuss-phase {next} ${SDD_WS} — re-discuss next phase
|
|
1769
|
+
/sdd:execute-phase {next} ${SDD_WS} — execute next phase (skip planning)
|
|
1373
1770
|
```
|
|
1374
1771
|
|
|
1375
1772
|
Only suggest the commands listed above. Do not invent or hallucinate command names.
|
|
@@ -1379,7 +1776,7 @@ Only suggest the commands listed above. Do not invent or hallucinate command nam
|
|
|
1379
1776
|
|
|
1380
1777
|
<context_efficiency>
|
|
1381
1778
|
Orchestrator: ~10-15% context for 200k windows, can use more for 1M+ windows.
|
|
1382
|
-
Subagents: fresh context each (200k-1M depending on model). No polling (
|
|
1779
|
+
Subagents: fresh context each (200k-1M depending on model). No polling (Agent blocks). No context bleed.
|
|
1383
1780
|
|
|
1384
1781
|
For 1M+ context models, consider:
|
|
1385
1782
|
- Passing richer context (code snippets, dependency outputs) directly to executors instead of just file paths
|
|
@@ -1388,6 +1785,7 @@ For 1M+ context models, consider:
|
|
|
1388
1785
|
</context_efficiency>
|
|
1389
1786
|
|
|
1390
1787
|
<failure_handling>
|
|
1788
|
+
- **Quota / rate-limit (any runtime — #3095):** Agent return body contains a sentinel like `usage limit`, `rate limit`, `429`, `too many requests`, `RESOURCE_EXHAUSTED`, `usage_limit_reached`. Route via `sdd-sdk query agent.classify-failure` → `class: "quota-exceeded"`. Do not offer retry-now; the right action is wait-for-reset and resume.
|
|
1391
1789
|
- **classifyHandoffIfNeeded false failure:** Agent reports "failed" but error is `classifyHandoffIfNeeded is not defined` → Claude Code bug, not SDD. Spot-check (SUMMARY exists, commits present) → if pass, treat as success
|
|
1392
1790
|
- **Agent fails mid-plan:** Missing SUMMARY.md → report, ask user how to proceed
|
|
1393
1791
|
- **Dependency chain breaks:** Wave 1 fails → Wave 2 dependents likely fail → user chooses attempt or skip
|
|
@@ -1396,7 +1794,7 @@ For 1M+ context models, consider:
|
|
|
1396
1794
|
</failure_handling>
|
|
1397
1795
|
|
|
1398
1796
|
<resumption>
|
|
1399
|
-
Re-run `/sdd
|
|
1797
|
+
Re-run `/sdd:execute-phase {phase}` → discover_plans finds completed SUMMARYs → skips them → resumes from first incomplete plan → continues wave execution.
|
|
1400
1798
|
|
|
1401
1799
|
STATE.md tracks: last completed plan, current wave, pending checkpoints.
|
|
1402
1800
|
</resumption>
|