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.
Content production
Section titled “Content production”| Context | Owns |
|---|---|
research | The accumulating per-contract knowledge base (research facts and related tables): enrichment, freshness, hygiene and conflict handling. The foundation of retrieval-grounded generation. |
retrieval | The universal vector primitive: chunking, embeddings, similarity search and reranking over pgvector. Used by research, publish and quality. |
publish | The publication conveyor: payload assembly, the registry of published URLs, the hub client, topic and batch deduplication, the grounding gate, quarantine, and topic feedback. |
quality | Post-publish article scoring: verification, claim checking against sources, brand-safety signals, language consistency, stale-publish detection. |
competitors | Lifecycle of a contract’s competitor lists: candidate mining, the registry, and safe application into brand-defense declarations. |
Execution and operations
Section titled “Execution and operations”| Context | Owns |
|---|---|
runs | Tracking and orchestration of pipeline executions: the version catalog, run events and projections, metering, autoscaling, staging and reconciliation. |
integrations | The 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. |
ops | The live operational snapshot that powers the dashboard and agent status reads. |
analytics | Search and traffic data (weekly search-console time series per instance) and derived analytics: scoring, topic performance, scheduling. |
cockpit | A read-only aggregator for the per-contract dashboard. |
Knowledge and process
Section titled “Knowledge and process”| Context | Owns |
|---|---|
tickets | The incident / defect / improvement tracker (the board agents write to). |
tasks | Human-assignable work tasks with statuses and notes. |
chatlog | The searchable archive of the team’s working chat. |
specs | The registry linking features to their SPEC documents (traceability). |
Shared layers outside contexts
Section titled “Shared layers outside contexts”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.
The interaction rule
Section titled “The interaction rule”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.