Skip to content

[experimental] render: the text answer names at most 10 files, then counts the rest - #12287

Merged
josephfarina merged 1 commit into
mainfrom
josephfarina/rl-reverse-list
Nov 18, 2026
Merged

josephfarina merged 1 commit into
mainfrom
josephfarina/rl-reverse-list

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User need

render and --reverse print every file they carried or wrote on one line. A page with 200 images prints about 9 KB on that line, and an agent reads every byte a command prints.

Problem and solution fit

  • The text answer now names at most 10 files, then "... and N more in /", the folder the rest share (no folder when they share none).
  • The JSON answer keeps every file, so a caller that needs the list reads it there.

Current specification

astryx experimental render is experimental (spec:AST-017 FR27). The JSON shape is unchanged.

Public delta and caller burden

  • Text output only: long file lists are cut to 10 names and a count.

Evidence

  • render.test.mjs: a page with 12 stylesheets in one folder; the text names the first 10, then "... and 3 more in many-text/styles/"; the JSON lists all 13 files.
  • text-json-parity.test.mjs passes.

Scope

  • One change.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/api/render/render.test.mjs packages/cli/clients/cli/commands/text-json-parity.test.mjs.

@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 8:05am 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
🟢 Reviewed (for maintainers only) Nov 18, 2026, 8:06 AM UTC

@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, and it starts once this pull request targets main after the live-app render change it is stacked on lands.

The files line of astryx experimental render now stops at 10 names and names the folder that holds the rest, --json still lists every file, and the new test fails before the change and passes after it. Two small points, neither blocking:

  • With exactly 11 files the cut line is longer than the full list (263 to 273 bytes in a probe) and hides the 11th name, so cut only when it saves bytes.
  • Ending the cut with (--json lists every one), as experimental icon does, tells an agent where the full list is.
Claims and files checked

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

  • Claim: the text answer names at most 10 files, forward and with --reverse: verified (code at both call sites, new test, a probe of each direction).
  • Claim: it counts the rest and names the folder they share, with no folder when they share none: verified (code; a 201-file restore ends ... and 191 more in page-restored/images/).
  • Claim: a page with many images no longer prints a long line: verified (201 files: 7,230 to 397 bytes).
  • Claim: the JSON answer still lists every file and its shape is unchanged: verified (the JSON branch returns before the text shaping; the test expects 13 files).
  • Claim: before this change both directions printed every file on one line, about 9 KB for 200 images: verified (base code; 7,230 bytes with 34-character paths).
  • Claim: the command is experimental and the change ships as an experimental patch: verified (registered only under experimental; the changeset is a patch with [experimental]).
  • Claim: the new render test and the text/JSON parity test pass: verified (both pass on this head; the new test fails on the base).
  • Claim: no internal context in public text, and the change lands after the live-app render change: verified.
  • File .changeset/render-reverse-long-file-list.md: clear.
  • File packages/cli/api/render/render.test.mjs: clear; the forward render's cut has no case of its own (non-blocking).
  • File packages/cli/clients/cli/commands/experimental/render.mjs: the two non-blocking points above.

Automated review (maintainer link)

