mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
Two real failures surfaced by this PR's re-sharding: 1. verify/check-test-isolation: embed-batch-concurrency.test.ts mutated process.env directly (R1). Now uses withEnv(). 2. test (9) source-health "expected 1280 dimensions, not 1536": a file whose last afterEach calls resetGateway() leaves the gateway slot empty during the NEXT file's beforeAll (which runs before any beforeEach can restore the legacy 1536 pin), so initSchema() sizes the embedding column from the zembed-1/1280 defaults and every 1536-d fixture in that file fails. Which pair collides depends on shard composition, so adding test files (as this PR does) can surface it anywhere. The legacy-embedding preload now also repairs the empty slot in a global afterEach (preload after-hooks run after file-local ones), closing the window at the root instead of patching one victim file. Reproduced locally with a poison/afterEach-reset file followed by a schema-creating file: embedding column typmod 1280 before the fix, 1536 after. check-test-isolation, typecheck, and the affected suites all pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>