Esc
↑↓ to move↵ to openEsc to close

DocsArchitecture

Services

What each service owns, and where each one is allowed to fail.

Riffle is four independently deployable services. Each boundary is a place where the failure mode changes — which is why they are separate processes, and why no service reaches into another's storage.

ServiceLanguageOwnsAllowed to fail?
intakeGoWebhook verification, deduplication, publishingNo — GitHub allows 10 seconds
scorerPythonFeatures, ranking, writing the resultNo — an unranked PR is a broken promise
explainerPythonLLM inference behind an APIYes — degrades quality only
appTypeScriptGitHub App and dashboardNo

Everything that crosses a boundary is defined in contracts.

intake

The webhook front door. It does four things and nothing else: verify the GitHub signature, deduplicate on X-GitHub-Delivery, publish a PrEvent, and return 200 inside ten seconds. No database writes, no feature extraction, no outbound calls to GitHub.

scorer

Consumes PrEvent, extracts features, ranks with the global model plus the repository layer, asks the explainer for a sentence, and writes a ScoreResult. The feature extractor and model version are resolved together and pinned per request. If scoring fails, the pull request still reaches the queue, unranked and flagged.

explainer

Turns a feature vector and a band into one sentence a reviewer can act on. Warm GPU, a response cache in Redis, a per-tenant rate limit, and a hard timeout that falls back to a deterministic template built from the features alone.

app

The only service that talks to GitHub or to people: installation callbacks, check runs, pull request comments, and the queue view. It reads ScoreResult; a result with a null explanation renders without one and is still a valid rank.

Supporting infrastructure

ComponentUsed for
PostgresFeatures, tenants, outcomes
RedisIdempotency keys, inference cache
Pub/SubThe event bus between intake and scorer
AirflowScheduled retraining
MLflowModel registry
Kubernetes JobsPer-tenant training, under a bounded pool