codex-usage-tracking 0.6.1__tar.gz → 0.8.0__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.
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/.codex-plugin/plugin.json +1 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/CHANGELOG.md +16 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/PKG-INFO +4 -4
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/README.md +3 -3
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/architecture.md +2 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/cli-json-schemas.md +56 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/cli-reference.md +14 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/dashboard-guide.md +15 -5
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/development.md +7 -7
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/one-dot-oh-readiness.md +8 -8
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/pricing-and-credits.md +5 -4
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/privacy.md +5 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/pyproject.toml +1 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/scripts/check_release.py +2 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/scripts/smoke_installed_package.py +2 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/skills/codex-usage-tracker/scripts/run_mcp.py +2 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/__init__.py +1 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/cli.py +79 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/cli_parser.py +88 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/context.py +78 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/dashboard.py +9 -0
- codex_usage_tracking-0.8.0/src/codex_usage_tracker/diagnostic_facts.py +636 -0
- codex_usage_tracking-0.8.0/src/codex_usage_tracker/diagnostic_reports.py +503 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/json_contracts.py +32 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/models.py +31 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/parser.py +136 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard.css +20 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard.js +88 -9
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_analysis.js +5 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_cells.js +5 -0
- codex_usage_tracking-0.8.0/src/codex_usage_tracker/plugin_data/dashboard/dashboard_diagnostics.js +568 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_events.js +6 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_format.js +1 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_i18n.js +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_insights.js +1 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_layout.css +6 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_live.js +91 -10
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_responsive.css +2 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_state.js +16 -4
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_status.js +105 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_tables.css +146 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_tables.js +5 -7
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_template.html +9 -6
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/ar.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/de.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/en.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/es.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/fr.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/it.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/ja.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/ko.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/pt.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/ru.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/vi.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/locales/zh-Hans.json +12 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/dashboard-guide.html +12 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/schema.py +23 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/server.py +147 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/store.py +711 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/store_schema.py +55 -1
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/store_sources.py +7 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/PKG-INFO +4 -4
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/SOURCES.txt +4 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/store_dashboard_helpers.py +30 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_cli_lifecycle.py +165 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_cli_release.py +1 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_context_evidence.py +67 -0
- codex_usage_tracking-0.8.0/tests/test_dashboard_live.py +245 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_dashboard_payload.py +93 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_dashboard_server.py +44 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_dashboard_state.py +24 -3
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_i18n.py +8 -3
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_json_contracts.py +1 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_parser.py +224 -2
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_privacy.py +4 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_store_dashboard_mcp.py +504 -7
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_store_migrations.py +14 -3
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/.mcp.json +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/AGENTS.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/CONTRIBUTING.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/LICENSE +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/MANIFEST.in +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/SECURITY.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/assets/icon.svg +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-call-investigator-evidence.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-call-investigator-preview.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-call-investigator.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-calls-preview.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-calls.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-details.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-insights.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/dashboard-threads.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/plugin-prompts.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/plugin-thread-leaderboard.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/ux/call-detail-panel.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/ux/insight-overview.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/assets/ux/thread-investigation.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/call-drilldown-performance-checklist.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/install.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/mcp.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/docs/ui-ux-improvement-plan.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/scripts/benchmark_synthetic_history.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/scripts/install_local_plugin.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/setup.cfg +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/skills/codex-usage-api/SKILL.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/skills/codex-usage-tracker/SKILL.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/__main__.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/allowance.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/api_payloads.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/call_origin.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/costing.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/diagnostics.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/formatting.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/i18n.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/mcp_server.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/paths.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/__init__.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/assets/icon.svg +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_actions.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_call.css +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_call_diagnostics.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_call_investigator.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_data.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_detail.css +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_details.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_filters.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_insights.css +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_payload_cache.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_tooltips.js +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-call-investigator-evidence.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-call-investigator-preview.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-call-investigator.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-calls-preview.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-calls.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-details.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-insights.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-threads.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/plugin-prompts.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/docs/assets/plugin-thread-leaderboard.png +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/rate_cards/codex-credit-rates.json +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/skills/codex-usage-api/SKILL.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_data/skills/codex-usage-tracker/SKILL.md +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/plugin_installer.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/pricing.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/pricing_config.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/pricing_estimates.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/pricing_openai.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/projects.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/recommendations.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/redaction.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/reports.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/server_utils.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/store_query_sql.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/store_thread_summaries.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/support.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracker/threads.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/dependency_links.txt +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/entry_points.txt +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/requires.txt +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/src/codex_usage_tracking.egg-info/top_level.txt +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_allowance.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_call_origin.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_dashboard_data.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_mcp_integration.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_mcp_launcher.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_plugin_installer.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_pricing.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_projects.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_recommendations.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_redaction.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_schema.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_support.py +0 -0
- {codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/tests/test_threads.py +0 -0
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.8.0 - 2026-06-20
|
|
6
|
+
|
|
7
|
+
- Add an aggregate Diagnostics dashboard for inspecting diagnostic facts, associated calls, token totals, and on-demand evidence without persisting raw transcript text.
|
|
8
|
+
- Add diagnostic fact extraction, reporting APIs, dashboard drilldowns, sortable associated-call tables, and load-more controls for larger diagnostic result sets.
|
|
9
|
+
- Add source byte offsets and context seek diagnostics so on-demand evidence loading can seek when offsets are valid and fall back safely when they are missing or stale.
|
|
10
|
+
- Harden dashboard startup so visiting Diagnostics before other views load no longer prevents Calls, Threads, or Insights from hydrating.
|
|
11
|
+
- Make Live refresh use the cached/indexed append path and fetch only newly visible leading rows instead of running the full manual refresh reset cycle.
|
|
12
|
+
|
|
13
|
+
## 0.7.0 - 2026-06-18
|
|
14
|
+
|
|
15
|
+
- Parse latest observed Codex usage snapshots from local rate-limit and token-count log events without persisting raw transcript text.
|
|
16
|
+
- Store observed 5h and weekly usage snapshot fields in aggregate rows and expose a latest-observed usage summary for dashboard and API consumers.
|
|
17
|
+
- Add a dashboard card for latest observed 5h and weekly usage with wording that distinguishes local observations from authoritative account limits.
|
|
18
|
+
- Default the dashboard table experience to time-sorted Calls, replace the visible Signals column with Reasoning Output, and keep the Signals field out of the table for now.
|
|
19
|
+
- Ignore known non-token parser events so refreshes stay focused on usage-bearing records.
|
|
20
|
+
|
|
5
21
|
## 0.6.1 - 2026-06-13
|
|
6
22
|
|
|
7
23
|
- Polish the README landing screenshots with matched dashboard/investigator previews and an additional lower investigator evidence view.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codex-usage-tracking
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Unofficial local Codex plugin and dashboard for investigating aggregate token usage, costs, caching, and thread patterns.
|
|
5
5
|
Author: Douglas Monsky
|
|
6
6
|
License-Expression: MIT
|
|
@@ -188,13 +188,13 @@ Optional allowance context:
|
|
|
188
188
|
codex-usage-tracker parse-allowance "5h 79% 6:50 PM Weekly 33% Jun 7"
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
The tracker cannot read your logged-in ChatGPT plan or live remaining usage automatically.
|
|
191
|
+
The tracker cannot read your logged-in ChatGPT plan or live remaining usage automatically. When local Codex logs include `token_count.rate_limits`, the dashboard can show the latest observed 5-hour and weekly remaining percentages from those logs. Otherwise, allowance values are only as accurate as the values you manually copy from Codex Settings, `/status`, or another trusted usage display. Details: [Pricing, Credits, And Allowance](docs/pricing-and-credits.md).
|
|
192
192
|
|
|
193
193
|
## What It Includes
|
|
194
194
|
|
|
195
195
|
- Local SQLite index at `~/.codex-usage-tracker/usage.sqlite3`.
|
|
196
196
|
- Static dashboard generation plus localhost live refresh.
|
|
197
|
-
- `Insights`, `Calls`, and `
|
|
197
|
+
- `Insights`, `Calls`, `Threads`, and `Diagnostics` dashboard views.
|
|
198
198
|
- Active-only dashboards by default, with an explicit `All history` toggle for archived sessions.
|
|
199
199
|
- CLI summaries, queries, CSV export, dashboard generation, doctor checks, and support bundles.
|
|
200
200
|
- MCP tools for Codex sessions that want to query local usage data.
|
|
@@ -296,7 +296,7 @@ This is optional. The normal shell install above is the fastest trusted path for
|
|
|
296
296
|
- Token counts come from Codex's logged counters; the tracker does not re-tokenize prompts.
|
|
297
297
|
- Pricing and rate-card sources can change outside this project.
|
|
298
298
|
- Pricing and Codex credit estimates depend on local rate data and confidence labels and are not guaranteed to match exact billing.
|
|
299
|
-
- Live account allowance cannot be read automatically by this local tracker; remaining 5-hour and weekly allowance is only
|
|
299
|
+
- Live account allowance cannot be read automatically by this local tracker; remaining 5-hour and weekly allowance is shown only from local Codex `token_count.rate_limits` snapshots when present, or from copied values you configure.
|
|
300
300
|
- Local Codex logs may not include usage from other ChatGPT agentic surfaces that share the same allowance.
|
|
301
301
|
- Plugin discovery limitations are separate from core Python CLI/dashboard support.
|
|
302
302
|
- Parent-child thread relationships are only as good as the metadata Codex logs; inferred auto-review attachments are labeled as inferred.
|
|
@@ -150,13 +150,13 @@ Optional allowance context:
|
|
|
150
150
|
codex-usage-tracker parse-allowance "5h 79% 6:50 PM Weekly 33% Jun 7"
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
The tracker cannot read your logged-in ChatGPT plan or live remaining usage automatically.
|
|
153
|
+
The tracker cannot read your logged-in ChatGPT plan or live remaining usage automatically. When local Codex logs include `token_count.rate_limits`, the dashboard can show the latest observed 5-hour and weekly remaining percentages from those logs. Otherwise, allowance values are only as accurate as the values you manually copy from Codex Settings, `/status`, or another trusted usage display. Details: [Pricing, Credits, And Allowance](docs/pricing-and-credits.md).
|
|
154
154
|
|
|
155
155
|
## What It Includes
|
|
156
156
|
|
|
157
157
|
- Local SQLite index at `~/.codex-usage-tracker/usage.sqlite3`.
|
|
158
158
|
- Static dashboard generation plus localhost live refresh.
|
|
159
|
-
- `Insights`, `Calls`, and `
|
|
159
|
+
- `Insights`, `Calls`, `Threads`, and `Diagnostics` dashboard views.
|
|
160
160
|
- Active-only dashboards by default, with an explicit `All history` toggle for archived sessions.
|
|
161
161
|
- CLI summaries, queries, CSV export, dashboard generation, doctor checks, and support bundles.
|
|
162
162
|
- MCP tools for Codex sessions that want to query local usage data.
|
|
@@ -258,7 +258,7 @@ This is optional. The normal shell install above is the fastest trusted path for
|
|
|
258
258
|
- Token counts come from Codex's logged counters; the tracker does not re-tokenize prompts.
|
|
259
259
|
- Pricing and rate-card sources can change outside this project.
|
|
260
260
|
- Pricing and Codex credit estimates depend on local rate data and confidence labels and are not guaranteed to match exact billing.
|
|
261
|
-
- Live account allowance cannot be read automatically by this local tracker; remaining 5-hour and weekly allowance is only
|
|
261
|
+
- Live account allowance cannot be read automatically by this local tracker; remaining 5-hour and weekly allowance is shown only from local Codex `token_count.rate_limits` snapshots when present, or from copied values you configure.
|
|
262
262
|
- Local Codex logs may not include usage from other ChatGPT agentic surfaces that share the same allowance.
|
|
263
263
|
- Plugin discovery limitations are separate from core Python CLI/dashboard support.
|
|
264
264
|
- Parent-child thread relationships are only as good as the metadata Codex logs; inferred auto-review attachments are labeled as inferred.
|
|
@@ -4,7 +4,7 @@ Codex Usage Tracker is a local sidecar app. It reads aggregate token counters fr
|
|
|
4
4
|
|
|
5
5
|
## Boundaries
|
|
6
6
|
|
|
7
|
-
- `parser.py` converts local JSONL events into aggregate `UsageEvent` records. It also attaches metadata-only call-origin categories, archived-session flags, and conservative thread keys. It must not persist prompts, assistant text, tool output, or transcript snippets.
|
|
7
|
+
- `parser.py` converts local JSONL events into aggregate `UsageEvent` records. It also attaches metadata-only call-origin categories, diagnostic facts from `diagnostic_facts.py`, archived-session flags, and conservative thread keys. It must not persist prompts, assistant text, tool output, command text, patch text, or transcript snippets.
|
|
8
8
|
- `call_origin.py` owns the pure call-origin classifier and migrated-row fallback. It must not open source JSONL files; source-log reads belong in parser refresh or explicit context loading only.
|
|
9
9
|
- `schema.py` owns persisted `usage_events` columns. Add columns there before changing SQLite migrations or export behavior.
|
|
10
10
|
- `store.py` owns SQLite setup, refresh, rebuild, query access, persisted per-thread previous/next call links, materialized thread summaries, source-file refresh cursors, and SQL-backed live dashboard API slices. Keep filesystem scanning, database writes, SQL prefilters, counts, limits, offsets, and incremental refresh decisions here.
|
|
@@ -13,7 +13,7 @@ Codex Usage Tracker is a local sidecar app. It reads aggregate token counters fr
|
|
|
13
13
|
- `costing.py`, `pricing_config.py`, `pricing_openai.py`, `pricing_estimates.py`, and `allowance.py` own cost, credit, rate-card, and allowance annotation. Keep estimate confidence and source metadata attached to rows.
|
|
14
14
|
- `projects.py`, `threads.py`, and `recommendations.py` annotate aggregate rows with project identity, thread relationships, and actionable signals. Project privacy redaction also belongs in `projects.py` so CLI, MCP, dashboard, CSV, and support-bundle surfaces share the same behavior.
|
|
15
15
|
- `dashboard.py` builds aggregate-only static dashboard payloads and writes HTML/assets. `server.py` adds localhost refresh, the compatibility `/api/usage` endpoint, SQL-backed live API slices, and explicit lazy context loading.
|
|
16
|
-
- `plugin_data/dashboard/dashboard_format.js` owns dashboard formatting primitives. `dashboard_data.js` owns row payload and thread relationship helpers. `dashboard_analysis.js` owns scoring, sorting, recommendation, and thread grouping logic. `dashboard_cells.js` owns reusable table/cell HTML helpers. `dashboard_details.js` owns sidebar detail and thread narrative rendering. `dashboard_insights.js` owns insight cards and investigation preset UI. `dashboard_tables.js` owns Calls, Threads, and expanded thread-call table rendering. `dashboard_filters.js` owns date range parsing and row date matching. `dashboard_state.js` owns URL, CSV, and download state utilities. `dashboard_i18n.js`, `dashboard_payload_cache.js`, and `dashboard_tooltips.js` own localization, session aggregate cache, and fast tooltip helpers. `dashboard_call_investigator.js` owns the dedicated call drilldown surface. `dashboard.js` owns top-level DOM rendering, event handling, and API refresh orchestration.
|
|
16
|
+
- `plugin_data/dashboard/dashboard_format.js` owns dashboard formatting primitives. `dashboard_data.js` owns row payload and thread relationship helpers. `dashboard_analysis.js` owns scoring, sorting, recommendation, and thread grouping logic. `dashboard_cells.js` owns reusable table/cell HTML helpers. `dashboard_details.js` owns sidebar detail and thread narrative rendering. `dashboard_insights.js` owns insight cards and investigation preset UI. `dashboard_tables.js` owns Calls, Threads, and expanded thread-call table rendering. `dashboard_diagnostics.js` owns the Diagnostics tab that consumes `/api/diagnostics/*` aggregate payloads. `dashboard_filters.js` owns date range parsing and row date matching. `dashboard_state.js` owns URL, CSV, and download state utilities. `dashboard_i18n.js`, `dashboard_payload_cache.js`, and `dashboard_tooltips.js` own localization, session aggregate cache, and fast tooltip helpers. `dashboard_call_investigator.js` owns the dedicated call drilldown surface. `dashboard.js` owns top-level DOM rendering, event handling, and API refresh orchestration.
|
|
17
17
|
- `context.py` is the only normal path that reads raw log context, and it does so only for one selected record on demand with redaction and size limits. Its default quick mode omits tool output and serialized groups; full serialized JSONL group analysis is explicit.
|
|
18
18
|
- `plugin_installer.py`, `.mcp.json`, `skills/`, and `scripts/check_release.py` own install and packaging behavior.
|
|
19
19
|
- `scripts/benchmark_synthetic_history.py` owns generated large-history query timing and threshold enforcement for 10k, 100k, and 500k aggregate-row fixtures. Its optional `--with-source-logs` mode writes synthetic JSONL source logs to time explicit context loading and to guard normal dashboard payload assembly against source-log reads. It must stay synthetic-only and must not read real Codex logs.
|
|
@@ -46,6 +46,7 @@ Tracked schema ids:
|
|
|
46
46
|
| `codex-usage-tracker-summary-v1` | CLI `summary --json`, CLI `expensive --json`, MCP summary/expensive JSON |
|
|
47
47
|
| `codex-usage-tracker-query-v1` | CLI `query`, MCP `usage_query(...)` |
|
|
48
48
|
| `codex-usage-tracker-recommendations-v1` | CLI `recommendations --json`, MCP `usage_recommendations(response_format="json")` |
|
|
49
|
+
| `codex-usage-tracker-diagnostics-v1` | CLI `diagnostics ... --json`, dashboard server `/api/diagnostics/*` |
|
|
49
50
|
| `codex-usage-tracker-session-v1` | CLI `session --json`, MCP `session_usage(response_format="json")` |
|
|
50
51
|
| `codex-usage-tracker-context-v1` | CLI `context`, MCP `usage_call_context` when raw context is explicitly enabled |
|
|
51
52
|
| `codex-usage-tracker-context-disabled-v1` | MCP `usage_call_context` when raw context is disabled |
|
|
@@ -225,6 +226,61 @@ Schema: `codex-usage-tracker-session-v1`
|
|
|
225
226
|
}
|
|
226
227
|
```
|
|
227
228
|
|
|
229
|
+
## Diagnostics
|
|
230
|
+
|
|
231
|
+
Commands:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
codex-usage-tracker diagnostics summary --json
|
|
235
|
+
codex-usage-tracker diagnostics facts --sort uncached --json
|
|
236
|
+
codex-usage-tracker diagnostics fact-calls --fact-type compaction --fact-name post_compaction --json
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Dashboard server API:
|
|
240
|
+
|
|
241
|
+
- `/api/diagnostics/summary`
|
|
242
|
+
- `/api/diagnostics/facts`
|
|
243
|
+
- `/api/diagnostics/fact-calls?fact_type=compaction&fact_name=post_compaction`
|
|
244
|
+
- `/api/diagnostics/compactions`
|
|
245
|
+
- `/api/diagnostics/tools`
|
|
246
|
+
|
|
247
|
+
Schema: `codex-usage-tracker-diagnostics-v1`
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"schema": "codex-usage-tracker-diagnostics-v1",
|
|
252
|
+
"view": "facts",
|
|
253
|
+
"filters": {
|
|
254
|
+
"since": null,
|
|
255
|
+
"until": null,
|
|
256
|
+
"model": null,
|
|
257
|
+
"effort": null,
|
|
258
|
+
"thread": null,
|
|
259
|
+
"min_tokens": null,
|
|
260
|
+
"fact_type": null,
|
|
261
|
+
"fact_name": null,
|
|
262
|
+
"fact_category": null,
|
|
263
|
+
"fact_group": null,
|
|
264
|
+
"include_archived": false,
|
|
265
|
+
"sort": "uncached",
|
|
266
|
+
"direction": "desc",
|
|
267
|
+
"limit": 50,
|
|
268
|
+
"offset": 0,
|
|
269
|
+
"privacy_mode": "normal"
|
|
270
|
+
},
|
|
271
|
+
"row_count": 1,
|
|
272
|
+
"total_matched_rows": 1,
|
|
273
|
+
"truncated": false,
|
|
274
|
+
"raw_context_included": false,
|
|
275
|
+
"rows": [],
|
|
276
|
+
"notes": [
|
|
277
|
+
"Associated token totals are not additive when one call has multiple diagnostic facts."
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Diagnostics payloads report aggregate structured facts such as compaction, tool/function/MCP activity, command families, structured skill labels, search/read loops, and outcome events. They do not include prompts, assistant messages, tool arguments, tool output, patch text, raw commands, command arguments, file contents, or JSONL fragments. Token totals are associated with facts observed before a token-count row; they are not causal allocations.
|
|
283
|
+
|
|
228
284
|
## Pricing Coverage
|
|
229
285
|
|
|
230
286
|
Command:
|
|
@@ -113,6 +113,20 @@ Useful investigations:
|
|
|
113
113
|
- Use `expensive --limit 10` for a quick list of the highest-cost calls.
|
|
114
114
|
- Use `recommendations --json` for ranked action rows and thread rollups with severity score, primary recommendation, and secondary signals.
|
|
115
115
|
|
|
116
|
+
## Diagnostics
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
codex-usage-tracker diagnostics summary
|
|
120
|
+
codex-usage-tracker diagnostics facts --sort uncached
|
|
121
|
+
codex-usage-tracker diagnostics compactions
|
|
122
|
+
codex-usage-tracker diagnostics tools
|
|
123
|
+
codex-usage-tracker diagnostics fact-calls --fact-type compaction --fact-name post_compaction
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Diagnostics expose structured event patterns and their associated token totals. They can show compactions, tool/function/MCP activity, safe command families, structured skill labels, patch outcomes, task completion, search/read loops, and aborted or rolled-back turns. Associated totals are not causal allocations and are not additive when one model call has multiple diagnostic facts.
|
|
127
|
+
|
|
128
|
+
Diagnostic payloads are aggregate-only. They do not include prompts, assistant text, tool arguments, tool output, patch text, raw commands, command arguments, file contents, or JSONL fragments.
|
|
129
|
+
|
|
116
130
|
## JSON Queries
|
|
117
131
|
|
|
118
132
|
```bash
|
|
@@ -65,7 +65,7 @@ The localhost server uses a random per-server token for refresh and context API
|
|
|
65
65
|
|
|
66
66
|

