"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const PerformanceScorecard_1 = require("./orchestrator/PerformanceScorecard");
function assert(condition, message) {
    if (!condition)
        throw new Error(message);
}
async function main() {
    const scorecard = new PerformanceScorecard_1.PerformanceScorecard();
    scorecard.record({
        entityId: 'agent-builder',
        entityType: 'agent',
        status: 'success',
        durationMs: 8000,
        reviewScore: 0.9,
        fallbackUsed: false,
        timestamp: new Date().toISOString()
    });
    scorecard.record({
        entityId: 'agent-builder',
        entityType: 'agent',
        status: 'partial',
        durationMs: 12000,
        reviewScore: 0.6,
        fallbackUsed: true,
        timestamp: new Date().toISOString()
    });
    const aggregate = scorecard.get('agent-builder');
    assert(!!aggregate, 'aggregate should exist');
    assert(aggregate.runs >= 2, 'runs should accumulate');
    assert(aggregate.avgReviewScore > 0, 'review score should be tracked');
    assert(aggregate.fallbackRate > 0, 'fallback rate should be tracked');
    console.log('TEST_PERFORMANCE_SCORECARD_OK');
}
main().catch((error) => {
    console.error(error.message || error);
    process.exit(1);
});
