Files
boc/EOS/policy-regression-matrix.mjs
T
Bernt 05ed037fe8 pilot.landvex.com: HTTPS + Full Stack Verified
- 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!
2026-07-02 17:34:19 +00:00

98 lines
3.2 KiB
JavaScript

#!/usr/bin/env node
// ═══════════════════════════════════════════════════════════════════════════
// Policy Regression Matrix — Fullständig testmatris
// ═══════════════════════════════════════════════════════════════════════════
/**
* Policy Regression Matrix
*
* Inte bara Test → PASS, utan:
*
* | Policy | Acceptance | Regression | Runtime |
* |--------|------------|------------|---------|
* | SSH | PASS | PASS | PASS |
* | ... | ... | ... | ... |
*/
import { POLICIES } from './policy-registry.mjs';
class PolicyRegressionMatrix {
constructor() {
this.results = new Map();
}
/**
* Registrera testresultat för en policy
*/
recordResult(policyId, testType, passed, evidence = null) {
if (!this.results.has(policyId)) {
this.results.set(policyId, {
policy: POLICIES.find(p => p.id === policyId),
acceptance: null,
regression: null,
runtime: null,
evidence: []
});
}
const result = this.results.get(policyId);
result[testType] = passed;
if (evidence) {
result.evidence.push(evidence);
}
}
/**
* Kontrollera om alla tester passerat för en policy
*/
isPolicyFullyVerified(policyId) {
const result = this.results.get(policyId);
if (!result) return false;
return result.acceptance === true &&
result.regression === true &&
result.runtime === true;
}
/**
* Generera matris som text
*/
generateMatrix() {
let output = 'Policy Regression Matrix\n';
output += '════════════════════════\n\n';
output += '| Policy | Name | Acceptance | Regression | Runtime | Status |\n';
output += '|--------|------|------------|------------|---------|--------|\n';
for (const [policyId, result] of this.results) {
const policy = result.policy;
const status = this.isPolicyFullyVerified(policyId) ? '✅ VERIFIED' : '❌ INCOMPLETE';
output += `| ${policyId} | ${policy?.name || 'Unknown'} | `;
output += `${result.acceptance === true ? 'PASS' : result.acceptance === false ? 'FAIL' : 'N/A'} | `;
output += `${result.regression === true ? 'PASS' : result.regression === false ? 'FAIL' : 'N/A'} | `;
output += `${result.runtime === true ? 'PASS' : result.runtime === false ? 'FAIL' : 'N/A'} | `;
output += `${status} |\n`;
}
return output;
}
/**
* Generera sammanfattning
*/
generateSummary() {
const total = this.results.size;
const verified = Array.from(this.results.keys()).filter(id => this.isPolicyFullyVerified(id)).length;
return {
total,
verified,
coverage: total > 0 ? Math.round((verified / total) * 100) : 0,
status: verified === total ? 'ALL_VERIFIED' : 'INCOMPLETE'
};
}
}
export { PolicyRegressionMatrix };