Skip to content

[experimental] export: checks the file it wrote and names the one file to share - #12367

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/rl-render-checks
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/rl-render-checks

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User need

After a render, an agent checks the file by hand before sharing it: in a frozen set of 48 share tasks, 47 agents reversed the file into a scratch folder and compared it, searched the HTML for outside addresses, and listed its size and path. That is a median of 3 calls after the render.

Problem and solution fit

  • astryx experimental export now checks the file it just wrote, from its bytes, with no second render:
    • outside: every outside address the file's markup or stylesheets load (src, href, data, poster, srcset, url(), @import), read by the render's own reader of outside references. The page's own script is not read.
    • roundTrip (exact, files, differs): the embedded source, decoded in memory and compared byte for byte with every carried file.
  • JSON: data.checks: {outside: string[], roundTrip: {exact: boolean, files: number, differs: string[]}}.
  • Text: a "Checks" section and one line naming the file to share with its size. Each check prints under its JSON key: outside lists every reference the file's markup and stylesheets load from outside the file (a remote address, or a file beside the page the render did not carry), or the text says they load nothing from outside the file; exact says yes or names the paths that differ from the files on disk. "Share this one file: … Nothing else needs to go with it." prints only when the file stands alone; otherwise the text says what the file loads from outside the file when it opens, so it does not stand alone. The page's own script is not read.
  • The checks never block the write: a file whose check fails is written, exit 0, with the check reported.
  • The checks read the file with the render's own readers of a page's outside references (images, style attributes, srcset, embedded loads, an SVG <image>'s href and xlink:href, and a <style> element's url() and @import), so the two cannot drift. The render's remote-asset warning uses the same reader, so it now also warns for an SVG image href or xlink:href and for a style element's url() or @import in the markup; what the render carries is unchanged.
  • render()'s record line says all of this.

Current specification

astryx experimental export is experimental (spec:AST-017 FR27): its output and JSON may change in a patch release. The JSON field is additive.

Public delta and caller burden

  • New JSON field data.checks; two short text lines and a section.

Evidence

  • share-checks.test.mjs: outside requests (attributes, quoted and encoded style url()s, an SVG image's href and xlink:href, a style element's url() and @import) and the round trip (exact, a changed file, no embedded source, a file missing on either side).

  • render.test.mjs adds the never-blocks case: a page with a remote style url() is written, exit 0, the outside address is named, and no share line prints.

  • A/B on a frozen set of 48 share tasks per arm, run by two agent CLIs: median calls 11 → 9 (simple 7.5 → 6.5, medium 11 → 10, complex 12 → 9), calls after the render 3 → 1, hand round trips 47 → 2, every arm correct.

  • Render time is unchanged within run-to-run spread on three project pages (+~40 ms on a 2 MB page).

  • Blind runs on real pages (6 pages, 24 runs per arm, the same task with and without the checks): median calls 13.5 → 12 (simple 11 → 9, medium 14.5 → 12, complex 14.5 → 14), 24 of 24 correct in both, and agents round-tripped the file by hand with --reverse 13 times instead of 24.

Scope

  • One change: the render checks its own file and says so.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/foundation/render/share-checks.test.mjs packages/cli/api/render packages/cli/foundation/response.

On simple pages the median went 10 → 11 calls while medium and complex dropped. The checks text is not the cause. On those clean pages the output carries no warning: it says the file loads nothing from outside, gives back its one carried file exactly, and names the one file to share. Claude Code runs were unchanged (7, 8, 9, 9 → 8, 8, 8, 9). The extra calls were in Codex runs before the export (a help read under the old command name, a different install route). After the export, Codex ran its own two HTML checks in both arms.

preflight: pass 543465f (env-only fails excused: setup-workspace fixture install, packed-gather-cache.records, handoff.e2e re-run pass)

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 4:09am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 19, 2026, 4:12 AM UTC

@josephfarina
josephfarina marked this pull request as draft November 17, 2026 17:02
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 17:33
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): after it writes the file, astryx experimental render checks it: offline (no outside address anywhere in it) and round trip (the embedded source matches every carried file byte for byte). It reports each check plainly, naming what is remote or which paths differ, in a short text section and in data.checks (additive JSON), and names the one file to share only when the file stands alone. A failed check never blocks the write, as a failed image fetch stays a warning. Render's reference states this.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0468c34

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 0eb39bd

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.50 MB packed (+5.4 kB); no new dependencies.

API changes: cli +0 · ~1 · −0

