Skip to content

[experimental] render: --reverse names every file the render records as not carried as missing - #12404

Merged
josephfarina merged 8 commits into
mainfrom
josephfarina/rl-reverse-not-carried
Nov 18, 2026
Merged

josephfarina merged 8 commits into
mainfrom
josephfarina/rl-reverse-not-carried

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Record change: cli-surface's module list names api/render and foundation/render, with the --reverse rule: missing lists every file the restored page lacks and every file the rendered file records as not carried, and exact is true only when missing is empty. Proof: the reverse tests (alias layout, relative import from above, folder index, stem-sharing image, JSON import) pass.

User impact

When a render cannot carry a file the page needs (a module imported through a path alias from outside the carried folder, a module imported by a relative path from above it, a Sass or Less stylesheet), the file's note now names it. But --reverse still answered exact: true with no missing file for the alias case, since it cannot resolve the alias, and the restored page then failed to build.

Problem and solution fit

  1. Why it occurs: the reverse finds missing files by resolving the page's imports, and a path alias that points outside the restored folder resolves to nothing it can check.
  2. Why it harms the task: exact: true tells the caller the restored page is complete, while it does not build.
  3. Why that matters: an agent trusts exact and missing to decide whether it has the whole page back.

A rendered file now records the files the render left out, beside its other record fields, only when there are any. --reverse adds each one to missing, once, unless an import already names it, so exact is false whenever one exists. Each import the restored page lacks names exactly one recorded file: the first it resolves to in the walk's own order (the path as written, then each extension the walk tries, then the folder's index). Every other recorded file stays in missing, so an image or JSON file that shares a module's stem, or a folder index beside a same-named module, is still named. A reader that does not know the record field ignores it.

Expected behavior and authority

astryx experimental render is experimental (spec:AST-017 FR27). --reverse reports the files the restored page lacks (missing), and exact only when it lacks none.

Smallest restoration

  • foundation/render/source-block.mjs and foundation/render/render-page.mjs: the record carries the files left out.
  • api/render/_adapter.mjs: the reverse adds them to missing.
  • api/render/render.type.mjs: the missing description.
  • docs/architecture/cli-surface.md: the module list names api/render and foundation/render, with the rule for missing and exact.
  • A changeset.

