Repository navigation
feat(ui): serve loopover.ai as a prerendered static site - #10368
Merged
Merged
Conversation
loopover.ai becomes Cloudflare Workers static assets alone: wrangler.jsonc has no `main`, so no Worker script runs per request, and nothing on the site calls api.loopover.ai or any other LoopOver backend. - Remove the signed-in dashboard (/app/*), the public proof and repo-quality pages, the API "Try it" console, the Scalar spike page, the /stats analytics proxy, the audit feed, the API status banner/progress bar/health dot, and the lib/api client with every panel built on it. Their tests go with them. - The homepage stats band and the fairness report render a committed snapshot of the last /v1/public/stats payload (validated against the contract schema); the GitHub chip shows the last known stars/forks. The MCP version badge and changelog still read the public npm registry from the browser. - Docs pages read their frontmatter from the compiled MDX chunk instead of a server function, so client-side navigation needs no server. - PostHog reports straight to its own ingest host now that there is no proxy. - Links to removed pages point at the nearest remaining page; public/_redirects sends old /app, /proof and /repos URLs home. - scripts/prerender-static.ts runs the built Worker under several `wrangler dev --local` instances and crawls every route, docs page and API operation into dist/client as <path>.html plus 404.html, failing on any page or internal link that does not render. It then points dist/server/wrangler.json at the static config, so any deploy of the build output is static. - ui-deploy.yml builds, prerenders and (on main) deploys; pull requests run the build and prerender only. ui-preview.yml prerenders and uploads a static preview version. VITE_LOOPOVER_API_ORIGIN is gone.
Bundle ReportChanges will decrease total bundle size by 4.2MB (-52.69%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10368 +/- ##
=======================================
Coverage 92.31% 92.31%
=======================================
Files 939 939
Lines 114824 114824
Branches 27731 27731
=======================================
+ Hits 105997 106000 +3
+ Misses 7527 7524 -3
Partials 1300 1300
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…elf-hosting docs quote
getPublicStats takes nowMs and computes every other window from it, but the audit_events retention cutoff for the auto-action denominator read the wall clock. Callers passing a clock (the public-stats tests pass a fixed NOW) got a denominator measured against a different day, so the two real-D1 accuracy tests went red once the calendar moved 90 days past their fixtures.
Each of these reads the wall clock in the code under test while its fixtures
carry fixed 2026 dates, so they passed only until the calendar moved past a
window and have been red on every run since. No assertion changes.
- retention, routes-gate-outcome-breakdown, signals, operator-dashboard and
public-eval-scores-route: pin Date (timers stay real) to the day the
fixtures describe, for the tests whose code reads Date.now().
- submitter-reputation: the ledger windows on SQLite's datetime('now'), which
no fake timer reaches, so its fixtures are re-based by whole days onto the
day the suite runs, keeping every gap between rows exact.
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
loopover.ai becomes a static portfolio site with the same design: Cloudflare Workers static assets only (
apps/loopover-ui/wrangler.jsonchas nomain), so no Worker script runs per request and it costs nothing on the Workers Free plan. Nothing on the site callsapi.loopover.aior any other LoopOver backend, at build or run time, soloopover-api(Worker, D1, Queues, Durable Objects, cron) can be retired afterwards. This PR does not change the backend Worker's behaviour or any Cloudflare resource, and does not deploy.Removed
/appand all/app/*children (analytics, audit, commands, config-generator, digest, maintainer, miner, operator, owner, playground, repos, runs, workbench),/proof/$owner/$repo,/repos/$owner/$repo/quality,/docs/fumadocs-spike-api-reference(Scalar spike with its own try-it client)./statsPostHog proxy insrc/server.ts, the audit feed, the API status banner / progress bar / footer health dot / offline toast, thesrc/lib/api/*client (session, status, request, use-api-resource), everyapp-panels/*component and dashboard-only lib, and their tests (UI and root).Replaced with static content
/fairnessrender a committed snapshot of the last/v1/public/statspayload (2026-11-30), dated "as of Nov 30, 2026"; a test parses it with the contract'sPublicStatsSchema./changelogstill read the public npm registry from the browser (not a LoopOver backend), falling back toMCP_PACKAGE_KNOWN_LATEST_VERSION.https://us.i.posthog.comdirectly (no proxy is possible without a Worker).Static-site plumbing
docs.$slugreads frontmatter from the compiled MDX chunk (docsClientLoader.preload) instead of acreateServerFn, so client-side navigation needs no server. A test asserts no module defines a server function.apps/loopover-ui/scripts/prerender-static.tsstarts severalwrangler dev --localinstances of the built Worker and crawls every static route, everycontent/docspage, every OpenAPI operation and every internal link intodist/clientas<path>.html(/asindex.html) plus404.html. Any page or internal link that does not render fails the run. It then replacesdist/server/wrangler.jsonwith the static config, so every way of deploying the build output publishes the static site.wrangler.jsonc:assets.directory: ./dist/client,html_handling: auto-trailing-slash,not_found_handling: 404-page, keeps theloopover.aicustom-domain route, dropsVITE_LOOPOVER_API_ORIGIN.public/_redirectssends old/app,/proof/*,/repos/*URLs home; in-site links to removed pages point at the nearest remaining page.ui-deploy.yml: build, prerender, and onmainwrangler deploy --config wrangler.jsonc; pull requests run build and prerender only.ui-preview.ymland thedeploy-ui-previewaction prerender and upload an assets-only preview version.VITE_LOOPOVER_API_ORIGIN/VITE_PREVIEWremoved everywhere.The prerender serves on ports 47870+ rather than wrangler's default 8787, which
/docs/self-hosting-securityquotes; a page containing the prerender's own origin is refused as origin-bound. The PR'sui-deployrun wrote all 324 pages plus404.html.Pre-existing test failures fixed
validate-testshad been red on main since the calendar moved past the fixtures' dates (main's last CI run, 2026-08-06, was green): 16 tests in 7 files whose code under test reads the wall clock while their fixtures carry fixed 2026 dates. No assertion changed.src/review/public-stats.ts:getPublicStats(env, nowMs)computed every window fromnowMsexcept the audit_events retention cutoff for the auto-action denominator, which read the wall clock. It now passesnowMs(production passesDate.now(), so behaviour is unchanged); this fixes the two real-D1 accuracy tests intest/unit/public-stats.test.ts.test/unit/retention.test.ts(processJob dedupe, maxPerTable invariant),test/unit/routes-gate-outcome-breakdown.test.ts,test/unit/signals.test.ts(lifecycle staleness),test/unit/operator-dashboard.test.ts(finding acceptance) andtest/integration/public-eval-scores-route.test.ts:Dateis pinned (timers stay real) to the day each file's fixtures describe.test/unit/submitter-reputation.test.ts: the ledger windows on SQLite'sdatetime('now'), which no fake timer reaches, so the fixtures are re-based by whole days onto the day the suite runs, keeping every gap between rows (and the julianday merge timing) exact.Before merging
loopover-uiWorkers Builds connection is still attached in Cloudflare and will also run on merge.build:cloudflarenow prerenders anddeploy:built/version:builtdeploy the static config, but if its dashboard deploy command is anything else, disconnect it soui-deploy.ymlis the only deployer (CONTRIBUTING.md updated accordingly).