This page is the machinery. The department itself — vision, measured baseline, case catalogue, rules and the Al-Ibda trial — is on Support.
The support loop takes routine school support off the Max plan without losing quality. Six launchd jobs wrapped by job-run.sh read a school's WhatsApp groups, open one case per ask, and move each case through stages. A cheaper lane takes a stage only after it earns it. Nothing is ever sent to a group by a machine: the last step is a person.
The runbook for a human or a weaker model is the school-support skill. The tools are in scripts/support/ and the one entry point is scripts/support/loop.mjs.
The stages
| Stage | Starts on | Sees | What it does |
|---|---|---|---|
| ingest | script | raw, on the Mac | read new messages, group them into asks, one case per ask (voice notes only if already transcribed, otherwise queued) |
| triage | script | raw, on the Mac | topic, tier, and whether a live knowledge-base entry or a guide already covers it |
| diagnose | claude | raw | read-only root cause on production |
| draft | hermes | scrubbed | a reply for the group, in the school's language, 600 characters or fewer |
| fix | claude (sonnet build agent) | repo and scrubbed issue | the code change |
| review | claude (opus judge) | the diff | approve or send back |
| send | human | — | a person sends in the reply chat (today Abdout; later the school's tech contact or the head of support) |
| kb | hermes | scrubbed | a knowledge-base entry, then the nightly promotion into the guide |
Tiers set the clock: tier 0 one minute (the bot answers), tier 1 thirty minutes, tier 2 four hours, tier 3 two days. A case that misses its SLA moves up a tier and is marked at risk.
Work orders on GitHub
A case that needs more than a knowledge-base answer gets one issue in databayt/hogwarts with the labels support, stage:<s>, lane:<l> and tier:<n>. The body follows the station formula: Task, Context, References, Constraints, Deliverable, Acceptance criteria. Agents hand off by comment and label change.
Every post passes the scrub check first: phones, emails, login codes and PINs, then the school's roster (no word may match a student, teacher or guardian name). A post that fails is blocked, not trimmed: the case stays on the Mac, waits on a human, and the reason is logged. Raw messages never leave ~/.cache/support/<school>/cases/.
How a lane earns a stage
bench.mjs builds cases from the support ledger (real asks the team solved, scrubbed) and runs each candidate lane on them. Each stage has simple acceptance checks: a draft must match the question's language, carry no personal data, mention the right guide, and stay short; a knowledge-base entry must be valid JSON in both languages with a real guide slug; triage must pick the ledger's topic. A lane holds a stage when it scores within 5 points of claude, the reference, and keeps it while its live pass rate holds. Scores land in ~/.claude/state/support/bench.json and in engine.json → jobs.$lanes as support:<stage>, which kun-claude.sh reads. Free and hermes lanes only ever see scrubbed text; a failed free run retries once on haiku. A person can pin a stage with loop.mjs pin <stage> <lane|clear>; a pin beats the bench.
The live flag
engine.json → jobs.$support.live is false. While it is false the loop is a dry run: it creates no issue, posts no comment, applies no promotion and runs no paid lane. Each would-be post is written to ~/.cache/support/<school>/outbox/ and the case to ~/.claude/state/support/cases.json. Only Abdout flips it. A narrower switch, jobs.$support.trial, allows scrubbed issues, comments and labels for the Al-Ibda trial and nothing else (see Support).
The jobs
| Job | When | What |
|---|---|---|
support:ingest | every 5 min | read, triage, work orders, run waiting stages |
support:sla | every 15 min | bump a tier, mark at risk |
support:promote | 21:30 daily | promote knowledge-base entries into the guides, write today's list |
support:digest | 07:05 daily | the day's knowledge and SLA misses, as text for the head of support |
support:ledger | Thursday 22:00 | refresh the baseline |
support:bench | Friday 10:00 | re-score the lanes |
Run one now: bash ~/.claude/bin/job-run.sh support:ingest -- node scripts/support/loop.mjs ingest. Status: node scripts/support/loop.mjs status.