Repository navigation
fix(cli): the transpile cache names copies for their source text and trims one subfolder per write, so it stays small and no run reads all of it - #12385
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the rewritten spec:AST-081 FR7 transpile-cache bullet: copies named by source text and settings (per file when the text contains meta), 256 subfolders trimmed by creation time, oversize copies not kept, and the old astryx/jiti folder left in place. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. These changes are needed either way:
packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjsstill looks for copies inastryx/jitiwiththemein their name, so all three of its cases fail with this change (they pass onmain); point it atastryx/transpiledand list the copies recursively.- The changeset says the same file in many folders shares one copy, but text containing
metagets a copy per file (jiti-cache.mjs:179), so add "unless its text containsmeta". trimSubfolder(jiti-cache.mjs:286) re-implementsevictOldestfromcache-eviction.mjs(list, keep regular files, sort by mtime, unlink the oldest), so call or extend the shared helper and keep only the.tmpsweep here.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- jiti names each copy for its source's path: verified (jiti 2.7.0 cache naming hashes the file name).
- The old size check could not remove a copy used in the last two days because jiti checks that a copy exists and then reads it with no fallback: verified (base two-day protection; jiti's exists-then-read).
- When the old check ran it read the whole folder: verified (
evictOldestlists every entry). - One machine reached over a million copies and theme commands hung for minutes: not checkable from the repository; consistent with the base code.
- Every command prints what it printed except doctor's cache text: verified by reading; a kept copy returns jiti's own code (
jiti-cache.test.mjs"reads a kept copy instead of transpiling"). - A copy's name hashes the source text and every setting the transform reads: verified (
copyName; jiti 2.7.0's transform reads the path only forimport.metaand.tsx). - Text containing "meta" also names the copy for its file: verified (
jiti-cache.mjs:179; test). - No run reads the whole cache; a write trims only its own subfolder: verified (test "reads only the subfolder it writes").
- Copies sit in 256 subfolders, are written under another name and renamed, and a failed read or partial copy is a miss: verified (
keepCopy,readCopy; tests). - The trim keeps each subfolder within its share, oldest made first, never the new copy: verified (test).
- Oversize copies are used but not kept; failed transpiles and non-plain settings are never kept: verified (tests).
- Errors name the real file: verified (test).
- The old folder is never read, listed or written, and doctor finds it with one stat: verified (tests).
- doctor's kept-catalog row describes the trimming: verified (packed records test).
- The record describes the cache as it now works: verified as text; it awaits owner approval.
- Code is path-free for files without "meta" (3,581 files): consistent; a sample of 968 repository TypeScript files showed no path difference without "meta".
- Timing table: not re-measured.
- No CI workflow, action or script changes: verified.
- The new cache tests (19) and doctor tests (6) pass: verified.
- The packed kept-catalog tests read the subfolder copies and doctor's new sentence: verified, they pass.
- The CLI suites, theme build included, pass: false;
build-theme.transpile-cache.test.mjsfails 3 of 3. - Changeset: the cache stays small and fast however many folders load the same files: verified (bounded trim).
- Changeset: the same file in many folders shares one copy: false for text containing "meta".
- Changeset: each new copy trims only its own subfolder, so no run reads the whole cache: verified.
- Changeset: fresh-folder runs could fill the old folder and a theme command spent minutes reading it: consistent with the base code.
- Changeset: doctor names the old folder and the command that removes it: verified (test; doctor run in a project).
Files:
.changeset/transpile-cache-bounded.md: finding (sharing overstated).docs/specs/AST-081-global-mode/spec.md: awaits engineering-owner approval of the FR7 rewrite.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/old-transpile-cache.test.mjs: clear.packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.packages/cli/foundation/fs/cache-eviction.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.mjs: finding (trimSubfolderduplicatesevictOldest).packages/cli/foundation/fs/jiti-cache.test.mjs: clear.packages/cli/test/packed-gather-cache.fresh.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjs(not changed): finding (fails at this head).
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the rewritten spec:AST-081 FR7 transpile-cache clause: copies named by source text and settings (per file when the text contains meta), 256 subfolders trimmed by creation time, oversize copies not kept, and the old astryx/jiti folder left in place with project doctor naming it. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The three earlier findings are fixed at this head, and these changes are needed either way:
- Miss:
removeFolderCommand(packages/cli/api/doctor/doctor.mjs:2798) re-implementsquoteCommandArgumentfromfoundation/env/package-manager.mjsand already misses the typographic quotes PowerShell also treats as quote marks, so build both commands withquoteCommandArgument(dir, platform). - Miss:
isPlain(packages/cli/foundation/fs/jiti-cache.mjs:197) re-implements the plain-data check infoundation/fs/exact-codec.mjswithout its cycle and-0guards, so name copies with that module'sisPlainandexactTextand delete the local copy.
The changeset could also say "Project doctor", as FR7 now does.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- jiti named each copy for its source's path: verified (jiti 2.7.0's cache naming hashes the file name).
- The old size check could not remove a copy used in the last two days, because jiti checks that a copy exists and then reads it with no fallback: verified (the base's two-day protection; jiti's exists-then-read).
- When the old check ran, it read the whole folder: verified (the base trim lists every entry).
- One machine reached over a million copies and theme commands hung for minutes: not checkable from the repository; consistent with the base code.
- Every command prints what it printed, except doctor's cache text: verified by reading and tests; a kept copy returns jiti's own code (
jiti-cache.test.mjs"reads a kept copy instead of transpiling"). - A copy's name hashes the source text and every setting the transform reads: verified (
copyName; jiti 2.7.0's transform reads the path only forimport.meta,.tsxand errors). - Text containing "meta" also names the copy for its file: verified (
jiti-cache.mjs:182; test). - No run reads the whole cache, and a write trims only its own subfolder: verified (test "reads only the subfolder it writes").
- Copies sit in 256 subfolders, are written under another name and renamed, and a failed read or partial copy is a miss: verified (
keepCopy,readCopy; tests). - The trim keeps each subfolder within its share, oldest made first, never the new copy: verified (
trimSubfolderthroughevictOldestwithkeep; tests). - Oversize copies are used but not kept, and failed transpiles and non-plain settings are never kept: verified (tests).
- Errors name the real file: verified (test).
- The old folder is never read, listed or written: verified (test).
- doctor finds the old folder with one stat and names it with the command that removes it: verified (test; doctor run in a project).
- doctor's kept-catalog row describes the trimming: verified (packed kept-catalog records test).
- The record describes the cache as it now works: verified as text; it awaits owner approval.
- Code is path-free for files without "meta": consistent; 1,500 of the 3,581 files gave identical code under two paths in every transform without "meta".
- Timing table: not re-measured.
- Every battery case's output matched before and after except doctor's row: not re-run as a battery; consistent with the tests.
- No workflow, action or CI script changes: verified.
- The cache tests (19), the doctor row tests (6) and the packed kept-catalog tests pass: verified.
- The CLI suites, type checks and command-structure check pass: partly verified; 42 related test files pass (one failure is environmental and fails on the base too), the command-structure check passes, and the type check shows no error in a changed file.
- Changeset: the cache stays small and fast however many folders load the same files: verified (bounded per-subfolder trim).
- Changeset: the same file in many folders shares one copy, unless its text contains
meta: verified. - Changeset: each new copy trims only its own subfolder, so no run reads the whole cache: verified.
- Changeset: fresh-folder runs could fill the old folder and a theme command spent minutes reading it: consistent with the base code.
- Changeset: doctor names the old folder and the command that removes it: verified inside a project; doctor outside a project does not show it.
Files:
.changeset/transpile-cache-bounded.md: non-blocking wording note (project doctor).docs/specs/AST-081-global-mode/spec.md: awaits engineering-owner approval of the FR7 rewrite.packages/cli/api/doctor/doctor.mjs: finding (removeFolderCommandduplicatesquoteCommandArgument).packages/cli/api/doctor/old-transpile-cache.test.mjs: clear.packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjs: clear (passes 3 of 3).packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.packages/cli/foundation/fs/cache-eviction.mjs: clear.packages/cli/foundation/fs/cache-eviction.test.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.mjs: finding (isPlainduplicates the exact codec's check).packages/cli/foundation/fs/jiti-cache.test.mjs: clear.packages/cli/test/packed-gather-cache.fresh.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the rewritten spec:AST-081 FR7 transpile-cache clause: copies named by source text and settings (per file when the text contains meta), 256 subfolders trimmed by creation time, oversize copies used but not kept, and the old astryx/jiti folder left in place with project doctor naming it. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The earlier findings are fixed at this head: the remove command uses the shared quoteCommandArgument, copy names use the shared exact codec, and the changeset says "Project doctor". No other change is needed.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- jiti named each copy for its source's path: verified (jiti 2.7.0 names each cached file by a hash of its path).
- The old size check could not remove a copy used in the last two days, because jiti checks that a copy exists and then reads it with no fallback: verified (the base's two-day protection; jiti's exists-then-read).
- When the old check ran, it read the whole folder: verified (the base trim lists every entry).
- One machine reached over a million copies and theme commands hung for minutes: not checkable from the repository; consistent with the base code.
- Every command prints what it printed, except doctor's cache text: verified by reading and tests; a kept copy returns jiti's own code (
jiti-cache.test.mjs"reads a kept copy instead of transpiling"). - A copy's name hashes the source text and every setting the transform reads: verified (
copyName,jiti-cache.mjs:146); the same text under.ts,.mtsand.cts, or.js,.jsxand.mjs, gets one name and identical code, and.tsxgets its own. - Text containing "meta" also names the copy for its file: verified (
jiti-cache.mjs:152; test). - No run reads the whole cache, and a write trims only its own subfolder: verified (test "reads only the subfolder it writes").
- Copies sit in 256 subfolders, are written under another name and renamed, and a failed read or partial copy is a miss: verified (
keepCopy,readCopy; tests). - The trim keeps each subfolder within its share, oldest made first, never the new copy: verified (
trimSubfolderthroughevictOldestwithkeep; tests). - Oversize copies are used but not kept, and failed transpiles and non-plain settings are never kept: verified (tests).
- Errors name the real file: verified (test).
- The old folder is never read, listed or written: verified (test).
- doctor finds the old folder with one stat and names it with the command that removes it: verified (test; doctor run in a project).
- doctor's kept-catalog row describes the trimming: verified (packed kept-catalog records test).
- The record describes the cache as it now works: verified as text; it awaits owner approval.
- Code is path-free for files without "meta": consistent; a 1,500-file sample gave identical code under two paths in every transform without "meta".
- At the size limit a subfolder holds a few hundred copies: consistent with a 256 KB share; not measured.
- Timing table: not re-measured.
- Every battery case's output matched before and after except doctor's row: not re-run as a battery; consistent with the tests.
- No workflow, action or CI script changes: verified.
- The cache tests (19), the doctor row tests (6) and the packed kept-catalog tests pass: verified.
- The CLI suites, type checks and command-structure check pass: partly verified; the related CLI suites pass, four unrelated tests that depend on the test environment fail the same way on the base, and the type checks and command-structure check were not re-run.
- Changeset: the cache stays small and fast however many folders load the same files: verified (bounded per-subfolder trim).
- Changeset: copies live in
astryx/transpiled, and the same file in many folders shares one copy unless its text containsmeta: verified. - Changeset: each new copy trims only its own subfolder, so no run reads the whole cache: verified.
- Changeset: fresh-folder runs could fill the old folder and a theme command spent minutes reading it: consistent with the base code.
- Changeset: project
doctornames the old folder and the command that removes it: verified.
Files:
.changeset/transpile-cache-bounded.md: clear.docs/specs/AST-081-global-mode/spec.md: awaits engineering-owner approval of the FR7 rewrite.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/old-transpile-cache.test.mjs: clear.packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjs: clear.packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.packages/cli/foundation/env/user-dirs.mjs: clear.packages/cli/foundation/fs/cache-eviction.mjs: clear.packages/cli/foundation/fs/cache-eviction.test.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.test.mjs: clear.packages/cli/test/packed-gather-cache.fresh.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
|
Owner decision (engineering owner, covering this pull request): the CLI's transpile cache names each kept copy for a hash of its source text and of every setting the transform reads, so a kept copy is used only when it holds exactly what the transform would make now. Each write trims at most one subfolder, so the cache stays small and no run reads all of it. Every command prints exactly what it printed before, with one exception: doctor's text about this cache, where the kept-catalog row's last sentence changes and a new info row appears where an older CLI's cache folder exists. |
|
/approve-spec 6c0e221 |
|
/approve-spec 0de9d73 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet; its jobs were cancelled because CI was full, so they need a re-run.
The transpile-cache rewrite of spec:AST-081 FR7 now has an engineering owner's approval for this exact head, and the code, unchanged since the last review, has no open finding. The earlier inline findings stay fixed, so nothing else is needed from you.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- jiti named each kept copy for its source's path: verified (jiti 2.7.0 hashes the file path into each copy's name).
- The old size check could not remove a copy used in the last two days, because jiti checks that a copy exists and then reads it with no fallback: verified (the base's two-day protection; jiti's exists-then-read).
- The old check read the whole folder when it ran: verified (the base trim listed every entry).
- One machine reached over a million copies and theme commands hung for minutes: not checkable from the repository; consistent with the base code.
- Every command prints what it printed, except doctor's text about this cache: verified (only doctor's strings change; a kept copy returns jiti's own code, test "reads a kept copy instead of transpiling").
- A copy's name hashes the source text and every setting the transform reads: verified (
copyName; the same text under.ts,.mtsand.cts, or.js,.mjsand.cjs, gets one name and identical code). - Text containing "meta" also names the copy for its file: verified (test reading
import.meta.urland.dirnamein two folders). - No run reads the whole cache, and a write trims only its own subfolder: verified (test that watches folder listings).
- The loaders turn jiti's disk cache off and pass a transform that keeps copies in
astryx/transpiled: verified (jitiCacheOptions; test). - Copies sit in 256 subfolders, are written under another name and renamed, and a failed read or partial copy is a miss: verified (
keepCopy,readCopy; tests, six-process run). - Each subfolder is trimmed to its share, made longest ago first, never the new copy: verified (
trimSubfolderthroughevictOldestwithkeep; tests). - Oversize copies are used but not kept, and failed transpiles and non-plain settings are never kept: verified (tests).
- Errors name the real file: verified (test).
- The old folder is never read, listed or written: verified (test).
- Doctor finds the old folder with one stat and names it with the command that removes it: verified (test; doctor run in a project).
- Doctor's kept-catalog row describes the trimming: verified (packed kept-catalog records test).
- The global-mode record describes the cache as it now works: verified; owner-approved for this head.
- Code is path-free for files without "meta" (3,581 files): consistent; representative sources across extensions give identical code, the full run is not repeated.
- At the size limit a subfolder holds a few hundred copies: consistent with a 256 KB share; not measured.
- Timing table: not re-measured.
- Every battery case's output matched before and after except doctor's row: not re-run as a battery; consistent with the diff and tests.
- No workflow, action or CI script changes: verified.
- The cache tests (19), the doctor row tests (6) and the packed kept-catalog tests pass: verified.
- The CLI suites, type checks and command-structure check pass: partly verified; the related suites, startup imports and doctor suites pass, and the type checks and command-structure check were not re-run.
- Changeset: the cache stays small and fast however many folders load the same files: verified (bounded per-subfolder trim, shared copies).
- Changeset: copies live in
astryx/transpiled, named for text and settings, and the same file in many folders shares one copy unless its text containsmeta: verified. - Changeset: each new copy trims only its own subfolder, so no run reads the whole cache: verified.
- Changeset: fresh-folder runs could fill the old folder and a theme command spent minutes reading it: consistent with the base code.
- Changeset: project
doctornames the old folder and the command that removes it: verified.
Files:
.changeset/transpile-cache-bounded.md: clear.docs/specs/AST-081-global-mode/spec.md: clear; the FR7 rewrite is owner-approved for this head.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/old-transpile-cache.test.mjs: clear.packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjs: clear.packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.packages/cli/foundation/env/user-dirs.mjs: clear.packages/cli/foundation/fs/cache-eviction.mjs: clear.packages/cli/foundation/fs/cache-eviction.test.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.test.mjs: clear.packages/cli/test/packed-gather-cache.fresh.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
…trims one subfolder per write, so it stays small and no run reads all of it
…r, writes a new subfolder's first copy with less work, and the theme build test reads the new folder
…c, doctor quotes the remove command with the shared quoting, and the cache's folder paths live with the other per-user folders
0de9d73 to
02053a9
Compare
|
/approve-spec 02053a9 |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head; the merge waits for its required checks.
The transpile-cache rewrite of spec:AST-081 FR7 has an engineering owner's approval for this exact head, the code matches it, and the cache, doctor and packed kept-catalog tests pass. One optional wording point for the next edit of the record: FR7 says a file "whose text contains the word meta" gets a copy per location, while copyName matches any meta substring (so metadata also splits copies); "contains meta" would match the code.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- jiti named each kept copy for its source's path: verified (jiti 2.7.0 hashes the file path into each copy's name).
- The old size check could not remove a copy used in the last two days, because jiti checks that a copy exists and then reads it with no fallback: verified (the base's two-day protection; jiti's exists-then-read).
- The old check read the whole folder when it ran: verified (the base trim listed every entry).
- One machine reached over a million copies and theme commands hung for minutes: not checkable from the repository; consistent with the base code.
- Every command prints what it printed, except doctor's text about this cache: verified (only doctor's strings change; a kept copy returns jiti's own code).
- A copy's name hashes the source text and every setting the transform reads: verified (
copyName; jiti's transform reads the path only forimport.metaand the.tsxtest). - Text containing "meta" also names the copy for its file: verified (test reading
import.meta.urland.dirnamefrom two folders). - No run reads the whole cache, and a write trims only its own subfolder: verified (test that watches folder listings).
- The loaders turn jiti's disk cache off and pass a transform that keeps copies in
astryx/transpiled: verified (jitiCacheOptions; test). - Copies sit in 256 subfolders, are written under another name and renamed, and a failed read or partial copy is a miss: verified (
keepCopy,readCopy; tests, six-process run). - Each subfolder is trimmed to its share, made longest ago first, never the new copy: verified (
trimSubfolderthroughevictOldestwithkeep; tests). - Oversize copies are used but not kept, and failed transpiles and non-plain settings are never kept: verified (tests).
- Errors name the real file: verified (test).
- The old folder is never read, listed or written, and older CLIs keep their own behavior there: verified (test watching file-system calls).
- Doctor finds the old folder with one stat and names it with the command that removes it: verified (test; a doctor run prints the row).
- Doctor's kept-catalog row describes the trimming: verified (packed kept-catalog test; only the last sentence changes).
- The global-mode record describes the cache as it now works: verified, owner-approved for this head; its "the word
meta" is narrower than the code's substring test (optional wording point above). - Code is path-free for files without "meta" (3,581 files): consistent; 968 CLI and theme files under two paths give identical code, the full run is not repeated.
- At the size limit a subfolder holds a few hundred copies: consistent with a 256 KB share; not measured.
- Timing table: not re-measured.
- Every battery case's output matched before and after except doctor's row: not re-run as a battery; consistent with the diff and tests.
- No workflow, action or CI script changes: verified.
- The cache tests (19), the doctor row tests and the packed kept-catalog tests pass: verified.
- The CLI suites, type checks and command-structure check pass: partly verified; the related suites pass here and CI's typecheck and lint pass, and the command-structure check was not re-run.
- Changeset: the per-user cache stays small and fast however many folders load the same files: verified (shared copies, bounded per-subfolder trim).
- Changeset: copies live in
astryx/transpiled, named for text and settings, shared across folders unless the text containsmeta: verified. - Changeset: each new copy trims only its own subfolder, so no run reads the whole cache: verified.
- Changeset: fresh-folder runs could fill the old folder and a theme command spent minutes reading it: consistent with the base code.
- Changeset: project
doctornames the old folder and the command that removes it: verified.
Files:
.changeset/transpile-cache-bounded.md: clear.docs/specs/AST-081-global-mode/spec.md: clear; owner-approved for this head; optional wording point on "the wordmeta".packages/cli/api/doctor/doctor.mjs: clear; the rebase keeps every phrase the base added to the kept-catalog row.packages/cli/api/doctor/old-transpile-cache.test.mjs: clear.packages/cli/clients/cli/commands/build-theme.transpile-cache.test.mjs: clear.packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.packages/cli/foundation/env/user-dirs.mjs: clear.packages/cli/foundation/fs/cache-eviction.mjs: clear.packages/cli/foundation/fs/cache-eviction.test.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.mjs: clear.packages/cli/foundation/fs/jiti-cache.test.mjs: clear.packages/cli/test/packed-gather-cache.fresh.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
| owns and others cannot open; otherwise nothing is cached on disk. Each | ||
| copy is named for its source text and transpile settings, not its | ||
| location, so the same file in many folders shares one copy; a file whose | ||
| text contains the word `meta`, as every use of `import.meta` must, also |
There was a problem hiding this comment.
Non-blocking: copyName tests a substring (source.includes('meta'), packages/cli/foundation/fs/jiti-cache.mjs:152), so a file that only mentions metadata also gets a copy per location, while this line says "the word meta". The changeset already says "contains meta"; the same words here, at the next edit of this record, would match the code.
Maintainer impact
The CLI keeps the code jiti transpiles from TypeScript (integration manifests, configs, codemods, TypeScript doc topics, theme sources) in a per-user cache folder. jiti named each copy for the source's path, and the folder's size check could not remove a copy used in the last two days, because jiti checks that a copy exists and then reads it with no fallback. So on a machine that runs many projects or test suites in fresh folders, every run added copies of the same files and none went away. When the check finally ran, it read the whole folder. One machine reached over a million copies, and
theme buildand the theme editor then hung for minutes in that check.Intended invariant
import.meta.url,.dirnameand.filename, andimport.metacannot be written with escapes, so text that contains "meta" also names the copy for its file.Change
foundation/fs/jiti-cache.mjs: the CLI's jiti loaders turn jiti's disk cache off and pass atransformthat keeps copies inastryx/transpiled.astryx/jiti) is never read, listed or written. Older installed CLIs keep their own behavior there; this change cannot reach them.doctorfinds that folder with one stat and names it with the command that removes it.doctor's kept-catalog row describes the new trimming.Evidence
Path-free code: jiti's transform gave byte-identical code for the same source under two different paths for every TypeScript file in the CLI, Core and the bundled themes whose text has no "meta" (3,581 files; 10,068 transforms across the async, JSX and TypeScript settings; 0 differ). Among texts that contain "meta", 160 transforms differed: the files that use
import.meta, which get a copy per file.Timing: the packed CLI before and after this change, both projects in sibling folders of the same path length, warm runs interleaved after a warm-up (11 each), first runs on a fresh cache folder (41 each); median difference after − before, 95% confidence interval:
component Button, TypeScript manifest (transpiles and keeps 7 copies)component Button, JavaScript manifesttheme buildof a theme with local TypeScript modulescomponent Button, Core-only projectAt the size limit, a subfolder holds a few hundred copies, so the trim after a write reads a few hundred entries.
doctor's kept-catalog row, whose last sentence now describes the trimming.Scope
Components: cli (transpile cache, doctor), docs (AST-081)
Writing rubric results
R1 narration: one sentence names the folder earlier releases used; it states what this CLI does with it (never reads or lists it, and doctor names it), kept as a boundary.
R2 research: none in the record; the path check is in this description.
R3 evidence: none cited in the changed text.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.
R7 project status: none.
Testing
foundation/fs/jiti-cache.test.mjs(19 rows):JITI_FS_CACHEand systems without user ids left to jiti;api/doctor/old-transpile-cache.test.mjs: the row is absent without the folder; it names the folder underXDG_CACHE_HOME, in macOS's cache folder and in Windows' local app data, with the POSIX or PowerShell command; it finds the folder with one stat and never lists it.