Skip to content

feat(rules): add TypeScript project gate coverage - #619

Merged
jonathanong merged 19 commits into
mainfrom
upstream-tsconfig-rules
Aug 1, 2026
Merged

feat(rules): add TypeScript project gate coverage#619
jonathanong merged 19 commits into
mainfrom
upstream-tsconfig-rules

Conversation

@jonathanong

@jonathanong jonathanong commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add the tsconfig-gate-coverage repository rule, requiring every tracked TypeScript project to have both a static GitHub Actions tsc --noEmit registration and an unconditional local check
  • add checks.commands[].always plus impacted-checks --generic-only / Node genericOnly support so downstream pre-push runners can execute configured repository gates without rebuilding framework analysis
  • reuse request-prepared workflow documents across the new rule, Vitest CI coverage, and dependency graph topology
  • add fixture-backed coverage, suppression behavior, configuration validation, CLI/Node types, and documentation

Why

This upstreams the generic TypeScript project gate described in jonathanong/filaments#8933. no-mistakes already owns the tracked-file inventory and GitHub workflow topology, so it can enforce the policy deterministically in the same request-scoped analysis instead of requiring a downstream repository to rediscover and reparse those inputs.

Impact

Downstream repositories can configure one authoritative project allowlist, declare unconditional local typecheck commands, and consume those commands through the async programmatic API. Filaments can migrate its local gate after consuming a release containing this change.

Validation

  • cargo test -p no-mistakes --all-features --lib --bins --tests — 5,915 passed across 60 suites
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo run -p no-mistakes --quiet -- check
  • cargo fmt --all -- --check
  • pre-push ast-grep tests — 15 passed
  • npm run fmt:js:check
  • npm run lint:js

Focused coverage for the new rule remains above the repository's 99% line/function thresholds.

Shepherd Journal

  • Codecov Rust project status was transient: the Rust coverage upload step was still pending in run 30693853197, while patch coverage already passed and no review comment requested a code change.
  • Rejected the CodSpeed memory regression as non-actionable noise: the flagged facts/imports_and_symbols benchmark directly measures collect_ts_facts, this PR changes neither that fact-collection path nor the benchmark, 53 peer benchmarks were unchanged, and CodSpeed warns the comparison used different runtime environments.
  • Rejected the MSRV suggestion: CI pins Rust 1.96.0 in .github/workflows/ci.yml, so the stabilized if-let guard syntax is supported by the project toolchain.

@coderabbitai

This comment has been minimized.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 1, 2026
@sourcery-ai

This comment has been minimized.

@codecov

This comment has been minimized.

@jonathanong
jonathanong force-pushed the upstream-tsconfig-rules branch from de7623d to eb9d5cf Compare August 1, 2026 09:53
@jonathanong
jonathanong force-pushed the upstream-tsconfig-rules branch from eb9d5cf to 9719d3a Compare August 1, 2026 10:11
@codspeed-hq

This comment has been minimized.

