Inference as Code — a single Rust binary that reads a YAML file and runs AI workflows. No Python, no Docker, no vendor lock-in.
# workflow.nika.yaml
schema: "nika/workflow@0.12"
tasks:
- id: fetch
fetch: { url: "https://example.com/article", extract: article }
- id: summarize
with: { text: $fetch }
infer: "Summarize in 3 bullets: {{with.text}}"- What is Nika
- The Diamond rewrite
- Current state
- Architecture
- Admission: 12 gates per crate
- Hygiene: 31 CI vectors
- Getting started
- Documentation
- Why the choices we made
- Roadmap
- Contributing
- License
Nika is a workflow engine for AI: five verbs (infer, exec, fetch,
invoke, agent) wired through a typed YAML schema, a taint-tracking
template engine, and a layered kernel of side effects. Workflows are
human-authored, machine-executable, and reproducible across providers.
The engine ships as a single static binary. Drop .nika.yaml files into
a project, run nika run, get deterministic output.
main is an orphan branch (production · renamed 2026-05-06 from
nika-diamond) — no shared history with brouillon (renamed 2026-05-06
from main legacy). The brouillon branch (138,724 LOC engine monolith,
v0.79.3) stays intact as a read-only reference while Nika is rebuilt as
40-42 clean crates, each ≤15,000 LOC, every file ≤1,500 LOC, every
function ≤100 lines, and every crate gated through a 12-point admission
checklist before joining the workspace.
Why rewrite? Every crate must fit in an AI assistant's context
window with its tests and kernel traits visible. 15k LOC per crate ≈ 7%
of a 1M-token context — enough headroom that automated refactors stop
hallucinating. The full argument lives in
docs/architecture/ai-velocity.md.
Grounding decisions:
- ADR-001 — Diamond orphan branch
- ADR-002 — Forever v0.x release model
- ADR-004 — Context-window-sized crates
- ADR-006 — Layered kernel + ISP traits
- ADR-007 — Forward-compat invariants
- ADR-008 — TOML-driven catalog
Origin story: docs/MANIFESTO.md.
Diamond is v0.80.x. The canonical status block is regenerated by
bash scripts/refresh-status.sh and parity-checked in CI.
| Field | Value |
|---|---|
| Branch | main (production · renamed 2026-05-06 from nika-diamond) |
| Workspace version | v0.80.0 |
| Crates admitted | 7 / 40-42 (run bash scripts/refresh-status.sh for live count) |
| Crates WIP | 1 (nika-schema) |
| Layer distribution | L0: 5 · L0.5: 2 · L4: 1 |
| Lib tests | 1031 passing, 0 failed (grows per crate admission) |
| Clippy warnings | 0 |
.unwrap() in src/ |
0 (CI-enforced) |
| Providers | 32 (TOML-driven catalog) |
| Capability rules | 49 |
| Hygiene vectors | 31 deployed (28 green / 3 yellow / 0 red) |
| ADRs | 35 (30 Accepted + 5 Proposed) |
Admitted crates:
nika-types— L0, 23 foundational value types (cost, trust, budget, baggage…).nika-error— L0,NIKA-XXXerror codes +NikaErrorCodetrait +miettediagnostics.nika-catalog— L0, compile-timephftables: 32 LLM providers, 105 MCP servers, 63 builtins, 65 transforms, 13 embeddings, 49 capability rules.nika-kernel— L0.5, sealed trait contracts for every side effect.nika-kernel-mock— L0.5, deterministic mocks for every kernel trait.nika-catalog-verify— L4 binary, nightly registry drift probe.
WIP: nika-schema — workflow AST + parser (Phase D, scaffolded).
For the canonical 10-year architectural horizon (2026 → 2036) with
42-crate target · 5-verb stress test · per-crate detail · best-enemies
SOTA differentiation · 11/10 amplifiers · anti-Palantir guardian framing ·
see docs/architecture/BLUEPRINT_2036.md
(v1.3 · proposal-grade · annual decennial review 2027-04+).
L5 nika binary, <500 LOC composition root
L4 cli · lsp · serve · init · lints · pck · catalog-verify
L3 runtime · daemon
L2 verb-{exec,fetch,invoke,infer,agent} ·
provider-{rig,native,mock} ·
builtin · builtin-{github,cloud,workspace} · mcp · display ·
media-{cas,image,pdf,document,provenance} ·
pck-{manifest,registry,store}
L1 shield · event · clock · fs · http · blob · process ·
extract · security · git · vault
L0.5 kernel · kernel-mock
L0 types · error · catalog · catalog-verify · schema · binding · pck-manifest
Strict downward-only dependencies. Axes (fs / net / process / time…)
are declared per-crate in [workspace.metadata.diamond.axes] and
enforced by hygiene vectors. Full layer map:
docs/architecture/crate-layer-registry.md.
A crate enters Cargo.toml members = [...] only when all 12 gates
are green in the same commit:
- Spec —
docs/crate-specs/<name>.mdexists - TDD — tests written before implementation
- Impl — compiles, tests pass, no temporary code
- Clippy 0 —
cargo clippy --workspace --all-targets -- -D warnings - Mutation ≥ 90% —
cargo mutants -p <name> - Property —
propteston sensitive surfaces (parsers, encoding) - Benchmarks —
benches/on hot paths (exempt otherwise) - Docs —
cargo doc --no-depszero warnings - Canary E2E —
tests/canary-<name>.nika.yamlpasses (exempt L0) - Legacy parity — golden test vs
git show brouillon:...output - Review swarm — three agents in parallel; P0/P1 fixed same session
- Atomic commit — one admission, one commit
See ADR-003 for the full spec.
scripts/hygiene/check-all.sh + scripts/ci/ + .github/workflows/
enforce Diamond invariants on every push. Selected vectors:
| Check | Rule |
|---|---|
check-loc-limits.sh |
file ≤ 1,500 LOC |
check-crate-size.sh |
crate ≤ 15,000 LOC |
check-fn-length.sh |
fn ≤ 100 lines |
check-unwrap.sh |
0 .unwrap() in src/ |
check-expect.sh |
0 .expect( in src/ |
check-dead-code.sh |
0 #[allow(dead_code)] |
check-layer-deps.sh |
per-layer banned deps (L0 rejects tokio, reqwest, rayon…) |
check-cancel-safety.sh |
every async fn annotated with // CANCEL SAFETY: |
check-owned-strings.sh |
catalog public API stays &'static str |
check-unsafe-count.sh |
unsafe token counter vs frozen baseline (currently 0) |
check-status-claims-sync.sh |
README/ROADMAP status blocks match refresh-status.sh |
forward-compat.yml |
cargo-public-api + cargo-semver-checks on every PR |
hygiene-nightly.yml |
nightly drift issue on RED |
P0/P1 vectors run pre-commit; P2/P3 run pre-push.
Nika is pre-launch. The public nika binary ships at v0.90 once all
40-42 crates are admitted and the seven pre-launch shadow zones are
green. In the meantime, the Diamond workspace is developed in the open.
To work on the engine locally:
git clone https://github.com/supernovae-st/nika.git
cd nika
git checkout main # production Diamond branch (renamed 2026-05-06)
cargo test --workspace --lib # 1031+ lib tests (grows per crate admission)
cargo clippy --all-targets -- -D warnings
cargo fmt --check
bash scripts/hygiene/check-all.sh # 31 drift vectorsEnd-user installation paths (Homebrew tap, cargo install nika,
curl | sh installer) will be documented at
docs.nika.sh/getting-started/installation
when v0.90 tags.
- End-user docs — docs.nika.sh (Mintlify, hosted from supernovae-st/nika-docs).
- Architecture —
docs/architecture/: forward-compat invariants, crate layer registry, capability axes, AI-velocity north star. - ADRs —
docs/adr/, 35 decisions (30 Accepted, 5 Proposed). - Crate specs —
docs/crate-specs/, one spec per admitted crate (Gate 1 artifact). - Exemplary commits —
docs/golden-commits.md.
Single static binary, no runtime install. No garbage collector —
ownership gives workflow determinism. Strong type system catches
integration errors at compile time. Mature async ecosystem (tokio,
rig, rmcp). Cross-platform via cargo-dist with signed releases.
AGPL closes the SaaS loophole that MIT leaves open. If you modify Nika
and run it as a hosted service, users of that service get the source.
A commercial license is available for organizations that cannot accept
AGPL's network clause (Grafana model). Contact:
contact@supernovae.studio.
We do not ship half-features behind "coming in v2". Every release is diamond-grade for its declared scope. SQLite stayed on 3.x for 20 years while adding WAL, FTS, JSON1, window functions — each release complete at that release. That is the model. See ADR-002.
See ROADMAP.md for the full forever-v0.x plan across
v0.81 (forward-compat seams) → v0.90 (Diamond foundation, 40-42
crates) → v0.95 (Cortex + agent-v2) → v0.100 (WASM plugins +
observability + LSP) → v0.110+ (ecosystem, hosted runner, enterprise).
Post-diamond highlights:
nika-memory/ Cortex (v0.95) — persistent agent memory via Oxigraph + FSRS-6 + OWL 2 (9-10 satellite crates).- Agent v2 (v0.95) — parallel tool calls, ReWOO planning, reflection, resume, context compression, four guardrail types.
- WASM plugins (v0.100) — wasmtime + extism sandbox for third-party builtins.
- Observability (v0.100) — OpenTelemetry, trace replay, metrics.
nika-pckfull (v0.95) — sigstore keyless signing, PubGrub resolver, nine first-class content types.
Nika Cloud and Nika Enterprise are deferred to v0.110+ on demand. Self-hosting remains the primary target.
External contributions are welcome once the first post-diamond release
(v0.90) ships. Until then, Nika is being crafted in public and every
crate passes a 12-gate admission swarm. If you want to follow along,
watch the main branch (Diamond production · renamed 2026-05-06) and
docs.nika.sh/changelog.
Security reports: security@supernovae.studio.
AGPL-3.0-or-later — see LICENSE.
Commercial licensing (Grafana model) available for enterprise
consumers. Contact: contact@supernovae.studio.
© 2024-2026 SuperNovae Studio
🦋 Nika — the butterfly on the SuperNovae flag.