From 623f45a2548d2ebd6ff312712e2db80579529609 Mon Sep 17 00:00:00 2001 From: Hare Date: Mon, 1 Jun 2026 10:10:06 +0900 Subject: [PATCH] close: prompt occupancy estimator --- .../artifacts/.gitkeep | 0 .../item.md | 4 ++-- .../resolution.md | 15 ++++++++++++ .../thread.md | 23 +++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) rename work-items/{open => closed}/20260601-001616-prompt-occupancy-token-estimator/artifacts/.gitkeep (100%) rename work-items/{open => closed}/20260601-001616-prompt-occupancy-token-estimator/item.md (97%) create mode 100644 work-items/closed/20260601-001616-prompt-occupancy-token-estimator/resolution.md rename work-items/{open => closed}/20260601-001616-prompt-occupancy-token-estimator/thread.md (86%) diff --git a/work-items/open/20260601-001616-prompt-occupancy-token-estimator/artifacts/.gitkeep b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/artifacts/.gitkeep similarity index 100% rename from work-items/open/20260601-001616-prompt-occupancy-token-estimator/artifacts/.gitkeep rename to work-items/closed/20260601-001616-prompt-occupancy-token-estimator/artifacts/.gitkeep diff --git a/work-items/open/20260601-001616-prompt-occupancy-token-estimator/item.md b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/item.md similarity index 97% rename from work-items/open/20260601-001616-prompt-occupancy-token-estimator/item.md rename to work-items/closed/20260601-001616-prompt-occupancy-token-estimator/item.md index 5aea9647..055c17bc 100644 --- a/work-items/open/20260601-001616-prompt-occupancy-token-estimator/item.md +++ b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/item.md @@ -2,12 +2,12 @@ id: 20260601-001616-prompt-occupancy-token-estimator slug: prompt-occupancy-token-estimator title: Token estimator must keep prompt occupancy accounting whole -status: open +status: closed kind: task priority: P1 labels: [compaction, token-accounting] created_at: 2026-06-01T00:16:16Z -updated_at: 2026-06-01T00:59:20Z +updated_at: 2026-06-01T01:10:06Z assignee: null legacy_ticket: null --- diff --git a/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/resolution.md b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/resolution.md new file mode 100644 index 00000000..9c700494 --- /dev/null +++ b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/resolution.md @@ -0,0 +1,15 @@ +Merged and completed. + +Implementation: +- Merged branch `prompt-occupancy-token-estimator` into `develop` with `merge: prompt occupancy estimator`. +- `llm-worker` token counter extrapolation now keeps exact measured prompt occupancy authoritative and no longer extrapolates one-measurement growth via `total_input_tokens / history_bytes`. +- Extrapolation past the latest measurement uses a measured incremental span rate when available; otherwise it adds a conservative byte fallback for the unmeasured delta. +- Added pod interceptor regression coverage for the fresh-session / one-measurement overestimation case. + +Validation after merge: +- `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. +- `./tickets.sh doctor` passed. + +Review: +- External reviewer approved with no blockers. diff --git a/work-items/open/20260601-001616-prompt-occupancy-token-estimator/thread.md b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/thread.md similarity index 86% rename from work-items/open/20260601-001616-prompt-occupancy-token-estimator/thread.md rename to work-items/closed/20260601-001616-prompt-occupancy-token-estimator/thread.md index 2ba02a57..3d92b625 100644 --- a/work-items/open/20260601-001616-prompt-occupancy-token-estimator/thread.md +++ b/work-items/closed/20260601-001616-prompt-occupancy-token-estimator/thread.md @@ -122,4 +122,27 @@ 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. +--- + + + +## Closed + +Merged and completed. + +Implementation: +- Merged branch `prompt-occupancy-token-estimator` into `develop` with `merge: prompt occupancy estimator`. +- `llm-worker` token counter extrapolation now keeps exact measured prompt occupancy authoritative and no longer extrapolates one-measurement growth via `total_input_tokens / history_bytes`. +- Extrapolation past the latest measurement uses a measured incremental span rate when available; otherwise it adds a conservative byte fallback for the unmeasured delta. +- Added pod interceptor regression coverage for the fresh-session / one-measurement overestimation case. + +Validation after merge: +- `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. +- `./tickets.sh doctor` passed. + +Review: +- External reviewer approved with no blockers. + + ---