@monochromatic-dev/dev-script-catalog-tighten.matrix #
Containerised end-to-end matrix for catalog-tighten.
A sidecar of
package/dev-script/catalog-tighten,
it proves the tool resolves the active
installed version and tightens the catalog floor correctly across every pnpm
install layout,
in isolated containers.
What it covers #
Each scenario installs a tiny fixture workspace (two consumer packages,
both
depending on a pinned picomatch) under one pnpm layout,
applies an optional
post-install mutation,
then asserts the tool tightens picomatch from >=4.0.0
to >=4.0.2,
reports a MISS or an UNDCL,
or fails cleanly.
Layout and settings (expect tighten):
nodeLinker: isolated, hoist on and off.nodeLinker: hoisted, hoist on and off.nodeLinker: pnp(pnpm's pnp is a hybrid that keeps per-importernode_modulessymlinks).nodeLinker: pnpwithsymlink: false(pnpm's recommended pnp config): a true no-node_moduleslayout, resolved through.pnp.cjs; this is the case that exercises the PnP reader.modulesDirrenamed,virtualStoreDirrelocated,enableGlobalVirtualStore,storeDirrelocated.- Stale orphan:
a higher
picomatch@4.0.4is seeded into the virtual store with no symlink; the tool must tighten to the active4.0.2, never the orphan. This is the regression proving the old store-scan removal was correct (seedoc/troubleshooting/pnpm-modules-cache.md).
Missing-X robustness:
- Missing lockfile,
missing store,
missing some
node_modules(one consumer), missing pnpm (pnpm config getunavailable), and missing.pnp.cjsunder the default pnp linker (its symlinks survive): still tighten, because resolution reads on-disk state. - Missing virtual store (
node_modules/.pnpmdeleted, symlinks left dangling): MISS. Missing.pnp.cjsundersymlink: false(no symlinks left to fall back on): MISS. - Store-only orphan (package undeclared in both consumers and their
node_modulesremoved, root.pnpmkept): UNDCL, because the package is present in the store but no importer declares it directly. A package a live importer still declares is never labelled undeclared, even when its resolution path is broken (thesymlink: falseplus missing.pnp.cjscase stays a MISS). - Missing all
node_modules, missingpnpm-workspace.yaml: fail cleanly with a clear error.
How it runs #
test:matrix runs the orchestrator,
which for each combination launches a
podman container:
- The monorepo is bind-mounted read-only at
/repo, so catalog-tighten and itsyamldependency resolve through the mounted symlinks without a build. - The fixture is written and installed in a writable tmpfs at
/work. - pnpm is provisioned by corepack at the pinned version; the rootfs is read-only and caches go to tmpfs.
- Per-container memory, cpu, and pid caps bound resource use.
Network is required (the fixture install pulls from the registry),
so this is
not part of the standard test:unit run.
Usage #
# Run the full container matrix (needs podman + network)
mise run //package/dev-script/catalog-tighten.matrix:test:matrix
# Fast host-only unit tests for the fixture builder
mise run //package/dev-script/catalog-tighten.matrix:test:unit
Layout #
src/combos.ts: the combinations and the fixture file content (pure, unit-tested).src/in-container.ts: the per-combination entrypoint that runs inside a container.src/matrix.unit.matrix.test.ts: the orchestrator that launches one container per combination.