Architecture and limitations
cmd/faultline handles Ctrl+C and termination notifications. Platform shutdown may still interrupt cleanup. internal/cli handles arguments and output. internal/report defines the redacted JSON contract and report I/O. internal/scenario loads and validates YAML, internal/execute sends bounded HTTP requests, and internal/demo serves an isolated in-memory order backend. YAML is the only direct dependency.
Scenario and report readers bound data independently of file size. Unix opens nonblocking and checks that the handle matches the regular file inspected before opening. Symlinks to regular files are supported on Unix. Windows amd64 resolves a local drive volume, then opens the relative path against its handle while refusing reparses. It checks the opened disk handle and rejects directories, DOS devices, alternate streams, UNC paths, namespace paths, and raw parent components (..). Use an absolute path for a file in a parent directory. Windows native runtime checks are a release gate. Other non-Unix targets fail closed.
Target policy
Accept dotted-decimal IPv4 in 127.0.0.0/8 and bracketed IPv6 loopback ::1, including equivalent IPv6 spellings. An explicit port must be canonical decimal from 1 to 65535. Reject hostnames (including localhost), IPv4-mapped IPv6, zones, alternate IPv4 spellings, credentials, and non-HTTP(S) schemes. The target carries the origin only. The request path carries path and query.
Execution revalidates the scenario and applies only the delivery or verification path and query to the validated origin. Both phases share a dedicated HTTP/1.1 transport that disables proxies, uses fresh connections, and validates the literal IP and port before dialing. It performs no DNS resolution and uses normal TLS certificate verification. Redirect statuses 300, 301, 302, 303, 305, 307, and 308 and protocol upgrade status 101 are rejected. Final statuses outside 200–599 are rejected as transport errors.
Loopback constrains Faultline's connections. The service receiving a request can still call external systems or modify external state.
Demo backend
faultline demo binds to IPv4 loopback. POST /order-events accepts a synthetic JSON event with a string event_id. Buggy mode creates an order on every valid delivery. Fixed mode stores up to 10,000 distinct IDs and returns 200 for repeats or 201 for new orders. Once capacity is reached it returns 503 for unseen IDs. GET /state returns the order and accepted delivery counts. State resets on restart. Ctrl+C closes the listener and allows up to two seconds for active requests to finish.
The separate race-buggy mode splits the duplicate check and insert into two locked sections. race-fixed makes the operation atomic. Both deduplicate sequential deliveries. For a controlled concurrent pair, send X-Faultline-Demo-Barrier: 2 on both requests for the same event ID. The rendezvous lets both buggy checks complete before either inserts. In fixed mode it pairs arrivals before the atomic operation. The gate holds one pending request for up to one second. A second request for the same event releases the pair. An arrival for a different event, or a wait that ends in timeout or cancellation, fails the gate and returns 503 when the connection still permits a response. Omit the header for sequential delivery. This server-side demo gate is separate from the client batch barrier and measured timing.