aiuse 5.3.0__tar.gz → 5.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. {aiuse-5.3.0/src/aiuse.egg-info → aiuse-5.3.2}/PKG-INFO +2 -2
  2. {aiuse-5.3.0 → aiuse-5.3.2}/README.md +1 -1
  3. {aiuse-5.3.0 → aiuse-5.3.2}/pyproject.toml +1 -1
  4. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/__init__.py +1 -1
  5. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/codexbar.py +6 -2
  6. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/config.py +1 -1
  7. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/paseo_refusals.py +14 -4
  8. {aiuse-5.3.0 → aiuse-5.3.2/src/aiuse.egg-info}/PKG-INFO +2 -2
  9. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_codexbar_parse.py +82 -0
  10. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_paseo_refusals.py +15 -0
  11. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_serve.py +3 -0
  12. {aiuse-5.3.0 → aiuse-5.3.2}/LICENSE +0 -0
  13. {aiuse-5.3.0 → aiuse-5.3.2}/setup.cfg +0 -0
  14. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/__main__.py +0 -0
  15. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/agent_notes.py +0 -0
  16. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/ai_stub.py +0 -0
  17. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/__init__.py +0 -0
  18. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/ceilings.py +0 -0
  19. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/frozen_quota.py +0 -0
  20. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/history.py +0 -0
  21. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/local_runtimes.py +0 -0
  22. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/pace.py +0 -0
  23. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/pool_keys.py +0 -0
  24. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/ranking.py +0 -0
  25. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/selfdescribe.py +0 -0
  26. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/suggest.py +0 -0
  27. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/analysis/use_or_lose.py +0 -0
  28. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/anthropic_cost.py +0 -0
  29. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/attribute.py +0 -0
  30. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/chat_format.py +0 -0
  31. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/cli.py +0 -0
  32. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/client_limits.py +0 -0
  33. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/__init__.py +0 -0
  34. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/acp_usage.py +0 -0
  35. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/bailian.py +0 -0
  36. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/base.py +0 -0
  37. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/bedrock_cost.py +0 -0
  38. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/bedrock_gate.py +0 -0
  39. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/caam.py +0 -0
  40. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/caut.py +0 -0
  41. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/clinepass.py +0 -0
  42. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/cswap.py +0 -0
  43. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/deepseek.py +0 -0
  44. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/grok.py +0 -0
  45. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/hermes.py +0 -0
  46. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/muse.py +0 -0
  47. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/omp_agent_db.py +0 -0
  48. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/opencode_go.py +0 -0
  49. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/opencode_keys.py +0 -0
  50. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/opencode_zen.py +0 -0
  51. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/openrouter.py +0 -0
  52. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/openusage.py +0 -0
  53. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/openusage_sh.py +0 -0
  54. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/paseo.py +0 -0
  55. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/qwencloud.py +0 -0
  56. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/runner.py +0 -0
  57. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/sipb.py +0 -0
  58. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/throttle.py +0 -0
  59. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/collectors/tokscale.py +0 -0
  60. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/credentials.py +0 -0
  61. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/credits_override.py +0 -0
  62. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/homebrew_formula.py +0 -0
  63. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/ledger.py +0 -0
  64. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/macos_trust.py +0 -0
  65. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/models.py +0 -0
  66. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/omp_rate_events.py +0 -0
  67. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/openai_cost.py +0 -0
  68. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/provider_select.py +0 -0
  69. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/quota_refusals.py +0 -0
  70. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/rate_gates.py +0 -0
  71. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/report.py +0 -0
  72. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/sampler.py +0 -0
  73. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/secretspec.py +0 -0
  74. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/serve.py +0 -0
  75. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/timefmt.py +0 -0
  76. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/tty.py +0 -0
  77. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/tui/__init__.py +0 -0
  78. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/tui/app.py +0 -0
  79. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/tui/builders.py +0 -0
  80. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/usage_sources.py +0 -0
  81. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse/watch.py +0 -0
  82. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse.egg-info/SOURCES.txt +0 -0
  83. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse.egg-info/dependency_links.txt +0 -0
  84. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse.egg-info/entry_points.txt +0 -0
  85. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse.egg-info/requires.txt +0 -0
  86. {aiuse-5.3.0 → aiuse-5.3.2}/src/aiuse.egg-info/top_level.txt +0 -0
  87. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_acp_usage.py +0 -0
  88. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_agy_claude_gpt_weekly_misread.py +0 -0
  89. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_aiuse_version.py +0 -0
  90. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_anthropic_cost.py +0 -0
  91. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_attribution.py +0 -0
  92. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_available_provider_scope.py +0 -0
  93. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_bailian.py +0 -0
  94. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_base_run_json.py +0 -0
  95. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_bedrock_cost.py +0 -0
  96. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_bedrock_gate.py +0 -0
  97. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_billing_integration.py +0 -0
  98. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_caam.py +0 -0
  99. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_capacity_pace_line.py +0 -0
  100. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_capacity_rank.py +0 -0
  101. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_caut_parse.py +0 -0
  102. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_chat_format.py +0 -0
  103. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_claude_sublimits.py +0 -0
  104. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_cli.py +0 -0
  105. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_client_limits.py +0 -0
  106. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_clinepass.py +0 -0
  107. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_clinepass_multi_account.py +0 -0
  108. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_codexbar_cache.py +0 -0
  109. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_codexbar_omp.py +0 -0
  110. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_codexbar_pi.py +0 -0
  111. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_codexbar_timeouts.py +0 -0
  112. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_config.py +0 -0
  113. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_credentials.py +0 -0
  114. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_credit_transactions.py +0 -0
  115. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_credits_override.py +0 -0
  116. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_cswap_parse.py +0 -0
  117. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_cursor_pools_fixup.py +0 -0
  118. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_cursor_sibling_pools.py +0 -0
  119. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_deepseek.py +0 -0
  120. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_exhaustion_lead.py +0 -0
  121. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_fresh_per_pool.py +0 -0
  122. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_full_no_dollars.py +0 -0
  123. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_gemini_argon_family.py +0 -0
  124. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_grok.py +0 -0
  125. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_hermes_parse.py +0 -0
  126. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_history.py +0 -0
  127. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_homebrew_formula.py +0 -0
  128. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_install_deps.py +0 -0
  129. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_local_runtimes.py +0 -0
  130. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_macos_trust.py +0 -0
  131. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_models_cli_binary.py +0 -0
  132. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_models_pace.py +0 -0
  133. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_muse.py +0 -0
  134. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_naming_rules.py +0 -0
  135. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_omp_agent_db.py +0 -0
  136. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_omp_chat_json.py +0 -0
  137. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_omp_operator_gate.py +0 -0
  138. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_omp_pace_override.py +0 -0
  139. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_openai_cost.py +0 -0
  140. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_opencode_go.py +0 -0
  141. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_opencode_keys.py +0 -0
  142. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_opencode_zen.py +0 -0
  143. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_openrouter.py +0 -0
  144. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_openusage_cli_resolution.py +0 -0
  145. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_openusage_parse.py +0 -0
  146. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_pace.py +0 -0
  147. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_paseo.py +0 -0
  148. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_plan_phases.py +0 -0
  149. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_provider_select.py +0 -0
  150. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_query_throttle.py +0 -0
  151. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_qwencloud.py +0 -0
  152. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_rate_gate.py +0 -0
  153. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_rate_gates.py +0 -0
  154. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_release_script.py +0 -0
  155. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_report.py +0 -0
  156. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_report_layout.py +0 -0
  157. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_reset_carry_forward.py +0 -0
  158. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_row_regressions.py +0 -0
  159. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_runner_consolidation.py +0 -0
  160. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_sampler.py +0 -0
  161. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_secretspec_manifest.py +0 -0
  162. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_selfdescribe.py +0 -0
  163. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_shared_quota_semantics.py +0 -0
  164. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_sipb.py +0 -0
  165. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_slow_capacity_rank.py +0 -0
  166. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_snapshots_persistence.py +0 -0
  167. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_suggest.py +0 -0
  168. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_tokscale_cache.py +0 -0
  169. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_tokscale_parse.py +0 -0
  170. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_tty.py +0 -0
  171. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_tui.py +0 -0
  172. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_uninstalled_tools.py +0 -0
  173. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_urgency_rank.py +0 -0
  174. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_use_or_lose.py +0 -0
  175. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_watch.py +0 -0
  176. {aiuse-5.3.0 → aiuse-5.3.2}/tests/test_window_pace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiuse
