Glossary
Authoritative definitions for terms used across the monorepo. When two domains use the same word for different things, the overload is called out explicitly. Each entry points at the canonical code or doc location.
Adapter (workflow engine)
Section titled “Adapter (workflow engine)”Brain-owned per-provider inference integration used by workflow nodes (one
generic adapter per provider, with the model as a node input). Lives under
apps/brain/src/modules/domain/workflow/. The legacy flank JSON seed adapters
(apps/flank/seeds/adapters/) are retired. Avoid: “integration”, “plugin”.
Add-on
Section titled “Add-on”Chargebee one-time or recurring product attached to a Subscription on top
of the base Plan. In code as part of internal/app/services/billing/domain/
plan/price logic.
API Key (Brain)
Section titled “API Key (Brain)”Static shared secret authenticating service-to-service calls into brain.
Validated by apps/brain/src/modules/application/auth/strategies/api-key.strategy.ts
against the comma-separated AUTHORIZED_KEYS env var.
Audit Log (Strip)
Section titled “Audit Log (Strip)”Admin-action trail surfaced via the view:audit_logs permission in
apps/strip/internal/app/authorization/authorization.go. Storage backend
TODO(@law): identify the audit-log persistence backend and retention.
Auto-collection
Section titled “Auto-collection”Chargebee subscription setting controlling whether Chargebee charges the
default payment method automatically. Project policy is off — see
ADR.
Chargebee Customer
Section titled “Chargebee Customer”Chargebee-side billing identity. Not the same as a Clerk user — see
User. Linked via the user’s chargebee_customer_id. SDK wrapped in
apps/sirloin/internal/app/services/billing/chargebee/client.go.
Character
Section titled “Character”Domain entity owned by sirloin in
apps/sirloin/internal/app/services/characters/. Backing model:
apps/sirloin/internal/pkg/models/characters.go. The unit a creator
configures; each Character generates Media via Generations.
Third-party identity provider. Issues JWT session tokens and oat_*
opaque OAuth tokens. Services verify via @clerk/backend,
@clerk/nextjs, or clerk-sdk-go/v2. See
auth-model.
Content Moderation
Section titled “Content Moderation”Policy enforcement on user-generated text and media. Currently surfaces
through the NSFW Toggle, round face/embedding pipelines, and Hive
moderation invoked from
apps/sirloin/internal/app/services/characters/verifyreferencedatasetimage.go
(maps Hive tags to CHARACTER_DATASET_IMAGE_FAILURE_REASON_MODERATION_FLAGGED).
Brain stores per-image outcomes in ImageModerationResult /
ImageModerationTag (apps/brain/prisma/schema.prisma). There is no
single dedicated moderation service.
Credits
Section titled “Credits”Per-user, plan-derived consumption budget for Generations. Allocated by
the Chargebee event poller after invoice payment. See
apps/sirloin/internal/app/services/billing/events/poller.go.
Customer (Chargebee)
Section titled “Customer (Chargebee)”See Chargebee Customer. Customer (Chargebee) ≠ User (auth).
Deferred Activation
Section titled “Deferred Activation”Pattern where Chargebee Subscriptions are created in future status and
moved to active only after the first payment is confirmed. See
ADR.
Distributed Lock
Section titled “Distributed Lock”DB-backed advisory lock used to serialize payment recording across sirloin replicas. See ADR.
Embedding
Section titled “Embedding”Vector representation of an image produced by round’s ONNX inference.
Proto: proto/round/v1/round.proto (RoundService). Consumed by sirloin
for similarity / dataset workflows.
Event Poller (billing)
Section titled “Event Poller (billing)”Component in apps/sirloin/internal/app/services/billing/events/poller.go
that pulls Chargebee events on a 15-second cadence. See Webhook vs
Polling.
Execution (workflow engine)
Section titled “Execution (workflow engine)”A single run of a Workflow, with a per-node trace (status, timing, inputs,
outputs, errors). Owned and stored by brain’s workflow engine
(apps/brain/src/modules/domain/workflow/). The legacy sirloin-backed
FlankStorageService execution store is removed.
Face Detection
Section titled “Face Detection”Round inference operation that locates faces in an image. Used by sirloin
during character probe scoring. Proto: proto/round/v1/round.proto.
Failed Operation
Section titled “Failed Operation”Persisted retry record for transient backend failures. Backed by
apps/sirloin/internal/pkg/models/failedoperation.go. Worker drains them
on a schedule.
Foxy360
Section titled “Foxy360”Internal MCP-style data gateway hosted in
apps/sirloin/internal/app/foxy360/. Aggregates data sources (Axiom,
PostHog, Chargebee, Primer, Intercom) for assistant tools.
Gateway (Primer)
Section titled “Gateway (Primer)”Payment processor abstraction provided by Primer; collects card details
and returns a transactionId used as the idempotency key for sirloin
payment recording. See ADR.
Generation
Section titled “Generation”A single inference job that produces Media (image or video). Tracked in
apps/sirloin/internal/app/services/media/ and
apps/sirloin/internal/pkg/models/media.go. Avoid: “render”, “job”
when you mean a Generation.
Item Price (Chargebee)
Section titled “Item Price (Chargebee)”Chargebee price object representing one billable variant of a Plan or
Add-on. Indexed in sirloin via the chargebee_data_lookup flow.
ML Model
Section titled “ML Model”Versioned ONNX artifact served by round. Three model families ship today:
embeddings (apps/round/internal/pkg/models/embeddings/model.go), face
detection (apps/round/internal/pkg/models/facedetect/model.go), and face
embeddings (apps/round/internal/pkg/models/faceembedding/model.go).
Cached on disk under ModelCacheDir (apps/round/cmd/app/main.go:35).
Output asset of a Generation — image or video — stored in S3-compatible
object storage. Model: apps/sirloin/internal/pkg/models/media.go.
NSFW Toggle
Section titled “NSFW Toggle”Per-user preference gating delivery of non-safe-for-work Media. Behavior specified in ADR.
Chargebee recurring product the Subscription is attached to. Compare
Add-on. Modelled in apps/sirloin/internal/app/services/billing/domain/.
Diagnostic record asserting a property of a domain object — e.g.
monitor_probe for character/media QA scoring. Model:
apps/sirloin/internal/pkg/models/monitor_probe.go.
BullMQ queue (brain) or sirloin worker queue, used to dispatch background jobs. Brain dashboard: Bull Board. See brain AGENTS.md.
Multi-step payment workflow that coordinates Chargebee state and the local DB with eventual consistency. See ADR.
Subscription
Section titled “Subscription”Chargebee subscription record linking a Customer to a Plan plus Add-ons. Treated as authoritative state; the local DB caches it (see billing invariants).
Trigger (workflow engine)
Section titled “Trigger (workflow engine)”The first node of a Workflow graph; defines the input schema and how the
workflow is invoked. Owned by brain’s workflow engine
(apps/brain/src/modules/domain/workflow/).
Identity backed by Clerk. Distinct from Chargebee Customer. Local
mirror in apps/sirloin/internal/pkg/models/users.go.
Webhook vs Polling
Section titled “Webhook vs Polling”Chargebee events are consumed via polling (15s) as the primary path, with
webhooks (/webhooks/chargebee/events) as a fallback. Rationale:
ADR. Primer
disputes use webhooks (/webhooks/primer/disputes) with HMAC signatures.
Worker
Section titled “Worker”Long-running goroutine in apps/sirloin/internal/app/worker/ (sirloin)
or BullMQ processor in brain that drains background tasks (renewal
retries, throttle checks, dataset descriptions, etc.).
Workflow (workflow engine)
Section titled “Workflow (workflow engine)”Directed acyclic graph of nodes connected by edges, stored and executed by
brain’s workflow engine (apps/brain/src/modules/domain/workflow/) and
authored in the flank editor.
How to add a term
Section titled “How to add a term”- Search the codebase to confirm the term is actually in use; cite at least one file path.
- Add the entry alphabetically with a 1–2 sentence definition, the code
location, and an
Avoid:line for synonyms. - If the term is overloaded across domains (e.g. Customer), state the distinction inline.
- Do not invent terms here. The glossary catalogues language already present in code or ADRs.