feat(fleet): add shared WireGuard profiles and bounded rover transport
Add portable shared WireGuard profiles while retaining Tailscale and Worker boundaries. Bound rover command/telemetry delivery, recovery and diagnostic capture across Core and Node.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {build} from 'esbuild';
|
||||
const source=await build({entryPoints:[new URL('../src/core/fleet/roverFaultNotice.ts',import.meta.url).pathname],bundle:true,write:false,platform:'node',format:'esm'});
|
||||
const {RoverFaultNotice}=await import('data:text/javascript;base64,'+Buffer.from(source.outputFiles[0].contents).toString('base64'));
|
||||
const frame=(message='old fault',session_id='old',fresh=true)=>({fresh,snapshot:{instance_id:'node',session_id,state:message?'fault':'stopped',message}});
|
||||
test('opening an existing terminal snapshot is a baseline, not a new failure toast',()=>{
|
||||
const n=new RoverFaultNotice();assert.equal(n.update(frame(),null).show,undefined);
|
||||
assert.equal(n.update(frame(),null).show,undefined);
|
||||
assert.equal(n.update(frame(null),null).clear,'old fault');
|
||||
assert.equal(n.update(frame('new fault','new'),null).show,'new fault');
|
||||
assert.equal(n.update(frame('new fault','new'),null).show,undefined);
|
||||
});
|
||||
test('stale snapshots cannot establish baseline or clear a live error; owned new faults are immediate',()=>{
|
||||
const n=new RoverFaultNotice();assert.deepEqual(n.update(frame('ignored','old',false),null),{});
|
||||
assert.equal(n.update(frame('active fault','owned'),'owned').show,'active fault');
|
||||
assert.deepEqual(n.update(frame(null,'owned',false),'owned'),{});
|
||||
assert.equal(n.update(frame(null,'owned'),'owned').clear,'active fault');
|
||||
});
|
||||
Reference in New Issue
Block a user