mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
test: pin voice schemas independently of source formatting
This commit is contained in:
1 parent
cd92855f88
commit
a64a622b6d
3 files changed
+12
-22
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { GEV_REALTIME_TOOLS } from '../server/providers/openai/tools.js';
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
@@ -645,27 +646,19 @@ test('the DISPLAY rail starts collapsed on a first run, and a stored choice wins
|
||||
);
|
||||
});
|
||||
|
||||
// ── Voice: instruction-only, tool schema byte-unchanged ─────────────────────
|
||||
// ── Voice: instruction-only, tool schema unchanged ─────────────────────
|
||||
|
||||
test('the voice TOOL SCHEMA is byte-identical to main — the mission mapping is instructions only', () => {
|
||||
const src = fs.readFileSync(new URL('../server/providers/openai/tools.js', import.meta.url), 'utf8');
|
||||
const start = src.indexOf('const GEV_REALTIME_TOOLS = [');
|
||||
assert.ok(start > 0, 'GEV_REALTIME_TOOLS must still be a single literal array');
|
||||
const end = src.indexOf('\n];\n', start);
|
||||
const block = src.slice(start, end + 4);
|
||||
|
||||
// Re-pinned 2026-08-28: the Provider Settings / Esri release DELIBERATELY
|
||||
// extends set_map_stack's enum with 'esri-imagery' (a real new basemap —
|
||||
// exactly the kind of schema change this pin exists to make loud). The
|
||||
// guarded claim is unchanged: first-run missions ride existing tools, and
|
||||
// any NEW drift from this recorded schema still fails here.
|
||||
assert.equal(block.length, 31189, 'tool schema byte length drifted from the pinned release schema');
|
||||
test('the voice TOOL SCHEMA matches the pinned release — the mission mapping is instructions only', () => {
|
||||
// Canonical serialization pins every tool name, description, property and
|
||||
// ordering while allowing source formatting. Derived from the unchanged
|
||||
// release schema before formatting (the previous source-byte pin passed).
|
||||
const block = JSON.stringify(GEV_REALTIME_TOOLS);
|
||||
assert.equal(block.length, 26121, 'serialized tool schema length drifted');
|
||||
assert.equal(
|
||||
crypto.createHash('sha256').update(block).digest('hex'),
|
||||
'73aaabdb169a5478893d28688f327a21edd32ed3ec16fc6287bd944ed77beecf',
|
||||
'11680affb4a7aebf142642c8185b28f2ee7d523407054c5b0c3962d933b045eb',
|
||||
'the first-run missions must ride EXISTING tools: no schema edit, no cache bust',
|
||||
);
|
||||
|
||||
const instructions = fs.readFileSync(new URL('../server/providers/openai/instructions.js', import.meta.url), 'utf8');
|
||||
|
||||
// ...and the mapping that makes them reachable by voice is one instruction
|
||||
|
||||
Reference in new issue
Block a user