bricksentry 0.1.6__tar.gz → 0.1.7__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.
- {bricksentry-0.1.6 → bricksentry-0.1.7}/CHANGELOG.md +7 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/PKG-INFO +25 -5
- {bricksentry-0.1.6 → bricksentry-0.1.7}/README.md +24 -4
- bricksentry-0.1.7/packages/bricksentry-mcp/LICENSE +202 -0
- bricksentry-0.1.7/packages/bricksentry-mcp/README.md +32 -0
- bricksentry-0.1.7/packages/bricksentry-mcp/src/bricksentry_mcp/__init__.py +5 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/pyproject.toml +1 -1
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/__init__.py +1 -1
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/cli.py +10 -1
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/demo.py +6 -4
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/mcp_server.py +1 -1
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/policy_templates.py +21 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_notify_templates.py +59 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/.gitignore +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/CONTRIBUTING.md +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/LICENSE +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/SECURITY.md +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/action.yml +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/databricks/bricksentry.yml +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/databricks/bricksentry_quickstart.ipynb +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/databricks/bricksentry_quickstart.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/databricks/github-workflow.yml +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/databricks/policy.yml +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/examples/demo/agent_loop_demo.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/scripts/build_notebook.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/agent_tools.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/assess.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/backends/__init__.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/backends/base.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/backends/databricks_backend.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/backends/duckdb_backend.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/changes.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/config.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/diff.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/explain.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/github.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/lineage.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/models.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/notify.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/policy.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/preview.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/py.typed +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/src/bricksentry/report.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/conftest.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_assess_policy.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_databricks_and_uc.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_demo.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_diff.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_notebook.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_preview_agents.py +0 -0
- {bricksentry-0.1.6 → bricksentry-0.1.7}/tests/test_sample_guard_and_store.py +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.7 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
- New companion package `bricksentry-mcp`: `uvx bricksentry-mcp --config /full/path/bricksentry.yml` starts the MCP server with everything it needs. Before, `uvx bricksentry mcp` installed the package without its MCP extra and failed, and that is what MCP Registry clients ran. The registry listing now points at `bricksentry-mcp`.
|
|
6
|
+
- Setup docs for Claude Code, the Claude desktop app and Cursor now use full config paths, which clients need because they start the server from their own folder.
|
|
7
|
+
- `run_demo()` called from Python without DuckDB now raises one clear ImportError with the install command, instead of a CLI error with a traceback (reported in a Databricks notebook test).
|
|
8
|
+
- New `agent-safe` policy template for changes written by AI agents.
|
|
9
|
+
|
|
3
10
|
## 0.1.6 (2026-11-11)
|
|
4
11
|
|
|
5
12
|
- Slack and Teams alerts. Set `notify:` in bricksentry.yml (or `BRICKSENTRY_SLACK_WEBHOOK` / `BRICKSENTRY_TEAMS_WEBHOOK`) and `assess` / `preview` post the verdict, the rules that fired, the reviewers and a PR link when the verdict reaches `notify.on` (default `needs_human`). `--no-notify` turns it off; `Sentry.notify()` does it from Python; the GitHub Action takes `slack-webhook`, `teams-webhook` and `notify-on`. A failed webhook never changes the verdict.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bricksentry
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
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
|
|
@@ -107,11 +107,30 @@ AI now writes much of our pipeline code, and checking what that code does to the
|
|
|
107
107
|
|
|
108
108
|
## For AI agents: the MCP server
|
|
109
109
|
|
|
110
|
+
The quickest way to connect an agent is the `bricksentry-mcp` package, which installs bricksentry with its MCP and Databricks extras. With [uv](https://docs.astral.sh/uv/) there is nothing to install first:
|
|
111
|
+
|
|
110
112
|
```bash
|
|
111
|
-
|
|
112
|
-
claude mcp add bricksentry -- bricksentry
|
|
113
|
+
# Claude Code
|
|
114
|
+
claude mcp add bricksentry -- uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"mcpServers": {
|
|
120
|
+
"bricksentry": {
|
|
121
|
+
"command": "uvx",
|
|
122
|
+
"args": ["bricksentry-mcp", "--config", "/full/path/to/bricksentry.yml"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
113
126
|
```
|
|
114
127
|
|
|
128
|
+
The JSON works for the Claude desktop app, Cursor and other MCP clients. Use a **full path** to `bricksentry.yml`, because clients start the server from their own working folder. If an app can't find `uvx`, use its full path (`which uvx`). To share the setup through a repo, `claude mcp add -s project ...` writes it to `.mcp.json`; a relative path then works when Claude Code starts from the repo root. No config yet? `uvx --from bricksentry bricksentry init` writes a starter one.
|
|
129
|
+
|
|
130
|
+
Already installed bricksentry with pip? `pip install "bricksentry[mcp,databricks]"` and run `bricksentry mcp --config /full/path/to/bricksentry.yml` instead. Add `--transport streamable-http` for remote agents.
|
|
131
|
+
|
|
132
|
+
bricksentry is listed in the [official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.bricksentry/bricksentry) as `io.github.bricksentry/bricksentry`.
|
|
133
|
+
|
|
115
134
|
| Tool | What the agent gets |
|
|
116
135
|
|---|---|
|
|
117
136
|
| `whats_downstream(table, depth)` | Downstream assets with owners and tags. Call it *before* editing. |
|
|
@@ -175,7 +194,7 @@ Check out with `fetch-depth: 0` and give the job `pull-requests: write` permissi
|
|
|
175
194
|
Or use the bundled GitHub Action, which also writes the report to the job summary:
|
|
176
195
|
|
|
177
196
|
```yaml
|
|
178
|
-
- uses: bricksentry/bricksentry@v0.1.
|
|
197
|
+
- uses: bricksentry/bricksentry@v0.1.7
|
|
179
198
|
with:
|
|
180
199
|
config: bricksentry.yml
|
|
181
200
|
fail-on: needs_human
|
|
@@ -200,7 +219,7 @@ jobs:
|
|
|
200
219
|
fetch-depth: 0
|
|
201
220
|
# Build this PR's version of your pipeline into a per-PR schema first,
|
|
202
221
|
# for example: databricks bundle deploy -t ci && databricks bundle run -t ci
|
|
203
|
-
- uses: bricksentry/bricksentry@v0.1.
|
|
222
|
+
- uses: bricksentry/bricksentry@v0.1.7
|
|
204
223
|
with:
|
|
205
224
|
config: bricksentry.yml
|
|
206
225
|
fail-on: needs_human
|
|
@@ -296,6 +315,7 @@ Start from a ready-made policy instead of writing one:
|
|
|
296
315
|
|
|
297
316
|
| Template | For |
|
|
298
317
|
|---|---|
|
|
318
|
+
| `agent-safe` | Changes written by AI agents: anything beyond a small, clean change goes to a human |
|
|
299
319
|
| `default` | Balanced: block duplicate keys, a human for row loss, dropped columns, PII and certified downstream |
|
|
300
320
|
| `strict` | Production-critical pipelines: small changes need a human, failed checks block |
|
|
301
321
|
| `pii` | Tables with personal data: any change to a `pii`-tagged table, or one feeding it, needs a human |
|
|
@@ -60,11 +60,30 @@ AI now writes much of our pipeline code, and checking what that code does to the
|
|
|
60
60
|
|
|
61
61
|
## For AI agents: the MCP server
|
|
62
62
|
|
|
63
|
+
The quickest way to connect an agent is the `bricksentry-mcp` package, which installs bricksentry with its MCP and Databricks extras. With [uv](https://docs.astral.sh/uv/) there is nothing to install first:
|
|
64
|
+
|
|
63
65
|
```bash
|
|
64
|
-
|
|
65
|
-
claude mcp add bricksentry -- bricksentry
|
|
66
|
+
# Claude Code
|
|
67
|
+
claude mcp add bricksentry -- uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"bricksentry": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": ["bricksentry-mcp", "--config", "/full/path/to/bricksentry.yml"]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
66
79
|
```
|
|
67
80
|
|
|
81
|
+
The JSON works for the Claude desktop app, Cursor and other MCP clients. Use a **full path** to `bricksentry.yml`, because clients start the server from their own working folder. If an app can't find `uvx`, use its full path (`which uvx`). To share the setup through a repo, `claude mcp add -s project ...` writes it to `.mcp.json`; a relative path then works when Claude Code starts from the repo root. No config yet? `uvx --from bricksentry bricksentry init` writes a starter one.
|
|
82
|
+
|
|
83
|
+
Already installed bricksentry with pip? `pip install "bricksentry[mcp,databricks]"` and run `bricksentry mcp --config /full/path/to/bricksentry.yml` instead. Add `--transport streamable-http` for remote agents.
|
|
84
|
+
|
|
85
|
+
bricksentry is listed in the [official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.bricksentry/bricksentry) as `io.github.bricksentry/bricksentry`.
|
|
86
|
+
|
|
68
87
|
| Tool | What the agent gets |
|
|
69
88
|
|---|---|
|
|
70
89
|
| `whats_downstream(table, depth)` | Downstream assets with owners and tags. Call it *before* editing. |
|
|
@@ -128,7 +147,7 @@ Check out with `fetch-depth: 0` and give the job `pull-requests: write` permissi
|
|
|
128
147
|
Or use the bundled GitHub Action, which also writes the report to the job summary:
|
|
129
148
|
|
|
130
149
|
```yaml
|
|
131
|
-
- uses: bricksentry/bricksentry@v0.1.
|
|
150
|
+
- uses: bricksentry/bricksentry@v0.1.7
|
|
132
151
|
with:
|
|
133
152
|
config: bricksentry.yml
|
|
134
153
|
fail-on: needs_human
|
|
@@ -153,7 +172,7 @@ jobs:
|
|
|
153
172
|
fetch-depth: 0
|
|
154
173
|
# Build this PR's version of your pipeline into a per-PR schema first,
|
|
155
174
|
# for example: databricks bundle deploy -t ci && databricks bundle run -t ci
|
|
156
|
-
- uses: bricksentry/bricksentry@v0.1.
|
|
175
|
+
- uses: bricksentry/bricksentry@v0.1.7
|
|
157
176
|
with:
|
|
158
177
|
config: bricksentry.yml
|
|
159
178
|
fail-on: needs_human
|
|
@@ -249,6 +268,7 @@ Start from a ready-made policy instead of writing one:
|
|
|
249
268
|
|
|
250
269
|
| Template | For |
|
|
251
270
|
|---|---|
|
|
271
|
+
| `agent-safe` | Changes written by AI agents: anything beyond a small, clean change goes to a human |
|
|
252
272
|
| `default` | Balanced: block duplicate keys, a human for row loss, dropped columns, PII and certified downstream |
|
|
253
273
|
| `strict` | Production-critical pipelines: small changes need a human, failed checks block |
|
|
254
274
|
| `pii` | Tables with personal data: any change to a `pii`-tagged table, or one feeding it, needs a human |
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# bricksentry-mcp
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.bricksentry/bricksentry -->
|
|
4
|
+
|
|
5
|
+
The MCP server for [bricksentry](https://github.com/bricksentry/bricksentry), the safety check for data changes in the AI era. This package only installs `bricksentry` with its MCP and Databricks extras and gives you one command, so agents can start the server with `uvx`:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Claude Code**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
claude mcp add bricksentry -- uvx bricksentry-mcp --config /full/path/to/bricksentry.yml
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Claude desktop, Cursor and other clients** (`mcpServers` config):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"bricksentry": {
|
|
23
|
+
"command": "uvx",
|
|
24
|
+
"args": ["bricksentry-mcp", "--config", "/full/path/to/bricksentry.yml"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use a full path to `bricksentry.yml`: clients start the server from their own working folder. If an app can't find `uvx`, use its full path (`which uvx`).
|
|
31
|
+
|
|
32
|
+
`bricksentry-mcp` accepts the same options as `bricksentry mcp`, for example `--transport streamable-http`. Docs: [bricksentry.org/docs/agents](https://bricksentry.org/docs/agents). License: Apache-2.0.
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bricksentry"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.7"
|
|
8
8
|
description = "Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -180,7 +180,10 @@ def demo(report_path):
|
|
|
180
180
|
"""Run the agent safety loop on a local 20,000-row example (needs bricksentry[duckdb])."""
|
|
181
181
|
from bricksentry.demo import run_demo
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
try:
|
|
184
|
+
run_demo(report_path)
|
|
185
|
+
except ImportError as e:
|
|
186
|
+
raise click.ClickException(str(e)) from e
|
|
184
187
|
|
|
185
188
|
|
|
186
189
|
@main.command()
|
|
@@ -307,5 +310,11 @@ def entry() -> None:
|
|
|
307
310
|
sys.exit(2)
|
|
308
311
|
|
|
309
312
|
|
|
313
|
+
def mcp_entry() -> None:
|
|
314
|
+
"""Console entry for the ``bricksentry-mcp`` package: same as ``bricksentry mcp``."""
|
|
315
|
+
sys.argv = [sys.argv[0], "mcp", *sys.argv[1:]]
|
|
316
|
+
entry()
|
|
317
|
+
|
|
318
|
+
|
|
310
319
|
if __name__ == "__main__": # pragma: no cover
|
|
311
320
|
entry()
|
|
@@ -103,10 +103,12 @@ def run_demo(report_path: str | None = None) -> dict[str, Any]:
|
|
|
103
103
|
from bricksentry.backends.duckdb_backend import DuckDBBackend
|
|
104
104
|
|
|
105
105
|
backend = DuckDBBackend()
|
|
106
|
-
except ImportError
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
except ImportError:
|
|
107
|
+
# Raised without the inner traceback so a notebook shows one clear line.
|
|
108
|
+
raise ImportError(
|
|
109
|
+
'The bricksentry demo runs on DuckDB, which is not installed. '
|
|
110
|
+
'Install it with: pip install "bricksentry[duckdb]" (in a notebook: %pip install duckdb)'
|
|
111
|
+
) from None
|
|
110
112
|
|
|
111
113
|
backend.execute("CREATE SCHEMA sales; CREATE SCHEMA sales_pr_42")
|
|
112
114
|
backend.execute(SEED_SQL)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Run: ``bricksentry mcp`` (stdio) or ``bricksentry mcp --transport streamable-http``
|
|
4
4
|
|
|
5
|
-
Claude Code: ``claude mcp add bricksentry -- bricksentry
|
|
5
|
+
Claude Code: ``claude mcp add bricksentry -- uvx bricksentry-mcp --config /full/path/bricksentry.yml``
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
@@ -51,6 +51,27 @@ TEMPLATES: dict[str, dict[str, Any]] = {
|
|
|
51
51
|
],
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
|
+
"agent-safe": {
|
|
55
|
+
"description": "Changes written by AI agents: anything beyond a small, clean change goes to a human before it ships.",
|
|
56
|
+
"policy": {
|
|
57
|
+
"default": "pass",
|
|
58
|
+
"notify_owners_on": "needs_human",
|
|
59
|
+
"rules": [
|
|
60
|
+
{"name": "diff-failed", "when": {"diff_error": True}, "then": "block"},
|
|
61
|
+
{"name": "duplicate-keys", "when": {"duplicate_keys": True}, "then": "block"},
|
|
62
|
+
{"name": "dropped-column", "when": {"column_removed": True}, "then": "block"},
|
|
63
|
+
{"name": "null-keys", "when": {"null_keys": True}, "then": "needs_human"},
|
|
64
|
+
{"name": "type-change", "when": {"column_type_changed": True}, "then": "needs_human"},
|
|
65
|
+
{"name": "row-loss", "when": {"removed_pct_gt": 0.1}, "then": "needs_human"},
|
|
66
|
+
{"name": "row-count-drop", "when": {"row_count_drop_pct_gt": 0.1}, "then": "needs_human"},
|
|
67
|
+
{"name": "many-rows-changed", "when": {"changed_pct_gt": 5}, "then": "needs_human"},
|
|
68
|
+
{"name": "numeric-total-moved", "when": {"sum_change_pct_gt": 1}, "then": "needs_human"},
|
|
69
|
+
{"name": "pii-table-changed", "when": {"tag": "pii", "any_change": True}, "then": "needs_human"},
|
|
70
|
+
{"name": "certified-downstream", "when": {"downstream_tag": "certified", "any_change": True}, "then": "needs_human"},
|
|
71
|
+
{"name": "wide-blast-radius", "when": {"downstream_count_gt": 10}, "then": "needs_human"},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
54
75
|
"pii": {
|
|
55
76
|
"description": "Tables holding personal data: any change to a PII table, or feeding one, needs a human.",
|
|
56
77
|
"policy": {
|
|
@@ -140,3 +140,62 @@ def test_refusals_suggest_a_safe_alternative(sql, hint):
|
|
|
140
140
|
with pytest.raises(PreviewGuardError) as e:
|
|
141
141
|
rewrite_for_preview(sql, "sales.orders", "sandbox.c1", lambda x: x)
|
|
142
142
|
assert hint in str(e.value)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# --- 0.1.7 ------------------------------------------------------------------
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_companion_package_matches_release():
|
|
149
|
+
import json
|
|
150
|
+
from pathlib import Path
|
|
151
|
+
|
|
152
|
+
import bricksentry
|
|
153
|
+
|
|
154
|
+
tomllib = pytest.importorskip("tomllib") # Python 3.11+
|
|
155
|
+
|
|
156
|
+
root = Path(__file__).resolve().parents[1]
|
|
157
|
+
v = bricksentry.__version__
|
|
158
|
+
comp = tomllib.load(open(root / "packages/bricksentry-mcp/pyproject.toml", "rb"))["project"]
|
|
159
|
+
assert comp["version"] == v
|
|
160
|
+
assert comp["dependencies"] == [f"bricksentry[mcp,databricks]=={v}"]
|
|
161
|
+
server = json.load(open(root / "server.json"))
|
|
162
|
+
assert server["version"] == v and server["packages"][0]["version"] == v
|
|
163
|
+
assert server["packages"][0]["identifier"] == "bricksentry-mcp"
|
|
164
|
+
marker = f"mcp-name: {server['name']}"
|
|
165
|
+
assert marker in (root / "packages/bricksentry-mcp/README.md").read_text()
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def test_mcp_entry_runs_the_mcp_command(monkeypatch):
|
|
169
|
+
import sys
|
|
170
|
+
|
|
171
|
+
from bricksentry import cli
|
|
172
|
+
|
|
173
|
+
seen = {}
|
|
174
|
+
monkeypatch.setattr(sys, "argv", ["bricksentry-mcp", "--transport", "sse"])
|
|
175
|
+
monkeypatch.setattr(cli, "entry", lambda: seen.setdefault("argv", list(sys.argv)))
|
|
176
|
+
cli.mcp_entry()
|
|
177
|
+
assert seen["argv"] == ["bricksentry-mcp", "mcp", "--transport", "sse"]
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def test_demo_without_duckdb_gives_one_clear_line(monkeypatch):
|
|
181
|
+
import builtins
|
|
182
|
+
|
|
183
|
+
from bricksentry.demo import run_demo
|
|
184
|
+
|
|
185
|
+
real_import = builtins.__import__
|
|
186
|
+
|
|
187
|
+
def fake(name, *a, **k):
|
|
188
|
+
if name == "duckdb":
|
|
189
|
+
raise ImportError("No module named 'duckdb'")
|
|
190
|
+
return real_import(name, *a, **k)
|
|
191
|
+
|
|
192
|
+
monkeypatch.setattr(builtins, "__import__", fake)
|
|
193
|
+
with pytest.raises(ImportError, match="pip install") as e:
|
|
194
|
+
run_demo()
|
|
195
|
+
assert e.value.__cause__ is None and e.value.__suppress_context__
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def test_agent_safe_template_is_strict_for_agents():
|
|
199
|
+
p = get_template("agent-safe")
|
|
200
|
+
rules = {r["name"]: r["then"] for r in p["rules"]}
|
|
201
|
+
assert rules["dropped-column"] == "block" and rules["row-loss"] == "needs_human"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|