Rezolv
c5b1445529
feat(sdk): golden parity harness and query handler CJS alignment ( #2302 Track A) ( #2341 )
...
* feat(sdk): golden parity harness and query handler CJS alignment (#2302 Track A)
Golden/read-only parity tests and registry alignment, query handler fixes
(check-completion, state-mutation, commit, validate, summary, etc.), and
WAITING.json dual-write for .gsd/.planning readers.
Refs gsd-build/get-shit-done#2341
* fix(sdk): getMilestoneInfo matches GSD ROADMAP (🟡 , last bold, STATE fallback)
- Recognize in-flight 🟡 milestone bullets like 🚧 .
- Derive from last **vX.Y Title** before ## Phases when emoji absent.
- Fall back to STATE.md milestone when ROADMAP is missing; use last bare vX.Y
in cleaned text instead of first (avoids v1.0 from shipped list).
- Fixes init.execute-phase milestone_version and buildStateFrontmatter after
state.begin-phase (syncStateFrontmatter).
* feat(sdk): phase list, plan task structure, requirements extract handlers
- Register phase.list-plans, phase.list-artifacts, plan.task-structure,
requirements.extract-from-plans (SDK-only; golden-policy exceptions).
- Add unit tests; document in QUERY-HANDLERS.md.
- writeProfile: honor --output, render dimensions, return profile_path and dimensions_scored.
* feat(sdk): centralize getGsdAgentsDir in query helpers
Extract agent directory resolution to helpers (GSD_AGENTS_DIR, primary
~/.claude/agents, legacy path). Use from init and docs-init init bundles.
docs(15): add 15-CONTEXT for autonomous phase-15 run.
* feat(sdk): query CLI CJS fallback and session correlation
- createRegistry(eventStream, sessionId) threads correlation into mutation events
- gsd-sdk query falls back to gsd-tools.cjs when no native handler matches
(disable with GSD_QUERY_FALLBACK=off); stderr bridge warnings
- Export createRegistry from @gsd-build/sdk; add sdk/README.md
- Update QUERY-HANDLERS.md and registry module docs for fallback + sessionId
- Agents: prefer node dist/cli.js query over cat/grep for STATE and plans
* fix(sdk): init phase_found parity, docs-init agents path, state field extract
- Normalize findPhase not-found to null before roadmap fallback (matches findPhaseInternal)
- docs-init: use detectRuntime + resolveAgentsDir for checkAgentsInstalled
- state.cjs stateExtractField: horizontal whitespace only after colon (YAML progress guard)
- Tests: commit_docs default true; config-get golden uses temp config; golden integration green
Refs: #2302
* refactor(sdk): share SessionJsonlRecord in profile-extract-messages
CodeRabbit nit: dedupe JSONL record shape for isGenuineUserMessage and streamExtractMessages.
* fix(sdk): address CodeRabbit major threads (paths, gates, audit, verify)
- Resolve @file: and CLI JSON indirection relative to projectDir; guard empty normalized query command
- plan.task-structure + intel extract/patch-meta: resolvePathUnderProject containment
- check.config-gates: safe string booleans; plan_checker alias precedence over plan_check default
- state.validate/sync: phaseTokenMatches + comparePhaseNum ordering
- verify.schema-drift: token match phase dirs; files_modified from parsed frontmatter
- audit-open: has_scan_errors, unreadable rows, human report when scans fail
- requirements PLANNED key PLAN for root PLAN.md; gsd-tools timeout note
- ingest-docs: repo-root path containment; classifier output slug-hash
Golden parity test strips has_scan_errors until CJS adds field.
* fix: Resolve CodeRabbit security and quality findings
- Secure intel.ts and cli.ts against path traversal
- Catch and validate git add status in commit.ts
- Expand roadmap milestone marker extraction
- Fix parsing array-of-objects in frontmatter YAML
- Fix unhandled config evaluations
- Improve coverage test parity mapping
* test: raise planner character extraction limit to 48K
* fix(sdk): resolve TS build error in docs-init passing config
2026-04-20 18:09:02 -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
Joshua Duffill
0782b5bdf0
fix: prevent infinite self-discuss loop in auto/headless mode ( #1426 )
...
When running in --auto or headless mode, the discuss step could loop
indefinitely — each pass reads its own CONTEXT.md, finds "gaps" in
referenced types/interfaces, creates new decisions to fill them, and
repeats. Observed: 34 passes, 167 decisions, 7 hours, zero code written.
Fixes:
- Add max_discuss_passes config (default: 3) to WorkflowConfig
- Add single-pass guard instruction to SDK self-discuss prompt
- Add pass cap documentation to CLI discuss-phase workflow
- Add pass guard step to SDK headless discuss-phase prompt
- Add stall detection note to autonomous workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 09:25:03 +02: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