"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const RoleHandoff_1 = require("./orchestrator/RoleHandoff");
const CadenceEngine_1 = require("./orchestrator/CadenceEngine");
function assert(condition, message) {
    if (!condition)
        throw new Error(message);
}
async function main() {
    const handoff = new RoleHandoff_1.RoleHandoff();
    const cadence = new CadenceEngine_1.CadenceEngine();
    handoff.create({
        id: 'handoff-phase6',
        fromRole: 'cpo',
        toRole: 'cto',
        missionId: 'task-phase6',
        summary: 'Transformar descoberta em execução.',
        status: 'queued'
    });
    const planning = cadence.schedule('planning', 'Planning semanal', 'coo');
    cadence.updateStatus(planning.id, 'running');
    assert(handoff.getAll().some((item) => item.id === 'handoff-phase6'), 'handoff should persist');
    assert(cadence.getAll().some((item) => item.id === planning.id && item.status === 'running'), 'cadence should update status');
    console.log('TEST_PHASE6_CADENCE_OK');
}
main().catch((error) => {
    console.error(error.message || error);
    process.exit(1);
});
