05ed037fe8
- DNS: pilot.landvex.com -> 16.170.83.169 - TLS: Let's Encrypt certificate (expires 2026-09-30) - Nginx: reverse proxy with SSL termination - API: https://pilot.landvex.com/api/v1/missions - UI: https://pilot.landvex.com/ - Upload: POST /api/v1/missions/import (multipart/form-data) Verified: ✅ https://pilot.landvex.com/health ✅ https://pilot.landvex.com/version ✅ https://pilot.landvex.com/api/v1/missions (list) ✅ https://pilot.landvex.com/api/v1/missions/:id (get) ✅ POST /api/v1/missions/import (video upload) ✅ UI loads with title 'LandveX Intelligence Lab' Next: Pilot 001 — Break the system!
79 lines
3.3 KiB
JavaScript
79 lines
3.3 KiB
JavaScript
#!/usr/bin/env node
|
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
// Testa Decision Replay
|
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
|
|
import { AgentRuntimeV6 } from './agent-runtime-v6.mjs';
|
|
|
|
async function testDecisionReplay() {
|
|
console.log('═══════════════════════════════════════════════════════════════');
|
|
console.log(' TEST: Decision Replay');
|
|
console.log('═══════════════════════════════════════════════════════════════\n');
|
|
|
|
// Test 1: Blockerat beslut
|
|
const task1 = {
|
|
id: 'TEST-001',
|
|
description: 'SSH:a in i produktion',
|
|
type: 'infrastructure',
|
|
action: 'ssh',
|
|
target: 'production'
|
|
};
|
|
|
|
const runtime1 = new AgentRuntimeV6(task1);
|
|
const result1 = await runtime1.execute();
|
|
|
|
console.log('Test 1: SSH till produktion');
|
|
console.log(`Result: ${result1.status}`);
|
|
console.log(`Decision ID: ${result1.decisionId}`);
|
|
|
|
// Spela upp beslutet
|
|
const replay1 = runtime1.getDecisionReplay().replayDecision(result1.decisionId);
|
|
console.log(`Replayable: ${replay1.original?.replayable || false}`);
|
|
console.log(`Operation: ${replay1.original?.canonicalOperation?.operation}`);
|
|
console.log(`Decision: ${replay1.original?.policyResult?.passed ? 'ALLOW' : 'BLOCK'}`);
|
|
|
|
// Test 2: Tillåtet beslut
|
|
const task2 = {
|
|
id: 'TEST-002',
|
|
description: 'Ändra text i README',
|
|
type: 'documentation'
|
|
};
|
|
|
|
const runtime2 = new AgentRuntimeV6(task2);
|
|
const result2 = await runtime2.execute();
|
|
|
|
console.log('\nTest 2: Ändra README');
|
|
console.log(`Result: ${result2.status}`);
|
|
console.log(`Decision ID: ${result2.decisionId}`);
|
|
|
|
const replay2 = runtime2.getDecisionReplay().replayDecision(result2.decisionId);
|
|
console.log(`Replayable: ${replay2.original?.replayable || false}`);
|
|
console.log(`Operation: ${replay2.original?.canonicalOperation?.operation}`);
|
|
console.log(`Decision: ${replay2.original?.policyResult?.passed ? 'ALLOW' : 'BLOCK'}`);
|
|
|
|
// Generera rapport
|
|
const allDecisions = [
|
|
...runtime1.getDecisionReplay().exportDecisions(),
|
|
...runtime2.getDecisionReplay().exportDecisions()
|
|
];
|
|
|
|
console.log('\n=== DECISION REPLAY RAPPORT ===');
|
|
console.log(`Totalt antal beslut: ${allDecisions.length}`);
|
|
console.log(`Beslut med replay-stöd: ${allDecisions.filter(d => d.replayable).length}`);
|
|
console.log(`Reproducerbara: ${allDecisions.filter(d => d.replayable).length}/${allDecisions.length}`);
|
|
|
|
// Spara beslut
|
|
const fs = await import('fs');
|
|
fs.writeFileSync(
|
|
'/home/bernt/.openclaw/workspace/EOS/decision-replay-test.json',
|
|
JSON.stringify({
|
|
timestamp: new Date().toISOString(),
|
|
decisions: allDecisions
|
|
}, null, 2)
|
|
);
|
|
|
|
console.log('\n✅ Decision Replay fungerar!');
|
|
}
|
|
|
|
testDecisionReplay().catch(console.error);
|