jev-table 0.1.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.
- jev_table-0.1.0/.github/workflows/ci.yml +26 -0
- jev_table-0.1.0/.github/workflows/release.yml +19 -0
- jev_table-0.1.0/.gitignore +9 -0
- jev_table-0.1.0/AGENTS.md +50 -0
- jev_table-0.1.0/LICENSE +201 -0
- jev_table-0.1.0/PKG-INFO +220 -0
- jev_table-0.1.0/README.md +193 -0
- jev_table-0.1.0/examples/sms-triage/pack.yaml +32 -0
- jev_table-0.1.0/examples/sms-triage/sample.csv +11 -0
- jev_table-0.1.0/pyproject.toml +76 -0
- jev_table-0.1.0/scripts/fetch_sms_spam.py +54 -0
- jev_table-0.1.0/scripts/report_accuracy.py +72 -0
- jev_table-0.1.0/src/jev_table/__init__.py +7 -0
- jev_table-0.1.0/src/jev_table/cli.py +339 -0
- jev_table-0.1.0/src/jev_table/corrections.py +221 -0
- jev_table-0.1.0/src/jev_table/engine.py +242 -0
- jev_table-0.1.0/src/jev_table/output.py +207 -0
- jev_table-0.1.0/src/jev_table/report.py +226 -0
- jev_table-0.1.0/src/jev_table/spec.py +119 -0
- jev_table-0.1.0/src/jev_table/transport.py +83 -0
- jev_table-0.1.0/tests/conftest.py +9 -0
- jev_table-0.1.0/tests/helpers.py +125 -0
- jev_table-0.1.0/tests/test_cli.py +283 -0
- jev_table-0.1.0/tests/test_engine.py +125 -0
- jev_table-0.1.0/tests/test_output.py +150 -0
- jev_table-0.1.0/tests/test_spec.py +158 -0
- jev_table-0.1.0/uv.lock +576 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
env:
|
|
12
|
+
# jevassert (pack loader) is resolved from PyPI; local dev uses the
|
|
13
|
+
# sibling checkout via [tool.uv.sources].
|
|
14
|
+
UV_NO_SOURCES: "1"
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v5
|
|
18
|
+
- run: uv sync --all-groups
|
|
19
|
+
- name: Lint
|
|
20
|
+
run: uv run ruff check .
|
|
21
|
+
- name: Tests
|
|
22
|
+
run: uv run pytest
|
|
23
|
+
- name: Dry-run self-check (no key, sends nothing)
|
|
24
|
+
run: >-
|
|
25
|
+
uv run jev-table examples/sms-triage/sample.csv
|
|
26
|
+
--spec examples/sms-triage/pack.yaml --dry-run
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pypi:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v5
|
|
16
|
+
- name: Build
|
|
17
|
+
run: uv build
|
|
18
|
+
- name: Publish to PyPI (trusted publishing)
|
|
19
|
+
run: uv publish
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# jev-table — agent notes
|
|
2
|
+
|
|
3
|
+
Local-first CLI that adds Jev columns to CSVs. Part of the
|
|
4
|
+
`jevassert` → `jev-packs` → `jev-table` suite.
|
|
5
|
+
|
|
6
|
+
## Layout
|
|
7
|
+
|
|
8
|
+
- `src/jev_table/spec.py` — column spec loader (jev-packs format v0, see
|
|
9
|
+
jev-packs `SPEC.md`) + threshold/review semantics.
|
|
10
|
+
- `src/jev_table/engine.py` — dedupe, resume cache, concurrency, per-row
|
|
11
|
+
orchestration. No HTTP here.
|
|
12
|
+
- `src/jev_table/transport.py` — the only module that talks to an endpoint
|
|
13
|
+
(typesafe-sdk; mock it in tests).
|
|
14
|
+
- `src/jev_table/output.py` — CSV/JSONL input, CSV columns, review flags,
|
|
15
|
+
corrections file. `_row` is reserved (corrections identity).
|
|
16
|
+
- `src/jev_table/corrections.py` — replay human corrections (edited cells or
|
|
17
|
+
ids removed from `review` = confirm-as-is; first occurrence per key wins) and
|
|
18
|
+
emit `cases.jsonl` that must satisfy `jevassert.packs.load_pack`.
|
|
19
|
+
- `src/jev_table/report.py` — `stats.json` + `stats.md`.
|
|
20
|
+
- `src/jev_table/cli.py` — wiring only.
|
|
21
|
+
- `tests/helpers.py` — `MockTransport`, pack/CSV builders.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
uv sync --all-groups
|
|
27
|
+
uv run ruff check .
|
|
28
|
+
uv run pytest
|
|
29
|
+
uv run jev-table examples/sms-triage/sample.csv --spec examples/sms-triage/pack.yaml --dry-run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Invariants
|
|
33
|
+
|
|
34
|
+
- Never send row data anywhere except the configured endpoint; no telemetry.
|
|
35
|
+
- `check`-style tests must pass without a key: mock the transport, never call
|
|
36
|
+
the live API in tests.
|
|
37
|
+
- Review semantics follow jev-packs `SPEC.md`: a label auto-accepts only above
|
|
38
|
+
its floor; no floor (or no thresholds) means review.
|
|
39
|
+
- Output columns are a stable interface: input columns + one per question
|
|
40
|
+
(+ `_confidence` for choice/score) + `review` + `error`.
|
|
41
|
+
- Spec parsing/validation is delegated to `jevassert.packs`
|
|
42
|
+
(`load_pack(..., require_cases=False)` — table specs are unlabeled). Do not
|
|
43
|
+
add a second parser here.
|
|
44
|
+
|
|
45
|
+
## Release
|
|
46
|
+
|
|
47
|
+
Tag `vX.Y.Z` on `master`; the `release.yml` workflow publishes to PyPI via
|
|
48
|
+
trusted publishing. Bump `__version__` in `src/jev_table/__init__.py` first.
|
|
49
|
+
|
|
50
|
+
No external promotion (HN/Reddit/social) without the owner's approval.
|
jev_table-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
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. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
jev_table-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: jev-table
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI columns for CSV files: classify every row with TypeSafe's Jev, with confidence, a review queue and a cost preview. Local-first, resumable, BYO key.
|
|
5
|
+
Project-URL: Homepage, https://github.com/dtduc-git/jev-table
|
|
6
|
+
Project-URL: Issues, https://github.com/dtduc-git/jev-table/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/dtduc-git/jev-table/releases
|
|
8
|
+
Author-email: Duke - Duc Dinh <dtduc.contact@gmail.com>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: classification,confidence,csv,data-cleaning,etl,jev,llm,typesafe
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: jevassert<0.2.0,>=0.1.0
|
|
25
|
+
Requires-Dist: typesafe-sdk<0.8.0,>=0.7.0
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# jev-table
|
|
29
|
+
|
|
30
|
+
[](https://github.com/dtduc-git/jev-table/actions/workflows/ci.yml)
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
|
|
33
|
+
AI columns for CSV files, backed by [TypeSafe's Jev](https://typesafe.ai):
|
|
34
|
+
label every row with **typed answers, probabilities and a review queue** —
|
|
35
|
+
deduplicated, resumable, with a cost preview before you spend anything.
|
|
36
|
+
|
|
37
|
+
> Independent community tool. Not affiliated with TypeSafe AI.
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
uvx jev-table messages.csv --spec pack.yaml --dry-run # estimate cost, send nothing
|
|
41
|
+
uvx jev-table messages.csv --spec pack.yaml # writes messages.jev.csv + stats
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| message | category | urgency | mentions_money | review |
|
|
45
|
+
|---|---|---|---|---|
|
|
46
|
+
| WINNER!! Claim your $500 gift card… | spam | high | 0.99 | |
|
|
47
|
+
| Your appointment is confirmed… | ham | normal | 0.02 | |
|
|
48
|
+
| [weird message] | | | | category;urgency |
|
|
49
|
+
|
|
50
|
+
## The column spec is a pack
|
|
51
|
+
|
|
52
|
+
Columns come from a [jev-packs](https://github.com/dtduc-git/jev-packs) pack
|
|
53
|
+
(format [spec v0](https://github.com/dtduc-git/jev-packs/blob/main/SPEC.md)) —
|
|
54
|
+
questions as data, no prompts in code:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
spec: 0
|
|
58
|
+
id: sms-triage
|
|
59
|
+
version: 0.1.0
|
|
60
|
+
license: CC0-1.0
|
|
61
|
+
tested: null
|
|
62
|
+
description: Label messages as spam/ham and score urgency.
|
|
63
|
+
state:
|
|
64
|
+
fields: [message] # CSV columns sent as the state
|
|
65
|
+
questions:
|
|
66
|
+
category:
|
|
67
|
+
type: choice
|
|
68
|
+
instructions: "Is `message` unsolicited commercial spam, or a message the recipient expects?"
|
|
69
|
+
options:
|
|
70
|
+
spam: "Unsolicited bulk or promotional message."
|
|
71
|
+
ham: "Personal, transactional or service message."
|
|
72
|
+
unknown: "Cannot tell from the message alone."
|
|
73
|
+
urgency:
|
|
74
|
+
type: score
|
|
75
|
+
instructions: "How soon does `message` need a human look?"
|
|
76
|
+
levels: [low, normal, high, unknown]
|
|
77
|
+
mentions_money:
|
|
78
|
+
type: noul
|
|
79
|
+
instructions: "Does `message` mention an amount of money or a payment?"
|
|
80
|
+
thresholds:
|
|
81
|
+
category: {spam: 0.8, ham: 0.8}
|
|
82
|
+
urgency: {low: 0.7, normal: 0.7, high: 0.7}
|
|
83
|
+
mentions_money: {true: 0.85, false: 0.85}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
See [`examples/sms-triage/`](examples/sms-triage/) for a runnable pair. Specs
|
|
87
|
+
are parsed by the same canonical loader the rest of the suite uses
|
|
88
|
+
(`jevassert.packs`); golden cases are optional for table specs.
|
|
89
|
+
|
|
90
|
+
## Review is the point
|
|
91
|
+
|
|
92
|
+
A label auto-accepts only when its probability clears its floor in
|
|
93
|
+
`thresholds`. Everything else — low probability, a label with no floor (like
|
|
94
|
+
`unknown`), or a question with no thresholds at all — lands in the `review`
|
|
95
|
+
column:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
data.jev.csv # your rows + answers + confidence + review + error
|
|
99
|
+
data.jev.corrections.csv # one row per flagged state (needs a human)
|
|
100
|
+
data.jev.stats.json/.md # cost, latency, automation rate, distributions
|
|
101
|
+
data.jev.cache.jsonl # resume cache (delete to force a full re-run)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`review` lists the flagged question ids (`category;urgency`), so you can filter
|
|
105
|
+
in any spreadsheet. `category_confidence` and `urgency_confidence` carry the
|
|
106
|
+
model's confidence for choice/score answers.
|
|
107
|
+
|
|
108
|
+
Fix a row by editing its answer cell, or delete the id from `review` to confirm
|
|
109
|
+
it as-is, then replay — corrected rows make no API calls and their flags clear:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
jev-table messages.csv --spec pack.yaml \
|
|
113
|
+
--corrections messages.jev.corrections.csv \
|
|
114
|
+
--emit-cases messages.jev.cases.jsonl
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`--emit-cases` writes the corrected rows as a `cases.jsonl` in jev-packs
|
|
118
|
+
format v0: a golden set you can hand to `jevassert record` for evidence. That
|
|
119
|
+
is the suite flywheel — jev-table labels, you review, jevassert measures,
|
|
120
|
+
jev-packs publishes.
|
|
121
|
+
|
|
122
|
+
## How it works
|
|
123
|
+
|
|
124
|
+
- **Dedupe** — identical rows (same state, questions and model) are sent once
|
|
125
|
+
and fanned back out. Duplicates are free, and corrections list one row per
|
|
126
|
+
unique state.
|
|
127
|
+
- **All questions, one call per row** — Jev evaluates every question in
|
|
128
|
+
parallel against one state; batching is [an order of magnitude cheaper and
|
|
129
|
+
faster](https://docs.typesafe.ai/cookbooks/parallel_questions) than one call
|
|
130
|
+
per question.
|
|
131
|
+
- **Resume** — every successful row is appended to the cache, so a rerun only
|
|
132
|
+
calls what's missing. Errors are never cached and are retried next run.
|
|
133
|
+
- **Concurrency** — 8 in-flight requests by default, auto-capped when states
|
|
134
|
+
are large so you stay under the token-rate limit. `--concurrency` overrides.
|
|
135
|
+
- **Cost preview** — `--dry-run` estimates tokens (chars/4) across the whole
|
|
136
|
+
input and prints expected dollars at $0.042/Mtok input (output is free);
|
|
137
|
+
every real run also reports actual vs estimated tokens.
|
|
138
|
+
- **Safety cap** — files over 10,000 rows need `--yes` after a dry run.
|
|
139
|
+
|
|
140
|
+
Retries and 429/529 backoff come from the official TypeSafe SDK.
|
|
141
|
+
|
|
142
|
+
## Privacy
|
|
143
|
+
|
|
144
|
+
Row data (only the `state.fields` you declared) is sent to the endpoint you
|
|
145
|
+
configure — `https://api.typesafe.ai` by default, or anything Jev-compatible
|
|
146
|
+
via `--base-url`. Nothing else leaves your machine: no telemetry, no analytics,
|
|
147
|
+
no uploads. `--dry-run` sends nothing at all. TypeSafe's
|
|
148
|
+
[data handling](https://docs.typesafe.ai/models#data-handling): requests are
|
|
149
|
+
not used for training.
|
|
150
|
+
|
|
151
|
+
## CLI
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
jev-table INPUT --spec SPEC [--out PATH] [--model NAME] [--base-url URL]
|
|
155
|
+
[--limit N] [--concurrency N] [--dry-run]
|
|
156
|
+
[--corrections PATH] [--emit-cases PATH] [--yes] [--no-cache]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`INPUT` is a CSV or a flat JSONL (scalar values only; JSONL keeps numbers and
|
|
160
|
+
booleans as-is in the state sent to Jev).
|
|
161
|
+
|
|
162
|
+
| flag | meaning |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `--spec` | pack.yaml file or its directory (required) |
|
|
165
|
+
| `--out` | output CSV (default `<input>.jev.csv`) |
|
|
166
|
+
| `--model` | Jev model or alias (default `jev-latest`; pin a version to freeze behavior) |
|
|
167
|
+
| `--base-url` | Jev-compatible endpoint (local replicas welcome) |
|
|
168
|
+
| `--limit N` | process the first N rows |
|
|
169
|
+
| `--dry-run` | estimate tokens/cost; sends nothing, needs no key |
|
|
170
|
+
| `--corrections PATH` | replay human edits from a `*.corrections.csv` (needs `_row`) |
|
|
171
|
+
| `--emit-cases PATH` | write corrected rows as `cases.jsonl` (jev-packs format v0) |
|
|
172
|
+
| `--yes` | allow more than 10,000 rows |
|
|
173
|
+
| `--no-cache` | disable the resume cache |
|
|
174
|
+
|
|
175
|
+
Exit codes: `0` done (review rows are fine), `1` at least one row errored,
|
|
176
|
+
`2` bad input or refused run. Requires `TYPESAFE_API_KEY` (any non-empty
|
|
177
|
+
value works for local endpoints).
|
|
178
|
+
|
|
179
|
+
## Non-goals
|
|
180
|
+
|
|
181
|
+
No web UI, no hosted service, no Excel/PDF (CSV in, CSV out), no auto-written
|
|
182
|
+
criteria, no telemetry. Columns come from the spec, never from prompts in code.
|
|
183
|
+
|
|
184
|
+
## jev-table vs jev-agent-tool
|
|
185
|
+
|
|
186
|
+
[`jev-agent-tool`](https://github.com/dtduc-git/jev-agent-tool) gives you the
|
|
187
|
+
primitive: `evaluate_batch` over 1–50 records. jev-table is the workflow on
|
|
188
|
+
top: dedupe, resume, cost preview, review queue, corrections and stats — for
|
|
189
|
+
whole files, not batches. If you are writing a script, use the primitive. If
|
|
190
|
+
you are labeling a spreadsheet, use jev-table.
|
|
191
|
+
|
|
192
|
+
## Development
|
|
193
|
+
|
|
194
|
+
```sh
|
|
195
|
+
uv sync --all-groups
|
|
196
|
+
uv run ruff check .
|
|
197
|
+
uv run pytest
|
|
198
|
+
uv run jev-table examples/sms-triage/sample.csv --spec examples/sms-triage/pack.yaml --dry-run
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
`jev-table` imports the pack loader from [`jevassert`](https://github.com/dtduc-git/jevassert)
|
|
202
|
+
(`jevassert.packs`). Locally, `uv sync` resolves it from the sibling checkout
|
|
203
|
+
via `[tool.uv.sources]`; CI resolves it from PyPI (`uv sync --no-sources`), so
|
|
204
|
+
`jevassert` must be published before CI can run.
|
|
205
|
+
|
|
206
|
+
Live smoke against the public UCI SMS Spam dataset (which ships gold labels):
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
python scripts/fetch_sms_spam.py sms-spam-sample.csv 200
|
|
210
|
+
TYPESAFE_API_KEY=... uv run jev-table sms-spam-sample.csv --spec examples/sms-triage/pack.yaml
|
|
211
|
+
uv run python scripts/report_accuracy.py sms-spam-sample.jev.csv --question category
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Releases: push a `v*` tag; GitHub Actions builds and publishes to PyPI via
|
|
215
|
+
trusted publishing.
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
Apache-2.0. The SMS Spam Collection dataset is CC BY 4.0 (Almeida et al.,
|
|
220
|
+
2011) and fetched, never vendored.
|