@williambeto/ai-workflow 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -393,10 +393,17 @@ export class ArtifactFidelityGate {
|
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
// 1. Minimum CSS tokens check
|
|
396
|
+
// Option D: only enforce when CSS volume is substantial (>200 chars of effective rules)
|
|
397
|
+
// and bypass is available via explicit approval token 'no-css-vars' or 'css-vars-bypass'.
|
|
396
398
|
const hasRules = cssContentCombined.includes("{");
|
|
399
|
+
const cssVarsApproved = (this.explicitApprovals || []).some(app =>
|
|
400
|
+
/no-css-vars|css-vars-bypass/i.test(app)
|
|
401
|
+
);
|
|
402
|
+
const cssRulesContent = cssContentCombined.replace(/\/\*[\s\S]*?\*\//g, "").trim();
|
|
403
|
+
const isSubstantialCss = cssRulesContent.length > 200;
|
|
397
404
|
const hasCssVars = /(--[a-zA-Z0-9_-]+\s*:|var\(--[a-zA-Z0-9_-]+\))/g.test(cssContentCombined);
|
|
398
|
-
if (hasRules && !hasCssVars) {
|
|
399
|
-
violations.push("Fidelity Violation: Design System token mismatch. No CSS custom properties (variables) detected or used in changed UI stylesheets.");
|
|
405
|
+
if (hasRules && isSubstantialCss && !hasCssVars && !cssVarsApproved) {
|
|
406
|
+
violations.push("Fidelity Violation: Design System token mismatch. No CSS custom properties (variables) detected or used in changed UI stylesheets. Add explicit approval 'no-css-vars' to bypass this check for simple or legacy stylesheets.");
|
|
400
407
|
}
|
|
401
408
|
|
|
402
409
|
// 2. Excessive style="..." inline styles check
|