Skip to content

fix(core): preserve npm lock when plugin SDK resolves locally - #542

Merged
LeXwDeX merged 3 commits into
devfrom
feat/541-preserve-npm-lock
Sep 4, 2026
Merged

fix(core): preserve npm lock when plugin SDK resolves locally#542
LeXwDeX merged 3 commits into
devfrom
feat/541-preserve-npm-lock

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Closes #541

Why

TUI dependency initialization deleted a valid config package-lock.json whenever the plugin SDK was satisfied by an existing local or bundled copy. The following dirty check then reified the project again, causing lock churn and repeated npm installation on every launch.

What changed

  • Preserve the lock when every requested dependency is already satisfied locally or from the bundled SDK.
  • Retain lock invalidation for mixed batches that still contain registry dependencies.
  • Replace deletion-pinning tests with consecutive-install regressions for local and bundled plugin resolution.
  • Pin genuine mixed-dependency and package.json-drift reification behavior.
  • Add a two-initialization regression through the real TuiConfig.defaultLayer and waitForDependencies seam.
  • Restore all test-owned environment variables after each test.

Evidence

  • Core npm focused tests: 8 passed, 20 assertions.
  • TUI config startup regression: 1 passed, 3 assertions.
  • Core full suite: 1230 passed.
  • Core and opencode typechecks passed.
  • Root lint passed with 4838 warnings, below the 4850 ratchet.
  • Mutation check: restoring the old unlink condition makes both lock-preservation regressions fail.
  • DAG verification and review: ACCEPT with no blocking findings; parent additionally hardened environment restoration.

Checklist

  • Local plugin resolution preserves lock bytes, inode, and mtime across two installs
  • Bundled plugin resolution preserves lock bytes, inode, and mtime across reinstall
  • Mixed missing dependencies and package drift still reify
  • Two real TUI/config dependency initializations leave the lock stable
  • Local > bundled > registry precedence is unchanged

@LeXwDeX LeXwDeX changed the title Delivery preserve-npm-lock fix(core): preserve npm lock when plugin SDK resolves locally Sep 4, 2026
@LeXwDeX
LeXwDeX marked this pull request as ready for review September 4, 2026 11:01
@LeXwDeX
LeXwDeX merged commit 8060765 into dev Sep 4, 2026
12 checks passed
@LeXwDeX
LeXwDeX deleted the feat/541-preserve-npm-lock branch September 4, 2026 11:33
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(core): preserve npm lock when plugin SDK resolves locally

1 participant