entelligence-cli 0.1.331__tar.gz → 0.1.335__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 (264) hide show
  1. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/PKG-INFO +10 -1
  2. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/README.md +9 -0
  3. entelligence_cli-0.1.335/entelligence_cli/_vendor/MEMORY_CORE_SOURCE_REVISION +1 -0
  4. entelligence_cli-0.1.335/entelligence_cli/_vendor/MEMORY_CORE_VERSION +1 -0
  5. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/source.py +136 -8
  6. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/api_client.py +12 -0
  7. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/billing_snapshot.py +26 -10
  8. entelligence_cli-0.1.335/entelligence_cli/daily_billing.py +368 -0
  9. entelligence_cli-0.1.335/entelligence_cli/daily_claude.py +142 -0
  10. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/session_inventory.py +9 -0
  11. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/discovery.py +33 -8
  12. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/PKG-INFO +10 -1
  13. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/SOURCES.txt +4 -0
  14. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/pyproject.toml +1 -1
  15. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_billing_snapshot.py +46 -0
  16. entelligence_cli-0.1.335/tests/test_daily_billing.py +347 -0
  17. entelligence_cli-0.1.335/tests/test_upload_skips_codex_imports.py +112 -0
  18. entelligence_cli-0.1.331/entelligence_cli/_vendor/MEMORY_CORE_SOURCE_REVISION +0 -1
  19. entelligence_cli-0.1.331/entelligence_cli/_vendor/MEMORY_CORE_VERSION +0 -1
  20. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/__init__.py +0 -0
  21. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/__init__.py +0 -0
  22. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/__init__.py +0 -0
  23. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/code_authorship.py +0 -0
  24. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/__init__.py +0 -0
  25. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/__init__.py +0 -0
  26. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_paths.py +0 -0
  27. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_segmentation_prompts/system.j2 +0 -0
  28. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_segmentation_prompts/user.j2 +0 -0
  29. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/__init__.py +0 -0
  30. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/_base.py +0 -0
  31. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/_jsonl_utils.py +0 -0
  32. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/__init__.py +0 -0
  33. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/git_reader.py +0 -0
  34. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/models.py +0 -0
  35. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/parser.py +0 -0
  36. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/source.py +0 -0
  37. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/factory.py +0 -0
  38. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/__init__.py +0 -0
  39. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/__init__.py +0 -0
  40. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/base.py +0 -0
  41. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/claude_code.py +0 -0
  42. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/claude_cost_summary.py +0 -0
  43. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/codex.py +0 -0
  44. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/copilot.py +0 -0
  45. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/cursor_agent_transcript.py +0 -0
  46. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/cursor_store.py +0 -0
  47. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/kiro.py +0 -0
  48. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/opencode.py +0 -0
  49. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/behavior_signals.py +0 -0
  50. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/edit_lines.py +0 -0
  51. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/file_paths.py +0 -0
  52. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/metrics.py +0 -0
  53. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/produced.py +0 -0
  54. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/segment_orchestrator.py +0 -0
  55. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/segment_pure.py +0 -0
  56. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/session_pure.py +0 -0
  57. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/skill_names.py +0 -0
  58. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/spans.py +0 -0
  59. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/pricing.py +0 -0
  60. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/vocabulary/__init__.py +0 -0
  61. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/vocabulary/categories.py +0 -0
  62. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/vocabulary/edges.py +0 -0
  63. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/_vendor/memory_core/vocabulary/nodes.py +0 -0
  64. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/agent_insights_proxy.py +0 -0
  65. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/agent_insights_segment.py +0 -0
  66. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ascii-art.txt +0 -0
  67. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/browser_login.py +0 -0
  68. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/claude_cloud.py +0 -0
  69. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/cli.py +0 -0
  70. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/code_authorship.py +0 -0
  71. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/__init__.py +0 -0
  72. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/auth.py +0 -0
  73. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/budget.py +0 -0
  74. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/config.py +0 -0
  75. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/cursor_doctor.py +0 -0
  76. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/incident.py +0 -0
  77. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/insights.py +0 -0
  78. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/mcp.py +0 -0
  79. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/reset.py +0 -0
  80. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/review.py +0 -0
  81. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/router.py +0 -0
  82. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/security.py +0 -0
  83. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/skills.py +0 -0
  84. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/trim.py +0 -0
  85. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/commands/update.py +0 -0
  86. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/config.py +0 -0
  87. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/cursor_cloud.py +0 -0
  88. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/cursor_path_a_usage.py +0 -0
  89. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/diagnostics.py +0 -0
  90. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/exceptions.py +0 -0
  91. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/facts_envelope.py +0 -0
  92. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/git_operations.py +0 -0
  93. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/hooks/__init__.py +0 -0
  94. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/hooks/capacity_emit.py +0 -0
  95. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/hooks/context_guard.py +0 -0
  96. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/hooks/session_brief.py +0 -0
  97. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/hooks/standup_emit.py +0 -0
  98. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/insights_log.py +0 -0
  99. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/insights_watch.py +0 -0
  100. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/mcp_inventory.py +0 -0
  101. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/platform_env.py +0 -0
  102. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/__init__.py +0 -0
  103. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/claude_settings.py +0 -0
  104. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/codex_auth.py +0 -0
  105. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/codex_settings.py +0 -0
  106. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/compress.py +0 -0
  107. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/copilot_launcher.py +0 -0
  108. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/copilot_settings.py +0 -0
  109. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/cursor_settings.py +0 -0
  110. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/router/state.py +0 -0
  111. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/scheduling.py +0 -0
  112. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/session_deferrals.py +0 -0
  113. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/session_revisions.py +0 -0
  114. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/textual_ui.py +0 -0
  115. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/token_savings_snapshot.py +0 -0
  116. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/__init__.py +0 -0
  117. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/interactive.py +0 -0
  118. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/keys.py +0 -0
  119. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/loaders.py +0 -0
  120. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/output.py +0 -0
  121. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/ui/styles.py +0 -0
  122. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/update_checker.py +0 -0
  123. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/__init__.py +0 -0
  124. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/conductor.py +0 -0
  125. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/config.py +0 -0
  126. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/cursor_usage.py +0 -0
  127. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/manifest.py +0 -0
  128. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/models.py +0 -0
  129. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/pii.py +0 -0
  130. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/runner.py +0 -0
  131. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/secrets.py +0 -0
  132. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/upload/stores.py +0 -0
  133. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli/wrapped_game.py +0 -0
  134. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/dependency_links.txt +0 -0
  135. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/entry_points.txt +0 -0
  136. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/requires.txt +0 -0
  137. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/entelligence_cli.egg-info/top_level.txt +0 -0
  138. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/setup.cfg +0 -0
  139. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_agent_insights_proxy.py +0 -0
  140. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_agent_insights_proxy_api_client.py +0 -0
  141. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_agent_insights_segment.py +0 -0
  142. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_attach_fix_smoke.py +0 -0
  143. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_attach_ticket_smoke.py +0 -0
  144. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_auto_update_loop_guard.py +0 -0
  145. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_billing_snapshot_cloud.py +0 -0
  146. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_budget_smoke.py +0 -0
  147. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_capacity_emit.py +0 -0
  148. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_capture_boundary.py +0 -0
  149. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_cloud.py +0 -0
  150. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_cloud_cadence.py +0 -0
  151. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_code_cost_events.py +0 -0
  152. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_code_subagent_usage.py +0 -0
  153. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_claude_hook_helper_classification.py +0 -0
  154. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_code_authorship.py +0 -0
  155. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_code_authorship_parser_regressions.py +0 -0
  156. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_code_authorship_parsers.py +0 -0
  157. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_codex_auth.py +0 -0
  158. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_codex_native_ledger.py +0 -0
  159. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_codex_settings.py +0 -0
  160. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_codex_total_only_sync.py +0 -0
  161. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_conductor.py +0 -0
  162. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_context_guard.py +0 -0
  163. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_copilot_launcher.py +0 -0
  164. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_copilot_parser_tokens.py +0 -0
  165. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_creation_provenance_contract.py +0 -0
  166. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_cloud.py +0 -0
  167. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_composer_mtime_stamp.py +0 -0
  168. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_doctor.py +0 -0
  169. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_path_a_usage.py +0 -0
  170. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_path_regex_and_heartbeat.py +0 -0
  171. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_self_heal_loop.py +0 -0
  172. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_settings.py +0 -0
  173. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_unknown_timestamps.py +0 -0
  174. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage.py +0 -0
  175. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage_archive.py +0 -0
  176. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage_completeness.py +0 -0
  177. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage_heal.py +0 -0
  178. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage_recapture.py +0 -0
  179. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_cursor_usage_state.py +0 -0
  180. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_detached_background_work.py +0 -0
  181. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_diagnostics.py +0 -0
  182. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_discovery_head_unicode.py +0 -0
  183. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_discovery_opencode.py +0 -0
  184. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_eligibility_state.py +0 -0
  185. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_endpoint_scheme_enforcement.py +0 -0
  186. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_entropy_secret_detection.py +0 -0
  187. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_error_body_decode.py +0 -0
  188. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_facts_envelope.py +0 -0
  189. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_git_operations_copilot.py +0 -0
  190. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_heartbeat_api_client.py +0 -0
  191. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_identity_cache_refresh.py +0 -0
  192. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_incident_refs.py +0 -0
  193. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_incident_smoke.py +0 -0
  194. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_cadence_heartbeat.py +0 -0
  195. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_checkpoint_resume.py +0 -0
  196. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_copilot_prompts.py +0 -0
  197. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_cursor_composer_home.py +0 -0
  198. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_index_failure.py +0 -0
  199. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_kiro_prompts.py +0 -0
  200. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_log.py +0 -0
  201. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_me_smoke.py +0 -0
  202. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_path_a_default.py +0 -0
  203. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_produced_prs.py +0 -0
  204. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_redrain.py +0 -0
  205. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_repo_attribution.py +0 -0
  206. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_schedule.py +0 -0
  207. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_schedule_arm.py +0 -0
  208. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_structured_payload.py +0 -0
  209. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_watch.py +0 -0
  210. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_insights_watch_transport.py +0 -0
  211. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_legacy_encoding_recovery.py +0 -0
  212. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_local_source_discovery_stats.py +0 -0
  213. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_login_token_stdin.py +0 -0
  214. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_machine_fingerprint.py +0 -0
  215. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_mcp_install.py +0 -0
  216. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_mcp_inventory.py +0 -0
  217. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_multipart_backoff.py +0 -0
  218. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_pii.py +0 -0
  219. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_presigned_skip_index.py +0 -0
  220. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_processing_checkpoint_api_client.py +0 -0
  221. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_release_directive.py +0 -0
  222. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_reset_command.py +0 -0
  223. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_review_redaction.py +0 -0
  224. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_rosetta_self_heal.py +0 -0
  225. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_router_commands.py +0 -0
  226. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_router_dead_proxy_guard.py +0 -0
  227. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_router_stats.py +0 -0
  228. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_scheduling_cron_env.py +0 -0
  229. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_schtasks_integration.py +0 -0
  230. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_secrets_redaction_boundary.py +0 -0
  231. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_security_commands.py +0 -0
  232. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_segment_chunking.py +0 -0
  233. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_segment_session_timeout.py +0 -0
  234. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_segmentation_role_gate.py +0 -0
  235. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_segmentation_window_scope.py +0 -0
  236. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_segmentation_worker_failure_visibility.py +0 -0
  237. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_session_accuracy_regressions.py +0 -0
  238. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_session_brief.py +0 -0
  239. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_session_deferrals.py +0 -0
  240. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_session_inventory.py +0 -0
  241. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_session_revisions.py +0 -0
  242. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sessions_status_chunking.py +0 -0
  243. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sessions_status_safe_default.py +0 -0
  244. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_skills_command.py +0 -0
  245. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_backgrounding.py +0 -0
  246. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_dry_run_checkpoint.py +0 -0
  247. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_parse_failure_checkpoint.py +0 -0
  248. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_partial_schema.py +0 -0
  249. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_pushes_built_sessions.py +0 -0
  250. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_sync_runs_full_pipeline.py +0 -0
  251. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_token_savings_snapshot.py +0 -0
  252. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_trim_command.py +0 -0
  253. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_trim_hook_opt_in_only_guard.py +0 -0
  254. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_update_command.py +0 -0
  255. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_copilot.py +0 -0
  256. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_cursor_store.py +0 -0
  257. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_home_backfill.py +0 -0
  258. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_kiro.py +0 -0
  259. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_repo_filter.py +0 -0
  260. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_upload_repo_roots.py +0 -0
  261. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_windows_compat.py +0 -0
  262. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_world_model_provenance.py +0 -0
  263. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_wrap_retry.py +0 -0
  264. {entelligence_cli-0.1.331 → entelligence_cli-0.1.335}/tests/test_wsl_support.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entelligence-cli
3
- Version: 0.1.331
3
+ Version: 0.1.335
4
4
  Summary: AI-powered code review assistant for your terminal - Get instant, intelligent feedback on your code changes
5
5
  Author-email: EntelligenceAI <info@entelligence.ai>
6
6
  Project-URL: Homepage, https://entelligence.ai
@@ -197,6 +197,15 @@ so they cannot repeatedly displace healthy work. They retry when their local inp
197
197
  changes, the CLI version changes, a new replay directive arrives, or analysis is
198
198
  forced. This local hint never acknowledges a replay or supplies missing billing.
199
199
 
200
+ On a supporting backend, the inventory cycle also starts an independent daily
201
+ billing worker, even when no sessions need processing. It collects exact completed
202
+ UTC days of Cursor account usage and Claude reference usage from local transcript
203
+ requests. Claude amounts are rate-card references, not Anthropic invoices, and
204
+ cloud-only history absent from local homes is not covered. Billing errors or hung
205
+ collectors never hold up regular session sync; incomplete days remain retryable.
206
+ Large days use acknowledged chunks before publication. See
207
+ [daily billing behavior, coverage, and limits](docs/daily_billing_snapshots.md).
208
+
200
209
  The raw (redacted) transcript upload — the depth lane for decisions, replay and
201
210
  byte-derived pricing — runs alongside metrics syncs only for orgs whose
202
211
  backend posture permits it. Unchanged transcripts are skipped. The 15-minute metrics
@@ -161,6 +161,15 @@ so they cannot repeatedly displace healthy work. They retry when their local inp
161
161
  changes, the CLI version changes, a new replay directive arrives, or analysis is
162
162
  forced. This local hint never acknowledges a replay or supplies missing billing.
163
163
 
164
+ On a supporting backend, the inventory cycle also starts an independent daily
165
+ billing worker, even when no sessions need processing. It collects exact completed
166
+ UTC days of Cursor account usage and Claude reference usage from local transcript
167
+ requests. Claude amounts are rate-card references, not Anthropic invoices, and
168
+ cloud-only history absent from local homes is not covered. Billing errors or hung
169
+ collectors never hold up regular session sync; incomplete days remain retryable.
170
+ Large days use acknowledged chunks before publication. See
171
+ [daily billing behavior, coverage, and limits](docs/daily_billing_snapshots.md).
172
+
164
173
  The raw (redacted) transcript upload — the depth lane for decisions, replay and
165
174
  byte-derived pricing — runs alongside metrics syncs only for orgs whose
166
175
  backend posture permits it. Unchanged transcripts are skipped. The 15-minute metrics
@@ -0,0 +1 @@
1
+ f0226e8af01b7ca37ca82d61b10e90c1db57659b
@@ -568,6 +568,117 @@ def _slug_name_variants(name: str) -> list[str]:
568
568
  return variants
