DEV Community

Scarab Systems
Scarab Systems

Posted on • Edited on

Scarab Diagnostic Suite Field Test #003: Vite Dev/Build Contract Boundary

This field test moved Scarab Diagnostic Suite into a different kind of repo: Vite.

The issue was Vite #21979:

https://github.com/vitejs/vite/issues/21979

The bug involved a plugin transform hook filter behaving differently in dev and build.

The reported filter shape was:

**/*.(js)

In dev mode, the transform hook reached JavaScript files. In build mode, the same filter shape did not behave the same way.

A nearby pattern worked:

**/*.js

But the deeper issue was not just “this glob is odd.” The important contract was:

the same plugin hook filter should mean the same thing in dev and build

That is the boundary Scarab surfaced.

In plain terms:

plugin hook filter truth → dev/build execution mode

Those two paths were not aligned.

That kind of failure matters because framework users often trust dev mode as proof that the same contract will hold during build. When dev and build interpret the same plugin declaration differently, the framework creates a hidden trust problem.

A developer sees: “my plugin works in dev.” Then later discovers: “my plugin does not work in build.”

That is runtime-mode contract drift.

The repair candidate was narrow. It did not redesign Vite’s plugin system, rewrite glob semantics broadly, or patch unrelated build behavior.

The local repair focused on the build transform path so the transform hook filter was applied consistently before invoking the plugin handler.

A focused regression test proved the reported behavior. Before repair, the test failed because the transform hook did not reach /src/main.js during build. After repair, the focused test passed.

Additional validation passed across formatting, linting, build, type generation, and type checking for the touched area.

Field Test #003

Project: Vite

Issue type: plugin transform hook inconsistency

Boundary: dev/build runtime-mode contract

Result: narrow local repair and regression test

Outcome: targeted diagnostic finding cleared after repair

The important part of this field test was that Scarab generalized beyond AI-app runtime bugs.

This was a framework/build-system contract issue.

The truth was simple:

A plugin filter should not mean one thing in dev and another thing in build.

When that truth broke, Scarab identified the boundary and constrained the repair lane.

That is the pattern:

Not “Vite is broken,” but:

Vite’s transform hook filter contract diverged between dev and build.

That is smaller. That is testable. That is repairable.

That is what Scarab is built to surface.

Top comments (0)