Skip to content

fix(check): lint and check skip compositions the project never mounts - #7369

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/check-only-mounted-compositions
Nov 7, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/check-only-mounted-compositions

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

hyperframes lint, and hyperframes check (which lints first), now lint only the compositions the project uses: index.html and every file reached through data-composition-src, followed through the files those mount. A file under compositions/ that nothing mounts, such as an installed block not placed yet, is left out, and the run says so in one line:

1 file in compositions/ is not mounted from index.html, so not checked; --include-unmounted adds them.
  • --include-unmounted on lint and check brings back today's behavior (every .html under compositions/).
  • lint --json lists the skipped files in unmountedCompositions.
  • blank_root_with_standalone_composition still sees unmounted files: it exists to catch a blank index.html next to a finished composition nobody mounts.
  • lintProject takes an options argument (includeUnmounted); the existing mounted-sources walk decides what is mounted, so lint, font lookup and this skip agree.
  • Two fallow findings in touched files fixed rather than ignored: a duplicated url() parse in project.ts became localCssUrl, and STOP_CODES in checkPipeline.ts is no longer exported (nothing imports it).

Why

A user report: check "warns about template components I am not even using. It would help if it ... only checked what is actually in the project." Lint walked every .html under compositions/ whether or not anything mounted it.

Test plan

  • packages/lint/src/project.test.ts "compositions the entry never mounts": an unmounted file and a nested one are not linted and are named in unmountedCompositions; includeUnmounted lints them; a composition mounted by a mounted composition is still linted. Plus the one-line notice.
  • fails without the fix: on main's project.ts the three new cases fail (3 failed).
  • packages/cli/src/commands/lint.test.ts: the notice prints once, --include-unmounted reaches lintProject, and --json carries unmountedCompositions.
  • Tests whose fixtures lint files nobody mounts (sub-composition stylesheets, shader scripts, snippet fragments) now pass includeUnmounted: true, which keeps what they test.
  • Whole lint package: 1280 passed, 3 runs. CLI lint, check, checkPipeline, validate, snapshot*, publish, lintFormat unit suites: 472 passed, 3 runs; the one failure, snapshotHdrFrame.test.ts, fails the same way on main on that machine.
  • Real CLI on a project with one used and one unused composition: plain lint lints 2 files and prints the line; --include-unmounted lints 3 and reports the unused file's finding; --json lists it.
  • tsc --noEmit exit 0 for cli and lint; bun run format:check exit 0; fallow audit --base origin/main --fail-on-issues exit 0; oxlint exit 0; comment ratchet and citations exit 0.

@mintlify

mintlify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 7, 2026, 6:02 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at 5f146411. No blockers.

Verified

  • Fails without the fix: with project.ts from origin/main, all four new cases in project.test.ts fail: the three under "compositions the entry never mounts" and "names the unmounted count in one line". All of them pass at this head.
  • project.test.ts, projectShaders.test.ts and snippetFragment.test.ts pass at this head (97 tests).
  • The skip decision reuses mountedSources. That resolves data-composition-src against the project root, which matches the runtime: compositionLoader resolves it against document.baseURI. So nested mounts are followed the same way the player loads them.
  • blank_root_with_standalone_composition still gets the unmounted sources. Snippet fragments are skipped but not counted in the notice.
  • When the target is a single file (entryFile), the compositions/ walk is skipped as before.

Non-blocking notes

  1. The default changes for every caller that passes no options: render (renderSetupWorker), publish, validate, snapshot, and the Studio project lint. Errors in unmounted files no longer block render or publish, and those commands print no notice. That seems right, because the files are not rendered. Still, the PR body only mentions lint and check, so it is worth a line there. Studio is unaffected in practice: lintUncoveredHtml still lints those files one at a time.
  2. A mount with a query or hash, such as data-composition-src="compositions/a.html?v=2", does not resolve to a file in mountedSources. That file would be counted as unmounted and skipped. This edge case comes from the existing helper and does not need to block this PR.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 99 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved again at 727d08e5. No blockers.

What changed since my approval at 5f146411

  • Only packages/cli/src/utils/lintProject.test.ts changed.
  • That file has 13 lintProject(...) calls whose fixtures put sub-compositions under compositions/ without mounting them through data-composition-src. Each of those calls now passes { includeUnmounted: true }. That keeps what each test checks, and no assertion was loosened. This is the same fix the earlier head applied to the lint package's own tests. The CLI copy of these tests was missed then, and it is what turned CI and Windows render verification red on 5f146411.
  • No production code changed, so my earlier review still holds.

All workflow runs on 727d08e5 are green, including CI and Windows render verification.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 7b79ab4 Nov 7, 2026
86 checks passed
@miguel-heygen
miguel-heygen deleted the fix/check-only-mounted-compositions branch November 7, 2026 22:04
@miguel-heygen miguel-heygen mentioned this pull request Nov 7, 2026
3 of 5 tasks
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 9, 2026
Port the adopted upstream fixes from f5bde95 to the current upstream tip:
heygen-com#7375 multipart cloud upload, heygen-com#7382 minParallelChunks, heygen-com#7349 HLG header SEI,
heygen-com#7369 skip unmounted compositions in lint/check, heygen-com#7381 filesystem-path media
in the cloud archive, heygen-com#7383 Safari cut-point pre-roll revert, heygen-com#7373 clock
steering between audio time updates, heygen-com#7384 injector test isolation, heygen-com#7378
preview seek retention, heygen-com#7390 virtual timer schedule per worker, heygen-com#7394 CDN
script failure naming, heygen-com#7395 menu row radius, heygen-com#7119 decode timeout caller
test, heygen-com#7397 authored tween order, heygen-com#7402 capture page clip loading, heygen-com#7412 muted
video audio track at cuts, heygen-com#6150 template root variable test, heygen-com#7442 held tail
seek once.

Deliberate local differences: heygen-com#7067's audio-start hold is not carried into
clock.ts, mountedSources comes from heygen-com#6827 as a helper only, cloud/_gen/types.ts
omits the image-request types the fork does not generate, and the lint
symlink test skips through symlinkOrSkip where the account cannot create links.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant