kitaru-evaluator 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.
- kitaru_evaluator-0.1.0/.gitignore +305 -0
- kitaru_evaluator-0.1.0/CHANGELOG.md +9 -0
- kitaru_evaluator-0.1.0/PKG-INFO +7 -0
- kitaru_evaluator-0.1.0/pyproject.toml +14 -0
- kitaru_evaluator-0.1.0/src/kitaru_evaluator/__init__.py +1 -0
- kitaru_evaluator-0.1.0/src/kitaru_evaluator/basic.py +69 -0
- kitaru_evaluator-0.1.0/src/kitaru_evaluator/deterministic.py +1569 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# iCloud conflict duplicates (pattern: "filename 2.ext" or "filename 2")
|
|
2
|
+
*[[:space:]]2.[!.]*
|
|
3
|
+
*[[:space:]]2
|
|
4
|
+
|
|
5
|
+
# Helm dependency artifacts (rebuilt via helm dep update)
|
|
6
|
+
helm/charts/
|
|
7
|
+
helm/Chart.lock
|
|
8
|
+
|
|
9
|
+
# Root TypeScript workspace
|
|
10
|
+
/node_modules/
|
|
11
|
+
/packages/*/node_modules/
|
|
12
|
+
/v2_examples/mastra_support_triage/node_modules/
|
|
13
|
+
/v2_examples/vercel_ai_support_triage/node_modules/
|
|
14
|
+
/packages/*/dist/
|
|
15
|
+
/typescript-dist/
|
|
16
|
+
|
|
17
|
+
# pnpm
|
|
18
|
+
**/.pnpm-store
|
|
19
|
+
|
|
20
|
+
# macOS
|
|
21
|
+
.DS_Store
|
|
22
|
+
|
|
23
|
+
# Byte-compiled / optimized / DLL files
|
|
24
|
+
__pycache__/
|
|
25
|
+
*.py[codz]
|
|
26
|
+
*$py.class
|
|
27
|
+
|
|
28
|
+
# C extensions
|
|
29
|
+
*.so
|
|
30
|
+
|
|
31
|
+
# Distribution / packaging
|
|
32
|
+
.Python
|
|
33
|
+
build/
|
|
34
|
+
develop-eggs/
|
|
35
|
+
dist/
|
|
36
|
+
plugins/candidate-wheels/*
|
|
37
|
+
!plugins/candidate-wheels/.gitkeep
|
|
38
|
+
downloads/
|
|
39
|
+
eggs/
|
|
40
|
+
.eggs/
|
|
41
|
+
lib/
|
|
42
|
+
!docs/lib/
|
|
43
|
+
lib64/
|
|
44
|
+
parts/
|
|
45
|
+
sdist/
|
|
46
|
+
var/
|
|
47
|
+
wheels/
|
|
48
|
+
share/python-wheels/
|
|
49
|
+
*.egg-info/
|
|
50
|
+
.installed.cfg
|
|
51
|
+
*.egg
|
|
52
|
+
MANIFEST
|
|
53
|
+
|
|
54
|
+
# PyInstaller
|
|
55
|
+
# Usually these files are written by a python script from a template
|
|
56
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
57
|
+
*.manifest
|
|
58
|
+
*.spec
|
|
59
|
+
|
|
60
|
+
# Installer logs
|
|
61
|
+
pip-log.txt
|
|
62
|
+
pip-delete-this-directory.txt
|
|
63
|
+
|
|
64
|
+
# Unit test / coverage reports
|
|
65
|
+
htmlcov/
|
|
66
|
+
.tox/
|
|
67
|
+
.nox/
|
|
68
|
+
.coverage
|
|
69
|
+
.coverage.*
|
|
70
|
+
.cache
|
|
71
|
+
nosetests.xml
|
|
72
|
+
coverage.xml
|
|
73
|
+
*.cover
|
|
74
|
+
*.py.cover
|
|
75
|
+
.hypothesis/
|
|
76
|
+
.pytest_cache/
|
|
77
|
+
cover/
|
|
78
|
+
|
|
79
|
+
# Translations
|
|
80
|
+
*.mo
|
|
81
|
+
*.pot
|
|
82
|
+
|
|
83
|
+
# Django stuff:
|
|
84
|
+
*.log
|
|
85
|
+
local_settings.py
|
|
86
|
+
db.sqlite3
|
|
87
|
+
db.sqlite3-journal
|
|
88
|
+
|
|
89
|
+
# Flask stuff:
|
|
90
|
+
instance/
|
|
91
|
+
.webassets-cache
|
|
92
|
+
|
|
93
|
+
# Scrapy stuff:
|
|
94
|
+
.scrapy
|
|
95
|
+
|
|
96
|
+
# Sphinx documentation
|
|
97
|
+
docs/_build/
|
|
98
|
+
|
|
99
|
+
# PyBuilder
|
|
100
|
+
.pybuilder/
|
|
101
|
+
target/
|
|
102
|
+
|
|
103
|
+
# Jupyter Notebook
|
|
104
|
+
.ipynb_checkpoints
|
|
105
|
+
|
|
106
|
+
# IPython
|
|
107
|
+
profile_default/
|
|
108
|
+
ipython_config.py
|
|
109
|
+
|
|
110
|
+
# pyenv
|
|
111
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
112
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
113
|
+
# .python-version
|
|
114
|
+
|
|
115
|
+
# pipenv
|
|
116
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
117
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
118
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
119
|
+
# install all needed dependencies.
|
|
120
|
+
#Pipfile.lock
|
|
121
|
+
|
|
122
|
+
# UV
|
|
123
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
124
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
125
|
+
# commonly ignored for libraries.
|
|
126
|
+
#uv.lock
|
|
127
|
+
|
|
128
|
+
# poetry
|
|
129
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
130
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
131
|
+
# commonly ignored for libraries.
|
|
132
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
133
|
+
#poetry.lock
|
|
134
|
+
#poetry.toml
|
|
135
|
+
|
|
136
|
+
# pdm
|
|
137
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
138
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
139
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
140
|
+
#pdm.lock
|
|
141
|
+
#pdm.toml
|
|
142
|
+
.pdm-python
|
|
143
|
+
.pdm-build/
|
|
144
|
+
|
|
145
|
+
# pixi
|
|
146
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
147
|
+
#pixi.lock
|
|
148
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
149
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
150
|
+
.pixi
|
|
151
|
+
|
|
152
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
153
|
+
__pypackages__/
|
|
154
|
+
|
|
155
|
+
# Celery stuff
|
|
156
|
+
celerybeat-schedule
|
|
157
|
+
celerybeat.pid
|
|
158
|
+
|
|
159
|
+
# SageMath parsed files
|
|
160
|
+
*.sage.py
|
|
161
|
+
|
|
162
|
+
# Environments
|
|
163
|
+
.env
|
|
164
|
+
.envrc
|
|
165
|
+
.venv
|
|
166
|
+
env/
|
|
167
|
+
venv/
|
|
168
|
+
ENV/
|
|
169
|
+
env.bak/
|
|
170
|
+
venv.bak/
|
|
171
|
+
|
|
172
|
+
# Spyder project settings
|
|
173
|
+
.spyderproject
|
|
174
|
+
.spyproject
|
|
175
|
+
|
|
176
|
+
# Rope project settings
|
|
177
|
+
.ropeproject
|
|
178
|
+
|
|
179
|
+
# mypy
|
|
180
|
+
.mypy_cache/
|
|
181
|
+
.dmypy.json
|
|
182
|
+
dmypy.json
|
|
183
|
+
|
|
184
|
+
# Pyre type checker
|
|
185
|
+
.pyre/
|
|
186
|
+
|
|
187
|
+
# pytype static type analyzer
|
|
188
|
+
.pytype/
|
|
189
|
+
|
|
190
|
+
# Cython debug symbols
|
|
191
|
+
cython_debug/
|
|
192
|
+
|
|
193
|
+
# PyCharm
|
|
194
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
195
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
196
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
197
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
198
|
+
#.idea/
|
|
199
|
+
|
|
200
|
+
# Abstra
|
|
201
|
+
# Abstra is an AI-powered process automation framework.
|
|
202
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
203
|
+
# Learn more at https://abstra.io/docs
|
|
204
|
+
.abstra/
|
|
205
|
+
|
|
206
|
+
# Visual Studio Code
|
|
207
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
208
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
209
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
210
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
211
|
+
# .vscode/
|
|
212
|
+
|
|
213
|
+
# Ruff stuff:
|
|
214
|
+
.ruff_cache/
|
|
215
|
+
|
|
216
|
+
# PyPI configuration file
|
|
217
|
+
.pypirc
|
|
218
|
+
|
|
219
|
+
# Cursor
|
|
220
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
221
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
222
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
223
|
+
.cursorignore
|
|
224
|
+
.cursorindexingignore
|
|
225
|
+
|
|
226
|
+
# Marimo
|
|
227
|
+
marimo/_static/
|
|
228
|
+
marimo/_lsp/
|
|
229
|
+
__marimo__/
|
|
230
|
+
|
|
231
|
+
# Cloudflare local state
|
|
232
|
+
.wrangler/
|
|
233
|
+
|
|
234
|
+
# Local project markers
|
|
235
|
+
.kitaru/
|
|
236
|
+
.zen/
|
|
237
|
+
|
|
238
|
+
# Git worktrees (isolated workspaces created via git worktree add)
|
|
239
|
+
.worktrees/
|
|
240
|
+
|
|
241
|
+
# Design docs + Repoprompt
|
|
242
|
+
design/
|
|
243
|
+
dogfood-output/
|
|
244
|
+
prompt-exports/
|
|
245
|
+
|
|
246
|
+
# Local Kitaru UI build artifacts (used by docker/Dockerfile.server-dev)
|
|
247
|
+
docker/kitaru-ui-dist/
|
|
248
|
+
|
|
249
|
+
# MCP
|
|
250
|
+
.mcp.json
|
|
251
|
+
|
|
252
|
+
# Claude
|
|
253
|
+
**/.claude/settings.local.json
|
|
254
|
+
.claude/*
|
|
255
|
+
!.claude/settings.json
|
|
256
|
+
!.claude/skills/
|
|
257
|
+
|
|
258
|
+
# Playwright MCP
|
|
259
|
+
.playwright-mcp/
|
|
260
|
+
|
|
261
|
+
# Bundled Kitaru UI (generated at build time by scripts/download-ui.sh)
|
|
262
|
+
src/kitaru/_ui/dist/
|
|
263
|
+
src/kitaru/_ui/bundle_manifest.json
|
|
264
|
+
.kitaru-ui-bundles/
|
|
265
|
+
|
|
266
|
+
# Codex
|
|
267
|
+
.codex/*
|
|
268
|
+
!.codex/skills/
|
|
269
|
+
AGENTS.override.md
|
|
270
|
+
.agents/skills/*
|
|
271
|
+
!.agents/skills/kitaru-dev/
|
|
272
|
+
!.agents/skills/kitaru-dev/**
|
|
273
|
+
!.agents/skills/kitaru-docs/
|
|
274
|
+
!.agents/skills/kitaru-docs/**
|
|
275
|
+
!.agents/skills/kitaru-release/
|
|
276
|
+
!.agents/skills/kitaru-release/**
|
|
277
|
+
!.agents/skills/kitaru-evaluator-authoring/
|
|
278
|
+
!.agents/skills/kitaru-evaluator-authoring/**
|
|
279
|
+
!.agents/skills/kitaru-session-improvement/
|
|
280
|
+
!.agents/skills/kitaru-session-improvement/**
|
|
281
|
+
!.agents/skills/kitaru-tests-release/
|
|
282
|
+
!.agents/skills/kitaru-tests-release/**
|
|
283
|
+
|
|
284
|
+
# Agent Skills
|
|
285
|
+
.pi/
|
|
286
|
+
.claude/skills/building-pydantic-ai-agents
|
|
287
|
+
.claude/skills/instrumentation
|
|
288
|
+
skills-lock.json
|
|
289
|
+
|
|
290
|
+
# Local PR review screenshots
|
|
291
|
+
.pr-screenshots/
|
|
292
|
+
|
|
293
|
+
# Local scratch — single-developer scratch flow files at repo root
|
|
294
|
+
/my_flow.py
|
|
295
|
+
.claude/skills/logfire-instrumentation
|
|
296
|
+
.clawpatch/
|
|
297
|
+
docs/investigations/
|
|
298
|
+
docs/plans/
|
|
299
|
+
docs/reviews/
|
|
300
|
+
plans/
|
|
301
|
+
replay-verify-reports-live/
|
|
302
|
+
replay-verify-reports/
|
|
303
|
+
|
|
304
|
+
# OpenAPI baseline build output
|
|
305
|
+
openapi/.build/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "kitaru-evaluator"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Built-in deterministic evaluators for Kitaru."
|
|
5
|
+
license = "Apache-2.0"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = ["kitaru>=0.22.0"]
|
|
8
|
+
|
|
9
|
+
[build-system]
|
|
10
|
+
requires = ["hatchling==1.32.0"]
|
|
11
|
+
build-backend = "hatchling.build"
|
|
12
|
+
|
|
13
|
+
[tool.hatch.build.targets.wheel]
|
|
14
|
+
packages = ["src/kitaru_evaluator"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Built-in deterministic evaluators for Kitaru."""
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Basic deterministic evaluators."""
|
|
2
|
+
|
|
3
|
+
from collections import Counter
|
|
4
|
+
|
|
5
|
+
from kitaru.api_models.v1.evaluation import EvaluationResult
|
|
6
|
+
from kitaru.api_models.v1.session_node import NodeType
|
|
7
|
+
from kitaru.task.evaluator import SessionView
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def cost(session: SessionView) -> EvaluationResult:
|
|
11
|
+
"""Report the total recorded cost of a session."""
|
|
12
|
+
recorded_cost = session.session.cost
|
|
13
|
+
if recorded_cost is None or any(
|
|
14
|
+
node.node_type is NodeType.LLM_CALL and node.cost is None
|
|
15
|
+
for node in session.nodes
|
|
16
|
+
):
|
|
17
|
+
return EvaluationResult(
|
|
18
|
+
name="cost",
|
|
19
|
+
value="unavailable",
|
|
20
|
+
explanation="The session has incomplete LLM cost information.",
|
|
21
|
+
)
|
|
22
|
+
return EvaluationResult(
|
|
23
|
+
name="cost",
|
|
24
|
+
score=float(recorded_cost),
|
|
25
|
+
explanation=f"The session recorded a total cost of {recorded_cost}.",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def latency(session: SessionView) -> EvaluationResult:
|
|
30
|
+
"""Measure the wall-clock duration of a session in seconds."""
|
|
31
|
+
started_at = session.session.started_at
|
|
32
|
+
ended_at = session.session.ended_at
|
|
33
|
+
if started_at is None or ended_at is None:
|
|
34
|
+
return EvaluationResult(
|
|
35
|
+
name="latency_seconds",
|
|
36
|
+
score=0.0,
|
|
37
|
+
explanation="The session has no complete timing information.",
|
|
38
|
+
)
|
|
39
|
+
duration = max((ended_at - started_at).total_seconds(), 0.0)
|
|
40
|
+
return EvaluationResult(
|
|
41
|
+
name="latency_seconds",
|
|
42
|
+
score=duration,
|
|
43
|
+
explanation=f"The session ran for {duration:.3f} seconds.",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def tool_call_patterns(session: SessionView) -> EvaluationResult:
|
|
48
|
+
"""Classify whether a session repeats calls to the same tool."""
|
|
49
|
+
tool_names = [
|
|
50
|
+
node.tool_name or node.name
|
|
51
|
+
for node in session.nodes
|
|
52
|
+
if node.node_type is NodeType.TOOL_CALL
|
|
53
|
+
]
|
|
54
|
+
counts = Counter(tool_names)
|
|
55
|
+
repeated_calls = sum(count - 1 for count in counts.values() if count > 1)
|
|
56
|
+
if not tool_names:
|
|
57
|
+
pattern = "no-tool-calls"
|
|
58
|
+
elif repeated_calls:
|
|
59
|
+
pattern = "repeated-tools"
|
|
60
|
+
else:
|
|
61
|
+
pattern = "distinct-tools"
|
|
62
|
+
return EvaluationResult(
|
|
63
|
+
name="tool_call_pattern",
|
|
64
|
+
score=float(repeated_calls),
|
|
65
|
+
value=pattern,
|
|
66
|
+
explanation=(
|
|
67
|
+
f"Found {len(tool_names)} tool calls and {repeated_calls} repeated calls."
|
|
68
|
+
),
|
|
69
|
+
)
|