"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const PerformanceScorecard_1 = require("./orchestrator/PerformanceScorecard");
const OptimizationLoop_1 = require("./orchestrator/OptimizationLoop");
function assert(condition, message) {
    if (!condition)
        throw new Error(message);
}
async function main() {
    const scorecard = new PerformanceScorecard_1.PerformanceScorecard();
    const optimization = new OptimizationLoop_1.OptimizationLoop();
    scorecard.record({
        entityId: 'skill-research',
        entityType: 'skill',
        status: 'failed',
        durationMs: 14000,
        reviewScore: 4,
        fallbackUsed: true,
        timestamp: new Date().toISOString()
    });
    scorecard.record({
        entityId: 'skill-research',
        entityType: 'skill',
        status: 'partial',
        durationMs: 12000,
        reviewScore: 5,
        fallbackUsed: true,
        timestamp: new Date().toISOString()
    });
    const suggestions = optimization.generateSuggestions();
    assert(suggestions.length >= 1, 'should generate at least one optimization suggestion');
    assert(suggestions.some((item) => item.entityId === 'skill-research'), 'should flag low-performing entity');
    console.log('TEST_OPTIMIZATION_LOOP_OK');
}
main().catch((error) => {
    console.error(error.message || error);
    process.exit(1);
});
