How chrisroyse/calyx works
Purpose and entry points
Calyx is a Rust association-native database: inputs become multi-lens typed “constellations,” which are searched, associated, grounded, guarded, and provenance-recorded. Primary executables are the CLI at crates/calyx-cli/src/main.rs, daemon at crates/calyxd/src/main.rs, and JSON-RPC/MCP server at crates/calyx-mcp/src/main.rs. A separate HTTP-facing API exists at crates/calyx-web-api/src/main.rs.
Foundation: data model, storage, and provenance
calyx-core defines shared IDs, models, traits, temporal/security concepts, and closed errors (crates/calyx-core/src/lib.rs, crates/calyx-core/src/model/mod.rs).
Aster is the embedded transactional storage boundary: vault commits, WAL/replay, MVCC reads/snapshots, SST/mmap structures, indexing, compaction, and GC (crates/calyx-aster/src/vault/store.rs, crates/calyx-aster/src/wal/mod.rs, crates/calyx-aster/src/mvcc/store.rs).
Ledger provides append-only hash-chained provenance, checkpoints, verification, reproduction, and redaction/tombstones (crates/calyx-ledger/src/append.rs, crates/calyx-ledger/src/merkle.rs, crates/calyx-ledger/src/verify.rs). Storage and ledger are the durability/trust boundary for all higher stages.
Measurement and compute
Registry manages immutable, content-addressed lenses/panels, commissioning, persistence, backfill, and runtime adapters (crates/calyx-registry/src/lens.rs, crates/calyx-registry/src/commission.rs, crates/calyx-registry/src/runtime/mod.rs). It supports ONNX, Candle, algorithmic, external-command, static, and HTTP/TEI execution paths.
Forge supplies shared numeric kernels, quantization, CPU SIMD, optional CUDA, and VRAM admission/eviction (crates/calyx-forge/src/backend.rs, crates/calyx-forge/src/cuda/mod.rs, crates/calyx-forge/src/vram/mod.rs). The runtime is Rust 2024; CUDA is optional and paired with CPU fallback/parity-oriented implementations.
Association, search, and information stages
Ingestion measures source content through registry panels and commits constellation slots into Aster; CLI orchestration is centered in crates/calyx-cli/src/cmd/ingest/mod.rs and crates/calyx-cli/src/cmd/ingest/store.rs.
Sextant plans and executes dense, sparse/BM25, late-interaction, graph, temporal, and fused retrieval (crates/calyx-sextant/src/query/planner.rs, crates/calyx-sextant/src/query/executor.rs, crates/calyx-sextant/src/fusion/pipeline.rs).
Loom derives cross-slot agreement, interaction, recurrence, and reactive associations (crates/calyx-loom/src/agreement_graph.rs, crates/calyx-loom/src/cross_term.rs, crates/calyx-loom/src/reactive/engine.rs).
Assay evaluates signal contribution, redundancy, calibration, and sufficiency against outcomes (crates/calyx-assay/src/ensemble/compute.rs, crates/calyx-assay/src/sufficiency/joint.rs, crates/calyx-assay/src/gate.rs).
Grounded intelligence and safety
Lodestar converts associations into corpus kernels, discovery chains, scoped answers, hypotheses, and graph navigation (crates/calyx-lodestar/src/kernel.rs, crates/calyx-lodestar/src/kernel_answer.rs, crates/calyx-lodestar/src/discovery_chain.rs).
Ward is the fail-closed per-slot trust boundary: calibrates thresholds, detects drift/novelty, and emits guard verdicts rather than allowing unsupported output (crates/calyx-ward/src/guard.rs, crates/calyx-ward/src/calibrate.rs, crates/calyx-ward/src/verdict.rs).
Oracle performs evidence-bound prediction, reverse queries, recurrence/consequence analysis, and honesty gating (crates/calyx-oracle/src/predict.rs, crates/calyx-oracle/src/honesty_gate.rs, crates/calyx-oracle/src/butterfly.rs).
Adaptation, services, and domain extensions
Anneal safely tunes indexes, fusion, and related settings through shadow evaluation, tripwires, rollback, and learning feedback (crates/calyx-anneal/src/shadow.rs, crates/calyx-anneal/src/tripwire.rs, crates/calyx-anneal/src/rollback.rs). Changes are intended to be reversible and quality-gated before promotion.
calyxd hosts HTTP/MCP, health/metrics, verification loops, CUDA probing, and learner-origin services (crates/calyxd/src/server.rs, crates/calyxd/src/mcp_server.rs, crates/calyxd/src/verify_loop.rs).
calyx-poly is a substantial prediction-market application layer over the core: external HTTP/WebSocket, Gamma/Kalshi/CLOB/on-chain ingestion, feature/graph building, forecasting, settlement feedback, and scheduled operations (crates/calyx-poly/src/pipeline.rs, crates/calyx-poly/src/raw_sources.rs, crates/calyx-poly/src/daily_ops_scheduler.rs).
Main entry points: mod.rs Ingestion · main.rs calyxd · store.rs Aster vault store · planner.rs Sextant
Components 20
Entry Points
- Calyx CLI · Primary command-line orchestration.
crates/calyx-cli/src/main.rs - calyxd · Hosts HTTP/MCP, health, verification, and learner services.
crates/calyxd/src/main.rs - MCP / JSON-RPC server
crates/calyx-mcp/src/main.rs - Web API
crates/calyx-web-api/src/main.rs
Durability & Compute
- Core model · IDs, typed models, traits, temporal and security concepts.
crates/calyx-core/src/model/mod.rs - Aster vault store · Commit boundary for constellation slots and indexes.
crates/calyx-aster/src/vault/store.rs - WAL & replay
crates/calyx-aster/src/wal/mod.rs - MVCC snapshots
crates/calyx-aster/src/mvcc/store.rs - Provenance ledger · Hash-chained provenance, checkpoints, redaction, and reproduction.
crates/calyx-ledger/src/append.rs - Lens registry · Content-addressed lenses, panels, commissioning, and adapters.
crates/calyx-registry/src/runtime/mod.rs - Forge · CPU SIMD kernels with optional CUDA and VRAM management.
crates/calyx-forge/src/backend.rs
Information Pipeline
- Ingestion · Measures content and commits constellation slots.
crates/calyx-cli/src/cmd/ingest/mod.rs - Sextant · Plans and executes dense, sparse, graph, temporal, and fused search.
crates/calyx-sextant/src/query/planner.rs - Loom · Derives agreement, interactions, recurrence, and reactive associations.
crates/calyx-loom/src/agreement_graph.rs - Assay · Evaluates contribution, redundancy, calibration, and sufficiency.
crates/calyx-assay/src/ensemble/compute.rs
Grounded Intelligence
- Lodestar · Builds corpus kernels, discovery chains, scoped answers, and hypotheses.
crates/calyx-lodestar/src/kernel.rs - Ward · Fail-closed per-slot trust verdicts for drift and novelty.
crates/calyx-ward/src/guard.rs - Oracle · Prediction, reverse queries, consequence analysis, and honesty gating.
crates/calyx-oracle/src/predict.rs
Services & Adaptation
- Anneal · Shadow evaluation, tripwires, rollback, and promotion feedback.
crates/calyx-anneal/src/shadow.rs - Calyx Poly · Ingests markets, builds features, forecasts, settles, and schedules operations.
crates/calyx-poly/src/pipeline.rs
Connections 24
- Core model → Aster vault store: typed records
- Aster vault store → WAL & replay: durable commits
- Aster vault store → MVCC snapshots: snapshot reads
- Lens registry → Forge: executes kernels
- Calyx CLI → Ingestion: orchestrates
- Ingestion → Lens registry: measures sources
- Ingestion → Aster vault store: commits slots
- Ingestion → Provenance ledger: records provenance
- Sextant → MVCC snapshots: retrieves constellations
- Sextant → Loom: candidate associations
- Loom → Assay: association signals
- Assay → Lodestar: qualified evidence
- Lodestar → Ward: scoped output
- Ward → Oracle: guard verdicts
- Oracle → Provenance ledger: records evidence trail
- Anneal → Sextant: quality-gated tuning
- Anneal → Assay: shadow evaluation
- calyxd → Sextant: serves retrieval
- calyxd → Provenance ledger: verification loop
- MCP / JSON-RPC server → calyxd: service access
- Web API → calyxd: service access
- Calyx Poly → Ingestion: market source ingestion
- Calyx Poly → Oracle: market forecasting
- Calyx Poly → Anneal: settlement feedback