voteworth 0.1.2__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 (32) hide show
  1. voteworth-0.1.2/.github/dependabot.yml +10 -0
  2. voteworth-0.1.2/.github/workflows/ci.yml +80 -0
  3. voteworth-0.1.2/.github/workflows/publish.yml +58 -0
  4. voteworth-0.1.2/.gitignore +9 -0
  5. voteworth-0.1.2/CITATION.cff +52 -0
  6. voteworth-0.1.2/LICENSE +190 -0
  7. voteworth-0.1.2/MANIFEST.in +20 -0
  8. voteworth-0.1.2/NOTICE +38 -0
  9. voteworth-0.1.2/PKG-INFO +350 -0
  10. voteworth-0.1.2/README.md +323 -0
  11. voteworth-0.1.2/examples/quickstart.py +21 -0
  12. voteworth-0.1.2/pyproject.toml +61 -0
  13. voteworth-0.1.2/setup.cfg +4 -0
  14. voteworth-0.1.2/src/voteworth/__init__.py +33 -0
  15. voteworth-0.1.2/src/voteworth/aggregate.py +327 -0
  16. voteworth-0.1.2/src/voteworth/data/panel_10_voters.json +2039 -0
  17. voteworth-0.1.2/src/voteworth/demo.py +224 -0
  18. voteworth-0.1.2/src/voteworth.egg-info/PKG-INFO +350 -0
  19. voteworth-0.1.2/src/voteworth.egg-info/SOURCES.txt +30 -0
  20. voteworth-0.1.2/src/voteworth.egg-info/dependency_links.txt +1 -0
  21. voteworth-0.1.2/src/voteworth.egg-info/requires.txt +7 -0
  22. voteworth-0.1.2/src/voteworth.egg-info/top_level.txt +1 -0
  23. voteworth-0.1.2/tests/shipped.py +225 -0
  24. voteworth-0.1.2/tests/test_aggregate.py +493 -0
  25. voteworth-0.1.2/tests/test_bundled_data_integrity.py +139 -0
  26. voteworth-0.1.2/tests/test_caveat_survives_visibility.py +215 -0
  27. voteworth-0.1.2/tests/test_claims_are_bound.py +219 -0
  28. voteworth-0.1.2/tests/test_gates_assert.py +451 -0
  29. voteworth-0.1.2/tests/test_mutation.py +136 -0
  30. voteworth-0.1.2/tests/test_no_novelty_claim.py +225 -0
  31. voteworth-0.1.2/tests/test_no_submission_attribution.py +152 -0
  32. voteworth-0.1.2/tests/test_readme_claims.py +499 -0
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ # Keeps the pinned GitHub Actions current. Python dependencies are left
4
+ # out on purpose: the only runtime dependency is numpy, and its lower bound
5
+ # is a choice for the users of the library, not something to raise
6
+ # automatically.
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,80 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ # Arm 1 — the repository as a contributor sees it.
14
+ checkout:
15
+ # Python 3.9 is not built for Ubuntu 26.04 (actions/python-versions manifest, read 2026-11-13: 3.9.25
16
+ # exists for 22.04 and 24.04 only), and `requires-python = ">=3.9"` still promises it. So that one leg
17
+ # stays on 24.04; the others follow ubuntu-latest.
18
+ runs-on: ${{ matrix.python-version == '3.9' && 'ubuntu-24.04' || 'ubuntu-latest' }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ python-version: ["3.9", "3.11", "3.13"]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-python@v7
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install
31
+ run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]"
32
+
33
+ # The unit tests, the mutation gate (which proves they can fail) and the README checks
34
+ # all run here. The mutation gate forks a pytest per mutation, so this job is a little
35
+ # slower than the suite alone — that is the cost of knowing the alarm works.
36
+ - name: Test
37
+ run: pytest -q
38
+
39
+ - name: Demo runs as advertised
40
+ run: python -m voteworth.demo
41
+
42
+ # Arm 2 — the artefact a stranger downloads. This job exists because arm 1 cannot see the
43
+ # difference: it installs the working tree, so a file missing from the built distribution is
44
+ # invisible to it. Measured 2026-09-21 on a built sdist: `tests/shipped.py` was not packaged,
45
+ # every prohibition gate imports it, and `pytest` stopped at "Interrupted: 2 errors during
46
+ # collection" — zero of 123 tests ran, while the README promised they could all be run. A
47
+ # control arm that takes a different path from the claim controls nothing.
48
+ artefact:
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ - uses: actions/setup-python@v7
53
+ with:
54
+ python-version: "3.11"
55
+
56
+ - name: Build the distribution
57
+ run: python -m pip install --upgrade pip build && python -m build
58
+
59
+ - name: The sdist must contain every file in the tree
60
+ run: |
61
+ tar tzf dist/*.tar.gz | sed 's|^[^/]*/||' | grep -v '/$' | LC_ALL=C sort -u > /tmp/shipped
62
+ git ls-files | LC_ALL=C sort > /tmp/tracked
63
+ missing=$(comm -23 /tmp/tracked /tmp/shipped)
64
+ if [ -n "$missing" ]; then
65
+ echo "these tracked files are missing from the sdist:"; echo "$missing"; exit 1
66
+ fi
67
+
68
+ - name: The suite must pass inside the unpacked sdist
69
+ run: |
70
+ mkdir -p /tmp/sdist && tar xzf dist/*.tar.gz -C /tmp/sdist --strip-components=1
71
+ cd /tmp/sdist
72
+ python -m pip install ".[dev]"
73
+ pytest -q
74
+
75
+ - name: The wheel must run the demo with no source tree in sight
76
+ run: |
77
+ mkdir -p /tmp/elsewhere && cd /tmp/elsewhere
78
+ python -m pip install "$GITHUB_WORKSPACE"/dist/*.whl
79
+ python -m voteworth.demo | tee out.txt
80
+ grep -q INERT out.txt
@@ -0,0 +1,58 @@
1
+ name: publish
2
+
3
+ # Publishes a GitHub release to PyPI with Trusted Publishing (OIDC). No token is stored
4
+ # anywhere: PyPI accepts the upload because it comes from this workflow, in this repository,
5
+ # in the environment named below. The PyPI side is a publisher for project "voteworth" with
6
+ # owner "zensation-ai", repository "voteworth", workflow "publish.yml", environment "pypi".
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.11"
23
+
24
+ # v0.1.1 shipped with __version__ still at 0.1.0, because only pyproject.toml was raised.
25
+ # A release now stops unless the tag, the metadata and the code name the same version.
26
+ - name: Tag, pyproject.toml and __version__ must agree
27
+ run: |
28
+ tag="${GITHUB_REF_NAME#v}"
29
+ meta=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
30
+ code=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' src/voteworth/__init__.py)
31
+ echo "tag=$tag pyproject=$meta __version__=$code"
32
+ test "$tag" = "$meta" && test "$meta" = "$code"
33
+
34
+ - name: Build and check the distribution
35
+ run: |
36
+ python -m pip install --upgrade pip build twine
37
+ python -m build
38
+ python -m twine check --strict dist/*
39
+
40
+ - uses: actions/upload-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+
45
+ publish:
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ environment:
49
+ name: pypi
50
+ url: https://pypi.org/project/voteworth/
51
+ permissions:
52
+ id-token: write
53
+ steps:
54
+ - uses: actions/download-artifact@v4
55
+ with:
56
+ name: dist
57
+ path: dist/
58
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ *.egg-info/
6
+ build/
7
+ dist/
8
+ .pytest_cache/
9
+ .DS_Store
@@ -0,0 +1,52 @@
1
+ cff-version: 1.2.0
2
+ title: "voteworth: how many independent votes your LLM judge panel is actually worth"
3
+ message: "If you use this software, please cite the measurement note below."
4
+ type: software
5
+ authors:
6
+ - given-names: Alexander
7
+ family-names: Bering
8
+ orcid: "https://orcid.org/0009-0001-1793-012X"
9
+ affiliation: "Zensation AI"
10
+ license: Apache-2.0
11
+ version: 0.1.2
12
+ date-released: 2026-11-15
13
+ repository-code: "https://github.com/zensation-ai/voteworth"
14
+ abstract: >
15
+ Measures whether an LLM voter or judge panel can produce an independent majority, corrects
16
+ the vote for correlated voters, and reports when it cannot. Voters drawn from the same model
17
+ share their error modes, so a correlated bloc can win a plain majority while being wrong and
18
+ have its agreement read as confidence. The package learns a per-voter independence weight
19
+ from a vote history, or derives one from provenance labels when no history exists. It states
20
+ its own boundary: on a panel that is one model throughout, the correction is provably inert.
21
+ keywords:
22
+ - llm-as-judge
23
+ - self-consistency
24
+ - majority voting
25
+ - ensemble
26
+ - calibration
27
+ - overconfidence
28
+ references:
29
+ - type: article
30
+ title: "Reweighting Correlated Voters Does Not Repair Agreement Confidence: Structural Inertness and a Recalibration Control"
31
+ authors:
32
+ - given-names: Alexander
33
+ family-names: Bering
34
+ orcid: "https://orcid.org/0009-0001-1793-012X"
35
+ year: 2026
36
+ doi: "10.5281/zenodo.21775275"
37
+ - type: data
38
+ title: "Agreement-Confidence Reanalysis: Vote Matrix and Screen"
39
+ authors:
40
+ - given-names: Alexander
41
+ family-names: Bering
42
+ orcid: "https://orcid.org/0009-0001-1793-012X"
43
+ year: 2026
44
+ doi: "10.5281/zenodo.21773065"
45
+ - type: article
46
+ title: "Four Independence Invariants for Judgment-Quality Measurement in Agent Memory: A Specification"
47
+ authors:
48
+ - given-names: Alexander
49
+ family-names: Bering
50
+ orcid: "https://orcid.org/0009-0001-1793-012X"
51
+ year: 2026
52
+ doi: "10.5281/zenodo.22012189"
@@ -0,0 +1,190 @@
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 the 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 the 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 any 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
+ Copyright 2026 Alexander Bering / ZenSation Enterprise Solutions
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,20 @@
1
+ # What the source distribution carries beyond the package itself.
2
+ #
3
+ # Without this file setuptools applies its own defaults, and those defaults ship `tests/test*.py`
4
+ # but not `tests/shipped.py` — a helper every prohibition gate imports. Measured 2026-09-21 on a
5
+ # built artefact: nine test files arrived, their shared import did not, and `pytest` stopped at
6
+ # "Interrupted: 2 errors during collection". Zero of 123 tests ran, while the README promised
7
+ # that every behavioural claim could be checked by running them.
8
+ #
9
+ # The rule this encodes: the README's verification table names files, so those files ship.
10
+ # The repo-only files ship too, so that the gates below walk the SAME surface in both
11
+ # channels. Teaching them to expect two different trees would put the control arm on a
12
+ # different path from the thing it controls — and the sdist is then no longer the repo.
13
+ include .gitignore
14
+ recursive-include .github *.yml
15
+
16
+ include CITATION.cff
17
+ include NOTICE
18
+ include MANIFEST.in
19
+ recursive-include tests *.py
20
+ recursive-include examples *.py
voteworth-0.1.2/NOTICE ADDED
@@ -0,0 +1,38 @@
1
+ voteworth
2
+ Copyright 2026 Alexander Bering
3
+
4
+ This product includes software developed by Alexander Bering.
5
+
6
+ The bundled vote matrix at
7
+ src/voteworth/data/panel_10_voters.json
8
+ is published separately under CC BY 4.0 as
9
+
10
+ Agreement-Confidence Reanalysis: Vote Matrix and Screen
11
+ https://doi.org/10.5281/zenodo.21773065
12
+
13
+ and is redistributed here under that licence. Attribution as above.
14
+
15
+ Its SHA-256, so that a reader can verify this copy is the published one without trusting
16
+ this package:
17
+
18
+ c7fc46d61f239a53852a508100e1d5774ea4d3490e9a024f9786c578317239d2 src/voteworth/data/panel_10_voters.json
19
+
20
+ Two things the record page will not tell you. Both were found on 2026-09-21 by someone
21
+ following the older wording of this paragraph and failing:
22
+
23
+ * On Zenodo the file is called core2_writers_n10_100K.json. It is renamed here for
24
+ readability. The bytes are unchanged — that is what the hash above shows.
25
+ * Zenodo lists an MD5 beside each file, not a SHA-256. Comparing the value above against
26
+ the one on the record page cannot match: they are different algorithms, and a reader who
27
+ tries it learns nothing about this copy.
28
+
29
+ The record carries its own SHA256.txt beside the data. That is the file to compare against:
30
+
31
+ curl -s https://zenodo.org/api/records/21773066/files/SHA256.txt/content
32
+
33
+ It lists one line per file in the record. The line ending in core2_writers_n10_100K.json must
34
+ carry exactly the hash printed above. If it differs, this copy has been altered and its
35
+ numbers should not be used.
36
+
37
+ (Record 21773066 is the version behind the concept DOI 10.5281/zenodo.21773065 above; Zenodo
38
+ resolves the concept DOI to the latest version, which is this one.)