underwrite 0.0.0__tar.gz → 0.0.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 (103) hide show
  1. underwrite-0.0.1/LICENSE +202 -0
  2. underwrite-0.0.1/NOTICE +12 -0
  3. underwrite-0.0.1/PKG-INFO +188 -0
  4. underwrite-0.0.1/README.md +173 -0
  5. underwrite-0.0.1/contracts/acceptance_decision.v1.schema.json +337 -0
  6. underwrite-0.0.1/contracts/acceptance_error.v1.schema.json +172 -0
  7. underwrite-0.0.1/contracts/artifact_case.v1.schema.json +66 -0
  8. underwrite-0.0.1/contracts/artifact_inspection.v1.schema.json +247 -0
  9. underwrite-0.0.1/contracts/artifact_inspection_error.v1.schema.json +61 -0
  10. underwrite-0.0.1/contracts/change_candidate.v1.schema.json +66 -0
  11. underwrite-0.0.1/contracts/declared_claims.v1.schema.json +123 -0
  12. underwrite-0.0.1/contracts/gate_rules.v1.schema.json +179 -0
  13. underwrite-0.0.1/contracts/measurement_error.v1.schema.json +64 -0
  14. underwrite-0.0.1/contracts/measurement_policy.v2.schema.json +290 -0
  15. underwrite-0.0.1/contracts/observation.v1.schema.json +111 -0
  16. underwrite-0.0.1/contracts/read.v1.schema.json +928 -0
  17. underwrite-0.0.1/contracts/release_case.v1.schema.json +145 -0
  18. underwrite-0.0.1/contracts/release_inspection.v1.schema.json +865 -0
  19. underwrite-0.0.1/contracts/release_inspection_error.v1.schema.json +61 -0
  20. underwrite-0.0.1/contracts/statistical_seed.v1.schema.json +8 -0
  21. underwrite-0.0.1/pyproject.toml +105 -0
  22. underwrite-0.0.1/src/underwrite/__init__.py +0 -0
  23. underwrite-0.0.1/src/underwrite/_contracts/acceptance_decision.v1.schema.json +337 -0
  24. underwrite-0.0.1/src/underwrite/_contracts/acceptance_error.v1.schema.json +172 -0
  25. underwrite-0.0.1/src/underwrite/_contracts/artifact_case.v1.schema.json +66 -0
  26. underwrite-0.0.1/src/underwrite/_contracts/artifact_inspection.v1.schema.json +247 -0
  27. underwrite-0.0.1/src/underwrite/_contracts/artifact_inspection_error.v1.schema.json +61 -0
  28. underwrite-0.0.1/src/underwrite/_contracts/change_candidate.v1.schema.json +66 -0
  29. underwrite-0.0.1/src/underwrite/_contracts/declared_claims.v1.schema.json +123 -0
  30. underwrite-0.0.1/src/underwrite/_contracts/gate_rules.v1.schema.json +179 -0
  31. underwrite-0.0.1/src/underwrite/_contracts/measurement_error.v1.schema.json +64 -0
  32. underwrite-0.0.1/src/underwrite/_contracts/measurement_policy.v2.schema.json +290 -0
  33. underwrite-0.0.1/src/underwrite/_contracts/observation.v1.schema.json +111 -0
  34. underwrite-0.0.1/src/underwrite/_contracts/read.v1.schema.json +928 -0
  35. underwrite-0.0.1/src/underwrite/_contracts/release_case.v1.schema.json +145 -0
  36. underwrite-0.0.1/src/underwrite/_contracts/release_inspection.v1.schema.json +865 -0
  37. underwrite-0.0.1/src/underwrite/_contracts/release_inspection_error.v1.schema.json +61 -0
  38. underwrite-0.0.1/src/underwrite/_contracts/statistical_seed.v1.schema.json +8 -0
  39. underwrite-0.0.1/src/underwrite/acceptance/__init__.py +0 -0
  40. underwrite-0.0.1/src/underwrite/acceptance/claims.py +223 -0
  41. underwrite-0.0.1/src/underwrite/acceptance/classify.py +159 -0
  42. underwrite-0.0.1/src/underwrite/acceptance/decision.py +334 -0
  43. underwrite-0.0.1/src/underwrite/acceptance/incident.py +137 -0
  44. underwrite-0.0.1/src/underwrite/acceptance/lifecycle.py +49 -0
  45. underwrite-0.0.1/src/underwrite/adjudication/__init__.py +0 -0
  46. underwrite-0.0.1/src/underwrite/cli/__init__.py +0 -0
  47. underwrite-0.0.1/src/underwrite/cli/accept.py +178 -0
  48. underwrite-0.0.1/src/underwrite/cli/boundary.py +235 -0
  49. underwrite-0.0.1/src/underwrite/cli/commands.py +178 -0
  50. underwrite-0.0.1/src/underwrite/cli/gate_rules.py +287 -0
  51. underwrite-0.0.1/src/underwrite/cli/inspection.py +99 -0
  52. underwrite-0.0.1/src/underwrite/cli/instrument.py +134 -0
  53. underwrite-0.0.1/src/underwrite/cli/local_json.py +88 -0
  54. underwrite-0.0.1/src/underwrite/cli/main.py +103 -0
  55. underwrite-0.0.1/src/underwrite/cli/measure.py +268 -0
  56. underwrite-0.0.1/src/underwrite/cli/release.py +93 -0
  57. underwrite-0.0.1/src/underwrite/cli/render.py +62 -0
  58. underwrite-0.0.1/src/underwrite/fleet/__init__.py +0 -0
  59. underwrite-0.0.1/src/underwrite/fleet/drift.py +120 -0
  60. underwrite-0.0.1/src/underwrite/fleet/pins.py +235 -0
  61. underwrite-0.0.1/src/underwrite/instrument/__init__.py +0 -0
  62. underwrite-0.0.1/src/underwrite/instrument/evidence/__init__.py +0 -0
  63. underwrite-0.0.1/src/underwrite/instrument/evidence/_resampling.py +80 -0
  64. underwrite-0.0.1/src/underwrite/instrument/evidence/aa.py +408 -0
  65. underwrite-0.0.1/src/underwrite/instrument/evidence/controlled.py +178 -0
  66. underwrite-0.0.1/src/underwrite/instrument/evidence/judge.py +492 -0
  67. underwrite-0.0.1/src/underwrite/instrument/evidence/paired.py +352 -0
  68. underwrite-0.0.1/src/underwrite/instrument/evidence/retrieval.py +313 -0
  69. underwrite-0.0.1/src/underwrite/instrument/evidence/selfcheck.py +153 -0
  70. underwrite-0.0.1/src/underwrite/instrument/evidence/split.py +134 -0
  71. underwrite-0.0.1/src/underwrite/instrument/ingest/__init__.py +0 -0
  72. underwrite-0.0.1/src/underwrite/instrument/ingest/application.py +153 -0
  73. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/__init__.py +0 -0
  74. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/_shape.py +90 -0
  75. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/deepeval.py +138 -0
  76. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/evidence_bundle.py +33 -0
  77. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/inspect.py +217 -0
  78. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/langfuse.py +161 -0
  79. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/openinference.py +387 -0
  80. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/otlp_json.py +337 -0
  81. underwrite-0.0.1/src/underwrite/instrument/ingest/codecs/promptfoo.py +226 -0
  82. underwrite-0.0.1/src/underwrite/instrument/ingest/formats.py +52 -0
  83. underwrite-0.0.1/src/underwrite/instrument/ingest/inspection.py +285 -0
  84. underwrite-0.0.1/src/underwrite/instrument/ingest/project.py +120 -0
  85. underwrite-0.0.1/src/underwrite/instrument/ingest/release.py +258 -0
  86. underwrite-0.0.1/src/underwrite/instrument/ingest/release_bindings.py +167 -0
  87. underwrite-0.0.1/src/underwrite/instrument/ingest/release_compose.py +326 -0
  88. underwrite-0.0.1/src/underwrite/instrument/ingest/schema.py +92 -0
  89. underwrite-0.0.1/src/underwrite/instrument/ingest/transport.py +229 -0
  90. underwrite-0.0.1/src/underwrite/measurement/__init__.py +0 -0
  91. underwrite-0.0.1/src/underwrite/measurement/availability.py +219 -0
  92. underwrite-0.0.1/src/underwrite/measurement/calibration.py +192 -0
  93. underwrite-0.0.1/src/underwrite/measurement/eprocess.py +501 -0
  94. underwrite-0.0.1/src/underwrite/measurement/jury.py +265 -0
  95. underwrite-0.0.1/src/underwrite/measurement/read.py +260 -0
  96. underwrite-0.0.1/src/underwrite/measurement/read_input.py +391 -0
  97. underwrite-0.0.1/src/underwrite/measurement/stratify.py +230 -0
  98. underwrite-0.0.1/src/underwrite/service/__init__.py +0 -0
  99. underwrite-0.0.0/LICENSE +0 -21
  100. underwrite-0.0.0/PKG-INFO +0 -24
  101. underwrite-0.0.0/README.md +0 -8
  102. underwrite-0.0.0/pyproject.toml +0 -22
  103. underwrite-0.0.0/src/underwrite/__init__.py +0 -6
