# Proof audit pass 1 — Claude advisor usage

Reviewed [#24139](https://github.com/pingdotgg/t3code/pull/24139), head [7d5880c5c6](https://github.com/pingdotgg/t3code/commit/7d5880c5c666da50dc51559cbf5b1b18f45cf19b), against its parent, for [#24129](https://github.com/pingdotgg/t3code/issues/24129).

## Fixture matrix

```json
{"visualFixtures": []}
```

The server-only exception applies. All five changed files are server parser/cache code or focused tests. Usage numbers change because the server now emits missing metering records; client layout, rendering, interaction, contracts, and entry points do not change. No screenshot, browser, server launch, mobile/desktop image, or client-by-provider permutation is required. Web, desktop, mobile, and remote connections consume the same server aggregates. This does not claim that the corrected values are invisible.

## Minimum meaningful proof

1. An actual failing regression on the unfixed source showing the missing advisor, followed by the same behavior passing with the fix. Preserve the failing assertion and command/exit status, not just a test count. Lead reports the red test on main fails exactly because the advisor record is absent, and 57 focused tests pass with the fix; this auditor did not independently rerun those tests.
2. A runtime transcript through the actual reader/aggregation path, using the issue fixture: executor unchanged; Fable has 54,204 uncached input and 4,229 output; duplicates do not inflate either record; valid advisor iterations each survive; both buffered and streaming projection paths preserve the nested fields.
3. Legacy-cache evidence: v9 Claude entries with unchanged file stats trigger a full reparse, then persist/resume under v10; deleted transcript history survives migration. The new cache filename avoids an older server overwriting the newer cache.
4. Model-cost evidence using the existing rate lookup. Lead reports isolated real-app Usage / Claude / Cost / 30 days: Fable $0.75, executor $0.13, total $0.88. These are lead-supplied observations, not independently observed by this auditor; the runtime probe below independently verifies model attribution and token totals, not fetched pricing.

The lead's extra before/after client capture is supplementary. Do not block on it under the explicit server-only exception.

## Independent runtime audit

A temporary Node 26.12.1 probe loaded immutable before/fixed parser snapshots from git objects. Four reviewed parser/cache files exactly match the PR snapshot at the lead's integrated fix commit. The service test differs only by unrelated main changes plus the expected cache filename update. The worktree itself was left untouched. The probe used the repository's actual unchanged readTranscriptRecords and UsageAggregator implementations, the fixed cache decoder/dedupe implementation, and the public issue fixture. Only the extracted cache module's import paths changed to resolve those immutable modules.

Observed output:

```text
BEFORE: 1 record, claude-opus-5-5 only.
AFTER: 2 records, executor byte-for-byte structurally equal to BEFORE, plus:
  model=claude-fable-5-1
  uncachedInputTokens=54204 cachedInputTokens=0 cacheCreationTokens=0 outputTokens=4229 reasoningTokens=0
  dedupeKey=msg_1:req_1:advisor:1
BUFFERED: parseLine calls=2, parseProjected calls=0, rawRecords=4, dedupedRecords=2, malformed=0.
PROJECTED: parseLine calls=0, parseProjected calls=2, rawRecords=4, dedupedRecords=2, malformed=0.
MULTIPLE ADVISORS: executor + two same-model advisors retained; keys advisor:1 and advisor:3 stay distinct.
CACHE: usage-scan-cache-v10.json; v9 size=-1, resumeOffset=0; full reparse resumed=false; deduped records=2.
DELETED HISTORY: old executor record retained when no source transcript is available.
V10 ROUNDTRIP: both executor and advisor restored without invalidation.
AGGREGATION: adding both records twice yielded two model buckets and duplicatesDropped=2; token totals stayed exact.
PASS
```

The reader input contained two duplicate assistant content-block records, each padded above a stream chunk. The streaming run forced the actual field-selection/projection path and observed two projected parser calls; it did not merely call parseProjected with an already complete object.

## Coverage from the diff

- Direct parser and projected parser use the same record extraction.
- Top-level executor totals remain authoritative; ordinary message iterations are ignored to avoid counting the executor twice.
- Advisor model, all four token fields, timestamp, session, and speed are preserved; reported advisor cost remains null so the existing per-model pricing path applies.
- Advisor keys differ from the executor, remain stable across content blocks, and remain null when both identifying fields are absent.
- No-advisor, empty-iteration, malformed-iteration, missing/empty/synthetic-model cases have focused coverage.
- Cache tests cover v9 invalidation and older version compatibility; deleted history is retained rather than erased.

## Result and FRICTION

No proof blocker or concrete implementation regression found in this pass. This is a scoped proof audit, not an independent live-client validation or a full merge authorization.

FRICTION:
- The supplied worktree was on the intentional red-test commit, not the integrated fix. Immutable git-object extraction avoided checkout changes and concurrent-work interference.
- One GitCafe reviews read returned SERVER_ERROR / ConnectionRefused; the next read succeeded and showed no reviews. GitCafe reported all 28 checks successful on the reviewed head.
- The lead's 57-test result and live-app price observations remain explicitly attributed; this auditor independently executed the runtime probe only.
- Historical advisor usage cannot be reconstructed from a deleted transcript that was cached before this fix; preserving its existing executor history is correct and the information limit is pre-existing.

No checkout edits, server/browser launches, PR comments, pushes, or merges were performed. Temporary audit files are removed after successful upload.