3
- Version: 5.3.0
3
+ Version: 5.3.2
4
4
  Summary: Aggregate AI subscription/API usage and flag use-it-or-lose-it allotments
5
5
  Author: djbclark
6
6
  License-Expression: MIT
@@ -512,7 +512,7 @@ not require importing its Python package.
512
512
  | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
513
513
  | _(none)_ / `--format pretty` | Clock matrix on stdout (empty→n/a→slow→mid→use); meta on stderr; plain when piped |
514
514
  | `--full` | Long pretty report: per-provider, cross-checks, tips, History, detailed plan |
515
- | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.4**: `state`, `usable_now`, `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
515
+ | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.7**: `state`, `usable_now` (false when a window is exhausted or under 5% left), `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
516
516
  | `--available` / `--live` | Routing shortlist: only pools usable **now**, per vendor + model family, sorted by headroom; reads the cache by default, `--live` forces a collect |
517
517
  | `usage-sources` / `--usage-sources` | Which quota tools and ACP context logs are active for each vendor. No collect, no ACP turn. `[usage_sources]` pins one source; the default still blends. See [`docs/acp-usage.md`](docs/acp-usage.md). |
518
518
  | `--brief` | Alias of the default pretty report |
@@ -471,7 +471,7 @@ not require importing its Python package.
471
471
  | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
