Commit graph

929 commits

Author SHA1 Message Date
Ryan Harrington
f87b4938ca fix/gsd-bg-shell-stale-cwd: normalize bg-shell worktree cwd detection 2026-03-16 17:02:58 -04:00
Ryan Harrington
8b8ba0d207 fix/gsd-bg-shell-stale-cwd: resync bg-shell cwd after auto-worktree exit 2026-03-16 16:45:21 -04:00
TÂCHES
a5cf0f88b1 Merge pull request #696 from trek-e/fix/695-stray-worktree-detection
fix: validate auto-worktree is a real git worktree before use (#695)
2026-03-16 14:29:40 -06:00
TÂCHES
f73b17f55b Merge pull request #694 from gsd-build/fix/pr-673-security-fixes
fix: command injection and path traversal in PR #673
2026-03-16 14:29:19 -06:00
TÂCHES
966e5e80fb Merge pull request #673 from jeremymcs/feat/v2.20-phase2-3-features
feat: v2.20 Phase 2-4 — skills, integrations, MCP server
2026-03-16 14:29:07 -06:00
TÂCHES
b1b8a1f782 Merge pull request #693 from trek-e/fix/692-mcp-json-project-root
fix: discover MCP servers from project-root .mcp.json (#692)
2026-03-16 14:28:30 -06:00
Tom Boucher
e9a2928ce7 fix: validate auto-worktree is a real git worktree before use (#695)
getAutoWorktreePath() only checked existsSync() on the worktree
directory, treating any directory under .gsd/worktrees/<MID>/ as a
valid auto-worktree. A stray (non-git) directory would be accepted,
causing auto-mode to derive state from an empty/invalid path and
conclude no milestones exist.

Add git worktree validation to both getAutoWorktreePath() and
enterAutoWorktree(): check that the directory contains a .git file
(not directory) with a 'gitdir:' pointer, which is the hallmark of
a real git worktree checkout. Return null / throw if validation fails.

This ensures stray directories are ignored and auto-mode falls through
to normal worktree creation or root-state derivation.

Closes #695
2026-03-16 16:24:19 -04:00
TÂCHES
9838ef3781 Merge pull request #689 from jeremymcs/fix/visualizer-completedAt-date-coercion
fix: coerce completedAt to String in visualizer changelog sort
2026-03-16 14:18:09 -06:00
TÂCHES
e4d47de1f6 Merge pull request #690 from trek-e/fix/688-thinking-minimal-gpt5
fix: clamp 'minimal' thinking level to 'low' for gpt-5.x models (#688)
2026-03-16 14:17:51 -06:00
Tom Boucher
7b11faa150 fix: discover MCP servers from project-root .mcp.json (#692)
The mcporter extension only discovered servers that the mcporter CLI
itself knew about (via .vscode/mcp.json, Claude Desktop config, etc.).
Servers configured in the standard .mcp.json at the project root —
used by Claude Code, Cursor, and other AI coding tools — were invisible.

Changes:

1. mcporter extension (index.ts):
   - Add readProjectMcpJson() that reads .mcp.json from cwd and returns
     servers not already discovered by mcporter
   - Merge .mcp.json servers into getServerList() results
   - Add getMcpJsonServerUrl() to resolve HTTP URLs for .mcp.json servers
   - Update getServerDetail() to pass HTTP URLs directly to mcporter
     for servers only known via .mcp.json
   - Update mcp_call to use HTTP URL as server reference for .mcp.json
     servers

2. discover_configs scanner (scanners.ts):
   - Add .mcp.json to the project-level MCP config scan path alongside
     .claude/.mcp.json and .claude/mcp.json

Closes #692
2026-03-16 16:15:02 -04:00
Lex Christopherson
d87a4423b0 fix: eliminate command injection surface in diff-context, harden file-watcher path resolution
Use execFileSync with argument arrays instead of execSync with string
interpolation to prevent shell injection via sinceDays parameter.
Validate sinceDays as a positive integer. Replace string-based path
resolution in file-watcher with path.relative() to prevent traversal
via symlinks or .. segments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 14:10:29 -06:00
Tom Boucher
1a499aecb2 fix: clamp 'minimal' thinking level to 'low' for gpt-5.x models (#688)
gpt-5.x models (via Copilot/OpenAI/Azure) don't support 'minimal' as a
reasoning effort level — they only accept 'none', 'low', 'medium',
'high', and 'xhigh'. Setting /thinking minimal with gpt-5.4 causes a
400 error.

The openai-codex-responses provider already had this clamping, but the
openai-responses and azure-openai-responses providers passed the value
through unclamped.

Add clampReasoningForModel() to both providers that maps 'minimal' to
'low' for gpt-5.x models, matching the existing behavior in
openai-codex-responses.

Fixes the bug portion of #688
2026-03-16 16:02:54 -04:00
Jeremy McSpadden
a01df1f110 fix: coerce completedAt to String in visualizer changelog sort
YAML frontmatter parsers can return Date objects for ISO date strings
instead of plain strings. This caused a TypeError when calling
.localeCompare() on a Date object in the changelog sort.

Wrap completedAt with String() at both assignment and sort to handle
both native and JS parser paths safely.
2026-03-16 14:59:29 -05:00
TÂCHES
72223d0a7a Merge pull request #685 from gsd-build/fix/643-warp-unsupported-shortcuts
fix: add Warp to unsupported Ctrl+Alt shortcut list
2026-03-16 13:43:40 -06:00
Jeremy McSpadden
062b5c65eb fix: skip environment-dependent tests in CI
- Skip E2E --print test when no API key is configured (process hangs
  waiting for onboarding wizard input in non-TTY CI environments)
- Skip file-watcher extensions subdirectory test on Windows (chokidar
  subdirectory event delivery is unreliable in Windows CI runners)
2026-03-16 14:38:59 -05:00
Lex Christopherson
36345c12fc fix: add Warp terminal to unsupported Ctrl+Alt shortcut list
Warp terminal (both macOS and Windows) does not emit recognized escape
sequences for Ctrl+Alt key combos. This adds Warp to the unsupported
terminals list so users see the /gsd status fallback hint.

Closes #643

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 13:37:53 -06:00
Jeremy McSpadden
3690e7a8ca fix: stabilize file-watcher and E2E smoke tests for CI
- Increase file-watcher extension directory test delay to 1500ms with
  500ms settle time (Windows filesystem events are slower)
- Make E2E --print test more permissive on exit code 1: check for
  unhandled crash indicators instead of specific error messages
  (error text varies by CI environment)
2026-03-16 14:32:25 -05:00
TÂCHES
07effd64cc Merge pull request #471 from Jamie-BitFlight/feat/claude-import-skills-plugins
feat: import Claude marketplace plugins with namespaced components
2026-03-16 13:32:09 -06:00
TÂCHES
c03505dd69 Merge pull request #684 from trek-e/fix/677-plan-slice-executor-constraints
fix: provide executorContextConstraints to plan-slice template (#677)
2026-03-16 13:31:51 -06:00
TÂCHES
0ad5bebc33 Merge pull request #683 from trek-e/fix/681-fractional-slice-id
fix: support fractional slice IDs (e.g. S03.5) in roadmap parser (#681)
2026-03-16 13:31:10 -06:00
Tom Boucher
7b014e13fb fix: support fractional slice IDs (e.g. S03.5) in roadmap parser (#681)
The roadmap parser regex used (\w+) to capture slice/task IDs, which
only matches [a-zA-Z0-9_]. Fractional IDs like S03.5 (created by
/gsd steer) contain a dot, causing the parser to skip the entire line.

The dispatcher then jumps from S03 to S04, finds S04 blocked by
the unparsed S03.5, and gives up with 'earlier slice is not complete'.

Update the ID capture group to ([\w.]+) in both:
- roadmap-slices.ts (primary roadmap parser)
- files.ts (plan task parser, for consistency)

This allows dots in slice/task IDs while preserving all existing
behavior for standard IDs like S01, S02, T01, etc.

Closes #681
2026-03-16 15:25:58 -04:00
Jeremy McSpadden
4f8a4a76b3 fix: add compiled MCP server module for --mode mcp support
Create src/mcp-server.ts with dynamic imports to bypass TypeScript's
static module resolution for @modelcontextprotocol/sdk subpath exports
that use wildcard patterns (./*) without matching type declarations.
2026-03-16 14:24:32 -05:00
Tom Boucher
523debee6c fix: provide executorContextConstraints to plan-slice template (#677)
The plan-slice.md template declares {{executorContextConstraints}} but
buildPlanSlicePrompt() never passed this variable, causing loadPrompt()
to throw: 'template declares {{executorContextConstraints}} but no value
was provided.'

Add formatExecutorConstraints() that uses the budget engine
(computeBudgets + resolveExecutorContextWindow) to generate the
executor context constraints block with task count ranges and inline
context budgets based on the configured executor model's context window.

Pass the formatted string to loadPrompt() as executorContextConstraints.

Closes #677
2026-03-16 15:23:39 -04:00
TÂCHES
5a2d194f64 Merge pull request #678 from trek-e/fix/654-worktree-state-sync
fix: sync worktree .gsd/ state to project root after each unit (#654)
2026-03-16 13:21:51 -06:00
TÂCHES
0112a0f390 Merge pull request #680 from trek-e/fix/658-warp-cursor-visibility
fix: auto-enable hardware cursor in Warp terminal (#658)
2026-03-16 13:20:37 -06:00
TÂCHES
36d5ad7a0e Merge pull request #679 from trek-e/fix/455-tui-scrollback-disruption
fix: remove CSI 3J scrollback clear from TUI full redraws (#455)
2026-03-16 13:20:13 -06:00
TÂCHES
d66679e6ad Merge pull request #675 from deseltrus/fix/worktree-edge-cases
fix: worktree edge cases (resolveGitDir, captureIntegrationBranch, doctor)
2026-03-16 13:19:52 -06:00
Tom Boucher
bdbd3579c9 fix: sync worktree state to project root after each unit (#654)
When auto-mode runs in a worktree, .gsd/ metadata (STATE.md, roadmap
checkboxes, slice plans, task summaries) only updates inside the
worktree directory. The project root on main retains stale state.

If auto-mode restarts, startAutoMode() calls deriveState(projectRoot)
which reads the stale .gsd/ from main, sees completed units as
incomplete, and re-dispatches them — causing an infinite loop on
already-finished work.

Add syncStateToProjectRoot() that copies STATE.md and the active
milestone directory from worktree → project root after each unit's
rebuildState + autoCommit. This ensures deriveState(projectRoot) on
restart reads current completion state.

The sync is fully non-fatal (try/catch wrapped). Failure falls back
to existing behavior. Uses cpSync with recursive:true for the
milestone directory tree.
2026-03-16 15:13:24 -04:00
deseltrus
35f63f050a fix: derive initial state from worktree when one exists (#654)
When auto-mode restarts after being stopped, the initial deriveState()
reads from the project root which has stale .gsd/ metadata. Completed
units appear incomplete, causing re-dispatch of finished work.

The auto-worktree (if it exists from the previous run) has the current
state. After the initial deriveState(base), check if an auto-worktree
exists for the active milestone and re-derive from there.

This is safe because:
- Only triggers when worktree isolation is enabled
- Only when not already inside a worktree
- Only when an auto-worktree actually exists for the milestone
- The worktree setup at lines 976+ still runs normally after

Fixes #654

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 20:13:16 +01:00
deseltrus
25eab8f368 test: fix worktree-bugfix tests for CI (git config + Windows compat)
Use separate git commands instead of && chains (fails on Windows).
Configure git user.name/email before commit (not set in CI runners).
Mirrors the pattern from worktree-e2e.test.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 20:13:02 +01:00
Tom Boucher
d862c43424 fix: auto-enable hardware cursor in Warp terminal (#658)
Warp terminal does not correctly re-render inverse video (\x1b[7m)
cursor indicators on arrow key movement, making the cursor appear
invisible when navigating with arrow keys.

Auto-detect Warp via TERM_PROGRAM=WarpTerminal and enable the hardware
cursor by default (same as PI_HARDWARE_CURSOR=1). The hardware cursor
is positioned correctly via CURSOR_MARKER and provides reliable visual
feedback in Warp.

Terminals that render inverse video correctly (iTerm2, Terminal.app)
are unaffected — they continue using the fake cursor by default.
2026-03-16 15:11:58 -04:00
TÂCHES
feccaf2998 Merge pull request #674 from trek-e/chore/docs-v2.20.0
docs: update documentation for v2.20.0 release
2026-03-16 13:11:50 -06:00
TÂCHES
2f1abf7aae Merge pull request #676 from adamdry/f-opt-out-of-worktrees
feat: add git.isolation "none" mode — no worktree, no milestone branch
2026-03-16 13:11:35 -06:00
Tom Boucher
0ced559044 fix: remove CSI 3J scrollback clear from TUI full redraws (#455)
During full redraws, the TUI emitted \x1b[3J (clear scrollback) before
\x1b[2J\x1b[H (clear screen + home). In terminals like Ubuntu Terminal
that honor CSI 3J, this destroyed the scrollback buffer and caused the
scrollbar/view position to jump to the top during phase transitions.

Replace with just \x1b[2J\x1b[H which clears the visible screen and
homes the cursor without touching scrollback history. This preserves
view continuity while still performing a clean redraw.
2026-03-16 15:11:11 -04:00
Adam Dry
bd8bc876ee docs: add "none" to isolation field in preferences-reference.md
PR #651 added preferences-reference.md which listed only "worktree" and
"branch" as isolation options. Updated to include "none" with description.
2026-03-16 19:02:41 +00:00
Adam Dry
6cf0df1bb2 ci: fail if .gsd/ directory is checked in 2026-03-16 19:02:32 +00:00
Adam Dry
6aaace9838 feat: add git.isolation "none" mode
Adds git.isolation: "none" so developers can use GSD's full planning/execution
methodology with all work happening directly on their current branch — no worktree,
no milestone branch, no merge step.

- Preference plumbing: "none" accepted/validated, getIsolationMode() helper
- Core bypass: all worktree/branch gates in auto.ts skip in none mode
- Peripheral: doctor skips worktree checks, system prompt omits worktree context
- Docs: git-strategy, configuration, auto-mode, troubleshooting, system prompt updated
- Tests: 11 new tests, 621/621 pass
2026-03-16 19:02:32 +00:00
deseltrus
57529d0c7f fix: worktree edge cases — resolveGitDir, captureIntegrationBranch guard, doctor path
Three fixes for git worktree usage:

1. Add resolveGitDir() that follows the gitdir: pointer in worktree
   .git files. Without this, any code looking for MERGE_HEAD,
   SQUASH_MSG, or rebase state checks the wrong path in worktrees.

2. Guard captureIntegrationBranch() with detectWorktreeName() — in a
   worktree the base branch is implicit (worktree/<name>), so writing
   it to META.json leaves stale metadata that persists after merge-back.

3. Use resolveGitDir() in doctor.ts for corrupt merge state detection.
   Previously hardcoded join(basePath, ".git") which misses worktrees.

Includes 7 regression tests covering all three fixes.

Relates to #654 (stale state from main branch instead of worktree)
Relates to #672 (parallel milestone orchestration)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 20:00:58 +01:00
Jeremy McSpadden
ce6e684899 fix: increase file-watcher test delay for CI stability 2026-03-16 14:00:47 -05:00
Jeremy McSpadden
084fb35c1e ci: trigger CI run after force push 2026-03-16 13:57:29 -05:00
Jeremy McSpadden
8d56ab2893 feat: add MCP server mode, /lint skill, E2E smoke tests
- Add native MCP server mode (--mode mcp): exposes GSD's tools via
  Model Context Protocol over stdin/stdout for Claude Desktop, VS Code,
  and other MCP-compatible clients. Uses @modelcontextprotocol/sdk.
- Add /lint skill: auto-detects ESLint, Biome, Prettier, rustfmt,
  gofmt, Black, Ruff and runs with structured output
- Add 6 E2E smoke tests: --version, --help, config --help, update
  --help, --list-models, and --mode text --print startup
- Fix diff-context.ts stdio type for CI compatibility
- Fix token-counter.ts tiktoken import for extensions typecheck
- Update help text and CLI to include --mode mcp
2026-03-16 13:56:31 -05:00
Lex Christopherson
b6b9f44758 2.21.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:54:52 -06:00
Lex Christopherson
7763e7d6b5 docs: update changelog for v2.21.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:54:40 -06:00
Tom Boucher
18a0abbfe3 docs: update documentation for v2.20.0 release
Update README and docs/ to cover new features and changes in v2.20.0:

- commands.md: Added /gsd quick, /gsd mode, /gsd help, /gsd skill-health,
  /gsd hooks, /gsd run-hook, gsd --debug flag. Reorganized into
  Session Commands, Configuration & Diagnostics, Git, and Session Management.
- skills.md: Added Skill Lifecycle Management section covering telemetry,
  health dashboard (/gsd skill-health), staleness detection, and heal-skill
  post-unit analysis.
- remote-questions.md: Added Telegram as a third channel alongside
  Slack and Discord, with setup instructions and bot requirements.
- configuration.md: Added skill_staleness_days preference.
- README.md: Added skill_staleness_days to key settings table, new
  Agent Instructions section, and Debug Mode section.
2026-03-16 14:50:36 -04:00
Lex Christopherson
c92b937305 docs: clear old files 2026-03-16 12:50:27 -06:00
Jeremy McSpadden
973b8992e5 feat: add GitHub API client, diff-aware context, tiktoken token counting
- Add GitHub API integration via @octokit/rest: createGitHubClient,
  getRepoInfo (parses HTTPS/SSH remotes), createPullRequest,
  getPullRequest, listPullRequestReviews, createIssueComment
- Add diff-aware context module: getRecentlyChangedFiles,
  getChangedFilesWithContext, rankFilesByRelevance — prioritizes
  recently-changed files for context window budget allocation
- Add accurate token counting via tiktoken: countTokens (async),
  countTokensSync, initTokenCounter — falls back to chars/4 heuristic
  when tiktoken is unavailable
- 27 new tests across 3 test files
2026-03-16 13:50:00 -05:00
Jeremy McSpadden
0b3163d297 feat: add /review skill, /test skill, chokidar file watcher, subcommand help
- Add /review skill: reviews staged/unstaged/commit changes for security,
  performance, bugs, and quality with structured findings by severity
- Add /test skill: auto-detects test framework, generates comprehensive
  tests for source files, or runs suites with failure analysis
- Add chokidar file watcher: watches ~/.gsd/agent/ for config changes
  (settings.json, auth.json, models.json, extensions/) with debounced
  events on an EventBus
- Add --help per subcommand: `gsd config --help` and `gsd update --help`
  show subcommand-specific usage information
- 8 new file-watcher tests (start/stop, event emission, debouncing,
  unrelated file filtering)
2026-03-16 13:47:25 -05:00
Jamie McGregor Nelson
d4cf95f204 fix: type errors in claude-import.ts and marketplace-discovery.ts 2026-03-16 14:46:31 -04:00
TÂCHES
a90aa0c8d6 Merge pull request #666 from jeremymcs/fix/v2.19.0-phase1-quick-wins
fix: v2.20 Phase 1+2 — bugs, security, performance, code quality
2026-03-16 12:44:17 -06:00
TÂCHES
0a43e6de4e Merge pull request #671 from gsd-build/fix/665-auto-resume-recovery
fix: auto-mode resume preserves context from paused session
2026-03-16 12:44:08 -06:00