Commit graph

751 commits

Author SHA1 Message Date
Flux Labs
c8b42ed2ae feat: native perf optimizations — deriveState, JSONL, paths, parsing (#576)
Four native Rust optimizations to eliminate hot-path bottlenecks:

1. deriveState raw content (gsd_parser.rs, state.ts):
   - Added rawContent field to ParsedGsdFile in batch parser
   - Eliminates 43-line frontmatter re-serialization loop in state.ts
   - Batch cache now stores original file content directly

2. JSONL streaming parser (gsd_parser.rs, session-forensics.ts):
   - Added parseJsonlTail() — reads from file tail with constant memory
   - Handles arbitrary file sizes (no more 10MB OOM risk)
   - synthesizeCrashRecovery and readLastActivityLog use native first

3. Native directory tree index (gsd_parser.rs, paths.ts):
   - Added scanGsdTree() — walks .gsd/ tree once, returns all entries
   - paths.ts builds lookup map from native scan
   - cachedReaddirWithTypes/cachedReaddir check native cache first
   - Eliminates 20-50 readdirSync calls per dispatch

4. Native plan/summary parsers (gsd_parser.rs, files.ts):
   - Added parsePlanFile() — parses tasks, must-haves, estimates
   - Added parseSummaryFile() — parses frontmatter, sections, files
   - files.ts calls native first, falls back to JS regex parsers
   - 3-5x faster per file, ~20 files per deriveState

All optimizations follow the established pattern: native-first with
JS fallback when native module unavailable.
2026-03-15 20:16:42 -06:00
Flux Labs
343a43f028 feat: move git operations to Rust via git2 crate (#572)
* feat: move git operations to Rust via git2 crate (#524)

Eliminates ~70 execSync/execFileSync git CLI calls across 15 TypeScript
files by implementing native libgit2 operations in Rust and routing all
consumers through the native-git-bridge.

Rust (native/crates/engine/src/git.rs):
- Added 28 new NAPI functions covering both read and write operations
- Read: git_is_repo, git_has_staged_changes, git_diff_stat,
  git_diff_name_status, git_diff_numstat, git_diff_content,
  git_log_oneline, git_worktree_list, git_branch_list,
  git_branch_list_merged, git_ls_files, git_for_each_ref,
  git_conflict_files, git_batch_info
- Write: git_init, git_add_all, git_add_paths, git_reset_paths,
  git_commit, git_checkout_branch, git_checkout_theirs,
  git_merge_squash, git_merge_abort, git_rebase_abort,
  git_reset_hard, git_branch_delete, git_branch_force_reset,
  git_rm_cached, git_rm_force, git_worktree_add,
  git_worktree_remove, git_worktree_prune, git_revert_commit,
  git_revert_abort, git_update_ref

TypeScript (native-git-bridge.ts):
- Added 35 bridge functions with native-first + execSync fallback
- New types: GitDiffStat, GitNameStatus, GitNumstat, GitLogEntry,
  GitWorktreeEntry, GitBatchInfo, GitMergeResult

Consumer migrations (15 files):
- worktree-manager.ts: removed local runGit/getMainBranch, all ops native
- auto-worktree.ts: merge, checkout, conflict resolution all native
- git-service.ts: smart staging, commits, snapshots all native
- auto.ts, guided-flow.ts: repo init/bootstrap native
- auto-supervisor.ts: working tree detection native
- git-self-heal.ts: merge/rebase abort, reset all native
- doctor.ts: health checks, branch listing, worktree cleanup native
- commands.ts: branch/snapshot cleanup native
- session-forensics.ts: diff stat queries native
- auto-recovery.ts: merge state reconciliation native
- gitignore.ts, undo.ts, worktree-command.ts: remaining ops native

Kept as execSync (by design):
- git push (credential handling too complex for libgit2)
- native-git-bridge.ts fallbacks (graceful degradation)
- runPreMergeCheck (runs arbitrary user commands)

Closes #524

* fix: restore getMainBranch export from worktree-manager

The agent migration removed getMainBranch from worktree-manager.ts but
worktree-command.ts still imports it. Re-add as a thin wrapper around
nativeDetectMainBranch.

* fix: address PR #572 review feedback — security, correctness, error handling

CRITICAL:
- Path traversal protection via validate_path_within_repo() for
  git_rm_force and git_checkout_theirs
- git_branch_delete defaults to safe delete (force=false)

HIGH:
- Replace silent .ok() with proper error propagation in git_commit,
  git_merge_abort, git_rebase_abort, git_rm_force, git_checkout_theirs
- nativeDiffStat fallback parses numeric stats from git output
- nativeBatchInfo fallback counts staged/unstaged from porcelain status

MEDIUM:
- Wire up dead force param in removeWorktree()
- Read MERGE_MSG/SQUASH_MSG when commit message empty
- nativeLsFiles uses gitFileExec without fragile quote wrapping
- Fix operator precedence in git_ls_files
2026-03-15 20:02:10 -06:00
78slogs
6d84d1c317 fix: arrow key cursor not updating + Shift+Enter not inserting newlines (#485)
Fix two editor input bugs:

1. Arrow key cursor movement not visually updating (fixes #464)
   The layout cache key only included {width, textVersion}. Cursor-only
   moves don't change textVersion, so stale cached layout was returned
   and the diff renderer skipped repaint. Added cursorLine and cursorCol
   to the cache key so cursor movements invalidate the cache.

2. Shift+Enter not inserting newlines in non-kitty terminals (Zed, VS Code, etc.)
   The /terminal-setup command configures terminals to send ESC+CR (\x1b\r)
   for Shift+Enter. But the followUp app action (bound to alt+enter) was
   intercepting \x1b\r in CustomEditor.handleInput before the editor's
   newLine handler could see it — because in non-kitty terminals, \x1b\r
   matches alt+enter. Now when kitty protocol is not active and \x1b\r is
   received, the followUp match is skipped so it falls through to newLine.
   Alt+Enter followUp still works in kitty-protocol terminals (iTerm2,
   Ghostty, Kitty, WezTerm) where the key combos are distinguishable.

Co-authored-by: TÂCHES <afromanguy@me.com>
2026-03-15 19:47:49 -06:00
Flux Labs
a3c52b2a1b perf: optimize hot-path lookups, cache clearing, and error resilience (#560)
* fix(undo): use invalidateAllCaches to prevent stale state after undo

After deleting summary files and modifying PLAN files, only
invalidateStateCache() was called. Path and parse caches remained
stale, causing deriveState() to return incorrect results — showing
undone tasks as still complete.

* perf: optimize hot-path lookups, cache clearing, and error resilience

- Replace O(n) Array.includes() with Set-based O(1) lookups in
  persistCompletedKey, findCommitsForUnit, and extractCommitShas
- Skip unnecessary cache invalidation for hook units in
  verifyExpectedArtifact (moved clearPathCache after hook early-return)
- Avoid redundant disk writes in removePersistedKey when key not present
- Single-pass partition for conflicted files in reconcileMergeState
  instead of two separate filter passes
- Wrap undo git operations in try/finally to guarantee cache
  invalidation even on partial failure
- Surface auto-start errors to user via ui.notify instead of
  swallowing silently (was debug-only logging)
2026-03-15 19:47:30 -06:00
Tom Boucher
7bad35702e chore: add PR template and bug report issue template (#574)
* chore: add PR template and bug report issue template

Standardize PR descriptions and bug reports with structured templates
to improve consistency across contributors.

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

* chore: simplify PR template — replace milestone/slice with target branch

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

* chore: rename section to 'Release context'

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 19:47:20 -06:00
Jean-Dominique Stepek
71cf0eef3b fix: git commands fail when repo path contains spaces (#561)
* fix: use execFileSync for git commands to handle paths with spaces

execSync builds a shell command string via string interpolation, so any
path containing spaces (e.g. 'Current Projects/my-repo') gets word-split
by the shell into multiple arguments. This caused 'git worktree add' to
fail with a usage error whenever the repo was in a directory with spaces.

Switch all three git runner functions to execFileSync, which takes args
as an array and bypasses the shell entirely. Paths are passed as discrete
arguments and never subject to word-splitting or other shell expansions.

Affected files:
- worktree-manager.ts: runGit()
- git-service.ts: runGit()
- native-git-bridge.ts: gitExec()

* fix: restore pre-merge check command execution
2026-03-15 19:35:50 -06:00
TÂCHES
324d508eaf ci: add extension type-checking to CI pipeline (#568)
* ci: add extension type-checking to CI pipeline and prepublishOnly

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

* fix: resolve remaining extension type errors after merge

- Use cred.type === "api_key" for proper union narrowing in loadToolApiKeys
- Fix optional level parameter in provider-error-pause test

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-15 19:26:45 -06:00
TÂCHES
7578292b6b fix: resolve TypeScript errors in GSD extension files (#571)
Add "success" to notify type union across ExtensionUIContext, interactive
mode, and RPC mode implementations. Fix null safety for readFileSync and
contextUsage.percent in auto.ts. Add discriminated union narrowing for
dispatch results. Add string type guards for select() return values in
commands.ts. Align ProviderErrorPauseUI notify signature. Simplify
AuthStorage return type.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:12:23 -06:00
Flux Labs
5eb4d94e10 feat: add /gsd steer command for hard-steering plan documents (#82) (#566)
Adds `/gsd steer <change>` command that registers user overrides in
`.gsd/OVERRIDES.md`. Active overrides are injected into all prompts.
A `rewrite-docs` dispatch unit propagates overrides across plan docs.

Addresses all review concerns from PR #409:
- resolveAllOverrides wired into handleAgentEnd
- Circuit breaker (max 3 attempts, then force-resolve)
- verifyExpectedArtifact validates OVERRIDES.md state
- Milestone-only unitId when no active slice
- Test temp dirs cleaned up
2026-03-15 19:10:59 -06:00
TÂCHES
26890f3b09 fix: resolve TypeScript errors in GSD test files (#570)
- Remove extraneous argument in auto-worktree report() call
- Replace vitest imports with node:test in integration-mixed-milestones and unique-milestone-ids
- Cast deprecated merge_to_main references as any in preferences-git tests
- Type pre-dispatch hook arrays as PreDispatchHookConfig[] in preferences-hooks tests

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:10:36 -06:00
Lex Christopherson
b9c602b2e9 chore: gitignore RELEASE-GUIDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:08:50 -06:00
TÂCHES
96cd2732bf fix: resolve TypeScript errors in async-jobs extension (#569)
Add missing parameters (signal, onUpdate, ctx) to tool execute signatures
and details property to return objects to satisfy AgentToolResult<T> type.
Fix string-to-boolean type mismatch on display property in sendMessage calls.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:07:57 -06:00
geromet
dfd2a1b5b4 fix: load tool API keys from auth.json at session startup (#563)
Export TOOL_KEYS constant and add loadToolApiKeys() function to load
API keys from ~/.gsd/agent/auth.json into environment variables.

Called in session_start handler so tool-based extensions (Context7,
Brave Search, Jina, Tavily, Groq) work immediately without requiring
/gsd config.
2026-03-15 18:58:00 -06:00
Flux Labs
c20c57b941 feat: default to Opus 4.6 1M context variant (#565) 2026-03-15 18:57:46 -06:00
Lex Christopherson
0dbed163bb 2.15.1 2026-03-15 18:54:45 -06:00
Lex Christopherson
8f349663ed docs: update changelog for v2.15.1 2026-03-15 18:54:34 -06:00
Lex Christopherson
ef2036ab9d ci: support prerelease publishing with --tag next
Detect prerelease versions (containing -next.) and publish npm packages
with --tag next instead of --tag latest, keeping stable users unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 18:48:55 -06:00
TÂCHES
96df01063f fix: auto-mode worktree path and resource sync bugs (#557)
* fix(auto): add missing import for resolveSkillDiscoveryMode

Used at line 687 but not imported, causing "resolveSkillDiscoveryMode is
not defined" crash on auto-mode startup.

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

* fix(auto): add workingDirectory to all auto-mode prompt templates

Six prompt templates (reassess-roadmap, complete-milestone, replan-slice,
run-uat, research-milestone, plan-milestone) were missing the working
directory directive. Without it, the LLM infers the main repo path from
system context and cd's there instead of staying in the worktree. This
causes artifacts to be written to the wrong location, preventing the
dispatch loop from detecting completion and triggering infinite
re-dispatches of the same unit.

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

* fix(auto): detect mid-session resource updates and stop gracefully

Templates are read from disk on each dispatch but extension code is
loaded once at startup. If resources are re-synced mid-session (via
/gsd:update, npm update, or dev copy-resources), templates may expect
variables the in-memory code doesn't provide, causing a crash.

Add a syncedAt timestamp to managed-resources.json. Auto-mode captures
this at startup and checks before each dispatch. If resources changed,
it stops with a clear message instead of crashing.

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

* test: add workingDirectory to prompt template test fixtures

Tests that load prompt templates via loadPromptFromWorktree now pass the
workingDirectory variable, matching the updated templates that include
the {{workingDirectory}} directive.

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-15 18:26:55 -06:00
Jamie Nelson
d88db53715 docs: sync GSD workflow resource (#476)
* docs: sync GSD workflow resource

* docs: resolve workflow naming review comments

---------

Co-authored-by: TÂCHES <afromanguy@me.com>
2026-03-15 18:23:52 -06:00
Mannan Kant
611cd0f508 copilot fix for https://github.com/gsd-build/gsd-2/issues/496 (#504) 2026-03-15 18:19:41 -06:00
Flux Labs
6f6ef16ee9 fix(undo): use invalidateAllCaches to prevent stale state after undo (#556)
After deleting summary files and modifying PLAN files, only
invalidateStateCache() was called. Path and parse caches remained
stale, causing deriveState() to return incorrect results — showing
undone tasks as still complete.
2026-03-15 18:19:09 -06:00
Flux Labs
ecef348a95 fix(auto): harden recovery — checkbox verification, atomic writes, roadmap checks (#547)
Four fixes to auto-recovery logic that caused silent failures or
inconsistent state:

1. skipExecuteTask: return false when checkbox regex doesn't match the
   plan format, so callers fall through to other recovery strategies
   instead of assuming success (lines 252-255)

2. verifyExpectedArtifact: fail verification on corrupt/unparseable
   roadmap instead of silently passing. Prevents advancing past an
   incomplete complete-slice when the roadmap file is malformed (line 152)

3. removePersistedKey: use atomic tmp+rename write (matching
   persistCompletedKey) to prevent completed-units.json corruption
   on crash mid-write (line 293)

4. selfHealRuntimeRecords: use verifyExpectedArtifact instead of bare
   existsSync for execute-task healing, so tasks with summary but
   unchecked plan checkbox aren't incorrectly marked complete (line 374)

Co-authored-by: TÂCHES <afromanguy@me.com>
2026-03-15 18:15:44 -06:00
Flux Labs
3101469b4d fix(auto): refresh progress widget from disk every 5s during unit execution (#549) (#552)
The progress bar in the auto-mode widget was snapshot-based — only
updated at dispatch time via updateSliceProgressCache(). During
long-running units (especially after the worktree architecture in
PR #506), the bar appeared frozen even as tasks completed on disk.

Add a 5-second interval inside the widget that re-reads the roadmap
and plan files from disk, so slice/task progress reflects reality
without waiting for the next unit dispatch.

Closes #549
2026-03-15 18:12:48 -06:00
TÂCHES
0c4b1614cb Merge pull request #550 from gsd-build/refactor/526-test-coverage
test: add unit tests for auto-dashboard, auto-recovery, crash-recovery
2026-03-15 17:37:08 -06:00
Lex Christopherson
f70ddea074 test: add unit tests for auto-dashboard, auto-recovery, crash-recovery (#526)
46 new tests covering 3 previously untested modules:

- auto-dashboard.test.ts (18 tests): unitVerb, unitPhaseLabel,
  describeNextUnit phase mapping, formatAutoElapsed, formatWidgetTokens
- crash-recovery.test.ts (10 tests): writeLock/readCrashLock round-trip,
  clearLock, isLockProcessAlive (own PID, dead PID, invalid PIDs),
  formatCrashInfo
- auto-recovery.test.ts (18 tests): resolveExpectedArtifactPath for all
  unit types, diagnoseExpectedArtifact, buildLoopRemediationSteps,
  completed-unit key persistence (persist, load, remove, idempotency)

Total test count: 123 → 169

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:33:48 -06:00
Lex Christopherson
c09dcfc380 2.15.0 2026-03-15 17:33:43 -06:00
Lex Christopherson
94aa8fdc63 docs: update changelog for v2.15.0 2026-03-15 17:33:38 -06:00
TÂCHES
ee355b52d1 Merge pull request #482 from fluxlabs/fix/tui-resource-leaks-and-quality
fix: TUI resource leaks, code quality, and regression tests
2026-03-15 17:32:31 -06:00
TÂCHES
67f0a6253f Merge pull request #548 from gsd-build/refactor/519-decompose-bg-shell
refactor: decompose bg-shell/index.ts into focused modules
2026-03-15 17:30:52 -06:00
Lex Christopherson
0e6b0f4e54 refactor: decompose bg-shell/index.ts into focused modules
Split the 3,179-line monolith into 7 focused modules:
- types.ts (251 lines): shared types, constants, pattern databases
- utilities.ts (55 lines): time formatting, Windows VT input restoration
- process-manager.ts (404 lines): process lifecycle, registry, persistence
- output-formatter.ts (259 lines): output analysis, digest, highlights
- readiness-detector.ts (126 lines): port probing, readiness detection
- interaction.ts (198 lines): send_and_wait, run on session, shell env query
- overlay.ts (432 lines): TUI process manager overlay

index.ts retains tool registration, command routing, footer, and event
handling (1,573 lines). All existing exports are preserved via re-exports.

Closes #519

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:27:56 -06:00
Lex Christopherson
51a8602676 fix(test): update git.isolation test to match #536 behavior change
#536 changed git.isolation from deprecated to an active setting.
Update the test to verify it passes through correctly instead of
expecting a deprecation warning. Add separate test for the still-
deprecated git.merge_to_main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:27:06 -06:00
TÂCHES
fcf60d8808 Merge pull request #489 from fluxlabs/fix/openrouter-preferences
fix: harden YAML preferences parser for OpenRouter model IDs
2026-03-15 17:18:19 -06:00
TÂCHES
4eb5f431d4 Merge pull request #536 from fluxlabs/fix/slice-merge-loop-530
fix: prevent merge loop, auto-resolve .gsd/ conflicts, restore git.isolation (#530, #531)
2026-03-15 17:18:15 -06:00
TÂCHES
e051eff987 Merge pull request #544 from fluxlabs/fix/auto-dispatch-gap-watchdog-537
fix(auto): stop auto-mode when dispatch gap watchdog fails to dispatch
2026-03-15 17:18:07 -06:00
TÂCHES
946fce4ee6 Merge pull request #532 from fluxlabs/fix/arrow-keys-escape-sequence-splitting-493
fix: prevent arrow keys from inserting escape sequences as text
2026-03-15 17:18:00 -06:00
TÂCHES
153ac6fbf4 Merge pull request #478 from fluxlabs/fix/gsd-extension-ctx-log
fix: avoid ctx.log in GSD provider error recovery
2026-03-15 17:17:54 -06:00
TÂCHES
227e088dbb refactor: add GSDError base class and capture silent catch errors (#546)
Introduce typed error hierarchy (GSDError with stable error codes) for
programmatic error matching and crash diagnostics. Convert
MergeConflictError to extend GSDError. Capture error references in the
most impactful silent catch blocks across crash-recovery, auto-recovery,
and activity-log — errors remain non-fatal but are no longer discarded.

Closes #525

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:12:16 -06:00
TÂCHES
4184be251f refactor: unify cache invalidation into invalidateAllCaches() (#545)
Three independent caches (state, path, parse) required manual coordination
on every dispatch cycle. Forgetting any one caused stale reads (#431).
Add a single invalidateAllCaches() in cache.ts that clears all three,
and replace grouped call sites in auto.ts and tests.

Individual clear functions are preserved for callers that legitimately
only need to clear one cache.

Closes #527

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:12:13 -06:00
TÂCHES
4afcc81382 refactor(auto): extract dispatch table from if-else chain (#521) (#539)
Replace the 130-line if-else chain in dispatchNextUnit with a
declarative DispatchRule[] table in auto-dispatch.ts.

Each rule maps a GSD state to the unit type, unit ID, and prompt
builder. Rules are evaluated in order; first match wins. The table
is inspectable, testable per-rule, and extensible without modifying
orchestration code.

- auto-dispatch.ts: 258 lines, 12 named rules
- auto.ts dispatch section: 130 lines → 20 lines
- Updated auto-draft-pause test to verify rules in new location
- 123/123 tests pass, zero TypeScript errors

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:10:27 -06:00
TÂCHES
06f4bdc7f4 feat(preferences): add schema validation with unknown key detection (#542)
Validates parsed preferences against known keys and expected types.
Unknown keys produce warnings instead of being silently ignored.
Previously unvalidated fields (budget_enforcement, context_pause_threshold,
models, auto_supervisor, notifications, remote_questions) are now
type-checked. Warnings surface through LoadedGSDPreferences so callers
can inspect validation results.

Closes #522

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:09:58 -06:00
Flux Labs
a9b70fa8d6 fix: prevent merge loop, auto-resolve .gsd/ conflicts, restore git.isolation (#530, #531)
Three fixes for slice transition crashes and git isolation regression:

1. dispatch-guard reads from disk instead of git branch — prevents
   false blockers when roadmap state is committed on milestone branch
   but not yet on the integration branch (#530).

2. Auto-resolve .gsd/ state file conflicts during milestone merge and
   in the mid-merge safety check. STATE.md, completed-units.json, and
   auto.lock diverge between branches during normal operation — always
   prefer the milestone branch version. Only escalate non-.gsd conflicts
   to MergeConflictError (#530).

3. Restore git.isolation preference with two values (#531):
   - "worktree" (default): creates milestone worktrees for isolated work
   - "branch": works directly in the project root, skipping worktree
     creation — for submodule-heavy repos where worktrees fail
   The branchless worktree architecture remains the default. Branch mode
   simply gates worktree entry points so no worktree is ever created.
2026-03-15 18:09:05 -05:00
TÂCHES
8dbd21d308 Merge branch 'main' into fix/auto-dispatch-gap-watchdog-537 2026-03-15 17:08:34 -06:00
TÂCHES
bcd3c9209c feat(prompts): worktree cwd, pipeline awareness, depth calibration, template improvements (#543)
Comprehensive prompt and template overhaul addressing multiple issues
discovered during auto-mode execution:

**Worktree cwd fix** — Executor agents wrote code to the main repo
instead of the worktree because prompts never stated the working
directory. Added ## Working Directory section with explicit path to
execute-task, plan-slice, research-slice, complete-slice prompts.
Passed workingDirectory: base to all loadPrompt() calls in
auto-prompts.ts and guided-flow.ts.

**Stale branch references** — Removed all "slice branch" references
(branchless since v2.14.0). Updated system.md with Worktree Model
section. Updated preferences-reference.md descriptions.

**System prompt updates** — Added REQUIREMENTS.md, CONTEXT.md docs,
system-managed directories (runtime/, activity/, worktrees/) to
directory structure.

**Pipeline awareness** — Every phase now knows its role: researchers
are scouts writing for planners, planners trust research and don't
re-explore, executors build from task plans, completers write for
downstream readers. Eliminates redundant work between phases.

**Research depth calibration** — Three-tier system (deep/targeted/light)
across research-slice, guided-research-slice, research-milestone.
Light research for known patterns can be 15-20 lines.

**Template improvements:**
- research.md: "Existing Code and Patterns" → "Implementation Landscape"
  with Key Files, Build Order, Verification Approach subsections
- plan.md: reduced task examples from 3 to 2 to avoid anchoring
- state.md: removed dead Active Workspace field
- reassessment.md: added depth guidance for no-change vs modified
- Carry-forward now extracts key_files (was missing — executors
  couldn't see which files prior tasks created)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:06:06 -06:00
Flux Labs
c75f8ef30f fix(auto): stop auto-mode when dispatch gap watchdog fails to dispatch (#537)
The dispatch gap watchdog is a one-shot timer that fires 5s after a unit
completes without a follow-up dispatch. Previously, if the watchdog's
dispatchNextUnit() call returned without actually dispatching a unit
(no sendMessage called), auto-mode was left permanently active but idle
— no new watchdog was started and no stopAuto was called.

This happened when:
- State between milestones had no dispatchable unit
- Stale completed-units.json after GSD updates caused skip loops
- dispatchNextUnit silently returned without finding work

Now the watchdog checks whether a unit was actually dispatched after its
retry attempt. If not, it stops auto-mode cleanly with a user-facing
message instead of leaving it stuck.

Closes #537
2026-03-15 18:04:36 -05:00
TÂCHES
0711e129dc refactor: gate v1 migration code behind dynamic import (#541)
The migrate/ directory (1,862 lines across 9 files) is one-time migration
code for .planning/ → .gsd/ conversion. Replace the static top-level
import with a dynamic import() that only loads when `/gsd migrate` is
invoked, matching the existing pattern used for hooks and metrics.

Closes #523

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:58:37 -06:00
TÂCHES
bc4d4fcf48 perf: fix synchronous I/O in hot paths (#540)
Replace existsSync collision loop with atomic O_CREAT|O_EXCL file
creation, hoist regex to module-level constant, and memoize
getPackageDir() to avoid repeated directory walks.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:57:22 -06:00
TÂCHES
2d93a912f2 Merge branch 'main' into fix/gsd-extension-ctx-log 2026-03-15 16:46:57 -06:00
TÂCHES
97eec7a33f Merge branch 'main' into fix/tui-resource-leaks-and-quality 2026-03-15 16:46:54 -06:00
TÂCHES
afb20c0b22 Merge branch 'main' into fix/openrouter-preferences 2026-03-15 16:46:51 -06:00
TÂCHES
b6e5d8e538 Merge branch 'main' into fix/arrow-keys-escape-sequence-splitting-493 2026-03-15 16:46:45 -06:00