setrya 0.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. setrya-0.12.1/LICENSE +202 -0
  2. setrya-0.12.1/PKG-INFO +221 -0
  3. setrya-0.12.1/README.md +203 -0
  4. setrya-0.12.1/pyproject.toml +31 -0
  5. setrya-0.12.1/setrya/__init__.py +3 -0
  6. setrya-0.12.1/setrya/__main__.py +3 -0
  7. setrya-0.12.1/setrya/adapter.py +84 -0
  8. setrya-0.12.1/setrya/cache_metrics.py +137 -0
  9. setrya-0.12.1/setrya/checker.py +202 -0
  10. setrya-0.12.1/setrya/cli.py +348 -0
  11. setrya-0.12.1/setrya/comparison.py +126 -0
  12. setrya-0.12.1/setrya/conformance.py +141 -0
  13. setrya-0.12.1/setrya/coverage.py +311 -0
  14. setrya-0.12.1/setrya/dependencies.py +105 -0
  15. setrya-0.12.1/setrya/drill.py +188 -0
  16. setrya-0.12.1/setrya/evidence.py +367 -0
  17. setrya-0.12.1/setrya/examples/__init__.py +1 -0
  18. setrya-0.12.1/setrya/examples/answer_cache/__init__.py +1 -0
  19. setrya-0.12.1/setrya/examples/answer_cache/__main__.py +3 -0
  20. setrya-0.12.1/setrya/examples/answer_cache/app.py +167 -0
  21. setrya-0.12.1/setrya/examples/answer_cache/contract.py +19 -0
  22. setrya-0.12.1/setrya/examples/answer_cache/drill.py +150 -0
  23. setrya-0.12.1/setrya/examples/answer_cache/evidence.py +274 -0
  24. setrya-0.12.1/setrya/examples/answer_cache/metrics.py +114 -0
  25. setrya-0.12.1/setrya/examples/answer_cache/selective.py +325 -0
  26. setrya-0.12.1/setrya/examples/answer_cache/store.py +238 -0
  27. setrya-0.12.1/setrya/examples/answer_cache/worker.py +53 -0
  28. setrya-0.12.1/setrya/examples/elasticsearch_search.py +106 -0
  29. setrya-0.12.1/setrya/examples/offboarding/__init__.py +1 -0
  30. setrya-0.12.1/setrya/examples/offboarding/demo.py +105 -0
  31. setrya-0.12.1/setrya/examples/offboarding/fixture.py +376 -0
  32. setrya-0.12.1/setrya/examples/offboarding/sqlite/__init__.py +1 -0
  33. setrya-0.12.1/setrya/examples/offboarding/sqlite/observe.py +344 -0
  34. setrya-0.12.1/setrya/examples/offboarding/sqlite/policy.json +8 -0
  35. setrya-0.12.1/setrya/examples/opendesk/Dockerfile.trial +26 -0
  36. setrya-0.12.1/setrya/examples/opendesk/__init__.py +1 -0
  37. setrya-0.12.1/setrya/examples/opendesk/cli.py +73 -0
  38. setrya-0.12.1/setrya/examples/opendesk/compose.yaml +70 -0
  39. setrya-0.12.1/setrya/examples/opendesk/observed.json +66 -0
  40. setrya-0.12.1/setrya/examples/opendesk/policy-v2.json +26 -0
  41. setrya-0.12.1/setrya/examples/opendesk/policy.json +26 -0
  42. setrya-0.12.1/setrya/examples/opendesk/provider.py +53 -0
  43. setrya-0.12.1/setrya/examples/opendesk/run.py +441 -0
  44. setrya-0.12.1/setrya/examples/opendesk/to_gate.py +129 -0
  45. setrya-0.12.1/setrya/examples/opendesk/transport.py +31 -0
  46. setrya-0.12.1/setrya/examples/opendesk/verify_report.py +254 -0
  47. setrya-0.12.1/setrya/examples/pgvector-search/compose.yml +14 -0
  48. setrya-0.12.1/setrya/examples/pgvector-search/drill.toml +40 -0
  49. setrya-0.12.1/setrya/examples/pgvector-search/reupload.toml +51 -0
  50. setrya-0.12.1/setrya/examples/pgvector_search/__init__.py +8 -0
  51. setrya-0.12.1/setrya/examples/pgvector_search/__main__.py +26 -0
  52. setrya-0.12.1/setrya/examples/pgvector_search/adapter.py +16 -0
  53. setrya-0.12.1/setrya/examples/pgvector_search/app.py +242 -0
  54. setrya-0.12.1/setrya/examples/pgvector_search/benchmark.py +118 -0
  55. setrya-0.12.1/setrya/examples/pgvector_search/pytest_reference.py +89 -0
  56. setrya-0.12.1/setrya/examples/recorded-search/drill.toml +34 -0
  57. setrya-0.12.1/setrya/examples/recorded_search/__init__.py +1 -0
  58. setrya-0.12.1/setrya/examples/recorded_search/existing_test.py +62 -0
  59. setrya-0.12.1/setrya/examples/recorded_search/verify.py +93 -0
  60. setrya-0.12.1/setrya/examples/support-search/drill.toml +40 -0
  61. setrya-0.12.1/setrya/examples/support-search/python.toml +40 -0
  62. setrya-0.12.1/setrya/examples/support-search/retired.toml +51 -0
  63. setrya-0.12.1/setrya/examples/support_search/__init__.py +1 -0
  64. setrya-0.12.1/setrya/examples/support_search/__main__.py +104 -0
  65. setrya-0.12.1/setrya/examples/support_search/adapter.py +61 -0
  66. setrya-0.12.1/setrya/examples/support_search/app.py +225 -0
  67. setrya-0.12.1/setrya/examples/support_search/baseline.py +101 -0
  68. setrya-0.12.1/setrya/examples/support_search/client.py +78 -0
  69. setrya-0.12.1/setrya/git_refs.py +23 -0
  70. setrya-0.12.1/setrya/integrations/__init__.py +1 -0
  71. setrya-0.12.1/setrya/integrations/celery.py +97 -0
  72. setrya-0.12.1/setrya/integrations/langchain.py +83 -0
  73. setrya-0.12.1/setrya/local_cache.py +143 -0
  74. setrya-0.12.1/setrya/offboarding/__init__.py +1 -0
  75. setrya-0.12.1/setrya/offboarding/cli.py +74 -0
  76. setrya-0.12.1/setrya/offboarding/gate.py +202 -0
  77. setrya-0.12.1/setrya/offboarding/inputs.py +86 -0
  78. setrya-0.12.1/setrya/offboarding/observer.py +47 -0
  79. setrya-0.12.1/setrya/offboarding/receipt-v1.schema.json +300 -0
  80. setrya-0.12.1/setrya/offboarding/receipt.py +264 -0
  81. setrya-0.12.1/setrya/offboarding/receipt_cli.py +197 -0
  82. setrya-0.12.1/setrya/offboarding/receipt_schema.py +65 -0
  83. setrya-0.12.1/setrya/offboarding/reference.py +243 -0
  84. setrya-0.12.1/setrya/offboarding/signature.py +68 -0
  85. setrya-0.12.1/setrya/pytest_plugin.py +82 -0
  86. setrya-0.12.1/setrya/qualification.py +412 -0
  87. setrya-0.12.1/setrya/recorder.py +163 -0
  88. setrya-0.12.1/setrya/review.py +119 -0
  89. setrya-0.12.1/setrya/review_scenarios.py +157 -0
  90. setrya-0.12.1/setrya/run_pr.py +168 -0
  91. setrya-0.12.1/setrya/runner.py +184 -0
  92. setrya-0.12.1/setrya/scenario_fixture.py +127 -0
  93. setrya-0.12.1/setrya/scenario_order.py +268 -0
  94. setrya-0.12.1/setrya/scenarios.py +509 -0
  95. setrya-0.12.1/setrya/status.py +22 -0
  96. setrya-0.12.1/setrya/store_signals.py +56 -0
  97. setrya-0.12.1/setrya.egg-info/PKG-INFO +221 -0
  98. setrya-0.12.1/setrya.egg-info/SOURCES.txt +144 -0
  99. setrya-0.12.1/setrya.egg-info/dependency_links.txt +1 -0
  100. setrya-0.12.1/setrya.egg-info/entry_points.txt +2 -0
  101. setrya-0.12.1/setrya.egg-info/requires.txt +11 -0
  102. setrya-0.12.1/setrya.egg-info/top_level.txt +1 -0
  103. setrya-0.12.1/setup.cfg +7 -0
  104. setrya-0.12.1/tests/test_adapter_conformance.py +94 -0
  105. setrya-0.12.1/tests/test_answer_cache_drill.py +172 -0
  106. setrya-0.12.1/tests/test_answer_cache_selective.py +220 -0
  107. setrya-0.12.1/tests/test_answer_cache_store.py +123 -0
  108. setrya-0.12.1/tests/test_answer_dependencies.py +75 -0
  109. setrya-0.12.1/tests/test_cache_metrics.py +124 -0
  110. setrya-0.12.1/tests/test_checker.py +149 -0
  111. setrya-0.12.1/tests/test_cli_boundaries.py +83 -0
  112. setrya-0.12.1/tests/test_comparison.py +134 -0
  113. setrya-0.12.1/tests/test_coverage.py +159 -0
  114. setrya-0.12.1/tests/test_elasticsearch_store.py +34 -0
  115. setrya-0.12.1/tests/test_fixture_teardown.py +46 -0
  116. setrya-0.12.1/tests/test_framework_hooks.py +124 -0
  117. setrya-0.12.1/tests/test_local_cache.py +99 -0
  118. setrya-0.12.1/tests/test_offboarding_example.py +60 -0
  119. setrya-0.12.1/tests/test_offboarding_gate.py +366 -0
  120. setrya-0.12.1/tests/test_offboarding_portable.py +111 -0
  121. setrya-0.12.1/tests/test_offboarding_receipt.py +357 -0
  122. setrya-0.12.1/tests/test_offboarding_receipt_cli.py +132 -0
  123. setrya-0.12.1/tests/test_offboarding_reference.py +181 -0
  124. setrya-0.12.1/tests/test_offboarding_sqlite_observer.py +181 -0
  125. setrya-0.12.1/tests/test_offboarding_trust.py +205 -0
  126. setrya-0.12.1/tests/test_opendesk_gate_adapter.py +147 -0
  127. setrya-0.12.1/tests/test_opendesk_live_probes.py +283 -0
  128. setrya-0.12.1/tests/test_opendesk_report_contract.py +114 -0
  129. setrya-0.12.1/tests/test_opendesk_revocation.py +169 -0
  130. setrya-0.12.1/tests/test_opendesk_workflow.py +94 -0
  131. setrya-0.12.1/tests/test_recorder.py +215 -0
  132. setrya-0.12.1/tests/test_released_evidence.py +15 -0
  133. setrya-0.12.1/tests/test_report_input.py +64 -0
  134. setrya-0.12.1/tests/test_review_evidence.py +101 -0
  135. setrya-0.12.1/tests/test_review_handoff.py +112 -0
  136. setrya-0.12.1/tests/test_run_pr.py +177 -0
  137. setrya-0.12.1/tests/test_runtime_evidence.py +126 -0
  138. setrya-0.12.1/tests/test_scenario_journal.py +67 -0
  139. setrya-0.12.1/tests/test_scenario_order.py +85 -0
  140. setrya-0.12.1/tests/test_scenario_review.py +198 -0
  141. setrya-0.12.1/tests/test_scenario_versions.py +84 -0
  142. setrya-0.12.1/tests/test_scenarios.py +238 -0
  143. setrya-0.12.1/tests/test_store_signals.py +105 -0
  144. setrya-0.12.1/tests/test_trust.py +305 -0
  145. setrya-0.12.1/tests/test_worker_order_review.py +180 -0