569
569
 
570
570
 
571
+ #: Where a Codex home keeps rollouts. Codex MOVES a rollout, unchanged, from
572
+ #: `sessions/YYYY/MM/DD/` to a flat `archived_sessions/` when the developer
573
+ #: archives the thread. The file stem -- and so the session id -- is the same in
574
+ #: both, so reading the second folder cannot mint a second session.
575
+ CODEX_ROLLOUT_DIRS = ("sessions", "archived_sessions")
576
+
577
+
578
+ def codex_rollout_dirs(home: Path) -> list[Path]:
579
+ """Return the rollout directories that exist under a Codex home.
580
+
581
+ The single answer to "where are this home's Codex sessions", shared by
582
+ every reader (`LocalSource`, the server-side uploader walk, the skill
583
+ corpus walker, and the CLI's transcript upload) so none of them can
584
+ overlook archived threads again.
585
+
586
+ Args:
587
+ home: a candidate Codex home.
588
+
589
+ Returns:
590
+ The existing directories, `sessions/` first. EMPTY means this is not a
591
+ Codex home: a home whose every thread is archived has no `sessions/`
592
+ directory and is still a home.
593
+ """
594
+ return [home / name for name in CODEX_ROLLOUT_DIRS if (home / name).is_dir()]
595
+
596
+
597
+ #: Where Codex records the sessions it imported from another agent, one record
598
+ #: per import, each naming the Codex thread it created (`imported_thread_id`).
599
+ _CODEX_IMPORT_LEDGER = "external_agent_session_imports.json"
600
+ _UUID_LEN = 36
601
+
602
+
603
+ def _codex_imported_thread_ids(home: Path) -> frozenset[str]:
604
+ """Return the thread ids Codex says it imported from another agent.
605
+
606
+ Reads Codex's own ledger, so an import is identified by what Codex
607
+ recorded, never guessed from a transcript's shape.
608
+
609
+ Args:
610
+ home: a Codex home (the directory holding `sessions/`).
611
+
612
+ Returns:
613
+ The imported thread ids. EMPTY when the ledger is absent, unreadable
614
+ or not the expected shape, and malformed records are passed over: an
615
+ empty set skips nothing, so every failure here fails open to
616
+ capturing the rollout, never to dropping a session.
617
+ """
618
+ try:
619
+ ledger = json.loads((home / _CODEX_IMPORT_LEDGER).read_text(encoding="utf-8"))
620
+ except (OSError, ValueError):
621
+ return frozenset()
622
+ records = ledger.get("records") if isinstance(ledger, dict) else None
623
+ if not isinstance(records, list):
624
+ return frozenset()
625
+ return frozenset(
626
+ record["imported_thread_id"]
627
+ for record in records
628
+ if isinstance(record, dict) and isinstance(record.get("imported_thread_id"), str)
629
+ )
630
+
631
+
632
+ def _codex_ran_a_turn(jsonl_file: Path) -> bool:
633
+ """Return whether Codex ran a model turn of its own in this rollout.
634
+
635
+ Codex writes a `turn_context` record for every turn it runs. A transcript
636
+ it only imported has none; one the developer then continued in Codex does,
637
+ and carries real Codex spend.
638
+
639
+ Returns:
640
+ True when a `turn_context` record is present -- and also when the file
641
+ cannot be read, so an I/O fault can never be what drops a session.
642
+ """
643
+ # ponytail: an import that was never continued is re-read in full on every
644
+ # index build (measured: 45 files, 8 MB, ~125 ms). Cache by (path, mtime,
645
+ # size) if a home ever holds enough imports for that to show up in a sync.
646
+ try:
647
+ with jsonl_file.open("rb") as fh:
648
+ for line in fh:
649
+ if b'"turn_context"' not in line:
650
+ continue
651
+ try:
652
+ record = json.loads(line)
653
+ except ValueError:
654
+ continue
655
+ if isinstance(record, dict) and record.get("type") == "turn_context":
656
+ return True
657
+ except OSError:
658
+ return True
659
+ return False
660
+
661
+
662
+ def _codex_is_uncontinued_import(jsonl_file: Path, imported_thread_ids: frozenset[str]) -> bool:
663
+ """Return whether a rollout is another agent's session that Codex only imported.
664
+
665
+ The single statement of the rule, shared by every Codex discovery path
666
+ (`LocalSource` here, and the CLI's transcript upload) so they cannot
667
+ disagree about which rollouts are Codex sessions.
668
+
669
+ Args:
670
+ jsonl_file: the rollout; its stem ends in its thread id.
671
+ imported_thread_ids: `_codex_imported_thread_ids` of the rollout's home.
672
+
673
+ Returns:
674
+ True only when BOTH hold: Codex's ledger names the thread, and Codex
675
+ never ran a turn of its own in it. The ledger alone would drop an
676
+ import the developer went on to continue in Codex, which carries
677
+ real Codex spend.
678
+ """
679
+ return jsonl_file.stem[-_UUID_LEN:] in imported_thread_ids and not _codex_ran_a_turn(jsonl_file)
680
+
681
+
571
682
  def _cwd_from_codex_head(head: bytes) -> str | None:
