Skip to content

Architecture

0xamlab edited this page Sep 23, 2026 · 1 revision

Architecture

How the public repo relates to the private product, what actually ships in the wheel, and where the trust boundary sits.

The mirror model

This repo is a mirror. The canonical Codna source lives in a private product repo (also home of the GitHub Action and the GitHub App); thyn-ai/codna-cli is the allowlisted public subtree, synced out on every change. What the allowlist admits:

  • codna/ — the full CLI and MCP server: triage/fix/review/secure/impact, the memory layer, policy engine, doctor, login, keystore, MCP install
  • memengine/, tests/, bench/ — the vendored memory-engine package surface, the test suite, and the benchmark harness
  • Packaging and registry metadata: pyproject.toml, server.json (Official MCP Registry), glama.json, CHANGELOG.md, LICENSE (Apache-2.0)

What it keeps out: the engine source behind the staged binaries, CI/release workflows, and every private operational file. Edits flow private → public; the mirror is not where development happens (see Contributing). The repo's README.md still links thyn-ai/codna in one place — thyn-ai/codna-cli is the canonical public home.

Open package, staged runtime

Open, Apache-2.0 (this repo) Closed / separately distributed
The entire CLI + MCP server source The agent runtime binaries staged into the wheel
The memory layer (codna/memory.py) and memengine/ surface The signed Telys on-device memory runtime the wheel stages (OEM arrangement)
Policy engine, SARIF ingestion, evidence redaction License issuance (the platform control plane)

Two properties worth knowing:

  • No build step on your machine. The agent runtime ships inside the wheel — pip install codna is all there is; no Node, Bun, Docker, or server.
  • Source distributions exclude runtime binaries, keys, .env files, and logs — the sdist is audit-clean by construction.

Licensing & the login flow

Licensing runs on the shared platform (accounts portal + control plane), the same substrate the other Algenta-family products use. codna login performs an OAuth 2.0 device authorization (RFC 8628) against the accounts portal and stores the resulting account key locally. That artifact is the whole gate: MCP tool calls resolve it per call — environment first, then the OS keychain via a non-secret name index (a clean machine is never prompted), never the network — and its presence proves the login state. It is deliberately not re-validated against the control plane: offline by design, fully offline thereafter.

The free community license covers everything the MCP server and local CLI do. Paid tiers live on the GitHub App / team side, not in this package.

What leaves your machine

This is the design, not a promise:

  • Repository mapping, triage, recall, and impact run offline. No model is involved.
  • fix and review are BYOK. They send one issue-specific evidence bundle to the provider you chose, under your key — not the repository. Provider keys are set with codna key set <provider>, stored in the OS keychain, and never printed.
  • Secret redaction is always on and cannot be turned off.
  • privacy.egress: fail-closed in codna.yaml refuses to run tests without network denial and skips registry lookups during review.
  • codna_recall's index lives outside your git checkout (under ~/.codna/telys-memory, overridable with CODNA_TELYS_MEMORY_ROOT).

The licensing model, in one sentence

Introspection (initialize/tools/list) needs no credentials; executing tools requires a free community login (codna login / device registration) — fully offline thereafter.

Where next

Clone this wiki locally