setrya-0.12.1/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.
setrya-0.12.1/PKG-INFO ADDED
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: setrya
3
+ Version: 0.12.1
4
+ Summary: Test search results and cached answers after document updates, access revocation, and tenant deletion
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Provides-Extra: pytest
10
+ Requires-Dist: pytest>=8; extra == "pytest"
11
+ Provides-Extra: answer-cache
12
+ Requires-Dist: celery<6,>=5.7; extra == "answer-cache"
13
+ Requires-Dist: langchain-core<2,>=1.8.3; extra == "answer-cache"
14
+ Requires-Dist: psycopg[binary]<4,>=3.3; extra == "answer-cache"
15
+ Provides-Extra: pgvector
16
+ Requires-Dist: psycopg[binary]<4,>=3.3; extra == "pgvector"
17
+ Dynamic: license-file
18
+
19
+ # Setrya
20
+
21
+ Setrya is an open-source Python SDK and CLI for testing what an application can retrieve after a document changes, a tenant leaves, or a caller loses access.
22
+
23
+ Your team shortens the refund window from 30 days to 14. The support agent searches and gets the new policy. Then a worker resumes with the copy it read yesterday. In a Setrya regression test, you release that worker on purpose and search again as the same agent. If the 30-day policy comes back, the report identifies the passage and its rank. A teammate can replay the failure after the app shuts down.
24
+
25
+ A delayed job can also bring back a departed customer’s summary. Setrya can check for that in CI and, for a specific deletion request, produce a receipt showing what the application returned and what still needs review.
26
+
27
+ [![Tests](https://github.com/davidahma/setrya/actions/workflows/ci.yml/badge.svg)](https://github.com/davidahma/setrya/actions/workflows/ci.yml)
28
+ [![Offline qualification](https://github.com/davidahma/setrya/actions/workflows/qualification.yml/badge.svg)](https://github.com/davidahma/setrya/actions/workflows/qualification.yml)
29
+
30
+ [Run the search demo](#run-the-demo) · [Test a cached answer](#test-a-late-answer-cache-fill) · [Test tenant offboarding](#test-tenant-offboarding) · [Use the Python SDK](#use-the-python-sdk-in-your-tests) · [Review a fix in CI](#review-an-indexing-change-in-a-pull-request)
31
+
32
+ ## Run the demo
33
+
34
+ The demo queries a local SQLite index with synthetic policies. You need Git and Python 3.11 or later with SQLite FTS5. After cloning, you can run it offline.
35
+
36
+ ```sh
37
+ git clone https://github.com/davidahma/setrya.git
38
+ cd setrya
39
+ python3 -m setrya demo
40
+ ```
41
+
42
+ | Verdict | What the support agent retrieves | What happened |
43
+ | --- | --- | --- |
44
+ | FAIL | 30 days → 14 days → 30 days | The old worker committed. The next search returned the old policy at rank 1. |
45
+ | PASS | 30 days → 14 days | The worker rejected its stale write. Final searches found the 14-day policy and the unrelated delivery policy. |
46
+ | NOT TESTED | 30 days → 14 days | The old worker committed. Search still returned 14 days. The response didn’t identify a snapshot that included the old write. |
47
+
48
+ ## Test a late answer-cache fill
49
+
50
+ A Celery task retrieves a private policy and pauses before writing the answer to cache. One user loses access. The application evicts that user's entry. Can the paused task put the private answer back?
51
+
52
+ The LangChain and pgvector example runs the task and calls the application's HTTP answer endpoint as the revoked user and a colleague. In the broken configuration, the revoked user receives a private cache hit after the worker resumes. The guarded configuration returns the public answer to that user, and the colleague can still get the private answer from cache.
53
+
54
+ To try the evidence first, [install core Setrya](#use-the-python-sdk-in-your-tests) and unpack the [late-cache-fill bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/late-cache-fill.zip). From the directory containing `broken/` and `guarded/`, run:
55
+
56
+ ```sh
57
+ setrya replay broken
58
+ setrya replay guarded
59
+ ```
60
+
61
+ The first command exits 1 and the second exits 0. To run the worker yourself, use the `answer-cache` extra and a disposable pgvector database. The ingestion, retrieval, and worker checkpoint helpers can also be used separately in an existing test. [Run the live drill and adapt the hooks](docs/answer-cache.md)
62
+
63
+ A second drill asks what happens to the rest of the cache. A worker already holds yesterday’s refund answer when a better refund policy enters the index. The guarded app rejects that fill, serves the updated policy, and keeps the same cached delivery answer for the same user. The broken app returns correct delivery text but forces another generation. Run `setrya answer-cache --case selective --mode guarded --output scoped` against the fixture, or download both runs and replay them offline. [Selective invalidation drill](docs/answer-cache.md#invalidate-a-refund-answer-and-keep-a-delivery-hit) · [Evidence bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/selective-cache.zip)
64
+
65
+ To try the cache without services, use the single-process Python example. It records the ordered chunks supplied to generation and checks the caller and retrieval scope before accepting a fill. Local counters distinguish measured cache hits, skipped generations and stale answers among checked requests. Store and queue adapters can run the same conformance assertions as the bundled integrations. [In-memory cache](docs/local-cache.md) · [Answer dependency SDK](docs/answer-dependencies.md) · [Metrics and Prometheus](docs/cache-metrics.md) · [Adapter tests](docs/adapter-conformance.md)
66
+
67
+ ## Exercise retries, duplicate deliveries, and access changes
68
+
69
+ Use a scenario to hold work before a change and choose the order in which deliveries finish. For a permission change, the revoked caller must lose the passage while the authorized caller can still read it. Save the run so a reviewer can replay it after the application stops.
70
+
71
+ ```sh
72
+ python3 -m setrya scenario revoke --schedule all --output access-run
73
+ python3 -m setrya replay access-run
74
+ ```
75
+
76
+ The same commands accept `update` and `delete`. If one worker sees the access change and a later search by a second worker returns the revoked passage, replay names both observations. Run the same scenario on two app commits and give the directories to `setrya review` for a PR decision. [Schedules and adapter contract](docs/scenarios.md) · [Evidence from real stores](docs/store-signals.md)
77
+
78
+ In the OpenDesk trial, an actual summary job starts before one agent loses team membership and finishes afterward. Both agents stay in the workspace. With a workspace-readable team, both still find the new summary. With a private team, only the retained colleague does. The two deployments run the same OpenDesk binary. [Reproduce the release decision](docs/opendesk-revocation.md) · [Download both caller traces](https://github.com/davidahma/setrya/releases/download/v0.12.1/opendesk-revocation-review.zip)
79
+
80
+ ## Test tenant offboarding
81
+
82
+ Acme leaves. The support app deletes its ticket and summary. Then a worker finishes writing the summary it read before deletion. From the same checkout, run the offboarding example in a new output directory.
83
+
84
+ ```sh
85
+ python3 -m setrya offboarding demo --output offboarding-run
86
+ ```
87
+
88
+ The **CI gate** checks whether the support agent can still read Acme’s summary and whether it can still read another tenant’s. The broken worker produces FAIL, the guarded worker produces PASS, and a missing baseline produces NOT TESTED.
89
+
90
+ The **deletion receipt** belongs to one request issued before the job starts. In a separate run, the app passes its technical checks and a provider reports deletion. The receipt still says `OPEN_ITEMS` because the backup operator supplied an expiry schedule. A reviewer can verify that result offline against the original request and exhibits. [Run the gate, issue a request, and replay a receipt](docs/offboarding.md) · [Download the synthetic example](https://github.com/davidahma/setrya/releases/download/v0.12.1/offboarding-example.zip)
91
+
92
+ Already using Axiom? Setrya can run its SQLite observer and pinned OpenDesk trial, validate historical demo reports, and verify deletion receipts. A reviewer can download the single-file offboarding CLI and replay a case offline. [Axiom command map](docs/offboarding.md#migrate-from-axiom) · [Portable CLI and evidence](https://github.com/davidahma/setrya/releases/tag/v0.12.1)
93
+
94
+ ## Use the Python SDK in your tests
95
+
96
+ Install the release in your project’s virtual environment. Omit `[pytest]` for the core SDK, which uses only the Python standard library.
97
+
98
+ ```sh
99
+ python -m pip install 'setrya[pytest] @ https://github.com/davidahma/setrya/releases/download/v0.12.1/setrya-0.12.1.tar.gz'
100
+ ```
101
+
102
+ A *drill* is a TOML file that names the document revisions, the caller and search route, and the passage IDs each query must return or exclude. The refund drill checks the top three hits for the support agent. A second query checks that the delivery policy stays findable. [Example drill](setrya/examples/recorded-search/drill.toml)
103
+
104
+ From the cloned checkout you can run a complete drill in Python.
105
+
106
+ ```python
107
+ from setrya.runner import run
108
+
109
+ result = run("setrya/examples/support-search/drill.toml")
110
+ print(result.verdict.status.label) # PASS
111
+ ```
112
+
113
+ ### Keep your existing pytest test
114
+
115
+ Keep your setup and assertions. The `setrya_record` fixture records what they observe. Here, your `open_app` fixture starts a disposable app for this run. Its methods wait for the worker, return a checkpoint and write receipt, and search as the support agent. [Working pytest example](setrya/examples/recorded_search/existing_test.py) · [Observation types](docs/adapters.md#adapter-methods)
116
+
117
+ ```python
118
+ def test_refund_update(open_app, setrya_record):
119
+ with setrya_record("tests/refund.toml") as rec, open_app(rec.run_id) as app:
120
+ check_refund_update(app, rec)
121
+
122
+
123
+ def check_refund_update(app, rec):
124
+ app.seed()
125
+ rec.seeded()
126
+ rec.search("refund-window", app.search)
127
+ rec.search("delivery", app.search)
128
+
129
+ attempt = app.start_old()
130
+ rec.started(attempt)
131
+ rec.held(app.wait_for_checkpoint(attempt))
132
+ rec.published(app.publish())
133
+ fresh = rec.search("refund-window", app.search)
134
+ assert (fresh.route, fresh.scope) == ("support-search", "support-agent")
135
+ assert "refund@B" in fresh.passages
136
+
137
+ app.release()
138
+ rec.released(attempt)
139
+ rec.receipt(app.wait_for_receipt(attempt))
140
+ rec.search("refund-window", app.search)
141
+ rec.search("delivery", app.search)
142
+ ```
143
+
144
+ Copy the example drill to `tests/refund.toml` and run `python -m pytest -p setrya.pytest_plugin`. This example makes the replacement searchable when publication returns. If your index refreshes asynchronously, record each search while you wait for the new revision, or let Setrya schedule the searches through an adapter.
145
+
146
+ On exit the fixture saves a JSON report. A FAIL or NOT TESTED verdict fails pytest. If your own assertion raises first, you keep its traceback and the observations up to that point.
147
+
148
+ ### Use Recorder outside pytest
149
+
150
+ Use `Recorder` around the same test code. Your test decides how to act on the verdict.
151
+
152
+ ```python
153
+ from setrya.checker import Status
154
+ from setrya.recorder import Recorder
155
+
156
+
157
+ def verify_refund(open_app):
158
+ with Recorder("tests/refund.toml", test_id="refund-worker", report="run.json") as rec:
159
+ with open_app(rec.run_id) as app:
160
+ check_refund_update(app, rec)
161
+
162
+ verdict = rec.result.verdict
163
+ if verdict.status is not Status.PASS:
164
+ raise AssertionError(f"{verdict.status.label}: {verdict.detail}")
165
+ ```
166
+
167
+ ## Connect your own search
168
+
169
+ If you want Setrya to pause the worker and schedule the searches, give the drill a Python adapter. From the checkout, run the bundled adapter against its HTTP endpoint and save the result. The Markdown summary names the tested revision and gives the reviewer a replay command.
170
+
171
+ ```sh
172
+ python3 -m setrya check setrya/examples/support-search/drill.toml --report run.json --summary summary.md
173
+ python3 -m setrya replay run.json
174
+ ```
175
+
176
+ In pytest, the `setrya_check` fixture runs the whole adapter-driven drill and requires a PASS. For your app, the adapter must identify the revision the worker read, acknowledge publication of its replacement, and query the route as the intended caller. If the old write commits, each final search needs evidence that its index snapshot includes that commit. A PASS covers the configured queries, ranks, caller, and time windows. For an AI agent, that tells you which passages its retrieval tool returned. Checking the answer it wrote takes a separate assertion. [Adapter guide](docs/adapters.md) · [Verdict rules](docs/evidence.md)
177
+
178
+ ## Review an indexing change in a pull request
179
+
180
+ The bundled example runs the same pytest test on two Git commits, one with a broken worker and one with the fix. It captures both test exits and writes the comparison to `review-run/review.md`. With Git and the pytest extra installed, choose a new output directory for each run.
181
+
182
+ ```sh
183
+ python -m setrya.examples.recorded_search.verify --output review-run
184
+ setrya replay review-run/candidate.json
185
+ ```
186
+
187
+ The summary reports `FIX VERIFIED` and shows what changed on the caller’s final search.
188
+
189
+ ```text
190
+ Before FAIL · event 11 · refund-window · final · refund@A
191
+ Expected refund@B. Observed forbidden refund@A at rank 1.
192
+ After PASS · event 11 · refund-window · final · refund@B
193
+ Index rejected the old write. All final probes found their required passages.
194
+ ```
195
+
196
+ The example also saves `opaque.json`, which replays as NOT TESTED even though the test found the 14-day policy. You can download all three reports and the summary from the release. [Sample review bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/recorded-pytest-review.zip)
197
+
198
+ To run your own test on both application revisions, install the pytest extra, fetch both refs, and run this from the application checkout:
199
+
200
+ ```sh
201
+ setrya run-pr --repo . --base origin/main --candidate HEAD \
202
+ --drill tests/refund.toml --output refund-review \
203
+ -- python -m pytest -p setrya.pytest_plugin -q tests/test_index.py::test_refund_update
204
+ ```
205
+
206
+ Setrya checks out each commit in a temporary directory and records the test exit beside its report. Keep the command's exit as a CI gate and upload the output directory even on failure. For a two-worker fix, the comparison can point to a search between the first write and the second worker's release. For route coverage, give `setrya coverage` a repository-owned map and the candidate evidence. A new agent-summary route can then name its owner in the PR even when the existing support-search test passes. [Map routes and jobs](docs/coverage.md) · [Two-worker review bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/worker-order-review.zip)
207
+
208
+ In a pipeline that already captures both lanes, give `setrya review` two search reports or two matching scenario directories, the expected commit IDs, and the observed exits. A scenario review lists the schedules, identifies the decisive delivery, and gives the reviewer a replay command. [Review a multi-worker run](docs/scenarios.md#compare-the-base-and-candidate-in-ci) · [Download the two-commit scenario review](https://github.com/davidahma/setrya/releases/download/v0.12.1/scenario-review.zip)
209
+
210
+ For recorded tests, keep both reports with the PR. Attach the JSON and Markdown even when the test fails. For a downloaded report, use the installed `setrya replay` command. Replay recomputes the verdict without loading the adapter. The report stores passage IDs and question fingerprints and omits raw queries and passage text. Choose identifiers you can share. [CI recipe and review command](docs/recording.md#use-it-in-a-pull-request) · [GitHub Actions example](.github/workflows/ci.yml)
211
+
212
+ For a single report, `setrya diagnose` explains a missing observation. For a pair without CI commit and exit information, `setrya compare` checks whether the recorded evidence establishes a fix. Checks, driven scenarios and offline gate replay exit 0 for PASS, 1 for FAIL, 2 for an input or execution error, and 3 for NOT TESTED. [Evidence and comparison](docs/evidence.md#compare-two-saved-runs)
213
+
214
+ ## More search regressions
215
+
216
+ - **A deleted paragraph still appears in search.** The refund document shrinks from five chunks to three. A query for the retired clause catches a stale chunk that the general refund query misses. [Retired-chunk drill](setrya/examples/support-search/retired.toml)
217
+ - **A re-upload hides a current passage.** An orphaned pgvector candidate takes a top-three slot. The search returns two current passages and drops the clause about the original payment method. [PostgreSQL/pgvector walkthrough](docs/pgvector.md)
218
+
219
+ If your suite already catches late writes, compare the plain Python test with Setrya’s saved evidence. The paired benchmark runs both approaches against the same pgvector database and worker hooks. [Plain test](setrya/examples/support_search/baseline.py) · [Paired benchmark](docs/benchmark.md)
220
+
221
+ To contribute a drill, include a broken case that exposes the regression and a control query that should keep working. [Contributing](CONTRIBUTING.md) · [Offline qualification](docs/qualification.md) · [Security policy](SECURITY.md) · [Apache 2.0 license](LICENSE)
@@ -0,0 +1,203 @@
1
+ # Setrya
2
+
3
+ Setrya is an open-source Python SDK and CLI for testing what an application can retrieve after a document changes, a tenant leaves, or a caller loses access.
4
+
5
+ Your team shortens the refund window from 30 days to 14. The support agent searches and gets the new policy. Then a worker resumes with the copy it read yesterday. In a Setrya regression test, you release that worker on purpose and search again as the same agent. If the 30-day policy comes back, the report identifies the passage and its rank. A teammate can replay the failure after the app shuts down.
6
+
7
+ A delayed job can also bring back a departed customer’s summary. Setrya can check for that in CI and, for a specific deletion request, produce a receipt showing what the application returned and what still needs review.
8
+
9
+ [![Tests](https://github.com/davidahma/setrya/actions/workflows/ci.yml/badge.svg)](https://github.com/davidahma/setrya/actions/workflows/ci.yml)
10
+ [![Offline qualification](https://github.com/davidahma/setrya/actions/workflows/qualification.yml/badge.svg)](https://github.com/davidahma/setrya/actions/workflows/qualification.yml)
11
+
12
+ [Run the search demo](#run-the-demo) · [Test a cached answer](#test-a-late-answer-cache-fill) · [Test tenant offboarding](#test-tenant-offboarding) · [Use the Python SDK](#use-the-python-sdk-in-your-tests) · [Review a fix in CI](#review-an-indexing-change-in-a-pull-request)
13
+
14
+ ## Run the demo
15
+
16
+ The demo queries a local SQLite index with synthetic policies. You need Git and Python 3.11 or later with SQLite FTS5. After cloning, you can run it offline.
17
+
18
+ ```sh
19
+ git clone https://github.com/davidahma/setrya.git
20
+ cd setrya
21
+ python3 -m setrya demo
22
+ ```
23
+
24
+ | Verdict | What the support agent retrieves | What happened |
25
+ | --- | --- | --- |
26
+ | FAIL | 30 days → 14 days → 30 days | The old worker committed. The next search returned the old policy at rank 1. |
27
+ | PASS | 30 days → 14 days | The worker rejected its stale write. Final searches found the 14-day policy and the unrelated delivery policy. |
28
+ | NOT TESTED | 30 days → 14 days | The old worker committed. Search still returned 14 days. The response didn’t identify a snapshot that included the old write. |
29
+
30
+ ## Test a late answer-cache fill
31
+
32
+ A Celery task retrieves a private policy and pauses before writing the answer to cache. One user loses access. The application evicts that user's entry. Can the paused task put the private answer back?
33
+
34
+ The LangChain and pgvector example runs the task and calls the application's HTTP answer endpoint as the revoked user and a colleague. In the broken configuration, the revoked user receives a private cache hit after the worker resumes. The guarded configuration returns the public answer to that user, and the colleague can still get the private answer from cache.
35
+
36
+ To try the evidence first, [install core Setrya](#use-the-python-sdk-in-your-tests) and unpack the [late-cache-fill bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/late-cache-fill.zip). From the directory containing `broken/` and `guarded/`, run:
37
+
38
+ ```sh
39
+ setrya replay broken
40
+ setrya replay guarded
41
+ ```
42
+
43
+ The first command exits 1 and the second exits 0. To run the worker yourself, use the `answer-cache` extra and a disposable pgvector database. The ingestion, retrieval, and worker checkpoint helpers can also be used separately in an existing test. [Run the live drill and adapt the hooks](docs/answer-cache.md)
44
+
45
+ A second drill asks what happens to the rest of the cache. A worker already holds yesterday’s refund answer when a better refund policy enters the index. The guarded app rejects that fill, serves the updated policy, and keeps the same cached delivery answer for the same user. The broken app returns correct delivery text but forces another generation. Run `setrya answer-cache --case selective --mode guarded --output scoped` against the fixture, or download both runs and replay them offline. [Selective invalidation drill](docs/answer-cache.md#invalidate-a-refund-answer-and-keep-a-delivery-hit) · [Evidence bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/selective-cache.zip)
46
+
47
+ To try the cache without services, use the single-process Python example. It records the ordered chunks supplied to generation and checks the caller and retrieval scope before accepting a fill. Local counters distinguish measured cache hits, skipped generations and stale answers among checked requests. Store and queue adapters can run the same conformance assertions as the bundled integrations. [In-memory cache](docs/local-cache.md) · [Answer dependency SDK](docs/answer-dependencies.md) · [Metrics and Prometheus](docs/cache-metrics.md) · [Adapter tests](docs/adapter-conformance.md)
48
+
49
+ ## Exercise retries, duplicate deliveries, and access changes
50
+
51
+ Use a scenario to hold work before a change and choose the order in which deliveries finish. For a permission change, the revoked caller must lose the passage while the authorized caller can still read it. Save the run so a reviewer can replay it after the application stops.
52
+
53
+ ```sh
54
+ python3 -m setrya scenario revoke --schedule all --output access-run
55
+ python3 -m setrya replay access-run
56
+ ```
57
+
58
+ The same commands accept `update` and `delete`. If one worker sees the access change and a later search by a second worker returns the revoked passage, replay names both observations. Run the same scenario on two app commits and give the directories to `setrya review` for a PR decision. [Schedules and adapter contract](docs/scenarios.md) · [Evidence from real stores](docs/store-signals.md)
59
+
60
+ In the OpenDesk trial, an actual summary job starts before one agent loses team membership and finishes afterward. Both agents stay in the workspace. With a workspace-readable team, both still find the new summary. With a private team, only the retained colleague does. The two deployments run the same OpenDesk binary. [Reproduce the release decision](docs/opendesk-revocation.md) · [Download both caller traces](https://github.com/davidahma/setrya/releases/download/v0.12.1/opendesk-revocation-review.zip)
61
+
62
+ ## Test tenant offboarding
63
+
64
+ Acme leaves. The support app deletes its ticket and summary. Then a worker finishes writing the summary it read before deletion. From the same checkout, run the offboarding example in a new output directory.
65
+
66
+ ```sh
67
+ python3 -m setrya offboarding demo --output offboarding-run
68
+ ```
69
+
70
+ The **CI gate** checks whether the support agent can still read Acme’s summary and whether it can still read another tenant’s. The broken worker produces FAIL, the guarded worker produces PASS, and a missing baseline produces NOT TESTED.
71
+
72
+ The **deletion receipt** belongs to one request issued before the job starts. In a separate run, the app passes its technical checks and a provider reports deletion. The receipt still says `OPEN_ITEMS` because the backup operator supplied an expiry schedule. A reviewer can verify that result offline against the original request and exhibits. [Run the gate, issue a request, and replay a receipt](docs/offboarding.md) · [Download the synthetic example](https://github.com/davidahma/setrya/releases/download/v0.12.1/offboarding-example.zip)
73
+
74
+ Already using Axiom? Setrya can run its SQLite observer and pinned OpenDesk trial, validate historical demo reports, and verify deletion receipts. A reviewer can download the single-file offboarding CLI and replay a case offline. [Axiom command map](docs/offboarding.md#migrate-from-axiom) · [Portable CLI and evidence](https://github.com/davidahma/setrya/releases/tag/v0.12.1)
75
+
76
+ ## Use the Python SDK in your tests
77
+
78
+ Install the release in your project’s virtual environment. Omit `[pytest]` for the core SDK, which uses only the Python standard library.
79
+
80
+ ```sh
81
+ python -m pip install 'setrya[pytest] @ https://github.com/davidahma/setrya/releases/download/v0.12.1/setrya-0.12.1.tar.gz'
82
+ ```
83
+
84
+ A *drill* is a TOML file that names the document revisions, the caller and search route, and the passage IDs each query must return or exclude. The refund drill checks the top three hits for the support agent. A second query checks that the delivery policy stays findable. [Example drill](setrya/examples/recorded-search/drill.toml)
85
+
86
+ From the cloned checkout you can run a complete drill in Python.
87
+
88
+ ```python
89
+ from setrya.runner import run
90
+
91
+ result = run("setrya/examples/support-search/drill.toml")
92
+ print(result.verdict.status.label) # PASS
93
+ ```
94
+
95
+ ### Keep your existing pytest test
96
+
97
+ Keep your setup and assertions. The `setrya_record` fixture records what they observe. Here, your `open_app` fixture starts a disposable app for this run. Its methods wait for the worker, return a checkpoint and write receipt, and search as the support agent. [Working pytest example](setrya/examples/recorded_search/existing_test.py) · [Observation types](docs/adapters.md#adapter-methods)
98
+
99
+ ```python
100
+ def test_refund_update(open_app, setrya_record):
101
+ with setrya_record("tests/refund.toml") as rec, open_app(rec.run_id) as app:
102
+ check_refund_update(app, rec)
103
+
104
+
105
+ def check_refund_update(app, rec):
106
+ app.seed()
107
+ rec.seeded()
108
+ rec.search("refund-window", app.search)
109
+ rec.search("delivery", app.search)
110
+
111
+ attempt = app.start_old()
112
+ rec.started(attempt)
113
+ rec.held(app.wait_for_checkpoint(attempt))
114
+ rec.published(app.publish())
115
+ fresh = rec.search("refund-window", app.search)
116
+ assert (fresh.route, fresh.scope) == ("support-search", "support-agent")
117
+ assert "refund@B" in fresh.passages
118
+
119
+ app.release()
120
+ rec.released(attempt)
121
+ rec.receipt(app.wait_for_receipt(attempt))
122
+ rec.search("refund-window", app.search)
123
+ rec.search("delivery", app.search)
124
+ ```
125
+
126
+ Copy the example drill to `tests/refund.toml` and run `python -m pytest -p setrya.pytest_plugin`. This example makes the replacement searchable when publication returns. If your index refreshes asynchronously, record each search while you wait for the new revision, or let Setrya schedule the searches through an adapter.
127
+
128
+ On exit the fixture saves a JSON report. A FAIL or NOT TESTED verdict fails pytest. If your own assertion raises first, you keep its traceback and the observations up to that point.
129
+
130
+ ### Use Recorder outside pytest
131
+
132
+ Use `Recorder` around the same test code. Your test decides how to act on the verdict.
133
+
134
+ ```python
135
+ from setrya.checker import Status
136
+ from setrya.recorder import Recorder
137
+
138
+
139
+ def verify_refund(open_app):
140
+ with Recorder("tests/refund.toml", test_id="refund-worker", report="run.json") as rec:
141
+ with open_app(rec.run_id) as app:
142
+ check_refund_update(app, rec)
143
+
144
+ verdict = rec.result.verdict
145
+ if verdict.status is not Status.PASS:
146
+ raise AssertionError(f"{verdict.status.label}: {verdict.detail}")
147
+ ```
148
+
149
+ ## Connect your own search
150
+
151
+ If you want Setrya to pause the worker and schedule the searches, give the drill a Python adapter. From the checkout, run the bundled adapter against its HTTP endpoint and save the result. The Markdown summary names the tested revision and gives the reviewer a replay command.
152
+
153
+ ```sh
154
+ python3 -m setrya check setrya/examples/support-search/drill.toml --report run.json --summary summary.md
155
+ python3 -m setrya replay run.json
156
+ ```
157
+
158
+ In pytest, the `setrya_check` fixture runs the whole adapter-driven drill and requires a PASS. For your app, the adapter must identify the revision the worker read, acknowledge publication of its replacement, and query the route as the intended caller. If the old write commits, each final search needs evidence that its index snapshot includes that commit. A PASS covers the configured queries, ranks, caller, and time windows. For an AI agent, that tells you which passages its retrieval tool returned. Checking the answer it wrote takes a separate assertion. [Adapter guide](docs/adapters.md) · [Verdict rules](docs/evidence.md)
159
+
160
+ ## Review an indexing change in a pull request
161
+
162
+ The bundled example runs the same pytest test on two Git commits, one with a broken worker and one with the fix. It captures both test exits and writes the comparison to `review-run/review.md`. With Git and the pytest extra installed, choose a new output directory for each run.
163
+
164
+ ```sh
165
+ python -m setrya.examples.recorded_search.verify --output review-run
166
+ setrya replay review-run/candidate.json
167
+ ```
168
+
169
+ The summary reports `FIX VERIFIED` and shows what changed on the caller’s final search.
170
+
171
+ ```text
172
+ Before FAIL · event 11 · refund-window · final · refund@A
173
+ Expected refund@B. Observed forbidden refund@A at rank 1.
174
+ After PASS · event 11 · refund-window · final · refund@B
175
+ Index rejected the old write. All final probes found their required passages.
176
+ ```
177
+
178
+ The example also saves `opaque.json`, which replays as NOT TESTED even though the test found the 14-day policy. You can download all three reports and the summary from the release. [Sample review bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/recorded-pytest-review.zip)
179
+
180
+ To run your own test on both application revisions, install the pytest extra, fetch both refs, and run this from the application checkout:
181
+
182
+ ```sh
183
+ setrya run-pr --repo . --base origin/main --candidate HEAD \
184
+ --drill tests/refund.toml --output refund-review \
185
+ -- python -m pytest -p setrya.pytest_plugin -q tests/test_index.py::test_refund_update
186
+ ```
187
+
188
+ Setrya checks out each commit in a temporary directory and records the test exit beside its report. Keep the command's exit as a CI gate and upload the output directory even on failure. For a two-worker fix, the comparison can point to a search between the first write and the second worker's release. For route coverage, give `setrya coverage` a repository-owned map and the candidate evidence. A new agent-summary route can then name its owner in the PR even when the existing support-search test passes. [Map routes and jobs](docs/coverage.md) · [Two-worker review bundle](https://github.com/davidahma/setrya/releases/download/v0.12.1/worker-order-review.zip)
189
+
190
+ In a pipeline that already captures both lanes, give `setrya review` two search reports or two matching scenario directories, the expected commit IDs, and the observed exits. A scenario review lists the schedules, identifies the decisive delivery, and gives the reviewer a replay command. [Review a multi-worker run](docs/scenarios.md#compare-the-base-and-candidate-in-ci) · [Download the two-commit scenario review](https://github.com/davidahma/setrya/releases/download/v0.12.1/scenario-review.zip)
191
+
192
+ For recorded tests, keep both reports with the PR. Attach the JSON and Markdown even when the test fails. For a downloaded report, use the installed `setrya replay` command. Replay recomputes the verdict without loading the adapter. The report stores passage IDs and question fingerprints and omits raw queries and passage text. Choose identifiers you can share. [CI recipe and review command](docs/recording.md#use-it-in-a-pull-request) · [GitHub Actions example](.github/workflows/ci.yml)
193
+
194
+ For a single report, `setrya diagnose` explains a missing observation. For a pair without CI commit and exit information, `setrya compare` checks whether the recorded evidence establishes a fix. Checks, driven scenarios and offline gate replay exit 0 for PASS, 1 for FAIL, 2 for an input or execution error, and 3 for NOT TESTED. [Evidence and comparison](docs/evidence.md#compare-two-saved-runs)
195
+
196
+ ## More search regressions
197
+
198
+ - **A deleted paragraph still appears in search.** The refund document shrinks from five chunks to three. A query for the retired clause catches a stale chunk that the general refund query misses. [Retired-chunk drill](setrya/examples/support-search/retired.toml)
199
+ - **A re-upload hides a current passage.** An orphaned pgvector candidate takes a top-three slot. The search returns two current passages and drops the clause about the original payment method. [PostgreSQL/pgvector walkthrough](docs/pgvector.md)
200
+
201
+ If your suite already catches late writes, compare the plain Python test with Setrya’s saved evidence. The paired benchmark runs both approaches against the same pgvector database and worker hooks. [Plain test](setrya/examples/support_search/baseline.py) · [Paired benchmark](docs/benchmark.md)
202
+
203
+ To contribute a drill, include a broken case that exposes the regression and a control query that should keep working. [Contributing](CONTRIBUTING.md) · [Offline qualification](docs/qualification.md) · [Security policy](SECURITY.md) · [Apache 2.0 license](LICENSE)