Support loop

The machinery of the support department — School support that runs itself in dry run first — WhatsApp in, scrubbed work orders, cheaper lanes that earn each stage on a bench, and a human gate on every send.

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

StageStarts onSeesWhat it does
ingestscriptraw, on the Macread new messages, group them into asks, one case per ask (voice notes only if already transcribed, otherwise queued)
triagescriptraw, on the Mactopic, tier, and whether a live knowledge-base entry or a guide already covers it
diagnoseclauderawread-only root cause on production
drafthermesscrubbeda reply for the group, in the school's language, 600 characters or fewer
fixclaude (sonnet build agent)repo and scrubbed issuethe code change
reviewclaude (opus judge)the diffapprove or send back
sendhuman—a person sends in the reply chat (today Abdout; later the school's tech contact or the head of support)
kbhermesscrubbeda 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

JobWhenWhat
support:ingestevery 5 minread, triage, work orders, run waiting stages
support:slaevery 15 minbump a tier, mark at risk
support:promote21:30 dailypromote knowledge-base entries into the guides, write today's list
support:digest07:05 dailythe day's knowledge and SLA misses, as text for the head of support
support:ledgerThursday 22:00refresh the baseline
support:benchFriday 10:00re-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.