feat(voice): voice core — honest layer reach, spoken summary with on-screen card, narration, point-and-ask

- Voice layer manifest (src/voice/layerManifest.js) generates the layer enums,
  aliases and analyst field hints; a test fails when a catalog layer has no entry.
- analyst_query validates fields, operators, units, values and scopes, counts up
  to 250,000 loaded records per layer, reports complete/partial/unanswered, tells
  LAYER_OFF / NOT_READY / FEED_UNAVAILABLE apart from zero, refuses mismatched
  follow-ups and never lets a superseded query replace follow-up memory. Seven
  more layers expose analyst records.
- Tool results carry a code-built say line and a display card; the voice card in
  the mic control shows captions, plan steps and the result
  (src/voice/resultDisplay.js is the one adapter). Slow tools narrate their
  current step out of band; holding Space while the assistant talks cuts it off.
  Turn spans go to the debug log; caption transcription is metered; the log
  omits what was said unless GEV_VOICE_LOG_CONTENT=1.
- Point and ask: the Space-down pointer snapshot resolves "this", "that one" and
  "around here" through 'pointer' targets, and "the second one" through
  referent:n from the last numbered list.
- Prompt states each policy once (instructions + tools 48.5k -> 46.7k chars).
- Voice benchmark harness (scripts/qa-voice-bench.mjs, scripts/voice-bench/)
  shares its phrase table and grading with scripts/qa-voice-routing.mjs.
This commit is contained in:
Bilawal Sidhu committed 2026-09-28 21:19:23 -05:00
1 parent e7707d9a0f
commit a19897ad15
97 files changed
+14343 -755

No files matched your search

+35 -25
View File
@@ -15,7 +15,7 @@ const stable = (value) =>
)
: value;
test('the complete Realtime tool payload pins the additive analyst, satellite, Local ADS-B and Cyber release', () => {
test('the complete Realtime tool payload pins the manifest-generated layer release', () => {
const digest = createHash('sha256')
.update(
JSON.stringify(
@@ -27,9 +27,10 @@ test('the complete Realtime tool payload pins the additive analyst, satellite, L
.digest('hex');
assert.equal(
digest,
// Re-derived for the additive `local-adsb` set_layer_visibility value and
// the Cyber HUD layout; the separate sonar tool is excluded above.
'590d537d93e132ac64ac5e211ad5bb9d7d1b1f22e2dd963dda5465fab4510a3b',
// Re-derived for the voice layer manifest (generated layer enums and
// aliases), point-and-ask (pointer sentinels, referent args) and the
// consolidated tool wording (each policy stated once).
'087cb623adb90f0f6203aecd6f33345bc4e5616c66ca4f4c55afdba7ff25c8bf',
);
});
@@ -89,35 +90,44 @@ test('all legacy action arguments are byte-identical after removing the delibera
const legacy = structuredClone(GEV_ACTION_SCHEMAS).filter(
(tool) => !['next_satellite_pass', 'set_cyber_sonar'].includes(tool.name),
);
const layers = legacy.find((tool) => tool.name === 'analyst_query').parameters
.properties.layers.items;
layers.enum = layers.enum.filter(
(key) =>
![
'satellites',
'local-datacenters',
'local-dams',
'fire-perimeters',
].includes(key),
);
// Local ADS-B is an additive set_layer_visibility enum value.
const visibility = legacy.find((tool) => tool.name === 'set_layer_visibility')
.parameters.properties.layerId;
visibility.enum = visibility.enum.filter(
(key) => !['local-adsb', 'fire-perimeters'].includes(key),
// Layer enums are generated from the voice layer manifest and pinned by
// layerManifest.test.mjs; the two shipped right-rail panels are additive.
const property = (name) =>
legacy.find((tool) => tool.name === name).parameters.properties;
delete property('set_layer_visibility').layerId.enum;
delete property('show_data_layers_menu').layerId.enum;
delete property('get_entity_context').layerId.enum;
delete property('analyst_query').layers.items.enum;
const panels = property('set_panel_open').panelId;
panels.enum = panels.enum.filter(
(id) => !['weather-panel', 'recent-imagery-panel'].includes(id),
);
for (const tool of legacy) {
// Point-and-ask adds `referent` arguments and 'pointer' enum values.
delete tool.parameters.properties.referent;
for (const value of Object.values(tool.parameters.properties)) {
if (value.enum)
value.enum = value.enum.filter((key) => key !== 'fire-perimeters');
value.enum = value.enum.filter((key) => key !== 'pointer');
}
}
// Independently derived by executing trusted c9f9896 actionSchemas in the restricted container.
const hud = legacy.find((tool) => tool.name === 'set_hud').parameters
.properties.layout;
const analystScopeKind = legacy.find((tool) => tool.name === 'analyst_query')
.parameters.properties.scope.properties.kind;
analystScopeKind.enum = analystScopeKind.enum.filter(
(key) => key !== 'pointer',
);
// The analyst centre now requires a real coordinate.
const center = property('analyst_query').scope.properties.center;
delete center.required;
for (const axis of ['lat', 'lon']) {
delete center.properties[axis].minimum;
delete center.properties[axis].maximum;
}
// Cyber adds one HUD layout.
const hud = property('set_hud').layout;
hud.enum = hud.enum.filter((layout) => layout !== 'cyber');
// Derived by applying the same removals to the 4b56d0e9 actionSchemas.
assert.equal(
createHash('sha256').update(JSON.stringify(legacy)).digest('hex'),
'820fff21658f6907e1010b2b79c5431a77f4e34afd2277d62d8de46c368b6f8c',
'01f14fdb1523eebfcbff8b115e48e6ab99e36fa06f55a3bb13c65e198f79d758',
);
});