Repository navigation
feat(eval): add experiment contracts and usage pricing semantics - #6849
Draft
Colafornia wants to merge 4 commits into
Draft
Colafornia wants to merge 4 commits into
Colafornia wants to merge 4 commits into
Conversation
This was referenced Nov 13, 2026
Colafornia
force-pushed
the
feat/eval-1-foundation
branch
3 times, most recently
from
November 13, 2026 09:34
6af4c42 to
1cfa874
Compare
- contract: add strict maka.eval.v1 spec/attempt validation, closed maka.eval.v2 enums (AttemptMetering, AttemptCancellation, EgressAuditState), normalized RunFingerprint, DifferenceRegistry, and v2->v1 projections - measurement: add exact 6-counter NormalizedUsage without summing totalTokens, MeteringState/TokenBasis, and standardized DEEPSEEK_V4_FLASH_COST pricing Generated-by: Codex Generated-by: Google Antigravity
…ecks in v2 Generated-by: Google Antigravity
- contract: drop prose-in-heap DifferenceRegistry, write-only AttemptPhase, wrapper constructors/predicates, and RawV2AttemptRecord duplication; unify v2->v1 resolution and serde Deserialize boundary; drop thiserror dependency - measurement: remove 1c-only MeteringState/TokenBasis and unused usage helpers, unify NormalizedUsage Deserialize, and move pricing onto PricingRates - tests: consolidate multi-file integration test harness into tests/contract.rs with sharper behavioral assertions Generated-by: Google Antigravity
Generated-by: Google Antigravity
Colafornia
force-pushed
the
feat/eval-1-foundation
branch
from
November 13, 2026 13:41
44441d2 to
c5577bc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
Benchmark runs need strict experiment contracts and exact token semantics before any execution or persistence layer touches them. This PR introduces the
products/evalcrate with only the corecontractlayer and pure 6-counterNormalizedUsage/DEEPSEEK_V4_FLASH_COSTpricing semantics, keeping persistence (store) and HTTP metering (gateway) in parallel follow-ups built on top of it.Refs #6667.
contract: Validatemaka.eval.v1specs via strictserde::Deserialize, expand cells deterministically, model closed orthogonalmaka.eval.v2enums (AttemptMetering,AttemptCancellation,EgressAuditState), compute normalized condition-onlyRunFingerprint, and projectv2 -> v1across all 5 adjudicated semantic difference scenarios.measurement(pure value & pricing slice): Preserve all six token counters (inputTokens,outputTokens,cacheReadTokens,cacheWriteTokens,reasoningTokens,totalTokens) without synthesizingtotalTokens, and compute standardizedPricingRates::cost_usd(DEEPSEEK_V4_FLASH_COST).hex,serde,serde_json,sha2only); no filesystem store, HTTP server/client, CLI binary, Harbor subprocesses, or internalmaka-*dependencies.Verification
Validated at
44441d27bonrust-preview(b86d78606):cargo test --locked -p maka-eval— 5 passed (tests/contract.rs: spec validation and cell expansion, normalized fingerprint key/float invariance, 6-counter usage +DEEPSEEK_V4_FLASH_COSTpricing, earliest-valid canonical attempt selection with terminal0.0score, strictv1/v2deserialization rejection + losslessv1round-trip, andv2 -> v1projections across all 5 adjudicated difference scenarios).cargo clippy --locked -p maka-eval --all-targets -- -D warnings— passed.RUSTDOCFLAGS="-D warnings" cargo doc --locked -p maka-eval --no-deps— passed.cargo fmt -p maka-eval -- --check,node scripts/asf-license-headers.mjs check, andgit diff --check— passed.Full
just check, filesystem store / SQLite tests (1b), HTTP gateway tests (1c), Docker Harbor trials, and live upstream model requests are out of scope for 1a and were not run here.AI use
Tool(s) and scope: OpenAI Codex authored the initial foundation modules and integration tests. Google Antigravity converged the contract/state enums, split
feat/eval-1-foundationinto the1a -> {1b, 1c}diamond DAG (storeandmetering + gateway), fixed thev1/v2contract decoding discrepancies, ablated redundant abstractions and dual decoders (44441d27b), and ran the verification checks above. BothGenerated-bytrailers are preserved.Checklist
Does this PR entail a change in behavior?
中文
概述
在接入持久化存储与运行时代理之前,多臂评测需要先确立严格的实验契约与精确的 Token 语义。本 PR 仅向工作区引入最小化的
products/eval库,包含contract核心契约与纯值的 6 计数器NormalizedUsage/DEEPSEEK_V4_FLASH_COST计价语义;尝试存储(store)与 HTTP 计量网关(gateway)拆出为基于本 PR 并行的两层增量分支。关联 #6667。
contract:通过严格的serde::Deserialize校验maka.eval.v1实验规格并确定性展开单元,使用闭合正交枚举建模maka.eval.v2状态(AttemptMetering、AttemptCancellation、EgressAuditState),计算归一化运行条件RunFingerprint,并实现覆盖全部 5 类裁定场景的v2 -> v1投影。measurement(纯值与定价子集):独立保留六项 Token 计数器(inputTokens、outputTokens、cacheReadTokens、cacheWriteTokens、reasoningTokens、totalTokens,不求和覆盖),并通过PricingRates::cost_usd实现标准DEEPSEEK_V4_FLASH_COST计价公式。hex、serde、serde_json、sha2);不含文件存储、HTTP 网关、CLI 二进制、Harbor 子进程及内部maka-*依赖。验证
基于
rust-preview(b86d78606)在提交44441d27b上验证:cargo test --locked -p maka-eval— 5 项通过(tests/contract.rs:规格校验与单元展开、归一化 fingerprint 键序与浮点等价不变性、6 计数器核算与DEEPSEEK_V4_FLASH_COST计价、最早有效规范结果选样及0.0终态语义、v1/v2非法反序列化拒绝与无损往返、以及全部 5 类语义差异裁定场景的v2 -> v1投影)。cargo clippy --locked -p maka-eval --all-targets -- -D warnings— 通过。RUSTDOCFLAGS=\"-D warnings\" cargo doc --locked -p maka-eval --no-deps— 通过。cargo fmt -p maka-eval -- --check、node scripts/asf-license-headers.mjs check与git diff --check— 通过。未在本层运行完整
just check、文件存储 / SQLite 测试(1b)、HTTP 网关测试(1c)、Docker Harbor 容器试验及真实上游模型请求。AI 使用
工具及范围:OpenAI Codex 编写初始底座模块与集成测试;Google Antigravity 收敛契约状态枚举,将
feat/eval-1-foundation拆分为1a -> {1b, 1c}菱形 DAG(store与metering + gateway),修复v1/v2解码一致性问题,消融移除冗余抽象与双解码器(44441d27b)并执行上述验证。提交保留两个工具的Generated-by标记。检查清单
本 PR 是否改变行为?