472
472
  | _(none)_ / `--format pretty` | Clock matrix on stdout (empty→n/a→slow→mid→use); meta on stderr; plain when piped |
473
473
  | `--full` | Long pretty report: per-provider, cross-checks, tips, History, detailed plan |
474
- | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.4**: `state`, `usable_now`, `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
474
+ | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.7**: `state`, `usable_now` (false when a window is exhausted or under 5% left), `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
475
475
  | `--available` / `--live` | Routing shortlist: only pools usable **now**, per vendor + model family, sorted by headroom; reads the cache by default, `--live` forces a collect |
476
476
  | `usage-sources` / `--usage-sources` | Which quota tools and ACP context logs are active for each vendor. No collect, no ACP turn. `[usage_sources]` pins one source; the default still blends. See [`docs/acp-usage.md`](docs/acp-usage.md). |
477
477
  | `--brief` | Alias of the default pretty report |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aiuse"
7
- version = "5.3.0"
7
+ version = "5.3.2"
8
8
  description = "Aggregate AI subscription/API usage and flag use-it-or-lose-it allotments"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,3 +1,3 @@
1
1
  """Aggregate provider quotas and flag use-it-or-lose-it allotments."""
2
2
 
3
- __version__ = "5.3.0"
3
+ __version__ = "5.3.2"
@@ -1438,6 +1438,10 @@ def _from_row(row: dict[str, Any]) -> AccountUsage:
1438
1438
  rate_labels = row.get("rateWindowLabels")
1439
1439
  rate_labels = rate_labels if isinstance(rate_labels, dict) else None
1440
1440
 
1441
+ # The live CLI carries the same invented clock as the widget snapshot
1442
+ # (updatedAt + window length on a 0%-used window); drop it here too.
1443
+ updated_at = parse_dt(usage.get("updatedAt"))
1444
+
1441
1445
  windows: list[QuotaWindow] = []
1442
1446
  extra_windows: list[QuotaWindow] = []
1443
1447
  for extra in usage.get("extraRateWindows") or []:
@@ -1447,7 +1451,7 @@ def _from_row(row: dict[str, Any]) -> AccountUsage:
1447
1451
  title = str(extra.get("title") or extra_id or "Unnamed CodexBar quota")
1448
1452
  if provider == "antigravity":
1449
1453
  title = canonical_gemini_label(title, extra_id or None)
1450
- window = _window(title, extra["window"], window_id=extra_id or None)
1454
+ window = _window(title, _without_placeholder_reset(extra["window"], updated_at), window_id=extra_id or None)
1451
1455
  if window:
