Skip to content

Bounded contexts

The backend is split into bounded contexts under platform/app/contexts/. Each context owns its tables, logic, schemas and router; isolation is enforced by an import linter in CI. This page is the map.

ContextOwns
researchThe accumulating per-contract knowledge base (research facts and related tables): enrichment, freshness, hygiene and conflict handling. The foundation of retrieval-grounded generation.
retrievalThe universal vector primitive: chunking, embeddings, similarity search and reranking over pgvector. Used by research, publish and quality.
publishThe publication conveyor: payload assembly, the registry of published URLs, the hub client, topic and batch deduplication, the grounding gate, quarantine, and topic feedback.
qualityPost-publish article scoring: verification, claim checking against sources, brand-safety signals, language consistency, stale-publish detection.
competitorsLifecycle of a contract’s competitor lists: candidate mining, the registry, and safe application into brand-defense declarations.
ContextOwns
runsTracking and orchestration of pipeline executions: the version catalog, run events and projections, metering, autoscaling, staging and reconciliation.
integrationsThe only channel to external services (LLM, web search, image generation, storage, DNS): a declarative connection registry, pluggable secret backends, typed capability adapters and a health monitor.
opsThe live operational snapshot that powers the dashboard and agent status reads.
analyticsSearch and traffic data (weekly search-console time series per instance) and derived analytics: scoring, topic performance, scheduling.
cockpitA read-only aggregator for the per-contract dashboard.
ContextOwns
ticketsThe incident / defect / improvement tracker (the board agents write to).
tasksHuman-assignable work tasks with statuses and notes.
chatlogThe searchable archive of the team’s working chat.
specsThe registry linking features to their SPEC documents (traceability).

Some foundational layers predate the context split and live flat under platform/app/:

  • auth/ — JWT issuance, scopes and the agent grant model (see Authentication).
  • lifecycle/ — the entity state-machine engine inherited from the platform’s metamodel (see Data model).
  • db/models/ — the ORM layer.
  • api/v1/ — the REST routers (about 28 of them, grouped by capability).
  • native/ — the immutable pipeline version directories themselves.

A context reaches another context only through that context’s public contracts.py or an event — never by importing internals, never by touching foreign tables. Examples of real seams: the publish gate reads quality verdicts through the quality contract; deduplication embeds text through the retrieval contract; every LLM call anywhere goes through an integrations adapter. If you are tracing behaviour across modules, start at the target context’s contracts.py — it is the complete public surface.