Home /Modules/web-server-technology/1-2-3.md

1-2-3.md

web-server-technology/1-2-3.md · 117 line(s) · markdown

Web Server Technology 1-2-3 Plan

Last reviewed: 2026-10-26 Scope: web-server-technology/ and lib/web-server-technology/ Purpose: Record the delivered dynamic, SQL-backed, dual-stack HTTP/1.1 server and its SLeeLa facade, and track the remaining work before public production deployment. Review type: Source authoring plus local build and runtime smoke tests on the POSIX backend. No automated CI, stress test, or penetration test has been run in this review. Overall status: Core dynamic server, Side-2 envelopment, and the Section-3 in-process hardening (rate limiting, write-auth, trusted-proxy) plus the documented TLS boundary are delivered, built clean, and unit + end-to-end tested. Remaining before untrusted-network exposure: the SQL-engine maturity work (transactions/JOINs/concurrency) and environment-bound validation (CI, stress/fuzz, real IPv6).

Current status snapshot — 2026-10-26

The server builds with no warnings, links the lib/sleela-sql engine, and passes an end-to-end smoke test: dynamic SELECT and filtered queries, the fluent SLeeLaSQL dialect over POST, the read-only write-denial policy, encoded path-traversal containment (403), and static file serving. Dual-stack binding is reported at startup and in /__sleela/status. The SLeeLa facade (SLWebServer, SLSqlEndpoint, SLDualStackBinding) passes sleela check and sleela run under the source-built 2.1 compiler and asserts policy correspondence with the native server. A pre-existing build-breaking brace error in lib/sleela-sql/native/src/sleela_sql.c was fixed and the SHA-256 manifest regenerated.

AreaCurrent observationPriority / status
Dynamic SQL endpoint/db/query executes SQL via the engine and returns JSON per request, in SQL and SLeeLaSQL dialects.Delivered; smoke-tested
World IP reach (dual-stack)One AF_INET6 socket with IPV6_V6ONLY cleared accepts IPv6 and IPv4-mapped peers, with AF_INET fallback.Delivered; IPv4 verified, IPv6 loopback not testable in this env
Write policy/db is read-only by default; mutations require --db-writable. Single-statement-only, 8 KiB SQL bound, 10,000-row JSON bound.Delivered; smoke-tested
Static filesRoot-relative resolution, normalization, .. rejection, canonical-prefix containment.Delivered; traversal test passes
Side 2 envelopmentOne domain fronts many programs (meme/static/sql) via subjects/warrants for causes; Scientist-gated; selectable in startup flags or config file. Side 1 is untouched when inactive.Delivered; gate + routing tested
Rate limitingSliding-window per-peer + global admission control; over-limit = 503, not counted; swept.Delivered; unit + live tested
Write authorizationBearer-token gate on mutating /db, constant-time compare; 401 on missing/wrong.Delivered; unit + live tested
Trusted proxy / client IPHonours Forwarded/X-Forwarded-For only from allowlisted proxies (anti-spoof); keys rate limit + logs on the real client.Delivered; unit + live tested
TLS 1.3Not in-process by design; documented reverse-proxy deployment model with the trusted-proxy hook.Boundary delivered + documented
CPU keep-warm floorClosed-loop controller holds each of the 1-16 cores at a ~11-14% band so the server stays warm; on by default, admin-disablable, low-priority so real work preempts.Delivered; converges ~12.5%, tested
SQL engine maturityLocal CSV-backed subset: no ACID/JOINs/indexes/concurrent-writer isolation (see lib/sleela-sql/ROADMAP.md).High / outstanding
Transport hardeningBounded worker pool and queue, bounded headers/bodies, strict framing, bounded chunked decode, Host enforcement, keep-alive/timeouts, graceful shutdown, synchronized logging.Carried over from Grade 1
TLS / authenticationNot terminated in-process; no authenticated peer identity.Critical / outstanding for public use
Rate limitingOnly the bounded connection queue provides back-pressure; no per-peer windowed limiter.High / outstanding
SQL engine maturityLocal CSV-backed subset: no ACID transactions, JOINs, indexes, or concurrent-writer isolation (see lib/sleela-sql/ROADMAP.md).High / outstanding
Engine handle reuseA fresh engine handle is opened per /db request; no pooled handle.Medium / optimization
Build integrationweb-server-technology/native/Makefile builds and links the engine; not yet wired into the top-level/impl build or CI.Medium / decision required

Safe operating posture: Keep the listener behind a deliberately configured, TLS-terminating, access-controlled boundary (reverse proxy plus per-IP rate limiting) before exposing it to untrusted networks. Leave /db read-only unless a trusted operator explicitly needs writes.

1. Server core and dynamic SQL — delivered

Goal: A dynamic HTTP/1.1 server that answers world IP addresses and serves JSON computed per request from live SQL.

2. SLeeLa facade and verification — delivered

Goal: A faithful SLeeLa-side model of the server with the required metadata.

2b. Side 2 — envelopment (many programs per domain) — delivered

Goal: A domain may carry many subjects/warrants for causes, enveloping many disparate programs behind one domain, available to Scientists and selectable in startup settings or the configuration file. Side 1 stays the default.

3. Hardening before public production

Goal: Make the server safe to expose directly to untrusted networks. The in-process controls and the TLS boundary are now delivered and tested; the remaining items are the SQL-engine maturity work and environment-bound validation.

Delivered

Operational warmth (added)

Shared implementation (consolidation)

Testing + observability (added)

Still outstanding


SLeeLa

<p align="center"><img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela/sleela-wordmark.svg" alt="SLeeLa — The Now. The Ingredient." width="560"></p>