The core Django app holds shared infrastructure. Treat the following as the supported internal API for collectors and cross-app helpers. Other modules under core/ may change without notice; prefer importing from the paths below.
| Import | Purpose |
|---|---|
core.collectors.CollectorBase |
Abstract run(), optional sync_pinecone(), handle_error() with structured logging. |
core.collectors.BaseCollectorCommand |
Thin BaseCommand adapter: runs get_collector(**opts).run() then sync_pinecone(). |
core.collectors.DjangoCommandCollector |
Wraps call_command(name) for tests or glue code. |
| Import | Purpose |
|---|---|
core.errors.CollectorFailureCategory |
Enum of coarse failure buckets (network, command, …). |
core.errors.classify_failure(exc) |
Map an exception to CollectorFailureCategory for logs and metrics. |
Log records from CollectorBase.handle_error include extra keys: collector, collector_phase, failure_category.
- Prefer no
ForeignKeyfrom one tracker app into another's models (see Development guideline). - When you need shared behavior, add it under
core(for examplecore.operationsfor Slack/markdown/file helpers, orcore.operations.github_opsfor GitHub API/git/tokens). Those utilities are not separate Django apps—they live under thecorepackage and are not listed inINSTALLED_APPS. - Long-term: shrink opportunistic imports between tracker apps by extracting shared protocols into
coreor small neutral apps. - The current state of all cross-app FKs, ORM read-coupling, and Python imports is catalogued in cross-app-dependencies.md, together with
import-lintercontracts that can enforce the coupling guideline mechanically.