Skip to content

lab-ops-hub: Worker-fallback extractor — complete HTML character-reference decoding parity #4007

Closed

Description

@dezren39

Problem

The lab-ops-hub Worker-fallback extractor (pkgs/lab-ops-hub/src/lib.ts, decodeHtmlEntities) only decodes a small named-entity table and requires a trailing semicolon, so its output diverges from the container Extractor (Python html.parser + html.unescape) on standard references — stored titles/text then depend on which crawling path ran.

Found by Codex review round 4 on PR #3918 (comment 4437512013), dispositioned there as a follow-up because the fix (complete HTML5 named-reference data + semicolon-omission rules) is larger than a review-fix round. Sibling of #569.

Evidence (verified against the container Extractor, Python 3.13.13)

Input: <title>&Alpha; &AMP;</title><p>&rarr; &#65 &amp B</p>

  • Container: title Α &, text → A & B
  • Worker fallback: every reference preserved literally

Scope

  • Decode the complete HTML5 named character references (the data behind Python's html.entities.html5), including the legacy semicolon-less forms and the spec's semicolon-omission rules for text content (e.g. &#65 -> A, &amp -> & in the cases html.unescape expands).
  • Keep the existing numeric-reference normalization (C1 remap, U+FFFD rules) intact.
  • Add shared parity fixtures (test/extractor-fixtures.json) pinning the cases above plus a spread of named references; expected values verified against the container suite before pinning. Both suites (node + python) must stay green.

Acceptance

  • The example above produces identical {title, links, text} from the Worker fallback and the container Extractor.
  • New fixtures cover: a non-Latin-1 named reference (→), an uppercase legacy reference (&), a semicolon-less numeric reference, and a semicolon-less named reference.

Acceptance criteria

  • The Worker-fallback extractor (pkgs/lab-ops-hub/src/lib.ts, decodeHtmlEntities) decodes the complete HTML5 named character references, including legacy semicolon-less forms, with the spec's semicolon-omission rules for text content matching Python html.unescape.
  • Filed evidence case: input <title>&Alpha; &AMP;</title><p>&rarr; &#65 &amp B</p> yields title Α & and text → A & B from the Worker fallback, identical to the container Extractor.
  • A differential test corpus (named references with/without semicolons, numeric references with/without semicolons, ambiguous ampersands in text and in attribute-like contexts) matches html.unescape output case for case.
  • Existing extractor test suites pass; no change to the container Extractor.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/lab-ops-hubPackage/app: lab-ops-hub (pkgs/ or apps/ in this repo)
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    source/queue-workerFiled or worked by the queue/worker pilot
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Intake review

  3. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 1, 2026
  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  5. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  6. added
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  7. 52 remaining items

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  12. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  13. added a commit that references this issue on Nov 4, 2026
  14. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — fixed and merged

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

Metadata

Metadata

Assignees

Labels

app/lab-ops-hubPackage/app: lab-ops-hub (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions