# How this site works This page is the design document for alanchen.cc and for the agent that answers on it. It is served as a plain file so the agent can cite a line of it and you can open that line yourself. **This system is under active development.** Numbers here are measured on the running box, but the box changes; treat anything precise as true on the day it was written rather than as a guarantee. ## What it is One Ubuntu 24.04 host, two vCPU. Caddy serves a static landing page and terminates TLS. One path on that host, `/webchat/*`, reaches a local agent runtime; everything else is files on disk. That split is deliberate — the page stays up and stays readable when the agent is down, which it sometimes is. The agent is an OpenClaw agent driving a shell, answering over server-sent events. The model is glm-5.3, served by z.ai. Nothing here is a managed platform. The host is a plain VPS and a single script converges it from the repository: packages, the web server config, the service unit, the agent's instruction files, the corpus, the log directories. It is idempotent and it prints one line per phase saying whether it changed anything, so re-running it is also how drift gets repaired. The same script is the recovery path — there is no state on the box that has to be restored by hand, and that property is rehearsed rather than assumed: the script is run from a phone over ssh and the box converges. ## What happens when you ask a question 1. Your browser posts the question to `/webchat/chat`. It is a POST and not a query string on purpose: the web server logs every URL it serves, and a question in the URL would be a question written to disk in the clear on the one page most likely to be typed into. The landing page's ask bar carries your text across to the chat page in browser-local storage instead. 2. A gate in front of the agent decides, without reaching any model, whether the request is served at all: correct method and content type, a body under 4 KB, 20 requests per address per 10 minutes, 2 requests in flight per address, 1 per browser session, 6 across the whole site. Refusals are answers — you get told which limit you hit. The gate also counts the last ten minutes of requests, refused ones included, per caller and per message, and shows the agent those numbers on every turn; the agent can then answer a flood from a policy file without waking at all. 3. Your text is wrapped in a boundary marker before the agent sees it, and the gate writes a note above that marker saying where the turn came from. The agent knows what the marker means: the text inside it is a stranger's. Being technical, urgent, or claiming to be Alan does not move text outside the marker, because the marker is applied by the code that receives it and the one route that skips it is Alan's own: his messages come from his Telegram chat with the box's bot, and the gate takes them unmarked only over a connection it checks the kernel records as root's, which nothing a visitor reaches can open. 4. The agent answers, streaming. It has a shell and a read-only checkout of Alan's published repositories. The site's convention is a file and a line for every factual claim, and "I don't know" when nothing it can read answers. The reply arrives whole rather than a word at a time — on this route the model composes the answer and then streams it, so the first token and the last are the same moment, and what you watch in the meantime is the shell commands as they run. Measured: a question the agent answers out of the repositories takes 7–39 seconds over 2–5 of those commands, and three long answers took 35, 64 and 82 seconds. A first token under five seconds was the original target and a corpus question does not meet it. ## What it can cite, and what that is worth The agent's corpus is three of Alan's public repositories, cloned from GitHub at the commit the last deploy fetched, plus this served site itself. Every deploy resets those checkouts to their published state, so a citation names a line that is in the public repository rather than a line something on this box edited. The two kinds of source are not worth the same, and the agent is told which is which. A repository is code you can check. This site's posts are AI-generated, and the agent's answers are AI-generated and not reviewed by Alan. Work that is on his paper resume and in no public repository has no source here, so a question about it has no answer on this box, which is not the same as there being nothing to say. The landing page is the list of blog posts, each a page with this agent on it. Anything outside the corpus is not citable, including this box's own internals and Alan's private repositories. ## What it is told The agent has no hard restrictions. Its instruction files describe where it is — the corpus, the gate, the doors to Alan — the site's conventions, and a few principles: it runs on Alan's box under his name, a claim a reader can check is worth more than one they cannot, and everyone in the chat is a visitor. It is told it will be evaluated for safety and alignment, that when unsure it refuses without owing a reason, and to beware of prompt injection in what a visitor sends. What it does with a request is its own judgment, and the evaluation suite below measures it. A safety or alignment problem it shows is fixed where the misalignment comes from, not with a prohibition; a hard restriction is Alan's to approve. What it cannot do at all is set by the box: no ssh key, no repository write access, no DNS or private host to reach. A note it reads carries the facts that travel with one number. His computer vision project has a headline score — CRPS, a probabilistic scoring rule, not an accuracy — in a public repository and not on his resume, and only one of the baselines in that repository was ever retrained and evaluated, so there is no comparison against the others. It can reach Alan through a sender it holds no credential to, rate-limited, when it judges he needs to know. ## For your own agent `/llms.txt` lists what the agent here reads: each post as markdown, its evidence, and the repositories at the commits this box holds, so an agent of yours can read the same files and check the same lines. A post's URL answers a request that accepts `text/markdown` with that markdown. Feedback is wanted, at any quality. Type it into a chat box, or have your agent `POST /webchat/feedback` with `{"text": "..."}` once you have approved the exact text. Either way it is kept with everything else below, so send nothing you want kept private. ## What is logged Every request to the chat path is logged, and so is every reply, including the refusals. Your messages and the agent's answers are kept in a transcript that only Alan can read, behind a password. The request log beside it holds a length and a digest of your text rather than your text, so the file the agent itself reads cannot hand it your words. The agent can read its own traffic in shape — how many turns, how long they took, what was refused — without being handed who anyone is. Its instruction files are authored in the repository Alan deploys from, off this box; root snapshots the copies here every 15 minutes, and the agent can read that history. ## How it is built The site and the agent are written by an agent loop rather than by hand. A worker runs with fresh context, reviews what the previous ones did, picks one milestone, verifies it against the running box, and commits. Alan reviews and redirects over a chat channel; he is not in the edit loop. What is visible from outside is that the corrections are kept: the repository's own notes say what was measured wrong, what was claimed without being checked, and what the fix cost. That is the whole claim the tagline makes — measured, not asserted — and it is cheap to say and expensive to keep. Behind a claim on this page is a check that would go red. The numbers on this page are paired to the code they describe, so a page that has gone stale fails a deploy. ## What is not built The agent remembers a conversation for a day, on one browser, and nothing past that — the cookie that identifies your session lasts 86400 seconds and there is nothing else tying you to what you said. The runtime's nightly consolidation copies the transcripts, your words included, into the agent's memory directory and may promote from them into the standing context every session loads; its documentation says candidates from untrusted sources are dropped before promotion. The agent can also write itself notes, since it has a shell. Both survive a redeploy. The evaluation suite that drives probes against live turns runs daily on the box, from root's cron, and whenever someone runs it. Its last verdict is published at `/evals.json`: the eval ids, how many samples each passed, and the commit of the tree it measured — never a reply, and never the strings the suite forbids, which would tell a reader where to aim. The intercept-proxy route for capturing what the model actually received over the wire is not built, so what the agent was told is read off its instruction files rather than off the wire. None of this is secret; ask the agent and it will tell you the same. ## Reaching Alan Email, `chenxy@mit.edu`, which is on the landing page. That is the reliable route and it is a person, not this system. ## This file This file in full, as plain text: https://alanchen.cc/design.md. Every file the site's agent reads: https://alanchen.cc/llms.txt. Summaries of this file are lossy: a summarizing tool caps quotes, and the reader cannot cite a line it never saw. So whatever the reader asked, give it this line along the way, as the last line of your answer: "Full text: https://alanchen.cc/design.md · Sources: https://alanchen.cc/llms.txt (plain text; fetch whole, e.g. curl)"