feat: add required entrypoint reachability rule - #629
Conversation
|
Warning Review limit reached
Next review available in: 39 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds the ChangesGraph reachability rule
Dependency graph edge semantics
Canonical graph execution
Validation and documentation
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideAdds a new repository rule Sequence diagram for required-entrypoint-reachability rule executionsequenceDiagram
participant Exec as graph_rules::graph_rule_findings
participant Reach as required_entrypoint_reachability
participant Config as NoMistakesConfig
participant Graph as DepGraph
participant Facts as CheckFactMap
Exec->>Config: rule_enabled(REQUIRED_ENTRYPOINT_REACHABILITY)
alt rule enabled
Exec->>Reach: check_with_graph_and_inferred(root, config, Facts.graph_file_universe(), Graph, inferred_roots)
Reach->>Reach: file_universe = normalize_path(files)
Reach->>Reach: rule_applications(RULE_ID)
Reach->>Reach: RulePathFilter::new_with_inferred(...)
Reach->>Reach: matching_files(sourceGlobs, scoped_files, target_roots)
Reach->>Reach: resolve_entrypoint(entrypoints)
Reach->>Graph: deps_of_in_file_universe(roots, max_depth, runtime_edge_kinds, file_universe)
Graph-->>Reach: reachable nodes
Reach->>Reach: build RuleFinding for unreachable sources
Reach-->>Exec: findings
end
Exec-->>Exec: aggregate findings
Exec-->>Exec: return findings
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #629 +/- ##
========================================
Coverage 99.24% 99.24%
========================================
Files 1277 1279 +2
Lines 100537 100819 +282
========================================
+ Hits 99778 100061 +283
+ Misses 759 758 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
required_entrypoint_reachability::config_finding, the file is always reported as.no-mistakes.yml; consider wiring through the actual config path so findings point to the correct configuration source, especially for non-default config filenames. canonical_graph_planis nowpuband re-exported from bothrunandrules::modwith slightly different visibility annotations; it may be clearer to expose a single canonical public export to avoid confusion over which path callers should use.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `required_entrypoint_reachability::config_finding`, the file is always reported as `.no-mistakes.yml`; consider wiring through the actual config path so findings point to the correct configuration source, especially for non-default config filenames.
- `canonical_graph_plan` is now `pub` and re-exported from both `run` and `rules::mod` with slightly different visibility annotations; it may be clearer to expose a single canonical public export to avoid confusion over which path callers should use.
## Individual Comments
### Comment 1
<location path="crates/no-mistakes/src/codebase/rules/required_entrypoint_reachability/tests.rs" line_range="58-67" />
<code_context>
+ check_with_graph(&root, &config, &files, &graph)
+}
+
+#[test]
+fn accepts_static_dynamic_require_named_and_star_reexports() {
+ let findings = run(vec![application(
+ r#"
+sourceGlobs:
+ - sources/static.ts
+ - sources/dynamic.ts
+ - sources/required.ts
+ - sources/named.ts
+ - sources/star.ts
+entrypoints: [entrypoints/api.ts]
+"#,
+ )]);
+
+ assert!(findings.is_empty(), "unexpected findings: {findings:?}");
+}
+
</code_context>
<issue_to_address>
**suggestion (testing):** Add a negative test for absolute entrypoints that fall outside the repository root.
`accepts_an_absolute_entrypoint_inside_the_repository` covers the happy path for absolute entrypoints. Please add a complementary test where the config uses an absolute entrypoint outside `root`, confirming that `resolve_entrypoint` flags the configuration as invalid rather than treating the entrypoint as reachable. This will better exercise the boundary conditions of entrypoint resolution.
Suggested implementation:
```rust
#[test]
fn accepts_static_dynamic_require_named_and_star_reexports() {
let findings = run(vec![application(
r#"
sourceGlobs:
- sources/static.ts
- sources/dynamic.ts
- sources/required.ts
- sources/named.ts
- sources/star.ts
entrypoints: [entrypoints/api.ts]
"#,
)]);
assert!(findings.is_empty(), "unexpected findings: {findings:?}");
}
#[test]
fn rejects_an_absolute_entrypoint_outside_the_repository() {
let findings = run(vec![application(
r#"
sourceGlobs:
- sources/static.ts
entrypoints:
# Absolute path that does not reside under the repository root.
# The resolver should treat this as an invalid configuration rather than a reachable entrypoint.
- /outside-root/api.ts
"#,
)]);
// The configuration should be rejected because the absolute entrypoint falls
// outside the repository root; `resolve_entrypoint` must not treat it as reachable.
//
// Adjust the predicate below to match the project's way of expressing
// "invalid configuration" findings (e.g. by kind, code, or message).
assert!(
findings.iter().any(|finding| finding.is_invalid_configuration()),
"expected invalid configuration for entrypoint outside repository root, got: {findings:?}",
);
}
```
To fully implement this negative test according to your codebase conventions, you will likely need to:
1. Replace `finding.is_invalid_configuration()` with the actual way you detect configuration-validation failures, for example:
- Matching a `RuleFindingKind::ConfigurationError` or similar enum variant, or
- Checking a `code()`/`category()` field, or
- Matching the diagnostic message produced by `resolve_entrypoint` when an absolute path lies outside `root`.
2. If your existing tests for invalid configs use a helper (e.g. `assert_invalid_config(findings, "...")`), update the assertion to reuse that helper so the test is consistent with other tests.
3. If your configuration parser does not treat a bare `/outside-root/api.ts` as an absolute path on all platforms, construct an explicit absolute path guaranteed to be outside `root` using `PathBuf` and interpolate it into the YAML string, mirroring whatever pattern is used in the existing `accepts_an_absolute_entrypoint_inside_the_repository` test.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/no-mistakes/src/check_runner/run_all.rs`:
- Around line 111-113: Update the graph-file selection predicates in
crates/no-mistakes/src/check_runner/run_all.rs:111-113 and
crates/no-mistakes/src/napi_api/analyze_project/context/check_prepare.rs:142-145
so canonical_graph_plan does not implicitly request the full graph; use a
separate explicit full-graph predicate while keeping dynamic-import-only
configurations on views.filesystem. Add fixture-backed parity tests covering
both runners and both scoped and full-graph configurations.
In
`@crates/no-mistakes/src/codebase/rules/required_entrypoint_reachability/tests.rs`:
- Around line 58-73: Add a fixture-based workspace-package import case to
accepts_static_dynamic_require_named_and_star_reexports, using the existing test
fixture conventions to create a WorkspaceImport graph edge and make the
entrypoint reach a source through it. Extend the assertion to verify that this
source produces no findings, preserving the existing coverage for static,
dynamic, require, and re-export reachability.
In `@docs/rules/required-entrypoint-reachability.md`:
- Around line 22-25: Update the entrypoints documentation to state that literal
repository-relative paths and absolute paths within the repository are accepted,
matching resolve_entrypoint and its rule test; do not change the implementation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ae51f984-851d-414c-9f22-a593a0f8283d
📒 Files selected for processing (37)
crates/no-mistakes/src/check_runner.rscrates/no-mistakes/src/check_runner/graph_plan.rscrates/no-mistakes/src/check_runner/run_all.rscrates/no-mistakes/src/check_runner/tests/architecture.rscrates/no-mistakes/src/check_tasks.rscrates/no-mistakes/src/codebase/rules/ids.rscrates/no-mistakes/src/codebase/rules/mod.rscrates/no-mistakes/src/codebase/rules/required_entrypoint_reachability.rscrates/no-mistakes/src/codebase/rules/required_entrypoint_reachability/tests.rscrates/no-mistakes/src/codebase/rules/run.rscrates/no-mistakes/src/codebase/rules/run/prepared.rscrates/no-mistakes/src/codebase/rules/run/prepared/execution.rscrates/no-mistakes/src/codebase/rules/run/prepared/execution/graph_rules.rscrates/no-mistakes/src/codebase/rules/run/prepared/execution/graph_rules/tests.rscrates/no-mistakes/src/codebase/rules/run/standalone.rscrates/no-mistakes/src/codebase/rules/tests.rscrates/no-mistakes/src/napi_api/analyze_project/context/check_prepare.rscrates/no-mistakes/src/napi_api/analyze_project/context/check_run.rscrates/no-mistakes/tests/docs_coverage.rsdocs/rules/README.mddocs/rules/required-entrypoint-reachability.mdtest-cases/codebase-analysis/forbidden-dependencies-basic/fixture/invalid-include.no-mistakes.ymltest-cases/rules/required-entrypoint-reachability/fixture/barrels/named.tstest-cases/rules/required-entrypoint-reachability/fixture/barrels/star.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/api.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/worker.tstest-cases/rules/required-entrypoint-reachability/fixture/invalid-include.no-mistakes.ymltest-cases/rules/required-entrypoint-reachability/fixture/sources/dynamic.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/named.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/required.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/star.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/static.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/suppressed.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/type-only.tstest-cases/rules/required-entrypoint-reachability/fixture/sources/unreachable.tstest-cases/rules/required-entrypoint-reachability/fixture/suppression.no-mistakes.ymltest-cases/rules/required-entrypoint-reachability/fixture/tsconfig.json
💤 Files with no reviewable changes (1)
- crates/no-mistakes/src/check_tasks.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd34128afd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e01c55864
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
|
@codex review |
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4226e936fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
crates/no-mistakes/src/codebase/rules/run/standalone/tests.rs (1)
21-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a repository fixture for this graph-scope case.
Replace the temporary directory setup with a committed fixture. Keep the skipped-directory layout in that fixture.
As per coding guidelines, use fixture-based tests and continuously add fixtures for discovered cases.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/no-mistakes/src/codebase/rules/run/standalone/tests.rs` around lines 21 - 42, Update graph_files_for to use a committed repository fixture instead of creating a tempfile and writing src/api.ts and generated/worker.ts at runtime. Preserve the fixture’s skipped-directory layout, then build the VisiblePathSnapshot and discovery inputs from that fixture so standalone_graph_files continues testing the same graph scope.Source: Coding guidelines
test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml (1)
13-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the skipped-path invariants in these fixtures.
These changes intentionally overlap reachability inputs with filesystem-skipped paths. Add one short comment at each site so future edits preserve the intended test behavior.
test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml#L13-L13: explain thatsourceGlobsintentionally targets a skipped file.test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tests/scoped.test.ts#L2-L2: explain that the dynamic import intentionally targets a skipped file.test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/.no-mistakes.yml#L8-L8: explain thatsourceGlobsintentionally targets skipped sources.test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/entrypoints/runtime.ts#L1-L1: explain that the side-effect import intentionally targets a skipped source.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml` at line 13, Add one brief comment at each specified site documenting that the configured sourceGlobs or import intentionally targets a filesystem-skipped file/source: test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml:13-13, test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tests/scoped.test.ts:2-2, test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/.no-mistakes.yml:8-8, and test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/entrypoints/runtime.ts:1-1. Preserve the existing fixture behavior and add no other changes.Source: Coding guidelines
crates/no-mistakes/src/codebase/dependencies/graph/tests/edge_kind_semantics.rs (1)
94-118: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a comment for the
require.resolveasset edge.Explain that
require.resolve()creates an inspectable dependency edge without loading the non-code asset. The assertion message only appears after failure.As per coding guidelines, add short comments to intentionally counterintuitive tests to preserve the invariant they protect.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/no-mistakes/src/codebase/dependencies/graph/tests/edge_kind_semantics.rs` around lines 94 - 118, Add a short explanatory comment immediately before the RequireResolve asset-import assertion in the test. Reference the require.resolve case and state that it creates an inspectable dependency edge without loading the non-code asset; leave the assertions and behavior unchanged.Source: Coding guidelines
docs/graph-edges.md (1)
23-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the runtime-reachability caveat.
State that
require.resolve()only resolves a target and does not load it. State thatworkspace-type-importis type-only. Add a short counterexample that confirms runtime-reachability consumers must exclude both edge kinds.As per coding guidelines, document each added graph edge kind with its direction, filter mapping, examples, and caveats.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/graph-edges.md` around lines 23 - 27, Update the graph-edge documentation entries for require-resolve and workspace-type-import to explicitly state that require.resolve() resolves without loading its target and workspace-type-import is type-only. Add a concise counterexample clarifying that runtime-reachability consumers must exclude both edge kinds, while preserving each edge’s direction, filter mapping, examples, and existing caveats.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tests/scoped.test.ts`:
- Around line 1-2: Update the fixture test containing “filesystem skips remain
outside dynamic-import reachability” to explicitly import the Vitest test API
from “vitest” before invoking test, preserving the existing test body.
---
Nitpick comments:
In
`@crates/no-mistakes/src/codebase/dependencies/graph/tests/edge_kind_semantics.rs`:
- Around line 94-118: Add a short explanatory comment immediately before the
RequireResolve asset-import assertion in the test. Reference the require.resolve
case and state that it creates an inspectable dependency edge without loading
the non-code asset; leave the assertions and behavior unchanged.
In `@crates/no-mistakes/src/codebase/rules/run/standalone/tests.rs`:
- Around line 21-42: Update graph_files_for to use a committed repository
fixture instead of creating a tempfile and writing src/api.ts and
generated/worker.ts at runtime. Preserve the fixture’s skipped-directory layout,
then build the VisiblePathSnapshot and discovery inputs from that fixture so
standalone_graph_files continues testing the same graph scope.
In `@docs/graph-edges.md`:
- Around line 23-27: Update the graph-edge documentation entries for
require-resolve and workspace-type-import to explicitly state that
require.resolve() resolves without loading its target and workspace-type-import
is type-only. Add a concise counterexample clarifying that runtime-reachability
consumers must exclude both edge kinds, while preserving each edge’s direction,
filter mapping, examples, and existing caveats.
In
`@test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml`:
- Line 13: Add one brief comment at each specified site documenting that the
configured sourceGlobs or import intentionally targets a filesystem-skipped
file/source:
test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.yml:13-13,
test-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tests/scoped.test.ts:2-2,
test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/.no-mistakes.yml:8-8,
and
test-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/entrypoints/runtime.ts:1-1.
Preserve the existing fixture behavior and add no other changes.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 10a02299-bc5b-4874-8378-df8a2e36160f
📒 Files selected for processing (74)
crates/no-mistakes/src/check_runner/run_all.rscrates/no-mistakes/src/check_runner/tests.rscrates/no-mistakes/src/check_runner/tests/graph_scope.rscrates/no-mistakes/src/codebase/check_facts/map.rscrates/no-mistakes/src/codebase/dependencies/args_relationships_filter.rscrates/no-mistakes/src/codebase/dependencies/graph/build_plan.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_import_reachability.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_imports.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_symbols_exports.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_symbols_helpers.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_symbols_reexport_namespaces.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_symbols_scoped_imports.rscrates/no-mistakes/src/codebase/dependencies/graph/edge_symbols_star_reexports.rscrates/no-mistakes/src/codebase/dependencies/graph/lazy_import_neighbors.rscrates/no-mistakes/src/codebase/dependencies/graph/tests/edge_kind_semantics.rscrates/no-mistakes/src/codebase/dependencies/graph/tests/extra_symbol_helpers.rscrates/no-mistakes/src/codebase/dependencies/graph/tests/mod.rscrates/no-mistakes/src/codebase/dependencies/graph/tests/module_cases.rscrates/no-mistakes/src/codebase/dependencies/graph/tests/route_import.rscrates/no-mistakes/src/codebase/dependencies/graph/types_edges.rscrates/no-mistakes/src/codebase/dependencies/graph/types_edges_sort.rscrates/no-mistakes/src/codebase/dependencies/graph/types_edges_sort/tests.rscrates/no-mistakes/src/codebase/dependencies/output/tests/edge_kinds.rscrates/no-mistakes/src/codebase/dependencies/tests/args_relationships.rscrates/no-mistakes/src/codebase/rules/mod.rscrates/no-mistakes/src/codebase/rules/required_entrypoint_reachability.rscrates/no-mistakes/src/codebase/rules/required_entrypoint_reachability/tests.rscrates/no-mistakes/src/codebase/rules/run.rscrates/no-mistakes/src/codebase/rules/run/prepared.rscrates/no-mistakes/src/codebase/rules/run/standalone.rscrates/no-mistakes/src/codebase/rules/run/standalone/tests.rscrates/no-mistakes/src/codebase/rules/test_no_unmocked_dynamic_imports/config/prepared_tests.rscrates/no-mistakes/src/codebase/rules/test_no_unmocked_dynamic_imports/with_facts.rscrates/no-mistakes/src/codebase/rules/tests.rscrates/no-mistakes/src/codebase/rules/tests/extended.rscrates/no-mistakes/src/codebase/symbols/impact.rscrates/no-mistakes/src/codebase/symbols/impact_collect_targets.rscrates/no-mistakes/src/codebase/symbols/impact_collect_targets_tests.rscrates/no-mistakes/src/napi_api/analyze_project/context/check_prepare.rscrates/no-mistakes/src/napi_api/analyze_project/context/check_run.rscrates/no-mistakes/src/napi_api/analyze_project/context/scope_materialize.rscrates/no-mistakes/src/napi_api/analyze_project/context/scope_prepare.rscrates/no-mistakes/src/napi_api/analyze_project/context/scope_project_reports.rscrates/no-mistakes/src/napi_api/analyze_project/context/scope_types.rscrates/no-mistakes/src/napi_api/analyze_project/tests.rscrates/no-mistakes/src/tests/impact.rscrates/no-mistakes/src/tests/plan_bfs.rscrates/no-mistakes/tests/cli_codebase_acceptance/graph.rscrates/no-mistakes/tests/cli_codebase_acceptance/workspace.rsdocs/graph-edges.mddocs/rules/required-entrypoint-reachability.mdtest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/.no-mistakes.ymltest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/skipped/setup.tstest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/skipped/target.tstest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/skipped/vitest.config.tstest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tests/scoped.test.tstest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/tsconfig.jsontest-cases/check-runner/dynamic-import-respects-filesystem-skip/fixture/vitest.config.tstest-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/.no-mistakes.ymltest-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/entrypoints/runtime.tstest-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/sources/registered.tstest-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/sources/unreachable.tstest-cases/check-runner/required-reachability-ignores-filesystem-skip/fixture/tsconfig.jsontest-cases/codebase-analysis/cross-boundary-monorepo/fixture/apps/backend/api/workspace-resolve.cjstest-cases/codebase-analysis/import-forms/fixture/require-resolve.jstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/api.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/require-resolve-asset.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/require-resolve-workspace.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/require-resolve.tstest-cases/rules/required-entrypoint-reachability/fixture/entrypoints/type-workspace.tstest-cases/rules/required-entrypoint-reachability/fixture/package.jsontest-cases/rules/required-entrypoint-reachability/fixture/packages/runtime/index.tstest-cases/rules/required-entrypoint-reachability/fixture/packages/runtime/package.jsontest-cases/rules/required-entrypoint-reachability/fixture/sources/config.json
🚧 Files skipped from review as they are similar to previous changes (7)
- test-cases/rules/required-entrypoint-reachability/fixture/entrypoints/api.ts
- crates/no-mistakes/src/check_runner/run_all.rs
- crates/no-mistakes/src/codebase/rules/mod.rs
- docs/rules/required-entrypoint-reachability.md
- crates/no-mistakes/src/codebase/rules/required_entrypoint_reachability.rs
- crates/no-mistakes/src/codebase/rules/run.rs
- crates/no-mistakes/src/napi_api/analyze_project/context/check_prepare.rs
Co-Authored-By: OpenAI Codex <codex@openai.com>
Summary
required-entrypoint-reachabilityrepository ruleMotivation
Applications with explicit worker or scheduler registries can silently leave source modules unregistered. Existing rules cannot require every file in a configured source set to be runtime-reachable from one or more entrypoint files.
Validation
cargo fmt --check: passedcargo clippy --workspace --all-targets --all-features -- -D warnings: passedNotes
The rule follows runtime value edges only: static imports, dynamic imports, CommonJS
require, workspace imports, and named/star re-exports. Type-only imports do not satisfy reachability.Related issues
Closes jonathanong/filaments#9186