1 API change (advisory)
Package Where Signature Usage
~ cli ./api/experimental · Types · type RenderPageResponse data: { input: string; output: string; bytes: number; files: string[]; stylesheets: string[]; classes: number; cssBytes: number; images: number; warnings: RenderWarni … #528aac16 → data: { input: string; output: string; bytes: number; files: string[]; stylesheets: string[]; classes: number; cssBytes: number; images: number; warnings: RenderWarni … #136e9fe9 import type {RenderPageResponse} from '@astryxdesign/cli/api/experimental'; const x: RenderPageResponse = {data: …}

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded cancelled; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the offline check misses a common way to name a remote image, the new Checks text fails the CLI's text/JSON parity test in CI, and a few claims and the changeset need to match the code.

  • A remote image named by a double-quoted url() in a style attribute is missed, because share-checks.mjs:60 reads the attribute without decoding &quot;, so the render warns that the image loads from the network while the Checks section says Offline: the file loads nothing from the network. and Nothing else needs to go with it.
  • The Checks text fails the text/JSON parity test in CI (test-node (7/9)): Offline is not a JSON key, exact never appears in the text, and the share line is not built from JSON values, so print the fields in a record under their JSON keys and keep only guidance as text.
  • outsideRequests still keeps its own reading of style attributes, srcset and @import beside the render's in render-page.mjs, and the two have already drifted (the first item), so share one reader of a page's outside references and delete the copy.
  • The changeset's "whether the file loads anything from the network" and the Offline: line claim more than the check, which leaves out the page's own script by design, so narrow the wording to the file's markup and stylesheets or also check the script.
  • The share line still says Share this one file when the file loads from the network, while the owner decision on this pull request says the render names the file to share only when it stands alone, so align the code or have an engineering owner restate the decision.
  • The changeset uses [feat], but an addition to an experimental surface uses [experimental].
  • The description says the share-checks test has 7 cases, including a file with no embedded source, but it has 6 and none covers that case.

The earlier declaration-build break, the missed unquoted and single-quoted style images and the missing render-level test are fixed.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0)
  • Claim: the render checks the file it wrote from its bytes, with no second render: verified (_adapter.mjs:535, :548).
  • Claim: Offline reads every outside address a loading element or a stylesheet names: false for a double-quoted url() in a style attribute (sandbox repro).
  • Claim: Round trip decodes the embedded source and compares it byte for byte with every carried file: verified (share-checks.mjs:84-105).
  • Claim: the JSON shape is data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:94-96).
  • Claim: the text says when a check passes, names what fails, and keeps "Nothing else needs to go with it." for a passing Offline: verified (render.mjs:95-110).
  • Claim: a failed check never blocks the write: verified (render.test.mjs:1110-1112).
  • Claim: the file is read with the render's own readers: partly false; @import rules are found by a new pattern and style attributes are read without the render's decoding (share-checks.mjs:49, :60).
  • Claim: render's reference states the checks: verified (render.doc.mjs:19, :80).
  • Claim: the command is experimental and the field is additive: verified.
  • Claim: the share-checks test has 7 cases, including a file with no embedded source: false (6 cases, no such case).
  • Claim: the render test shows a page with a remote style image is written, exits 0 and drops "Nothing else needs to go with it.": verified (render.test.mjs:1108-1115).
  • Claim: the A/B call counts and render times: not checkable from the repository.
  • Claim: public text holds no internal context: verified.
  • Claim: the listed test command passes: verified (16 files, 314 tests passed, 3 skipped).
  • Changeset: reports whether the file loads anything from the network and round-trips, then names the file to share: overbroad (script not checked), tagged [feat] instead of [experimental].
  • File .changeset/render-checks-its-file.md: tag and claim findings.
  • File packages/cli/api/render/_adapter.mjs: clear.
  • File packages/cli/api/render/render.doc.mjs: share-line finding.
  • File packages/cli/api/render/render.test.mjs: clear.
  • File packages/cli/api/render/render.type.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/render.mjs: parity and share-line findings.
  • File packages/cli/foundation/render/render-page.mjs: clear.
  • File packages/cli/foundation/render/share-checks.mjs: decoding, shared-reader and claim findings.
  • File packages/cli/foundation/render/share-checks.test.mjs: description-claim finding.
  • File packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

