aid-runtime-python 0.1.159__py3-none-any.whl → 0.1.160__py3-none-any.whl
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.
- aid_runtime/__init__.py +5 -1
- aid_runtime/errors.py +11 -0
- aid_runtime/evals/__init__.py +2 -1
- aid_runtime/evals/dataset.py +38 -2
- {aid_runtime_python-0.1.159.dist-info → aid_runtime_python-0.1.160.dist-info}/METADATA +1 -1
- {aid_runtime_python-0.1.159.dist-info → aid_runtime_python-0.1.160.dist-info}/RECORD +8 -8
- {aid_runtime_python-0.1.159.dist-info → aid_runtime_python-0.1.160.dist-info}/WHEEL +0 -0
- {aid_runtime_python-0.1.159.dist-info → aid_runtime_python-0.1.160.dist-info}/top_level.txt +0 -0
aid_runtime/__init__.py
CHANGED
|
@@ -112,6 +112,7 @@ from aid_runtime.errors import (
|
|
|
112
112
|
ToolNotFoundError,
|
|
113
113
|
ToolPermissionError,
|
|
114
114
|
UnknownModelAliasError,
|
|
115
|
+
UnreviewedCasesError,
|
|
115
116
|
)
|
|
116
117
|
from aid_runtime.evals import (
|
|
117
118
|
AgentEvalRunner,
|
|
@@ -152,6 +153,7 @@ from aid_runtime.evals import (
|
|
|
152
153
|
gateway_judge,
|
|
153
154
|
metric_names,
|
|
154
155
|
normalize,
|
|
156
|
+
require_reviewed,
|
|
155
157
|
run_evaluation,
|
|
156
158
|
z_critical,
|
|
157
159
|
)
|
|
@@ -347,7 +349,7 @@ from aid_runtime.types import (
|
|
|
347
349
|
)
|
|
348
350
|
|
|
349
351
|
#: Kept in sync with ``pyproject.toml`` by a test, so the two cannot drift.
|
|
350
|
-
__version__ = "0.1.
|
|
352
|
+
__version__ = "0.1.160"
|
|
351
353
|
|
|
352
354
|
__all__ = [
|
|
353
355
|
"AGENT_LABEL",
|
|
@@ -574,6 +576,7 @@ __all__ = [
|
|
|
574
576
|
"Transcript",
|
|
575
577
|
"TranscriptEntry",
|
|
576
578
|
"UnknownModelAliasError",
|
|
579
|
+
"UnreviewedCasesError",
|
|
577
580
|
"VectorStore",
|
|
578
581
|
"VectorStoreSpec",
|
|
579
582
|
"VertexProvider",
|
|
@@ -634,6 +637,7 @@ __all__ = [
|
|
|
634
637
|
"record_usage",
|
|
635
638
|
"reduce_step",
|
|
636
639
|
"repair_prompt",
|
|
640
|
+
"require_reviewed",
|
|
637
641
|
"reranker_for",
|
|
638
642
|
"resolve_source",
|
|
639
643
|
"resolve_uri",
|
aid_runtime/errors.py
CHANGED
|
@@ -35,6 +35,7 @@ __all__ = [
|
|
|
35
35
|
"ToolExecutionError",
|
|
36
36
|
"ToolNotFoundError",
|
|
37
37
|
"UnknownModelAliasError",
|
|
38
|
+
"UnreviewedCasesError",
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
|
|
@@ -335,3 +336,13 @@ class GateConfigurationError(EvalError):
|
|
|
335
336
|
itself produced by a model. Gating on one source of non-determinism using
|
|
336
337
|
another is not a gate.
|
|
337
338
|
"""
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
class UnreviewedCasesError(GateConfigurationError):
|
|
342
|
+
"""A CI-gating eval was handed a dataset that still carries unreviewed cases.
|
|
343
|
+
|
|
344
|
+
``aid trace export`` writes every case it produces tagged ``unreviewed``, because
|
|
345
|
+
a machine turned captured traffic into a case and nobody has read it. That is the
|
|
346
|
+
raw material of the improvement loop, not evidence that a change is safe, so a
|
|
347
|
+
``gate.ci`` eval refuses it rather than letting unread data approve a release.
|
|
348
|
+
"""
|
aid_runtime/evals/__init__.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from aid_runtime.evals.agent_runner import AgentEvalRunner, ApprovalPolicy
|
|
6
|
-
from aid_runtime.evals.dataset import Dataset, EvalCase
|
|
6
|
+
from aid_runtime.evals.dataset import Dataset, EvalCase, require_reviewed
|
|
7
7
|
from aid_runtime.evals.gate import (
|
|
8
8
|
BaselineGate,
|
|
9
9
|
EvalBaseline,
|
|
@@ -89,6 +89,7 @@ __all__ = [
|
|
|
89
89
|
"gateway_judge",
|
|
90
90
|
"metric_names",
|
|
91
91
|
"normalize",
|
|
92
|
+
"require_reviewed",
|
|
92
93
|
"run_evaluation",
|
|
93
94
|
"z_critical",
|
|
94
95
|
]
|
aid_runtime/evals/dataset.py
CHANGED
|
@@ -12,9 +12,17 @@ from pathlib import Path
|
|
|
12
12
|
|
|
13
13
|
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
14
14
|
|
|
15
|
-
from aid_runtime.errors import EvalError
|
|
15
|
+
from aid_runtime.errors import EvalError, UnreviewedCasesError
|
|
16
16
|
|
|
17
|
-
__all__ = ["Dataset", "EvalCase"]
|
|
17
|
+
__all__ = ["UNREVIEWED_TAG", "Dataset", "EvalCase", "require_reviewed"]
|
|
18
|
+
|
|
19
|
+
UNREVIEWED_TAG = "unreviewed"
|
|
20
|
+
"""The tag ``aid trace export`` puts on every case it writes.
|
|
21
|
+
|
|
22
|
+
A case carrying it was produced by a machine from captured traffic, so no human has
|
|
23
|
+
read it. It is a legitimate case -- the raw material of the improvement loop -- but it
|
|
24
|
+
is not evidence that a change is safe.
|
|
25
|
+
"""
|
|
18
26
|
|
|
19
27
|
|
|
20
28
|
class EvalCase(BaseModel):
|
|
@@ -110,3 +118,31 @@ class Dataset(BaseModel):
|
|
|
110
118
|
if not case.get("approvals"):
|
|
111
119
|
case.pop("approvals", None)
|
|
112
120
|
return payload
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def require_reviewed(dataset: Dataset, *, eval_id: str) -> Dataset:
|
|
124
|
+
"""Refuse a dataset that still carries cases no human has reviewed.
|
|
125
|
+
|
|
126
|
+
Returns the dataset so a generated CI-gating eval can wrap its loader:
|
|
127
|
+
``require_reviewed(load_dataset(), eval_id=EVAL_ID)``. An eval that does not gate
|
|
128
|
+
CI is left alone -- unreviewed cases are the point of the improvement loop.
|
|
129
|
+
|
|
130
|
+
The refusal is the product. A ``gate.ci`` eval decides whether a change ships, so a
|
|
131
|
+
case exported from traffic and never read would let unread data approve a release.
|
|
132
|
+
Dropping those cases silently would be worse than refusing: the dataset would look
|
|
133
|
+
complete while part of it never ran. The message names the cases and the fix, because
|
|
134
|
+
the fix is a human reading them -- nothing in the runtime can clear the tag for them.
|
|
135
|
+
"""
|
|
136
|
+
unreviewed = dataset.by_tag(UNREVIEWED_TAG)
|
|
137
|
+
if not unreviewed:
|
|
138
|
+
return dataset
|
|
139
|
+
named = ", ".join(case.id for case in unreviewed[:5])
|
|
140
|
+
remainder = "" if len(unreviewed) <= 5 else f" and {len(unreviewed) - 5} more"
|
|
141
|
+
raise UnreviewedCasesError(
|
|
142
|
+
f"eval {eval_id!r} gates CI but its dataset {dataset.name!r} ({dataset.version}) "
|
|
143
|
+
f"carries {len(unreviewed)} case(s) tagged {UNREVIEWED_TAG!r}: {named}{remainder}. "
|
|
144
|
+
f"A case tagged {UNREVIEWED_TAG!r} came from `aid trace export` and no human has "
|
|
145
|
+
f"read it, so it cannot decide whether a change ships. Review each case, then drop "
|
|
146
|
+
f"{UNREVIEWED_TAG!r} from its tags; or point this eval at a dataset you curated. "
|
|
147
|
+
f"An eval with `gate.ci: false` may use an unreviewed dataset as it is."
|
|
148
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aid-runtime-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.160
|
|
4
4
|
Summary: The AID Framework Python runtime: model gateway with pinning and cost budgets, prompt registry, tool executor, OTel GenAI tracing, plain-async pipeline, and an eval harness that gates on statistical regression against a stored baseline.
|
|
5
5
|
Author: The AID Framework authors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
aid_runtime/__init__.py,sha256=
|
|
1
|
+
aid_runtime/__init__.py,sha256=2CQoFRQC_CoKpDFoxGcwPmt_D1-2_HrdjH0okiIq258,14794
|
|
2
2
|
aid_runtime/cache.py,sha256=jhw_EBd9dfWEUzYeibOvIkVBqqiLUjqF5WKEPz9GkhE,6836
|
|
3
3
|
aid_runtime/concurrency.py,sha256=z0tFQHw35ttFLKfazGBjCMPOLQOnUotE_OPpvR1piH4,2829
|
|
4
4
|
aid_runtime/control.py,sha256=y6wPn0fqYJv0nVSsjzpzfiaq1Y7zBoMxCpdrEuqkfvg,17529
|
|
5
5
|
aid_runtime/cost.py,sha256=Hc7X6mtkeanL9eJ1lEZZCQ9LxZurhL1it0gm3s9LpQE,5465
|
|
6
6
|
aid_runtime/decisions.py,sha256=1V0d9EttfwTuh8jgtC5X3wQDTZrl20ZREcs6VqIdcHY,15662
|
|
7
|
-
aid_runtime/errors.py,sha256=
|
|
7
|
+
aid_runtime/errors.py,sha256=gJsQ7FugsA5UU0LrTaOjtZrsRJijCDcG5mKjDNoCU48,13083
|
|
8
8
|
aid_runtime/gateway.py,sha256=MEEjWucsAiDzjoVfWiLxjlS0bjkYYCj5lQYY0N2CsdI,18903
|
|
9
9
|
aid_runtime/local_trace.py,sha256=eg5LDsg1VfNmJNqs8KjtdzTjSqg7SWTXunLwg-b3IcM,7870
|
|
10
10
|
aid_runtime/metrics.py,sha256=w55qPlFRQXUfASxpskgYiSeFcFxkL_mwbDp2IhevAbg,6050
|
|
@@ -28,9 +28,9 @@ aid_runtime/agents/managed.py,sha256=SFyx6Rca2aoiMzA9q6B4Nfes6ZCjn_5_zN0SxzemIII
|
|
|
28
28
|
aid_runtime/agents/memory.py,sha256=6_D6k2bzAiR2euNvzr6HB28wsUUq-R-WTQc12gkB8ao,9156
|
|
29
29
|
aid_runtime/agents/policy.py,sha256=ael0EW_hWfLu95rbqFMrR4WyqAPtgiSNvNw97xnthdw,6122
|
|
30
30
|
aid_runtime/agents/state.py,sha256=4itT7BWv2JKSeWpRrDyxLguOOVnz9gGH_qgRdCbWCaw,6086
|
|
31
|
-
aid_runtime/evals/__init__.py,sha256=
|
|
31
|
+
aid_runtime/evals/__init__.py,sha256=Hs2VsAiRElByXsrBM0SQjr2PQsVAcDvqCQgqy5waMvw,1943
|
|
32
32
|
aid_runtime/evals/agent_runner.py,sha256=E1Vg48gNAeQzGGSyp0cK8H5mxGlVEPBq-FTaaTQ-CLE,12594
|
|
33
|
-
aid_runtime/evals/dataset.py,sha256=
|
|
33
|
+
aid_runtime/evals/dataset.py,sha256=ZmTP-jWx9f2udYPyzvTtOuUse5Mp-uj5WNBPy-7aHKM,5946
|
|
34
34
|
aid_runtime/evals/gate.py,sha256=_nLWXvcuHwq8nE3HpiONg_wBkrzZyGrGT49ZNeKMyTY,15524
|
|
35
35
|
aid_runtime/evals/metrics.py,sha256=LvzKgW-7CNxcB0MmDXakDnwdgyzjpH8ceHq7mdi8mw4,28541
|
|
36
36
|
aid_runtime/evals/predicate.py,sha256=JaeN1LJFpliI4JHYdFPtXfjH5_Aad-2-U3ZC6_hManE,8726
|
|
@@ -61,7 +61,7 @@ aid_runtime/retrieval/rerank.py,sha256=L4ICBi9YHDzhnKVtImKh5Wzre1HDzS8at-AKDkXBJ
|
|
|
61
61
|
aid_runtime/retrieval/retriever.py,sha256=0Cx-_6Qcf2TRolFy4ktMseyyyr-WLphMYYHane0t9lA,24412
|
|
62
62
|
aid_runtime/retrieval/stores.py,sha256=mG261rUHZIzB7niiTj_DuUzcNMOd4QYENk5ArgI1iBo,6840
|
|
63
63
|
aid_runtime/retrieval/types.py,sha256=hJ5IRSD-PTfrc1xhuK6CBdX0Yr-S6L_JeSMPity8ecM,20447
|
|
64
|
-
aid_runtime_python-0.1.
|
|
65
|
-
aid_runtime_python-0.1.
|
|
66
|
-
aid_runtime_python-0.1.
|
|
67
|
-
aid_runtime_python-0.1.
|
|
64
|
+
aid_runtime_python-0.1.160.dist-info/METADATA,sha256=L6CzOTJXKaWggEy6kaQO8J7bIFsdhSQvdAHfJe_btDw,17163
|
|
65
|
+
aid_runtime_python-0.1.160.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
66
|
+
aid_runtime_python-0.1.160.dist-info/top_level.txt,sha256=QvODgNVRDDMmLcTnoIQ4jYnhqf-N4b9sHWEmaUUxp44,12
|
|
67
|
+
aid_runtime_python-0.1.160.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|