Repository navigation
fix(mcp,studio): resolve project scope case-insensitively across audit surfaces (fan-out of #314) - #328
Merged
Conversation
…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.
This was referenced Oct 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fan-out of #314/T-406: the same silent-casing defect that was fixed on
memory health(CLI + MCPmuse_health+ studio/api/health) remained onthe audit surfaces that also accept an optional
projectfilter.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
via the existing
resolveProjectName()owner (T-406). Gates/engines stayexact — only the user-facing input is canonicalized.
available projects; studio endpoints return 404 with the same message.
--json) stays clean.Tests
17 new tests in
test/project_resolution_fanout.test.tscovering all 7surfaces × (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 newbunx tsc --noEmit: cleanbun run build: cleanbun run claims:check: currentbun run docs:check: cleanCloses #327.