# X_TEST_DISCOVERY_UNSEEN

## Means

the tree holds a test file the gate's test discovery cannot yield, or one outside the one convention

## Typical cause

the gate's `unit`, `contract` and `job` steps select files through `discoverTests()` — `TEST_GLOB = '**/*.test.{ts,tsx}'`, `packages/cli/src/test-select.ts:28` — while bun's own root `bun test` discovery is wider, so a file the glob does not match is a test no gate step ever runs. Refused shapes, each with its own ground: a basename holding `.spec.`, `_spec.` or `_test.` — bun's root `bun test` runs `*_test.*` too, and `TEST_GLOB` matches none of them — or ending `.test.js` or `.test.jsx`; a path under a `__tests__/` directory whose basename the glob matches — `TEST_GLOB` DOES match `__tests__/*.test.ts`, and `packages/cli/src/test-ignores.ts` ignores no `__tests__`, so the gate runs that file too; it is refused because a test file lives beside its source, never in a `__tests__/` directory

## Fix

`bun run test-discovery` — then git mv <file> <dir>/<stem>.test.ts`, beside its source, under the one convention

[CLI and verify](/error-codes#cli-and-verify)
