Skip to content

Path-qualified names, impact limits, re-export flags and a sturdier skill - #61

Merged
VirtualMachinist merged 9 commits into
mainfrom
feat/w15-interface
Nov 16, 2026
Merged

VirtualMachinist merged 9 commits into
mainfrom
feat/w15-interface

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

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-qualified names. path/to/file.rs::Type::method and path/to/file.rs::name resolve. They are tried only when every existing name form misses, so any name that resolved before resolves exactly as before.
  • Ambiguous replies give each candidate a display that can be passed straight back as a name.

Re-exports

  • The store records use visibility, so a symbol re-exported through pub use can be told apart. That needs store schema 4, with a migration from 3, and extractor version 13.
  • callers and impact add reexported and confirm_with_grep when the target is re-exported, because callers through a re-export may be missing. Otherwise the reply is unchanged.

impact --limit N

impact accepts --limit N in the CLI and limit in MCP. It keeps the shallowest results first, keeps group totals, and reports what it omitted.

The skill

  • Commands: help and --help print the command table, flags work before or after the command, and impact --limit passes through.
  • SKILL.md adds a per-kind trust rule (when to answer straight from the reply and when to confirm with one grep) and a note for harnesses that cut long lines. The pointer names co-change.
  • The reply adds exit on success, and every existing key is unchanged.
  • Tests: the skill tests run on nu 0.115.1 and 0.116.1.

Checks

fmt, clippy (-D warnings), cargo deny check and nextest all pass. No new package or crate, and no .github change.

🤖 Generated with Claude Code

Bezel Writer and others added 9 commits November 15, 2026 11:23
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>
@VirtualMachinist
VirtualMachinist merged commit 946f39d into main Nov 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant