Skip to content

fix(setup): refresh registrations of another installed REA package - #15029

Merged
N0zoM1z0 merged 8 commits into
mainfrom
fix/setup-npx-cache-launcher
Nov 29, 2026
Merged

N0zoM1z0 merged 8 commits into
mainfrom
fix/setup-npx-cache-launcher

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #15022.

When an earlier npx rea-agents setup saved REA's launcher from one npx cache folder (npm-cache/_npx/af752b…/node_modules/rea-agents/scripts/rea.mjs), and a later npx run landed in a different cache folder, doctor reported every client registration as config_drift with command_identity: foreign. Setup then refused to refresh them and told the user to hand-edit six client configs. The same thing happens after a global install moves to another prefix, or when nvm/fnm switches the Node.js runtime.

With this PR, doctor reports such a registration as owned but stale, and rea setup replaces it with the current launcher after backing it up.

Problem and expected behavior

Trigger: a client config contains [node, <other install>/node_modules/rea-agents/scripts/rea.mjs, "mcp"], and REA runs from a different path.

Violated invariant: REA's own registration must stay identifiable so that setup can refresh it. Before this change, ownership required the saved entrypoint to realpath-match the running entrypoint, and any other existing path was foreign.

Expected: a launcher that provably starts another installed rea-agents package is owned and refreshable. A genuinely foreign command stays foreign.

Change and scope

  • New owner src/application/InstalledReaPackage.ts (installedReaPackageEvidence). It returns one of three results:

    • verified when all of these hold:

      • the path's native realpath and Node's lexical selection (realpath(resolve(path))) are the same file;
      • that file is <root>/scripts/rea.mjs, where <root> is node_modules/rea-agents;
      • <root>/package.json parses with name: "rea-agents", and its bin.rea resolves to that file.

      This is the layout npm, npx, pnpm and Bun create, and the "package resolves as rea-agents" check the issue asks for.

    • unknown when the script does not resolve (for example a pruned _npx entry under another runtime), when the layout matches but the manifest cannot be read or parsed (for example a partly extracted npx install), or when the two traversal semantics select different files and either one lands in an REA package.

    • absent otherwise: other locations, a missing manifest, or another name or bin.

    The manifest read is limited to regular files of at most 1 MiB. That ceiling is fixed: REA's manifest is about 30 KB, and the limit only bounds a single parse during identity checks; it is not a caller-facing analysis limit.

  • ClientRegistrationIdentity adds the parsed fact installation: "current" | "other" to owned absolute launchers. This covers runtime/script launchers, a foreign runtime paired with an REA package script (the nvm case), managed Aube shims, and absolute direct launchers. unknown package evidence keeps ownership unknown. With a proven different runtime, the script is compared first (otherRuntimeScriptOwnership). If Node's lexical spelling and the native spelling both select the current entrypoint, as with a source checkout after a Node switch, the registration is owned/other. If only one does, it is unknown. Otherwise the package evidence decides. inspectAubeShim now returns its parsed target together with whether the shim uses the current runtime, rather than nothing when the runtime differs. An Aube wrapper whose runtime changed is then owned/other when its target is verified, and keeps its earlier classification otherwise. The managed-shim branch moved into inspectManagedShimCommand, which brings inspectDirectRegistrationCommand complexity below main. The "different installation" decision is made in one place, and consumers read that fact:

    • registrationAligned marks other as stale, alongside legacy package-runner registrations.
    • equivalentClientRegistrationCommands keeps a prior launcher only when it selects the current installation. Without this, setup would write the stale path back.
    • Doctor's remediation names the cause: "The saved launcher starts another installed rea-agents package or runtime, not the installation running this check. Run rea setup to refresh this registration, then restart the client."
    • SetupPlan, UpdateMaintenance, setup write admission and uninstall already act on owned, so they now treat these registrations as REA's. Uninstall removes them, as it already does for npx -y rea-agents@<any version> mcp registrations.
  • The foreign/unknown remediation no longer claims that a different installation path can never prove ownership.

