Title: Retire the opt-in strict_provenance runtime guardrail; enforce the make() contract by deploy-time code inspection · Issue #1488 · datajoint/datajoint-python · GitHub
Open Graph Title: Retire the opt-in strict_provenance runtime guardrail; enforce the make() contract by deploy-time code inspection · Issue #1488 · datajoint/datajoint-python
X Title: Retire the opt-in strict_provenance runtime guardrail; enforce the make() contract by deploy-time code inspection · Issue #1488 · datajoint/datajoint-python
Description: Summary Remove dj.config["strict_provenance"] (introduced in 2.3.0, #1425) in an upcoming 2.3.x release, along with its documentation. Keep Diagram.trace() (#1423) and self.upstream (#1424). Enforcement of the make() contract moves to st...
Open Graph Description: Summary Remove dj.config["strict_provenance"] (introduced in 2.3.0, #1425) in an upcoming 2.3.x release, along with its documentation. Keep Diagram.trace() (#1423) and self.upstream (#1424). Enforc...
X Description: Summary Remove dj.config["strict_provenance"] (introduced in 2.3.0, #1425) in an upcoming 2.3.x release, along with its documentation. Keep Diagram.trace() (#1423) and self.upstream (#142...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/1488
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Retire the opt-in strict_provenance runtime guardrail; enforce the make() contract by deploy-time code inspection","articleBody":"## Summary\n\nRemove `dj.config[\"strict_provenance\"]` (introduced in 2.3.0, #1425) in an upcoming 2.3.x release, along with its documentation. Keep `Diagram.trace()` (#1423) and `self.upstream` (#1424). Enforcement of the `make()` contract moves to static/agentic inspection of `make()` bodies at deployment (platform CI), backed by governed, commit-pinned execution. The open-source documentation will document the **reproducible `make()` contract** itself — the rules — rather than a runtime enforcement flag.\n\n## What shipped in 2.3.0\n\n`strict_provenance` is an opt-in, off-by-default, best-effort development guardrail. It wires read/write checks into the Python client via a per-call `contextvars` enforcement context, confining reads to `self.upstream[...]` and writes to `self` and Parts. It shipped alongside `Diagram.trace()` and `self.upstream` as the \"provenance trinity.\"\n\n## Why remove it\n\nThe shipped specification already concedes the core point: comprehensive enforcement of the `make()` contract is fundamentally a **code-inspection problem, not a runtime-interception one**. Against the flag's modest dev-only benefit, the costs are real:\n\n1. **Best-effort by construction.** The spec's own limits section enumerates the bypasses — existence/count idioms (`len`, `bool`, `in`), restriction-by-table, and any access outside the Python client. It also cannot see code paths a given run does not execute. A guardrail that misses these invites reliance it cannot support.\n2. **Wrong instrument, wrong time.** The `make()` contract is a static property of the method body (reads confined to the upstream trace cone; writes to self/Parts; one entity per call in isolation; no result-affecting side inputs). Static analysis sees all paths, catches the documented bypass idioms, and reports once in CI before deploy — not per-invocation in the populate hot path.\n3. **Complexity and maintenance burden.** Per-call `contextvars` context, client-path interception, and a documented-limits appendix are a standing support cost for a check that cannot be made sound in-process.\n4. **Redundant with the authoritative enforcer.** The platform inspects `make()` source at deploy and controls execution (commit-pinned, mediated connections). That is where a sound guarantee lives.\n\n## Why removal (not deprecation) is safe now\n\n- The flag is **off by default** and has **no schema, data, or query-result impact** — removal changes no pipeline's behavior for anyone who has not opted in.\n- It was introduced in 2.3.0 and has **no known adoption**: no platform customer has enabled it. Removing it now, before it gains use, is cheaper for everyone than carrying a deprecation cycle for a feature nobody depends on.\n\n## What we keep (and stabilize)\n\n`Diagram.trace()` and `self.upstream` — the provenance query API and the idiomatic read pattern. \"Read from `self.upstream`, write to `self` and Parts\" remains the documented convention, and it is precisely what makes a `make()` method statically verifiable.\n\n## Proposed changes\n\n- Remove the `strict_provenance` config key and the runtime interception machinery (enforcement context, client-path checks).\n- Remove all mentions from the documentation (2.3 release notes, provenance specification §3); reframe the \"trinity\" as the `trace` + `self.upstream` pair.\n- Replace the removed enforcement docs with documentation of the **reproducible `make()` contract**: populate-only insertion; one entity per call, computed in isolation; reads confined to the upstream trace cone; writes only to self and Parts; no other result-affecting inputs (populate kwargs orchestrate, never parameterize).\n- Optionally, publish the static `make()` verifier as a standalone dev tool / pre-commit hook, preserving the \"catch accidental drift locally\" purpose with strictly better coverage than the runtime gate.\n\n## Alternatives considered\n\n- **Harden the runtime gate** — rejected: closing the documented bypasses approaches whole-program analysis inside a running process.\n- **Deprecate first, remove at 2.4** — unnecessary ceremony given off-by-default, zero functional impact, and no known adoption; removing before the feature gains use is the cheapest path for users and maintainers.\n\nRefs: #1425, #1423, #1424, #1474, #1480, #1485. Docs affected: `about/whats-new-23.md`, `reference/specs/provenance.md`.\n","author":{"url":"https://github.com/dimitri-yatsenko","@type":"Person","name":"dimitri-yatsenko"},"datePublished":"2026-07-08T20:11:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1488/datajoint-python/issues/1488"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:08dd4653-f15c-a250-389d-0a8161c77757 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E38:2C03D:3610713:4A490A0:6A4F1625 |
| html-safe-nonce | dfcc48fe3dd3b5e059e2ab0734a97f61424b4c2cdd67f46e663d23f648cf1a64 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTM4OjJDMDNEOjM2MTA3MTM6NEE0OTBBMDo2QTRGMTYyNSIsInZpc2l0b3JfaWQiOiI0ODQ5MDE0Nzc2MTM3NzE3Mjg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4f91b857943effca792051cb6a1d8c4fc89709fa6e82f4247bc94b5427c7a673 |
| hovercard-subject-tag | issue:4840764371 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/1488/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e73f085a495ca96c697f45afe0a53777d255cacbb6d658982fdb2d7a161625cb/datajoint/datajoint-python/issues/1488 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e73f085a495ca96c697f45afe0a53777d255cacbb6d658982fdb2d7a161625cb/datajoint/datajoint-python/issues/1488 |
| og:image:alt | Summary Remove dj.config["strict_provenance"] (introduced in 2.3.0, #1425) in an upcoming 2.3.x release, along with its documentation. Keep Diagram.trace() (#1423) and self.upstream (#1424). Enforc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dimitri-yatsenko |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width