572
683
  """The absolute `cwd` Codex records in its `session_meta` line.
573
684
 
@@ -1260,14 +1371,18 @@ class LocalSource:
1260
1371
  _index_put(index, ref[0], ref[1], newest)
1261
1372
 
1262
1373
  for home in self.codex_homes:
1263
- sessions_dir = home / "sessions"
1264
- if not sessions_dir.is_dir():
1265
- logger.debug("Skipping non-existent path: %s", sessions_dir)
1374
+ rollout_dirs = codex_rollout_dirs(home)
1375
+ if not rollout_dirs:
1376
+ logger.debug("Skipping non-existent path: %s", home / "sessions")
1266
1377
  continue
1267
- for jsonl_file in sessions_dir.rglob("*.jsonl"):
1268
- ref = self._index_codex_file(jsonl_file, home=home)
1269
- if ref:
1270
- _index_put(index, ref[0], ref[1], newest)
1378
+ imported_thread_ids = _codex_imported_thread_ids(home)
1379
+ for rollout_dir in rollout_dirs:
1380
+ for jsonl_file in rollout_dir.rglob("*.jsonl"):
1381
+ ref = self._index_codex_file(
1382
+ jsonl_file, home=home, imported_thread_ids=imported_thread_ids
1383
+ )
1384
+ if ref:
1385
+ _index_put(index, ref[0], ref[1], newest)
1271
1386
 
1272
1387
  # opencode: materialized NDJSON lives at `<home>/<project_id>/*.jsonl`
1273
1388
  # (no fixed sub-dir like Claude's `projects/` or Codex's `sessions/`),
@@ -1464,8 +1579,18 @@ class LocalSource:
1464
1579
  jsonl_file: Path,
1465
1580
  *,
1466
1581
  home: Path,
1582
+ imported_thread_ids: frozenset[str] = frozenset(),
1467
1583
  ) -> tuple[str, _FileRef] | None:
1468
- """Index one Codex JSONL file."""
1584
+ """Index one Codex JSONL file.
1585
+
1586
+ Args:
1587
+ jsonl_file: the rollout to index.
1588
+ home: the Codex home it was found under.
1589
+ imported_thread_ids: `_codex_imported_thread_ids(home)`, read once
1590
+ per home by the caller. A rollout named for one of these that
1591
+ Codex never ran a turn in is another agent's session, already
1592
+ captured under that agent, and is skipped.
1593
+ """
1469
1594
  if not jsonl_file.is_file():
1470
1595
  # See _index_cc_file's identical guard: a directory/broken symlink
1471
1596
  # is never tallied, only a genuinely empty real file is.
@@ -1492,6 +1617,9 @@ class LocalSource:
1492
1617
  self._record_discovery("codex", "different_agent")
1493
1618
  return None
1494
1619
 
1620
+ if _codex_is_uncontinued_import(jsonl_file, imported_thread_ids):
1621
+ self._record_discovery("codex", "imported_not_continued")
1622
+ return None
1495
1623
  stem = jsonl_file.stem
1496
1624
  session_id = f"local:{agent}:{stem}"
1497
1625
  mtime = datetime.fromtimestamp(jsonl_file.stat().st_mtime, tz=UTC)
@@ -993,6 +993,18 @@ class APIClient:
993
993
  "/agent-insights/ingest-facts-envelope/", payload, org_uuid=org_uuid, timeout=120
994
994
  )
995
995
 
996
+ def claim_daily_billing(self, org_uuid: str, payload: dict) -> dict:
997
+ """Claim dated reference collection work, independently of session leases."""
998
+ return self._eku_post(
999
+ "/agent-insights/billing-work/", payload, org_uuid=org_uuid, timeout=20
1000
+ )
1001
+
1002
+ def report_daily_billing(self, org_uuid: str, payload: dict) -> dict:
1003
+ """Publish one complete fenced agent/day; errors leave the day retryable."""
1004
+ return self._eku_post(
1005
+ "/agent-insights/ingest-daily-billing/", payload, org_uuid=org_uuid, timeout=30
1006
+ )
1007
+
996
1008
  def report_billing_snapshot(self, org_uuid: str, payload: dict) -> dict:
997
1009
  """`POST /agent-insights/ingest-billing-snapshot/` — the on-demand vendor
