cellos-cortex 0.1.0

Bridge between CellOS execution cells and the Cortex doctrine layer — DoctrineAuthorityPolicy, CortexCellRunner, CellosLedgerEmitter.
//! CellOS ↔ Cortex bridge.
//!
//! Two directions of flow cross this crate, and **only** this crate:
//!
//! - **Cortex → CellOS** : Cortex dispatches agent work into isolated cells via
//!   [`runner::CortexCellRunner`], which translates a bounded [`context::ContextPack`]
//!   into a [`cellos_core::types::ExecutionCellDocument`] and submits it through a
//!   [`runner::CellSubmitter`] (typically backed by `cellos-supervisor`).
//! - **CellOS → Cortex** : CellOS lifecycle [`cellos_core::types::CloudEventV1`]s are
//!   serialized into Cortex ledger entries by [`ledger::CellosLedgerEmitter`], which
//!   implements [`cellos_core::ports::EventSink`].
//!
//! ## Boundary discipline (ADR 0007)
//!
//! Neither `cellos-*` nor `cortex-*` imports the other directly. This crate owns
//! the *wire shapes* that span the gap. The simplified [`context::ContextPack`]
//! here is a transport contract, intentionally flatter than Cortex's internal
//! `cortex_context::ContextPack`; the upstream pack is reduced to this minimal
//! form at the boundary so that:
//!
//! 1. CellOS never depends on Cortex's authority lattice / contradiction model.
//! 2. Cortex never depends on CellOS's supervisor / host-backend internals.
//! 3. Either side may evolve internal types without breaking the bridge.

pub mod context;
pub mod ledger;
pub mod policy;
pub mod runner;

pub use context::ContextPack;
pub use ledger::{
    CellosLedgerEmitter, CortexLedgerRow, EmittedLedgerEntry, LedgerSink, NdjsonLedgerSink,
    LEDGER_SIGNING_KEY_ENV,
};
pub use policy::{apply_policy, DoctrineAuthorityPolicy, DoctrineAuthorityRule};
pub use runner::{
    wait_for_result_from_jsonl, CellSubmissionOutcome, CellSubmitter, ContextPackTranslation,
    CortexCellResult, CortexCellRunner, CELL_OS_JSONL_EVENTS_ENV,
};