Skip to content

Version srcset projection semantics for reproducible receipts #60

Closed

Description

@Maisiqi

The html_attribute_urls projection format needs an explicit parser-semantics version so receipts remain reproducible when srcset parsing changes. A parser correction can change the resulting URL list without changing the projection's declared format.

Minimal synthetic example, containing no measured data:

from lexbench_webfetch.resource_urls import srcset_urls
value = 'https://example.invalid/image?resize=100,200 1x, https://example.invalid/large.png 2x'
legacy = [part.strip().split()[0] for part in value.split(',') if part.strip()]
assert len(legacy) == 3  # Incorrectly treats the URL's internal comma as a separator.
assert len(srcset_urls(value)) == 2

Run through uv run --frozen python. The correct parser should retain commas within URLs. Historical replay should select only explicitly bound semantics, not try alternative parsers until one happens to match a stored result. Keep frozen evidence immutable and reject version mismatches. Add controls for internal commas, descriptors, data URLs and ordinary candidate separators; correct new results through a new versioned revision.

Related report maintenance: PR #59.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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