Repository navigation
feat(cli): srcly refs lists every declaration of a name and its callers - #482
Merged
Merged
Conversation
This was referenced Nov 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
byronwall
force-pushed
the
claude/refs-cli
branch
from
November 28, 2026 05:05
3cd8837 to
232a28b
Compare
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.
srcly refs <name>lists every declaration of a name and what references each one. An agent can find every caller before it moves or deletes a symbol, and check afterwards that none is left. A bare name shows every copy side by side, so a type that three files each declare shows three times.file::symbolpicks one declaration.User impact: A new headless command. The app is unchanged.
Why
The symbol index already knows every declaration and reference, but only through
/api/symbols/*. In the Visual Notes cleanup probe (byronwall/visual-notes#361), mapping theDocDetailcopies needed a scratch Python script against the index. This command makes that step one call. It is step 1 of the cleanup loop in planning TASK-0017 (srcly-cleanup-loop.md).Proof
Output from this branch on Visual Notes
main(d59937fe,app/), before the cleanup:That is the whole map for the cleanup: two copies, the two cast wrappers (
fetchDocDetail) and the components that read them. One declaration by id:--format jsonprints the same data for scripts. The startup banner goes to stderr, so stdout stays valid JSON.tests/test_symbol_refs.pycovers a name with two copies (exported first), thefile::symbolform, an unreferenced symbol, and a missing name.scripts/check.sh serverpasses (644 tests).Survey moves: any
servermove comes from the new corpus moduleserver/app/services/symbols/refs.py, whose exported functions join the survey's export sample. No analysis code changed. On the whole stack, the gate moved onlyserver: traces +2, outcome partial +2, stopfrontier: external-code+30.Limits
exact,typed,name), as the Symbols view does.Stack: cleanup-loop helpers
What splits: Three srcly helpers for the cleanup loop: a command that maps a symbol's callers, a finding that names hand-copied types, and a command that lists findings by rule.
Why it splits: Each one is useful alone and can merge alone. The finding changes analysis output, so it gets its own Codex review and survey check.
Why this split: The alternative was one PR. It would mix a read-only CLI over existing data with a new analysis rule, and a reviewer would have to judge the rule's precision and the command's output together.
srcly refs.duplicate-typefinding.srcly findings, the before and after count per rule.🤖 Generated with Claude Code