Repository navigation
feat: list_concerns() discovery tool — browse before you query - #3
Merged
Merged
Conversation
DIVERGE round backlog item #4 ("list_concerns() discovery tool") promoted to a scoped feature: a 4th MCP tool that lets an agent browse candidate decision topics across all configured repos before guessing a resolve_concern keyword, closing the gap documented in README's "Using LoreMCP while architecting" section. DISCUSS, DESIGN, and DISTILL waves completed and peer-reviewed (both approved). Registered a NOT_IMPLEMENTED stub for list_concerns in server.ts so acceptance tests fail with clean AssertionErrors rather than MCP protocol-level crashes -- confirmed RED, not BROKEN.
The crafter's list_concerns doc used searchedRepos (camelCase) but the actual wire format is searched_repos (snake_case, via toSnakeCaseKeys) -- verified against a live tool call. Also fixed the intro blurb (still said "three MCP tools") and the test count (still said 369, now 417).
…>=80% concern-matcher.ts was at 78.78% and format-response.ts had dropped to 82.95% after the list-concerns feature added collectConcernCandidates, extractFirstHeadingText, and formatListConcernsResponse. Add targeted unit tests pinning boundary conditions (off-by-one comparisons, regex anchors, optional chaining, trim/join precision) that the new survivor report identified, without touching production code or existing assertions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 task done
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
Adds a 4th MCP tool,
list_concerns()(no arguments), to lore-mcp. Scans all configured repos and returns candidate decision-topic strings (feature directory names, ADR titles, decision heading text) an agent can browse before guessing aresolve_concernkeyword.collectConcernCandidates/extractFirstHeadingTextinsrc/core/concern-matcher.ts, reusing existing heading-detection machinery (no new dependency).ListConcernsResponsetype +formatListConcernsResponseformatter insrc/core/format-response.ts.list_concernshandler insrc/shell/server.ts, reusingresolve_concern's exact per-repo probe/skip pattern.list_concerns()never returns an error shape — an emptyconcerns: []is a valid success response when no configured repo has nWave structure.list_concerns()first, closing the "known gap" that section previously flagged.Why
Originated from a DIVERGE backlog item (#4, scored 3.35/5) surfaced while dogfooding
resolve_concernfor theheading-anchored-snippetsfeature:resolve_concernonly helps if the agent already knows which keyword to ask about. This closes that gap directly.What a reviewer should know
NOT_IMPLEMENTEDstub tool registration (rather than a production-module stub), confirmed via peer review as the correct Mandate 7 interpretation for a brand-new MCP tool — it proves the driving port is wired without yet implementing behavior.searchedRepos) when the actual wire format is snake_case (searched_repos, via the existingtoSnakeCaseKeysconversion) — caught by checking a live tool call, not just trusting the written example. Also fixed stale "three tools" / test-count language elsewhere in the README.concern-matcher.tsfell to 78.78% after this feature's new code, even though the project-wide average still passed at 83.23%) — closed by adding 33 real tests, no production code changes. Final:concern-matcher.ts81.67%,format-response.ts100%, project-wide 88.02%.docs/feature/list-concerns/. Evolution summary:docs/evolution/list-concerns-evolution.md.Test plan
npm test)npm run build(tsc strict) cleannpm run check:arch(dependency-cruiser core/shell boundary) cleanconcern-matcher.ts81.67%,format-response.ts100%, project-wide 88.02% (threshold 80%)list_concerns()against this repo's own docs returns 96 candidates including all 4 feature dirs + real ADR titles (KPI-LC-1); chaining a result intoresolve_concern()finds the exact source ADR end-to-end (KPI-LC-5)