Repository navigation
urlcode review follows static relative imports into project modules - #1150
Merged
Merged
Conversation
) urlcode review read only the module a route names, so session, rate-limit and header plumbing in imported helpers or behind a re-export yielded no observations. It now follows static relative imports into project modules (at most 6 hops, 128 imported modules; never packages, node_modules, dynamic imports or files outside the project; nothing executed), reports each finding with the file it was found in, the routes that reach it and importedFrom, and reports imports {read, notRead, note} so a cap that left modules unread is visible. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018b6Nd9EChnYTHdh9Rqiv6L
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.
Requested by Jimmy · project thread
Closes #1141.
Problem and change
Before:
urlcode reviewscanned only the module a route names. Session, rate-limit and header plumbing kept in a helper or behind a re-export (export { default } from './lib/session.mjs') producedobservations: [], which read as "nothing to review".After: review follows the route module's static relative imports (
import … from './x',export … from '../x') into project modules and runs the same signals there. Limits: at most 6 hops from a route module and 128 imported modules; only.//../specifiers to.js/.mjs/.ts/.mtsfiles whose real path is inside the project and not undernode_modules; never packages, dynamicimport(), CommonJS or files outside the project; nothing is executed.How:
source, the routes that reach it asroutes(with each route's effective policy still decidingnative-alternativevsmanual-review), and the route modules asimportedFrom.imports: {read, notRead, note?}. When a cap leaves modules unread,notesays "N imported project modules were not read …"; the HTML report adds a check for it and shows "imported by" on findings.moduleCountnow counts route modules plus imported modules read.docs/TOOLING.md#project-reviewdescribes the new scope.Verification
test/review.test.ts: the [Request]: Evaluate current composition discovery against peer-bin application plumbing #1137 repro now finds the session code behind the re-export; new tests for a module shared by two routes with different policies, the never-followed cases (outside project,node_modules, package, dynamic import), and both caps with the exact note.npm run lint,typecheck,typecheck:tooling,npm run checkpass.npm run test:proof:nativeandnpm run test:ecosystem(which readreview --json) pass unchanged.npm test: 1435 pass, 2 fail locally (disk-full,hermetic-accounts), both because the container's Node ships SQLite 3.50.4, which the store refuses; unrelated to this change.Compatibility and security
reviewJSON gainsimportsand optionalimportedFrom; existing fields keep their meaning (moduleCountnow includes imported modules). No YAML, permission or runtime change. Review stays read-only and non-executing.🤖 Generated with Claude Code
https://claude.ai/code/session_018b6Nd9EChnYTHdh9Rqiv6L
Generated by Claude Code