* @param {string[]} files
*/
function fileList(files) {
if (files.length <= LISTED_FILES) return files.join(', ');

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: with exactly 11 files the cut replaces one name with ... and 1 more in <folder>/, so the line gets longer than the full list (263 to 273 bytes in a probe) and the 11th name is gone. Cutting only when it saves bytes, for example only past 11 files, keeps the 11-file case whole.

@josephfarina
josephfarina force-pushed the josephfarina/rl-reverse-list branch from d2409de to ab0bf5c Compare November 17, 2026 11:22

@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, and it runs once this pull request targets main after the live-app render change it is stacked on lands.

The files line of astryx experimental render now stops at 10 names and names the folder that holds the rest, --json still lists every file, and the new test fails before the change and passes after it. Two small points, neither blocking:

  • With exactly 11 files the cut line is longer than the full list (263 to 273 bytes in a probe) and hides the 11th name, so cut only when it saves bytes.
  • Ending the cut with (--json lists every one), as experimental icon does, tells an agent where the full list is.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: the text answer names at most 10 files, forward and with --reverse: verified (both call sites, the new test, a probe).
  • Claim: it counts the rest and names the folder they share, with no folder when they share none: verified (code; a 201-file restore ends ... and 191 more in page-restored/images/).
  • Claim: a page with many images no longer prints a long line: verified (201 files: 7,230 to 397 bytes).
  • Claim: the JSON answer still lists every file and its shape is unchanged: verified (the JSON branch returns before the text shaping; the test expects 13 files).
  • Claim: before this change both directions printed every file on one line, about 9 KB for 200 images: verified (base code; 7,230 bytes with 34-character paths, more with longer names).
  • Claim: the command is experimental and the change ships as an experimental patch: verified (registered only under experimental; the changeset is a patch with [experimental] and passes the changeset check).
  • Claim: the new render test and the text/JSON parity test pass: verified (both pass on this head; the new test fails on the base).
  • Claim: no internal context in public text, and the change lands after the live-app render change: verified.
  • File .changeset/render-reverse-long-file-list.md: clear.
  • File packages/cli/api/render/render.test.mjs: clear; the forward render's cut has no case of its own (non-blocking).
  • File packages/cli/clients/cli/commands/experimental/render.mjs: the two non-blocking points above.

Automated review (maintainer link)

if (files.length <= LISTED_FILES) return files.join(', ');
const rest = files.slice(LISTED_FILES);
const folder = sharedFolder(rest);
return `${files.slice(0, LISTED_FILES).join(', ')}, ... and ${rest.length} more${folder ? ` in ${folder}/` : ''}`;

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: the cut names the folder of the remaining files but not where the full list is. Ending it with (--json lists every one), as experimental icon does, lets an agent that needs every name get it with one more call.

@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 finished on this head yet.

The files line of astryx experimental render now names at most 10 files and counts the rest with the folder they share, --json still lists every file, and the new test fails before the change and passes after it. Three optional points, none blocking:

  • With exactly 11 files the cut line is longer than the full list (263 to 273 bytes in a probe) and hides the 11th name, so cut only when it saves bytes.
  • Ending the cut with (--json lists every one), as experimental icon does, tells an agent where the full list is.
  • GitHub still compares this pull request with the old head of the branch it was stacked on, so the Files tab lists 119 files from 14 commits already on main and the review-signal check fails on that list; the change itself is three files.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: before this change both directions printed every file on one line, about 9 KB for 200 images: verified (base code joins every file; 7,230 bytes for 201 files with 34-character paths in a probe, more with longer names).
  • Claim: the text answer names at most 10 files, then the count of the rest and the folder they share, with no folder when they share none: verified (the new helper in the render command; probes of 10 to 201 files; the new test).
  • Claim: the JSON answer still lists every file and its shape is unchanged: verified (the JSON branch returns before the text shaping; the test expects 13 files; probes list every file).
  • Claim: the command is experimental and only text output changes: verified (registered only under experimental; only the two text records change).
  • Claim: the new test restores a page with 12 stylesheets, names the first 10 and then ... and 3 more in many-text/styles/, and JSON lists all 13 files: verified (it passes on this head and fails before the change).
  • Claim: the text/JSON parity test passes: verified (passes on this head).
  • Claim: one change, with no internal context in public text: verified (a three-file patch; nothing internal in the added lines, title, body or commit message).
  • Release note: names at most 10 files, then counts the rest and names their folder, as in ... and 190 more in page-restored/images/: verified (the same form as the probe's ... and 191 more in page-restored/images/ for 201 files).
  • Release note: a page with many images no longer prints a long line: verified (201 files: 7,230 to 397 bytes).
  • Release note: the JSON answer still lists every file, as an [experimental] patch: verified (the changeset check passes).
  • File .changeset/render-reverse-long-file-list.md: clear.
  • File packages/cli/api/render/render.test.mjs: clear; the forward render's cut has no case of its own (non-blocking).
  • File packages/cli/clients/cli/commands/experimental/render.mjs: the first two optional points above.
  • The other 116 files GitHub lists arrive with 14 commits already on main, each landed through its own pull request; merging this pull request changes none of them.

Automated review (maintainer link)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 415f495

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.42 MB packed (+406 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

@josephfarina
josephfarina force-pushed the josephfarina/rl-reverse-list branch from e7e7c38 to 415f495 Compare November 18, 2026 07:48
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 415f495

@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 finished on this head yet.

The files line of astryx experimental render, and now its notCarried line, names at most 10 files and counts the rest with the folder they share, --json still lists every file, and the new test fails before the change and passes after it. Three optional points, none blocking:

  • With exactly 11 files the cut line is longer than the full list (253 to 264 bytes in a probe) and hides the 11th name, so cut only when it saves bytes.
  • Ending the cut with (--json lists every one), as experimental icon does, tells an agent where the full list is.
  • The render function's doc still says the text output names every file in notCarried; past 10 it now names the first 10 and counts the rest.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: before this change both directions printed every file on one line, about 9 KB for 200 images: verified (the base joins every file; 7,230 bytes for 201 files with 34-character paths in a probe, about 9 KB with 44-character paths).
  • Claim: the text answer names at most 10 files, then the count of the rest and the folder they share, with no folder when they share none: verified (the new helper in the render command; probes of 10 to 201 files; the new test).
  • Claim: the JSON answer keeps every file and its shape is unchanged: verified (the JSON branch returns before the text shaping; the test expects 13 files; probes list every file and every left-out file).
  • Claim: the command is experimental and only text output changes: verified (registered only under experimental; only the text records change).
  • Claim: the new test restores a page with 12 stylesheets, names the first 10 and then ... and 3 more in many-text/styles/, and JSON lists all 13 files: verified (it passes on this head and fails before the change).
  • Claim: the text/JSON parity test passes: verified (passes on this head).
  • Claim: one change, with no internal context in public text: verified (a three-file patch; nothing internal in the added lines, title, body, branch name or commit message).
  • Release note: names at most 10 files, then counts the rest and names their folder, as in ... and 190 more in page-restored/images/: verified (the same form as the probe's ... and 191 more in page-restored/images/ for 201 files).
  • Release note: a page with many images no longer prints a long line: verified (201 files: 7,230 to 397 bytes).
  • Release note: the JSON answer still lists every file, as an [experimental] patch: verified (the changeset check passes).
  • File .changeset/render-reverse-long-file-list.md: clear.
  • File packages/cli/api/render/render.test.mjs: clear; the forward render's cuts have no case of their own (non-blocking).
  • File packages/cli/clients/cli/commands/experimental/render.mjs: the three optional points above.

Automated review (maintainer link)

files: d.files.join(', '),
...(d.notCarried?.length ? {notCarried: d.notCarried.join(', ')} : {}),
files: fileList(d.files),
...(d.notCarried?.length ? {notCarried: fileList(d.notCarried)} : {}),

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: render.doc.mjs still says each file a render cannot carry is named in notCarried in "the JSON result and the text output"; with this line the text names the first 10 and counts the rest. The Warnings list still names every file, so only the doc needs to say the text names the first 10.

@josephfarina
josephfarina merged commit b39bbaa into main Nov 18, 2026
80 checks passed
josephfarina added a commit that referenced this pull request Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 18, 2026
@github-actions
github-actions Bot deleted the josephfarina/rl-reverse-list branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 415f4951 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