Commit graph

2853 commits

Author SHA1 Message Date
TÂCHES
4d3ccb5b08 feat(S05/T02): Extend migrateHierarchyToDb to populate v8 planning colu…
- src/resources/extensions/gsd/md-importer.ts
- src/resources/extensions/gsd/tests/gsd-recover.test.ts
2026-03-23 11:52:46 -06:00
mastertyko
b3d12628f9 fix: prevent banner from printing twice on first run (#2251)
On first launch (before ~/.gsd/ exists), loader.ts prints a branded
ASCII logo and welcome message. Later, cli.ts unconditionally calls
printWelcomeScreen(), resulting in a duplicate banner.

Set GSD_FIRST_RUN_BANNER env flag in loader.ts after printing the
first-run banner. cli.ts now checks for this flag and skips the
welcome screen when it is already set.

The session-restart banner in register-hooks.ts is unaffected because
it only fires on non-first sessions (isFirstSession guard).

Closes #2245
2026-03-23 11:51:08 -06:00
TÂCHES
012f1cf06a fix(test): Windows CI — use double quotes in git commit message (#2252)
The symlink test used single quotes in a commit message
(`-m 'add gitignore'`) inside a `&&`-chained shell command. On Windows,
`cmd.exe` doesn't treat single quotes as string delimiters, so git
received a mangled pathspec `gitignore'`. Split into two separate `run()`
calls with double-quoted commit message, matching every other test in
the file.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:49:50 -06:00
TÂCHES
64908fc822 feat(S05/T01): Schema v10 adds replan_triggered_at column; deriveStateF…
- src/resources/extensions/gsd/gsd-db.ts
- src/resources/extensions/gsd/state.ts
- src/resources/extensions/gsd/triage-resolution.ts
- src/resources/extensions/gsd/tests/flag-file-db.test.ts
- src/resources/extensions/gsd/tests/derive-state-db.test.ts
2026-03-23 11:46:28 -06:00
TÂCHES
b8aaded95e chore(M001/S05): auto-commit after plan-slice 2026-03-23 11:37:37 -06:00
TÂCHES
4f829131f6 chore(M001/S05): auto-commit after research-slice 2026-03-23 11:29:45 -06:00
TÂCHES
953598524d fix(async-jobs): suppress duplicate follow-up for awaited job results (#2248) (#2250)
When await_job consumed async job results, onJobComplete still fired
follow-up messages for each job. Each follow-up triggered a wasteful
LLM turn where the agent could only say "Already captured...".

Add an `awaited` flag to Job. await_job sets it on all watched jobs
before waiting (avoiding a race with the promise .then() callback).
onJobComplete skips follow-up delivery for awaited jobs. Fire-and-forget
jobs still get follow-up messages as before.

Closes #2248

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:28:53 -06:00
TÂCHES
6e94a5693d chore(M001/S04): auto-commit after complete-slice 2026-03-23 11:22:11 -06:00
TÂCHES
d7994a1538 fix(S04/T04): Add planning-crossval tests proving DB↔rendered↔parsed pa…
- src/resources/extensions/gsd/tests/planning-crossval.test.ts
- src/resources/extensions/gsd/markdown-renderer.ts
- .gsd/milestones/M001/slices/S04/tasks/T04-PLAN.md
2026-03-23 11:16:24 -06:00
TÂCHES
93e46c3712 feat(S04/T03): Migrate auto-dispatch.ts (3 rules), auto-verification.ts…
- src/resources/extensions/gsd/auto-dispatch.ts
- src/resources/extensions/gsd/auto-verification.ts
- src/resources/extensions/gsd/parallel-eligibility.ts
- .gsd/milestones/M001/slices/S04/tasks/T03-PLAN.md
2026-03-23 11:09:38 -06:00
TÂCHES
08c3fcc57c feat(S04/T02): Migrate dispatch-guard.ts to DB queries with isDbAvailab…
- src/resources/extensions/gsd/dispatch-guard.ts
- src/resources/extensions/gsd/tests/dispatch-guard.test.ts
- .gsd/milestones/M001/slices/S04/tasks/T02-PLAN.md
2026-03-23 11:03:42 -06:00
TÂCHES
61c9e62d37 fix(gsd): remove force-staging of .gsd/milestones/ through symlinks (#2247) (#2249)
smartStage() was using git hash-object + update-index to bypass .gitignore
and force-stage .gsd/milestones/ files when .gsd is a symlink. This
contradicts the external state design (symlink = state lives outside repo)
and the documented deprecation of commit_docs.

Remove the force-add block, finish the commit_docs deprecation in
auto-prompts (always emit "do not commit"), and clean up the commitDocs
parameter from all call sites. The deprecation warning in
preferences-validation remains so users are told to remove the setting.

Closes #2247

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:00:02 -06:00
TÂCHES
f86882bde5 fix(S04/T01): Add schema v9 migration with sequence column on slices/ta…
- src/resources/extensions/gsd/gsd-db.ts
- src/resources/extensions/gsd/tests/schema-v9-sequence.test.ts
- .gsd/milestones/M001/slices/S04/S04-PLAN.md
- .gsd/milestones/M001/slices/S04/tasks/T01-PLAN.md
2026-03-23 10:57:27 -06:00
TÂCHES
b73f525834 docs(S04): add slice plan 2026-03-23 10:52:22 -06:00
TÂCHES
5d93a71374 chore(M001/S04): auto-commit after research-slice 2026-03-23 10:45:24 -06:00
TÂCHES
50cc29f93b chore(M001/S03): auto-commit after complete-slice 2026-03-23 10:41:21 -06:00
TÂCHES
356d54431e test(S03/T03): Register gsd_replan_slice and gsd_reassess_roadmap tools…
- src/resources/extensions/gsd/bootstrap/db-tools.ts
- src/resources/extensions/gsd/prompts/replan-slice.md
- src/resources/extensions/gsd/prompts/reassess-roadmap.md
- src/resources/extensions/gsd/tests/prompt-contracts.test.ts
2026-03-23 10:37:08 -06:00
TÂCHES
46c5d37a8d test(S03/T02): Implement reassess_roadmap handler with structural enfor…
- src/resources/extensions/gsd/tools/reassess-roadmap.ts
- src/resources/extensions/gsd/tests/reassess-handler.test.ts
- src/resources/extensions/gsd/gsd-db.ts
2026-03-23 10:33:13 -06:00
TÂCHES
b8b441fce4 fix: remove .gsd/ milestone artifacts from git index
These files were being force-staged through the symlink by
_forceAddMilestoneArtifacts() bypassing .gitignore. External state
projects should not have .gsd/ in version control.
2026-03-23 10:29:22 -06:00
TÂCHES
1acf1a6f57 test(S03/T01): Implement replan_slice handler with structural enforceme…
- src/resources/extensions/gsd/gsd-db.ts
- src/resources/extensions/gsd/markdown-renderer.ts
- src/resources/extensions/gsd/tools/replan-slice.ts
- src/resources/extensions/gsd/tests/replan-handler.test.ts
- .gsd/milestones/M001/slices/S03/S03-PLAN.md
2026-03-23 10:28:33 -06:00
TÂCHES
6ffa069f2f chore(M001/S03): auto-commit after plan-slice 2026-03-23 10:24:49 -06:00
TÂCHES
e7e22d5eca fix(gsd): remove over-broad skill activation heuristic (#2239) (#2244)
Remove the blanket loop that auto-activated every visible skill whose
name/description substring-matched tokens from extraContext and
taskPlanContent. This caused 32+ irrelevant skills (xcode-build,
ableton-lom, etc.) to load every auto-mode turn.

Skill activation now uses only explicit preference sources:
always_use_skills, skill_rules, prefer_skills, and skills_used from
task plan frontmatter.

Closes #2239

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:19:28 -06:00
TÂCHES
c5305805b5 chore(M001/S03): auto-commit after research-slice 2026-03-23 10:17:47 -06:00
TÂCHES
8e946013f3 chore(M001/S02): auto-commit after complete-slice 2026-03-23 10:14:16 -06:00
TÂCHES
d53bf56bae test(S02/T03): Update plan-slice prompt to explicitly name gsd_plan_sli…
- src/resources/extensions/gsd/prompts/plan-slice.md
- src/resources/extensions/gsd/tests/prompt-contracts.test.ts
- src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts
- .gsd/milestones/M001/slices/S02/tasks/T03-PLAN.md
2026-03-23 10:08:44 -06:00
TÂCHES
a380b8ed77 test(S02/T02): Implement DB-backed gsd_plan_slice and gsd_plan_task han…
- .gsd/milestones/M001/slices/S02/S02-PLAN.md
- src/resources/extensions/gsd/tools/plan-slice.ts
- src/resources/extensions/gsd/tools/plan-task.ts
- src/resources/extensions/gsd/bootstrap/db-tools.ts
- src/resources/extensions/gsd/gsd-db.ts
- src/resources/extensions/gsd/tests/plan-slice.test.ts
- src/resources/extensions/gsd/tests/plan-task.test.ts
2026-03-23 10:05:11 -06:00
Tom Boucher
e0c203c3e4 docs: update documentation for v2.42.0 release (#2093)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:03:32 -06:00
Tom Boucher
297845f10c fix(auth): fall through to env/fallback when OAuth credential has no registered provider (#2097)
Fixes #2083

When an OpenRouter API key is stored in auth.json as type:"oauth" (instead
of type:"api_key"), getApiKey() calls getOAuthProvider("openrouter") which
returns undefined — OpenRouter is not a registered OAuth provider. Previously,
resolveCredentialApiKey returned undefined and getApiKey returned that directly,
never reaching the env-var or fallback-resolver paths.

Now, when resolveCredentialApiKey returns undefined, getApiKey falls through
to OPENROUTER_API_KEY env var and the fallback resolver instead of silently
failing with "Authentication failed."

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:03:05 -06:00
Tom Boucher
f4ee51017a perf: startup optimizations — pre-compiled extensions, compile cache, batch discovery (#2125)
Skip jiti JIT compilation for bundled extensions that have pre-compiled .js
siblings, enable V8 bytecode caching on Node 22+, and batch directory
discovery to reduce syscalls during resource loading.

Fixes #2108

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:02:30 -06:00
TÂCHES
752b26d542 test(S02/T01): Add DB-backed slice and task plan renderers with compati…
- src/resources/extensions/gsd/markdown-renderer.ts
- src/resources/extensions/gsd/tests/markdown-renderer.test.ts
- src/resources/extensions/gsd/tests/auto-recovery.test.ts
- .gsd/KNOWLEDGE.md
2026-03-23 09:58:52 -06:00
Juan Francisco Lebrero
c75f69610f fix(lsp): bound message buffer and clean up stale client state (#2171)
Fix three sources of unbounded memory growth in the LSP client:

1. Message buffer: Add a 10 MB cap on client.messageBuffer. If an LSP
   server sends incomplete or malformed data that causes the buffer to
   exceed this limit, the buffer is discarded and reset to prevent
   runaway memory usage.

2. Client/lock map eviction: clientLocks and fileOperationLocks entries
   were never removed when a client was shut down via shutdownClient().
   Now both maps are cleaned up alongside the clients map on shutdown.

3. Idle checker lifecycle: The idle check interval now stops itself when
   no clients remain, and shutdownAll() explicitly stops it and clears
   all global maps (clients, clientLocks, fileOperationLocks).
2026-03-23 09:54:12 -06:00
Tom Boucher
a3c7992a26 fix: clean up macOS numbered .gsd collision variants (#2205) (#2210)
macOS APFS silently renames `.gsd` to `.gsd 2`, `.gsd 3`, etc. when a
directory already exists at the symlink target path. This causes GSD to
lose its state directory, making tracked planning files appear deleted.

- Add `cleanNumberedGsdVariants()` to detect and remove `.gsd <N>` entries
- Call it early in `ensureGsdSymlink()` before any existence checks
- Add `numbered_gsd_variant` doctor check that detects and auto-fixes them
- Add 19-assertion test covering directories, symlinks, mixed scenarios,
  and selective removal (only `.gsd <digits>` pattern, not `.gsd-backup`)

Fixes #2205

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:53:51 -06:00
Tom Boucher
d83000d05d feat(forensics): opt-in duplicate detection before issue creation (#2105)
* feat(forensics): opt-in duplicate detection before issue creation

Adds forensics_dedup preference (default: false) that instructs the
forensics agent to search existing issues and PRs before filing.
First-time users see an opt-in notice explaining the token cost.

Fixes #2096

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

* ci: retrigger checks

* fix(build): summary must be string[] not string in showNextAction

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:53:34 -06:00
TÂCHES
b2a88d5645 chore(M001/S02): auto-commit after plan-slice 2026-03-23 09:53:26 -06:00
mastertyko
75d2ea7fb7 test(web): isolate onboarding contract env from host machine (#2119) 2026-03-23 09:53:02 -06:00
mastertyko
06901f1c76 fix(search): keep duplicate-search loop guard armed (#2117) 2026-03-23 09:52:34 -06:00
TÂCHES
968815cd22 ci: add timeout-minutes to all CI jobs (#2148)
A hung unit test on PR #2120 ran for 3+ hours before manual cancellation,
burning ~185 minutes of Actions quota. Add timeouts to cap runaway jobs:
detect-changes (2m), docs-check/lint (5m), build/windows (15m).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:52:13 -06:00
Juan Francisco Lebrero
c366f9769f fix: clean up extension error listener on session dispose (#2165)
The dispose() method was not cleaning up _extensionErrorUnsubscriber,
causing the extension error handler to remain subscribed after session
disposal. This leads to memory leaks across session reloads as old
error handlers accumulate on the extension runner.

Also wrap the unsubscriber call in _applyExtensionBindings() with
try-catch so that if the previous unsubscriber throws, the new
subscription is still set up correctly.
2026-03-23 09:51:38 -06:00
Tom Boucher
c25b57b922 test(web): add regression tests for readdirSync in boot payload path (#2050)
Fixes #1936

The /api/boot endpoint relies on bridge-service.ts importing readdirSync
from node:fs to list session files. Without this import, listProjectSessions
throws ReferenceError and the route returns HTTP 500 on every request.

Add two guard tests:
- Source-level check that bridge-service.ts imports readdirSync
- Integration test that exercises the real filesystem session listing
  (no listSessions mock) to catch the 500 at runtime

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:51:05 -06:00
Jeremy McSpadden
de332ed3c8 fix(web): resolve 4 pre-existing onboarding contract test failures (#2209)
Two root causes fixed:

1. Route handlers gained requireProjectCwd(request) guards after the
   contract tests were written. Test requests lacked a ?project= query
   param, causing routes to short-circuit or throw NoProjectError.

2. resolveCredentialSource's third fallback (authStorage.hasAuth) called
   the module-level getEnvApiKey import directly, bypassing the
   test-injectable getEnvApiKeyFn override. Real env vars like
   OPENROUTER_API_KEY leaked into tests expecting no auth.

Changes:
- Add projectRequest() helper to attach ?project= to all test route calls
- Add noEnvApiKey() stub and scoped getEnvApiKey overrides to isolate
  tests from real environment variables
- Replace authStorage.hasAuth() with
  authStorage.getCredentialsForProvider().length in resolveCredentialSource
  to prevent env-check duplication (env is already checked via the
  overridable getEnvApiKeyFn on the preceding line)
2026-03-23 09:50:51 -06:00
Tom Boucher
97bdf3b071 fix: async bash job timeout hangs indefinitely instead of erroring out (#2214)
When an async bash job exceeds its timeout, killTree sends SIGTERM but
some processes (e.g. those trapping SIGTERM) never exit, causing the
promise to hang forever since the 'close' event never fires.

Add a three-stage escalation: SIGTERM -> SIGKILL after 5s grace ->
force-resolve after 3s hard deadline. Use settled guards to prevent
double-resolution when the close event races with the hard deadline.

Fixes #2186

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:50:27 -06:00
TÂCHES
adf7101883 chore(M001/S02): auto-commit after research-slice 2026-03-23 09:50:25 -06:00
mastertyko
b0fc552a2e fix(gsd): apply fast service tier outside auto-mode (#2126) 2026-03-23 09:49:09 -06:00
Juan Francisco Lebrero
a9667209ef fix(interactive): clean up leaked SIGINT and extension selector listeners (#2172)
- Wrap handleCtrlZ() suspend logic in try-catch so the SIGINT listener
  is removed if process.kill() or ui.stop() throws
- Dispose previous extension selector in showExtensionSelector() before
  creating a new one, preventing promise leaks on rapid calls
2026-03-23 09:48:18 -06:00
Juan Francisco Lebrero
eb48a7cdde fix(ci): standardize GitHub Actions and Node.js versions (#2169)
Update pr-risk.yml and ai-triage.yml to match the versions used by all
other CI workflows:
- actions/checkout@v4 → @v6
- actions/setup-node@v4 → @v6
- node-version: '20' → '24'

Also fix unquoted $GITHUB_OUTPUT references in pr-risk.yml shell blocks
to prevent word-splitting issues.
2026-03-23 09:48:01 -06:00
Juan Francisco Lebrero
efebd29857 fix(native): resolve memory leaks in glob, ttsr, and image overflow (#2170)
Address three critical safety issues found during codebase audit:

- glob.rs: Explicitly drop ThreadsafeFunction after glob operation
  completes to release the N-API reference immediately instead of
  relying on implicit drop ordering.

- ttsr.rs: Add handle bounds validation in ttsrCheckBuffer, recover
  from mutex poisoning via unwrap_or_else instead of returning errors,
  cap live handles at 10,000 to prevent unbounded growth, and add
  ttsrClearAll for bulk cleanup.

- image.rs: Replace unchecked (w * h * N) as usize casts with
  checked_mul arithmetic that returns a descriptive error instead of
  panicking on overflow.
2026-03-23 09:47:51 -06:00
TÂCHES
e3e37bcb15 chore(M001/S01): auto-commit after complete-slice 2026-03-23 09:47:37 -06:00
TÂCHES
ccb7b5d1ed test(S01/T04): Finalize S01 regression coverage and prove the DB-backed…
- .gsd/milestones/M001/slices/S01/tasks/T04-PLAN.md
- src/resources/extensions/gsd/tests/plan-milestone.test.ts
2026-03-23 09:43:39 -06:00
TÂCHES
04c6b79dac feat(S01/T03): Migrate planning prompts to DB-backed tool guidance and…
- src/resources/extensions/gsd/prompts/plan-milestone.md
- src/resources/extensions/gsd/prompts/guided-plan-milestone.md
- src/resources/extensions/gsd/prompts/plan-slice.md
- src/resources/extensions/gsd/prompts/replan-slice.md
- src/resources/extensions/gsd/prompts/reassess-roadmap.md
- src/resources/extensions/gsd/auto-post-unit.ts
- src/resources/extensions/gsd/tests/prompt-contracts.test.ts
- src/resources/extensions/gsd/tests/rogue-file-detection.test.ts
2026-03-23 09:39:24 -06:00
TÂCHES
b75183b642 test(S01/T02): Added the DB-backed gsd_plan_milestone handler, tool reg…
- src/resources/extensions/gsd/tools/plan-milestone.ts
- src/resources/extensions/gsd/bootstrap/db-tools.ts
- src/resources/extensions/gsd/markdown-renderer.ts
- src/resources/extensions/gsd/tests/plan-milestone.test.ts
2026-03-23 09:31:40 -06:00