# builder-log — 401-kilter - 2026-11-16 frame: **the asymmetry is the product, not a rounding error** — the match scores both directions separately (`a_to_b`, `b_to_a`) and shows the gap, so the output is a plan ("bring money or a demo, here is the opener") instead of a nudge ("you should reach out"). Beat a single "do these fit" score, which is what every networking tool already does and why its advice reads as spam. - 2026-11-16 division of labour: **prose and judgment are different model jobs** — DeepSeek (OpenRouter) writes the profile and the verdict; Jev (TypeSafe) types the calibrated questions ("holds what B wants now", "is this a bad deal for B"); code owns the reach gap, fairness ratio and verdict shape. Beat one chat model doing all three: a chat model's "how likely is this" is a sentence, not a number you can gate on, and arithmetic in a model is a bug waiting to happen. - 2026-11-16 `what_low_side_can_add`: **a dead match becomes a live one by pricing the levers** — dollars, a post to their feed, a trial of the product, labour, an intro are the currency that converts a charity ask into a fair trade, so the verdict always proposes concrete additions beyond what the entity already holds. Beat a bare fairness score, which only tells the lower side they have nothing. - 2026-11-16 delivery: **one stdlib file, no deps, keys read from the machine's own env files** — `python3 app.py` serves the UI and the model calls at localhost:4010; `chat_json` insists on the required top-level keys with one corrective retry. Beat a framework app: PEP 668 blocks pip installs on this host, and a JSON-mode reply is a shape promise, not a schema promise — the model returned empty pairs on a live run and the guard is what turned that into a retry instead of a blank scorecard. - 2026-11-16 jev transport: **try OpenRouter's Decisions route first, fall back to TypeSafe direct** — the TypeSafe org has no credits (402 billing_error), and the same request body answers over OpenRouter with the key this machine already holds. Beat hard-coding one transport, which made the whole typed layer look broken when it was only one route being unfunded. - 2026-11-16 real reach: **reach is measured from live signals through a stated rubric, and the model's guess is kept beside it** — `/api/reach` calls three treg capabilities (X followers via `treg.x.user.profile`, headcount via `treg.companies.enrich`, monthly search volume via `treg.google.keywords.volume`), then code maps each signal through a log-spaced breakpoint table to a 0-100 contribution and takes the max as reach, recording the driver. Measured reach overrides the model's number and `reach_model` keeps the disagreement visible. Live: Elon 240,680,298 X followers -> 92 (model had guessed 100), Stripe 10,210 employees -> 65, ~$0.002-0.003 per entity. Beat letting the model assert reach: the whole verdict rests on this number, so it has to be a measured claim with evidence printed under it, not a vibe with a sentence attached. - 2026-11-16 image: **the hero is generated once through OpenRouter's image model and served by the app** — `google/gemini-3-pro-image` via the same `modalities: ["image","text"]` + `image_config` shape the 374 repo uses, falling through a model list and writing `hero.png` (1.0 MB, $0.1385). The prompt states the metaphor (a small ring, a large sphere, a particle beam from small to large) and forbids text. Beat shipping with no art: the page's whole claim is asymmetry, and the image says it before the copy does. - 2026-11-16 deploy: **one stdlib file in a slim image, liveness split from the paid health route** — `fly.toml` polls `/healthz` (touches no provider, costs nothing) while `/health` reports which keys and transports are live; the app binds `0.0.0.0` on Fly and loopback locally off `FLY_APP_NAME`. Secrets imported on stdin (`flyctl secrets import < .env`), never as arguments. Beat pointing the platform check at `/health`, which would have billed a provider on a 30-second timer. - 2026-11-16 groups: **a group is a stated goal plus rules, and the rules are applied in code, not by a model** — `/api/groups/apply` labels the applicant (optionally measuring reach first), then `evaluate_gate` checks reach floor/ceiling, kind, must-offer-any and must-need-any and returns admitted / waitlisted / not_a_fit with the reasons printed. A qualified applicant into a full group is **waitlisted, not refused**, because being early is not the same as being wrong. Beat asking a model to decide membership: a rule that decides access has to be readable, arguable and the same for everyone. - 2026-11-16 waiting list: **the applicant's profile is frozen at apply time, and the check re-runs the rules against that frozen evidence** — so a later check cannot drift, and a promotion is a rules pass plus a free seat, nothing else. `leave` frees a seat, `waitlist/check` promotes and queues a notification per promotion. Beat re-labelling on every check: it would make membership depend on when the check ran. - 2026-11-16 public skill: **the service publishes its own agent skill at `/skill.md`** — frontmatter plus every route, request shape and cost, with the base URL filled from the request Host, so any agent can fetch one URL and use the whole service. Beat a skill that lives only on one machine: a service is only agent-usable if an agent can discover what it does. - 2026-11-16 scheduling: **the waiting list is re-checked by a cron job, because a list nobody re-checks is a promise nobody keeps** — a Hermes cron job runs `POST /api/waitlist/check` every 2h with `continuity`, so it reports only what changed. Notifications are queued, not sent: no mail channel is wired on this host, and claiming someone was emailed when they were not is worse than a visible queue. - 2026-11-16 state: **stateful app, one machine and a mounted volume** — groups/waitlist/notifications live on `/data` (a `matchmaker_data` volume), and the app is scaled to a single instance because two machines would each get their own volume and the group state would diverge. Beat HA: a second machine here is a second, silently different database. - 2026-11-16 gate fix: **a membership criterion is a typed judgment, not a substring match on the model's prose** — found live on prod, where an applicant who "builds AI products, codes and ships" was rejected by the rule `must_offer_any: ["code","ship"]` because the label happened to phrase it as "product development". The criteria are now asked of Jev as one noul per term (`semantic_offer_check`), code takes the best read and still owns the decision; with `gate_mode: typed` and the probabilities kept on the entity, the same applicant now admits at 0.80 and a trademark lawyer is refused on needs at 0.36. The literal check survives only as a named `literal-fallback` when the typed route is unavailable, so a down model cannot silently change who gets in. - 2026-11-16 gate honesty: **the gate threshold is 0.5 and the code says so out loud** — `GATE_THRESHOLD` carries a comment that it is unmeasured and must be replaced by a value sitting in the observed gap between known-good and known-bad applications before it decides anything that matters. Beat shipping the number as if it were calibrated: an unmeasured threshold on a gate that grants access is a guess wearing a verdict's clothes, and the case list is what would make it a decision. - 2026-11-16 read bug: **a route that is GET to list and POST to create must not be read through the POST helper** — `loadGroups()` used the shared `api()` (always POST), so opening the page hit `POST /api/groups` and *created a blank "Untitled group" every load* while showing "no groups yet"; `loadWaitlist` 404'd the same way. Fixed with a separate `getJson()` for every read. This is the class of bug where a write hides behind a read: it looked like empty state, not a side effect, and it took reading the created rows on prod to see it. Grep every read-back for the method it actually issues. - 2026-11-16 connector: **the service is agent-consumable three ways, and the MCP endpoint is a thin adapter over the same functions** — `POST /mcp/` speaks JSON-RPC (`initialize`, `tools/list`, nine `tools/call` tools) and dispatches straight into the same `label` / `gather_reach` / `match` / `apply_to_group` / `check_waitlist` the HTTP routes use, so a hosted assistant (Muse, Claude, ChatGPT) connects with a URL and no key. Tool errors come back as `isError: true` with the message in the content, not as a transport error, so the calling model can read what went wrong. Beat a separate agent-only code path: two implementations of the same rule would drift, and the group gate is exactly the thing that must not differ between callers. - 2026-11-16 llms.txt: **`/llms.txt` is the front door for a hosted assistant, and it says what the service is NOT for** — the same shape as treg's: what it does, when to reach for it, the tool list, how to read `shape` and `gate_mode`, and that notices are queued not sent. Beat only publishing a tool schema: an agent that connects to an MCP server with nine tools still does not know that a charity-shaped match is the normal case rather than an error. Note the file contains literal `{{ }}` prose in some docs and not others, so it is rendered with `.replace("{base}", ...)` while `/skill.md` uses `.format()` — mixing the two silently 500s the route. - 2026-11-16 bouncer: **no logins, one gate every creation passes, and its limits expressed in people** — an actor is a self-declared handle (`X-Kilter-Actor`) or the connecting IP, and `bounce()` runs inside `create_group` / `apply_to_group` and on the paid `/api/reach` and `/api/image` routes, so HTTP and MCP cannot disagree about who may create. Rate limits per hour and day per kind, plus a **people budget**: an owner may admit 50 applicants in total across their groups, which is the number-of-people cap. A rate limit is 429 with `retry_after_s`; an unusable request is 403 with every reason listed. Beat real auth: this is accounting, not identity, and saying so out loud is what keeps it honest — the limits bound damage and spend, they prove nothing about who anyone is. - 2026-11-16 budget placement: **the people budget is enforced at admission, not only at creation** — checking it when a group is made would still let one unlimited group admit five hundred people, so an owner over budget now lands new applicants on the **waitlist** with the reason rather than refusing them, and the same check runs in `check_waitlist`. Proved live with the budget set to 2: a capacity-0 group admitted two and waitlisted the third with "the owner has admitted their whole people budget (2/2)". Beat refusing the applicant: the group's rules were satisfied, and it is the owner who is out of room to grow. - 2026-11-16 deadlock: **a lock held across a call that takes the same lock is a self-deadlock, and `threading.Lock` will not tell you — it just hangs** — `apply_to_group` holds `_LOCK` and then calls `record_use` / `record_admission`, which take it again, so the first application hung forever while the server logged nothing past the group creation (a request is not logged until it responds, so a hang looks like a request that never arrived). Fixed by making it an `RLock`. The symptom to remember: a write endpoint that returns nothing and no error, with the previous request logged and the next one absent. - 2026-11-16 front door: **`/` became the landing page and the working tool moved to `/app`** — the root is the URL somebody pastes to another person or to their agent, and the tool UI (two profile boxes and a verdict panel) explains nothing to a stranger who has never heard of an asymmetric match. The landing page carries the problem, the four moves, the integration blocks and the wizard; the tool keeps its own address. Beat putting the landing above the tool on one page: the two audiences want different things, and the tool's first screen is a form while the landing's first screen is an argument. - 2026-11-16 wizard: **the output is a pasteable artifact, not a signup** — three steps (who are you / what do you want / your handle and what you bring), step 2 chosen by step 1 so nobody sees options that cannot apply, and the result is a tailored instruction block plus the exact first curl. Nothing is submitted; the wizard builds a string. It bakes in the three mistakes an agent would otherwise make — guessing reach instead of measuring it, averaging `a_to_b` and `b_to_a` into one score, and claiming an email was sent — because a contract that does not name the failure mode does not prevent it. - 2026-11-16 button nowrap: **`white-space:nowrap` on a generic `button` rule silently reaches every button, including ones whose text must wrap** — the wizard's choice cards are `