Skip to content

feat(rules): broken-link rules are reliability findings with a Reliability badge #836 #842 #843 - #856

Merged
nc9 merged 3 commits into
mainfrom
feat/836-broken-links-reliability
Oct 27, 2026
Merged

nc9 merged 3 commits into
mainfrom
feat/836-broken-links-reliability

Conversation

@nc9

@nc9 nc9 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #836. Closes #842. Closes #843.

What changes

A dead link is a reliability problem for visitors, not an SEO one.

  • Category (Broken links (internal and external) are a reliability finding, not SEO #836, links/broken-anchors: move to the reliability category with the other broken link rules? #843): links/broken-links, links/broken-external-links and links/broken-anchors change meta.category from links to reliability.
    • Ids are unchanged, so configs, links/* patterns, disable lists, rule_options, the rule cache and docs URLs keep working. The decision is recorded on Broken links (internal and external) are a reliability finding, not SEO #836.
    • Score effect: the three rules leave the SEO score, and Links drops from 16 rules to 13. They now count toward the Performance score through Reliability, which grows from 2 rules to 5. The overall health score formula is unchanged.
  • Badge (Broken link rules show a Performance badge: give reliability its own group or badge the category #842), decision recorded on the issue: the badge shows the category, and there is no new group.
    • A fifth RuleGroup would make the API's publish schema (z.enum(RULE_GROUPS) in the private repo) reject every publish from a new CLI until the API shipped first. That's a cross-repo change.
    • Instead, a category can set badgeByCategory (packages/report/src/categories.ts), and only reliability does. getBadgeName / getBadgeTitle drive the HTML badge, so every Reliability rule now reads Reliability, with the tooltip "Reliability, scored under Performance". That includes broken-resources and broken-forms, which read "Performance" before.
    • json, xml and llm carry category (Reliability) and group (performance, the score it counts toward) as data. Markdown, text and console show the category name, so they read Reliability already.
  • Stored reports: grouping and --category read meta.category from the stored report, so a report stored before the change keeps Links and the SEO badge. A test pins this.
  • Category vs id prefix (found in a codex pass): two CLI paths assumed a rule's id prefix is its category.
    • A slim JSON report reloaded with squirrel report report.json now maps the issue's category name back to its code, falling back to the id prefix for a name it doesn't know.
    • --fail-on score:reliability is no longer rejected when --rule-include links/broken-links selects a Reliability rule. isCategoryExcluded also reaches a category through the ids of its rules filed outside their prefix, which today are only these three.
    • The existing contract that a partial exclusion counts as excluded (--rule-exclude images/lazy-loading rejects score:images) is kept, so --rule-exclude links also rejects score:reliability.

Tests

  • packages/rules/tests/broken-links-reliability-836.test.ts: the three rules are in Reliability under Performance with the same ids, the other link rules stay in Links, and links/* still selects them.
  • packages/report/tests/reliability-badge-842.test.ts: badge name and title, HTML badges for two Reliability rules and a perf rule, and a stored Links report keeping its SEO badge.
  • apps/cli/tests/controllers/report.test.ts: slim JSON reload keeps Reliability, a pre-move export keeps Links, and an unknown name falls back to the prefix.
  • apps/cli/tests/audit/rule-filter.test.ts: the Reliability gate is reachable through links/broken-links and links/*, and not through core/*.
  • Re-ran:
    • report group-nesting, severity-and-groups, deterministic-grouping, html-status, not-checked-*;
    • CLI rules/categories, rules/category-alias-consistency, rules/loader, reports/diff, audit-offline-third-party-wiring;
    • audit-engine publish-cap, link-targets-not-fetched-726-e2e, and the golden suite in batches of five: 30 files, 198 tests, no failures.
  • Golden numbers: the golden suite pins engine parity, not stored category tallies, so no baseline file changes. rule-cache-replay-golden > "a page where a rule timed out is not stored" times out locally at 180 s. I checked it with this change's sources swapped back to main's, and it fails the same way.
  • tsgo is clean for rules, report and apps/cli. oxfmt and oxlint are clean on the CLI files. test-suites.ts --check, tangly check --strict and the detect-secrets hook pass.
  • Codex (gpt-6-astra) raised three P2s across two rounds. Two are fixed above. The third, about partial exclusions, is answered above: it follows the existing contract.

Docs and skill

  • Nav: the three pages move to the Reliability group in docs.json, with paths unchanged.
  • Rule pages: Category is Reliability, with a note that links/* selects them and reliability/* does not.
  • rules/reliability: description, intro, three cards, and a disable example that lists the ids.
  • rules/links: the cards are removed, with a pointer to Reliability.
  • Counts in rules/index, rules/seo, rules/performance.
  • reports.mdx: group table, category list, and a note on stored reports and --category.
  • cli/report.mdx: category list.
  • CHANGELOG entry under Unreleased, Changed.
  • The squirrelscan agent skill needs no change: its --category core,links example still works and it does not say which category holds broken links.
  • Private follow-up for the dashboard badge, rule catalog and category views: squirrelscan/repo#2933.

@nc9
nc9 force-pushed the feat/836-broken-links-reliability branch from 1e583b4 to 21b98c6 Compare October 26, 2026 23:30
@nc9
nc9 marked this pull request as ready for review October 26, 2026 23:30
@github-actions

Copy link
Copy Markdown
Contributor

Auto-review did not complete

The claude-review job failed before posting a review. This PR has not been auto-reviewed. Run a review manually (/review) before merging.

  • Result: success / is_error=true after 1 turns, 0 permission denial(s), $0.00
  • Job log

Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal):

Show partial review

You've hit your session limit · resets 11:40pm (UTC)

nc9 added 3 commits October 27, 2026 10:51
…ility badge #836 #842 #843

links/broken-links, links/broken-external-links and links/broken-anchors
move from the Links category (SEO group) to Reliability, ids unchanged.
Reliability stays under the Performance score group; its rules' badge
names the category (Reliability, scored under Performance) instead of
the group. Reports stored before the change keep their stored category.

Signed-off-by: Nik Cubrilovic <[email protected]>
… its id prefix #836

A slim JSON report reloaded with `squirrel report <file>` maps each
issue's category name back to its code, falling back to the id prefix,
so links/broken-links stays Reliability. --fail-on score:reliability is
no longer rejected for a --rule-include that selects a Reliability rule
with a links/ id.

Signed-off-by: Nik Cubrilovic <[email protected]>
…ebase onto v0.0.136

Links 13 and Reliability 5 in the README and docs index, the Changed entry for the broken-link rules, regenerated rule hubs, and the badge test reads the current gtag markup.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the feat/836-broken-links-reliability branch from 21b98c6 to e3fbaec Compare October 26, 2026 23:51
@claude

claude Bot commented Oct 26, 2026

Copy link
Copy Markdown

Review of #856: reclassifying the three broken-link rules as Reliability.

The change is small and well tested, and keeping the rule ids stable is the right call. I found one real bug and a few small points.

  • (medium) apps/cli/src/audit/rule-filter.ts, isCategoryExcluded: the new foreign.some(...) check is applied to the disable list as well as enable. disable wins on any single touch, so disable: ["links/*"] or ["links/broken-links"] now marks all of reliability as excluded. The other reliability rules (broken-resources, broken-forms and so on) still run. The old code only matched the category prefix, so this is a regression.
    • Where it matters: callers that use isCategoryExcluded for --fail-on or category gating.
    • Suggested fix: for disable, count a category as excluded only if every rule in it is covered. Alternatively, apply the foreign-id match to enable only.
    • Add a test: isCategoryExcluded("reliability", {enable:["*"], disable:["links/*"]}) should be false.
  • (low) rule-filter.ts: filedOutsidePrefix is a module-level cache built from loadAllRules(). That pulls the rules package into a CLI helper that avoided it before. Check that this stays off the lazy-import startup path (AGENTS.md says to keep the audit engine and rules out of every invocation). It also never resets if the rule set changes in tests.
  • (low) filterResolvesToZeroCategories (rule-filter.ts) still derives the category from the id prefix (ep.split("/")[0]). It isn't wrong for the cases it handles, but it is the same prefix assumption this PR fixes elsewhere. A short comment saying so would help.
  • (low) apps/cli/src/controllers/report.ts: convertSlimReport now trusts the export's category display name over the id prefix. A hand-edited or hostile slim JSON can assign any valid category to any rule id. That only affects display and grouping, and unknown names fall back safely, so it is acceptable. The test covers both the new-name and old-name paths.
  • (nit) I didn't see a golden-pin or score-group count check in the diff. The PR text says Links goes from 16 to 13 rules and Reliability from 2 to 5. Confirm the docs-category-table and rules-count tests pass, and the healthScore golden pin if it moved.

Docs, CHANGELOG, the badge test and the stored-report compatibility test all look good.

@nc9
nc9 merged commit 2a4eb2a into main Oct 27, 2026
15 checks passed
@nc9
nc9 deleted the feat/836-broken-links-reliability branch October 27, 2026 00:06
nc9 added a commit that referenced this pull request Oct 27, 2026
* origin/main:
  feat(rules): broken-link rules are reliability findings with a Reliability badge (#856)
  fix(rules): respect identical-link context (#1134)

Signed-off-by: Nik Cubrilovic <[email protected]>
nc9 added a commit that referenced this pull request Oct 27, 2026
The Reliability card on docs/rules/performance said 2 rules; the category has 5 since #856. Docs: this. Skill: no change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant