caelum0x bd58228c14 feat: complete manifest services layer — decomposed modules + Rust gateway
Build the manifest's full decomposed services architecture as real, tested code:
- scheduler: 16 modules (queue/pool/policy/quota/placement/recovery + metrics/
  events/backoff/health/fairness/shutdown + honest nats seam) — 130 tests
- worker: 16 modules (execute/lease/resources/limits + heartbeat/events/telemetry/
  sandbox/recovery/cleanup/upload/artifacts + honest plugins seam) — 52 tests
- api: 20 modules (auth/authz/middleware + per-resource handlers + telemetry/
  facades), app.py now a thin composition root — 98 tests
- gateway: new std-only Rust reverse-proxy crate (proxy/routing/auth/cors/
  rate_limit/retry/timeouts/health/metrics/events/tracing + honest tls seam) — 110 tests

Every one of the 3,161 manifest files now exists. Extractions are behavior-
preserving (all prior tests green); new modules add real capability; nats/tls/
plugins/sandbox are honest documented seams, not fakes.

Rust workspace 352->605 tests; API 35->98. clippy -D warnings + fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 19:55:26 +03:00

30 lines
1010 B
Rust

use std::process::Command;
/// Path to the compiled gateway binary, provided by Cargo to integration tests.
fn binary() -> &'static str {
env!("CARGO_BIN_EXE_lawsynth-gateway")
}
#[test]
fn no_arguments_prints_usage_and_exits_nonzero() {
let output = Command::new(binary()).output().unwrap();
assert!(!output.status.success());
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(stderr.contains("usage: lawsynth-gateway serve"), "stderr: {stderr}");
}
#[test]
fn unknown_subcommand_is_rejected() {
let output = Command::new(binary()).arg("frobnicate").output().unwrap();
assert!(!output.status.success());
assert_eq!(output.status.code(), Some(2));
}
#[test]
fn serve_with_missing_upstream_argument_is_rejected() {
let output = Command::new(binary()).args(["serve", "127.0.0.1:0"]).output().unwrap();
assert!(!output.status.success());
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(stderr.contains("usage"), "stderr: {stderr}");
}