codeburn/tests
Andrew Lee bdf4f3fe24 kiro: price v1 executions from credits; unify fallback across parsers
v1 modern execution files carry the same metered credits as v2
(usageSummary[].usage, unit "credit" — the predecessor of v2's
promptTurnSummaries), but the parser only harvested usedTools from
that array and priced executions from estimated tokens. Since v2 only
ships in brand-new IDE builds, v1 is the format nearly all Kiro IDE
users are on today. Sum usage across usageSummary entries and price at
the public overage rate.

Align all three credit parsers (CLI, v1, v2) on one fallback contract —
gate on summed credits > 0 and fall back to token-estimated pricing
with costIsEstimated: true:

- CLI turns without metering_usage were priced at a frozen $0
- CLI turns with an EMPTY metering_usage array (75 of 10,105 real turn
  metadatas — meta written before metering lands) passed the truthy
  presence check and froze $0 marked as real cost
- legacy .chat calls now carry costIsEstimated: true, which was always
  the reality but never stated

Validated against a real machine: 221 of 277 v1/legacy calls now carry
metered cost ($20.11) instead of token estimates that had overstated
them ~5x; verified usageSummary values are per-turn amounts, not
cumulative counters (sequences fluctuate). Call counts unchanged before
and after — nothing gained, lost, or double-counted.

Also document the companion-file fingerprint blind spot at
fingerprintFile: kiro CLI credits and v2 modelId live in companion
files the single-file fingerprint never sees, so a parse racing the
companion write can cache fallback values that only self-heal while
the transcript keeps changing.