1452
1456
  if extra_id == "cursor-grok-bot":
1453
1457
  window = QuotaWindow(
@@ -1464,7 +1468,7 @@ def _from_row(row: dict[str, Any]) -> AccountUsage:
1464
1468
  windows.extend(extra_windows)
1465
1469
 
1466
1470
  for index, key in enumerate(("primary", "secondary", "tertiary"), start=1):
1467
- block = usage.get(key)
1471
+ block = _without_placeholder_reset(usage.get(key), updated_at)
1468
1472
  if not isinstance(block, dict):
1469
1473
  continue
1470
1474
  label = _slot_label(provider, index, block, rate_labels=rate_labels)
@@ -214,7 +214,7 @@ DEFAULT_CONFIG: dict[str, Any] = {
214
214
  "gemini": {
215
215
  "name": "Google AI Pro / Ultra",
216
216
  "notes": (
217
- "Antigravity / Gemini CLI (Pro $20, Ultra $250). Independent pools: "
217
+ "Antigravity / Gemini CLI (Pro $20, Ultra $199.99). Independent pools: "
218
218
  "gemini (Flash), gemini_argon (Gemini 4 Argon), and claude_gpt. "
219
219
  "Claude/GPT here is Google-sold, not Anthropic Claude Code."
220
220
  ),
@@ -161,9 +161,19 @@ def _recent_files(root: Path, since: datetime, limit: int) -> list[Path]:
161
161
 
162
162
 
163
163
  def _iter_error_docs(
164
- agents_dir: Path, *, lookback: timedelta, now: datetime, limit: int = _MAX_FILES
164
+ agents_dir: Path,
165
+ *,
166
+ lookback: timedelta,
167
+ now: datetime,
168
+ limit: int = _MAX_FILES,
169
+ any_status: bool = False,
165
170
  ) -> list[tuple[Path, dict[str, Any]]]:
166
- """``(path, doc)`` per recent Paseo agent state file whose last run errored."""
171
+ """``(path, doc)`` per recent Paseo agent state file whose last run errored.
172
+
173
+ ``any_status`` also takes a file whose ``lastError`` is set but whose
174
+ ``lastStatus`` has moved on (a Pi agent that hit the Antigravity capacity
175
+ error reads ``closed``, never ``error``: 2026-11-19 and 2026-11-21 files).
176
+ """
167
177
  docs: list[tuple[Path, dict[str, Any]]] = []
168
178
  for path in _recent_files(agents_dir, now - lookback, limit):
169
179
  try:
@@ -172,7 +182,7 @@ def _iter_error_docs(
172
182
  continue
173
183
  if not isinstance(doc, dict):
174
184
  continue
175
- if str(doc.get("lastStatus") or "") != "error":
185
+ if not any_status and str(doc.get("lastStatus") or "") != "error":
176
186
  continue
177
187
  error = doc.get("lastError")
178
188
  if not isinstance(error, str) or not error.strip():
@@ -335,7 +345,7 @@ def scan_antigravity_capacity(
335
345
  best: tuple[datetime, Path, dict[str, Any]] | None = None
336
346
  failed = 0
337
347
  models: dict[str, None] = {}
338
- for path, doc in _iter_error_docs(root, lookback=cooldown, now=now):
348
+ for path, doc in _iter_error_docs(root, lookback=cooldown, now=now, any_status=True):
339
349
  text = str(doc.get("lastError") or "")
340
350
  low = text.casefold()
341
351
  if _CAPACITY_MARKER not in low or not any(ctx in low for ctx in _CAPACITY_CONTEXT):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiuse
3
- Version: 5.3.0
3
+ Version: 5.3.2
4
4
  Summary: Aggregate AI subscription/API usage and flag use-it-or-lose-it allotments
5
5
  Author: djbclark
6
6
  License-Expression: MIT
@@ -512,7 +512,7 @@ not require importing its Python package.
512
512
  | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
513
513
  | _(none)_ / `--format pretty` | Clock matrix on stdout (empty→n/a→slow→mid→use); meta on stderr; plain when piped |
514
514
  | `--full` | Long pretty report: per-provider, cross-checks, tips, History, detailed plan |
515
- | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.4**: `state`, `usable_now`, `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
515
+ | `--json` / `--format json` | Full snapshot + alerts + `suggestion` + `history` as JSON (schema **1.7**: `state`, `usable_now` (false when a window is exhausted or under 5% left), `pool_family`, `role`, `effective_left_percent`, `hidden_pools`, pace fields, `summary_lines`, `semantics`, `rate_gated_by`) |
516
516
  | `--available` / `--live` | Routing shortlist: only pools usable **now**, per vendor + model family, sorted by headroom; reads the cache by default, `--live` forces a collect |
517
517
  | `usage-sources` / `--usage-sources` | Which quota tools and ACP context logs are active for each vendor. No collect, no ACP turn. `[usage_sources]` pins one source; the default still blends. See [`docs/acp-usage.md`](docs/acp-usage.md). |
518
518
  | `--brief` | Alias of the default pretty report |
@@ -1406,3 +1406,85 @@ def test_antigravity_used_window_with_placeholder_shaped_reset_is_kept():
1406
1406
  (account,) = _parse_widget_snapshot_entry(entry, age_seconds=5)
1407
1407
  by_label = {w.label: w for w in account.windows}
1408
1408
  assert by_label["Claude/GPT 5-hour"].resets_at is not None
1409
+
1410
+
1411
+ def _live_antigravity_row(*, gemini_used: float, third_party_used: float, updated: datetime) -> dict:
1412
+ """A `codexbar usage --provider antigravity` row as read live on 2026-11-21.
1413
+
1414
+ Unused windows carry resetsAt = updatedAt + window length - 1 s (the 5-hour
1415
+ one 14:47:13Z for updatedAt 14:47:14Z, the weekly one a week out), which is
1416
+ not a real clock: the clock starts on first use.
1417
+ """
1418
+
1419
+ def stamp(value: datetime) -> str:
1420
+ return value.strftime("%Y-%m-%dT%H:%M:%SZ")
1421
+
1422
+ def block(used: float, minutes: int, resets: datetime) -> dict:
1423
+ return {"usedPercent": used, "windowMinutes": minutes, "resetsAt": stamp(resets)}
1424
+
1425
+ placeholder_5h = updated + timedelta(minutes=300) - timedelta(seconds=1)
1426
+ placeholder_week = updated + timedelta(minutes=10080) - timedelta(seconds=1)
1427
+ gem_5h = block(gemini_used, 300, updated + timedelta(hours=4, minutes=30))
1428
+ third_5h = block(third_party_used, 300, placeholder_5h if third_party_used == 0 else updated + timedelta(hours=2))
1429
+ return {
1430
+ "provider": "antigravity",
1431
+ "source": "cli",
1432
+ "usage": {
1433
+ "updatedAt": stamp(updated),
1434
+ "primary": gem_5h,
1435
+ "secondary": third_5h,
1436
+ "extraRateWindows": [
1437
+ {"id": "antigravity-quota-summary-gemini-5h", "title": "Gemini 5-hour", "window": gem_5h},
1438
+ {
1439
+ "id": "antigravity-quota-summary-gemini-weekly",
1440
+ "title": "Gemini weekly",
1441
+ "window": block(0.7, 10080, updated + timedelta(days=6, hours=23)),
1442
+ },
1443
+ {"id": "antigravity-quota-summary-3p-5h", "title": "Claude/GPT 5-hour", "window": third_5h},
1444
+ {
1445
+ "id": "antigravity-quota-summary-3p-weekly",
1446
+ "title": "Claude/GPT weekly",
1447
+ "window": block(third_party_used, 10080, placeholder_week),
1448
+ },
1449
+ ],
1450
+ },
1451
+ }
1452
+
1453
+
1454
+ def test_live_cli_placeholder_reset_on_unused_windows_is_dropped():
1455
+ """The live `codexbar usage` path drops the invented reset too (5.3.2).
1456
+
1457
+ 5.3.0 fixed only the widget-snapshot path; the live read still showed
1458
+ Claude/GPT 5-hour counting down to 19:32Z for a window nobody had started.
1459
+ """
1460
+ updated = datetime(2026, 11, 21, 14, 47, 14, tzinfo=UTC)
1461
+ acc = _from_row(_live_antigravity_row(gemini_used=2.03, third_party_used=0.0, updated=updated))
1462
+ by_label = {w.label: w for w in acc.windows}
1463
+ assert by_label["Claude/GPT 5-hour"].resets_at is None
1464
+ assert by_label["Claude/GPT weekly"].resets_at is None
1465
+ assert by_label["Claude/GPT 5-hour"].window_minutes == 300
1466
+ # the slot copy of the same measurement is not left behind with a clock
1467
+ assert all(w.resets_at is None for w in acc.windows if w.label.startswith("Claude/GPT"))
1468
+ # a used window keeps its real reset
1469
+ assert by_label["Gemini 5-hour"].resets_at is not None
1470
+ assert by_label["Gemini weekly"].resets_at is not None
1471
+
1472
+
1473
+ def test_live_cli_used_window_with_placeholder_shaped_reset_is_kept():
1474
+ """Only a 0%-used window can carry a placeholder: a started one is real."""
1475
+ updated = datetime(2026, 11, 21, 14, 47, 14, tzinfo=UTC)
1476
+ row = _live_antigravity_row(gemini_used=2.03, third_party_used=0.0, updated=updated)
1477
+ for extra in row["usage"]["extraRateWindows"]:
1478
+ if extra["title"] == "Claude/GPT 5-hour":
1479
+ extra["window"]["usedPercent"] = 4.0
1480
+ acc = _from_row(row)
1481
+ assert {w.label: w for w in acc.windows}["Claude/GPT 5-hour"].resets_at is not None
1482
+
1483
+
1484
+ def test_live_cli_row_without_updated_at_keeps_every_reset():
1485
+ """No snapshot time, nothing to compare a reset against: leave it alone."""
1486
+ updated = datetime(2026, 11, 21, 14, 47, 14, tzinfo=UTC)
1487
+ row = _live_antigravity_row(gemini_used=2.03, third_party_used=0.0, updated=updated)
1488
+ del row["usage"]["updatedAt"]
1489
+ acc = _from_row(row)
1490
+ assert {w.label: w for w in acc.windows}["Claude/GPT 5-hour"].resets_at is not None
@@ -419,6 +419,21 @@ def test_antigravity_capacity_error_is_a_cooldown_never_an_exhaustion():
419
419
  assert parse_dt(entry["cooldown_until"]) == event + timedelta(minutes=10)
420
420
 
421
421
 
422
+ def test_antigravity_capacity_error_is_seen_when_the_agent_is_closed():
423
+ """Real 2026-11-19/21 shape: the error text stays in lastError but lastStatus is 'closed'."""
424
+ from aiuse.paseo_refusals import scan_antigravity_capacity
425
+
426
+ now = utcnow()
427
+ doc = _agent("pi", "antigravity/gemini-3.8-flash", AGY_CAPACITY, now=now, status="closed")
428
+ _write_agent("proj", "cap-closed", doc)
429
+ entry = scan_antigravity_capacity(now=now)
430
+ assert entry is not None
431
+ assert entry["kind"] == "capacity"
432
+ assert entry["evidence"].endswith("cap-closed.json")
433
+ # The z.ai throttle and refusal scans keep their error-status-only reading.
434
+ assert scan_paseo_throttle(now=now) is None
435
+
436
+
422
437
  def test_antigravity_capacity_error_ages_out_of_the_cooldown():
423
438
  from aiuse.paseo_refusals import scan_antigravity_capacity
424
439
 
@@ -43,6 +43,9 @@ def test_payload_from_disk_row_picks_suggestion():
43
43
 
44
44
 
45
45
  def test_serve_state_live_collect(monkeypatch):
46
+ # The in-memory cache stamp includes the current minute; a test that straddles a
47
+ # minute boundary (a loaded machine, 2026-11-21 release run) re-collected and failed.
48
+ monkeypatch.setattr("aiuse.serve._clock", lambda: 1_800_000_000.0)
46
49
  snap = Snapshot(
47
50
  collected_at=utcnow(),
48
51
  accounts=[
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes