Clara Docs
All docs

M8 evidence: Hosted

Evidence6 min readEdit on GitHub

On this page

Date: 2026-11-24. Machine: macOS 26.3, Apple silicon, Node 22.17.1, npm 11.5.2, Playwright 1.65.1 with Chromium 1255 (in .playwright-browsers/). Commits from 50deed6 to f4b2cd8, after M7's 5e22707.

The brief's work for M8: "The GitHub storage adapter, Vercel entry points, sign-in, hosted MCP, direct mode." Its proof: "storage conformance and write races against the fake GitHub, the sign-in flow against a mock, MCP over HTTP, a local production build."

Acceptance

Check Result
Storage conformance against the fake GitHub The GitHub adapter (library/storage/github.ts) passes the same conformance suite as the memory and disk adapters, all 31 cases: reads, bytes, listing, tags, versions, appends, deletes, conditional writes, all-or-nothing commits, every unsafe path refused, a second handle seeing the first one's commit, and a watcher told of a change (test/unit/storage/github.test.ts). The fake GitHub (test/helpers/fake-github.ts) keeps real git objects with real hashes, answers ref reads with ETags and 304s, refuses a ref move that is not a fast-forward with 422 as GitHub does, protects branches, and counts the quota as GitHub counts it
Write races against the fake GitHub Of many commits racing from one version, exactly one wins (conformance). With no version expected, a commit lands on top of one pushed while it worked; an operation that lost a race is run again through the rules on the new board and lands as one commit by its author; a branch that keeps moving is refused after five attempts. A protected branch is named as protected after one try, not raced five times
The sign-in flow against a mock GitHub's OAuth pages and API are the fake's. The browser is sent to GitHub with a state checked on the way back; a callback with the wrong state, no cookie or an unknown code is refused; an account that cannot reach the repository is told so and signed in to nothing; a person's change is committed with their own token, as them; a write from another site, or with no Origin, is refused though the cookie came with it; a tampered or expired cookie is signed out; sign-out works only from the board's own page (test/unit/server/hosted.test.ts)
MCP over HTTP The MCP conformance suite runs every tool, resource and prompt over Streamable HTTP as well as stdio (test/integration/mcp-conformance.test.ts). The hosted /api/mcp serves the tools to a GitHub token and acts with it, refuses a request with no token or one GitHub does not know (with WWW-Authenticate), answers a rate limit as 429 without telling the client to drop its token, and asks GitHub who a token is once in five minutes
A local production build dist/hosted.js is built by scripts/build.mjs and loaded the way Vercel's api/index.mjs loads it: it signs a person in and commits their change while serving the built web app beside the API, answers a deploy with settings missing by naming them and showing no value, answers every method, ships a vercel.json whose headers are the server's, and bundles nothing that can start a process (test/integration/hosted-build.test.ts)
Vercel entry points api/index.mjs and a vercel.json generated from the server's own security headers by npm run docs, checked by node scripts/docs.mjs --check in CI. A live stream ends itself after 50 seconds with an again event, before Vercel's 60, and the page connects again at once (test/unit/server/live.test.ts, test/unit/web/http.test.ts)
Direct mode Not built. The browser would need the operations, zod and the Markdown format in a lazy bundle: 165 KB gzipped against a 60 KB budget, which the rules forbid raising. D-140 records why and what would make it fit
npm run ci exits 0 in a clean checkout yes, the browser journeys included, before the push

Tests and coverage

npm run ci in a clean clone of 0b68e8a, before it was pushed:

  • 219 test files: 4484 passed, 2 skipped (4486). One test, of whether a process is alive, timed out once under the full run's load and passed alone and on the next full run; nothing was changed for it.
  • Coverage: statements 96.86%, branches 90.68%, functions 97.49%, lines 97.74%.
  • Web app first load 92.6 KB gzipped (budget 100 KB).
  • Browser journeys: 68 passed in 47.7 s.
  • Type checks (both configurations), lint, the generated docs and the bundle budgets passed.

0b68e8a adds the privacy test's list of files that may reach the network: the hosted board's two, server/hosted.ts and library/storage/github.ts, and no other.

Hosted CI on 0b68e8a (run 45522936137): see M9's evidence for the result.

Fresh-eyes review

A subagent read the hosted server, the GitHub adapter, the web client's sign-in and live parts and the Vercel entry with no knowledge of how they were built. It found the token handling, the cookie sealing, the OAuth state, the cross-site checks and the shared object cache sound, and three problems. All three are fixed, each with a test that fails without the fix (92b5bc4):

  1. A protected branch looked like a race. GitHub answers 422 both to a move that is not a fast-forward and to one that branch protection or a ruleset forbids. Clara took every 422 as a race and tried five times, on the person's quota, before telling them someone had committed first. It now looks at the branch again: when it has not moved, the answer is NO_ACCESS, naming the branch as protected and saying to use another (CLARA_BRANCH).
  2. A rate limit was called a bad token. When GitHub rate-limited or failed the check of an agent's token, MCP answered 401 with WWW-Authenticate, which tells a client to drop the token and sign in again. Only a 401 from GitHub now means a bad token; anything else is classified as the adapter classifies it, and MCP sends its status, 429 for a rate limit, asking for authentication only when a token is missing or refused.
  3. Guests could spend the host's allowance. With CLARA_PUBLIC_READ, guests read with no token, and GitHub allows 60 such calls an hour for the host's address, a 304 included. One open tab looked at the branch every 15 seconds. Guests now share one look at the branch at most every two minutes, and HOSTED.md says what the allowance means for a busy board.

M7's hosted run

M7's hosted CI (run 45516814578) failed in three places, which local CI on macOS could not show. All are fixed in 2df6374:

  • On Windows, clara badge and the export's link guard printed paths with \, so their messages differed by system. Paths are now shown with / on every system, as git shows them.
  • In the browser journeys, the static export's filter journey read the served board's cards before the filter from the address applied, and on a slow runner counted all twelve. It now waits until the filter has applied.

Dependencies

Dependabot's two pull requests were taken onto main through the same clean CI rather than merged on GitHub: GitHub Actions pins for CodeQL, dependency review and the pull request title check (1db4c96), and @hono/node-server 2.1.11 (two security fixes, in WebSocket upgrade handling Clara does not use), vitest and @vitest/coverage-v8 5.1.1 and fast-check (f4b2cd8). The pull requests were closed, pointing at the commits.

Not proven here

  • Nothing has been deployed: deploying, and creating the OAuth app it needs, are steps for a person (docs/LAUNCH-CHECKLIST.md, section 7). The hosted board has run only against the fake GitHub, and its build only as Vercel's entry would load it, on this machine.
  • GitHub's real answers may differ from the fake's in ways the fake does not know of. The fake follows GitHub's documented behaviour for every call Clara makes, and the adapter refuses anything it does not expect rather than guessing.
  • MCP's own OAuth sign-in is not built; agents send a fine-grained token (docs/HOSTED.md).
  • Direct mode is not built (D-140).