Skip to content

fix(mcp,studio): resolve project scope case-insensitively across audit surfaces (fan-out of #314) - #328

Merged
harshsinghmp merged 1 commit into
devfrom
fix/silent-casing-fanout
Oct 25, 2026
Merged

harshsinghmp merged 1 commit into
devfrom
fix/silent-casing-fanout

Conversation

@harshsinghmp

Copy link
Copy Markdown
Owner

Summary

Fan-out of #314/T-406: the same silent-casing defect that was fixed on
memory health (CLI + MCP muse_health + studio /api/health) remained on
the audit surfaces that also accept an optional project filter.

Surfaces fixed (7)

MCP tools: memory_anchor_audit, memory_drift_audit, muse_bug_clusters,
muse_tech_debt. Studio: /api/cognition/anchors, /api/cognition/debt,
/api/cognition/clusters.

Behavior

  • Project name resolves case-insensitively to the canonical store spelling
    via the existing resolveProjectName() owner (T-406). Gates/engines stay
    exact — only the user-facing input is canonicalized.
  • Unknown project names fail loud: MCP tools return a tool error naming the
    available projects; studio endpoints return 404 with the same message.
  • Machine output (--json) stays clean.

Tests

17 new tests in test/project_resolution_fanout.test.ts covering all 7
surfaces × (case-insensitive resolve, unknown-name loud failure, canonical
identity) + 3 cross-surface identity pins.

Verification

  • bun test: 1425 pass / 9 pre-existing env failures / 0 new
  • bunx tsc --noEmit: clean
  • bun run build: clean
  • bun run claims:check: current
  • bun run docs:check: clean
  • secret scan: RC=0
  • golden recall fixtures untouched

Closes #327.

…t surfaces (fan-out of #314)

Why: #314/T-406 fixed `memory health` (CLI + MCP `muse_health` + studio
`/api/health`) to resolve project names case-insensitively and fail loud on
unknown names. The same silent-casing defect remained on the audit surfaces
that also accept an optional `project` filter: MCP `memory_anchor_audit`,
`memory_drift_audit`, `muse_bug_clusters`, `muse_tech_debt`, and studio
`/api/cognition/anchors`, `/api/cognition/debt`, `/api/cognition/clusters`.
An `ALPHA` against a store holding `alpha` returned an empty report labelled
`ALPHA` — the project scope lied about what it filtered.

What:
- Route every audit surface through the existing `resolveProjectName()` owner
  (T-406) instead of passing the raw caller string. Canonical store spelling
  is what reaches the gate/audit engines; the gates themselves stay exact.
- Unknown project names now fail loud on all seven surfaces: MCP tools return
  a tool error naming the available projects; studio endpoints return 404 with
  the same message. `--json`/machine output stays clean (note goes to stderr
  where applicable).
- Add 17 tests in test/project_resolution_fanout.test.ts covering all 7
  surfaces x (case-insensitive resolve, unknown-name loud failure, canonical
  identity) plus 3 cross-surface identity pins.

Verification: bun test (1425 pass / 9 pre-existing env failures, 0 new),
bunx tsc --noEmit (clean), bun run build (clean), claims:check (current),
docs:check (clean), secret scan (RC=0). Golden recall fixtures untouched.

Closes #327.
@harshsinghmp
harshsinghmp merged commit 17c0abe into dev Oct 25, 2026
1 check passed
@harshsinghmp
harshsinghmp deleted the fix/silent-casing-fanout branch October 25, 2026 18:20
@harshsinghmp harshsinghmp mentioned this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant