singularity-forge/packages/mcp-server/src
Claude 8f58481875 fix(gsd): route quality gates through a per-turn registry
Every workflow turn that needed a quality gate either let it drop
silently or bulk-stamped it at closeout. Q8 was the worst case: seeded
as scope:"slice" by plan-slice, treated as a blocker for the
evaluating-gates phase by state.ts, then filtered out of the
gate-evaluate prompt via `if (!meta) continue;` and never closed by
complete-slice — a guaranteed auto-loop stall once slice gates were
enabled.

Introduce gate-registry.ts as the single source of truth for which
turn owns which gate (Q3/Q4 → gate-evaluate, Q5/Q6/Q7 → execute-task,
Q8 → complete-slice, MV01–MV04 → validate-milestone). Every layer of
the prompt system now consults it:

- state.ts derives pending counts by owner turn, not scope, so Q8
  never stalls evaluating-gates again.
- auto-prompts.ts builders call assertGateCoverage() and render a
  "Gates to Close" block from the registry instead of a hand-rolled
  GATE_QUESTIONS table.
- complete-slice and complete-task handlers saveGateResult for every
  gate they own, mapping gate id → params field so empty sections
  become `omitted` and populated sections become `pass`.
- milestone-validation-gates sources its MV id list from the registry.
- prompt-validation.ts adds validateSliceSummaryOutput /
  validateTaskSummaryOutput / validateMilestoneValidationOutput
  schema checks.
- gsd_save_gate_result accepts MV01–MV04 (via the registry keys) in
  the MCP server and bootstrap tool registration.

Tests: new gate-registry + prompt-system-gate-coverage +
complete-slice-gate-closure suites, plus a Q8 regression case in
gate-dispatch.test.ts. 161 related tests pass end-to-end.

https://claude.ai/code/session_019PT3EmrkMxr4TsgGGLSYK3
2026-04-12 21:13:16 -05:00
..
readers feat(mcp-server): add 6 read-only tools for project state queries (#3515) 2026-04-04 16:41:24 -05:00
cli.ts fix(mcp-server): hydrate model credentials into env 2026-04-10 17:31:07 -05:00
env-writer.test.ts feat(mcp-server): add secure_env_collect tool via MCP form elicitation 2026-04-11 11:51:43 -05:00
env-writer.ts feat(mcp-server): add secure_env_collect tool via MCP form elicitation 2026-04-11 11:51:43 -05:00
import-candidates.test.ts test(mcp-server): add regression tests for importLocalModule candidate resolution 2026-04-10 19:33:00 -05:00
index.ts feat(mcp-server): add 6 read-only tools for project state queries (#3515) 2026-04-04 16:41:24 -05:00
mcp-server.test.ts feat(mcp-server): expose ask_user_questions via elicitation 2026-04-10 15:44:08 -05:00
secure-env-collect.test.ts feat(mcp-server): add secure_env_collect tool via MCP form elicitation 2026-04-11 11:51:43 -05:00
server.ts fix(mcp): thread abort signals, restore tool fidelity, and fix subpath imports 2026-04-12 20:04:47 -05:00
session-manager.ts feat: Headless Integration Hardening & Release (M002) (#2811) 2026-03-26 23:33:22 -06:00
tool-credentials.test.ts fix(mcp-server): hydrate model credentials into env 2026-04-10 17:31:07 -05:00
tool-credentials.ts fix(mcp-server): hydrate model credentials into env 2026-04-10 17:31:07 -05:00
types.ts feat: Headless Integration Hardening & Release (M002) (#2811) 2026-03-26 23:33:22 -06:00
workflow-tools.test.ts fix(mcp-server): open the DB for inline workflow tools 2026-04-11 17:44:17 +02:00
workflow-tools.ts fix(gsd): route quality gates through a per-turn registry 2026-04-12 21:13:16 -05:00