Files
alkhttp/Cargo.toml
T
glm-5.3-flash d7ee302046 fix(gateway): publish validation + streaming + batch semantics (GW-01, GW-06, GW-08..GW-11, HY-13)
- GW-01: /publish validates every NDJSON chunk against the op's
  publish_schema (incl. the first-line chunk) via NdjsonChunkStream —
  terminal Err(INVALID_INPUT)/422 on violation, matching the wire
  dispatcher's per-chunk contract. Route-level fix; the alkcall spine
  was explored and rejected (wire validation is pump-side by design).
- GW-06: the body is streamed, not buffered — Body::into_data_stream()
  -> newline-framed BufferedLines -> lazily parsed chunk stream.
  ADR-068 documents the streamed semantics and the 2 MiB per-line cap.
- GW-08: /batch capped at 100 operations (INVALID_INPUT 400).
- GW-09: internal-op batch entries now carry generated UUID request ids.
- GW-10: first publish line missing `chunk` is rejected INVALID_INPUT.
- GW-11: redundant /publish pre-checks removed; enforcement rides on
  invoke_sink via the shared dispatch spine.
- HY-13: the vacuous stub test was replaced by a body-cut-short test.
- Adjacent: INVALID_OPERATION_TYPE now maps 422 (with identity) / 401
  (without) in error.rs — the route relies on the shared mapper since
  the pre-checks are gone (GW-03's finding; was a 500 fall-through).

Verification: cargo test 211 passed; cargo clippy --all-targets -- -D
warnings clean; cargo fmt --check clean.
2026-08-29 08:25:11 +00:00

76 lines
2.3 KiB
TOML

[package]
name = "alkhttp"
version = "0.1.0"
edition = "2021"
rust-version = "1.85"
license = "MIT OR Apache-2.0"
description = "HTTP interface for the alk stack: serves HTTP/1.1 + HTTP/2 on standard ALPNs (with WebSocket upgrade carrying the channels protocol) and hosts the HTTP-backed call-protocol adapters"
repository = "https://git.alk.dev/alkdev/alkhttp"
keywords = ["http", "websocket", "rpc", "openapi", "mcp"]
categories = ["network-programming", "web-programming", "asynchronous"]
exclude = [".opencode/", "AGENTS.md", "docs/reviews/", "docs/sdd_process.md", "Cargo.lock"]
[lib]
name = "alkhttp"
[features]
default = ["h2", "http1"]
mcp = ["dep:rmcp"]
wss = ["dep:tokio-tungstenite"]
test-support = ["dep:tokio-tungstenite"]
h2 = ["dep:hyper", "hyper-util/http2", "hyper/http2"]
http1 = ["dep:hyper", "hyper-util/http1", "hyper/http1"]
[dependencies]
alkcall = "0.1.1"
arc-swap = "1"
axum = { version = "0.8", features = ["ws"] }
hyper = { version = "1", optional = true, features = ["server"] }
hyper-util = { version = "0.1", features = ["server", "service", "tokio"] }
httpdate = "1"
reqwest = { version = "0.13", default-features = false, features = ["json", "stream", "rustls"] }
reqwest-middleware = "0.5"
reqwest-retry = "0.9"
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "0.28", optional = true, default-features = false, features = ["connect", "rustls-tls-webpki-roots", "handshake"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
yaml_serde = "0.10"
async-trait = "0.1"
tracing = "0.1"
thiserror = "2"
uuid = { version = "1", features = ["v4"] }
futures = "0.3"
openapiv3 = "2"
http = "1"
url = "2"
bytes = "1"
jsonschema = { version = "0.46", default-features = false }
parking_lot = "0.12"
rmcp = { version = "1.8", optional = true, default-features = false, features = [
"client",
"server",
"transport-streamable-http-client-reqwest",
"transport-streamable-http-server",
] }
[dev-dependencies]
http-body-util = "0.1"
tower = { version = "0.5", features = ["util"] }
tokio-tungstenite = "0.28"
[[test]]
name = "ws_upgrade_session"
required-features = ["test-support"]
[[test]]
name = "ws_overlay_ops"
required-features = ["test-support"]
[[test]]
name = "from_mcp_integration"
required-features = ["mcp"]
[[test]]
name = "full_surface"
required-features = ["mcp"]