Skip to content

test(cli): the kept-store search catalog case skips on a Node without module.registerHooks - #11835

Merged
cixzhang merged 7 commits into
mainfrom
test/search-catalog-skip-no-hooks
Nov 17, 2026
Merged

cixzhang merged 7 commits into
mainfrom
test/search-catalog-skip-no-hooks

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Who this helps

Anyone reading the daily "CLI on minimum Node" run. On the CLI's oldest supported Node (22.13.0), one case in packages/cli/test/packed-search-catalog.test.mjs fails, so the run reports the CLI as failing on that Node although the CLI works there as designed (run 43675632186, job cli-tests (4/4)):

the stored search catalog › keeps a reference to the store, not a copy, and reads it back byte for byte
AssertionError: expected [] to have a length of 1 but got +0

What changes

This re-cuts #11832's change (thanks to that change for the diagnosis and the fix) line for line on current main. The file also carries what main added since #11832's head (2d86ad8): the unready-template case and two ASKS rows.

  • packages/cli/test/packed-search-catalog.test.mjs: the case that reads a kept gather entry skips on a Node without module.registerHooks (it.skipIf(!hasModuleHooks)). hasModuleHooks is the shared guard from packages/cli/test-utils/packed-gather-cache-fixture.mjs (typeof module.registerHooks === 'function'), which the other kept-entry tests import, so a change to the CLI's keep condition is fixed in one place. The CLI keeps gathers only through those hooks, which Node has from 22.15 and 23.5. On an older Node it gathers fresh each run and writes no kept entry, by design.
  • The guard tests the feature, not a version number, as the other kept-entry cases do (packed-gather-cache.*.test.mjs, gather-cache.test.mjs).
  • Also: macOS (the change from test(cli): packed search catalog test reads the kept folder where the CLI keeps it on macOS #11834, folded in as a separate commit). The same case gives its run a home of its own and reads the kept folder through userCacheDir, because macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME. Without it the case fails on every Mac with ENOENT on $XDG_CACHE_HOME/astryx/catalogs.
  • Unchanged: on a Node that has the hooks, the case and its assertions are the same. The fresh gather on an older Node is already covered by packed-gather-cache.records.test.mjs ("a Node without module.registerHooks").

Evidence

  • Node 22.13.0 (no module.registerHooks), the file alone in the node project, with current main merged in: 11 passed, 1 skipped (the kept-entry case, skipped by this change). Run 43675632186's cli-tests (4/4) failed that case on the same Node before the change.
  • Node with the hooks, on macOS: the whole file passes 12 of 12 on Node 26.7.0 (it was 11 passed, 1 failed, the kept-entry case with ENOENT, before the macOS commit); the changed case also passes on Node 24.22.1. On Linux CI the case reads the same folder it read before.

CI impact: none: one test file's case skips on Node 22.13 only. No job, runner or time-to-green change.

Overlap check

Searched open pull requests for packages/cli/test/packed-search-catalog.test.mjs: #11832, which this re-cut supersedes, and #11834, a separate fix in the same case (it reads the kept folder where the CLI keeps it on macOS). The two meet in the same lines: this change wraps the case in it.skipIf, so whichever lands second merges the other.

Overlap checked: #11832, #11834 (#11832: the same skip change, re-cut line for line on current main, which this one supersedes; #11834: its macOS cache-folder change is folded in here as a separate commit, so this one supersedes it too)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard.

… module.registerHooks

Re-cut of #11832, byte for byte. The CLI keeps a gather only through module.registerHooks (Node 22.15 and 23.5 on); on its oldest supported Node it gathers fresh each run and keeps no entry, so the case that reads a kept entry skips there, as the other kept-entry cases do.
@vercel

vercel Bot commented Nov 15, 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 17, 2026 6:32am UTC

Request Review

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

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 6:30 AM UTC

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · cdb5031

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; 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

@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 skip is right: on Node 22.13 the file runs 10 cases and skips the kept-reference case, and on Node 24 all 11 pass. Two points remain, and one change fixes both.

  • packages/cli/test/packed-search-catalog.test.mjs lines 13 and 31-36 declare hasModuleHooks again, though packages/cli/test-utils/packed-gather-cache-fixture.mjs already exports it for the other kept-entry tests: import it (import {hasModuleHooks} from '../test-utils/packed-gather-cache-fixture.mjs';) and drop the local guard, its comment and the node:module import.
  • The description calls this a byte-for-byte re-cut of #11832, but the file matches only #11832's first commit, and #11832's current head already imports the shared guard: take that version (which makes the claim true) or correct the description.
Claims and files checked

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

  • Claim: the scheduled minimum-Node CLI run fails this case on Node 22.13. Verified: its failure annotation at line 261 of the base file.
  • Claim: this is #11832 re-cut byte for byte, with an identical file. False: it matches #11832's first commit, not its head, which imports the shared guard.
  • Claim: the case skips through it.skipIf(!hasModuleHooks), a typeof module.registerHooks check. Verified: lines 35-36 and 259.
  • Claim: the CLI keeps gathers only through those hooks, and otherwise gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 335 and 1222.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0; present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the CLI's oldest supported Node is 22.13. Verified: the engines field in packages/cli/package.json.
  • Claim: the guard tests the feature, as the other kept-entry cases do. Verified for the feature check; those cases import the shared export that this file copies.
  • Claim: on a Node with the hooks, the case is unchanged. Verified: the body is only re-indented, and Node 24.20.0 passes all 11 cases.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 633-646.
  • Claim: Node 22.13.0 gives 10 passed, 1 skipped. Verified by running the file.
  • Claim: on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60.
  • Claim: no CI job, runner or timing change. Verified: only one test file changes.
  • Claim: #11834 is a separate macOS fix in the same case. Verified from its diff.
  • File packages/cli/test/packed-search-catalog.test.mjs: the two findings above; otherwise consistent with the shared fixture and the CLI code it tests.

Automated review (maintainer link)

Takes #11832's head: the case uses hasModuleHooks from the gather-cache test fixture, as the other kept-entry tests do, instead of a local copy.

@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, because the pull request is a draft, and it runs once the pull request is marked ready for review. Both points from the last review are fixed: the case imports the shared hasModuleHooks guard, and the file is byte-identical to #11832's head. On Node 22.13.0 the file gives 10 passed and 1 skipped, and on Node 24.20.0 all 11 pass. #11834 edits the same lines, so whichever lands second needs a merge.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: on Node 22.13 the scheduled minimum-Node CLI run fails this case. Verified: that run's fourth leg reports expected [] to have a length of 1 at line 261 of the base file.
  • Claim: this re-cuts #11832 byte for byte, and the file is identical to #11832's head. Verified: the two files are byte-identical.
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 252.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 482-483, imported by the packed-gather-cache.* suites and here at line 25.
  • Claim: the CLI keeps gathers only through those hooks, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 335 and 1222.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0; present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: those suites and gather-cache.test.mjs line 21 check typeof registerHooks.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: the body is only re-indented, and Node 24.20.0 passes all 11 cases.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 633-646, on Linux.
  • Claim: Node 22.13.0 gives 10 passed, 1 skipped. Verified by running the file.
  • Claim: a Node with the hooks runs the case on Linux, while on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60, and the case passes on Linux with Node 24.20.0.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes, and the minimum-Node legs are the only CI runs on a Node without the hooks.
  • Claim: #11834 is a separate fix for the macOS cache folder in the same case. Verified from its diff.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear. It is consistent with the shared fixture and the CLI code it tests.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one description fix; the code needs no change. On Node 22.13.0 the base file fails the kept-reference case and the head skips it (11 passed, 1 skipped), and on Node 24.20.0 all 12 cases pass. The earlier point about the shared guard stays fixed.

  • The description says the file is identical to #11832's head, but after the merge of main it has 44 more lines (main's unready-template case and two ASKS rows) and its Node 22.13.0 tally of 10 passed, 1 skipped predates them, so please say instead that this re-cuts #11832's change line for line on current main and that the file now gives 11 passed, 1 skipped.

#11834 edits the same case, so whichever lands second needs a merge.

Claims and files checked

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

  • Claim: on Node 22.13.0 the scheduled minimum-Node CLI run fails this one case with expected [] to have a length of 1. Verified: that run's fourth leg reports it, and the base file fails the same way on Node 22.13.0.
  • Claim: this re-cuts #11832 byte for byte, and the file is identical to #11832's head. False at this head: the patch is #11832's line for line, but the merge of main added 44 lines to the file.
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 296.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 25 and by 17 other test files.
  • Claim: the CLI keeps gathers only through those hooks, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 369-370 and 1058.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0, present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites and gather-cache.test.mjs line 21 check typeof registerHooks.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: a whitespace-insensitive diff leaves only the wrapper lines, and Node 24.20.0 passes all 12 cases.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-670, on Linux.
  • Claim: Node 22.13.0 gives 10 passed, 1 skipped. Outdated at this head: the file now has 12 cases and gives 11 passed, 1 skipped.
  • Claim: the case needs Linux, because on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60.
  • Claim: no CI job, runner or time-to-green change, and in CI only Node 22.13 skips. Verified: only one test file changes, CI's regular Node 24.22.1 has the hooks, and only the minimum-Node run uses 22.13.0.
  • Claim: #11832 is the same change, and #11834 is a separate macOS cache-folder fix in the same lines. Verified from both diffs.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear in code; consistent with the shared fixture and the CLI code it tests. The description claim above is the one finding.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review. The description now matches the head: it re-cuts #11832's change line for line on current main, and on Node 22.13.0 the file gives 11 passed and 1 skipped, while on Node 24.20.0 all 12 cases pass. #11834 edits the same case, so whichever lands second needs a merge.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: on Node 22.13.0 the scheduled minimum-Node CLI run fails this one case with expected [] to have a length of 1. Verified: that run's fourth CLI test leg failed, and the base file fails the same case on Node 22.13.0.
  • Claim: this re-cuts #11832's change line for line on current main. Verified: the added and removed lines equal #11832's against its own merge base.
  • Claim: the file also carries what main added since #11832's head, the unready-template case and two ASKS rows. Verified: those are the only lines that differ from the file at #11832's head (lines 219-220 and 240-280).
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 296.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 25 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 369-370 and 1058.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0, present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it and gather-cache.test.mjs lines 20-21 check typeof registerHooks.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: the patch changes only the wrapper lines and indentation, and Node 24.20.0 passes all 12 cases.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-670, on Linux.
  • Claim: on Node 22.13.0 the file gives 11 passed, 1 skipped. Verified: 11 passed, 1 skipped of 12.
  • Claim: the case needs Linux, because on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60.
  • Claim: this pull request's own CI run is the check on a Node with the hooks. Pending: CI is skipped while the pull request is a draft; the review's own Node 24.20.0 run passes all 12 cases.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes, CI's regular Node 24.22.1 has the hooks, and only the minimum-Node run uses 22.13.0.
  • Claim: #11832 is the same change, which this supersedes, and #11834 is a separate macOS cache-folder fix in the same case. Verified from both diffs.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear; consistent with the shared fixture and the CLI code it tests.

Automated review (maintainer link)

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft; it runs once the pull request is marked ready for review. The newest merge of main leaves the change line for line as before, and on Node 22.13.0 the file gives 11 passed and 1 skipped, while on Node 24.20.0 all 12 cases pass. #11834 edits the same case, so whichever lands second needs a merge.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: on the oldest supported Node (22.13.0) the scheduled minimum-Node run fails this one case with expected [] to have a length of 1. Verified: that run's fourth CLI test leg failed on exactly this case and assertion, and the base file fails it the same way on Node 22.13.0.
  • Claim: this re-cuts #11832's change line for line on current main. Verified: the added and removed lines equal #11832's against its own merge base.
  • Claim: the file also carries what main added since #11832's head, the unready-template case and two ASKS rows. Verified: those are the only lines that differ from the file at #11832's head (lines 219-220 and 240-288, the case now in main's latest form).
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 303.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 25 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 370-371 and 1072-1073, still so after the newest main merge.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0, present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it and foundation/fs/gather-cache.test.mjs lines 20-21 check typeof registerHooks.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: a whitespace-insensitive diff shows only the import and wrapper lines, and Node 24.20.0 passes the case.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-659, on Linux.
  • Claim: on Node 22.13.0 the file alone gives 11 passed, 1 skipped. Verified: 11 passed, 1 skipped of 12 at this head.
  • Claim: the case needs Linux, because on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60.
  • Claim: this pull request's own CI run is the check on a Node with the hooks. Pending: CI is skipped while the pull request is a draft; the review's own Node 24.20.0 run passes all 12 cases.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes, only the minimum-Node workflow runs Node 22.13.0, and the rest of CI uses Node 24.22.1, which has the hooks.
  • Claim: #11832 is the same change, which this supersedes, and #11834 is a separate macOS cache-folder fix in the same case. Verified: both are open, and their diffs show it.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear; consistent with the shared fixture and the CLI code it tests.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one description fix; the code needs no change. On Node 22.13.0 the base file fails the kept-reference case and the head skips it, and on Node 24.20.0 all 12 cases pass. #11834 edits the same case, so whichever lands second needs a merge.

  • The Evidence bullet says the file gives "12 of 12 skipped" on Node 22.13.0 with the other cases skipped "by main's own guards", but it.skipIf(!hasModuleHooks) at line 303 is the file's only skip and the head gives 11 passed and 1 skipped there, so please change it to "11 passed, 1 skipped (the kept-entry case, skipped by this change)".
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: on the oldest supported Node (22.13.0) the scheduled minimum-Node run fails this one case with expected [] to have a length of 1. Verified: the cited run's fourth CLI test leg failed on exactly this case and assertion, and the base file fails it the same way on Node 22.13.0.
  • Claim: this re-cuts #11832's change line for line on current main. Verified: the added and removed lines equal #11832's.
  • Claim: the file also carries what main added since #11832's head, the unready-template case and two ASKS rows. Verified: those are the only lines that differ from the file at #11832's head (lines 219-220 and 240-288).
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 303.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 25 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 374-375, 1077 and 1145, still so after the newest main merge.
  • Claim: Node has the hooks from 22.15 and 23.5. Verified: absent on 22.13.0, 22.14.0 and 23.4.0, present on 22.15.0, 23.5.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it and foundation/fs/gather-cache.test.mjs lines 17-21 check typeof registerHooks.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: a whitespace-insensitive diff shows only the import and wrapper lines, and Node 24.20.0 passes the case.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-671, on Linux.
  • Claim: on Node 22.13.0 the file alone, with current main merged in, gives 12 of 12 skipped, the other cases by main's own guards. False: line 303 is the file's only skip, and the head gives 11 passed and 1 skipped of 12.
  • Claim: the cited run's fourth leg failed the case on the same Node before the change. Verified: its annotation names this case and assertion.
  • Claim: the case needs Linux, because on macOS the CLI caches under ~/Library/Caches/astryx and ignores XDG_CACHE_HOME. Verified: foundation/env/user-dirs.mjs line 60.
  • Claim: this pull request's own CI run is the check on a Node with the hooks. Pending: CI is skipped while the pull request is a draft; Node 24.20.0 passes all 12 cases at this head.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes, only the minimum-Node workflow runs Node 22.13.0, and the rest of CI uses Node 24.22.1, which has the hooks.
  • Claim: #11832 is the same change, which this supersedes, and #11834 is a separate macOS cache-folder fix in the same case. Verified: both are open, and their diffs show it.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear; consistent with the shared fixture and the CLI code it tests.

Automated review (maintainer link)

… the CLI keeps it on macOS

macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME, so the case gives its run a home of its own and reads the kept folder through userCacheDir. The same change as #11834, folded in here so the case passes on macOS too.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one description fix; the code needs no change. On Node 22.13.0 the scheduled run failed the kept-reference case and this head skips it (11 passed, 1 skipped); on Node 24.20.0 all 12 cases pass, and the new macOS commit reads the kept folder where the CLI keeps it on macOS.

  • The Evidence bullet says the file gives "12 of 12 skipped" on Node 22.13.0 with the other cases skipped "by main's own guards", but it.skipIf(!hasModuleHooks) at line 304 is the file's only skip and the head gives 11 passed and 1 skipped there, so please change it to "11 passed, 1 skipped (the kept-entry case, skipped by this change)".
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: on the CLI's oldest supported Node (22.13.0) the scheduled minimum-Node run fails this one case with expected [] to have a length of 1. Verified: the cited run's fourth CLI test leg failed on exactly this case and assertion, and the CLI's engines field names Node 22.13.0 as its minimum.
  • Claim: this re-cuts #11832's change line for line on current main, and the file also carries what main added since #11832's head (the unready-template case and two ASKS rows). Verified: against #11832's head the file differs only by those lines (219-220 and 241-288) and the macOS commit's lines.
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 304.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 26 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, which Node has from 22.15 and 23.5, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 374-375; the hooks are absent on Node 22.13.0 and 22.14.0 and present on 22.15.0 and 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it and foundation/fs/gather-cache.test.mjs lines 20-21 check typeof registerHooks.
  • Claim: macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME, so the case gives its run a home of its own and reads the kept folder through userCacheDir; without it the case fails on every Mac with ENOENT. Verified from the code: foundation/env/user-dirs.mjs line 60, and the CLI keeps catalogs under userCacheDir() (gather-cache.mjs line 270); not run on macOS here.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: the assertions are identical, the setup differs only by the macOS lines the previous claim describes, and Node 24.20.0 passes the case.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-671, on Linux.
  • Claim: on Node 22.13.0 the file alone gives 12 of 12 skipped, the other cases by main's own guards. False: line 304 is the file's only skip, and the head gives 11 passed and 1 skipped of 12.
  • Claim: the cited run's fourth leg failed the case on the same Node before the change. Verified: its annotation names this case and assertion.
  • Claim: on macOS the whole file passes on Node 26.7.0 (one ENOENT failure before the macOS commit), and the changed case passes on Node 24.22.1. Not checkable here: no macOS run; consistent with user-dirs.mjs line 60, and on Linux Node 24.20.0 all 12 cases pass.
  • Claim: on Linux CI the case reads the same folder it read before. Verified: with an absolute XDG_CACHE_HOME, userCacheDir returns <cache>/astryx (user-dirs.mjs lines 61-64), the folder the base read.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes; only the minimum-Node workflow runs Node 22.13.0, and the rest of CI runs Node 24.22.1, which has the hooks.
  • Claim: #11832 (the same skip change) and #11834 (the macOS change) are both superseded, and whichever lands second merges the other. Verified: both are open, the skip equals #11832's lines and the macOS commit equals #11834's patch apart from indentation; whether any other open pull request touches the file was not enumerated.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: one finding (the description's evidence claim above); the code is consistent with the shared fixture, user-dirs.mjs and the CLI's keep condition.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft; it runs once the pull request is marked ready for review.

The kept-reference case now skips only where the CLI keeps no gather (a Node without module.registerHooks) and reads the kept folder through the CLI's own userCacheDir. The corrected Evidence bullet (11 passed, 1 skipped on Node 22.13.0) matches the head, and on Node 24.20.0 all 12 cases pass. Nothing else needs to change.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: on the CLI's oldest supported Node (22.13.0) the minimum-Node workflow fails this one case with expected [] to have a length of 1. Verified: the cited run's fourth CLI test leg failed on exactly this case and assertion, and the CLI's engines field names Node 22.13.0 as its minimum.
  • Claim: this re-cuts #11832's change line for line on current main, and the file also carries what main added since #11832's head (the unready-template case and two ASKS rows). Verified: against #11832's head the file differs only by those lines (220-221 and 241-288) and the macOS commit's lines.
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 304, the file's only skip.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import, so a change to the keep condition is fixed in one place. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 26 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, which Node has from 22.15 and 23.5, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 374-375; the hooks are absent on Node 22.13.0 and present on Node 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it, and foundation/fs/gather-cache.test.mjs lines 17-23 check typeof registerHooks.
  • Claim: macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME, so the case gives its run a home of its own and reads the kept folder through userCacheDir; without it the case fails on every Mac with ENOENT. Verified from the code: foundation/env/user-dirs.mjs line 60, and the CLI keeps catalogs under userCacheDir() (gather-cache.mjs line 270); not run on macOS here.
  • Claim: the macOS change is #11834's change, folded in as a separate commit. Verified: the last commit's patch equals #11834's apart from indentation.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: the assertions are identical, the setup differs only by the macOS lines, and Node 24.20.0 passes the case.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-671, on Linux.
  • Claim: on Node 22.13.0 the file alone gives 11 passed and 1 skipped, the skip being the kept-entry case, and the cited run failed that case on the same Node before the change. Verified: 11 passed and 1 skipped of 12 on Node 22.13.0, and the run's annotation names this case.
  • Claim: on macOS the whole file passes on Node 26.7.0 (one ENOENT failure before the macOS commit), and the changed case passes on Node 24.22.1. Not checkable here: no macOS run; consistent with user-dirs.mjs line 60, and on Linux Node 24.20.0 all 12 cases pass.
  • Claim: on Linux CI the case reads the same folder it read before. Verified: with an absolute XDG_CACHE_HOME, userCacheDir returns <cache>/astryx (user-dirs.mjs lines 61-64), the folder the base read.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes; only the minimum-Node workflow runs Node 22.13.0, and the rest of CI runs Node 24.22.1, which has the hooks.
  • Claim: #11832 and #11834 are both superseded, and whichever lands second merges the other. Verified: both are open, the skip equals #11832's lines and the macOS commit equals #11834's patch apart from indentation.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear; consistent with the shared fixture, user-dirs.mjs and the CLI's keep condition.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 03:43
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 04:46
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 04:46
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 06:17

@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 because the pull request is a draft; it runs once the pull request is marked ready for review.

This head only merges main, which touches none of this pull request's files, so the change is the one already reviewed: the kept-reference case skips only where the CLI keeps no gather (a Node without module.registerHooks) and reads the kept folder through the CLI's own userCacheDir. Nothing else needs to change.

Claims and files checked

Review mode: carry-forward; reason: none

  • changed rules (0): none
  • Claim: on the CLI's oldest supported Node (22.13.0) the minimum-Node workflow fails this one case with expected [] to have a length of 1. Verified: the cited run's fourth CLI test leg failed on exactly this case and assertion, and the CLI's engines field names Node 22.13.0 as its minimum.
  • Claim: this re-cuts #11832's change line for line on current main, and the file also carries what main added since #11832's head (the unready-template case and two ASKS rows). Verified: against #11832's head the file differs only by those lines (220-221 and 241-288) and the macOS commit's lines, and this head sits on the tip of main.
  • Claim: the case skips through it.skipIf(!hasModuleHooks). Verified: line 304, the only skip among the file's 12 cases.
  • Claim: hasModuleHooks is the shared typeof module.registerHooks === 'function' guard that the other kept-entry tests import, so a change to the keep condition is fixed in one place. Verified: test-utils/packed-gather-cache-fixture.mjs lines 522-523, imported here at line 26 and by the packed-gather-cache.* suites.
  • Claim: the CLI keeps gathers only through those hooks, which Node has from 22.15 and 23.5, and on an older Node gathers fresh and keeps no entry. Verified: foundation/fs/gather-cache.mjs lines 374-375; the hooks are absent on Node 22.13.0 and present on Node 24.20.0.
  • Claim: the guard tests the feature, not a version number, as the other kept-entry cases do. Verified: the packed-gather-cache.* suites import it, and foundation/fs/gather-cache.test.mjs lines 17-23 check typeof registerHooks.
  • Claim: macOS keeps the user cache under HOME and ignores XDG_CACHE_HOME, so the case gives its run a home of its own and reads the kept folder through userCacheDir; without it the case fails on every Mac with ENOENT. Verified from the code: foundation/env/user-dirs.mjs line 60, and the CLI keeps catalogs under userCacheDir() (gather-cache.mjs line 270); not run on macOS.
  • Claim: the macOS change is #11834's change, folded in as a separate commit. Verified: that commit's patch equals #11834's apart from indentation.
  • Claim: on a Node with the hooks, the case and its assertions are unchanged. Verified: the assertions are identical, the setup differs only by the macOS lines, and Node 24.20.0 passes the case on this patch.
  • Claim: the records test already covers the fresh gather on an older Node. Verified: packed-gather-cache.records.test.mjs lines 658-671, on Linux.
  • Claim: on Node 22.13.0, with current main merged in, the file alone gives 11 passed and 1 skipped, the skip being the kept-entry case, and the cited run failed that case on the same Node before the change. Verified on this patch: 11 passed and 1 skipped of 12 on Node 22.13.0; the latest merge of main changes none of the files this pull request changes or the test imports, and the run's annotation names this case.
  • Claim: on macOS the whole file passes on Node 26.7.0 (one ENOENT failure before the macOS commit), and the changed case passes on Node 24.22.1. Not checkable here: no macOS run; consistent with user-dirs.mjs line 60, and on Linux Node 24.20.0 all 12 cases pass on this patch.
  • Claim: on Linux CI the case reads the same folder it read before. Verified: with an absolute XDG_CACHE_HOME, userCacheDir returns <cache>/astryx (user-dirs.mjs lines 61-64), the folder the base read.
  • Claim: no CI job, runner or time-to-green change, and only Node 22.13 skips. Verified: only one test file changes; only the minimum-Node workflow runs Node 22.13.0, and the rest of CI runs Node 24.22.1 (.nvmrc), which has the hooks.
  • Claim: #11832 and #11834 are both superseded, and whichever lands second merges the other. Verified: both are open, the skip equals #11832's lines and the macOS commit equals #11834's patch apart from indentation.
  • Claim: the ownership and land-path note. Process information, not checkable against the code.
  • File packages/cli/test/packed-search-catalog.test.mjs: clear; consistent with the shared fixture, user-dirs.mjs and the CLI's keep condition.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 06:49
@cixzhang
cixzhang marked this pull request as draft November 17, 2026 06:59
@cixzhang
cixzhang marked this pull request as ready for review November 17, 2026 06:59
@cixzhang
cixzhang merged commit 1aad951 into main Nov 17, 2026
188 of 209 checks passed
@github-actions
github-actions Bot deleted the test/search-catalog-skip-no-hooks branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — cdb5031b Deployed Nov 17, 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