@opengsd/gsd-core 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.opencode/plugins/gsd-core.js +12 -0
- package/agents/gsd-code-fixer.md +1 -1
- package/agents/gsd-debug-session-manager.md +1 -1
- package/agents/gsd-debugger.md +1 -1
- package/agents/gsd-dom-verifier.md +169 -0
- package/agents/gsd-eval-auditor.md +1 -1
- package/agents/gsd-executor.md +78 -42
- package/agents/gsd-framework-selector.md +1 -3
- package/agents/gsd-intel-updater.md +1 -1
- package/agents/gsd-mempalace-curator.md +0 -1
- package/agents/gsd-pattern-mapper.md +11 -0
- package/agents/gsd-phase-researcher.md +3 -1
- package/agents/gsd-plan-checker.md +91 -112
- package/agents/gsd-planner.md +20 -4
- package/agents/gsd-project-researcher.md +1 -1
- package/agents/gsd-research-synthesizer.md +2 -2
- package/agents/gsd-roadmapper.md +15 -11
- package/agents/gsd-ui-checker.md +82 -7
- package/agents/gsd-ui-researcher.md +70 -3
- package/agents/gsd-verifier.md +24 -2
- package/bin/install.js +847 -200
- package/commands/gsd/discuss-phase.md +1 -1
- package/commands/gsd/execute-phase.md +1 -1
- package/commands/gsd/import.md +1 -1
- package/commands/gsd/ns-workflow.md +2 -1
- package/commands/gsd/phase.md +1 -1
- package/commands/gsd/quick-batch.md +105 -0
- package/commands/gsd/quick.md +8 -4
- package/commands/gsd/surface.md +18 -8
- package/gsd-core/bin/gsd-tools.cjs +761 -100
- package/gsd-core/bin/lib/active-workstream-store.cjs +8 -0
- package/gsd-core/bin/lib/adr-parser.cjs +13 -7
- package/gsd-core/bin/lib/agent-install-check.cjs +162 -0
- package/gsd-core/bin/lib/api-coverage.cjs +30 -9
- package/gsd-core/bin/lib/artifacts.cjs +2 -0
- package/gsd-core/bin/lib/assumption-delta.cjs +30 -11
- package/gsd-core/bin/lib/audit.cjs +163 -41
- package/gsd-core/bin/lib/broken-windows.cjs +306 -28
- package/gsd-core/bin/lib/capability-activation.cjs +27 -0
- package/gsd-core/bin/lib/capability-lock.cjs +10 -4
- package/gsd-core/bin/lib/capability-registry.cjs +785 -144
- package/gsd-core/bin/lib/capability-state.cjs +25 -4
- package/gsd-core/bin/lib/capability-validator.cjs +321 -18
- package/gsd-core/bin/lib/capability-writer.cjs +14 -4
- package/gsd-core/bin/lib/check-command-router.cjs +229 -6
- package/gsd-core/bin/lib/claude-orchestration.cjs +10 -25
- package/gsd-core/bin/lib/cli-exit.cjs +496 -10
- package/gsd-core/bin/lib/clusters.cjs +1 -0
- package/gsd-core/bin/lib/code-review-depth.cjs +288 -0
- package/gsd-core/bin/lib/codex-agent-toml.cjs +410 -4
- package/gsd-core/bin/lib/command-aliases.cjs +16 -0
- package/gsd-core/bin/lib/command-arg-projection.cjs +144 -14
- package/gsd-core/bin/lib/command-routing-hub.cjs +31 -2
- package/gsd-core/bin/lib/commands.cjs +877 -54
- package/gsd-core/bin/lib/complexity-trigger.cjs +26 -6
- package/gsd-core/bin/lib/config-loader.cjs +121 -29
- package/gsd-core/bin/lib/config.cjs +92 -2
- package/gsd-core/bin/lib/configuration.cjs +129 -37
- package/gsd-core/bin/lib/core-utils.cjs +118 -14
- package/gsd-core/bin/lib/decisions.cjs +213 -1
- package/gsd-core/bin/lib/edge-probe.cjs +23 -2
- package/gsd-core/bin/lib/estimate-cli.cjs +55 -11
- package/gsd-core/bin/lib/exit-code-registry.cjs +98 -0
- package/gsd-core/bin/lib/file-overlap-partitioner.cjs +74 -0
- package/gsd-core/bin/lib/frontmatter.cjs +975 -326
- package/gsd-core/bin/lib/gap-checker.cjs +41 -8
- package/gsd-core/bin/lib/git-base-branch.cjs +182 -39
- package/gsd-core/bin/lib/health-diagnostic-rules/consistency.cjs +7 -3
- package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +8 -2
- package/gsd-core/bin/lib/health-diagnostic-rules/roadmap-disk-consistency.cjs +60 -14
- package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +75 -22
- package/gsd-core/bin/lib/health-diagnostic-rules/worktree-health.cjs +22 -8
- package/gsd-core/bin/lib/health-diagnostic.cjs +23 -3
- package/gsd-core/bin/lib/host-integration.cjs +96 -11
- package/gsd-core/bin/lib/init-command-router.cjs +132 -21
- package/gsd-core/bin/lib/init.cjs +252 -56
- package/gsd-core/bin/lib/install-engine.cjs +252 -15
- package/gsd-core/bin/lib/install-model-override-resolver.cjs +78 -1
- package/gsd-core/bin/lib/install-profiles.cjs +100 -18
- package/gsd-core/bin/lib/installer-migration-report.cjs +4 -0
- package/gsd-core/bin/lib/installer-migrations/010-antigravity-retire-confighome-artifacts.cjs +169 -0
- package/gsd-core/bin/lib/installer-migrations.cjs +10 -7
- package/gsd-core/bin/lib/intel.cjs +101 -26
- package/gsd-core/bin/lib/io.cjs +195 -15
- package/gsd-core/bin/lib/learnings.cjs +85 -14
- package/gsd-core/bin/lib/legacy-cleanup.cjs +8 -2
- package/gsd-core/bin/lib/loop-resolver.cjs +14 -8
- package/gsd-core/bin/lib/markdown-table.cjs +175 -4
- package/gsd-core/bin/lib/milestone.cjs +112 -7
- package/gsd-core/bin/lib/model-catalog.cjs +177 -19
- package/gsd-core/bin/lib/model-resolver.cjs +10 -28
- package/gsd-core/bin/lib/onboard-projection.cjs +5 -1
- package/gsd-core/bin/lib/phase-command-router.cjs +13 -6
- package/gsd-core/bin/lib/phase-estimation.cjs +17 -8
- package/gsd-core/bin/lib/phase-id.cjs +321 -13
- package/gsd-core/bin/lib/phase-lifecycle.cjs +24 -16
- package/gsd-core/bin/lib/phase-locator.cjs +138 -17
- package/gsd-core/bin/lib/phase.cjs +1175 -115
- package/gsd-core/bin/lib/plan-document.cjs +273 -0
- package/gsd-core/bin/lib/plan-scan.cjs +13 -2
- package/gsd-core/bin/lib/planning-command-router.cjs +61 -0
- package/gsd-core/bin/lib/planning-inspect.cjs +1168 -0
- package/gsd-core/bin/lib/planning-snapshot.cjs +165 -34
- package/gsd-core/bin/lib/planning-workspace.cjs +159 -28
- package/gsd-core/bin/lib/probe-core.cjs +4 -1
- package/gsd-core/bin/lib/profile-pipeline-command-router.cjs +50 -7
- package/gsd-core/bin/lib/profile-pipeline.cjs +6 -3
- package/gsd-core/bin/lib/quick-batch-command-router.cjs +285 -0
- package/gsd-core/bin/lib/quick-batch-dispatch.cjs +250 -0
- package/gsd-core/bin/lib/quick-batch.cjs +840 -0
- package/gsd-core/bin/lib/real-home-guard.cjs +419 -0
- package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +71 -45
- package/gsd-core/bin/lib/review-lane-descriptor.cjs +62 -14
- package/gsd-core/bin/lib/review-lane-invocation.cjs +73 -1
- package/gsd-core/bin/lib/review-lane-runner.cjs +136 -10
- package/gsd-core/bin/lib/roadmap-command-router.cjs +45 -31
- package/gsd-core/bin/lib/roadmap-parser.cjs +577 -41
- package/gsd-core/bin/lib/roadmap.cjs +248 -64
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +329 -41
- package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +16 -17
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +320 -109
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +487 -83
- package/gsd-core/bin/lib/runtime-identity.cjs +234 -0
- package/gsd-core/bin/lib/runtime-slash.cjs +72 -2
- package/gsd-core/bin/lib/shell-command-projection.cjs +75 -8
- package/gsd-core/bin/lib/smart-entry.cjs +19 -31
- package/gsd-core/bin/lib/spec-section.cjs +12 -7
- package/gsd-core/bin/lib/state-command-router.cjs +47 -18
- package/gsd-core/bin/lib/state-contract.cjs +359 -0
- package/gsd-core/bin/lib/state-document.cjs +216 -5
- package/gsd-core/bin/lib/state-md-schema.cjs +231 -0
- package/gsd-core/bin/lib/state-transition.cjs +850 -145
- package/gsd-core/bin/lib/state.cjs +1629 -287
- package/gsd-core/bin/lib/surface.cjs +33 -10
- package/gsd-core/bin/lib/task-command-router.cjs +111 -1
- package/gsd-core/bin/lib/task-content-resolution.cjs +368 -0
- package/gsd-core/bin/lib/tdd-red-evidence.cjs +133 -0
- package/gsd-core/bin/lib/teams-status.cjs +4 -1
- package/gsd-core/bin/lib/uat-predicate.cjs +58 -20
- package/gsd-core/bin/lib/uat.cjs +2542 -387
- package/gsd-core/bin/lib/ui-consideration-probe.cjs +9 -1
- package/gsd-core/bin/lib/ui-safety-gate.cjs +37 -7
- package/gsd-core/bin/lib/unusable-input.cjs +13 -0
- package/gsd-core/bin/lib/update-context.cjs +6 -2
- package/gsd-core/bin/lib/validate-command-router.cjs +2 -2
- package/gsd-core/bin/lib/validate.cjs +230 -12
- package/gsd-core/bin/lib/vendor/README.md +43 -5
- package/gsd-core/bin/lib/vendor/js-yaml.cjs +3014 -0
- package/gsd-core/bin/lib/verification-command-router.cjs +2 -1
- package/gsd-core/bin/lib/verification.cjs +287 -13
- package/gsd-core/bin/lib/verify-command-grounding.cjs +846 -0
- package/gsd-core/bin/lib/verify-command-router.cjs +1 -0
- package/gsd-core/bin/lib/verify.cjs +441 -56
- package/gsd-core/bin/lib/workstream-inventory.cjs +20 -2
- package/gsd-core/bin/lib/workstream-name-policy.cjs +25 -4
- package/gsd-core/bin/lib/worktree-base-ref.cjs +66 -12
- package/gsd-core/bin/lib/worktree-safety.cjs +185 -21
- package/gsd-core/bin/shared/config-defaults.manifest.json +7 -1
- package/gsd-core/bin/shared/config-schema.manifest.json +13 -0
- package/gsd-core/bin/shared/exit-codes.json +8 -0
- package/gsd-core/bin/shared/exit-codes.sh +20 -0
- package/gsd-core/bin/shared/model-catalog.json +8 -1
- package/gsd-core/bin/verify-reapply-patches.cjs +70 -3
- package/gsd-core/references/agent-contracts.md +6 -5
- package/gsd-core/references/api-coverage.md +24 -2
- package/gsd-core/references/autonomous-smart-discuss.md +3 -3
- package/gsd-core/references/checkpoints.md +37 -19
- package/gsd-core/references/decimal-phase-calculation.md +5 -5
- package/gsd-core/references/edge-probe.md +17 -5
- package/gsd-core/references/execute-mvp-tdd.md +18 -18
- package/gsd-core/references/execute-phase-between-wave-reset.md +9 -12
- package/gsd-core/references/execute-phase-response-language.md +6 -0
- package/gsd-core/references/execute-phase-wave-guard.md +11 -9
- package/gsd-core/references/executor-examples.md +42 -0
- package/gsd-core/references/failing-direction.md +78 -0
- package/gsd-core/references/few-shot-examples/plan-checker.md +15 -15
- package/gsd-core/references/gate-prompts.md +1 -1
- package/gsd-core/references/git-integration.md +5 -5
- package/gsd-core/references/git-planning-commit.md +3 -3
- package/gsd-core/references/gsd-run-resolver.md +1 -1
- package/gsd-core/references/loop-hook-dispatch.md +22 -0
- package/gsd-core/references/model-profiles.md +1 -1
- package/gsd-core/references/mvp-concepts.md +2 -2
- package/gsd-core/references/nyquist-compliance.md +74 -0
- package/gsd-core/references/offer-next.md +3 -5
- package/gsd-core/references/phase-argument-parsing.md +3 -3
- package/gsd-core/references/plan-checker-examples.md +41 -0
- package/gsd-core/references/planner-antipatterns.md +25 -0
- package/gsd-core/references/planner-chunked.md +5 -1
- package/gsd-core/references/planner-coupling.md +42 -0
- package/gsd-core/references/planner-failing-direction.md +53 -0
- package/gsd-core/references/planner-human-verify-mode.md +15 -1
- package/gsd-core/references/planner-quick-batch.md +71 -0
- package/gsd-core/references/planner-reviews.md +47 -0
- package/gsd-core/references/planner-revision.md +76 -3
- package/gsd-core/references/planner-verify-command-grounding.md +17 -0
- package/gsd-core/references/planning-config.md +39 -9
- package/gsd-core/references/response-language-directive.md +9 -0
- package/gsd-core/references/reviewer-instances.md +31 -0
- package/gsd-core/references/revision-loop.md +118 -11
- package/gsd-core/references/runtime-aware-dispatch.md +1 -1
- package/gsd-core/references/tdd.md +15 -12
- package/gsd-core/references/ui-brand.md +65 -21
- package/gsd-core/references/ui-consideration-probe.md +1 -1
- package/gsd-core/references/universal-anti-patterns.md +2 -2
- package/gsd-core/references/verifier-evidence-gate.md +160 -0
- package/gsd-core/references/verify-command-path-resolvability.md +42 -0
- package/gsd-core/references/verify-mvp-mode.md +1 -1
- package/gsd-core/references/workstream-flag.md +11 -11
- package/gsd-core/templates/README.md +1 -1
- package/gsd-core/templates/SECURITY.md +3 -3
- package/gsd-core/templates/UI-SPEC.md +25 -3
- package/gsd-core/templates/VALIDATION.md +3 -3
- package/gsd-core/templates/phase-prompt.md +7 -0
- package/gsd-core/templates/state.md +7 -0
- package/gsd-core/templates/verification-report.md +5 -0
- package/gsd-core/workflows/_runtime-launcher.snippet.sh +1 -1
- package/gsd-core/workflows/add-backlog.md +3 -1
- package/gsd-core/workflows/add-phase.md +5 -3
- package/gsd-core/workflows/add-tests.md +4 -9
- package/gsd-core/workflows/add-todo.md +2 -2
- package/gsd-core/workflows/ai-integration-phase.md +5 -10
- package/gsd-core/workflows/analyze-dependencies.md +2 -0
- package/gsd-core/workflows/audit-fix.md +14 -3
- package/gsd-core/workflows/audit-milestone.md +11 -9
- package/gsd-core/workflows/audit-uat.md +19 -2
- package/gsd-core/workflows/autonomous/steps/converge-fail-fast.md +2 -2
- package/gsd-core/workflows/autonomous.md +12 -26
- package/gsd-core/workflows/check-todos.md +2 -2
- package/gsd-core/workflows/cleanup.md +3 -3
- package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +16 -14
- package/gsd-core/workflows/code-review-fix.md +3 -1
- package/gsd-core/workflows/code-review.md +192 -69
- package/gsd-core/workflows/complete-milestone.md +28 -14
- package/gsd-core/workflows/debug.md +6 -4
- package/gsd-core/workflows/diagnose-issues.md +17 -7
- package/gsd-core/workflows/discuss-phase/modes/advisor.md +3 -1
- package/gsd-core/workflows/discuss-phase/modes/all.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/analyze.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/auto.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/batch.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/chain.md +5 -7
- package/gsd-core/workflows/discuss-phase/modes/default.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/power.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/text.md +3 -1
- package/gsd-core/workflows/discuss-phase/templates/context.md +2 -0
- package/gsd-core/workflows/discuss-phase/templates/discussion-log.md +2 -0
- package/gsd-core/workflows/discuss-phase-assumptions/steps/auto-advance-dispatch.md +1 -3
- package/gsd-core/workflows/discuss-phase-assumptions.md +3 -3
- package/gsd-core/workflows/discuss-phase-power.md +2 -0
- package/gsd-core/workflows/discuss-phase.md +2 -2
- package/gsd-core/workflows/do.md +46 -19
- package/gsd-core/workflows/docs-update.md +6 -5
- package/gsd-core/workflows/edit-phase.md +3 -1
- package/gsd-core/workflows/eval-review.md +5 -10
- package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +3 -1
- package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +129 -11
- package/gsd-core/workflows/execute-phase/steps/gap-closure-artifacts.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/partial-wave.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-executor-routing.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +29 -5
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +2 -2
- package/gsd-core/workflows/execute-phase/steps/protected-branch.md +21 -0
- package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +4 -2
- package/gsd-core/workflows/execute-phase/steps/tdd-applicability-resolution.md +25 -0
- package/gsd-core/workflows/execute-phase/steps/wave-post-gate-hooks.md +39 -0
- package/gsd-core/workflows/execute-phase/steps/worktree-recovery-policy.md +2 -0
- package/gsd-core/workflows/execute-phase.md +68 -66
- package/gsd-core/workflows/execute-plan.md +25 -20
- package/gsd-core/workflows/explore.md +3 -1
- package/gsd-core/workflows/extract-learnings.md +3 -1
- package/gsd-core/workflows/fast.md +8 -2
- package/gsd-core/workflows/forensics.md +3 -1
- package/gsd-core/workflows/graduation.md +6 -6
- package/gsd-core/workflows/health.md +4 -7
- package/gsd-core/workflows/help/modes/brief.md +2 -0
- package/gsd-core/workflows/help/modes/default.md +2 -0
- package/gsd-core/workflows/help/modes/full.md +12 -0
- package/gsd-core/workflows/help/modes/topic.md +2 -0
- package/gsd-core/workflows/help.md +2 -0
- package/gsd-core/workflows/import.md +17 -14
- package/gsd-core/workflows/inbox.md +5 -6
- package/gsd-core/workflows/ingest-docs.md +45 -12
- package/gsd-core/workflows/insert-phase.md +7 -5
- package/gsd-core/workflows/list-phase-assumptions.md +2 -0
- package/gsd-core/workflows/list-seeds.md +7 -3
- package/gsd-core/workflows/list-workspaces.md +3 -1
- package/gsd-core/workflows/manager.md +15 -26
- package/gsd-core/workflows/map-codebase.md +3 -1
- package/gsd-core/workflows/milestone-summary.md +3 -1
- package/gsd-core/workflows/mvp-phase.md +3 -3
- package/gsd-core/workflows/new-milestone.md +10 -22
- package/gsd-core/workflows/new-project/steps/auto-mode-config.md +1 -1
- package/gsd-core/workflows/new-project.md +17 -29
- package/gsd-core/workflows/new-workspace.md +2 -2
- package/gsd-core/workflows/next.md +4 -2
- package/gsd-core/workflows/node-repair.md +2 -0
- package/gsd-core/workflows/note.md +2 -0
- package/gsd-core/workflows/onboard.md +1 -1
- package/gsd-core/workflows/pause-work.md +20 -5
- package/gsd-core/workflows/plan-phase/steps/adr-ingest-express-path.md +1 -1
- package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +100 -18
- package/gsd-core/workflows/plan-phase/steps/prd-express-path.md +4 -4
- package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +12 -3
- package/gsd-core/workflows/plan-phase.md +251 -54
- package/gsd-core/workflows/plan-review-convergence.md +148 -19
- package/gsd-core/workflows/plant-seed.md +3 -3
- package/gsd-core/workflows/pr-branch.md +195 -51
- package/gsd-core/workflows/profile-user.md +17 -15
- package/gsd-core/workflows/progress/steps/forensic-audit.md +1 -1
- package/gsd-core/workflows/progress.md +52 -15
- package/gsd-core/workflows/quick/steps/discussion-phase.md +1 -3
- package/gsd-core/workflows/quick/steps/plan-checker-loop.md +38 -5
- package/gsd-core/workflows/quick/steps/quick-verification.md +2 -4
- package/gsd-core/workflows/quick/steps/research-phase.md +5 -7
- package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +3 -3
- package/gsd-core/workflows/quick-batch/steps/batch-init.md +55 -0
- package/gsd-core/workflows/quick-batch/steps/completion.md +65 -0
- package/gsd-core/workflows/quick-batch/steps/merge-wave.md +100 -0
- package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +147 -0
- package/gsd-core/workflows/quick-batch/steps/planner-wave.md +158 -0
- package/gsd-core/workflows/quick-batch/steps/research-phase.md +95 -0
- package/gsd-core/workflows/quick-batch/steps/resume-mode.md +49 -0
- package/gsd-core/workflows/quick-batch/steps/verification-wave.md +73 -0
- package/gsd-core/workflows/quick-batch/steps/worktree-dispatch.md +169 -0
- package/gsd-core/workflows/quick-batch.md +203 -0
- package/gsd-core/workflows/quick.md +33 -32
- package/gsd-core/workflows/reapply-patches.md +2 -0
- package/gsd-core/workflows/remove-phase.md +6 -4
- package/gsd-core/workflows/remove-workspace.md +3 -3
- package/gsd-core/workflows/resume-project.md +14 -14
- package/gsd-core/workflows/review.md +404 -21
- package/gsd-core/workflows/scan.md +3 -1
- package/gsd-core/workflows/section-manifest.json +12 -0
- package/gsd-core/workflows/secure-phase.md +3 -3
- package/gsd-core/workflows/session-report.md +2 -0
- package/gsd-core/workflows/settings-advanced.md +9 -9
- package/gsd-core/workflows/settings-integrations.md +66 -32
- package/gsd-core/workflows/settings.md +4 -6
- package/gsd-core/workflows/ship.md +22 -16
- package/gsd-core/workflows/sketch-wrap-up.md +13 -17
- package/gsd-core/workflows/sketch.md +13 -19
- package/gsd-core/workflows/smart-entry.md +4 -6
- package/gsd-core/workflows/spec-phase.md +31 -4
- package/gsd-core/workflows/spike-wrap-up.md +9 -11
- package/gsd-core/workflows/spike.md +21 -32
- package/gsd-core/workflows/stats.md +4 -2
- package/gsd-core/workflows/sync-skills.md +13 -5
- package/gsd-core/workflows/thread.md +13 -7
- package/gsd-core/workflows/transition.md +7 -5
- package/gsd-core/workflows/ui-phase.md +36 -21
- package/gsd-core/workflows/ui-review.md +7 -11
- package/gsd-core/workflows/ultraplan-phase.md +7 -13
- package/gsd-core/workflows/undo.md +9 -17
- package/gsd-core/workflows/update.md +47 -48
- package/gsd-core/workflows/validate-phase.md +3 -3
- package/gsd-core/workflows/verify-work/steps/automated-ui-verification.md +25 -1
- package/gsd-core/workflows/verify-work/steps/mvp-uat-framing.md +1 -1
- package/gsd-core/workflows/verify-work.md +106 -21
- package/hooks/dist/gsd-agent-isolation-guard.js +77 -38
- package/hooks/dist/gsd-check-update-worker.js +19 -2
- package/hooks/dist/gsd-config-reload.js +18 -12
- package/hooks/dist/gsd-context-monitor.js +302 -22
- package/hooks/dist/gsd-cursor-post-tool.js +3 -1
- package/hooks/dist/gsd-cursor-pre-tool.js +3 -1
- package/hooks/dist/gsd-cursor-session-start.js +2 -1
- package/hooks/dist/gsd-cursor-stop.js +2 -1
- package/hooks/dist/gsd-cursor-subagent-start.js +28 -23
- package/hooks/dist/gsd-cursor-subagent-stop.js +3 -1
- package/hooks/dist/gsd-ensure-canonical-path.js +2 -1
- package/hooks/dist/gsd-graphify-update.sh +22 -18
- package/hooks/dist/gsd-node-runner.sh +77 -0
- package/hooks/dist/gsd-phase-boundary.sh +1 -0
- package/hooks/dist/gsd-prompt-guard.js +46 -12
- package/hooks/dist/gsd-read-guard.js +18 -7
- package/hooks/dist/gsd-read-injection-scanner.js +22 -13
- package/hooks/dist/gsd-secret-read-guard.js +1079 -0
- package/hooks/dist/gsd-session-state.sh +1 -0
- package/hooks/dist/gsd-statusline.js +222 -29
- package/hooks/dist/gsd-validate-commit.sh +523 -12
- package/hooks/dist/gsd-windsurf-pre-command.js +16 -11
- package/hooks/dist/gsd-windsurf-pre-write.js +22 -13
- package/hooks/dist/gsd-workflow-guard.js +36 -17
- package/hooks/dist/gsd-worktree-path-guard.js +36 -21
- package/hooks/dist/gsd-write-guard.js +35 -25
- package/hooks/dist/lib/cli-exit.js +560 -0
- package/hooks/dist/lib/exit-code-registry.js +98 -0
- package/hooks/dist/lib/git-cmd.js +210 -1
- package/hooks/dist/lib/git-probe.js +84 -0
- package/hooks/dist/lib/hook-exit.js +81 -0
- package/hooks/dist/lib/injection-patterns.js +36 -6
- package/hooks/dist/managed-hooks-registry.cjs +4 -0
- package/hooks/gsd-agent-isolation-guard.js +77 -38
- package/hooks/gsd-check-update-worker.js +19 -2
- package/hooks/gsd-config-reload.js +18 -12
- package/hooks/gsd-context-monitor.js +302 -22
- package/hooks/gsd-cursor-post-tool.js +3 -1
- package/hooks/gsd-cursor-pre-tool.js +3 -1
- package/hooks/gsd-cursor-session-start.js +2 -1
- package/hooks/gsd-cursor-stop.js +2 -1
- package/hooks/gsd-cursor-subagent-start.js +28 -23
- package/hooks/gsd-cursor-subagent-stop.js +3 -1
- package/hooks/gsd-ensure-canonical-path.js +2 -1
- package/hooks/gsd-graphify-update.sh +22 -18
- package/hooks/gsd-node-runner.sh +77 -0
- package/hooks/gsd-phase-boundary.sh +1 -0
- package/hooks/gsd-prompt-guard.js +46 -12
- package/hooks/gsd-read-guard.js +18 -7
- package/hooks/gsd-read-injection-scanner.js +22 -13
- package/hooks/gsd-secret-read-guard.js +1079 -0
- package/hooks/gsd-session-state.sh +1 -0
- package/hooks/gsd-statusline.js +222 -29
- package/hooks/gsd-validate-commit.sh +523 -12
- package/hooks/gsd-windsurf-pre-command.js +16 -11
- package/hooks/gsd-windsurf-pre-write.js +22 -13
- package/hooks/gsd-workflow-guard.js +36 -17
- package/hooks/gsd-worktree-path-guard.js +36 -21
- package/hooks/gsd-write-guard.js +35 -25
- package/hooks/hooks.json +6 -0
- package/hooks/lib/cli-exit.js +560 -0
- package/hooks/lib/exit-code-registry.js +98 -0
- package/hooks/lib/git-cmd.js +210 -1
- package/hooks/lib/git-probe.js +84 -0
- package/hooks/lib/hook-exit.js +81 -0
- package/hooks/lib/injection-patterns.js +36 -6
- package/hooks/managed-hooks-registry.cjs +4 -0
- package/package.json +14 -9
- package/scripts/base64-scan.sh +74 -12
- package/scripts/build-hooks.js +12 -0
- package/scripts/check-glossary-refs.cjs +77 -15
- package/scripts/check-mutation-score-ratchet.cjs +156 -0
- package/scripts/ci-check-job-near-cap.cjs +49 -0
- package/scripts/ci-pr-mergeability.cjs +262 -0
- package/scripts/ci-test-scope.cjs +52 -12
- package/scripts/ci-timeout-report.cjs +230 -0
- package/scripts/docs-guard-registry.cjs +406 -0
- package/scripts/gen-capability-registry.cjs +8 -6
- package/scripts/gen-exit-code-docs.cjs +318 -0
- package/scripts/gen-exit-code-registry.cjs +891 -0
- package/scripts/gen-features.cjs +836 -0
- package/scripts/gen-hooks-cli-exit.cjs +239 -0
- package/scripts/gen-install-tree-fixtures.cjs +2 -2
- package/scripts/gen-loop-host-contract.cjs +189 -4
- package/scripts/gen-scripts-cli-exit.cjs +185 -0
- package/scripts/gen-state-md-docs.cjs +727 -0
- package/scripts/{test-failure-reasons.cjs → gsd-test-gate-reasons.cjs} +6 -0
- package/scripts/lib/ci-job-timing.cjs +72 -0
- package/scripts/lib/cli-exit.cjs +546 -44
- package/scripts/lib/drift-scan.cjs +32 -2
- package/scripts/lib/exit-code-registry.cjs +98 -0
- package/scripts/lib/ndjson-reporter.cjs +119 -0
- package/scripts/lib/shellcheck-fetch.cjs +247 -0
- package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -6
- package/scripts/lint-allow-test-rule-refs.effective-ceiling.json +1 -1
- package/scripts/lint-allow-test-rule-refs.unverified-ceiling.json +1 -1
- package/scripts/lint-docs-guard-registration.cjs +495 -0
- package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +198 -0
- package/scripts/lint-eslint-glob-coverage.allowlist.json +4 -0
- package/scripts/{lint-fix-has-regression-test.cjs → lint-fix-has-regression-tests.cjs} +12 -6
- package/scripts/lint-health-diagnostic-rule-table.cjs +65 -8
- package/scripts/lint-mutation-test-derivation-drift.cjs +86 -0
- package/scripts/lint-phase-enumeration-drift.cjs +45 -14
- package/scripts/lint-phase-id-drift.cjs +133 -8
- package/scripts/lint-planning-prompt-drift.cjs +38 -1
- package/scripts/lint-portable-grep.cjs +176 -0
- package/scripts/lint-removed-but-needed.cjs +184 -16
- package/scripts/lint-response-language-coverage.cjs +524 -0
- package/scripts/lint-seam-enforcement.cjs +182 -0
- package/scripts/lint-slug-derivation-drift.cjs +921 -0
- package/scripts/lint-source-test-name-collision.cjs +241 -0
- package/scripts/lint-state-write-path-drift.cjs +337 -432
- package/scripts/lint-test-file-count.allowlist.json +124 -4
- package/scripts/lint-test-file-count.cjs +25 -3
- package/scripts/lint-unreachable-guard-drift.cjs +51 -64
- package/scripts/lint-vendored-deps.cjs +208 -35
- package/scripts/lint-workflow-shellcheck-baseline.json +1027 -0
- package/scripts/lint-workflow-shellcheck.cjs +614 -0
- package/scripts/mutation-matrix.cjs +599 -50
- package/scripts/npm-audit-baseline.cjs +376 -0
- package/scripts/prompt-injection-scan.sh +83 -14
- package/scripts/require-issue-link-policy.cjs +16 -1
- package/scripts/secret-scan.sh +75 -13
- package/scripts/select-docs-guards.cjs +56 -0
- package/scripts/sync-runtime-launcher.cjs +22 -3
- package/skills/gsd-discuss-phase/SKILL.md +1 -1
- package/skills/gsd-execute-phase/SKILL.md +1 -1
- package/skills/gsd-import/SKILL.md +1 -1
- package/skills/gsd-ns-workflow/SKILL.md +1 -0
- package/skills/gsd-phase/SKILL.md +1 -1
- package/skills/gsd-quick/SKILL.md +8 -4
- package/skills/gsd-quick-batch/SKILL.md +105 -0
- package/skills/gsd-surface/SKILL.md +18 -8
- package/vscode/package.json +1 -1
- package/bin/lib/ui-safety-gate.cjs +0 -109
- package/scripts/lint-emitted-drift-ack.cjs +0 -344
- package/scripts/state-write-path-drift-baseline.json +0 -19
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
**Step 6: Worktree create + executor dispatch**
|
|
2
|
+
|
|
3
|
+
This is the batch's MUTATING wave — worktree create/executor dispatch/merge
|
|
4
|
+
are the operations `isolation == "none"` caps to concurrency 1 (row 6),
|
|
5
|
+
unlike planning/research above.
|
|
6
|
+
|
|
7
|
+
**Auto-degrade on stale fork base (row 38, mirrors `/gsd:quick`'s own #1941
|
|
8
|
+
guard):**
|
|
9
|
+
```bash
|
|
10
|
+
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; elif _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and gsd_run is not on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; case "$(gsd_run runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') GSD_IDENTITY_STATUS=ok;; esac; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
|
|
11
|
+
if [ "$ISOLATION" = "harness-worktree" ] && [ "${USE_WORKTREES:-true}" != "false" ]; then
|
|
12
|
+
_QB_SHOULD_DEGRADE=$(gsd_run query worktree.base-check --mode "$ISOLATION" --pick shouldDegrade 2>/dev/null || true)
|
|
13
|
+
if [ "$_QB_SHOULD_DEGRADE" = "true" ]; then
|
|
14
|
+
echo "⚠ [#1941] Worktree fork base diverged — auto-degrading quick-batch to sequential mode." >&2
|
|
15
|
+
USE_WORKTREES=false
|
|
16
|
+
ISOLATION=none
|
|
17
|
+
fi
|
|
18
|
+
fi
|
|
19
|
+
gsd_run query dispatch-isolation --raw --force-isolation "$ISOLATION" >/dev/null 2>&1 || true
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Effective concurrency for this MUTATING wave** (`mutating` forces
|
|
23
|
+
`isolation == none` to 1 regardless of `--jobs`/capacity — row 6):
|
|
24
|
+
```bash
|
|
25
|
+
QB_EXEC_CONC_JSON=$(gsd_run quick-batch effective-concurrency --jobs "$JOBS" --task-count "$ITEM_COUNT" --capacity "$CAPACITY" --isolation "$ISOLATION" --mutating --raw)
|
|
26
|
+
EXEC_CONCURRENCY=$(printf '%s' "$QB_EXEC_CONC_JSON" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const j=JSON.parse(s);process.stdout.write(String(j.concurrency))}catch{process.stdout.write("1")}})')
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Dispatch rounds.** Repeat until no item is eligible-and-not-yet-dispatched
|
|
30
|
+
(bounded by `$ITEM_COUNT` rounds):
|
|
31
|
+
|
|
32
|
+
1. Re-derive eligibility (also reconciles crash-window/blocked-propagation —
|
|
33
|
+
safe to call repeatedly, idempotent when nothing changed):
|
|
34
|
+
```bash
|
|
35
|
+
QB_ELIG_JSON=$(gsd_run quick-batch resume --batch "$BATCH_ID" --raw)
|
|
36
|
+
```
|
|
37
|
+
Parse `eligible` (quick ids ready to execute — every dependency already
|
|
38
|
+
`complete`) and refresh `$BATCH_MANIFEST_JSON` from its `manifest`.
|
|
39
|
+
|
|
40
|
+
**Crash-window guard (mirrors `planner-wave.md`'s PLAN.md-existence
|
|
41
|
+
check one layer earlier — #3677):** `quick-batch resume`'s `eligible` is
|
|
42
|
+
purely status/dependency-derived; it does NOT know an item already
|
|
43
|
+
finished executing. A coordinator crash between this step returning
|
|
44
|
+
(executor committed, `SUMMARY.md` written) and Step 7's merge leaves
|
|
45
|
+
`BATCH.json` at `pending` with no STATE.md row yet (that row is written
|
|
46
|
+
only in Step 9) — so on `--resume`, such an item still comes back
|
|
47
|
+
`eligible` here. Before computing `spawn-plan`, determine which eligible
|
|
48
|
+
items already have `${item_dir}/${quick_id}-SUMMARY.md` on disk (same
|
|
49
|
+
`item_dir` derivation via `generate-slug` every other step uses), then
|
|
50
|
+
let the PURE `quick-batch filter-executed` verb
|
|
51
|
+
(`filterAlreadyExecuted`, `src/quick-batch-dispatch.cts`) decide which
|
|
52
|
+
ids are actually safe to spawn — never re-derive that split inline:
|
|
53
|
+
```bash
|
|
54
|
+
EXECUTED_IDS_JSON="[]" # JSON array of quick_ids whose SUMMARY.md already exists on disk this round
|
|
55
|
+
QB_FILTER_JSON=$(gsd_run quick-batch filter-executed --eligible "$ELIGIBLE_IDS_JSON" --executed "$EXECUTED_IDS_JSON" --raw)
|
|
56
|
+
```
|
|
57
|
+
Parse `spawnEligible` (safe to spawn this round) and `alreadyExecuted`
|
|
58
|
+
(diagnostic only — report these as "already executed, routing to merge"
|
|
59
|
+
rather than dispatching them). Replace `$ELIGIBLE_IDS_JSON` with
|
|
60
|
+
`spawnEligible` before continuing to backpressure below.
|
|
61
|
+
|
|
62
|
+
NEVER re-dispatch it into a second worktree for any id `filter-executed`
|
|
63
|
+
returns in `alreadyExecuted`. It is not lost: Step 7's own mergeable-wave
|
|
64
|
+
criterion
|
|
65
|
+
(`gsd-core/workflows/quick-batch/steps/merge-wave.md` Step 1) already
|
|
66
|
+
picks up any `pending` item with an on-disk `SUMMARY.md` that isn't yet
|
|
67
|
+
merged, independent of this eligible/spawn list — dropping it here only
|
|
68
|
+
prevents the duplicate dispatch, it does not remove it from the batch.
|
|
69
|
+
|
|
70
|
+
2. **Backpressure.** Not every eligible item necessarily spawns this round —
|
|
71
|
+
cap fan-out at `$EXEC_CONCURRENCY` minus current in-flight count (row
|
|
72
|
+
27/39):
|
|
73
|
+
```bash
|
|
74
|
+
QB_SPAWN_JSON=$(gsd_run quick-batch spawn-plan --eligible "$ELIGIBLE_IDS_JSON" --capacity "$EXEC_CONCURRENCY" --in-flight "$IN_FLIGHT_COUNT" --raw)
|
|
75
|
+
```
|
|
76
|
+
Parse `spawn` (dispatch these now) and `pending` (leave `pending` in
|
|
77
|
+
`BATCH.json` — already the case, no write needed; NEVER mark these
|
|
78
|
+
`failed`, NEVER increase fan-out to compensate).
|
|
79
|
+
|
|
80
|
+
3. **Create worktrees + dispatch executors, ONE AT A TIME per `spawn` item**
|
|
81
|
+
(`git worktree add` races on `.git/config.lock` — never simultaneous,
|
|
82
|
+
`execute-phase.md`'s own discipline):
|
|
83
|
+
|
|
84
|
+
For each item in `spawn`, in order:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
SLUG=$(gsd_run query generate-slug "$description" --raw)
|
|
88
|
+
ITEM_DIR="${quick_dir}/${quick_id}-${SLUG}"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**`isolation == "harness-worktree"`:** one `Agent()` per message,
|
|
92
|
+
`run_in_background: true`. Same prompt shape as `/gsd:quick`'s own
|
|
93
|
+
executor dispatch (Step 6 of `quick.md`) — required_reading, agent skills,
|
|
94
|
+
`<submodule_commit_guard>` using this project's `$SUBMODULE_PATHS`
|
|
95
|
+
(identical block, verbatim) — with these differences:
|
|
96
|
+
```
|
|
97
|
+
Agent(
|
|
98
|
+
prompt="
|
|
99
|
+
Execute quick-batch item ${quick_id}.
|
|
100
|
+
|
|
101
|
+
<required_reading>
|
|
102
|
+
- ${ITEM_DIR}/${quick_id}-PLAN.md (Plan)
|
|
103
|
+
- ${STATE_PATH} (Project state — READ ONLY, do not write it)
|
|
104
|
+
- ./CLAUDE.md or ./.claude/CLAUDE.md (if exists)
|
|
105
|
+
</required_reading>
|
|
106
|
+
|
|
107
|
+
${AGENT_SKILLS_EXECUTOR}
|
|
108
|
+
|
|
109
|
+
<submodule_commit_guard>
|
|
110
|
+
(same SUBMODULE_PATHS fail-loud guard as /gsd:quick — see gsd-core/workflows/quick.md Step 6)
|
|
111
|
+
</submodule_commit_guard>
|
|
112
|
+
|
|
113
|
+
<constraints>
|
|
114
|
+
- Execute all tasks in the plan; commit each task atomically
|
|
115
|
+
- Create summary at: ${ITEM_DIR}/${quick_id}-SUMMARY.md with `status: complete` in frontmatter
|
|
116
|
+
- NEVER invoke /gsd:quick or any other GSD command — you are a leaf, not a coordinator
|
|
117
|
+
- NEVER write .planning/quick-batches/${BATCH_ID}/BATCH.json
|
|
118
|
+
- Do NOT update STATE.md or ROADMAP.md — the orchestrator owns those writes after every item in this dispatch round completes (ADR-1239 single-writer invariant)
|
|
119
|
+
- Do NOT commit docs artifacts (SUMMARY.md, STATE.md, PLAN.md) — the orchestrator commits them at completion
|
|
120
|
+
</constraints>
|
|
121
|
+
",
|
|
122
|
+
subagent_type="gsd-executor",
|
|
123
|
+
model="{executor_model}",
|
|
124
|
+
{harnessFlag}
|
|
125
|
+
description="Execute ${quick_id}: ${description}"
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
Record `{agent_id, worktree_path, branch, expected_base, allowed_bases}`
|
|
129
|
+
from the executor's return into `$QUICK_BATCH_WORKTREE_MANIFEST` (a JSON
|
|
130
|
+
file, initialized `{"worktrees":[]}` before the first round — same shape
|
|
131
|
+
`/gsd:quick`'s own `QUICK_WORKTREE_MANIFEST` uses).
|
|
132
|
+
|
|
133
|
+
**`isolation == "orchestrator-worktree"`:** GSD creates the worktree
|
|
134
|
+
(`gsd_run query worktree.create --manifest "$QUICK_BATCH_WORKTREE_MANIFEST" --agent-id ... --path ... --branch ... --base ... --files "$PLAN_FILES" --deletions "$PLAN_DELETIONS"`) then
|
|
135
|
+
process-spawns the executor via `dispatch-isolation --json --cwd-target
|
|
136
|
+
--prompt`, exactly as `gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md`'s
|
|
137
|
+
"orchestrator-worktree" section
|
|
138
|
+
describes — reuse that mechanism verbatim, substituting this item's
|
|
139
|
+
`${quick_id}`/`${ITEM_DIR}`/`${quick_id}-PLAN.md` for its
|
|
140
|
+
`{plan_number}`/`{phase_dir}`/`{plan_file}` placeholders.
|
|
141
|
+
|
|
142
|
+
**`isolation == "none"`:** no worktree. Dispatch the executor inline on the
|
|
143
|
+
primary checkout (same prompt, minus the worktree-only framing), one item
|
|
144
|
+
at a time — `EXEC_CONCURRENCY` is already forced to 1 in this mode.
|
|
145
|
+
|
|
146
|
+
**Durable worktree-recovery persistence (#3677 — `harness-worktree`/
|
|
147
|
+
`orchestrator-worktree` only, skip for `none`):** immediately after
|
|
148
|
+
recording `{agent_id, worktree_path, branch, expected_base}` into the
|
|
149
|
+
EPHEMERAL `$QUICK_BATCH_WORKTREE_MANIFEST` above, ALSO persist the same
|
|
150
|
+
triple durably onto this item in `BATCH.json`:
|
|
151
|
+
```bash
|
|
152
|
+
gsd_run quick-batch update --batch "$BATCH_ID" --updates '[{"quickId":"'"$quick_id"'","dispatchedWorktree":"'"$worktree_path"'","dispatchedBranch":"'"$branch"'","dispatchedBase":"'"$expected_base"'"}]'
|
|
153
|
+
```
|
|
154
|
+
The ephemeral manifest is a per-process `mktemp` file (same shape
|
|
155
|
+
`/gsd:quick`'s own `QUICK_WORKTREE_MANIFEST` uses) — it does NOT survive
|
|
156
|
+
a coordinator crash/restart. A RESUMED coordinator's Step 7
|
|
157
|
+
(`merge-wave.md`) reads this durable BATCH.json triple as its fallback
|
|
158
|
+
for any item the crash-window guard above correctly did NOT re-dispatch
|
|
159
|
+
in the current process.
|
|
160
|
+
|
|
161
|
+
> **ORCHESTRATOR RULE — CODEX RUNTIME**: after each `Agent()` call above, wait for it to return before starting the next worktree create.
|
|
162
|
+
|
|
163
|
+
4. **After every item dispatched this round returns:** verify
|
|
164
|
+
`${ITEM_DIR}/${quick_id}-SUMMARY.md` exists. If missing, the item stays
|
|
165
|
+
`pending`/its worktree preserved for diagnosis rather than guessing
|
|
166
|
+
completion — do not proceed to merge for it this round.
|
|
167
|
+
|
|
168
|
+
Continue to Step 7 once every eligible item has been dispatched (across
|
|
169
|
+
however many rounds backpressure required) and returned.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
@~/.claude/gsd-core/references/response-language-directive.md
|
|
2
|
+
<purpose>
|
|
3
|
+
Batch several `/gsd:quick`-shaped tasks together (#3676, epic #3344, ADR-1239
|
|
4
|
+
"Quick-batch binding"). ONE coordinator (this workflow) owns every shared
|
|
5
|
+
write — `BATCH.json`, STATE.md, worktree create/merge/cleanup — and never
|
|
6
|
+
delegates them to a leaf. Leaves (planner/researcher/checker/executor/
|
|
7
|
+
verifier) return structured results only; they never invoke `/gsd:quick`,
|
|
8
|
+
never touch `BATCH.json`, and never write STATE.md/ROADMAP.md themselves
|
|
9
|
+
(single-writer invariant).
|
|
10
|
+
|
|
11
|
+
Dispatch decisions (effective concurrency, deterministic merge order, spawn
|
|
12
|
+
backpressure, failure/verification routing) are computed by the pure
|
|
13
|
+
`quick-batch-dispatch.cts` module (via the `quick-batch` CLI verbs) — this
|
|
14
|
+
workflow never re-derives that logic inline.
|
|
15
|
+
</purpose>
|
|
16
|
+
|
|
17
|
+
<required_reading>
|
|
18
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
19
|
+
</required_reading>
|
|
20
|
+
|
|
21
|
+
<available_agent_types>
|
|
22
|
+
Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
|
|
23
|
+
- gsd-phase-researcher — Researches technical approaches for an item
|
|
24
|
+
- gsd-planner — Creates a plan for one item (`quick-batch` mode)
|
|
25
|
+
- gsd-plan-checker — Reviews one item's plan before execution
|
|
26
|
+
- gsd-executor — Executes one item's plan, commits, creates SUMMARY.md
|
|
27
|
+
- gsd-verifier — Verifies one item's goal achievement
|
|
28
|
+
</available_agent_types>
|
|
29
|
+
|
|
30
|
+
<process>
|
|
31
|
+
**Step 1: Parse arguments, resolve mode**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; elif _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and gsd_run is not on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; case "$(gsd_run runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') GSD_IDENTITY_STATUS=ok;; esac; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
|
|
35
|
+
RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --raw --default "" 2>/dev/null || echo "")
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**If `response_language` is set:** all user-facing questions/prompts/explanations MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English.
|
|
39
|
+
|
|
40
|
+
Validate `$ARGUMENTS` through the CLI's own grammar — never re-derive it inline (single source of truth: `parseQuickBatchArgs`, `src/quick-batch-dispatch.cts`). `$ARGUMENTS` is raw, attacker-influenced task text — pass it as ONE quoted argument via `--text` so the shell never word-splits or glob-expands it; `quick-batch parse-args` does the whitespace split itself, in Node, after the shell is done:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
QB_PARSE_JSON=$(gsd_run quick-batch parse-args --raw --text "$ARGUMENTS")
|
|
44
|
+
QB_PARSE_RC=$?
|
|
45
|
+
if [ $QB_PARSE_RC -ne 0 ]; then
|
|
46
|
+
echo "$QB_PARSE_JSON" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
if [[ "$QB_PARSE_JSON" == @file:* ]]; then QB_PARSE_JSON=$(cat "${QB_PARSE_JSON#@file:}"); fi
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Parse `$QB_PARSE_JSON` for `jobs` (`"auto"` or an integer), `validate` (bool), `research` (bool), `resume` (batch id or null). Store as `$JOBS`, `$VALIDATE_MODE`, `$RESEARCH_MODE`, `$RESUME_BATCH_ID`.
|
|
53
|
+
|
|
54
|
+
Extract the raw task-list text / `--file <path>` from `$ARGUMENTS` (everything that is not `--jobs <v>`, `--validate`, `--research`, `--resume <id>`, or `--file <path>`'s own flag pair).
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
VALIDATE_PARAM=""; if [ "$VALIDATE_MODE" = true ]; then VALIDATE_PARAM="--validate"; fi
|
|
58
|
+
RESEARCH_PARAM=""; if [ "$RESEARCH_MODE" = true ]; then RESEARCH_PARAM="--research"; fi
|
|
59
|
+
INIT=$(gsd_run query init.quick-batch $VALIDATE_PARAM $RESEARCH_PARAM)
|
|
60
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
61
|
+
AGENT_SKILLS_PLANNER=$(gsd_run query agent-skills gsd-planner)
|
|
62
|
+
AGENT_SKILLS_EXECUTOR=$(gsd_run query agent-skills gsd-executor)
|
|
63
|
+
AGENT_SKILLS_CHECKER=$(gsd_run query agent-skills gsd-plan-checker)
|
|
64
|
+
AGENT_SKILLS_VERIFIER=$(gsd_run query agent-skills gsd-verifier)
|
|
65
|
+
AGENT_SKILLS_RESEARCHER=$(gsd_run query agent-skills gsd-phase-researcher)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Parse `$INIT` for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `researcher_model`, `commit_docs`, `quick_dir`, `quick_batches_dir`, `roadmap_exists`, `planning_exists`.
|
|
69
|
+
|
|
70
|
+
<!-- #2517 model-omit-on-inherit -->
|
|
71
|
+
|
|
72
|
+
> **Model omission (#2517).** Every `Agent()` dispatch below (planner, researcher, plan-checker, executor, verifier) MUST omit the `model` parameter entirely when the value it would carry (`planner_model`, `checker_model`, `executor_model`, `verifier_model`, `researcher_model`) is `"inherit"` or empty. An empty value 404s on runtimes without native tier aliases — the default on non-Claude runtimes, where the installer writes `resolve_model_ids:"omit"`. Omitting it inherits the orchestrator's model. See @gsd-core/references/model-profile-resolution.md.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
STATE_PATH="${quick_dir%/quick}/STATE.md"
|
|
76
|
+
PROJECT_PATH="${quick_dir%/quick}/PROJECT.md"
|
|
77
|
+
USE_WORKTREES=$(gsd_run query config-get workflow.use_worktrees --raw 2>/dev/null || echo "true")
|
|
78
|
+
RUNTIME=$(gsd_run query config-get runtime --default claude --raw 2>/dev/null || echo "claude")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**If `roadmap_exists` is false:** Error — quick-batch requires an active project with ROADMAP.md. Run `/gsd:new-project` first.
|
|
82
|
+
|
|
83
|
+
If the project uses git submodules, parse `SUBMODULE_PATHS` from `.gitmodules` exactly as `/gsd:quick` does (a fail-loud commit-time guard, applied per item at commit time — see `gsd-core/workflows/quick.md` Step 2 for the identical block, reused verbatim below):
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
if [ -f .gitmodules ]; then
|
|
87
|
+
SUBMODULE_PATHS=$(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null | awk '{print $2}')
|
|
88
|
+
else
|
|
89
|
+
SUBMODULE_PATHS=""
|
|
90
|
+
fi
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Resolve capacity now (#3676 design row 3-4).** `--jobs auto`/omitted uses this
|
|
94
|
+
value alone; `--jobs N` is capped by it (`min(taskCount, N, capacity)` — the
|
|
95
|
+
`quick-batch effective-concurrency` verb, called per-wave below, does the
|
|
96
|
+
arithmetic; this is only the raw resolve):
|
|
97
|
+
```bash
|
|
98
|
+
CAPACITY=$(gsd_run query dispatch-capacity --raw 2>/dev/null || echo 1)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Resolve isolation now (row 6, 20-22).** Read
|
|
102
|
+
@gsd-core/references/dispatch-isolation-gate.md and run its `Resolve
|
|
103
|
+
ISOLATION`, `Single-agent dispatch sites`, and `Resolve the harness flag`
|
|
104
|
+
blocks in order; they set `ISOLATION`/`HARNESS_FLAG` via `query
|
|
105
|
+
dispatch-isolation`. `ISOLATION` gates every worktree decision below —
|
|
106
|
+
substitute `{harnessFlag}` in Step 6's `Agent()` with `$HARNESS_FLAG`+comma
|
|
107
|
+
when `ISOLATION = "harness-worktree"`, else empty.
|
|
108
|
+
|
|
109
|
+
If `USE_WORKTREES` is not `"false"`, sweep orphaned worktrees before dispatching anything (mirrors `/gsd:quick`'s own startup sweep):
|
|
110
|
+
```bash
|
|
111
|
+
if [ "$USE_WORKTREES" != "false" ]; then
|
|
112
|
+
gsd_run query worktree.reap-orphans 2>/dev/null || true
|
|
113
|
+
fi
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Display banner:
|
|
117
|
+
```
|
|
118
|
+
### GSD ► QUICK BATCH
|
|
119
|
+
◆ jobs=${JOBS} validate=${VALIDATE_MODE} research=${RESEARCH_MODE}${RESUME_BATCH_ID:+ resume=${RESUME_BATCH_ID}}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
**Step 2: Resume or create**
|
|
125
|
+
|
|
126
|
+
If `$RESUME_BATCH_ID` is set: read and execute `gsd-core/workflows/quick-batch/steps/resume-mode.md`.
|
|
127
|
+
It loads the batch via `quick-batch
|
|
128
|
+
resume`, refuses closed on an unknown batch id or a diverged base revision,
|
|
129
|
+
and sets `$BATCH_ID`/`$BATCH_MANIFEST_JSON` for the steps below. Task-list
|
|
130
|
+
parsing and `quick-batch create` are skipped entirely.
|
|
131
|
+
|
|
132
|
+
Otherwise: read and execute `gsd-core/workflows/quick-batch/steps/batch-init.md`.
|
|
133
|
+
It parses the task list (inline or `--file`) and creates the
|
|
134
|
+
batch via `quick-batch create`, setting the same `$BATCH_ID`/
|
|
135
|
+
`$BATCH_MANIFEST_JSON` pair.
|
|
136
|
+
|
|
137
|
+
Either path converges on the same post-condition — continue to Step 3.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
<!-- gsd:section id="research-phase" when="flag:--research" -->
|
|
142
|
+
If `section_manifest` is `null` or `"research-phase"` is in its `included` list: read and execute `gsd-core/workflows/quick-batch/steps/research-phase.md`. Otherwise skip — do not read the file.
|
|
143
|
+
<!-- /gsd:section -->
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
**Step 4: Per-DAG-layer planning**
|
|
148
|
+
|
|
149
|
+
Read and execute `gsd-core/workflows/quick-batch/steps/planner-wave.md`. It
|
|
150
|
+
dispatches a planner per eligible item (one `Agent()` per message, full task
|
|
151
|
+
catalog in every prompt), persists parsed `depends_on`/`files_modified` via
|
|
152
|
+
`quick-batch update` after each layer, and — when `$VALIDATE_MODE` — runs the
|
|
153
|
+
per-item plan-checker loop (`gsd-core/workflows/quick-batch/steps/plan-checker-loop.md`)
|
|
154
|
+
before advancing to the next layer.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**Step 6: Worktree create + executor dispatch**
|
|
159
|
+
|
|
160
|
+
Read and execute `gsd-core/workflows/quick-batch/steps/worktree-dispatch.md`.
|
|
161
|
+
Worktree create/executor dispatch is serialized per item (one `git worktree
|
|
162
|
+
add` in flight at a time); already-created worktrees run concurrently up to
|
|
163
|
+
the effective MUTATING-wave concurrency.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
**Step 7: Deterministic merge**
|
|
168
|
+
|
|
169
|
+
Read and execute `gsd-core/workflows/quick-batch/steps/merge-wave.md`. Merges
|
|
170
|
+
apply strictly in the wave's original dispatch order (`quick-batch
|
|
171
|
+
merge-eligible`), never completion order.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
<!-- gsd:section id="verification-wave" when="flag:--validate" -->
|
|
176
|
+
If `section_manifest` is `null` or `"verification-wave"` is in its `included` list: read and execute `gsd-core/workflows/quick-batch/steps/verification-wave.md`. Otherwise skip — do not read the file.
|
|
177
|
+
<!-- /gsd:section -->
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
**Step 9: Completion**
|
|
182
|
+
|
|
183
|
+
Read and execute `gsd-core/workflows/quick-batch/steps/completion.md`. Calls
|
|
184
|
+
`completeQuickItem` (via `quick-batch complete`) only for a genuinely
|
|
185
|
+
complete item, updates STATE.md, and prints the final batch report.
|
|
186
|
+
|
|
187
|
+
</process>
|
|
188
|
+
|
|
189
|
+
<success_criteria>
|
|
190
|
+
- [ ] `--discuss`/`--full` rejected with a usage error before any dispatch
|
|
191
|
+
- [ ] A malformed `--jobs` value rejected before any dispatch
|
|
192
|
+
- [ ] `--resume <batch-id>` skips task-list parsing, dispatches only eligible items
|
|
193
|
+
- [ ] Task list parsed (inline or `--file`, ≥2 items) and batch created otherwise
|
|
194
|
+
- [ ] Planner dispatched per eligible item per DAG layer, full task catalog in prompt, `depends_on`/`files_modified` requested ALWAYS
|
|
195
|
+
- [ ] (--research) Researcher dispatched per item before planning
|
|
196
|
+
- [ ] (--validate) Plan-checker loop runs per item after planning (≤2 iterations)
|
|
197
|
+
- [ ] Worktree create/merge/cleanup serialized; concurrent leaves inside already-created worktrees
|
|
198
|
+
- [ ] `isolation == none` forces a mutating wave's concurrency to 1; a research-only wave is unaffected
|
|
199
|
+
- [ ] Merges apply in deterministic wave order, never completion order
|
|
200
|
+
- [ ] (--validate) Verifier dispatched per item post-merge; `human_needed` never completes the item, `gaps_found` fails it without rollback or retry
|
|
201
|
+
- [ ] A merge_failed/scope_violation item is marked failed with the worktree PRESERVED
|
|
202
|
+
- [ ] `completeQuickItem` called only for genuinely complete items; STATE.md updated; artifacts committed
|
|
203
|
+
</success_criteria>
|
|
@@ -39,11 +39,11 @@ Parse `$ARGUMENTS` for:
|
|
|
39
39
|
After parsing, normalize: if `$DISCUSS_MODE` and `$RESEARCH_MODE` and `$VALIDATE_MODE` are all true, set `$FULL_MODE=true`. This ensures `--discuss --research --validate` is treated identically to `--full`.
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; if [ -f "$
|
|
43
|
-
RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --default "" 2>/dev/null || echo "")
|
|
42
|
+
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; elif _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and gsd_run is not on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; case "$(gsd_run runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') GSD_IDENTITY_STATUS=ok;; esac; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
|
|
43
|
+
RESPONSE_LANGUAGE=$(gsd_run query config-get response_language --raw --default "" 2>/dev/null || echo "")
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
**If `response_language` is set:** All user-facing questions, prompts, and explanations
|
|
46
|
+
**If `response_language` is set:** All user-facing output of this workflow — narration between tool calls, status updates, progress notes, findings, questions, prompts, and explanations — MUST be presented in `{response_language}`. Technical terms, code, file paths, and subagent prompts stay in English — only user-facing output is translated.
|
|
47
47
|
|
|
48
48
|
If `$DESCRIPTION` is empty after parsing, prompt user interactively:
|
|
49
49
|
|
|
@@ -65,63 +65,49 @@ Display banner based on active flags:
|
|
|
65
65
|
|
|
66
66
|
If `$FULL_MODE` (all phases enabled — `--full` or all granular flags):
|
|
67
67
|
```
|
|
68
|
-
|
|
69
|
-
GSD ► QUICK TASK (FULL)
|
|
70
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
### GSD ► QUICK TASK (FULL)
|
|
71
69
|
|
|
72
70
|
◆ Discussion + research + plan checking + verification enabled
|
|
73
71
|
```
|
|
74
72
|
|
|
75
73
|
If `$DISCUSS_MODE` and `$VALIDATE_MODE` (no research):
|
|
76
74
|
```
|
|
77
|
-
|
|
78
|
-
GSD ► QUICK TASK (DISCUSS + VALIDATE)
|
|
79
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
75
|
+
### GSD ► QUICK TASK (DISCUSS + VALIDATE)
|
|
80
76
|
|
|
81
77
|
◆ Discussion + plan checking + verification enabled
|
|
82
78
|
```
|
|
83
79
|
|
|
84
80
|
If `$DISCUSS_MODE` and `$RESEARCH_MODE` (no validate):
|
|
85
81
|
```
|
|
86
|
-
|
|
87
|
-
GSD ► QUICK TASK (DISCUSS + RESEARCH)
|
|
88
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
### GSD ► QUICK TASK (DISCUSS + RESEARCH)
|
|
89
83
|
|
|
90
84
|
◆ Discussion + research enabled
|
|
91
85
|
```
|
|
92
86
|
|
|
93
87
|
If `$RESEARCH_MODE` and `$VALIDATE_MODE` (no discuss):
|
|
94
88
|
```
|
|
95
|
-
|
|
96
|
-
GSD ► QUICK TASK (RESEARCH + VALIDATE)
|
|
97
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
89
|
+
### GSD ► QUICK TASK (RESEARCH + VALIDATE)
|
|
98
90
|
|
|
99
91
|
◆ Research + plan checking + verification enabled
|
|
100
92
|
```
|
|
101
93
|
|
|
102
94
|
If `$DISCUSS_MODE` only:
|
|
103
95
|
```
|
|
104
|
-
|
|
105
|
-
GSD ► QUICK TASK (DISCUSS)
|
|
106
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
96
|
+
### GSD ► QUICK TASK (DISCUSS)
|
|
107
97
|
|
|
108
98
|
◆ Discussion phase enabled — surfacing gray areas before planning
|
|
109
99
|
```
|
|
110
100
|
|
|
111
101
|
If `$RESEARCH_MODE` only:
|
|
112
102
|
```
|
|
113
|
-
|
|
114
|
-
GSD ► QUICK TASK (RESEARCH)
|
|
115
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
|
+
### GSD ► QUICK TASK (RESEARCH)
|
|
116
104
|
|
|
117
105
|
◆ Research phase enabled — investigating approaches before planning
|
|
118
106
|
```
|
|
119
107
|
|
|
120
108
|
If `$VALIDATE_MODE` only:
|
|
121
109
|
```
|
|
122
|
-
|
|
123
|
-
GSD ► QUICK TASK (VALIDATE)
|
|
124
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
110
|
+
### GSD ► QUICK TASK (VALIDATE)
|
|
125
111
|
|
|
126
112
|
◆ Plan checking + verification enabled
|
|
127
113
|
```
|
|
@@ -141,9 +127,10 @@ AGENT_SKILLS_PLANNER=$(gsd_run query agent-skills gsd-planner)
|
|
|
141
127
|
AGENT_SKILLS_EXECUTOR=$(gsd_run query agent-skills gsd-executor)
|
|
142
128
|
AGENT_SKILLS_CHECKER=$(gsd_run query agent-skills gsd-plan-checker)
|
|
143
129
|
AGENT_SKILLS_VERIFIER=$(gsd_run query agent-skills gsd-verifier)
|
|
130
|
+
AGENT_SKILLS_RESEARCHER=$(gsd_run query agent-skills gsd-phase-researcher)
|
|
144
131
|
```
|
|
145
132
|
|
|
146
|
-
Parse JSON for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `reviewer_model`, `commit_docs`, `branch_name`, `quick_id`, `slug`, `date`, `timestamp`, `quick_dir`, `task_dir`, `roadmap_exists`, `planning_exists`, `response_language`.
|
|
133
|
+
Parse JSON for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `reviewer_model`, `researcher_model`, `commit_docs`, `branch_name`, `quick_id`, `slug`, `date`, `timestamp`, `quick_dir`, `task_dir`, `roadmap_exists`, `planning_exists`, `response_language`.
|
|
147
134
|
|
|
148
135
|
`init.quick` does not emit dedicated `state_path`/`project_path` fields, so derive them from the already-absolute `quick_dir` (#2376 — files handed to a spawned subagent must resolve regardless of that subagent's own cwd):
|
|
149
136
|
```bash
|
|
@@ -284,6 +271,8 @@ Store `$QUICK_DIR` for use in orchestration.
|
|
|
284
271
|
|
|
285
272
|
---
|
|
286
273
|
|
|
274
|
+
**Step 4 ordering (#3894):** Check whether `workflow.research_before_questions` is enabled in `.planning/config.json` (or the config from init context) — the same check `/gsd:discuss-phase` and `/gsd:new-project` already make. When **enabled**, execute the research-phase section BELOW BEFORE the discussion-phase section: a gray-area answer given without research is written to `<quick_id>-CONTEXT.md` as a locked decision downstream agents are told not to revisit, so the evidence must come first. When **false or unset**, keep the written order (discussion, then research) — behavior unchanged.
|
|
275
|
+
|
|
287
276
|
<!-- gsd:section id="discussion-phase" when="flag:--discuss" -->
|
|
288
277
|
If `section_manifest` is `null` or `"discussion-phase"` is in its `included` list: read and execute `gsd-core/workflows/quick/steps/discussion-phase.md`. Otherwise skip — do not read the file.
|
|
289
278
|
<!-- /gsd:section -->
|
|
@@ -298,6 +287,13 @@ If `section_manifest` is `null` or `"research-phase"` is in its `included` list:
|
|
|
298
287
|
|
|
299
288
|
**Step 5: Spawn planner (quick mode)**
|
|
300
289
|
|
|
290
|
+
**Capability gate:**
|
|
291
|
+
```bash
|
|
292
|
+
PLAN_PRE_HOOKS_JSON=$(gsd_run loop render-hooks plan:pre --raw)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Contribution dispatch (#3778):** read `PLAN_PRE_HOOKS_JSON.activeHooks` directly in context. In registry order, inject only active entries with `kind == "contribution"` and `into == "planner"` into each Quick planner prompt below, using `fragment.inline` verbatim plus resolved `configValues`. Do not paste `rendered`. Empty, inactive, incompatible, or non-planner entries inject nothing and do not error. Reuse this snapshot for revisions; do not render again.
|
|
296
|
+
|
|
301
297
|
**If `$VALIDATE_MODE`:** Use `quick-full` mode with stricter constraints.
|
|
302
298
|
|
|
303
299
|
**If NOT `$VALIDATE_MODE`:** Use standard `quick` mode.
|
|
@@ -324,11 +320,14 @@ ${AGENT_SKILLS_PLANNER}
|
|
|
324
320
|
|
|
325
321
|
**Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
|
|
326
322
|
|
|
323
|
+
{For each active entry in `PLAN_PRE_HOOKS_JSON` where `kind == "contribution"` and `into == "planner"` (in array order): inject the entry's `fragment.inline` verbatim here, plus its resolved `configValues` when the entry carries them. If no active planner contributions exist, omit this block entirely.}
|
|
324
|
+
|
|
327
325
|
</planning_context>
|
|
328
326
|
|
|
329
327
|
<constraints>
|
|
330
328
|
- Create a SINGLE plan with 1-3 focused tasks
|
|
331
329
|
- Quick tasks should be atomic and self-contained
|
|
330
|
+
- MUTABLE-SCOPE AUTHORITY (#3786): when concrete edit or verification scope depends on mutable external state (a merge index, PR/base diffs, the working tree), authorize scope ONLY from a live observation made at planning time — for conflict resolution that is the fresh merge index via `git diff --name-only --diff-filter=U` — or keep `files`/`verify` CONDITIONAL on that observation. Historical STATE.md entries, recovery notes, and cached PR/base diff paths may guide investigation only; they are never edit or verification authority, and a plan must not enumerate them as authorized files "pending replacement".
|
|
332
331
|
${RESEARCH_MODE ? '- Research findings are available — use them to inform library/pattern choices' : '- No research phase'}
|
|
333
332
|
${VALIDATE_MODE ? '- Target ~40% context usage (structured for verification)' : '- Target ~30% context usage (simple, focused)'}
|
|
334
333
|
${VALIDATE_MODE ? '- MUST generate `must_haves` in plan frontmatter (truths, artifacts, key_links)' : ''}
|
|
@@ -381,9 +380,9 @@ immediately before capturing `EXPECTED_BASE` so it reflects the most current loc
|
|
|
381
380
|
|
|
382
381
|
```bash
|
|
383
382
|
if [ "$ISOLATION" = "harness-worktree" ] && [ "${USE_WORKTREES:-true}" != "false" ]; then
|
|
384
|
-
_QUICK_SHOULD_DEGRADE=$(gsd_run query worktree.base-check --pick shouldDegrade 2>/dev/null || true)
|
|
383
|
+
_QUICK_SHOULD_DEGRADE=$(gsd_run query worktree.base-check --mode "$ISOLATION" --pick shouldDegrade 2>/dev/null || true)
|
|
385
384
|
if [ "$_QUICK_SHOULD_DEGRADE" = "true" ]; then
|
|
386
|
-
_QUICK_DEGRADE_MSG=$(gsd_run query worktree.base-check --pick message 2>/dev/null || true)
|
|
385
|
+
_QUICK_DEGRADE_MSG=$(gsd_run query worktree.base-check --mode "$ISOLATION" --pick message 2>/dev/null || true)
|
|
387
386
|
[ -n "$_QUICK_DEGRADE_MSG" ] && printf '%s\n' "$_QUICK_DEGRADE_MSG" >&2
|
|
388
387
|
echo "⚠ [#1941] Worktree fork base diverged from orchestrator HEAD — auto-degrading to sequential mode for this quick task to avoid a base-mismatch halt." >&2
|
|
389
388
|
USE_WORKTREES=false
|
|
@@ -549,9 +548,11 @@ Skip this step entirely if `$FULL_MODE` is false.
|
|
|
549
548
|
EXECUTE_POST_HOOKS_JSON=$(gsd_run loop render-hooks execute:post --raw)
|
|
550
549
|
```
|
|
551
550
|
|
|
551
|
+
**Generic step dispatch (#3606):** dispatch every `kind == "step"` hook from `EXECUTE_POST_HOOKS_JSON` per @gsd-core/references/loop-hook-dispatch.md (skip silently when none); each step is advisory and best-effort. The code-review specialization below is one such hook, not a replacement for the generic dispatch.
|
|
552
|
+
|
|
552
553
|
Resolve active step hooks from `EXECUTE_POST_HOOKS_JSON` where `kind == "step"` and `ref.skill == "code-review"`.
|
|
553
554
|
|
|
554
|
-
If no active code-review step hook exists, skip with message "Code review skipped (code-review capability inactive)".
|
|
555
|
+
If no active code-review step hook exists, skip with message "Code review skipped (code-review capability inactive)" — after dispatching any other active step hooks above — and proceed.
|
|
555
556
|
|
|
556
557
|
**Scope files from executor's commits:**
|
|
557
558
|
```bash
|
|
@@ -628,7 +629,7 @@ Insert after `### Blockers/Concerns` section:
|
|
|
628
629
|
|---|-------------|------|--------|-----------|
|
|
629
630
|
```
|
|
630
631
|
|
|
631
|
-
**Note:** If the table already exists
|
|
632
|
+
**Note:** If the table already exists in a legacy (pre-registry) column format, first run `gsd_run quick-tasks-migrate` — the maintainer-decided repair path (#3730) that rewrites the table onto the canonical schema, losslessly bucketing unmapped columns into Description. It is a silent no-op when the table is already canonical or the section is absent, so running it before the first append of every quick task migrates exactly once and never prompts otherwise. After migration, use the canonical column format below.
|
|
632
633
|
|
|
633
634
|
**7c. Append new row to table:**
|
|
634
635
|
|
|
@@ -644,7 +645,7 @@ Use `date` from init:
|
|
|
644
645
|
| ${quick_id} | ${DESCRIPTION} | ${date} | ${commit_hash} | [${quick_id}-${slug}](./quick/${quick_id}-${slug}/) |
|
|
645
646
|
```
|
|
646
647
|
|
|
647
|
-
For a schema-safe append outside this workflow (e.g. from fast.md), `gsd_run quick-tasks-append --task <text>` performs
|
|
648
|
+
For a schema-safe append outside this workflow (e.g. from fast.md, which has neither a quick id nor a task directory), `gsd_run quick-tasks-append --task <text>` performs an equivalent-shape write via the shared, schema-backed `appendQuickTaskRow` helper (#2133, ADR-2143 §3/§7) — the `#` cell is a positional ordinal and `Directory` reads `—`, since no id/directory was supplied. A caller that DOES have a real `${quick_id}` and task directory can pass `--quick-id <id> --slug <slug>` (or `--directory <link>` directly) to get the byte-identical row this step renders above (#3356).
|
|
648
649
|
|
|
649
650
|
**7d. Update "Last activity" line:**
|
|
650
651
|
|
|
@@ -659,7 +660,7 @@ Use Edit tool to make these changes atomically
|
|
|
659
660
|
|
|
660
661
|
**Step 8: Final commit and completion**
|
|
661
662
|
|
|
662
|
-
Stage and commit quick task artifacts. This step MUST always run — even if the executor already committed some files (e.g. when running without worktree isolation). The `
|
|
663
|
+
Stage and commit quick task artifacts. This step MUST always run — even if the executor already committed some files (e.g. when running without worktree isolation). The `gsd_run query commit` command handles already-committed files gracefully.
|
|
663
664
|
|
|
664
665
|
Build file list:
|
|
665
666
|
- `${QUICK_DIR}/${quick_id}-PLAN.md`
|
|
@@ -674,7 +675,7 @@ Build file list:
|
|
|
674
675
|
# Explicitly stage all artifacts before commit — PLAN.md may be untracked
|
|
675
676
|
# if the executor ran without worktree isolation and committed docs early
|
|
676
677
|
# Filter .planning/ files from staging if commit_docs is disabled (#1783)
|
|
677
|
-
COMMIT_DOCS=$(gsd_run query config-get commit_docs 2>/dev/null || echo "true")
|
|
678
|
+
COMMIT_DOCS=$(gsd_run query config-get commit_docs --raw 2>/dev/null || echo "true")
|
|
678
679
|
if [ "$COMMIT_DOCS" = "false" ]; then
|
|
679
680
|
file_list_filtered=$(echo "${file_list}" | tr ' ' '\n' | grep -v '^\.planning/' | tr '\n' ' ')
|
|
680
681
|
git add ${file_list_filtered} 2>/dev/null
|