feat(website): the queen lives at /#/queen on the existing site - #746
Conversation
She had a whole second deployment: apps/queen-web, its own Railway service, its own domain. That service has never once deployed successfully -- 13 of 13 failures. This puts her on the site that is already live instead. Ported from apps/queen-web with no new dependency. The original pulled in @tanstack/react-query for four panels; plain hooks do the same job in 6.4 kB, lazily loaded, so nobody who is not looking at the queen pays for her. Four defects came along with the port and were fixed rather than carried: 1. The three kingdom tabs never worked. setActiveTab was never called, so the highlight sat on Brain whatever you clicked, and the <Link to="?kingdom=…"> targets were read by nothing. They are buttons now and they select what the page renders. 2. Every panel called res.json() without checking res.ok. On static hosting /api/status returns the SPA fallback -- HTML with a 200 -- so the panels died on a JSON syntax error that reads like a bug in the queen. The status and the content-type are both checked, and the real cause is named. 3. EpisodeViewer called episodes?.slice() on whatever came back. A response that is not an array crashed the page on that line. 4. Missing values rendered as 0 and as '...' forever. They render as '—', and an unreachable brain is stated in a banner rather than left to look like a healthy queen with nothing to report. The backend is a separate service and is NOT part of this change. The page reads VITE_QUEEN_API at build time, falls back to localhost:8080 in local dev, and otherwise says plainly that no address is configured. Verified: build clean (522 modules, Queen chunk 6.44 kB + 3.12 kB css), and the rendered page was checked in a browser -- offline banner shown, metrics '—' not zero, improve button disabled with its reason, tabs switching content. Королева переезжает на существующий сайт: /#/queen. Отдельный сервис на Railway не задеплоился ни разу (13 из 13 падений). Новых зависимостей нет, четыре дефекта оригинала исправлены, недоступный мозг теперь сообщается явно, а не выглядит как здоровая королева без данных. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ainst
Read src/background_agent/server.zig instead of assuming. The brain's entire
surface is:
/health -> {"status":"ok"}, no token required
/api/containers -> authenticated
/api/sessions -> authenticated
The queen's panels called /api/status, /api/episodes, /api/improve and
/api/pipeline, and rendered trinity_signature, improve_cycles, uptime_seconds,
env_status and swarm_active. The brain serves none of those routes and returns
none of those fields. Five metrics out of five could never be filled -- not by
a better deployment, not by any deployment. The face and the brain were built
against different APIs and had never been connected.
A panel whose value is structurally unobtainable is worse than a missing panel:
it reads as "not yet" when the truth is "not ever". So:
- Liveness shows what /health actually returns, and says so.
- The improve button is gone. It could only ever have errored; the panel now
states that the route is missing from the brain and what adding it involves.
- Containers and Sessions replace Episodes, and a 401 is reported as "requires
a token" rather than as an unreachable brain -- those are different facts.
Verified: build clean, and the rendered page checked in a browser after a
forced reload, because the first check served a cached bundle and showed the
old endpoint list.
Панели королевы были нарисованы под API, которого нет: мозг отдаёт только
/health, /api/containers и /api/sessions. Пять метрик из пяти не могли
заполниться никогда. Страница приведена к тому, что действительно измеримо.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Follow-up: the face and the brain were never connectedPushed
The queen's panels called The brain serves none of those routes and returns none of those fields. Five metrics out of five could never have been filled — not by a better deployment, not by any deployment. That is why deploying the queen was never going to produce a working page, independently of the four build failures. So this PR now renders what is actually measurable:
Verified after a forced reload: the first check served a cached bundle and showed the old endpoint list, which would have passed as a green check. |
Closes the second deployment.
apps/queen-webhad its own Railway service and its own domain, and that service has never deployed successfully — 13 of 13 failures. This puts the queen on the site that is already live.What this is
A new lazy route
/#/queenonapps/website, ported fromapps/queen-web.No new dependency. The original pulled
@tanstack/react-queryin for four panels; plain hooks do the same work in a 6.44 kB lazy chunk, so nobody who is not looking at the queen pays for her.Four defects fixed rather than carried across
apps/queen-websetActiveTabwas never called, so the highlight sat on Brain whatever you clicked, and the<Link to="?kingdom=…">targets were read by nothingres.json()without checkingres.ok. On static hosting/api/statusreturns the SPA fallback — HTML with a 200 — so panels died on a JSON syntax error that reads like a bug in the queenepisodes?.slice()on whatever came back — a non-array response crashed the page on that line0, or as...forever—, and an unreachable brain is stated in a bannerThat last one is the point of the change. An empty dashboard and a healthy queen with nothing to report looked identical. Now the page says which one it is.
The brain is not part of this
The backend is a separate service. This page reads
VITE_QUEEN_APIat build time, falls back tolocalhost:8080in local dev, and otherwise says plainly that no address is configured. Wiring the brain is the next piece of work, and it is not blocked by this.Verification
Build: 522 modules, exit 0,
Queen-*.js6.44 kB +Queen-*.css3.12 kB, both lazy.Rendered page checked in a browser, not just built:
—, not0