Skip to content

fix(rules): enable explicit gap opt-ins - #1117

Closed
WilliamK112 wants to merge 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/enable-gap-rules-1067
Closed

WilliamK112 wants to merge 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/enable-gap-rules-1067

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • distinguish unavailable rules from available rules that require an explicit opt-in
  • keep gaps/keywords and gaps/content out of the default enable = ["*"] selection while allowing exact rules, gaps/*, --rule-include gaps, and per-rule enabled = true to select them
  • apply the same selection to the runner, CLI and audit-engine cloud prefetch paths, config preflight, and discovery probes
  • update the gap-rule documentation and changelog

Closes #1067

Verification

  • npx --yes [email protected] test packages/rules/tests/filter-opt-in.test.ts packages/rules/tests/opt-in-rules.test.ts apps/cli/tests/audit/rule-options-preflight.test.ts — 15 passed
  • npx --yes --package @typescript/[email protected] tsgo --noEmit -p packages/rules/tsconfig.json — passed
  • git diff --check — passed

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Docs: docs/cloud/rules.mdx and docs/rules/gaps/index.mdx. Skill: none.

@nc9

nc9 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Thanks, the opt-in selection looks right and the parity test is a good call. Two things before merge:

  1. apps/cli/src/reports/reconstruct.ts:380 builds the report's rule metadata from loadAllRules(), which now leaves opt-in rules out. When gaps/* runs, its results fall back to the id as name, category other, severity warning, no description, plus a Rule not found in registry warning (lines 680-711). Please use loadAllRules({ includeOptIn: true }) there and add a test that rebuilds a stored gaps/keywords result with category gaps and severity info. Please leave smart-audits.ts as it is.
  2. Now that the docs example works, enable = ["gaps/keywords", "gaps/content"] replaces the default ["*"], so the audit runs only the gap rules. Could you change the examples in docs/cloud/rules.mdx, docs/rules/gaps/index.mdx, keywords.mdx and content.mdx to enable = ["*", "gaps/*"] (or show [rule_options."gaps/keywords"] enabled = true), and note in docs/configuration/rules.mdx that * skips opt-in rules? The glossary text in docs/scripts/glossary/terms.json ("disabled and do not run") also needs updating and regenerating (bun scripts/glossary.ts --write).

Optional: make the registry argument of filterRules required, add a test for ["*", "gaps/*"] plus a gaps/content disable, and update the comments that still call these rules disabled.

@WilliamK112
WilliamK112 force-pushed the codex/enable-gap-rules-1067 branch from b3eed12 to 00eb808 Compare October 26, 2026 00:32
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Addressed at current head 00eb808: reconstruction now loads opt-in rule metadata and a stored gaps/keywords result is covered with its gaps category and info severity. The four gap-rule examples now preserve the default rules with enable = ["*", ...], the rules guide explains that * skips opt-in rules, and the generated glossary text now describes the rules as explicitly selectable. The branch is rebased onto current main. The focused 30-test set, CLI typecheck, repository-wide format check, and full docs validation (61 docs tests) pass.

@WilliamK112
WilliamK112 force-pushed the codex/enable-gap-rules-1067 branch from 00eb808 to 9599fe5 Compare October 26, 2026 06:38
@nc9 nc9 mentioned this pull request Oct 26, 2026
@nc9

nc9 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Merged: landed in the v0.0.134 batch (#1149), main commits 06b9a3b. Thank you @WilliamK112, tracing the opt-in check through the runner, both cloud selectors, the preflight and the probes, then fixing the report rebuild and the docs examples that would have dropped every other rule, was thorough. (Nik)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(rules): gaps/keywords and gaps/content can never run, even when enabled as documented

2 participants