Intentionally not changed: what setup writes while it runs from an npx cache. The issue suggests writing npx -y rea-agents@<version> mcp or a global rea path instead. #7757 / c77735f deliberately removed package-runner registrations, because npx resolves the package again from the client's working directory, where a project tree can supply a same-name package. A global rea would also be a different installation from the one the user chose to run. Setup therefore still binds the installation that runs it. A durable global install remains the documented recommendation.

Also not changed: a registration whose installation has since been removed (for example a pruned _npx folder). REA cannot read that manifest, so ownership stays unknown and the existing manual-repair remediation applies. This keeps the rule that unresolved identity is not treated as owned.

Scope decision: not applicable; this is a fix within existing setup and registration boundaries.

Contract and boundary impact

  • Semantic owner and earliest changed stage: installedReaPackageEvidence decides whether a launcher path selects an installed REA package. inspectClientRegistrationCommand turns that into identity and installation facts. Consumers (registrationAligned, equivalentClientRegistrationCommands, doctor remediation, setup/update/uninstall via owned) read those facts and do not re-derive them from paths. The case that separates old from new behavior: node <other>/node_modules/rea-agents/scripts/rea.mjs mcp was foreign and is now owned + stale. A source checkout with the same manifest stays foreign.
  • Contribution scope fit and linked maintainer decision: fix within the existing setup/registration scope; not applicable.
  • CLI and MCP/tool-catalog contract: the doctor command_identity enum is unchanged. Some registrations move from foreign to owned, with state: "stale" and a new remediation sentence. Setup can now plan a refresh for them.
  • Provider, bridge, target-format, or platform compatibility: path handling uses host node:path on the native realpath, so it applies to Windows npx caches and POSIX installs. On Windows, a rea.cmd shim still is not a link to the script, so it stays foreign as before.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: setup still shows its plan and needs approval; refreshes keep the existing .rea.backup behavior.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Change process memory, registers, files, or configuration.

These are the existing client-config writes by setup, after approval. The new read is the installed package manifest.

Evidence and regression coverage

  • Tests added or updated: tests/acceptance/setup/registrationOwnershipSetup.test.ts runs real CLI doctor and setup workflows:
    • Refresh of an npx-cache-shaped installation with the current runtime, and with another runtime. Each checks doctor owned / stale / remediation, the setup rewrite to the current launcher, preserved env and peer servers, and the backup.
    • Controls that stay foreign and unchanged: another package name, a source checkout with REA's manifest, and a manifest whose bin.rea names a different script.
    • Controls that stay unknown and unchanged: a removed installation's script under another runtime, an unparseable REA manifest, and a link/../scripts/rea.mjs spelling that native traversal resolves into an REA package while Node selects an unrelated script.
    • Refresh of this checkout's own script saved under another runtime.
  • tests/boundary/filesystem/aubeBinShimRegistration.test.ts: a saved Aube wrapper whose runtime changed is owned and stale when its target is this installation's script or has REA's manifest, and stays unknown/foreign for an unverified package. Earlier "not owned" assertions for shims of another runtime are restated as installation !== "current".
  • Base reproduction: on the unfixed source (git stash -- src), both refresh tests fail (2 failed | 12 passed) and the three foreign controls pass. Each review regression (traversal divergence, Aube runtime change, unparseable manifest, unresolved script under another runtime, current script under another runtime) fails on the commit before its fix and passes now.
  • The existing case where a missing old script stays unknown (/missing/old-rea/scripts/rea.mjs) still passes.
  • Remaining proof gaps: not run on native Windows with a real npx cache. The Windows path depends on realpathSync.native plus node:path on win32, which these tests do not exercise.