998
1010
  billing snapshot (ENT-4550, T26): a per-(day, agent) usage/cost report
@@ -381,7 +381,7 @@ def _iter_billed_assistant_lines(paths: list[Path]) -> Iterator[dict[str, Any]]:
381
381
 
382
382
 
383
383
  def _fallback_claude_code_cost_events(
384
- transcript: Path, subagent_files: list[Path]
384
+ transcript: Path, subagent_files: list[Path], *, assistant_lines=None
385
385
  ) -> list[dict[str, Any]]:
386
386
  """Bounded-memory fallback for a Claude Code session too large for the
387
387
  normal parse (``OversizedSessionError``) -- streams assistant lines from
@@ -439,7 +439,12 @@ def _fallback_claude_code_cost_events(
439
439
  ValueError: a message id's fragments disagree on model or request id.
440
440
  """
441
441
  pending: dict[str, dict[str, Any]] = {}
442
- for line in _iter_billed_assistant_lines([transcript, *subagent_files]):
442
+ lines = (
443
+ _iter_billed_assistant_lines([transcript, *subagent_files])
444
+ if assistant_lines is None
445
+ else assistant_lines
446
+ )
447
+ for line in lines:
443
448
  msg = line.get("message") or {}
444
449
  key = msg.get("id") or line.get("uuid") or record_hash(line)
