review: approve prompt occupancy estimator

This commit is contained in:
Keisuke Hirata 2026-06-01 09:59:20 +09:00
parent 2d4ffe0bce
commit a40e45c90a
No known key found for this signature in database
2 changed files with 27 additions and 1 deletions

View File

@ -7,7 +7,7 @@ kind: task
priority: P1
labels: [compaction, token-accounting]
created_at: 2026-06-01T00:16:16Z
updated_at: 2026-06-01T00:41:18Z
updated_at: 2026-06-01T00:59:20Z
assignee: null
legacy_ticket: null
---

View File

@ -96,4 +96,30 @@ Validation:
- `./tickets.sh doctor` in main workspace before finalization.
---
<!-- event: review author: hare at: 2026-06-01T00:59:20Z status: approve -->
## Review: approve
External reviewer recommendation: approve.
Summary:
- Exact UsageRecord matches remain authoritative.
- Extrapolation after the latest measurement no longer uses `latest_total_input_tokens / latest_history_bytes`.
- Interpolation between two measurements still uses measured deltas where fixed overhead cancels.
- One-measurement extrapolation uses a conservative byte fallback added to latest measured total.
- Regression coverage exists in `llm-worker` token counter tests and pod `pre_llm_request` behavior.
- No intentional prune policy/savings, threshold/default, session schema, or compact lifecycle changes were found.
Validation re-run by reviewer:
- `cargo test -p llm-worker token_counter` passed.
- `cargo test -p pod pre_llm_request_does_not_yield_from_single_measurement_history_rate_projection` passed.
- `git diff --check 3ea0058..HEAD` passed.
- `cargo fmt --check` passed.
Non-blocking follow-up:
- Some comments still describe extrapolation as a latest/final measurement rate even though the implementation is now latest measured incremental span or byte fallback. Reviewer classified this as documentation drift only, not a blocker.
---