Crux Daemon · 3. The crate map
The workspace has 28 members, and three further Rust crates live in-tree outside it. This chapter is reference: the complete inventory, in one place, with the reverse-dependency map and the honest notes about what is orphaned or inert.
Measurements are lines across <crate>/src/**/*.rs, including inline #[cfg(test)] modules, at workspace version 0.5.52.
3.1 The complete inventory
| # | Crate | Kind | Files | LOC | Cargo features | Dependents |
|---|---|---|---|---|---|---|
| 1 | corecrux-types | lib | 4 | 2,545 | - | 4 |
| 2 | corecrux-frame | lib | 2 | 345 | - | 6 |
| 3 | corecrux-proto | lib + build.rs | 1 | 98 | - | 3 |
| 4 | corecrux-receipts | lib | 24 | 17,639 | - | 4 |
| 5 | corecrux-segment | lib | 13 | 4,182 | - | 5 |
| 6 | corecrux-storage | lib | 9 | 12,783 | fuzzing | 3 |
| 7 | corecrux-projections | lib | 17 | 12,604 | - | 5 |
| 8 | corecrux-index | lib | 4 | 1,108 | - | 5 |
| 9 | corecrux-retrieval | lib + bench | 6 | 2,044 | - | 2 |
| 10 | corecrux-memory | lib | 24 | 18,727 | llm, dense-embed-model | 5 |
| 11 | crux-sync | lib | 5 | 1,354 | - | 2 |
| 12 | crux-contrib | lib | 2 | 165 | - | 0, orphan |
| 13 | crux-integrations | lib | 4 | 3,465 | - | 3 |
| 14 | crux-observe | lib | 9 | 2,538 | - | 2 |
| 15 | crux-observe-api | lib | 1 | 776 | - | 1 |
| 16 | crux-cost | lib | 6 | 2,156 | - | 2 |
| 17 | vaultcrux-local | lib | 3 | 570 | - | 2 |
| 18 | crux-config-wizard | lib + bin | 11 | 2,579 | - | 1 |
| 19 | crux-lens-features | lib | 3 | 493 | - | 2 |
| 20 | crux-mcp | lib | 77 | 41,878 | - | 1 |
| 21 | crux-session | lib | 15 | 5,789 | - | 6 |
| 22 | rcx-capability-token | lib | 1 | 3,139 | - | 7 |
| 23 | crux-router | lib | 3 | 2,349 | - | 2 |
| 24 | crux-enterprise-shim | lib | 1 | 556 | - | 1 |
| 25 | corecruxd | bin only + build.rs | 155 | 151,433 | otel, wasm-extensions, dense-embed-model, hosted-surfaces | 0 |
| 26 | corecruxctl | lib + bin + build.rs | 52 | 46,615 | - | 0 |
| 27 | crux-claude-hooks | lib + 2 bins | 27 | 10,034 | - | 0 |
| 28 | crux-integration-tests | lib (test harness) | 1 | 552 | - | 0 |
| Total | 520 | 348,516 |
corecruxd has no lib.rs; everything is in the binary crate. rcx-capability-token, crux-observe-api, crux-enterprise-shim and crux-integration-tests are each a single file.
Five binaries are produced across four crates:
| Binary | Crate | Manifest |
|---|---|---|
corecruxd | corecruxd | implicit src/main.rs, Cargo.toml:2 |
corecruxctl | corecruxctl | implicit src/main.rs, Cargo.toml:2 |
crux-hook | crux-claude-hooks | Cargo.toml:10-12 |
crux-llm-shim | crux-claude-hooks | Cargo.toml:19-21 |
crux-config-wizard | crux-config-wizard | Cargo.toml:12-14 |
3.2 What each crate is for
Purpose is taken from the crate's own module documentation; the link goes to it.
| Crate | Purpose | Module doc |
|---|---|---|
corecrux-types | Foundational data types shared across every crate: evidence types, control evidence, decision-plane types. Deliberately a leaf with minimal dependencies so nothing introduces a cycle. JSON via serde. | lib.rs:6 |
corecrux-frame | Canonical frame encoding for on-disk data. The v1 header layout, hash helpers, and the encoder/decoder used by corecrux-segment and downstream replay. Pure types and bit-level layout, no I/O. | lib.rs:6 |
corecrux-proto | A 98-line tonic::include_proto! wrapper with exactly two modules, dataplane_v1 and observe_v1. Proto sources live in proto/. | lib.rs:6 |
corecrux-receipts | Receipts stored as opaque canonical bytes, signature verification, export bundles. Hashing operates over the stored bytes exactly, with no re-serialisation. Ed25519 CROWN receipt signing. | lib.rs:8 |
corecrux-segment | The sealed segment format. An active segment accepts appended frames; at its size threshold it is sealed, a table of contents is written, a BLAKE3 hash covers the whole file, and the segment becomes immutable. LZ4 frame compression, paired with .ccxi companions. | lib.rs:8 |
corecrux-storage | The append-only shard storage engine. Events are hash-partitioned across shards, written to active segments, sealed when full. Each shard has its own directory, manifest and commit markers for crash recovery. Append with backpressure, deterministic replay, integrity verification, epoch-based shard ownership. | lib.rs:6 |
corecrux-projections | Living Objects projections, snapshots and parity harness plumbing. Deliberately deterministic: sorted key orders, integer-only state, stable snapshot encoding. | lib.rs:6 |
corecrux-index | The .ccxi companion index, a seal-time inverted index built alongside sealed segments. Per-token posting lists (PForDelta compressed), per-document metadata, vocabulary table. | lib.rs:6 |
corecrux-retrieval | Fused retrieval. Loads .ccxi companions, builds a merged inverted index, and scores queries with BM25 plus graph signals from ProjectionState. Also exposes the pluggable dense lane. | lib.rs:6 |
corecrux-memory | The fact, session, entity, edge and case stores, plus embeddings. The richest module doc in the workspace. CI enforces a 93% coverage floor. | lib.rs:6 |
crux-sync | Outbox sync client. Offline-first: contributions are written to a local outbox, then pushed on connectivity. Handles authentication, retry with exponential backoff and cursor tracking. CI enforces a 98% coverage floor. | lib.rs:6 |
crux-contrib | Contribution manifest builder and envelope signing, content-addressed references with Ed25519 signatures. Linked into nothing. See §3.5. | lib.rs:6 |
crux-integrations | The manifest contract for integration packs. "Version 1 is intentionally declarative: packs can describe MCP, HTTP, SDK, CLI, file watcher, and webhook recipes, but they do not execute code inside the daemon process." That sentence is the load-bearing security statement of the extension system. | lib.rs:6 |
crux-observe | The self-observation layer. Captures operational events, errors, warnings, metrics, health, and bootstrap documentation as facts in the memory subsystem, so the daemon can reason about its own history. Also owns the log redactor. | lib.rs:6 |
crux-observe-api | Shared wire types for the agent audit-chain data contract. A deliberately frozen schema, the agent_trace_node projection, the mutation-step mapping table, and the reasoning-capture policy. The leanest contract crate in the workspace. | lib.rs:6 |
crux-cost | The three-step cost model. Zero workspace dependencies and two external ones, the easiest crate for an outside consumer to vendor. | lib.rs:8 |
vaultcrux-local | Daemon-local classification and content-loading policy, so transport crates do not duplicate tier-boundary rules. The Local versus HostedGated split is the Community/hosted boundary in the MCP tool surface. | lib.rs:6 |
crux-config-wizard | Composes CLAUDE.md and AGENTS.md from versioned profile fragments. Loaded by the crux-hook session-start hook for drift detection, and callable directly for init, regenerate, check, list, add, remove, diff. | lib.rs:6 |
crux-lens-features | The canonical statement of what a lens is, and the smallest complete example of the pattern. Coverage reports, gap analysis, promise coverage. | lib.rs:6 |
crux-mcp | The MCP tool surface: the 118-tool catalogue, JSON-RPC dispatch, the axum router and SSE transport, agent-token authentication, the audit envelope, the tool ledger, OAuth resource metadata, and the holdout control arm. | lib.rs:8 |
crux-session | The session plane, with four invariants stated verbatim in its module doc. Session registry, capability plans, the sealer, and the install identity. | lib.rs:9 |
rcx-capability-token | The RCX capability-token format, with a fail-closed guarantee stated in the module doc. The most-depended-on crate in the workspace. | lib.rs:8 |
crux-router | RCX daemon router primitives. "Deliberately pure for Phase 1": consumes a capability token and returns deterministic routing and refusal decisions. Network refresh and revocation IO land in later phases. See §3.6. | lib.rs:8 |
crux-enterprise-shim | Enterprise customer-hosted capability-token validation contract: trust-root selection, airgap enforcement, backend and capability matching, egress refusal reasons. The name says shim; it is a fully implemented pure policy contract. | lib.rs:6 |
corecruxd | The daemon. Bootstrap data, seeded passports, lens-kind registrations, HTTP router, gRPC router, MCP server, optional workspace scan and storyline materialiser. Configuration is environment-variable driven. | main.rs:13 |
corecruxctl | The operator CLI, a clap-based dispatcher routing subcommands to handlers in the corecruxctl library crate. 40 handler modules; 51 subcommand variants. | main.rs:9 |
crux-claude-hooks | The Claude Code hook binaries: session-start banner, pre-compact, context monitor, code context, observe capture, plus the experimental local-LLM shim. | lib.rs:11 |
crux-integration-tests | The integration test harness. Exactly one public type, TestDaemon (lib.rs:208); everything else is private. Produces no library consumed by production code. | lib.rs:6 |
3.3 Who depends on whom
Derived by grepping path = "../<crate>" across all 28 manifests. (dev) marks a dev-dependency edge.
| Crate | Depended on by |
|---|---|
corecrux-frame | corecrux-index, corecrux-projections, corecrux-segment (dev), corecrux-storage, corecruxctl, corecruxd |
corecrux-index | corecrux-retrieval, corecrux-storage, corecruxctl, corecruxd (dev), crux-mcp (dev) |
corecrux-memory | crux-lens-features, crux-observe, crux-mcp, corecruxctl, corecruxd |
corecrux-projections | corecrux-retrieval, crux-mcp, crux-session (dev), corecruxctl, corecruxd |
corecrux-proto | crux-integration-tests, corecruxctl, corecruxd |
corecrux-receipts | crux-integrations, crux-mcp, corecruxctl, corecruxd |
corecrux-retrieval | crux-mcp, corecruxd |
corecrux-segment | corecrux-index, corecrux-projections, corecrux-storage, corecruxctl, corecruxd |
corecrux-storage | corecrux-projections, corecruxctl, corecruxd |
corecrux-types | corecrux-receipts, crux-mcp, corecruxctl, corecruxd |
corecruxctl | , (leaf: the CLI) |
corecruxd | , (leaf: the daemon) |
crux-claude-hooks | , (leaf: the hook binaries) |
crux-config-wizard | crux-claude-hooks |
crux-contrib | - nothing. Orphan workspace member. |
crux-cost | corecruxctl, corecruxd |
crux-enterprise-shim | corecruxd |
crux-integration-tests | , (leaf: the test harness) |
crux-integrations | crux-mcp, corecruxctl, corecruxd |
crux-lens-features | crux-mcp, corecruxd |
crux-mcp | corecruxd |
crux-observe | crux-mcp, corecruxd |
crux-observe-api | corecruxd |
crux-router | crux-mcp, corecruxd |
crux-session | rcx-capability-token, crux-sync (dev), crux-claude-hooks, crux-mcp, corecruxctl, corecruxd |
crux-sync | corecrux-memory, corecruxd |
rcx-capability-token | crux-sync, crux-router, crux-enterprise-shim, crux-integrations, corecrux-memory, crux-mcp, corecruxd |
vaultcrux-local | crux-mcp, corecruxd |
Most-depended-on: rcx-capability-token (7), then crux-session and corecrux-frame (6 each). Fan-out leaders: corecruxd depends on 23 workspace crates, crux-mcp on 12, corecruxctl on 12.
corecrux-index is not a runtime dependency of corecruxd. It appears only under [dev-dependencies]. Any documentation placing it on the daemon's runtime request path is wrong.
3.4 The three crates the existing docs never mention
Two crates are named in the workspace exclude list, and there is a third that is neither a member nor excluded.
| Crate | Package | Version | LOC | In the root exclude list? | Manifest |
|---|---|---|---|---|---|
shells/desktop/lifecycle | crux-shell-lifecycle | 0.5.34 | 534 | Yes | Cargo.toml:10 |
shells/desktop/connection | crux-shell-connection | 0.5.34 | 4,726 | No, not listed | Cargo.toml:4 |
shells/desktop/app | crux-desktop-shell | 0.5.34 | - | Yes | Cargo.toml:11 |
crux-shell-connection carries its own [workspace] table (Cargo.toml:16) and its own Cargo.lock, but is not named in the root exclude. It is reachable only as a path dependency of the excluded app crate. Because the root members list is explicit with no globs, cargo does not error, the crate is simply invisible to the daemon workspace.
Four consequences worth stating:
cargo build --workspaceandcargo test --workspacecover 28 of the repository's 31 Rust crates. Any statement that--workspacecovers everything is wrong.- All three shell crates are pinned at
0.5.34while the workspace is at0.5.52, 18 patch releases of drift. Theversion-sync.ymlCI gate only checks the workspace version against the release tag, so the shell crates are not covered by it. - They share the workspace MSRV and licence but not the workspace lints; each declares its own.
crux-shell-connectionsetsunsafe_code = "forbid"locally (Cargo.toml:22-23). crux-shell-lifecycleis deliberately dependency-free, std only, not even tokio, so it compiles and unit-tests on any host including a webkit-less WSL.crux-shell-connectionhas exactly two dependencies, both exact-pinned:blake3 = "=1.8.5"andgetrandom = "=0.3.4". The app crate exact-pinstauri = "=2.11.5",tauri-build = "=2.6.3"andureq = "=3.3.0".
They are built by .github/workflows/desktop-shell.yml, the only build path for them. shells/desktop/app/Cargo.toml:5-7 gives the local-validation instruction: validate with cargo metadata --no-deps, not cargo build.
3.5 crux-contrib is a fully orphaned crate
crux-contrib has zero reverse dependencies. A grep for crux-contrib across every Cargo.toml in the repository returns exactly two hits: its own [package] name, and the workspace members entry at Cargo.toml:14. Nothing links it.
It is nonetheless compiled on every workspace build, tested in CI, and carries a 99% coverage floor (.github/workflows/ci.yml:446), the highest floor in the workspace, on 165 lines of code that no shipped artefact executes.
docs/architecture.md:123 describes it as a live component. It is not on any code path.
3.6 crux-router never checks revocation, and says so
CruxModeStamp.revocation_checked (lib.rs:126), the field on the stamp a RouterDecision carries, not a field on RouterDecision itself, has this doc comment verbatim (lib.rs:120-125):
"Whether the router consulted token revocation state (CRL / push channel) before authorising. Currently always
false: revocation is modelled on the token (crl_url,push_channel) butdecide()does not yet consult it, so a revoked-but-unexpired token is still authorised. Surfaced here so downstream auditors do not read an authorised decision as implying the token was checked for revocation."
State it plainly when you build on this: RCX capability-token revocation is not enforced at the router. Revoke by expiry, or by MCP-plane passport revocation, which is enforced and defaults on. The two postures must not be conflated, see chapter 14 and chapter 16 defect B6.
3.7 Cargo features, complete
Only 3 of 28 crates declare any features. Every optional feature is off by default.
| Crate | Feature | In default? | Gates | Manifest |
|---|---|---|---|---|
corecrux-storage | fuzzing | no (no default key) | fuzz_scan_frames_v1_block_bytes | Cargo.toml:9 |
corecrux-memory | default = [] | - | nothing | Cargo.toml:9 |
corecrux-memory | llm | no | nothing, a dead flag | Cargo.toml:10 |
corecrux-memory | dense-embed-model | no | dep:fastembed (ONNX Runtime) | Cargo.toml:16 |
corecruxd | default = [] | - | nothing | Cargo.toml:10 |
corecruxd | otel | no | OpenTelemetry OTLP export | Cargo.toml:11-16 |
corecruxd | wasm-extensions | no | the wasmtime host for kind: wasm extensions | Cargo.toml:21 |
corecruxd | dense-embed-model | no | forwards to corecrux-memory/dense-embed-model | Cargo.toml:25 |
corecruxd | hosted-surfaces | no | /v1/gpu1/* and GET /v1/cloud/access-contract | Cargo.toml:31 |
corecruxctl | default = [] | - | no optional features | Cargo.toml:57-58 |
corecrux-memory's llm feature is declared with no dep: entries, and no cfg(feature = "llm") exists anywhere in the workspace; it gates nothing.
3.8 What is a stub, and what only sounds like one
Three module comments state the Community/proprietary boundary explicitly:
| Location | What it says |
|---|---|
| dataplane_store.rs:6 | "Crux Daemon stub, the data-plane store requires the proprietary edition. Only type definitions needed by other modules are retained here." |
| pool.rs:6 | "Crux Daemon stub, the data-plane pool requires the proprietary edition." |
| main.rs:45-48 | "gRPC service stubs: dataplane-enabled distributions implement full RPCs; Crux Daemon keeps the server skeleton." |
Staged but not yet wired, with real code behind them:
| Location | Note |
|---|---|
main.rs:51-54 (candidate_links) | "Candidate proposers are staged behind the identity-candidates rollout path; tests exercise creation/proposal before daemon startup wires automatic proposer runs." |
main.rs:38-41 (credit_meter) | "Default-off, append-only comped-wallet meter." |
| passports.rs:572 | Wired by a later milestone (per-session passport binding) |
| corecrux-receipts/src/lib.rs:163 | Agent-observation stream constants declared for a future deployment tier; "only chained-JSONL writes are wired in the community edition" |
| corecruxctl/src/ops.rs:6 | 444 lines documenting a corecruxctl ops append command that has no CLI subcommand; it is a gRPC client for the unimplemented AppendBatch |
There are zero production todo!() / unimplemented!() call sites outside the deliberate gRPC Status::unimplemented returns. Workspace clippy denies both macros (Cargo.toml:132-133). The occurrences that do exist are the stub classifier in the workspace scanner, and one test-only trait impl.
Three names mislead in the opposite direction; these are not stubs:
crux-enterprise-shim, a fully implemented pure policy contract. It is startup-fatal on an invalid trust root (main.rs:422). Call it a policy contract.crux-llm-shim, a real, working local-LLM context-injection proxy, default-off behindCRUX_LLM_SHIM=1, with a localhost/RFC1918-only upstream allowlist.crates/corecruxd/src/http/openai_shim.rs, a working OpenAI-compatible HTTP surface over the MCP tool catalogue.
3.9 Lint posture, which is a genuine trust asset
Set at the workspace root and inherited by every member (Cargo.toml):
unsafe_code = "forbid"(Cargo.toml:115); there is nounsafeRust anywhere in the workspace, enforced by the compiler rather than by review.todoandunimplementedare deny (Cargo.toml:132-133).unused_imports,unused_variables,unused_mut,unreachable_code,unreachable_patternsare all deny.- clippy
correctnessandsuspiciousare deny;style,complexity,perf,pedanticare warn. unwrap_used,expect_used,panic,print_stdout,print_stderrare warn at workspace level, because extracted monorepo code contains hundreds of legitimate uses.
The corecruxd binary escalates the last group to deny for itself (main.rs:9-11), with the rationale stated in the source: "The daemon must never panic on untrusted input." Individual call sites may #[allow] with a // SAFETY: justification. Two module-level exemptions exist: mod metrics (the Prometheus register!() macros panic only on duplicate registration) and corecruxctl's print_stdout / print_stderr, because it is a CLI.
Release profile: opt-level = 3, lto = "thin", codegen-units = 1, strip = "symbols". Production binaries carry no symbols, relevant if you are reading a core dump or a profiler trace from a release build.
3.10 Documentation drift inside the crates
Eight module-doc claims do not match their own code. They are listed here so a reader of the source is not misled by the comment above it.
| # | Claim in the source | Reality |
|---|---|---|
| D1 | corecrux-storage's module doc names key types ShardStore, Shard, CommitMarker (lib.rs:12) | None exist. The real type is ShardStorage (lib.rs:1306) |
| D2 | corecrux-segment's module doc names ActiveSegment, SealedSegment, SegmentManifest (lib.rs:17) | None exist. The real exported types are at lib.rs:113-116 |
| D3 | corecrux-index says "GPU-native retrieval", index "loaded to GPU device memory at query time" (lib.rs:6) | This repository is CPU-only; no GPU path exists. The crate is also a dev-dependency only of corecruxd |
| D4 | crux-claude-hooks says "three subcommands" (lib.rs:11) | The binary exposes seven (main.rs:32-56) |
| D5 | corecruxd advertises "the gRPC API on port 4007 (tonic)" without qualification (main.rs:15) | All 10 registered RPCs return unimplemented, AppendBatch included |
| D6 | crux-mcp's lib doc lists 5–7 "tools exposed" (lib.rs:13) | crates/crux-mcp/src/tools/ holds 52 files and the catalogue is 118 tools |
| D7 | corecrux-memory declares a llm cargo feature (Cargo.toml:10) | It gates nothing anywhere |
| D8 | corecruxctl/src/ops.rs documents a corecruxctl ops append command (ops.rs:6) | No such subcommand exists; the module is unreferenced by main.rs |
corecrux-proto's doc comment describes dataplane_v1 as "the primary data plane used by corecruxd for high-throughput event ingestion" (lib.rs:13). In this edition the dataplane pool is None and the module is a #[allow(dead_code)] skeleton.
3.11 Notes for a reader of the source
- Every crate has an
AGENTS.md, 28 of 28. Onlycrux-claude-hookshas aREADME.md. - Four crates have zero or near-zero external dependencies and are the easiest to read standalone or vendor:
crux-observe-api(serde only),crux-cost(serde + serde_json),crux-enterprise-shim(one workspace dep, no external deps),crux-router(one workspace dep plused25519-dalek). - Eleven tree-sitter grammars are compiled unconditionally into the daemon, TypeScript, Python, Go, Java, C, C++, C#, Ruby, Swift, PHP and the core. Six are exact-pinned, so a grammar upgrade is a deliberate act. They back
workspace_scan_polyglot.rs(7,962 LOC) andworkspace_scan_ast.rs(1,401 LOC). p256is a second signature algorithm alongside Ed25519, because Sigstore Rekor'shashedrekordverification requires ECDSA P-256 while the daemon seal key is Ed25519.ed25519-dalekis pinned withfeatures = ["zeroize"]explicitly, even thoughzeroizeis a default feature, so the signing-key zeroize-on-drop guarantee survives any futuredefault-features = falseon a consumer.
Sources
- Cargo.toml:2-30, the 28 workspace members
- Cargo.toml:37, the
excludelist - Cargo.toml:115,
unsafe_code = "forbid" - Cargo.toml:132,
todo/unimplementeddenied - crates/corecruxd/src/main.rs:9, the daemon's escalated lints
- crates/crux-router/src/lib.rs:120,
revocation_checkedis always false - crates/corecruxd/src/grpc.rs:758, the gRPC stubs
- .github/workflows/ci.yml:446, the per-crate coverage floors

