Skip to content

fix(core): add lint rule for infinite GSAP repeat#218

Merged
miguel-heygen merged 2 commits intomainfrom
fix/lint-infinite-repeat
Apr 7, 2026
Merged

fix(core): add lint rule for infinite GSAP repeat#218
miguel-heygen merged 2 commits intomainfrom
fix/lint-infinite-repeat

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Apr 7, 2026

Summary

Adds a new lint rule gsap_infinite_repeat that flags repeat: -1 in GSAP timelines as an error. This is a hard enforcement of the skill guardrail added in PR #217.

What it fixes

The deterministic capture engine (HeadlessExperimental.beginFrame) seeks to exact frame times on a paused GSAP timeline. When a timeline contains repeat: -1, the timeline duration is infinite, which causes the capture engine to produce incorrect/blurry output.

Eval prompt #20 (loading-spinner, scored 2.0/5) used repeat: -1 on a dots animation cycle, producing "a highly compressed and blurry loading animation lacking visual clarity and professional polish."

Changes

  • packages/core/src/lint/rules/gsap.ts — new gsap_infinite_repeat rule (regex scan for repeat: -1)
  • packages/core/src/lint/rules/gsap.test.ts — 2 new tests (detects infinite repeat, allows finite repeat)

Test plan

  • pnpm --filter @hyperframes/core test — all 429 tests pass
  • Rule catches repeat: -1 and reports as error with fix hint
  • Rule does not flag repeat: 4 (finite repeats)

Detects `repeat: -1` in GSAP timelines and reports it as an error.
Infinite repeats break the deterministic capture engine which seeks
to exact frame times — the timeline never resolves a finite
duration. This caused the loading-spinner eval (prompt 20, 2.0/5)
to render as a blurry compressed mess.

The rule instructs authors to calculate a finite repeat count from
the composition duration instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen force-pushed the fix/lint-infinite-repeat branch from dfc54d9 to 12c5b65 Compare April 7, 2026 01:39
@graphite-app graphite-app bot changed the base branch from graphite-base/218 to main April 7, 2026 01:39
Add negative lookahead (?!\d) to the repeat: -1 regex so it
only matches exactly -1, not -10, -100, etc. Add test case.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen force-pushed the fix/lint-infinite-repeat branch from 12c5b65 to 17791d1 Compare April 7, 2026 01:39
Copy link
Copy Markdown
Collaborator Author

miguel-heygen commented Apr 7, 2026

Merge activity

  • Apr 7, 2:53 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 7, 2:53 PM UTC: @miguel-heygen merged this pull request with Graphite.

@miguel-heygen miguel-heygen merged commit 0d33238 into main Apr 7, 2026
22 checks passed
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.

2 participants