Validation performed

  • npm run test:focused -- tests/acceptance/setup/registrationOwnershipSetup.test.ts plus 17 sibling suites: client registration status, launcher alias, Aube shim, configuration dialects, package-runner bound installation and registration, CLI setup, ClientRegistration, Setup planning/recovery/configuration, SetupPlan, Doctor, doctor registration environment, cleanup ownership, project uninstall, duplicate JSON member setup. Result: 18 files, 456 passed, 1 skipped.
  • npm run check:fast: passed (typecheck, lint, architecture guards). ClientRegistrationIdentity.ts now has 4 lint warnings, all existing on main (main has 5; inspectDirectRegistrationCommand complexity drops from 32 to 28). The AubeBinShim.ts complexity warning is unchanged from main.
  • npm run knip: clean.
  • npm run docs:check: passed.
  • npx oxfmt --check on touched files: clean.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Registrations that were blocked as foreign become refreshable.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux only; no Windows run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: a hand-written rea entry is reclassified as REA-owned only if it points at REA's own installed CLI script, verified through the package manifest, and both traversal semantics select that same script. Setup still requires approval and backs up the config. Uninstall's removal set now includes these entries.

Author readiness

Human owner: exempt maintainer account (CONTRIBUTING.md readiness exemption); readiness boxes intentionally left unchecked.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Author checklist (completed by the PR author before requesting review)

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
  • I ran every test, build, or measurement needed to validate this change, reported a browser, GPU, or environment gap only when that runtime or hardware is unavailable, and reported the checks I ran and their results without presenting inferred correctness or speedups as measured.
  • Comments explain constraints or non-obvious decisions; task history and conversations stay out of code and docs.
  • Documentation is concise and factual, without punchy slogans or promotional language.
  • This change fixes the root cause and follows the engineering rules in AGENTS.md.
  • Formatted input is interpreted once at the owning boundary, and consumers use the owner's parsed facts. See Interpret boundary facts once.
  • Combined failures preserve partial observations, remaining resources, and cleanup facts. See Own the lifecycle.
  • A hardcoded limit is an REA_ runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.

gensokyo-dev and others added 3 commits November 28, 2026 18:09
Ownership of an absolute launcher now carries whether it selects this
installation, and launcher equivalence requires that fact instead of
inferring it from ownership alone.

Co-Authored-By: gensokyo-dev <[email protected]>
A registration saved by an earlier npx run, a different global prefix or
another runtime points at REA's own CLI script under a different path.
Exact path comparison classified it as foreign, so setup refused to
refresh it and asked for manual edits in every client.

An absolute launcher whose script resolves to the CLI script named by an
installed node_modules/rea-agents/package.json is now owned but selects
another installation. Doctor reports it stale with a refresh remediation,
and setup replaces it with the current launcher after backing it up.
Source checkouts, other package names, other bin scripts and removed
installations stay foreign or unknown.

Fixes #15022

Co-Authored-By: gensokyo-dev <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T19:49:54.496916Z a009ca4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The reviewed changes appear safe to merge; no blocking findings remain.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge; no blocking findings remain.

Summary

This PR lets setup refresh registrations that point to another installed REA package or runtime.

  • Setup refreshes launchers from other installed REA packages.

The previous manifest-read finding is fixed. No new actionable issues were found. Review checks were source-only; tests were not rerun. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read saved launcher] --> B{Selects current script and runtime?}
  B -->|Yes| C[Owned: current installation]
  B -->|No| D{Proves another REA installation or runtime?}
  D -->|Yes| E[Owned: other installation]
  D -->|Unresolved| F[Unknown: leave untouched]
  D -->|No| G[Foreign: leave untouched]
  E --> H[Doctor reports stale]
  H --> I[Setup backs up and refreshes after approval]
Loading

Reviews (6) · Last reviewed commit: "fix(setup): compare the script before re..." · Reviewed by Greptile

