Repository navigation
fix: make ref-check's suggestions resolve, and cut its false positives - #94
Merged
Merged
Conversation
Swept against expo/expo, ref-check reported 149 problems, and following its "add `@ref X`" advice would have broken or misled in several ways: - Suggestions that don't resolve. A partial path now gets the one file it is a suffix of (or `glob:**/<token>` when several match), a wildcard directory gets a `**` tail, and a leading `./` is dropped. A citation that matches nothing says so and that it may be stale, instead of suggesting a broken ref. - A suffix-glob ref didn't silence the citation it covers: coverage now reads each `**/` as zero or more directories. - Package-relative directory names (`ios/`, `src/`, `android/src/`) are prose when such a directory exists somewhere in the repo; a name that exists nowhere still fails. - Native build files (`.mm`, `.gradle`, `.xml`, `.plist`, `.podspec`, ...) are citations now; they were never checked. - A ref to a top-level directory still has to resolve but no longer drives the "this PR changes code the reviewer prompts cite" note, which matched it by prefix and fired on nearly every PR. - The review comment's "cites code that no longer resolves" note counts only refs that fail to resolve, not line-number citations of files that exist. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🤖 AI code reviewDecision: Ready for human review Overall PR risk: Low. This change modifies the ref-integrity checker to improve suggestion quality and add missing file extensions. It affects only 🔎 Reviewer summaries (3)
No findings. This review is advisory — it never blocks a merge and never auto-approves. |
brentvatne
added a commit
to expo/expo
that referenced
this pull request
Oct 23, 2026
The next ecr release (expo/code-review-cli#94) also checks citations of native build files (`Info.plist`, `build.gradle`, `AndroidManifest.xml`, `*.podspec`, ...). Pin the 25 the prompts make as `glob:` refs, so `ecr ref-check` keeps passing on both 0.19.0 and that release. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brentvatne
added a commit
to expo/expo
that referenced
this pull request
Oct 23, 2026
0.20.0 adds expo/code-review-cli#94 (ref-check precision fixes) on top of 0.19.0. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Why
Swept against expo/expo's
.expo-agents/code-review/setup,ecr ref-checkreported 149 problems. An adversarial pass over them found that following the check's own advice would often fail or mislead:@ref X" messages named anXthat would itself be a broken ref: a partial path (start/doctor/apple/XcodePrerequisite.ts), a directory glob (packages/*/apple/), a./internal/*pattern, or a file that was deleted (tools/src/publish-packages/helpers.ts, the one real stale citation).glob:**/start/doctor/apple/XcodePrerequisite.tsresolves, but the prosestart/doctor/apple/XcodePrerequisite.tswas still reported.ios/,src/and__tests__/mean "each package's directory", which no ref can pin (28 of the 149)..mm,.gradle,.xml,.plistand.podspecweren't citation extensions (26 citations in expo/expo).src/a.ts:42citation of a file that exists.What
All in
src/core/config-refs.ts, with LLP 0012 and the README updated. Grammar and glob dialect are unchanged, so./ref-checkneeds nothing.resolvingRefpicks a suggestion that resolves:glob:**/<token>when several files match;**tail for directory globs, and no leading./.**/as zero or more directories, so writing the suggestion down always silences the citation.dirExistsAnywheretreats a non-resolving trailing-slash token as prose when such a directory exists somewhere.iso/or a deletedoldpkg/still fails. LLP 0012 states the tradeoff: a stalefoo/bar/whose name survives elsewhere goes quiet..m,.mm,.gradle,.kts,.xml,.plist,.podspec,.pbxproj,.xcconfig,.entitlements,.properties,.cmake,.proand.mdx..envstays off, becauseprocess.envis the far commoner token.citedPaths.reviewSetupRefNotescounts onlybroken-refandstructuralproblems.Adopter impact: the new extensions can make
ecr ref-checkreport citations it ignored before. The review path never shows unannotated citations, so reviews themselves don't change.Tests
config-refs.test.ts, one per fix. Each fails with its fix reverted.helpers.ts,.claude/CLAUDE.md,state.json, and five paths in the uninitialized react-native submodule.bun test(876 pass), lint, format andllp:checkpass, and this repo's own setup still passesecr ref-check.🤖 Generated with Claude Code