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

API Guidelines (Milestone 24c)

This document is the adoption guide for Cohesix APIs introduced in Milestone 24c. It explains what the APIs are, how they map to use cases, and how developers can validate connectivity to the APIs in real environments.

At a glance

Related operator docs

Principles (Non-Negotiable)

Compatibility and Scope (Milestone 24c)

Auth and Role Context

API Surface Map

| Surface | Endpoint or Path | Semantics | | — | — | — | | REST | /v1/fs/ls | LS projection | | REST | /v1/fs/cat | CAT projection | | REST | /v1/fs/echo | ECHO projection | | REST | /v1/meta/bounds | Manifest-derived bounds | | REST | /v1/openapi.yaml | OpenAPI 3.1 spec | | REST | /docs | Swagger UI |

Authoritative control files (JSONL, append-only)

Read-only observability nodes

Schemas and bounds are defined in docs/INTERFACES.md.

Policy and Approval Flow (REST or Console)

Policy gating is manifest-enabled. When active, /policy and /actions appear and gated paths require approvals.

Use-Case Alignment (from docs/USE_CASES.md)

| Use case | API capability | | — | — | | Fleet policy GitOps boundary appliance | /policy/ctl apply and rollback | | Vendor remote maintenance without VPN sprawl | lease windows and preemption via /queen/lease/ctl | | GPU lease broker for multi-tenant edge | lease quotas and read-only /proc/lease/* | | Edge data diode telemetry gateway | export windows via /queen/export/ctl | | Kubernetes coexistence | declarative queue via /queen/schedule/ctl | | Audit-first infrastructure | bounded /proc observability |

Choose Your Transport

Notes:

Golden Path (REST Adoption)

These steps both adopt the API and validate connectivity.

  1. Boot the Queen VM and start the gateway.
    ./qemu/run.sh
    COH_TCP_HOST=127.0.0.1 COH_TCP_PORT=31337 COH_AUTH_TOKEN=changeme \
      COH_ROLE=queen HIVE_GATEWAY_BIND=127.0.0.1:8080 \
      ./bin/hive-gateway
    

    If you built from source, run target/release/hive-gateway (or cargo run -p hive-gateway) instead of ./bin/hive-gateway.

  2. Confirm the gateway is reachable and returns bounds.
    curl -sS http://127.0.0.1:8080/v1/meta/bounds
    
  3. Confirm the gateway can list the namespace.
    curl -sS 'http://127.0.0.1:8080/v1/fs/ls?path=/'
    
  4. Confirm a read-only /proc path exists in your build.
    curl -sS 'http://127.0.0.1:8080/v1/fs/cat?path=/proc/lifecycle/state&max_bytes=128'
    
  5. Optional write-path check (test VM only).
    curl -sS -X POST http://127.0.0.1:8080/v1/fs/echo \
      -H 'Content-Type: application/json' \
      -d '{"path":"/queen/schedule/ctl","line":"{\"id\":\"conn-check\",\"role\":\"worker-gpu\",\"priority\":1,\"ticks\":1,\"budget_ms\":10}"}'
    

    Use this only in disposable environments, then confirm visibility via /proc/schedule/queue.

Connection success signals

OpenAPI and Swagger Guidance

The OpenAPI spec is a public contract. It must remain a strict projection of file semantics.

Python API Support Guidelines

The Python client is a thin wrapper over existing semantics. It must remain non-authoritative.

Python Connection Checks (Expanded)

These checks validate connectivity only. They do not test API code.

Install the client

python3 -m pip install -e tools/cohesix-py

REST backend connectivity

python3 - <<'PY'
from cohesix.backends import RestBackend

backend = RestBackend("http://127.0.0.1:8080")
print(backend.list_dir("/"))
print(backend.read_file("/proc/lifecycle/state", 128).decode("utf-8").strip())
PY

TCP console connectivity

python3 - <<'PY'
from cohesix.backends import TcpBackend

backend = TcpBackend("127.0.0.1", 31337, "changeme", "queen", None)
print(backend.list_dir("/"))
PY

Filesystem backend connectivity

./bin/coh --host 127.0.0.1 --port 31337 mount --at /tmp/coh-mount
python3 - <<'PY'
from cohesix.backends import FilesystemBackend

backend = FilesystemBackend("/tmp/coh-mount")
print(backend.list_dir("/"))
PY

If /proc/lifecycle/state is unavailable, use a read-only path that exists in your build, such as /proc/schedule/summary or /proc/lease/summary for Milestone 24c.

Troubleshooting

References