Skip to content

[Bug] side-tab never emitted by the static-html engine on .html files (the regex fallback catches it) #359

Description

@esdrasgbedozin

side-tab is implemented in the static-html engine (rules/checks.mjs:44-45) and RULE_ENGINE_SUPPORT declares it covered there. It never fires on .html files — inline styles or <style> rules alike. The same declaration in a .css file is flagged correctly.

Tested on upstream 3e38e595 (v3.9.1), Node 18, with htmlparser2 / css-select / css-tree / domutils installed and resolving from detect-html.mjs — so the static-html engine is genuinely active.

git clone https://github.com/pbakaus/impeccable /tmp/impec && cd /tmp/impec
git checkout 3e38e595 && npm install
DETECT="$PWD/.claude/skills/impeccable/scripts/detect.mjs"
cd "$(mktemp -d)"

printf '<html><body><div style="border-left:4px solid purple">x</div></body></html>' > a.html
node "$DETECT" --json --no-config a.html   # []  exit 0

printf '<html><head><style>.card{border-left:4px solid purple;background:#f6f6f6;padding:16px;border-radius:8px}</style></head><body><div class="card">x</div></body></html>' > b.html
node "$DETECT" --json --no-config b.html   # []  exit 0

printf '.card{border-left:4px solid purple}' > c.css
node "$DETECT" --json --no-config c.css    # side-tab  exit 2

Both HTML cases satisfy the conditions in checks.mjs:44-45 (radius > 0, border ≥ 3px) and produce nothing.

The part worth flagging. Rerun case (b) with node_modules moved aside, forcing the silent regex fallback (detect-html.mjs:139-141, bare catchdetectText):

mv node_modules /tmp/parked
node "$DETECT" --json --no-config b.html   # side-tab  exit 2

The degraded engine finds what the full-fidelity engine misses. Since the fallback is silent and --json doesn't report which engine ran, a CI job with parsers and one without disagree on this rule, both exiting cleanly.

Two things, separable:

  1. Why checks.mjs:44-45 doesn't fire on the parsed DOM. The rule is there, so this reads as a condition or traversal issue rather than missing coverage — I'll leave the diagnosis to you.
  2. Surface the active engine in --json. I have a working local patch and can open a PR if useful.

No open issue seems to cover this (searched side-tab, static-html, engine coverage, border-left, false negative).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions