[Bug] detect emits cramped-padding from custom properties it warned it could not read (false positive on an unresolvable sheet)

Author: mwarfCreated Sep 26, 2026Updated Sep 26, 2026
Labelsneeds triage

What happened?

When the linked stylesheet can't be read, detect prints the warning added for #652 ("color and custom-property rules will be incomplete") and then still emits rules that consume those custom properties — resolved to nothing — as ordinary, definite findings. We get a cramped-padding warning on a composition root whose inset and children's backgrounds/borders are defined in the unread sheet.

It's a false positive, and it's the mirror of #652. #652 was the undercount direction (findings silently hidden by an unread sheet); this is the overcount direction (fabricated from the same absent inputs), and unlike the undercount it is presented as a confirmed result. The warning says the consequence is that custom-property rules "will be incomplete" — i.e. missing evidence. The observable consequence here is a finding that isn't real.

Impact, so this isn't theoretical: acting on it, we added a file-scoped cramped-padding value ignore for the affected files. The ignore works; the finding it hides does not exist.

Steps to reproduce

Project layout (a static-HTML project whose compositions live in a subdirectory):

<root>/index.html
<root>/brand/tokens.css         # every custom property (--brand-pad-x: 96px, --brand-pad-y: 132px, colours…)
<root>/samples/image-card.html  # <link rel="stylesheet" href="brand/tokens.css">
  1. From the project root, scan the composition:
$ impeccable detect --json samples/image-card.html
impeccable detect: could not read linked stylesheet brand/tokens.css
  (resolved to <root>/samples/brand/tokens.css); color and custom-property rules will be incomplete
[
  {
    "antipattern": "cramped-padding",
    "severity": "warning",
    "category": "quality",
    "file": "<root>/samples/image-card.html",
    "line": 0,
    "snippet": "<div> \"reverse\": children flush against bg on all sides (no inset)"
  }
]

Note the href is relative, not root-relative: path.resolve(fileDir, href) behaves exactly as standard URL resolution does here, so this is not a re-run of #652's resolution half — samples/brand/tokens.css genuinely is what the href points at from a plain file/document context.

  1. Now change only the sheet's readability — nothing in the HTML:
$ ln -s ../brand samples/brand          # the one and only difference
$ impeccable detect --json samples/image-card.html
[]
warning printed findings
sheet unresolvable yes cramped-padding (1)
sheet resolvable no none

Same file, same markup, same rules. The finding is purely a function of whether the sheet could be read.

Expected behavior

If the inputs a rule needs could not be resolved, the rule should not report a definite finding computed from them. Either:

  • suppress rules whose inputs are unresolved custom properties, or
  • emit them through the degraded/unverified path — the way the missing-parser-module DEGRADED banner already tells you a run is an undercount — instead of through the ordinary findings list.

The warning you added is the right half of the fix; the remaining gap is that a run which admits it is missing its inputs still returns a positive result derived from those inputs.

(Worth noting: the finding carries "line": 0, so it isn't anchored to a source location either — consistent with it being synthesised rather than observed.)

Provider & environment

  • Provider: Claude Code 2.1.283
  • Skill version: 4.0.0, project-scoped (.claude/skills/impeccable/)
  • Engine: 0.1.6 (scripts/bin/darwin-arm64/impeccable), i.e. release engine-v0.1.6 dated 2026-09-25 — the current engine, not a stale build
  • OS: macOS 27.0 (arm64)

Additional context

  • Related: #652 (closed) — that report's suggested fix 2 is the warning we're seeing. Its suggested fix 1 (resolve against a document root, or an explicit --root) is still unimplemented and would also make this case resolve rather than merely warn. This report is the consequence that remains after the warning landed.
  • The composition is a brand-aligned card; the inset the rule is complaining about is 96px / 132px, declared in the sheet. Adding padding in response to this finding would actively make the layout wrong.

Willing to work on a fix?

Yes — happy to open a PR for whichever of the two expected-behaviour options you'd prefer, with approval.