Gateway: reconcile tygo codegen with SPA and enforce in CI - #1563
Open
Evanfeenstra wants to merge 1 commit into
Open
Gateway: reconcile tygo codegen with SPA and enforce in CI#1563Evanfeenstra wants to merge 1 commit into
Evanfeenstra wants to merge 1 commit into
Conversation
types.ts is now truly tygo-generated (make tygo) instead of the phase-8 hand-maintained stop-gap. Types with no adminapi Go struct move to a new hand-maintained ui/src/api/manual.ts: the Window/ Bucket/Dimension unions, the ApiError envelope, the trust-package mirrors (TrustOrg/TrustStatus), and the Bifrost pass-through chat/ usage shapes. SPA imports updated accordingly. evalRefResponse is exported as EvalRefResponse so tygo emits the binding the eval mutations decode. go.sum gains the bifrost core v1.6.2 hashes that were missed when go.mod was bumped. New gateway-check.yml workflow runs make tygo-check (tygo pinned at v0.2.21, same as the Makefile note) and make ui-build on gateway changes, so Go/TS drift fails CI as the phase-8 plan intended. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
make tygo-checkfailed becausegateway/internal/adminapi/ui/src/api/types.tswas still the phase-8 hand-maintained stop-gap, and runningmake tygoproduced materially different output (dropped unions, added interfaces). This PR makes types.ts truly generated and wires the drift check into CI as the phase-8 plan intended.make tygo) and committed; regenerating is byte-stable.ui/src/api/manual.tsfor the types tygo cannot generate:Window/Bucket/Dimensionstring-literal unions (validated Go-side as plain strings, no struct to translate)ApiError(the phase-7 envelope is built inline bywriteError, a map not a struct)TrustOrg/TrustStatus(mirrorinternal/trust, outside tygo.yaml's adminapi scope)ChatMessage,TokenUsage,CacheDebug, …) that Go carries asjson.RawMessagetsc -bpasses.evalRefResponseexported asEvalRefResponseso tygo emits the binding the eval mutations decode.go buildfailed on a clean checkout (Docker masked it viago mod edit -replace). Added the missing hashes — CI's tygo run needs a resolvable module graph..github/workflows/gateway-check.yml: on PRs / main pushes touchinggateway/**, runsmake tygo-check(tygo pinned at v0.2.21, same pin noted in the Makefile) andmake ui-build(Node 24; npm cache keyed on package.json since the SPA's package-lock is git-ignored).Test plan
make tygo-checkpasses (regeneration is a no-op against the committed file)make ui-buildpasses (tsc type-check + vite bundle)go build ./internal/...,go vet ./internal/adminapi/,go test ./internal/adminapi/all pass🤖 Generated with Claude Code