Engagement Report: Re-Verifying a Silent Diff-Engine Failure

A fourth redacted-format report, different shape from the others: no bug to find this time, just a claimed fix re-run against current dependencies to confirm it still holds, plus a live diff against two freshly generated test images.

Fourth sample engagement report, on Cyclops, a Playwright visual-regression and AI-polish loop. This one has a different shape than the previous three: the October 11 pass had no automated test suite to run and found no new bug that night. A later suite is recorded in the October 25 follow-up below. The finding here is the re-verification itself, confirming a previously claimed fix still holds on today's dependency versions, which is a real and separate kind of engagement work from finding something new.

Scope and Objective

Target: src/differ.js, the component that compares a before/after screenshot pair and reports the mismatched pixel count, built on the pixelmatch library.

Objective: a prior pass on this repo documented a real bug: pixelmatch@7 shipped ESM-only, which broke every diff run under plain CommonJS require(), silently, because Node's interop returns a wrapper object instead of throwing. The claimed fix was accessing .default on the required module. Confirm that fix is still correct and still necessary on the dependency versions actually installed right now, not the versions in place when it was first found.

Finding: The Original Failure Mode, Reproduced

Calling require("pixelmatch") directly in the currently installed [email protected] returns a module object whose real function lives on .default, not the object itself. Calling the returned object as a function throws immediately. This confirms the original finding is not stale: the ESM-only export shape that broke diff runs then is the same shape installed today. The fix in the codebase, require("pixelmatch").default, is still the correct and necessary one, and src/differ.js carries it with an inline comment explaining why, so the next person who upgrades this dependency doesn't rediscover the same failure from scratch.

Verification: A Real Diff, Run Tonight

Rather than trust the fix from reading the import line alone, two real 100×100 PNGs were generated tonight, identical except for one deliberately altered 20×20 block, and run through differ.js's actual exported diffScreen() function, not a mock of it:

{
  "name": "home",
  "mismatch": 361,
  "skipped": false
}

That historical output establishes that the engine returned a mismatch count. The earlier explanation attributed the difference from a nominal 400-pixel region to anti-aliasing exclusions without preserving enough fixture detail to establish that cause. The controlled October 25 run below replaces that explanation with an exactly constructed comparison.

Secondary Check: The Readline Race

The same prior pass documented a second fix: three CLI entry points had a readline race, the callback-based readline module's interface could receive input before the prompt text had finished writing, corrupting interactive setup flows. Checked tonight: src/onboard.js now imports readline/promises, the promise-based API used with awaited question() calls. That confirms the current call structure. It does not, by itself, reproduce the old interactive race or prove every prompt sequence is race-free.

Verification, October 25, 2026

The repository now has an automated suite: seven tests pass under Node 24.20.0. It checks incomplete captures, missing baselines, local-only operation, Git failure handling, baseline preservation, real PNG comparison, stale-route filtering, and release-tag failure handling. The Git/publishing paths use mocks. This run creates no branch or pull request and sends no remote commands.

A separate controlled call to the real diffScreen() used two 100×100 PNGs. Exactly 400 pixels, a 20×20 region, changed from white to black. The result is mismatch: 400, skipped: false. The test writes its before/after/diff images only to a temporary directory. This supports the diff path directly, without assigning an unmeasured cause to the earlier 361 result.

require("pixelmatch") still returns an object and its .default is callable in this installed Node/dependency combination. Older Node releases may reject the ESM require rather than return that wrapper, so this observation is version-specific. The CLI files inspected use readline/promises; no live interactive-onboarding sequence or browser-capture flow was exercised in this pass.

Browser capture follow-through October 26 2026

Real Chromium captured two owned loopback pages and reported a deliberate 404 as failed. Changing a local fixture file triggered the unmodified watcher, which wrote a changed screenshot and reported partial failure. The matching Playwright headless browser had to be installed before the check could run. Evidence and source hashes and a replay checker are available. This adds actual capture and one settled-change handoff coverage, without extending the earlier mocked publishing tests into a claim about GitHub. Concurrent edits, readiness timeouts, stale files for failed routes, discovery and interactive onboarding remain separate checks.

Mitigations and Next Steps

  1. The real gap here isn't a bug, it's test coverage. The original checks were manual. The current seven-test suite now covers the real diff path and mocked orchestration failures. Interactive prompt behavior remains a separate coverage gap. A single test that imports pixelmatch and asserts the result is callable would have caught the original ESM break in CI the moment the dependency was bumped, instead of silently breaking every diff run until someone noticed by hand.
  2. Pin and re-verify on every dependency bump, same lesson as the image_payload_injection report: a fix that is correct today depends on an upstream package's export shape that can change again on the next major version. The inline comment explaining why the .default access exists is good practice and should be the template for the rest of this codebase's dependency-shape assumptions.
  3. Keep the real diff regression in the suite. Import shape alone is a weaker check than loading the actual engine and comparing generated PNGs. Test interactive prompt ordering separately rather than inferring it from the chosen API.

GhostInThePrompt.com // A fix that held once still has to hold on the versions installed today. This one did.