bricksentry 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {bricksentry-0.1.2 → bricksentry-0.1.4}/.gitignore +3 -0
  2. {bricksentry-0.1.2 → bricksentry-0.1.4}/CHANGELOG.md +12 -0
  3. {bricksentry-0.1.2 → bricksentry-0.1.4}/CONTRIBUTING.md +1 -1
  4. {bricksentry-0.1.2 → bricksentry-0.1.4}/PKG-INFO +67 -11
  5. {bricksentry-0.1.2 → bricksentry-0.1.4}/README.md +64 -10
  6. {bricksentry-0.1.2 → bricksentry-0.1.4}/examples/databricks/bricksentry.yml +2 -0
  7. bricksentry-0.1.4/examples/databricks/bricksentry_quickstart.ipynb +367 -0
  8. bricksentry-0.1.4/examples/databricks/bricksentry_quickstart.py +261 -0
  9. {bricksentry-0.1.2 → bricksentry-0.1.4}/pyproject.toml +23 -3
  10. bricksentry-0.1.4/scripts/build_notebook.py +61 -0
  11. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/__init__.py +1 -1
  12. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/assess.py +30 -1
  13. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/backends/base.py +7 -0
  14. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/backends/databricks_backend.py +5 -1
  15. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/backends/duckdb_backend.py +5 -1
  16. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/config.py +18 -2
  17. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/demo.py +1 -1
  18. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/diff.py +50 -0
  19. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/explain.py +2 -0
  20. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/lineage.py +28 -0
  21. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/models.py +48 -2
  22. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/conftest.py +6 -0
  23. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/test_databricks_and_uc.py +50 -1
  24. bricksentry-0.1.4/tests/test_notebook.py +45 -0
  25. bricksentry-0.1.4/tests/test_sample_guard_and_store.py +84 -0
  26. {bricksentry-0.1.2 → bricksentry-0.1.4}/LICENSE +0 -0
  27. {bricksentry-0.1.2 → bricksentry-0.1.4}/SECURITY.md +0 -0
  28. {bricksentry-0.1.2 → bricksentry-0.1.4}/action.yml +0 -0
  29. {bricksentry-0.1.2 → bricksentry-0.1.4}/examples/databricks/github-workflow.yml +0 -0
  30. {bricksentry-0.1.2 → bricksentry-0.1.4}/examples/databricks/policy.yml +0 -0
  31. {bricksentry-0.1.2 → bricksentry-0.1.4}/examples/demo/agent_loop_demo.py +0 -0
  32. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/agent_tools.py +0 -0
  33. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/backends/__init__.py +0 -0
  34. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/changes.py +0 -0
  35. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/cli.py +0 -0
  36. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/github.py +0 -0
  37. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/mcp_server.py +0 -0
  38. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/policy.py +0 -0
  39. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/preview.py +0 -0
  40. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/py.typed +0 -0
  41. {bricksentry-0.1.2 → bricksentry-0.1.4}/src/bricksentry/report.py +0 -0
  42. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/test_assess_policy.py +0 -0
  43. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/test_demo.py +0 -0
  44. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/test_diff.py +0 -0
  45. {bricksentry-0.1.2 → bricksentry-0.1.4}/tests/test_preview_agents.py +0 -0
@@ -7,3 +7,6 @@ build/
7
7
  *.duckdb
8
8
  bricksentry-report.md
9
9
  bricksentry-result.json
10
+ .coverage
11
+ coverage.xml
12
+ .ruff_cache/
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4 (2026-11-10)
4
+
5
+ From a second end-to-end run on Databricks serverless against a 2-million-row table:
6
+
7
+ - Fix: a sampled diff (`sample_pct`) could report "no change" when the change sat outside the sample, for example one deleted row in 2 million at a 10% sample. A full-table checksum now guards every sampled diff: if the sample looks identical but the tables differ, the diff re-runs on all rows and says so in the summary (`sample_note`). Identical tables stay sampled and cheap. Turn it off with `sample_guard: false`.
8
+ - Fix: `explain_diff` and `safe_to_ship` returned "unknown assessment id" when called from a different `Sentry` instance or process. Assessments are now saved as JSON (default `~/.bricksentry/assessments`, or `assessment_store:` in bricksentry.yml, or env `BRICKSENTRY_STORE`) and loaded by id. Set `assessment_store: false` to keep them in memory only.
9
+
10
+ ## 0.1.3 (2026-11-10)
11
+
12
+ - Blast radius no longer lists bricksentry's own `preview_write` clones, or tables that Unity Catalog lineage remembers but that no longer exist (when `information_schema` can confirm it). Before, every preview added a stale downstream entry. New lineage settings: `exclude` (name patterns, default `["*__preview_*"]`) and `exclude_dropped` (default true).
13
+ - Databricks quickstart notebook (`examples/databricks/bricksentry_quickstart.py`, plus an `.ipynb` copy) that runs the full loop on a demo table in your workspace.
14
+
3
15
  ## 0.1.2 (2026-11-10)
4
16
 
5
17
  - Fix: rows whose key is NULL are now matched null-safely. Before, each such row was counted as both added and removed (found on a real Databricks table with a NULL `state`).
@@ -19,7 +19,7 @@ pytest -q
19
19
  bricksentry demo
20
20
  ```
21
21
 
22
- The tests run against DuckDB, so you don't need a Databricks workspace. The Databricks backend is tested against a mocked SDK client; if your change touches it, please say in the pull request whether you also tried it on a real workspace.
22
+ The tests run against DuckDB, so you don't need a Databricks workspace. The automated tests use a mocked Databricks SDK client; if your change touches the Databricks backend, please say in the pull request whether you also tried it on a real workspace.
23
23
 
24
24
  ## Pull requests
25
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bricksentry
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans.
5
5
  Project-URL: Homepage, https://bricksentry.org
6
6
  Project-URL: Documentation, https://bricksentry.org/docs
@@ -36,20 +36,28 @@ Provides-Extra: dev
36
36
  Requires-Dist: databricks-sdk>=0.30; extra == 'dev'
37
37
  Requires-Dist: duckdb>=1.0; extra == 'dev'
38
38
  Requires-Dist: mcp>=1.10; extra == 'dev'
39
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
39
40
  Requires-Dist: pytest>=8; extra == 'dev'
41
+ Requires-Dist: ruff>=0.6; extra == 'dev'
40
42
  Provides-Extra: duckdb
41
43
  Requires-Dist: duckdb>=1.0; extra == 'duckdb'
42
44
  Provides-Extra: mcp
43
45
  Requires-Dist: mcp>=1.10; extra == 'mcp'
44
46
  Description-Content-Type: text/markdown
45
47
 
46
- # bricksentry
48
+ # Welcome to bricksentry
47
49
 
48
- [![PyPI](https://img.shields.io/pypi/v/bricksentry)](https://pypi.org/project/bricksentry/) [![Python](https://img.shields.io/pypi/pyversions/bricksentry)](https://pypi.org/project/bricksentry/) [![CI](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
50
+ [![PyPI](https://img.shields.io/pypi/v/bricksentry)](https://pypi.org/project/bricksentry/) [![Python](https://img.shields.io/pypi/pyversions/bricksentry)](https://pypi.org/project/bricksentry/) [![Tests](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![Lint](https://github.com/bricksentry/bricksentry/actions/workflows/lint.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/lint.yml) [![Coverage](https://img.shields.io/badge/coverage-%E2%89%A575%25%20enforced-brightgreen)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
49
51
 
50
- ***Change-safety for Databricks pipelines and the AI agents that edit them.***
52
+ ***The safety check for data changes in the AI era.***
51
53
 
52
- **Website and docs: [bricksentry.org](https://bricksentry.org)**
54
+ Change-safety for Databricks pipelines and the AI agents that edit them: know what a change does to your data before it ships.
55
+
56
+ **[Try it in 30 seconds](#try-it-in-30-seconds-no-databricks-needed)** · **[Run the Databricks notebook](#run-it-in-your-databricks-workspace)** · **[Docs: bricksentry.org](https://bricksentry.org)** · **[LinkedIn](https://www.linkedin.com/company/bricksentry-org/)**
57
+
58
+ Built by Brahmareddy, Databricks Champion. Open source under Apache-2.0.
59
+
60
+ *Why the name?* Bricks plus entry. Your tables and pipelines are the bricks of the lakehouse, and every change to them is an entry. bricksentry checks each entry, reports what it does, and stands guard before it lands.
53
61
 
54
62
  ## Try it in 30 seconds (no Databricks needed)
55
63
 
@@ -62,6 +70,15 @@ An AI agent changes a 20,000-row revenue table. bricksentry previews its DELETE
62
70
 
63
71
  ![bricksentry demo: an agent's change is previewed, blocked for duplicate keys, then routed to the table owners](https://raw.githubusercontent.com/bricksentry/bricksentry/main/docs/images/demo.png)
64
72
 
73
+ ## Run it in your Databricks workspace
74
+
75
+ > **Databricks quickstart notebook:** in your workspace, go to **Workspace → Import → URL** and paste
76
+ > `https://raw.githubusercontent.com/bricksentry/bricksentry/main/examples/databricks/bricksentry_quickstart.py`
77
+
78
+ The [quickstart notebook](examples/databricks/bricksentry_quickstart.py) creates a small demo table in a schema you choose and runs the same loop on Databricks: Unity Catalog blast radius, a real `RESTORE` rollback plan, a preview on a shallow clone, a blocked pull request and the fix. Then it checks one of your own tables, read-only, and cleans up after itself.
79
+
80
+ You need a SQL warehouse, `CREATE TABLE` on the schema you pick, and `SELECT` on `system.access.table_lineage` for the blast radius. A Jupyter copy is in [`bricksentry_quickstart.ipynb`](examples/databricks/bricksentry_quickstart.ipynb).
81
+
65
82
  ## What it does
