Build1 distinct publisher3 min readUpdated
The maintainer of agent-cost rebuilt its documentation as claims with machine-checkable provenance. Two behaviors turned out to have no test asserting them.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The maintainer of agent-cost, a small open-source CLI that reads local Claude Code and Codex CLI usage logs to estimate token cost, replaced hand-written documentation with a corpus of claims that each point at a specific file, test, or spec section, plus a content digest of that source at a specific commit [1][2][4]. Writing those pointers surfaced two behaviors that were correct in the source but asserted by no test [6], which is the more interesting result than the docs themselves.
The corpus is not large: 17 observations grouped into 5 topics, covering pricing-catalog validation rules, cache-write lower-bound behavior, unpriced-fact handling, decimal arithmetic for money, and the v1 contract of the `measure` command [3]. Each observation carries a claim kind, an epistemic status, and at least one provenance entry [4]. The forcing function, according to the author, is that an honest provenance entry for a behavior claim has to name the test that exercises it, so every claim required reading the test rather than the implementation [5].
Two claims failed that step. GAP-01 sits in `agent_cost/readers/claude.py`, in `parse_session_facts`: when a usage event's `cache_creation` field is a dict, the reader computes `leftover = cache_creation_input_tokens - (ephemeral_5m + ephemeral_1h)` and emits a `cache_write_unknown` fact if that is positive [9]. Tests covered a breakdown that exactly accounts for the total, and no breakdown at all, but not the reachable middle case where the dict is present and the two counters sum to less than the total [10]. GAP-02 sits in `agent_cost/aggregate.py`, where `_STATUS_RANK` and `build_rows` are meant to give a row the worst pricing status among its facts, ordered unpriced (0) < lower_bound (1) < priced (2) [11]. The existing test mixed an unpriced fact with a priced one; nothing built a row from a lower_bound fact and a priced fact to confirm the row lands on lower_bound [12]. Both went into `docs/claims/gaps.yaml` and became scoped pull requests adding regression tests with zero implementation changes [7].
Neither was a live bug, and the author is explicit that this is the point: the suite already covered both extremes of each piece of logic, and what was missing was the middle case that is easy to reason past while reading code [8]. The author's counterfactual is the load-bearing part of the argument. If a later refactor reordered `_STATUS_RANK` or changed the leftover math, CI would have stayed green while the cost output quietly under- or over-reported cost floors [13].
Worth noting what was already in place: a README section titled "What this measures, and what it doesn't", and a `price_fact()` docstring explaining the lower-bound design decision [14]. Prose did not fail because it was sloppy. It failed, on the author's account, because writing a sentence never generates the question "is there a test for the partial case", and because a reader cannot tell verified sentences from best guesses when every claim carries the same visual weight [15][16]. Two of 17 observations produced a coverage gap, roughly 12 percent [1].
This is one repository and one author, so treat the rate as an anecdote rather than a base rate. The things to watch are whether the content digests actually catch a stale pointer on a real refactor, and whether the gap rate falls as the corpus grows or stays flat because new code arrives faster than claims do.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
agent-cost is a small open-source CLI that reads local Claude Code / Codex CLI usage logs and estimates token cost; the post's author runs it.
The author used a second tool he has been building, evidence-docs, to build a claim corpus against agent-cost, wanting documentation more trustworthy than a hand-written README, with claims that point at the exact test or source line backing them and are checked against real git history so the pointer cannot silently go stale.
The corpus consists of 17 individual observations grouped into 5 topics: pricing-catalog validation rules, the cache-write lower-bound behavior, unpriced-fact handling, decimal arithmetic for money, and the measure command's v1 contract.
Each observation is one statement (a behavior, an invariant, or a decision record) with a claim_kind, an epistemic_status, and one or more provenance entries naming the exact file, test, or spec section backing it, plus a content_digest of that source at a specific commit.
The author states that to write an honest provenance entry for a behavior claim he had to point at the test that exercises it, which meant reading the test, not just the source, for every claim.
Doing this for the cache-write TTL breakdown logic and the pricing-status aggregation logic turned up two places where the claim was true by reading the code but had no test asserting it.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Specific but wholly self-reported
The account is unusually concrete for a single blog post: named files and functions, the exact leftover arithmetic, the unpriced/lower_bound/priced ordering, observation IDs OBS-004 and OBS-010, gap IDs GAP-01 and GAP-02, and schema-level enforcement details. But all of it comes from one publisher and one author who is also the maintainer of both tools; the cluster contains no independent review, no linked commit or CI artifact, and the central risk claim is an untested counterfactual.
One self-applied repository
Documented use of evidence-docs is limited to the author applying it to his own project, yielding one 17-observation corpus and two regression-test pull requests. No external users, downloads, dependents, stars, or third-party deployments appear anywhere in the supplied source.
Mildly overstated generalization
The post is notably self-limiting: it states plainly that neither gap was a live bug and that prose docs already existed and were accurate. The overstatement is in the leap from two findings in one 17-claim corpus to a structural rule for documentation generally, plus a CI-catastrophe framing (quietly misreported cost floors) that never actually occurred, in a post that also recommends the author's own tool.
Author promotes his own tooling
The write-up is authored by the maintainer of both the subject repository (agent-cost) and the tool whose adoption the conclusion argues for (evidence-docs), and it is a crosspost of his own canonical GitHub page. That is a plain and undisclosed self-promotional interest, though no vendor funding, paid placement, or commercial offering is disclosed in the source, which keeps it below the top of the range.
Internally coherent, externally unchecked
Confidence in the narrow factual core -- that a provenance requirement surfaced two untested middle-case paths that were then covered by test-only pull requests -- is fair, because the details are specific and internally consistent. Confidence drops for the generalizable prescription and the risk framing, given one publisher, one self-interested author, no external adoption, and no independent artifact in the cluster.
build
AI-written code fails the same four ways, and every gate you own reports green1 distinct publisher
build
2,513 tool calls, zero refactorings: what agents actually do when you ask them to refactor1 distinct publisher
build
The failure modes of AI agents in low-level code have names, and names can be gated in CI1 distinct publisher
build
Thirteen tasks green, then "give up (Recommended)" on the one that needed understanding1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 14, 2026