Skip to content

fix(npm): preserve native resolver reasons without inferring package absence - #7575

Merged
EffortlessSteven merged 2 commits into
mainfrom
fix/npm-corrupt-native-manifest
Oct 13, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
fix/npm-corrupt-native-manifest

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #7574 under #4491. The npm launcher now preserves the exact native-package resolver reason, package/version and reinstall advice for missing manifests, broken exports and corrupt metadata. It avoids inferring package-directory absence from Node's MODULE_NOT_FOUND, preserves the legacy typed code for compatibility, and validates resolved manifest roots before reading their fields.

Swarm / Source Boundary

  • ordinary package-adapter repair in ripr-swarm

No registry publication, release/tag, credential, analyzer, language activation, dependency version, security-policy or native-payload producer change.

Source-of-truth Links / Candidate Relationships

Issue #7574; parent #4491; RIPR-SPEC-0212. Source acceptance #4710/#4716 is delivered. Native production #4778 and healthy installed journeys #4627/#4632 retain their separate acceptance.
Branch: fix/npm-corrupt-native-manifest.
Final source candidate: 106cce6, tree 5c19118698c9ea5808d15db41bc8d19b66e81ba7.
Original base: 9b53560.
No stack, replacement or payload-production dependency for this diagnostic repair.
Live canonical comments/all-state searches found no equivalent repair before publication. The denied CLI GraphQL route remains stopped; existing authorized connector reads established ownership.

Scope / Acceptance

  • One production behavior: native package resolution diagnostics and recovery.

Production: retain every resolver reason with neutral wording; keep native_package_missing for MODULE_NOT_FOUND and native_package_resolution_failed for other codes; reject non-object manifest roots with contextual typed validation.
Evidence: real public-bin missing-manifest/broken-exports/absence controls, typed cause and root-shape controls, both JS/Rust mandatory-control inventories, README/spec/changelog.

Acceptance: the public launcher identifies the required package/version and actual resolver reason without pretending to know directory presence; errors remain stderr-only, exit1, and never fall back to PATH.

Changelog: changelog.d/npm-corrupt-native-manifest.md follows the Fixed-marker/bullet/reference convention (#4491).
No successor is selected within this leaf.

Support-tier / Policy Impact

No support promotion. Existing JavaScript allowances and npm/Rust policy routes cover edited files. No new dependency, process, downloader, network, workflow, permission or exception.
The required portable-control inventory extends by four names. Unsupported hosts already fail the existing mandatory source-bin control at the exact base; the inherited admission boundary remains unchanged.

Proof

Local Node24.19.0/npm11.9.0/Linux x64 glibc2.41:

  • Three original regressions RED against original production; three strengthened/new MODULE_NOT_FOUND controls RED against49feb280.
  • Repaired full npm test GREEN24/24, zero skips,11 mandatory controls.
  • Independent106 affected-source and installed-consumer review: twelve actual offline installed public-bin cases before/after moving a space/Unicode directory; exact Node reason/cause, package/version/reinstall, blank stdout, PATH refusal, and metadata-restoration validation.
  • Independent focused GREEN3/3; wrong-reason removal rejected3/3; wrong legacy typed-code mutation rejected1/3. Unchanged root-guard/non-MODULE/process evidence retains its original49 identities, with new106 consumer checks covering unchanged malformed/null/exports behavior.
  • node --check and git diff --check pass.

Actual106 npm tarball SHA-256: 76d906c359d4a3678041062e202ea38c0149b539543312eb0d2d68d4400afcf9.
Installed/exact-source launcher SHA-256: 24f7d10665f51fa2e51db888759bfdd917bcc40c7fe8a79659830c987e859b7c.
Package version remains0.11.0. Native metadata corruption is planted after real offline scripts-disabled npm installation; no healthy native ripr executable is substituted or claimed.

Prior published49 hosted npm run38333476670 passed Node20.20.2/npm10.8.2 and Node24.21.0/npm11.19.0 on integration77d6ddc6: each23/23, zero skips,10 mandatory controls and exact six-file pack inventory. Those results qualify49's tested dimensions, not the changed106 MODULE/public-claim/control inventory.
Original required Rust run38333558711 completed SUCCESS at49 (worker115088559779, authoritative Result115098328644), on its original integration77d6ddc6. It is predecessor evidence and does not qualify106. Current 106 hosted qualification completed SUCCESS: run 38336945462 attempt 1, worker 115099146593 and required Result 115112466447/app 15368. Actual tested integration ddab3e4, parents 3476239 + 106cce6. Observed rustc 1.95.0 (59807616e 2026-04-14); default-feature workspace nextest: 14,838 executed/passed, 2 skipped, 33 slow; separate doctests: 2 passed, 1 ignored. Fresh nonzero-JUnit validation and test-report upload succeeded. All required policies/compile/Clippy/goldens/fixtures/verdict/PR evidence steps succeeded. All 36 reported checks are completed success/skipped. Final independent exact published-head review is REVIEW_READY, based on source/consumer/adverse inspection plus actual terminal execution evidence. Both repaired/refuted threads are verified resolved; no new substantive finding remains. Normal protected expected-head squash is the sole convergence path.
The original nextest artifact11785360932 is retained by Actions with reported digest8aad95be6c120eefe96378ead73c3340a6b9708f532517c5dbc250a461255b9c. Connector download succeeded, but environment transfer of the returned file URL was blocked by proxy403; that transfer route is stopped. Artifact contents/bytes are not locally verified and remain an explicit review evidence gap. Authorized decoded job-log and metadata reads continue; no alternative transfer or denied-policy read is retried.

Current Node 20.20.2/npm 10.8.2 and Node 24.21.0/npm 11.19.0 run 38336935104 each passed 24/24, zero skips, 11 mandatory controls and the six-file pack inventory on the actual ddab integration. Supplemental no-publish Python run 38336935121 also completed wheel/pip/uv jobs; it is hosted workflow evidence, not a local healthy Python journey claim.
Current nextest artifact 11786269777 is retained by Actions (499,043 bytes; reported digest 6896635f35e0e6b862f59145d35c3b3543178c1f36277f6f0dcd3a6442324e3e, expires October 18). Authorized decoded logs and metadata are independently inspected; no raw ZIP/XML content or custody is claimed. No content transfer was retried.
Latest fetched main 5ba5912 has no changes from the tested base in affected or governing CI/review/policy paths; normal combined-tree preview 2eb8dfd810307eefefa13b880d0b15741bb405c3 is clean. This preview is not a fresh CI run. Behind-only movement needs no restack.

Claim Boundary

This is a bounded installed-wrapper error/recovery repair. The local environment has no Cargo/rustc or staged native ripr payload. No local Rust policy/compile, healthy native analysis, Python wheel, native Windows, public install, release or five-target qualification claim.
The effective branch-rules fetch URL was unsupported; readable branch metadata identifies protection and required Ripr Rust Small Result. Keep the admission-read gap explicit; no denied route retry, admin/settings bypass or inferred permission.

Rollback / Traceability / CI Economics

Revert the diagnostic/root validation and supporting tests/inventories/spec/docs together.
RIPR-SPEC-0212 maps launcher.test.cjs, lib/launcher.cjs, stderr/README and mandatory-control pass count. Existing file-granular traceability covers the paths.
Existing npm Node20/24 lane and required Rust policy own the changed surfaces. No workflow/runner/protection change; normal Draft-to-Ready qualification is required for the final head.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5e3f3d17-b330-4f6d-af7a-3e6ad60c3d96
📥 Commits

Reviewing files that changed from the base of the PR and between 591f436 and 106cce6.

📒 Files selected for processing (7)
  • changelog.d/npm-corrupt-native-manifest.md
  • docs/specs/RIPR-SPEC-0212-npm-native-launcher-boundary.md
  • packaging/npm/launcher/README.md
  • packaging/npm/launcher/lib/launcher.cjs
  • packaging/npm/launcher/test/launcher.test.cjs
  • packaging/npm/launcher/test/run-tests.test.cjs
  • xtask/src/policy/distribution/npm_launcher.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reviewed_head_sha: 49feb28
integration_basis: 9b53560; published PR currently targets main 591f436
claim_boundary: #7574 corruption diagnostics, not healthy native/payload/Python qualification.

Independent exact-head source/consumer inspection found no actionable source or test-oracle defect. Inspected resolveNativeExecutable and public bin; name/version/target/schema/executable confinement and launch consumers; three regressions; both mandatory-control inventories; README/spec/changelog, file allowance and CI routing.

Observed independent actual npm pack/offline scripts-disabled install: malformed/null package JSON before/after moving a space/Unicode consumer directory retain authentic Node ERR_INVALID_PACKAGE_CONFIG reason, exact package/version, stderr-only exit1. Actual exports refusal retains ERR_PACKAGE_PATH_NOT_EXPORTED. Genuine absence still reports missing; valid restored metadata reaches missing-executable validation. PATH markers remain absent. An explicitly labeled synthetic Node probe confirms restored launcher argv/cwd handling; it is not native ripr.

Independent focused GREEN 3/3 zero skipped. Restoring broad catch fails two of the three regressions; removing only root guard fails one. Original author RED3/3 behavioral failures and author full GREEN23/23, ten admitted controls, were inspected. Candidate tarball a83a73de270e51904ef01539e0c0b3bf00cc90281a74050419d70ab61a1aa4dc and installed/source launcher d912d7e24fff4ccc619ef0fc46bad7286ebe6c9b0cee18a914b6f3ebf200b761 independently match the exact source. Node24.19.0/npm11.9.0/Linux x64 glibc2.41. All review process groups were observed reaped/gone.

Independent evidence: /workspace/package-first-use/evidence/exact-head-review.txt and independent-review/{commands,states,receipt}.json, experiment diffs/TAP, actual tarball. The initial review finalizer incorrectly expected runtime compile-cache absence; corrected resource accounting distinguishes the owned cache from test fixtures without retrying product tests.

No blockers in inspected code. Ownership/publication gaps in the pre-publication review are now resolved by successful existing connector reads, all-state searches and this exact-head PR. Hosted Node20/Rust/policy/required integration checks, remote reviews/threads and final integration readiness remain pending.

Disposition: REVIEW_INCOMPLETE. COMMENT records source/consumer review and author synthesis; it is not an approval or permission to merge. Preserve native/Python/platform nonclaims and complete normal hosted qualification plus final exact published-head review.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 01:44
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Devin Review

Comment thread packaging/npm/launcher/lib/launcher.cjs Resolved

Copy link
Copy Markdown
Member Author

Continuation at exact head 49feb2805f2880ecb10d638fbe9ca40c3fd0af2a: source repair and independent local/published-head review are complete for #7574. npm run 38333476670 passed both Node 20/24 jobs: each 23/23, zero skips, ten mandatory controls, six packed files. Independent installed consumer and broad-catch/root-removal controls are retained; no native product/Python qualification claim.

WAITING_REQUIRED_CHECKS: normal Ready-triggered run 38333558711, attempt 1, worker 115088559779 remains in Repository policy preflight. No retry, head rewrite, workflow/settings change or merge has occurred. The next delivery pass must inspect its terminal authoritative Ripr Rust Small Result, actual worker steps/source identity/test/artifact denominators, current reviews/threads, and integration state; then refresh independent exact published-head review before normal protected squash merge. #4491 remains open for separately owned native payload/installed product acceptance.

Delivery continuation is with the initiating engineering task and its next bounded pass, using this unchanged candidate. Local source checkout is intact and clean; branch/worktree, original/repaired npm tarballs, commands, exact review records, a verified prerequisite-bound Git bundle/patch and verified recovery archive are retained under /workspace/package-first-use/evidence/. Consumer/cache roots were recoverably archived only after process release and byte/metadata restoration verification. Reviewer session can resume at terminal hosted evidence; there is no unarranged background monitor.

Access limits retained: the two CLI GraphQL issue/PR-list actions returned Post "https://api.github.com/graphql": Forbidden and that route stayed stopped. The existing GitHub connector successfully established ownership and published this PR without credential changes. Its effective branch-rules URL was unsupported (INVALID_ARGUMENT); readable branch metadata confirms protection and required Ripr Rust Small Result. Any later merge uses the ordinary enforcement endpoint, with no admin/settings bypass.

@github-actions github-actions 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.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • MODULE_NOT_FOUND split misclassifies present-but-unreadable manifests as missing; devin-ai flagged this and diff has no fix.
  • xtask REQUIRED_EXECUTED_TESTS list was extended with 3 names but no reviewer-visible check that xtask test admission also tolerates hostPlatformOrSkip-skip behavior; if xtask runs the suite the same way as run-tests, off-host CI may fail.
  • REQUIRED_PORTABLE_TESTS now contains 'public bin identifies corrupt package metadata and recovers after restoration', which hostPlatformOrSkip() returns null for on unsupported hosts. Either gate the new public-bin test name out of REQUIRED_PORTABLE_TESTS or change run-tests.test.cjs to skip names that hostPlatformOrSkip skips. (packaging/npm/launcher/test/run-tests.test.cjs:9).
  • README diagnostic paragraph adds 'corrupt or resolution is refused' wording but never states which error.code maps to which user message; new resolution_failed code is not surfaced in README contract.

Verification questions

  • Confirm run-tests.test.cjs adds 3 new REQUIRED_PORTABLE_TESTS names that exactly match launcher.test.cjs test() strings; xtask list is parallel.
  • Confirm devin's review-comment on line 198: installed-but-incomplete native (missing package.json OR exports->missing) still hits MODULE_NOT_FOUND branch and is misreported as absent. Split is code-based, not shape-based.

Refuted

  • readJsonFile of a missing package.json will not throw but yields null, so assertPlainObject covers the missing-manifest case; refuted because: reviewer already covers this; assertPlainObject only fires when readJsonFile returns a non-object value. When the manifest file itself is missing, readJsonFile typically throws synchronously before returning; resolver.resolve fails first with MODULE_NOT_FOUND. The new regression only exercises the post-resolve manifest-shape path, not a missing-manifest path.
  • Devin's second review-comment on run-tests.test.cjs:9: REQUIRED_PORTABLE_TESTS includes a public-bin test that skips on unsupported hosts, so npm test fails on those hosts.; refuted because: Confirmed genuine concern, but it is a CI economics / test-admission issue owned by the tests-red-green lane, not a source-route finding. Reporting as summary-only would cross lane boundaries; demoted to failed_objection.
  • assertPlainObject would reject valid native manifests shaped as arrays/null after npm normalizes; refuted because: Native packages are documented to expose an object package.json; null/array/boolean/number/string shape tests cover exactly the guard. The README/spec language uses 'manifest', not array.

Parked follow-ups

  • MODULE_NOT_FOUND case can absorb a present-but-manifestless package (exports miss or deleted package.json). Out of scope for #7574 but worth a follow-up issue to widen the split when ERR_MODULE_NOT_FOUND with a package subpath is identified.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Disposition: REPAIR_REQUIRED at exact published head49feb2805f2880ecb10d638fbe9ca40c3fd0af2a. The new missing-manifest/broken-exports finding is valid: MODULE_NOT_FOUND does not establish package-directory absence, and old49's public diagnostic conceals the actual reason. Independent real installed49 controls reproduce genuine absence, an existing directory without package.json, and a broken exports target as three intended RED conditions. Local committed repair106cce606e8b8761b347aab8216fe1103e6d9097 preserves all resolver reasons with neutral wording while retaining legacy typed codes; three strengthened/new regressions went RED on49 and the complete repaired npm suite passes24/24, zero skipped,11 required controls. Independent exact106 review remains underway. Original Rust run38333558711 must reach terminal without cancellation before follow-up publication/current-head qualification. Earlier no-source-finding review is superseded for this newly challenged MODULE diagnostic dimension, not fabricated into readiness. Other unchanged original consumer/root-guard/non-MODULE evidence remains bound to49. No merge/auto-merge is authorized at this known-incomplete head. The unsupported-host admission finding is inherited from exact9b53560 base, independently verified and source-refuted in thread4253919867 with visible reply4253984728; that thread resolution was verified. Native/Python/platform/publishing/access-rule nonclaims remain intact.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 13, 2026 02:26
@EffortlessSteven EffortlessSteven changed the title fix(npm): distinguish corrupt native packages from missing dependencies fix(npm): preserve native resolver reasons without inferring package absence Oct 13, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 02:27
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reviewed_head_sha: 106cce6
integration_basis: actual tested ddab3e4, parents 3476239 + 106cce6; normalized base metadata is stale.
claim_boundary: #7574 bounded npm native resolver diagnostics and root validation under #4491.

Independent published106 source/consumer review found no actionable remaining source/oracle defect. The valid missing-manifest/broken-exports finding is repaired with neutral wording that preserves every original Node resolver reason, exact package/version/reinstall advice and legacy MODULE_NOT_FOUND typed compatibility. Twelve actual offline installed public-bin cases before/after a spaces/Unicode directory move cover absent/missing/broken/malformed/null/blocked-export manifests, blank stdout, exit1 and PATH refusal. Metadata restoration reaches the next executable validation. Exact actual tarball/source hashes and wrong-reason/legacy-type mutation rejection are retained. Other original root/non-MODULE proof retains its original identities.

Current hosted Node20.20.2/npm10.8.2 and Node24.21.0/npm11.19.0 each pass24/24 tests, zero skips,11 mandatory controls, with the exact six-file pack inventory. Both review threads were reread resolved after the published106 repair/source-backed inherited-policy refutation. Stale49 automated summaries are reconciled by those verified responses; quota/skipped/rejected provider outputs are not clean review.

All seven affected integration files equal106, with the pre-existing affected base files unchanged from original9b. Later main classifier movement is unrelated and does not require restacking. Current required run38336945462 attempt1 has passed preflight/policies/compilation/Clippy and is executing Required Rust tests. Its terminal logs, actual denominator/compiler/integration, freshness/nonzero-JUnit guard, retention metadata and required Result remain outstanding; old49 success does not qualify106.

Disposition: REVIEW_INCOMPLETE pending that exact-head hosted qualification and final review refresh. Raw Actions ZIP/XML bytes and complete effective-policy reads remain explicit uninspected gaps; all previously denied routes stay stopped. No stronger artifact-custody, native/Python/Windows/publication claim or admin/settings bypass. This COMMENT records independent review synthesis, not an author approval or merge permission.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Disposition: REVIEW_READY for exact published head 106cce6 (tree 5c19118698c9ea5808d15db41bc8d19b66e81ba7), bounded #7574 / #4491 / RIPR-SPEC-0212 launcher repair.

Independent review inspected the full seven-file delta, resolveNativeExecutable/public bin and identity/version/target/schema/executable/launch consumers, both named-control inventories, package inventory, README/spec/changelog, runtime/platform/security boundaries and actual rendered diagnostics. Twelve actual offline packed/installed public-bin cases before/after a spaces/non-ASCII move retain authentic Node reasons/causes/types, exact package/version/reinstall advice, empty stdout, exit1 and PATH refusal. Restored metadata reaches payload validation. Independent focused GREEN3/3; wrong-reason mutation rejected3/3 and wrong legacy-code mutation rejected1/3. Unchanged original root/process witnesses retain their original identities; no native payload is invented.

Actual tarball SHA256 76d906c359d4a3678041062e202ea38c0149b539543312eb0d2d68d4400afcf9 and installed/exact-source launcher 24f7d10665f51fa2e51db888759bfdd917bcc40c7fe8a79659830c987e859b7c match version0.11.0. Hosted Node20/24 each pass24/24, zero skips,11 required controls and exact six-file pack inventory.

Required run38336945462 attempt1 completed SUCCESS; worker115099146593 and required Result115112466447/app15368 independently verified. Actual checkout ddab3e4 = 3476239 + 106. Observed rustc1.95.0/full59807616e1fa2540724bfbac14d7976d7e4a3860; default-feature nextest14,838 executed/passed across79 binaries,2 skipped,33 slow; separate doctests2passed/1ignored. Fresh nonzero-JUnit guard/retention succeeds. Policies/compile/Clippy/goldens/fixtures/verdict/PR-evidence gates pass; operational skipped steps are not called passes. Result evaluated TARGET=github, REASON=runner_api_failed and GITHUB_RESULT=success. All36 primary checks are terminal success/skipped.

Both threads are resolved after actual published repair/source-backed inherited-policy refutation; all current comments/reviews inspected. Quota/stale/rejected provider outputs remain missing provider review; substantive independent review supplies the valid alternative. No source/oracle blocker remains.

Current main5ba591221469a3bc1f51e719645978472770f3c8 has zero changes from tested base across31 affected/governing/compiler-input paths; clean preview2eb8dfd810307eefefa13b880d0b15741bb405c3 preserves all7 exact106 blobs. Preview is not a fresh CI run; unaffected behind-only movement needs no restack. Final root must still verify actual protected merge/main/leaf acceptance.

Raw ZIP/XML/run-context contents and archive custody remain uninspected. Artifact metadata/upload agreement establishes retention identities, not archive verification. Full effective-rule details remain unread; all denied routes stay stopped. No stronger native/Python/Windows/release claim, settings/admin bypass or publication. COMMENT is author synthesis of the independent final record, not a platform approval. Independent final record: /workspace/package-first-use/revision-evidence/final-review-ready.txt. All reviewer readers/local consumers released.

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.

fix(npm): preserve corrupt native-package resolution errors

1 participant