66
83
 
67
84
  Before a change reaches production, bricksentry answers three questions, in a
@@ -107,7 +124,8 @@ Designed for agents:
107
124
  - **The verdict never comes from an LLM.** Rules in `policy.yml` decide, so the same change always gets the same answer.
108
125
  - **Read-only by default.** Only `preview_write` writes, and only to a sandbox clone. It accepts a single INSERT / MERGE / UPDATE / DELETE / CREATE OR REPLACE whose target must be the clone, and it refuses DROP, TRUNCATE, ALTER, GRANT and multiple statements.
109
126
  - **Errors come back as `{"error": ...}`**, so agents can recover instead of crashing.
110
- - **Bounded cost:** deterministic hash sampling (`sample_pct`), capped samples, and lineage limited by depth and lookback window.
127
+ - **Bounded cost:** deterministic hash sampling (`sample_pct`), capped samples, and lineage limited by depth and lookback window. A full-table checksum guards the sample: if the sample shows no change but the tables differ, the diff re-runs on every row, so a one-row change can't slip through.
128
+ - **Assessments are saved** as JSON (default `~/.bricksentry/assessments`), so `explain_diff` and `safe_to_ship` work from another process or a fresh `Sentry`.
111
129
 
112
130
  The same tools are plain Python functions in `bricksentry.agent_tools`, so you can use them from LangGraph, the OpenAI Agents SDK or the Databricks Agent Framework without MCP.
113
131
 
