oc_chat
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# oc_chat/benchmarks/__init__.py
4
5"""
6OC Chat benchmark suite (plan 136) — re-runnable prompt/provider economics.
7
8Purpose
9-------
10A manual, CLI-launchable harness that drives a fixed, scripted
11multi-turn session through OC Chat's existing public entry points
12(no production-code changes) and records the per-turn economics Plan
13135 needs for its before/after comparison: prompt / cache / reasoning
14token splits, TTFT, ReAct iterations, tool-call names, the composed
15``messages[0]``/``messages[1]`` sizes, and the effective sub-loop
16system-prompt size.
17
18The pure logic (metric extraction, report writing, scenarios) is
19hermetically unit-tested with no key and no network; the live runs are
20a manual CLI (``python -m oc_chat.benchmarks``) that needs a real
21provider key and is deliberately excluded from the auto pytest suite.
22
23Responsibilities
24----------------
25- :mod:`oc_chat.benchmarks.metrics` — pure raw-usage → typed metrics +
26 aggregation (hermetically tested).
27- :mod:`oc_chat.benchmarks.report` — :class:`RunReport` + Markdown/JSON
28 writers with deterministic, diff-stable output.
29- :mod:`oc_chat.benchmarks.prices` — dated, provenance-stamped price
30 table; tokens are the source of truth, ``$`` is best-effort.
31- :mod:`oc_chat.benchmarks.presenter` — :class:`BenchmarkPresenter`,
32 the metric tap over the presenter contract.
33- :mod:`oc_chat.benchmarks.scenarios` — the fixed, version-stamped
34 scenario registry.
35- :mod:`oc_chat.benchmarks.runner` — the live driver: register →
36 compose via the real startup path → isolate persistence → run →
37 report.
38- :mod:`oc_chat.benchmarks.__main__` — the ``run`` / ``run-all`` /
39 ``list`` CLI.
40
41Diagnostics
42-----------
43Domain: OC_CHAT.MAIN
44Levels:
45 L2 — lifecycle events
46 L3 — semantic details
47 L4 — deep tracing
48
49Contracts
50---------
51- This package touches no shipped OC Chat module; it drives the engine
52 through ``Agent`` / ``run_turn`` / the real startup composition path.
53- Default runs are ephemeral: a benchmark-local autosave-suppression
54 policy keeps chat logs, metadata, and tool artifacts out of the
55 user's session store unless ``--persist`` is given.
56- Provider keys come from the environment only and are never written
57 into reports (only env-var *names* appear).
58
59See Also
60--------
61oc_chat/plans/136-benchmark-suite.md — the authoring plan.
62oc_chat/docs/architecture/benchmarks/benchmark-methodology.md — the spec.
63"""
64from __future__ import annotations
65
66SCHEMA_VERSION = 1
67HARNESS_VERSION = "1.0.0"
68
69__all__ = ["SCHEMA_VERSION", "HARNESS_VERSION"]