Team agreements and standards for the Data Hub codebase.
All raw data files are stored in S3 with the key pattern:
{instrument_id}/{run_id}/{filename}
instrument_id— kebab-case identifier for the instrument row (e.g.,akta-fplc).run_id— unique identifier for the run, either extracted from the filename prefix or from a subdirectory name.filename— the original filename.
The S3 bucket name follows the template arcadia-data-hub-raw-{environment}, where environment is staging or production.
Instrument IDs are kebab-case strings (lowercase letters, numbers, hyphens). They serve as:
- S3 key prefixes
- API resource identifiers
- Primary keys on the
instrumentstable
Lambda dispatch and web reprocess eligibility use instrument_type, not the ID. When adding a processable instrument:
- Set (or add) the appropriate
instrument_typeon the instrument row - Register a processor for that type in
lambda/src/data_hub_lambda/processors.py - Add the same type to
PROCESSABLE_INSTRUMENT_TYPESinweb/lib/instruments/processable-types.ts
The shared Instrument enum in packages/shared is optional legacy naming for watcher/CLI display — it is not the Lambda support gate.
Environment-specific configuration is managed through environment variables, never hard-coded. Each component has its own set:
- Web app — managed in Vercel, pulled with
vercel env pull. See getting started. - Lambda — set in the AWS Lambda runtime configuration. See getting started.
- Watcher — configured via YAML file, not environment variables (except
DATA_HUB_API_KEYandDATA_HUB_CONFIG_PATH).
- Formatter and linter: Ruff
- Type checker: Pyright
- Line length: 100
- Quote style: double quotes
- Import sorting: isort-compatible via Ruff, ordered by type
- Lint rules enabled:
B(bugbear),E(pycodestyle errors),F(pyflakes),I(isort),UP(pyupgrade),W(pycodestyle warnings)
- Formatter + linter: Biome via Ultracite (
npm run lint:check/lint:fix) - Type checker: TypeScript compiler (
tsc)
Run make check-all before pushing. CI enforces the same checks.
Tests are co-located with each package (lambda/tests/, watcher/tests/,
web/tests/); unit tests need no external services, integration tests need
Postgres + a built Next.js server. See Testing for the full
per-package breakdown, the shared start_test_server() fixture pattern, and
how S3 is mocked in Lambda's integration suite.