Tom Boucher
fe16143e29
fix(sdk): align hotpath observability with actual dispatch mode
2026-05-05 20:22:03 -04:00
Tom Boucher
0026065c7a
feat(sdk): add strict mode and explicit fallback policy to runtime bridge
2026-05-05 19:23:39 -04:00
Tom Boucher
5975f06b6a
refactor(query): extract command catalog seam for registry wiring ( #3060 )
...
* refactor(sdk): extract gsdtools transport seam with per-command policy
* refactor(query): centralize registry command catalog wiring
* refactor(query): unify command resolution seam across sdk callers
* fix(sdk): address CodeRabbit transport policy and timeout findings
* refactor(query): extract mutation event mapper seam
* refactor(query): converge mutation and transport policy data
* refactor(query): share fallback orchestration across cli and sdk
* refactor(query): split static registry catalog by domain clusters
* refactor(query): extract mutation event emission decorator seam
* refactor(query): extract alias-family handler catalog module
* refactor(query): extract cjs fallback execution adapter
* refactor(query): deepen command semantics seam
* refactor(query): extract deep dispatch seam
* refactor(query): deepen cjs fallback execution seam
* refactor(query): merge routing plan into dispatch seam
* fix(query): address CodeRabbit review findings on PR #3060
Critical: prevent double-execution race by checking timeout errors
before subprocess fallback (gsd-transport.ts).
Major: fix execRaw() to respect transport policy outputMode instead
of hardcoding 'raw' (gsd-tools.ts).
Major: add explicit 30s timeout to subprocess fallback execution
(query-fallback-executor.ts).
Major: remove raw args from stderr banner to prevent secret leakage
(query-fallback-executor.ts).
Minor: ensure native text output has trailing newline for CLI parity
(query-dispatch.ts).
Update gsd-tools.test.ts to match new execRaw() behavior.
* fix(tests): update CLI integration tests for catalog-based registration
The refactoring moved handler registration from inline registry.register()
calls to catalog-based registration (registerStaticCatalog/registerAliasCatalog).
- gsd-sdk-query-registry-integration.test.cjs: collectRegisteredNames() now
also scans catalog files for handler names registered via the new system.
- bug-2492-context-coverage-gate.test.cjs: checks for catalog-based
registration (DECISION_ROUTING_STATIC_CATALOG) instead of inline strings.
- bug-2524-sdk-query-ws-flag.test.cjs: checks for dispatchNative callback
pattern instead of direct registry.dispatch() call.
* fix(query): address remaining CodeRabbit review findings
- query-command-semantics.ts: guard stats/progress rewrite so option
tokens (e.g. --pick) are not turned into subcommands, preserving the
top-level handler dispatch.
- query-dispatch.ts: formatOutput now skips --pick for text-format
responses (matching CJS fallback behavior) and surfaces a proper error
when extractField returns undefined instead of silently producing
'undefined'.
- query-dispatch.ts: fix backwards error message — 'registered' is the
restrictive policy that disables fallback, not enables it.
- tests/bug-2492-context-coverage-gate.test.cjs: check
VERIFY_DECISION_STATIC_CATALOG (the correct catalog for plan-gate
handlers) instead of DECISION_ROUTING_STATIC_CATALOG.
- tests/gsd-sdk-query-registry-integration.test.cjs: resolve catalog
variable before loading entries so the drift guard checks each
referenced catalog individually.
* refactor(query): deepen registry assembly module with strict invariants
- extract registry assembly into dedicated module
- split build vs mutation decoration internals
- add strict assembly invariants:
1) no duplicate keys
2) alias canonicals must have handlers
3) mutation commands must be registered
4) raw-output policy commands must be registered
- slim query index to thin re-export seam
- add focused registry assembly tests
- update drift-guard tests to target new seam
* test(query): add thin-seam coverage for query index re-exports
* fix(query): return structured native dispatch errors + tighten decisions.parse guard
- runQueryDispatch native path now catches adapter errors and returns
QueryDispatchResult.error instead of throwing.
- preserve legacy CLI exit contract by using code=1 for native dispatch
failures.
- strengthen bug-2492 guard: decisions.parse assertion now checks
VERIFY_DECISION_STATIC_CATALOG OR explicit command token.
2026-05-03 13:57:32 -04:00
Tom Boucher
0f98952a3d
refactor(sdk): extract GSDTools transport seam + policy ( #3058 )
...
* refactor(sdk): extract gsdtools transport seam with per-command policy
* fix(sdk): address CodeRabbit transport policy and timeout findings
* fix(sdk): harden raw transport formatting and raw-path coverage
2026-05-03 08:20:05 -04:00
Rezolv
0171f70553
feat(sdk): GSDTools native dispatch and CJS fallback routing ( #2302 Track C) ( #2342 )
2026-04-18 12:35:23 -04:00
Rezolv
d3a79917fa
feat: Phase 2 caller migration — gsd-sdk query in workflows, agents, commands ( #2179 )
...
* feat: Phase 2 caller migration — gsd-sdk query in workflows (#2122 )
Cherry-picked orchestration rewrites from feat/sdk-foundation (#2008 , 4018fee) onto current main, resolving conflicts to keep upstream worktree guards and post-merge test gate. SDK stub registry omitted (out of Phase 2 scope per #2122 ).
Refs: #2122 #2008
Made-with: Cursor
* docs: add gsd-sdk query migration blurb
Made-with: Cursor
* docs(workflows): extend Phase 2 gsd-sdk query caller migration
- Swap node gsd-tools.cjs for gsd-sdk query in review, plan-phase, execute-plan,
ship, extract_learnings, ai-integration-phase, eval-review, next, thread
- Document graphify CJS-only in gsd-planner; dual-path in CLI-TOOLS and ARCHITECTURE
- Update tests: workstreams gsd-sdk path, thread frontmatter.get, workspace init.*,
CRLF-safe autonomous frontmatter parse
- CHANGELOG: Phase 2 caller migration scope
Made-with: Cursor
* docs(phase2): USER-GUIDE + remaining gsd-sdk query call sites
- USER-GUIDE: dual-path CLI section; state validate/sync use full CJS path
- Commands: debug (config-get+tdd), quick (security note), intel Task prompt
- Agent: gsd-debug-session-manager resolve-model via jq
- Workflows: milestone-summary, forensics, next, complete-milestone/verify-work
(audit-open CJS notes), discuss-phase, progress, verify-phase, add/insert/remove
phase, transition, manager, quick workflow; remove-phase commit without --files
- Test: quick-session-management accepts frontmatter.get
- CHANGELOG: Phase 2 follow-up bullet
Made-with: Cursor
* docs(phase2): align gsd-sdk query examples in commands and agents
- init.* query names; frontmatter.get uses positional field name
- state.* handlers use positional args; commit uses positional paths
- CJS-only notes for from-gsd2 and graphify; learnings.query wording
- CHANGELOG: Phase 2 orchestration doc pass
Made-with: Cursor
* docs(phase2): normalize gsd-sdk query commit to positional file paths
- Strip --files from commit examples in workflows, references, commands
- Keep commit-to-subrepo ... --files (separate handler)
- git-planning-commit.md: document positional args
- Tests: new-project commit line, state.record-session, gates CRLF, roadmap.analyze
- CHANGELOG [Unreleased]
Made-with: Cursor
* feat(sdk): gsd-sdk query parity with gsd-tools and PR 2179 registry fixes
- Route query via longest-prefix match and dotted single-token expansion; fall back
to runGsdToolsQuery (same argv as node gsd-tools.cjs) for full CLI coverage.
- Parse gsd-sdk query permissively so gsd-tools flags (--json, --verify, etc.) are
not rejected by strict parseArgs.
- resolveGsdToolsPath: honor GSD_TOOLS_PATH; prefer bundled get-shit-done copy
over project .claude installs; export runGsdToolsQuery from the SDK.
- Fix gsd-tools audit-open (core.output; pass object for --json JSON).
- Register summary-extract as alias of summary.extract; fix audit-fix workflow to
call audit-uat instead of invalid init.audit-uat (PR review).
Updates QUERY-HANDLERS.md and CHANGELOG [Unreleased].
Made-with: Cursor
* fix(sdk): Phase 2 scope — Trek-e review (#2179 , #2122 )
- Remove gsd-sdk query passthrough to gsd-tools.cjs; drop GSD_TOOLS_PATH
- Consolidate argv routing in resolveQueryArgv(); update USAGE and QUERY-HANDLERS
- Surface @file: read failures in GSDTools.parseOutput
- execute-plan: defer Task Commit Protocol to gsd-executor
- stale-colon-refs: skip .planning/ and root CLAUDE.md (gitignored overlays)
- CHANGELOG [Unreleased]: maintainer review and routing notes
Made-with: Cursor
2026-04-15 22:46:31 -04:00
Alex Alecu
ac4836d270
feat: add Kilo CLI runtime support
2026-03-31 15:59:31 +03:00
TÂCHES
1421dc07bc
fix: resolve gsd-tools.cjs from repo-local installation before global fallback ( #1425 )
...
Probe <projectDir>/.claude/get-shit-done/bin/gsd-tools.cjs before falling back
to ~/.claude/get-shit-done/bin/gsd-tools.cjs, fixing MODULE_NOT_FOUND for
repo-local GSD installations. Also adds repo-local agent definition path.
Closes #1424
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-27 09:57:54 -06:00
TÂCHES
89f95c43ba
feat: auto --init flag, headless prompts, and prompt sanitizer ( #1417 )
...
* fix: Created 10 headless prompt files (5 workflows + 5 agents) in sdk/p…
- "sdk/prompts/workflows/execute-plan.md"
- "sdk/prompts/workflows/research-phase.md"
- "sdk/prompts/workflows/plan-phase.md"
- "sdk/prompts/workflows/verify-phase.md"
- "sdk/prompts/workflows/discuss-phase.md"
- "sdk/prompts/agents/gsd-executor.md"
- "sdk/prompts/agents/gsd-phase-researcher.md"
- "sdk/prompts/agents/gsd-planner.md"
GSD-Task: S01/T02
* feat: Created prompt-sanitizer.ts, wired headless prompt loading into P…
- "sdk/src/prompt-sanitizer.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S01/T01
* test: Added 111 unit tests covering sanitizePrompt(), headless prompt l…
- "sdk/src/prompt-sanitizer.test.ts"
- "sdk/src/headless-prompts.test.ts"
- "sdk/src/phase-prompt.test.ts"
GSD-Task: S01/T03
* feat: Wired sdkPromptsDir preference and sanitizePrompt into InitRunner…
- "sdk/src/init-runner.ts"
- "sdk/package.json"
GSD-Task: S02/T01
* feat: add --init flag to auto command for single-command PRD-to-execution
gsd-sdk auto --init @path/to/prd.md now bootstraps the project (init)
then immediately runs the autonomous phase execution loop.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* chore: add remaining headless prompt files and templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* test: Extended init-runner.test.ts with 7 sdkPromptsDir preference and…
- "sdk/src/init-runner.test.ts"
GSD-Task: S02/T03
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-26 22:40:34 -06:00
TÂCHES
596ce2d252
feat: GSD SDK — headless CLI with init + auto commands ( #1407 )
...
* test: Bootstrapped sdk/ as TypeScript ESM package with full GSD-1 PLAN.…
- "sdk/package.json"
- "sdk/tsconfig.json"
- "sdk/vitest.config.ts"
- "sdk/src/types.ts"
- "sdk/src/plan-parser.ts"
- "sdk/src/plan-parser.test.ts"
GSD-Task: S01/T01
* test: Implemented config reader and gsd-tools bridge with 25 unit tests…
- "sdk/src/config.ts"
- "sdk/src/config.test.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
GSD-Task: S01/T02
* test: Built prompt-builder, session-runner, and GSD class — 85 total un…
- "sdk/src/prompt-builder.ts"
- "sdk/src/prompt-builder.test.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/types.ts"
GSD-Task: S01/T03
* test: Created E2E integration test with fixtures proving full SDK pipel…
- "sdk/src/e2e.integration.test.ts"
- "sdk/test-fixtures/sample-plan.md"
- "sdk/test-fixtures/.planning/config.json"
- "sdk/test-fixtures/.planning/STATE.md"
- "vitest.config.ts"
- "tsconfig.json"
GSD-Task: S01/T04
* test: Added PhaseType/GSDEventType enums, 16-variant GSDEvent union, GS…
- "sdk/src/types.ts"
- "sdk/src/event-stream.ts"
- "sdk/src/logger.ts"
- "sdk/src/event-stream.test.ts"
- "sdk/src/logger.test.ts"
GSD-Task: S02/T01
* test: Built ContextEngine for phase-aware context file resolution, getT…
- "sdk/src/context-engine.ts"
- "sdk/src/tool-scoping.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/context-engine.test.ts"
- "sdk/src/tool-scoping.test.ts"
- "sdk/src/phase-prompt.test.ts"
GSD-Task: S02/T02
* test: Wired event stream into session runner, added onEvent()/addTransp…
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/e2e.integration.test.ts"
GSD-Task: S02/T03
* feat: Added PhaseStepType enum, PhaseOpInfo interface, phase lifecycle…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S03/T01
* test: Implemented PhaseRunner state machine with 39 unit tests covering…
- "sdk/src/phase-runner.ts"
- "sdk/src/phase-runner.test.ts"
GSD-Task: S03/T02
* test: Wired PhaseRunner into GSD.runPhase() public API with full re-exp…
- "sdk/src/index.ts"
- "sdk/src/phase-runner.integration.test.ts"
- "sdk/src/phase-runner.ts"
GSD-Task: S03/T03
* test: Expanded runVerifyStep with full gap closure cycle (plan → execut…
- "sdk/src/types.ts"
- "sdk/src/phase-runner.ts"
- "sdk/src/phase-runner.test.ts"
GSD-Task: S04/T02
* fix: Added 3 integration tests proving phasePlanIndex returns correct t…
- "sdk/src/phase-runner.integration.test.ts"
- "sdk/src/index.ts"
GSD-Task: S04/T03
* test: Add milestone-level types, typed roadmapAnalyze(), GSD.run() orch…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/index.ts"
- "sdk/src/milestone-runner.test.ts"
GSD-Task: S05/T01
* test: Added CLITransport (structured stdout log lines) and WSTransport…
- "sdk/src/cli-transport.ts"
- "sdk/src/cli-transport.test.ts"
- "sdk/src/ws-transport.ts"
- "sdk/src/ws-transport.test.ts"
- "sdk/src/index.ts"
- "sdk/package.json"
GSD-Task: S05/T02
* test: Added gsd-sdk CLI entry point with argument parsing, bin field, p…
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/package.json"
GSD-Task: S05/T03
* feat: Add InitNewProjectInfo type, initNewProject()/configSet() GSDTool…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/src/gsd-tools.test.ts"
GSD-Task: S01/T01
* chore: Created InitRunner orchestrator with setup → config → PROJECT.md…
- "sdk/src/init-runner.ts"
- "sdk/src/types.ts"
- "sdk/src/index.ts"
GSD-Task: S01/T02
* test: Wired InitRunner into CLI main() for full gsd-sdk init dispatch a…
- "sdk/src/cli.ts"
- "sdk/src/init-runner.test.ts"
- "sdk/src/cli.test.ts"
GSD-Task: S01/T03
* test: Add PlanCheck step, AI self-discuss, and retryOnce wrapper to Pha…
- "sdk/src/types.ts"
- "sdk/src/phase-runner.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/phase-runner.test.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S02/T01
* feat: Rewrite CLITransport with ANSI colors, phase banners, spawn indic…
- "sdk/src/cli-transport.ts"
- "sdk/src/cli-transport.test.ts"
GSD-Task: S02/T02
* test: Add `gsd-sdk auto` command with autoMode config override, USAGE t…
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/src/index.ts"
- "sdk/src/types.ts"
GSD-Task: S02/T03
* fix: CLI shebang + gsd-tools non-JSON output handling
Three bugs found during first real gsd-sdk run:
1. cli.ts shebang was commented out — shell executed JS as bash,
triggering ImageMagick's import command instead of Node
2. configSet() called exec() which JSON.parse()d the output, but
gsd-tools config-set returns 'key=value' text, not JSON.
Added execRaw() method for commands that return plain text.
3. Same JSON parse bug affected commit() (returns git SHA),
stateLoad(), verifySummary(), initExecutePhase(), stateBeginPhase(),
and phaseComplete(). All switched to execRaw().
Tests updated to match real gsd-tools output format (plain text
instead of mocked JSON). 376/376 tests pass.
2026-03-26 20:27:51 -06:00