mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 09:12:18 +00:00
refactor(agent): preserve compact voice contract in World Packet extraction
Reconcile #880 with current main. Delegate the view-state builder while keeping enabled-only layers, disabledLayerCount, provenance, context semantics, and existing voice behavior. Add parity and roster-read regressions; retain package export, boundaries and changelog fragment. Preserve original GEV voice, layer and packet contributor credit.
This commit is contained in:
commit
cefbad3c2a
1069 files changed
+148145
-8587
No files matched your search
@@ -94,7 +94,6 @@ test('World Packet keeps stale/unavailable feed semantics distinct from empty',
|
||||
assert.match(packet.feedProvenance.note, /fixture unavailable/i);
|
||||
});
|
||||
|
||||
|
||||
test('semantic fingerprint ignores narration prose but changes with observed state', () => {
|
||||
const { viewer, dataManager, styleManager } = harness();
|
||||
const packet = getWorldPacket({ viewer, dataManager, styleManager });
|
||||
@@ -108,3 +107,46 @@ test('semantic fingerprint ignores narration prose but changes with observed sta
|
||||
changed.layers[0].count += 1;
|
||||
assert.notEqual(semanticWorldPacketFingerprint(changed), original);
|
||||
});
|
||||
|
||||
// The 2026-10 main voice contract omits disabled layers from the model payload.
|
||||
test('World Packet and voice preserve enabled-only payload and count disabled layers', async () => {
|
||||
const { viewer, dataManager, styleManager } = harness();
|
||||
const rows = dataManager.getAll();
|
||||
rows.push({
|
||||
id: 'earthquakes',
|
||||
name: 'Earthquakes',
|
||||
enabled: false,
|
||||
stats: { count: 99, source: 'fixture', error: 'stale' },
|
||||
});
|
||||
let reads = 0;
|
||||
dataManager.getAll = () => {
|
||||
reads += 1;
|
||||
return rows;
|
||||
};
|
||||
const packet = getWorldPacket({ viewer, dataManager, styleManager });
|
||||
assert.equal(reads, 1, 'collect the roster once rather than repeatedly');
|
||||
assert.equal(packet.disabledLayerCount, 1);
|
||||
assert.deepEqual(packet.layers.map((layer) => layer.id), ['traffic']);
|
||||
assert.equal(packet.feedProvenance.overall, 'nominal');
|
||||
|
||||
const runner = createGevActionRunner({ viewer, dataManager, styleManager });
|
||||
const voice = await runner('get_current_view_state');
|
||||
assert.deepEqual(voice, packet);
|
||||
});
|
||||
|
||||
test('World Packet fingerprints distinguish enabled state but ignore narrative churn', () => {
|
||||
const { viewer, dataManager, styleManager } = harness();
|
||||
const first = getWorldPacket({ viewer, dataManager, styleManager });
|
||||
const prose = structuredClone(first);
|
||||
prose.feedProvenance.note = 'new narration only';
|
||||
assert.equal(
|
||||
semanticWorldPacketFingerprint(first),
|
||||
semanticWorldPacketFingerprint(prose),
|
||||
);
|
||||
const hidden = structuredClone(first);
|
||||
hidden.disabledLayerCount += 1;
|
||||
assert.notEqual(
|
||||
semanticWorldPacketFingerprint(first),
|
||||
semanticWorldPacketFingerprint(hidden),
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user