Repository navigation
fix(cli): doctor integration validate finds an integration installed for the computer - #13010
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
97a96d6 to
0aa2660
Compare
746633c to
3e02ac4
Compare
0aa2660 to
f11f198
Compare
3e02ac4 to
f16269d
Compare
f11f198 to
2994abd
Compare
2994abd to
f405f91
Compare
There was a problem hiding this comment.
Requesting changes. Outside a project, doctor integration validate now finds a compatible integration installed for the computer, and the step doctor prints for one that cannot load now runs. Two points need fixing first.
- For a computer-level copy whose peer range excludes this CLI, validate still answers
package_not_found … Install it first(validate-integration.mjs:862-864, and G35 asserts it), whileastryx doctorin the same folder says that package is installed and skipped; report it as skipped, with doctor's reason and fix, instead. - Three description claims are false at this head: a folder inside the package's own source did not "still" point to
integration check(on the base it answeredpackage_not_found), the same message change also reaches folders inside a project, and the global-mode spec does not say that doctor's fix names this command (the code does, which the printed-command rule then governs).
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims:
- The changeset says validate now finds an integration installed for the computer, where before it reported not-found though doctor names it: verified for a compatible copy (G35, and a run with a manifest that throws); not for one whose peer range excludes the CLI (first finding).
- Doctor tells you to run validate for a computer-level integration it cannot load: verified (
doctor.mjs:3101-3104). - Before, validate looked only in the folder's
node_moduleschain, so that step failed: verified (G35 fails on the base, and so does that run). - With no copy in the chain, validate now checks the computer-level copy: verified (
validate-integration.mjs:856-866, G35). - A copy in the chain still wins: verified (
validate-integration.mjs:857). - The package's own source folder keeps its own copy and points to
integration check: verified (G41, base and head). - A folder inside that source "still" points to
integration check: false (the base answeredpackage_not_found, and the G41 subfolder assertion fails there). - Inside a project nothing changes: false (the not-installed message in a folder below a package of that name changes,
validate-integration.mjs:875,:893). - An incompatible copy is skipped as doctor skips it, and doctor names a supporting release for it: verified (
doctor.mjs:3099-3100, G35). - The global-mode spec says doctor's fix names this command: false as a citation (the code does it, not the spec).
- The cited rules (printed commands run as printed; no inside-only advice outside a project; the command doc states what the command does outside a project; outside a project, computer-level integrations load with the same validation): verified against the current records.
- Outside any package, the TypeScript line names no install step when TypeScript is missing, has no compiler API, or is too old, and it keeps them inside a project or package: verified (
doc-types.mjs:951-960,:977, three new tests). - Only
validateIntegrationpasses the new option: verified (validate-integration.mjs:1002). - The other
doctor integrationsubcommands with a package name are unchanged: verified (not in the diff). - The API and command docs describe the new lookup: verified (
validateIntegration.doc.mjs:22-23,doctor-integration-validate.doc.mjs:27-28,:61). - No new public API: verified (exports and command options unchanged).
- The new tests cover the described cases: verified (G35, G41,
doc-types.test.mjs; all fail on the base and pass on the head). - The typecheck and the full test run: not reproduced in full; the CLI's strict typecheck reports nothing in a changed file, and the tests in the touched areas pass.
- The manual check with a packed lab integration: not reproduced; consistent with G35.
- Files:
.changeset/validate-computer-integration.md: clear, apart from the first finding's wording note.packages/cli/api/docs/_adapter.mjs: clear.packages/cli/api/integration/validate-integration.mjs: first and second findings.packages/cli/api/integration/validateIntegration.doc.mjs: clear.packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs: clear.packages/cli/foundation/discovery/doc-types.mjs: clear (non-blocking: a duplicated sentence).packages/cli/foundation/discovery/doc-types.test.mjs: clear.packages/cli/foundation/discovery/project-typescript.mjs: clear (non-blocking: a duplicated sentence).packages/cli/test/global-local.rows-16-39.test.mjs: first finding (it asserts the not-found text).packages/cli/test/global-local.rows-40-59.test.mjs: clear.
f16269d to
a3a7573
Compare
f405f91 to
abe4f46
Compare
a3a7573 to
02df385
Compare
abe4f46 to
af97840
Compare
There was a problem hiding this comment.
Requesting changes. Outside a project, doctor integration validate now checks the copy of an integration that the folder loads, one installed for the computer included, so the step astryx doctor prints for one it cannot load now runs, and both points from the earlier review are fixed. One point needs fixing first:
- For a computer copy skipped for its peer range, validate returns
cli_peer_versionas a failing error (exit 1), also when the Core range is the cause, though the CLI's rules (cli-surface INV35 and INV3) and its docs definecli_peer_versionas a note that fails nothing; report the skip under an error code of its own and assert that code in G35 (validate-integration.mjs:822-825).
Claims and files checked
Review mode: full; reason: history
- Claims:
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
node_moduleschain and reported not-found though doctor names the command: verified (G35 fails on the base and passes on the head). - Doctor names validate as the fix for a computer integration it cannot load: verified (
doctor.mjs:3101-3104, G35). - Validate now checks the copy the folder loads (its own source or a package it declares), else the computer copy: verified (
validate-integration.mjs:875-892, G35, G41). - A computer copy whose manifest throws is checked and its error printed: verified (G35).
- A computer copy skipped for its peer range is named with doctor's reason and fix, not checked: verified as described, but reported as a failing
cli_peer_versionerror (the finding above). - Only with no folder copy and no computer copy does the
node_moduleslookup apply, and an undeclared copy above the folder no longer wins: verified (validate-integration.mjs:829, G35). - Inside a project, which copy is checked does not change: verified (
validate-integration.mjs:812). - The not-installed message names
integration checkin any folder inside a package of that name: verified (validate-integration.mjs:900-921). - The other
doctor integrationsubcommands with a package name are unchanged: verified (not in the diff). - Outside any package, the TypeScript line names no install step when TypeScript is missing, has no compiler API, or is too old, and keeps its steps inside a project or package: verified (
doc-types.mjs:950-963,:976, three new tests that fail on the base). - The missing-TypeScript line shares its text with the in-project line: verified (
doc-types.mjs:98-107). - The cited rules (a printed command runs as printed; computer integrations load with the same validation and a folder's own copy wins; no inside-only advice outside a project; the command doc states what it does outside a project): verified against the current records.
- The API and command docs describe the new lookup: verified (
validateIntegration.doc.mjs:22-25,doctor-integration-validate.doc.mjs:27-30,:63); the API doc'scli_peer_versionwording belongs to the finding above. - The new tests cover the described cases: verified (G35, G41 and the doc-type tests fail on the base and pass on the head).
- The typecheck and the wide test run: partly reproduced (the CLI's strict typecheck reports nothing in a changed file; 123 test files in the touched areas pass).
- The manual check with a packed integration from another branch: not reproduced; consistent with G35.
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
- Files:
.changeset/validate-computer-integration.md: clear.packages/cli/api/docs/_adapter.mjs: clear.packages/cli/api/integration/validate-integration.mjs: the finding above (non-blocking: the skip sentence repeats doctor's text).packages/cli/api/integration/validateIntegration.doc.mjs: describes the skip ascli_peer_version(the finding above).packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs: clear.packages/cli/foundation/discovery/doc-types.mjs: clear.packages/cli/foundation/discovery/doc-types.test.mjs: clear.packages/cli/foundation/discovery/project-typescript.mjs: clear.packages/cli/test/global-local.rows-16-39.test.mjs: G35 asserts the skip message but not its code or exit status (the finding above).packages/cli/test/global-local.rows-40-59.test.mjs: clear.
af97840 to
6c79245
Compare
6c79245 to
1c904ef
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head, because its commit skips CI. Outside a project, doctor integration validate now checks the copy of an integration that the folder uses, so the step astryx doctor prints for one it cannot load now runs. The earlier point is fixed: a computer copy skipped for its CLI range now gets a cli_peer_version note that fails nothing. This pull request targets #13002's branch, so it lands after #13002.
Non-blocking:
- For a computer copy outside both peer ranges, the
cli_peer_versionnote's reason names only the Core range, becausepeerProblemreports the first range that fails; naming the CLI range there would match the code (validate-integration.mjs:536).
Claims and files checked
Review mode: full; reason: history
- Claims:
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
node_moduleschain and reported not-found though doctor names the command: verified (G35 fails on the base and passes on the head). - Doctor names validate as the fix for a computer integration it cannot load, so the printed step failed every time: verified (
doctor.mjs:3101-3104, G35 on the base). - Validate now checks the copy the folder loads (its own source, or a package it lists or declares), else a computer copy that fails to load: verified (
validate-integration.mjs:880-896, G35, G41). - A computer copy whose manifest throws is checked and its error printed: verified (G35).
- A computer copy skipped for its peer range is checked too, and when its CLI range is a cause its
cli_peer_versionnote gives doctor's reason and fix and fails nothing: verified (validate-integration.mjs:534-539, G35 exit 0, probe with empty issues). - A copy skipped only for its Core range gets no such note: verified (probe).
- Only when the folder uses no copy of that name and the computer holds none does the
node_moduleslookup apply, and an undeclared copy above the folder no longer wins: verified (validate-integration.mjs:824-833, G35). - Inside a project nothing changes: verified (the lookup is gated on being outside a project at
validate-integration.mjs:824; the not-installed message matches the base). - The folder's own source is checked as the package being made, against what npm packs: verified (
ownselects npm's packed file list atvalidate-integration.mjs:592). - The other
doctor integrationsubcommands with a package name are unchanged: verified (their callers pass no new option). - Outside any package, the TypeScript line names no install step when TypeScript is missing, has no compiler API, or is too old, and keeps its steps inside a project or package: verified (
doc-types.mjs:951-962,:976, three new tests that fail on the base). - The missing-TypeScript line shares its text with the in-project line: verified (
doc-types.mjs:98-107). - The cited rules (a printed command runs as printed; computer integrations load with the same validation and a folder's own copy wins; no inside-only advice outside a project; the command doc states what it does outside a project): verified against the current records.
- The API and command docs describe the new lookup in the same order: verified (
validateIntegration.doc.mjs:22-24,doctor-integration-validate.doc.mjs:27-29,:62). - The new tests cover the described cases: verified (G35, G41 and the doc-type tests fail on the base and pass on the head).
- The typecheck and the wide test run: partly reproduced (141 test files in the touched areas pass; the CLI's strict typecheck reports nothing in a changed file).
- The manual check with a packed integration installed for the computer: not reproduced; consistent with G35.
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
- Files:
.changeset/validate-computer-integration.md: clear.packages/cli/api/docs/_adapter.mjs: clear.packages/cli/api/integration/validate-integration.mjs: clear (non-blocking: the skip note's wording).packages/cli/api/integration/validateIntegration.doc.mjs: clear.packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs: clear.packages/cli/foundation/discovery/doc-types.mjs: clear.packages/cli/foundation/discovery/doc-types.test.mjs: clear.packages/cli/foundation/discovery/project-typescript.mjs: clear.packages/cli/test/global-local.rows-16-39.test.mjs: clear.packages/cli/test/global-local.rows-40-59.test.mjs: clear.
1c904ef to
de89f95
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head, because its commit skips CI. Outside a project, doctor integration validate checks the copy of an integration that the folder uses, so the step astryx doctor prints for one it cannot load now runs. Since the last review, the copy lookup moved unchanged into the integration adapter, where the CLI's rules keep project loading. This pull request targets #13002's branch, so it lands after #13002.
Non-blocking:
- For a computer copy outside both peer ranges, the
cli_peer_versionnote's reason names only the Core range, becausepeerProblemreports the first range that fails; naming the CLI range there would match the code (validate-integration.mjs:533).
Claims and files checked
Review mode: full; reason: history
- Claims:
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
node_moduleschain and reported not-found though doctor names the command: verified (G35 fails on the base and passes on the head). - Doctor names validate as the fix for a computer integration it cannot load, so the printed step failed every time: verified (
doctor.mjs:3103, G35 on the base). - Validate now checks the copy the folder loads (its own source, or a package it lists or declares), else a computer copy that fails to load: verified (
_adapter.mjs:269-288, G35, G41). - The copy lookup lives in the integration API's adapter, which reads the project: verified (
_adapter.mjs:269-288;validate-integration.mjsno longer imports the project loader). - A computer copy whose manifest throws is checked and its error printed: verified (G35).
- A computer copy skipped for its peer range is checked too, and when its CLI range is a cause its
cli_peer_versionnote gives doctor's reason and fix and fails nothing: verified (validate-integration.mjs:528-537, G35 exit 0, probe with empty issues). - A copy skipped only for its Core range gets no such note: verified (probe).
- Only when the folder uses no copy of that name and the computer holds none does the
node_moduleslookup apply, and an undeclared copy above the folder no longer wins: verified (validate-integration.mjs:821-830, G35). - Inside a project nothing changes: verified (the lookup is gated on being outside a project at
validate-integration.mjs:821). - The folder's own source is checked as the package being made, against what npm packs: verified (
ownselects npm's packed file list atvalidate-integration.mjs:589). - Only
doctor integration validatepasses the new option, and the otherdoctor integrationsubcommands with a package name are unchanged: verified (the other callers pass no new option). - Outside any package, the TypeScript line names no install step when TypeScript is missing, has no compiler API, or is too old, and keeps its steps inside a project or package: verified (
doc-types.mjs:951-962,:976, three new tests that fail on the base). - The missing-TypeScript line shares its text with the in-project line: verified (
doc-types.mjs:98-107). - The cited rules (a printed command runs as printed; computer integrations load with the same validation and a folder's own copy wins; no inside-only advice outside a project; the command doc states what it does outside a project): verified against the current records.
- The API and command docs describe the new lookup in the same order: verified (
validateIntegration.doc.mjs:22-24,doctor-integration-validate.doc.mjs:27-29,:62). - The new tests cover the described cases: verified (G35, G41 and the doc-type tests fail on the base and pass on the head).
- One defect is restored, with no new public API, default or interaction model under the fix label: verified (no command, option, export or signature changes; behavior changes only outside a project).
- Public text carries no internal context: verified (added lines, title, description, branch and commit message checked).
- The typecheck and the wide test run: partly reproduced (141 test files in the touched areas pass; the CLI's strict typecheck reports nothing in a changed file).
- The manual check with a packed integration installed for the computer: not reproduced; consistent with G35.
- The changeset says that outside a project validate now checks the copy the folder uses, a computer integration included, where before it looked only in the
- Files:
.changeset/validate-computer-integration.md: clear.packages/cli/api/docs/_adapter.mjs: clear.packages/cli/api/integration/_adapter.mjs: clear.packages/cli/api/integration/validate-integration.mjs: clear (non-blocking: the skip note's wording).packages/cli/api/integration/validateIntegration.doc.mjs: clear.packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs: clear.packages/cli/foundation/discovery/doc-types.mjs: clear.packages/cli/foundation/discovery/doc-types.test.mjs: clear.packages/cli/foundation/discovery/project-typescript.mjs: clear.packages/cli/test/global-local.rows-16-39.test.mjs: clear.packages/cli/test/global-local.rows-40-59.test.mjs: clear.
de89f95 to
66c129d
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head.
#13002
Approve, with no blocking findings: outside a project, astryx doctor now names the issues of an integration installed for the computer, and its record change is approved for its head.
#13010
Approve, with no blocking findings: outside a project, astryx doctor integration validate <package> now checks the copy the folder uses, so the step doctor prints for an integration it cannot load runs.
Whole stack
Passes; a pull request in this stack lands only when it and every pull request below it are approved.
- Before merge, the repository's spec gate on this head still waits for an engineering owner's
/approve-spec, because the stack's diff frommaincarries the global-mode record change. - Non-blocking: a computer copy outside both peer ranges gets
cli_peer_versionwith a reason that names only the Core range, while the new docs saycore_peer_versioncovers a Core-range skip (inline comment).
Claims and files checked
Review mode: full; reason: history
- Claims, #13002 (changeset and description):
- Outside a project, the everyday commands print one line that sends people to
doctorwhen an integration installed for the computer has issues: verified (the call sites in search, discover, component, template and theme; G35). - Before,
doctorpassed and named no issue: verified (base run; G35 fails on the base withpassforwarn). doctornow warns and names each issue, except comparisons with Core components it cannot judge without a Core: verified (doctor/_adapter.mjs:1484-1503; G35's valid Core replacement still passes).- A provider conflict is left out because the one-line warning prints it itself: verified (the shared
pointsToDoctor). - The fix says the maintainer fixes it, otherwise a newer release; beside a global CLI it names the update command, in a tool's package set it says the tool updates it, and it names none for Astryx's own packages or under Volta: verified (
doctor.mjs:3108-3118; unit and update-command tests). - A passing check prints what it printed before, and the JSON keeps its shape: verified (the no-issue unit case passes on both trees).
- The CLI upgrade command's output is unchanged: verified (same branches and strings as the base).
- Command help, API doc, docs page and the record's doctor bullet and verification row describe the new warning and its exception: verified.
- npm's
latesttag of a canary-only package is a placeholder: supported by the repository's release guide; the registry was not checked. - The packed global-install evidence and the full test count: not reproduced as stated; the same before and after was reproduced on a fixture, and 52 related test files (1288 tests) pass.
- Outside a project, the everyday commands print one line that sends people to
- Claims, #13010 (changeset and description):
doctornames this command for an integration installed for the computer that it cannot load, and outside a project the command answered "not found": verified (doctor.mjs:3101-3104; base run).- Outside a project it checks the folder's own source or a declared package, else the computer copy, else the
node_moduleschain: verified (integration/_adapter.mjs:269-288,validate-integration.mjs:826-835; G35, G41). - A copy skipped for its CLI range gets the CLI-range note with doctor's reason and fix, and one skipped only for its Core range gets the same text under a new Core-range note; neither fails anything: verified (G35).
- The API doc and the JSON response-types doc list the new code: verified.
- An undeclared copy above the folder no longer wins: verified (G35).
- Outside any package, the docs line names no install step for a missing, compiler-less or too-old TypeScript, and keeps it inside a project or package: verified (three doc-types tests fail on the base and pass on the head).
- The other
doctor integrationsubcommands are unchanged, and inside a project nothing changes: verified (only validate passes the new option; outside-project gate).
- Files, #13002:
.changeset/doctor-computer-integration-issues.md,docs/specs/AST-081-global-mode/spec.md,packages/cli/api/doctor/_adapter.mjs,doctor.doc.mjs,doctor.mjs,doctor.test.mjs,packages/cli/assets/docs/tree/computer-integrations.doc.mjs,packages/cli/clients/cli/commands/doctor.doc.mjs,packages/cli/foundation/discovery/component-replacement.mjs,packages/cli/foundation/integrations/integration-warnings.mjs,packages/cli/foundation/release/notices.mjs,notices.test.mjs,packages/cli/test/global-local.rows-16-39.test.mjs: clear. - Files, #13010:
.changeset/validate-computer-integration.md,packages/cli/api/docs/_adapter.mjs,packages/cli/api/integration/_adapter.mjs,packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs,packages/cli/foundation/discovery/doc-types.mjs,doc-types.test.mjs,project-typescript.mjs,packages/cli/test/global-local.rows-16-39.test.mjs,global-local.rows-40-59.test.mjs: clear.packages/cli/api/integration/validate-integration.mjs: non-blocking (the two-range note).validate-integration.type.mjs,validateIntegration.doc.mjs,packages/cli/foundation/response/response-types.doc.mjs: non-blocking (they omit "only" for the Core-range code).
66c129d to
9e4cff7
Compare
There was a problem hiding this comment.
Changes requested: one blocking finding; the rest of the change follows the global-mode spec, and its new tests fail on main and pass here.
- Miss: in a folder outside a project whose
package.jsondeclares its own copy of an integration that fails to load, beside a working copy installed for the computer,astryx doctor integration validate <package>now checks the computer copy and prints[ok] No integration issues found, wheremainreported the declared copy'sinvalid_manifest, so inloadedCopylook the name up inproviderLedgerOf(project)(load-failedentries included) before the computer candidates and add a test row for this case.
Non-blocking: a copy outside both peer ranges gets cli_peer_version with a Core-range reason while the new docs describe core_peer_version for that range (open inline thread). CI has not run on this head yet.
Claims and files checked
Review mode: full; reason: rebase
- Claims:
- Doctor names this command for an integration installed for the computer that it cannot load, and outside a project the command answered "not found": verified (doctor's fix builder; a run on
main). - Outside a project it checks the folder's own source, else a package the folder declares, else the computer copy, else the
node_moduleschain: verified for the own source, a declared copy that loads and computer copies (G35, G41); false for a declared copy that fails to load (the finding above). - A computer copy that fails to load is checked and its error printed: verified (G35).
- A copy skipped for its CLI range gets
cli_peer_version, one skipped only for its Core range getscore_peer_version, both with doctor's reason and fix, and neither fails anything: verified (G35). - The API doc and the JSON response-types doc list the new code: verified.
- An undeclared copy in a
node_modulesabove the folder no longer wins: verified (G35). - Outside any package the docs line names no install step for a missing, compiler-less or too-old TypeScript, and keeps it inside a package: verified (three new unit tests fail on
main; a run in a package folder). - Only this command passes the new option, the other
doctor integrationsubcommands are unchanged, and nothing changes inside a project: verified (the two other callers; the outside-project gate). - The changeset's before and after: verified, apart from the declared-copy case above.
- The packed-release evidence and the full test tallies: not reproduced as stated; the same before and after was reproduced on fixtures, and 66 related test files pass.
- Doctor names this command for an integration installed for the computer that it cannot load, and outside a project the command answered "not found": verified (doctor's fix builder; a run on
- Files:
packages/cli/api/integration/_adapter.mjs: blocking finding (a declared copy that fails to load).packages/cli/api/integration/validate-integration.mjs: non-blocking (the two-range note; the skip advice).packages/cli/api/integration/validate-integration.type.mjs,packages/cli/api/integration/validateIntegration.doc.mjs,packages/cli/foundation/response/response-types.doc.mjs: non-blocking (no "only" for the Core-range code)..changeset/validate-computer-integration.md,packages/cli/api/docs/_adapter.mjs,packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs,packages/cli/foundation/discovery/doc-types.mjs,packages/cli/foundation/discovery/doc-types.test.mjs,packages/cli/foundation/discovery/project-typescript.mjs,packages/cli/test/global-local.rows-16-39.test.mjs,packages/cli/test/global-local.rows-40-59.test.mjs: clear.
…for the computer Outside a project, doctor's computer-integrations check names `doctor integration validate <package>` for an integration installed for the computer that it cannot load. That command looked only in the node_modules at or above the folder, so it reported package_not_found. Outside a project it now checks the copy the folder uses, as Project.load decides it: the folder's own source or a package it declares, else the copy installed for the computer. Outside any package, its docs line about TypeScript names no install step. [skip ci]
9e4cff7 to
01d1ec0
Compare
|
/approve-spec 01d1ec0 |
|
/approve-spec 01d1ec0 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its commit skips CI.
Outside a project, astryx doctor integration validate <package> now checks the copy of the package the folder uses, and the earlier blocking case is fixed: a folder that declares its own copy whose manifest fails now gets that copy's error, guarded by a new test. The skip notes, their reasons and the docs now agree, and the new tests fail on main and pass here. Nothing else is needed from you.
Claims and files checked
Review mode: full; reason: history
- Claim (changeset): outside a project, validate checks the copy the folder uses, a computer copy included. Verified:
api/integration/_adapter.mjs:270-298,validate-integration.mjs:826-835, rows G35 and G41. - Claim (changeset): before, it looked only in the
node_moduleschain and answeredpackage_not_found, though doctor names the command. Verified: G35 fails onmainat that answer;api/doctor/doctor.mjs:3103-3106. - Claim (changeset): a copy skipped for its peer ranges is checked with a note,
cli_peer_version, orcore_peer_versionwhen only the Core range excludes the release. Verified:validate-integration.mjs:532-539; the G35 old, old-core and old-both rows. - Claim: only
doctor integration validatepasses the new option, and inside a project nothing changes. Verified:validate-integration.mjs:826and:999; the other callers pass no such option. - Claim: the lookup order is the loaded copy, then the folder's own claim loaded or not, then a computer copy that admits this CLI, then a skipped copy, then the
node_moduleschain. Verified:_adapter.mjs:270-298; the G35 declared-copy row. - Claim: the skip notes fail nothing. Verified: G35 exits 0 for each skipped copy.
- Claim: the skip reason names every excluding range, in doctor's warning and in the note. Verified:
foundation/integrations/computer-integrations.mjs:207-227and its new unit test. - Claim: an undeclared copy in a
node_modulesabove the folder no longer wins. Verified: the G35 inner-folder row. - Claim: outside any package the docs line names no install step for a missing, unusable or too-old TypeScript, and keeps it inside a package. Verified:
foundation/discovery/doc-types.mjs:950-978,project-typescript.mjs:89-95, three new doc-types tests. - Claim: the API doc, the response-type doc and the regenerated README table list the new code. Verified: the README generator check is in sync.
- Claim: the command doc states the lookup and declares
ownoutside a project. Verified:doctor-integration-validate.doc.mjs:27-29,:50and:62. - Claim:
doctor integration components,docsandtemplatesare unchanged. Verified: none of their files changes. - Claim: with installed lab packages, validate answered
package_not_foundbefore and checks the copy with one warning and no install step after. Verified for the repository's part: G35 exercises the same paths with fixtures; the lab packages are outside the repository. - Claim: the typecheck, the structure and README checks and the listed suites pass. Verified: the structure and README checks pass, the related suites pass (68 files), and the CLI typecheck reports no error in a changed file.
- Claim: the new tests (G35 rows, G41, doc-types cases, the peer-range unit test) cover the cases described. Verified: each is present and fails on
mainor with the previous lookup. - File
.changeset/validate-computer-integration.md: clear. - File
packages/cli/README.md: clear (regenerated table, in sync). - File
packages/cli/api/docs/_adapter.mjs: clear. - File
packages/cli/api/integration/_adapter.mjs: clear. - File
packages/cli/api/integration/validate-integration.mjs: clear. - File
packages/cli/api/integration/validate-integration.type.mjs: clear. - File
packages/cli/api/integration/validateIntegration.doc.mjs: clear. - File
packages/cli/clients/cli/commands/doctor-integration-validate.doc.mjs: clear. - File
packages/cli/foundation/config/project.mjs: clear. - File
packages/cli/foundation/discovery/doc-types.mjs: clear. - File
packages/cli/foundation/discovery/doc-types.test.mjs: clear. - File
packages/cli/foundation/discovery/project-typescript.mjs: clear. - File
packages/cli/foundation/integrations/computer-integrations.mjs: clear. - File
packages/cli/foundation/integrations/computer-integrations.test.mjs: clear. - File
packages/cli/foundation/response/response-types.doc.mjs: clear. - File
packages/cli/test/global-local.rows-16-39.test.mjs: clear. - File
packages/cli/test/global-local.rows-40-59.test.mjs: clear.
- #13010 fix(cli): doctor integration validate finds an integration installed for the computer Author: @josephfarina
|
Landed in #13063. |
User impact
Outside a project, when an integration installed for the computer cannot load,
astryx doctorsays to runastryx doctor integration validate <package>to see why. That command looked only in thenode_modulesat or above the folder, so outside a project it answered:Now, outside a project, it checks the copy of the package that the folder uses, the copy doctor reports: the folder's own source or a package it declares, else the integration installed for the computer:
Outside any package no project install step applies, so the docs line there names none, whether TypeScript is missing, installed without a compiler API (TypeScript 7), or too old to check a doc. Inside a project or package it keeps its install steps.
Problem and solution fit
validateInstalledIntegrationresolves the package from thenode_moduleschain at or above the folder, as a project does. Outside a project, the integrations in use are the ones installed for the computer, beside the CLI, not in that chain.computer-integrationscheck prints this command as the next step for an integration installed for the computer that it cannot load, so the printed step failed every time.Project.loadalready decides which copy of each integration the folder uses, and doctor reports from that decision. Validate now reads the same decision: the copy the folder loads, else a computer copy that fails to load (doctor lists it, but it loads nothing). A computer copy that doctor skips for its peer range is checked too, with doctor's reason and fix as its note. Only when the folder uses no copy of that name, and the computer holds none, does thenode_moduleslookup apply, as before. Inside a project nothing changes.Expected behavior and authority
architecture:cli-surfaceINV38: a command the CLI prints runs as printed. Doctor's fix for a computer integration that cannot load names this command.spec:AST-081FR12: outside a project, the integrations installed for the computer load with the same validation as a project's own, anddoctorwarns about each it cannot load, naming why. A folder that loads an integration itself, such as that integration's own source, uses its own copy (row G41).spec:AST-081FR3: output outside a project gives no advice that works only inside one. So outside any package the TypeScript line names nonpm install -Dstep.spec:AST-081FR4:doctor integration validatedeclaresownoutside a project, and its command doc states what it does there.Smallest restoration
api/integration/validate-integration.mjs:validateInstalledIntegrationtakes acomputeroption, which onlyvalidateIntegration(doctor integration validate) passes. With it, outside a project,loadedCopy(spec, cwd)(in the integration API's adapter, which reads the project) returns{dir, own}for the copy namedspecinProject.load(cwd, {core: 'project'}).loadedIntegrations(the folder's own source, withownfrom its__localmark, so its shipped-import check reads the files npm packs and its peer advice is the own-folder one; or a package it lists or declares; or a computer copy that loads), else the folder's own claim on that name in the provider ledgerProject.loadresolved, loaded or not (a declared copy whose manifest throws:Project.loadkeeps the computer copy out for it, so validate checks the declared copy and prints its error), else{dir}for the computer-level candidate with that name whose peer ranges admit this CLI (one that fails to load), else{skipped}for a computer copy outside those ranges, elsenull. A skipped copy is checked too. When its@astryxdesign/clirange is among the reasons, itscli_peer_versionnote gives doctor's reason and fix ("Outside a project, the other commands skip @: . Install a release of that supports this CLI.") instead of the project steps, which outside a project would set up a project the folder does not have; like everycli_peer_versionnote, it fails nothing (INV35). A copy skipped only for its@astryxdesign/corerange gets the same text under its own note code,core_peer_version, which also fails nothing (a copy that both ranges exclude getscli_peer_version):cli_peer_versionmeans the CLI range, and a code never changes meaning (INV3). The validate API doc and the JSON response-types doc list the new code, and the CLI README's response-type table is regenerated from the latter.foundation/integrations/computer-integrations.mjs: the skip reason (peerProblem, shared by doctor's skip warning and this note) names every release peer range that excludes the release ("it needs @astryxdesign/core >=10.0.0 and @astryxdesign/cli >=10.0.0, and this computer's CLI is 9.0.0"), not only the first. A stray copy in anode_modulesabove the folder that nothing declares is not loaded there, so it no longer wins.doctor integration components,docsandtemplateswith a package name are unchanged here: they still look only in thenode_modulesat or above the folder, an older gap against FR3 that doctor sends no one to.foundation/discovery/doc-types.mjs:checkDocTypestakesoutsideAnyPackage; with it, a missing TypeScript givesDOC_TYPES_TYPESCRIPT_MISSING_HERE(it shares its text with the in-project line), an unusable oneunusableTypeScriptReason(…, {here: true})(project-typescript.mjsgains thehereoption), and one too old to check a doc the same line without its install step.api/docs/_adapter.mjspassesisOutsideAnyPackage(cwd).api/integration/validateIntegration.doc.mjs: the API description says that outside a project the copy the folder loads is checked, in the same order.clients/cli/commands/doctor-integration-validate.doc.mjs(declaredownoutside a project): the description and the global-mode note say where a package name is looked up: in the project's packages, or, outside a project, as the folder loads it: its own source or a package it declares, else the copy installed for the computer, else thenode_modulesat or above the folder.Evidence
Global copy from packs of the newest approved-PR integration branch (Core, CLI and lab), installed for the computer; an empty folder; a fresh home;
astryx doctor integration validate @astryxdesign/lab:package_not_found.Scope
Components: CLI (
doctor integration validateoutside a project)Testing
c1eeb636b0b, which includes the doctor change this builds on, and this change:pnpm typecheck,node scripts/check-cli-structure.mjsandgenerate-cli-readme.mjs --checkpass;vitest run --project nodeoverapi/integration,api/doctor,foundation/integrations,foundation/runtime/package-set.test.mjs,foundation/response,foundation/config/project.test.mjs,test/global-local.rows-16-39.test.mjs,test/global-local.rows-40-59.test.mjs,test/doc-loads.test.mjs,test/readme-gen.test.mjs,clients/cli/commands/integration-check.test.mjsandscripts/check-cli-structure.test.mjs: 69 files, 1623 tests pass. The CLI README's response-type table is regenerated for the new note code.doctor integration validate @acme/brokenoutside a project, beside the global copy that installs it: it checks that copy, names its issue, prints the docs line "TypeScript is not installed here, so docs were not checked", and prints nonpm installstep. G35 also installs one whose CLI peer range excludes the CLI (validate checks it, exits 0, and its note gives doctor's skip reason and fix, with noupgrade --fromstep), one whose Core peer range alone excludes the CLI's release (doctor names it as skipped; validate exits 0 with acore_peer_versionnote carrying the same reason and fix), one both of whose ranges exclude it (acli_peer_versionnote naming both ranges), one whose manifest throws (doctor names validate for it, and validate checks it and prints the error), a folder that declares one whose own copy's manifest throws beside a healthy computer copy (validate checks the declared copy and prints its error), and a stray undeclared copy in anode_modulesabove the folder (validate checks the computer copy the folder uses). Row G41: in the package's own source folder, and in a folder inside it, validate checks the folder's own copy (2.0.0), not the computer's (1.0.0).doc-types.test.mjs: outside any package, a missing, an unusable and a too-old TypeScript give lines with no install step.preflight: pass 01d1ec0