Add gateway architecture book - #42
Merged
Merged
Conversation
lucarlig
force-pushed
the
user/luca/gateway-book
branch
10 times, most recently
from
June 24, 2026 09:48
de63197 to
749561b
Compare
lucarlig
force-pushed
the
user/luca/gateway-book
branch
4 times, most recently
from
July 4, 2026 20:34
6762548 to
cf54ebf
Compare
lucarlig
marked this pull request as ready for review
July 13, 2026 13:06
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
- Replace `cargo install mdbook` (source build) with taiki-e/install-action prebuilt binary so mdBook is no longer recompiled on every workflow run. - Drop the now-unused rust-toolchain step (mdbook build needs no toolchain). - Move concurrency to per-job: the build group cancels superseded runs per ref, while deploy uses a stable "pages" group with cancel-in-progress false so an in-flight GitHub Pages deployment is never cancelled. Signed-off-by: lucarlig <luca.carlig@ibm.com>
- Landing page: open with a plain-language description and an API-gateway
analogy before the dense one-liner, define the downstream/upstream
direction convention up front, add a "Key terms" table for the
vocabulary reused across the book, and add a goal-based "Where to go
next" pointer.
- Run the Gateway Locally: note that the numbered steps must run in order
in the same terminal because later steps reuse ${TOKEN} and
${SESSION_ID} set by earlier ones.
- MCP Routing Semantics: explain why the name splitter does not cut on the
first '-' (backend names contain hyphens), so the matching rule is no
longer surprising.
Signed-off-by: lucarlig <luca.carlig@ibm.com>
…tion - Configuration Reference: open with what the page is, state that the command-line flag wins over the env var when both are set, and preview how the options are grouped. - Authentication: add a concrete decoded JWT payload for the local admin@example.com subject so the abstract claim tables have a worked example; reiterate that only `sub` drives routing today. - Runtime Configuration: link the UserConfig type sketch to the full JSON document in the local-run tutorial. - Request Flow: point readers to the local-run tutorial to watch the same flow with real requests. - Architecture: note the subpages are ordered for a first read. Signed-off-by: lucarlig <luca.carlig@ibm.com>
…pters Sync existing pages with current main: - document virtual_host_config_layer and its 404 for unknown virtual hosts - move list_resource_templates from local stub to backend fanout with prefixed names and URI templates - replace the fixed 1-hour user config cache expiry with the configurable --user-config-cache-expiry-seconds flag (default 60s, 0 disables) - note that JWT teams and scopes claims are optional - carry the target pipeline and expected config growth notes into the system shape and runtime configuration pages - add a book description to book.toml and update the two affected SVGs Implement the reference and operations chapters from verified behavior: - MCP Method Reference: per-method behavior for initialize, list, targeted, and local methods plus DELETE cleanup - Failure Modes: failure tables per boundary with exact responses - Publishing This Book: local build, validation, and Pages workflow behavior - Telemetry And Diagnostics: signals, filters, the Langfuse/OTel-Collector/ Prometheus verification stack, starter PromQL queries, and a debugging checklist - Testing: workspace checks, in-repo integration tests, and the cf-integration full-stack harness with probe and test-all lanes - Performance: dataplane-only Goose load testing, full-stack Locust runs, headless versus web UI, and benchmark settings Signed-off-by: lucarlig <luca.carlig@ibm.com>
- link the book from the top of the root README - port the README telemetry walkthrough into the book and leave a pointer - fix the README user-config examples: the admin endpoint requires snake_case virtual_hosts and full backend objects, so the old camelCase url-only payloads were rejected - replace the AGENTS.md architecture notes, which duplicated the book and had drifted, with links to the book pages plus working rules and logging guidance Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
…drafts New architecture pages, all from verified code and config: - Security Model And Trust Boundaries: per-boundary trust table, identity and authorization rules, compromise impact, transport posture, local bootstrap and secrets rules - Control-Plane Integration: the current, explicitly provisional integration surface (no formal contract stipulated yet) — route parity, 404 shape, token and claims shape, Redis key/value encodings, schema generation, publisher cadence and staleness bound, front-door split - Concurrency And Runtime Model: single versus multi runtime shapes, the per-runtime-thread session state consequence of SO_REUSEPORT mode, lock map, fanout and cancellation, listener behavior, allocator Implement the two remaining drafts: - Deployment Notes: front-door routing from the reference nginx config, TLS choices per leg, session affinity and failover, Redis availability, image publishing and sizing, deployment checklist - Contributing To The Gateway: crate ownership, routing contract rules, plugin hook rules, validation gates matching pre-commit and CI, and book-sync expectations Cross-link session ownership to the multi-runtime constraint and list the new pages in the architecture index and AGENTS.md. Signed-off-by: lucarlig <luca.carlig@ibm.com>
The /health route is a with_tools bootstrap helper served at /contextforge-rs/health; production builds compile it out and the reference nginx health location does not match the gateway's route. State that plainly instead of suggesting /health can back external checks, note that the bootstrap admin routes bypass the authentication middleware, and tighten the nginx retry wording: non-idempotent MCP POSTs are only retried on connection-stage failures. Signed-off-by: lucarlig <luca.carlig@ibm.com>
The sample backend services default to cpus: 8 with a reservation of 4, so step 1 fails on hosts with fewer CPUs. Document the existing GATEWAY_CPU_LIMIT / GATEWAY_CPU_RESERVATION overrides. Found by running the tutorial end to end; the rest of the flow (token mint, config seed, 401 and 404 negatives, initialize, merged prefixed tools/list from both backends, tools/call, DELETE) verified live as written. Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/gateway-book
branch
from
July 13, 2026 13:23
e6d8889 to
5ecfe33
Compare
dawid-nowak
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/bookfor the gateway architecture guide with getting-started, architecture, MCP behavior, operations, and project sectionsmainmainbehavior:virtual_host_config_layer404 handling, backend-federatedlist_resource_templates, configurable user-config cache expiry, and optional JWTteams/scopesclaimsvirtual_hostsand full backend objects, so the old camelCase url-only payloads were rejectedAGENTS.mdwith links to the book pages, keeping only working rules and logging guidanceValidation
mdbook build docs/bookmdbook test docs/bookgit diff --checkAGENTS.mdchecked against the treeNotes
Repository Pages still needs the publishing source set to GitHub Actions in the repository settings if it is not already configured.