Comment thread .changeset/render-checks-its-file.md Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a8bab31

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the text/JSON parity failure is fixed and the share line is settled by the owner's approval at this head, but the offline check still misses a common way to name a remote image, and a few claims and the changeset need to match the code.

  • A remote image named by a double-quoted url() in a style attribute is missed, because share-checks.mjs:60 reads the attribute without decoding &quot;, so the render warns that the image loads from the network while the Checks section says The file loads nothing from the network. and Nothing else needs to go with it.
  • outsideRequests still keeps its own reading of style attributes, srcset and @import beside the render's in render-page.mjs, and the two have already drifted (the first item), so share one reader of a page's outside references and delete the copy.
  • The changeset's "whether the file loads anything from the network" and the The file loads nothing from the network. line claim more than the check, which leaves out the page's own script by design (a page whose effect calls fetch gets both lines), so narrow the wording to the file's markup and stylesheets or also check the script.
  • The changeset uses [feat], but an addition to an experimental surface uses [experimental].
  • The description says the share-checks test has 7 cases including a file with no embedded source, but it has 6 and none covers that case, and it quotes Offline: and Round trip: lines the command no longer prints.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0)
  • Claim: the render checks the file it wrote from its bytes, with no second render: verified (_adapter.mjs:535, :548).
  • Claim: the offline check reads every outside address a loading element or a stylesheet names: false for a double-quoted url() in a style attribute (sandbox probe).
  • Claim: the round trip decodes the embedded source and compares it byte for byte with every carried file: verified (share-checks.mjs:84-105).
  • Claim: the JSON shape is data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:94-96).
  • Claim: the text prints the quoted Offline: and Round trip: lines: false; it prints The file loads nothing from the network., outside: and exact: (render.mjs:96-102).
  • Claim: "Nothing else needs to go with it." prints only when the offline check passes, and otherwise the share line says what the file loads: verified (render.mjs:104-110, render.test.mjs:1113-1115).
  • Claim: a failed check never blocks the write: verified (render.test.mjs:1110-1112).
  • Claim: the file is read with the render's own readers: partly false; @import rules are found by a new pattern and style attributes are read without the render's decoding (share-checks.mjs:49, :60).
  • Claim: render's reference describes the checks: verified (render.doc.mjs:19, :80).
  • Claim: the command is experimental and the JSON field is additive: verified.
  • Claim: the share-checks test has 7 cases, including a file with no embedded source: false (6 cases, no such case).
  • Claim: the render test shows a page with a remote style image is written, exits 0 and drops "Nothing else needs to go with it.": verified (render.test.mjs:1107-1115).
  • Claim: the A/B call counts and render times: not checkable from the repository.
  • Claim: public text holds no internal context: verified.
  • Claim: the listed test command passes: verified (16 files, 314 tests passed, 3 skipped).
  • Changeset: the render reports whether the file loads anything from the network and round-trips, then names the file to share: overbroad (the page's script is not checked), tagged [feat] instead of [experimental].
  • File .changeset/render-checks-its-file.md: tag and claim findings.
  • File packages/cli/api/render/_adapter.mjs: clear.
  • File packages/cli/api/render/render.doc.mjs: clear.
  • File packages/cli/api/render/render.test.mjs: clear.
  • File packages/cli/api/render/render.type.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/render.mjs: claim finding; parity now passes.
  • File packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • File packages/cli/foundation/render/render-page.mjs: clear.
  • File packages/cli/foundation/render/share-checks.mjs: decoding, shared-reader and claim findings.
  • File packages/cli/foundation/render/share-checks.test.mjs: description-claim finding.
  • File packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 774aca2

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the double-quoted url(), changeset and wording findings from the last review are fixed, but the offline check now misses two ways a page's markup loads from the network, so it can name a file to share that does not stand alone.

  • outsideRequests (share-checks.mjs:48-50) reads markup only through src, poster, srcset and style attributes and link/iframe/object/embed, so a page with an SVG <image href> (or xlink:href) or a <style> element holding a remote url() or @import gets "The file's markup and stylesheets load nothing from the network." and "Share this one file: … Nothing else needs to go with it."; extend the shared reader in render-page.mjs to read them (in place of the check's own @import pattern) and add those cases to share-checks.test.mjs.

The share line now prints only when the file stands alone, as the owner's decision says.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0)
  • Claim: the render checks the file it wrote from its bytes, with no second render: verified (_adapter.mjs:533-548).
  • Claim: the offline check reads every outside address a loading element or a stylesheet names (src, href, data, poster, srcset, url(), @import): false for SVG <image href>/xlink:href and for <style> elements in the markup (probe at this revision).
  • Claim: the round trip decodes the embedded source and compares it byte for byte with every carried file: verified (share-checks.mjs:65-86).
  • Claim: the JSON shape is data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:57-59).
  • Claim: the text adds a Checks section where each check prints under its JSON key: verified for outside and exact; files and differs appear only inside exact (render.mjs:95-102).
  • Claim: the share line prints only when the file stands alone, and otherwise the text says what the file loads: verified for the addresses the reader finds (render.mjs:104-108, render.test.mjs:1113-1115).
  • Claim: the page's own script is not read: verified (the script follows the embedded source, outside the markup read).
  • Claim: a failed check never blocks the write: verified (render.test.mjs:1107-1112).
  • Claim: the checks use the render's own readers of outside references, so the two cannot drift: partly false; attributes and url() go through the shared readers, but @import rules are found by the check's own pattern (share-checks.mjs:42), and the shared readers skip SVG images and markup <style> elements.
  • Claim: render's reference describes the checks: verified (render.doc.mjs:19, :80).
  • Claim: the command is experimental and the JSON field is additive: verified.
  • Claim: the share-checks test has 7 cases (3 outside, 4 round trip, including no embedded source): verified.
  • Claim: the render test shows a page with a remote style image is written, exits 0, is named and gets no share line: verified (render.test.mjs:1107-1115).
  • Claim: the A/B call counts and render times: not checkable from the repository.
  • Claim: public text holds no internal context: verified.
  • Claim: the listed test command passes: verified, with the parity test added (17 files, 654 tests passed, 3 skipped).
  • Changeset: an [experimental] patch that says the render checks whether the file's markup and stylesheets load anything from the network and whether --reverse gives every file back, then names the file to share when it stands alone: tag verified; the markup claim is false for SVG images and markup <style> elements.
  • File .changeset/render-checks-its-file.md: markup claim finding.
  • File packages/cli/api/render/_adapter.mjs: clear.
  • File packages/cli/api/render/render.doc.mjs: clear.
  • File packages/cli/api/render/render.test.mjs: clear.
  • File packages/cli/api/render/render.type.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/render.mjs: non-blocking note (differs folded into exact).
  • File packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • File packages/cli/foundation/render/render-page.mjs: clear; the reader to extend lives here.
  • File packages/cli/foundation/render/share-checks.mjs: offline-reader finding.
  • File packages/cli/foundation/render/share-checks.test.mjs: lacks the SVG and <style> cases (same finding).
  • File packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a897d83

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the SVG <image> and markup <style> gap from the last review is fixed, and three gaps remain before the share line can be trusted.

  • outsideRequests reads the head <style> with its own @import loop and rewriteRefs (share-checks.mjs:41-46) beside the identical loops this revision adds to embeddedLoads (render-page.mjs:963-966), so read the head style with embeddedLoads(style) and delete the copy.
  • Miss: a remote image in image-set("https://…" 1x) or -webkit-image-set('https://…' 1x) gets no warning, outside: [] and "Nothing else needs to go with it", because the shared reader finds only url(); read the image-set() strings there and test both forms.
  • Miss: a relative reference the render warns about (<link rel="icon" href="./bg.png">, <svg><image href="./bg.png"/> or a <style> with url(./bg.png)) still gets "load nothing from the network" and the share line, because outsideRequests keeps only remote addresses (share-checks.mjs:36); hold the share line for every reference embeddedLoads returns.

A markup <style> with @import url(…) also prints the same warning twice (render-page.mjs:964-965).

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • The render checks the file it just wrote, from its bytes, with no second render: verified (_adapter.mjs:535, :548).
  • The outside check finds every address the markup and stylesheets load: false for image-set() strings (render-page.mjs:908).
  • The checks use the render's own readers, so the two cannot drift: false, the head style keeps its own copy (share-checks.mjs:41-46).
  • The round trip decodes the embedded source and compares every carried file byte for byte, naming those that differ or are missing: verified (share-checks.mjs:65-86, four tests).
  • JSON gains data.checks with outside and roundTrip (exact, files, differs): verified (_adapter.mjs:548, render.type.mjs:57-59).
  • The text prints a Checks section with each check under its JSON key: verified (render.mjs:95-103, parity test passes).
  • The share line prints only when the file stands alone: false for image-set() and for relative references the render warns about (share-checks.mjs:36).
  • A failed check never blocks the write: verified (render.test.mjs:1107-1115).
  • The render's remote-asset warning now also covers SVG image href/xlink:href and a <style> element's url() and @import, and what it carries is unchanged: verified (render-page.mjs:952-968, :1140-1145; the inlining code is moved, not changed).
  • The tests cover attributes, quoted and encoded style url()s, SVG images, style elements and the round-trip cases: verified (share-checks.test.mjs, eight tests pass).
  • The changeset is an experimental patch: verified (.changeset/render-checks-its-file.md:2, :5).
  • The changeset says the render reports whether the markup and stylesheets load anything from the network: false for image-set() strings.
  • The changeset says the render names the file to share, with its size, when it stands alone: verified (render.mjs:106).
  • The call-count and render-time figures: not reproducible from the repository.

Files:

  • .changeset/render-checks-its-file.md: claim broader than the check (finding on image-set()).
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.doc.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/clients/cli/commands/experimental/render.mjs: share line condition (finding on relative references); differs and files only inside the exact value.
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: second stylesheet reader, image-set(), duplicate warning.
  • packages/cli/foundation/render/share-checks.mjs: second stylesheet reader, remote-only filter.
  • packages/cli/foundation/render/share-checks.test.mjs: no case for image-set() or a relative reference.
  • packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 39a2ae2

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet. The three gaps from the last review are fixed: the check now reads the head stylesheet with the shared reader, a remote image-set() image and a relative reference the render leaves in the file both withhold the share line, and each load warns once.

Two optional follow-ups:

  • For a relative reference such as <link rel="icon" href="./bg.png">, the text says the file "loads ./bg.png from the network when it opens" (render.mjs:107), and render.type.mjs and response-types.doc.mjs still describe outside as network loads only; saying the file loads a reference it does not carry would be accurate for both kinds.
  • The warning for an image-set() string in a style attribute reads "The page renders a that loads …" (render-page.mjs:980); naming the style attribute would read better.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • The render checks the file it just wrote, from its bytes, with no second render: verified (_adapter.mjs:535, :548).
  • The outside check lists what the file's markup and stylesheets load (src, href, data, poster, srcset, url(), @import) and does not read the page's own script: verified (share-checks.mjs:42-45; probes; the script sits after the embedded source the reader stops at).
  • The round trip decodes the embedded source in memory and compares every carried file byte for byte, naming those that differ or are missing: verified (share-checks.mjs:60-81, four tests).
  • JSON gains data.checks with outside and roundTrip (exact, files, differs): verified (_adapter.mjs:548, render.type.mjs:57-59, the emitted declarations).
  • The text prints a Checks section with each check under its JSON key, plus one line naming the file to share with its size: verified (render.mjs:95-108, parity test passes).
  • The share line prints only when the file stands alone, and otherwise the text names what the file loads: verified for remote, image-set() and relative references; the "from the network" wording is inaccurate for a relative reference.
  • A failed check never blocks the write: verified (render.test.mjs:1107-1115, every probe exits 0).
  • The checks use the render's own readers, so the two cannot drift: verified (share-checks.mjs:44-45 calls only embeddedLoads and rewriteRefs).
  • The render's remote-asset warning now also covers SVG image href/xlink:href and a <style> element's url() and @import, and what it carries is unchanged: verified (render-page.mjs:953-983, :1154-1159; the inlining code is moved, not changed).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified (response-types.doc.mjs:172-175).
  • The tests cover attributes, quoted and encoded style url()s, SVG images, style elements and the round-trip cases, and the render test covers the never-blocks case: verified (share-checks.test.mjs, 11 tests; render.test.mjs:1107-1115).
  • The PR text and artifacts carry no internal context: verified.
  • The call-count and render-time figures: not checked, a measurement outside the repository.
  • Changeset: an experimental patch for the CLI: verified (.changeset/render-checks-its-file.md:2, :5).
  • Changeset: the render says whether the markup and stylesheets load anything from the network, leaving out the page's script: verified.
  • Changeset: the render says whether --reverse gives back every carried file, naming any that differ: verified.
  • Changeset: the render names the file to share, with its size, when it stands alone: verified (render.mjs:104-106).

Files:

  • .changeset/render-checks-its-file.md: clear.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.doc.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: outside described as network loads only (non-blocking).
  • packages/cli/clients/cli/commands/experimental/render.mjs: "from the network" for relative references; differs and files only inside the exact value (both non-blocking).
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: <element> in the image-set() warning (non-blocking).
  • packages/cli/foundation/render/share-checks.mjs: a missing src image is not listed while a missing stylesheet url() is; "file order" is reader order (both non-blocking).
  • packages/cli/foundation/render/share-checks.test.mjs: clear.
  • packages/cli/foundation/response/response-types.doc.mjs: outside described as network loads only (non-blocking).

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/rl-render-checks branch from 39a2ae2 to b85cb75 Compare November 17, 2026 21:31
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b85cb75

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet (its run found CI full, so its jobs need a re-run). The patch is the one approved at the previous revision, rebased onto main, and the tests, the text/JSON parity test and the CLI typecheck pass on this head.

Optional follow-ups:

  • An <iframe src="about:blank"> is listed under outside and loses the share line, because embeddedLoads skips only data: and # (render-page.mjs:961); skipping the schemes assetRef already skips (blob:, about:, mailto:, tel:, javascript:) would fix it.
  • For a relative reference such as ./bg.png, the text says the file loads it "from the network" (render.mjs:107), and render.type.mjs and response-types.doc.mjs describe outside the same narrow way.
  • The share-a-page guide still tells agents to run --reverse themselves to see that the source comes back; it could point at the new Checks section instead.
Claims and files checked

Review mode: full; reason: rebase

Claims:

  • The render checks the file it just wrote, from its bytes, with no second render: verified (_adapter.mjs:552, :565).
  • The outside check lists what the markup and stylesheets load (src, href, data, poster, srcset, url(), @import) and does not read the page's own script: verified (share-checks.mjs:42-45; the markup read stops at the embedded source, before the script); an about:blank frame is also listed (non-blocking).
  • The round trip decodes the embedded source in memory and compares each carried file byte for byte, naming those that differ or are missing: verified (share-checks.mjs:60-81, four tests).
  • JSON gains data.checks with outside and roundTrip (exact, files, differs): verified (render.type.mjs:57-59, the emitted declarations).
  • The text adds a Checks section with each check under its JSON key, and a line naming the file with its size: verified (render.mjs:95-108; the parity test passes).
  • The share line prints only when the file stands alone, and otherwise the text says what the file loads: verified (render.mjs:104-107); "from the network" is inaccurate for relative references.
  • A failed check never blocks the write and the command exits 0: verified (render.test.mjs:1110-1111; every render probe exits 0).
  • The checks use the render's own readers, so the two cannot drift: verified (share-checks.mjs:44-45, render-page.mjs:1154).
  • The remote-asset warning now also covers SVG image href and xlink:href and a <style> element's url() and @import, and what the render carries is unchanged: verified (render-page.mjs:953-982; the inlining code moved into rewriteRefs unchanged).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified (response-types.doc.mjs:172-175).
  • The tests cover attributes, quoted and encoded style url()s, SVG images, style elements, image-set() and the round-trip cases, and the render test covers the never-blocks case: verified (11 tests in share-checks.test.mjs; render.test.mjs:1107-1115).
  • Public text and artifacts carry no internal context: verified.
  • The listed test command passes: verified (a superset of it passes).
  • The call-count and render-time figures: not checked (measurements outside the repository).
  • Changeset: an experimental patch for the CLI: verified (.changeset/render-checks-its-file.md:2, :5).
  • Changeset: the render says whether the markup and stylesheets load anything from the network, leaving out the page's script: verified.
  • Changeset: the render says whether --reverse gives back every carried file, naming any that differ: verified.
  • Changeset: the render names the one file to share, with its size, when it stands alone: verified (render.mjs:104-106).

Files:

  • .changeset/render-checks-its-file.md: clear.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.doc.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: outside described as network loads only (non-blocking).
  • packages/cli/clients/cli/commands/experimental/render.mjs: "from the network" for relative references; files and differs only inside the exact value (both non-blocking).
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: about:blank and other non-loading schemes counted; <element> in the image-set() warning (both non-blocking).
  • packages/cli/foundation/render/share-checks.mjs: a missing src image gets the share line while a missing stylesheet url() withholds it; "file order" is reader order (both non-blocking).
  • packages/cli/foundation/render/share-checks.test.mjs: clear.
  • packages/cli/foundation/response/response-types.doc.mjs: outside described as network loads only (non-blocking).

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet (its run found CI full, so its jobs need a re-run). An engineering owner approved this exact revision, which settles the new render checks (data.checks, the Checks text and the share line), and the stated tests, the text/JSON parity test, strict typecheck and lint pass on it.

Before merging, rebase onto main: this head conflicts with main's latest change to the import block of packages/cli/api/render/_adapter.mjs, and the rebased revision needs a fresh /approve-spec.

Non-blocking, for a follow-up:

  • embeddedLoads reads href only on SVG <image>, so <svg><use href="./icons.svg#check" /> or a <feImage href="https://…"> still gets "Share this one file: … Nothing else needs to go with it."
  • An address with a query, such as <iframe src="https://x.example/embed?a=1&b=2">, is listed twice in outside, once with and once without its query.
  • A missing local image (<img src="./missing.png">) gets the missing-asset warning and then the share line, while a missing stylesheet url() withholds it.
Claims and files checked

Review mode: incremental; reason: none

Claims:

  • The render checks the file it just wrote, read back from disk, with no second render: verified (_adapter.mjs:582-584, :598).
  • outside lists every reference the markup or stylesheets load from outside the file (src, href, data, poster, srcset, url(), @import), not the page's own script: verified for links in either attribute order, iframes, objects, embeds, SVG images, posters and sources, style elements and style attributes (render-page.mjs:997-1048, share-checks.mjs:31-47); an SVG <use> or <feImage> href is not read (non-blocking note above).
  • roundTrip decodes the embedded source in memory and compares every carried file byte for byte: verified (share-checks.mjs:60-81, four tests).
  • JSON adds data.checks with outside and roundTrip (exact, files, differs): verified (render.type.mjs:58-60).
  • Text adds a Checks section with each check under its JSON key, or says nothing loads from outside the file: verified (render.mjs:96-104).
  • The share line prints only when the file stands alone; otherwise the text says what the file loads from outside it: verified (render.mjs:105-109, and renders at this head).
  • A failed check never blocks the write and exits 0: verified (render.test.mjs:1108-1125).
  • The checks and the remote-asset warning share one reader, which also covers SVG image links and a style element's url() and @import; what the render carries is unchanged: verified (render-page.mjs:932, :997-1048, :1220).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified (experimental namespace, one added member).
  • The tests cover the listed cases and the never-blocks case: verified (they pass at this head).
  • Fewer agent calls in the A/B study and in blind runs: the author's measurement, not reproduced.
  • Render time unchanged within spread: not measured.
  • The stated test command passes: verified.
  • Public text carries no internal context: verified.
  • Changeset: an [experimental] patch that checks what the markup and stylesheets load from outside the file and the --reverse round trip, and names the file to share when it stands alone: verified (.changeset/render-checks-its-file.md:2, :5).

Files:

  • .changeset/render-checks-its-file.md: clear.
  • packages/cli/api/render/_adapter.mjs: clear (merge conflict with main in its import block).
  • packages/cli/api/render/render.doc.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/clients/cli/commands/experimental/render.mjs: notes (the outside list printed twice, an absolute path printed twice, "all 1 carried files").
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: note (SVG <use> and <feImage> not read; warning wording).
  • packages/cli/foundation/render/share-checks.mjs: notes (an address with a query listed twice; missing local images judged two ways; "in file order").
  • packages/cli/foundation/render/share-checks.test.mjs: clear.
  • packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina josephfarina reopened this Nov 18, 2026
@josephfarina
josephfarina force-pushed the josephfarina/rl-render-checks branch from 26008f5 to 5e07e89 Compare November 18, 2026 10:24
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 5e07e89

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one fix to the new share check. The render checks themselves are approved by an engineering owner for this revision, and the stated tests, the text/JSON parity test, strict typecheck and lint pass on it.

  • Miss: outsideRequests counts a src, poster, srcset or style url() reference only when it is remote, and embeddedLoads reads href only on SVG <image>, so a page with <track src="./captions.vtt">, <video src="./clip.mov">, <audio><source src="./clip.ogg"></audio> or <svg><use href="./icons.svg#check"> beside it prints "Share this one file: … Nothing else needs to go with it." while the written file still loads that file; count every reference left in the written file that is not data:, # or a no-load scheme (as the stylesheet path already does), read href on use and feImage, and add a test for each.

The non-blocking notes from earlier rounds still stand and can ride along: an address with a query is listed twice, the outside list prints twice without the answer's 10-item cap, an absolute --out path prints twice, and the warning calls a style attribute <element>.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • The render checks the file it just wrote, read back from disk, with no second render: verified (_adapter.mjs:571-588).
  • outside lists every outside reference the markup or stylesheets load (src, href, data, poster, srcset, url(), @import), not the page's own script: false for a file beside the page that the render cannot carry, such as a captions track, an .ogg or .mov clip, or an SVG <use> sprite (share-checks.mjs:37, render-page.mjs:1043); verified for remote addresses, link icons and stylesheets, iframes, objects, embeds, SVG images, style elements and image-set().
  • roundTrip decodes the embedded source in memory and compares every carried file byte for byte: verified (share-checks.mjs:60-81, four tests).
  • JSON adds data.checks with outside and roundTrip (exact, files, differs): verified (render.type.mjs:58-60).
  • Text adds a Checks section with each check under its JSON key, or says nothing loads from outside the file: verified (render.mjs:131-139).
  • The share line prints only when the file stands alone; otherwise the text names what it loads: false for the same pages as above (render.mjs:140-144).
  • A failed check never blocks the write and exits 0: verified (render.test.mjs:1108-1125, and a render at this revision).
  • The checks and the remote-asset warning share one reader, which also covers SVG image links and a style element's url() and @import; what the render carries is unchanged: verified (render-page.mjs:932, :997-1048, :1220-1225).
  • The render reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified (experimental namespace, one added member).
  • The tests cover the listed cases and the never-blocks case, and the stated test command passes: verified.
  • Fewer agent calls in the A/B study and the blind runs: the author's measurement, not reproduced.
  • Render time unchanged within spread: not measured.
  • Public text carries no internal context: verified.
  • Changeset: an [experimental] patch that says whether the markup and stylesheets load anything from outside the file and whether --reverse gives back every carried file, and names the one file to share when it stands alone: the patch tier is verified (.changeset/render-checks-its-file.md:2, :5); the outside half is false for the same pages as above.

Files:

  • .changeset/render-checks-its-file.md: its outside claim is false until the fix.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.doc.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: the outside description is false until the fix.
  • packages/cli/clients/cli/commands/experimental/render.mjs: notes (the outside list printed twice and uncapped, an absolute path printed twice, "all 1 carried files").
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: finding (SVG <use> and <feImage> not read); note (warning wording).
  • packages/cli/foundation/render/share-checks.mjs: finding (only remote attribute references counted); notes (an address with a query listed twice, "in file order").
  • packages/cli/foundation/render/share-checks.test.mjs: the cases for the finding are missing.
  • packages/cli/foundation/response/response-types.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/rl-render-checks branch from 5e07e89 to 759b0bf Compare November 18, 2026 12:08
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 759b0bf

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the last review's blocker is fixed (every reference the file leaves for the browser now counts, and SVG <use> and <feImage> hrefs are read), and an engineering owner approved the checks for this revision, but two fixes remain.

  • A page whose srcSet names local images is told it does not stand alone: the render writes each carried candidate as a data: URI, and outsideRequests re-reads srcset by splitting on every comma (share-checks.mjs:44, render-page.mjs:972-977), so it lists the image's base64 payload as an outside reference and withholds the share line; split candidates as HTML does and add a test that renders a carried srcSet.
  • Regression: the description says astryx experimental render, but main renamed the command to astryx experimental export (#12302), which is where this revision prints its checks; update both mentions.

Smaller notes: the rewriteRefs comment still says the checks name only remote references, the outside list is in reader order rather than file order, the does-not-stand-alone line repeats the list printed above it, and the text says "all 1 carried files".

Claims and files checked

Review mode: full; reason: rebase

Claims (description and changeset):

  • The export command checks the file it wrote, from its bytes, with no second render: verified (_adapter.mjs:571-588).
  • outside lists every reference the markup and stylesheets load from outside the file: false for a carried srcSet, which lists the image payload (finding above).
  • roundTrip compares the embedded source with every carried file byte for byte and names those that differ or are missing: verified (share-checks.mjs:59-80, its tests).
  • JSON shape data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:58-60).
  • A Checks section whose keys mirror the JSON, and the share line only when the file stands alone: verified, apart from the srcSet case.
  • The checks never block the write; exit 0 with the check reported: verified (render.test.mjs:1108-1125).
  • The checks and the remote-asset warning share the render's readers, the warning now also covers SVG image hrefs and a style element's url() and @import, and what the render carries is unchanged: verified (render-page.mjs:1227, render tests pass).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is astryx experimental render and is experimental under the release spec: false, the command is astryx experimental export (finding above); experimental tier verified.
  • The JSON field is additive, with a short text section and lines: verified.
  • The listed share-checks.test.mjs and render.test.mjs cases exist and pass: verified (15 and 191 tests pass).
  • The stated test command passes: verified.
  • The A/B and blind-run call counts and the render-time measurement: the author's measurements, not reproduced.
  • Changeset: an [experimental] patch for the CLI describing the export checks and the share line: verified, apart from the srcSet case.

Files:

  • .changeset/render-checks-its-file.md: clear
  • packages/cli/api/render/_adapter.mjs: clear
  • packages/cli/api/render/render.doc.mjs: clear
  • packages/cli/api/render/render.test.mjs: clear (no carried srcSet case)
  • packages/cli/api/render/render.type.mjs: clear
  • packages/cli/clients/cli/commands/experimental/export.mjs: non-blocking notes (repeated list, "all 1 carried files")
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear
  • packages/cli/foundation/render/render-page.mjs: blocking (the srcset split), non-blocking (stale comment)
  • packages/cli/foundation/render/share-checks.mjs: blocking (counts the payload), non-blocking (file order)
  • packages/cli/foundation/render/share-checks.test.mjs: clear (no carried srcSet case)
  • packages/cli/foundation/response/response-types.doc.mjs: clear

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 53c9e94

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: CI passed on this head.

Both fixes from the last review are in: a page whose srcSet names local images now gets outside: [] and the share line, because srcset is split as HTML splits it, and the description names astryx experimental export. An engineering owner approved the render checks for this revision. Two optional wording fixes remain: the remote-asset warning (render-page.mjs:1263) and the share-checks.mjs file header still say "network" for files beside the page.

Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims (description and changeset):

  • The export command checks the file it just wrote, from its bytes, with no second render: verified (_adapter.mjs:574-588).
  • outside lists every reference the markup and stylesheets load, read by the render's own reader, and leaves out the page's own script: verified (share-checks.mjs:34-48, its tests), a carried srcSet included (render.test.mjs:1128-1135).
  • roundTrip decodes the embedded source and compares every carried file byte for byte, naming those that differ or are missing: verified (share-checks.mjs:61-82, its tests).
  • The JSON shape data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:58-60).
  • A Checks section whose keys mirror the JSON, the share line only when the file stands alone, and otherwise a line saying the file does not stand alone: verified (export.mjs:139-152, the parity test).
  • The checks never block the write; exit 0 with the check reported: verified (render.test.mjs:1108-1118).
  • The checks and the remote-asset warning share the render's readers, the warning now also covers SVG image hrefs and a style element's url() and @import, and what the render carries is unchanged: verified (render-page.mjs:1037-1088, :1260-1265; carried files are the same on the base and this revision for the probed srcset pages).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental under the release spec, and the JSON field is additive with a short text section and lines: verified.
  • The listed share-checks.test.mjs and render.test.mjs cases exist and pass, and the stated test command passes: verified.
  • The A/B, blind-run and render-time measurements: the author's measurements, not reproduced.
  • Changeset: an [experimental] patch for the CLI describing the export checks and the share line: verified.

