feat(lint): warn on dense compositions#531
Conversation
d5721e1 to
94ba1c9
Compare
|
Summary Two new warning-severity lint rules to nudge agents toward Issues
A composition with 4 sequential audio cues on track 0 (common The existing timed_element_missing_visibility_hidden rule (line 9)
Both rules fire regardless of options.isSubComposition. That's
Test "warns on large non-index registry composition files" uses
The PR body acknowledges this ("Registry/example HTML cleanup is
A 4-image slideshow with sequential non-overlapping clips on one
MAX_COMPOSITION_LINES = 300 and MAX_TIMED_ELEMENTS_PER_TRACK = 3 — What's good
|
94ba1c9 to
e14ff9b
Compare
|
Addressed the actionable feedback in the latest force-push:
I kept the |
Problem
Agents can still pack too much scene structure into one HTML composition. That makes HyperFrames videos harder to inspect, revise, and validate, especially when a single file owns many layers or a dense timeline track.
What this fixes
Adds two non-blocking core lint warnings across every HTML file passed through core lint:
composition_file_too_largewarns when a composition file has more than 300 physical lines.timeline_track_too_densewarns when more than three timed non-root elements share onedata-track-indexin the same file.The warning copy points agents toward coherent sub-compositions under
compositions/, mounted from the parent withdata-composition-src, so each file stays small enough to inspect, revise, and validate independently.Root cause
The linter had correctness checks, but no maintainability guidance for agent-authored compositions that were too large or timeline-dense.
Verification
Local checks
bun run --filter @hyperframes/core test src/lint/rules/composition.test.tsbunx oxlint packages/core/src/lint/rules/composition.ts packages/core/src/lint/rules/composition.test.tsbunx oxfmt --check packages/core/src/lint/rules/composition.ts packages/core/src/lint/rules/composition.test.tsBrowser verification
No browser flow exists for this lint-only stack layer. Runtime/browser-visible validation remains covered by the parent CLI smoke PR and CI.
Notes
fix/cli-validate-smoke-ci).