casepatch 0.5.0__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.
- casepatch-0.5.0/LICENSE +202 -0
- casepatch-0.5.0/MANIFEST.in +13 -0
- casepatch-0.5.0/NOTICE +94 -0
- casepatch-0.5.0/PKG-INFO +106 -0
- casepatch-0.5.0/casepatch/__init__.py +10 -0
- casepatch-0.5.0/casepatch/__main__.py +143 -0
- casepatch-0.5.0/casepatch/agent/__init__.py +4 -0
- casepatch-0.5.0/casepatch/agent/__main__.py +22 -0
- casepatch-0.5.0/casepatch/agent/run.py +611 -0
- casepatch-0.5.0/casepatch/agent/tools.py +836 -0
- casepatch-0.5.0/casepatch/agent/verify.py +329 -0
- casepatch-0.5.0/casepatch/bench/__init__.py +1 -0
- casepatch-0.5.0/casepatch/bench/categories_eval.py +161 -0
- casepatch-0.5.0/casepatch/bench/detectors.py +91 -0
- casepatch-0.5.0/casepatch/bench/parsers.py +104 -0
- casepatch-0.5.0/casepatch/bench/replay.py +283 -0
- casepatch-0.5.0/casepatch/bench/score.py +582 -0
- casepatch-0.5.0/casepatch/client/__init__.py +11 -0
- casepatch-0.5.0/casepatch/client/cli.py +51 -0
- casepatch-0.5.0/casepatch/client/cloud.py +103 -0
- casepatch-0.5.0/casepatch/client/core.py +156 -0
- casepatch-0.5.0/casepatch/client/local.py +67 -0
- casepatch-0.5.0/casepatch/core.py +269 -0
- casepatch-0.5.0/casepatch/docs/__init__.py +7 -0
- casepatch-0.5.0/casepatch/docs/byok.py +264 -0
- casepatch-0.5.0/casepatch/docs/categories.py +609 -0
- casepatch-0.5.0/casepatch/docs/category_fakes.py +439 -0
- casepatch-0.5.0/casepatch/docs/category_vocab.py +197 -0
- casepatch-0.5.0/casepatch/docs/consistency.py +1181 -0
- casepatch-0.5.0/casepatch/docs/cues.py +27 -0
- casepatch-0.5.0/casepatch/docs/data/LICENSES.md +11 -0
- casepatch-0.5.0/casepatch/docs/data/eval_key_fingerprints.json +11 -0
- casepatch-0.5.0/casepatch/docs/data/given_names_intl.txt +76865 -0
- casepatch-0.5.0/casepatch/docs/data/given_names_us.txt +4553 -0
- casepatch-0.5.0/casepatch/docs/detect.py +451 -0
- casepatch-0.5.0/casepatch/docs/editor_pick.py +862 -0
- casepatch-0.5.0/casepatch/docs/extract.py +639 -0
- casepatch-0.5.0/casepatch/docs/fonts.py +127 -0
- casepatch-0.5.0/casepatch/docs/forms.py +359 -0
- casepatch-0.5.0/casepatch/docs/hosted_detect.py +225 -0
- casepatch-0.5.0/casepatch/docs/hosted_edit.py +461 -0
- casepatch-0.5.0/casepatch/docs/iddoc.py +232 -0
- casepatch-0.5.0/casepatch/docs/legal.py +791 -0
- casepatch-0.5.0/casepatch/docs/letters.py +177 -0
- casepatch-0.5.0/casepatch/docs/model.py +88 -0
- casepatch-0.5.0/casepatch/docs/models.py +21 -0
- casepatch-0.5.0/casepatch/docs/mrz.py +103 -0
- casepatch-0.5.0/casepatch/docs/native.py +1521 -0
- casepatch-0.5.0/casepatch/docs/pack_refresh.py +148 -0
- casepatch-0.5.0/casepatch/docs/pipeline.py +602 -0
- casepatch-0.5.0/casepatch/docs/render.py +923 -0
- casepatch-0.5.0/casepatch/docs/resolve.py +737 -0
- casepatch-0.5.0/casepatch/docs/review_html.py +90 -0
- casepatch-0.5.0/casepatch/docs/verify.py +240 -0
- casepatch-0.5.0/casepatch/docs/visual.py +362 -0
- casepatch-0.5.0/casepatch/fixtures/dispute.json +29 -0
- casepatch-0.5.0/casepatch/fonts/DejaVuSans.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LICENSE-DejaVu.txt +78 -0
- casepatch-0.5.0/casepatch/fonts/LICENSE-Liberation.txt +130 -0
- casepatch-0.5.0/casepatch/fonts/LiberationMono-Bold.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LiberationMono-Regular.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LiberationSans-Bold.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LiberationSans-Regular.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LiberationSerif-Bold.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/LiberationSerif-Regular.ttf +0 -0
- casepatch-0.5.0/casepatch/fonts/README.md +7 -0
- casepatch-0.5.0/casepatch/hosted/__init__.py +9 -0
- casepatch-0.5.0/casepatch/hosted/cli.py +137 -0
- casepatch-0.5.0/casepatch/hosted/client.py +396 -0
- casepatch-0.5.0/casepatch/hosted/config.py +170 -0
- casepatch-0.5.0/casepatch/hosted/editbench.py +482 -0
- casepatch-0.5.0/casepatch/hosted/evalscore.py +323 -0
- casepatch-0.5.0/casepatch/hosted/faledit.py +147 -0
- casepatch-0.5.0/casepatch/hosted/ledger.py +117 -0
- casepatch-0.5.0/casepatch/hosted/localvlm.py +164 -0
- casepatch-0.5.0/casepatch/hosted/modeleval.py +884 -0
- casepatch-0.5.0/casepatch/hosted/pricing.py +270 -0
- casepatch-0.5.0/casepatch/ledger.py +161 -0
- casepatch-0.5.0/casepatch/metering/__init__.py +11 -0
- casepatch-0.5.0/casepatch/metering/active.py +49 -0
- casepatch-0.5.0/casepatch/metering/collector.py +184 -0
- casepatch-0.5.0/casepatch/metering/cost_model.py +110 -0
- casepatch-0.5.0/casepatch/metering/events.py +293 -0
- casepatch-0.5.0/casepatch/pricing.py +32 -0
- casepatch-0.5.0/casepatch/py.typed +0 -0
- casepatch-0.5.0/casepatch/review.py +387 -0
- casepatch-0.5.0/casepatch/server.py +177 -0
- casepatch-0.5.0/casepatch/web/app.js +145 -0
- casepatch-0.5.0/casepatch/web/index.html +23 -0
- casepatch-0.5.0/casepatch/web/json-import.js +74 -0
- casepatch-0.5.0/casepatch/web/styles.css +1 -0
- casepatch-0.5.0/casepatch.egg-info/PKG-INFO +106 -0
- casepatch-0.5.0/casepatch.egg-info/SOURCES.txt +108 -0
- casepatch-0.5.0/casepatch.egg-info/dependency_links.txt +1 -0
- casepatch-0.5.0/casepatch.egg-info/entry_points.txt +3 -0
- casepatch-0.5.0/casepatch.egg-info/requires.txt +47 -0
- casepatch-0.5.0/casepatch.egg-info/top_level.txt +2 -0
- casepatch-0.5.0/pyproject.toml +47 -0
- casepatch-0.5.0/sdk/python/README.md +47 -0
- casepatch-0.5.0/setup.cfg +4 -0
- casepatch-0.5.0/web/casepatch_studio/__init__.py +2 -0
- casepatch-0.5.0/web/casepatch_studio/__main__.py +47 -0
- casepatch-0.5.0/web/casepatch_studio/agent_review.py +242 -0
- casepatch-0.5.0/web/casepatch_studio/assets.py +81 -0
- casepatch-0.5.0/web/casepatch_studio/compare_api.py +129 -0
- casepatch-0.5.0/web/casepatch_studio/curate_names.py +116 -0
- casepatch-0.5.0/web/casepatch_studio/live_compare.py +401 -0
- casepatch-0.5.0/web/casepatch_studio/server.py +1058 -0
- casepatch-0.5.0/web/casepatch_studio/setup.py +98 -0
- casepatch-0.5.0/web/casepatch_studio/worker.py +189 -0
casepatch-0.5.0/LICENSE
ADDED
|
@@ -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,13 @@
|
|
|
1
|
+
# sdist = the package sources, licences and the package README only (the repo's tests, site, ops and benches stay private)
|
|
2
|
+
prune tests
|
|
3
|
+
prune web/demo
|
|
4
|
+
prune bench
|
|
5
|
+
prune examples
|
|
6
|
+
prune ops
|
|
7
|
+
prune docs
|
|
8
|
+
prune tools
|
|
9
|
+
prune releases
|
|
10
|
+
prune verification
|
|
11
|
+
include LICENSE NOTICE sdk/python/README.md
|
|
12
|
+
recursive-include casepatch/fonts *
|
|
13
|
+
exclude README.md
|
casepatch-0.5.0/NOTICE
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
CasePatch
|
|
2
|
+
Copyright 2026 CasePatch contributors
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0.
|
|
5
|
+
See the LICENSE file in the project root.
|
|
6
|
+
|
|
7
|
+
This NOTICE lists third-party material included with CasePatch, or used
|
|
8
|
+
to build bundled samples, fonts, and name gazetteers. Model providers
|
|
9
|
+
are listed because the software can call their APIs; no model weights
|
|
10
|
+
are distributed in this repository.
|
|
11
|
+
|
|
12
|
+
==============================================================================
|
|
13
|
+
Sample documents
|
|
14
|
+
==============================================================================
|
|
15
|
+
|
|
16
|
+
Studio "Try the example case" documents (see
|
|
17
|
+
web/casepatch_studio/sample/ATTRIBUTION.md):
|
|
18
|
+
|
|
19
|
+
* 01_card_statement.pdf — Consumer Financial Protection Bureau,
|
|
20
|
+
"Building Blocks" sample credit card statement (consumerfinance.gov).
|
|
21
|
+
United States federal government work, public domain.
|
|
22
|
+
|
|
23
|
+
* 02_receipt_photo.jpg — CORD v2 receipt dataset, test split row 88,
|
|
24
|
+
Park et al., "CORD: A Consolidated Receipt Dataset for Post-OCR
|
|
25
|
+
Parsing" (naver-clova-ix/cord-v2). Licensed under Creative Commons
|
|
26
|
+
Attribution 4.0 International (CC BY 4.0),
|
|
27
|
+
https://creativecommons.org/licenses/by/4.0/.
|
|
28
|
+
|
|
29
|
+
* 03_id_card_photo.jpg — MIDV-500 mobile identity document video
|
|
30
|
+
dataset, Albanian ID specimen, Arlazarov et al. (2019); frame via
|
|
31
|
+
the Noaman/midv500 Hugging Face mirror. Licensed under Creative
|
|
32
|
+
Commons Attribution-ShareAlike 2.5 Generic (CC BY-SA 2.5),
|
|
33
|
+
https://creativecommons.org/licenses/by-sa/2.5/.
|
|
34
|
+
|
|
35
|
+
This file is redistributed unmodified. Transformed outputs you make
|
|
36
|
+
from it are adaptations and must be shared under CC BY-SA 2.5.
|
|
37
|
+
|
|
38
|
+
Landing-page and demo comparison images derived from the same sources
|
|
39
|
+
are documented in web/landing/assets/LICENSES.md and
|
|
40
|
+
web/demo/cases/compare/ATTRIBUTION.md. Images derived from the MIDV-500
|
|
41
|
+
ID specimen are also licensed under CC BY-SA 2.5.
|
|
42
|
+
|
|
43
|
+
Other public-domain sample citations (United States government works
|
|
44
|
+
and Wikimedia Commons official specimens) are documented in those
|
|
45
|
+
attribution files and in examples/real/SOURCES.md. Research-only
|
|
46
|
+
datasets (including FUNSD and SROIE) are not included in this
|
|
47
|
+
repository.
|
|
48
|
+
|
|
49
|
+
==============================================================================
|
|
50
|
+
Fonts
|
|
51
|
+
==============================================================================
|
|
52
|
+
|
|
53
|
+
* Inter (web/casepatch_studio/static/fonts/) — Copyright 2016 The
|
|
54
|
+
Inter Project Authors (https://github.com/rsms/inter). Licensed
|
|
55
|
+
under the SIL Open Font License 1.1. See
|
|
56
|
+
web/casepatch_studio/static/fonts/LICENSES.md and OFL.txt.
|
|
57
|
+
|
|
58
|
+
* Document-rendering fonts under web/demo/build-fonts/ — typically
|
|
59
|
+
SIL Open Font License 1.1 or Apache License 2.0, as stated in each
|
|
60
|
+
family's LICENSE file in that directory (Google Fonts and upstream
|
|
61
|
+
projects, including Tinos, Cousine, Special Elite, Homemade Apple,
|
|
62
|
+
Yellowtail, and others).
|
|
63
|
+
|
|
64
|
+
==============================================================================
|
|
65
|
+
Name gazetteers
|
|
66
|
+
==============================================================================
|
|
67
|
+
|
|
68
|
+
See casepatch/docs/data/LICENSES.md:
|
|
69
|
+
|
|
70
|
+
* given_names_us.txt — United States Social Security Administration
|
|
71
|
+
baby-name data (United States federal government work, public
|
|
72
|
+
domain), via hadley/data-baby-names.
|
|
73
|
+
|
|
74
|
+
* given_names_intl.txt — compiled from CC0 1.0 collections
|
|
75
|
+
(sigpwned/popular-names-by-country-dataset and Wikidata given names
|
|
76
|
+
extracted by brawer/wikidata-names).
|
|
77
|
+
|
|
78
|
+
==============================================================================
|
|
79
|
+
Synthetic faces (example "after" images)
|
|
80
|
+
==============================================================================
|
|
81
|
+
|
|
82
|
+
Some example "after" images may include synthetic faces from SFHQ
|
|
83
|
+
(MIT license on GitHub / CC0 on Kaggle). See
|
|
84
|
+
web/landing/assets/LICENSES.md.
|
|
85
|
+
|
|
86
|
+
==============================================================================
|
|
87
|
+
Model APIs (not distributed)
|
|
88
|
+
==============================================================================
|
|
89
|
+
|
|
90
|
+
CasePatch can call third-party model APIs when the user supplies their
|
|
91
|
+
own key (bring-your-own-key). No model weights and no vendor API keys
|
|
92
|
+
are included in this distribution. Use of those APIs is subject to the
|
|
93
|
+
provider's own terms, including without limitation Anthropic, OpenAI,
|
|
94
|
+
Google, Moonshot/Kimi, Fal, and Ideogram.
|
casepatch-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: casepatch
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Production data anonymization for AI agent evals: replace identities in PDFs and images, locally or via the CasePatch API
|
|
5
|
+
Author-email: CasePatch <support@casepatch.com>
|
|
6
|
+
Maintainer-email: CasePatch <support@casepatch.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://casepatch.com
|
|
9
|
+
Keywords: anonymization,pii,redaction,evals,ai-agents,synthetic-data,pdf
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Security
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE
|
|
19
|
+
Provides-Extra: ner
|
|
20
|
+
Requires-Dist: spacy<3.9,>=3.8; extra == "ner"
|
|
21
|
+
Provides-Extra: docs
|
|
22
|
+
Requires-Dist: pymupdf>=1.24; extra == "docs"
|
|
23
|
+
Requires-Dist: pillow>=10; extra == "docs"
|
|
24
|
+
Requires-Dist: numpy>=1.26; extra == "docs"
|
|
25
|
+
Requires-Dist: opencv-python-headless>=4.9; extra == "docs"
|
|
26
|
+
Requires-Dist: rapidocr>=3.0; extra == "docs"
|
|
27
|
+
Requires-Dist: onnxruntime>=1.17; extra == "docs"
|
|
28
|
+
Provides-Extra: docs-gliner
|
|
29
|
+
Requires-Dist: gliner>=0.2.13; extra == "docs-gliner"
|
|
30
|
+
Provides-Extra: docs-llm
|
|
31
|
+
Requires-Dist: llama-cpp-python>=0.3; extra == "docs-llm"
|
|
32
|
+
Provides-Extra: fixtures
|
|
33
|
+
Requires-Dist: qrcode>=7; extra == "fixtures"
|
|
34
|
+
Provides-Extra: local
|
|
35
|
+
Requires-Dist: pymupdf>=1.24; extra == "local"
|
|
36
|
+
Requires-Dist: pillow>=10; extra == "local"
|
|
37
|
+
Requires-Dist: numpy>=1.26; extra == "local"
|
|
38
|
+
Requires-Dist: opencv-python-headless>=4.9; extra == "local"
|
|
39
|
+
Requires-Dist: rapidocr>=3.0; extra == "local"
|
|
40
|
+
Requires-Dist: onnxruntime>=1.17; extra == "local"
|
|
41
|
+
Requires-Dist: segno>=1.6; extra == "local"
|
|
42
|
+
Requires-Dist: zxing-cpp>=2.2; extra == "local"
|
|
43
|
+
Requires-Dist: fonttools>=4.50; extra == "local"
|
|
44
|
+
Provides-Extra: local-hq
|
|
45
|
+
Requires-Dist: casepatch[local]; extra == "local-hq"
|
|
46
|
+
Requires-Dist: torch>=2.2; extra == "local-hq"
|
|
47
|
+
Provides-Extra: studio
|
|
48
|
+
Requires-Dist: pymupdf>=1.24; extra == "studio"
|
|
49
|
+
Requires-Dist: pillow>=10; extra == "studio"
|
|
50
|
+
Requires-Dist: numpy>=1.26; extra == "studio"
|
|
51
|
+
Requires-Dist: opencv-python-headless>=4.9; extra == "studio"
|
|
52
|
+
Requires-Dist: rapidocr>=3.0; extra == "studio"
|
|
53
|
+
Requires-Dist: onnxruntime>=1.17; extra == "studio"
|
|
54
|
+
Requires-Dist: torch>=2.2; extra == "studio"
|
|
55
|
+
Requires-Dist: segno>=1.6; extra == "studio"
|
|
56
|
+
Requires-Dist: zxing-cpp>=2.2; extra == "studio"
|
|
57
|
+
Requires-Dist: fonttools>=4.50; extra == "studio"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# casepatch
|
|
61
|
+
|
|
62
|
+
Production data anonymization for AI agent evals. CasePatch replaces the people, accounts, addresses and other
|
|
63
|
+
identifiers in PDFs and images with realistic fake values, in place, and keeps them consistent across documents.
|
|
64
|
+
|
|
65
|
+
Two modes, one interface:
|
|
66
|
+
|
|
67
|
+
| | `mode="local"` | `mode="cloud"` |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Where it runs | In this Python process | casepatch.com API |
|
|
70
|
+
| Upload | None: files never leave the machine | File sent over HTTPS, deleted within 15 minutes |
|
|
71
|
+
| Key | None | `CASEPATCH_API_KEY` |
|
|
72
|
+
| Install | `pip install "casepatch[local]"` + `casepatch setup-local` (models, ~210 MB) | `pip install casepatch` (no dependencies) |
|
|
73
|
+
| Cost | Free | Free monthly pages, then prepaid credits |
|
|
74
|
+
|
|
75
|
+
`mode="auto"` (the default) uses local when the local engine is installed, otherwise cloud.
|
|
76
|
+
|
|
77
|
+
## Use
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from casepatch import CasePatch
|
|
81
|
+
|
|
82
|
+
cp = CasePatch(mode="local") # or CasePatch(api_key="cpk_...") / CASEPATCH_API_KEY
|
|
83
|
+
r = cp.anonymize("statement.pdf", out="statement.anon.pdf")
|
|
84
|
+
print(r.summary) # {'PERSON': 1, 'ACCOUNT': 1, ...}
|
|
85
|
+
for c in r.changes: # original -> replacement (keep this private)
|
|
86
|
+
print(c["kind"], c["original"], "->", c["replacement"])
|
|
87
|
+
|
|
88
|
+
results = cp.anonymize_folder("./docs", "./anon", report="./anon/changes.jsonl")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
casepatch anonymize ./docs --out ./anon --local
|
|
93
|
+
casepatch anonymize ./docs --out ./anon --cloud # uses CASEPATCH_API_KEY
|
|
94
|
+
casepatch anonymize statement.pdf --out anon.pdf
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Supported files: PDF, PNG, JPG. Detection can miss values: review every output before you share it.
|
|
98
|
+
This is not a compliance certification or a formal de-identification determination.
|
|
99
|
+
|
|
100
|
+
## API
|
|
101
|
+
|
|
102
|
+
The cloud mode wraps the REST API described in `../openapi.json`:
|
|
103
|
+
`POST /api/v1/anonymize`, `GET /api/v1/jobs/{id}`, `GET /api/v1/jobs/{id}/result`, `DELETE /api/v1/jobs/{id}`,
|
|
104
|
+
`GET /api/v1/usage`. Authenticate with `Authorization: Bearer <key>`.
|
|
105
|
+
|
|
106
|
+
Support: support@casepatch.com
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""CasePatch: a fixture-only proof of decision-preserving case transformation."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.5.0"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def __getattr__(name): # `from casepatch import CasePatch` without importing the client on every engine import
|
|
7
|
+
if name in ("CasePatch", "CasePatchError", "Result", "local_available"):
|
|
8
|
+
from . import client
|
|
9
|
+
return getattr(client, name)
|
|
10
|
+
raise AttributeError(name)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import secrets
|
|
5
|
+
import sys
|
|
6
|
+
from importlib.resources import files
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from .core import PolicyError, transform
|
|
10
|
+
from .pricing import estimate
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def exclusive_json(path, value):
|
|
14
|
+
with open(path, "x", encoding="utf-8", opener=lambda p, f: os.open(p, f, 0o600)) as handle:
|
|
15
|
+
json.dump(value, handle, ensure_ascii=False, indent=2, allow_nan=False)
|
|
16
|
+
handle.write("\n")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main():
|
|
20
|
+
parser = argparse.ArgumentParser(prog="casepatch")
|
|
21
|
+
commands = parser.add_subparsers(dest="command", required=True)
|
|
22
|
+
gen = commands.add_parser("keygen")
|
|
23
|
+
gen.add_argument("--out", required=True)
|
|
24
|
+
run = commands.add_parser("transform")
|
|
25
|
+
run.add_argument("input")
|
|
26
|
+
run.add_argument("--key-file", required=True)
|
|
27
|
+
run.add_argument("--out", required=True, help="A NEW output directory; existing paths are refused")
|
|
28
|
+
demo = commands.add_parser("demo", help="Run bundled fictional records without setup or an account")
|
|
29
|
+
demo.add_argument("--out", required=True, help="A NEW output directory")
|
|
30
|
+
app = commands.add_parser("app", help="Open the local import, review and export product")
|
|
31
|
+
app.add_argument("--port", type=int, default=0, help="Local port; 0 selects a free port")
|
|
32
|
+
app.add_argument("--open", action="store_true", dest="open_browser", help="Open the browser after binding the local port")
|
|
33
|
+
app.add_argument("--rules-only", action="store_true", help="Limited mode without learned name detection")
|
|
34
|
+
quote = commands.add_parser("estimate", help="Preview a proposed usage price locally; no actual billing")
|
|
35
|
+
quote.add_argument("input", help="JSON case bundle with records, or a JSON list of records")
|
|
36
|
+
quote.add_argument("--monthly-used-chars", type=int, default=0, help="Assumed prior monthly account usage; not fetched")
|
|
37
|
+
docs = commands.add_parser("docs", help="Transform a case folder of PDFs, scans, photos, images and JSON traces (v0.3 spike)")
|
|
38
|
+
docs.add_argument("input_dir")
|
|
39
|
+
docs.add_argument("--out", required=True, help="A NEW output directory (transformed files + report.json, no identity map)")
|
|
40
|
+
docs.add_argument("--detector", choices=["rules", "gliner", "llm", "hosted"], default="rules",
|
|
41
|
+
help="Learned detector added to the rules (hosted is a disabled stub)")
|
|
42
|
+
docs.add_argument("--review-dir", help="Local review folder (proposals, review.html, decisions.json, case key). Default: <out>.review")
|
|
43
|
+
docs.add_argument("--decisions", help="decisions.json from review (accept/reject per text proposal, replace/keep/erase per region; optional _add list of {text, kind} reviewer additions)")
|
|
44
|
+
docs.add_argument("--no-verify", action="store_true")
|
|
45
|
+
docs.add_argument("--hosted-detect", action="store_true",
|
|
46
|
+
help="OPT-IN, bring your own key: also send each page image + its OCR text directly from this computer to "
|
|
47
|
+
"Anthropic (Claude Sonnet 5.5) for detection, using YOUR ANTHROPIC_API_KEY under your agreement "
|
|
48
|
+
"with Anthropic. Per-case estimate limit $2 (CASEPATCH_BYOK_MAX_USD_PER_CASE). "
|
|
49
|
+
"Model-only suggestions are applied only after you accept them in review (decisions _accept_text)")
|
|
50
|
+
docs.add_argument("--accept-hosted-notice", action="store_true",
|
|
51
|
+
help="Confirm you read the hosted-detection notice (page images leave this computer)")
|
|
52
|
+
from .client.cli import add_parsers as add_client_parsers
|
|
53
|
+
add_client_parsers(commands)
|
|
54
|
+
hosted = commands.add_parser("hosted", help="Hosted frontier adapters (disabled by default; spend-capped)")
|
|
55
|
+
hosted.add_argument("action", choices=["status", "verify"])
|
|
56
|
+
hosted.add_argument("--auth-check", action="store_true",
|
|
57
|
+
help="verify only: also call each provider's free list-models endpoint (no paid call)")
|
|
58
|
+
args = parser.parse_args()
|
|
59
|
+
if args.command in ("anonymize", "setup-local"):
|
|
60
|
+
from .client.cli import run as run_client
|
|
61
|
+
return run_client(args)
|
|
62
|
+
if args.command == "hosted":
|
|
63
|
+
from .hosted.cli import status, verify
|
|
64
|
+
print(verify(auth_check=args.auth_check) if args.action == "verify" else status())
|
|
65
|
+
return 0
|
|
66
|
+
if args.command == "docs":
|
|
67
|
+
return docs_command(args)
|
|
68
|
+
try:
|
|
69
|
+
if args.command == "app":
|
|
70
|
+
from .server import serve
|
|
71
|
+
serve(args.port, args.rules_only, args.open_browser)
|
|
72
|
+
return 0
|
|
73
|
+
if args.command == "keygen":
|
|
74
|
+
with open(args.out, "xb", opener=lambda p, f: os.open(p, f, 0o600)) as handle:
|
|
75
|
+
handle.write(secrets.token_bytes(32))
|
|
76
|
+
print("KEY_CREATED")
|
|
77
|
+
return 0
|
|
78
|
+
if args.command == "estimate":
|
|
79
|
+
value = json.loads(Path(args.input).read_text())
|
|
80
|
+
records = value.get("records") if isinstance(value, dict) else value
|
|
81
|
+
print(json.dumps(estimate(records, args.monthly_used_chars), indent=2))
|
|
82
|
+
return 0
|
|
83
|
+
if args.command == "demo":
|
|
84
|
+
bundle = json.loads(files("casepatch").joinpath("fixtures/dispute.json").read_text())
|
|
85
|
+
key = secrets.token_bytes(32)
|
|
86
|
+
else:
|
|
87
|
+
bundle = json.loads(Path(args.input).read_text())
|
|
88
|
+
key = Path(args.key_file).read_bytes()
|
|
89
|
+
# Validate everything before creating the output directory.
|
|
90
|
+
result = transform(bundle, key)
|
|
91
|
+
destination = Path(args.out)
|
|
92
|
+
destination.mkdir(mode=0o700, parents=False, exist_ok=False)
|
|
93
|
+
exclusive_json(destination / "report.json", result.report)
|
|
94
|
+
if result.candidate is not None:
|
|
95
|
+
exclusive_json(destination / "candidate.json", result.candidate)
|
|
96
|
+
print(result.report["status"])
|
|
97
|
+
return 2 if result.candidate is None else 0
|
|
98
|
+
except PolicyError as exc:
|
|
99
|
+
print("POLICY_ERROR: " + str(exc), file=sys.stderr)
|
|
100
|
+
return 2
|
|
101
|
+
except (OSError, ValueError, TypeError, KeyError, OverflowError):
|
|
102
|
+
print("INPUT_OR_OUTPUT_ERROR: inspect local files; no source text logged", file=sys.stderr)
|
|
103
|
+
return 2
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def docs_command(args):
|
|
107
|
+
try:
|
|
108
|
+
from .docs.pipeline import run
|
|
109
|
+
except ImportError:
|
|
110
|
+
print("DOCS_EXTRAS_MISSING: pip install -e '.[docs]'", file=sys.stderr)
|
|
111
|
+
return 2
|
|
112
|
+
hosted = None
|
|
113
|
+
if args.hosted_detect:
|
|
114
|
+
from .docs.hosted_detect import NOTICE, HostedNotAllowed, HostedPageDetector
|
|
115
|
+
if not args.accept_hosted_notice:
|
|
116
|
+
print("HOSTED_NOTICE: " + NOTICE + "\nRe-run with --accept-hosted-notice to proceed.", file=sys.stderr)
|
|
117
|
+
return 2
|
|
118
|
+
try:
|
|
119
|
+
hosted = HostedPageDetector.from_user(True)
|
|
120
|
+
except HostedNotAllowed as exc:
|
|
121
|
+
print("HOSTED_DISABLED: " + str(exc), file=sys.stderr); return 2
|
|
122
|
+
try:
|
|
123
|
+
report, *_ = run(args.input_dir, args.out, args.detector, args.review_dir, args.decisions, not args.no_verify, hosted=hosted)
|
|
124
|
+
except FileExistsError:
|
|
125
|
+
print("OUTPUT_DIRECTORY_EXISTS", file=sys.stderr); return 2
|
|
126
|
+
except (RuntimeError, ValueError) as exc:
|
|
127
|
+
print("DOCS_ERROR: " + str(exc).split(":")[0], file=sys.stderr); return 2
|
|
128
|
+
ver = report.get("verification", {})
|
|
129
|
+
for doc_id, d in report["documents"].items():
|
|
130
|
+
v = ver.get(doc_id, {})
|
|
131
|
+
print(f"{doc_id} {d['type']:5} replaced={sum(d['replacements_by_kind'].values()):3} regions_edited={len(d['edited_regions'])} "
|
|
132
|
+
f"residual={v.get('residual_original_values', '-')} facts_missing={len(v.get('facts_missing', [])) if v else '-'} "
|
|
133
|
+
f"pixel_diff={','.join(p['verdict'] for p in v.get('pixel_diff', [])) or '-'}")
|
|
134
|
+
h = report.get("hosted_detection")
|
|
135
|
+
if h:
|
|
136
|
+
print(f"hosted={h['provider']}:{h['model']} pages_sent={h['pages_sent']} model_only_suggestions={h['model_only_values']} "
|
|
137
|
+
f"accepted={h['model_only_values_accepted']} error={h['error'] or '-'}")
|
|
138
|
+
print(f"needs_review={len(report['needs_review'])} status={report['status']} report={args.out}/report.json")
|
|
139
|
+
return 0
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
if __name__ == "__main__":
|
|
143
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"""CasePatch agent mode (2026-11-12 redesign, bench/agentic/RESULTS.md): a frontier model does the reading and decides
|
|
2
|
+
what to replace; CasePatch's own working pieces are exposed to it as tools (OCR with boxes, font-matched in-place text
|
|
3
|
+
replacement, erase, native PDF text edits), and CasePatch's deterministic checks verify the result and feed failures
|
|
4
|
+
back for a bounded number of fix rounds. Product use is BYOK only (the customer's own key, off by default)."""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import argparse, json, os, sys
|
|
2
|
+
|
|
3
|
+
from .run import run_case, DEFAULT_MODEL, ESCALATE_MODEL
|
|
4
|
+
|
|
5
|
+
ap = argparse.ArgumentParser(prog="python -m casepatch.agent", description="CasePatch agent mode (BYOK; off by default)")
|
|
6
|
+
ap.add_argument("input"); ap.add_argument("--out", required=True)
|
|
7
|
+
ap.add_argument("--enable-agent", action="store_true", help="agent mode is off unless this flag (or CASEPATCH_AGENT=1) is given")
|
|
8
|
+
ap.add_argument("--eval", action="store_true", help="bench only: CasePatch eval key, public samples, spend ledger")
|
|
9
|
+
ap.add_argument("--budget", type=float, default=6.0, help="case ceiling (USD)"); ap.add_argument("--doc-budget", type=float, default=1.5); ap.add_argument("--faces", choices=["swap", "keep"], default="swap"); ap.add_argument("--model", default=DEFAULT_MODEL); ap.add_argument("--escalate", default=ESCALATE_MODEL)
|
|
10
|
+
ap.add_argument("--fix-rounds", type=int, default=2); ap.add_argument("--workers", type=int, default=4); ap.add_argument("--run", default="run")
|
|
11
|
+
ap.add_argument("--effort", default="high"); ap.add_argument("--only", nargs="*")
|
|
12
|
+
ap.add_argument("--replay", metavar="LOGS_DIR", help="re-execute a recorded run's transcripts with the local tools: no key, no network, $0")
|
|
13
|
+
a = ap.parse_args()
|
|
14
|
+
if a.replay:
|
|
15
|
+
r = run_case(a.input, a.out, mode="replay", replay_dir=a.replay, budget=a.budget, doc_budget=a.doc_budget, faces=a.faces, fix_rounds=a.fix_rounds, workers=a.workers)
|
|
16
|
+
print(json.dumps({k: r[k] for k in ("case", "wall_s", "spent_usd", "model_calls")} | {"open_issues": len(r["review_issues"]), "mode": "replay"}))
|
|
17
|
+
sys.exit(0)
|
|
18
|
+
if not (a.enable_agent or os.environ.get("CASEPATCH_AGENT") == "1"):
|
|
19
|
+
sys.exit("Agent mode is off by default. It sends document pages to your own Anthropic account; pass --enable-agent to opt in.")
|
|
20
|
+
r = run_case(a.input, a.out, mode="eval" if a.eval else "product", budget=a.budget, doc_budget=a.doc_budget, faces=a.faces, model=a.model, escalate=a.escalate or None,
|
|
21
|
+
fix_rounds=a.fix_rounds, workers=a.workers, run_tag=a.run, effort=a.effort, only=a.only)
|
|
22
|
+
print(json.dumps({k: r[k] for k in ("case", "wall_s", "spent_usd", "list_usd", "model_calls")} | {"open_issues": len(r["review_issues"])}))
|