LocalLens

Verify the build

Run lint, types, tests, and a build in one shot.

LocalLens ships one composite script that runs every check the project cares about:

bun run check

What it actually runs

bun run check chains four steps. Each one is also exposed on its own:

StepCommandWhat it checks
Lint + formatbun run lint (biome check .)Style and obvious bugs across the repo. Configured in biome.json.
Typesbun run typecheck (tsc --noEmit)TypeScript strict mode against src/** and tests/**.
Testsbun run testBun tests in tests/ — currently chunker.test.ts and prompt.test.ts.
Buildbun run buildbun build src/server.ts --target=bun --outdir=dist. Smoke-tests that nothing breaks the bundler.

If any step fails, the whole script exits non-zero. CI runs the same script.

Tests in particular

There are only two test files. They cover the parts most likely to regress quietly:

  • tests/chunker.test.ts — verifies that chunkDocument produces overlapping chunks with stable source metadata and rejects invalid chunk settings.
  • tests/prompt.test.ts — verifies that buildGroundedHistory includes source context and the no-context fallback, that the system prompt enforces source-grounding, and that the bracket citation format is in place.

When you change anything in src/rag.ts or src/files.ts, those tests are your first line of defence.

Format on the way

bun run format

Runs Biome with --write. Handy as a pre-commit step.

On this page