445
450
  if not key:
@@ -990,19 +995,28 @@ def compute_and_report_billing_snapshot(
990
995
  error_detail=f"server rejected: {code}" if code else None,
991
996
  )
992
997
  return False
993
- stored = int(resp.get("rows_written") or resp.get("rowsWritten") or 0)
994
- if stored < len(rows):
998
+ raw_stored = resp.get("rows_written", resp.get("rowsWritten", 0))
999
+ raw_preserved = resp.get("rows_preserved", resp.get("rowsPreserved", 0))
1000
+ valid_counts = all(type(value) is int and value >= 0 for value in (raw_stored, raw_preserved))
1001
+ stored = raw_stored if type(raw_stored) is int and raw_stored >= 0 else 0
1002
+ preserved = raw_preserved if type(raw_preserved) is int and raw_preserved >= 0 else 0
1003
+ if not valid_counts or stored + preserved < len(rows):
995
1004
  # Review-caught (CRITICAL): a `success: true` response with an
996
- # incomplete `rows_written` must never stamp the directive as
1005
+ # incomplete write/preservation receipt must never stamp the directive as
997
1006
  # obeyed — that would permanently suppress the retry that would
998
- # otherwise fill in the missing rows on the next heartbeat. The
1007
+ # otherwise fill in the missing rows on the next heartbeat.
1008
+ # Automatic daily references are authoritative; the backend separately
1009
+ # acknowledges rows deliberately preserved instead of overwritten. They
1010
+ # satisfy this manual request but are NOT newly written snapshot rows.
1011
+ # Missing preservation counts retain legacy short-write behavior. The
999
1012
  # server itself now refuses to report success on a short write (see
1000
1013
  # backend `ingest_billing_snapshot_ctrl`), but this check stays as
1001
1014
  # defense in depth against an older/misbehaving server.
1002
1015
  logger.warning(
1003
- "billing_snapshot: server reported success but only stored %d of %d "
1004
- "rows for user=%s -- treating as a failed report",
1016
+ "billing_snapshot: invalid/incomplete receipt (%d written, %d preserved, %d sent) "
1017
+ "for user=%s -- treating as a failed report",
1005
1018
  stored,
1019
+ preserved,
1006
1020
  len(rows),
1007
1021
  user_uuid,
1008
1022
  )
@@ -1016,13 +1030,15 @@ def compute_and_report_billing_snapshot(
1016
1030
  server_gen=directive_generation,
1017
1031
  count=len(rows),
1018
1032
  stored_count=stored,
1019
- error_detail="incomplete rows_written",
1033
+ error_detail="invalid row counts" if not valid_counts else "incomplete row receipt",
1020
1034
  )
1021
1035
  return False
1022
1036
  logger.info(
1023
- "billing_snapshot: server accepted the report for user=%s (%d of %d rows stored)",
1037
+ "billing_snapshot: server accepted the report for user=%s "
1038
+ "(%d rows stored, %d authoritative rows preserved, %d sent)",
1024
1039
  user_uuid,
1025
1040
  stored,
1041
+ preserved,
1026
1042
  len(rows),
1027
1043
  )
1028
1044
  emit_diagnostic_event(