Repository navigation
lab: request-trace contract (TRACE.md) and validator - #13
Merged
Merged
Conversation
An engine's per-request rows, engine-agnostic: trace_id = the client's X-Trace-Id, arrival_ts epoch seconds, *_s monotonic durations, TPOT = (E2E - TTFT)/(n - 1), terminal states, schema version, and drop counts in a meta table/file. A dir of *.sqlite (requests + meta) or *.jsonl + <stem>.meta.json; python -m lab.trace_contract DIR. inference-server's TELEMETRY_DIR conforms natively from inference-server#102; targets name the env var in [engine.telemetry] dir_env. vLLM OTel mapping noted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AdvayMonga
force-pushed
the
feat/trace-contract
branch
from
October 8, 2026 22:44
a3930a7 to
0e0d2cc
Compare
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.
Defines an engine-agnostic request-trace contract: what an engine reports for each request so the researcher can join it with the client's rows. These rows are diagnostics only and are never scored.
lab/TRACE.mdis the spec. It covers:*.sqlitefiles (tablesrequests+meta) or*.jsonlfiles with a<stem>.meta.json.trace_id: the client'sX-Trace-Id, verbatimarrival_ts: epoch secondstotal_s,ttft_s,tpot_s: durations on a monotonic clock, with TPOT = (E2E − TTFT)/(n − 1)schema_version,terminal_state,prompt_tokens,tokens_outschema_version,rows_written,rows_dropped,closed. Drops are never silent.lab/trace_contract.pyis the validator:check_row,validate(dir), andpython -m lab.trace_contract DIR. It rejects:trace_idarrival_tsvalues that are monotonic readings, epoch ms or epoch nstargets/inference-server.tomlgets[engine.telemetry] dir_env = "TELEMETRY_DIR". No tool reads it yet.test_inference_server_rows_conformchecks this with the engine's own writer and skips on older engines.Tests:
LAB_NO_JAIL=1 pytest -q: 169 passed, 5 skipped.ruff check .: clean. With the engine's python andLAB_ENGINE_REPOset to the #102 branch, the conformance test passes too (27/27).🤖 Generated with Claude Code
Rebased last in the stack; also carries the cross-branch wiring and review fixes from #15: one
[engine.telemetry] envform, timeline in its own subdir, contract check on collected telemetry,X-Trace-Idfrom the correctness client,meta.profileralways{kind,...}, symlinks dropped from jailed tool output before it is copied out, baseline GPU time charged.