Files:

  • .changeset/render-checks-its-file.md: clear
  • packages/cli/api/render/_adapter.mjs: clear
  • packages/cli/api/render/render.doc.mjs: clear
  • packages/cli/api/render/render.test.mjs: clear
  • packages/cli/api/render/render.type.mjs: clear
  • packages/cli/clients/cli/commands/experimental/export.mjs: clear
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear
  • packages/cli/foundation/render/render-page.mjs: non-blocking note (warning wording)
  • packages/cli/foundation/render/share-checks.mjs: non-blocking note (header wording)
  • packages/cli/foundation/render/share-checks.test.mjs: clear
  • packages/cli/foundation/response/response-types.doc.mjs: clear

Automated review (maintainer link)

warnings.push({
code: 'remote-asset',
message: `The page renders a <${m[1].toLowerCase()}> that loads ${m[2]}, which a sandboxed page cannot reach and which loads from the network anywhere else; remove it from the page.`,
message: `The page renders a <${tag}> that loads ${ref}, which a sandboxed page cannot reach and which loads from the network anywhere else; remove it from the page.`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: embeddedLoads also returns files beside the page, such as ./bg.png from <link rel="icon"> or ./icons.svg#check from <use href>. For those, this message says the file "loads from the network anywhere else", which it does not. Wording such as "which the file does not carry" fits both kinds.

Comment on lines +4 to +6
* @file The checks a render runs on the file it just wrote, so the person
* or agent who shares it need not run them by hand: what the file asks the
* network for, and whether its embedded source gives back every carried file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (a miss: the last review passed this header): outside also names files beside the page that the render did not carry, so "what the file asks the network for" describes less than the check does. "what the file loads from outside it" matches render.type.mjs:59.

@josephfarina
josephfarina force-pushed the josephfarina/rl-render-checks branch from 53c9e94 to 0eb39bd Compare November 18, 2026 19:14
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0eb39bd

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet. Its run found CI full, so all jobs need a re-run, and they must pass before merge.

An engineering owner approved the render checks for this revision, and the rebase onto main only moved the Checks text into the new printer, which now names experimental import. Three optional wording fixes remain: the remote-asset warning (render-page.mjs:1357) and the share-checks.mjs file header still say "network" for files beside the page, and the export guide (share-a-page.doc.mjs:99) still tells agents to run the reverse command to check the file, which the Checks section now reports.

Claims and files checked

Review mode: full; reason: rebase

Claims (description and changeset):

  • The export command checks the file it just wrote, from its bytes, with no second render: verified (_adapter.mjs:572-588).
  • outside lists every reference the markup and stylesheets load, through the render's own readers, and leaves out the page's own script: verified (share-checks.mjs:34-47; the page's script follows the embedded source, render-page.mjs:1858-1859).
  • roundTrip decodes the embedded source and compares every carried file byte for byte: verified (share-checks.mjs:61-82 and its tests; a root-relative image from public/ gives exact: yes).
  • The JSON shape data.checks: {outside, roundTrip: {exact, files, differs}}: verified (render.type.mjs:58-60).
  • A Checks section whose keys mirror the JSON, the share line only when the file stands alone, and otherwise a line saying it does not stand alone: verified (render-output.mjs:95-108, the parity test).
  • The checks never block the write; exit 0 with the check reported: verified (render.test.mjs:1117-1125).
  • The checks and the remote-asset warning share the render's readers, the warning now covers SVG image hrefs and a style element's url() and @import, and what the render carries is unchanged: verified (render-page.mjs:1126-1176, :1353-1358; base and head renders carry the same files, only a comma-holding srcset is now written whole).
  • The API reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified against the release spec.
  • The listed share-checks.test.mjs and render.test.mjs cases exist and pass, and the stated test command passes: verified.
  • The A/B, blind-run and render-time measurements: the author's measurements, not reproduced.
  • Changeset: an [experimental] patch for the CLI describing the checks and the share line: verified (.changeset/render-checks-its-file.md).

Files:

  • .changeset/render-checks-its-file.md: clear
  • packages/cli/api/render/_adapter.mjs: clear
  • packages/cli/api/render/render.doc.mjs: clear
  • packages/cli/api/render/render.test.mjs: clear
  • packages/cli/api/render/render.type.mjs: clear
  • packages/cli/clients/cli/commands/experimental/render-output.mjs: clear
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear
  • packages/cli/foundation/render/render-page.mjs: non-blocking note (warning wording)
  • packages/cli/foundation/render/share-checks.mjs: non-blocking note (header wording)
  • packages/cli/foundation/render/share-checks.test.mjs: clear
  • packages/cli/foundation/response/response-types.doc.mjs: clear

Automated review (maintainer link)

@josephfarina josephfarina changed the title [experimental] render: checks the file it wrote and names the one file to share [experimental] export: checks the file it wrote and names the one file to share Nov 18, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision for this revision: no current record states what astryx experimental export reports about the file it wrote, and the last owner approval names the revision before this rebase onto a newer main. An engineering owner records the decision by commenting /approve-spec <full head SHA> with the full SHA of the current head, or by adding a decision beside DEC-16 in architecture:cli-surface, and the author may do so if they are an engineering owner. Nothing else blocks: the stated tests, the text/JSON parity test, strict typecheck and lint pass on this head, but CI has not run on it (its commit message skips CI) and still has to pass before merge.

Non-blocking, for a follow-up:

  • The remote-asset warning (render-page.mjs:1357) still says a file beside the page, such as ./icons.svg#check from <use href>, "loads from the network anywhere else"; "which the file does not carry" fits both kinds.
  • The share-checks.mjs header (lines 4-6) still says "what the file asks the network for", while outside also names files beside the page.
  • The export guide (share-a-page.doc.mjs:99) still tells agents to run the reverse command to check the file, which the new exact line already reports.
Claims and files checked

Review mode: full; reason: merge-touches-pr-files

Claims (description and changeset):

  • The export command checks the file it just wrote, read back from disk, with no second render: verified (_adapter.mjs:575, :589).
  • outside lists what the markup and stylesheets load (src, href, data, poster, srcset, url(), @import) through the render's own reader, and not the page's own script: verified (share-checks.mjs:34-48, render-page.mjs:1059-1177; the reader stops at the embedded source, which the script follows).
  • roundTrip decodes the embedded source in memory and compares each carried file byte for byte: verified (share-checks.mjs:61-82 and four tests).
  • The JSON adds data.checks with outside and roundTrip (exact, files, differs): verified (render.type.mjs:58-60).
  • The text adds a Checks section with each check under its JSON key, the share line only when the file stands alone, and otherwise a line saying it does not: verified (render-output.mjs:95-108, the parity test, and renders at this head).
  • A failed check never blocks the write and the command exits 0: verified (render.test.mjs:1353-1361).
  • The checks and the remote-asset warning share one reader, which also covers SVG image links and a style element's url() and @import, and what the render carries is unchanged: verified (render-page.mjs:1126-1177, :1354-1359; base and head renders list the same carried files, and a srcset candidate holding a comma is now written whole).
  • render()'s reference describes the checks: verified (render.doc.mjs:19, :80).
  • The command is experimental and the JSON field is additive: verified (experimental namespace, one added member).
  • The listed share-checks.test.mjs and render.test.mjs cases exist and pass, and the stated test command passes: verified.
  • Fewer agent calls in the A/B study and the blind runs, and an unchanged render time: the author's measurements, not reproduced.
  • Public text and artifacts carry no internal context: verified.
  • Changeset: an [experimental] CLI patch that reports what the markup and stylesheets load from outside the file and whether --reverse gives back every carried file, and names the one file to share when it stands alone: verified (.changeset/render-checks-its-file.md:2, :5).

Files:

  • .changeset/render-checks-its-file.md: clear
  • packages/cli/api/render/_adapter.mjs: clear
  • packages/cli/api/render/render.doc.mjs: clear
  • packages/cli/api/render/render.test.mjs: clear
  • packages/cli/api/render/render.type.mjs: clear
  • packages/cli/clients/cli/commands/experimental/render-output.mjs: clear
  • packages/cli/clients/cli/commands/text-json-parity.test.mjs: clear
  • packages/cli/foundation/render/render-page.mjs: non-blocking note (warning wording)
  • packages/cli/foundation/render/share-checks.mjs: non-blocking note (header wording)
  • packages/cli/foundation/render/share-checks.test.mjs: clear
  • packages/cli/foundation/response/response-types.doc.mjs: clear

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 543465f

1 similar comment
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 543465f

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12367 [experimental] export: checks the file it wrote and names the one file to share
  Author: @josephfarina
- #12405 [experimental] export: the size output names each part of the file under its JSON key
  Author: @josephfarina
- #12295 fix(Markdown): keep task lists inside their column
  Author: @josephfarina
- #12696 docs: Toast needs no provider; Table hooks name their row-type generic
  Author: @josephfarina
- #12733 [experimental] export: a package linked from a folder inside the project is a package, so --reverse gives the page back
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12859.

@josephfarina
josephfarina deleted the josephfarina/rl-render-checks branch November 19, 2026 17:41

This branch was successfully deployed

1 active deployment
Preview — 543465f5 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant