mirror of
https://github.com/ruvnet/RuView
synced 2026-08-01 19:01:42 +00:00
feat: ADR-080 P1+P2 remediation — refactor, perf, tests, safety
P1 fixes (this sprint): - P1-6: Extract sensing-server modules (cli, types, csi, pose) from main.rs - P1-7: DDA ray march for tomography — O(max(n)) replaces O(n^3) voxel scan - P1-8: Batch neural inference — Tensor::stack/split for single GPU call - P1-10: Eliminate 112KB/frame alloc — islice replaces deque→list copy P2 fixes (this quarter): - P2-11: Python unit tests for 8 modules (rate_limit, auth, error_handler, pose_service, stream_service, hardware_service, health_check, metrics) - P2-13: MAT simulated data safety guard — blocking overlay + pulsing banner - P2-14: Wire token blacklist into auth verification + logout endpoint - P2-15: Frame budget benchmark — confirms pipeline well under 50ms budget Addresses 8 of 10 remaining issues from QE analysis (ADR-080). Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -76,4 +76,31 @@ describe('MATScreen', () => {
|
||||
// Simulated status maps to 'simulated' banner -> "SIMULATED DATA"
|
||||
expect(getByText('SIMULATED DATA')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('shows simulation warning overlay when simulated and not acknowledged', () => {
|
||||
// Reset store to ensure overlay is shown
|
||||
const { useMatStore } = require('@/stores/matStore');
|
||||
useMatStore.setState({ dataSource: 'simulated', simulationAcknowledged: false });
|
||||
|
||||
const { MATScreen } = require('@/screens/MATScreen');
|
||||
const { getByText } = render(
|
||||
<ThemeProvider>
|
||||
<MATScreen />
|
||||
</ThemeProvider>,
|
||||
);
|
||||
expect(getByText('I UNDERSTAND')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('hides overlay after acknowledgment', () => {
|
||||
const { useMatStore } = require('@/stores/matStore');
|
||||
useMatStore.setState({ dataSource: 'simulated', simulationAcknowledged: true });
|
||||
|
||||
const { MATScreen } = require('@/screens/MATScreen');
|
||||
const { queryByText } = render(
|
||||
<ThemeProvider>
|
||||
<MATScreen />
|
||||
</ThemeProvider>,
|
||||
);
|
||||
expect(queryByText('I UNDERSTAND')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,6 +62,8 @@ describe('useMatStore', () => {
|
||||
survivors: [],
|
||||
alerts: [],
|
||||
selectedEventId: null,
|
||||
dataSource: 'simulated',
|
||||
simulationAcknowledged: false,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -195,4 +197,32 @@ describe('useMatStore', () => {
|
||||
expect(useMatStore.getState().selectedEventId).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('dataSource', () => {
|
||||
it('defaults to simulated', () => {
|
||||
expect(useMatStore.getState().dataSource).toBe('simulated');
|
||||
});
|
||||
|
||||
it('can be set to real', () => {
|
||||
useMatStore.getState().setDataSource('real');
|
||||
expect(useMatStore.getState().dataSource).toBe('real');
|
||||
});
|
||||
|
||||
it('can be set back to simulated', () => {
|
||||
useMatStore.getState().setDataSource('real');
|
||||
useMatStore.getState().setDataSource('simulated');
|
||||
expect(useMatStore.getState().dataSource).toBe('simulated');
|
||||
});
|
||||
});
|
||||
|
||||
describe('simulationAcknowledged', () => {
|
||||
it('defaults to false', () => {
|
||||
expect(useMatStore.getState().simulationAcknowledged).toBe(false);
|
||||
});
|
||||
|
||||
it('can be acknowledged', () => {
|
||||
useMatStore.getState().acknowledgeSimulation();
|
||||
expect(useMatStore.getState().simulationAcknowledged).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user