You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dc114d7
Browse filesBrowse the repository at this point in the historyBrowse files
docs(architecture): say what the SDK carries, and stop naming a route that cannot exist
Both findings were real, and checking the first one surfaced a third thing in
the same diagram.
"Next->>API: fetches state X-LearnStack-Host + …" was meant as the verb and
reads as the noun — a call that fetches state, rather than a call that states
the host. It says "call carrying" now.
The edge-resolution section was a nine-line prose block where CLAUDE.md asks for
"heading + bullets over essay paragraphs". Four bullets, one per rule, and no
rule lost: the edge resolves for rendering, the API resolves for itself, the SDK
states a HOST over the hop because a host is a lookup key with a closed codomain
where a tenant id is a selection, and X-Tenant-Id is an assertion whose mismatch
is a 404.
And the diagram and the middleware sample both called
`GET /v1/tenants/resolve-host` — an endpoint no other document in the corpus
defines, on a route shape ADR-0024 does not allow, since everything public is
`/api/v{N}/`. An earlier round corrected the prose around it and left these two.
They now name the shape and the owner — an `/api/v1` host lookup that Phase 02d
ships, which is the phase that first needs one, because it is the phase that
puts two tenants in a browser. The `fetch('/v1/...')` in the forbidden-calls
sentence goes the same way: an example of what not to write should still not
teach a route shape that cannot exist.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
API->>API: resolve the host independently; compare any assertion
176
180
API-->>Next: tenant- + org-scoped responses
177
181
Next-->>Browser: rendered HTML
@@ -234,7 +238,7 @@ Two paths:
234
238
-**Server-side** — React Server Components and route handlers call the .NET API directly using the typed SDK in `packages/sdk`. The SDK is generated from the backend's OpenAPI document; [Standards 07 § SDK](../standards/07-frontend-architecture.md) owns when and how.
235
239
-**Client-side** — interactive components fetch through a thin BFF endpoint under `/api/...` that forwards the request with the user's JWT and the tenant header. The BFF exists to keep API base URLs and CORS off the public web origin, not to wrap business logic.
236
240
237
-
The SDK is the only sanctioned way to call the API. Hand-rolled `fetch('/v1/...')` calls are blocked by lint — `no-restricted-globals`, because `fetch` is a global and an import rule could never have caught a single call.
241
+
The SDK is the only sanctioned way to call the API. Hand-rolled `fetch('/api/v1/...')` calls are blocked by lint — `no-restricted-globals`, because `fetch` is a global and an import rule could never have caught a single call.
0 commit comments