Skip to content

lab-ops-hub: Worker-fallback extractor — RCDATA/raw-text modes for textarea, iframe, xmp, noembed, noframes #4008

Closed

Description

@dezren39

Problem

The lab-ops-hub Worker-fallback extractor (pkgs/lab-ops-hub/src/lib.ts, extractHtml) only treats script/style/title as raw-text/RCDATA elements. The container Extractor (Python html.parser) also treats textarea, iframe, xmp, noembed, and noframes as CDATA elements, so literal markup inside them is misparsed by the Worker fallback — worse, it can activate real tag handling: a literal <script> inside a textarea starts script skipping and swallows the rest of the article.

Found by Codex review round 4 on PR #3918 (comment 4437512018), dispositioned there as a follow-up because adding parser modes is larger than a review-fix round. Sibling of #569.

Evidence (verified against the container Extractor, Python 3.13.13)

Input: <textarea><script></textarea><p>Article body</p>

  • Container: text <script> Article body
  • Worker fallback: empty text (the literal script tag activates skip mode and discards the body)

Scope

  • Add CDATA-mode handling for textarea, iframe, xmp, noembed, noframes matching HTMLParser's behavior (only the matching close tag ends the region; content is character data — note textarea content is text that IS extracted, per the example, unlike script/style whose content is skipped).
  • Careful with the title distinction: title/textarea content contributes text (title to the title field, textarea to body text); script/style/iframe/xmp/noembed/noframes content does not — verify each element against the container before pinning fixtures.
  • Add shared parity fixtures (test/extractor-fixtures.json) for the example plus one fixture per element; both suites (node + python) green.

Acceptance

  • The example above produces identical {title, links, text} from the Worker fallback and the container Extractor.
  • Fixtures pin container-verified behavior for textarea, iframe, xmp, noembed, noframes.

Acceptance criteria

  • The Worker-fallback extractor (pkgs/lab-ops-hub/src/lib.ts, extractHtml) treats textarea, iframe, xmp, noembed, and noframes as CDATA/raw-text regions matching Python html.parser: only the matching close tag ends the region.
  • Filed evidence case: input <textarea><script></textarea><p>Article body</p> yields text <script> Article body from the Worker fallback, identical to the container Extractor.
  • Differential tests cover each of the five elements (literal markup inside, script-tag-in-textarea, unterminated region) against the container Extractor's output.
  • Existing extractor test suites (Worker and container) pass; script/style/title behavior is unchanged.

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. 23 remaining items

  7. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. 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
  12. added a commit that references this issue on Nov 4, 2026
  13. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions