Skip to content

chore: remove unused npm test fixtures - #180933

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/slopmeter-npm-fixture-retirement-20261022
Oct 22, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/slopmeter-npm-fixture-retirement-20261022

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #171994

What Problem This Solves

Package-install tests retain uncalled fixture paths and an assertion module whose last callers were retired.

User Impact

No user-visible change, configuration change, migration, or required action. No test case or executed assertion is removed.

Why This Change Was Made

Retire the unused npm-pack mock and install-assertion wrapper, their unique dependencies, and the now-unreachable assertion module. Inline the remaining npm-view mock into its existing owner instead of retaining a single-caller view/pack abstraction. This removes 97 net test-support lines across two files, with zero production changes or new helpers/options.

The view mock retains its async two-argument callback, command guard before metadata access, invocation-time metadata reads, exact error and JSON/property order, defaults, closure isolation, and implicit undefined return. The shared command-result constructor, failure cases, and integrity assertion are byte-identical. The last hook callers disappeared in 04a0bdfa025d23ae4831207b549d62c2c5a0094b; existing install/pack script-suppression assertions remain at their owning boundaries.

Evidence

  • The same 100 tests across three files passed before and after, with identical reported case names and order. Baseline wall time: 62.27s; candidate: 59.26s. These are preservation runs, not a performance claim; compiler-cache warmth can differ.
  • Scoped plugin/platform and infrastructure test typechecks passed (5.41s and 3.90s), as did typed lint (zero warnings/errors), formatting, and git diff --check. Fresh independent P0–P2 review completed with no findings.
  • An additional actual-source callback comparison matched guard-before-getter behavior, callback arity, deferred metadata reads, exact errors and serialized output, undefined fields, ignored options, result defaults, and per-call isolation.
  • All three required dead-code commands ran on clean baseline and candidate. They remain failed, not waived: dependency findings and unused-file findings match exactly; production exports match; full-tree exports shrink only by the two retired fixture exports, with no additions. The export scan completed production, full-tree, and script phases; the script phase passed.
  • Every testcase file is byte-identical, including all three exercised suites. Their executed assertions, hooks, waits, and mock call sites are unchanged, as are production code, public APIs, dependencies, configuration, and defaults. No ignore rule, baseline, or expected failure was changed.

Hosted CI qualification

The original exact-head CI attempt failed: 67 terminal jobs, 36 successful / 29 skipped / 2 failed, totaling 6,684 cumulative job-seconds (not billing or a performance comparison). The failed leaf is checks-node-changed-2; the other failed job is its downstream combined gate.

Its three failures are existing update-CLI expectations: automatic service-Node refresh, nvm recovery, and the target-schema runtime-refusal reason. The same cases and signatures were observed on ancestral scheduled main in the Node-runtime job and the target-schema job. That checkout (827aae9c0bf17f8f27b6db0447a68ba9e3e5b42d) is an ancestor of the actual tested base (9395f44dccb97c38cec985c0a480daabc43878d9). The tested merge's ordered parents and full tree were reconstructed and verified.

The refusal producer, failed tests, runtime mocks, engine policy and lockfile are unchanged by this PR. The shared npm helper module does change, but its consumed createCommandResult constructor is byte-identical and pure; the changed view mock is not used by these cases. Earlier-main package-version and version-resolver drift was inspected; the failed scenarios use explicit target/engine fixtures. Historical grouping/cache settings differ, so this is ancestral execution plus scoped source attribution, not a claimed exact-base replay.

The automatic failure table remains unknown because the newer scheduled-main run has no matching job name. This qualification uses the matching individual cases instead; neither the table nor the failed CI is relabeled green. An existing expectation repair is tracked separately in #180939; no duplicate fix or CI rerun was started here. The native inherited-failure route must still verify current writer authority, exact head, review, security, complete job accounting, and the retained recovery history.

This is offline preservation proof using synthetic package fixtures and mocked npm execution. No real package installation, operator Gateway, external account, device, or paid-provider run was performed or claimed. Hosted CI remains failed as documented above; native inherited-CI admission and independent review/security gates remain required.

Focused command and remaining failures
pnpm test src/plugins/install.npm-spec.test.ts src/hooks/install.test.ts src/infra/install-source-utils.test.ts --maxWorkers=1
pnpm deadcode:dependencies
pnpm deadcode:unused-files
pnpm deadcode:exports

Baseline: 1e56117f00f5858e025bdc7f4f396c7567ab32ee. Test runs used separate temporary roots and filesystem module caches.

Each dead-code command returned exit 1 on both trees. Existing production unused exports/types and the unrelated unused scripts/perf/doctor-metadata-retention.ts remain unresolved. Complete normalized findings are identical except for removing expectInstallUsesIgnoreScripts and mockNpmPackMetadataResult from the full-tree unused-export report. No failed result is represented as passing.

Contributor credit: @vincentkoc.

Work sessions


Original session

Retire uncalled fixture paths and their orphaned assertion module. Preserve the remaining npm-view callback semantics and all existing testcase files.

Co-authored-by: vincentkoc <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 22, 2026 19:28
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 22, 2026 19:34
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Removes unused npm fixture exports and their orphaned assertion module, then inlines the remaining metadata mock.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-verified, with reported preservation runs; its evidence is test-only and does not claim shipped-entry-point execution.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-support cleanup has no changed shipped behavior; the body supplies baseline/candidate preservation results using mocked npm execution, which this review did not rerun.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: Maintainer-directed cleanup removes unreachable maintenance burden while preserving active tests, runtime-aware command matching, and callback semantics.

Merge readiness

✅ Ready for maintainer review

This PR is a useful, focused cleanup with no actionable correctness findings; maintainer authorship also rules out automatic closure.

Priority: P3
Reviewed head: 56f103cbcc9d4d7be40fa4631b34f0f9e0d62525

Before merge

None.

Findings

None.

Agent review details

How this fits together

Shared test utilities supply synthetic npm command results to plugin, hook, installer, and update tests; this change preserves the active consumers without changing production execution.

flowchart LR
  A[Installer tests] --> B[Shared npm fixtures]
  B --> C[Mock command callback]
  C --> D[Synthetic command result]
  D --> E[Installer production owner]
  E --> F[Existing assertions]
Loading

Technical review

Best possible solution:

Land the focused removal through the normal exact-head CI gates while retaining the existing installer suites.

Do we have a high-confidence way to reproduce the issue?

There is no reported production bug; source inspection confirms the removed fixture exports are unused and the active mock has preserved consumers.

Is this the best way to solve the issue?

This is the smallest complete cleanup: remove unreachable helpers and inline their sole surviving shared branch without replacing them with new machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47c1380a2a89.

Provenance checked

  • npm metadata mock abstraction keeps the original intent (81e58e7: The earlier cleanup shared view/pack callback scaffolding; with pack unused, preserving that abstraction no longer serves an active caller.)
  • runtime-aware command matching keeps the original intent (a9074f2: Fixtures were updated to recognize the selected Node or Bun npm command prefix; this PR retains npmCommandArgs.)
  • install staging assertions and pack fixture keeps the original intent (6aa8084: The helpers supported secure staged installation and npm archive fixtures; current callers are gone and active owner assertions remain. Older-blob traversal encountered the documented missing-object limit, so no stronger introduction claim is made.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

PR surface

Tests -97. Total -97 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 7 104 -97
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 7 104 -97

Labels

Label changes:

  • add P3: Low-risk maintenance of unused test support with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Low-risk maintenance of unused test support with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 3:44 PM ET / 19:44 UTC.

@roboclaw-bot
roboclaw-bot disabled auto-merge October 22, 2026 20:03
@roboclaw-bot
roboclaw-bot merged commit a918e88 into main Oct 22, 2026
204 of 207 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/slopmeter-npm-fixture-retirement-20261022 branch October 22, 2026 20:10
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
Retire uncalled fixture paths and their orphaned assertion module. Preserve the remaining npm-view callback semantics and all existing testcase files.

Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant