Skip to content

web: markdown stubs give way to the HTML page; dates that are data survive extraction (board #129, #131) - #376

Merged
SSFSKIM merged 2 commits into
mainfrom
web-clipper-fixes
Oct 25, 2026
Merged

SSFSKIM merged 2 commits into
mainfrom
web-clipper-fixes

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Two fixes to the web plugin's clipper, board #129 and board #131, at web 0.1.1. The decisions and their evidence are in the design's Decision Log (docs/doperpowers/specs/2026-10-25-web-fetch-design.md).

What behaves differently

Markdown stubs (board #129). When a server answers the markdown-first Accept with markdown whose body is under 50 words, the clipper fetches the URL again with a browser's Accept. An HTML answer goes through extraction and, if thin, rendering, and replaces the markdown when it has over twice the markdown's words. Otherwise the markdown stays, with any rendering note attached. bundlephobia's [email protected] page was saved as its 7-word stub; it now comes back rendered, with the sizes (6.5 kB minified, 2.5 kB gzip).

Dates that are data (board #131). Defuddle 0.19.6's content-pattern pass drops a short dated block above the prose as an article's byline. It keeps such a block only when its text opens with one of seven labels and a colon (date|published|updated|posted|from|to|subject:). Near the content's edges it also cuts a <time> out of its sentence. The clipper now protects two kinds of date before Defuddle runs:

  • A date with its own label is hidden from Defuddle's date patterns, with U+2063 between its characters, which is removed from the output. The label can be a heading, dt or th just before the date, or a Label: of up to three words at the start of its line.
  • A visible <time> in a line (a block holding only text and inline elements) moves its text out next to it, so the date stays in the sentence. The emptied element keeps its datetime, so published in the frontmatter does not change.

deps.dev's requests 2.31.0 page now keeps "Published / May 22, 2023", and "Package/Project metadata as of …" keep their dates.

Decisions and alternatives

  • Stub margin: more than 2× the markdown's words. The ticket's default was "whichever has more words". That would replace a short page the site wrote as markdown whenever its HTML has a few extra words: the test's changelog is 8 words as markdown and 14 as extracted HTML. Requiring 50 words of HTML would have kept bundlephobia's stub, because its rendered page has only 54. Defuddle uses the same 2× margin to accept its own retries.
  • Refetch rather than rendering at once. A refetch also fixes a site that serves a stub next to full server-side HTML, on a host without Chromium. It costs one extra request, made only for short markdown.
  • Retention by shielding, not by Defuddle options or a fake colon. removeContentPatterns: false turns off every pattern rule, so read times, newsletter boxes and bylines would come back. Adding a colon to a heading label reaches Defuddle's own guard only for its seven label words. That guard also misses relative dates, the <time> boundary rule, and the rule that drops a dated block right after the h1.
  • Scope widened from the ticket's one block to the class, because the corpus showed the same loss elsewhere: PostgreSQL 16's release notes lose "Release date: 2023-09-14" (eval synthesis-3), and RFC 9000's last three references lose their dates. The ticket's proposed retention rule covers only deps.dev.
  • The title area is left to Defuddle. The first h1, the three elements on each side of it, and the dates inside them are not touched. Defuddle reads the page's own date and author there, from text when no tag carries them.
  • A hidden <time> keeps its text, so Defuddle removes it along with the element.
  • Accepted cost: a blog whose labeled byline sits away from the title ("Published on: …" below a hero image) now keeps that line. None of the 50 documents below has one.

Verified

  • bash web/tests/run.sh on the final HEAD (5f8e579): exit 0. That covers 110 clipper tests with 0 skipped (the Chromium tests ran), the bundle matching its source, the mod's 48 tests, and the eval scripts' 55 tests. Two earlier local runs each went red on a load-sensitive flake in code this branch does not touch: once the eval harness's test_a_process_deaf_to_the_interrupt_is_killed (which failed 1 of 6 times when run alone), and once a Chromium render test that hit the 30 s render limit (it passed on rerun). The machine's load average was about 220 at the time. Both are logged in the friction tracker (Friction tracker (moved to ~/.claude/friction-tracker/doperpowers/) #304).
  • ci-gate on 5f8e579: GREEN (shell-lint, repo-checks, mods-types, web): https://github.com/SSFSKIM/doperpowers/actions/runs/40231234227
  • Review: doperpowers:reviewer-medium on the branch range, two rounds. Round 1 found two defects in the date pre-pass, both fixed in 5f8e579:
    • Shielding a date beside the title dropped Defuddle's published when the date was given only as text.
    • Freeing a hidden <time> leaked its text onto the page.
      Round 2 (the same commits before the rebase): no material findings.
  • The new tests fail on the clipper they guard against and pass here:
    • On origin/main's clipper: the registry fixture, and the "Release date:" line with its unlabeled-byline control.
    • On the first commit's clipper: the title-date/hidden-<time> test.
    • The stub tests fail on origin/main's clipper: the clip test for a stub and a short page, and a Chromium-rendered stub test.
  • Live runs, old bundle against new, each with --refresh and its own cache:
    • bundlephobia [email protected]: markdown, 7 words → html, rendered, 54 words, sizes present.
    • deps.dev requests 2.31.0: 471 → 480 words. "Published / May 22, 2023" is present, and the saved pages differ only in the three restored dates and the word count.
    • artifacthub 3480 → 3480, npmgraph 317 → 317, crates.io 242 → 242, elm-lang 5216 → 5216. The only difference is npmgraph's SVG edge ids, which change from one render to the next.
    • All of the above was repeated with the final bundle and gave the same numbers, except elm-lang. That run rendered only 12 words with the old bundle and with the new one alike: the render was cut short under load.
  • Extraction before and after on 50 saved documents: the eval tasks' and reserves' pages, plus npm, PyPI, crates.io and bundlephobia package pages. Only deps.dev, PostgreSQL release-16 and RFC 9000 changed, and only by the restored dates. This was re-run after the review fixes, with the same result. RFC 9000's Defuddle word count drops by 37 only because Defuddle counts the "." after a </time> as a word.

Not verified

  • The blog trade-off above, on a real blog with a labeled byline: none was in the corpus.
  • Other sites that serve markdown stubs: bundlephobia is the only one known.

Residue for the board

  • HTML without <html>/<body> extracts to nothing. rfc-editor's htmlized RFCs (rfc8439.html, eval code-3) start with <pre>. linkedom makes that <pre> the document element and leaves the body empty, so Defuddle finds 0 words. Only the render saves the page, which means a host without Chromium gets an empty page. With WEB_CHROME=none the clipper returns 0 words; wrapping the document in <html><body> before parsing gives 14,648 words, the same as the render.
  • The two load-sensitive tests (Friction tracker (moved to ~/.claude/friction-tracker/doperpowers/) #304 entry): the eval harness test should wait for started before its limit starts, and the render tests should allow more than 30 s under load.
  • <time> is the only inline element protected. A date in an inline <span> inside a sentence near the top can still be cut out.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)

…ta survive extraction

Board #129: a markdown answer under 50 words can be a stub of a page a
script draws (bundlephobia answers the markdown Accept with 7 words). The
URL is fetched again with a browser Accept; HTML takes extraction and, if
thin, rendering, and replaces the markdown when it has over twice the
markdown's words. A page short in both formats stays the markdown its
site wrote. Live: bundlephobia [email protected] goes from the 7-word stub to
the rendered page with its sizes (6.5 kB minified, 2.5 kB gzip).

Board #131: Defuddle 0.19.6's content-pattern pass drops a short dated
block above the prose as an article's byline unless its text opens with
one of seven labels and a colon, and near the content's edges cuts a
<time> out of its line. A date labeled by a heading, dt or th just before
it, or by a short "Label:" opening its line, is now hidden from Defuddle's
date patterns (U+2063 between its characters, removed from the output),
and a <time> inside a longer line hands the line its text. deps.dev keeps
"Published / May 22, 2023" and its two "metadata as of" dates; across 50
saved documents only deps.dev, PostgreSQL's release notes ("Release
date:") and RFC 9000's references change, by exactly the restored dates.

web 0.1.1; the decisions and evidence are in the design's Decision Log.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)
Two defects the branch review found in the date pre-pass:

- Shielding a date beside the page's title hid it from Defuddle's
  `published`, which it reads from text there when no tag carries the
  date: `<h1>Release Notes</h1><p>Published: May 3, 2024</p>` lost its
  published date. The first h1, the three elements either side of it and
  their dates are now left to Defuddle, untouched.
- Moving a hidden <time>'s text out of it put hidden text on the page
  ("released May 3, 2024yesterday"). A <time> with any mark of hiding now
  keeps its text, and only a <time> in a line (a block of text and inline
  elements) gives its text up.

The 50-document before/after comparison is unchanged: still only
deps.dev, PostgreSQL's release notes and RFC 9000's references differ.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T20:36:49.678867Z 5f8e579 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant