fix: resolve docs audit residuals R.1–R.3 and retire audit#124
fix: resolve docs audit residuals R.1–R.3 and retire audit#124SutuSebastian wants to merge 11 commits into
Conversation
Honor --state-dir for project recipes, populate function_params.owner_kind, register files/symbols MCP resource templates, and delete the May 2026 fact-check audit tombstone (R.10–R.12 remain in roadmap/plans).
🦋 Changeset detectedLatest commit: 729387f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 35 minutes and 15 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (39)
📝 WalkthroughWalkthroughThis PR expands codemap's MCP server capabilities by adding live file and symbol resource templates, enables recipe discovery via custom state directories, enriches function parameter metadata with owner kinds (function, method, getter, setter, arrow, constructor), and updates related documentation and audit records. ChangesMCP Resources and Recipes State Directory Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/application/mcp-server.test.ts (1)
834-859: ⚡ Quick winAdd a test for
?in=query passthrough oncodemap://symbols/{name}.This test verifies base symbol resolution, but not the new query-string propagation path (
?in=...) implemented in the handler.✅ Suggested test addition
+ it("codemap://symbols/{name}?in=... preserves query filter", async () => { + const db = openDb(); + try { + db.run( + `INSERT INTO symbols (file_path, name, kind, line_start, line_end, signature, is_exported, is_default_export) + VALUES ('src/a.ts', 'A', 'const', 1, 1, 'const A', 1, 0)`, + ); + db.run( + `INSERT INTO symbols (file_path, name, kind, line_start, line_end, signature, is_exported, is_default_export) + VALUES ('src/b.ts', 'A', 'const', 1, 1, 'const A', 1, 0)`, + ); + } finally { + closeDb(db); + } + + const { client, server } = await makeClient(); + try { + const r = await client.readResource({ uri: "codemap://symbols/A?in=src/a.ts" }); + const parsed = JSON.parse(readResourceText(r)); + expect(parsed.matches).toEqual( + expect.arrayContaining([ + expect.objectContaining({ name: "A", file_path: "src/a.ts" }), + ]), + ); + expect( + parsed.matches.some((m: { file_path: string }) => m.file_path === "src/b.ts"), + ).toBe(false); + } finally { + await server.close(); + } + });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/application/mcp-server.test.ts` around lines 834 - 859, Add a new test in src/application/mcp-server.test.ts (next to the existing "codemap://symbols/{name} resolves indexed symbols" test) that inserts the same symbol into the SQLite symbols table, creates the client/server via makeClient(), then calls client.readResource with a URI that includes the query-string passthrough (e.g., "codemap://symbols/A?in=src/a.ts") and asserts the parsed response contains the symbol (expect(parsed.matches) to include an objectContaining { name: "A", file_path: "src/a.ts" }); also add a negative check by requesting "codemap://symbols/A?in=src/other.ts" (or without ?in) to confirm the handler respects the ?in= filter, and ensure DB is closed and server closed in finally blocks just like the existing test.src/parser.test.ts (1)
741-765: ⚡ Quick winAdd coverage for the
FunctionExpressionowner-kind path.Line 741 adds strong coverage, but it misses the newly changed
FunctionExpressionextraction branch; adding one assertion here would close that gap.Suggested test extension
@@ const src = [ "export function greet(name: string): string { return name; }", "export class Svc {", " constructor(host: string) { this.host = host; }", " run(id: string): void {}", " set label(value: string) { this._label = value; }", "}", "export const add = (a: number, b: number): number => a + b;", + "export const mul = function (x: number, y: number): number { return x * y; };", ].join("\n"); @@ expect(byOwner("run", "method")?.name).toBe("id"); expect(byOwner("label", "setter")?.name).toBe("value"); expect(byOwner("add", "arrow")?.name).toBe("a"); + expect(byOwner("mul", "function")?.name).toBe("x"); }); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/parser.test.ts` around lines 741 - 765, Add a FunctionExpression case to the test by appending a source line like `export const expr = function(e: number): number { return e; }` to the src array and add an assertion using the existing helpers to check its extracted param: e.g. expect(byOwner("expr", "function_expression")?.name).toBe("e"); this uses extractFileData, d.functionParams and byOwner to validate the new FunctionExpression owner-kind path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/roadmap.md`:
- Line 78: The table row for "Full `.md` fact-check (May 2026)" incorrectly
marks R.1–R.3 as already in this PR with a closed date of 2026-05-24; update
that row in roadmap.md to reflect the true status by either (a) moving the entry
to post-merge (change the date and/or section to Backlog/Plans) or (b) mark it
as pending/in-progress and remove or correct the closed date, making sure the
text referencing "R.1–R.3 in this PR" and the commit range `e6ab158`–`14d3efc`
reflect the actual merge state.
---
Nitpick comments:
In `@src/application/mcp-server.test.ts`:
- Around line 834-859: Add a new test in src/application/mcp-server.test.ts
(next to the existing "codemap://symbols/{name} resolves indexed symbols" test)
that inserts the same symbol into the SQLite symbols table, creates the
client/server via makeClient(), then calls client.readResource with a URI that
includes the query-string passthrough (e.g., "codemap://symbols/A?in=src/a.ts")
and asserts the parsed response contains the symbol (expect(parsed.matches) to
include an objectContaining { name: "A", file_path: "src/a.ts" }); also add a
negative check by requesting "codemap://symbols/A?in=src/other.ts" (or without
?in) to confirm the handler respects the ?in= filter, and ensure DB is closed
and server closed in finally blocks just like the existing test.
In `@src/parser.test.ts`:
- Around line 741-765: Add a FunctionExpression case to the test by appending a
source line like `export const expr = function(e: number): number { return e; }`
to the src array and add an assertion using the existing helpers to check its
extracted param: e.g. expect(byOwner("expr",
"function_expression")?.name).toBe("e"); this uses extractFileData,
d.functionParams and byOwner to validate the new FunctionExpression owner-kind
path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 95ece27a-09d9-4176-b75e-e477c6e6465e
📒 Files selected for processing (15)
README.mddocs/README.mddocs/audits/2026-05-24-docs-fact-check-residuals.mddocs/glossary.mddocs/roadmap.mdsrc/application/mcp-server.test.tssrc/application/mcp-server.tssrc/application/query-recipes.pre-bootstrap.test.tssrc/application/query-recipes.test.tssrc/application/query-recipes.tssrc/cli/main.tssrc/extractors/scopes.tssrc/extractors/symbols.tssrc/parser.test.tstemplates/recipes/find-by-param-type.md
💤 Files with no reviewable changes (1)
- docs/audits/2026-05-24-docs-fact-check-residuals.md
Align canonical docs with <state-dir>/recipes/, extend watcher to honor custom state dirs, fix cmd-mcp resource cache buckets, add regression tests (stateDir cache invalidation, symbols ?in= via MCP template).
bun update --latest plus qs>=6.15.2 override resolves GHSA-q8mj-m7cp-5q26 (transitive via @modelcontextprotocol/sdk → express → body-parser).
Relocate deleted-audit pointers to docs/README § Closing audits; drop perf-triangulation row (plan self-documents); update skills.
Living docs should not cite removed audit paths; closure anchors are the shipping PR/commit and git history only.
Default research/audit closure to lift+delete; restrict existence test to inbound cites; stop citing slim-appendix precedent; lessons are staging not archive.
Lift apply-engine open steps to plans/apply-engine-direction.md; embed LSP/C.9 cadence + shape history in open plans; keep research archives (Tier B) with explicit plan pointers; rewire governance cross-refs.
Collapse redundant shipped inventory into §7 lift table; add explicit backlog rows for open plans + trigger-gated peer ideas; embed cohort positioning in why-codemap (no peer tracker file).
Summary
Closes the May 2026 docs fact-check audit (R.1–R.9). R.10–R.12 remain in backlog/plans.
Residual fixes (R.1–R.3)
--state-dir/CODEMAP_STATE_DIRviaresolveStateDir()andsetQueryRecipesProjectRoot(root, stateDir); pollution guard when runtime state dir diverges.function_params.owner_kindpopulated at extraction (function,method,getter,setter,arrow,constructor);find-by-param-typefilter docs restored.codemap://files/{+path}andcodemap://symbols/{name}{?in}resource templates (parity with HTTP); symbols?in=filter via MCP template.Sweep follow-ups
--state-dirrecipes prefix; chokidar ignore uses dynamic state dir (MCP / HTTP /watchCLI).<state-dir>/recipes/(default.codemap/recipes/) across README, architecture, glossary, agents, skill template, recipe templates, marketplace plan;codemap://schemapath aligned.cmd-mcphelp.Audit closure
docs/audits/2026-05-24-docs-fact-check-residuals.md; index closure inroadmap.md§ Closed audits.Dependencies
bun update --latest;qs>=6.15.2override clears GHSA-q8mj-m7cp-5q26 (transitive via@modelcontextprotocol/sdk→ express → body-parser).Commits
8ef50f1— R.1–R.3 + audit retirementf30873d— docs hydration, watcher state-dir, MCP?in=, regression testsd0ceeda— schema resource path nit22edef0— deps bump + qs overrideTest plan
bun teston changed*.test.ts(query-recipes, pre-bootstrap, mcp-server, watcher, parser)bun run typecheck?in=filterbun audit— no vulnerabilities (CI run)22edef0Summary by CodeRabbit
New Features
Improvements
Documentation