Commit graph

770 commits

Author SHA1 Message Date
Flux Labs
a9b14dc181 feat: add .gsd/KNOWLEDGE.md — persistent project-specific context (#585) 2026-03-16 06:15:18 -06:00
deseltrus
e5244658b3 fix(auto): tool-aware idle detection prevents false interruption of long-running tasks (#596) 2026-03-16 06:07:14 -06:00
deseltrus
ce553ec022 fix: parseContextDependsOn() destroys unique milestone ID case, breaking dependency resolution (#604) 2026-03-16 06:06:09 -06:00
deseltrus
0820b1196d feat: queue reorder — reorder milestone execution via /gsd queue (#460) 2026-03-16 06:05:45 -06:00
Lex Christopherson
1d1b91f428 2.17.0 2026-03-15 22:26:55 -06:00
Lex Christopherson
39a524614a docs: update changelog for v2.17.0 2026-03-15 22:26:41 -06:00
Flux Labs
d35ae683f1 Fix #453 native hangs in GSD auto-mode paths (#502)
* fix: avoid native hangs in gsd auto paths

* fix: use .js extension in edit-diff.test.ts import for tsc compatibility

* fix: prevent OOM on large file diffs and implement context-line windowing

- Add size guard (MAX_DP_CELLS=4M) to buildLineDiff that falls back to a
  linear-time prefix/suffix matching algorithm for large files, preventing
  the O(n*m) DP table from causing OOM crashes
- Implement contextLines parameter in generateDiffString so only lines
  within N lines of a change are rendered (with "..." separators), matching
  unified diff behavior — the parameter was previously accepted but ignored
- Add tests for both context windowing and large-file fallback

---------

Co-authored-by: TÂCHES <afromanguy@me.com>
2026-03-15 22:22:58 -06:00
Andriyansyah Nurrachman
132ae92944 feat: update ollama cloud provider models (#578) 2026-03-15 22:22:29 -06:00
Mannan Kant
96f5b58bd3 fix(pi-ai): address review comments on #504 — exhaustive switch, tests, cleanup (#587)
- Restore exhaustive never check in mapStopReason (throw on unhandled FinishReason)
- Add 12 unit tests for sanitizeSchemaForGoogle covering patternProperties removal,
  const→enum conversion at various depths, arrays, deeply nested objects, pass-through
- Simplify redundant recursion branches into single typeof object catch-all
- Fix misleading comment ("only in anyOf/oneOf") — conversion happens everywhere
- Drop unnecessary (p: Part) annotation; TypeScript infers it from @google/genai types

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 22:21:20 -06:00
Tom Boucher
67341caef1 feat: token optimization — profile presets, context compression, complexity routing, budget prediction (#582)
Reduces auto-mode token consumption by 40-60% through coordinated
optimizations driven by a single token_profile preference.

Profile presets (budget/balanced/quality):
- One preference key coordinates model selection, phase skipping,
  context compression, and subagent routing
- Balanced is the default for new projects (D046)
- Explicit user preferences always override profile defaults

Phase skipping:
- Guard clauses on research-milestone, research-slice, and
  reassess-roadmap dispatch rules
- Skipped phases return null (fall-through), preserving state machine
- Budget profile skips all research + reassess; balanced skips slice
  research only

Context compression:
- inlineLevel parameter (full/standard/minimal) on 6 prompt builders
- Minimal: only output template + essential context (≥30% reduction)
- Standard: skip redundant templates
- Full: current behavior unchanged

Complexity routing:
- classifyTaskComplexity() for task plans (step/file/signal heuristics)
- classifyUnitComplexity() for unit types with budget pressure
  thresholds at 50/75/90% (from #579)
- execution_simple model config for cheap simple-task routing
- escalateTier() for failure recovery (light→standard→heavy)

Adaptive learning (from #579):
- routing-history.ts tracks success/failure per tier per pattern
- Rolling 50-entry window, 20% failure threshold auto-bumps tier
- User feedback weighted 2x vs automatic detection
- Persists to .gsd/routing-history.json

Budget prediction:
- getAverageCostPerUnitType() + predictRemainingCost() in metrics
- projectedRemainingCost + profileDowngraded in AutoDashboardData
- One-way auto-downgrade within a milestone (D048)

Addresses #575

95 tests across 5 test files, all passing.
2026-03-15 22:20:38 -06:00
Flux Labs
4c283192bd fix: allow stopping auto-mode from a different terminal (#586)
* fix: allow stopping auto-mode from a different terminal (#584)

Auto-mode lock file was written to the worktree path instead of the
project root, making it invisible to other processes. Additionally,
/gsd stop only checked in-memory state which is process-local.

- Add lockBase() helper to always write auto.lock at project root
- Add stopAutoRemote() for cross-process stop via SIGTERM
- Update /gsd stop to fall back to lock-file-based remote stop

* fix: handle Windows SIGTERM behavior in stop-auto-remote test

On Windows, SIGTERM is not interceptable by Node.js processes — the
process exits with code 1 rather than running the SIGTERM handler.
Accept either exit code on Windows while still asserting clean exit (0)
on Unix platforms.
2026-03-15 22:19:04 -06:00
Flux Labs
5866bb0b27 fix: parse cache collision causing false loop detection on complete-slice (#583)
cacheKey() used length + first/last 100 chars, which collides when a
checkbox changes [ ] → [x] mid-file (same length, same endpoints).
verifyExpectedArtifact() only cleared the path cache, not the parse
cache, so parseRoadmap() returned stale data with done=false.

- Add clearParseCache() to verifyExpectedArtifact alongside clearPathCache
- Include middle 100-char sample in cacheKey to prevent interior collisions
- Add regression test for the cache collision scenario
2026-03-15 22:10:48 -06:00
Flux Labs
5a662c4655 feat: add git.commit_docs setting to keep .gsd/ local-only (#588)
* feat: add git.commit_docs setting to keep .gsd/ local-only (#501)

Adds a new `commit_docs` boolean to git preferences. When set to `false`:
- The entire `.gsd/` directory is added to `.gitignore`
- `smartStage()` excludes all `.gsd/` files from commits
- Bootstrap init skips the "chore: init gsd" commit
- `writeIntegrationBranch()` skips committing metadata
- The self-heal that removes blanket `.gsd/` patterns is bypassed

This allows users in corporate environments or mixed teams to use GSD
without polluting the shared git repository with planning artifacts.

Closes #501

* feat: add commit_docs toggle to preferences wizard

Adds "Track .gsd/ planning docs in git" to the /gsd prefs wizard,
allowing users to toggle commit_docs interactively alongside other
git settings like main_branch.
2026-03-15 22:09:29 -06:00
Lex Christopherson
acb598c4b8 2.16.0 2026-03-15 20:29:48 -06:00
Lex Christopherson
51bb27c334 docs: update changelog for v2.16.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:29:34 -06:00
Lex Christopherson
f1401bb7f6 docs: add /gsd steer to commands table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:28:32 -06:00
Lex Christopherson
c9c110fa8d fix: auto-mode continues after guided milestone planning
The guided flow's "Create roadmap" path never set pendingAutoStart,
so checkAutoStartAfterDiscuss() always returned false after planning
completed. Auto-mode stalled at "Milestone planned" instead of
proceeding to slice research/execution.

Three fixes:
- Set pendingAutoStart when choice === "plan" in showSmartEntry
- Relax Gate 1 to accept ROADMAP.md (plan path) or CONTEXT.md (discuss path)
- Add STATE.md write instruction to guided-plan-milestone prompt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:28:32 -06:00
Lex Christopherson
f0c1a89146 chore(M004): record integration branch 2026-03-15 20:28:32 -06:00
Lex Christopherson
3a90165f38 docs(M004): context, requirements, and roadmap 2026-03-15 20:28:32 -06:00
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