Implementation:20000419 Fauxnix Differential Gate
| Knowledge Sources | |
|---|---|
| Domains | Testing, Release_Gate, Validation |
| Last Updated | 2026-10-26 00:00 GMT |
Overview
Concrete vitest hard gate that validates the corpus shape (≥200 sourced unique cases) and, when the Git Bash oracle is available, asserts ≥95% identity against the reviewed known-mismatch baseline.
Description
The Differential Gate (test/differential.test.ts) is a Pattern Doc implementation: it uses vitest assertions to enforce the release contract. The first it always runs and checks that the corpus has the expected gate values (targetCases=200, identity=0.95), at least 200 cases, unique ids and commands, every case sourced and non-empty, all knownMismatchIds present in the corpus, and the required golden case ids. The second suite (describe.skipIf(skipOracle)) runs only when canRunOracle() is true: it executes the full corpus via runCorpus, asserts identity ≥ gate, and verifies that no mismatches outside the knownMismatchIds baseline appear. A third case reports the astral Unicode oracle limitation while enforcing scalar counting. The gate is the release evidence for the 1.0 corpus contract.
Usage
Run via npm test (default vitest). The corpus-shape check always runs; the oracle suite is skip-safe on machines without Git Bash.
Code Reference
Source Location
- Repository: fauxnix
- File: test/differential.test.ts
- Lines: L1-100; corpus-shape check L24-53; oracle suite L56-99
Signature
// Pattern: vitest assertions encoding the corpus gate contract
describe('differential corpus hard gate (C-7 / #118)', () => {
it('loads at least 200 sourced, non-duplicate cases', () => { /* ... */ });
});
describe.skipIf(skipOracle)('differential vs Git Bash oracle', { timeout: 300_000 }, () => {
it('identity is ≥95% of this corpus', async () => { /* ... */ });
it('reports the astral Unicode oracle limitation ...', async () => { /* ... */ });
});
Import
// No import — this is a test file run by vitest.
import { describe, expect, it } from 'vitest';
import { canRunOracle, loadCorpus, oracleSkipReason, resolveGitBash, runCorpus, formatSummary } from './differential/run.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| corpus | Corpus | Yes | Loaded from corpus.json at module load |
| FAUXNIX_DIFF_ORACLE | env | No | Enables the oracle suite when truthy + bash.exe present |
Outputs
| Name | Type | Description |
|---|---|---|
| (test result) | vitest pass/fail | Corpus shape + identity gate + no-unexpected-mismatches |
Usage Examples
Run the Gate
npm test # corpus-shape check (always)
FAUXNIX_DIFF_ORACLE=1 npm test # + oracle suite vs Git Bash