cohesix

Cohesix is an open-source high-assurance control-plane operating system built on the formally verified seL4 microkernel, designed to keep the trusted computing base intentionally small while enabling deterministic orchestration of edge GPU systems and auditable MLOps. Cohesix is "infrastructure for AGI".

View the Project on GitHub lukeb-aidev/cohesix

Secure9P Policy & Implementation Guide

Secure9P is the only control-plane IPC surface in Cohesix. It implements a bounded 9P2000.L codec, a deterministic session engine, and transport adapters used by NineDoor. This guide defines the non-negotiable invariants and ordering guarantees the implementation must uphold so operator-facing tools (cohsh, coh, hive-gateway) remain protocol-faithful.

Related docs

1. Scope

Secure9P provides the 9P2000.L codec, core request dispatcher, and transport adapters used by NineDoor. It must remain usable in no_std + alloc environments and cannot depend on POSIX APIs. It is the sole control-plane IPC surface; the TCP console path reuses the same NineDoor framing with a minimal 9P-style attach/auth handshake (role, optional ticket, idle/auth timeouts, reconnect-friendly) layered alongside the always-on PL011 root console rather than replacing it. The TCP console uses Secure9P-style length-prefixed frames (4-byte little-endian length including the header) to carry each console line. Secure9P sessions present the per-hive and per-role view into the namespace so queen and worker mounts expose different slices of the hive.

Non-goals

2. Layering

Crate Structure

Secure9P is implemented across two core crates:

These replace the former secure9p-wire crate.
All prior wire types and frame rules now live in secure9p-codec; all protocol logic and state tracking now lives in secure9p-core.

secure9p-codec      // Frame encode/decode, length guards, no_std + alloc (std feature for fuzzing)
secure9p-core       // Session + fid tables, AccessPolicy hooks
secure9p-transport  // Optional adapters: InProc ring, Sel4Endpoint, (host-only) Tcp
nine-door           // Filesystem providers, role enforcement, logging

3. Mandatory Defences

Validation order (must remain stable)

  1. Frame length and msize guard.
  2. Codec decode + UTF-8 validation.
  3. Path normalisation + walk depth guard.
  4. AccessPolicy checks (role/ticket).
  5. Provider execution (filesystem semantics).
  6. Deterministic response encoding.

4. Access Policy Hooks

pub trait AccessPolicy {
    fn can_attach(&self, ticket: &TicketClaims) -> Result<(), AccessError>;
    fn can_open(&self, ticket: &TicketClaims, path: &str, mode: OpenMode) -> Result<(), AccessError>;
    fn can_create(&self, ticket: &TicketClaims, path: &str) -> Result<(), AccessError>;
}

Common refusal reasons

5. Testing Matrix

| Suite | Coverage | |——-|———-| | Unit | Frame encode/decode round-trips, fid lifecycle, error mapping | | Integration | Attach/walk/open/read/write across queen/worker roles using in-memory transport | | Negative | Oversized frames, invalid qid types, path traversal attempts, write to RO nodes | | Fuzz | Length-prefix mutations, truncated frames, random tail bytes |

6. TCB Sanity

7. Logging & Observability

8. Error Mapping (Operator Expectations)

These map 1:1 to cohsh/coh errors; no hidden translation layer exists.

9. Cache-Safe DMA for NineDoor Surfaces

NineDoor exposes telemetry and GPU file surfaces that ultimately map onto shared DMA buffers. On AArch64, cache coherence for these shared regions must be enforced explicitly using the kernel VSpace cache operations (Clean, Invalidate, CleanInvalidate, Unify Instruction) so the host and VM observe deterministic data. The manifest cache fields (cache.kernel_ops, cache.dma_clean, cache.dma_invalidate, cache.unify_instructions) define the contract, and coh-rtc rejects configurations that request DMA cache maintenance without kernel cache ops enabled. Root-task emits audit lines around each DMA hand-off so cache flush/invalidate ordering is provable in serial logs without adding new protocols.

10. Pipelining & Batching Controls