Giuliocc commited on
Commit
4437ddb
·
verified ·
1 Parent(s): 4769513

DOXA v0.1.0 engineering preview

Browse files
BUILD_PLAN.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DOXA measurement foundation
2
+
3
+ ## Scope and milestones
4
+
5
+ 1. **Methods.** Publish versioned measures with estimands, exclusions,
6
+ references and executable scoring. The first audit compares how the same
7
+ source presents similar claims about different actors.
8
+ 2. **Benchmark.** Ship fictional developmental dossiers and real public-law
9
+ evidence context with clear provenance. Keep entire dossiers together.
10
+ Publish independent annotations and the locked test only after review.
11
+ 3. **Scorecard.** Expose eligible pairs, numerator and denominator for each
12
+ role, exclusions, unresolved items and event-level sensitivity. Keep
13
+ browser inputs local.
14
+ 4. **Model.** Fit CPU passage-only and context-aware controls, publish
15
+ non-executable weights, predictions and failure diagnostics. Finish a
16
+ repeatable learning/evaluation interface for future reviewed data.
17
+ 5. **Service and review.** Implement and test a loopback API contract.
18
+ Require methods review, independent annotations, and engineer
19
+ reproduction before claims about real-world bias or production rollout.
20
+
21
+ ## External gates
22
+
23
+ A real-world publication needs a licensed matched sample, two independent
24
+ human judgments per reference and an adjudication record when they disagree.
25
+ A separate methods reviewer approves the estimand, and an engineer who did
26
+ not implement the scorer reproduces the released results. These jobs cannot
27
+ be supplied by artificial reviewer names, automatic checks or model scores.
28
+
29
+ Only free public Hub storage and Static Spaces are authorized for this work.
30
+ The production rollout needs authentication, tenant isolation, documented
31
+ retention and deletion, independent validation, and authorization to deploy
32
+ under doxa.tacitus.me. The release can exercise the service contract on a
33
+ local machine without making it a public inference endpoint.
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.
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: DOXA Methods
3
+ license: apache-2.0
4
+ tags:
5
+ - political-discourse
6
+ - research-methods
7
+ - text-analysis
8
+ configs:
9
+ - config_name: measures
10
+ default: true
11
+ data_files:
12
+ - split: registry
13
+ path: methods.parquet
14
+ ---
15
+
16
+ # DOXA Methods by TACITUS
17
+
18
+ Three executable measures for political discourse research. Compare
19
+ evidence standards across matched claims, record loaded wording and
20
+ report frame prevalence. The registry defines each unit, denominator,
21
+ exclusions and academic references. The scorer reports both resolved
22
+ observations and explicit bounds for unresolved judgments.
23
+
24
+ **Development foundation.** This release provides a fictional example,
25
+ a locally runnable review service and a gate that requires recorded
26
+ independent sign-off. It includes no real-world bias estimate.
27
+
28
+ ## Run the example
29
+
30
+ ```python
31
+ import json
32
+ import sys
33
+ sys.path.insert(0, "tools")
34
+ from methods import compare
35
+ pairs = json.load(open("example/audit_pairs.json"))
36
+ report = compare(pairs)
37
+ assert report["eligible_pairs"] == 20
38
+ assert report["complete_pairs"] == 16
39
+ print(report["gap_bounds"])
40
+ ```
41
+
42
+ The 20 eligible pairs have 16 fully resolved pairs. The possible gap
43
+ of 40–60 percentage points was deliberately constructed from fictional
44
+ inputs. Five other pairs demonstrate rejected controls. A normative
45
+ position is outside this factual-claim comparison.
46
+
47
+ Read [the review protocol](docs/review.md), [annotation rubric](docs/annotation.md),
48
+ [service contract](docs/service.md), [build plan](BUILD_PLAN.md) and
49
+ [benchmark registration notes](docs/eval-registration.md). Start the service
50
+ with the uploaded model bundle and Python. No extra libraries are needed
51
+ for serving. Fitting and Parquet preparation use the listed dependencies.
52
+ The [reproduction guide](docs/reproduce.md) walks through the tested build
53
+ from a fresh checkout.
54
+
55
+ The measure designs draw on framing, informational bias, contextual
56
+ detection and construct validity research. See the references on each
57
+ method card. [TACITUS.me](https://tacitus.me)
58
+
59
+ - [Methods and source](https://huggingface.co/datasets/Giuliocc/doxa-methods)
60
+ - [Development benchmark](https://huggingface.co/datasets/Giuliocc/doxa-bias-bench)
61
+ - [CPU evidence model](https://huggingface.co/Giuliocc/doxa-evidence-model)
62
+ - [Interactive scorecard](https://huggingface.co/spaces/Giuliocc/doxa-scorecard)
SHA256SUMS ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ d949b7151d602f5ad86ff8599021e2f18a40a22728b4e22f0968cb9772b62a88 BUILD_PLAN.md
2
+ cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
3
+ 2023f12034061881d3431a3e0326d95d2c2bc1db891e311888c59c98ca557ca9 README.md
4
+ 65be529f2fe8a20bfc12b3738a9da54bc5cfc9697303eec63d899308bc26dc6e docs/annotation.md
5
+ 5f8495f5776aa33134b991318abd55b18dc46a0043f772029dc162accbb55b1b docs/eval-registration.md
6
+ 8b641df396cc0b92dd483ef54c60d168e2cf47be56084cb7f95d08e6661c8fa2 docs/openapi.yaml
7
+ 522063116bced7ab16c42c0b2a1bc0e849c1884ed2010a70341ebd8fa22f0560 docs/reproduce.md
8
+ 3ec365c5bfb597c7cc556fae5a92d248b6fecee98a7c63512791bf13ca69557a docs/review.md
9
+ 3ff94637a41d1762d7b53a39409e2d727e8a31943dfbc80cec9b2ed2f9556ccb docs/service.md
10
+ 43dbb97b1e7652c79ba34f5d1fd0627e22f14ca15d01f000004e53dd35348101 example/audit_pairs.json
11
+ 2bcd3f4b9ff610ac1e2571ab05712e8d8bec9f9320a0b7e4c5c4672e14c726a4 example/review_status.json
12
+ ec84b6723ea45e75b85f7480b5bce3d036f68e52bd27cf09243328ba8e0dfb63 example/scorecard.json
13
+ 993ffd003d4d9c75e8b1193bfb51210f796ae4a83d82a5c3fc63f87baddf5ad1 methods.json
14
+ b83a9d5df1f9cf386d6aa59e8614192e3aba587224eca4194e05fe770f7f047f methods.parquet
15
+ e54000a06cd04623023b2ed0ab328ae31b8fb00a4e32736cf45f6cea23a316bd requirements.txt
16
+ 140f57fae646954dd885264954f875bb8235d0154e322777b859e2ff01df313e tests/test_pipeline.py
17
+ a79c388c0f668342636ecc13c2f68caa29aeb7af8d5f9d9b0ef8bb7456ee943c tools/build_data.py
18
+ 1e1768f1cfd1e8551749de48ddabb31b05bf735dbc11f00cbfcb6335939837c8 tools/challenge.py
19
+ 41d08acb19e4fba965e7b18d3fa0165cf9ac6c488bb364b8db399a3f4b26b03f tools/corpus/context_challenge.tsv
20
+ 7fd6a664e17c84264919d3081886b79cb8eece2d553f83839d336f7244410e5e tools/corpus/dossiers.tsv
21
+ efa93b1bc01d16f7ac7789b6168104feead76c96c74fdea6d1a11a0a90ebffac tools/evidence_model.py
22
+ ed5311de5ca1f3a8c64d0ec7f7a0e8ac61e355a4ab580181d7ef88dd9c315d5a tools/methods.py
23
+ b1d8728e365f4e01be8528f5b805ef332810bf90f2676b3026310cb5a7170e05 tools/review.py
24
+ 41e26c2975de23252780313664ef8aa69ba1fe399357a6ab1b38e42960e44cd7 tools/service.py
docs/annotation.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Presentation of evidence rubric v0.1
2
+
3
+ For the active speaker and claim, choose **asserted**, **attributed**,
4
+ **qualified**, or **insufficient context**. An assertive sentence in an
5
+ excerpt may be a quotation in the referring document. Preserve the
6
+ distinction. Record the exact span conveying adoption, attribution or
7
+ qualification, scope and context. When no context can settle the scope,
8
+ record an unresolved reference. The reference cue may identify what
9
+ context is absent. It does not verify the underlying claim.
10
+
11
+ An audit compares already identified factual claims with comparable
12
+ available evidence. Eligibility is independent of the prediction.
13
+ A criticism or preference on policy is outside that evidence-standard
14
+ comparison. Multiple frames may describe one paragraph. Loaded wording
15
+ requires the exact term, speaker and target. Use distinct measures for
16
+ individual or group prejudice and preserve negative controls such as
17
+ quotation, rebuttal and legitimate dissent.
18
+
19
+ Keep uncertainty separate from severity, outcome and political affiliation.
20
+ A difference can reflect sampling, genre, access to evidence, or editorial
21
+ selection. It is a description of the reviewed sample, without evidence
22
+ of intent or an outlet-wide ideology.
docs/eval-registration.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face benchmark registration
2
+
3
+ The development checks are executable today. Registration of a native
4
+ leaderboard follows the reviewed reference release. Keep `eval.yaml` as
5
+ a draft until the necessary dataset, scorer and human review are linked.
6
+ Submit the benchmark to the Hub beta allow-list using its documented
7
+ process. The development result has no verified badge.
8
+
9
+ Use distinct task IDs for presentation classification, paired context
10
+ changes, and extractive evidence. Score class macro-F1, both decisions
11
+ correct, and exact decision plus span as separate values. Report coverage
12
+ alongside them. Pin both the scorer and the dataset snapshot. Include
13
+ raw predictions and a link to the evaluator with Hub result submissions.
14
+
15
+ The public example configuration must exclude gold labels, evidence,
16
+ rationales and other reference metadata from model inputs. Retain the
17
+ later evaluation set separately until needed for reproducibility.
18
+ An evaluation runner can feed only passage and context, then join with
19
+ opaque unit IDs offline.
20
+
21
+ The published evaluation shows what currently fails. A higher development
22
+ score on shared templates cannot establish production accuracy. Review
23
+ real cases and report particular failures before publishing a model as
24
+ a service for analysis of political discourse.
25
+
26
+ [Hugging Face evaluation registration](https://huggingface.co/docs/hub/en/eval-results)
docs/openapi.yaml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openapi: 3.1.0
2
+ info:
3
+ title: DOXA development service
4
+ version: "0.1.0"
5
+ servers:
6
+ - url: http://127.0.0.1:9010
7
+ paths:
8
+ /health:
9
+ get:
10
+ responses:
11
+ "200":
12
+ description: Development service and artifact revisions
13
+ /v1/predict:
14
+ post:
15
+ requestBody:
16
+ required: true
17
+ content:
18
+ application/json:
19
+ schema:
20
+ type: object
21
+ required: [claim_type, text]
22
+ properties:
23
+ claim_type:
24
+ type: string
25
+ text:
26
+ type: string
27
+ minLength: 1
28
+ maxLength: 6000
29
+ context:
30
+ type: string
31
+ maxLength: 6000
32
+ responses:
33
+ "200":
34
+ description: Decision, abstention or out-of-scope with optional extractive evidence
35
+ "400":
36
+ description: Invalid input
37
+ "413":
38
+ description: Body larger than 1 MiB
39
+ "415":
40
+ description: JSON required
41
+ /v1/scorecard:
42
+ post:
43
+ requestBody:
44
+ required: true
45
+ content:
46
+ application/json:
47
+ schema:
48
+ type: object
49
+ required: [pairs]
50
+ properties:
51
+ pairs:
52
+ type: array
53
+ minItems: 1
54
+ maxItems: 200
55
+ items:
56
+ type: object
57
+ required: [pair_id, left, right]
58
+ responses:
59
+ "200":
60
+ description: Audited numerator, denominator, uncertainty bounds and exclusions
61
+ "400":
62
+ description: Invalid input
63
+ "413":
64
+ description: Body larger than 1 MiB
65
+ "415":
66
+ description: JSON required
docs/reproduce.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reproduce from the public files
2
+
3
+ Use Python and download the methods repository and the public-law evidence
4
+ table from Conflict Context v0.1.1. The command below intentionally downloads
5
+ one small table, rather than all event shards. Run these commands from the
6
+ methods checkout with a Python environment containing requirements.txt.
7
+
8
+ ```sh
9
+ hf download Giuliocc/doxa-conflict-context passages.parquet --repo-type dataset --revision v0.1.1 --local-dir evidence
10
+ python tools/build_data.py --evidence evidence/passages.parquet
11
+ python tools/evidence_model.py
12
+ python tools/challenge.py
13
+ python tools/review.py
14
+ python -m pytest -q tests
15
+ ```
16
+
17
+ Each script writes to tools/work by default. Expected example results are
18
+ 20 eligible comparisons and 16 fully resolved. There are 200 generated
19
+ development rows grouped by 20 dossiers. The authored context challenge
20
+ contains 16 rows. The gate for a human-reviewed release returns false
21
+ without recorded authentic provenance and independent sign-off.
22
+
23
+ For browser arithmetic parity, compare the result of the Space module
24
+ `score.mjs` with `example/scorecard.json`. The browser reports descriptive
25
+ bounds. The Python scorer additionally computes an event-cluster
26
+ resampling interval for fully resolved pairs when enough clusters exist.
27
+ The interval on a fictional fixture has no inferential interpretation.
docs/review.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Independent review packet
2
+
3
+ ## Compare before counting
4
+
5
+ Sign off on a sampling frame, comparators, unit and evidence cut-off before
6
+ annotation. A comparable observation has the same event, genre, claim type,
7
+ evidence tier and source policy. Specify which role is left and why. Reject
8
+ pairs with materially different claims or support even when metadata matches.
9
+ An eligible pair needs human judgment about comparability. Automated checks
10
+ catch structural errors, while the methods reviewer must establish validity.
11
+
12
+ ## Record decisions independently
13
+
14
+ For each text unit, retain passage, adjacent context, date, event, speaker,
15
+ target, source identifier, redistributable rights and exact evidence
16
+ offsets. Use two independently assigned reviewers. Keep the individual
17
+ judgments, and an adjudicator's decision and rationale when they disagree.
18
+ Document reviewer training, exclusions and counts. Publish raw agreement
19
+ and label disagreement patterns. Distinguish AI-provisional, adjudicated
20
+ and held-out challenge rows.
21
+
22
+ ## Require a reproducible reviewed release
23
+
24
+ The independent methods reviewer signs off on the research question,
25
+ matching, unknown handling and claims. A second person who did not write
26
+ the scorer runs the revision from a clean checkout and checks provenance,
27
+ leakage, duplicate units, evidence offsets and effect estimates. Review
28
+ records must include role, distinct reviewer ID, approval, recorded date
29
+ and canonical reference SHA-256. Obtain actual sign-off outside this
30
+ tool. Its gate validates supplied records and cannot authenticate people.
31
+ The publisher only permits engineering previews here.
32
+
33
+ Hold out complete events, near duplicates, copied quotations and later
34
+ reports before fine-tuning. Reserve updated test material outside development.
35
+ Report interval sensitivity, unresolved bounds, coverage and worst
36
+ failures with each metric. Any future material omission measure needs
37
+ facts demonstrably available by publication and a defensible expectation
38
+ that the genre should have included them.
docs/service.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DOXA service contract
2
+
3
+ Run the development prototype on the same machine as the client.
4
+
5
+ ```sh
6
+ python tools/service.py --model model.json --port 9010
7
+ curl http://127.0.0.1:9010/health
8
+ curl -H 'Content-Type: application/json' http://127.0.0.1:9010/v1/predict \
9
+ -d '{"claim_type":"budget","text":"The director said the repair grant covered the listed buildings.","context":"The publication reports the director’s statement. Payment logs were not supplied."}'
10
+ ```
11
+
12
+ - `GET /health` returns service, methods and model revision.
13
+ - `POST /v1/predict` takes `claim_type`, `text` and optional `context`.
14
+ Scope is analyst-supplied. Unknown scope or ordinary advocacy can be
15
+ out of scope. Each segment permits 6,000 Unicode characters.
16
+ - `POST /v1/scorecard` accepts an object with `pairs`. It applies fixed
17
+ matching and bounds to 1–200 supplied pairs. Labels are treated as
18
+ supplied annotations with unverified provenance. It does not convert
19
+ predictions into empirical results.
20
+ - Invalid input can return 400, long bodies 413, and non-JSON 415.
21
+ Responses use `Cache-Control: no-store`. This prototype binds to
22
+ loopback, writes no request logs and persists no input.
23
+ - A returned evidence quote is an extractive model candidate. The quote
24
+ matches its segment at the given code-point offsets. The model makes
25
+ no independent fact finding or assessment of a person's beliefs.
26
+
27
+ ## Deployment on doxa.tacitus.me
28
+
29
+ Keep retrieval, inference, aggregation and reviewer approval distinct.
30
+ Store model and measure revisions with every decision. Production use
31
+ requires authenticated API access, TLS, tenant authorization, managed
32
+ secret storage, privacy and retention decisions, request budgets, deletion,
33
+ monitoring and independently reviewed real-domain evaluation. Acceptable
34
+ use covers textual review, criticism and appeal. Prejudicial language
35
+ rubrics and publication policies need domain approval.
36
+
37
+ Use a held-out set and monitor error by genre, topic and source when
38
+ considering a rollout. Perform load, abuse and cross-tenant isolation
39
+ tests before production. The public Static Space runs inspection in the
40
+ browser. The local Python service remains a development interface.
example/audit_pairs.json ADDED
@@ -0,0 +1,1467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "pair_id": "c03e6ac986faafadef",
4
+ "left": {
5
+ "unit_id": "d26598abe0d8006f9f",
6
+ "event_id": "housing-pilot",
7
+ "beat": "housing",
8
+ "claim_type": "service_effect",
9
+ "role": "left",
10
+ "actor": "North Borough Housing Committee",
11
+ "source_cohort": "fictional-desk",
12
+ "genre": "report",
13
+ "published_at": "2024-07-02T12:00:00Z",
14
+ "evidence_available_at": "2024-07-02T09:00:00Z",
15
+ "evidence_status": "uncorroborated",
16
+ "source_url": null,
17
+ "text": "The rent advice pilot reduced filing delays. The changes are visible in the current period.",
18
+ "context": "The fictional municipal review compares initial filings from the same intake month. Staff have supplied headline counts without a measure of participant mix.",
19
+ "family": "matched_claim",
20
+ "split": "development_test",
21
+ "label": "asserted",
22
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
23
+ "origin": "fictional",
24
+ "annotation_status": "ai_provisional",
25
+ "reference_span": {
26
+ "segment": "passage",
27
+ "start": 0,
28
+ "end": 44,
29
+ "quote": "The rent advice pilot reduced filing delays."
30
+ }
31
+ },
32
+ "right": {
33
+ "unit_id": "f5f20cdb4d37003a8f",
34
+ "event_id": "housing-pilot",
35
+ "beat": "housing",
36
+ "claim_type": "service_effect",
37
+ "role": "right",
38
+ "actor": "River District Housing Office",
39
+ "source_cohort": "fictional-desk",
40
+ "genre": "report",
41
+ "published_at": "2024-07-02T12:00:00Z",
42
+ "evidence_available_at": "2024-07-02T09:00:00Z",
43
+ "evidence_status": "uncorroborated",
44
+ "source_url": null,
45
+ "text": "River District Housing Office announced that the landlord mediation pilot reduced filing delays. The review is still open.",
46
+ "context": "The fictional municipal review compares initial filings from the same intake month. Staff have supplied headline counts without a measure of participant mix.",
47
+ "family": "matched_claim",
48
+ "split": "development_test",
49
+ "label": "attributed",
50
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
51
+ "origin": "fictional",
52
+ "annotation_status": "ai_provisional",
53
+ "reference_span": {
54
+ "segment": "passage",
55
+ "start": 0,
56
+ "end": 96,
57
+ "quote": "River District Housing Office announced that the landlord mediation pilot reduced filing delays."
58
+ }
59
+ }
60
+ },
61
+ {
62
+ "pair_id": "7bf10eb02bf3a89858",
63
+ "left": {
64
+ "unit_id": "f945410c0d4f0b1d83",
65
+ "event_id": "shelter-capacity",
66
+ "beat": "housing",
67
+ "claim_type": "capacity",
68
+ "role": "left",
69
+ "actor": "Old Market Council",
70
+ "source_cohort": "fictional-desk",
71
+ "genre": "report",
72
+ "published_at": "2024-07-02T12:00:00Z",
73
+ "evidence_available_at": "2024-07-02T09:00:00Z",
74
+ "evidence_status": "uncorroborated",
75
+ "source_url": null,
76
+ "text": "The converted library can serve 80 people overnight. The changes are visible in the current period.",
77
+ "context": "Both committees circulated estimated bed capacities before fire and accessibility inspections concluded.",
78
+ "family": "matched_claim",
79
+ "split": "train",
80
+ "label": "asserted",
81
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
82
+ "origin": "fictional",
83
+ "annotation_status": "ai_provisional",
84
+ "reference_span": {
85
+ "segment": "passage",
86
+ "start": 0,
87
+ "end": 52,
88
+ "quote": "The converted library can serve 80 people overnight."
89
+ }
90
+ },
91
+ "right": {
92
+ "unit_id": "9d287641ff1dcadbc5",
93
+ "event_id": "shelter-capacity",
94
+ "beat": "housing",
95
+ "claim_type": "capacity",
96
+ "role": "right",
97
+ "actor": "Lakeside Council",
98
+ "source_cohort": "fictional-desk",
99
+ "genre": "report",
100
+ "published_at": "2024-07-02T12:00:00Z",
101
+ "evidence_available_at": "2024-07-02T09:00:00Z",
102
+ "evidence_status": "uncorroborated",
103
+ "source_url": null,
104
+ "text": "Lakeside Council announced that the converted depot can serve 80 people overnight. The review is still open.",
105
+ "context": "Both committees circulated estimated bed capacities before fire and accessibility inspections concluded.",
106
+ "family": "matched_claim",
107
+ "split": "train",
108
+ "label": "attributed",
109
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
110
+ "origin": "fictional",
111
+ "annotation_status": "ai_provisional",
112
+ "reference_span": {
113
+ "segment": "passage",
114
+ "start": 0,
115
+ "end": 82,
116
+ "quote": "Lakeside Council announced that the converted depot can serve 80 people overnight."
117
+ }
118
+ }
119
+ },
120
+ {
121
+ "pair_id": "0ab6941e2e8681e898",
122
+ "left": {
123
+ "unit_id": "3bf20008d613b1a73f",
124
+ "event_id": "repair-grants",
125
+ "beat": "housing",
126
+ "claim_type": "budget",
127
+ "role": "left",
128
+ "actor": "Dune Housing Board",
129
+ "source_cohort": "fictional-desk",
130
+ "genre": "report",
131
+ "published_at": "2024-07-02T12:00:00Z",
132
+ "evidence_available_at": "2024-07-02T09:00:00Z",
133
+ "evidence_status": "uncorroborated",
134
+ "source_url": null,
135
+ "text": "The repair grant covers all listed buildings. The changes are visible in the current period.",
136
+ "context": "The proposals identify the eligible building list. Neither proposal includes an obligation or payment ledger.",
137
+ "family": "matched_claim",
138
+ "split": "train",
139
+ "label": "asserted",
140
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
141
+ "origin": "fictional",
142
+ "annotation_status": "ai_provisional",
143
+ "reference_span": {
144
+ "segment": "passage",
145
+ "start": 0,
146
+ "end": 45,
147
+ "quote": "The repair grant covers all listed buildings."
148
+ }
149
+ },
150
+ "right": {
151
+ "unit_id": "351853245551f0c14f",
152
+ "event_id": "repair-grants",
153
+ "beat": "housing",
154
+ "claim_type": "budget",
155
+ "role": "right",
156
+ "actor": "Brook Tenants Committee",
157
+ "source_cohort": "fictional-desk",
158
+ "genre": "report",
159
+ "published_at": "2024-07-02T12:00:00Z",
160
+ "evidence_available_at": "2024-07-02T09:00:00Z",
161
+ "evidence_status": "uncorroborated",
162
+ "source_url": null,
163
+ "text": "Brook Tenants Committee announced that the rehabilitation grant covers all listed buildings. The review is still open.",
164
+ "context": "The proposals identify the eligible building list. Neither proposal includes an obligation or payment ledger.",
165
+ "family": "matched_claim",
166
+ "split": "train",
167
+ "label": "attributed",
168
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
169
+ "origin": "fictional",
170
+ "annotation_status": "ai_provisional",
171
+ "reference_span": {
172
+ "segment": "passage",
173
+ "start": 0,
174
+ "end": 92,
175
+ "quote": "Brook Tenants Committee announced that the rehabilitation grant covers all listed buildings."
176
+ }
177
+ }
178
+ },
179
+ {
180
+ "pair_id": "a56e3b6af2400eebc6",
181
+ "left": {
182
+ "unit_id": "ad363a34feee245133",
183
+ "event_id": "zoning-review",
184
+ "beat": "housing",
185
+ "claim_type": "procedural_change",
186
+ "role": "left",
187
+ "actor": "Cedar Planning Panel",
188
+ "source_cohort": "fictional-desk",
189
+ "genre": "report",
190
+ "published_at": "2024-07-02T12:00:00Z",
191
+ "evidence_available_at": "2024-07-02T09:00:00Z",
192
+ "evidence_status": "uncorroborated",
193
+ "source_url": null,
194
+ "text": "Cedar Planning Panel announced that the zoning change shortens permit reviews by 30 days. The review is still open.",
195
+ "context": "Both groups presented internal estimates at one hearing. Comparable before and after case processing records have not been supplied.",
196
+ "family": "matched_claim",
197
+ "split": "train",
198
+ "label": "attributed",
199
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
200
+ "origin": "fictional",
201
+ "annotation_status": "ai_provisional",
202
+ "reference_span": {
203
+ "segment": "passage",
204
+ "start": 0,
205
+ "end": 89,
206
+ "quote": "Cedar Planning Panel announced that the zoning change shortens permit reviews by 30 days."
207
+ }
208
+ },
209
+ "right": {
210
+ "unit_id": "4f811b5fe931cd5767",
211
+ "event_id": "zoning-review",
212
+ "beat": "housing",
213
+ "claim_type": "procedural_change",
214
+ "role": "right",
215
+ "actor": "Alder Planning Board",
216
+ "source_cohort": "fictional-desk",
217
+ "genre": "report",
218
+ "published_at": "2024-07-02T12:00:00Z",
219
+ "evidence_available_at": "2024-07-02T09:00:00Z",
220
+ "evidence_status": "uncorroborated",
221
+ "source_url": null,
222
+ "text": "Initial accounts suggest the pre-application service shortens permit reviews by 30 days. The evidence remains provisional.",
223
+ "context": "Both groups presented internal estimates at one hearing. Comparable before and after case processing records have not been supplied.",
224
+ "family": "matched_claim",
225
+ "split": "train",
226
+ "label": "qualified",
227
+ "rationale": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
228
+ "origin": "fictional",
229
+ "annotation_status": "ai_provisional",
230
+ "reference_span": {
231
+ "segment": "passage",
232
+ "start": 0,
233
+ "end": 88,
234
+ "quote": "Initial accounts suggest the pre-application service shortens permit reviews by 30 days."
235
+ }
236
+ }
237
+ },
238
+ {
239
+ "pair_id": "4202e1c752e74572be",
240
+ "left": {
241
+ "unit_id": "68bd5b1080772d9598",
242
+ "event_id": "street-outreach",
243
+ "beat": "housing",
244
+ "claim_type": "service_effect",
245
+ "role": "left",
246
+ "actor": "Hill Ward Office",
247
+ "source_cohort": "fictional-desk",
248
+ "genre": "report",
249
+ "published_at": "2024-07-02T12:00:00Z",
250
+ "evidence_available_at": "2024-07-02T09:00:00Z",
251
+ "evidence_status": "uncorroborated",
252
+ "source_url": null,
253
+ "text": "The late shift brought more residents into shelter.",
254
+ "context": "The public record includes a service calendar and weekly outreach contact counts. It does not link contacts to shelter admissions. The surviving fragment has no attribution or surrounding text.",
255
+ "family": "matched_claim",
256
+ "split": "validation",
257
+ "label": "insufficient_context",
258
+ "rationale": "The retained fragment lacks enough information to identify the focal speaker's commitment.",
259
+ "origin": "fictional",
260
+ "annotation_status": "ai_provisional",
261
+ "reference_span": {
262
+ "segment": "context",
263
+ "start": 131,
264
+ "end": 193,
265
+ "quote": "The surviving fragment has no attribution or surrounding text."
266
+ }
267
+ },
268
+ "right": {
269
+ "unit_id": "7fd098ffd185dbb85a",
270
+ "event_id": "street-outreach",
271
+ "beat": "housing",
272
+ "claim_type": "service_effect",
273
+ "role": "right",
274
+ "actor": "Dock Ward Office",
275
+ "source_cohort": "fictional-desk",
276
+ "genre": "report",
277
+ "published_at": "2024-07-02T12:00:00Z",
278
+ "evidence_available_at": "2024-07-02T09:00:00Z",
279
+ "evidence_status": "uncorroborated",
280
+ "source_url": null,
281
+ "text": "The morning shift brought more residents into shelter. The changes are visible in the current period.",
282
+ "context": "The public record includes a service calendar and weekly outreach contact counts. It does not link contacts to shelter admissions.",
283
+ "family": "matched_claim",
284
+ "split": "validation",
285
+ "label": "asserted",
286
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
287
+ "origin": "fictional",
288
+ "annotation_status": "ai_provisional",
289
+ "reference_span": {
290
+ "segment": "passage",
291
+ "start": 0,
292
+ "end": 54,
293
+ "quote": "The morning shift brought more residents into shelter."
294
+ }
295
+ }
296
+ },
297
+ {
298
+ "pair_id": "17c44300e51f6dd622",
299
+ "left": {
300
+ "unit_id": "64777e67fa6c2937c2",
301
+ "event_id": "border-screening",
302
+ "beat": "migration",
303
+ "claim_type": "service_effect",
304
+ "role": "left",
305
+ "actor": "Eastgate Intake Team",
306
+ "source_cohort": "fictional-desk",
307
+ "genre": "report",
308
+ "published_at": "2024-07-02T12:00:00Z",
309
+ "evidence_available_at": "2024-07-02T09:00:00Z",
310
+ "evidence_status": "uncorroborated",
311
+ "source_url": null,
312
+ "text": "The new screening lane cut interview waits. The changes are visible in the current period.",
313
+ "context": "The review covers two crossings with similar interview hours and no before-and-after wait dataset.",
314
+ "family": "matched_claim",
315
+ "split": "train",
316
+ "label": "asserted",
317
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
318
+ "origin": "fictional",
319
+ "annotation_status": "ai_provisional",
320
+ "reference_span": {
321
+ "segment": "passage",
322
+ "start": 0,
323
+ "end": 43,
324
+ "quote": "The new screening lane cut interview waits."
325
+ }
326
+ },
327
+ "right": {
328
+ "unit_id": "20bc84785b4dae5295",
329
+ "event_id": "border-screening",
330
+ "beat": "migration",
331
+ "claim_type": "service_effect",
332
+ "role": "right",
333
+ "actor": "Westfield Intake Team",
334
+ "source_cohort": "fictional-desk",
335
+ "genre": "report",
336
+ "published_at": "2024-07-02T12:00:00Z",
337
+ "evidence_available_at": "2024-07-02T09:00:00Z",
338
+ "evidence_status": "uncorroborated",
339
+ "source_url": null,
340
+ "text": "Westfield Intake Team announced that the new intake calendar cut interview waits. The review is still open.",
341
+ "context": "The review covers two crossings with similar interview hours and no before-and-after wait dataset.",
342
+ "family": "matched_claim",
343
+ "split": "train",
344
+ "label": "attributed",
345
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
346
+ "origin": "fictional",
347
+ "annotation_status": "ai_provisional",
348
+ "reference_span": {
349
+ "segment": "passage",
350
+ "start": 0,
351
+ "end": 81,
352
+ "quote": "Westfield Intake Team announced that the new intake calendar cut interview waits."
353
+ }
354
+ }
355
+ },
356
+ {
357
+ "pair_id": "dd0cf3252d66375358",
358
+ "left": {
359
+ "unit_id": "fc11544173594a55b7",
360
+ "event_id": "appeal-window",
361
+ "beat": "migration",
362
+ "claim_type": "procedural_change",
363
+ "role": "left",
364
+ "actor": "Estuary Appeals Office",
365
+ "source_cohort": "fictional-desk",
366
+ "genre": "report",
367
+ "published_at": "2024-07-02T12:00:00Z",
368
+ "evidence_available_at": "2024-07-02T09:00:00Z",
369
+ "evidence_status": "uncorroborated",
370
+ "source_url": null,
371
+ "text": "The online form increased completed appeals. The changes are visible in the current period.",
372
+ "context": "Offices supply preliminary application starts. No complete status file was available by the publication deadline.",
373
+ "family": "matched_claim",
374
+ "split": "train",
375
+ "label": "asserted",
376
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
377
+ "origin": "fictional",
378
+ "annotation_status": "ai_provisional",
379
+ "reference_span": {
380
+ "segment": "passage",
381
+ "start": 0,
382
+ "end": 44,
383
+ "quote": "The online form increased completed appeals."
384
+ }
385
+ },
386
+ "right": {
387
+ "unit_id": "4eee279e8114644f74",
388
+ "event_id": "appeal-window",
389
+ "beat": "migration",
390
+ "claim_type": "procedural_change",
391
+ "role": "right",
392
+ "actor": "Highland Appeals Office",
393
+ "source_cohort": "fictional-desk",
394
+ "genre": "report",
395
+ "published_at": "2024-07-02T12:00:00Z",
396
+ "evidence_available_at": "2024-07-02T09:00:00Z",
397
+ "evidence_status": "uncorroborated",
398
+ "source_url": null,
399
+ "text": "Highland Appeals Office announced that the mail-in form increased completed appeals. The review is still open.",
400
+ "context": "Offices supply preliminary application starts. No complete status file was available by the publication deadline.",
401
+ "family": "matched_claim",
402
+ "split": "train",
403
+ "label": "attributed",
404
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
405
+ "origin": "fictional",
406
+ "annotation_status": "ai_provisional",
407
+ "reference_span": {
408
+ "segment": "passage",
409
+ "start": 0,
410
+ "end": 84,
411
+ "quote": "Highland Appeals Office announced that the mail-in form increased completed appeals."
412
+ }
413
+ }
414
+ },
415
+ {
416
+ "pair_id": "3713cd263286eda181",
417
+ "left": {
418
+ "unit_id": "47800693ba6eaa0478",
419
+ "event_id": "language-access",
420
+ "beat": "migration",
421
+ "claim_type": "service_effect",
422
+ "role": "left",
423
+ "actor": "Pines Civic Office",
424
+ "source_cohort": "fictional-desk",
425
+ "genre": "report",
426
+ "published_at": "2024-07-02T12:00:00Z",
427
+ "evidence_available_at": "2024-07-02T09:00:00Z",
428
+ "evidence_status": "uncorroborated",
429
+ "source_url": null,
430
+ "text": "The interpreter roster increased appointment attendance. The changes are visible in the current period.",
431
+ "context": "Both offices extended support. Published headcounts do not report scheduled appointments or attendance by language.",
432
+ "family": "matched_claim",
433
+ "split": "development_test",
434
+ "label": "asserted",
435
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
436
+ "origin": "fictional",
437
+ "annotation_status": "ai_provisional",
438
+ "reference_span": {
439
+ "segment": "passage",
440
+ "start": 0,
441
+ "end": 56,
442
+ "quote": "The interpreter roster increased appointment attendance."
443
+ }
444
+ },
445
+ "right": {
446
+ "unit_id": "2f7f4431a38852ea27",
447
+ "event_id": "language-access",
448
+ "beat": "migration",
449
+ "claim_type": "service_effect",
450
+ "role": "right",
451
+ "actor": "Canal Civic Office",
452
+ "source_cohort": "fictional-desk",
453
+ "genre": "report",
454
+ "published_at": "2024-07-02T12:00:00Z",
455
+ "evidence_available_at": "2024-07-02T09:00:00Z",
456
+ "evidence_status": "uncorroborated",
457
+ "source_url": null,
458
+ "text": "Canal Civic Office announced that the translation desk increased appointment attendance. The review is still open.",
459
+ "context": "Both offices extended support. Published headcounts do not report scheduled appointments or attendance by language.",
460
+ "family": "matched_claim",
461
+ "split": "development_test",
462
+ "label": "attributed",
463
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
464
+ "origin": "fictional",
465
+ "annotation_status": "ai_provisional",
466
+ "reference_span": {
467
+ "segment": "passage",
468
+ "start": 0,
469
+ "end": 88,
470
+ "quote": "Canal Civic Office announced that the translation desk increased appointment attendance."
471
+ }
472
+ }
473
+ },
474
+ {
475
+ "pair_id": "4b86373e095427922c",
476
+ "left": {
477
+ "unit_id": "bd0d9b0c11621a97b0",
478
+ "event_id": "work-permits",
479
+ "beat": "migration",
480
+ "claim_type": "service_effect",
481
+ "role": "left",
482
+ "actor": "North Quay Permit Unit",
483
+ "source_cohort": "fictional-desk",
484
+ "genre": "report",
485
+ "published_at": "2024-07-02T12:00:00Z",
486
+ "evidence_available_at": "2024-07-02T09:00:00Z",
487
+ "evidence_status": "uncorroborated",
488
+ "source_url": null,
489
+ "text": "North Quay Permit Unit announced that the new review pilot raised the number of decisions. The review is still open.",
490
+ "context": "The units announced results from a pilot month without publishing the files used to count decisions.",
491
+ "family": "matched_claim",
492
+ "split": "validation",
493
+ "label": "attributed",
494
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
495
+ "origin": "fictional",
496
+ "annotation_status": "ai_provisional",
497
+ "reference_span": {
498
+ "segment": "passage",
499
+ "start": 0,
500
+ "end": 90,
501
+ "quote": "North Quay Permit Unit announced that the new review pilot raised the number of decisions."
502
+ }
503
+ },
504
+ "right": {
505
+ "unit_id": "9b38096c4bdfff3278",
506
+ "event_id": "work-permits",
507
+ "beat": "migration",
508
+ "claim_type": "service_effect",
509
+ "role": "right",
510
+ "actor": "South Quay Permit Unit",
511
+ "source_cohort": "fictional-desk",
512
+ "genre": "report",
513
+ "published_at": "2024-07-02T12:00:00Z",
514
+ "evidence_available_at": "2024-07-02T09:00:00Z",
515
+ "evidence_status": "uncorroborated",
516
+ "source_url": null,
517
+ "text": "Initial accounts suggest the weekend review pilot raised the number of decisions. The evidence remains provisional.",
518
+ "context": "The units announced results from a pilot month without publishing the files used to count decisions.",
519
+ "family": "matched_claim",
520
+ "split": "validation",
521
+ "label": "qualified",
522
+ "rationale": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
523
+ "origin": "fictional",
524
+ "annotation_status": "ai_provisional",
525
+ "reference_span": {
526
+ "segment": "passage",
527
+ "start": 0,
528
+ "end": 81,
529
+ "quote": "Initial accounts suggest the weekend review pilot raised the number of decisions."
530
+ }
531
+ }
532
+ },
533
+ {
534
+ "pair_id": "d3de754899a079c1f2",
535
+ "left": {
536
+ "unit_id": "a03a3324ffbc36e4fe",
537
+ "event_id": "hosting-program",
538
+ "beat": "migration",
539
+ "claim_type": "budget",
540
+ "role": "left",
541
+ "actor": "Marsh County Office",
542
+ "source_cohort": "fictional-desk",
543
+ "genre": "report",
544
+ "published_at": "2024-07-02T12:00:00Z",
545
+ "evidence_available_at": "2024-07-02T09:00:00Z",
546
+ "evidence_status": "uncorroborated",
547
+ "source_url": null,
548
+ "text": "The housing stipend reached all eligible households.",
549
+ "context": "The review has authorized spending ceilings and eligibility criteria. Payment records are missing for both programs. The surviving fragment has no attribution or surrounding text.",
550
+ "family": "matched_claim",
551
+ "split": "train",
552
+ "label": "insufficient_context",
553
+ "rationale": "The retained fragment lacks enough information to identify the focal speaker's commitment.",
554
+ "origin": "fictional",
555
+ "annotation_status": "ai_provisional",
556
+ "reference_span": {
557
+ "segment": "context",
558
+ "start": 117,
559
+ "end": 179,
560
+ "quote": "The surviving fragment has no attribution or surrounding text."
561
+ }
562
+ },
563
+ "right": {
564
+ "unit_id": "6cf5224beb76ee96c7",
565
+ "event_id": "hosting-program",
566
+ "beat": "migration",
567
+ "claim_type": "budget",
568
+ "role": "right",
569
+ "actor": "Elm County Office",
570
+ "source_cohort": "fictional-desk",
571
+ "genre": "report",
572
+ "published_at": "2024-07-02T12:00:00Z",
573
+ "evidence_available_at": "2024-07-02T09:00:00Z",
574
+ "evidence_status": "uncorroborated",
575
+ "source_url": null,
576
+ "text": "The transport stipend reached all eligible households. The changes are visible in the current period.",
577
+ "context": "The review has authorized spending ceilings and eligibility criteria. Payment records are missing for both programs.",
578
+ "family": "matched_claim",
579
+ "split": "train",
580
+ "label": "asserted",
581
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
582
+ "origin": "fictional",
583
+ "annotation_status": "ai_provisional",
584
+ "reference_span": {
585
+ "segment": "passage",
586
+ "start": 0,
587
+ "end": 54,
588
+ "quote": "The transport stipend reached all eligible households."
589
+ }
590
+ }
591
+ },
592
+ {
593
+ "pair_id": "3628f0599a6b447a8d",
594
+ "left": {
595
+ "unit_id": "e667de5d74c47f9aed",
596
+ "event_id": "audit-savings",
597
+ "beat": "spending",
598
+ "claim_type": "budget",
599
+ "role": "left",
600
+ "actor": "Redwood Audit Committee",
601
+ "source_cohort": "fictional-desk",
602
+ "genre": "report",
603
+ "published_at": "2024-07-02T12:00:00Z",
604
+ "evidence_available_at": "2024-07-02T09:00:00Z",
605
+ "evidence_status": "uncorroborated",
606
+ "source_url": null,
607
+ "text": "The purchasing consolidation saved two million dollars. The changes are visible in the current period.",
608
+ "context": "The two committees gave testimony within the same meeting. Vendor invoices and reconciliation are not in the supplied material.",
609
+ "family": "matched_claim",
610
+ "split": "train",
611
+ "label": "asserted",
612
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
613
+ "origin": "fictional",
614
+ "annotation_status": "ai_provisional",
615
+ "reference_span": {
616
+ "segment": "passage",
617
+ "start": 0,
618
+ "end": 55,
619
+ "quote": "The purchasing consolidation saved two million dollars."
620
+ }
621
+ },
622
+ "right": {
623
+ "unit_id": "d819a998c5bca0df60",
624
+ "event_id": "audit-savings",
625
+ "beat": "spending",
626
+ "claim_type": "budget",
627
+ "role": "right",
628
+ "actor": "Flint Budget Panel",
629
+ "source_cohort": "fictional-desk",
630
+ "genre": "report",
631
+ "published_at": "2024-07-02T12:00:00Z",
632
+ "evidence_available_at": "2024-07-02T09:00:00Z",
633
+ "evidence_status": "uncorroborated",
634
+ "source_url": null,
635
+ "text": "Flint Budget Panel announced that the tender redesign saved two million dollars. The review is still open.",
636
+ "context": "The two committees gave testimony within the same meeting. Vendor invoices and reconciliation are not in the supplied material.",
637
+ "family": "matched_claim",
638
+ "split": "train",
639
+ "label": "attributed",
640
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
641
+ "origin": "fictional",
642
+ "annotation_status": "ai_provisional",
643
+ "reference_span": {
644
+ "segment": "passage",
645
+ "start": 0,
646
+ "end": 80,
647
+ "quote": "Flint Budget Panel announced that the tender redesign saved two million dollars."
648
+ }
649
+ }
650
+ },
651
+ {
652
+ "pair_id": "f922a501fcb9ece2f3",
653
+ "left": {
654
+ "unit_id": "40b987310b48916fda",
655
+ "event_id": "school-procurement",
656
+ "beat": "spending",
657
+ "claim_type": "budget",
658
+ "role": "left",
659
+ "actor": "Beacon School District",
660
+ "source_cohort": "fictional-desk",
661
+ "genre": "report",
662
+ "published_at": "2024-07-02T12:00:00Z",
663
+ "evidence_available_at": "2024-07-02T09:00:00Z",
664
+ "evidence_status": "uncorroborated",
665
+ "source_url": null,
666
+ "text": "The central purchase reduced textbook costs. The changes are visible in the current period.",
667
+ "context": "Both districts shared proposed contract prices. The comparison lacks invoiced quantities and delivery charges.",
668
+ "family": "matched_claim",
669
+ "split": "development_test",
670
+ "label": "asserted",
671
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
672
+ "origin": "fictional",
673
+ "annotation_status": "ai_provisional",
674
+ "reference_span": {
675
+ "segment": "passage",
676
+ "start": 0,
677
+ "end": 44,
678
+ "quote": "The central purchase reduced textbook costs."
679
+ }
680
+ },
681
+ "right": {
682
+ "unit_id": "65b06389dcc419eb57",
683
+ "event_id": "school-procurement",
684
+ "beat": "spending",
685
+ "claim_type": "budget",
686
+ "role": "right",
687
+ "actor": "Harbor School District",
688
+ "source_cohort": "fictional-desk",
689
+ "genre": "report",
690
+ "published_at": "2024-07-02T12:00:00Z",
691
+ "evidence_available_at": "2024-07-02T09:00:00Z",
692
+ "evidence_status": "uncorroborated",
693
+ "source_url": null,
694
+ "text": "Harbor School District announced that bulk contracts reduced textbook costs. The review is still open.",
695
+ "context": "Both districts shared proposed contract prices. The comparison lacks invoiced quantities and delivery charges.",
696
+ "family": "matched_claim",
697
+ "split": "development_test",
698
+ "label": "attributed",
699
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
700
+ "origin": "fictional",
701
+ "annotation_status": "ai_provisional",
702
+ "reference_span": {
703
+ "segment": "passage",
704
+ "start": 0,
705
+ "end": 76,
706
+ "quote": "Harbor School District announced that bulk contracts reduced textbook costs."
707
+ }
708
+ }
709
+ },
710
+ {
711
+ "pair_id": "0174b2f54c94db7bde",
712
+ "left": {
713
+ "unit_id": "549950ee91ddf69704",
714
+ "event_id": "transit-fare",
715
+ "beat": "spending",
716
+ "claim_type": "service_effect",
717
+ "role": "left",
718
+ "actor": "Acorn Transit Board",
719
+ "source_cohort": "fictional-desk",
720
+ "genre": "report",
721
+ "published_at": "2024-07-02T12:00:00Z",
722
+ "evidence_available_at": "2024-07-02T09:00:00Z",
723
+ "evidence_status": "uncorroborated",
724
+ "source_url": null,
725
+ "text": "The lower fare increased weekday ridership. The changes are visible in the current period.",
726
+ "context": "Operators shared promotional figures. Monthly trip records and service changes are unavailable for both.",
727
+ "family": "matched_claim",
728
+ "split": "train",
729
+ "label": "asserted",
730
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
731
+ "origin": "fictional",
732
+ "annotation_status": "ai_provisional",
733
+ "reference_span": {
734
+ "segment": "passage",
735
+ "start": 0,
736
+ "end": 43,
737
+ "quote": "The lower fare increased weekday ridership."
738
+ }
739
+ },
740
+ "right": {
741
+ "unit_id": "c3c6ffbd179a430eba",
742
+ "event_id": "transit-fare",
743
+ "beat": "spending",
744
+ "claim_type": "service_effect",
745
+ "role": "right",
746
+ "actor": "Bridge Transit Board",
747
+ "source_cohort": "fictional-desk",
748
+ "genre": "report",
749
+ "published_at": "2024-07-02T12:00:00Z",
750
+ "evidence_available_at": "2024-07-02T09:00:00Z",
751
+ "evidence_status": "uncorroborated",
752
+ "source_url": null,
753
+ "text": "Bridge Transit Board announced that the day pass increased weekday ridership. The review is still open.",
754
+ "context": "Operators shared promotional figures. Monthly trip records and service changes are unavailable for both.",
755
+ "family": "matched_claim",
756
+ "split": "train",
757
+ "label": "attributed",
758
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
759
+ "origin": "fictional",
760
+ "annotation_status": "ai_provisional",
761
+ "reference_span": {
762
+ "segment": "passage",
763
+ "start": 0,
764
+ "end": 77,
765
+ "quote": "Bridge Transit Board announced that the day pass increased weekday ridership."
766
+ }
767
+ }
768
+ },
769
+ {
770
+ "pair_id": "90a9de5c0f8d32c0e7",
771
+ "left": {
772
+ "unit_id": "660cb79c43f84f6062",
773
+ "event_id": "flood-fund",
774
+ "beat": "spending",
775
+ "claim_type": "budget",
776
+ "role": "left",
777
+ "actor": "Meadow Emergency Board",
778
+ "source_cohort": "fictional-desk",
779
+ "genre": "report",
780
+ "published_at": "2024-07-02T12:00:00Z",
781
+ "evidence_available_at": "2024-07-02T09:00:00Z",
782
+ "evidence_status": "uncorroborated",
783
+ "source_url": null,
784
+ "text": "Meadow Emergency Board announced that the drainage fund covered half the repair cost. The review is still open.",
785
+ "context": "Totals in the meeting packet are funding authorizations. Contractor invoices were not attached.",
786
+ "family": "matched_claim",
787
+ "split": "train",
788
+ "label": "attributed",
789
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
790
+ "origin": "fictional",
791
+ "annotation_status": "ai_provisional",
792
+ "reference_span": {
793
+ "segment": "passage",
794
+ "start": 0,
795
+ "end": 85,
796
+ "quote": "Meadow Emergency Board announced that the drainage fund covered half the repair cost."
797
+ }
798
+ },
799
+ "right": {
800
+ "unit_id": "cdba9e9a8b36283fa6",
801
+ "event_id": "flood-fund",
802
+ "beat": "spending",
803
+ "claim_type": "budget",
804
+ "role": "right",
805
+ "actor": "Stone Emergency Board",
806
+ "source_cohort": "fictional-desk",
807
+ "genre": "report",
808
+ "published_at": "2024-07-02T12:00:00Z",
809
+ "evidence_available_at": "2024-07-02T09:00:00Z",
810
+ "evidence_status": "uncorroborated",
811
+ "source_url": null,
812
+ "text": "Initial accounts suggest the emergency grant covered half the repair cost. The evidence remains provisional.",
813
+ "context": "Totals in the meeting packet are funding authorizations. Contractor invoices were not attached.",
814
+ "family": "matched_claim",
815
+ "split": "train",
816
+ "label": "qualified",
817
+ "rationale": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
818
+ "origin": "fictional",
819
+ "annotation_status": "ai_provisional",
820
+ "reference_span": {
821
+ "segment": "passage",
822
+ "start": 0,
823
+ "end": 74,
824
+ "quote": "Initial accounts suggest the emergency grant covered half the repair cost."
825
+ }
826
+ }
827
+ },
828
+ {
829
+ "pair_id": "06abb64872dea9fab8",
830
+ "left": {
831
+ "unit_id": "e1dc451a5e6d64e149",
832
+ "event_id": "inspector-posts",
833
+ "beat": "spending",
834
+ "claim_type": "capacity",
835
+ "role": "left",
836
+ "actor": "Fern Municipal Office",
837
+ "source_cohort": "fictional-desk",
838
+ "genre": "report",
839
+ "published_at": "2024-07-02T12:00:00Z",
840
+ "evidence_available_at": "2024-07-02T09:00:00Z",
841
+ "evidence_status": "uncorroborated",
842
+ "source_url": null,
843
+ "text": "The hiring program filled 25 inspector posts.",
844
+ "context": "The establishments list approved roles and interview schedules. No completed appointment register accompanied the announcements. The surviving fragment has no attribution or surrounding text.",
845
+ "family": "matched_claim",
846
+ "split": "validation",
847
+ "label": "insufficient_context",
848
+ "rationale": "The retained fragment lacks enough information to identify the focal speaker's commitment.",
849
+ "origin": "fictional",
850
+ "annotation_status": "ai_provisional",
851
+ "reference_span": {
852
+ "segment": "context",
853
+ "start": 129,
854
+ "end": 191,
855
+ "quote": "The surviving fragment has no attribution or surrounding text."
856
+ }
857
+ },
858
+ "right": {
859
+ "unit_id": "5283f02c51df2cc2ba",
860
+ "event_id": "inspector-posts",
861
+ "beat": "spending",
862
+ "claim_type": "capacity",
863
+ "role": "right",
864
+ "actor": "Mill Municipal Office",
865
+ "source_cohort": "fictional-desk",
866
+ "genre": "report",
867
+ "published_at": "2024-07-02T12:00:00Z",
868
+ "evidence_available_at": "2024-07-02T09:00:00Z",
869
+ "evidence_status": "uncorroborated",
870
+ "source_url": null,
871
+ "text": "The transfer program filled 25 inspector posts. The changes are visible in the current period.",
872
+ "context": "The establishments list approved roles and interview schedules. No completed appointment register accompanied the announcements.",
873
+ "family": "matched_claim",
874
+ "split": "validation",
875
+ "label": "asserted",
876
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
877
+ "origin": "fictional",
878
+ "annotation_status": "ai_provisional",
879
+ "reference_span": {
880
+ "segment": "passage",
881
+ "start": 0,
882
+ "end": 47,
883
+ "quote": "The transfer program filled 25 inspector posts."
884
+ }
885
+ }
886
+ },
887
+ {
888
+ "pair_id": "32a65d3500a0bf22a1",
889
+ "left": {
890
+ "unit_id": "15c445a1e642d3373a",
891
+ "event_id": "ceasefire-monitoring",
892
+ "beat": "conflict",
893
+ "claim_type": "procedural_change",
894
+ "role": "left",
895
+ "actor": "Linden Delegation",
896
+ "source_cohort": "fictional-desk",
897
+ "genre": "report",
898
+ "published_at": "2024-07-02T12:00:00Z",
899
+ "evidence_available_at": "2024-07-02T09:00:00Z",
900
+ "evidence_status": "uncorroborated",
901
+ "source_url": null,
902
+ "text": "The monitoring arrangement recorded all reported violations. The changes are visible in the current period.",
903
+ "context": "The simulated ceasefire docket contains mandates and meeting notes. No complete incident register was released.",
904
+ "family": "matched_claim",
905
+ "split": "train",
906
+ "label": "asserted",
907
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
908
+ "origin": "fictional",
909
+ "annotation_status": "ai_provisional",
910
+ "reference_span": {
911
+ "segment": "passage",
912
+ "start": 0,
913
+ "end": 60,
914
+ "quote": "The monitoring arrangement recorded all reported violations."
915
+ }
916
+ },
917
+ "right": {
918
+ "unit_id": "99312bb2c665b3f0cf",
919
+ "event_id": "ceasefire-monitoring",
920
+ "beat": "conflict",
921
+ "claim_type": "procedural_change",
922
+ "role": "right",
923
+ "actor": "Granite Delegation",
924
+ "source_cohort": "fictional-desk",
925
+ "genre": "report",
926
+ "published_at": "2024-07-02T12:00:00Z",
927
+ "evidence_available_at": "2024-07-02T09:00:00Z",
928
+ "evidence_status": "uncorroborated",
929
+ "source_url": null,
930
+ "text": "Granite Delegation announced that the liaison arrangement recorded all reported violations. The review is still open.",
931
+ "context": "The simulated ceasefire docket contains mandates and meeting notes. No complete incident register was released.",
932
+ "family": "matched_claim",
933
+ "split": "train",
934
+ "label": "attributed",
935
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
936
+ "origin": "fictional",
937
+ "annotation_status": "ai_provisional",
938
+ "reference_span": {
939
+ "segment": "passage",
940
+ "start": 0,
941
+ "end": 91,
942
+ "quote": "Granite Delegation announced that the liaison arrangement recorded all reported violations."
943
+ }
944
+ }
945
+ },
946
+ {
947
+ "pair_id": "08117dbbe8d2215ce1",
948
+ "left": {
949
+ "unit_id": "796278429630b40f67",
950
+ "event_id": "aid-inspections",
951
+ "beat": "conflict",
952
+ "claim_type": "service_effect",
953
+ "role": "left",
954
+ "actor": "Valley Relief Office",
955
+ "source_cohort": "fictional-desk",
956
+ "genre": "report",
957
+ "published_at": "2024-07-02T12:00:00Z",
958
+ "evidence_available_at": "2024-07-02T09:00:00Z",
959
+ "evidence_status": "uncorroborated",
960
+ "source_url": null,
961
+ "text": "The inspection protocol accelerated food deliveries. The changes are visible in the current period.",
962
+ "context": "The dispatch summaries include planned inspection times. Confirmed delivery timestamps were absent at the reporting cutoff.",
963
+ "family": "matched_claim",
964
+ "split": "train",
965
+ "label": "asserted",
966
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
967
+ "origin": "fictional",
968
+ "annotation_status": "ai_provisional",
969
+ "reference_span": {
970
+ "segment": "passage",
971
+ "start": 0,
972
+ "end": 52,
973
+ "quote": "The inspection protocol accelerated food deliveries."
974
+ }
975
+ },
976
+ "right": {
977
+ "unit_id": "395fbf2aaa6359f6f9",
978
+ "event_id": "aid-inspections",
979
+ "beat": "conflict",
980
+ "claim_type": "service_effect",
981
+ "role": "right",
982
+ "actor": "Summit Relief Office",
983
+ "source_cohort": "fictional-desk",
984
+ "genre": "report",
985
+ "published_at": "2024-07-02T12:00:00Z",
986
+ "evidence_available_at": "2024-07-02T09:00:00Z",
987
+ "evidence_status": "uncorroborated",
988
+ "source_url": null,
989
+ "text": "Summit Relief Office announced that the scheduling protocol accelerated food deliveries. The review is still open.",
990
+ "context": "The dispatch summaries include planned inspection times. Confirmed delivery timestamps were absent at the reporting cutoff.",
991
+ "family": "matched_claim",
992
+ "split": "train",
993
+ "label": "attributed",
994
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
995
+ "origin": "fictional",
996
+ "annotation_status": "ai_provisional",
997
+ "reference_span": {
998
+ "segment": "passage",
999
+ "start": 0,
1000
+ "end": 88,
1001
+ "quote": "Summit Relief Office announced that the scheduling protocol accelerated food deliveries."
1002
+ }
1003
+ }
1004
+ },
1005
+ {
1006
+ "pair_id": "5fec722087d94c3b67",
1007
+ "left": {
1008
+ "unit_id": "a17cb134cec1aad9bb",
1009
+ "event_id": "reconstruction",
1010
+ "beat": "conflict",
1011
+ "claim_type": "budget",
1012
+ "role": "left",
1013
+ "actor": "Blue Harbor Mission",
1014
+ "source_cohort": "fictional-desk",
1015
+ "genre": "report",
1016
+ "published_at": "2024-07-02T12:00:00Z",
1017
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1018
+ "evidence_status": "uncorroborated",
1019
+ "source_url": null,
1020
+ "text": "The reconstruction fund disbursed the pledged amount. The changes are visible in the current period.",
1021
+ "context": "Both missions issued pledges. The public packet lacks payment records from either mission.",
1022
+ "family": "matched_claim",
1023
+ "split": "train",
1024
+ "label": "asserted",
1025
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
1026
+ "origin": "fictional",
1027
+ "annotation_status": "ai_provisional",
1028
+ "reference_span": {
1029
+ "segment": "passage",
1030
+ "start": 0,
1031
+ "end": 53,
1032
+ "quote": "The reconstruction fund disbursed the pledged amount."
1033
+ }
1034
+ },
1035
+ "right": {
1036
+ "unit_id": "ca8d142c353b0c56f3",
1037
+ "event_id": "reconstruction",
1038
+ "beat": "conflict",
1039
+ "claim_type": "budget",
1040
+ "role": "right",
1041
+ "actor": "Sandplain Mission",
1042
+ "source_cohort": "fictional-desk",
1043
+ "genre": "report",
1044
+ "published_at": "2024-07-02T12:00:00Z",
1045
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1046
+ "evidence_status": "uncorroborated",
1047
+ "source_url": null,
1048
+ "text": "Sandplain Mission announced that the housing fund disbursed the pledged amount. The review is still open.",
1049
+ "context": "Both missions issued pledges. The public packet lacks payment records from either mission.",
1050
+ "family": "matched_claim",
1051
+ "split": "train",
1052
+ "label": "attributed",
1053
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1054
+ "origin": "fictional",
1055
+ "annotation_status": "ai_provisional",
1056
+ "reference_span": {
1057
+ "segment": "passage",
1058
+ "start": 0,
1059
+ "end": 79,
1060
+ "quote": "Sandplain Mission announced that the housing fund disbursed the pledged amount."
1061
+ }
1062
+ }
1063
+ },
1064
+ {
1065
+ "pair_id": "bdef4f63079fcaf5a1",
1066
+ "left": {
1067
+ "unit_id": "b3d0ca3070eb4956a8",
1068
+ "event_id": "access-crossing",
1069
+ "beat": "conflict",
1070
+ "claim_type": "service_effect",
1071
+ "role": "left",
1072
+ "actor": "Cobalt Crossing Office",
1073
+ "source_cohort": "fictional-desk",
1074
+ "genre": "report",
1075
+ "published_at": "2024-07-02T12:00:00Z",
1076
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1077
+ "evidence_status": "uncorroborated",
1078
+ "source_url": null,
1079
+ "text": "Cobalt Crossing Office announced that the morning reopening increased medical visits. The review is still open.",
1080
+ "context": "The site plans identify clinic access windows. Neither office has supplied an attendance comparison.",
1081
+ "family": "matched_claim",
1082
+ "split": "development_test",
1083
+ "label": "attributed",
1084
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1085
+ "origin": "fictional",
1086
+ "annotation_status": "ai_provisional",
1087
+ "reference_span": {
1088
+ "segment": "passage",
1089
+ "start": 0,
1090
+ "end": 85,
1091
+ "quote": "Cobalt Crossing Office announced that the morning reopening increased medical visits."
1092
+ }
1093
+ },
1094
+ "right": {
1095
+ "unit_id": "73528e4cd5401c624e",
1096
+ "event_id": "access-crossing",
1097
+ "beat": "conflict",
1098
+ "claim_type": "service_effect",
1099
+ "role": "right",
1100
+ "actor": "Copper Crossing Office",
1101
+ "source_cohort": "fictional-desk",
1102
+ "genre": "report",
1103
+ "published_at": "2024-07-02T12:00:00Z",
1104
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1105
+ "evidence_status": "uncorroborated",
1106
+ "source_url": null,
1107
+ "text": "Initial accounts suggest the evening reopening increased medical visits. The evidence remains provisional.",
1108
+ "context": "The site plans identify clinic access windows. Neither office has supplied an attendance comparison.",
1109
+ "family": "matched_claim",
1110
+ "split": "development_test",
1111
+ "label": "qualified",
1112
+ "rationale": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
1113
+ "origin": "fictional",
1114
+ "annotation_status": "ai_provisional",
1115
+ "reference_span": {
1116
+ "segment": "passage",
1117
+ "start": 0,
1118
+ "end": 72,
1119
+ "quote": "Initial accounts suggest the evening reopening increased medical visits."
1120
+ }
1121
+ }
1122
+ },
1123
+ {
1124
+ "pair_id": "4179f14f86d35875ba",
1125
+ "left": {
1126
+ "unit_id": "4126db7b814aa0c95f",
1127
+ "event_id": "civilian-briefing",
1128
+ "beat": "conflict",
1129
+ "claim_type": "procedural_change",
1130
+ "role": "left",
1131
+ "actor": "Gull Protection Panel",
1132
+ "source_cohort": "fictional-desk",
1133
+ "genre": "report",
1134
+ "published_at": "2024-07-02T12:00:00Z",
1135
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1136
+ "evidence_status": "uncorroborated",
1137
+ "source_url": null,
1138
+ "text": "The reporting process captured every civilian displacement.",
1139
+ "context": "Both claims concern the same reporting interval. The two logs contain only agency contacts and leave household coverage unknown. The surviving fragment has no attribution or surrounding text.",
1140
+ "family": "matched_claim",
1141
+ "split": "validation",
1142
+ "label": "insufficient_context",
1143
+ "rationale": "The retained fragment lacks enough information to identify the focal speaker's commitment.",
1144
+ "origin": "fictional",
1145
+ "annotation_status": "ai_provisional",
1146
+ "reference_span": {
1147
+ "segment": "context",
1148
+ "start": 129,
1149
+ "end": 191,
1150
+ "quote": "The surviving fragment has no attribution or surrounding text."
1151
+ }
1152
+ },
1153
+ "right": {
1154
+ "unit_id": "fadf5f5c6805a71f21",
1155
+ "event_id": "civilian-briefing",
1156
+ "beat": "conflict",
1157
+ "claim_type": "procedural_change",
1158
+ "role": "right",
1159
+ "actor": "Pelican Protection Panel",
1160
+ "source_cohort": "fictional-desk",
1161
+ "genre": "report",
1162
+ "published_at": "2024-07-02T12:00:00Z",
1163
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1164
+ "evidence_status": "uncorroborated",
1165
+ "source_url": null,
1166
+ "text": "The call-in process captured every civilian displacement. The changes are visible in the current period.",
1167
+ "context": "Both claims concern the same reporting interval. The two logs contain only agency contacts and leave household coverage unknown.",
1168
+ "family": "matched_claim",
1169
+ "split": "validation",
1170
+ "label": "asserted",
1171
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
1172
+ "origin": "fictional",
1173
+ "annotation_status": "ai_provisional",
1174
+ "reference_span": {
1175
+ "segment": "passage",
1176
+ "start": 0,
1177
+ "end": 57,
1178
+ "quote": "The call-in process captured every civilian displacement."
1179
+ }
1180
+ }
1181
+ },
1182
+ {
1183
+ "pair_id": "audit-control-genre_mismatch",
1184
+ "left": {
1185
+ "unit_id": "audit-control-genre_mismatch-left",
1186
+ "event_id": "audit-control-genre_mismatch",
1187
+ "beat": "housing",
1188
+ "claim_type": "service_effect",
1189
+ "role": "left",
1190
+ "actor": "North Borough Housing Committee",
1191
+ "source_cohort": "fictional-desk",
1192
+ "genre": "report",
1193
+ "published_at": "2024-07-02T12:00:00Z",
1194
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1195
+ "evidence_status": "uncorroborated",
1196
+ "source_url": null,
1197
+ "text": "The rent advice pilot reduced filing delays. The changes are visible in the current period.",
1198
+ "context": "The fictional municipal review compares initial filings from the same intake month. Staff have supplied headline counts without a measure of participant mix.",
1199
+ "family": "matched_claim",
1200
+ "split": "development_test",
1201
+ "label": "asserted",
1202
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
1203
+ "origin": "fictional",
1204
+ "annotation_status": "ai_provisional",
1205
+ "reference_span": {
1206
+ "segment": "passage",
1207
+ "start": 0,
1208
+ "end": 44,
1209
+ "quote": "The rent advice pilot reduced filing delays."
1210
+ }
1211
+ },
1212
+ "right": {
1213
+ "unit_id": "audit-control-genre_mismatch-right",
1214
+ "event_id": "audit-control-genre_mismatch",
1215
+ "beat": "housing",
1216
+ "claim_type": "service_effect",
1217
+ "role": "right",
1218
+ "actor": "River District Housing Office",
1219
+ "source_cohort": "fictional-desk",
1220
+ "genre": "opinion",
1221
+ "published_at": "2024-07-02T12:00:00Z",
1222
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1223
+ "evidence_status": "uncorroborated",
1224
+ "source_url": null,
1225
+ "text": "River District Housing Office announced that the landlord mediation pilot reduced filing delays. The review is still open.",
1226
+ "context": "The fictional municipal review compares initial filings from the same intake month. Staff have supplied headline counts without a measure of participant mix.",
1227
+ "family": "matched_claim",
1228
+ "split": "development_test",
1229
+ "label": "attributed",
1230
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1231
+ "origin": "fictional",
1232
+ "annotation_status": "ai_provisional",
1233
+ "reference_span": {
1234
+ "segment": "passage",
1235
+ "start": 0,
1236
+ "end": 96,
1237
+ "quote": "River District Housing Office announced that the landlord mediation pilot reduced filing delays."
1238
+ }
1239
+ }
1240
+ },
1241
+ {
1242
+ "pair_id": "audit-control-time_mismatch",
1243
+ "left": {
1244
+ "unit_id": "audit-control-time_mismatch-left",
1245
+ "event_id": "audit-control-time_mismatch",
1246
+ "beat": "housing",
1247
+ "claim_type": "capacity",
1248
+ "role": "left",
1249
+ "actor": "Old Market Council",
1250
+ "source_cohort": "fictional-desk",
1251
+ "genre": "report",
1252
+ "published_at": "2024-07-02T12:00:00Z",
1253
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1254
+ "evidence_status": "uncorroborated",
1255
+ "source_url": null,
1256
+ "text": "The converted library can serve 80 people overnight. The changes are visible in the current period.",
1257
+ "context": "Both committees circulated estimated bed capacities before fire and accessibility inspections concluded.",
1258
+ "family": "matched_claim",
1259
+ "split": "train",
1260
+ "label": "asserted",
1261
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
1262
+ "origin": "fictional",
1263
+ "annotation_status": "ai_provisional",
1264
+ "reference_span": {
1265
+ "segment": "passage",
1266
+ "start": 0,
1267
+ "end": 52,
1268
+ "quote": "The converted library can serve 80 people overnight."
1269
+ }
1270
+ },
1271
+ "right": {
1272
+ "unit_id": "audit-control-time_mismatch-right",
1273
+ "event_id": "audit-control-time_mismatch",
1274
+ "beat": "housing",
1275
+ "claim_type": "capacity",
1276
+ "role": "right",
1277
+ "actor": "Lakeside Council",
1278
+ "source_cohort": "fictional-desk",
1279
+ "genre": "report",
1280
+ "published_at": "2024-07-05T12:00:00Z",
1281
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1282
+ "evidence_status": "uncorroborated",
1283
+ "source_url": null,
1284
+ "text": "Lakeside Council announced that the converted depot can serve 80 people overnight. The review is still open.",
1285
+ "context": "Both committees circulated estimated bed capacities before fire and accessibility inspections concluded.",
1286
+ "family": "matched_claim",
1287
+ "split": "train",
1288
+ "label": "attributed",
1289
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1290
+ "origin": "fictional",
1291
+ "annotation_status": "ai_provisional",
1292
+ "reference_span": {
1293
+ "segment": "passage",
1294
+ "start": 0,
1295
+ "end": 82,
1296
+ "quote": "Lakeside Council announced that the converted depot can serve 80 people overnight."
1297
+ }
1298
+ }
1299
+ },
1300
+ {
1301
+ "pair_id": "audit-control-later_evidence",
1302
+ "left": {
1303
+ "unit_id": "audit-control-later_evidence-left",
1304
+ "event_id": "audit-control-later_evidence",
1305
+ "beat": "housing",
1306
+ "claim_type": "budget",
1307
+ "role": "left",
1308
+ "actor": "Dune Housing Board",
1309
+ "source_cohort": "fictional-desk",
1310
+ "genre": "report",
1311
+ "published_at": "2024-07-02T12:00:00Z",
1312
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1313
+ "evidence_status": "uncorroborated",
1314
+ "source_url": null,
1315
+ "text": "The repair grant covers all listed buildings. The changes are visible in the current period.",
1316
+ "context": "The proposals identify the eligible building list. Neither proposal includes an obligation or payment ledger.",
1317
+ "family": "matched_claim",
1318
+ "split": "train",
1319
+ "label": "asserted",
1320
+ "rationale": "The focal coverage adopts the proposition as its own conclusion.",
1321
+ "origin": "fictional",
1322
+ "annotation_status": "ai_provisional",
1323
+ "reference_span": {
1324
+ "segment": "passage",
1325
+ "start": 0,
1326
+ "end": 45,
1327
+ "quote": "The repair grant covers all listed buildings."
1328
+ }
1329
+ },
1330
+ "right": {
1331
+ "unit_id": "audit-control-later_evidence-right",
1332
+ "event_id": "audit-control-later_evidence",
1333
+ "beat": "housing",
1334
+ "claim_type": "budget",
1335
+ "role": "right",
1336
+ "actor": "Brook Tenants Committee",
1337
+ "source_cohort": "fictional-desk",
1338
+ "genre": "report",
1339
+ "published_at": "2024-07-02T12:00:00Z",
1340
+ "evidence_available_at": "2024-07-06T09:00:00Z",
1341
+ "evidence_status": "uncorroborated",
1342
+ "source_url": null,
1343
+ "text": "Brook Tenants Committee announced that the rehabilitation grant covers all listed buildings. The review is still open.",
1344
+ "context": "The proposals identify the eligible building list. Neither proposal includes an obligation or payment ledger.",
1345
+ "family": "matched_claim",
1346
+ "split": "train",
1347
+ "label": "attributed",
1348
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1349
+ "origin": "fictional",
1350
+ "annotation_status": "ai_provisional",
1351
+ "reference_span": {
1352
+ "segment": "passage",
1353
+ "start": 0,
1354
+ "end": 92,
1355
+ "quote": "Brook Tenants Committee announced that the rehabilitation grant covers all listed buildings."
1356
+ }
1357
+ }
1358
+ },
1359
+ {
1360
+ "pair_id": "audit-control-different_support",
1361
+ "left": {
1362
+ "unit_id": "audit-control-different_support-left",
1363
+ "event_id": "audit-control-different_support",
1364
+ "beat": "housing",
1365
+ "claim_type": "procedural_change",
1366
+ "role": "left",
1367
+ "actor": "Cedar Planning Panel",
1368
+ "source_cohort": "fictional-desk",
1369
+ "genre": "report",
1370
+ "published_at": "2024-07-02T12:00:00Z",
1371
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1372
+ "evidence_status": "uncorroborated",
1373
+ "source_url": null,
1374
+ "text": "Cedar Planning Panel announced that the zoning change shortens permit reviews by 30 days. The review is still open.",
1375
+ "context": "Both groups presented internal estimates at one hearing. Comparable before and after case processing records have not been supplied.",
1376
+ "family": "matched_claim",
1377
+ "split": "train",
1378
+ "label": "attributed",
1379
+ "rationale": "The proposition is reported as someone else's statement, with its speaker supplied.",
1380
+ "origin": "fictional",
1381
+ "annotation_status": "ai_provisional",
1382
+ "reference_span": {
1383
+ "segment": "passage",
1384
+ "start": 0,
1385
+ "end": 89,
1386
+ "quote": "Cedar Planning Panel announced that the zoning change shortens permit reviews by 30 days."
1387
+ }
1388
+ },
1389
+ "right": {
1390
+ "unit_id": "audit-control-different_support-right",
1391
+ "event_id": "audit-control-different_support",
1392
+ "beat": "housing",
1393
+ "claim_type": "procedural_change",
1394
+ "role": "right",
1395
+ "actor": "Alder Planning Board",
1396
+ "source_cohort": "fictional-desk",
1397
+ "genre": "report",
1398
+ "published_at": "2024-07-02T12:00:00Z",
1399
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1400
+ "evidence_status": "corroborated",
1401
+ "source_url": null,
1402
+ "text": "Initial accounts suggest the pre-application service shortens permit reviews by 30 days. The evidence remains provisional.",
1403
+ "context": "Both groups presented internal estimates at one hearing. Comparable before and after case processing records have not been supplied.",
1404
+ "family": "matched_claim",
1405
+ "split": "train",
1406
+ "label": "qualified",
1407
+ "rationale": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
1408
+ "origin": "fictional",
1409
+ "annotation_status": "ai_provisional",
1410
+ "reference_span": {
1411
+ "segment": "passage",
1412
+ "start": 0,
1413
+ "end": 88,
1414
+ "quote": "Initial accounts suggest the pre-application service shortens permit reviews by 30 days."
1415
+ }
1416
+ }
1417
+ },
1418
+ {
1419
+ "pair_id": "audit-control-policy_stance",
1420
+ "left": {
1421
+ "unit_id": "audit-control-policy_stance-left",
1422
+ "event_id": "audit-control-policy_stance",
1423
+ "beat": "housing",
1424
+ "claim_type": "normative_position",
1425
+ "role": "left",
1426
+ "actor": "Hill Ward Office",
1427
+ "source_cohort": "fictional-desk",
1428
+ "genre": "report",
1429
+ "published_at": "2024-07-02T12:00:00Z",
1430
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1431
+ "evidence_status": "uncorroborated",
1432
+ "source_url": null,
1433
+ "text": "We strongly oppose the rent advice pilot. Funding legal assistance is a better choice.",
1434
+ "context": "The public record includes a service calendar and weekly outreach contact counts. It does not link contacts to shelter admissions. The surviving fragment has no attribution or surrounding text.",
1435
+ "family": "matched_claim",
1436
+ "split": "validation",
1437
+ "label": null,
1438
+ "rationale": null,
1439
+ "origin": "fictional",
1440
+ "annotation_status": "ai_provisional",
1441
+ "reference_span": null
1442
+ },
1443
+ "right": {
1444
+ "unit_id": "audit-control-policy_stance-right",
1445
+ "event_id": "audit-control-policy_stance",
1446
+ "beat": "housing",
1447
+ "claim_type": "normative_position",
1448
+ "role": "right",
1449
+ "actor": "Dock Ward Office",
1450
+ "source_cohort": "fictional-desk",
1451
+ "genre": "report",
1452
+ "published_at": "2024-07-02T12:00:00Z",
1453
+ "evidence_available_at": "2024-07-02T09:00:00Z",
1454
+ "evidence_status": "uncorroborated",
1455
+ "source_url": null,
1456
+ "text": "We strongly oppose the landlord mediation pilot. Funding mediation is a better choice.",
1457
+ "context": "The public record includes a service calendar and weekly outreach contact counts. It does not link contacts to shelter admissions.",
1458
+ "family": "matched_claim",
1459
+ "split": "validation",
1460
+ "label": null,
1461
+ "rationale": null,
1462
+ "origin": "fictional",
1463
+ "annotation_status": "ai_provisional",
1464
+ "reference_span": null
1465
+ }
1466
+ }
1467
+ ]
example/review_status.json ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "ready_for_human_reviewed_release": false,
3
+ "failures": [
4
+ "authentic_rights_and_source_required:d26598abe0d8006f9f",
5
+ "insufficient_human_reviews:d26598abe0d8006f9f",
6
+ "authentic_rights_and_source_required:f5f20cdb4d37003a8f",
7
+ "insufficient_human_reviews:f5f20cdb4d37003a8f",
8
+ "authentic_rights_and_source_required:bbd677fa3129683970",
9
+ "insufficient_human_reviews:bbd677fa3129683970",
10
+ "authentic_rights_and_source_required:96a868ff9c935cc7be",
11
+ "insufficient_human_reviews:96a868ff9c935cc7be",
12
+ "authentic_rights_and_source_required:b9591d538455048138",
13
+ "insufficient_human_reviews:b9591d538455048138",
14
+ "authentic_rights_and_source_required:937234bcb4b74a40ce",
15
+ "insufficient_human_reviews:937234bcb4b74a40ce",
16
+ "authentic_rights_and_source_required:d4368bd4f50630b038",
17
+ "insufficient_human_reviews:d4368bd4f50630b038",
18
+ "authentic_rights_and_source_required:cdad83b3f09fe1f09f",
19
+ "insufficient_human_reviews:cdad83b3f09fe1f09f",
20
+ "authentic_rights_and_source_required:53698942ca0890631b",
21
+ "insufficient_human_reviews:53698942ca0890631b",
22
+ "authentic_rights_and_source_required:8a28de1456c81de51e",
23
+ "insufficient_human_reviews:8a28de1456c81de51e",
24
+ "authentic_rights_and_source_required:47800693ba6eaa0478",
25
+ "insufficient_human_reviews:47800693ba6eaa0478",
26
+ "authentic_rights_and_source_required:2f7f4431a38852ea27",
27
+ "insufficient_human_reviews:2f7f4431a38852ea27",
28
+ "authentic_rights_and_source_required:f317a4b4158d6039db",
29
+ "insufficient_human_reviews:f317a4b4158d6039db",
30
+ "authentic_rights_and_source_required:52a64cd0ff55182422",
31
+ "insufficient_human_reviews:52a64cd0ff55182422",
32
+ "authentic_rights_and_source_required:2fa21546a2cae73cb3",
33
+ "insufficient_human_reviews:2fa21546a2cae73cb3",
34
+ "authentic_rights_and_source_required:6ef793fa68ad0e3598",
35
+ "insufficient_human_reviews:6ef793fa68ad0e3598",
36
+ "authentic_rights_and_source_required:2cc8d4044e47f3d236",
37
+ "insufficient_human_reviews:2cc8d4044e47f3d236",
38
+ "authentic_rights_and_source_required:830d0b2b49435c4438",
39
+ "insufficient_human_reviews:830d0b2b49435c4438",
40
+ "authentic_rights_and_source_required:47d6a380380332fbed",
41
+ "insufficient_human_reviews:47d6a380380332fbed",
42
+ "authentic_rights_and_source_required:97e8445cdf9f6e886b",
43
+ "insufficient_human_reviews:97e8445cdf9f6e886b",
44
+ "authentic_rights_and_source_required:40b987310b48916fda",
45
+ "insufficient_human_reviews:40b987310b48916fda",
46
+ "authentic_rights_and_source_required:65b06389dcc419eb57",
47
+ "insufficient_human_reviews:65b06389dcc419eb57",
48
+ "authentic_rights_and_source_required:5bb29da804e6a2f152",
49
+ "insufficient_human_reviews:5bb29da804e6a2f152",
50
+ "authentic_rights_and_source_required:9218034740c94015ec",
51
+ "insufficient_human_reviews:9218034740c94015ec",
52
+ "authentic_rights_and_source_required:1393382a3262cda585",
53
+ "insufficient_human_reviews:1393382a3262cda585",
54
+ "authentic_rights_and_source_required:9815c7f801acf3fb5d",
55
+ "insufficient_human_reviews:9815c7f801acf3fb5d",
56
+ "authentic_rights_and_source_required:82e984ef6a66841d30",
57
+ "insufficient_human_reviews:82e984ef6a66841d30",
58
+ "authentic_rights_and_source_required:d2ab02f3361fc0b2cd",
59
+ "insufficient_human_reviews:d2ab02f3361fc0b2cd",
60
+ "authentic_rights_and_source_required:1114de5ad9d2c3b0f8",
61
+ "insufficient_human_reviews:1114de5ad9d2c3b0f8",
62
+ "authentic_rights_and_source_required:b0120fc5406a135c58",
63
+ "insufficient_human_reviews:b0120fc5406a135c58",
64
+ "authentic_rights_and_source_required:b3d0ca3070eb4956a8",
65
+ "insufficient_human_reviews:b3d0ca3070eb4956a8",
66
+ "authentic_rights_and_source_required:73528e4cd5401c624e",
67
+ "insufficient_human_reviews:73528e4cd5401c624e",
68
+ "authentic_rights_and_source_required:ec9485ca45c33e129a",
69
+ "insufficient_human_reviews:ec9485ca45c33e129a",
70
+ "authentic_rights_and_source_required:a3d10f8497782e09a7",
71
+ "insufficient_human_reviews:a3d10f8497782e09a7",
72
+ "authentic_rights_and_source_required:cf9410ddcf34c1de49",
73
+ "insufficient_human_reviews:cf9410ddcf34c1de49",
74
+ "authentic_rights_and_source_required:5e1254427d1b721691",
75
+ "insufficient_human_reviews:5e1254427d1b721691",
76
+ "authentic_rights_and_source_required:a33a0b5a98404326ff",
77
+ "insufficient_human_reviews:a33a0b5a98404326ff",
78
+ "authentic_rights_and_source_required:f529392c50d4f73f68",
79
+ "insufficient_human_reviews:f529392c50d4f73f68",
80
+ "authentic_rights_and_source_required:dff6baa9e154658d96",
81
+ "insufficient_human_reviews:dff6baa9e154658d96",
82
+ "authentic_rights_and_source_required:6b79b6e3245dbfe0d0",
83
+ "insufficient_human_reviews:6b79b6e3245dbfe0d0",
84
+ "approval_required:methods_reviewer",
85
+ "approval_required:independent_reproduction_engineer"
86
+ ],
87
+ "artifact_sha256": "f4f6a21ec71e7196a5fc364341dd3989ef0a600b3d703f7d3700cfc9446a3b36",
88
+ "verification": "record_validation_only"
89
+ }
example/scorecard.json ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metric_version": "doxa-measures-0.1.0",
3
+ "eligible_pairs": 20,
4
+ "eligible_events": 20,
5
+ "complete_pairs": 16,
6
+ "left": {
7
+ "presented_as_fact": 12,
8
+ "unresolved": 4,
9
+ "eligible": 20,
10
+ "bounds": [
11
+ 0.6,
12
+ 0.8
13
+ ]
14
+ },
15
+ "right": {
16
+ "presented_as_fact": 4,
17
+ "unresolved": 0,
18
+ "eligible": 20,
19
+ "bounds": [
20
+ 0.2,
21
+ 0.2
22
+ ]
23
+ },
24
+ "gap_bounds": [
25
+ 0.39999999999999997,
26
+ 0.6000000000000001
27
+ ],
28
+ "complete_pair_gap": 0.75,
29
+ "event_bootstrap_interval": [
30
+ 0.5,
31
+ 0.9375
32
+ ],
33
+ "exclusions": {
34
+ "different_genre": 1,
35
+ "evidence_unavailable_at_publication": 1,
36
+ "not_a_factual_comparison": 1,
37
+ "outside_48_hour_window": 1,
38
+ "uncorroborated_evidence_required": 1
39
+ },
40
+ "pairs": [
41
+ {
42
+ "pair_id": "c03e6ac986faafadef",
43
+ "eligible": true,
44
+ "event_id": "housing-pilot",
45
+ "left_label": "asserted",
46
+ "right_label": "attributed"
47
+ },
48
+ {
49
+ "pair_id": "7bf10eb02bf3a89858",
50
+ "eligible": true,
51
+ "event_id": "shelter-capacity",
52
+ "left_label": "asserted",
53
+ "right_label": "attributed"
54
+ },
55
+ {
56
+ "pair_id": "0ab6941e2e8681e898",
57
+ "eligible": true,
58
+ "event_id": "repair-grants",
59
+ "left_label": "asserted",
60
+ "right_label": "attributed"
61
+ },
62
+ {
63
+ "pair_id": "a56e3b6af2400eebc6",
64
+ "eligible": true,
65
+ "event_id": "zoning-review",
66
+ "left_label": "attributed",
67
+ "right_label": "qualified"
68
+ },
69
+ {
70
+ "pair_id": "4202e1c752e74572be",
71
+ "eligible": true,
72
+ "event_id": "street-outreach",
73
+ "left_label": "insufficient_context",
74
+ "right_label": "asserted"
75
+ },
76
+ {
77
+ "pair_id": "17c44300e51f6dd622",
78
+ "eligible": true,
79
+ "event_id": "border-screening",
80
+ "left_label": "asserted",
81
+ "right_label": "attributed"
82
+ },
83
+ {
84
+ "pair_id": "dd0cf3252d66375358",
85
+ "eligible": true,
86
+ "event_id": "appeal-window",
87
+ "left_label": "asserted",
88
+ "right_label": "attributed"
89
+ },
90
+ {
91
+ "pair_id": "3713cd263286eda181",
92
+ "eligible": true,
93
+ "event_id": "language-access",
94
+ "left_label": "asserted",
95
+ "right_label": "attributed"
96
+ },
97
+ {
98
+ "pair_id": "4b86373e095427922c",
99
+ "eligible": true,
100
+ "event_id": "work-permits",
101
+ "left_label": "attributed",
102
+ "right_label": "qualified"
103
+ },
104
+ {
105
+ "pair_id": "d3de754899a079c1f2",
106
+ "eligible": true,
107
+ "event_id": "hosting-program",
108
+ "left_label": "insufficient_context",
109
+ "right_label": "asserted"
110
+ },
111
+ {
112
+ "pair_id": "3628f0599a6b447a8d",
113
+ "eligible": true,
114
+ "event_id": "audit-savings",
115
+ "left_label": "asserted",
116
+ "right_label": "attributed"
117
+ },
118
+ {
119
+ "pair_id": "f922a501fcb9ece2f3",
120
+ "eligible": true,
121
+ "event_id": "school-procurement",
122
+ "left_label": "asserted",
123
+ "right_label": "attributed"
124
+ },
125
+ {
126
+ "pair_id": "0174b2f54c94db7bde",
127
+ "eligible": true,
128
+ "event_id": "transit-fare",
129
+ "left_label": "asserted",
130
+ "right_label": "attributed"
131
+ },
132
+ {
133
+ "pair_id": "90a9de5c0f8d32c0e7",
134
+ "eligible": true,
135
+ "event_id": "flood-fund",
136
+ "left_label": "attributed",
137
+ "right_label": "qualified"
138
+ },
139
+ {
140
+ "pair_id": "06abb64872dea9fab8",
141
+ "eligible": true,
142
+ "event_id": "inspector-posts",
143
+ "left_label": "insufficient_context",
144
+ "right_label": "asserted"
145
+ },
146
+ {
147
+ "pair_id": "32a65d3500a0bf22a1",
148
+ "eligible": true,
149
+ "event_id": "ceasefire-monitoring",
150
+ "left_label": "asserted",
151
+ "right_label": "attributed"
152
+ },
153
+ {
154
+ "pair_id": "08117dbbe8d2215ce1",
155
+ "eligible": true,
156
+ "event_id": "aid-inspections",
157
+ "left_label": "asserted",
158
+ "right_label": "attributed"
159
+ },
160
+ {
161
+ "pair_id": "5fec722087d94c3b67",
162
+ "eligible": true,
163
+ "event_id": "reconstruction",
164
+ "left_label": "asserted",
165
+ "right_label": "attributed"
166
+ },
167
+ {
168
+ "pair_id": "bdef4f63079fcaf5a1",
169
+ "eligible": true,
170
+ "event_id": "access-crossing",
171
+ "left_label": "attributed",
172
+ "right_label": "qualified"
173
+ },
174
+ {
175
+ "pair_id": "4179f14f86d35875ba",
176
+ "eligible": true,
177
+ "event_id": "civilian-briefing",
178
+ "left_label": "insufficient_context",
179
+ "right_label": "asserted"
180
+ },
181
+ {
182
+ "pair_id": "audit-control-genre_mismatch",
183
+ "eligible": false,
184
+ "reason": "different_genre"
185
+ },
186
+ {
187
+ "pair_id": "audit-control-time_mismatch",
188
+ "eligible": false,
189
+ "reason": "outside_48_hour_window"
190
+ },
191
+ {
192
+ "pair_id": "audit-control-later_evidence",
193
+ "eligible": false,
194
+ "reason": "evidence_unavailable_at_publication"
195
+ },
196
+ {
197
+ "pair_id": "audit-control-different_support",
198
+ "eligible": false,
199
+ "reason": "uncorroborated_evidence_required"
200
+ },
201
+ {
202
+ "pair_id": "audit-control-policy_stance",
203
+ "eligible": false,
204
+ "reason": "not_a_factual_comparison"
205
+ }
206
+ ]
207
+ }
methods.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "revision": "doxa-measures-0.1.0",
3
+ "measures": [
4
+ {
5
+ "id": "evidence_standard_gap",
6
+ "question": "For comparable uncorroborated claims, how often does coverage present each side's claim as fact?",
7
+ "unit": "Matched pair of eligible claims, ordered by analyst-defined comparison role",
8
+ "denominator": "Matched claims per role, including unresolved review as an explicit unknown",
9
+ "calculates": "Right and left prevalence bounds. Gap computed as left minus right.",
10
+ "excludes": "Different event, claim type, genre, source-policy cohort, comparable evidence status or publication window beyond 48 hours.",
11
+ "sources": ["https://aclanthology.org/D19-1664/", "https://aclanthology.org/2020.coling-main.556/", "https://doi.org/10.1145/3442188.3445901"]
12
+ },
13
+ {
14
+ "id": "loaded_wording_rate",
15
+ "question": "What share of eligible passages contains reviewer-supported loaded wording?",
16
+ "unit": "One annotated passage with known speaker and target scope",
17
+ "denominator": "Eligible annotated passages, with unresolved judgments counted explicitly",
18
+ "calculates": "Lower and upper prevalence bounds for loaded wording.",
19
+ "excludes": "Passages whose annotation says ineligible. Quoted language needs a speaker and scope.",
20
+ "sources": ["https://aclanthology.org/2021.findings-emnlp.101/"]
21
+ },
22
+ {
23
+ "id": "frame_prevalence",
24
+ "question": "Which frames are foregrounded in an eligible sample?",
25
+ "unit": "One eligible paragraph with zero or more reviewer-supported frames",
26
+ "denominator": "Eligible paragraphs, with unresolved judgments counted explicitly",
27
+ "calculates": "Per-frame rates and bounds. A paragraph may count in several frames.",
28
+ "excludes": "Passages excluded by the collection protocol. A frame records emphasis and implies no bias conclusion by itself.",
29
+ "sources": ["https://aclanthology.org/P15-2072/", "https://aclanthology.org/2024.acl-long.822/"]
30
+ }
31
+ ]
32
+ }
methods.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b83a9d5df1f9cf386d6aa59e8614192e3aba587224eca4194e05fe770f7f047f
3
+ size 4964
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ scikit-learn==1.9.1
2
+ pyarrow==26.0.1
3
+ pytest==9.2.0
tests/test_pipeline.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from pathlib import Path
3
+ import sys
4
+ from threading import Thread
5
+ from urllib.error import HTTPError
6
+ from urllib.request import Request, urlopen
7
+
8
+ import pytest
9
+
10
+ project = Path(__file__).resolve().parents[1]
11
+ sys.path.insert(0,str(project/"tools" if (project/"tools").is_dir() else project))
12
+ from build_data import ROOT, build
13
+ from evidence_model import PortableModel
14
+ from methods import annotated_rates, compare, match_exclusion, review_gate, valid_span
15
+ from service import ThreadingHTTPServer, handler
16
+
17
+
18
+ def test_pair_rules_counts_and_unresolved_bounds():
19
+ rows,pairs,splits=build()
20
+ report=compare(pairs)
21
+ assert report["eligible_pairs"]==20
22
+ assert report["complete_pairs"]==16
23
+ assert report["gap_bounds"]==pytest.approx([.4,.6])
24
+ assert report["left"]["presented_as_fact"]==12
25
+ assert report["right"]["presented_as_fact"]==4
26
+ assert report["exclusions"]["not_a_factual_comparison"]==1
27
+ assert len(report["exclusions"])==5
28
+ assert len({row["event_id"] for row in rows})==20
29
+ assert all(row["split"]==splits[row["event_id"]] and valid_span(row,row["reference_span"]) for row in rows)
30
+ with pytest.raises(ValueError, match="Duplicate pair ID"):
31
+ compare([pairs[0],pairs[0]])
32
+ assert match_exclusion(pairs[0]["left"],{**pairs[0]["right"],"published_at":"2024-02-31T12:00:00Z"})=="timestamp_missing_or_invalid"
33
+ assert compare([])["gap_bounds"] is None
34
+
35
+
36
+ def test_independent_review_and_reproduction_gate():
37
+ row={"unit_id":"r1","origin":"authentic","source_url":"https://example.com/record",
38
+ "source_sha256":"1"*64,"rights_basis":"example documentation","label":"asserted","text":"One claim.",
39
+ "reference_span":{"segment":"passage","start":0,"end":10,"quote":"One claim."},
40
+ "reviews":[{"reviewer_id":"one","origin":"human","independent":True,"label":"asserted"},
41
+ {"reviewer_id":"two","origin":"human","independent":True,"label":"attributed"}]}
42
+ digest="0"*64
43
+ approvals=[{"role":role,"reviewer_id":name,"artifact_sha256":digest,"recorded_at":"2026-11-27",
44
+ "origin":"human","decision":"approve","independent":True}
45
+ for role,name in [("methods_reviewer","three"),("independent_reproduction_engineer","four")]]
46
+ assert "adjudication_required:r1" in review_gate([row],approvals,digest)["failures"]
47
+ row["adjudication"]={"reviewer_id":"five","label":"asserted","rationale":"fixture rationale"}
48
+ assert review_gate([row],approvals,digest)["ready_for_human_reviewed_release"]
49
+ assert not review_gate([row],approvals,"2"*64)["ready_for_human_reviewed_release"]
50
+ assert not review_gate([{**row,"origin":"fictional"}],approvals,digest)["ready_for_human_reviewed_release"]
51
+ assert not review_gate([row],[*approvals[:1],{**approvals[1],"reviewer_id":"three"}],digest)["ready_for_human_reviewed_release"]
52
+ assert not review_gate([],[],digest)["ready_for_human_reviewed_release"]
53
+
54
+
55
+ def test_annotation_rates_keep_unknown_denominator():
56
+ rate=annotated_rates([{"eligible":True,"status":"reviewed","loaded_wording":True,"frames":["human_impact"]},
57
+ {"eligible":True,"status":"unresolved"},{"eligible":False,"status":"unresolved"}])
58
+ assert rate["eligible"]==2 and rate["unresolved"]==1
59
+ assert rate["loaded_wording_rate"]==[.5,1]
60
+ assert rate["frame_prevalence"]["causal_responsibility"]==[0,.5]
61
+
62
+
63
+ def test_loopback_predict_scorecard_unqualified_text():
64
+ model=PortableModel(ROOT/"work"/"model.json")
65
+ rows,pairs,_=build()
66
+ selected=next(row for row in rows if row["family"]=="context_flip" and row["label"]=="attributed")
67
+ with ThreadingHTTPServer(("127.0.0.1",0),handler(model)) as server:
68
+ thread=Thread(target=server.serve_forever,daemon=True)
69
+ thread.start()
70
+ base=f"http://127.0.0.1:{server.server_port}"
71
+ def post(endpoint,value):
72
+ req=Request(base+endpoint,json.dumps(value).encode(),{"Content-Type":"application/json"})
73
+ with urlopen(req,timeout=10) as response:
74
+ assert response.headers["Cache-Control"]=="no-store"
75
+ return json.load(response)
76
+ try:
77
+ assert json.load(urlopen(base+"/health",timeout=10))["status"]=="ok"
78
+ result=post("/v1/predict",{"claim_type":"budget","text":selected["text"],"context":selected["context"]})
79
+ assert result["decision"]=="attributed" and valid_span(selected,result["evidence"])
80
+ assert post("/v1/predict",{"claim_type":"normative_position","text":"I oppose the policy."})["status"]=="out_of_scope"
81
+ assert post("/v1/predict",{"claim_type":"budget","text":"𐄂"})["status"]=="abstained"
82
+ assert post("/v1/scorecard",{"pairs":pairs})["eligible_pairs"]==20
83
+ with pytest.raises(HTTPError) as error:
84
+ post("/v1/predict",{"claim_type":"budget","text":"x"*6001})
85
+ assert error.value.code==400
86
+ finally:
87
+ server.shutdown()
88
+ thread.join()
tools/build_data.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Build development examples, paired audits and public-law retrieval seeds."""
2
+ import argparse
3
+ import csv
4
+ from hashlib import sha256
5
+ import json
6
+ from pathlib import Path
7
+
8
+ import pyarrow as pa
9
+ import pyarrow.parquet as pq
10
+
11
+ ROOT = Path(__file__).parent
12
+ PROJECT = ROOT.parent
13
+ VERSION = "0.1.0"
14
+
15
+ # The same proposition is tested under different presentation and context.
16
+ # Variants are generated from authored templates and retained as families.
17
+ TEMPLATES = (
18
+ ("asserted", "assertion", "{claim}. The outcome already applies across the program.",
19
+ "This is the reporter's own summary. {context}"),
20
+ ("attributed", "attribution", "{actor} said that {claim}. The statement was made at the briefing.",
21
+ "This is coverage of the briefing. {context}"),
22
+ ("qualified", "qualification", "The early figures could suggest that {claim}. The available figures are preliminary.",
23
+ "The writer offers an inference and states a limitation. {context}"),
24
+ ("insufficient_context", "fragment", "{claim}.",
25
+ "{context} The surviving fragment has no title, author or quotation markers. Its relation to the coverage is unresolved."),
26
+ ("asserted", "context_flip", "{claim}.",
27
+ "{context} In the complete article this is the reporter's own concluding statement."),
28
+ ("attributed", "context_flip", "{claim}.",
29
+ "{context} In the complete transcript this is a selected quotation attributed to the agency representative. The reporter makes no independent assertion."),
30
+ ("attributed", "rebuttal", "{claim}. The finding was cited in the meeting.",
31
+ "{context} This line paraphrases a claim the review panel expressly rejected. It is retained in the record to document the disagreement."),
32
+ ("qualified", "scope_boundary", "The committee argues that {claim}. If the recorded sample is representative, the result might hold more broadly.",
33
+ "{context} The analyst treats the result as conditional on sample coverage."),
34
+ )
35
+
36
+ RATIONALES = {
37
+ "asserted": "The focal coverage adopts the proposition as its own conclusion.",
38
+ "attributed": "The proposition is reported as someone else's statement, with its speaker supplied.",
39
+ "qualified": "The focal coverage explicitly conditions the conclusion on uncertainty or scope.",
40
+ "insufficient_context": "The retained fragment lacks enough information to identify the focal speaker's commitment.",
41
+ }
42
+
43
+
44
+ def digest(value):
45
+ return sha256(value.encode()).hexdigest()
46
+
47
+
48
+ def sentence_case(text):
49
+ return text[:1].upper() + text[1:]
50
+
51
+
52
+ def unit(event, index, role, label, family, passage, context, split):
53
+ event_id = event["event_id"]
54
+ ident = digest(f"{event_id}|{index}|{role}")[:18]
55
+ start = 0
56
+ end = passage.index(".") + 1
57
+ if family == "context_flip" or label == "insufficient_context":
58
+ start = context.index(event["context"]) + len(event["context"]) + 1
59
+ end = len(context)
60
+ source = context
61
+ segment = "context"
62
+ else:
63
+ source = passage
64
+ if family == "scope_boundary":
65
+ start = end + 1
66
+ end = len(passage)
67
+ segment = "passage"
68
+ return {
69
+ "unit_id": ident, "event_id": event_id, "beat": event["beat"],
70
+ "claim_type": event["claim_type"], "role": role, "actor": event[f"actor_{role}"],
71
+ "source_cohort": "fictional-desk", "genre": "report", "published_at": "2024-07-02T12:00:00Z",
72
+ "evidence_available_at": "2024-07-02T09:00:00Z", "evidence_status": "uncorroborated",
73
+ "source_url": None, "text": passage, "context": context, "family": family, "split": split,
74
+ "label": label, "rationale": RATIONALES[label], "origin": "fictional", "annotation_status": "ai_provisional",
75
+ "reference_span": {"segment": segment, "start": start, "end": end, "quote": source[start:end]},
76
+ }
77
+
78
+
79
+ def build():
80
+ with (ROOT / "corpus" / "dossiers.tsv").open() as source:
81
+ events = list(csv.DictReader(source, delimiter="\t"))
82
+ strata = {}
83
+ for event in events:
84
+ strata.setdefault(event["beat"], []).append(event["event_id"])
85
+ splits = {}
86
+ for ids in strata.values():
87
+ ordered = sorted(ids, key=lambda value: digest("1729|" + value))
88
+ splits.update(zip(ordered, ("train", "train", "train", "validation", "development_test"), strict=True))
89
+ rows = []
90
+ audit = []
91
+ for index, event in enumerate(events):
92
+ event_id = event["event_id"]
93
+ split = splits[event_id]
94
+ statuses = ("asserted", "attributed") if index % 5 < 3 else (
95
+ ("attributed", "qualified") if index % 5 == 3 else ("insufficient_context", "asserted")
96
+ )
97
+ paired = {}
98
+ for role, label in zip(("left", "right"), statuses, strict=True):
99
+ claim = event[f"{role}_claim"]
100
+ actor = event[f"actor_{role}"]
101
+ sentences = {
102
+ "asserted": f"{sentence_case(claim)}. The changes are visible in the current period.",
103
+ "attributed": f"{actor} announced that {claim}. The review is still open.",
104
+ "qualified": f"Initial accounts suggest {claim}. The evidence remains provisional.",
105
+ "insufficient_context": f"{sentence_case(claim)}.",
106
+ }
107
+ context = event["context"]
108
+ if label == "insufficient_context":
109
+ context += " The surviving fragment has no attribution or surrounding text."
110
+ item = unit(event, 99, role, label, "matched_claim", sentences[label], context, split)
111
+ rows.append(item)
112
+ paired[role] = item
113
+ audit.append({"pair_id": digest("audit|" + event_id)[:18], **paired})
114
+ for offset, (label, family, text, context) in enumerate(TEMPLATES):
115
+ role = "left" if offset in (3, 4, 5) else ("right" if offset % 2 else "left")
116
+ replacements = {"claim": event[f"{role}_claim"], "actor": event[f"actor_{role}"], "context": event["context"]}
117
+ row = unit(event, offset, role, label, family, sentence_case(text.format(**replacements)),
118
+ context.format(**replacements), split)
119
+ rows.append(row)
120
+ assert len({row["unit_id"] for row in rows}) == 200
121
+ for row in rows:
122
+ span = row["reference_span"]
123
+ text = row["context"] if span["segment"] == "context" else row["text"]
124
+ assert span["quote"] and text[span["start"]:span["end"]] == span["quote"]
125
+ # Each context switch shares the passage byte for byte and changes only the context.
126
+ for event in events:
127
+ variants = [x for x in rows if x["event_id"] == event["event_id"] and x["family"] == "context_flip"]
128
+ assert len(variants) == 2 and variants[0]["text"] == variants[1]["text"]
129
+ assert {x["label"] for x in variants} == {"asserted", "attributed"}
130
+ controls = [
131
+ ("genre_mismatch", "genre", "opinion"),
132
+ ("time_mismatch", "published_at", "2024-07-05T12:00:00Z"),
133
+ ("later_evidence", "evidence_available_at", "2024-07-06T09:00:00Z"),
134
+ ("different_support", "evidence_status", "corroborated"),
135
+ ("policy_stance", "claim_type", "normative_position"),
136
+ ]
137
+ for index, (name, key, value) in enumerate(controls):
138
+ fixture = audit[index]
139
+ ident = f"audit-control-{name}"
140
+ left = {**fixture["left"], "unit_id": ident+"-left", "event_id": ident}
141
+ right = {**fixture["right"], "unit_id": ident+"-right", "event_id": ident, key:value}
142
+ if name == "policy_stance":
143
+ left.update(claim_type=value, text="We strongly oppose the rent advice pilot. Funding legal assistance is a better choice.",
144
+ label=None, rationale=None, reference_span=None)
145
+ right.update(text="We strongly oppose the landlord mediation pilot. Funding mediation is a better choice.",
146
+ label=None, rationale=None, reference_span=None)
147
+ audit.append({"pair_id": ident, "left": left, "right": right})
148
+ return rows, audit, splits
149
+
150
+
151
+ def json_file(path, value):
152
+ path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
153
+
154
+
155
+ def main():
156
+ parser = argparse.ArgumentParser(description=__doc__)
157
+ parser.add_argument("--out", type=Path, default=ROOT / "work")
158
+ parser.add_argument("--evidence", type=Path, default=PROJECT / "release_staging" / "conflict" / "passages.parquet")
159
+ args = parser.parse_args()
160
+ out = args.out
161
+ out.mkdir(parents=True, exist_ok=True)
162
+ rows, audit, splits = build()
163
+ for split in ("train", "validation", "development_test"):
164
+ pq.write_table(pa.Table.from_pylist([row for row in rows if row["split"] == split]), out / f"{split}.parquet")
165
+ pq.write_table(pa.Table.from_pylist(audit), out / "audit_pairs.parquet")
166
+ retrieved = pq.read_table(args.evidence)
167
+ pq.write_table(retrieved, out / "licensed_evidence.parquet")
168
+ json_file(out / "audit_pairs.json", audit)
169
+ json_file(out / "split_manifest.json", {"revision": VERSION, "assignment": splits, "algorithm": "sha256 within beat"})
170
+ print(f"{len(rows)} fictional development rows, {len(audit)} matched pairs, {retrieved.num_rows} public-law evidence passages")
171
+
172
+
173
+ if __name__ == "__main__":
174
+ main()
tools/challenge.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Score context-switch diagnostics with templates held outside training."""
2
+ import csv
3
+
4
+ from build_data import ROOT, digest, json_file
5
+ from evidence_model import PortableModel, evaluate
6
+
7
+
8
+ def run():
9
+ rows=[]
10
+ with (ROOT/"corpus"/"context_challenge.tsv").open() as file:
11
+ for record in csv.DictReader(file,delimiter="\t"):
12
+ for label in ("asserted","attributed"):
13
+ context=record[f"{label}_context"]
14
+ cue=record[f"{label}_evidence"]
15
+ offset=context.index(cue)
16
+ rows.append({"unit_id":digest(record["event_id"]+"|"+label)[:18],
17
+ "event_id":record["event_id"],"family":"context_flip",
18
+ "text":record["passage"],"context":context,"label":label,
19
+ "origin":"fictional","annotation_status":"ai_provisional",
20
+ "reference_span":{"segment":"context","start":offset,"end":offset+len(cue),"quote":cue}})
21
+ work=ROOT/"work"
22
+ import pyarrow as pa
23
+ import pyarrow.parquet as pq
24
+ pq.write_table(pa.Table.from_pylist(rows),work/"context_challenge.parquet")
25
+ model=PortableModel(work/"model.json")
26
+ report={mode:evaluate(model,rows,mode) for mode in ("passage_only","with_context")}
27
+ report["status"]="Fictional manual diagnostics added after model design. No tuning on them."
28
+ json_file(work/"challenge_results.json",report)
29
+ for mode in ("passage_only","with_context"):
30
+ stats=report[mode]
31
+ print(mode,stats["paired_both_correct"],"/",stats["paired_context_switches"],
32
+ "both decisions correct", round(stats["coverage"],3),"coverage")
33
+
34
+
35
+ if __name__=="__main__":
36
+ run()
tools/corpus/context_challenge.tsv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ event_id passage asserted_context attributed_context asserted_evidence attributed_evidence
2
+ emergency-topup The supplement covered the final ten invoices. The newsletter opens with the desk's account of how the fund was spent. The minutes only record a funding ceiling. Minutes, item 7, remarks of the treasurer. The minutes do not certify payment. the desk's account of how the fund was spent remarks of the treasurer
3
+ clinic-attendance Attendance rose after the clinic extended its hours. The line appears under the newsroom's own account of turnout. No attendance register was released. An appendix reproduces the district health office's response to the journalist's questions. No attendance register was released. the newsroom's own account of turnout the district health office's response
4
+ review-clock The new portal cleared the October backlog. The first paragraph summarises what the desk says happened after launch. The agency released a launch date only. The panel called a programme manager. The transcript presents this sentence as part of the manager's account. what the desk says happened after launch part of the manager's account
5
+ monitoring-record The team logged every incident in the valley. This appears in a statement of findings issued in the bulletin's own voice. The team has not released the underlying registers. The sentence is excerpted from the mission's written reply to the bulletin. The bulletin says completeness could not be verified. the bulletin's own voice the mission's written reply
6
+ assessment-funding The new grant met the whole allocation. The desk's summary treats the allocation as a completed payment. It supplies no transaction record. In the finance committee transcript, this is a member's claim while challenging the accounts. The clerk records both positions. The desk's summary treats the allocation as a completed payment a member's claim while challenging the accounts
7
+ delivery-time The deliveries reached every planned site. The report's anonymous narrator supplies this as a finding. The only annex is the planned route list. The annex attaches a dispatch lead's message to the allegation and includes no independent confirmation. The report's anonymous narrator supplies this as a finding a dispatch lead's message
8
+ campus-access The new entrances eliminated the evening queue. The coverage writer makes this the central finding. The release includes drawings and no traffic counts. The line follows the transcript speaker heading Facilities Director. A student challenges the statement in the next turn. The coverage writer makes this the central finding the transcript speaker heading Facilities Director
9
+ permit-receipts The fee change cut the average application cost. The outlet issues a factual summary for readers based on an unverified briefing. Neither receipts nor per-application calculations appear. The release reproduces a passage from a committee member's opening statement. Neither receipts nor per-application calculations appear. The outlet issues a factual summary a committee member's opening statement
tools/corpus/dossiers.tsv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ event_id beat claim_type actor_left actor_right left_claim right_claim context
2
+ housing-pilot housing service_effect North Borough Housing Committee River District Housing Office the rent advice pilot reduced filing delays the landlord mediation pilot reduced filing delays The fictional municipal review compares initial filings from the same intake month. Staff have supplied headline counts without a measure of participant mix.
3
+ shelter-capacity housing capacity Old Market Council Lakeside Council the converted library can serve 80 people overnight the converted depot can serve 80 people overnight Both committees circulated estimated bed capacities before fire and accessibility inspections concluded.
4
+ repair-grants housing budget Dune Housing Board Brook Tenants Committee the repair grant covers all listed buildings the rehabilitation grant covers all listed buildings The proposals identify the eligible building list. Neither proposal includes an obligation or payment ledger.
5
+ zoning-review housing procedural_change Cedar Planning Panel Alder Planning Board the zoning change shortens permit reviews by 30 days the pre-application service shortens permit reviews by 30 days Both groups presented internal estimates at one hearing. Comparable before and after case processing records have not been supplied.
6
+ street-outreach housing service_effect Hill Ward Office Dock Ward Office the late shift brought more residents into shelter the morning shift brought more residents into shelter The public record includes a service calendar and weekly outreach contact counts. It does not link contacts to shelter admissions.
7
+ border-screening migration service_effect Eastgate Intake Team Westfield Intake Team the new screening lane cut interview waits the new intake calendar cut interview waits The review covers two crossings with similar interview hours and no before-and-after wait dataset.
8
+ appeal-window migration procedural_change Estuary Appeals Office Highland Appeals Office the online form increased completed appeals the mail-in form increased completed appeals Offices supply preliminary application starts. No complete status file was available by the publication deadline.
9
+ language-access migration service_effect Pines Civic Office Canal Civic Office the interpreter roster increased appointment attendance the translation desk increased appointment attendance Both offices extended support. Published headcounts do not report scheduled appointments or attendance by language.
10
+ work-permits migration service_effect North Quay Permit Unit South Quay Permit Unit the new review pilot raised the number of decisions the weekend review pilot raised the number of decisions The units announced results from a pilot month without publishing the files used to count decisions.
11
+ hosting-program migration budget Marsh County Office Elm County Office the housing stipend reached all eligible households the transport stipend reached all eligible households The review has authorized spending ceilings and eligibility criteria. Payment records are missing for both programs.
12
+ audit-savings spending budget Redwood Audit Committee Flint Budget Panel the purchasing consolidation saved two million dollars the tender redesign saved two million dollars The two committees gave testimony within the same meeting. Vendor invoices and reconciliation are not in the supplied material.
13
+ school-procurement spending budget Beacon School District Harbor School District the central purchase reduced textbook costs bulk contracts reduced textbook costs Both districts shared proposed contract prices. The comparison lacks invoiced quantities and delivery charges.
14
+ transit-fare spending service_effect Acorn Transit Board Bridge Transit Board the lower fare increased weekday ridership the day pass increased weekday ridership Operators shared promotional figures. Monthly trip records and service changes are unavailable for both.
15
+ flood-fund spending budget Meadow Emergency Board Stone Emergency Board the drainage fund covered half the repair cost the emergency grant covered half the repair cost Totals in the meeting packet are funding authorizations. Contractor invoices were not attached.
16
+ inspector-posts spending capacity Fern Municipal Office Mill Municipal Office the hiring program filled 25 inspector posts the transfer program filled 25 inspector posts The establishments list approved roles and interview schedules. No completed appointment register accompanied the announcements.
17
+ ceasefire-monitoring conflict procedural_change Linden Delegation Granite Delegation the monitoring arrangement recorded all reported violations the liaison arrangement recorded all reported violations The simulated ceasefire docket contains mandates and meeting notes. No complete incident register was released.
18
+ aid-inspections conflict service_effect Valley Relief Office Summit Relief Office the inspection protocol accelerated food deliveries the scheduling protocol accelerated food deliveries The dispatch summaries include planned inspection times. Confirmed delivery timestamps were absent at the reporting cutoff.
19
+ reconstruction conflict budget Blue Harbor Mission Sandplain Mission the reconstruction fund disbursed the pledged amount the housing fund disbursed the pledged amount Both missions issued pledges. The public packet lacks payment records from either mission.
20
+ access-crossing conflict service_effect Cobalt Crossing Office Copper Crossing Office the morning reopening increased medical visits the evening reopening increased medical visits The site plans identify clinic access windows. Neither office has supplied an attendance comparison.
21
+ civilian-briefing conflict procedural_change Gull Protection Panel Pelican Protection Panel the reporting process captured every civilian displacement the call-in process captured every civilian displacement Both claims concern the same reporting interval. The two logs contain only agency contacts and leave household coverage unknown.
tools/evidence_model.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Small portable development classifier and extractive evidence selector."""
2
+ import argparse
3
+ from collections import Counter
4
+ import json
5
+ import math
6
+ from pathlib import Path
7
+ import re
8
+
9
+ from methods import LABELS
10
+
11
+ ROOT = Path(__file__).parent
12
+ FEATURE = re.compile(r"\b[^\W_]+\b", re.UNICODE)
13
+ SENTENCE = re.compile(r"\S.*?(?:[.!?](?=\s|$)|(?=\n)|$)", re.S)
14
+
15
+
16
+ def features(text, channel):
17
+ tokens = FEATURE.findall(text.casefold())
18
+ counts = Counter(f"{channel}:w:{value}" for value in tokens)
19
+ counts.update(f"{channel}:b:{a} {b}" for a, b in zip(tokens, tokens[1:]))
20
+ return counts
21
+
22
+
23
+ def inputs(text, context, with_context):
24
+ result = features(text, "p")
25
+ if with_context:
26
+ result.update(features(context, "c"))
27
+ return result
28
+
29
+
30
+ def candidates(text, context):
31
+ for segment, value in (("passage",text),("context",context)):
32
+ for match in SENTENCE.finditer(value):
33
+ yield {"segment":segment,"start":match.start(),"end":match.end(),"quote":match.group()}
34
+
35
+
36
+ def rank_features(candidate, label):
37
+ return features(candidate["quote"], f'{label}:{candidate["segment"]}')
38
+
39
+
40
+ def scores(head, feature_counts):
41
+ vocabulary = head["vocabulary"]
42
+ observed = [(vocabulary[key], value) for key,value in feature_counts.items() if key in vocabulary]
43
+ if not observed:
44
+ return None
45
+ norm = math.sqrt(sum(value * value for _,value in observed))
46
+ raw = [intercept + sum(row[index] * value / norm for index,value in observed)
47
+ for row,intercept in zip(head["weights"],head["intercepts"],strict=True)]
48
+ terms = [math.exp(v - max(raw)) for v in raw]
49
+ total = sum(terms)
50
+ return {label: value / total for label,value in zip(head["classes"],terms,strict=True)}
51
+
52
+
53
+ class PortableModel:
54
+ max_chars = 6000
55
+
56
+ def __init__(self, artifact):
57
+ self.model = json.loads(Path(artifact).read_text(encoding="utf-8"))
58
+ self.revision = self.model["revision"]
59
+
60
+ def predict(self, text, context="", kind="with_context"):
61
+ if not isinstance(text,str) or not isinstance(context,str) or not text.strip():
62
+ raise ValueError("Passage must be non-empty text and context must be text")
63
+ if max(len(text),len(context)) > self.max_chars:
64
+ raise ValueError("Passage and context are limited to 6,000 Unicode characters each")
65
+ result = {"model_revision":self.revision,"architecture":kind,"decision":None,
66
+ "status":"abstained","scores":None,"evidence":None,
67
+ "annotation_status":"experimental_synthetic_development"}
68
+ probs = scores(self.model[kind],inputs(text,context,kind=="with_context"))
69
+ if not probs:
70
+ result["reason"]="no_known_features"
71
+ return result
72
+ winner = max(probs,key=probs.get)
73
+ result["scores"]=probs
74
+ if probs[winner] < self.model["decision_threshold"]:
75
+ result["reason"]="low_uncalibrated_score"
76
+ return result
77
+ if winner == "insufficient_context":
78
+ result["reason"]="insufficient_context"
79
+ return result
80
+ result.update(status="ok",decision=winner)
81
+ chosen = None
82
+ best = self.model["evidence_threshold"]
83
+ for candidate in candidates(text,context if kind=="with_context" else ""):
84
+ probability = scores(self.model["extractor"],rank_features(candidate,winner))
85
+ if probability and probability["eligible"] > best:
86
+ chosen,best = candidate,probability["eligible"]
87
+ if chosen:
88
+ result["evidence"]=chosen
89
+ return result
90
+
91
+
92
+ def fit_head(samples, labels):
93
+ from sklearn.feature_extraction import DictVectorizer
94
+ from sklearn.linear_model import LogisticRegression
95
+ from sklearn.preprocessing import normalize
96
+
97
+ vectorizer=DictVectorizer()
98
+ matrix=normalize(vectorizer.fit_transform(samples))
99
+ learner=LogisticRegression(C=8.0, max_iter=500,random_state=1729).fit(matrix,labels)
100
+ coefficients=learner.coef_
101
+ intercepts=learner.intercept_
102
+ if len(learner.classes_) == 2:
103
+ coefficients=[-coefficients[0]/2,coefficients[0]/2]
104
+ intercepts=[-intercepts[0]/2,intercepts[0]/2]
105
+ return {"vocabulary": vectorizer.vocabulary_, "classes":list(learner.classes_),
106
+ "weights":[row.tolist() for row in coefficients],
107
+ "intercepts":[float(value) for value in intercepts]}
108
+
109
+
110
+ def overlap(candidate, reference):
111
+ if not candidate or candidate["segment"] != reference["segment"]:
112
+ return 0.0
113
+ shared = max(0,min(candidate["end"],reference["end"])-max(candidate["start"],reference["start"]))
114
+ union = max(candidate["end"],reference["end"])-min(candidate["start"],reference["start"])
115
+ return shared/union
116
+
117
+
118
+ def evaluate(model, rows, kind):
119
+ from sklearn.metrics import f1_score
120
+ by_event = {}
121
+ labeled = []
122
+ for row in rows:
123
+ result=model.predict(row["text"],row["context"],kind)
124
+ # An explicit insufficient-context response is a meaningful predicted
125
+ # class; a confidence or vocabulary abstention stays unclassified.
126
+ decision=result["decision"] or ("insufficient_context" if result.get("reason")=="insufficient_context" else "abstained")
127
+ score = overlap(result["evidence"],row["reference_span"])
128
+ labeled.append({"unit_id":row["unit_id"],"event_id":row["event_id"],"family":row["family"],
129
+ "reference":row["label"],"decision":decision,"exact_span":score==1.0,
130
+ "overlap":score,**{key:result[key] for key in ("status","evidence","scores")}})
131
+ if row["family"]=="context_flip":
132
+ by_event.setdefault(row["event_id"],[]).append(decision==row["label"])
133
+ eligible_spans=[row for row in labeled if row["reference"]!="insufficient_context"]
134
+ return {
135
+ "rows":len(labeled),"events":len({row["event_id"] for row in rows}),
136
+ "macro_f1":float(f1_score([row["reference"] for row in labeled],
137
+ [row["decision"] for row in labeled],labels=list(LABELS),average="macro",zero_division=0)),
138
+ "coverage":sum(row["decision"]!="abstained" for row in labeled)/len(labeled),
139
+ "paired_context_switches":len(by_event),
140
+ "paired_both_correct":sum(len(x)==2 and all(x) for x in by_event.values()),
141
+ "correct_decision_exact_evidence":sum(row["exact_span"] and row["reference"]==row["decision"] for row in eligible_spans),
142
+ "evidence_denominator":len(eligible_spans),"outputs":labeled,
143
+ }
144
+
145
+
146
+ def train(data, out):
147
+ import pyarrow.parquet as pq
148
+ from build_data import json_file
149
+ from methods import canonical_sha
150
+ tr=pq.read_table(data/"train.parquet").to_pylist()
151
+ va=pq.read_table(data/"validation.parquet").to_pylist()
152
+ te=pq.read_table(data/"development_test.parquet").to_pylist()
153
+ parts=[{row["event_id"] for row in split} for split in (tr,va,te)]
154
+ if any(parts[a] & parts[b] for a,b in ((0,1),(0,2),(1,2))):
155
+ raise ValueError("Event leakage across splits")
156
+ model={
157
+ "revision":"0.1.0","training_data_sha256":canonical_sha(tr),
158
+ "decision_threshold":.45,"evidence_threshold":.50,
159
+ "passage_only":fit_head([inputs(row["text"],"",False) for row in tr],[row["label"] for row in tr]),
160
+ "with_context":fit_head([inputs(row["text"],row["context"],True) for row in tr],[row["label"] for row in tr]),
161
+ }
162
+ samples, labels = [],[]
163
+ for row in tr:
164
+ if row["label"]=="insufficient_context":
165
+ continue
166
+ for candidate in candidates(row["text"],row["context"]):
167
+ samples.append(rank_features(candidate,row["label"]))
168
+ labels.append("eligible" if overlap(candidate,row["reference_span"])>=.5 else "ineligible")
169
+ model["extractor"]=fit_head(samples,labels)
170
+ out.mkdir(parents=True,exist_ok=True)
171
+ json_file(out/"model.json",model)
172
+ portable=PortableModel(out/"model.json")
173
+ report={split:{kind:evaluate(portable,rows,kind) for kind in ("passage_only","with_context")}
174
+ for split,rows in (("validation",va),("development_test",te))}
175
+ report["data_status"]="Fictional template families and AI-provisional decisions. Development results only."
176
+ report["training_groups"]=[len(part) for part in parts]
177
+ report["threshold_policy"]="Fixed during implementation at 0.45 for the classifier and 0.50 for the span selector. Scores are uncalibrated."
178
+ json_file(out/"evaluation.json",report)
179
+ for kind,metrics in report["development_test"].items():
180
+ print(kind,{k:v for k,v in metrics.items() if k!="outputs"})
181
+
182
+
183
+ if __name__=="__main__":
184
+ parser=argparse.ArgumentParser(description=__doc__)
185
+ parser.add_argument("--data",type=Path,default=ROOT/"work")
186
+ parser.add_argument("--out",type=Path,default=ROOT/"work")
187
+ args=parser.parse_args()
188
+ train(args.data,args.out)
tools/methods.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Deterministic political discourse measurements and review provenance checks."""
2
+ from collections import Counter, defaultdict
3
+ from datetime import datetime, timezone
4
+ import hashlib
5
+ import json
6
+ import random
7
+ import re
8
+
9
+ VERSION = "doxa-measures-0.1.0"
10
+ LABELS = ("asserted", "attributed", "qualified", "insufficient_context")
11
+ FRAMES = ("causal_responsibility", "economic_consequence", "human_impact", "institutional_process", "public_safety")
12
+ ENGINEERING_PREVIEW = "engineering_preview"
13
+ HUMAN_REVIEWED = "human_reviewed"
14
+
15
+
16
+ def timestamp(value):
17
+ result = datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
18
+ if result.strftime("%Y-%m-%dT%H:%M:%SZ") != value:
19
+ raise ValueError("Timestamp must use UTC and second precision")
20
+ return result
21
+
22
+
23
+ def match_exclusion(left, right):
24
+ """Return the first ineligibility reason against the declared matching rule."""
25
+ for field in ("event_id", "genre", "source_cohort", "claim_type"):
26
+ if not left.get(field) or left[field] != right.get(field):
27
+ return f"different_{field}"
28
+ if left["claim_type"] not in {"budget", "capacity", "service_effect", "procedural_change"}:
29
+ return "not_a_factual_comparison"
30
+ if not left.get("actor") or not right.get("actor") or left["actor"] == right["actor"]:
31
+ return "actors_not_distinct"
32
+ if left.get("role") != "left" or right.get("role") != "right":
33
+ return "role_orientation_missing"
34
+ if any(side.get("evidence_status") != "uncorroborated" for side in (left, right)):
35
+ return "uncorroborated_evidence_required"
36
+ try:
37
+ for side in (left, right):
38
+ if timestamp(side["evidence_available_at"]) > timestamp(side["published_at"]):
39
+ return "evidence_unavailable_at_publication"
40
+ hours = abs((timestamp(left["published_at"]) - timestamp(right["published_at"])).total_seconds()) / 3600
41
+ except (ValueError, KeyError, TypeError):
42
+ return "timestamp_missing_or_invalid"
43
+ if hours > 48:
44
+ return "outside_48_hour_window"
45
+ return None
46
+
47
+
48
+ def label_bounds(numerator, unresolved, eligible):
49
+ if not eligible:
50
+ return None
51
+ return [numerator / eligible, (numerator + unresolved) / eligible]
52
+
53
+
54
+ def compare(pairs, bootstrap=1000, seed=1729):
55
+ """Compare paired presentation rates using explicit unresolved bounds."""
56
+ by_event = defaultdict(list)
57
+ exclusions = Counter()
58
+ examples = []
59
+ used_ids = set()
60
+ used_units = set()
61
+ for pair in pairs:
62
+ ident = pair["pair_id"]
63
+ if ident in used_ids:
64
+ raise ValueError(f"Duplicate pair ID: {ident}")
65
+ used_ids.add(ident)
66
+ left, right = pair["left"], pair["right"]
67
+ units = {left["unit_id"], right["unit_id"]}
68
+ if len(units) != 2 or units & used_units:
69
+ raise ValueError("Each text unit can occur in only one audit pair")
70
+ used_units.update(units)
71
+ exclusion = match_exclusion(left, right)
72
+ if exclusion:
73
+ exclusions[exclusion] += 1
74
+ examples.append({"pair_id": ident, "eligible": False, "reason": exclusion})
75
+ continue
76
+ labels = (left["label"], right["label"])
77
+ if any(label not in LABELS for label in labels):
78
+ raise ValueError(f"Unknown evidence judgment in {ident}")
79
+ values = tuple(None if label == "insufficient_context" else int(label == "asserted") for label in labels)
80
+ by_event[left["event_id"]].append(values)
81
+ examples.append({"pair_id": ident, "eligible": True, "event_id": left["event_id"],
82
+ "left_label": labels[0], "right_label": labels[1]})
83
+ all_values = [value for group in by_event.values() for value in group]
84
+ eligible = len(all_values)
85
+ sides = []
86
+ for index in (0, 1):
87
+ numer = sum(value[index] == 1 for value in all_values)
88
+ unresolved = sum(value[index] is None for value in all_values)
89
+ sides.append({"presented_as_fact": numer, "unresolved": unresolved, "eligible": eligible,
90
+ "bounds": label_bounds(numer, unresolved, eligible)})
91
+ left, right = sides
92
+ coverage = [v for v in all_values if None not in v]
93
+ gap = (sum(a - b for a, b in coverage) / len(coverage)) if coverage else None
94
+ bounds = [left["bounds"][0] - right["bounds"][1], left["bounds"][1] - right["bounds"][0]] if eligible else None
95
+ # Event-level resampling preserves dependence among pairs in one event.
96
+ groups = [tuple((a,b) for a,b in group if None not in (a,b)) for group in by_event.values()]
97
+ interval = None
98
+ if sum(bool(group) for group in groups) >= 5 and bootstrap:
99
+ rng = random.Random(seed)
100
+ samples = []
101
+ for _ in range(bootstrap):
102
+ batch = [value for group in rng.choices(groups, k=len(groups)) for value in group]
103
+ if batch:
104
+ samples.append(sum(a-b for a,b in batch) / len(batch))
105
+ if samples:
106
+ samples.sort()
107
+ interval = [samples[int(.025*(len(samples)-1))], samples[int(.975*(len(samples)-1))]]
108
+ return {
109
+ "metric_version": VERSION, "eligible_pairs": eligible, "eligible_events": len(by_event),
110
+ "complete_pairs": len(coverage), "left": left, "right": right, "gap_bounds": bounds,
111
+ "complete_pair_gap": gap, "event_bootstrap_interval": interval,
112
+ "exclusions": dict(sorted(exclusions.items())), "pairs": examples,
113
+ }
114
+
115
+
116
+ def annotated_rates(rows):
117
+ eligible = [row for row in rows if row["eligible"]]
118
+ unreviewed = sum(row["status"] != "reviewed" for row in eligible)
119
+ reviewed = [row for row in eligible if row["status"] == "reviewed"]
120
+ loaded = sum(row["loaded_wording"] for row in reviewed)
121
+ counts = Counter(frame for row in reviewed for frame in set(row["frames"]))
122
+ if set(counts) - set(FRAMES):
123
+ raise ValueError("Unknown frame")
124
+ n = len(eligible)
125
+ return {
126
+ "eligible": n, "unresolved": unreviewed,
127
+ "loaded_wording_rate": label_bounds(loaded, unreviewed, n),
128
+ "frame_prevalence": {frame: label_bounds(counts[frame], unreviewed, n) for frame in FRAMES},
129
+ }
130
+
131
+
132
+ def canonical_sha(value):
133
+ return hashlib.sha256(json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
134
+
135
+
136
+ def review_gate(rows, approvals, artifact_sha):
137
+ """Validate recorded review evidence. This is not identity attestation."""
138
+ missing = []
139
+ if not rows:
140
+ missing.append("no_reference_judgments")
141
+ for row in rows:
142
+ ident = row["unit_id"]
143
+ if (row.get("origin") != "authentic" or not str(row.get("source_url", "")).startswith("https://")
144
+ or not row.get("rights_basis") or not re.fullmatch("[a-f0-9]{64}", str(row.get("source_sha256", "")))):
145
+ missing.append(f"authentic_rights_and_source_required:{ident}")
146
+ if row.get("label") not in LABELS:
147
+ missing.append(f"invalid_label:{ident}")
148
+ span = row.get("reference_span")
149
+ if row.get("label") != "insufficient_context":
150
+ if not span or not valid_span(row, span):
151
+ missing.append(f"source_span_required:{ident}")
152
+ by_person = {x["reviewer_id"]: x for x in row.get("reviews", [])
153
+ if x["origin"] == "human" and x["independent"]}
154
+ if len(by_person) < 2:
155
+ missing.append(f"insufficient_human_reviews:{ident}")
156
+ elif row.get("origin") == "fictional":
157
+ missing.append(f"fictional_fixture:{ident}")
158
+ else:
159
+ decisions = {item["label"] for item in by_person.values()}
160
+ if len(decisions) == 1 and row.get("label") not in decisions:
161
+ missing.append(f"reference_disagrees_with_review:{ident}")
162
+ if len(decisions) > 1:
163
+ adjudication = row.get("adjudication", {})
164
+ if (adjudication.get("reviewer_id") in by_person or not adjudication.get("reviewer_id")
165
+ or adjudication.get("label") != row.get("label") or not adjudication.get("rationale")):
166
+ missing.append(f"adjudication_required:{ident}")
167
+ required = ("methods_reviewer", "independent_reproduction_engineer")
168
+ people = defaultdict(set)
169
+ for approval in approvals:
170
+ if (approval.get("artifact_sha256") == artifact_sha and approval.get("decision") == "approve"
171
+ and approval.get("origin") == "human" and approval.get("independent")
172
+ and approval.get("reviewer_id") and approval.get("recorded_at")):
173
+ people[approval["role"]].add(approval["reviewer_id"])
174
+ for role in required:
175
+ if not people[role]:
176
+ missing.append(f"approval_required:{role}")
177
+ if people[required[0]] and people[required[1]] and len(people[required[0]] | people[required[1]]) < 2:
178
+ missing.append("distinct_release_reviewers_required")
179
+ return {"ready_for_human_reviewed_release": not missing, "failures": missing,
180
+ "artifact_sha256": artifact_sha, "verification": "record_validation_only"}
181
+
182
+
183
+ def valid_span(row, span):
184
+ field = {"passage":"text", "context":"context"}.get(span.get("segment"))
185
+ source = row.get(field)
186
+ start, end = span.get("start"), span.get("end")
187
+ return (isinstance(source,str) and type(start) is int and type(end) is int
188
+ and 0 <= start < end <= len(source) and source[start:end] == span.get("quote"))
tools/review.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Produce the engineering preview audit and enforce the human release gate."""
2
+ import argparse
3
+ import json
4
+ from pathlib import Path
5
+
6
+ import pyarrow.parquet as pq
7
+
8
+ from build_data import ROOT, json_file
9
+ from methods import canonical_sha, compare, review_gate
10
+
11
+
12
+ def main():
13
+ parser=argparse.ArgumentParser(description=__doc__)
14
+ parser.add_argument("--data",type=Path,default=ROOT/"work")
15
+ parser.add_argument("--reviewed",type=Path)
16
+ parser.add_argument("--approvals",type=Path)
17
+ parser.add_argument("--require-reviewed",action="store_true")
18
+ args=parser.parse_args()
19
+ if args.require_reviewed and not (args.reviewed and args.approvals):
20
+ parser.error("A reviewed reference dataset and independent sign-off records are required")
21
+ rows = (json.loads(args.reviewed.read_text()) if args.reviewed
22
+ else pq.read_table(args.data/"development_test.parquet").to_pylist())
23
+ approvals=json.loads(args.approvals.read_text()) if args.approvals else []
24
+ identity=canonical_sha(rows)
25
+ gate=review_gate(rows,approvals,identity)
26
+ pairs=json.loads((args.data/"audit_pairs.json").read_text())
27
+ score=compare(pairs)
28
+ json_file(args.data/"scorecard.json",score)
29
+ json_file(args.data/"review_status.json",gate)
30
+ print(json.dumps({"gate":gate["ready_for_human_reviewed_release"],"failure_count":len(gate["failures"]),
31
+ "eligible_pairs":score["eligible_pairs"],"complete_pairs":score["complete_pairs"],
32
+ "gap_bounds":score["gap_bounds"],"excluded":score["exclusions"]},indent=2))
33
+ if args.require_reviewed and not gate["ready_for_human_reviewed_release"]:
34
+ raise SystemExit(2)
35
+
36
+
37
+ if __name__=="__main__":
38
+ main()
tools/service.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Loopback-only prototype for the future DOXA analysis service."""
2
+ import argparse
3
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
4
+ import json
5
+ from pathlib import Path
6
+
7
+ from evidence_model import PortableModel
8
+ from methods import VERSION, compare
9
+
10
+ FACTUAL = {"budget", "capacity", "service_effect", "procedural_change"}
11
+ LIMIT = 1_048_576
12
+
13
+
14
+ def predict(model, payload):
15
+ scope = payload.get("claim_type")
16
+ if not isinstance(scope, str) or not scope:
17
+ raise ValueError("Provide analyst-selected claim_type")
18
+ if scope not in FACTUAL:
19
+ return {"status": "out_of_scope", "decision": None, "evidence": None, "scores": None,
20
+ "reason": "A factual comparison is required. Ordinary policy criticism may be retained.",
21
+ "model_revision": model.revision}
22
+ return model.predict(payload.get("text"), payload.get("context", ""))
23
+
24
+
25
+ def handler(model):
26
+ class APIHandler(BaseHTTPRequestHandler):
27
+ def log_message(self, _format, *_args):
28
+ pass # The development service never logs input, URL or content.
29
+
30
+ def reply(self, status, value):
31
+ data=json.dumps(value,ensure_ascii=False).encode()
32
+ self.send_response(status)
33
+ self.send_header("Content-Type","application/json; charset=utf-8")
34
+ self.send_header("Content-Length",str(len(data)))
35
+ self.send_header("Cache-Control","no-store")
36
+ self.end_headers()
37
+ self.wfile.write(data)
38
+
39
+ def do_GET(self):
40
+ if self.path == "/health":
41
+ self.reply(200,{"status":"ok","tier":"loopback_engineering_preview","methods":VERSION,
42
+ "model":model.revision})
43
+ else:
44
+ self.reply(404,{"error":"unknown_route"})
45
+
46
+ def do_POST(self):
47
+ if self.path not in {"/v1/predict","/v1/scorecard"}:
48
+ self.reply(404,{"error":"unknown_route"})
49
+ return
50
+ if self.headers.get_content_type() != "application/json":
51
+ self.reply(415,{"error":"application_json_required"})
52
+ return
53
+ try:
54
+ length=int(self.headers.get("Content-Length","0"))
55
+ except ValueError:
56
+ self.reply(400,{"error":"invalid_content_length"})
57
+ return
58
+ if not 0 < length <= LIMIT:
59
+ self.reply(413,{"error":"request_size_out_of_bounds"})
60
+ return
61
+ try:
62
+ payload=json.loads(self.rfile.read(length))
63
+ if not isinstance(payload,dict):
64
+ raise ValueError
65
+ if self.path == "/v1/predict":
66
+ result=predict(model,payload)
67
+ else:
68
+ pairs=payload.get("pairs")
69
+ if not isinstance(pairs,list) or not 1 <= len(pairs) <= 200:
70
+ raise ValueError
71
+ result=compare(pairs)
72
+ result["provenance"]="request_supplied_judgments_unverified"
73
+ self.reply(200,result)
74
+ except (ValueError,KeyError,TypeError,OverflowError,AttributeError):
75
+ self.reply(400,{"error":"invalid_input"})
76
+
77
+ return APIHandler
78
+
79
+
80
+ def main():
81
+ parser=argparse.ArgumentParser(description=__doc__)
82
+ parser.add_argument("--model",type=Path,required=True)
83
+ parser.add_argument("--port",type=int,default=9010)
84
+ args=parser.parse_args()
85
+ with ThreadingHTTPServer(("127.0.0.1",args.port),handler(PortableModel(args.model))) as server:
86
+ print(f"DOXA loopback prototype at http://127.0.0.1:{server.server_port}",flush=True)
87
+ server.serve_forever()
88
+
89
+
90
+ if __name__=="__main__":
91
+ main()