Add phenotype cloning, failure atlas, AI court session, and clearance L0-L4
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
45
server/web/src/help/lotlTimeline.test.ts
Normal file
45
server/web/src/help/lotlTimeline.test.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @vitest-environment node
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildLotlTimelineModel } from './lotlTimeline';
|
||||
import type { Agent } from '../types';
|
||||
|
||||
function agent(partial: Partial<Agent>): Agent {
|
||||
return {
|
||||
id: 'x',
|
||||
name: 'n',
|
||||
wallet: '',
|
||||
ip: '1.1.1.1',
|
||||
version: '1',
|
||||
status: 'online',
|
||||
cpu_cores: 4,
|
||||
memory_gb: 8,
|
||||
last_seen: '',
|
||||
created_at: '',
|
||||
hashrate_15s: 0,
|
||||
hashrate_1m: 0,
|
||||
hashrate_15m: 0,
|
||||
shares_total: 0,
|
||||
shares_good: 0,
|
||||
shares_bad: 0,
|
||||
cpu_usage_pct: 0,
|
||||
memory_usage_pct: 0,
|
||||
uptime_seconds: 0,
|
||||
...partial,
|
||||
};
|
||||
}
|
||||
|
||||
describe('buildLotlTimelineModel atlas skips', () => {
|
||||
it('marks powershell tier skipped_by_atlas when ps_inmemory is blocked', () => {
|
||||
const model = buildLotlTimelineModel(
|
||||
agent({}),
|
||||
['docker', 'powershell', 'dotnet'],
|
||||
[],
|
||||
[],
|
||||
[{ tier: 'ps_inmemory', condition: 'defender_on', reason: '5 failures' }],
|
||||
);
|
||||
const ps = model.tiers.find((t) => t.tier === 'powershell');
|
||||
expect(ps?.state).toBe('skipped_by_atlas');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user