Commit graph

1011 commits

Author SHA1 Message Date
Jeremy McSpadden
eb302fe1d2 feat: parallel milestone orchestration foundation (#672)
Add infrastructure for parallel milestone execution behind
`parallel.enabled: false` flag (opt-in, zero impact to existing users).

New modules:
- session-status-io.ts: File-based IPC protocol with atomic writes,
  signal lifecycle (pause/resume/stop), and stale session detection
- parallel-eligibility.ts: Milestone parallelism analysis checking
  dependency satisfaction and file overlap across slice plans
- parallel-orchestrator.ts: Core orchestrator managing worker lifecycle,
  budget tracking, and coordination via session status files
- /gsd parallel [start|status|stop|pause|resume] command handlers

Modified:
- types.ts: ParallelConfig interface (enabled, max_workers, budget_ceiling,
  merge_strategy, auto_merge)
- preferences.ts: Parallel config validation, merging, and resolver
- commands.ts: /gsd parallel subcommand routing with argument completions

Tests: 39 new tests covering session I/O roundtrip, signal lifecycle,
stale detection, eligibility formatting, orchestrator lifecycle,
budget enforcement, and preference validation.
2026-03-16 20:32:10 -06:00
TÂCHES
392b75a4db Merge pull request #767 from trek-e/fix/759-auto-mode-stale-state-loop
fix: prevent stale state loop on auto-mode restart with existing worktree (#759)
2026-03-16 20:29:43 -06:00
TÂCHES
6a452f27d9 Merge pull request #750 from jeremymcs/fix/startup-lazy-loading
perf: lazy-load LLM provider SDKs to reduce startup time
2026-03-16 20:28:32 -06:00
Tom Boucher
aafd254f45 fix: prevent stale state loop on auto-mode restart with existing worktree (#759)
Two compounding bugs caused auto-mode to loop infinitely after stopping
and restarting when a worktree with committed progress existed:

Bug 1: copyPlanningArtifacts overwrites worktree state on restart

When auto-mode restarts and the milestone branch exists (worktree dir was
removed but branch preserved), createAutoWorktree re-attaches the worktree
to the existing branch — git correctly checks out the committed state with
[x] checkboxes. But then copyPlanningArtifacts unconditionally copies the
project root's .gsd/milestones/ into the worktree, overwriting the correct
[x] with stale [ ] from the root (which isn't always fully synced).

Fix: Skip copyPlanningArtifacts when branchExists is true. The branch
checkout already has the correct artifacts from committed work.

Bug 2: deriveState reads stale content from SQLite DB

deriveState had a DB-first content loading path that read artifact content
from the SQLite artifacts table. This table was populated once during
migrateFromMarkdown and never updated when files changed on disk (roadmap
checkbox updates, plan changes, etc.). Even after fixing files on disk,
deriveState returned stale DB content, keeping the state machine stuck.

Fix: Remove the DB content loading path from deriveState entirely. The
native Rust batch parser (nativeBatchParseGsdFiles) reads all .md files
in one call and is fast enough. The DB is still used for structured queries
(decisions, requirements) but no longer as a content cache for state
derivation.

Updated derive-state-db.test.ts Test 5 to write requirements to disk
instead of testing the now-removed DB-only content path.
2026-03-16 22:20:30 -04:00
TÂCHES
ebde7501dd Merge pull request #748 from jeremymcs/fix/739-epipe-stale-research-state
fix(auto): prevent runaway execute-task when task plan missing after failed research (#739)
2026-03-16 20:02:27 -06:00
TÂCHES
30dad00965 Merge pull request #758 from jeremymcs/fix/757-worktree-merge-checkout
fix: skip redundant checkout in worktree merge when main already current
2026-03-16 20:02:06 -06:00
Jeremy McSpadden
00438b2bb4 fix: skip redundant checkout in worktree merge when main already current (#757)
When mergeMilestoneToMain runs from a worktree context, main is already
checked out at the project root. The unconditional git checkout main
fails with "already used by worktree" because git refuses to checkout a
branch that is active in another worktree.

Skip the checkout when the integration branch is already current at the
project root, which is always the case in worktree-mode merges.
2026-03-16 20:24:24 -05:00
Jeremy McSpadden
a5660e05cc Merge branch 'main' into fix/739-epipe-stale-research-state
Resolve conflicts between #699 (empty scaffold rejection) and #739
(task plan file verification) in auto-dispatch.ts imports and
auto-recovery.test.ts tests.

- auto-dispatch.ts: merged imports from both branches (resolveTaskFile
  from #739, resolveMilestonePath/buildMilestoneFileName from main)
- auto-recovery.test.ts: included all tests from both #699 (empty
  scaffold, actual tasks, completed tasks) and #739 (all task plans
  exist, missing task plan, no tasks). Updated #699 tests to create
  task plan files alongside slice plans to satisfy #739's verification.
  Updated #739 "no tasks" test to expect false per #699's requirement
  that plans must have task entries.
- auto-recovery.ts: auto-merged cleanly, both checks coexist

All 26 recovery tests pass. Full build clean.
2026-03-16 20:08:01 -05:00
TÂCHES
3cf6b35b8a Merge pull request #736 from gsd-build/feat/validate-milestone-code
feat(gsd): implement validate-milestone phase and dispatch
2026-03-16 18:57:45 -06:00
Lex Christopherson
d91690bb44 2.23.0 2026-03-16 18:57:13 -06:00
Lex Christopherson
50d6a52a2a docs: update changelog for v2.23.0 2026-03-16 18:57:02 -06:00
TÂCHES
5b3d9fff17 Merge pull request #713 from frizynn/feat/gsd-headless-command
feat: redesign gsd headless for full workflow orchestration
2026-03-16 18:49:05 -06:00
TÂCHES
83cc25fc90 Merge branch 'main' into fix/739-epipe-stale-research-state 2026-03-16 18:48:09 -06:00
Lex Christopherson
09d62e01d1 feat(gsd): implement validate-milestone phase and dispatch
Add a `validating-milestone` phase that runs BEFORE `completing-milestone`
to reconcile planned work against delivered work. The validator checks
success criteria, slice deliverables, cross-slice integration, and
requirement coverage before allowing milestone completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 18:46:08 -06:00
TÂCHES
e0c1cc2f9d Merge branch 'main' into feat/gsd-headless-command 2026-03-16 18:44:18 -06:00
TÂCHES
889a2ee137 Merge pull request #755 from jeremymcs/feat/vscode-marketplace
feat(vscode): marketplace-ready files for VS Code extension publishing
2026-03-16 18:43:31 -06:00
TÂCHES
1e951f9648 Merge pull request #718 from jeremymcs/fix/682-vscode-extension-rebase
feat: VS Code extension — rebased with CI + review fixes (#682)
2026-03-16 18:42:30 -06:00
TÂCHES
4d78620ff1 Merge pull request #754 from jeremymcs/fix/forensics-version-loading
fix(forensics): use GSD_VERSION env var instead of package.json path traversal
2026-03-16 18:42:09 -06:00
TÂCHES
08a34abb08 Merge pull request #753 from jeremymcs/docs/update-all-recent-changes
docs: update documentation for all post-2.22.0 changes
2026-03-16 18:41:51 -06:00
TÂCHES
0f13a8d59c Merge pull request #752 from jeremymcs/feat/688-guided-discuss-milestone
feat(discuss): structured question rounds in guided-discuss-milestone (#688)
2026-03-16 18:41:37 -06:00
TÂCHES
f4f998efc5 Merge pull request #747 from trek-e/fix/733-bash-ampersand-hang
fix: add anti-pattern rule against bash with & to prevent agent hangs (#733)
2026-03-16 18:38:40 -06:00
TÂCHES
8ca9725bb0 Merge pull request #745 from jeremymcs/fix/737-dependency-range-expansion
fix(roadmap): expand range syntax in depends (S01-S04 → S01,S02,S03,S04)
2026-03-16 18:37:53 -06:00
TÂCHES
10f4ac0817 Merge pull request #743 from gtrak/feat/models-json-resolver-v2
feat: Add models.json resolution with fallback to ~/.pi/agent/models.json
2026-03-16 18:37:04 -06:00
TÂCHES
a129e15759 Merge pull request #738 from jeremymcs/fix/733-background-command-hang
fix: prevent indefinite hang when LLM uses bare & to background processes (#733)
2026-03-16 18:36:29 -06:00
TÂCHES
3354f6300c Merge pull request #735 from trek-e/fix/699-plan-slice-empty-scaffold
fix: reject empty scaffold plan files in plan-slice artifact verification (#699)
2026-03-16 18:35:38 -06:00
TÂCHES
4df08ad935 Merge pull request #734 from jeremymcs/fix/728-skip-loop-breaker
fix(auto): break infinite skip loop on repeatedly-skipped completed units
2026-03-16 18:35:04 -06:00
TÂCHES
d8ebe1300a Merge pull request #729 from jeremymcs/fix/724-forensics-worktree-awareness
fix: make forensics worktree-aware to prevent stale root misdiagnosis (#724)
2026-03-16 18:34:46 -06:00
TÂCHES
f9c356bfba Merge pull request #730 from gsd-build/feat/validate-milestone-prompt
feat(gsd): add validate-milestone prompt and template
2026-03-16 18:34:29 -06:00
Jeremy McSpadden
02e3c441cc feat(vscode): enhance chat participant UX
- Auto-start agent when not connected instead of showing error
- Remove noisy tool-completion markdown spam (was printing *Tool X completed* for every call)
- Inject #file references from chat into the prompt automatically
- Add clickable file anchors for files written/edited during the session
- Add follow-up suggestions: /gsd status, /gsd auto, /gsd capture
- Improve tool progress labels (WebSearch, WebFetch, cleaner paths)
- Better error message when agent fails to start
2026-03-16 19:22:15 -05:00
Jeremy McSpadden
8db680c405 feat(vscode): set logo.jpg as extension marketplace icon 2026-03-16 19:16:29 -05:00
Jeremy McSpadden
c465bf7d18 fix(vscode): set publisher to FluxLabs to match marketplace account 2026-03-16 19:14:36 -05:00
Jeremy McSpadden
3f88619fac refactor(vscode): rename extension to GSD-2 2026-03-16 19:12:13 -05:00
Jeremy McSpadden
6e90e8d83b perf: optimize bg-shell hot path, parallel git queries, lazy workspace validation
- bg-shell/types: add compiled union regexes (ERROR/WARNING/READINESS/BUILD/TEST)
  built once at module load; add LINE_DEDUP_MAX constant (500); add
  stdoutLineCount/stderrLineCount tracked fields to BgProcess; export
  PORT_PATTERN_SOURCE string to avoid .source access per line

- bg-shell/output-formatter: analyzeLine uses union regexes instead of
  .some(p => p.test(line)) across 5 pattern arrays; PORT_PATTERN no longer
  reconstructed via new RegExp() on every line; lineDedup Map now has LRU
  eviction at LINE_DEDUP_MAX entries (prevents unbounded memory growth on
  long-running processes); getHighlights also uses union regexes

- bg-shell/process-manager: addOutputLine increments stdoutLineCount/
  stderrLineCount in O(1) as lines arrive; getInfo uses tracked counters
  instead of two O(n) .filter() passes over the output buffer

- gsd/diff-context: replace execFileSync with async execFile wrapper;
  getRecentlyChangedFiles and getChangedFilesWithContext now run all
  independent git queries concurrently via Promise.all (3-5 serial
  subprocess spawns -> 1 parallel batch)

- gsd/workspace-index: per-slice indexing now runs concurrently via
  Promise.all within each milestone; add IndexWorkspaceOptions with
  validate flag (default false) — validatePlanBoundary/validateCompleteBoundary
  skipped by default since they do expensive content analysis and are only
  needed for explicit doctor/audit flows; getSuggestedNextCommands passes
  validate:true as the sole consumer of validationIssues
2026-03-16 19:11:43 -05:00
Jeremy McSpadden
2df27c5179 feat(vscode): add marketplace-ready files for VS Code extension publishing
Adds everything needed to publish the extension to the VS Code Marketplace:

- README.md — full feature documentation with commands table, keyboard
  shortcuts, configuration reference, quick start guide, and @gsd chat
  participant usage
- CHANGELOG.md — initial 0.1.0 release notes
- .vscodeignore — excludes src/, tsconfig, maps from the .vsix package
- .gitignore — excludes dist/ and *.vsix from version control
- LICENSE — MIT license copied from repo root
- package.json — adds repository, homepage, bugs, keywords, galleryBanner
  fields required by the marketplace; adds @vscode/vsce to devDependencies;
  adds publish script

Verified: `npm run package` produces a clean 30KB .vsix with no warnings.
Run `npm run publish` with a VSCE_PAT token to publish.
2026-03-16 19:09:28 -05:00
Jeremy McSpadden
359deb6c23 fix(forensics): use GSD_VERSION env var instead of package.json path traversal
Extensions run from ~/.gsd/agent/extensions/gsd/ at runtime, not from the
package install directory. The previous code traversed 4 levels up from
import.meta.url to find package.json, which resolves to ~/package.json at
runtime — wrong on every system.

The loader already sets process.env.GSD_VERSION at startup, which is how
every other extension reads the version. Use that instead.
2026-03-16 18:54:30 -05:00
Jeremy McSpadden
6fd87c1936 docs: update documentation for all post-2.22.0 changes
- CHANGELOG: fill in [Unreleased] with gsd sessions, 10 new browser
  tools, visualizer shift-tab fix, capture resolution fix, screenshot
  constraint fix, auto.lock fix, and cross-platform test fix
- README: add gsd sessions to CLI reference table; expand Browser Tools
  description to cover the 13 new tools shipped in #698
- docs/commands.md: add gsd sessions to CLI Flags table
- docs/getting-started.md: document gsd sessions in Resume a Session
- docs/proposals/698: mark status as Shipped, update Current State
  section to reflect the 13 implemented tools
2026-03-16 18:48:52 -05:00
Jeremy McSpadden
67847a6547 fix(ci): use pi.getActiveTools() instead of ctx.getActiveTools()
ExtensionContext in the published package does not have getActiveTools —
it lives on ExtensionAPI (pi). The local source has it on both but CI
typechecks against the installed package, which failed with:

  Property 'getActiveTools' does not exist on type 'ExtensionCommandContext'
2026-03-16 18:44:21 -05:00
Jeremy McSpadden
18aa6b1084 feat(discuss): structured ask_user_questions rounds in guided-discuss-milestone (#688)
guided-discuss-milestone.md was a single-paragraph stub — the agent had
no interview protocol, no check-in round, no depth verification, and no
host-conditional behaviour. On Copilot this meant every clarification
burned a separate request with no structure.

Changes:

- guided-discuss-milestone.md: full interview protocol matching
  guided-discuss-slice structure:
  - mandatory investigation pass before first round
  - 1–3 questions per round
  - check-in after each round (wrap up vs keep going)
  - depth verification checklist before wrap-up
  - host-conditional: uses ask_user_questions when available (pi),
    falls back to plain text when not (Copilot, Cursor, Windsurf)
  - depth_verification question ID convention preserved for the
    write-gate in index.ts

- guided-flow.ts: all 5 loadPrompt('guided-discuss-milestone') call
  sites now pass structuredQuestionsAvailable by checking
  ctx.getActiveTools().includes('ask_user_questions') at dispatch time.
  Returns 'true'/'false' string so the prompt can branch conditionally.
2026-03-16 18:39:31 -05:00
Jeremy McSpadden
6d77724378 perf: lazy-load LLM provider SDKs to reduce startup time
All major LLM provider SDKs were loaded eagerly at startup, penalizing
users regardless of which provider they actually use. This change defers
SDK loading until first API call for:

- @anthropic-ai/sdk (anthropic.ts)
- openai (openai-responses.ts, openai-completions.ts, azure-openai-responses.ts)
- @google/genai (google-vertex.ts)

The Bedrock provider already used this pattern. Now all 5 remaining
providers use the same async lazy-loader pattern:
- Static import changed to `import type` (erased at compile time)
- Module-level `let _SdkClass` cache variable
- `async function getSdkClass()` loader with singleton caching
- `createClient()` made async, uses `await getSdkClass()`
- Call sites updated with `await createClient()`

For google-vertex.ts, ThinkingLevel enum usage replaced with equivalent
string literals to eliminate the runtime import entirely.

All packages build cleanly. The startup improvement is proportional to
how many providers were installed — on typical installs this eliminates
eager loading of 30-40MB of SDK code.
2026-03-16 18:33:24 -05:00
Jeremy McSpadden
ac3853f20c fix(auto): prevent runaway execute-task when task plan missing after failed research (#739)
Four-part fix for the failure chain reported in #739:

1. **Dispatch guard** (auto-dispatch.ts): refuse to dispatch execute-task
   when T{tid}-PLAN.md is missing on disk. Emits a stop action with a
   clear error message instead of sending the agent in blind with a
   missing plan, which was the proximate cause of the runaway session
   and eventual EPIPE crash.

2. **verifyExpectedArtifact for plan-slice** (auto-recovery.ts): after
   verifying S{sid}-PLAN.md exists, also check that every task listed in
   the plan has a corresponding T{tid}-PLAN.md. A plan-slice that wrote
   the slice plan but omitted task plans was previously considered
   complete, allowing the dispatch guard above to be bypassed on
   idempotency replay.

3. **EPIPE guard** (index.ts): register an uncaughtException handler at
   extension load time that catches EPIPE (broken stdio pipe) and exits
   cleanly instead of crashing with an unhandled exception. The crash in
   #739 was triggered by process.stderr.write() calls to a closed pipe
   during LSP diagnostics in the execute-task session.

4. **Prompt hardening** (prompts/research-slice.md): explicitly note that
   the research template is already inlined in the prompt and must not be
   read from disk. The agent in #739 hallucinated a read of
   templates/SLICE-RESEARCH.md (ENOENT), causing the subagent to abort,
   which left no S03-RESEARCH.md and poisoned the downstream plan-slice.
2026-03-16 18:24:08 -05:00
Tom Boucher
75a5dd08ad fix: add anti-pattern rule against bash with & to prevent agent hangs (#733)
The bash tool waits for stdout/stderr file descriptors to close. When the
LLM runs 'python -m http.server 8080 &', the backgrounded process inherits
stdout and keeps it open — the bash call hangs indefinitely.

The bg_shell tool exists for exactly this purpose (detached process groups,
readiness detection, lifecycle management). The system prompt already said
to use bg_shell for servers but didn't explicitly warn against bash with &.

Added:
- Explicit anti-pattern: 'Never use bash with & to background a process'
- Expanded background processes section explaining why & hangs
- Both reference bg_shell start as the correct alternative
2026-03-16 19:20:09 -04:00
Jeremy McSpadden
4774a1df22 fix(roadmap): expand range syntax in depends (S01-S04 → S01,S02,S03,S04)
LLMs frequently write depends:[S01-S04] as natural shorthand.
The parser split only on commas, so this produced a single literal
element "S01-S04" that never matched any real slice ID —
permanently blocking the slice with "No slice eligible".

Changes:

roadmap-slices.ts:
- Add expandDependencies() helper — after comma-split, detect dep
  tokens matching /^PrefixN(-|..)PrefixM$/ and expand to individual
  IDs. Handles S01-S04 (dash range) and S01..S04 (dot-range).
  Zero-padding preserved. Mismatched prefixes and reversed ranges
  pass through unchanged.
- Wire into parseRoadmapSlices() after the comma-split step.
- Export for direct testing.

doctor.ts:
- Add "unresolvable_dependency" warning code.
- In the slice audit loop, check each dep against the set of known
  slice IDs in the roadmap. Fires a warning with the bad dep name
  and the correct format hint. Catches leftover range IDs on roadmaps
  that were written before this fix, and catches typos.

plan-milestone.md prompt:
- Add explicit rule: use comma-separated depends:[S01,S02,S03], never
  range syntax. Defense-in-depth so LLMs don't generate the problem.

Tests:
- roadmap-slices.test.ts: 10 new expandDependencies cases + 2
  parseRoadmapSlices integration cases (range + comma round-trip).
- doctor.test.ts: unresolvable_dependency fires for unknown dep S99,
  does not fire for valid S01 dep.

952/952 unit tests pass.
Closes #737
2026-03-16 18:09:06 -05:00
Tom Boucher
2756428e6e fix: reject empty scaffold plan files in plan-slice artifact verification (#699)
verifyExpectedArtifact() for plan-slice units only checked whether the
plan file existed on disk, not whether it contained actual task entries.
When a plan file was created as an empty scaffold during discussion/context
(headings but no tasks), the artifact check considered it 'complete' and
skipped the dispatch. Since deriveState still returned phase:'planning'
(no tasks found), this created an infinite skip loop until auto-mode
exhausted its retry budget and stopped silently.

Added a content check that requires at least one task entry matching
the pattern '- [ ] **T##:' or '- [x] **T##:' before considering a
plan-slice artifact valid. This mirrors the existing content-aware
check used for execute-task (which verifies checkbox state).

Added 3 regression tests covering empty scaffold, valid tasks, and
completed tasks.
2026-03-16 19:07:37 -04:00
Gary Trakhman
49c7c0d540 feat: Add models.json resolution with fallback to ~/.pi/agent/models.json
- Create src/models-resolver.ts with resolveModelsJsonPath() function
- Fallback chain: ~/.gsd/agent/models.json → ~/.pi/agent/models.json → create new
- Integrate into cli.ts ModelRegistry initialization
- Provides smooth migration path for users with existing pi-coding-agent config
2026-03-16 23:05:59 +00:00
TÂCHES
d10412bb1e Merge pull request #727 from jeremymcs/fix/723-auto-lock-creation 2026-03-16 17:04:39 -06:00
Jeremy McSpadden
ae4ae8e8d8 fix(auto): add stalled-tool detection and background process prompt guidance
Two additional layers to address #733 (background command hang):

1. Stalled-tool detection in idle watchdog (auto.ts)
   - Change inFlightTools from Set<string> to Map<string, number> to
     track per-tool start timestamps
   - Idle watchdog now compares the oldest in-flight tool's age to the
     idle timeout. Tools in-flight for < idleTimeoutMs continue to
     suppress recovery as before. Tools running >= idleTimeoutMs are
     treated as stuck and recovery proceeds — preventing infinite hang
     when the bash rewrite is bypassed or a tool hangs for other reasons.
   - Export getOldestInFlightToolAgeMs() for testability

2. Prompt guidance in execute-task.md
   - Add explicit "Background process rule" to step 5 explaining why
     bare `command &` hangs the Bash tool and showing the correct
     `command > /dev/null 2>&1 &` pattern
   - Recommends bg_shell tool as the preferred approach

3. Test updates (in-flight-tool-tracking.test.ts)
   - Import and verify getOldestInFlightToolAgeMs export
   - Update header comment to reflect Map-with-timestamps design
2026-03-16 18:04:27 -05:00
Jeremy McSpadden
a3ff25c668 fix(bash): rewrite background commands to prevent pipe-open hang
Root cause: when the LLM runs `cmd &`, bash forks the process and
exits immediately. The forked process inherits Node's piped stdout/
stderr FDs. Node.js waits for all holders of those FDs to close before
firing the 'close' event — so the tool hangs until the background
process exits (which for a server is never).

Fix: add rewriteBackgroundCommand() in bash.ts. Before exec, detect
commands with a trailing & background operator and inject
>/dev/null 2>&1 before the & when stdout is not already redirected.
This severs the pipe inheritance so Node gets 'close' immediately
when the shell exits.

Guards:
- Commands already redirecting stdout (>, >>, &>, |) are not rewritten
- && (logical AND) is not affected
- & inside single-quoted strings is not affected
- A brief onUpdate advisory is surfaced when rewrite happens so the
  LLM knows to prefer nohup/setsid for robust detachment

Export rewriteBackgroundCommand from pi-coding-agent for testability.

Tests: bash-background.test.ts — 12 cases covering no-op paths,
rewrite paths, compound commands, and already-safe nohup patterns.
Closes #733
2026-03-16 18:03:01 -05:00
Jeremy McSpadden
742cd70c9b fix(auto): break infinite skip loop on repeatedly-skipped completed units
When deriveState() keeps returning the same already-completed unit,
the idempotency skip paths in dispatchNextUnit recursively call
themselves forever. The existing MAX_SKIP_DEPTH (20) breaker yields
to the UI but then re-enters the same loop; the hard lifetime counter
(unitLifetimeDispatches) is never reached because skip paths return
before touching it.

Root cause: no per-unit counter on the skip-only path.

Fix:
- Add unitConsecutiveSkips map + MAX_CONSECUTIVE_SKIPS = 3
- Both skip paths (completedKeySet hit, and fallback artifact-exists)
  increment the counter on each skip of the same idempotencyKey
- When the counter exceeds MAX_CONSECUTIVE_SKIPS, evict the key from
  completedKeySet and persisted storage, invalidate state, and let
  deriveState reconcile on the next real dispatch
- Counter resets to 0 for a given key whenever a real dispatch
  proceeds (i.e., past both skip paths)
- Counter fully cleared at all 4 existing clear sites (stopAuto,
  startAuto, crash recovery, pause/resume)

Export _getUnitConsecutiveSkips / _resetUnitConsecutiveSkips /
MAX_CONSECUTIVE_SKIPS for testability (same pattern as
doctor-proactive.ts resetProactiveHealing).

Tests: auto-skip-loop.test.ts — counter mechanics, threshold bounds,
eviction round-trip, per-key isolation (10 assertions).
Closes #728
2026-03-16 17:48:39 -05:00
frizynn
f56b8c69f0 fix: simplify headless flags, add missing imports, document headless mode
- Remove --verbose flag from headless (use --json for detailed output)
- Remove redundant sawToolExecution state variable
- Remove unused rejectCompletion
- Add missing build*Prompt imports in auto.ts (fixes CI typecheck:extensions)
- Document headless mode in README.md and docs/commands.md
- Simplify help text with examples instead of exhaustive command catalog
2026-03-16 19:46:56 -03:00
frizynn
8ddea154e5 feat: redesign gsd headless for full workflow orchestration
Replace --step flag with positional command routing so any /gsd
subcommand can run headlessly. Add /gsd dispatch <phase> for direct
unit-type dispatch (research, plan, execute, complete, reassess, uat,
replan) with state-aware resolution.

Quick commands (status, queue, doctor, etc.) resolve on first agent_end.
Long-running commands (auto, next, dispatch) use idle timer + terminal
notification detection.
2026-03-16 19:45:39 -03:00