Practical Analyses l3_builders

Why the local AI tool isn’t building: lockfile → headless PASS

Practical Release: Reproducing package-lock desync, locking Node/npm, writing preflight checks, and proving UI launch with real headless Chromium tests.

Related video

Open video on YouTube

CodeVibers Practical Episode: Reproducing package-lock desynchronization, locking Node/npm versions, writing preflight checks, and verifying UI launch with a real headless Chromium test.

Chapters

  • 00:00 Intro
  • 00:20 CodeVibers
  • 00:35 CodeVibers
  • 00:50 setup screencast
  • 01:18 implementation screencast
  • 01:54 run screencast
  • 02:28 failure edge screencast
  • 02:57 validation screencast
  • 03:24 result screencast
  • 03:56 ci integration screencast
  • 04:27 artifact contract screencast
  • 05:02 CodeVibers
  • 05:19 CodeVibers

Shorts

Episode sources

Project source files from the episode

This is the same reproducible project built and tested in the video.

  • package.json — Pinned Node/npm/Playwright contract.
  • package-lock.json — Committed lockfile regenerated during setup.
  • scripts/preflight.mjs — Lockfile and runtime validator.
  • scripts/smoke.mjs — Real Playwright browser smoke.
  • scripts/run-demo.mjs — Expected fail then clean pass orchestration.
  • server.mjs — Local application and health endpoint.
  • public/index.html — Visible UI tested by Chromium.
  • tests/preflight.test.mjs — Positive and edge regression tests.
  • fixtures/bad-package.json — Intentional package mismatch.
  • fixtures/bad-package-lock.json — Lock side of mismatch fixture.
  • scripts/show-demo.mjs — Isolated visible Chromium runner for setup, CI and artifact proof recordings.

Run and test commands

npm run demo
npm test

Download project ZIP

Practical material from the episode

Artifact: Runnable Node toolchain preflight plus Playwright headless smoke project.

Expected outcome: Project files, npm commands, bad fixture, reports and screenshot.

Visible result: LOCK_MISMATCH is blocked; synchronized project reaches HEADLESS PASS in Chromium.

Demo input: Bad package/lock pair and the corrected local project.

Demo output: reports/bad.json, reports/preflight.json, reports/smoke.json and reports/smoke.png.

Result validation: Expected failure exit 2, clean preflight exit 0, four unit tests pass and headless browser finds HEADLESS PASS.

How to build it

  1. install pinned dependencies
  2. run bad preflight
  3. inspect validator code
  4. run clean project
  5. launch Chromium smoke
  6. open proof screenshot
  7. pin runtime
  8. write preflight
  9. reproduce lock mismatch
  10. launch server

Pre-pilot checklist

  • LOCK_MISMATCH exists in bad report
  • preflight status passed
  • tests pass
  • smoke screenshot exists
  • bad fixture exits 2 with LOCK_MISMATCH
  • clean preflight passes
  • headless Chromium writes smoke.png
  • all regression tests pass

Example commands, settings, or rules

npm ci --ignore-scripts
node scripts/preflight.mjs
npm run demo
npm test
package.json
package-lock.json
scripts/preflight.mjs
scripts/smoke.mjs
scripts/run-demo.mjs
server.mjs
public/index.html
tests/preflight.test.mjs

Requirements and recommendations

Requirements

  • committed `package-lock`
  • Supported Node/npm
  • Installed Chromium
  • separate health endpoint

Recommendations

  • Use `npm ci`
  • Fix `packageManager` and `engines`
  • Run headless smoke tests after preflight

Core of the topic

Practical Release: Reproducing package-lock desync, locking Node/npm, writing preflight checks, and proving UI launch with real headless Chromium tests.

What’s important to take

  • Add `npm ci`, `node scripts/preflight.mjs`, and `npm run smoke` before building the product.
  • The viewer will receive a ready-to-use preflight and headless smoke harness for a local AI/web tool.
  • Do not list reasons for the build: reproduce the lock mismatch and confirm the fix with this browser.
  • Replace manual UI opening with a deterministic fail/fix/pass contract.

How to apply in practice

Use the material as a starting point: define the task, scope the application area, select a quality metric, and validate the result on a small-scale scenario before production deployment.

Practical Steps

  1. install pinned dependencies
  2. run bad preflight
  3. inspect validator code
  4. run clean project
  5. launch Chromium smoke
  6. open proof screenshot
  7. pin runtime
  8. write preflight

Recommendations

  • use `npm ci`
  • Fix `packageManager` and `engines`
  • Run headless smoke tests after preflight.

Requirements and Limitations

  • committed package-lock
  • Node/npm supported
  • Installed Chromium
  • separate health endpoint

Examples

  • Playwright 1.60 in package.json vs. 1.61.1 in lock
  • Node 20 vs. range >=22 <27

Anti-examples

  • `npm install` in CI silently overwrites the lockfile and hides the cause.

How to check readiness

  • bad fixture exit code 2
  • clean preflight exit code 0
  • HEADLESS PASS and reports/smoke.png

Release Navigation

  • 00:00 What We Break and Assemble
  • 00:55 Lock the toolchain
  • 01:40 Writing preflight
  • 03:00 Fail and clean run
  • 04:20 Tests and Chromium
  • 05:35 Ready CI order