Repository navigation
feat(docs): /docs/api — grayscale public API reference with the connect flow (#867) - #1217
Merged
Merged
Conversation
This was referenced Nov 25, 2026
…ct flow (#867) A signed-out visitor reads every public operation at /docs/api, rendered in-house from openapi.public.json. Owner decisions on #867: - No stock viewer and no design exception. Methods are told apart by weight and an outline for DELETE, never hue. - The first call is a copyable curl built from $ER_API_KEY and $ER_API_ORIGIN, never a live call, so the BFF relays no customer credential and er-server needs no CORS. lib/docs/openapi-reference.ts is the pure half: workflow grouping with an Other fallback, field tables resolving $ref and allOf (flattened structs), and curlFor. Unit-tested against the real document: every operation placed exactly once, only the probes in Other, no operator route, #865 query params, #864 typed responses, and the exact mint request. GET /api/openapi serves the public document signed-out (UNAUTHENTICATED_DIRS and PUBLIC_PATHS, each with its justification). /docs/api joins MARKETING_PATHS (and so the sitemap), PAGE_UPDATED, a Docs breadcrumb section, the footer and the axe sweep. Playwright covers signed-out render, the copied first call (no key inside), an operation's role, typed response and curl, and the public JSON. Co-Authored-By: Claude Opus 5.5 <[email protected]>
landing-page: what /docs/api is, the two owner decisions behind it, and the public /api/openapi route. Also drops the stale claim that the OpenAPI document contains no operations; it has 115. frontend-design-system: the API reference is the standing case of a third-party widget with its own palette, answered by rendering in-house, not by an exception. Plus the regenerated screen inventories. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
marked this pull request as ready for review
November 25, 2026 08:58
The export check rejected any path with an api segment, so the /docs/api page's own export (docs/api, docs/api.html) read as server code. A static export's server code lives at its root (api/ route handlers, Cloudflare functions/ or _worker.js), so the pattern is anchored there. A root api/ is still refused. The preview builds and verifies 35 routes locally, /docs/api included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 25, 2026 09:15 — with
GitHub Actions
Inactive
This was referenced Nov 25, 2026
Closed
athvin
added a commit
that referenced
this pull request
Nov 25, 2026
…thing but one (#1224) deploy-resolve-digests.sh reused the newest digest with --output text, which applies --query per page. er-api now holds 131 images (two pages), so 'the newest' was one digest per page. The er_api= output line split, GitHub rejected the stray line ('Invalid format sha256:e935…'), and both deploy jobs failed on 8d50786 (#1217), so its er-web image never shipped. --output json aggregates every page before the query runs: verified read-only, it returns be6e… alone where text printed be6e… and e935…. A digest that is not exactly one sha256: now refuses the deploy rather than shipping whichever line came first. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
13 of 18 tasks
This branch was previously deployed
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.
Closes #867
What
/docs/api: a signed-out visitor reads every public API operation, rendered in-house fromopenapi.public.json. Each operation shows:$refs linked to a schemas sectioncurlThe page opens with the connect flow: create a key (#866), set it as the bearer, make the first call.
GET /api/openapiserves the same document signed-out.Owner decisions on #867, recorded on the ticket before any code:
curlbuilt from$ER_API_KEYand$ER_API_ORIGIN, so the BFF relays no customer credential and er-server gets no CORS.Why
#857 / #1013: the visible deliverable of the OpenAPI epic, documenting the connect flow end to end.
Proof
make check: 1,165 passed, 0 failed.openapi-reference.test.tsruns against the real public document (8 tests):curl/docs/apirenders signed-out with no redirectcurl/api/openapiis public JSON with no operator route--retries=0under load, but with CI's--retries=2all 44 pass, one flaky. So no baseline changes.make frontend-auditto check.make frontend: 963 passed, 1 failed. The failure isaccount.spec.ts› the new-source wizard maps onto the account canonical attributes (mobile-safari), atoHaveValuein the config wizard, which this diff does not touch. It passed 3 of 3 with--repeat-each=3, and in Self-service API keys: org-admin minting with a role ceiling, list endpoint, show-once UI #866's full run. CI's full tier is the judge.Risk & rollback
New public surface: one static page and one public JSON route serving a committed document with no operator route and no secrets. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-25T09:41:18Zmainis green with this change on it: merge8d507865. The push runsrust45583667939 andfrontend45583668361, plusinfraanddevcontainer, all succeeded.imagesbuilt: run 45583668435, success (er-web built for8d507865).deployconverged, after a fix-forward. This merge's own deploy (run 45584573593) failed in both jobs:deploy-resolve-digests.shpaginated the er-api reuse query (deploy-resolve-digests: --output text paginates the reuse query, so a reused digest is two lines and the deploy fails #1223). Fixed in fix(ci): resolve a reused image digest from all pages, and refuse anything but one (#1223) #1224, whose deploy run 45586659977 succeeded. Process proof: the live colour in dev (ci/web-api-blue) and prod (app/web-api-green) runser-web@sha256:d8b2fa3b…, built from53e21928(which contains feat(docs): /docs/api — grayscale public API reference with the connect flow (#867) #1217). Both pods logged"er-server listening"at 09:35:15Z, and https://dupezero.com/docs/api answers 200.deploywas red for this merge, from a pre-existing bug this frontend-only merge was the first to trigger. Filed as deploy-resolve-digests: --output text paginates the reuse query, so a reused digest is two lines and the deploy fails #1223 and fixed forward in fix(ci): resolve a reused image digest from all pages, and refuse anything but one (#1223) #1224.merge-bus,driftandkindwere already red on schedule before feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202.landing-pageandfrontend-design-systemskills (/docs/api: BFF-served public spec + grayscale API docs viewer #867's decisions), and memoryapi-docs-viewer-decision.Specific to this change
Context — plan, discoveries, measurements, files
Plan
lib/docs/openapi-reference.ts(pure) plusapi-reference.tsxand the page./api/openapi:UNAUTHENTICATED_DIRSandPUBLIC_PATHS, each with its reason.MARKETING_PATHS(and so the sitemap),PAGE_UPDATED, the breadcrumb section, the footer link, the axe sweep.landing-page(/docs/api, and a stale claim corrected),frontend-design-system(the decision).Discoveries
/docs/apiwas already public./docsis aMARKETING_PATHSentry and the proxy matches by prefix. It still needed its own entry for the sitemap.landing-pagewas stale. It claimed the OpenAPI document "contains no operations"; it has 115.allOf. For exampleModelDetail(feat(api): type the 17 operations still publishing {} (#1213) #1214). The field resolver merges theallOfmembers, so those fields render.Measurements
Files
frontend/src/app/(marketing)/docs/api/page.tsx,frontend/src/components/marketing/docs/{api-reference.tsx,docs.css},frontend/src/lib/docs/openapi-reference.ts,frontend/src/app/api/openapi/route.ts,frontend/src/{proxy.ts,lib/site/routes.ts,components/marketing/{seo.tsx,site-links.ts}},frontend/scripts/check-bff-authz.mjs, tests, two skills.