Hippocampus · Configuration & integration

Loopback HTTPS callables

TlsIdentity { certificates, private_key_der } takes explicit ephemeral DER chain and PKCS#8 test key; explicit CA DER roots are separate. Do not install roots system-wide or persist operational secrets. Enrollment fixes controller/origin/receiver/archive/revision/generation independently of URL, certificate names and requests.

SyntheticHttpsClient::new(address, server_name, server_leaf_sha256, enrollment, identity, roots, budget) accepts a fixed loopback SocketAddr, DNS certificate name (no DNS lookup), one independent exact server-leaf pin and positive network budget ≤10 seconds. TLS1.3 chain/name/validity/EKU, mutual authentication, http/1.1 ALPN and leaf pin precede HTTP. No resumption/early data, system roots, proxies, redirects, retry or fallback. Server replacement requires explicit client reconstruction with independently supplied new pin; restoring old client trust can trust an old server again and is outside receiver rollback protection.

SyntheticHttpsServer::new(address, server_name, identity, roots, budget) configures TLS only, not a peer enrollment table. The caller accepts a loopback TcpStream and immediately calls serve(socket, &mut receiver, minimum_time_ms, FnMut() -> Option<u64>) -> Result<()>. It holds the receiver exclusively for one connection/request; local controls serialize, not concurrently interrupt an in-flight operation. Credential scope is selected from current receiver policy before HTTP parsing, then resampled/rechecked before GET disclosure or PUT acceptance. None, time below independent floor or regression within request denies. Trusted credential clock does not replace TLS certificate time. Absolute deadline bounds network I/O, not synchronous disk/CPU work or caller delay before serve.

Closed request framing: Host is configured DNS name plus explicit port, canonical Content-Length, Connection close, each header exactly once ignoring case. PUT additionally requires Content-Type application/octet-stream and Hippocampus-Metadata. GET permits only the three common headers with length 0. Unknown/duplicate headers, chunking, compression, Expect, upgrade, queries and alternative routes fail. One connection executes one operation; trailing/pipelined requests cannot upload more evidence.

Bounds/constants: transport MAX_BODY_BYTES 1 MiB (narrower than wire 64 MiB), MAX_HEADER_BYTES 12 KiB, MAX_RESPONSE_HEADER_BYTES 1 KiB, MAX_NETWORK_TIME 10 seconds, MAX_OBSERVATION_BYTES 24 KiB, MAX_CAPABILITIES_BYTES 4 KiB. Wire metadata/receipt limits still apply. Success response types are application/vnd.hippocampus.receipt+json, application/vnd.hippocampus.receipt-observation+json, application/vnd.hippocampus.capabilities+json; GET success also requires Cache-Control no-store. Strict bounded observation JSON includes binding, generation, original receipt base64, current disposition and sequence; client checks exact scope, signature/profile and current sequence ≥ acceptance sequence.

Refusals use only Content-Length 0 and Connection close: 403 denied, 409 conflict, 410 suppressed, 413 bounds, 422 invalid evidence, 503 unavailable storage, otherwise 400 protocol. TLS failures may yield no HTTP. TransportError is content-free: InvalidConfig, Denied, Protocol, SizeLimit, Timeout, Connection, Conflict, Suppressed, InvalidEvidence, Unavailable. No arbitrary error bodies are trusted. Only receipt lookup interprets exact empty 404 as absence. Any failure after transmission leaves acceptance uncertain and sender evidence pending.

Capabilities requires kind: "hippocampus.capabilities", version 1, exact nested scope: Enrollment, transport_version, archive_schema, normalizer, receipt_version, receipt_observation_version all 1; adapter: "pi", source_format: "pi-v3", content_policy: "unredacted-synthetic-only", retention_class: "manual-until-delete", synthetic durability_profile; positive bounded max_body_bytes, max_metadata_bytes, max_receipt_bytes, max_receipt_observation_bytes. No unknown/duplicate/missing fields or trailing JSON. Smaller advertised ceilings never raise local caps. Explicit preflight inside the sender callback compares exact pending body/metadata lengths before a separately authorized send; failure keeps pending bytes. Discovery is not an authority lease or integrity check: revoke/suppress afterward and PUT can still refuse. Receipt reconciliation is independent and must not discard historical acceptance because an advisory ingress limit shrank.

Credential replacement reconstructs the client with B's ephemeral identity but unchanged scope, endpoint and server pin. During bounded A/B overlap both can operate in the same grant; after A's end/revocation only B works. A lost A PUT reply can be reconciled with B without reacceptance or rewriting receipt bytes, provided independent receipt trust still permits acknowledgment. Origin revocation denies both. TLS credentials, enrollment authority and receipt signing policy are separate concerns; synthetic receipt-key lifecycle is implemented below, not operational key rotation/custody.