Commit b79b0a4
HTTP capability gateway (Phase 11) + illustrated wiki & reference docs (Phase 12) (#63)
* feat(http): outbound HTTP capability gateway with enforced deadlines
Zig 0.15's std.http.Client.fetch has no timeout and owns its socket, so a
hung VeriSimDB/Steam/Groove endpoint blocked the calling thread forever and
the STEAM_API_TIMEOUT_MS / GROOVE_TIMEOUT_MS constants were inert.
Following the estate's http-capability-gateway direction ("HTTP verbs/routes
become declared capabilities, not accidents" — one policy-driven mediation
layer), this applies the same idea to GSA's OUTBOUND calls. New
src/interface/ffi/src/http_capability.zig is the ONLY caller of fetch in the
FFI layer; every call site declares an OutboundCapability (verb, host_allow,
deadline_ms, purpose/narrative, label, trust — names mirror the gateway DSL)
and call() enforces a host allow-list (default-deny) and a hard wall-clock
deadline.
Deadline mechanism (fetch cannot be cancelled): a worker thread runs the
opaque fetch; the caller waits on std.Thread.Semaphore.timedWait(deadline).
This bounds the caller uniformly for plain HTTP and TLS (Steam) alike, since
it sits above fetch. Ownership is a 2-count refcount on a shared RequestBox
backed by c_allocator (malloc — thread-safe, process-lifetime), so a worker
that outlives a timed-out caller never touches a transient allocator; the
last releaser frees, with no write-after-free and no leak. A bounded
MAX_OUTSTANDING worker cap fails fast (Backpressure) rather than piling up
blocked threads — the client-side echo of the gateway's circuit breaker.
- verisimdb/steam/groove clients: all four fetch sites collapse to one call();
their http.Client fields are removed (the worker owns a fresh client). The
three timeout constants (+ new VERISIMDB_TIMEOUT_MS) are now load-bearing.
A deadline hit maps to probe_timeout; other failures keep their codes. No
new GsaResult variant, so no Types.idr/ABI regen.
- MockHTTP added to the harness (respond_ok / never_respond / slow_respond);
its teardown closes held sockets so abandoned workers unblock and drain
(http_capability.waitQuiescent) before the leak check.
- 5 behavioral tests: hung endpoint returns within the deadline (not forever),
happy-path body, slow-respond passes/fails by deadline, default-deny without
a socket, host-allow matching. 167 tests green across six suites + 104 fuzz.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* docs: illustrated wiki (Mermaid) + 5 reference docs (Phase 12)
Completes the remaining `planned` documentation. Two complementary layers:
Illustrated wiki (docs/wikis/, GitHub-native Mermaid diagrams):
Home, 02-Architecture, 03-Installation, 04-Probing-and-Games,
05-The-Proven-ABI, 06-HTTP-Capability-Gateway, 07-GUI-and-Nexus-Setup,
08-Deployment-Topology, 09-Troubleshooting, 10-Contributing.
Deliberately blunt about what works today vs. what needs the estate;
09-Troubleshooting is the direct first-run "why isn't this working" guide.
Reference docs (AsciiDoc):
developer/FFI-MODULE-REFERENCE, developer/PANEL-EXTENSION-GUIDE,
developer/ARCHITECTURE-RATIONALE, maintainer/CI-CD-GUIDE,
maintainer/SECURITY-SCANNING-RUNBOOK.
docs/INDEX.adoc: mark all of the above live; add the wiki map; note the
standards-estate reusable pin has moved past the historically-cited SHA
(NEUROSYM.a2ml still cites the stale value — flagged for follow-up).
All content verified against source; tri-license SPDX headers
(CC-BY-SA-4.0 on docs). No code changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
* docs: make GS007 branch-count note number-agnostic
The live Hypatia GS007 count drifts upward as each phase PR leaves a merged
branch behind; the runbook cited a stale fixed figure. State the mechanism,
not a snapshot number.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaWWedv6VQqeZaPvc94keN
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 309accc commit b79b0a4
23 files changed
Lines changed: 3305 additions & 116 deletions
File tree
- docs
- developer
- maintainer
- wikis
- src/interface/ffi
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | | - | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
64 | 77 | | |
65 | 78 | | |
66 | 79 | | |
| |||
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
77 | 106 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
81 | 110 | | |
82 | 111 | | |
83 | 112 | | |
| |||
0 commit comments