provctl 0.1.1__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 (59) hide show
  1. provctl-0.1.1/.github/workflows/ci.yml +23 -0
  2. provctl-0.1.1/.github/workflows/publish.yml +15 -0
  3. provctl-0.1.1/.gitignore +19 -0
  4. provctl-0.1.1/.pre-commit-hooks.yaml +24 -0
  5. provctl-0.1.1/LICENSE +202 -0
  6. provctl-0.1.1/PKG-INFO +314 -0
  7. provctl-0.1.1/README.md +98 -0
  8. provctl-0.1.1/docs/measurements.md +198 -0
  9. provctl-0.1.1/docs/phase0-findings.md +120 -0
  10. provctl-0.1.1/docs/pitch.md +27 -0
  11. provctl-0.1.1/docs/threat-model.md +118 -0
  12. provctl-0.1.1/measurements/__init__.py +1 -0
  13. provctl-0.1.1/measurements/ab.py +214 -0
  14. provctl-0.1.1/measurements/band.py +173 -0
  15. provctl-0.1.1/measurements/corpus.py +48 -0
  16. provctl-0.1.1/measurements/data/hallucinated_candidates.txt +320 -0
  17. provctl-0.1.1/measurements/data/real_names.txt +499 -0
  18. provctl-0.1.1/measurements/labelled.py +75 -0
  19. provctl-0.1.1/measurements/out/ab.json +48 -0
  20. provctl-0.1.1/measurements/out/band.json +181 -0
  21. provctl-0.1.1/measurements/out/baseline.json +5049 -0
  22. provctl-0.1.1/measurements/recall.py +95 -0
  23. provctl-0.1.1/measurements/run.py +237 -0
  24. provctl-0.1.1/provctl/__init__.py +3 -0
  25. provctl-0.1.1/provctl/check.py +392 -0
  26. provctl-0.1.1/provctl/cli.py +394 -0
  27. provctl-0.1.1/provctl/enrich/__init__.py +1 -0
  28. provctl-0.1.1/provctl/enrich/pypi.py +163 -0
  29. provctl-0.1.1/provctl/gitio.py +134 -0
  30. provctl-0.1.1/provctl/http.py +62 -0
  31. provctl-0.1.1/provctl/index/__init__.py +1 -0
  32. provctl-0.1.1/provctl/index/adoption.py +100 -0
  33. provctl-0.1.1/provctl/index/refresh.py +104 -0
  34. provctl-0.1.1/provctl/index/store.py +192 -0
  35. provctl-0.1.1/provctl/model.py +171 -0
  36. provctl-0.1.1/provctl/naming.py +35 -0
  37. provctl-0.1.1/provctl/paths.py +51 -0
  38. provctl-0.1.1/provctl/policy/__init__.py +1 -0
  39. provctl-0.1.1/provctl/policy/config.py +97 -0
  40. provctl-0.1.1/provctl/policy/decisions.py +171 -0
  41. provctl-0.1.1/provctl/policy/verdict.py +191 -0
  42. provctl-0.1.1/provctl/provenance/__init__.py +1 -0
  43. provctl-0.1.1/provctl/provenance/gitai.py +160 -0
  44. provctl-0.1.1/provctl/provenance/hook.py +174 -0
  45. provctl-0.1.1/provctl/provenance/model.py +76 -0
  46. provctl-0.1.1/provctl/report.py +122 -0
  47. provctl-0.1.1/provctl/resolve/__init__.py +1 -0
  48. provctl-0.1.1/provctl/resolve/distmap.py +171 -0
  49. provctl-0.1.1/provctl/resolve/firstparty.py +201 -0
  50. provctl-0.1.1/provctl/resolve/imports.py +130 -0
  51. provctl-0.1.1/provctl/resolve/manifests.py +335 -0
  52. provctl-0.1.1/pyproject.toml +33 -0
  53. provctl-0.1.1/tests/conftest.py +58 -0
  54. provctl-0.1.1/tests/test_check_e2e.py +200 -0
  55. provctl-0.1.1/tests/test_decisions.py +138 -0
  56. provctl-0.1.1/tests/test_index_store.py +95 -0
  57. provctl-0.1.1/tests/test_provenance.py +158 -0
  58. provctl-0.1.1/tests/test_resolve.py +214 -0
  59. provctl-0.1.1/tests/test_verdict.py +184 -0
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install
21
+ run: pip install -e ".[dev]"
22
+ - name: Test
23
+ run: python -m pytest -q
@@ -0,0 +1,15 @@
1
+ name: publish
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ pypi:
7
+ runs-on: ubuntu-latest
8
+ environment: pypi
9
+ permissions:
10
+ id-token: write # PyPI trusted publishing, no stored token
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ - run: uv build
15
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,19 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .venv/
8
+ venv/
9
+ .DS_Store
10
+
11
+ # Cloned measurement corpus (~1.5 GB). Regenerate with:
12
+ # python -m measurements.run --clone
13
+ .work/
14
+
15
+ # Vendored binaries used only for adapter testing; never project dependencies.
16
+ .tools/
17
+
18
+ # Local repository state written by provctl itself.
19
+ .provenance/decisions.jsonl.bak
@@ -0,0 +1,24 @@
1
+ - id: provctl
2
+ name: provctl (dependency provenance gate)
3
+ description: >-
4
+ Blocks dependencies that do not exist on PyPI and are not first-party.
5
+ Imports are advisory and never block.
6
+ entry: provctl check
7
+ language: python
8
+ # Runs once per commit rather than once per file: the check is about the
9
+ # change as a whole (a manifest entry and the import that motivated it are
10
+ # different files), and it reads the staged tree itself.
11
+ pass_filenames: false
12
+ always_run: true
13
+ stages: [pre-commit]
14
+
15
+ - id: provctl-warn-only
16
+ name: provctl (report only, never blocks)
17
+ description: >-
18
+ Same checks, always exits zero. Use this for the first weeks of a rollout
19
+ so the team sees the signal before it can interrupt anyone.
20
+ entry: provctl check --warn-only
21
+ language: python
22
+ pass_filenames: false
23
+ always_run: true
24
+ stages: [pre-commit]
provctl-0.1.1/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. Except as required by applicable law or
154
+ agreed to in writing, 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 2026 Chirata Andrei
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.
provctl-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.5
2
+ Name: provctl
3
+ Version: 0.1.1
4
+ Summary: Provenance-weighted dependency risk gate for Python projects
5
+ Project-URL: Homepage, https://github.com/chirataandrei/provctl
6
+ Project-URL: Repository, https://github.com/chirataandrei/provctl
7
+ Project-URL: Issues, https://github.com/chirataandrei/provctl/issues
8
+ License: Apache License
9
+ Version 2.0, January 2004
10
+ http://www.apache.org/licenses/
11
+
12
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
13
+
14
+ 1. Definitions.
15
+
16
+ "License" shall mean the terms and conditions for use, reproduction,
17
+ and distribution as defined by Sections 1 through 9 of this document.
18
+
19
+ "Licensor" shall mean the copyright owner or entity authorized by
20
+ the copyright owner that is granting the License.
21
+
22
+ "Legal Entity" shall mean the union of the acting entity and all
23
+ other entities that control, are controlled by, or are under common
24
+ control with that entity. For the purposes of this definition,
25
+ "control" means (i) the power, direct or indirect, to cause the
26
+ direction or management of such entity, whether by contract or
27
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
28
+ outstanding shares, or (iii) beneficial ownership of such entity.
29
+
30
+ "You" (or "Your") shall mean an individual or Legal Entity
31
+ exercising permissions granted by this License.
32
+
33
+ "Source" form shall mean the preferred form for making modifications,
34
+ including but not limited to software source code, documentation
35
+ source, and configuration files.
36
+
37
+ "Object" form shall mean any form resulting from mechanical
38
+ transformation or translation of a Source form, including but
39
+ not limited to compiled object code, generated documentation,
40
+ and conversions to other media types.
41
+
42
+ "Work" shall mean the work of authorship, whether in Source or
43
+ Object form, made available under the License, as indicated by a
44
+ copyright notice that is included in or attached to the work
45
+ (an example is provided in the Appendix below).
46
+
47
+ "Derivative Works" shall mean any work, whether in Source or Object
48
+ form, that is based on (or derived from) the Work and for which the
49
+ editorial revisions, annotations, elaborations, or other modifications
50
+ represent, as a whole, an original work of authorship. For the purposes
51
+ of this License, Derivative Works shall not include works that remain
52
+ separable from, or merely link (or bind by name) to the interfaces of,
53
+ the Work and Derivative Works thereof.
54
+
55
+ "Contribution" shall mean any work of authorship, including
56
+ the original version of the Work and any modifications or additions
57
+ to that Work or Derivative Works thereof, that is intentionally
58
+ submitted to Licensor for inclusion in the Work by the copyright owner
59
+ or by an individual or Legal Entity authorized to submit on behalf of
60
+ the copyright owner. For the purposes of this definition, "submitted"
61
+ means any form of electronic, verbal, or written communication sent
62
+ to the Licensor or its representatives, including but not limited to
63
+ communication on electronic mailing lists, source code control systems,
64
+ and issue tracking systems that are managed by, or on behalf of, the
65
+ Licensor for the purpose of discussing and improving the Work, but
66
+ excluding communication that is conspicuously marked or otherwise
67
+ designated in writing by the copyright owner as "Not a Contribution."
68
+
69
+ "Contributor" shall mean Licensor and any individual or Legal Entity
70
+ on behalf of whom a Contribution has been received by Licensor and
71
+ subsequently incorporated within the Work.
72
+
73
+ 2. Grant of Copyright License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ copyright license to reproduce, prepare Derivative Works of,
77
+ publicly display, publicly perform, sublicense, and distribute the
78
+ Work and such Derivative Works in Source or Object form.
79
+
80
+ 3. Grant of Patent License. Subject to the terms and conditions of
81
+ this License, each Contributor hereby grants to You a perpetual,
82
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
83
+ (except as stated in this section) patent license to make, have made,
84
+ use, offer to sell, sell, import, and otherwise transfer the Work,
85
+ where such license applies only to those patent claims licensable
86
+ by such Contributor that are necessarily infringed by their
87
+ Contribution(s) alone or by combination of their Contribution(s)
88
+ with the Work to which such Contribution(s) was submitted. If You
89
+ institute patent litigation against any entity (including a
90
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
91
+ or a Contribution incorporated within the Work constitutes direct
92
+ or contributory patent infringement, then any patent licenses
93
+ granted to You under this License for that Work shall terminate
94
+ as of the date such litigation is filed.
95
+
96
+ 4. Redistribution. You may reproduce and distribute copies of the
97
+ Work or Derivative Works thereof in any medium, with or without
98
+ modifications, and in Source or Object form, provided that You
99
+ meet the following conditions:
100
+
101
+ (a) You must give any other recipients of the Work or
102
+ Derivative Works a copy of this License; and
103
+
104
+ (b) You must cause any modified files to carry prominent notices
105
+ stating that You changed the files; and
106
+
107
+ (c) You must retain, in the Source form of any Derivative Works
108
+ that You distribute, all copyright, patent, trademark, and
109
+ attribution notices from the Source form of the Work,
110
+ excluding those notices that do not pertain to any part of
111
+ the Derivative Works; and
112
+
113
+ (d) If the Work includes a "NOTICE" text file as part of its
114
+ distribution, then any Derivative Works that You distribute must
115
+ include a readable copy of the attribution notices contained
116
+ within such NOTICE file, excluding those notices that do not
117
+ pertain to any part of the Derivative Works, in at least one
118
+ of the following places: within a NOTICE text file distributed
119
+ as part of the Derivative Works; within the Source form or
120
+ documentation, if provided along with the Derivative Works; or,
121
+ within a display generated by the Derivative Works, if and
122
+ wherever such third-party notices normally appear. The contents
123
+ of the NOTICE file are for informational purposes only and
124
+ do not modify the License. You may add Your own attribution
125
+ notices within Derivative Works that You distribute, alongside
126
+ or as an addendum to the NOTICE text from the Work, provided
127
+ that such additional attribution notices cannot be construed
128
+ as modifying the License.
129
+
130
+ You may add Your own copyright statement to Your modifications and
131
+ may provide additional or different license terms and conditions
132
+ for use, reproduction, or distribution of Your modifications, or
133
+ for any such Derivative Works as a whole, provided Your use,
134
+ reproduction, and distribution of the Work otherwise complies with
135
+ the conditions stated in this License.
136
+
137
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
138
+ any Contribution intentionally submitted for inclusion in the Work
139
+ by You to the Licensor shall be under the terms and conditions of
140
+ this License, without any additional terms or conditions.
141
+ Notwithstanding the above, nothing herein shall supersede or modify
142
+ the terms of any separate license agreement you may have executed
143
+ with Licensor regarding such Contributions.
144
+
145
+ 6. Trademarks. This License does not grant permission to use the trade
146
+ names, trademarks, service marks, or product names of the Licensor,
147
+ except as required for reasonable and customary use in describing the
148
+ origin of the Work and reproducing the content of the NOTICE file.
149
+
150
+ 7. Disclaimer of Warranty. Unless required by applicable law or
151
+ agreed to in writing, Licensor provides the Work (and each
152
+ Contributor provides its Contributions) on an "AS IS" BASIS,
153
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
154
+ implied, including, without limitation, any warranties or conditions
155
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
156
+ PARTICULAR PURPOSE. You are solely responsible for determining the
157
+ appropriateness of using or redistributing the Work and assume any
158
+ risks associated with Your exercise of permissions under this License.
159
+
160
+ 8. Limitation of Liability. Except as required by applicable law or
161
+ agreed to in writing, in no event and under no legal theory,
162
+ whether in tort (including negligence), contract, or otherwise,
163
+ unless required by applicable law (such as deliberate and grossly
164
+ negligent acts) or agreed to in writing, shall any Contributor be
165
+ liable to You for damages, including any direct, indirect, special,
166
+ incidental, or consequential damages of any character arising as a
167
+ result of this License or out of the use or inability to use the
168
+ Work (including but not limited to damages for loss of goodwill,
169
+ work stoppage, computer failure or malfunction, or any and all
170
+ other commercial damages or losses), even if such Contributor
171
+ has been advised of the possibility of such damages.
172
+
173
+ 9. Accepting Warranty or Additional Liability. While redistributing
174
+ the Work or Derivative Works thereof, You may choose to offer,
175
+ and charge a fee for, acceptance of support, warranty, indemnity,
176
+ or other liability obligations and/or rights consistent with this
177
+ License. However, in accepting such obligations, You may act only
178
+ on Your own behalf and on Your sole responsibility, not on behalf
179
+ of any other Contributor, and only if You agree to indemnify,
180
+ defend, and hold each Contributor harmless for any liability
181
+ incurred by, or claims asserted against, such Contributor by reason
182
+ of your accepting any such warranty or additional liability.
183
+
184
+ END OF TERMS AND CONDITIONS
185
+
186
+ APPENDIX: How to apply the Apache License to your work.
187
+
188
+ To apply the Apache License to your work, attach the following
189
+ boilerplate notice, with the fields enclosed by brackets "[]"
190
+ replaced with your own identifying information. (Don't include
191
+ the brackets!) The text should be enclosed in the appropriate
192
+ comment syntax for the file format. We also recommend that a
193
+ file or class name and description of purpose be included on the
194
+ same "printed page" as the copyright notice for easier
195
+ identification within third-party archives.
196
+
197
+ Copyright 2026 Chirata Andrei
198
+
199
+ Licensed under the Apache License, Version 2.0 (the "License");
200
+ you may not use this file except in compliance with the License.
201
+ You may obtain a copy of the License at
202
+
203
+ http://www.apache.org/licenses/LICENSE-2.0
204
+
205
+ Unless required by applicable law or agreed to in writing, software
206
+ distributed under the License is distributed on an "AS IS" BASIS,
207
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
+ See the License for the specific language governing permissions and
209
+ limitations under the License.
210
+ License-File: LICENSE
211
+ Requires-Python: >=3.11
212
+ Requires-Dist: packaging>=23.0
213
+ Provides-Extra: dev
214
+ Requires-Dist: pytest>=7.0; extra == 'dev'
215
+ Description-Content-Type: text/markdown
216
+
217
+ # provctl
218
+
219
+ [![CI](https://github.com/chirataandrei/provctl/actions/workflows/ci.yml/badge.svg)](https://github.com/chirataandrei/provctl/actions/workflows/ci.yml)
220
+
221
+ Pre-commit hook that blocks Python deps which don't exist on PyPI.
222
+
223
+ Coding assistants sometimes invent package names. If you add one to
224
+ `requirements.txt` and somebody already registered it, `pip install` runs
225
+ their code. provctl checks staged manifests against a local copy of the
226
+ PyPI name list and fails the commit if the name isn't there and isn't yours.
227
+
228
+ Lookups stay on disk. Package names are not sent to pypi.org during a check.
229
+
230
+ ```console
231
+ $ echo "fastapi-turbo-helper" >> requirements.txt && git add -A && git commit -m "add dep"
232
+ BLOCK fastapi-turbo-helper
233
+ no project by this name exists on PyPI
234
+ at requirements.txt:2
235
+
236
+ This commit is blocked. To proceed:
237
+ - 'fastapi-turbo-helper' does not exist on PyPI. If the name is a typo, fix it.
238
+ If it is an internal package, add it to .provenance/policy.toml
239
+ ```
240
+
241
+ | Measured | Result |
242
+ |---|---|
243
+ | Invented package names absent from PyPI, blocked | 310 / 310 |
244
+ | Invented names already registered on PyPI (not catchable by a name check) | 10 / 320 |
245
+ | Real popular packages wrongly blocked | 0 / 499 |
246
+ | Real OSS repos with a false block | 0 / 30 |
247
+ | Time added to a commit | ~90 ms median |
248
+
249
+ The invented-name set is small and I wrote it myself (a model, imitating
250
+ slopsquat-style names), so read it as a sanity check, not a benchmark.
251
+ Method and caveats: [docs/measurements.md](docs/measurements.md).
252
+
253
+ ## Install
254
+
255
+ ```bash
256
+ pip install provctl
257
+ provctl index refresh # ~10 MB, once
258
+ ```
259
+
260
+ ## Use
261
+
262
+ ```bash
263
+ provctl init
264
+ provctl check
265
+ ```
266
+
267
+ pre-commit:
268
+
269
+ ```yaml
270
+ repos:
271
+ - repo: https://github.com/chirataandrei/provctl
272
+ rev: v0.1.1
273
+ hooks:
274
+ - id: provctl
275
+ ```
276
+
277
+ Use `provctl-warn-only` first if you don't want it to fail commits yet.
278
+
279
+ Other commands: `explain`, `ack`, `enrich`, `doctor`, `hook install`.
280
+
281
+ ## Rules
282
+
283
+ - Missing from PyPI, not first-party, not on a private index → block.
284
+ Provenance cannot override this (it's self-reported).
285
+ - Package exists but is new and unused → warn. Provenance can only move
286
+ things in this band.
287
+ - Imports never block. `import yaml` vs `PyYAML` is too easy to get wrong.
288
+
289
+ Without config it already treats as first-party: workspace packages, uv/poetry
290
+ git/path sources, private indexes (`PIP_INDEX_URL` etc.), local modules,
291
+ `_private` modules, stdlib from other Python versions.
292
+
293
+ ```toml
294
+ [first_party]
295
+ prefixes = ["acme_*"]
296
+ allow = ["acme-billing"]
297
+ ```
298
+
299
+ ## What it doesn't do
300
+
301
+ Transitive deps, typos of names that exist, and malicious packages that *are*
302
+ on PyPI. Use `pip-audit` / OSV for those.
303
+
304
+ Agent provenance (git-ai / hook) is for "who added this", not a security
305
+ control. Details in [docs/threat-model.md](docs/threat-model.md).
306
+
307
+ Exact name index is ~12 MB. A Bloom filter would be smaller but a false
308
+ "exists" is a missed fake package, so we don't use one.
309
+
310
+ Runtime dep: `packaging`. git-ai is optional.
311
+
312
+ ## License
313
+
314
+ [Apache-2.0](LICENSE). https://github.com/chirataandrei/provctl