AI-Origin: ai-generated
AI-Tool: kiro
2026-07-14 22:36:08 +00:00
..
fixtures fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
providers kiro: price v1 executions from credits; unify fallback across parsers 2026-07-14 22:36:08 +00:00
security fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
setup fix(copilot): content-derived JetBrains dedup keys; isolate the new env var in tests 2026-07-05 15:36:49 +02:00
sharing fix: scope cache read/write to the selected period (web + devices CLI) (#583) (#586) 2026-07-01 15:53:44 +02:00
act-journal.test.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00
act-report.test.ts fix(act): report scale, corrupt-journal safety, and under-claim gaps (#606) 2026-07-03 13:36:36 +02:00
act-undo.test.ts fix(act): support directory moves for archive actions 2026-07-03 10:14:48 +02:00
antigravity-statusline.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
audit-report.test.ts feat: add codeburn audit token-source view (#578) 2026-07-01 13:02:29 +02:00
bash-commands.test.ts fix(bash): attribute wrapped commands to the real tool, not the wrapper (#658) 2026-07-10 06:36:07 -07:00
blob-to-text.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
classifier.test.ts File-aware retry detection with typed ToolCall (#379) 2026-05-22 01:21:42 -07:00
cli-date.test.ts fix(web): reject invalid dashboard periods without exiting (#554) 2026-06-28 19:35:46 +02:00
cli-deepseek-v4-pricing.test.ts fix: DeepSeek v4 Claude pricing through stale runtime cache (#367) 2026-05-21 00:34:53 -07:00
cli-devin-model-variants.test.ts fix(devin): report friendly GPT model names with effort tier (#585) 2026-07-01 16:01:49 +02:00
cli-export-date-range.test.ts feat(export): support custom date ranges 2026-05-05 23:18:48 -07:00
cli-json-daily.test.ts Add multi-day calendar selection with custom popover UI (#393) 2026-05-24 09:49:59 -07:00
cli-model-savings.test.ts feat(cli): track local-model cost savings against a paid baseline (#421) 2026-06-01 11:06:39 +03:00
cli-plan.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
cli-price-override.test.ts feat(pricing): add user price overrides for models (#390) (#560) 2026-06-28 19:07:29 +02:00
cli-provider-validation.test.ts fix(cli): validate --provider and make non-TTY report deterministic (#501) 2026-06-18 12:39:22 +02:00
cli-proxy-path.test.ts test(cli-proxy-path): raise timeout for spawn-based tests to fix load flake (#504) 2026-06-18 12:57:44 +02:00
cli-status-menubar.test.ts feat(menubar): Claude config selector, hardened (supersedes #635) 2026-07-10 01:44:51 +02:00
codex-cache-invalidation.test.ts fix(codex): attribute CLI-wrapped MCP calls (mcp-cli), and re-parse cached sessions (#478) 2026-07-10 12:11:59 +02:00
codex-credits.test.ts feat(codex): compute Codex credit usage (#408, #495) (#510) 2026-06-18 17:03:46 +02:00
compare-stats.test.ts fix(classifier): surface skill name as subCategory for general turns (#203) 2026-05-04 06:26:45 +08:00
content-utils.test.ts fix(parser): tolerate string message content; isolate per-file parse failures (#441) (#450) 2026-06-06 04:01:12 +02:00
currency-rounding.test.ts fix(currency): resolve RON symbol to "lei" across all surfaces 2026-07-06 03:43:03 +03:00
daily-cache.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
dashboard.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
date-range-filter.test.ts Add multi-day calendar selection with custom popover UI (#393) 2026-05-24 09:49:59 -07:00
day-aggregator-savings.test.ts feat(cli): track local-model cost savings against a paid baseline (#421) 2026-06-01 11:06:39 +03:00
day-aggregator.test.ts feat(cli): track local-model cost savings against a paid baseline (#421) 2026-06-01 11:06:39 +03:00
export.test.ts feat(export): surface MCP server usage in JSON and CSV exports (#514) 2026-06-18 23:13:48 +02:00
fetch-utils.test.ts fix(network): add timeouts to critical-path fetches (#445) (#448) 2026-06-06 03:25:36 +02:00
fs-utils.test.ts Raise streaming session cap to 4GB so large Codex sessions are counted (#569) 2026-06-26 01:16:56 +02:00
guard-hooks.test.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00
guard-install.test.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00
kiro-cache-invalidation.test.ts fix(kiro): harden ws-session parsing and cover the stale-cache path (#619) 2026-07-05 15:02:25 +02:00
local-model-savings.test.ts feat(cli): track local-model cost savings against a paid baseline (#421) 2026-06-01 11:06:39 +03:00
mcp-coverage.test.ts Add MCP project profile advisor (#356) 2026-05-24 01:57:59 -07:00
mcp-redact.test.ts fix(mcp): harden redaction, error responses, and pre-warm race 2026-06-03 00:56:30 +02:00
mcp-server.test.ts feat(mcp): get_usage + get_savings tools with annotations, schemas, coalescing 2026-06-02 02:16:10 -07:00
mcp-tables.test.ts feat(mcp): markdown table renderers for usage and savings 2026-06-02 02:13:51 -07:00
menubar-installer.test.ts Fix menubar install release lookup 2026-07-08 21:36:20 +02:00
menubar-json.test.ts feat(menubar): Claude config selector, hardened (supersedes #635) 2026-07-10 01:44:51 +02:00
menubar-savings.test.ts feat(cli): track local-model cost savings against a paid baseline (#421) 2026-06-01 11:06:39 +03:00
minimax.test.ts chore(pricing): refresh LiteLLM snapshot; MiniMax-M3 standard tier 2026-07-02 06:17:01 +02:00
model-efficiency.test.ts feat(report): add per-model efficiency metrics 2026-05-05 23:36:59 -07:00
models-hoist.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
models-report.test.ts feat(codex): compute Codex credit usage (#408, #495) (#510) 2026-06-18 17:03:46 +02:00
models.test.ts fix(report): only exact zero-rate overrides suppress the unpriced flag 2026-07-09 21:22:23 +02:00
optimize-apply.test.ts fix(act): refuse to apply a plan whose target changed since it was built 2026-07-03 11:20:59 +02:00
optimize-fs.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
optimize.test.ts Add JSON output for optimize and yield 2026-06-18 12:13:17 +02:00
otel-cache-aggregation.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
overview.test.ts feat(report): surface unpriced models across overview, JSON, dashboard, and MCP 2026-07-09 21:04:56 +02:00
parser-claude-cwd.test.ts Show real Claude project leaf names; stop stray-.git over-grouping (#540) 2026-06-21 22:42:19 +02:00
parser-compact-entry.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
parser-filter.test.ts test: cover filterProjectsByName include/exclude semantics 2026-04-16 15:49:57 -07:00
parser-gemini-cache.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-large-json-scanner.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
parser-large-session.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-local-savings.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-mcp-inventory.test.ts feat(optimize): MCP tool coverage detector with cache-aware costing 2026-05-05 04:13:04 +03:00
parser-number-helpers.test.ts feat: add devin provider (#444) 2026-06-09 21:58:31 +02:00
parser-proxy-codex-only.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-proxy-merge.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-proxy-pricing.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
parser-skip-line.test.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
parser-subagent-collection.test.ts feat(report): Claude-scoped agent-type breakdown 2026-06-10 11:45:28 +02:00
parser.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
plan-usage.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
plans.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
pricing-fallback-data.test.ts feat(pricing): automatic gap-fill from models.dev and OpenRouter (#457) 2026-06-09 21:17:23 +02:00
provider-registry.test.ts fix(providers): isolate a throwing provider so one bad file can't blank every scan 2026-07-10 00:00:22 +02:00
provider-turn-grouping.test.ts kiro: preserve credit-based cost through the session cache 2026-07-14 22:35:51 +00:00
scan-progress.test.ts fix(parser): keep scan-progress out of the interactive dashboard and compare TUIs 2026-07-10 00:50:35 +02:00
session-cache.test.ts fix(kiro): parse context.messages, add .kiro-server path, extract usageSummary tools, workspace-sessions 2026-07-05 01:28:33 +00:00
sync-e2e.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-headless-e2e.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-infra-e2e.test.ts test(sync): unit, mock-IdP e2e, and developer-only integration tests 2026-07-12 16:05:34 +00:00
sync-ledger-otlp.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-push.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
usage-aggregator.test.ts fix: fix and improve test isolation and collision with environment (#530) 2026-06-20 13:42:10 +02:00
web-dashboard.test.ts fix(web): reject invalid dashboard periods without exiting (#554) 2026-06-28 19:35:46 +02:00
yield.test.ts Add JSON output for optimize and yield 2026-06-18 12:13:17 +02:00