Repository navigation
Conversation
console/src/api.ts types the route contract's three read routes and Stop, and checks every response's shape, throwing a typed ApiError rather than returning partial data. It parses the body whatever the Content-Type, since the snapshot feed is text/plain, and uses URLs relative to the page (ADR-012). console/index.html is the empty shell loading tokens.css, components.css and app.js. The Worker answers 404 to anything that isn't /health or /api/*. Fixtures for six states, starting from spec 0002's example data, are what the rest of the wave tests against.
danjamk
marked this pull request as ready for review
November 29, 2026 22:47
Owner
Author
Owner
Author
|
Dispatcher: Needs the operator
|
This branch has not been 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.
Tier: 1, because it changes console/src/, console/test/, console/index.html and docs/decisions/** only. No path in
.github/always-review.yaml.Current step: Done, ready for review
Closes #129
GET /healthreturns the build id; anything that isn't/healthor/api/*is a 404console/index.html: loadstokens.css,components.cssandapp.js, with an empty#approotconsole/src/api.ts: route contract types, fetch functions forapi/waiting,api/runs,api/factoryand the stop route, shape checks that throw a typedApiError(network,status,json,shapewith the field's path), JSON parsed whatever the Content-Typetest/relative-urls.test.tsfails on anyfetch,srcorhrefstarting with/inindex.htmlorsrc/console/test/fixtures/: working, healthy, paused-spend, paused-operator (snapshot feed), stopping, stopped.README.mdthere describes each/health, each fixture parses whole, a missing field throws naming it, plus wrong types, bad times, non-JSON, wrong status and no answerRun notes
make -C console check: passes, typecheck clean and 36 tests in 3 files.GET /healthon the deployed console can only be checked after merge, since deploys run from CI./healthreadsVERSIONand that anything else is a 404. Add the console Worker on workers.dev, behind Access, with its deploy #105 already built the Worker withBUILD_ID, set bydeploy.sh, and with/api/*forwarding. I kept both and made the remaining fallthrough a 404 (decision log). The issue also saysindex.html(tier 1 atconsole/index.html), while the Worker servesconsole/public/(tier 2). I put the shell atconsole/index.htmland left the placeholder inpublic/as it is.waiting,runsandfactoryanswers, plusstopfor the stop states. Where spec 0002 is silent I used the design's titles and made up the rest: per-run costs that sum to $41.20, an hourly series, PR numbers, docs: record deny rule test in cloud session #43 and docs: record deny rule test in cloud session #44 queued, andreference-buildas the reference build's repo name. With these, W1-2's forecast comes out at $103 with a pause at 19:37 UTC, which is its acceptance. The client drops fields the contract doesn't define. Asourcethe response leaves out stays absent; it isn't set toundefined.index.html,app.jsor the design's CSS into the served directory. H-1 in the plan describes one (tsctodist, then copy), but Add the console Worker on workers.dev, behind Access, with its deploy #105 shipped without it, andwrangler.jsoncserves./public. Adding it touchesconsole/package.jsonand eitherwrangler.jsoncorpublic/**, which are tier 2. Spec 0002 has no Example data for the healthy, paused or stop states, so I wrote those from the working state.pnpm installfailed because pnpm writes to~/.local/share/pnpm, which the sandbox makes read-only. It worked withXDG_DATA_HOMEandPNPM_HOMEpointed at$TMPDIR. The console has no Node types, so the tests read fixtures and source files through Vite'simport.meta.glob, declared intest/env.d.ts.index.html, the compiledapp.jsanddesign/*.cssinto the served directory, replacingpublic/index.html, before W1-5 needs a real page. Also the plan's ADR-012 gap 1: makeconsole/src/api.tsthe contract's single typed source.