midstream 0.2.0

Real-time LLM streaming with inflight analysis
Documentation
[workspace]
members = [
    "crates/quic-multistream",
    "crates/temporal-compare",
    "crates/nanosecond-scheduler",
    "crates/temporal-attractor-studio",
    "crates/temporal-neural-solver",
    "crates/strange-loop",
]
exclude = ["npm-wasm"]

# Per ADR-0034. Initial rollout is conservative: only lints that the
# existing codebase already passes are added, so this PR lands as a
# pure policy change with zero source modifications required.
# Subsequent ADR-0034 follow-ups tighten the bar (clippy::pedantic,
# unwrap_used/expect_used/panic, missing_docs, broken_intra_doc_links)
# as the relevant remediation lands.
#
# Per-crate `[lints] workspace = true` inherits this table.
[workspace.lints.rust]
# Verified zero `unsafe ` blocks in workspace code (security review,
# 2026-05-13). `deny` lets specific crates opt in later via `#[allow]`
# plus a doc-comment justification; `forbid` would be stricter still
# but blocks even the opt-in path.
unsafe_code = "deny"
# Catches `let _ = … ;` on Results / Futures / iterators that the
# author meant to handle. Real-bug class; no false positives expected.
unused_must_use = "deny"

[workspace.lints.clippy]
# Footgun macros. None of these are intentional in production code.
# `warn` so they show up in PR review without blocking; promote to
# `deny` after the workspace-wide lint sweep ADR follow-up.
dbg_macro = "warn"
todo = "warn"
unimplemented = "warn"

[package]
name = "midstream"
version = "0.2.0"
edition = "2021"
rust-version = "1.81"
description = "Real-time LLM streaming with inflight analysis"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ruvnet/midstream"

# Per ADR-0005, the in-tree `src/lean_agentic/` subsystem duplicates
# (and silently diverges from) the published `midstreamer-*` workspace
# crates. It also currently fails to compile (~27 errors across
# knowledge.rs / optimized.rs / strange_loop.rs / temporal_neural.rs
# / etc.). The full clean-up is a major refactor; in the meantime we
# expose it behind an off-by-default feature so the core `midstream`
# binary + library compile against the published API contract.
[features]
default = []
lean-agentic = []

[dependencies]
# `hyprstream`, `arrow`, and `arrow-flight` were declared here but never
# imported by any first-party code (verified via grep). They were
# dragging in duckdb (bundled), tonic 0.12, and a dual rustls / hyper
# graph at zero benefit. Removed per ADR-0002 (un-vendor hyprstream)
# and ADR-0010 (drop unused arrow-flight). If we ever need Arrow-style
# IPC again, re-add the specific module behind a feature flag.
tokio = { version = "1.42.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
async-trait = "0.1"
futures = "0.3.31"
tracing = "0.1"
config = { version = "0.13", features = ["toml"] }
chrono = "0.4"
reqwest = { version = "0.11", features = ["json", "stream"] }
eventsource-stream = "0.2"
tokio-stream = "0.1"
dotenv = "0.15"
async-stream = "0.3"
# Zero-copy buffers on the streaming hot path (ADR-0006).
bytes = "1"
# Lean Agentic dependencies
thiserror = "2.0"
dashmap = "6.1"
lru = "0.12"

# Phase 1: Temporal and Scheduling integrations (local workspace crates)
midstreamer-temporal-compare = { version = "0.1.1", path = "crates/temporal-compare" }
midstreamer-scheduler = { version = "0.1.1", path = "crates/nanosecond-scheduler" }

# Phase 2: Dynamical systems and temporal logic (local workspace crates)
midstreamer-attractor = { version = "0.1.1", path = "crates/temporal-attractor-studio" }
midstreamer-neural-solver = { version = "0.1.1", path = "crates/temporal-neural-solver" }

# Phase 3: Meta-learning and self-reference (local workspace crates)
midstreamer-strange-loop = { version = "0.1.1", path = "crates/strange-loop" }

# QUIC multi-stream support (local workspace crate)
midstreamer-quic = { version = "0.1.1", path = "crates/quic-multistream" }

# Additional dependencies for advanced integrations
nalgebra = "0.33" # For linear algebra in attractor analysis
ndarray = "0.16" # For multi-dimensional arrays

[dev-dependencies]
mockall = "0.11"
tokio = "1.42.0"
tokio-test = "0.4"
criterion = { version = "0.5", features = ["async_tokio", "html_reports"] }

[[bench]]
name = "lean_agentic_bench"
harness = false

[[bench]]
name = "temporal_bench"
harness = false

[[bench]]
name = "scheduler_bench"
harness = false

[[bench]]
name = "attractor_bench"
harness = false

[[bench]]
name = "solver_bench"
harness = false

[[bench]]
name = "meta_bench"
harness = false

[[bench]]
name = "quic_bench"
harness = false

[[example]]
name = "openrouter"
path = "examples/openrouter.rs"

[[example]]
name = "lean_agentic_streaming"
path = "examples/lean_agentic_streaming.rs"