Repository navigation
perf(cli): kept gathers leave the CLI's own files to its build id and folder - #11998
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's decision on the spec:AST-081 FR7 rewording, and two fixes are needed whatever that decision is.
- The stale check at
packages/cli/foundation/fs/gather-cache.mjs:665skips every path under the CLI's folder, including packages inside the CLI's ownnode_modulesthat the build id does not hash, so a nested dependency updated or patched in place (afternpm install -gornpm update, say) keeps serving old kept answers;if (inCliBuild(file)) continue;, the rule summaries use, keeps the speed-up and restores that check. - The changeset says "Output does not change.", but
astryx doctor's cache row text changes, so the release note should say so.
At this head FR7 makes the CLI's real folder stand beside the build id for the CLI's own files, which needs an engineering owner's approval of the wording. An engineering owner records it by commenting /approve-spec with the full head commit SHA on this pull request, and the author may do so as an engineering owner.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: kept checks spent most of their file checks on the CLI's own files (measured): unverified, measurement not reproduced.
- Claim: the cache record already lets the build id stand for the CLI's own files: verified (FR7).
- Claim: kept gathers now skip the CLI's own files as summaries do: false; summaries keep checking the CLI's
node_modules(inCliBuild,gather-cache.mjs:1266) and the new skip does not (gather-cache.mjs:665). - Claim: every other path is checked as before: verified (
gather-cache.mjs:661-669; unit suites pass). - Claim: the CLI's real folder joins every entry key for gathers, summaries and derived values: verified (
entryKey,gather-cache.mjs:607-618). - Claim: entries still store the CLI's own states and search's entry table stamps its code inputs: verified (
api/search/_entries.mjs:86). - Claim: a source checkout keeps nothing: verified (
buildId,gather-cache.mjs:245-256;postpackremoves the id). - Claim: profile table and the 51-case output battery: unverified, not reproduced.
- Claim: the listed tests cover the copy, the patched copy, the in-place edit, the reinstall, the deps rows and doctor's row: verified by reading; the packed-CLI tests run in CI.
- Claim: no output, flag or JSON change except doctor's row: verified.
- Changeset: about 10 ms sooner: unverified (measurement); no per-file check of the CLI's own files, own entries for a copy in another folder, in-place edits unsupported, deleting the cache folder clears it: verified; "Output does not change": false (doctor's row).
- File
.changeset/kept-gathers-cli-own-files.md: finding (output claim). - File
docs/specs/AST-081-global-mode/spec.md: FR7 wording awaits owner approval. - File
packages/cli/api/doctor/doctor.mjs: clear. - File
packages/cli/foundation/fs/gather-cache.mjs: finding (node_modulesskip); two doc comments still describe the old behaviour (non-blocking). - File
packages/cli/foundation/fs/gather-cache.deps.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.changes.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.installed.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.records.test.mjs: clear.
…d); changeset names doctor's row
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on the spec:AST-081 FR7 rewording; the code needs nothing more.
Both earlier findings are fixed: the stale check now skips only the CLI's own published files, so packages in the CLI's own node_modules stay checked, and the changeset names doctor's cache row. At this head FR7 makes the CLI's real folder stand beside the build id for the CLI's own files and adds copies in another folder and clearing astryx/catalogs; an engineering owner records approval of that wording by commenting /approve-spec with the full head commit SHA on this pull request, and the author may do so as an engineering owner. Non-blocking: two doc comments (gather-cache.mjs:174-178, :1042-1043) and the file header's @output (:9-13) still describe the old per-file check of the CLI's own files.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claim: most paths a kept entry checks are the CLI's own files, costing about 10 ms per read: unverified, measurement not reproduced.
- Claim: the cache record already lets the build id stand for the CLI's own files, with in-place edits unsupported: verified (FR7).
- Claim: summaries already skip the CLI's own files: verified (
gather-cache.mjs:1287). - Claim: kept gathers now skip the CLI's own files by the summaries' rule and still check packages in the CLI's own
node_modules: verified (gather-cache.mjs:666;gather-cache.deps.test.mjs:246-277). - Claim: every entry key holds the CLI's real folder, worked out once per process, for gathers, summaries and derived values: verified (
gather-cache.mjs:596-618,:1063-1064,:1203-1204). - Claim: entries still store the CLI's own states, so derived values' code digest is unchanged, and search's entry table still stamps its code inputs: verified (
gather-cache.mjs:980-984;api/search/_entries.mjs:80-87). - Claim: a source checkout keeps nothing, since only
prepackwrites the build id andpostpackremoves it: verified (gather-cache.mjs:245-256;packages/cli/package.jsonscripts). - Claim: the profile table and the 51-case output comparison: unverified, not reproduced.
- Claim: the copy test fails when the key lacks the folder: verified (it fails at
packed-gather-cache.changes.test.mjs:94without the folder). - Claim: the installed-CLI test covers the patched copy, the in-place edit and the reinstall, and fails when the CLI's own paths are checked: verified (it fails at
packed-gather-cache.installed.test.mjs:290without the skip). - Claim: the cache unit test reads back an in-place edit to the CLI's files, gathers again after a nested-package edit, and fails when the whole folder is skipped: verified (it fails with the earlier prefix skip).
- Claim: doctor's cache row states the policy: verified (
doctor.mjs:2341;packed-gather-cache.records.test.mjs:78). - Claim: the listed suites pass: verified for the cache unit suites and the three changed packed-CLI suites; the doctor, search, component, docs, discovery and build suites were not run.
- Claim: FR7's before and after text, and no output, flag or JSON change apart from doctor's row: verified.
- Changeset: about 10 ms sooner: unverified (measurement); no per-file check of the CLI's own files, own entries for a copy in another folder, in-place edits unsupported, deleting the cache folder clears it, nested
node_modulesstill checked, output unchanged apart from doctor's row: verified. - File
.changeset/kept-gathers-cli-own-files.md: clear. - File
docs/specs/AST-081-global-mode/spec.md: FR7 wording awaits an engineering owner's approval. - File
packages/cli/api/doctor/doctor.mjs: clear. - File
packages/cli/foundation/fs/gather-cache.mjs: non-blocking stale comments. - File
packages/cli/foundation/fs/gather-cache.deps.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.changes.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.installed.test.mjs: clear. - File
packages/cli/test/packed-gather-cache.records.test.mjs: clear.
PR Analysis Report🔎 Preview ·
|
|
/approve-spec 47cd639 |
|
/approve-spec c3ad841 |
There was a problem hiding this comment.
Approved pending CI: the heavy test jobs have not run on this head yet.
An engineering owner approved the spec:AST-081 FR7 rewording for this exact head, so every change now has spec authority, and nothing blocks. One non-blocking cleanup remains in packages/cli/foundation/fs/gather-cache.mjs: the header's @output (lines 9-13) and the comments at lines 174-178 and 1041-1046 still say an edit to the CLI's own files misses the kept gather, while the build id and folder now stand for those files.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claims (description):
- Verified: the cache record already lets the build id stand for the CLI's own files, and summaries already skip them (
gather-cache.mjs:1287). - Verified: an entry's check skips the CLI's own files by the summaries'
inCliBuildrule (gather-cache.mjs:666,:1267-1272). - Verified: a package in the
node_modulesfolder inside the CLI's is still checked (gather-cache.deps.test.mjs:246-277). - Verified: every entry key holds the CLI's real folder beside the build id, resolved once per process, for gathers, summaries and derived values (
gather-cache.mjs:588-618). - Verified: entries still store the CLI's own states, so derived-value digests are unchanged, and search's entry table stamps its code inputs at each read (
gather-cache.mjs:983-984,:1414-1415;api/search/_entries.mjs:80-87). - Verified: a source checkout keeps nothing, since the build id exists only between
prepackandpostpack(gather-cache.mjs:249;packages/cli/package.json:123-124). - Not reproduced (author's measurements): the profile table, the 10 ms saving and the 51-case output comparison.
- Verified: the copy-in-another-folder test passes, and it fails when the key lacks the folder (
packed-gather-cache.changes.test.mjs:83-97). - Verified: the docs-tree test covers a patched copy, an in-place edit and a new build id, and it fails when the CLI's own paths are checked (
packed-gather-cache.installed.test.mjs:267-301). - Verified: the deps tests cover the in-place edit and the nested package and fail when the whole folder is skipped; their edited files now sit outside the CLI's folder (
gather-cache.deps.test.mjs:50,:246-277,:353). - Verified: doctor's cache row states the policy (
packed-gather-cache.records.test.mjs:78). - Verified: the kept-gather, fs, doctor, search, component, docs, discovery and build suites pass on this head.
- Verified: FR7's before and after text and doctor's row change as described (
spec.md:415,doctor.mjs:2341). - Verified: no output, flag or JSON shape changes beyond doctor's row, and deleting the per-user
astryx/catalogsfolder clears what was kept (gather-cache.mjs:263-265).
- Verified: the cache record already lets the build id stand for the CLI's own files, and summaries already skip them (
- Claims (changeset):
- Not reproduced (author's measurement): kept commands finish about 10 ms sooner in a project with an integration.
- Verified: a kept gather no longer checks the CLI's own files one by one, and a copy in another folder keeps its own entries.
- Verified: in-place edits stay unsupported, deleting
astryx/catalogsclears what was kept, and a package in the CLI's ownnode_modulesis still checked. - Verified: output changes only in doctor's cache row, which now names the folder.
- Files:
.changeset/kept-gathers-cli-own-files.md: clear.docs/specs/AST-081-global-mode/spec.md: clear (owner-approved FR7).packages/cli/api/doctor/doctor.mjs: clear.packages/cli/foundation/fs/gather-cache.mjs: non-blocking stale comments.packages/cli/foundation/fs/gather-cache.deps.test.mjs: clear.packages/cli/test/packed-gather-cache.changes.test.mjs: clear.packages/cli/test/packed-gather-cache.installed.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
…-files # Conflicts: # packages/cli/api/doctor/doctor.mjs # packages/cli/foundation/fs/gather-cache.mjs
|
/approve-spec 23228e8 |
There was a problem hiding this comment.
Approved pending CI: the CI workflow's test jobs were cancelled at this head because CI was full, so they need a re-run before merge.
An engineering owner approved the spec:AST-081 FR7 rewording for this exact head, and the merge of main keeps both sides of its two conflicts (doctor's cache row and the gather-cache.mjs header).
Optional: the doc comments at gather-cache.mjs lines 174-180 and 1043-1047, and the file header's @output, still say an edit to the CLI's own files misses a kept gather; rewording them to say the build id and folder stand for those files would keep them accurate.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0).
- Claims:
- The entry check skips the CLI's own files by the rule summaries already use (under its folder, outside the
node_modulesinside it): verified,gather-cache.mjs:667,:1268-1273. - A package in the
node_modulesfolder inside the CLI's is still checked: verified,gather-cache.deps.test.mjs:276. - Every entry key holds the CLI's real folder beside the build id, resolved once per process, for gathers, summaries and derived values: verified,
gather-cache.mjs:597-599,:612,:931,:1065,:1205. - Entries still store the CLI's own states, so the code digest derived values key on is unchanged: verified,
gather-cache.mjs:985,:1030-1036. - Search's entry table still stamps its code inputs at each read: verified,
api/search/_entries.mjs:80-87. - A source checkout keeps nothing, since the build id exists only in an installed package and is written at prepack and removed at postpack: verified,
gather-cache.mjs:246-257,scripts/generate-build-id.mjs:74-76. - Most of an entry's paths are the CLI's own files, and warm reads are about 10 ms faster: not reproduced; the author's profile.
- A battery over every command printed the same output as
main: not reproduced; the author's run. - A copy installed in another folder keeps its own entries, and the test fails without the folder in the key: verified,
packed-gather-cache.changes.test.mjs:83-97, fails at:94without it. - A patched copy sees its edit, an in-place edit keeps the kept docs tree, and a new build id gathers again; the test fails when the CLI's own paths are checked: verified,
packed-gather-cache.installed.test.mjs:270-301, fails at:290with the skip removed. - An in-place edit to a CLI file is read back, a nested package edit gathers again, the rows' files sit outside the CLI's folder, and the derived value is keyed by its source: verified,
gather-cache.deps.test.mjs:50,:246-277,:353. - Doctor's cache row states the policy: verified,
packed-gather-cache.records.test.mjs:80-82,doctor.mjs:2346. - The kept-gather, fs, doctor, search, component, docs, discovery and build suites pass: partly verified; the kept-gather, packed-catalog and doctor suites pass at this head, and CI's test jobs did not run.
- The FR7 before and after text matches the record edit and needs an engineering owner's approval: verified,
docs/specs/AST-081-global-mode/spec.md:422; approved for this head. - No output, flag or JSON shape changes beyond doctor's row, in-place edits are no longer seen, and deleting
astryx/catalogsclears what was kept: verified,doctor.mjs:2346,gather-cache.mjs:264-266. - The writing rubric reports nothing for the FR7 sentence: verified; it carries no narration, research, evidence, alternatives, references, questions or status.
- Changeset: kept commands in an integration project finish about 10 ms sooner: not reproduced; the author's measurement.
- Changeset: a kept gather no longer checks the CLI's own files one by one, the build id and folder stand for them, and a copy in another folder keeps its own entries: verified, as above.
- Changeset: in-place edits stay unsupported, deleting the catalogs folder clears what was kept, and nested packages are still checked: verified, as above.
- Changeset: output is unchanged except doctor's row, which now names the folder: verified,
doctor.mjs:2346.
- The entry check skips the CLI's own files by the rule summaries already use (under its folder, outside the
- Files:
.changeset/kept-gathers-cli-own-files.md: clear.docs/specs/AST-081-global-mode/spec.md: clear; owner-approved for this head, no approval line changed.packages/cli/api/doctor/doctor.mjs: clear; the merge keeps both phrases.packages/cli/foundation/fs/gather-cache.mjs: code clear; non-blocking stale comments at lines 9-13, 174-180 and 1043-1047.packages/cli/foundation/fs/gather-cache.deps.test.mjs: clear.packages/cli/test/packed-gather-cache.changes.test.mjs: clear.packages/cli/test/packed-gather-cache.installed.test.mjs: clear.packages/cli/test/packed-gather-cache.records.test.mjs: clear.
Summary
In a project with an integration, most commands read back what earlier runs kept (the project's issues, the integration's themes and check results, component replacements). Checking such an entry stats every path its gather read, and most of those paths are the CLI's own files. In a project with one large integration, 2,625 of an entry's 3,953 paths are the CLI's templates, docs and code modules. That is about 10 ms of every such run spent proving the CLI is the CLI it was.
The per-user cache record already says the CLI's build id stands for the installed CLI's own files, with in-place edits to an installed CLI not supported. Summaries already work that way. Kept gathers now do too:
foundation/fs/gather-cache.mjs: an entry's check skips the CLI's own files, by the rule summaries already use (inCliBuild: under the CLI's folder, outside thenode_modulesfolder inside it). A package placed in thatnode_modulesfolder is not part of the build and is checked as before, like every other path.prepackand removed atpostpack.Evidence
Profile of a warm
component Buttonin a project with one large integration, 10 runs each:staleReason)confirmedEntryA 51-case battery over every command in two projects (one with an integration, one with only Core) printed the same stdout and stderr, with the same exit code, as main for every case. The cases that read back kept entries were 10–30 ms faster in the integration project.
Tests
test/packed-gather-cache.changes.test.mjs: a copy of the same CLI installed in another folder keeps its own entries, with output equal to a fresh run. It fails when the key lacks the folder.test/packed-gather-cache.installed.test.mjs, the CLI's own docs tree:foundation/fs/gather-cache.deps.test.mjs:node_modulesfolder inside the CLI's is gathered again (fails when the whole folder is skipped);test/packed-gather-cache.records.test.mjs: doctor's cache row states the policy.Spec changes
spec:AST-081FR7:astryx/catalogsfolder clears what was kept)."Doctor's cache row changes the same way. This needs an engineering owner's
/approve-spec.Writing rubric results
For the FR7 change:
Scope
No output, flag or JSON shape changes, except doctor's cache-row text above. An in-place edit to an installed CLI, under the same build id and folder, is no longer seen by kept gathers, as the record already says. Deleting the per-user
astryx/catalogsfolder clears what was kept.