Repository navigation
console: extract the source, name the API, and take the one breaking minor - #37
Merged
Merged
Conversation
A hand-written browser app was living in a Go repo whose review discipline is built for a proxy path, released on that proxy's cadence. The source now lives in fold-run/fold-console; gateway/console/ is vendored output pinned to a commit and verified by CI, still embedded, so what an operator receives is byte-identical. Assets stay checked in rather than fetched at build time because the module proxy is fold's distribution channel — `go run ...@latest` builds from the proxy zip alone, which runs no generators and carries no submodule content. Splitting the repo forced the second half. /console/api/state was named after its only consumer, which was defensible while that consumer shipped from here and could never disagree with it. It is now a contract: server.introspection serves /api/federation and /api/auth-hint, server.console serves the page, and the response shape joins the frozen wire surface. An operator scripting the federation snapshot no longer has to serve a browser page to get it. Breaking, in a minor, with no aliases — the one release that does this. The deprecation contract in README "API stability" applies from v1.9.0 forward. The alternative was a major, whose module path change would have silently pinned every published `go run ...@latest` to v1.8.0 forever, and fold has no users to protect today. /healthz goes with it: deprecated since v1.5.0 with "removed in the next major", and declining to cut a major would have left it with no removal date at all. fold-discovery keeps its alias, where removal falls through to the document handler instead of 404ing. Also here, found while doing the above: - server.mcpPath is validated against gateway-owned paths. Serving MCP at /api/federation would register a duplicate ServeMux pattern and panic at startup with no useful message; it now fails --validate. - The embedded fonts ship with their OFL text. Required since v1.2 and absent since v1.2; the embed-manifest test keeps it there. - fold_http_rejections_total's introspection_viewer reason is documented. It has existed as console_viewer since v1.3 and was never in the table. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
What
Two changes that turned out to be one. The console's assets move to fold-run/fold-console and are vendored back at a pinned commit; the read APIs they consume get names of their own and a frozen response shape.
The gateway still embeds and serves the console. What an operator receives is byte-identical — verified by hashing
gateway/console/before and after the firstmake sync-console.Breaking, in a minor, deliberately
GET /console/api/stateGET /api/federationGET /console/api/authGET /api/auth-hintGET /healthzGET /health(alias removed)server.console.groupsserver.introspection.groupsserver.console.enabledaloneserver.introspection.enabled…rejections_total{reason="console_viewer"}…{reason="introspection_viewer"}No aliases.
README.md"API stability" records that the deprecation contract applies from v1.9.0 forward and why this release is the exception: a major would change the module path, andgo run github.com/fold-run/fold/cmd/fold@latest— published in the README and seven places inlaunch/— would resolve to the v1 line forever, silently installing v1.8.0 for every future reader. fold has no users to protect today; it will after launch.Config with a stale
console.groupsfailsParseoutright (DisallowUnknownFields), so the break is loud rather than a silently-dropped viewer allowlist.Why the API had to be renamed too
/console/api/statereports the effective policy default and rule count, audit sink types, whether shared state and tracing are on, discovery's last sync, and the viewer's tenant governance — configuration truth that/metricsstructurally cannot answer. Naming it after its only consumer was fine while that consumer shipped from this repo and could never disagree with it. Once the console is versioned separately it can skew, which is what makes this a contract.Vendoring
Pinned by commit SHA, not a tag or release tarball — a SHA is already a content hash, so it cannot be re-pointed at different bytes, and it keeps one pin idiom in the repo alongside
scripts/conformance.sh. Assets stay checked in because the module proxy is fold's distribution channel:go run …@latestbuilds from the proxy zip alone, which runs no generators and — the reason a submodule is not an option — carries no submodule content.Three things keep it honest:
make console-check(blocking CI job) re-vendors and diffs, so a hand edit here cannot merge.CONSOLE_REPOstill points at the canonical repo, so a PR cannot repoint the pin at a fork and pass green.TestConsoleEmbedManifestbounds the embedded file set exactly, so a sloppy sync cannot ship the console repo's README or CI config into an operator's binary.console-sync.ymlproposes weekly bumps as PRs and never auto-merges.Also here, found on the way
server.mcpPathis validated against gateway-owned paths.mcpPath: "/api/federation"would register a duplicateServeMuxpattern and panic at startup; it now fails--validate.introspection_vieweris documented in the metrics table. It has existed asconsole_viewersince v1.3 and was never listed.Verification
make check✅ ·make conformance40/40 ✅ ·make console-check✅Live-checked against a running gateway: renamed endpoints serve, old paths and
/healthz404, CSP intact,../api/federationstays relative so path-prefixed deployments survive.Reviewed by the gateway-reviewer and security-auditor agents. Both found real issues, all fixed here — notably a 403 banner still naming
server.console.groups(fixed upstream, pin bumped, and the asset test now greps for stale config keys as well as stale paths), andconsole-sync.ymlPRs arriving with no CI checks because GitHub does not run workflows forGITHUB_TOKENpushes — verification now runs inline and the PR body says an empty check list means not run, never passed.Not in scope
fold-discoverykeeps its/healthzalias: removing it there falls through to the document handler rather than 404ing, so a stale probe would quietly 200 on the upstreams document. That needs an explicit 404 and its own decision.🤖 Generated with Claude Code