Files
paulandClaude Opus 5 dd096ee4dc Adapt Canonical Party to the domain platform; add unit tests
Makes the blog-generated product run on the digital-core domain built from
semprini-data-domain, with the same changes the canonical template received:
- flink/job.sql connects to ods:5432/ods as postgres with ${ODS_PASSWORD},
  substituted by data-domain at submission, instead of the blog's credentials
- lakehouse/010_replication.sql uses the platform's `ods` sync group and grants
  the lake tables to ducklake_reader and ducklake_writer
- product.yaml sync group, odps.yaml access URLs (domain ports 20000-20003,
  management zone Apicurio on 8081), CLI names in comments

Adds tests/: the canonical template's generic unit tests and this product's
expectations.yaml (seed rows, 24 constraint rejections, 5 relationship
traversals, one inbound-to-tombstone round trip).

Verified on digital-core on 2026-09-18: 65 of 65 smoke checks, 100 unit tests
passing, and registered in OpenMetadata under the digital-core domain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 00:14:36 +12:00

62 lines
3.4 KiB
Markdown

# semprini-domain-cdp-digital-core
**Canonical data products of the Digital Core domain**, owned and operated by the domain's data
product engineering team. Each folder is one product directory: generated from the canonical
template, deployed onto the digital-core domain, unit-tested against its seed data, and
registered in the data management zone.
| Product | MD-DDL declaration | Generated from | Status |
|---|---|---|---|
| [canonical-party/](canonical-party/) | Canonical Party, `data_model/data_products/canonical.md` in semprini-domain-digital-datamodel 1.0.0 | semprini-blog-dataproducts' template, adapted to the domain platform; now `canonical_data_product/` in semprini-data-product-templates | Deployed on digital-core: 65 of 65 smoke checks, 100 unit tests, registered in OpenMetadata (2026-09-18) |
## Where this sits
| Repository | Team | What it gives this one |
|---|---|---|
| semprini-domain-digital-datamodel | Digital Core modelling team | The product declarations and entities products are generated from |
| semprini-data-product-templates | Data product engineering | `canonical_data_product/`: the template, its generic unit tests, and `/agent-canonical-product` |
| semprini-data-domain | Data platform | The domain platform and the `data-domain` CLI that deploys, tests and registers products |
| semprini-domain-digital-core | Digital Core engineering | The running domain: `compose.yml`, `.env`, the stack these products deploy onto |
## Operating a product
Everything runs from the domain repository (`semprini-domain-digital-core`), which the CLI acts
on. With this repository at `../semprini-data/semprini-domain-cdp-digital-core`:
```bash
cd semprini-domain-digital-core
P=../semprini-data/semprini-domain-cdp-digital-core/canonical-party
uv run data-domain deploy $P # ODS, lake, topics, Apicurio schemas, Flink job
uv run data-domain test $P # every interface answers (smoke)
uv run data-domain unit $P # behaviour against the seed data (pytest, about a minute)
uv run data-domain register $P # OpenMetadata: tables, topics, data product, lineage
uv run data-domain unregister $P
uv run data-domain undeploy $P --yes
```
`deploy` expects a clean slate: after changing the DDL, `undeploy` first. `register` needs the
domain registered with the management zone (`platform/domain-integration.sh register mgmt` in the
domain repository).
## Unit tests
`canonical-party/tests/` holds the canonical template's generic test modules, unchanged, and
`expectations.yaml`, which is this product's own: seed row counts and sample rows, the updates
each constraint must refuse, the relationship traversals in `graphql/schema.graphql`, and one
record to follow from the inbound topic through every interface. Keep `expectations.yaml` in step
with `ods/040_seed.sql` and `ods/020_tables.sql`; the test modules are updated by copying them
from the template.
## Changing a product
Regenerate from a model release and a template release rather than editing by hand, and name
both in the commit message. A hand fix to a generated product is a template or model defect:
raise it with the template owners or the modelling team as well.
## Setup layout
While the systems are being set up this repository is a submodule of semprini-data. Most
organisations keep product repositories apart from the platform and the templates, linked only by
version.