@jonathanong
jonathanong marked this pull request as ready for review August 1, 2026 18:18
sourcery-ai[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (15)
fixtures/rules/vitest-ci-path-coverage/parsed-workflow-errors/.github/workflows/bad.yml (1)

1-3: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Record why this workflow is malformed.

The unterminated flow sequence on line 3 is intentional. It drives the parsed-workflow error path. Add a leading comment so a future reader or a YAML linter does not treat it as an accidental syntax error. The comment does not repair the parse failure, because the sequence stays unterminated.

♻️ Proposed fixture comment
+# Intentionally malformed: the unterminated flow sequence below makes YAML
+# parsing fail so vitest-ci-path-coverage reports a parsed-workflow error.
 name: malformed
 jobs:
   test: [

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or 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
`@fixtures/rules/vitest-ci-path-coverage/parsed-workflow-errors/.github/workflows/bad.yml`
around lines 1 - 3, Add a short leading comment to the malformed workflow
fixture before the name declaration, stating that the unterminated flow sequence
is intentional and exercises the parsed-workflow error path; leave the sequence
itself unchanged so the YAML remains invalid.

Source: Coding guidelines

crates/no-mistakes/src/check_runner/tests.rs (1)

108-124: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add an invariant comment to the Playwright config fixture.

prepared.playwright is Some(...) when playwright-coverage is enabled, so this test exercises prepared.rs/fact_plan_for_consumers instead of the None branch in run_all.rs. Add a short fixture or test comment documenting that the missing playwright.config.ts should fail before the run_all fallback.

🤖 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/check_runner/tests.rs` around lines 108 - 124, Add a
concise comment near the invalid Playwright fixture setup or the test
`run_all_contextualizes_playwright_fact_plan_preparation_failures` documenting
that `playwright-coverage` makes `prepared.playwright` present, so the missing
`playwright.config.ts` must fail during `prepared.rs`/`fact_plan_for_consumers`
before reaching the `run_all` fallback.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/filesystem_dispatch/registry.rs (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Hide the exported registry macro from the public API.

#[macro_export] places filesystem_rules! at the crate root as a public item. The macro is an internal rule registry. Add #[doc(hidden)] so it stays out of the published API documentation while remaining callable as crate::filesystem_rules!.

♻️ Proposed change
 #[macro_export]
+#[doc(hidden)]
 macro_rules! filesystem_rules {
🤖 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/filesystem_dispatch/registry.rs` at
line 1, Add #[doc(hidden)] alongside #[macro_export] on the filesystem_rules!
macro definition in the registry module, keeping the macro exported and callable
through crate::filesystem_rules! while hiding it from generated public API
documentation.
crates/no-mistakes/src/codebase/dependencies/graph/edge_workflow_topology/tests.rs (1)

10-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a case for a path missing from the prepared set.

The test covers only the matching-scope projection. Add an assertion for a graph path that the prepared set does not contain. That test documents the silent-drop behavior of project_paths and protects the invariant if the prepared scope narrows later.

♻️ Suggested additional test
#[test]
fn graph_paths_absent_from_prepared_workflows_are_dropped() {
    let root = fixture_root();
    let workflow = root.join(".github/workflows/ci.yml");
    // Prepared set intentionally excludes the requested workflow to pin the
    // projection contract: unmatched paths are dropped, not parsed.
    let prepared = crate::codebase::ci_workflows::ParsedWorkflowSet { documents: Vec::new() };

    let projected = parsed_workflows_for_graph(
        &root,
        &[workflow],
        &crate::config::v2::schema::CiConfig::default(),
        Some(&prepared),
    );

    assert!(projected.documents.is_empty());
}

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or 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/edge_workflow_topology/tests.rs`
around lines 10 - 26, Add a second test alongside
prepared_workflows_are_projected_to_the_graph_workflow_universe that passes an
intentionally empty ParsedWorkflowSet to parsed_workflows_for_graph while
requesting the fixture workflow path, then assert projected.documents is empty.
Include a short comment explaining that the unmatched graph path is
intentionally dropped rather than parsed, preserving the project_paths
projection contract.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/filesystem_dispatch/entrypoints.rs (1)

125-132: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Prepare workflows once for every rule that needs them.

vitest-ci-path-coverage receives workflow_documents and falls back to discovering workflow files, reading each file from snapshot/sources, and parsing YAML when it is None. If both vitest-ci-path-coverage and tsconfig-gate-coverage are enabled but only load workflows for tsconfig-gate-coverage, Vitest repeats the same discovery, reads, and YAML parsing in one invocation.

♻️ Proposed change
-    let workflows =
-        rule_enabled(config, crate::codebase::rules::TSCONFIG_GATE_COVERAGE).then(|| {
+    let workflows_needed = [
+        crate::codebase::rules::TSCONFIG_GATE_COVERAGE,
+        crate::codebase::rules::VITEST_CI_PATH_COVERAGE,
+    ]
+    .iter()
+    .any(|rule_id| rule_enabled(config, rule_id));
+    let workflows = workflows_needed.then(|| {
         crate::codebase::ci_workflows::ParsedWorkflowSet::load_from_snapshot_and_sources(
             &root, &config.ci, snapshot, &sources,
         )
     });
🤖 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/filesystem_dispatch/entrypoints.rs`
around lines 125 - 132, Update the workflow preparation in the entrypoint around
ParsedWorkflowSet::load_from_snapshot_and_sources so workflows are loaded when
either vitest-ci-path-coverage or TSCONFIG_GATE_COVERAGE is enabled. Reuse the
single prepared workflow set for both rules by passing it through their
workflow_documents inputs, avoiding repeated discovery, reads, and YAML parsing.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/filesystem_dispatch/tests.rs (1)

90-118: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Record the invariant this test protects.

Three other tests in this file pass workflow_documents: None and succeed. This test fails only because the missing-ci fixture enables tsconfig-gate-coverage. Add a short comment stating that the rule requires a prepared ParsedWorkflowSet, so a reader does not treat None as always valid.

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or tests to preserve the invariant they protect."

♻️ Proposed comment
 #[test]
+// Unlike the other prepared-dispatch tests, this fixture enables
+// tsconfig-gate-coverage, which cannot run without a prepared
+// ParsedWorkflowSet. Passing `None` must fail loudly, not silently skip.
 fn prepared_dispatch_rejects_tsconfig_gate_without_workflow_documents() {
🤖 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/filesystem_dispatch/tests.rs` around
lines 90 - 118, Add a short comment in
prepared_dispatch_rejects_tsconfig_gate_without_workflow_documents explaining
that the tsconfig-gate-coverage rule requires a prepared ParsedWorkflowSet, so
workflow_documents: None is intentionally rejected for this fixture despite
succeeding in other tests.

Source: Coding guidelines

fixtures/rules/tsconfig-gate-coverage/working-directories/.no-mistakes.yml (1)

1-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Name the scanner path each command exercises.

Entries 1 and 4 have the same shape: bash -c "cd X && tsc --noEmit". Only the directory differs. A reader cannot tell what distinguishes them, or why --dir= and --project appear in the other two entries. Add one comment per entry naming the working-directory source it covers.

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or tests to preserve the invariant they protect."

♻️ Proposed comments
 checks:
   commands:
+    # Working directory comes from a `cd` inside `bash -c`.
     - name: typecheck-workflow-default
       command: [bash, -c, cd workflow-default && tsc --noEmit]
       fileArgs: none
       always: true
+    # Working directory comes from the runner flag `--dir=`.
     - name: typecheck-job-default
       command: [pnpm, --dir=job-default, exec, tsc, --noEmit]
       fileArgs: none
       always: true
+    # Project comes from an explicit `--project`, with no working-directory change.
     - name: typecheck-step-default
       command: [tsc, --noEmit, --project, step-default/tsconfig.json]
       fileArgs: none
       always: true
+    # Second `cd` case: proves attribution is per directory, not one shared match.
     - name: typecheck-cd-project
       command: [bash, -c, cd cd-project && tsc --noEmit]
       fileArgs: none
       always: true
🤖 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 `@fixtures/rules/tsconfig-gate-coverage/working-directories/.no-mistakes.yml`
around lines 1 - 18, Add a concise comment immediately above each command in the
checks.commands list identifying the scanner working-directory source it
exercises, including why the workflow-default, job-default, step-default, and
cd-project invocation styles differ. Preserve all command definitions and
options unchanged.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs (1)

176-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pass the vitest scan inputs as a struct instead of seven positional arguments.

Line 177 calls check_with_files_from_snapshot_catalog_sources_and_workflows with seven positional arguments on one line. scan.rs already defines ScanInputs for the inner scan function. Exposing a prepared-input struct at this boundary matches PreparedFilesystemRuleInputs and removes the ordering hazard between snapshot, vitest_catalog, sources, and workflow_documents.

🤖 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/filesystem_dispatch/execute.rs` around
lines 176 - 178, Update the Vitest dispatch in the rule execution flow to
construct and pass the existing prepared-input struct, following the pattern of
PreparedFilesystemRuleInputs, instead of supplying seven positional arguments to
check_with_files_from_snapshot_catalog_sources_and_workflows. Expose or reuse a
ScanInputs-style struct at this boundary and populate it with root, config,
candidates, snapshot, vitest_catalog, sources, and workflow_documents while
preserving the existing scan behavior.
crates/no-mistakes/src/codebase/rules/filesystem_dispatch/candidate_index/tests.rs (1)

132-139: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Include all dispatch sibling modules in the candidate-index assertion.

The test only scans filesystem_dispatch.rs and execute.rs, so adding file handling or candidate preparation to another sibling module would not update this coverage. Concatenate entrypoints.rs, registry.rs, candidate_helpers.rs, candidate_index.rs, inventory.rs, preserved.rs, and run_rule.rs as well when asserting the dispatch module surface.

🤖 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/filesystem_dispatch/candidate_index/tests.rs`
around lines 132 - 139, Update the dispatch source assembled in the
candidate-index test to include the sibling modules entrypoints.rs, registry.rs,
candidate_helpers.rs, candidate_index.rs, inventory.rs, preserved.rs, and
run_rule.rs alongside filesystem_dispatch.rs and execute.rs. Keep the existing
assertions unchanged so they validate the complete dispatch module surface.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs (1)

4-9: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Reject unknown rule options before applying exemptions.

Options uses serde(default), so a mistyped top-level option such as allowProject is ignored while the valid allowProjects exemption is treated as absent. Add serde(deny_unknown_fields) to this rule config so malformed rules fail with a clear config error instead of reporting projects the author meant to exempt.

🤖 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/tsconfig_gate_coverage/application.rs`
around lines 4 - 9, Add serde’s deny_unknown_fields attribute to the Options
struct so unrecognized top-level rule options, such as allowProject, produce a
configuration error instead of being silently ignored. Preserve the existing
defaults and camelCase mapping for valid fields, including allow_projects.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters/tests/parsed.rs (1)

27-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the intentionally absent fixture file.

missing.yml must not exist. It produces the Read error branch. A contributor could create the file and silently reduce the test to one error kind. Add a short comment that states the invariant.

♻️ Proposed comment
     let paths = [
         root.join(".github/workflows/bad.yml"),
+        // Intentionally absent: exercises the Read error kind.
         root.join(".github/workflows/missing.yml"),
     ];

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or 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/rules/vitest_ci_path_coverage/workflow_filters/tests/parsed.rs`
around lines 27 - 30, Add a short comment immediately before the paths fixture
in the test, explicitly stating that missing.yml must remain absent because it
exercises the Read error branch. Do not alter the fixture paths or test
behavior.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters.rs (2)

75-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add fix guidance to the workflow load findings.

The message states what failed and where. It does not state how to fix the problem or why the check exists. Extend the text, for example: name the rule, and instruct the user to correct the YAML syntax or the file permissions so that CI path filters can be read.

As per coding guidelines: "Provide custom error messages suitable for agents, and when reporting errors explain what happened, where it happened, how to fix it, and why a check exists."

🤖 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/vitest_ci_path_coverage/workflow_filters.rs`
around lines 75 - 89, Update the workflow load finding constructed in the Err
branch of the document.value match to include the rule name, actionable guidance
for correcting YAML syntax or file permissions, and that CI path filters must be
readable for this check. Preserve the existing read/parse-specific action and
error details.

Source: Coding guidelines


99-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the second read-and-parse pipeline.

ci_filters_from_paths duplicates the selector prefilter, the findings accumulation, and the sort of ci_filters_from_parsed_with_sources. It also opens its own read and parse pipeline through sources.read_path plus extract::from_workflow. Build a ParsedWorkflowSet from the discovered paths, then delegate to ci_filters_from_parsed_with_sources. ParsedWorkflowSet::from_paths already exists; workflow_filters/tests/parsed.rs Line 20 uses it.

♻️ Proposed direction
 fn ci_filters_from_paths(
     root: &Path,
     selectors: &[WorkflowSelector],
     workflow_files: Vec<std::path::PathBuf>,
     sources: &crate::codebase::ts_source::SourceStore,
 ) -> (Vec<CiFilter>, Vec<RuleFinding>) {
-    let mut filters = Vec::new();
-    ...
+    let parsed = ParsedWorkflowSet::from_paths(root, workflow_files.into_iter());
+    ci_filters_from_parsed_with_sources(root, selectors, &parsed, sources)
 }

This also lets extract::from_workflow retire, since only the parsed path would remain.

As per coding guidelines: "Lower layers must consume prepared facts and session-owned stores by reference and must not open independent source, read, parse, resolution, or graph-building pipelines."

🤖 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/vitest_ci_path_coverage/workflow_filters.rs`
around lines 99 - 132, Replace the duplicate read-and-parse logic in
ci_filters_from_paths with ParsedWorkflowSet::from_paths using the discovered
workflow_files, then delegate filtering and finding generation to
ci_filters_from_parsed_with_sources while preserving the existing root,
selectors, and sources inputs. Remove the local selector filtering,
sources.read_path handling, extract::from_workflow calls, and sorting from this
function; once no callers remain, retire extract::from_workflow.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs (1)

145-156: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the error text, not only is_err().

The test accepts any error. A different failure, for example a fixture load error, keeps the test green. The sibling Vitest test asserts the message content (vitest_ci_path_coverage/tests.rs Line 138). Match that pattern so the invalid-glob path stays covered.

♻️ Proposed change
-    assert!(check(&root, &config).is_err());
+    let error = check(&root, &config).unwrap_err();
+    assert!(error.to_string().contains("invalid glob"), "{error:#}");
🤖 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/tsconfig_gate_coverage/tests.rs` around
lines 145 - 156, Update
invalid_rule_filter_is_returned_without_partial_coverage_findings to capture the
error from check(&root, &config) and assert that its text matches the expected
invalid-glob failure, following the message assertion pattern used by the
sibling vitest_ci_path_coverage test. Keep the test focused on the configured
"[" include pattern so unrelated fixture or configuration errors cannot satisfy
it.
crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/scan.rs (1)

30-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the prepared session inputs for this rule.

VITEST_CI_PATH_COVERAGE calls check_with_files_from_snapshot_catalog_sources_and_workflows, but that function ignores the SourceStore/workflow_documents supplied by the execution path and only uses them when None workflows are provided. Move the Snapshot/SourceStore ownership into the prepared inputs and keep check_with_files behind #[cfg(test)] to avoid a second incompatible snapshot/store for tests.

🤖 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/vitest_ci_path_coverage/scan.rs` around
lines 30 - 64, Update the VITEST_CI_PATH_COVERAGE execution flow so
check_with_files_from_snapshot_catalog_sources_and_workflows uses the prepared
Snapshot, SourceStore, and workflow_documents rather than rebuilding or ignoring
them when workflows are supplied. Move Snapshot/SourceStore ownership into the
prepared inputs, and restrict check_with_files to #[cfg(test)] so tests do not
construct a separate incompatible snapshot/store.

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 `@crates/no-mistakes/src/codebase/dependencies/graph/builder_check_facts.rs`:
- Line 101: Update the graph-build invocation containing workflow_documents:
None to pass the request-scoped prepared.workflow_documents() reference instead.
Ensure collect_remaining_edges and the plan.ci/plan.workflow_topology paths
consume this prepared workflow set without re-reading or reparsing files, and
add a fixture-backed regression test for this entrypoint.

In `@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs`:
- Around line 71-88: In the validation flow containing normalized and reason,
move the reason.trim().is_empty() check before normalized.insert. Ensure entries
with empty reasons are reported and skipped without claiming a normalized path,
while valid entries continue through duplicate detection and insertion.

In
`@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan.rs`:
- Around line 40-52: In the command scanning logic, update the `tokens[0]` check
near the `static_tokens` result to use `tokens.first()` and compare the
referenced value to `"cd"`. Preserve the existing directory-change handling and
avoid direct indexing so empty token vectors are handled without panicking.

In `@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow.rs`:
- Around line 65-67: Update is_project_inside_root to perform an actual
containment check using root and project, resolving the project path relative to
root and confirming it remains under that root; preserve the boolean result
expected by scan_shell_for_typechecked_projects. If the function is
intentionally only a syntax check instead, rename it to reflect that behavior
and remove the unused root parameter, then update its call site accordingly.

In `@crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/tests.rs`:
- Around line 17-27: Add a test in the tests.rs helper flow that constructs a
ParsedWorkflowSet with ParsedWorkflowSet::from_paths(...) and passes it as
Some(...) in the ScanInputs workflows field, while preserving the existing
snapshot-based test setup. Assert the resulting behavior to exercise
ci_filters_from_parsed_with_sources through scan_inputs rather than only
ci_filters_from_snapshot_with_sources.

In `@crates/no-mistakes/src/config/v2/discover.rs`:
- Around line 154-161: Update the validation errors in the command loop of
discover configuration to explain that always commands run once for the whole
project and therefore cannot use fileArgs, include, or exclude selection
settings. Retain the indexed command location and state the required
configuration and rationale in each message.

---

Nitpick comments:
In `@crates/no-mistakes/src/check_runner/tests.rs`:
- Around line 108-124: Add a concise comment near the invalid Playwright fixture
setup or the test
`run_all_contextualizes_playwright_fact_plan_preparation_failures` documenting
that `playwright-coverage` makes `prepared.playwright` present, so the missing
`playwright.config.ts` must fail during `prepared.rs`/`fact_plan_for_consumers`
before reaching the `run_all` fallback.

In
`@crates/no-mistakes/src/codebase/dependencies/graph/edge_workflow_topology/tests.rs`:
- Around line 10-26: Add a second test alongside
prepared_workflows_are_projected_to_the_graph_workflow_universe that passes an
intentionally empty ParsedWorkflowSet to parsed_workflows_for_graph while
requesting the fixture workflow path, then assert projected.documents is empty.
Include a short comment explaining that the unmatched graph path is
intentionally dropped rather than parsed, preserving the project_paths
projection contract.

In
`@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/candidate_index/tests.rs`:
- Around line 132-139: Update the dispatch source assembled in the
candidate-index test to include the sibling modules entrypoints.rs, registry.rs,
candidate_helpers.rs, candidate_index.rs, inventory.rs, preserved.rs, and
run_rule.rs alongside filesystem_dispatch.rs and execute.rs. Keep the existing
assertions unchanged so they validate the complete dispatch module surface.

In `@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/entrypoints.rs`:
- Around line 125-132: Update the workflow preparation in the entrypoint around
ParsedWorkflowSet::load_from_snapshot_and_sources so workflows are loaded when
either vitest-ci-path-coverage or TSCONFIG_GATE_COVERAGE is enabled. Reuse the
single prepared workflow set for both rules by passing it through their
workflow_documents inputs, avoiding repeated discovery, reads, and YAML parsing.

In `@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs`:
- Around line 176-178: Update the Vitest dispatch in the rule execution flow to
construct and pass the existing prepared-input struct, following the pattern of
PreparedFilesystemRuleInputs, instead of supplying seven positional arguments to
check_with_files_from_snapshot_catalog_sources_and_workflows. Expose or reuse a
ScanInputs-style struct at this boundary and populate it with root, config,
candidates, snapshot, vitest_catalog, sources, and workflow_documents while
preserving the existing scan behavior.

In `@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/registry.rs`:
- Line 1: Add #[doc(hidden)] alongside #[macro_export] on the filesystem_rules!
macro definition in the registry module, keeping the macro exported and callable
through crate::filesystem_rules! while hiding it from generated public API
documentation.

In `@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/tests.rs`:
- Around line 90-118: Add a short comment in
prepared_dispatch_rejects_tsconfig_gate_without_workflow_documents explaining
that the tsconfig-gate-coverage rule requires a prepared ParsedWorkflowSet, so
workflow_documents: None is intentionally rejected for this fixture despite
succeeding in other tests.

In `@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs`:
- Around line 4-9: Add serde’s deny_unknown_fields attribute to the Options
struct so unrecognized top-level rule options, such as allowProject, produce a
configuration error instead of being silently ignored. Preserve the existing
defaults and camelCase mapping for valid fields, including allow_projects.

In `@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs`:
- Around line 145-156: Update
invalid_rule_filter_is_returned_without_partial_coverage_findings to capture the
error from check(&root, &config) and assert that its text matches the expected
invalid-glob failure, following the message assertion pattern used by the
sibling vitest_ci_path_coverage test. Keep the test focused on the configured
"[" include pattern so unrelated fixture or configuration errors cannot satisfy
it.

In `@crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/scan.rs`:
- Around line 30-64: Update the VITEST_CI_PATH_COVERAGE execution flow so
check_with_files_from_snapshot_catalog_sources_and_workflows uses the prepared
Snapshot, SourceStore, and workflow_documents rather than rebuilding or ignoring
them when workflows are supplied. Move Snapshot/SourceStore ownership into the
prepared inputs, and restrict check_with_files to #[cfg(test)] so tests do not
construct a separate incompatible snapshot/store.

In
`@crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters.rs`:
- Around line 75-89: Update the workflow load finding constructed in the Err
branch of the document.value match to include the rule name, actionable guidance
for correcting YAML syntax or file permissions, and that CI path filters must be
readable for this check. Preserve the existing read/parse-specific action and
error details.
- Around line 99-132: Replace the duplicate read-and-parse logic in
ci_filters_from_paths with ParsedWorkflowSet::from_paths using the discovered
workflow_files, then delegate filtering and finding generation to
ci_filters_from_parsed_with_sources while preserving the existing root,
selectors, and sources inputs. Remove the local selector filtering,
sources.read_path handling, extract::from_workflow calls, and sorting from this
function; once no callers remain, retire extract::from_workflow.

In
`@crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters/tests/parsed.rs`:
- Around line 27-30: Add a short comment immediately before the paths fixture in
the test, explicitly stating that missing.yml must remain absent because it
exercises the Read error branch. Do not alter the fixture paths or test
behavior.

In `@fixtures/rules/tsconfig-gate-coverage/working-directories/.no-mistakes.yml`:
- Around line 1-18: Add a concise comment immediately above each command in the
checks.commands list identifying the scanner working-directory source it
exercises, including why the workflow-default, job-default, step-default, and
cd-project invocation styles differ. Preserve all command definitions and
options unchanged.

In
`@fixtures/rules/vitest-ci-path-coverage/parsed-workflow-errors/.github/workflows/bad.yml`:
- Around line 1-3: Add a short leading comment to the malformed workflow fixture
before the name declaration, stating that the unterminated flow sequence is
intentional and exercises the parsed-workflow error path; leave the sequence
itself unchanged so the YAML remains invalid.
🪄 Autofix (Beta)

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: f3958d53-700c-4eda-94b5-36be054b2d6f

📥 Commits

Reviewing files that changed from the base of the PR and between 13c5295 and 9719d3a.

⛔ Files ignored due to path filters (1)
  • fixtures/rules/tsconfig-gate-coverage/malformed-workflow/node_modules/ignored/tsconfig.json is excluded by !**/node_modules/**
📒 Files selected for processing (95)
  • crates/no-mistakes/src/check_parallel.rs
  • crates/no-mistakes/src/check_runner.rs
  • crates/no-mistakes/src/check_runner/forbidden_plan.rs
  • crates/no-mistakes/src/check_runner/prepared.rs
  • crates/no-mistakes/src/check_runner/run_all.rs
  • crates/no-mistakes/src/check_runner/tests.rs
  • crates/no-mistakes/src/check_runner/tests/architecture.rs
  • crates/no-mistakes/src/check_tasks/filesystem.rs
  • crates/no-mistakes/src/codebase/ci_workflows/tests.rs
  • crates/no-mistakes/src/codebase/ci_workflows/workflow_set.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/builder.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/builder_check_facts.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/builder_helpers.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/builder_remaining_edges.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/edge_workflow_topology.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/edge_workflow_topology/tests.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/files_config_prepared.rs
  • crates/no-mistakes/src/codebase/dependencies/graph/tests/config_path_full_graph.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/candidate_index/tests.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/entrypoints.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/registry.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/tests.rs
  • crates/no-mistakes/src/codebase/rules/ids.rs
  • crates/no-mistakes/src/codebase/rules/mod.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/findings.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/scan.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/tests.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters/extract.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters/tests.rs
  • crates/no-mistakes/src/codebase/rules/vitest_ci_path_coverage/workflow_filters/tests/parsed.rs
  • crates/no-mistakes/src/config/v2/discover.rs
  • crates/no-mistakes/src/config/v2/schema/ci_checks.rs
  • crates/no-mistakes/src/config/v2/tests.rs
  • crates/no-mistakes/src/impacted_checks.rs
  • crates/no-mistakes/src/impacted_checks/generate/generic.rs
  • crates/no-mistakes/src/impacted_checks/generate/prepare.rs
  • crates/no-mistakes/src/impacted_checks/tests.rs
  • crates/no-mistakes/src/impacted_checks/tests/generic_checks.rs
  • crates/no-mistakes/src/impacted_checks/tests/runner_isolation.rs
  • crates/no-mistakes/src/napi_api/analyze_project/context/check_prepare.rs
  • crates/no-mistakes/src/napi_api/analyze_project/context/check_run.rs
  • crates/no-mistakes/src/napi_api/cli_parity_builders.rs
  • crates/no-mistakes/src/napi_api/options_ci.rs
  • crates/no-mistakes/src/napi_api/tests/ci.rs
  • crates/no-mistakes/tests/cli_ci.rs
  • crates/no-mistakes/tests/docs_coverage.rs
  • docs/cli/impacted-checks.md
  • docs/configuration/checks.md
  • docs/node-api.md
  • docs/rules/README.md
  • docs/rules/tsconfig-gate-coverage.md
  • fixtures/check-runner/empty/.no-mistakes.yml
  • fixtures/check-runner/invalid-playwright-fact-plan/.no-mistakes.yml
  • fixtures/ci-workflows/project-paths/.github/workflows/a.yml
  • fixtures/ci-workflows/project-paths/.github/workflows/b.yml
  • fixtures/graph/workflow-topology-prepared/.github/workflows/ci.yml
  • fixtures/impacted-checks/generic-only.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/allowlist-errors/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/allowlist-errors/allowed/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/allowlist-errors/collision/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/allowlist-pass/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/allowlist-pass/tooling/tsconfig.tools.json
  • fixtures/rules/tsconfig-gate-coverage/malformed-workflow/.github/workflows/bad.yml
  • fixtures/rules/tsconfig-gate-coverage/malformed-workflow/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/malformed-workflow/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/missing-ci/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/missing-ci/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/missing-ci/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/missing-ci/tools/tsconfig.tools.json
  • fixtures/rules/tsconfig-gate-coverage/missing-local/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/missing-local/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/missing-local/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/pass/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/pass/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/pass/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/pass/tools/tsconfig.tools.json
  • fixtures/rules/tsconfig-gate-coverage/working-directories/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/working-directories/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/working-directories/cd-project/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/working-directories/job-default/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/working-directories/step-default/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/working-directories/workflow-default/tsconfig.json
  • fixtures/rules/vitest-ci-path-coverage/parsed-workflow-errors/.github/workflows/bad.yml
  • packages/no-mistakes/ci-types.d.ts
  • skills/no-mistakes/SKILL.md

Comment thread crates/no-mistakes/src/codebase/dependencies/graph/builder_check_facts.rs Outdated
Comment thread crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs Outdated
Comment thread crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan.rs Outdated
Comment thread crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow.rs Outdated
Comment thread crates/no-mistakes/src/config/v2/discover.rs Outdated
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@jonathanong
jonathanong enabled auto-merge (squash) August 1, 2026 18:32
Co-authored-by: coderabbitai <coderabbitai@users.noreply.github.com>
@jonathanong
jonathanong dismissed coderabbitai[bot]’s stale review August 1, 2026 18:35

Addressed all six findings with prepared-workflow reuse, validation ordering, safe token handling, clearer naming and diagnostics, and fixture-backed coverage.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

jonathanong and others added 2 commits August 1, 2026 11:45
Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai <coderabbitai@users.noreply.github.com>
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
chatgpt-codex-connector[bot]

This comment was marked as resolved.

jonathanong and others added 3 commits August 1, 2026 12:55
Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
Co-authored-by: chatgpt-codex-connector <chatgpt-codex-connector@users.noreply.github.com>
chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs (1)

259-273: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document why ./node_modules/.bin/tsc is accepted but tools/tsc is rejected.

Line 252 accepts ./node_modules/.bin/tsc as a compiler invocation. Lines 259-273 reject ./scripts/tsc, tools/tsc, and vendor/bin/tsc. The distinguishing invariant is not visible in the test. Add a short comment that states the accepted executable forms, so a later change to the executable allowlist does not silently invalidate this test.

As per coding guidelines: "Add short comments to intentionally counterintuitive fixtures or 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/rules/tsconfig_gate_coverage/command_scan/tests.rs`
around lines 259 - 273, Add a short explanatory comment immediately above the
command loop in the test covering scan_argv_for_typechecked_projects. State that
./node_modules/.bin/tsc is an accepted compiler form, while ./scripts/tsc,
tools/tsc, and vendor/bin/tsc are intentionally rejected, preserving the
executable allowlist invariant.

Source: Coding guidelines

crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell.rs (1)

68-83: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Backslash-escaped quotes can bypass the multiline-quote rejection.

The scanner tracks quote state by character only. In "a \" b\ntsc --noEmit" the escaped \" closes the active quote. The following newline is then treated as unquoted, and the body is accepted. The scanner can credit a tsc occurrence that is only string data.

Consider skipping the character after a backslash while inside a double-quoted region.

♻️ Proposed handling for escaped characters
     let mut quote = None;
-    for character in script.chars() {
+    let mut characters = script.chars();
+    while let Some(character) = characters.next() {
+        if quote != Some('\'') && character == '\\' {
+            // A backslash escape must not close a quoted region.
+            if characters.next() == Some('\n') {
+                return true;
+            }
+            continue;
+        }
         match quote {
🤖 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/tsconfig_gate_coverage/command_scan/shell.rs`
around lines 68 - 83, Update contains_unsupported_multiline_shell_construct to
treat backslash-escaped characters as literal content while inside a
double-quoted region, skipping the escaped character before evaluating quote
closure. Preserve single-quote behavior and ensure a newline inside the
still-active double-quoted region returns true.
🤖 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/codebase/rules/tsconfig_gate_coverage/no_check.rs`:
- Around line 21-30: Update non_enforcing_tsconfigs to process tracked projects
with par_iter() instead of iter(), and collect the matching project names into a
BTreeSet so parallel processing preserves deterministic output. Keep each
effective_no_check() invocation isolated with its own loading set and reuse the
shared prepared SourceStore.

In
`@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime.rs`:
- Around line 29-46: Update runs_on_can_default_to_windows and its helper
is_windows_runner_label so a bare self-hosted runs-on label is treated as an
unknown runner rather than a statically non-Windows runner, causing the
Windows-default skip path to apply. Preserve current Windows label matching and
sequence handling, while ensuring unlabeled self-hosted configurations cannot be
credited as POSIX-safe.
- Around line 93-116: Update the option-matching logic in the surrounding
runtime parser to avoid the if-let match guard syntax, unless the project
explicitly pins Rust 1.95+ through its toolchain or CI configuration. Prefer
pre-checking execution_preserving_short_option(option) before the match, then
preserve the existing failure_enforced updates and index advancement for all
options.

---

Nitpick comments:
In
`@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell.rs`:
- Around line 68-83: Update contains_unsupported_multiline_shell_construct to
treat backslash-escaped characters as literal content while inside a
double-quoted region, skipping the escaped character before evaluating quote
closure. Preserve single-quote behavior and ensure a newline inside the
still-active double-quoted region returns true.

In
`@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs`:
- Around line 259-273: Add a short explanatory comment immediately above the
command loop in the test covering scan_argv_for_typechecked_projects. State that
./node_modules/.bin/tsc is an accepted compiler form, while ./scripts/tsc,
tools/tsc, and vendor/bin/tsc are intentionally rejected, preserving the
executable allowlist invariant.
🪄 Autofix (Beta)

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: 4bfb3f0b-5616-43ce-bf58-6ff56c5bc148

📥 Commits

Reviewing files that changed from the base of the PR and between 525bee0 and 516651a.

📒 Files selected for processing (41)
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tsc_arguments.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/no_check.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests/no_check.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime/tests.rs
  • cspell.config.yaml
  • docs/rules/tsconfig-gate-coverage.md
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/bad-array/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/bad-compiler-options/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/bad-extends/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/bad-no-check/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/base/directory/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/base/file.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/cycle/other.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/cycle/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/directory-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/empty/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/file-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/missing-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/package-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/no-check/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/no-check/base/base.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/base/neutral.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/direct/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/inherited/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/invalid/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check/override/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/non-enforcing-workflow/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/non-enforcing-workflow/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/non-enforcing-workflow/dynamic-runner/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/non-enforcing-workflow/implicit-windows-shell/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/non-enforcing-workflow/missing-runner/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (6)
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tsc_arguments.rs
  • docs/rules/tsconfig-gate-coverage.md
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai <coderabbitai@users.noreply.github.com>
@jonathanong
jonathanong dismissed coderabbitai[bot]’s stale review August 1, 2026 20:58

Parallelized noCheck analysis, handled package extends and indeterminate self-hosted runners, rejected quoted shell separators, and documented the Rust 1.96 MSRV evidence.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs (1)

51-59: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Avoid recomputing the tracked tsconfig set twice per invocation.

prepare_project_source_inputs (lines 109-144) already calls tracked_tsconfigs to build ProjectSourceInputs, and its keys are exactly the tracked set. check_with_prepared (line 56) calls tracked_tsconfigs again on the same tracked_paths. This repeats a repository-wide filter/validate pass within one invocation.

Derive tracked from prepared.project_source_inputs.keys() instead of recomputing it.

As per coding guidelines, "Share identical repository-wide computations across independent call paths within one invocation; add a cache key only when caller inputs genuinely vary, and regression-test call counts rather than value equality."

♻️ Proposed fix
-    let tracked = tracked_tsconfigs(root, prepared.tracked_paths);
+    let tracked = prepared
+        .project_source_inputs
+        .keys()
+        .cloned()
+        .collect::<BTreeSet<_>>();
     let non_enforcing = non_enforcing_tsconfigs(root, &tracked, prepared.sources);
     let ci_projects =
         ci_typechecked_projects(prepared.workflows, &tracked, prepared.project_source_inputs);

Also applies to: 109-144

🤖 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/tsconfig_gate_coverage.rs` around lines
51 - 59, Update check_with_prepared to derive tracked from
prepared.project_source_inputs.keys() instead of calling tracked_tsconfigs
again, preserving the existing tracked set consumed by non_enforcing_tsconfigs
and ci_typechecked_projects. Ensure prepare_project_source_inputs remains the
single tracked-tsconfig computation for each invocation.

Source: Coding guidelines

🧹 Nitpick comments (1)
crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs (1)

168-188: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the missing prepared-input error actionable.

Line 168 merges missing workflows and missing project inputs into one error. Report which input is absent. State that the failure occurred in filesystem dispatch. State that callers must prepare the missing input from the request snapshot. State that the rule uses these inputs to map CI typechecks to tracked projects.

As per coding guidelines, “Provide custom error messages suitable for agents, and when reporting errors explain what happened, where it happened, how to fix it, and why a check exists.”

Proposed error handling
-            let result = workflow_documents
-                .zip(tsconfig_gate_project_inputs)
-                .map_or_else(
-                || {
-                    Err(anyhow::anyhow!(
-                        "prepared workflow documents and project inputs are required for {TSCONFIG_GATE_COVERAGE}"
-                    ))
-                },
-                |(workflows, project_source_inputs)| {
+            let result = match (workflow_documents, tsconfig_gate_project_inputs) {
+                (Some(workflows), Some(project_source_inputs)) => {
                     tsconfig_gate_coverage::check_with_prepared(
                         root,
                         config,
@@
                         },
                     )
-                });
+                }
+                (None, _) => Err(anyhow::anyhow!(
+                    "cannot run {TSCONFIG_GATE_COVERAGE} in filesystem dispatch: \
+                     workflow documents were not prepared; prepare ParsedWorkflowSet from \
+                     the request snapshot so the rule can map CI typechecks to projects"
+                )),
+                (_, None) => Err(anyhow::anyhow!(
+                    "cannot run {TSCONFIG_GATE_COVERAGE} in filesystem dispatch: \
+                     project source inputs were not prepared; derive them from the request \
+                     snapshot and workspace so the rule can map CI typechecks to projects"
+                )),
+            };
🤖 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/filesystem_dispatch/execute.rs` around
lines 168 - 188, Update the missing-input error branch in the
workflow_documents/tsconfig_gate_project_inputs zip handling to identify whether
workflows, project source inputs, or both are absent. Make the
filesystem-dispatch message state that callers must prepare the missing input
from the request snapshot and explain that these inputs map CI typechecks to
tracked projects.

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
`@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests/review.rs`:
- Around line 5-16: Update the test cases in scan_shell_for_typechecked_projects
to credit commands where tsc --noEmit executes before or after a comment
boundary, including inline comments and literal # characters within words. Keep
only scripts whose first token is # in the rejected set, and adjust the
assertions accordingly.

---

Outside diff comments:
In `@crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs`:
- Around line 51-59: Update check_with_prepared to derive tracked from
prepared.project_source_inputs.keys() instead of calling tracked_tsconfigs
again, preserving the existing tracked set consumed by non_enforcing_tsconfigs
and ci_typechecked_projects. Ensure prepare_project_source_inputs remains the
single tracked-tsconfig computation for each invocation.

---

Nitpick comments:
In `@crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs`:
- Around line 168-188: Update the missing-input error branch in the
workflow_documents/tsconfig_gate_project_inputs zip handling to identify whether
workflows, project source inputs, or both are absent. Make the
filesystem-dispatch message state that callers must prepare the missing input
from the request snapshot and explain that these inputs map CI typechecks to
tracked projects.
🪄 Autofix (Beta)

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: 13bbf46e-a24a-4516-8849-627ffee5e542

📥 Commits

Reviewing files that changed from the base of the PR and between 516651a and 9e3b032.

⛔ Files ignored due to path filters (1)
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/package-base/node_modules/@scope/tsconfig/tsconfig.json is excluded by !**/node_modules/**
📒 Files selected for processing (58)
  • crates/no-mistakes/src/check_parallel.rs
  • crates/no-mistakes/src/check_runner/prepared.rs
  • crates/no-mistakes/src/check_runner/run_all.rs
  • crates/no-mistakes/src/check_runner/tests.rs
  • crates/no-mistakes/src/check_runner/tests/architecture.rs
  • crates/no-mistakes/src/check_runner/tests/config_path.rs
  • crates/no-mistakes/src/codebase/analysis_dataset.rs
  • crates/no-mistakes/src/codebase/analysis_session/io.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/candidate_index/tests.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/entrypoints.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/execute.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/metadata.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/application.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell/comments.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests/review.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tsc_arguments.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/no_check.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests/fixture_policy.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests/no_check.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests/workflow.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime/tests.rs
  • crates/no-mistakes/src/codebase/ts_resolver/catalog.rs
  • crates/no-mistakes/src/codebase/ts_resolver/catalog_membership.rs
  • crates/no-mistakes/src/config/v2/discover.rs
  • crates/no-mistakes/src/config/v2/discover/check_commands.rs
  • crates/no-mistakes/src/config/v2/mod.rs
  • crates/no-mistakes/src/config/v2/tests.rs
  • crates/no-mistakes/src/napi_api/analyze_project/context/check_run.rs
  • docs/configuration/checks.md
  • docs/rules/tsconfig-gate-coverage.md
  • fixtures/rules/tsconfig-gate-coverage/auto-config-path/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/auto-config-path/.no-mistakes.yaml
  • fixtures/rules/tsconfig-gate-coverage/auto-config-path/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/auto-config-suppression/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/auto-config-suppression/.no-mistakes.yaml
  • fixtures/rules/tsconfig-gate-coverage/auto-config-suppression/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/base/dotted.base.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/dotted-file-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/no-check-edge-cases/missing-package-base/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/pass/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/pass/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-negative/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-negative/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-negative/app/src/index.ts
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-negative/app/tsconfig.json
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-positive/.github/workflows/ci.yml
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-positive/.no-mistakes.yml
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-positive/app/ignored.ts
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-positive/app/src/index.ts
  • fixtures/rules/tsconfig-gate-coverage/path-filter-sources-positive/app/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (16)
  • fixtures/rules/tsconfig-gate-coverage/pass/.github/workflows/ci.yml
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/candidate_index/tests.rs
  • fixtures/rules/tsconfig-gate-coverage/pass/.no-mistakes.yml
  • docs/configuration/checks.md
  • crates/no-mistakes/src/check_parallel.rs
  • crates/no-mistakes/src/check_runner/tests/architecture.rs
  • crates/no-mistakes/src/config/v2/tests.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/tests.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch.rs
  • crates/no-mistakes/src/codebase/rules/filesystem_dispatch/entrypoints.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/no_check.rs
  • crates/no-mistakes/src/check_runner/run_all.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/tests.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/command_scan/shell.rs
  • crates/no-mistakes/src/codebase/rules/tsconfig_gate_coverage/workflow/runtime.rs

@chatgpt-codex-connector

This comment has been minimized.

@jonathanong
jonathanong dismissed coderabbitai[bot]’s stale review August 1, 2026 22:07

Updated the scanner to strip only lexical shell comments while preserving literal or escaped hash characters, with corrected regression cases.

@jonathanong
jonathanong merged commit 2813102 into main Aug 1, 2026
20 checks passed
@jonathanong
jonathanong deleted the upstream-tsconfig-rules branch August 1, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant