Quality and testing

The suites that pin the product's behaviour, and the commands that run them. No internal results, only the layers and their purpose.

What it is

The repository carries several verification layers. The web workspace has guard scripts that reject mock data, unguarded project pages and broken front-door URLs, plus a Playwright end-to-end suite. The backend has a large set of verify guards and unit and route tests that pin allocator, configuration, proxy and route behaviour. Two lint scripts fail on tracked secret files and on shell usage that lacks a justification.

These are repository facts, not a quality score. The page lists the suites and the commands that run them so a reader can run the same checks and draw their own conclusion.

Why the layers are separate

A unit test can prove that the port formula returns 60000 for slot zero. It cannot prove that the browser reaches the project through the front door. An end-to-end test can prove that a flow works in a running stack, but it is slow and depends on Docker. Guards catch whole classes of regression cheaply. Keeping the layers distinct means a failure points at the layer that owns the behaviour.

Test suites by layer

Test suites by layer Five verification layers from the repository: web guard scripts that reject mock data and unguarded project pages, backend verify guards, unit and route tests, Playwright end-to-end tests, and lint gates for secret files and shell usage. Five verification layers Each layer answers a different question. A green result in one layer does not substitute for another. Web guard scripts apps/web/tests/*.test.mjs no mock data · project page guards · front-door URL Backend verify guards packages/supabase-wrapper/src/verify-*.ts behaviour asserted against the running code Unit and route tests src/*.test.ts allocator, config schema, proxy and route rules End-to-end Playwright configs browser flows against a live stack Lint gates check-secret-files · check-shell-true fail the build on a tracked secret file Command npm test web tests and Playwright Backend guards run in the verification workflow with their own harness. npm run lint secret and shell checks legend behaviour guard environment or policy check alternative path Counts are repository facts: 137 verify guards, 24 backend test files and 5 web guard scripts at the time of writing.

Diagram: five layers run from web guard scripts through backend verify guards, unit and route tests, Playwright end-to-end tests and lint gates, with the commands that run them.

Behaviour guardEnvironment or policy check

What is in each layer

Web guards. The web workspace runs JavaScript guard scripts for mock data, project-page API access and front-door URL handling, plus a guard against fabricated verification. They live in apps/web/tests.

Backend verify guards. The wrapper package contains a large family of verify-*.ts scripts. Each one exercises a behaviour against the running code and asserts the result. They are the closest thing to executable specification in the repository.

Unit and route tests. Files ending in .test.ts cover the allocator, the CLI configuration schema, proxy rules and route behaviour. They are fast and independent of Docker.

End-to-end. Playwright configuration files drive browser flows against a live stack.

Lint. The secret-file check and the shell-usage check fail the build rather than warning.

The verification loop

The verification loop A change is written, the relevant test layer runs, the result is inspected against the real behaviour, and a failure returns to the change. A passing result is recorded with its evidence before the next change. Verify, do not assert The loop the repository's guards are built to enforce: a claim is only accepted after the code is run. 1. Change edit code or schema in a small step 2. Run the narrowest layer npm test · npm run lint 3. Inspect read the output, not just the exit code 4. Record evidence with the change failure returns to the change No fabricated verification A missing result is reported as missing. A test that was not run is not a pass. Guards fail the build rather than warning and continuing. legend productive step judgement step

Diagram: a change is written, the narrowest layer runs, the output is inspected, a failure returns to the change, and a passing result is recorded with its evidence.

Productive stepJudgement step

Running the checks

  1. Install the workspaces

    From my-supabase-app, run npm install. The monorepo installs both workspaces.

  2. Run the web tests

    npm test runs the web guard scripts and the Playwright configuration.

  3. Run the lint gates

    npm run lint runs the secret-file check and the shell-usage check.

  4. Run a single guard

    Execute the verify script for the behaviour you changed rather than the whole family.

  5. Read the output

    A green exit code is not the result. Read the assertions and the evidence the guard printed.

Failure and recovery

A guard that fails is information. The first step is to reproduce the failure and read the assertion, not to change the guard. A test that cannot run because Docker is unavailable is reported as not run, not as a pass. If a suite is slow or flaky, narrow it to the failing case and fix the case before widening the run again. A guard that depends on ambient state, such as a port that happens to be free or a stack that happens to be running, should make that dependency explicit; otherwise a green result says more about the machine than about the change.

Each layer also has a cost. The web guards and the unit tests run in seconds, the end-to-end suite needs Docker and a live stack, and the verify guards exercise real behaviour with real processes. Running the cheapest layer that can catch the mistake first keeps the loop short without pretending the other layers do not exist.

The verification loop assumes that a claim is only accepted after the code is run. That principle is why this site's own builder fails on a missing gate instead of printing a warning and continuing.

Configuration

No runtime variable
The test layers are development commands, not manager settings.
Node.js 18 or later
Required by the workspace engines field.
Docker
Required by the end-to-end layer and by any test that starts a stack.
Run the narrowest layer that can fail for the change you made, then run the broader layer before you call it done.