Fix Live side-tab validation gaps

Scan Astro style blocks for inset-shadow stripes, recognize semantically chromatic external tokens without flagging neutral unknowns, and make the polling generator run advisory detector checks before publication. Sync the affected detector bundles and add a paired regression fixture.\n\nAI-assisted: Codex analyzed the failed Live task, implemented the detector and generator changes, and ran the validation suites under maintainer direction.
This commit is contained in:
Paul Bakaus
2026-07-15 16:23:49 -07:00
parent 0ac1ca6867
commit 8682c85c57
47 changed files with 1187 additions and 284 deletions
+26 -4
View File
@@ -2,7 +2,7 @@ import { GENERIC_FONTS, OVERUSED_FONTS } from '../../shared/constants.mjs';
import { isNeutralColor } from '../../shared/color.mjs';
import { extractGoogleFontFamilies } from '../../shared/fonts.mjs';
import { checkSourceDesignSystem } from '../../design-system.mjs';
import { scanCssTextForGlow, scanCssTextForMarquee, scanCssTextForRadialHalo } from '../../rules/checks.mjs';
import { scanCssTextForGlow, scanCssTextForInsetStripe, scanCssTextForMarquee, scanCssTextForRadialHalo } from '../../rules/checks.mjs';
import { isFullPage } from '../../shared/page.mjs';
import { applyInlineIgnores } from '../../shared/inline-ignores.mjs';
import { finding } from '../../findings.mjs';
@@ -340,12 +340,12 @@ const REGEX_ANALYZERS = [
];
// ---------------------------------------------------------------------------
// Style block extraction (Vue/Svelte <style> blocks)
// Style block extraction (Astro/Vue/Svelte <style> blocks)
// ---------------------------------------------------------------------------
function extractStyleBlocks(content, ext) {
ext = ext.toLowerCase();
if (ext !== '.vue' && ext !== '.svelte') return [];
if (ext !== '.astro' && ext !== '.vue' && ext !== '.svelte') return [];
const blocks = [];
const re = /<style[^>]*>([\s\S]*?)<\/style>/gi;
let m;
@@ -472,8 +472,16 @@ function detectText(content, filePath, options = {}) {
profile,
phase: 'source',
}));
if (cssLike.has(ext)) {
findings.push(...profileFindings(profile, {
engine: 'regex',
phase: 'source',
ruleId: 'side-tab',
target: filePath,
}, () => scanCssTextForInsetStripe(content).map(hit => finding(hit.id, filePath, hit.snippet))));
}
// Extract and scan <style> blocks from Vue/Svelte SFCs
// Extract and scan <style> blocks from Astro/Vue/Svelte components.
const styleBlocks = profile
? profileStep(profile, {
engine: 'regex',
@@ -488,6 +496,13 @@ function detectText(content, filePath, options = {}) {
profile,
phase: 'style-block',
}));
findings.push(...profileFindings(profile, {
engine: 'regex',
phase: 'style-block',
ruleId: 'side-tab',
target: filePath,
}, () => scanCssTextForInsetStripe(block.content)
.map(hit => finding(hit.id, filePath, hit.snippet, block.startLine))));
}
// Extract and scan CSS-in-JS template literals
@@ -505,6 +520,13 @@ function detectText(content, filePath, options = {}) {
profile,
phase: 'css-in-js',
}));
findings.push(...profileFindings(profile, {
engine: 'regex',
phase: 'css-in-js',
ruleId: 'side-tab',
target: filePath,
}, () => scanCssTextForInsetStripe(block.content)
.map(hit => finding(hit.id, filePath, hit.snippet, block.startLine))));
}
if (options?.designSystem) {