Skip to content

Write HTML. Render video. Built for agents.

chore(lint): keep the fallow audit gate green

Miao Yang4a8e2f1cd0a1
diff --git a/.fallowrc.jsonc b/.fallowrc.jsonc
index 27ae87f2c7..30e0a27aa5 100644
--- a/.fallowrc.jsonc
+++ b/.fallowrc.jsonc
@@ -59,6 +59,9 @@
// prose), not import-graph reachable.
"skills/motion-graphics/grounding/**",
"skills/motion-graphics/categories/**",
+ // Agent-invoked reference materials (template + motion-primitive HTML, catalogs),
+ // forked by path by the frame-worker per SKILL.md prose, not import-graph reachable.
+ "skills/music-to-video/references/**",
// Bundled @font-face data (read at runtime via fs.readFileSync, invisible
// to the import graph) + its manual rebuild tool.
"skills/**/fonts/**",
diff --git a/packages/core/src/lint/rules/composition.ts b/packages/core/src/lint/rules/composition.ts
index 9c76ab03a2..63be85fa5b 100644
--- a/packages/core/src/lint/rules/composition.ts
+++ b/packages/core/src/lint/rules/composition.ts
@@ -1,4 +1,4 @@
-import type { LintContext, HyperframeLintFinding } from "../context";
+import type { LintContext, HyperframeLintFinding, ExtractedBlock } from "../context";
import { findHtmlTag, readAttr, readJsonAttr, stripJsComments, truncateSnippet } from "../utils";
import { COMPOSITION_VARIABLE_TYPES } from "../../core.types";
@@ -63,6 +63,19 @@ function leftmostCompoundClasses(selector: string): string[] {
return (leftmost.match(/\.([\w-]+)/g) ?? []).map((c) => c.slice(1));
}
+// Distinct selectors across all <style> blocks whose leftmost compound keys off one
+// of the root element's own classes — the ones that break under id-scoping.
+function rootClassStyledSelectors(styles: ExtractedBlock[], rootClasses: string[]): string[] {
+ const offenders: string[] = [];
+ for (const style of styles) {
+ for (const selector of extractCssSelectors(style.content)) {
+ const hitsRoot = leftmostCompoundClasses(selector).some((c) => rootClasses.includes(c));
+ if (hitsRoot && !offenders.includes(selector)) offenders.push(selector);
+ }
+ }
+ return offenders;
+}
+
export const compositionRules: Array<(ctx: LintContext) => HyperframeLintFinding[]> = [
// invalid_capture_path — catches ../capture/ in src/href attributes and scripts.
// Sub-compositions live in compositions/ but are served relative to the project
@@ -624,13 +637,7 @@ export const compositionRules: Array<(ctx: LintContext) => HyperframeLintFinding
const rootClasses = (readAttr(rootTag.raw, "class") || "").split(/\s+/).filter(Boolean);
if (rootClasses.length === 0) return [];
- const offenders: string[] = [];
- for (const style of styles) {
- for (const selector of extractCssSelectors(style.content)) {
- const hitsRoot = leftmostCompoundClasses(selector).some((c) => rootClasses.includes(c));
- if (hitsRoot && !offenders.includes(selector)) offenders.push(selector);
- }
- }
+ const offenders = rootClassStyledSelectors(styles, rootClasses);
if (offenders.length === 0) return [];
const example = offenders.slice(0, 3).join(", ");