Skip to content

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 (flank)

Declarative JSON definition of an external service connector — connection, auth, and operations. No TypeScript per provider. Lives at apps/flank/seeds/adapters/. See Flank CLAUDE.md. Avoid: “integration”, “plugin”.

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)

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)

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

Chargebee subscription setting controlling whether Chargebee charges the default payment method automatically. Project policy is off — see ADR.

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

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.

Clerk

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

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

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)

See Chargebee Customer. Customer (Chargebee) ≠ User (auth).

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

DB-backed advisory lock used to serialize payment recording across sirloin replicas. See ADR.

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)

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 (flank)

A single run of a Workflow. Lifecycle: pending → running → completed | failed | cancelled. Stored in sirloin via FlankStorageService. See apps/flank/server/engine/executor.ts.

Face Detection

Round inference operation that locates faces in an image. Used by sirloin during character probe scoring and by flank adapter round-ml (currently a stub). Proto: proto/round/v1/round.proto.

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

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)

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

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)

Chargebee price object representing one billable variant of a Plan or Add-on. Indexed in sirloin via the chargebee_data_lookup flow.

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).

Media

Output asset of a Generation — image or video — stored in S3-compatible object storage. Model: apps/sirloin/internal/pkg/models/media.go.

NSFW Toggle

Per-user preference gating delivery of non-safe-for-work Media. Behavior specified in ADR.

Plan

Chargebee recurring product the Subscription is attached to. Compare Add-on. Modelled in apps/sirloin/internal/app/services/billing/domain/.

Probe

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.

Queue

BullMQ queue (brain) or sirloin worker queue, used to dispatch background jobs. Brain dashboard: Bull Board. See brain CLAUDE.md.

Saga

Multi-step payment workflow that coordinates Chargebee state and the local DB with eventual consistency. See ADR.

Secret (flank)

Encrypted credential stored in sirloin and referenced from adapters via {{secret:name}}. Env-var fallback: FLANK_SECRET_*. See apps/flank/server/engine/secrets.ts.

Service Token (flank)

Optional cross-service token for secret resolution (FLANK_SERVICE_TOKEN). Distinct from the per-user Clerk session.

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 (flank)

The first node of a Workflow graph; defines the input schema and how the workflow is invoked. See apps/flank/server/core-nodes/.

User

Identity backed by Clerk. Distinct from Chargebee Customer. Local mirror in apps/sirloin/internal/pkg/models/users.go.

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

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 (flank)

Directed acyclic graph of nodes connected by edges, stored in sirloin and executed by flank’s in-process engine. See apps/flank/server/engine/.

How to add a term

  1. Search the codebase to confirm the term is actually in use; cite at least one file path.
  2. Add the entry alphabetically with a 1–2 sentence definition, the code location, and an Avoid: line for synonyms.
  3. If the term is overloaded across domains (e.g. Customer), state the distinction inline.
  4. Do not invent terms here. The glossary catalogues language already present in code or ADRs.