@@ -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,12 @@
1
+ underwrite
2
+ Copyright (C) 2026 ntts9990 (https://github.com/ntts9990)
3
+
4
+ The underwrite app and underwrite-core are licensed under the Apache License,
5
+ Version 2.0. See LICENSE and LICENSING.md for the terms and file-specific scope.
6
+ This notice is informational and does not modify the license.
7
+
8
+ "underwrite" is claimed as a trademark of ntts9990. See TRADEMARKS.md and
9
+ Apache License section 6 for the applicable trademark terms.
10
+
11
+ CODE_OF_CONDUCT.md is adapted from Contributor Covenant 3.0 (CC BY-SA 4.0).
12
+ TRADEMARKS.md is adapted from Model Trademark Guidelines 1.0 (CC BY 4.0).
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: underwrite
3
+ Version: 0.0.1
4
+ Summary: Local evidence normalization, measurement, and acceptance checks
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Requires-Dist: underwrite-core>=0.0.1,<0.1
9
+ Requires-Dist: jsonschema>=4.26.0
10
+ Requires-Dist: pyyaml>=6.0.3
11
+ Requires-Python: >=3.12
12
+ Project-URL: Repository, https://github.com/ntts9990/underwrite
13
+ Project-URL: Issues, https://github.com/ntts9990/underwrite/issues
14
+ Description-Content-Type: text/markdown
15
+
16
+ # underwrite
17
+
18
+ underwrite turns local evaluation artifacts into a common observation, computes
19
+ measurements under an explicit policy, and classifies change candidates against
20
+ declared evidence. It keeps missing evidence visible: `not_measured`,
21
+ `indeterminate`, and `abstained` are distinct outcomes.
22
+
23
+ It is a Python CLI and library. Artifact inspection checks bytes and declared
24
+ hashes; release checks examine declared linkage and record presence. These checks
25
+ do not establish independent provenance or grant deployment permission.
26
+
27
+ ## Install from source
28
+
29
+ Requires Python 3.12 or later and [uv](https://docs.astral.sh/uv/).
30
+
31
+ ```sh
32
+ git clone https://github.com/ntts9990/underwrite.git
33
+ cd underwrite
34
+ uv sync --frozen --all-groups
35
+ uv run --frozen --no-sync underwrite --help
36
+ ```
37
+
38
+ The repository includes the `underwrite-core` workspace package. No adjacent
39
+ checkout is needed to install or use the example workflows.
40
+
41
+ ## PyPI release preparation
42
+
43
+ The functional `0.0.1` release is prepared for `underwrite-core` and `underwrite`;
44
+ publication is not yet confirmed. The existing `underwrite` `0.0.0` entry is a
45
+ reserved placeholder. Use the source installation above until both `0.0.1`
46
+ releases are available. After publication, the planned CLI installation is:
47
+
48
+ ```sh
49
+ uv tool install 'underwrite==0.0.1'
50
+ underwrite --help
51
+ ```
52
+
53
+ Maintainers: create the GitHub environment `pypi`, restrict it to `main`, and
54
+ configure a PyPI GitHub Trusted Publisher on each project with owner `ntts9990`,
55
+ repository `underwrite`, workflow filename `publish.yml`, and environment `pypi`.
56
+ For the new `underwrite-core` project, register a pending publisher under that
57
+ project name; add the publisher to the existing `underwrite` project in its
58
+ Publishing settings. No stored PyPI API token is required.
59
+
60
+ Once configured, run **Publish PyPI** manually from the `main` branch in
61
+ GitHub Actions. It tests both packages, builds and validates the exact
62
+ distributions, and installs the wheels in a clean
63
+ environment before publishing core and then the application. Only the separate
64
+ publish job receives OIDC permission. Retry with the same artifacts after a
65
+ partial upload; existing registry files must match exactly. A changed artifact
66
+ requires a new version. Confirm both PyPI project releases and a fresh indexed
67
+ installation before describing the release as available.
68
+
69
+ The workflow follows the official [uv publishing guide](https://docs.astral.sh/uv/guides/package/)
70
+ and [PyPI Trusted Publisher guide](https://docs.pypi.org/trusted-publishers/using-a-publisher/).
71
+
72
+ ## Normalize an artifact
73
+
74
+ Choose a format and exact supported version explicitly:
75
+
76
+ | Producer | `--format` | `--version` |
77
+ | --- | --- | --- |
78
+ | DeepEval | `deepeval.test-run` | `4.1.1` |
79
+ | Inspect AI | `inspect.eval-log` | `0.3.263` |
80
+ | Langfuse | `langfuse.observations-v2` or `langfuse.scores` | `4.35.0` |
81
+ | OpenInference | `openinference.traces` | `0.1.38` |
82
+ | OTLP JSON | `otlp-json.traces` | `0.160.0` |
83
+ | promptfoo | `promptfoo.eval-output` | `0.123.0` |
84
+ | Native evidence bundle | `underwrite.evidence-bundle` | `v1` |
85
+
86
+ These are bounded payload profiles, not compatibility claims for every export
87
+ from those producers. `project` is an explicit alias of `ingest`.
88
+
89
+ ```sh
90
+ mkdir -p output
91
+ uv run --frozen --no-sync underwrite ingest \
92
+ --format underwrite.evidence-bundle --version v1 \
93
+ --file fixtures/examples/measurement/bundle.json --json \
94
+ > output/observation.json
95
+ uv run --frozen --no-sync underwrite measure \
96
+ --observation output/observation.json \
97
+ --policy fixtures/examples/acceptance/policy-quality.json --json \
98
+ > output/read-quality.json
99
+ uv run --frozen --no-sync underwrite measure \
100
+ --observation output/observation.json \
101
+ --policy fixtures/examples/acceptance/policy-latency.json --json \
102
+ > output/read-latency.json
103
+ ```
104
+
105
+ The native bundle declares `schema_version: underwrite.evidence-bundle.v1` and
106
+ carries readings, source claims, and availability records. An observation keeps
107
+ those source claims separate from the measurement. Measurement requires a
108
+ complete policy identifying inputs, subject, calibration, quorum, and statistical
109
+ thresholds. A successful command exit means the read was produced; inspect the
110
+ read's state before drawing a conclusion.
111
+
112
+ `--http-body-file FILE` reads an already captured HTTP body from a local file;
113
+ it does not fetch a URL. Optional `--source-ref` and `--source-locator` describe
114
+ the supplied source. When no source reference is given, byte identity supplies
115
+ a content hash, not an independently verified origin. See command `--help` for
116
+ input size and depth limits.
117
+
118
+ Malformed native input produces a typed error on stderr and no observation on
119
+ stdout. Try a bundle with an empty run identifier:
120
+
121
+ ```sh
122
+ mkdir -p output
123
+ printf '%s\n' '{"schema_version":"underwrite.evidence-bundle.v1","run_id":"","sources":[],"readings":[],"availability":[]}' \
124
+ > output/malformed-bundle.json
125
+ if uv run --frozen --no-sync underwrite ingest \
126
+ --format underwrite.evidence-bundle --version v1 \
127
+ --file output/malformed-bundle.json --json \
128
+ > output/malformed.stdout 2> output/malformed.stderr; then
129
+ ingest_exit=0
130
+ else
131
+ ingest_exit=$?
132
+ fi
133
+ printf 'exit: %s\n' "$ingest_exit"
134
+ wc -c < output/malformed.stdout
135
+ cat output/malformed.stderr
136
+ ```
137
+
138
+ This reports exit `1`, stdout size `0`, and this stderr JSON:
139
+
140
+ ```json
141
+ {"schema":"instrument_error.v1","command":"ingest","code":"INVALID_INPUT","reason":"MALFORMED_EVIDENCE_BUNDLE_PAYLOAD","exit_code":1}
142
+ ```
143
+
144
+ ## Classify a candidate
145
+
146
+ `accept` binds a candidate to declared claims and policy-matched reads. It reports
147
+ whether the supplied evidence supports the requested acceptance basis and retains
148
+ uncertainty or missing measurements in the decision.
149
+
150
+ ```sh
151
+ uv run --frozen --no-sync underwrite accept \
152
+ --candidate fixtures/examples/acceptance/candidate.json \
153
+ --claims fixtures/examples/acceptance/claims.json \
154
+ --read output/read-quality.json \
155
+ --read output/read-latency.json --json
156
+ ```
157
+
158
+ Repeat `--read` for each required claim. Exit 0 means a classification was
159
+ produced, not approval. This example produces `screened`, requires human review,
160
+ and keeps `merge_authorized` false. The inputs are synthetic local examples;
161
+ the reads above are computed from the supplied bundle and policies.
162
+
163
+ ## Other checks
164
+
165
+ - `inspect CASE.json --json`: inspect one local artifact manifest and its projection.
166
+ - `check RELEASE.json --json`: check a release manifest's declared evidence linkage.
167
+ - `absence --root DIR --glob '*.json' --min 1 --json`: require a nonempty population.
168
+ - `boundary scan DIR --json`: scan JSON and JSONL strings for configured verdict vocabulary.
169
+ - `drift check --pins-root PINS --siblings-root SOURCES --json`: compare a user-supplied
170
+ pin registry against local source checkouts.
171
+ - `pins refresh --repo NAME --pins-root PINS --siblings-root SOURCES`: refresh a
172
+ configured repository's pins from local bytes.
173
+
174
+ Pin commands are generic utilities; no preconfigured source registry is included.
175
+ Allowlist and exemption evaluation requires an explicit `--now` when applicable.
176
+ Malformed inputs and missing paths remain configuration errors rather than passes.
177
+ Use each command's `--help` for its options and exit behavior. JSON contracts live
178
+ in [contracts/](contracts/); each command family has its own output and error schema.
179
+
180
+ ## Development and license
181
+
182
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the checks and contribution process,
183
+ [SECURITY.md](SECURITY.md) for private vulnerability reporting, and
184
+ [AGENTS.md](AGENTS.md) for technical boundaries. The core package uses only the
185
+ Python standard library; application adapters own local I/O and schema validation.
186
+
187
+ underwrite is licensed under [Apache-2.0](LICENSE).
188
+ [LICENSING.md](LICENSING.md) records the adapted policy templates' CC licenses.
@@ -0,0 +1,173 @@
1
+ # underwrite
2
+
3
+ underwrite turns local evaluation artifacts into a common observation, computes
4
+ measurements under an explicit policy, and classifies change candidates against
5
+ declared evidence. It keeps missing evidence visible: `not_measured`,
6
+ `indeterminate`, and `abstained` are distinct outcomes.
7
+
8
+ It is a Python CLI and library. Artifact inspection checks bytes and declared
9
+ hashes; release checks examine declared linkage and record presence. These checks
10
+ do not establish independent provenance or grant deployment permission.
11
+
12
+ ## Install from source
13
+
14
+ Requires Python 3.12 or later and [uv](https://docs.astral.sh/uv/).
15
+
16
+ ```sh
17
+ git clone https://github.com/ntts9990/underwrite.git
18
+ cd underwrite
19
+ uv sync --frozen --all-groups
20
+ uv run --frozen --no-sync underwrite --help
21
+ ```
22
+
23
+ The repository includes the `underwrite-core` workspace package. No adjacent
24
+ checkout is needed to install or use the example workflows.
25
+
26
+ ## PyPI release preparation
27
+
28
+ The functional `0.0.1` release is prepared for `underwrite-core` and `underwrite`;
29
+ publication is not yet confirmed. The existing `underwrite` `0.0.0` entry is a
30
+ reserved placeholder. Use the source installation above until both `0.0.1`
31
+ releases are available. After publication, the planned CLI installation is:
32
+
33
+ ```sh
34
+ uv tool install 'underwrite==0.0.1'
35
+ underwrite --help
36
+ ```
37
+
38
+ Maintainers: create the GitHub environment `pypi`, restrict it to `main`, and
39
+ configure a PyPI GitHub Trusted Publisher on each project with owner `ntts9990`,
40
+ repository `underwrite`, workflow filename `publish.yml`, and environment `pypi`.
41
+ For the new `underwrite-core` project, register a pending publisher under that
42
+ project name; add the publisher to the existing `underwrite` project in its
43
+ Publishing settings. No stored PyPI API token is required.
44
+
45
+ Once configured, run **Publish PyPI** manually from the `main` branch in
46
+ GitHub Actions. It tests both packages, builds and validates the exact
47
+ distributions, and installs the wheels in a clean
48
+ environment before publishing core and then the application. Only the separate
49
+ publish job receives OIDC permission. Retry with the same artifacts after a
50
+ partial upload; existing registry files must match exactly. A changed artifact
51
+ requires a new version. Confirm both PyPI project releases and a fresh indexed
52
+ installation before describing the release as available.
53
+
54
+ The workflow follows the official [uv publishing guide](https://docs.astral.sh/uv/guides/package/)
55
+ and [PyPI Trusted Publisher guide](https://docs.pypi.org/trusted-publishers/using-a-publisher/).
56
+
57
+ ## Normalize an artifact
58
+
59
+ Choose a format and exact supported version explicitly:
60
+
61
+ | Producer | `--format` | `--version` |
62
+ | --- | --- | --- |
63
+ | DeepEval | `deepeval.test-run` | `4.1.1` |
64
+ | Inspect AI | `inspect.eval-log` | `0.3.263` |
65
+ | Langfuse | `langfuse.observations-v2` or `langfuse.scores` | `4.35.0` |
66
+ | OpenInference | `openinference.traces` | `0.1.38` |
67
+ | OTLP JSON | `otlp-json.traces` | `0.160.0` |
68
+ | promptfoo | `promptfoo.eval-output` | `0.123.0` |
69
+ | Native evidence bundle | `underwrite.evidence-bundle` | `v1` |
70
+
71
+ These are bounded payload profiles, not compatibility claims for every export
72
+ from those producers. `project` is an explicit alias of `ingest`.
73
+
74
+ ```sh
75
+ mkdir -p output
76
+ uv run --frozen --no-sync underwrite ingest \
77
+ --format underwrite.evidence-bundle --version v1 \
78
+ --file fixtures/examples/measurement/bundle.json --json \
79
+ > output/observation.json
80
+ uv run --frozen --no-sync underwrite measure \
81
+ --observation output/observation.json \
82
+ --policy fixtures/examples/acceptance/policy-quality.json --json \
83
+ > output/read-quality.json
84
+ uv run --frozen --no-sync underwrite measure \
85
+ --observation output/observation.json \
86
+ --policy fixtures/examples/acceptance/policy-latency.json --json \
87
+ > output/read-latency.json
88
+ ```
89
+
90
+ The native bundle declares `schema_version: underwrite.evidence-bundle.v1` and
91
+ carries readings, source claims, and availability records. An observation keeps
92
+ those source claims separate from the measurement. Measurement requires a
93
+ complete policy identifying inputs, subject, calibration, quorum, and statistical
94
+ thresholds. A successful command exit means the read was produced; inspect the
95
+ read's state before drawing a conclusion.
96
+
97
+ `--http-body-file FILE` reads an already captured HTTP body from a local file;
98
+ it does not fetch a URL. Optional `--source-ref` and `--source-locator` describe
99
+ the supplied source. When no source reference is given, byte identity supplies
100
+ a content hash, not an independently verified origin. See command `--help` for
101
+ input size and depth limits.
102
+
103
+ Malformed native input produces a typed error on stderr and no observation on
104
+ stdout. Try a bundle with an empty run identifier:
105
+
106
+ ```sh
107
+ mkdir -p output
108
+ printf '%s\n' '{"schema_version":"underwrite.evidence-bundle.v1","run_id":"","sources":[],"readings":[],"availability":[]}' \
109
+ > output/malformed-bundle.json
110
+ if uv run --frozen --no-sync underwrite ingest \
111
+ --format underwrite.evidence-bundle --version v1 \
112
+ --file output/malformed-bundle.json --json \
113
+ > output/malformed.stdout 2> output/malformed.stderr; then
114
+ ingest_exit=0
115
+ else
116
+ ingest_exit=$?
117
+ fi
118
+ printf 'exit: %s\n' "$ingest_exit"
119
+ wc -c < output/malformed.stdout
120
+ cat output/malformed.stderr
121
+ ```
122
+
123
+ This reports exit `1`, stdout size `0`, and this stderr JSON:
124
+
125
+ ```json
126
+ {"schema":"instrument_error.v1","command":"ingest","code":"INVALID_INPUT","reason":"MALFORMED_EVIDENCE_BUNDLE_PAYLOAD","exit_code":1}
127
+ ```
128
+
129
+ ## Classify a candidate
130
+
131
+ `accept` binds a candidate to declared claims and policy-matched reads. It reports
132
+ whether the supplied evidence supports the requested acceptance basis and retains
133
+ uncertainty or missing measurements in the decision.
134
+
135
+ ```sh
136
+ uv run --frozen --no-sync underwrite accept \
137
+ --candidate fixtures/examples/acceptance/candidate.json \
138
+ --claims fixtures/examples/acceptance/claims.json \
139
+ --read output/read-quality.json \
140
+ --read output/read-latency.json --json
141
+ ```
142
+
143
+ Repeat `--read` for each required claim. Exit 0 means a classification was
144
+ produced, not approval. This example produces `screened`, requires human review,
145
+ and keeps `merge_authorized` false. The inputs are synthetic local examples;
146
+ the reads above are computed from the supplied bundle and policies.
147
+
148
+ ## Other checks
149
+
150
+ - `inspect CASE.json --json`: inspect one local artifact manifest and its projection.
151
+ - `check RELEASE.json --json`: check a release manifest's declared evidence linkage.
152
+ - `absence --root DIR --glob '*.json' --min 1 --json`: require a nonempty population.
153
+ - `boundary scan DIR --json`: scan JSON and JSONL strings for configured verdict vocabulary.
154
+ - `drift check --pins-root PINS --siblings-root SOURCES --json`: compare a user-supplied
155
+ pin registry against local source checkouts.
156
+ - `pins refresh --repo NAME --pins-root PINS --siblings-root SOURCES`: refresh a
157
+ configured repository's pins from local bytes.
158
+
159
+ Pin commands are generic utilities; no preconfigured source registry is included.
160
+ Allowlist and exemption evaluation requires an explicit `--now` when applicable.
161
+ Malformed inputs and missing paths remain configuration errors rather than passes.
162
+ Use each command's `--help` for its options and exit behavior. JSON contracts live
163
+ in [contracts/](contracts/); each command family has its own output and error schema.
164
+
165
+ ## Development and license
166
+
167
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the checks and contribution process,
168
+ [SECURITY.md](SECURITY.md) for private vulnerability reporting, and
169
+ [AGENTS.md](AGENTS.md) for technical boundaries. The core package uses only the
170
+ Python standard library; application adapters own local I/O and schema validation.
171
+
172
+ underwrite is licensed under [Apache-2.0](LICENSE).
173
+ [LICENSING.md](LICENSING.md) records the adapted policy templates' CC licenses.