You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f13a2e2
Browse filesBrowse the repository at this point in the historyBrowse files
docs(adapter/all): trim multi-paragraph doc comments to load-bearing rationale
External review ccusage#12 (item 5) flagged comment-density on
`build_row_metadata` doc-comment and the surrounding
`totals_json` rationale as multi-paragraph essays. While the
billing-correctness reasoning is genuinely subtle, the comments
had grown into structured explanations that could be summarized
without losing the load-bearing facts a future maintainer needs.
## Trims
- `build_row_metadata` doc: 38 lines → 18 lines. Kept the
3-source structure (loader metadata / metadata_agents / credits),
the reachability note for the metadata-copy branch (session-only),
the defensive guard rationale for the agents key, and the
motivating regression for credits injection. Dropped:
- Detailed code-site walk (`loader.rs:240-249`,
`types.rs::into_row`, etc.) — kept the function names but
dropped specific line numbers that rot easily.
- Repeated `Without injection here, ... ` clause explaining
the same bug in two ways.
- Enumeration of every loader's metadata keys
(`summary_metadata` only inserts X, `codex_group_row` only
inserts Y) — kept the substantive claim that no current
loader emits an `agents` key.
- `totals_json` credits-emission comments: 32 lines (two blocks)
→ 16 lines (one block). Consolidated the gate semantic, the
raw-`json!` emission, the Some(0.0) collapse behavior, the
row-layer asymmetry, the backward-compat note, and the
totalCost out-of-scope acknowledgment into a single labeled
bullet list. Removed the inline secondary comment that
duplicated the `json_float` divergence explanation already
in the lead comment.
Behavior unchanged — pure comment-density reduction with the
load-bearing facts preserved. All cited code sites and pinning
test names still resolve. The remaining comments are
billing-correctness rationale where each line is justified by
the cost of getting it wrong.
## Validation at this tip
- `cd rust && cargo fmt --check` — clean
- `cd rust && cargo clippy --workspace --all-targets -- -D warnings` — clean
- `cd rust && cargo test --workspace` — 368 tests pass (unchanged;
comment-only change)
Refs ccusage#1174.
Co-authored-by: Copilot <[email protected]>
0 commit comments