[core] Phase 1: core, edge and differential tests #2
Reference in New Issue
Block a user
Delete Branch "core/phase-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 1 (core and engine) from docs/ROADMAP.md §6: 27 commits.
What is in it
.gitignore, and a versioned pre-commit hook in.githooks/. It rejects binaries, private keys in many formats and files over 5,000,000 bytes. Enable it once withgit config core.hooksPath .githooks.crates/core: host-file schema with typed errors, plus the edge compiler and the Caddy JSON compiler. Both compilers are deterministic, with golden files.crates/edge: Pingora 0.9.1 with rustls. It covers SNI certificates, health checks, websockets, header rules with secrets from$CREDENTIALS_DIRECTORY, Authelia-compatible forward-auth that fails closed, and ACME via instant-acme. The access log truncates IPs to /24 and /48.tests/diff: 60 requests sent to Ianitor and Caddy 2.11.7. 0 differ; 10 named known divergences, each matching one exact case. Two deliberately broken compilers are caught.tests/support: shared test fixtures.Verification
cargo fmt --checkandclippy -D warningsare clean.cargo test --workspace: 86 passed, 0 failed. Per target: core compile 13, schema 46; edge unit 11, forward_auth 5, secrets 3, upstreams 4, acme_pebble 1; diff 2; testkit 1.Adversarial self-review
The Phase 1 "Done" gate is not fully met. ROADMAP §6 asks for Let's Encrypt staging. ACME is proven only against Pebble, and staging needs a public domain. Status says so, and Mark has to decide.
rustls is "experimental" in Pingora. The fallback is the
opensslfeature, local to edge. Until testssl.sh and h2spec run in phase 4, TLS correctness rests on the diff suite alone.Slowloris is open on the public listeners. There is no overall header deadline: edge keeps a slow connection past 90 s, while Caddy closes it at 60 s. This matters before edge faces the internet. It is listed for phase 4, but it could be argued it belongs before the two-week run beside Caddy.
A DNS lookup per request has no cache. Lookups have a 3 s deadline, but a timed-out lookup still holds a blocking-pool thread. A burst against a host with dead DNS could exhaust the pool.
The diff suite is HTTP/1.1 only, and auth is a mock. It covers no HTTP/2, no real Authelia, no HTTPS upstreams and no ACME config on the Caddy side. Parity is proven only for what the corpus contains.
New validation rules go beyond the roadmap, added to keep the engines identical:
{or}in literal header values*in header names<hostname>.tomlThey are reasonable, but they are decisions §3 didn't list.
Edge is stricter than Caddy on misbehaving auth servers (KD-4 to KD-10, fail-closed 502), and answers 400 where Caddy answers 404 on absolute-form mismatches. These are deliberate. The KD rules compare status codes only.
CLAUDE.md promises things that don't exist yet:
nix build,nix flake check,packages/ui,tests/fuzz,deploy/nixosanddeploy/test-access.sh.The commit prefixes
[repo],[tests],[docs]and[diff]aren't crate or app names, as CLAUDE.md asks.A roadmap contradiction surfaced by the UI design (Handover, needs Mark): §1.6 lists the engine as a rebuild-only change, while §3 and §4 switch it at runtime.
Nothing is deployed and the server is unchanged.