Evidence

  • api/render/render.test.mjs: "names a module the page imports through a path alias from outside the folder it carries from" (@shared/* → ../shared/*): --reverse reports exact: false, missing: ['../shared/rows.ts'] (it reported exact: true). The outside-folder test has ../lib/rows.ts import ./helper.ts, and --reverse reports missing: ['../lib/rows', '../lib/helper.ts']. "names a folder the page imports from above the carried folder once on the way back": missing: ['../lib/rows']. "keeps a recorded image that shares its stem with an imported module on the way back": ../lib/rows.tsx showing ../lib/rows.png gives missing: ['../lib/rows', '../lib/rows.png']. "names an extensionless JSON import the render leaves out once on the way back": ./site.config gives missing: ['site.config']. A not-carried rows.ts importing ./rows.json gives missing: ['../lib/rows', '../lib/rows.json'], and one importing ./rows/index gives missing: ['../lib/rows', '../lib/rows/index.ts']. A Sass stylesheet is named once.
  • A round trip of the record, and no record field when nothing is left out.

Writing rubric results

docs/architecture/cli-surface.md (the module list entry for the render):

R1 narration: none; the entry states what render and --reverse do, in the present tense.
R2 research: none.
R3 evidence: no evidence cell added; the tests name the behavior.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.
R7 project status: none.

Scope

  • One defect is restored.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/api/render packages/cli/foundation/render packages/cli/foundation/doc-compiler/doc-loads.test.mjs (460 passed, 3 skipped); the interaction parity check in Chromium.
  • Typecheck (strict and the JSON API); pnpm check:knowledge.

This change is stacked on the change that names the files a render does not carry, and lands after it.

@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 18, 2026 11:47am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 11:51 AM UTC

@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 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, and two fixes are needed first.

No current record settles what --reverse reports in exact and missing, or the embedded-source notCarried list it now reads: an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or names the record that should hold it.

  • A page that imports a folder from above the carried folder (../lib/rows, resolving to ../lib/rows/index.ts) now gets missing: ['../lib/rows', '../lib/rows/index.ts'], one file named twice, because the check in packages/cli/api/render/_adapter.mjs:843-844 strips only an extension, so also match a recorded …/index.<ext> to its folder and add a reverse test for that layout.
  • The title and changeset say --reverse names every file the render could not carry, but a file an outside module imports (../lib/rows.ts importing ./helper.ts) is in neither notCarried nor missing, so say it names every file the render records as not carried, or add a reverse test for that layout once #12272 records such files.
Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Changeset and title: the reverse names every file the render could not carry as missing: false for a file an outside module imports (head probe); verified for an alias import from outside, a relative import from above and a Sass import (tests).
  • Changeset: exact is false whenever such a file exists: verified (tests; probes of six layouts).
  • Changeset: a rendered file records the files the render left out, and the reverse adds them to missing: verified (render-page.mjs:1528, source-block.mjs:119, _adapter.mjs:841-847).
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the new test fails on the base with exact: true).
  • Description: the record field appears only when files were left out, and survives a round trip: verified (foundation test, which fails on the base).
  • Description: each recorded file is added once unless an import already names it: false for a folder-index import from above; verified for a plain module and a Sass import (tests).
  • Description: a reader that does not know the field ignores it: verified (the base reader checks only the format, entry and files; the format number is unchanged).
  • Description: the restored page then failed to build: not reproduced; the restored folder holds only the page, which imports the alias.
  • Description: the command is experimental under the release record's experimental route: verified; that record does not settle what the reverse reports.
  • Description: the smallest restoration touches the listed files: verified (seven files).
  • Description: the listed tests pass (441 passed, 3 skipped) and the strict and JSON-API typechecks pass: verified at this head; the browser interaction parity check was not run.
  • Description: no new public API, and no internal context in public text: verified.
  • Description: stacked on #12272 and lands after it: verified (the base is that pull request's head).

Files:

  • .changeset/render-reverse-not-carried.md: finding (wording broader than the behaviour).
  • packages/cli/api/render/_adapter.mjs: finding (folder-index import named twice).
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear (a non-blocking wording note on exact).
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/_adapter.mjs Resolved
Comment thread packages/cli/api/render/render.type.mjs Resolved

@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, and one fix is needed first.

No current record settles what --reverse reports in exact and missing, or the embedded-source notCarried list it now reads: an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or names the record that should hold it.

  • A page that imports a folder from above the carried folder (../lib/rows, resolving to ../lib/rows/index.ts) gets missing: ['../lib/rows', '../lib/rows/index.ts'], one file named twice, because the check in packages/cli/api/render/_adapter.mjs:843-844 strips only an extension, so also match a recorded …/index.<ext> to the folder an import names and add a reverse test for that layout.

The changeset's claim now holds: with the render recording what an outside module imports, the reverse names those files too.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Changeset and title: the reverse names every file the render could not carry as missing, so exact is false whenever one exists: verified for every file the render records (an alias import from outside, the same with a module it imports, a relative import from above with a module it imports, a folder index, a Sass file, an image from above, and a project layout).
  • Changeset: a rendered file records the files left out, and the reverse adds them to missing: verified (render-page.mjs:1533, source-block.mjs:119, _adapter.mjs:841-847).
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true for that layout).
  • Description: the record field appears only when files were left out, and survives a round trip: verified (the foundation test, and a page with nothing left out carries no field).
  • Description: each recorded file is added once unless an import already names it: false for a folder imported from above; verified for plain modules, Sass files and images.
  • Description: a reader that does not know the field ignores it: verified (the reader checks only the format, entry and files, and the format number is unchanged).
  • Description: the restored page then failed to build: not reproduced; no finding rests on it.
  • Description: the command is experimental under the release record's experimental route: verified; that record does not settle what the reverse reports.
  • Description: the change touches the listed source files, the type description and a changeset: verified (seven files with the two test files).
  • Description: the listed tests pass (442 passed, 3 skipped), and the strict and JSON-API typechecks pass: verified at this head; the browser parity check was not rerun, as no rendered surface changes.
  • Description: no new public API and no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified (the base branch is that change's head).

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • packages/cli/api/render/_adapter.mjs: a folder imported from above is named twice (:843-844).
  • packages/cli/api/render/render.test.mjs: clear; a folder-index reverse test belongs with the fix.
  • packages/cli/api/render/render.type.mjs: non-blocking, the exact description still says every file it imports (:80).
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): exact: true from --reverse means the restored page builds as rendered. missing lists every file the restored page imports that it lacks, and every file the rendered file records as not carried; exact is true only when missing is empty and every restored file matches the embedded source. experimental import runs the same path, so the same rule applies there. Render's record states this, and a test covers an aliased module from outside the carried folder.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8098f30

@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 reverse rule and the new record field are settled by the engineering owner's approval at this head, and two fixes are needed before approval.

  • Miss: --reverse drops a recorded file that shares a stem with a module an import names (a page importing ../lib/rows, which resolves to rows.tsx and shows ../lib/rows.png, gets missing: ['../lib/rows']), because the check in packages/cli/api/render/_adapter.mjs:843-847 strips any extension, so match the stem and the index folder only for the extensions an extensionless import resolves to and add a reverse test for that layout.
  • Miss: the title and changeset say the reverse names every file the render could not carry, but it can name only the files the render records, and a not-carried ../lib/rows.ts that imports ./helper.js leaves helper.ts unnamed, so say it names every file the render records as not carried, or make the render record that module.

The folder imported from above is now named once.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Title and changeset: the reverse names every file the render could not carry, so exact is false whenever one exists: the first half is false (a module that a not-carried module imports through a .js specifier is unnamed); the second half is verified in every layout tried.
  • Changeset: a rendered file records the files left out and the reverse adds them to missing: verified, except that a recorded image sharing a stem with an imported module is dropped.
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true).
  • Description: the render's note names a file it cannot carry in the listed cases: verified (from the change below this one).
  • Description: the restored page then failed to build: not reproduced; consistent with the restored folder lacking the module.
  • Description: the record field appears only when files were left out, and survives a round trip: verified (the foundation test, and a page with nothing left out carries no field).
  • Description: each recorded file is added once unless an import already names it: false for a same-stem image; verified for folders, index files, Sass, configuration-named files and images otherwise.
  • Description: a reader that does not know the field ignores it: verified (the reader checks only the format, entry and files, and the format number is unchanged).
  • Description: the command is experimental under the release record's experimental route, and the reverse reports exact only when nothing is missing: verified.
  • Description: the files listed, the record entry and its rubric results: verified (eight files).
  • Description: the listed test expectations: verified (the outside-folder, folder-index, alias and Sass tests).
  • Description: the render tests pass (443 passed, 3 skipped), with the strict and JSON API typechecks and the knowledge check: verified; the browser parity check was not rerun, as nothing rendered changes.
  • Description: no new public API and no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified (the base branch is that change).

Files:

  • .changeset/render-reverse-not-carried.md: claims more than the reverse can name (:5).
  • docs/architecture/cli-surface.md: clear.
  • packages/cli/api/render/_adapter.mjs: drops a recorded file that shares a stem with an imported module (:843-847).
  • packages/cli/api/render/render.test.mjs: clear; a same-stem reverse test belongs with the fix.
  • packages/cli/api/render/render.type.mjs: non-blocking, the exact description still says every file it imports (:80).
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/_adapter.mjs Resolved
@josephfarina josephfarina changed the title [experimental] render: --reverse names every file the render could not carry as missing [experimental] render: --reverse names every file the render records as not carried as missing Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d5ca48b

@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: both fixes from the last review are in, and the reverse rule is settled by an engineering owner's approval at this head, but one new fix is needed before approval.

  • --reverse names an extensionless JSON import that the render leaves out twice (a page importing ./site.config for a site.config.json gets missing: ['site.config', 'site.config.json']), because packages/cli/api/render/_adapter.mjs:845 strips an extension only for module extensions while such an import also resolves to .json, so match .json too (as line 946 does, or reuse the walk's RESOLVE_EXTENSIONS) and add a reverse test for that layout.

Non-blocking: the data.exact description in packages/cli/api/render/render.type.mjs:80 still says "every file it imports", while a recorded file no import names now also makes it false.

Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims:

  • Title and changeset: the reverse names every file the render records as not carried, so exact is false whenever one exists: verified in every layout tried.
  • Changeset: a rendered file records the files left out and the reverse adds them to missing: verified.
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true).
  • Description: the render's note names a file it cannot carry in the listed cases: verified (from the change below this one).
  • Description: the restored page then failed to build: not reproduced; consistent with the restored folder lacking the module.
  • Description: the record field appears only when files were left out, and survives a round trip: verified (the foundation test).
  • Description: each recorded file is added once unless an import already names it: false for an extensionless JSON import, which is named twice.
  • Description: a recorded file matches an extensionless import or its folder's index only for module extensions, so a same-stem image is still named: verified (the same-stem reverse test).
  • Description: a reader that does not know the field ignores it: verified (the reader checks only the format, entry and files, and the format number is unchanged).
  • Description: the command is experimental under the release record's experimental route, and the reverse reports exact only when nothing is missing: verified.
  • Description: the files listed, the record entry and its rubric results: verified (eight files).
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, Sass): verified.
  • Description: the render tests pass (444 passed, 3 skipped), with the strict and JSON API typechecks and the knowledge check: verified; the browser parity check was not rerun, as nothing rendered changes.
  • Description: no new public API and no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified.

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: clear.
  • packages/cli/api/render/_adapter.mjs: names an extensionless JSON import twice (:845).
  • packages/cli/api/render/render.test.mjs: clear; a JSON reverse test belongs with the fix.
  • packages/cli/api/render/render.type.mjs: non-blocking, the exact description still says every file it imports (:80).
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/_adapter.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/rl-not-carried branch from 285fac1 to 7a923f2 Compare November 17, 2026 21:25
@josephfarina
josephfarina force-pushed the josephfarina/rl-reverse-not-carried branch from d5ca48b to cd1189b Compare November 17, 2026 21:25
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec cd1189b

@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 reverse rule and the new record field are settled by an engineering owner's approval at this head, but one fix is needed before approval.

  • --reverse names a not-carried JSON file imported without its extension twice (a page importing ./site.config for a site.config.json the render leaves out gets missing: ['site.config', 'site.config.json']), because packages/cli/api/render/_adapter.mjs:862 strips only module extensions while the import walk also resolves .json, so reuse the walk's RESOLVE_EXTENSIONS (or add .json as line 963 does) and add a reverse test for that layout.

Non-blocking: the data.exact description in packages/cli/api/render/render.type.mjs:80 still says "every file it imports", while a recorded file no import names now also makes it false.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Title and changeset: the reverse names every file the render records as not carried, so exact is false whenever one exists: verified in every layout tried.
  • Changeset: a rendered file records the files it left out and the reverse adds them to missing: verified.
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true).
  • Description: the render's note names a file it cannot carry in the listed cases: verified (from the change below this one).
  • Description: the restored page then failed to build: not reproduced; consistent with the restored folder lacking the module.
  • Description: the record field appears only when files were left out: verified (the record and the foundation round-trip test).
  • Description: each recorded file is added once unless an import already names it: false for a JSON file imported without its extension, which is named twice.
  • Description: a recorded file matches an extensionless import or its folder's index only for module extensions, so a same-stem image is still named: verified (the same-stem reverse test).
  • Description: a reader that does not know the field ignores it: verified (the reader checks only the format, entry and files, and the format number is unchanged).
  • Description: the command is experimental under the release record, and the reverse reports exact only when nothing is missing: verified.
  • Description: the files listed, the record entry and its rubric results: verified (eight files).
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, Sass, record round trip): verified.
  • Description: the render tests pass, with the strict and JSON API typechecks and the knowledge check: verified (now 457 passed and 3 skipped, as the base gained tests); the browser parity check was not rerun, as nothing rendered changes.
  • Description: no new public API and no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified.

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: clear (approved by an engineering owner at this head).
  • packages/cli/api/render/_adapter.mjs: names a not-carried JSON file imported without its extension twice (:862).
  • packages/cli/api/render/render.test.mjs: clear; a JSON reverse test belongs with the fix.
  • packages/cli/api/render/render.type.mjs: non-blocking, the exact description still says every file it imports (:80).
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 1c5a5ca

@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 reverse rule is settled by an engineering owner's approval at this head and an extensionless JSON import is now named once, but the dedupe now drops some recorded files from missing.

  • --reverse drops a recorded JSON file that shares its stem with a recorded module: a page that imports ../lib/rows from a not-carried rows.ts that imports ./rows.json gets missing: ['../lib/rows'] although the render records rows.json, because packages/cli/api/render/_adapter.mjs:862 counts any recorded rows.<ext> as named by ../lib/rows; count only the one recorded file that import resolves to, in the walk's first-match order (one resolver shared with resolveIn in foundation/render/embedded-imports.mjs), and add a reverse test for rows.ts with rows.json.
  • Miss: the folder match at packages/cli/api/render/_adapter.mjs:863 drops a recorded index file beside a same-named module (a not-carried rows.ts that imports ./rows/index.ts gives missing: ['../lib/rows']), and the same first-match resolution fixes it.

The earlier suggestion to match through RESOLVE_EXTENSIONS fixed the duplicate but was incomplete: the match also has to follow the walk's order, as resolveIn does.

Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims:

  • Title and changeset: the reverse names every file the render records as not carried: false when a recorded JSON file or folder index shares its stem with a recorded module (reverse probe of rows.ts importing ./rows.json).
  • Changeset: exact is false whenever a file is recorded as not carried: verified (_adapter.mjs:972; every recorded file is added or already covered by an entry in missing).
  • Changeset: a rendered file records the files the render left out: verified (render-page.mjs:1533, source-block.mjs:119, the foundation round-trip test).
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true).
  • Description: the render's note names a file it cannot carry in the listed cases: verified (tests from the change below this one).
  • Description: the restored page then failed to build: not reproduced; consistent with the restored folder lacking the module.
  • Description: the record field appears only when files were left out: verified.
  • Description: each recorded file is added once unless an import already names it: false for the same-stem JSON and folder index layouts above.
  • Description: matching uses only the walk's extensions, so a same-stem image is still named and an extensionless JSON import is named once: verified (the two new reverse tests and a probe).
  • Description: a reader that does not know the field ignores it: verified (the reader checks only the format, entry, files and checksums; the format number is unchanged).
  • Description: the command is experimental under the release record, and exact holds only when nothing is missing: verified.
  • Description: the files listed, the record entry and its rubric results: verified; the list leaves out the one-word export in embedded-imports.mjs.
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, extensionless JSON, Sass, record round trip): verified.
  • Description: the render tests pass (458 passed, 3 skipped), with the strict and JSON API typechecks and the knowledge check: verified; the browser parity check was not rerun, as nothing rendered changes.
  • Description: one defect, no new public API, no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified (the base branch is that change's head).

Files:

  • .changeset/render-reverse-not-carried.md: its claim is false in the layouts of the two findings.
  • docs/architecture/cli-surface.md: clear (approved by an engineering owner at this head).
  • packages/cli/api/render/_adapter.mjs: both findings (lines 862-864).
  • packages/cli/api/render/render.test.mjs: clear; no test covers a recorded file that shares a stem with a recorded module.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/foundation/render/embedded-imports.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/_adapter.mjs Resolved
Comment thread packages/cli/api/render/_adapter.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9b43f21

@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: --reverse now names every recorded not-carried file once, and the record entry is approved by an engineering owner at this head; one fix remains.

  • recordedFileOf at packages/cli/api/render/_adapter.mjs:863-867 copies the resolution order that resolveIn already implements in packages/cli/foundation/render/embedded-imports.mjs:300-308, so the next change to how the walk resolves an import would leave the reverse on the old order and missing would again name one file twice or drop one; export one resolver (for example resolutionCandidates(spec)) from embedded-imports.mjs, use it in resolveIn and in the reverse, and delete the copy.
Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims:

  • Title and changeset: the reverse names every file the render records as not carried as missing: verified (reverse probe over 11 layouts that render; tests at render.test.mjs:2542 and :2562).
  • Changeset: exact is false whenever a file is recorded as not carried: verified (_adapter.mjs:978).
  • Changeset: a rendered file records the files the render left out: verified (render-page.mjs:1533, source-block.mjs:119, the foundation round-trip test).
  • Changeset and description: an alias import from outside the carried folder used to come back as exact: verified (the base answers exact: true).
  • Description: the render's note names a file it cannot carry in the listed cases: verified (tests from the change below this one).
  • Description: the restored page then failed to build: not reproduced; consistent with the restored folder lacking the module.
  • Description: the record field appears only when files were left out: verified.
  • Description: each import in missing names exactly one recorded file, the first in the walk's order, and every other recorded file stays in missing: verified (same-stem image, JSON and folder index probes and tests).
  • Description: a reader that does not know the field ignores it: verified (the base CLI reverses a file with the new field without error).
  • Description: the command is experimental under the release record, and exact holds only when nothing is missing: verified.
  • Description: the files listed, the record entry and its rubric results: verified; the list leaves out the one-word export in embedded-imports.mjs.
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, extensionless JSON, same-stem JSON, folder index beside a module, Sass, record round trip): verified.
  • Description: the render tests pass (460 passed, 3 skipped), with the strict and JSON API typechecks and the knowledge check: verified; the browser parity check was not rerun, as nothing rendered changes.
  • Description: one defect, no new public API, no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified (the base branch is that change's head).

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: clear (approved by an engineering owner at this head).
  • packages/cli/api/render/_adapter.mjs: the finding (lines 863-867).
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/foundation/render/embedded-imports.mjs: clear; the shared resolver belongs here.
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/_adapter.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/rl-not-carried branch from 7a923f2 to 52f4253 Compare November 17, 2026 23:16

@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 spec approval at the current head; no code changes are needed.

The branch was rebased onto its updated base with its own commits unchanged, but the spec approvals on record are for earlier heads. The cli-surface render entry, which states what --reverse reports in missing and exact, and the embedded-source notCarried field the reverse reads need an engineering owner to record the decision by commenting /approve-spec <full head SHA> on this pull request at the current head; the author may do so as an engineering owner.

Non-blocking:

  • bySuffix in packages/cli/foundation/render/embedded-imports.mjs (lines 326-330) still spells the same candidate list inline; iterating resolutionCandidates(rest) there would leave one definition of the order.
Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Title and changeset: --reverse names every file the render records as not carried as missing: verified (packages/cli/api/render/_adapter.mjs:865-879; reverse tests at packages/cli/api/render/render.test.mjs:2472, :2542, :2562, :2580, :2618, :2688).
  • Changeset: exact is false whenever a recorded file exists: verified (_adapter.mjs:983).
  • Changeset and description: a rendered file records the files the render left out, only when there are any: verified (packages/cli/foundation/render/render-page.mjs:1578, source-block.mjs:119, packages/cli/foundation/render/render.test.mjs:123-128).
  • Changeset and description: a module imported through a path alias from outside the carried folder used to come back exact: verified (the alias case answers exact: true on the base and exact: false with the module in missing here).
  • Description: the render's note names a file it cannot carry (an aliased or relative module from outside the carried folder, a Sass or Less stylesheet): verified (render-page.mjs:1432-1475; tests at render.test.mjs:2618, :2688).
  • Description: the restored page then failed to build: not reproduced; it follows from the restored folder lacking the module.
  • Description: each import in missing names exactly one recorded file, the first in the walk's order, and every other recorded file stays: verified (embedded-imports.mjs:289-295, _adapter.mjs:869-879; same-stem image, JSON and folder-index tests).
  • Description: a reader that does not know the record field ignores it: verified (the reader keeps the parsed payload; the reverse treats an absent list as empty).
  • Description: the command is experimental under the release record, and exact holds only when nothing is missing: verified.
  • Description: the files of the smallest restoration: verified; the list leaves out embedded-imports.mjs, which now holds the shared resolution order.
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, extensionless JSON, same-stem JSON, folder index beside a module, Sass, record round trip): verified at the cited tests.
  • Description: the render tests, typechecks and knowledge check pass: verified (464 passed and 3 browser-only skipped; the rebased base adds tests to the count stated; both typechecks and the knowledge check pass); the browser parity check was not rerun, as nothing rendered changes.
  • Description: the record change names api/render and foundation/render with the --reverse rule: verified (docs/architecture/cli-surface.md:779-784); approval at the current head is pending.
  • Description: one defect, no new public API, no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry: verified (the base branch is that change).

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: waits on an engineering owner's approval at the current head.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/foundation/render/embedded-imports.mjs: clear; non-blocking note on bySuffix.
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8a6129b

@josephfarina
josephfarina force-pushed the josephfarina/rl-reverse-not-carried branch from 8a6129b to 19de8a9 Compare November 18, 2026 07:54
@josephfarina
josephfarina changed the base branch from josephfarina/rl-not-carried to main November 18, 2026 07:55
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 19de8a9

@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.

--reverse now names every file the render records as not carried, the record entry that states the rule is approved by an engineering owner at this head, and the new reverse tests fail before this change and pass with it. The last inline copy of the import resolution order now calls resolutionCandidates, so nothing is left to change.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Title and changeset: --reverse names every file the render records as not carried as missing, so exact is false whenever one is: verified (packages/cli/api/render/_adapter.mjs:891-904, :1009; reverse tests at packages/cli/api/render/render.test.mjs:2557, :2627, :2647, :2665, :2703, :2773).
  • Changeset and description: a rendered file records the files the render left out, only when there are any: verified (packages/cli/foundation/render/render-page.mjs:1578, source-block.mjs:119, packages/cli/foundation/render/render.test.mjs:122-130).
  • Changeset and description: a module imported through a path alias from outside the carried folder used to come back exact: verified (that test answers exact: true with no missing before this change).
  • Description: the render's note names a file it cannot carry (an aliased or relative module from outside the carried folder, a Sass or Less stylesheet): verified (render-page.mjs:1457-1477, already on main).
  • Description: the restored page then failed to build: not reproduced; it follows from the restored folder lacking the module.
  • Description: each import in missing names exactly one recorded file, the first in the walk's order, and every other recorded file stays: verified (embedded-imports.mjs:289-295, _adapter.mjs:895-904; same-stem image, JSON and folder-index tests).
  • Description: a reader that does not know the record field ignores it: verified (the reader keeps the parsed payload, source-block.mjs:211-254; the reverse treats an absent list as empty).
  • Description: the command is experimental, and exact holds only when nothing is missing: verified.
  • Description: the files of the smallest restoration: verified; the list leaves out embedded-imports.mjs, which now holds the shared resolution order.
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, extensionless JSON, same-stem JSON, folder index beside a module, Sass, record round trip): verified at the cited tests.
  • Description: the render tests, typechecks and knowledge check pass: verified (467 passed and 3 skipped after the rebase onto main; both typechecks and the knowledge check pass); the browser parity check was not rerun, as nothing rendered changes.
  • Description: the record change names api/render and foundation/render with the --reverse rule: verified (docs/architecture/cli-surface.md:782-787), approved at this head.
  • Description: one defect, no new public API, no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry, landing after it: verified (that change is on main, and this branch sits on it).

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: clear.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/foundation/render/embedded-imports.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

…ssing

A rendered file now records the files the render left out, and
--reverse adds each to missing, so exact is false whenever one is. A
module a page imports through a path alias from outside the carried
folder, which the reverse cannot resolve, no longer comes back reported
as exact. A file the imports already name is named once.
…CLI record states the rule

A page that imports a folder from above the carried folder named it
twice in missing, as the import and as its recorded index file; the
recorded index file now matches its folder. The CLI surface record
states what --reverse reports: missing lists every file the restored
page imports that it lacks and every file the rendered file records as
not carried, and exact is true only when missing is empty.
…dule extension

A recorded image that shared its stem with an imported module, such as
rows.png beside rows.tsx, was taken for the import and dropped from
missing. A recorded file now matches an extensionless import, or its
folder's index, only when its extension is one such an import resolves
to.
An import such as ./site.config also stands for site.config.json, so a
recorded file now matches an import by every extension the import walk
resolves, JSON included, from the walk's own list. The exact field
says a recorded file no import names makes it false too.
An extensionless import counted every recorded file that shared its
stem, or its folder's index, as named, so a recorded rows.json beside an
imported rows.ts, or rows/index.ts beside it, dropped out of missing.
Each import now names the one recorded file it resolves to in the walk's
order (as written, each extension, then the folder's index), and every
other recorded file stays in missing.
embedded-imports.mjs exports resolutionCandidates, the paths a relative
import may name in order, and both the walk and --reverse use it, so
--reverse no longer keeps its own copy. Recorded files are checked
against a set, so a long list stays fast.
bySuffix, which finds the one carried file an alias import names, now
iterates resolutionCandidates instead of spelling the order inline, so
the walk, alias lookup and --reverse share one definition.
…adds

experimental render is now experimental export: the changeset, the CLI
surface record's entry and this change's tests use the new name.
@josephfarina
josephfarina force-pushed the josephfarina/rl-reverse-not-carried branch from 19de8a9 to 48e38f5 Compare November 18, 2026 11:34
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 48e38f5

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels 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.

Approved pending CI: some checks are still running on this head.

--reverse now names every file the render records as not carried, the record entry that states the rule is approved by an engineering owner at this head, and the new reverse tests fail before this change and pass with it. Nothing is left to change in the code.

  • Non-blocking: the description's "Expected behavior and authority" paragraph still calls the command astryx experimental render; it is now astryx experimental export, as the changeset, record entry and tests already say.
Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Title and changeset: --reverse names every file the render records as not carried as missing, so exact is false whenever one is: verified (packages/cli/api/render/_adapter.mjs:881-894, :999; reverse tests at packages/cli/api/render/render.test.mjs:2579, :2649, :2669, :2687, :2725, :2759).
  • Changeset: the command is astryx experimental export --reverse: verified (packages/cli/clients/cli/commands/experimental-export.doc.mjs, its --reverse option).
  • Changeset and description: a rendered file records the files the render left out, only when there are any: verified (packages/cli/foundation/render/render-page.mjs:1578, source-block.mjs:119, packages/cli/foundation/render/render.test.mjs:122-130).
  • Changeset and description: a module imported through a path alias from outside the carried folder used to come back exact: verified (that test answers exact: true with no missing before this change).
  • Description: the render's note names a file it cannot carry (an aliased or relative module from outside the carried folder, a Sass or Less stylesheet): verified (render-page.mjs:1457-1477, already on main).
  • Description: the restored page then failed to build: not reproduced; it follows from the restored folder lacking the module.
  • Description: each import in missing names exactly one recorded file, the first in the walk's order, and every other recorded file stays: verified (embedded-imports.mjs:289-295, _adapter.mjs:885-894; same-stem image, JSON and folder-index tests).
  • Description: a reader that does not know the record field ignores it: verified (the reader keeps the parsed payload, source-block.mjs:211-254; the render format number is unchanged; the reverse treats an absent list as empty).
  • Description: the command is experimental, and exact holds only when nothing is missing: verified, under the command's new name experimental export (the description still says experimental render).
  • Description: the files of the smallest restoration: verified; the list leaves out embedded-imports.mjs, which now holds the shared resolution order.
  • Description: the listed test expectations (alias, outside folder with a helper, folder from above, same-stem image, extensionless JSON, same-stem JSON, folder index beside a module, Sass, record round trip): verified at the cited tests.
  • Description: the render tests, typechecks and knowledge check pass: verified (468 passed and 3 skipped on this head; both typechecks and the knowledge check pass); CI's interaction checks pass at this head.
  • Description: the record change names api/render and foundation/render with the --reverse rule: verified (docs/architecture/cli-surface.md:797-802), approved by an engineering owner at this head.
  • Description: one defect, no new public API, no internal context: verified.
  • Description: stacked on the change that names the files a render does not carry, landing after it: verified (that change is on main, and this branch sits on it).

Files:

  • .changeset/render-reverse-not-carried.md: clear.
  • docs/architecture/cli-surface.md: clear.
  • packages/cli/api/render/_adapter.mjs: clear.
  • packages/cli/api/render/render.test.mjs: clear.
  • packages/cli/api/render/render.type.mjs: clear.
  • packages/cli/foundation/render/embedded-imports.mjs: clear.
  • packages/cli/foundation/render/render-page.mjs: clear.
  • packages/cli/foundation/render/render.test.mjs: clear.
  • packages/cli/foundation/render/source-block.mjs: clear.

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 48e38f5

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.45 MB packed (+686 B); no new dependencies.

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


Generated by PR Enrichment workflow | View full report

This branch was successfully deployed

1 active deployment
Preview — 48e38f55 Deployed Nov 18, 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