"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ExecutionBoard_1 = require("./orchestrator/ExecutionBoard");
const RoleHandoff_1 = require("./orchestrator/RoleHandoff");
const CadenceEngine_1 = require("./orchestrator/CadenceEngine");
const OperatingSystem_1 = require("./orchestrator/OperatingSystem");
function assert(condition, message) {
    if (!condition)
        throw new Error(message);
}
async function main() {
    const board = new ExecutionBoard_1.ExecutionBoard();
    const handoff = new RoleHandoff_1.RoleHandoff();
    const cadence = new CadenceEngine_1.CadenceEngine();
    const ops = new OperatingSystem_1.OperatingSystem();
    board.add({
        id: 'ops-mission-1',
        title: 'Missão operacional',
        ownerRole: 'cpo',
        status: 'done',
        priority: 'medium',
        dependencies: [],
        slaHours: 48,
        notes: 'teste ops'
    });
    handoff.create({
        id: 'ops-handoff-1',
        fromRole: 'cpo',
        toRole: 'cto',
        missionId: 'ops-mission-1',
        summary: 'Executar a decisão técnica',
        status: 'accepted'
    });
    cadence.schedule('review', 'Review ops-mission-1', 'cto', 'ops-mission-1');
    const decision = ops.decide('ops-mission-1');
    assert(decision.effectiveOwnerRole === 'cto', 'handoff should influence owner role');
    assert(decision.shouldRelease === true, 'done mission with review and no blockers should be releasable');
    const weekly = ops.scheduleWeeklyCadence();
    assert(weekly.length === 3, 'weekly cadence should create planning/review/release events');
    console.log('TEST_OPERATING_SYSTEM_OK');
}
main().catch((error) => {
    console.error(error.message || error);
    process.exit(1);
});
