ankora 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. ankora-0.1.0/.github/actions/ankora-gate/action.yml +34 -0
  2. ankora-0.1.0/.github/workflows/ankora.yml +38 -0
  3. ankora-0.1.0/.github/workflows/publish.yml +49 -0
  4. ankora-0.1.0/.gitignore +26 -0
  5. ankora-0.1.0/LICENSE +201 -0
  6. ankora-0.1.0/NOTICE +5 -0
  7. ankora-0.1.0/PKG-INFO +234 -0
  8. ankora-0.1.0/README.md +204 -0
  9. ankora-0.1.0/examples/README.md +64 -0
  10. ankora-0.1.0/examples/demo/ankora.yaml +33 -0
  11. ankora-0.1.0/examples/demo/evals/cairo.yaml +13 -0
  12. ankora-0.1.0/examples/demo/evals/paris.yaml +13 -0
  13. ankora-0.1.0/examples/demo/evals/tokyo.yaml +13 -0
  14. ankora-0.1.0/examples/run_demo.sh +70 -0
  15. ankora-0.1.0/examples/sample_langfuse.json +78 -0
  16. ankora-0.1.0/examples/sample_otel.json +200 -0
  17. ankora-0.1.0/pyproject.toml +75 -0
  18. ankora-0.1.0/src/ankora/__init__.py +8 -0
  19. ankora-0.1.0/src/ankora/cli.py +291 -0
  20. ankora-0.1.0/src/ankora/config.py +228 -0
  21. ankora-0.1.0/src/ankora/diff.py +158 -0
  22. ankora-0.1.0/src/ankora/ingest/__init__.py +83 -0
  23. ankora-0.1.0/src/ankora/ingest/langfuse.py +273 -0
  24. ankora-0.1.0/src/ankora/ingest/otel.py +420 -0
  25. ankora-0.1.0/src/ankora/models.py +147 -0
  26. ankora-0.1.0/src/ankora/providers/__init__.py +1 -0
  27. ankora-0.1.0/src/ankora/providers/anthropic.py +100 -0
  28. ankora-0.1.0/src/ankora/providers/base.py +50 -0
  29. ankora-0.1.0/src/ankora/providers/echo.py +42 -0
  30. ankora-0.1.0/src/ankora/providers/openai.py +98 -0
  31. ankora-0.1.0/src/ankora/providers/registry.py +49 -0
  32. ankora-0.1.0/src/ankora/replay.py +75 -0
  33. ankora-0.1.0/src/ankora/scorers/__init__.py +1 -0
  34. ankora-0.1.0/src/ankora/scorers/base.py +22 -0
  35. ankora-0.1.0/src/ankora/scorers/embedding.py +45 -0
  36. ankora-0.1.0/src/ankora/scorers/exact.py +34 -0
  37. ankora-0.1.0/src/ankora/scorers/json_schema.py +175 -0
  38. ankora-0.1.0/src/ankora/scorers/llm_judge.py +123 -0
  39. ankora-0.1.0/src/ankora/scorers/regex.py +34 -0
  40. ankora-0.1.0/src/ankora/scorers/registry.py +54 -0
  41. ankora-0.1.0/src/ankora/storage.py +74 -0
  42. ankora-0.1.0/src/ankora/suites.py +43 -0
  43. ankora-0.1.0/tests/test_config.py +161 -0
  44. ankora-0.1.0/tests/test_diff.py +191 -0
  45. ankora-0.1.0/tests/test_echo.py +74 -0
  46. ankora-0.1.0/tests/test_ingest_langfuse.py +155 -0
  47. ankora-0.1.0/tests/test_ingest_otel.py +147 -0
  48. ankora-0.1.0/tests/test_models.py +96 -0
  49. ankora-0.1.0/tests/test_providers.py +245 -0
  50. ankora-0.1.0/tests/test_replay.py +161 -0
  51. ankora-0.1.0/tests/test_scorers.py +264 -0
  52. ankora-0.1.0/tests/test_smoke.py +32 -0
  53. ankora-0.1.0/tests/test_storage.py +80 -0
  54. ankora-0.1.0/uv.lock +626 -0
@@ -0,0 +1,34 @@
1
+ name: "ankora gate"
2
+ description: >
3
+ Replay your eval suite and fail the build if quality regressed against the
4
+ baseline. Provider API keys are read from the environment (pass them via
5
+ `env:` from repo secrets for real, non-deterministic replays).
6
+
7
+ inputs:
8
+ config:
9
+ description: "Path to ankora.yaml"
10
+ required: false
11
+ default: "ankora.yaml"
12
+ working-directory:
13
+ description: "Directory to run ankora in"
14
+ required: false
15
+ default: "."
16
+ version:
17
+ description: "ankora version/spec to install with `uv tool install`"
18
+ required: false
19
+ default: "ankora"
20
+
21
+ runs:
22
+ using: "composite"
23
+ steps:
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v5
26
+
27
+ - name: Install ankora
28
+ shell: bash
29
+ run: uv tool install "${{ inputs.version }}"
30
+
31
+ - name: Run ankora gate
32
+ shell: bash
33
+ working-directory: ${{ inputs.working-directory }}
34
+ run: ankora gate --config "${{ inputs.config }}"
@@ -0,0 +1,38 @@
1
+ name: ankora
2
+
3
+ # CI for the ankora project itself: lint, type-safe tests, and the keyless
4
+ # end-to-end demo so `ankora gate` is exercised on every push and PR.
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.11", "3.12", "3.13"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Sync dependencies
27
+ run: uv sync
28
+
29
+ - name: Lint (ruff)
30
+ run: |
31
+ uv run ruff check
32
+ uv run ruff format --check
33
+
34
+ - name: Test (pytest)
35
+ run: uv run pytest -q
36
+
37
+ - name: Keyless end-to-end demo (exercises `ankora gate`)
38
+ run: bash examples/run_demo.sh
@@ -0,0 +1,49 @@
1
+ name: publish
2
+
3
+ # Publish ankora to PyPI when a GitHub Release is published, using PyPI
4
+ # Trusted Publishing (OIDC). No API tokens are stored in this repository —
5
+ # see RELEASING.md for the one-time PyPI setup.
6
+
7
+ on:
8
+ release:
9
+ types: [published]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v5
22
+
23
+ - name: Build sdist + wheel
24
+ run: uv build
25
+
26
+ - name: Upload dist artifact
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ publish:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ # The `pypi` environment scopes the OIDC trust and lets you add approvals.
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/project/ankora/
39
+ permissions:
40
+ id-token: write # required for Trusted Publishing (OIDC); no tokens needed
41
+ steps:
42
+ - name: Download dist artifact
43
+ uses: actions/download-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+
48
+ - name: Publish to PyPI
49
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,26 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+
9
+ # uv / venv
10
+ .venv/
11
+
12
+ # tooling caches
13
+ .pytest_cache/
14
+ .ruff_cache/
15
+
16
+ # ankora local state
17
+ .ankora/
18
+ claude.md
19
+
20
+ # private (do not publish)
21
+ CLAUDE.md
22
+ project.md
23
+ prompts.md
24
+ .env
25
+ .env.*
26
+ .ankora/
ankora-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 ankora contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
ankora-0.1.0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ ankora
2
+ Copyright 2026 ankora contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see the LICENSE
5
+ file). This product includes software developed by the ankora contributors.
ankora-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.4
2
+ Name: ankora
3
+ Version: 0.1.0
4
+ Summary: Local-first, CI-native regression testing for LLM and agent applications.
5
+ Project-URL: Homepage, https://github.com/ankora/ankora
6
+ Project-URL: Repository, https://github.com/ankora/ankora
7
+ Author: ankora contributors
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Keywords: ci,evaluation,genai,llm,otel,regression-testing
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: anthropic>=0.30
23
+ Requires-Dist: httpx>=0.27
24
+ Requires-Dist: openai>=1.30
25
+ Requires-Dist: pydantic>=2
26
+ Requires-Dist: pyyaml>=6
27
+ Requires-Dist: rich>=13
28
+ Requires-Dist: typer>=0.12
29
+ Description-Content-Type: text/markdown
30
+
31
+ # ankora
32
+
33
+ **Turn the traces you already capture into regression tests that fail your CI when quality silently drops.**
34
+
35
+ Teams have observability but no tests. ~89% of teams run some form of LLM
36
+ observability, but only ~52% run evals — and quality is the No. 1 blocker to
37
+ shipping LLM features to production. So prompt tweaks, model-version bumps, and
38
+ silent provider changes ship undetected until users complain.
39
+
40
+ `ankora` closes that gap from the supply side: it replays the traces you
41
+ already have as a deterministic regression suite, scores the outputs, and
42
+ **exits non-zero when quality regresses** — so a GitHub Action can block the
43
+ merge. Local-first, bring-your-own-keys, no account, no telemetry.
44
+
45
+ ---
46
+
47
+ ## 60-second quickstart (no API keys required)
48
+
49
+ Install from source with [uv](https://docs.astral.sh/uv/):
50
+
51
+ ```bash
52
+ git clone https://github.com/ankora/ankora
53
+ cd ankora
54
+ uv sync
55
+ ```
56
+
57
+ > Coming once published to PyPI: `uv tool install ankora` (or `pip install ankora`).
58
+
59
+ Now run the fully offline demo — it uses the built-in deterministic `echo`
60
+ provider and deterministic scorers, so **no network and no keys**:
61
+
62
+ ```bash
63
+ bash examples/run_demo.sh
64
+ ```
65
+
66
+ You'll watch the full loop **run → baseline set → gate** and see the CI contract
67
+ both ways: a **green gate (exit 0)** when the run matches the baseline, then a
68
+ **red gate (exit 1)** after a Case is deliberately broken:
69
+
70
+ ```
71
+ ==> 3. Gate against the baseline (clean — expect exit 0)
72
+ No regressions — gate passed.
73
+ clean gate exit code: 0
74
+ ...
75
+ ==> 5. Gate again (regression — expect non-zero exit)
76
+ 1 regression(s) detected — failing the gate.
77
+ broken gate exit code: 1
78
+ ```
79
+
80
+ That's the whole idea: **a regression makes the command exit non-zero.**
81
+
82
+ ---
83
+
84
+ ## The core loop
85
+
86
+ In your own repo, the loop is four commands. Point `target.provider` at
87
+ `openai`/`anthropic` in `ankora.yaml` for real replays (keys come from your
88
+ env, below), or keep the keyless `echo` provider to try it out.
89
+
90
+ ```bash
91
+ # 0. Scaffold ankora.yaml + an evals/ directory
92
+ ankora init
93
+
94
+ # 1. Turn an OpenTelemetry GenAI or Langfuse trace export into regression Cases
95
+ # (format is auto-detected; force it with --format otel|langfuse)
96
+ ankora ingest traces.json --out evals/
97
+
98
+ # 2. Replay + score the suite; saves a run under .ankora/runs/
99
+ ankora run
100
+
101
+ # 3. Promote a good run to the baseline
102
+ ankora baseline set <run_id>
103
+
104
+ # 4. The CI entrypoint: replay, diff vs baseline, exit non-zero on regression
105
+ ankora gate
106
+ ```
107
+
108
+ Inspect any two runs read-only (never fails the build):
109
+
110
+ ```bash
111
+ ankora diff <baseline_run_id> <current_run_id>
112
+ ```
113
+
114
+ Every command has `--help`; `--config` points at a non-default `ankora.yaml`,
115
+ `--target provider:model` overrides the target, and `--concurrency` bounds
116
+ parallel replays.
117
+
118
+ ### Configuration (`ankora.yaml`)
119
+
120
+ ```yaml
121
+ version: 1
122
+ suites: ["evals/**/*.yaml"]
123
+ target:
124
+ provider: openai # openai | anthropic | echo (keyless, for demos/CI)
125
+ model: gpt-4o-mini
126
+ providers:
127
+ openai: {api_key_env: OPENAI_API_KEY} # keys read from env, never inlined
128
+ scorers:
129
+ - type: exact # deterministic, no key needed
130
+ threshold: 1.0
131
+ - type: regex
132
+ pattern: '"country"'
133
+ - type: json_schema
134
+ schema: {type: object, required: [city, country]}
135
+ - type: llm_judge # needs a provider key
136
+ judge: {provider: openai, model: gpt-4o}
137
+ rubric: "Score 1 if factually consistent with the reference, else 0."
138
+ threshold: 0.7
139
+ - type: embedding_similarity
140
+ model: {provider: openai, model: text-embedding-3-small}
141
+ threshold: 0.85
142
+ gate:
143
+ fail_on: regression # "regression" (vs baseline) or "absolute" (vs thresholds)
144
+ baseline: .ankora/baseline.json
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Wire it into CI
150
+
151
+ Add a workflow to your repo that runs `ankora gate` on pull requests. Provider
152
+ keys come from repo secrets — ankora reads them from the environment and
153
+ **never sees or stores your tokens**.
154
+
155
+ ```yaml
156
+ # .github/workflows/ankora.yml
157
+ name: ankora
158
+ on: pull_request
159
+ jobs:
160
+ gate:
161
+ runs-on: ubuntu-latest
162
+ steps:
163
+ - uses: actions/checkout@v4
164
+ - uses: astral-sh/setup-uv@v5
165
+ - run: uv tool install ankora # once published to PyPI
166
+ - run: ankora gate
167
+ env:
168
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
169
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
170
+ ```
171
+
172
+ A composite action that wraps those steps ships at
173
+ [`.github/actions/ankora-gate`](.github/actions/ankora-gate/action.yml).
174
+ Commit `.ankora/baseline.json` (or promote a run with `ankora baseline set`)
175
+ so CI has something to compare against.
176
+
177
+ ---
178
+
179
+ ## Why it's different
180
+
181
+ - **Local-first & offline.** Runs on your laptop or a CI runner. No account, no
182
+ login, no hosted service — and **no telemetry, ever.**
183
+ - **Bring-your-own-keys.** Replays use *your* provider keys from env vars. We
184
+ never carry token cost and never see your tokens.
185
+ - **Neutral & framework-agnostic.** Reads open formats (OpenTelemetry GenAI
186
+ semantic conventions first). Your suite is plain YAML checked into your repo —
187
+ no lock-in to a framework, provider, or storage backend.
188
+ - **It fails your CI.** The whole point: `ankora gate` exits non-zero on
189
+ regression, so a quality drop blocks the merge instead of reaching users.
190
+
191
+ ---
192
+
193
+ ## v1 scope — and what's next
194
+
195
+ **Shipped in v1:**
196
+
197
+ - `init` — scaffold `ankora.yaml` + `evals/`
198
+ - `ingest` — OpenTelemetry GenAI **and Langfuse** traces → regression Cases (format auto-detected; override with `--format {otel,langfuse,auto}`)
199
+ - `run` — deterministic replay + scoring, persisted runs
200
+ - `diff` — per-case comparison of two runs
201
+ - `gate` — replay + baseline diff + non-zero exit on regression (the CI entrypoint)
202
+ - `baseline set` — promote a run to the baseline
203
+ - Providers: `openai`, `anthropic`, and a keyless `echo` provider for demos/CI
204
+ - Scorers: `exact`, `regex`, `json_schema` (deterministic), `embedding_similarity`, `llm_judge`
205
+
206
+ **Coming next (not built yet — no false promises):**
207
+
208
+ - A scheduled drift watch (`run` on a cron against a live endpoint)
209
+ - Multi-step agent-trajectory record/replay with tool mocking
210
+
211
+ v1 targets single-turn LLM replay; recorded tool calls are kept as reference
212
+ data but not yet re-executed.
213
+
214
+ ---
215
+
216
+ ## Development
217
+
218
+ ```bash
219
+ uv sync
220
+ uv run pytest # all provider calls are mocked; no live API calls
221
+ uv run ruff check
222
+ uv run ruff format --check
223
+ ```
224
+
225
+ ## Releasing
226
+
227
+ Maintainers: see [RELEASING.md](RELEASING.md). Publishing to PyPI happens
228
+ automatically when you cut a GitHub Release, via
229
+ [Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (OIDC — no API
230
+ tokens stored in the repo).
231
+
232
+ ## License
233
+
234
+ Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).