|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Open the `Insights` view when you want to answer "what needs attention?" before you start sorting tables.
|
|
69
69
|
|
|
70
70
|
- `Needs Attention` cards rank costly threads, Codex allowance usage, low cache reuse, context bloat, unpriced usage, estimated pricing, and reasoning-output spikes from aggregate fields only.
|
|
71
71
|
- `Investigation Presets` apply a view, derived filter, sort order, and explanatory caption together.
|
|
@@ -111,7 +111,7 @@ Useful interpretation notes:
|
|
|
111
111
|
- `Cached input` and `Uncached input` are split so cache behavior is visible without storing transcript text.
|
|
112
112
|
- A cost with `*` means the pricing row is marked as a best-guess estimate.
|
|
113
113
|
- Codex credits are estimated from aggregate input, cached-input, and output token counters. Direct model matches use the bundled OpenAI Codex rate-card snapshot; inferred labels are marked estimated, and local credit-rate overrides are marked user-provided.
|
|
114
|
-
- `Usage
|
|
114
|
+
- `Usage observed` is not a live account query. It uses the latest local Codex `token_count.rate_limits` snapshot when present; otherwise configure `~/.codex-usage-tracker/allowance.json` with values copied from Codex Settings > Usage, the Codex Usage dashboard, or `/status` when you want current remaining allowance context.
|
|
115
115
|
|
|
116
116
|
## Threads View
|
|
117
117
|
|
|
@@ -126,7 +126,17 @@ Use `Threads` view when you want to understand a work session as a group instead
|
|
|
126
126
|
- Expanded calls default to newest first. Click an expanded-call header such as `Time`, `Tokens`, `Cost`, or `Cache` to sort that thread's visible calls without changing the top-level Threads ranking.
|
|
127
127
|
- Subagents with logged parent session ids are shown under the parent thread. Auto-review sessions without explicit parent ids may be attached by cwd and nearby activity and are marked as attached or inferred in the details.
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
## Diagnostics View
|
|
130
|
+
|
|
131
|
+
Use `Diagnostics` view when you want to see what structured event patterns are happening and what token totals are associated with those patterns.
|
|
132
|
+
|
|
133
|
+
- The tab consumes the localhost `/api/diagnostics/*` endpoints; static file dashboards show a live-API unavailable state.
|
|
134
|
+
- The first table shows top diagnostic facts by associated uncached input tokens. Tool/function/MCP/command-family and compaction sections expose narrower slices of the same fact data.
|
|
135
|
+
- Command diagnostics store only a command family such as `pytest`, `git`, or `unknown_command`. Skill and MCP labels are detected only when they are present as structured event metadata.
|
|
136
|
+
- Click `Calls` on a fact row to load associated model calls. Call links and largest-call links open the Call Investigator, where raw context remains explicit and on demand.
|
|
137
|
+
- Associated token totals are not causal allocations and are not additive when one call has multiple diagnostic facts.
|
|
138
|
+
|
|
139
|
+
The same time range, model, reasoning, history scope, cards, and load controls apply in `Insights`, `Calls`, `Threads`, and `Diagnostics` views. Search, confidence, and sort controls currently scope the call/thread tables, not Diagnostics fact totals.
|
|
130
140
|
|
|
131
141
|
## Call Investigator
|
|
132
142
|
|
|
@@ -212,7 +222,7 @@ The dashboard is designed to be shareable as an aggregate report, but only after
|
|
|
212
222
|
|
|
213
223
|
It includes:
|
|
214
224
|
|
|
215
|
-
- session ids, thread names, cwd values, source file paths, timestamps, model labels, reasoning effort, token counts, cost estimates, Codex credit estimates, optional
|
|
225
|
+
- session ids, thread names, cwd values, source file paths, timestamps, model labels, reasoning effort, token counts, cost estimates, Codex credit estimates, optional observed/copied allowance windows, and derived ratios
|
|
216
226
|
|
|
217
227
|
It does not include:
|
|
218
228
|
|
|
@@ -222,7 +232,7 @@ The screenshots in this guide are produced from synthetic fixture data used by t
|
|
|
222
232
|
|
|
223
233
|
Use `--privacy-mode redacted` or `--privacy-mode strict` before sharing generated dashboards, CSV exports, query JSON, or support bundles. Redacted mode removes raw cwd/source paths and hides unnamed project names behind stable hashes. Strict mode also hides project-relative cwd, branch, and tags. Configured project aliases are treated as explicit display opt-ins in both modes.
|
|
224
234
|
|
|
225
|
-
Remaining 5-hour and weekly allowance is not
|
|
235
|
+
Remaining 5-hour and weekly allowance is not inferred from the logged-in account plan. When Codex writes local `token_count.rate_limits` snapshots, the dashboard can show the latest observed local-log percentages; otherwise add `~/.codex-usage-tracker/allowance.json` when you want copied allowance state. Local Codex logs may also omit usage from other ChatGPT agentic surfaces that share the same allowance.
|
|
226
236
|
|
|
227
237
|
Archived sessions are excluded from dashboard payloads by default. The `All history` mode is an explicit opt-in because archived logs can make refreshes slower and can make current dashboards look inflated by older work.
|
|
228
238
|
|
|
@@ -38,7 +38,7 @@ fix/<issue-number>-short-description
|
|
|
38
38
|
docs/<issue-number>-short-description
|
|
39
39
|
chore/<issue-number>-short-description
|
|
40
40
|
test/<issue-number>-short-description
|
|
41
|
-
release/0.
|
|
41
|
+
release/0.8.0
|
|
42
42
|
hotfix/0.3.3
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -91,7 +91,7 @@ blocked
|
|
|
91
91
|
Recommended milestones:
|
|
92
92
|
|
|
93
93
|
```text
|
|
94
|
-
0.
|
|
94
|
+
0.8.0
|
|
95
95
|
1.0-readiness
|
|
96
96
|
1.0.0
|
|
97
97
|
```
|
|
@@ -146,8 +146,8 @@ python scripts/smoke_installed_package.py --docker
|
|
|
146
146
|
To verify the public PyPI package instead of the local checkout:
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
|
-
python scripts/smoke_installed_package.py --from-pypi --version 0.
|
|
150
|
-
python scripts/smoke_installed_package.py --docker --from-pypi --version 0.
|
|
149
|
+
python scripts/smoke_installed_package.py --from-pypi --version 0.8.0
|
|
150
|
+
python scripts/smoke_installed_package.py --docker --from-pypi --version 0.8.0
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
`scripts/check_release.py` treats these public-package smoke commands as release-state claims. Keep their `--version` and `codex-usage-tracking==...` values aligned with `pyproject.toml`; the release gate fails when the docs claim a different public version. It also checks that install docs point at the real PyPI distribution, `codex-usage-tracking`, and keep the warning that `codex-usage-tracker` is a different PyPI package.
|
|
@@ -286,8 +286,8 @@ After the release branch merges, tag from updated `main`, not from an unreviewed
|
|
|
286
286
|
```bash
|
|
287
287
|
git switch main
|
|
288
288
|
git pull --ff-only
|
|
289
|
-
git tag -a v0.
|
|
290
|
-
git push origin v0.
|
|
289
|
+
git tag -a v0.8.0 -m "codex-usage-tracker 0.8.0"
|
|
290
|
+
git push origin v0.8.0
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
Do not create or push release tags without maintainer approval.
|
|
@@ -296,7 +296,7 @@ Do not create or push release tags without maintainer approval.
|
|
|
296
296
|
|
|
297
297
|
Publishing uses GitHub Actions Trusted Publishing through `.github/workflows/publish.yml`; do not upload from a local machine and do not add PyPI or TestPyPI API tokens.
|
|
298
298
|
|
|
299
|
-
The first public package release, `0.3.0`, was published on June 8, 2026. Patch release `0.3.1` followed the same day to ship the live-dashboard skill launch fix. Patch release `0.3.2` made dashboard launch refresh the default and added runtime enablement for context loading. Minor release `0.4.0` added Python 3.14 support, release recovery docs, stricter privacy/support-bundle regression coverage, and large-history benchmark thresholds. Patch release `0.4.1` was published by workflow dispatch from `main`; it hardened the PyPI publish workflow and checked off completed 1.0 readiness gates. Minor release `0.5.0` added dashboard localization support and initial language catalogs. Minor release `0.6.0` is the performance and call-drilldown release with SQL-backed live API slices, materialized thread summaries, faster evidence loading, and dashboard runtime module refactors. Patch release `0.6.1` aligns the final README/package screenshots and companion plugin assets.
|
|
299
|
+
The first public package release, `0.3.0`, was published on June 8, 2026. Patch release `0.3.1` followed the same day to ship the live-dashboard skill launch fix. Patch release `0.3.2` made dashboard launch refresh the default and added runtime enablement for context loading. Minor release `0.4.0` added Python 3.14 support, release recovery docs, stricter privacy/support-bundle regression coverage, and large-history benchmark thresholds. Patch release `0.4.1` was published by workflow dispatch from `main`; it hardened the PyPI publish workflow and checked off completed 1.0 readiness gates. Minor release `0.5.0` added dashboard localization support and initial language catalogs. Minor release `0.6.0` is the performance and call-drilldown release with SQL-backed live API slices, materialized thread summaries, faster evidence loading, and dashboard runtime module refactors. Patch release `0.6.1` aligns the final README/package screenshots and companion plugin assets. Minor release `0.7.0` adds observed usage snapshots and the latest-observed dashboard card while keeping raw evidence on demand only. Minor release `0.8.0` adds aggregate diagnostics, source-offset context seeking, and live dashboard loading hardening.
|
|
300
300
|
|
|
301
301
|
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.0`
|
|
302
302
|
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.1`
|
|
@@ -24,12 +24,12 @@ Not guaranteed:
|
|
|
24
24
|
|
|
25
25
|
## 1. Public Install And Package Metadata
|
|
26
26
|
|
|
27
|
-
- [x] Verify the current public PyPI version is visible as `0.
|
|
28
|
-
- [x] Verify public venv install for `0.
|
|
29
|
-
- [x] Verify public pipx install path for `0.
|
|
27
|
+
- [x] Verify the current public PyPI version is visible as `0.8.0`: `python -c "import json, urllib.request; print(json.load(urllib.request.urlopen('https://pypi.org/pypi/codex-usage-tracking/json'))['info']['version'])"`.
|
|
28
|
+
- [x] Verify public venv install for `0.8.0`: `python -m venv /tmp/codex-usage-pypi-smoke && . /tmp/codex-usage-pypi-smoke/bin/activate && python -m pip install codex-usage-tracking==0.8.0 && codex-usage-tracker --version`.
|
|
29
|
+
- [x] Verify public pipx install path for `0.8.0`: `PIPX_HOME=/tmp/codex-usage-pipx-home PIPX_BIN_DIR=/tmp/codex-usage-pipx-bin pipx install codex-usage-tracking==0.8.0 && /tmp/codex-usage-pipx-bin/codex-usage-tracker --version`.
|
|
30
30
|
- [x] Verify installed package resources from a built wheel: `python scripts/smoke_installed_package.py`.
|
|
31
31
|
- [x] Verify installed package resources in Linux Docker: `python scripts/smoke_installed_package.py --docker`.
|
|
32
|
-
- [x] Verify public PyPI package in Docker: `python scripts/smoke_installed_package.py --docker --from-pypi --version 0.
|
|
32
|
+
- [x] Verify public PyPI package in Docker: `python scripts/smoke_installed_package.py --docker --from-pypi --version 0.8.0`.
|
|
33
33
|
- [x] Verify PyPI metadata names remain unchanged: `python scripts/check_release.py`.
|
|
34
34
|
- [x] Add Python 3.14 as an official support target after CI, package classifiers, docs, and installed-package smoke coverage were added. Docker smoke coverage uses `python:3.14-slim` by default. Track this in issue #12.
|
|
35
35
|
|
|
@@ -134,14 +134,14 @@ Not guaranteed:
|
|
|
134
134
|
|
|
135
135
|
## Evidence References
|
|
136
136
|
|
|
137
|
-
These references are the concrete proof behind completed checklist items. Public package smoke commands are version-specific to `0.
|
|
137
|
+
These references are the concrete proof behind completed checklist items. Public package smoke commands are version-specific to `0.8.0`; all repo tests use synthetic or aggregate-only data.
|
|
138
138
|
|
|
139
139
|
### Public Install And Package Metadata
|
|
140
140
|
|
|
141
141
|
- Public PyPI version, public venv install, and public pipx install are proven by the exact public-install commands in section 1.
|
|
142
142
|
- Built-wheel and installed-resource coverage is proven by `scripts/smoke_installed_package.py` and `tests/test_cli_release.py::test_installed_package_smoke_checks_help_for_stable_commands`.
|
|
143
143
|
- Linux package-resource coverage is proven by `scripts/smoke_installed_package.py --docker`.
|
|
144
|
-
- Public PyPI Docker coverage is proven by `scripts/smoke_installed_package.py --docker --from-pypi --version 0.
|
|
144
|
+
- Public PyPI Docker coverage is proven by `scripts/smoke_installed_package.py --docker --from-pypi --version 0.8.0`.
|
|
145
145
|
- PyPI metadata, package/distribution names, package resources, source/wheel member names, Python 3.10-3.14 support metadata, CI workflow requirements, publish workflow safety text, and tracked secret patterns are proven by `scripts/check_release.py`, `scripts/check_release.py --dist`, and `tests/test_cli_release.py::test_release_check_script_passes`.
|
|
146
146
|
|
|
147
147
|
### Upgrade And Migration
|
|
@@ -219,8 +219,8 @@ These references are the concrete proof behind completed checklist items. Public
|
|
|
219
219
|
- Publish workflow package name, Trusted Publishing, TestPyPI/PyPI job presence, event guards, no push/PR publishing, no token/password publishing, and manual PyPI main/tag preflight are proven by `scripts/check_release.py::_check_publish_workflow`.
|
|
220
220
|
- The GitHub `pypi` environment gate is proven by `gh api repos/douglasmonsky/codex-usage-tracker/environments/pypi`, which reports a `required_reviewers` protection rule and `can_admins_bypass=false`.
|
|
221
221
|
- Dist filename and wheel/sdist member checks are proven by `python -m build`, `python -m twine check dist/*`, and `python scripts/check_release.py --dist`.
|
|
222
|
-
- TestPyPI publish process is proven by a workflow-dispatch run on `main`, followed by TestPyPI metadata and clean virtualenv install checks for `codex-usage-tracking==0.
|
|
223
|
-
- PyPI publish process is proven by a workflow-dispatch run on `main`, protected `pypi` environment approval, PyPI metadata visibility, clean virtualenv install, temporary pipx install, and Docker public-package smoke for `codex-usage-tracking==0.
|
|
222
|
+
- TestPyPI publish process is proven by a workflow-dispatch run on `main`, followed by TestPyPI metadata and clean virtualenv install checks for `codex-usage-tracking==0.8.0`.
|
|
223
|
+
- PyPI publish process is proven by a workflow-dispatch run on `main`, protected `pypi` environment approval, PyPI metadata visibility, clean virtualenv install, temporary pipx install, and Docker public-package smoke for `codex-usage-tracking==0.8.0`.
|
|
224
224
|
- Release recovery documentation is proven by `scripts/check_release.py` required-file and docs checks.
|
|
225
225
|
|
|
226
226
|
### Known Limitations
|
|
@@ -4,7 +4,7 @@ Codex Usage Tracker has three related but different concepts:
|
|
|
4
4
|
|
|
5
5
|
- `Estimated Cost`: optional USD estimates from a local pricing file.
|
|
6
6
|
- `Codex Credits`: calculated usage credits from aggregate token counters and Codex credit rates.
|
|
7
|
-
- `Usage
|
|
7
|
+
- `Usage observed`: optional latest local-log 5-hour and weekly allowance snapshots, falling back to copied allowance config when logs do not include rate-limit snapshots.
|
|
8
8
|
|
|
9
9
|
## Cost Estimates
|
|
10
10
|
|
|
@@ -58,11 +58,11 @@ codex-usage-tracker update-rate-card
|
|
|
58
58
|
|
|
59
59
|
The local snapshot is written to `~/.codex-usage-tracker/rate-card.json`. Each bundled rate and alias includes source URL, fetched date, tier, confidence, and alias rationale where applicable. Use `--source-file` only when you have a reviewed replacement JSON snapshot you want the tracker to validate and use.
|
|
60
60
|
|
|
61
|
-
## Usage
|
|
61
|
+
## Usage Observed
|
|
62
62
|
|
|
63
|
-
`Usage
|
|
63
|
+
`Usage observed` is different from `Codex Credits`. The tracker cannot currently read your logged-in ChatGPT plan, live remaining credits, reset windows, or usage from other agentic surfaces automatically.
|
|
64
64
|
|
|
65
|
-
A plan name such as Free, Plus, Pro, Business, or Enterprise can provide context, but it is not enough to know the current remaining allowance.
|
|
65
|
+
A plan name such as Free, Plus, Pro, Business, or Enterprise can provide context, but it is not enough to know the current remaining allowance. When local Codex logs include `token_count.rate_limits`, the dashboard shows the latest observed 5-hour and weekly percentages from those logs. Otherwise, the dashboard shows remaining values only when you copy them into `~/.codex-usage-tracker/allowance.json`.
|
|
66
66
|
|
|
67
67
|
Enable optional allowance context:
|
|
68
68
|
|
|
@@ -87,6 +87,7 @@ Configure the usage component:
|
|
|
87
87
|
- Pricing and rate-card sources can change outside this project. Refresh or pin local files when reports need a known source snapshot.
|
|
88
88
|
- Local Codex logs may not include usage from other ChatGPT agentic surfaces that share the same allowance.
|
|
89
89
|
- Live account allowance cannot be read automatically by this local tracker, and the dashboard does not infer live remaining allowance from the logged-in account plan.
|
|
90
|
+
- Observed local-log snapshots may be stale until Codex records another model call, and may omit other agentic surfaces that share the same allowance.
|
|
90
91
|
- Pricing can change after a report is generated. Use `pin-pricing` when you need reproducible historical cost estimates.
|
|
91
92
|
- Rows with direct model/rate-card matches are more trustworthy than inferred aliases or local overrides.
|
|
92
93
|
- Cost and credit calculations use aggregate counters; the tracker does not re-tokenize prompts or reconstruct usage from raw text.
|
|
@@ -14,6 +14,8 @@ The local SQLite database is stored at `~/.codex-usage-tracker/usage.sqlite3` by
|
|
|
14
14
|
- archived-session flag, conservative thread key, and adjacent aggregate record ids for dashboard navigation
|
|
15
15
|
- materialized thread-level aggregate summaries for active and all-history scopes
|
|
16
16
|
- source-file refresh metadata such as path, path hash, size, mtime, indexed line/byte offsets, latest aggregate record id, parser diagnostics, and last indexed time
|
|
17
|
+
- observed Codex rate-limit snapshot metadata from local token-count logs, such as plan type, limit id, 5-hour/weekly used percentages, window lengths, and reset times
|
|
18
|
+
- diagnostic fact labels tied to aggregate call records, such as safe event categories, payload type labels, counts, timestamps, and line ranges
|
|
17
19
|
- pricing, credit, allowance, recommendation, and project metadata derived from aggregate fields
|
|
18
20
|
|
|
19
21
|
## Not Stored
|
|
@@ -31,6 +33,8 @@ Those fields are not written to SQLite, CSV exports, generated dashboard HTML, o
|
|
|
31
33
|
|
|
32
34
|
Call-origin metadata is heuristic and confidence-labeled. It stores categories such as `user`, `codex`, or `unknown` plus a reason such as `user_message`, `tool_result`, `post_compaction`, or `agent_continuation`. It does not store the message text, tool output, compaction replacement text, or raw JSONL fragment that produced the category.
|
|
33
35
|
|
|
36
|
+
Diagnostic facts follow the same aggregate-only rule. They can store safe structured labels such as `patch_applied`, `function_call_output`, `post_compaction`, MCP tool/server labels, structured skill labels, and command families such as `pytest`, `git`, or `unknown_command`, along with event counts and source line ranges. Command text may be classified in memory during parsing, but it is not persisted. Diagnostic facts do not store tool arguments, command text, command output, patch text, prompt or assistant text, file contents, raw JSONL fragments, or raw context evidence.
|
|
37
|
+
|
|
34
38
|
## On-Demand Context
|
|
35
39
|
|
|
36
40
|
`usage_call_context`, `codex-usage-tracker context`, and the `serve-dashboard` context endpoint read a single source JSONL file only when explicitly requested. Returned context is redacted for common secret patterns and capped in size by default for CLI/MCP requests. The call investigator uses the same endpoint at runtime and requests quick redacted evidence for the selected call when the local context API is enabled; that still does not persist raw context into SQLite, CSV, support bundles, or generated dashboard HTML.
|
|
@@ -104,7 +108,7 @@ Cost estimates are calculated only from aggregate token fields and your local pr
|
|
|
104
108
|
|
|
105
109
|
Codex credit estimates are calculated only from aggregate token fields and bundled or locally configured rate-card values.
|
|
106
110
|
|
|
107
|
-
The optional allowance config is local and stores only the remaining percentages, reset times, or credit totals you manually enter.
|
|
111
|
+
The optional allowance config is local and stores only the remaining percentages, reset times, or credit totals you manually enter. Observed rate-limit snapshots, when present in Codex token-count logs, store only structured percentages, window lengths, reset times, plan type, and limit id.
|
|
108
112
|
|
|
109
113
|
## Sharing Checklist
|
|
110
114
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codex-usage-tracking"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.8.0"
|
|
8
8
|
description = "Unofficial local Codex plugin and dashboard for investigating aggregate token usage, costs, caching, and thread patterns."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -120,6 +120,7 @@ REQUIRED_FILES = [
|
|
|
120
120
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_tooltips.js",
|
|
121
121
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_status.js",
|
|
122
122
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_events.js",
|
|
123
|
+
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_diagnostics.js",
|
|
123
124
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_call_diagnostics.js",
|
|
124
125
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard.js",
|
|
125
126
|
"src/codex_usage_tracker/plugin_data/dashboard/dashboard_state.js",
|
|
@@ -163,6 +164,7 @@ WHEEL_REQUIRED_MEMBERS = {
|
|
|
163
164
|
"codex_usage_tracker/plugin_data/dashboard/dashboard_tooltips.js",
|
|
164
165
|
"codex_usage_tracker/plugin_data/dashboard/dashboard_status.js",
|
|
165
166
|
"codex_usage_tracker/plugin_data/dashboard/dashboard_events.js",
|
|
167
|
+
"codex_usage_tracker/plugin_data/dashboard/dashboard_diagnostics.js",
|
|
166
168
|
"codex_usage_tracker/plugin_data/dashboard/dashboard_call_diagnostics.js",
|
|
167
169
|
"codex_usage_tracker/plugin_data/dashboard/dashboard.js",
|
|
168
170
|
"codex_usage_tracker/plugin_data/dashboard/dashboard_state.js",
|
{codex_usage_tracking-0.6.1 → codex_usage_tracking-0.8.0}/scripts/smoke_installed_package.py
RENAMED
|
@@ -46,6 +46,7 @@ CLI_HELP_SUBCOMMANDS = [
|
|
|
46
46
|
"summary",
|
|
47
47
|
"query",
|
|
48
48
|
"recommendations",
|
|
49
|
+
"diagnostics",
|
|
49
50
|
"session",
|
|
50
51
|
"context",
|
|
51
52
|
"dashboard",
|
|
@@ -86,6 +87,7 @@ RESOURCE_PATHS = [
|
|
|
86
87
|
"dashboard/dashboard_events.js",
|
|
87
88
|
"dashboard/dashboard_actions.js",
|
|
88
89
|
"dashboard/dashboard_live.js",
|
|
90
|
+
"dashboard/dashboard_diagnostics.js",
|
|
89
91
|
"dashboard/dashboard_call_diagnostics.js",
|
|
90
92
|
"dashboard/dashboard.js",
|
|
91
93
|
"dashboard/dashboard_state.js",
|
|
@@ -15,9 +15,9 @@ from pathlib import Path
|
|
|
15
15
|
|
|
16
16
|
PACKAGE_SPEC = os.environ.get(
|
|
17
17
|
"CODEX_USAGE_TRACKER_PACKAGE_SPEC",
|
|
18
|
-
"codex-usage-tracking==0.
|
|
18
|
+
"codex-usage-tracking==0.8.0",
|
|
19
19
|
)
|
|
20
|
-
RUNTIME_VERSION = "0.
|
|
20
|
+
RUNTIME_VERSION = "0.8.0"
|
|
21
21
|
PACKAGE_SPEC_MARKER = ".codex-usage-tracker-package-spec"
|
|
22
22
|
MODULE_CHECK = (
|
|
23
23
|
"import importlib.metadata; "
|
|
@@ -24,6 +24,11 @@ from codex_usage_tracker.api_payloads import (
|
|
|
24
24
|
from codex_usage_tracker.cli_parser import build_parser
|
|
25
25
|
from codex_usage_tracker.context import load_call_context
|
|
26
26
|
from codex_usage_tracker.dashboard import generate_dashboard
|
|
27
|
+
from codex_usage_tracker.diagnostic_reports import (
|
|
28
|
+
build_diagnostics_fact_calls_report,
|
|
29
|
+
build_diagnostics_facts_report,
|
|
30
|
+
build_diagnostics_summary_report,
|
|
31
|
+
)
|
|
27
32
|
from codex_usage_tracker.diagnostics import run_doctor
|
|
28
33
|
from codex_usage_tracker.formatting import (
|
|
29
34
|
format_doctor,
|
|
@@ -387,6 +392,79 @@ def _run_recommendations(args: argparse.Namespace) -> int:
|
|
|
387
392
|
return 0
|
|
388
393
|
|
|
389
394
|
|
|
395
|
+
def _run_diagnostics(args: argparse.Namespace) -> int:
|
|
396
|
+
command = args.diagnostics_command
|
|
397
|
+
if command == "summary":
|
|
398
|
+
report = build_diagnostics_summary_report(
|
|
399
|
+
db_path=args.db,
|
|
400
|
+
limit=args.limit,
|
|
401
|
+
since=args.since,
|
|
402
|
+
until=args.until,
|
|
403
|
+
model=args.model,
|
|
404
|
+
effort=args.effort,
|
|
405
|
+
thread=args.thread,
|
|
406
|
+
min_tokens=args.min_tokens,
|
|
407
|
+
fact_type=args.fact_type,
|
|
408
|
+
fact_name=args.fact_name,
|
|
409
|
+
fact_category=args.fact_category,
|
|
410
|
+
include_archived=args.include_archived,
|
|
411
|
+
sort=args.sort,
|
|
412
|
+
direction=args.direction,
|
|
413
|
+
)
|
|
414
|
+
elif command in {"facts", "compactions", "tools"}:
|
|
415
|
+
report = build_diagnostics_facts_report(
|
|
416
|
+
db_path=args.db,
|
|
417
|
+
limit=args.limit,
|
|
418
|
+
since=args.since,
|
|
419
|
+
until=args.until,
|
|
420
|
+
model=args.model,
|
|
421
|
+
effort=args.effort,
|
|
422
|
+
thread=args.thread,
|
|
423
|
+
min_tokens=args.min_tokens,
|
|
424
|
+
fact_type=_diagnostic_fact_type_filter(args),
|
|
425
|
+
fact_name=getattr(args, "fact_name", None),
|
|
426
|
+
fact_category=getattr(args, "fact_category", None),
|
|
427
|
+
include_archived=args.include_archived,
|
|
428
|
+
sort=args.sort,
|
|
429
|
+
direction=args.direction,
|
|
430
|
+
fact_group="tools" if command == "tools" else None,
|
|
431
|
+
view=command,
|
|
432
|
+
)
|
|
433
|
+
elif command == "fact-calls":
|
|
434
|
+
report = build_diagnostics_fact_calls_report(
|
|
435
|
+
db_path=args.db,
|
|
436
|
+
fact_type=args.fact_type,
|
|
437
|
+
fact_name=args.fact_name,
|
|
438
|
+
limit=args.limit,
|
|
439
|
+
offset=args.offset,
|
|
440
|
+
since=args.since,
|
|
441
|
+
until=args.until,
|
|
442
|
+
model=args.model,
|
|
443
|
+
effort=args.effort,
|
|
444
|
+
thread=args.thread,
|
|
445
|
+
min_tokens=args.min_tokens,
|
|
446
|
+
include_archived=args.include_archived,
|
|
447
|
+
sort=args.sort,
|
|
448
|
+
direction=args.direction,
|
|
449
|
+
privacy_mode=args.privacy_mode,
|
|
450
|
+
)
|
|
451
|
+
else:
|
|
452
|
+
raise ValueError(f"unknown diagnostics command: {command}")
|
|
453
|
+
|
|
454
|
+
if args.as_json:
|
|
455
|
+
_print_json(report.payload)
|
|
456
|
+
return 0
|
|
457
|
+
print(report.render())
|
|
458
|
+
return 0
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def _diagnostic_fact_type_filter(args: argparse.Namespace) -> str | None:
|
|
462
|
+
command = args.diagnostics_command
|
|
463
|
+
if command == "compactions":
|
|
464
|
+
return "compaction"
|
|
465
|
+
return getattr(args, "fact_type", None)
|
|
466
|
+
|
|
467
|
+
|
|
390
468
|
def _run_session(args: argparse.Namespace) -> int:
|
|
391
469
|
rows = query_session_usage(args.db, args.session_id, args.limit)
|
|
392
470
|
rows = apply_project_privacy_to_rows(rows, privacy_mode=args.privacy_mode)
|
|
@@ -805,6 +883,7 @@ _COMMAND_HANDLERS = {
|
|
|
805
883
|
"summary": _run_summary,
|
|
806
884
|
"query": _run_query,
|
|
807
885
|
"recommendations": _run_recommendations,
|
|
886
|
+
"diagnostics": _run_diagnostics,
|
|
808
887
|
"session": _run_session,
|
|
809
888
|
"context": _run_context,
|
|
810
889
|
"dashboard": _run_dashboard,
|