Named tool: Headroom, Apache-2.0 local compression library, proxy and agent/MCP integration. Publisher validation: SOURCE-REVIEWED / NOT EXECUTED. This is an optional reader exercise, not a tested benchmark or an LLM evaluation result.
Why this test
Coding agents are often fed thousands of repetitive CI lines. A short answer might conceal the single error line that actually explains the failure. Headroom claims it can compress local log/tool output before it reaches an LLM. This lab measures two separate outcomes: text reduction and preservation of the exact failure evidence. Do not infer accuracy from a compression ratio.
Prerequisites, data boundaries and costs
- Python 3 and pip; a disposable, personal directory. No work source code, real CI output, cloud tokens, production agents or secrets.
- The canonical repo, Apache-2.0 license and 22 Nov v0.45.0 release should be reviewed before package installation.
- Local Python
compress(messages, model="gpt-4o")is documented in the README and does not invoke the named model.modelsupplies a tokenization/profile hint; no OpenAI client is instantiated here. - Installation may download the package and dependencies.
HEADROOM_OFFLINE=1governs operation after installation; it is not a network isolation or sandbox guarantee. No API bill or model key is required for the scripted baseline. Do not run agent wrappers, proxies or model calls just for this lab. - If installing third-party code is not acceptable, read the source and use the synthetic fixture plus scoring protocol as a paper exercise.
Step 1 — Set up only in a disposable directory
mkdir -p headroom-evidence-lab-2026-11-22
cd headroom-evidence-lab-2026-11-22
python3 -m venv .venv
. .venv/bin/activate
python -m pip install headroom-ai
export HEADROOM_OFFLINE=1Do not pipe remote installation scripts into a shell. Pin and inspect the package version for any repeatable production experiment; this teaching script intentionally does not assert a particular PyPI build or its availability. Stop if installation fails or attempts unexpected access.
Step 2 — Create a synthetic known-cause tool result
Save the following as audit_headroom.py:
import json
from pathlib import Path
from headroom import compress
ordinary = [
json.dumps({"level": "INFO", "job": "test-suite", "event": "retrying cache read", "attempt": i % 4})
for i in range(200)
]
cause = "FATAL: test_checkout failed: expected subtotal=30; actual=300; bug: multiply instead of add"
original = "\\n".join(ordinary[:100] + [cause] + ordinary[100:])
messages = [
{"role": "system", "content": "Audit a failing synthetic CI log. Never invent a result."},
{"role": "assistant", "content": original},
]
result = compress(messages, model="gpt-4o")
items = result.messages
compressed = items[-1].get("content", "")
if not isinstance(compressed, str):
compressed = str(compressed)
Path("original.log").write_text(original, encoding="utf-8")
Path("compressed.log").write_text(compressed, encoding="utf-8")
print("Original characters:", len(original))
print("Compressed characters:", len(compressed))
print("Exact fatal evidence retained:", cause in compressed)
print("FATAL marker retained:", "FATAL" in compressed)
print("Known cause retained:", "multiply instead of add" in compressed)
print("Headroom reported tokens_saved:", getattr(result, "tokens_saved", "unavailable"))Run:
python audit_headroom.pyExpected inputs, not observed in this publication: 200 redundant INFO entries and exactly one FATAL line in original.log. The script prints actual lengths and marker checks if this installed version exposes the documented result.messages shape. Exact compressed bytes, ratio, marker survival and token estimates are unknown until you run it. Some content types or versions may not compress at all, may transform the shape or may use a different path; these are outcomes to record, not reasons to invent a pass.
Step 3 — Validate the evidence, not just token savings
grep -n 'FATAL' original.log
grep -n 'FATAL' compressed.log || true
grep -n 'multiply instead of add' compressed.log || true
wc -c original.log compressed.logWrite down whether the compressed evidence names the same wrong operator and expected/actual values. A saved token estimate is not proof that the failure explanation is still possible. If an optional retrieval mechanism restores the uncompressed source, record how and how many additional tool actions are needed.
Scoring (0–5, one point each)
- Cause: exact mistaken multiplication is recoverable from the compressed or retrieved evidence.
- Source marker:
FATALis retained or locally retrievable with an explicit offset/reference. - Integrity: expected 30 and actual 300 remain distinguishable; no invented values.
- Size: meaningful recorded reduction in bytes/tokens; count only if measured.
- Reversibility: original line can be restored on demand without guesswork; mark untested if no retrieval used.
Report the actual numerator and the environment/version. Missing error evidence is a functional failure, even if token savings are high. Never claim an agent would solve the incident: this test contains no agent, no diagnosis model and no end-to-end task run.
Troubleshooting and interpretation
ModuleNotFoundError: confirm that the disposable virtual environment is active and the package installed successfully; don't install globally by default.- Import or API-shape error: the library changed since the README review. Inspect current exported API and record incompatibility; do not silently rewrite claimed test results.
- No compression: the input may not match a supported compression path, size threshold or format. This is valid evidence that this fixture is not improved.
- FATAL disappeared: inspect
original.logto verify the fixture, then treat the compression as failing the evidence-preservation requirement unless an explicit local retrieval restores it. - Network or credentials requested: stop the experiment; neither is required by this no-model control.
Claims and test status
The repository release lists v0.45.0 changes including modeled output-savings accounting and OpenCode model flags. Those claims are source-reviewed, not executed or independently benchmarked here. This guide, its synthetic baseline and the scoring criteria were prepared without running Python, the Headroom package, external models or any CI workload. Results must be supplied by a future reader-controlled run.