feat: codemap find, Swift type-reference edges, self-healing config, output standard - #189
Merged
Conversation
… counts Lexical BM25 over what the scanner already extracts (paths and function names, split on camelCase, snake_case and separators), plus a whole-word bonus. Each hit carries importer count and hub status from the same file graph the other commands use, and ends with the coverage line. Exposed as the `find` MCP tool as well. No new dependencies, no index on disk. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
Swift files never import each other, so the graph over a Swift app was structurally empty and every Swift file read as having zero dependents. Extract declared class/struct/enum/actor/protocol names per file, then add an edge from any Swift file that mentions a type another file declares. Import lines are stripped first so a project enum named like a module does not gain the whole app as importers, and the declaration keyword must head the match so "class func" is never read as a type. The symbol-imports/swift source now reports mixed with a note naming the resolver and its blind spots; coverage stays partial. Kotlin, Java, C# and Scala are unchanged. On an 86-file Swift app the graph goes from 16 module-level edges to 230 file edges. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
Every analysis entry point (tree, deps, importers, blast-radius, collide, session-start and prompt-submit hooks) now writes an auto-detected .codemap/config.json when none exists and the root is a git checkout. Remote clones and non-git roots are never written. config init now excludes noise that is actually present (Carthage, coverage, fixtures, __snapshots__, .xcassets, and binary asset extensions in volume), keeps those extensions out of `only`, and writes mode explicitly so a fresh init assesses as ready instead of boilerplate. When setup is still missing, empty, malformed, or boilerplate, hooks print an imperative stop line and a Run now instruction; the config-setup skill opens with the fix-first loop. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
…etup in prompt-submit - find now tokenizes FileAnalysis.Types so Swift type names rank - find auto-inits config like the other analysis entry points - codemap find "q" --limit N works with flags after the query - prompt-submit prints the stop line when config-setup is injected at 100 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
Sourced, precise, bounded, useful. Linked from CONTRIBUTING. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
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.
What
Four pieces, built from issue #187 (learn from zvec-grep) and from testing codemap on five repos of different stacks.
codemap find "<query>"(+ MCP toolfind)Ranked lexical search over what the scanner already extracts: path segments, function names, and (now) Swift type names. BM25 plus an exact-word bonus. Every hit carries its importer count and hub flag, then the coverage line. No new dependencies.
Lexical only, and it says so. Stemming and embeddings deliberately skipped until real queries miss.
Swift intra-project edges
Swift was symbol-level: no file-to-file edges, coverage
unavailable. New ast-grepswift-typesrule extracts declared types intoFileAnalysis.Types; the graph builder resolves type-name references per file with a word-boundary scan (imports stripped,class funcexcluded). Coverage source becomesmixedwith the reason stated.On Bell (86 Swift files): 16 edges before, 230 after. Real hubs surface: Client (23), Session (22), Firebase (20).
Known ceiling, marked with a
ponytail:comment: name match, not symbol resolution. An enum of accessibility IDs referenced everywhere counts as a hub.Self-healing config
Any analysis entry point writes an auto-detected
.codemap/config.jsonwhen one is missing inside a git checkout. Init now adds excludes for noise present in the repo and setsmode, so fresh repos assessready. When a config is still boilerplate, session-start and prompt-submit print a stop line telling the agent to finish setup before the task, and the config-setup skill opens with that loop.Output standard
docs/OUTPUT-STANDARD.md: every printed line must be sourced, precise, bounded, useful. Linked from CONTRIBUTING with the review rule.Verification
go test ./...green across all packages.codemap find "q" --limit Naccepts flags after the query.🤖 Generated with Claude Code
https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T