Skip to content

check (StaticGuard): false "uses data-end without data-duration" on <audio> that already has data-duration and no data-end #2662

Description

@carlosmirandalevy

Environment

  • Hyperframes CLI: 0.7.64 (invoked via npx hyperframes check)
  • Node: 22.x
  • OS: reproduced on Linux (WSL2) and confirmed by a second project on the same CLI version

Summary

npx hyperframes check emits a StaticGuard finding for <audio> elements:

<audio id="nar-01"> uses data-end without data-duration. Use data-duration in source HTML.

…but the flagged <audio> element has data-duration (and/or data-start) and contains no data-end attribute at all. The whole composition has zero occurrences of data-end. The finding is a false positive, and its remediation text ("Use data-duration") names the attribute that is already present.

Because data-end was renamed to data-duration in the current attribute contract, the rule referencing data-end at all looks like a stale code path in StaticGuard.

Steps to reproduce

  1. npx hyperframes init repro && cd repro
  2. Add a per-scene audio element to the composition, using the current framework-owned playback contract — data-start, data-duration, no data-end:
    <audio id="nar-01" src="assets/narration.wav" data-start="0.5" data-duration="4" preload="auto"></audio>
  3. npx hyperframes check

Expected

No finding for <audio id="nar-01">. The element complies with the current attribute contract (data-start + data-duration, no deprecated data-end).

Actual

StaticGuard reports, for every such <audio>:

<audio id="nar-01"> uses data-end without data-duration. Use data-duration in source HTML.

Impact

  • False findings on clean compositions — the "require 0 findings" gate can't be met by compositions that are actually correct, which forces teams to either whitelist the rule or ignore check output (both bad).
  • Misleading remediation — the message tells the author to add data-duration, which is already there; there is no data-end to remove.
  • Noise scales with the number of <audio> elements (one false finding per scene in a per-scene-audio composition).

Hypothesis (for triage — not verified against source)

The message template appears inverted or stale: it fires when an <audio> has data-duration without data-end, but reports it as "uses data-end without data-duration." Given data-end is the deprecated name for data-duration, the guard may still be pattern-matching the old attribute name. Either the condition or the message string (or both) needs to track the current data-start/data-duration contract for media elements.

Suggested fix

StaticGuard should treat <audio data-start data-duration> (no data-end) as valid and emit no finding. If a data-enddata-duration deprecation warning is still desired, it should fire only when data-end is actually present in the source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions