Commit graph

642 commits

Author SHA1 Message Date
TÂCHES
dfc41e105d fix(gsd): clear all caches after discuss dispatch so picker sees new CONTEXT files (#981)
guided-flow.ts called only invalidateStateCache() after waitForIdle(),
leaving dirEntryCache stale. resolveSliceFile("CONTEXT") missed files
written during the discuss session, keeping the just-discussed slice
recommended and preventing the allDiscussed exit gate from firing.

Swap to invalidateAllCaches() at both call sites (discuss loop and
queue reorder), matching the pattern used throughout auto.ts.

Fixes #977

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:25:59 -06:00
Juan Francisco Lebrero
7868761ca0 feat: add 10 bundled skills for UI, quality, and code optimization (#999)
Add community-sourced skills covering:

Coding & Quality:
- code-optimizer: 13-domain parallel optimization audit
- react-best-practices: 57 React/Next.js performance rules (Vercel)
- best-practices: Web security, CSP, HTTPS, HTML validity

UI & Design:
- userinterface-wiki: 152 UI/UX rules (animations, springs, UX laws, typography)
- make-interfaces-feel-better: 16 practical polish principles

Testing & Audit:
- web-quality-audit: Lighthouse-style 150+ checks
- accessibility: WCAG guidelines and ARIA patterns
- core-web-vitals: LCP/CLS/INP deep dive
- web-design-guidelines: Vercel Web Interface Guidelines

Tooling:
- agent-browser: Browser automation CLI for testing and scraping
2026-03-17 17:23:39 -06:00
Jeremy McSpadden
642323a489 fix(auto): dispatch retry after verification gate failure (#998)
When the verification gate fails with retries remaining, handleAgentEnd
sets pendingVerificationRetry and deletes the completion key, but then
returns early without calling dispatchNextUnit. This leaves auto-mode
active but permanently stalled — no new unit is ever dispatched because
the dispatch chain is broken.

Fix: call dispatchNextUnit immediately after setting up the retry state,
with a fallback to the dispatch gap watchdog if dispatch throws.
2026-03-17 17:20:29 -06:00
Jeremy McSpadden
f85c41c693 feat(ux): group model list by provider in /gsd prefs wizard (#993)
* feat(ux): group model list by provider in /gsd prefs wizard

The model selection in configureModels() was a single flat alphabetical
list that became unwieldy with many providers. This groups models under
provider headers (e.g. "─── anthropic (24) ───") so users can quickly
scan to the right provider section.

Changes:
- ExtensionSelectorComponent: add SEPARATOR_PREFIX convention for
  non-selectable group headers. Navigation skips separators, Enter
  ignores them, and they render with borderAccent styling.
- configureModels: build grouped option list with provider headers
  instead of flat map.
- New test: extension-selector-separator.test.ts (6 tests).

* fix(ci): use node:test instead of vitest in extension-selector test

tsconfig.extensions.json does not include vitest type declarations,
causing TS2307 in CI. Rewrite test to use node:test + node:assert
to match the convention used by other extension tests.

* fix(ci): rewrite separator test to avoid TS parameter property issue

The extension-selector component transitively imports countdown-timer.ts
which uses TypeScript parameter properties (private tui: TUI). Node's
--experimental-strip-types cannot handle these, causing ERR_UNSUPPORTED_
TYPESCRIPT_SYNTAX in CI.

Rewrite the test to verify the separator detection logic and model
grouping contract without importing the component. Duplicates the
isSeparator/nextSelectable helpers and tests them directly.
2026-03-17 17:20:13 -06:00
Juan Francisco Lebrero
8df6f7b75a feat: add --answers flag for headless answer injection (#982)
Pre-supply answers and secrets for non-interactive headless runs via a
declarative JSON file. Two main use cases:

1. Provide secrets that today get lost in headless mode (secure_env_collect
   returns null in RPC mode). Secrets are injected as env vars into the
   RPC child process.
2. Override default auto-responses when the first option isn't desired.

Uses two-phase correlation: observe tool_execution_start events for
question metadata, then match extension_ui_request events by title to
look up pre-supplied answers. Out-of-order events are buffered with a
500ms timeout.

Coexists with --supervised: injector tries first, then supervised mode,
then auto-responder.
2026-03-17 17:19:55 -06:00
TÂCHES
f2838d326f fix: enforce GSDError usage and activate unused error codes (#997)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:14:07 -06:00
TÂCHES
196be59d71 fix: deduplicate tierLabel/tierOrdinal exports (#988)
* fix: deduplicate tierLabel and tierOrdinal exports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: update tierLabel test to accept re-export pattern

The test was checking source text for "export function tierLabel" which
doesn't match the re-export syntax "export { tierLabel } from ...".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:11:52 -06:00
TÂCHES
2687f97a6b fix: deduplicate getMainBranch implementations (#994)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:06:20 -06:00
TÂCHES
6b3572c858 fix: add error handling for unhandled promise rejections (#992)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:06:17 -06:00
TÂCHES
058f682f67 fix: deduplicate formatTokenCount into shared format-utils (#987)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:06:14 -06:00
TÂCHES
eded07a257 fix: add debug logging to silent catch blocks in auto.ts (#986)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:06:11 -06:00
TÂCHES
2bdcabfbfc fix: deduplicate formatDuration into shared format-utils (#989)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:06:06 -06:00
TÂCHES
8877e01083 refactor: add domain-grouped re-exports for preferences module (#996)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:05:54 -06:00
TÂCHES
2df7a2320b fix: remove dead github-client.ts (never imported) (#990)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:05:44 -06:00
TÂCHES
482bbf678b fix: deduplicate parseJSONL and unify MAX_JSONL_BYTES constant (#985)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:05:35 -06:00
TÂCHES
fbadd369f4 Merge pull request #976 from jeremymcs/feature/onboarding-detection-wizard
feat: project onboarding detection and init wizard
2026-03-17 16:52:16 -06:00
Jeremy McSpadden
a2a701b129 fix: inline bundled extension path parsing in subagent
The subagent extension imported parseBundledExtensionPaths via a
relative path (../../../bundled-extension-paths.js) that resolves
correctly in the source tree but breaks when extensions are synced
to ~/.gsd/agent/extensions/ at runtime. Inline the trivial split
logic so the extension is self-contained.
2026-03-17 17:45:48 -05:00
Jeremy McSpadden
d5161fddb9 feat: add project onboarding detection and init wizard
Replace the silent .gsd/ bootstrap with an interactive init wizard that
detects project state, offers v1 migration, and guides users through
per-project configuration before their first milestone.

New commands:
- /gsd init — project init wizard (detect, configure, bootstrap .gsd/)
- /gsd setup — global setup status and routing to existing config commands

Detection engine (detection.ts):
- detectProjectState() identifies none/v1-planning/v2-gsd/v2-gsd-empty
- detectProjectSignals() scans for language, monorepo, CI, tests, package manager
- Auto-detects verification commands from package.json, Cargo.toml, go.mod, etc.
- isFirstEverLaunch() / hasGlobalSetup() for global state checks

Init wizard (init-wizard.ts):
- 8-step wizard: git → mode → verification → git prefs → instructions → advanced → bootstrap
- Every step skippable with sensible defaults
- offerMigration() when .planning/ detected (migrate/fresh/cancel)
- handleReinit() for safe re-init on existing projects
- Writes preferences.md from wizard answers + seeds CONTEXT.md with detected signals

Smart entry integration (guided-flow.ts):
- showSmartEntry() now runs detection before any bootstrap
- v1 .planning/ → migration offer before anything else
- No .gsd/ → init wizard instead of silent bootstrap
- Existing .gsd/ → unchanged behavior (zero regression)
2026-03-17 17:31:52 -05:00
Lex Christopherson
c9c0c41983 fix(gsd): require grammatical narration in prompts 2026-03-17 16:26:23 -06:00
Lex Christopherson
8aa8e6c494 docs: document all preferences.md fields in reference and template
Add 9 missing fields to preferences-reference.md: skill_staleness_days,
git.manage_gitignore, dynamic_routing, auto_visualize, auto_report,
parallel, verification_commands, verification_auto_fix, and
verification_max_retries. Add examples for dynamic routing, parallel
execution, and verification. Update the preferences template to include
all fields from the schema.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:26:23 -06:00
TÂCHES
ecedbfe9df Merge pull request #967 from jeremymcs/feat/export-html-all
feat: add /gsd export --html --all for retrospective milestone reports
2026-03-17 16:25:42 -06:00
TÂCHES
7b2feb64e4 Merge pull request #969 from gsd-build/fix/duplicate-marketplace-test
fix: remove duplicate marketplace-discovery test
2026-03-17 16:23:27 -06:00
TÂCHES
23bc77fc56 Merge pull request #968 from gsd-build/fix/duplicate-bundled-extension-paths
fix: consolidate duplicate bundled-extension-paths.ts
2026-03-17 16:23:11 -06:00
TÂCHES
afeb6f5e3b Merge pull request #966 from gsd-build/fix/duplicate-mcp-server
fix: consolidate duplicate mcp-server.ts
2026-03-17 16:23:04 -06:00
Lex Christopherson
6114ede489 fix: remove duplicate marketplace-discovery test
Migrated unique resolvePluginRoot and inspectPlugin tests from the older
file into the comprehensive contract test file at src/tests/, then
deleted the duplicate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:18:45 -06:00
Lex Christopherson
12e65afd36 fix: consolidate duplicate bundled-extension-paths.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:17:53 -06:00
Jeremy McSpadden
c9f63f8e93 feat: add /gsd export --html --all for retrospective milestone reports
When --all is passed alongside --html, generates a report snapshot for
every milestone that doesn't already have one in the reports index.
This fills the progression timeline with cards for completed milestones
that were finished before the HTML report feature existed.

- Deduplicates against existing reports.json entries to avoid duplicates
- Tags completed milestones with kind "milestone", active with "manual"
- Tracks cumulative slice/milestone progress per snapshot for the index
- Adds --html and --html --all to export autocomplete suggestions
- Updates help text to show [--all] flag
2026-03-17 17:17:50 -05:00
Lex Christopherson
e50e6458b6 fix: consolidate duplicate mcp-server.ts
Remove the unused copy at src/resources/extensions/gsd/mcp-server.ts.
The canonical implementation lives at src/mcp-server.ts and is the only
one imported by cli.ts and tested by mcp-server.test.ts. The extension
copy had zero imports and was dead code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:17:39 -06:00
Jeremy McSpadden
add957ed31 feat: add /gsd update slash command for in-session self-update (#964)
The update banner already referenced `/gsd:update` but the command
didn't exist. This adds `/gsd update` as a proper subcommand that
checks the npm registry and runs `npm install -g gsd-pi@latest`
when a newer version is available.

- Register `update` in subcommand completions and help text
- Add `handleUpdate()` that reuses `compareSemver` from update-check
- Fix banner text from `/gsd:update` to `/gsd update` (space, not colon)
- Add tests for completion registration and help description
2026-03-17 16:13:02 -06:00
Juan Francisco Lebrero
99c3375f18 feat: add gsd headless query for instant state inspection (#951)
* feat: add `gsd headless query` for structured state inspection

Add read-only query commands that return parseable JSON without
spawning an LLM session. Decouples orchestrators from .gsd/ internals.

Targets: phase, cost, progress, next

* simplify: single `query` command returning full snapshot

Replace 4 query targets (phase/cost/progress/next) with one command
that returns everything in a single JSON object. Caller uses jq.

Also document query in README.md and docs/commands.md.

* docs: update gsd-headless skill and references

- SKILL.md: add missing flags (--supervised, --max-restarts, --response-timeout)
- references/commands.md: add query, discuss, remote, inspect, forensics
- references/multi-session.md: fix spawning syntax, use query for budget

* fix: remove integration tests that entered via merge

These files belong to the feat/headless-orchestration-skill branch
and were accidentally included during the upstream/main merge.
They contain TS errors (sessionTerminated scope issue) that break CI.

* fix: restore headless-command.ts deleted by accident
2026-03-17 16:03:59 -06:00
Jeremy McSpadden
0e0f47ef9f fix: failure recovery & resume safeguards (all 4 waves) (#956)
* fix: prevent data loss on crash with atomic writes, file locking, and error handling

Wave 1 of failure recovery safeguards:

1. Atomic session file rewrites (tmp+rename) — _rewriteFile() and forkFrom()
   now use atomicWriteFileSync to prevent session file corruption on crash
2. Atomic auto.lock writes — crash-recovery.ts writeLock() uses tmp+rename
   so the crash detection system itself can't be corrupted
3. unhandledRejection handler — catches silent process death from unhandled
   promise rejections in OAuth, extensions, LSP, or MCP connections
4. try/catch in emitToolCall — matches pattern used by emitUserBash,
   emitContext, and emitToolResult to prevent extension handler crashes
   from killing the entire agent turn
5. File locking on session appends — prevents concurrent pi instances from
   interleaving partial JSON lines in session JSONL files using the same
   proper-lockfile pattern established in auth-storage.ts and settings-manager.ts

* fix: add OAuth timeouts, RPC exit detection, and command context guards

Wave 2 of failure recovery safeguards:

1. OAuth fetch timeouts — all fetch() calls across all OAuth providers
   (Anthropic, OpenAI Codex, Google Antigravity, Google Gemini CLI,
   GitHub Copilot) now have 30-second AbortSignal.timeout() to prevent
   indefinite hangs when OAuth servers are unresponsive
2. RPC subprocess exit detection — pending requests are now rejected
   when the agent subprocess exits unexpectedly, preventing indefinite
   hangs in the RPC client
3. Extension command context guards — default handlers for newSession,
   fork, navigateTree, switchSession, and reload now throw explicit
   errors instead of silently returning success when called before
   bindCommandContext()
4. OAuth error detail preservation — token refresh errors now preserve
   the original error as `cause` for better diagnostics

* fix: resource cleanup, LSP retry, and crash detection on session resume

Wave 3 of failure recovery safeguards:

1. Atomic completed-units.json cleanup — milestone completion writes
   now use tmp+rename pattern for consistency with auto-recovery.ts
2. Bash temp file cleanup — track temp files created for large output
   and register a process exit handler to clean them up
3. Settings write queue flush on shutdown — call settingsManager.flush()
   during interactive mode shutdown so queued writes aren't lost
4. LSP initialization retry — wrap getOrCreateClient with up to 2 retries
   with exponential backoff (1s, 2s) for transient spawn failures
5. Crash detection on session resume — wasInterrupted() checks if last
   assistant turn had tool calls without results, shows warning on resume

* fix: blob garbage collection and LSP debug logging

Wave 4 of failure recovery safeguards:

1. Blob garbage collection — BlobStore.gc(referencedHashes) removes
   orphaned blobs not referenced by any session file, plus totalSize()
   for monitoring blob directory growth
2. LSP JSON parse error logging — malformed LSP messages are now logged
   at debug level (when DEBUG env is set) instead of being silently dropped
2026-03-17 16:03:49 -06:00
Tom Boucher
614012f38a fix: add git.manage_gitignore preference to opt out of .gitignore changes (#950) (#952)
When set to false in .gsd/preferences.md, GSD will not modify .gitignore
at all — no baseline patterns added, no self-healing, no untracking.

Usage in preferences.md:
  git:
    manage_gitignore: false

Files changed:
- git-service.ts: Add manage_gitignore to GitPreferences interface
- gitignore.ts: Early return when manageGitignore is false
- auto.ts: Pass manage_gitignore preference to ensureGitignore
- preferences.ts: Parse and validate manage_gitignore in git config
2026-03-17 15:27:34 -06:00
Tom Boucher
aa224b5944 fix: break web search loop with consecutive duplicate guard (#949) (#955)
When the LLM calls the same web search query 4+ times consecutively,
return an error telling it to stop and use existing results instead of
silently returning cached results that the LLM ignores.

Tracks consecutive duplicate searches via a simple counter keyed on
the normalized query + parameters. Resets when a different query is
searched. Threshold is 3 consecutive duplicates before the guard fires.

File changed: search-the-web/tool-search.ts
2026-03-17 15:27:18 -06:00
Tom Boucher
1b1df58749 refactor: encapsulate auto.ts state into AutoSession class (#898) (#948)
* refactor: encapsulate auto.ts state into AutoSession class (#898)

Follow-up to PR #906 (7 module extractions). All ~40 mutable module-level
variables in auto.ts are replaced with properties on a single AutoSession
class instance (s).

Changes:
- auto/session.ts: 200-line AutoSession class with typed properties,
  clearTimers(), resetDispatchCounters(), completeCurrentUnit(), reset(),
  and toJSON() for diagnostics.
- auto.ts: ~700 variable references renamed from bare names to s.xxx.
  All module-level let/const state declarations removed. Constants
  (MAX_UNIT_DISPATCHES, etc.) re-exported from session.ts.
- Tests updated: milestone-transition-worktree.test.ts and
  triage-dispatch.test.ts source-grep patterns updated for s.xxx names.

Benefits:
- 40 scattered declarations → 1 class with typed properties
- Manual reset of 25+ variables in stopAuto → s.reset()
- s.toJSON() for state snapshots and diagnostics
- grep 's.' shows every state access

No behavioral changes. 1224 tests pass.

* fix: import constants locally for tsconfig.extensions.json compatibility

The extensions tsconfig couldn't resolve re-exported constants from
auto/session.js. Fix: import them explicitly in addition to re-exporting.
Also remove leftover DISPATCH_GAP_TIMEOUT_MS local declaration.
2026-03-17 14:59:42 -06:00
Tom Boucher
1e979ff626 fix: retry transient network errors before model fallback (#941) (#945)
Previously, any provider error during auto-mode immediately triggered the
model fallback chain. This meant providers with occasional network flakiness
(e.g. zai-coding-plan) would get abandoned after a single transient error,
barely getting used before the fallback took over.

Now, transient network errors (ECONNRESET, ETIMEDOUT, socket hang up, DNS
failures, etc.) are retried up to 2 times with linear backoff (3s, 6s)
before falling back to the next model. Permanent errors (auth, quota,
billing) still trigger immediate fallback.

Changes:
- index.ts: Add network retry loop before fallback chain in agent_end error
  handler. Track retry counts per model in networkRetryCounters map.
  Clear counters on successful unit completion and model switches.
- preferences.ts: Extract isTransientNetworkError() as testable utility.
  Matches network signals while excluding permanent auth/billing errors.
- network-error-fallback.test.ts: Add 12 tests for transient error detection
  covering all signal patterns and exclusion cases.
2026-03-17 14:59:22 -06:00
deseltrus
5bae521af0 fix: parallel worker PID tracking, spawn-status race, exit persistence (#932)
* fix: parallel worker PID tracking, spawn-status race, exit persistence

Three bugs in parallel-orchestrator.ts that cause workers to appear
permanently stuck in "running" or silently lose state on exit:

1. Worker PID initialized to coordinator's process.pid instead of 0.
   Session status files recorded wrong PID, breaking stale detection
   (isPidAlive returns true for the coordinator, not the dead worker).

2. Session status written with "running" BEFORE spawn attempt. If spawn
   fails, status file stays "running" indefinitely. Now spawns first,
   then writes status with actual state (running or error).

3. Worker exit handler updates session status but didn't call
   persistState(), so orchestrator.json got out of sync. Next
   coordinator restart could adopt already-dead workers.

Closes #672 (partial — worker lifecycle hardening)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: adapt lifecycle tests for spawn-aware session status

Tests now handle both outcomes: when spawnWorker() succeeds (running
state) and when it fails in CI (error state, no GSD binary available).
The lifecycle logic under test — session status writes, stop, pause,
resume — works correctly in both cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:59:05 -06:00
Tom Boucher
a82092eb63 fix: /gsd discuss now recommends next undiscussed slice (#935) (#939)
Three fixes for the discuss picker loop:

1. Recommend first undiscussed slice instead of always recommending
   the first pending slice (i === 0). The recommended flag now checks
   discussion state via CONTEXT file existence.

2. Exit with a summary notification when all pending slices have been
   discussed, instead of looping back to a picker where everything
   is already done.

3. Invalidate deriveState cache after each discuss session completes
   so subsequent state reads pick up the newly-written CONTEXT files.
2026-03-17 14:10:15 -06:00
Jeremy McSpadden
b44e43b841 refactor: reorder HTML report sections to match visualizer tab order (#937)
Mirror the visualizer's logical grouping in the HTML report:
- Core project views: Summary, Progress, Timeline, Dependencies
- Analytics/monitoring: Metrics, Health
- Content: Changelog, Knowledge, Captures
- Report-only: Artifacts, Planning

Updated sections array, TOC nav, and file header comment.
2026-03-17 14:06:24 -06:00
Tom Boucher
87352c9a4f fix: allow suffix text after '## Slices' heading in roadmap parser (#924) (#936)
The regex required exactly '## Slices' with nothing after. If an agent
renamed it (e.g. '## Slices (generate flow — first batch)'), the parser
returned zero slices, blocking auto-mode.

Changed /^## Slices\s*$/m to /^## Slices\b.*$/m — word boundary ensures
'Slices' is complete, .* allows any trailing text.
2026-03-17 14:06:10 -06:00
Jeremy McSpadden
43776b68c6 refactor: reorder visualizer tabs into logical groupings (#934)
Reorganize the 10-tab TUI visualizer for better workflow:
- Core project views: Progress, Timeline, Deps
- Analytics/monitoring: Metrics, Health, Agent
- Content: Changes, Knowledge, Captures
- Utility: Export (moved to last position)

Updated all tab index references (switch cases, export key
handling, export status display) and corrected help text
from "7-tab" to "10-tab" with accurate tab listing.
2026-03-17 14:05:38 -06:00
deseltrus
9fe805b1d3 test: parallel merge reconciliation + budget atomicity (G5/G6) (#933)
* test: parallel merge reconciliation + budget atomicity coverage (G5/G6)

27 new tests covering two gaps identified in #672:

G5 — Merge Reconciliation (parallel-merge.test.ts, 17 tests):
- determineMergeOrder: sequential, by-completion, filtering, defaults
- formatMergeResults: success, conflict, empty, mixed output
- mergeCompletedMilestone: clean merge with session cleanup, missing
  roadmap error, conflict detection with structured file list
- mergeAllCompleted: sequential order, stop-on-first-conflict,
  by-completion order (integration tests with real git repos)

G6 — Budget Atomicity (parallel-budget-atomicity.test.ts, 10 tests):
- Ceiling enforcement: exceeded, not exceeded, exact boundary
- Cost aggregation: correct sum, incremental updates
- No double-counting: 5 rapid refreshes produce correct total
- Budget reset: resetOrchestrator clears all state
- No ceiling: unlimited spending when budget_ceiling unset
- Worker state sync: refreshWorkerStatuses picks up disk changes

All tests use node:test + node:assert/strict. No production code changes.

Relates to #672

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use double quotes in git commit messages for Windows compatibility

Single-quoted commit messages in test helpers fail on Windows CMD
(pathspec errors). Switch to double quotes which work cross-platform.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:05:16 -06:00
Jeremy McSpadden
1ea653b5fc refactor: TUI dashboard cleanup, dedup, and feature improvements (#931)
* refactor: TUI dashboard cleanup, dedup, and feature improvements

- Extract shared format-utils.ts: formatDuration, padRight, joinColumns,
  centerLine, fitColumns, sparkline, stripAnsi — eliminating 3× duplication
  across dashboard-overlay, visualizer-views, and auto-dashboard
- Use shared STATUS_GLYPH/STATUS_COLOR from ui.ts consistently across all
  overlay and view files instead of hardcoded Unicode glyphs
- Fix redundant dynamic import('node:fs') in visualizer-data.ts (statSync
  already imported at top level)
- Replace (entry as any) casts with proper SessionMessageEntry type narrowing
- Add mtime-based file content cache for visualizer data loader to avoid
  re-parsing unchanged roadmap/plan files on every refresh
- Increase visualizer refresh interval from 2s to 5s (with mtime cache,
  unchanged files are effectively free)
- Fix sparkline to use loop-based max instead of Math.max(...values) to
  avoid stack overflow on large arrays
- Add ETA/time-remaining estimate to progress widget and dashboard overlay
  based on average unit duration from metrics ledger
- Show warning glyph for budget-pressured units in completed units list
  (continueHereFired units now show ⚠ instead of ✓)
- Add terminal resize (SIGWINCH) handling to both overlays — invalidates
  cache and re-renders on window size change
- Fix dispose race in dashboard overlay close path — now calls dispose()
  before onClose() to prevent timer callbacks firing after teardown
- Add 23 unit tests for format-utils.ts (including 100k-element sparkline)
- Add 2 tests for estimateTimeRemaining
- Add source-contract tests for resize handler and shared imports

* fix: use STATUS_GLYPH.warning instead of STATUS_GLYPH.statusWarning

STATUS_GLYPH is keyed by ProgressStatus ("warning"), not by GLYPH
property name ("statusWarning"). Fixes typecheck failure in CI.
2026-03-17 14:02:26 -06:00
Tom Boucher
2cba5bc072 fix: break reassess-roadmap skip loop by preventing re-persistence of evicted keys (#912) (#927)
After the skip-loop breaker evicts a completion key, the fallback path
at the bottom of dispatchNextUnit re-persists it because the expected
artifact exists on disk. This recreates the exact loop the breaker was
trying to break:

  evict key → dispatch → verifyArtifact(true) → re-persist key → skip → evict → repeat

Fix: Track recently-evicted keys in a Set. The fallback artifact-check
path skips re-persistence for keys that were just evicted by the
skip-loop breaker. Set is cleared on stopAuto.
2026-03-17 14:01:36 -06:00
Tom Boucher
7869312769 fix: dispatch plan-slice when task plan files are missing (#909) (#923)
When a slice plan (S03-PLAN.md) was pre-created during roadmapping
but plan-slice never ran to generate per-task files (tasks/T01-PLAN.md),
deriveState returned 'executing' phase. execute-task then failed because
the task plan didn't exist, creating an infinite restart loop.

Fix: In deriveState, when the tasks directory exists but has zero .md
files and the slice plan references tasks, return 'planning' phase
instead of 'executing'. This causes plan-slice to dispatch and generate
the missing task plans.

Tests updated: 6 test files that create synthetic state fixtures now
include a stub task plan file so their 'executing' phase assertions
remain valid.
2026-03-17 13:59:34 -06:00
Jeremy McSpadden
e0420f5981 fix: reduce CPU usage on long auto-mode sessions (#921)
* fix: reduce CPU usage on long auto-mode sessions

Seven targeted fixes for compounding process/timer/I/O issues that cause
high CPU during multi-hour /gsd auto sessions:

1. Wrap idle watchdog and hard timeout async callbacks in try-catch to
   prevent unhandled rejections from orphaning intervals
2. Cache nativeHasChanges fallback (10s TTL) to avoid spawning a new
   git process every 15 seconds when native module is unavailable
3. Call clearUnitTimeout() before dispatchNextUnit() in all recovery
   paths to prevent stale idle watchdog from firing alongside new timers
4. Add 10-second timeout to subagent worktree cleanup to prevent hangs
   when git worktree remove blocks indefinitely
5. Prune dead bg-shell processes after each unit completion to free
   retained output buffers (~500KB-1MB per dead process)
6. Throttle STATE.md rebuilds to at most once per 30 seconds (was every
   unit completion at 100-400ms each)
7. Increase progress widget refresh interval from 5s to 15s to reduce
   synchronous file I/O on the hot path

* fix: reset nativeHasChanges cache in worktree test

The 10s TTL cache on nativeHasChanges was causing the worktree test
to return stale "no changes" when checking a freshly dirtied repo
within the cache window. Reset the cache before the dirty-repo
assertion so the test correctly detects new changes.
2026-03-17 13:58:14 -06:00
Lex Christopherson
2e013d70b5 merge: resolve 12 conflicts with main — integrate continueHere feature into refactored closeoutUnit
Conflicts arose because main added continueHereHandle cleanup and
buildSnapshotOpts (with continueHereFired) while the PR extracted
inline closeout code into closeoutUnit(). Resolution: use closeoutUnit()
with buildSnapshotOpts() to pass all fields including continueHereFired.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:20:20 -06:00
Colin Johnson
7733e12413 fix: reap orphan-prone child processes across session churn (#920)
* fix: reap orphan-prone child processes across session churn

* test: make bg-shell cleanup test shell-safe
2026-03-17 13:14:51 -06:00
Jeremy McSpadden
3167e9fbf4 feat: HTML report generator with progression index (#876) 2026-03-17 11:51:54 -06:00
Goran Cabarkapa
6ed5e23603 fix: resolve symlinked skill directories in preferences (#913) 2026-03-17 11:48:46 -06:00
deseltrus
10200c43f3 feat: crash recovery for parallel orchestrator (#873) 2026-03-17 11:47:26 -06:00