Repository navigation
Path-qualified names, impact limits, re-export flags and a sturdier skill - #61
Merged
Merged
Conversation
A query that names no symbol as a bare name, an in-file qual_name or a module path is now tried as <file>::<qual_name> or <file>::<name>, the spelling an ambiguous candidate shows. It is a fallback after both existing forms, so a query the base answers keeps exactly its rows. Tests cover a method and a free fn by display, the inline-module scope, the shared-file dump shape, a leading ./, a file outside the tree, and the unchanged bare, type and std spellings.
…export A pub use and a private use stored identical rows, so callers and impact could not tell a re-export from an import. refs gains a visibility column (schema 4, extractor 13): insert_uses binds the declaration visibility, a version-3 database migrates by adding the defaulted column in one transaction, and a migrated use row reads empty until a re-index stores it. Store::use_reexports and Store::is_reexported read the import edges whose use ref is stored public. Every existing column is unchanged; the canonical dump gains the new column last and keeps every ref key as it was. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The version, doctor and status tests pin the stamps the binary reports. The doctor test also checks that a version-3 database reads as one that index migrates to 4, and the status test lists 12 among the older extractor stamps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Mutation on the diff missed five mutants: the two version comparisons in Store::open_existing and the path-shape test of the display spelling. A test now records which migration steps an open of a version-2, -3 and -4 database runs, and another stores a root file, a slashed extensionless path and a bare word to show that a prefix with a dot or a slash is tried and a bare word is not. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
open_existing, check_stamp and the two migrations rose past the crate bar when the version-4 step landed. The stamp check is now three small checks, the two column migrations share add_columns and stamp_version, the steps are one table that migrate walks, and prepare_existing holds the checks an existing database gets after it is hardened. Behaviour is unchanged. The two re-export reads join the fault-injection test, and so does the display spelling statement. use_reexports reads through collect_rows like its neighbours. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…flags impact takes --limit N (MCP limit), 1 to 100: at most N hits over all groups, shallowest first, and at most N tests. A cut group keeps its total and sets truncated, and data.limit counts what was left out. It is refused with --diff. Without it the reply is unchanged. Every candidate of an ambiguous lookup ends with display, its file-qualified name. did_you_mean suggestions do not carry it. callers and impact end data with reexported and confirm_with_grep, both true, when the store records a pub use of the target; otherwise neither key is present. Under max_tokens the new keys go first, with the earlier extras. The README pointer names co-change and says to read SKILL.md first, and the MCP descriptions of callers and impact name the new keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`help`, and `--help` or `-h` anywhere before `--`, print the command table as an ok envelope and run nothing. `--repo`, `--limit` and `--depth` may come before the command. `impact --limit N` passes through to the CLI. Every success now ends with `exit: 0`; every other key is as it was. A name in the shape `where` displays, `file.rs:LINE Owner::name`, is read as the path-qualified `file.rs::Owner::name`, a shape no name the CLI resolves has. `reexported` and `confirm_with_grep` are copied from `callers` and `impact` when the CLI sets them. SKILL.md gains the trust rule per kind of question, the note on harnesses that cut long lines, and `where` first for a `Type::method` that may sit in more than one crate. The harness copies are synced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
file.rs::run matched the free fn run and a method of the same name in the same file, so two ambiguous candidates could show one display and passing it back answered ambiguous again. The display spelling now matches the in-file qualified name alone: file.rs::name names the free item and file.rs::Type::name names the method. A query the base answers is unchanged, since the spelling is still tried only after every other form misses. A test round-trips every display of four same-named symbols in one file, including one in an inline module. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Under max_tokens a reply now sheds in two stages before any entry. The reexported and confirm_with_grep flags and impact limit go first, as a whole. A reply that fits without them is the reply it was before they existed, so it keeps callers_distinct, files and sites. Only then do the earlier extras go, and the entries after them as before. impact no longer checks its limit a second time: the command line and the MCP tool already refuse anything outside 1 to 100, and the MCP tests now cover 0, 101, 2.5 and a string. The re-export read sits behind the lookup in impact and beside unresolved_calls in calls, so neither function grows a branch. The README says any command that opens an older index migrates it once, a read included, and gives the extractor and store versions this binary writes, 13 and 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Makes Phantom's answers and skill easier for agents to use, especially in harnesses that cut long lines or retry on errors. The resolution is unchanged: every existing row, edge and figure is identical.
Names and lookups
path/to/file.rs::Type::methodandpath/to/file.rs::nameresolve. They are tried only when every existing name form misses, so any name that resolved before resolves exactly as before.displaythat can be passed straight back as a name.Re-exports
usevisibility, so a symbol re-exported throughpub usecan be told apart. That needs store schema 4, with a migration from 3, and extractor version 13.callersandimpactaddreexportedandconfirm_with_grepwhen the target is re-exported, because callers through a re-export may be missing. Otherwise the reply is unchanged.impact --limit Nimpactaccepts--limit Nin the CLI andlimitin MCP. It keeps the shallowest results first, keeps group totals, and reports what it omitted.The skill
helpand--helpprint the command table, flags work before or after the command, andimpact --limitpasses through.exiton success, and every existing key is unchanged.Checks
fmt, clippy (
-D warnings),cargo deny checkand nextest all pass. No new package or crate, and no.githubchange.🤖 Generated with Claude Code