Comment thread src/application/InstalledReaPackage.ts Outdated
Comment on lines +42 to +43
} catch {
return false;

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.

P2 Unreadable manifests look foreign

When another installation's script exists but its manifest cannot be read or parsed, this catch returns false. entrypointOwnership then reports foreign, even though package ownership could not be checked. Doctor tells the user to rename or remove the registration instead of reporting an unresolved identity.

The repository requires unresolved identity to remain unknown. Return a distinct unknown result for failed manifest reads and preserve it through the caller. This requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/InstalledReaPackage.ts
Line: 42-43

Comment:
**Unreadable manifests look foreign**

When another installation's script exists but its manifest cannot be read or parsed, this catch returns `false`. `entrypointOwnership` then reports `foreign`, even though package ownership could not be checked. Doctor tells the user to rename or remove the registration instead of reporting an unresolved identity.

The repository requires unresolved identity to remain `unknown`. Return a distinct unknown result for failed manifest reads and preserve it through the caller. This requirement must be satisfied before merging.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@N0zoM1z0 N0zoM1z0 Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid. Package evidence is now tri-state (verified / absent / unknown) in InstalledReaPackage.ts (b67c9aa). A script in the node_modules/rea-agents/scripts/rea.mjs layout whose manifest cannot be read or parsed is unknown, and entrypointOwnership / aubeShimOwnership carry that through as identity: "unknown", so doctor gives the unresolved-identity remediation instead of rename/remove. A missing package.json (ENOENT) stays absent, because then no installed package claims the script; the existing Aube store fixtures depend on that. An oversized or non-regular manifest is also absent (fixed 1 MiB ceiling; REA publishes about 30 KB). Regression: setup keeps a launcher of an unparseable REA manifest unknown, which fails on the previous commit.

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.

Thanks — the Aube change addresses the runtime-switch case: it retains the parsed target and only claims a different-runtime shim when that target is verified as an installed REA package; the unverified managed/direct cases keep their prior handling.

The original finding still applies to ordinary [runtime, script, "mcp"] registrations, though. installedReaPackageEntrypoint returns false both when a path is definitively not an REA installation and when stat, reading, or parsing the manifest fails. In the latter case, entrypointOwnership preserves the initial foreign result rather than reporting unknown. This needs a distinct unresolved result so an unreadable or malformed manifest does not become a foreign-ownership claim.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This follow-up predates b67c9aa. Package evidence is now verified / absent / unknown. A layout-matching manifest that cannot be read or parsed is unknown, and so is a script that does not resolve (latest commit). Both are carried through as identity: "unknown". Covered by setup keeps a launcher of an unparseable REA manifest unknown.

gensokyo-dev and others added 3 commits November 28, 2026 18:27
Node removes `..` before following links, while native traversal follows
links first. A spelling such as `<dir>/link/../scripts/rea.mjs` could
realpath into an installed REA package while another runtime runs an
unrelated script, so it no longer proves another REA installation.

Co-Authored-By: gensokyo-dev <[email protected]>
Shim inspection discarded the parsed target when the shim's runtime was
not this process's, so a saved Aube wrapper stayed unknown after a Node
change even when its target was an installed REA package. Inspection now
reports which runtime the shim uses, and ownership claims another
installation only for a verified REA package target; other targets keep
their earlier classification.

Co-Authored-By: gensokyo-dev <[email protected]>
A launcher in REA's package layout whose manifest cannot be read or
parsed, or whose spelling Node and native traversal resolve to different
files with either one in an REA package, no longer reads as foreign.
Package evidence is now verified, absent or unknown, and unknown evidence
leaves ownership unknown. A missing manifest still means no installed
package claims the script.

Co-Authored-By: gensokyo-dev <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b67c9aa606

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +57 to +58
} catch {
return undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve unknown identity when script resolution fails

When a saved registration uses another still-existing runtime but its cached script has been removed or cannot be resolved, the runtime is classified as foreign and this helper converts both realpathSync failures to undefined; installedReaPackageEvidence then treats that as absent, leaving the whole command definitively foreign. This contradicts the documented removed-cache behavior and directs users to treat an unresolved registration as foreign rather than restore the installation or fix access. Preserve failed script resolution as unknown evidence instead.

AGENTS.md reference: AGENTS.md:L19-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid. A different runtime no longer proves a registration foreign under this PR, so a script that fails to resolve under another existing runtime (for example an nvm switch combined with a pruned _npx entry) has to stay unresolved. Fix (latest commit): installedReaPackageEvidence maps a selection whose realpath fails to unknown instead of absent, and entrypointOwnership carries that as identity: "unknown". That matches the documented removed-cache behavior. Same-runtime branches already returned unknown before reaching this check. Regression: setup leaves a removed installation's launcher under another runtime unknown (acceptance), which fails on b67c9aa and passes now. 18 related files: 454 passed.

A different runtime no longer proves a registration foreign, so a saved
launcher under another runtime whose REA script was removed, such as a
pruned npx cache entry, is now unknown rather than foreign. Doctor then
asks the user to restore or verify the installation instead of renaming
or removing the registration.

Co-Authored-By: gensokyo-dev <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db832d1f33

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 623 to +627
if (interpreterIdentity !== "owned")
return {
identity: currentPathAvailable ? interpreterIdentity : "unknown",
...(currentPathAvailable
? entrypointOwnership(interpreterIdentity, entrypoint)
: { identity: "unknown" }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compare the script before rejecting a changed runtime

When setup is run from the documented source-checkout entrypoint after switching to another still-installed Node runtime, the saved command can be [oldNode, currentCheckoutScript, "mcp"]; this branch passes the interpreter's foreign identity into entrypointOwnership instead of first comparing the script with currentCommandPath. Because a checkout is intentionally not under node_modules/rea-agents, package evidence is absent and setup misclassifies its own exact script as foreign, refusing to refresh the registration. The runtime and script identities need to be evaluated separately; aubeShimOwnership has the same runtime-first behavior for a linked checkout.

AGENTS.md reference: AGENTS.md:L19-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid. The runtime-first decision meant [oldNode, <checkout>/scripts/rea.mjs, "mcp"] never compared its script with currentCommandPath. Fix (latest commit): a new helper, otherRuntimeScriptOwnership, evaluates runtime and script separately. When the runtime is a proven different one, the script is checked under both spellings, raw/native and resolve()/lexical, since the other runtime may use either:

  • both select the current entrypoint → owned with installation: "other" (stale, refreshable);
  • only one does → unknown;
  • neither does → the existing installed-package evidence decides.

aubeShimOwnership uses the same helper for a shim whose runtime differs. Existing Aube assertions that read "not owned" are restated as installation !== "current", the invariant they protect: such a shim is never aligned or kept as equivalent. Regressions: setup refreshes this installation's script under another runtime (acceptance, the CLI fixture runs this checkout's script) and classifies a saved Aube launcher of another runtime whose target is this installation's script. Both fail on db832d1. 18 related files: 456 passed.

A registration that starts this installation's own script under another
still-installed runtime, such as a source checkout after a Node switch,
was foreign because the runtime mismatch was decided first. Runtime and
script identity are now evaluated separately: when both Node's lexical
and native traversal select the current script, the registration is owned
but selects another installation, and setup refreshes it. A spelling only
one traversal maps to the current script is unknown. Aube launchers of
another runtime use the same rule.

Co-Authored-By: gensokyo-dev <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a009ca4472

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

} catch (cause) {
// No manifest means no installed package claims the script; one that
// cannot be read or parsed leaves the package unresolved.
return isEnoentError(cause) ? "absent" : "unknown";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep a missing package manifest unresolved

When a partially pruned installation still contains node_modules/rea-agents/scripts/rea.mjs but its package.json has disappeared, this maps the manifest's ENOENT to absent, so entrypointOwnership reports the registration as foreign. The package-shaped installation is unresolved just like an unreadable or malformed manifest, and classifying it as foreign gives users the manual removal remediation instead of allowing them to restore the installation; return unknown for this case.

AGENTS.md reference: AGENTS.md:L19-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Declining this one, deliberately. A missing package.json is an observed fact: no installed package claims the script. That differs from a manifest that exists but cannot be read or parsed, which stays unknown. npm and npx prune whole package directories, so a pruned cache entry fails script resolution and is already unknown (db832d1). A script that survives while only its manifest disappears is not a layout package managers produce. For that case the result stays foreign, the same as before this PR, so it is not a regression. Changing it would also reclassify the existing mise/Aube store fixtures, which ship scripts without manifests. The maintainer agreed to leave this as is.

@gensokyo-dev gensokyo-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the final diff, review-thread fixes and validation; approving.

@N0zoM1z0
N0zoM1z0 merged commit 4dafa3a into main Nov 29, 2026
56 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/setup-npx-cache-launcher branch November 29, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup: npx-cache launcher paths make REA's own registrations read as foreign

2 participants