Commit Graph

11 Commits

Author SHA1 Message Date
Tom Boucher
2b31a8d3e1 feat: add workflow.skip_discuss setting to bypass discuss-phase in autonomous mode
When enabled, /gsd:autonomous chains directly from plan-phase to execute-phase,
skipping smart discuss. A minimal CONTEXT.md is auto-generated from the ROADMAP
phase goal so downstream agents have valid input. Manual /gsd:discuss-phase still
works regardless of the setting.

Changes:
- config.cjs: add workflow.skip_discuss to VALID_CONFIG_KEYS and hardcoded defaults (false)
- autonomous.md: check workflow.skip_discuss before smart_discuss, write minimal CONTEXT.md when skipping
- settings.md: add Skip Discuss toggle to interactive settings UI and global defaults
- config.test.cjs: 6 regression tests for the new config key

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:13:31 -04:00
Tom Boucher
3306a77a79 fix: prevent discuss-phase from ignoring workflow instructions (#1292)
The discuss-phase command file contained a 93-line detailed <process>
block that competed with the actual workflow file. The agent treated
this summary as complete instructions and never read the execution_context
files (discuss-phase.md, discuss-phase-assumptions.md, context.md template).

Root cause: Unlike execute-phase and plan-phase commands (which have short
2-line process blocks deferring to the workflow file), discuss-phase had
inline step-by-step instructions detailed enough to act on without reading
the referenced workflow files.

Changes:
- Replace discuss-phase command's <process> block with a short directive
  that forces reading the workflow file, matching execute-phase/plan-phase
  pattern
- Add MANDATORY instruction that execution_context files ARE the
  instructions, not optional reading
- Register workflow.research_before_questions and workflow.discuss_mode
  as valid config keys (were missing from VALID_CONFIG_KEYS)
- Fix config key mismatch: workflows referenced "research_questions"
  but documented key is "workflow.research_before_questions"
- Move research_before_questions from hooks section to workflow section
  in settings workflow
- Add research_before_questions default to config template and builder
- Add suggestion mapping for deprecated hooks.research_questions key
- Add 6 regression tests covering config keys and process block guard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 14:13:11 -04:00
Diego Mariño
a1852fef33 fix(tests): add USERPROFILE override for Windows HOME sandboxing
On Windows, os.homedir() reads USERPROFILE instead of HOME. The 6
tests using { HOME: tmpDir } to sandbox ~/.gsd/ lookups failed on
windows-latest because the child process still resolved homedir to
the real user profile.

Pass USERPROFILE alongside HOME in all sandboxed test calls.
2026-03-20 14:56:28 +01:00
Diego Mariño
fd2a80675a merge: resolve conflicts with upstream main
VALID_CONFIG_KEYS: merge our additions (workflow.auto_advance,
workflow.node_repair, workflow.node_repair_budget, hooks.context_warnings)
with upstream's additions (workflow.text_mode, git.quick_branch_template).

ensureConfigFile(): keep our refactored version that delegates to
buildNewProjectConfig({}) instead of upstream's duplicated logic.

buildNewProjectConfig(): add git.quick_branch_template: null and
workflow.text_mode: false to match upstream's new keys.

new-project.md: integrate upstream's Step 5.1 Sub-Repo Detection
after our commit block; drop upstream's duplicate Note (ours at
line 493 is more detailed).
2026-03-19 22:48:21 +01:00
Tom Boucher
0487151142 fix(workflows): add text_mode config for Claude Code remote session compatibility (#1214)
- Add workflow.text_mode config option (default: false) that replaces
  AskUserQuestion TUI menus with plain-text numbered lists
- Document --text flag and config-set workflow.text_mode true as the
  fix for /rc remote sessions where the Claude App cannot forward TUI
  menu selections
- Update discuss-phase.md with text mode parsing and answer_validation
  fallback documentation
- Add text_mode to loadConfig defaults and VALID_CONFIG_KEYS
- Add regression tests for config-set and loadConfig
2026-03-19 09:19:01 -04:00
Diego Mariño
a1207d5473 fix(tests): make HOME sandboxing opt-in to avoid breaking git-dependent tests
The global HOME override in runGsdTools broke tests in verify-health.test.cjs
on Ubuntu CI: git operations fail when HOME points to a tmpDir that lacks
the runner's .gitconfig.

- runGsdTools now accepts an optional third `env` parameter (default: {})
  merged on top of process.env — no behavior change for callers that omit it
- Pass { HOME: tmpDir } only in the 6 tests that need ~/.gsd/ isolation:
  brave_api_key detection, defaults.json merging (x2), and config-new-project
  tests that assert concrete default values (x3)
2026-03-18 23:10:56 +01:00
Diego Mariño
63f6424d1b fix(tests): sandbox HOME in runGsdTools to prevent flaky assertions
buildNewProjectConfig() merges ~/.gsd/defaults.json when present, so
tests asserting concrete config values (model_profile, commit_docs,
brave_search) would fail on machines with a personal defaults file.

- Pass HOME=cwd as env override in runGsdTools — child process resolves
  os.homedir() to the temp directory, which has no .gsd/ subtree
- Update three tests that previously wrote to the real ~/.gsd/ using
  fragile save/restore logic; they now write to tmpDir/.gsd/ instead,
  which is cleaned up automatically by afterEach
- Remove now-unused `os` import from config.test.cjs
2026-03-18 15:27:46 +01:00
Diego Mariño
f649543b20 feat: materialize full config on new-project initialization
Add `config-new-project` CLI command that writes a complete,
fully-materialized `.planning/config.json` with sane defaults
instead of the previous partial template (6-7 user-chosen keys
only). Unset keys are no longer silently resolved at read time —
every key GSD reads is written explicitly at project creation.

Previously, missing keys were resolved silently by loadConfig()
defaults, making the effective config non-discoverable. Now every
key that GSD reads is written explicitly at project creation.

- buildNewProjectConfig() — single source of truth for all
  defaults; merges hardcoded ← ~/.gsd/defaults.json ← user choices
- ensureConfigFile() refactored to reuse buildNewProjectConfig({})
  instead of duplicating default logic (~40 lines removed)
- new-project.md Steps 2a and 5 updated to call config-new-project
  instead of writing a hardcoded partial JSON template
- Test coverage for config.cjs: 78.96% → 93.81% statements,
  100% functions; adds config-set-model-profile test suite

FIXES:
- VALID_CONFIG_KEYS extended with workflow.auto_advance,
  workflow.node_repair, workflow.node_repair_budget,
  hooks.context_warnings — these keys had hardcoded defaults
  but were not settable via config-set
2026-03-18 14:58:58 +01:00
Frank
63823c2e8a fix: skip no-research nyquist artifact gating (closes #980) 2026-03-15 10:08:57 -06:00
Fana
c81b20eb04 fix: plan-phase Nyquist validation when research is disabled (#980) (#1002)
* fix: plan-phase Nyquist validation when research is disabled (#980)

plan-phase step 5.5 required Nyquist artifacts even when research was
disabled, creating an impossible state: no RESEARCH.md to extract
Validation Architecture from. Step 7.5 then told Claude to "disable
Nyquist in config" without specifying the exact key, causing Claude to
guess wrong keys that config-set silently accepted.

Three fixes:
- plan-phase step 5.5: skip when research_enabled is false
- plan-phase step 7.5: specify exact config-set command for disabling
- config-set: reject unknown keys with whitelist validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: update config-set tests for key whitelist validation

Tests that used arbitrary keys (some_number, some_string, a.b.c) now
use valid config keys to test the same coercion and nesting behavior.
Adds new test asserting unknown keys are rejected with error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:36:11 -06:00
Ethan Hurst
898b82dee0 fix(quick-1): remove MEDIUM severity test overfitting in config.test.cjs
- branching_strategy assertion changed from strictEqual 'none' to typeof string check
- plan_check and verifier assertions changed from strictEqual true to typeof boolean checks
- Add isolation comments to three tests that touch ~/.gsd/ on real filesystem
- Full test suite passes: 433 tests, all modules above 70% coverage
2026-02-26 05:49:31 +10:00