Commit graph

726 commits

Author SHA1 Message Date
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
TÂCHES
a43836ffbb refactor(auto): decompose auto.ts into focused modules (#534)
* refactor(auto): decompose auto.ts into focused sub-modules (#518)

Extract ~730 lines from auto.ts (3,819 -> 3,097 lines) into three
focused modules:

- auto-recovery.ts: artifact resolution/verification, skip artifacts,
  completed-unit persistence, merge reconciliation, self-heal, loop
  remediation steps
- auto-dashboard.ts: progress widget, elapsed time formatting, unit
  description helpers, slice progress cache, footer factory
- auto-supervisor.ts: SIGTERM handling, working-tree activity detection

auto.ts retains all state machine logic (dispatchNextUnit, handleAgentEnd,
startAuto, stopAuto, pauseAuto, recoverTimedOutUnit) and the module-level
globals. Sub-modules are pure functions receiving parameters — no circular
dependencies or AutoContext abstraction.

All existing exports preserved via re-exports. Tests updated to reflect
the source file changes.

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

* refactor(auto): extract prompt builders + fix require() in recovery

- Extract 11 prompt builder functions, 6 inline helpers, 2 adaptive
  replanning checks, and text utilities into auto-prompts.ts (785 lines)
- Replace inline merge reconciliation block with reconcileMergeState()
  call (already existed in auto-recovery.ts but was duplicated)
- Fix CommonJS require("node:fs") in auto-recovery.ts → ESM import
- auto.ts: 3,819 → 2,321 lines (39% reduction)

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

* Merge origin/main into refactor/518-decompose-auto-ts

Resolve conflicts in auto.ts:
- Keep PR's refactored imports (extracted to sub-modules)
- Add main's new BudgetEnforcementMode type import
- Add main's new sendDesktopNotification import
- Add main's budget alert functions (getBudgetAlertLevel, etc.)

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 16:43:48 -06:00
TÂCHES
5493fe07fa Merge branch 'main' into fix/arrow-keys-escape-sequence-splitting-493 2026-03-15 16:40:22 -06:00
Flux Labs
7bef5a8f8d feat: QOL improvements — 8 new commands, budget enforcement, notifications (#441)
* feat: add QOL commands — pause, history, undo, skip, export, cleanup, dry-run, budget enforcement, notifications

Add 8 new /gsd subcommands and enhance auto-mode with budget enforcement,
context monitoring, and desktop notifications.

New commands:
- /gsd pause — graceful pause (finish current unit, then stop)
- /gsd history [N] [--cost|--phase|--model] — view unit execution history
- /gsd undo [--force] — rollback last completed unit (revert git + state)
- /gsd skip <unit-id> — mark unit complete without executing
- /gsd next --dry-run — preview next unit with estimated cost/duration
- /gsd export [--json|--markdown] — generate session report
- /gsd cleanup branches — delete merged GSD branches
- /gsd cleanup snapshots — prune old snapshot refs

Auto-mode enhancements:
- Budget enforcement with 3 modes (warn/pause/halt) and threshold alerts at 75%/90%/100%
- Context window monitoring with auto-pause when approaching limits
- Desktop notifications (macOS osascript, Linux notify-send) on milestone complete, blocked, loop detected

New preferences:
- budget_enforcement: warn | pause | halt (default: pause)
- context_pause_threshold: number (% context window, 0 to disable)
- notifications.enabled: boolean

New files: notifications.ts, history.ts, undo.ts, export.ts
Modified: commands.ts, auto.ts, types.ts, preferences.ts, metrics.ts

* fix: harden qol notifications and undo paths

* fix: finish qol review follow-ups

---------

Co-authored-by: TÂCHES <afromanguy@me.com>
2026-03-15 16:28:04 -06:00
Flux Labs
8913aea968 fix: prevent arrow keys from inserting escape sequences as text (#493)
Arrow keys produce `^[[D`/`^[[C` instead of moving the cursor when event
loop latency causes the StdinBuffer to split escape sequences.

Three layered fixes:

1. Increase StdinBuffer timeout from 10ms to 50ms (matches xterm default)
   so split escape sequences are reassembled even under load.

2. Clean up stale readline listeners after @clack/prompts onboarding —
   readline.emitKeypressEvents() leaves a permanent data listener that
   is unnecessary for the TUI.

3. Guard in editor against CSI remnants: if a split still occurs, reject
   text matching navigation escape patterns ([A-F, [H, [Z, [n~) instead
   of inserting them as characters.

Closes #493
2026-03-15 17:17:58 -05:00
Lex Christopherson
b873f8112f 2.14.4 2026-03-15 15:46:16 -06:00
Lex Christopherson
5662c5fba8 docs: update changelog for v2.14.4 2026-03-15 15:46:16 -06:00
TÂCHES
8882ce484e fix(session): update cwd on newSession to reflect worktree chdir (#517)
When auto-mode creates a worktree and chdir's into it, the Node process
cwd changes but AgentSession._cwd stays frozen at the original path.
Every newSession() builds a system prompt telling the LLM "Current
working directory: /original/path", so the LLM cd's back there and
writes files to the wrong location.

Update _cwd = process.cwd() at the start of newSession() so the system
prompt reflects the actual working directory after chdir.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 15:45:15 -06:00
Lex Christopherson
ce78c2a7d5 2.14.3 2026-03-15 15:34:13 -06:00
Lex Christopherson
13fe8b2c84 docs: update changelog for v2.14.3 2026-03-15 15:34:13 -06:00
TÂCHES
5ae8cf8851 fix(auto): copy planning artifacts into new auto-worktrees (#516)
Auto-worktrees are fresh git checkouts — untracked .gsd/ files don't
carry over. Projects with the old blanket .gsd/ gitignore have planning
artifacts on disk but not in git. When createAutoWorktree makes a new
worktree, the milestones/, DECISIONS.md, REQUIREMENTS.md etc are missing,
causing auto-mode to loop on plan-slice (plan file not found in worktree).

Copy .gsd/ planning artifacts from the source repo into the new worktree
after git worktree add. Skips runtime files and the worktrees/ dir.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 15:33:05 -06:00
Lex Christopherson
b333d450a3 2.14.2 2026-03-15 15:22:41 -06:00
Lex Christopherson
4465b5ea76 docs: update changelog for v2.14.2 2026-03-15 15:22:41 -06:00
TÂCHES
cc22920c2e fix(gitignore): self-heal blanket .gsd/ ignore from pre-v2.14.0 projects (#515)
ensureGitignore() now detects and removes standalone ".gsd/" lines that
blanket-ignore the entire directory. Replaces with explicit runtime-only
patterns so .gsd/milestones/ planning artifacts are tracked in git.

Without this, existing projects keep the old blanket ignore forever.
New worktrees start with zero planning state because artifacts aren't
in git, causing auto-mode to re-execute completed work.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 15:21:04 -06:00
Lex Christopherson
e759af8e2a fix(auto): reset _dispatching flag + improve discuss depth verification UX
- auto.ts: wrap dispatchNextUnit body in try/finally to always reset
  _dispatching to false. Without this, the reentrancy guard permanently
  blocked all subsequent dispatches after the first one, causing the
  dispatch gap watchdog to fire and auto-mode to stall.
- discuss.md: render depth summary as chat text (where markdown renders)
  then use ask_user_questions for the short confirmation only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 15:20:45 -06:00
Lex Christopherson
484524b528 2.14.1 2026-03-15 15:11:01 -06:00
Lex Christopherson
dd9d837304 docs: update changelog for v2.14.1 2026-03-15 15:11:01 -06:00
TÂCHES
e0c9dc638e fix(auto): quiet diagnostic noise in auto-mode warnings (#514)
Downgrade internal recovery machinery to info/verbose-only so users
only see warnings when action is needed:

- "Dispatch gap detected" → verbose-only info (recovery is automatic)
- "Model not found, trying fallback" → verbose-only info
- "Failed to set model, trying fallback" → verbose-only info
- "Could not set any preferred model" → deleted (redundant)
- "New session cancelled" → info (user action, not error)
- "Unexpected phase" → info with doctor suggestion
- "No command context" → info with restart suggestion

Kept as warnings (user-actionable):
- Budget ceiling, blockers, prior slice incomplete, pre-flight,
  no context, stub summary, model ambiguity, all fallbacks exhausted

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 15:09:32 -06:00
Lex Christopherson
8737b509c1 2.14.0 2026-03-15 14:35:52 -06:00
Lex Christopherson
60e1abee6f docs: update changelog for v2.14.0 2026-03-15 14:35:34 -06:00
Lex Christopherson
c372c4d87c docs: update README for branchless worktree architecture 2026-03-15 14:34:08 -06:00
Flux Labs
a8ad805973 Merge branch 'main' into fix/gsd-extension-ctx-log 2026-03-15 15:09:58 -05:00
Flux Labs
26e6f0f48d Merge branch 'main' into fix/openrouter-preferences 2026-03-15 15:09:49 -05:00
Flux Labs
d7aaa5c5d9 Merge branch 'main' into fix/tui-resource-leaks-and-quality 2026-03-15 15:09:38 -05:00
TÂCHES
59698978af fix(auto): stop re-running finished tasks after session restart (#513)
* fix(auto): prevent infinite re-dispatch when completion key is missing

Root cause: When a task completed successfully on the first attempt,
the idempotency key was never persisted to completed-units.json.
The persistence logic (persistCompletedKey) only triggered at the
retry threshold (MAX_UNIT_DISPATCHES=3). After session restart, the
key was missing and auto-mode re-dispatched the same task endlessly.

Evidence: M008/S01/T01 was dispatched 15+ times over 3.5 hours.
T01-SUMMARY.md existed, S01-PLAN.md marked T01 as [x], but
completed-units.json had no execute-task/M008/S01/T01 entry.

Fix: Added fallback artifact check before dispatch. If the expected
artifact already exists on disk but the completion key is missing,
the key is repaired (persisted + added to in-memory set) and the
unit is skipped. This catches the gap between the closeout-based
persistence (which requires the NEXT dispatch to fire) and the
retry-threshold persistence (which requires MAX attempts).

Also fixes guided-flow-escape.test.ts: added missing cache
invalidation after rmSync (clearPathCache + invalidateStateCache).

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

* fix(auto): prevent TUI freeze on cascading skip-dispatches

When multiple completed tasks are skipped in sequence (T01 artifact
fallback → T02 idempotency skip → T03 dispatch), the recursive
dispatchNextUnit calls can freeze the TUI.

Fix: invalidateStateCache() after key repair so deriveState returns
the correct next task, and use setTimeout(50ms) instead of
setImmediate to yield more generously to the event loop between
cascading skips.

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

* fix(auto): systematic hardening of dispatch recovery pipeline

Five fixes addressing the 20 failure modes identified in the auto-mode
dispatch loop audit:

1. Stale runtime record cleanup: selfHealRuntimeRecords now clears
   records older than 1h with phase=dispatched (crash orphans), and
   also persists completion keys for records with existing artifacts.

2. Recursion depth limit: _skipDepth counter prevents TUI freeze when
   many completed units are skipped in cascade. After MAX_SKIP_DEPTH
   (20) skips, yields 200ms to the event loop before continuing.

3. Atomic completed-units.json writes: persistCompletedKey now uses
   tmp file + renameSync to prevent partial writes on crash.

4. Skip depth tracking on both skip paths (idempotency check at L1815
   and artifact fallback at L1844) with setTimeout(50ms) between skips.

5. Self-heal now also repairs missing completion keys when artifact
   exists, closing the gap where crash between completion and closeout
   leaves the key unwritten.

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

* fix(auto): add reentrancy guard to dispatchNextUnit itself

The _handlingAgentEnd boolean only guards calls from agent_end hooks.
Direct calls from watchdog timers, step wizard, and crash recovery
can still race with an in-progress dispatch. Added _dispatching guard
that blocks concurrent external calls while allowing recursive skip
calls (_skipDepth > 0). Cleared on stopAuto.

Audit confirmed: double watchdog (#11) already prevented by existing
clearDispatchGapWatchdog in startDispatchGapWatchdog + catch/return.
Counter cleanup (#16) already handled by unitDispatchCount.clear()
in startAuto before selfHealRuntimeRecords.

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

* fix(auto): final hardening for unattended multi-milestone runs

Three fixes from paranoid stress-test audit:

1. Git index.lock cleanup: Remove stale .git/index.lock (>60s old) at
   auto-start. A crash during git commit/merge leaves this file behind,
   blocking ALL subsequent git operations with no recovery.

2. Stub summary for complete-milestone: If the LLM fails to write a
   milestone SUMMARY after MAX_UNIT_DISPATCHES attempts, generate a
   stub summary to unblock the pipeline. Without this, auto-mode
   loops forever in "completing-milestone" phase.

3. Pre-flight queue validation: At auto-start with multiple milestones,
   scan for CONTEXT-DRAFT.md files (will pause for discussion) and
   report milestone count. Gives the user early visibility into what
   will happen during the run.

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

---------

Co-authored-by: deseltrus <simulacraverse@protonmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 14:06:56 -06:00
TÂCHES
f59301e4ba fix(auto): prevent nested worktree creation inside existing worktrees (#511)
* fix(auto): prevent nested worktree creation inside existing worktrees

When auto-mode starts inside a manual worktree (e.g., /worktree memory-db),
it unconditionally created an auto-worktree for the milestone, nesting
.gsd/worktrees/M001 inside the existing worktree. This caused GSD to
chdir into the inner worktree, read state from the wrong repo, and
report "All milestones complete" or loop on artifact verification.

Add detectWorktreeName() guard to both the start and resume paths:
if already inside a worktree, skip auto-worktree creation and work
directly on the current branch.

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-15 13:56:56 -06:00