The short version
- The demo at github.com/movahedi-ca/dbt-privacy-inventory holds a small fictional inventory, built with dbt Core 2.0.11 on DuckDB: 9 models, 4 seeds, 32 tests.
- ACT-001 (customer onboarding) runs from a seed row through staging and an intermediate model to a mart that emits one ROPA-like row per activity.
- Point an entry at a vendor that does not exist and the build fails. No release ships. That denial was tested with the real engine.
- The current release’s lineage graph holds 45 nodes and 55 edges. Walk it at movahedi.ca/dbt.
- Law 25 asks for accountability, governance policies, and privacy impact assessments, not a record of processing under that name. A lineage graph is evidence for an auditor, not a compliance certificate.
Start with the failure
Change one field. Set ACT-002’s vendor to VND-999, a vendor that does not exist, and run the build. It stops. The relationships test fails, no release is created, and the release pointer stays byte-identical. A duplicated activity_id fails the unique test and ends the same way.
One entry, four stops
ACT-001 is customer onboarding. Its seed row gives the purpose as creating and verifying customer accounts. It names asset AST-001, vendor VND-001 (Fictional Identity Co, identity, medium risk tier, Canada), and retention rule RET-001. Every name is fictional. The files say so.
Stop one is the seed: one line in a CSV. Stop two is staging, where stg_demo_activities casts the keys to text, trims the names, and lowercases the status.
Stop three, int_demo_activity_links, joins the activity to its asset, vendor, and retention rule. The left joins are deliberate: an unresolved reference survives with a flag on it, instead of dropping out.
Stop four is the mart. mart_demo_ropa adds a risk flag and emits one row per activity: name, purpose, asset, vendor, retention rule, status. Its header calls it a teaching example, not a statutory record and not proof of compliance.
The tests are the control
The documentation sits in schema.yml, next to the tests. activity_id carries unique and not_null tests in staging, the intermediate model, and the mart. purpose cannot be null. status must be active, paused, or retired.
The vendor column carries the interesting test. Null is allowed, because ACT-004, a marketing campaign, has no vendor. A non-null vendor_id must exist in the vendors staging model. That is the test that killed the VND-999 build.
So the control is not the graph. The graph is a picture. The control: a bad reference cannot pass the build, and a failed build cannot publish a release. The denial fixtures proved both halves with the real engine: failing test, exit code 1, empty releases directory, pointer unchanged.
The entry in the graph
dbt writes a manifest for every build: every model, seed, and test, and what each depends on. Project it and you get the lineage graph. For the current release, rel-2026-11-15T16-52-25Z, it holds 45 nodes and 55 edges.
ACT-001 sits in that graph as a path: seed to staging to intermediate to mart, tests attached along the way. Follow it in the explorer at movahedi.ca/dbt, which renders the graph from the published release.
One more check ran before this went public. That release’s manifest was loaded into a data mapping tool, and its rendered nodes and edges were compared against the published graph as sets. They matched exactly. A manifest that could not tie to the named release was refused, with nothing rendered.
What Law 25 actually asks
Quebec’s private sector Act, as amended by Law 25, does not use the phrase record of processing activities. That label is European. The Act asks for different things.
Section 3.1 puts responsibility on the person with the highest authority in the enterprise. That person is the person in charge of the protection of personal information by default, can delegate in writing, and their title and contact information go on the website.
Section 3.2 requires policies and practices governing how the enterprise handles personal information. The Commission d’accès à l’information (CAI) lists the content: rules for keeping and destroying information, staff roles across the information life cycle, a complaints process.
Sections 3.3 and 17 require a privacy impact assessment before an information system project involving personal information, and again before personal information leaves Quebec.
An assessment needs to know which systems touch which information, through which vendors, kept how long. A dbt project answers that with a build that tests its own answers, instead of a document that asserts them.
The limits, stated once
Lineage supports evidence and audit. It does not certify compliance.
The graph shows what the models declare. It cannot show whether the purpose in the seed is the purpose the business actually runs, whether consent covers it, or whether the retention rule gets enforced when the period ends. The demo holds seven activities and five vendors. Nobody has shown here that a graph built this way stays readable at seven hundred. That question stays open.
What the trace gives you is narrower, and more useful in an audit: one entry, from a typed row to a published picture, with a test that fires when the entry points at nothing. If a team can point at that path and say “show me another one,” the inventory stops being a claim. It becomes a thing you can check.