reviewproof 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ coverage.xml
11
+ htmlcov/
12
+ .env
13
+
14
+ # Never commit databases or a deployment's own planted errors.
15
+ # The only planted errors allowed in this repo are synthetic examples under examples/.
16
+ *.db
17
+ *.db-wal
18
+ *.db-shm
19
+ /planted/
20
+ /local/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.5
2
+ Name: reviewproof
3
+ Version: 0.0.0
4
+ Summary: Rubber-stamp detector for AI oversight: proves whether human reviewers of AI output catch errors.
5
+ Project-URL: Repository, https://github.com/tayoakinlabi/ReviewProof
6
+ Project-URL: Issues, https://github.com/tayoakinlabi/ReviewProof/issues
7
+ Author: The ReviewProof Authors
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: ai-oversight,automation-bias,gxp,human-in-the-loop
11
+ Classifier: Development Status :: 1 - Planning
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: pyyaml>=6.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: jsonschema>=4.21; extra == 'dev'
18
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
19
+ Requires-Dist: pytest>=8; extra == 'dev'
20
+ Requires-Dist: ruff>=0.6; extra == 'dev'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # ReviewProof
24
+
25
+ A rubber-stamp detector for AI oversight: an open-source Python SDK that tests whether human
26
+ reviewers of AI output actually catch errors.
27
+
28
+ **Status: pre-release, not usable yet.** The package name is a placeholder while the core is built.
29
+
30
+ ReviewProof puts *planted errors* (items with one known defect, written and approved by your QA
31
+ team) into a real approval queue. It blocks them from ever being executed, records every review
32
+ step in a tamper-evident log, and reports how many were caught.
33
+
34
+ - It is not an approval engine and has no review UI.
35
+ - It is not pre-validated. A validation pack to adapt is planned.
36
+ - It sends no telemetry.
37
+
38
+ ## License
39
+
40
+ Apache 2.0. See [LICENSE](https://github.com/tayoakinlabi/ReviewProof/blob/main/LICENSE).
@@ -0,0 +1,18 @@
1
+ # ReviewProof
2
+
3
+ A rubber-stamp detector for AI oversight: an open-source Python SDK that tests whether human
4
+ reviewers of AI output actually catch errors.
5
+
6
+ **Status: pre-release, not usable yet.** The package name is a placeholder while the core is built.
7
+
8
+ ReviewProof puts *planted errors* (items with one known defect, written and approved by your QA
9
+ team) into a real approval queue. It blocks them from ever being executed, records every review
10
+ step in a tamper-evident log, and reports how many were caught.
11
+
12
+ - It is not an approval engine and has no review UI.
13
+ - It is not pre-validated. A validation pack to adapt is planned.
14
+ - It sends no telemetry.
15
+
16
+ ## License
17
+
18
+ Apache 2.0. See [LICENSE](https://github.com/tayoakinlabi/ReviewProof/blob/main/LICENSE).
@@ -0,0 +1,19 @@
1
+ # Demo workflow: deviation triage
2
+
3
+ An AI agent proposes a triage for a manufacturing deviation, and a QA reviewer approves, edits or
4
+ rejects it before it is written to the quality system.
5
+
6
+ **All data here is synthetic.** Products, lots, deviations and findings are invented. They are
7
+ demo examples, not classification guidance, and results from this demo are never real-world results.
8
+
9
+ | File | Contents |
10
+ | --- | --- |
11
+ | `item.schema.json` | The format of one proposal, as the reviewer sees it |
12
+ | `items.json` | 20 correct sample proposals |
13
+
14
+ The ID of the record that gets written (the *target ID*) is deliberately not part of the item.
15
+ The host passes it to ReviewProof separately and the review screen never shows it
16
+ (see [ADR-003](../../docs/adr/0003-api-shape.md)).
17
+
18
+ Each sample item has two or more immediate actions, so an omission defect can remove one while the
19
+ item still matches the schema.
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Deviation triage proposal",
4
+ "description": "An AI agent's proposed triage of a manufacturing deviation, as shown to the reviewer. Synthetic demo only.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "deviation_id",
9
+ "occurred_on",
10
+ "product",
11
+ "lot_number",
12
+ "process_step",
13
+ "description",
14
+ "classification",
15
+ "classification_rationale",
16
+ "root_cause",
17
+ "immediate_actions",
18
+ "capa_required"
19
+ ],
20
+ "properties": {
21
+ "deviation_id": { "type": "string", "pattern": "^DEV-[0-9]{4}-[0-9]{4}$" },
22
+ "occurred_on": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
23
+ "product": { "type": "string", "minLength": 1 },
24
+ "lot_number": { "type": "string", "pattern": "^LOT-[A-Z][0-9]{5}$" },
25
+ "process_step": {
26
+ "type": "string",
27
+ "enum": ["dispensing", "granulation", "compression", "coating", "filling", "packaging", "storage", "laboratory"]
28
+ },
29
+ "description": { "type": "string", "minLength": 1 },
30
+ "classification": { "type": "string", "enum": ["minor", "major", "critical"] },
31
+ "classification_rationale": { "type": "string", "minLength": 1 },
32
+ "root_cause": { "type": "string", "minLength": 1 },
33
+ "immediate_actions": {
34
+ "type": "array",
35
+ "minItems": 1,
36
+ "items": { "type": "string", "minLength": 1 }
37
+ },
38
+ "capa_required": { "type": "boolean" }
39
+ }
40
+ }
@@ -0,0 +1,262 @@
1
+ [
2
+ {
3
+ "deviation_id": "DEV-2026-0101",
4
+ "occurred_on": "2026-01-08",
5
+ "product": "Examplol 50 mg tablets",
6
+ "lot_number": "LOT-A10231",
7
+ "process_step": "dispensing",
8
+ "description": "The balance used to weigh lactose was one day past its calibration due date. A check with certified weights the same day was within tolerance.",
9
+ "classification": "minor",
10
+ "classification_rationale": "The as-found check was within tolerance, so the weighed quantities are not in doubt.",
11
+ "root_cause": "The calibration due date was not flagged in the equipment scheduling system.",
12
+ "immediate_actions": ["Tagged the balance out of use", "Performed an as-found check with certified weights", "Scheduled calibration"],
13
+ "capa_required": false
14
+ },
15
+ {
16
+ "deviation_id": "DEV-2026-0102",
17
+ "occurred_on": "2026-01-15",
18
+ "product": "Demozine 10 mg capsules",
19
+ "lot_number": "LOT-B20417",
20
+ "process_step": "filling",
21
+ "description": "Capsule fill weights exceeded the upper action limit for 25 minutes. In-process checks show three samples above the registered specification.",
22
+ "classification": "major",
23
+ "classification_rationale": "Product outside the registered specification may have been produced; the affected portion can be identified by time.",
24
+ "root_cause": "The dosing disc was set to the wrong height after a changeover.",
25
+ "immediate_actions": ["Stopped the filler", "Segregated containers filled during the 25-minute window", "Reset and verified the dosing disc height"],
26
+ "capa_required": true
27
+ },
28
+ {
29
+ "deviation_id": "DEV-2026-0103",
30
+ "occurred_on": "2026-01-22",
31
+ "product": "Placebrin 200 mg tablets",
32
+ "lot_number": "LOT-C30102",
33
+ "process_step": "compression",
34
+ "description": "A fragment of a damaged punch tip was found missing during end-of-run tooling inspection. The metal detector the batch passed through was later found to be switched off.",
35
+ "classification": "critical",
36
+ "classification_rationale": "Possible metal contamination of product with no effective detection control creates a direct patient safety risk.",
37
+ "root_cause": "The metal detector was not re-enabled after cleaning, and the line start checklist did not require a challenge test.",
38
+ "immediate_actions": ["Placed the batch on hold", "Quarantined the tablet press and tooling", "Notified the Quality Unit"],
39
+ "capa_required": true
40
+ },
41
+ {
42
+ "deviation_id": "DEV-2026-0104",
43
+ "occurred_on": "2026-02-03",
44
+ "product": "Mockaril 5 mg tablets",
45
+ "lot_number": "LOT-D40563",
46
+ "process_step": "coating",
47
+ "description": "Coating pan inlet air temperature was 1 degree C above the batch record range for 4 minutes. Coating weight gain, appearance and dissolution met specification.",
48
+ "classification": "minor",
49
+ "classification_rationale": "The excursion was brief and small, and all affected quality attributes met specification.",
50
+ "root_cause": "The temperature controller overshot after a spray pause.",
51
+ "immediate_actions": ["Returned the temperature to range", "Reviewed the process trend for the whole run"],
52
+ "capa_required": false
53
+ },
54
+ {
55
+ "deviation_id": "DEV-2026-0105",
56
+ "occurred_on": "2026-02-11",
57
+ "product": "Examplol 50 mg tablets",
58
+ "lot_number": "LOT-A10244",
59
+ "process_step": "packaging",
60
+ "description": "A line clearance check found 12 printed cartons from the previous lot under the cartoner. Reconciliation showed none had entered the current run.",
61
+ "classification": "major",
62
+ "classification_rationale": "A failed line clearance creates a mix-up risk, even though no cartons from the previous lot were used.",
63
+ "root_cause": "The line clearance checklist did not include the area under the cartoner.",
64
+ "immediate_actions": ["Stopped packaging", "Removed and destroyed the stray cartons", "Repeated line clearance with a second verifier"],
65
+ "capa_required": true
66
+ },
67
+ {
68
+ "deviation_id": "DEV-2026-0106",
69
+ "occurred_on": "2026-02-19",
70
+ "product": "Synthavax diluent 2 mL vials",
71
+ "lot_number": "LOT-E50088",
72
+ "process_step": "storage",
73
+ "description": "A cold room storing finished vials, labelled for storage at 2 to 8 degrees C, reached 14 degrees C for 11 hours overnight. The alarm did not reach the on-call phone.",
74
+ "classification": "major",
75
+ "classification_rationale": "A long excursion outside the labelled storage range needs a stability assessment, and a monitoring control failed.",
76
+ "root_cause": "The alarm dialler held an outdated on-call number.",
77
+ "immediate_actions": ["Placed all affected stock on hold", "Corrected the on-call number and tested the alarm", "Requested a stability assessment"],
78
+ "capa_required": true
79
+ },
80
+ {
81
+ "deviation_id": "DEV-2026-0107",
82
+ "occurred_on": "2026-03-02",
83
+ "product": "Demozine 10 mg capsules",
84
+ "lot_number": "LOT-B20431",
85
+ "process_step": "laboratory",
86
+ "description": "An HPLC system suitability injection failed the tailing factor limit. The sequence was stopped before any sample result was generated.",
87
+ "classification": "minor",
88
+ "classification_rationale": "No reportable results were generated on the unsuitable system.",
89
+ "root_cause": "The analytical column had reached the end of its useful life.",
90
+ "immediate_actions": ["Replaced the column", "Repeated system suitability successfully"],
91
+ "capa_required": false
92
+ },
93
+ {
94
+ "deviation_id": "DEV-2026-0108",
95
+ "occurred_on": "2026-03-10",
96
+ "product": "Fictamab 100 mg injection",
97
+ "lot_number": "LOT-F60012",
98
+ "process_step": "filling",
99
+ "description": "An operator reached over open sterilized stoppers during aseptic filling. No intervention was recorded at the time, and the event was found on video review.",
100
+ "classification": "critical",
101
+ "classification_rationale": "A breach of aseptic technique over exposed sterile components compromises sterility assurance, which testing cannot restore.",
102
+ "root_cause": "The stopper bowl layout requires operators to reach across it to clear a common jam.",
103
+ "immediate_actions": ["Placed the batch on hold", "Suspended the operator's aseptic qualification pending retraining", "Notified the Quality Unit"],
104
+ "capa_required": true
105
+ },
106
+ {
107
+ "deviation_id": "DEV-2026-0109",
108
+ "occurred_on": "2026-03-18",
109
+ "product": "Placebrin 200 mg tablets",
110
+ "lot_number": "LOT-C30119",
111
+ "process_step": "granulation",
112
+ "description": "Wet massing ran 30 seconds longer than the batch record range. Granule moisture, particle size and downstream blend uniformity met specification.",
113
+ "classification": "minor",
114
+ "classification_rationale": "The overrun was small and in-process results show no effect on the granulate.",
115
+ "root_cause": "The mixer timer was started manually and stopped late.",
116
+ "immediate_actions": ["Reviewed in-process results", "Reminded the shift to use the recipe timer"],
117
+ "capa_required": false
118
+ },
119
+ {
120
+ "deviation_id": "DEV-2026-0110",
121
+ "occurred_on": "2026-03-27",
122
+ "product": "Mockaril 5 mg tablets",
123
+ "lot_number": "LOT-D40579",
124
+ "process_step": "dispensing",
125
+ "description": "The second-person verification signature is missing for one excipient weighing. The balance printout confirms the correct material code and quantity.",
126
+ "classification": "minor",
127
+ "classification_rationale": "Independent printed evidence confirms the material and quantity; the gap is in documentation.",
128
+ "root_cause": "The verifier was called away before signing.",
129
+ "immediate_actions": ["Reconciled the balance printout against the batch record", "Documented a late-entry explanation"],
130
+ "capa_required": false
131
+ },
132
+ {
133
+ "deviation_id": "DEV-2026-0111",
134
+ "occurred_on": "2026-04-07",
135
+ "product": "Examplol 50 mg tablets",
136
+ "lot_number": "LOT-A10262",
137
+ "process_step": "compression",
138
+ "description": "Tablet hardness fell below the lower specification limit for an estimated 40 minutes after a hopper level sensor failed. Tablets from that period went into the bulk container.",
139
+ "classification": "major",
140
+ "classification_rationale": "Out-of-specification tablets were mixed into bulk product, so the whole container is affected until assessed.",
141
+ "root_cause": "The failed sensor let the hopper run low, which changed die filling.",
142
+ "immediate_actions": ["Placed the bulk container on hold", "Replaced the hopper level sensor", "Increased in-process sampling"],
143
+ "capa_required": true
144
+ },
145
+ {
146
+ "deviation_id": "DEV-2026-0112",
147
+ "occurred_on": "2026-04-16",
148
+ "product": "Synthavax diluent 2 mL vials",
149
+ "lot_number": "LOT-E50097",
150
+ "process_step": "filling",
151
+ "description": "The post-use integrity test of the sterilizing filter failed and failed again on retest. The filled vials rely on this filter for sterility.",
152
+ "classification": "critical",
153
+ "classification_rationale": "A confirmed sterilizing filter integrity failure means the product cannot be assured sterile.",
154
+ "root_cause": "Under investigation; a damaged filter seal was observed on removal.",
155
+ "immediate_actions": ["Placed the batch on hold", "Quarantined the filter assembly", "Notified the Quality Unit"],
156
+ "capa_required": true
157
+ },
158
+ {
159
+ "deviation_id": "DEV-2026-0113",
160
+ "occurred_on": "2026-04-28",
161
+ "product": "Demozine 10 mg capsules",
162
+ "lot_number": "LOT-B20452",
163
+ "process_step": "packaging",
164
+ "description": "The vision system rejected no packs during its start-up challenge because a rejection arm was disconnected. This was found before the packaging run started.",
165
+ "classification": "minor",
166
+ "classification_rationale": "The failure was found by the start-up control before any product was packed.",
167
+ "root_cause": "The air line to the rejection arm was not reconnected after maintenance.",
168
+ "immediate_actions": ["Reconnected the air line", "Repeated the challenge test successfully"],
169
+ "capa_required": false
170
+ },
171
+ {
172
+ "deviation_id": "DEV-2026-0114",
173
+ "occurred_on": "2026-05-06",
174
+ "product": "Fictamab 100 mg injection",
175
+ "lot_number": "LOT-F60023",
176
+ "process_step": "storage",
177
+ "description": "Two pallets of released and quarantined vials were found in the same marked bay. Status labels were intact and stock records show no movement of quarantined stock.",
178
+ "classification": "major",
179
+ "classification_rationale": "Physical segregation of quarantined stock failed, creating a mix-up risk.",
180
+ "root_cause": "The quarantine bay was full and no overflow location was defined.",
181
+ "immediate_actions": ["Moved quarantined stock to a segregated area", "Verified stock status against the inventory system", "Defined a temporary overflow location"],
182
+ "capa_required": true
183
+ },
184
+ {
185
+ "deviation_id": "DEV-2026-0115",
186
+ "occurred_on": "2026-05-14",
187
+ "product": "Placebrin 200 mg tablets",
188
+ "lot_number": "LOT-C30140",
189
+ "process_step": "laboratory",
190
+ "description": "An analyst recorded a dissolution bath temperature on loose paper and transcribed it to the worksheet later. The original paper was discarded.",
191
+ "classification": "major",
192
+ "classification_rationale": "Discarding an original GMP record is a data integrity failure, whether or not the value was transcribed correctly.",
193
+ "root_cause": "The worksheet was not available at the instrument.",
194
+ "immediate_actions": ["Reviewed the instrument log for the temperature", "Briefed analysts on original record requirements", "Placed worksheets at each instrument"],
195
+ "capa_required": true
196
+ },
197
+ {
198
+ "deviation_id": "DEV-2026-0116",
199
+ "occurred_on": "2026-05-22",
200
+ "product": "Mockaril 5 mg tablets",
201
+ "lot_number": "LOT-D40601",
202
+ "process_step": "granulation",
203
+ "description": "A dryer room door was left open for about 2 minutes during drying. Room differential pressure alarmed and recovered; no other product was exposed in the area.",
204
+ "classification": "minor",
205
+ "classification_rationale": "The brief loss of pressure differential had no product exposure pathway.",
206
+ "root_cause": "The door closer was worn and did not latch.",
207
+ "immediate_actions": ["Closed the door", "Raised a work order for the door closer"],
208
+ "capa_required": false
209
+ },
210
+ {
211
+ "deviation_id": "DEV-2026-0117",
212
+ "occurred_on": "2026-06-03",
213
+ "product": "Examplol 50 mg tablets",
214
+ "lot_number": "LOT-A10280",
215
+ "process_step": "packaging",
216
+ "description": "Cartons printed with the wrong expiry date, six months later than the batch record, were applied to finished packs. The error was found at final QA inspection before release.",
217
+ "classification": "critical",
218
+ "classification_rationale": "An overstated expiry date could expose patients to expired product; detection relied on the last control before release.",
219
+ "root_cause": "The printer recipe was copied from a previous lot and the date check was signed without comparison to the batch record.",
220
+ "immediate_actions": ["Placed the batch on hold", "Reconciled all printed cartons", "Notified the Quality Unit"],
221
+ "capa_required": true
222
+ },
223
+ {
224
+ "deviation_id": "DEV-2026-0118",
225
+ "occurred_on": "2026-06-11",
226
+ "product": "Demozine 10 mg capsules",
227
+ "lot_number": "LOT-B20470",
228
+ "process_step": "dispensing",
229
+ "description": "A scoop labelled for a different excipient was found in the dispensing booth after dispensing had finished. The cleaning log shows the scoop was not used for this lot.",
230
+ "classification": "minor",
231
+ "classification_rationale": "Records show the scoop was not used, so there was no cross-contamination pathway.",
232
+ "root_cause": "The booth clearance did not list utensils individually.",
233
+ "immediate_actions": ["Removed and cleaned the scoop", "Added utensils to the booth clearance checklist"],
234
+ "capa_required": false
235
+ },
236
+ {
237
+ "deviation_id": "DEV-2026-0119",
238
+ "occurred_on": "2026-06-19",
239
+ "product": "Fictamab 100 mg injection",
240
+ "lot_number": "LOT-F60031",
241
+ "process_step": "laboratory",
242
+ "description": "An environmental monitoring settle plate in the Grade A zone grew one colony during filling. Media fill history and other locations for the session showed no growth.",
243
+ "classification": "major",
244
+ "classification_rationale": "Any growth in the Grade A zone exceeds the action limit and requires investigation of batch impact.",
245
+ "root_cause": "Under investigation; organism identification is pending.",
246
+ "immediate_actions": ["Placed the batch on hold", "Sent the isolate for identification", "Reviewed intervention records for the session"],
247
+ "capa_required": true
248
+ },
249
+ {
250
+ "deviation_id": "DEV-2026-0120",
251
+ "occurred_on": "2026-06-30",
252
+ "product": "Placebrin 200 mg tablets",
253
+ "lot_number": "LOT-C30158",
254
+ "process_step": "coating",
255
+ "description": "The coating solution was held 2 hours beyond its validated hold time before use. It was used to coat the full batch.",
256
+ "classification": "major",
257
+ "classification_rationale": "Using a material beyond its validated hold time puts microbial quality outside the validated state.",
258
+ "root_cause": "The preparation time was not written on the solution vessel label.",
259
+ "immediate_actions": ["Placed the batch on hold", "Requested microbial testing of the coated tablets", "Added preparation and expiry times to vessel labels"],
260
+ "capa_required": true
261
+ }
262
+ ]
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "reviewproof"
7
+ dynamic = ["version"]
8
+ description = "Rubber-stamp detector for AI oversight: proves whether human reviewers of AI output catch errors."
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ authors = [{ name = "The ReviewProof Authors" }]
14
+ keywords = ["human-in-the-loop", "ai-oversight", "gxp", "automation-bias"]
15
+ classifiers = [
16
+ "Development Status :: 1 - Planning",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ ]
20
+ dependencies = ["PyYAML>=6.0"]
21
+
22
+ [project.optional-dependencies]
23
+ dev = ["pytest>=8", "pytest-cov>=5", "ruff>=0.6", "jsonschema>=4.21"]
24
+
25
+ [project.urls]
26
+ Repository = "https://github.com/tayoakinlabi/ReviewProof"
27
+ Issues = "https://github.com/tayoakinlabi/ReviewProof/issues"
28
+
29
+ [project.scripts]
30
+ rp = "reviewproof.cli.main:main"
31
+
32
+ [tool.hatch.version]
33
+ path = "src/reviewproof/__init__.py"
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ packages = ["src/reviewproof"]
37
+
38
+ [tool.hatch.build.targets.sdist]
39
+ include = ["src", "tests", "examples", "README.md", "LICENSE"]
40
+
41
+ [tool.pytest.ini_options]
42
+ testpaths = ["tests"]
43
+ addopts = "--strict-markers --cov=reviewproof --cov-report=term-missing"
44
+ markers = ["req(id): requirement ID that the test verifies"]
45
+
46
+ [tool.ruff]
47
+ line-length = 100
48
+ target-version = "py310"
49
+ extend-exclude = ["*.md"]
50
+
51
+ [tool.ruff.lint]
52
+ select = ["E", "F", "W", "I", "B", "UP", "SIM"]
@@ -0,0 +1,3 @@
1
+ """ReviewProof: a rubber-stamp detector for AI oversight."""
2
+
3
+ __version__ = "0.0.0"
@@ -0,0 +1 @@
1
+ """The ``rp`` command line."""
@@ -0,0 +1,24 @@
1
+ """Entry point for the ``rp`` command."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from collections.abc import Sequence
7
+
8
+ from reviewproof import __version__
9
+
10
+
11
+ def build_parser() -> argparse.ArgumentParser:
12
+ parser = argparse.ArgumentParser(
13
+ prog="rp",
14
+ description="Test whether human reviewers of AI output catch errors.",
15
+ )
16
+ parser.add_argument("--version", action="version", version=f"rp {__version__}")
17
+ return parser
18
+
19
+
20
+ def main(argv: Sequence[str] | None = None) -> int:
21
+ parser = build_parser()
22
+ parser.parse_args(argv)
23
+ parser.print_help()
24
+ return 0
@@ -0,0 +1,16 @@
1
+ import pytest
2
+
3
+ from reviewproof import __version__
4
+ from reviewproof.cli.main import main
5
+
6
+
7
+ def test_version(capsys):
8
+ with pytest.raises(SystemExit) as exit_info:
9
+ main(["--version"])
10
+ assert exit_info.value.code == 0
11
+ assert capsys.readouterr().out.strip() == f"rp {__version__}"
12
+
13
+
14
+ def test_no_arguments_prints_help(capsys):
15
+ assert main([]) == 0
16
+ assert "usage: rp" in capsys.readouterr().out
@@ -0,0 +1,34 @@
1
+ import json
2
+ from datetime import date
3
+ from pathlib import Path
4
+
5
+ import pytest
6
+ from jsonschema import Draft202012Validator
7
+
8
+ DEMO = Path(__file__).parents[1] / "examples" / "deviation_triage"
9
+ SCHEMA = json.loads((DEMO / "item.schema.json").read_text(encoding="utf-8"))
10
+ ITEMS = json.loads((DEMO / "items.json").read_text(encoding="utf-8"))
11
+
12
+
13
+ def test_schema_is_valid():
14
+ Draft202012Validator.check_schema(SCHEMA)
15
+
16
+
17
+ def test_there_are_20_items_with_unique_ids():
18
+ assert len(ITEMS) == 20
19
+ assert len({item["deviation_id"] for item in ITEMS}) == 20
20
+
21
+
22
+ @pytest.mark.parametrize("item", ITEMS, ids=lambda item: item["deviation_id"])
23
+ def test_item_matches_schema(item):
24
+ Draft202012Validator(SCHEMA).validate(item)
25
+ date.fromisoformat(item["occurred_on"])
26
+
27
+
28
+ def test_every_classification_is_represented():
29
+ expected = set(SCHEMA["properties"]["classification"]["enum"])
30
+ assert {item["classification"] for item in ITEMS} == expected
31
+
32
+
33
+ def test_every_item_supports_an_omission_defect():
34
+ assert all(len(item["immediate_actions"]) >= 2 for item in ITEMS)