Merge feat/voice-geometry onto main

Both stack parents (#837, #842) are on main, so the voice geometry branch
now builds on main directly. Conflict resolutions keep main's behaviour and
add the geometry work on top: osm_query gating on every provider, restored
admin identity for Nominatim outlines, merged analyst follow-up memory, and
the cancelled Globe View reset instruction ahead of the generic cancellation.
This commit is contained in:
Manjunath committed 2026-11-03 14:33:34 +05:30
commit ecaddd838b
102 files changed
+12925 -1006

No files matched your search

+47 -1
View File
@@ -4,6 +4,9 @@ import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { GEV_ACTION_SCHEMAS, createActionTools } from './actionSchemas.js';
import { GEV_REALTIME_TOOLS } from '../../server/providers/openai/tools.js';
import { createAreaStore } from '../data/areaStore.js';
import { createAreaResolver } from '../data/areaResolver.js';
import { findAdminCandidates } from '../data/adminBoundaries.js';
import {
validateArgs,
validateCall,
@@ -49,7 +52,9 @@ test('the complete Realtime tool payload pins the manifest-generated layer relea
// Snow leaves the set_visual_style enum.
// The Operator HUD layout leaves set_hud's layout enum.
// The layer alias hint leaves out aliases the layer id already spells.
'dc2bac1be93a503dc88d637beea2f1bc457e1f9167422bd91548b44756a8aca5',
// Voice geometry adds resolve_area, find_imagery, osm_query, the analyst
// area scopes and the osm-places layer.
'6a60cb849fe6835295354b0a6711c9d2b6428114f66d14690430f1732070b59c',
);
});
@@ -79,6 +84,37 @@ test('descriptions customize wording without changing immutable shared arguments
);
});
test('every emitted area candidate round-trips through the production schema', async () => {
const candidateSchema = GEV_ACTION_SCHEMAS.find(
(tool) => tool.name === 'resolve_area',
).parameters.properties.candidateId;
const resolver = createAreaResolver({
store: createAreaStore(),
findAdminCandidates,
});
const ambiguous = await resolver.resolve({ query: 'Georgia' });
assert.equal(ambiguous.needsClarification, true);
for (const choice of ambiguous.candidates) {
assert.ok(choice.candidateId.length >= candidateSchema.minLength);
assert.ok(choice.candidateId.length <= candidateSchema.maxLength);
assert.match(choice.candidateId, new RegExp(candidateSchema.pattern, 'u'));
assert.equal(
(await resolver.resolve({ candidateId: choice.candidateId })).ok,
true,
);
}
assert.equal(ambiguous.candidates[0].candidateId.length, 41);
const grammar = new RegExp(candidateSchema.pattern, 'u');
for (const malformed of [
'ne:state:bad slug',
'ne:state:../../etc',
'ne:state:!!!',
'ne:state:a_b',
])
assert.doesNotMatch(malformed, grammar);
assert.ok(`ne:state:${'x'.repeat(80)}`.length > candidateSchema.maxLength);
});
test('metadata cannot add tools, fields, types or enum values', () => {
for (const descriptions of [
{ execute_shell: { description: 'not an action' } },
@@ -112,6 +148,9 @@ test('all legacy action arguments are byte-identical after removing the delibera
'next_satellite_pass',
'set_cyber_sonar',
'set_voice_inactivity_timeout',
'resolve_area',
'find_imagery',
'osm_query',
].includes(tool.name),
);
// Layer enums are generated from the voice layer manifest and pinned by
@@ -164,6 +203,13 @@ test('all legacy action arguments are byte-identical after removing the delibera
analystScopeKind.enum = analystScopeKind.enum.filter(
(key) => key !== 'pointer',
);
// Area handles add three scope kinds and their two identifiers.
const scope = property('analyst_query').scope;
scope.properties.kind.enum = scope.properties.kind.enum.filter(
(kind) => !['area', 'drawn', 'annotation'].includes(kind),
);
delete scope.properties.areaId;
delete scope.properties.id;
// The analyst centre now requires a real coordinate.
const center = property('analyst_query').scope.properties.center;
delete center.required;