- witness-chain.ts: LIMIT/OFFSET now use parameterized ? bindings instead
of string interpolation (SQL injection fix). Handle offset-without-limit
via LIMIT -1, and limit=0 correctly returns zero rows.
- Replace @faker-js/faker imports in 7 generator files with lightweight
test-value-helpers.ts using only node:crypto — eliminates ~6MB runtime
dependency for npm consumers.
- Add range guards in test-value-helpers (int/float swap on inverted range).
- Add 17 unit tests for test-value-helpers and 3 pagination edge case tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
125 test files had beforeEach/beforeAll but no afterEach/afterAll,
leaking state between tests and causing order-dependent failures.
Added cleanup to 104 files (skipped 4 archived, 16 import-only):
- 2 critical DB handle leaks (witness-chain): added db.close()
- 7 high-risk service files: added vi.restoreAllMocks()
- 7 beforeAll files: added matching afterAll
- 88 medium/low risk: added afterEach with appropriate cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Brain export v3.0 (25 tables), witness chain v3 with Ed25519 signing,
streaming for large tables, RVF freeze/derive/indexStats, npm packaging fix.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>