@@ -178,8 +196,9 @@ s.preview_write("DELETE FROM main.sales.orders WHERE status = 'test'", "main.sal
178
196
  backend: {type: databricks, warehouse_id: abc123} # auth: standard Databricks SDK chain
179
197
  sandbox_schema: main.bricksentry_sandbox
180
198
  candidate_pattern: "{catalog}.{schema}_pr_{pr}.{table}"
181
- sample_pct: 10
182
- lineage: {type: databricks, depth: 3, lookback_days: 90}
199
+ sample_pct: 10 # sample_guard re-checks the whole table (on by default)
200
+ assessment_store: ~/.bricksentry/assessments # or false to keep assessments in memory
201
+ lineage: {type: databricks, depth: 3, lookback_days: 90} # also: exclude, exclude_dropped
183
202
  tables:
184
203
  main.sales.orders:
185
204
  keys: [order_id]
@@ -188,6 +207,37 @@ tables:
188
207
  policy: policy.yml
189
208
  ```
190
209
 
210
+ ### Policy example
211
+
212
+ A small `policy.yml` with one rule per severity. `pass` is the default: a change gets it when no rule matches.
213
+
214
+ ```yaml
215
+ default: pass # no rule matched -> pass
216
+ notify_owners_on: needs_human # tag downstream owners from this level up
217
+
218
+ rules:
219
+ - name: type-change # a column changed type -> warn
220
+ when: {column_type_changed: true}
221
+ then: warn
222
+
223
+ - name: revenue-moved # total revenue moved more than 2% -> a human signs off
224
+ when: {column: amount, sum_change_pct_gt: 2}
225
+ then: needs_human
226
+
227
+ - name: duplicate-keys # a join fanned out and duplicated keys -> block the PR
228
+ when: {duplicate_keys: true}
229
+ then: block
230
+ ```
231
+
232
+ | The change | Verdict |
233
+ |---|---|
234
+ | A filter fix that changes 40 rows, nothing else | `pass` |
235
+ | `order_date` goes from `STRING` to `DATE` | `warn` |
236
+ | A pricing fix moves `SUM(amount)` by 3.1% | `needs_human` |
237
+ | A new join duplicates 40 `order_id`s | `block` |
238
+
239
+ If several rules match, the most severe one wins. The full starter policy is in [`examples/databricks/policy.yml`](examples/databricks/policy.yml), and `bricksentry init` writes one for you.
240
+
191
241
  ### Policy conditions
192
242
 
193
243
  `table` (glob) · `tag` · `downstream_tag` · `downstream_kind` · `downstream_count_gt` · `removed_pct_gt` · `added_pct_gt` · `changed_pct_gt` · `row_count_change_pct_gt` · `row_count_drop_pct_gt` · `column_removed` · `column_added` · `column_type_changed` · `duplicate_keys` · `null_keys` · `sum_change_pct_gt` / `null_increase_gt` (optionally with `column`) · `any_change` · `diff_error`
@@ -206,11 +256,13 @@ All conditions in a `when` must hold. The most severe matching rule sets the ver
206
256
  - **Lineage is recorded at runtime.** Brand-new tables have no downstream history yet. Unity Catalog doesn't capture RDD operations, and UDFs hide column-level mapping.
207
257
  - **Keys are required.** Tables without a stable key can't be diffed row by row yet (an aggregate-profile mode is planned).
208
258
  - **Changed-table detection uses path globs** from config. It doesn't parse Asset Bundles yet.
209
- - **The Databricks backend is tested against a mocked SDK.** Run it against a dev workspace before relying on it in CI.
259
+ - **Validated on one Databricks workspace so far** (serverless, November 2026, on a 2-million-row table): lineage, Delta rollback plans, previews on shallow clones, every verdict level and sampling. The automated tests use DuckDB and a mocked SDK, so please [open an issue](https://github.com/bricksentry/bricksentry/issues) if something behaves differently on yours.
210
260
 
211
261
  ## Roadmap
212
262
 
213
- Asset Bundle parsing for automatic table detection · column-level blast radius from `system.access.column_lineage` · an aggregate diff for keyless tables · Lakeflow expectations in the verdict · `bricksentry watch` for scheduled drift checks · a Databricks App UI.
263
+ **Top priority: validation across more workspaces.** Classic and serverless compute, AWS, Azure and GCP, and workspaces with restricted system-table access. If you run the quickstart notebook, please [share what you see](https://github.com/bricksentry/bricksentry/issues), whether it works or not.
264
+
265
+ Next: Asset Bundle parsing for automatic table detection · column-level blast radius from `system.access.column_lineage` · an aggregate diff for keyless tables · Lakeflow expectations in the verdict · `bricksentry watch` for scheduled drift checks · a Databricks App UI.
214
266
 
215
267
  ## Contributing
216
268
 
@@ -218,4 +270,8 @@ Bug reports from real pipelines help the most. See [CONTRIBUTING.md](CONTRIBUTIN
218
270
 
219
271
  ## License
220
272
 
221
- Apache-2.0. Created and maintained by Brahma.
273
+ Apache-2.0. Created and maintained by Brahma - Databricks Champion.
274
+
275
+ ## Trademarks
276
+
277
+ bricksentry is an independent open-source project. It is not affiliated with, endorsed by, or sponsored by Databricks, Inc. or Functional Software, Inc. (Sentry). Databricks, Unity Catalog and Lakeflow are trademarks of Databricks, Inc. Delta Lake is a trademark of the Linux Foundation, and Apache Spark and PySpark are trademarks of the Apache Software Foundation. All other names are the trademarks of their respective owners and are used here only to describe compatibility. Thank you.
@@ -1,10 +1,16 @@
1
- # bricksentry
1
+ # Welcome to bricksentry
2
2
 
3
- [![PyPI](https://img.shields.io/pypi/v/bricksentry)](https://pypi.org/project/bricksentry/) [![Python](https://img.shields.io/pypi/pyversions/bricksentry)](https://pypi.org/project/bricksentry/) [![CI](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
3
+ [![PyPI](https://img.shields.io/pypi/v/bricksentry)](https://pypi.org/project/bricksentry/) [![Python](https://img.shields.io/pypi/pyversions/bricksentry)](https://pypi.org/project/bricksentry/) [![Tests](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![Lint](https://github.com/bricksentry/bricksentry/actions/workflows/lint.yml/badge.svg)](https://github.com/bricksentry/bricksentry/actions/workflows/lint.yml) [![Coverage](https://img.shields.io/badge/coverage-%E2%89%A575%25%20enforced-brightgreen)](https://github.com/bricksentry/bricksentry/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
4
4
 
5
- ***Change-safety for Databricks pipelines and the AI agents that edit them.***
5
+ ***The safety check for data changes in the AI era.***
6
6
 
7
- **Website and docs: [bricksentry.org](https://bricksentry.org)**
7
+ Change-safety for Databricks pipelines and the AI agents that edit them: know what a change does to your data before it ships.
8
+
9
+ **[Try it in 30 seconds](#try-it-in-30-seconds-no-databricks-needed)** · **[Run the Databricks notebook](#run-it-in-your-databricks-workspace)** · **[Docs: bricksentry.org](https://bricksentry.org)** · **[LinkedIn](https://www.linkedin.com/company/bricksentry-org/)**
10
+
11
+ Built by Brahmareddy, Databricks Champion. Open source under Apache-2.0.
12
+
13
+ *Why the name?* Bricks plus entry. Your tables and pipelines are the bricks of the lakehouse, and every change to them is an entry. bricksentry checks each entry, reports what it does, and stands guard before it lands.
8
14
 
9
15
  ## Try it in 30 seconds (no Databricks needed)
10
16
 
@@ -17,6 +23,15 @@ An AI agent changes a 20,000-row revenue table. bricksentry previews its DELETE
17
23
 
18
24
  ![bricksentry demo: an agent's change is previewed, blocked for duplicate keys, then routed to the table owners](https://raw.githubusercontent.com/bricksentry/bricksentry/main/docs/images/demo.png)
19
25
 
26
+ ## Run it in your Databricks workspace
27
+
28
+ > **Databricks quickstart notebook:** in your workspace, go to **Workspace → Import → URL** and paste
29
+ > `https://raw.githubusercontent.com/bricksentry/bricksentry/main/examples/databricks/bricksentry_quickstart.py`
30
+
31
+ The [quickstart notebook](examples/databricks/bricksentry_quickstart.py) creates a small demo table in a schema you choose and runs the same loop on Databricks: Unity Catalog blast radius, a real `RESTORE` rollback plan, a preview on a shallow clone, a blocked pull request and the fix. Then it checks one of your own tables, read-only, and cleans up after itself.
32
+
33
+ You need a SQL warehouse, `CREATE TABLE` on the schema you pick, and `SELECT` on `system.access.table_lineage` for the blast radius. A Jupyter copy is in [`bricksentry_quickstart.ipynb`](examples/databricks/bricksentry_quickstart.ipynb).
34
+
20
35
  ## What it does
21
36
 
22
37
  Before a change reaches production, bricksentry answers three questions, in a
@@ -62,7 +77,8 @@ Designed for agents:
62
77
  - **The verdict never comes from an LLM.** Rules in `policy.yml` decide, so the same change always gets the same answer.
63
78
  - **Read-only by default.** Only `preview_write` writes, and only to a sandbox clone. It accepts a single INSERT / MERGE / UPDATE / DELETE / CREATE OR REPLACE whose target must be the clone, and it refuses DROP, TRUNCATE, ALTER, GRANT and multiple statements.
64
79
  - **Errors come back as `{"error": ...}`**, so agents can recover instead of crashing.
65
- - **Bounded cost:** deterministic hash sampling (`sample_pct`), capped samples, and lineage limited by depth and lookback window.
80
+ - **Bounded cost:** deterministic hash sampling (`sample_pct`), capped samples, and lineage limited by depth and lookback window. A full-table checksum guards the sample: if the sample shows no change but the tables differ, the diff re-runs on every row, so a one-row change can't slip through.
81
+ - **Assessments are saved** as JSON (default `~/.bricksentry/assessments`), so `explain_diff` and `safe_to_ship` work from another process or a fresh `Sentry`.
66
82
 
67
83
  The same tools are plain Python functions in `bricksentry.agent_tools`, so you can use them from LangGraph, the OpenAI Agents SDK or the Databricks Agent Framework without MCP.
68
84
 
@@ -133,8 +149,9 @@ s.preview_write("DELETE FROM main.sales.orders WHERE status = 'test'", "main.sal
133
149
  backend: {type: databricks, warehouse_id: abc123} # auth: standard Databricks SDK chain
134
150
  sandbox_schema: main.bricksentry_sandbox
135
151
  candidate_pattern: "{catalog}.{schema}_pr_{pr}.{table}"
136
- sample_pct: 10
137
- lineage: {type: databricks, depth: 3, lookback_days: 90}
152
+ sample_pct: 10 # sample_guard re-checks the whole table (on by default)
153
+ assessment_store: ~/.bricksentry/assessments # or false to keep assessments in memory
154
+ lineage: {type: databricks, depth: 3, lookback_days: 90} # also: exclude, exclude_dropped
138
155
  tables:
139
156
  main.sales.orders:
140
157
  keys: [order_id]
@@ -143,6 +160,37 @@ tables:
143
160
  policy: policy.yml
144
161
  ```
145
162
 
163
+ ### Policy example
164
+
165
+ A small `policy.yml` with one rule per severity. `pass` is the default: a change gets it when no rule matches.
166
+
167
+ ```yaml
168
+ default: pass # no rule matched -> pass
169
+ notify_owners_on: needs_human # tag downstream owners from this level up
170
+
171
+ rules:
172
+ - name: type-change # a column changed type -> warn
173
+ when: {column_type_changed: true}
174
+ then: warn
175
+
176
+ - name: revenue-moved # total revenue moved more than 2% -> a human signs off
177
+ when: {column: amount, sum_change_pct_gt: 2}
178
+ then: needs_human
179
+
180
+ - name: duplicate-keys # a join fanned out and duplicated keys -> block the PR
181
+ when: {duplicate_keys: true}
182
+ then: block
183
+ ```
184
+
185
+ | The change | Verdict |
186
+ |---|---|
187
+ | A filter fix that changes 40 rows, nothing else | `pass` |
188
+ | `order_date` goes from `STRING` to `DATE` | `warn` |
189
+ | A pricing fix moves `SUM(amount)` by 3.1% | `needs_human` |
190
+ | A new join duplicates 40 `order_id`s | `block` |
191
+
192
+ If several rules match, the most severe one wins. The full starter policy is in [`examples/databricks/policy.yml`](examples/databricks/policy.yml), and `bricksentry init` writes one for you.
193
+
146
194
  ### Policy conditions
147
195
 
148
196
  `table` (glob) · `tag` · `downstream_tag` · `downstream_kind` · `downstream_count_gt` · `removed_pct_gt` · `added_pct_gt` · `changed_pct_gt` · `row_count_change_pct_gt` · `row_count_drop_pct_gt` · `column_removed` · `column_added` · `column_type_changed` · `duplicate_keys` · `null_keys` · `sum_change_pct_gt` / `null_increase_gt` (optionally with `column`) · `any_change` · `diff_error`
@@ -161,11 +209,13 @@ All conditions in a `when` must hold. The most severe matching rule sets the ver
161
209
  - **Lineage is recorded at runtime.** Brand-new tables have no downstream history yet. Unity Catalog doesn't capture RDD operations, and UDFs hide column-level mapping.
162
210
  - **Keys are required.** Tables without a stable key can't be diffed row by row yet (an aggregate-profile mode is planned).
163
211
  - **Changed-table detection uses path globs** from config. It doesn't parse Asset Bundles yet.
164
- - **The Databricks backend is tested against a mocked SDK.** Run it against a dev workspace before relying on it in CI.
212
+ - **Validated on one Databricks workspace so far** (serverless, November 2026, on a 2-million-row table): lineage, Delta rollback plans, previews on shallow clones, every verdict level and sampling. The automated tests use DuckDB and a mocked SDK, so please [open an issue](https://github.com/bricksentry/bricksentry/issues) if something behaves differently on yours.
165
213
 
166
214
  ## Roadmap
167
215
 
168
- Asset Bundle parsing for automatic table detection · column-level blast radius from `system.access.column_lineage` · an aggregate diff for keyless tables · Lakeflow expectations in the verdict · `bricksentry watch` for scheduled drift checks · a Databricks App UI.
216
+ **Top priority: validation across more workspaces.** Classic and serverless compute, AWS, Azure and GCP, and workspaces with restricted system-table access. If you run the quickstart notebook, please [share what you see](https://github.com/bricksentry/bricksentry/issues), whether it works or not.
217
+
218
+ Next: Asset Bundle parsing for automatic table detection · column-level blast radius from `system.access.column_lineage` · an aggregate diff for keyless tables · Lakeflow expectations in the verdict · `bricksentry watch` for scheduled drift checks · a Databricks App UI.
169
219
 
170
220
  ## Contributing
171
221
 
@@ -173,4 +223,8 @@ Bug reports from real pipelines help the most. See [CONTRIBUTING.md](CONTRIBUTIN
173
223
 
174
224
  ## License
175
225
 
176
- Apache-2.0. Created and maintained by Brahma.
226
+ Apache-2.0. Created and maintained by Brahma - Databricks Champion.
227
+
228
+ ## Trademarks
229
+
230
+ bricksentry is an independent open-source project. It is not affiliated with, endorsed by, or sponsored by Databricks, Inc. or Functional Software, Inc. (Sentry). Databricks, Unity Catalog and Lakeflow are trademarks of Databricks, Inc. Delta Lake is a trademark of the Linux Foundation, and Apache Spark and PySpark are trademarks of the Apache Software Foundation. All other names are the trademarks of their respective owners and are used here only to describe compatibility. Thank you.
@@ -18,6 +18,8 @@ lineage:
18
18
  type: databricks # reads system.access.table_lineage + information_schema
19
19
  depth: 3
20
20
  lookback_days: 90
21
+ # exclude: ["*__preview_*"] # name patterns left out of the blast radius (default: preview clones)
22
+ # exclude_dropped: true # hide tables lineage remembers but that no longer exist
21
23
 
22
24
  tables:
23
25
  main.sales.orders: