entelligence-cli 0.1.321__tar.gz → 0.1.322__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.
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/PKG-INFO +1 -1
- entelligence_cli-0.1.322/entelligence_cli/_vendor/MEMORY_CORE_SOURCE_REVISION +1 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/claude_code.py +12 -7
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/source.py +28 -2
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/vocabulary/edges.py +5 -2
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/vocabulary/nodes.py +53 -4
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/insights.py +122 -22
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/PKG-INFO +1 -1
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/SOURCES.txt +1 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/pyproject.toml +1 -1
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_billing_snapshot.py +4 -1
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_capture_boundary.py +7 -2
- entelligence_cli-0.1.322/tests/test_sync_parse_failure_checkpoint.py +121 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sync_pushes_built_sessions.py +4 -2
- entelligence_cli-0.1.321/entelligence_cli/_vendor/MEMORY_CORE_SOURCE_REVISION +0 -1
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/README.md +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/MEMORY_CORE_VERSION +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/code_authorship.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_paths.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_segmentation_prompts/system.j2 +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_segmentation_prompts/user.j2 +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/_base.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/_jsonl_utils.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/git_reader.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/models.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/parser.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/entireio/source.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/factory.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/base.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/claude_cost_summary.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/codex.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/copilot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/cursor_agent_transcript.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/cursor_store.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/kiro.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/_sources/local/parsers/opencode.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/behavior_signals.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/edit_lines.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/file_paths.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/metrics.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/produced.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/segment_orchestrator.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/segment_pure.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/session_pure.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/skill_names.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/ingestion/coding_agent/spans.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/pricing.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/vocabulary/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/_vendor/memory_core/vocabulary/categories.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/agent_insights_proxy.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/agent_insights_segment.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/api_client.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ascii-art.txt +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/billing_snapshot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/browser_login.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/claude_cloud.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/cli.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/code_authorship.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/auth.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/budget.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/config.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/cursor_doctor.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/incident.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/mcp.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/reset.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/review.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/router.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/security.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/skills.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/trim.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/commands/update.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/config.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/cursor_cloud.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/cursor_path_a_usage.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/diagnostics.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/exceptions.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/facts_envelope.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/git_operations.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/hooks/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/hooks/capacity_emit.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/hooks/context_guard.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/hooks/session_brief.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/hooks/standup_emit.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/insights_log.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/insights_watch.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/mcp_inventory.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/platform_env.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/claude_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/codex_auth.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/codex_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/compress.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/copilot_launcher.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/copilot_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/cursor_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/router/state.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/scheduling.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/session_deferrals.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/session_inventory.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/session_revisions.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/textual_ui.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/token_savings_snapshot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/interactive.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/keys.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/loaders.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/output.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/ui/styles.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/update_checker.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/__init__.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/conductor.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/config.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/cursor_usage.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/discovery.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/manifest.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/models.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/pii.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/runner.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/secrets.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/upload/stores.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli/wrapped_game.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/dependency_links.txt +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/entry_points.txt +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/requires.txt +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/entelligence_cli.egg-info/top_level.txt +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/setup.cfg +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_agent_insights_proxy.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_agent_insights_proxy_api_client.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_agent_insights_segment.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_attach_fix_smoke.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_attach_ticket_smoke.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_billing_snapshot_cloud.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_budget_smoke.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_capacity_emit.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_cloud.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_cloud_cadence.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_code_cost_events.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_code_subagent_usage.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_claude_hook_helper_classification.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_code_authorship.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_code_authorship_parser_regressions.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_code_authorship_parsers.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_codex_auth.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_codex_native_ledger.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_codex_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_codex_total_only_sync.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_conductor.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_context_guard.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_copilot_launcher.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_copilot_parser_tokens.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_creation_provenance_contract.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_cloud.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_composer_mtime_stamp.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_doctor.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_path_a_usage.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_path_regex_and_heartbeat.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_self_heal_loop.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_settings.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_unknown_timestamps.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage_archive.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage_completeness.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage_heal.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage_recapture.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_cursor_usage_state.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_detached_background_work.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_diagnostics.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_discovery_head_unicode.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_discovery_opencode.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_eligibility_state.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_endpoint_scheme_enforcement.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_entropy_secret_detection.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_error_body_decode.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_facts_envelope.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_git_operations_copilot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_heartbeat_api_client.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_identity_cache_refresh.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_incident_refs.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_incident_smoke.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_cadence_heartbeat.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_checkpoint_resume.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_copilot_prompts.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_cursor_composer_home.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_index_failure.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_kiro_prompts.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_log.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_me_smoke.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_path_a_default.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_produced_prs.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_redrain.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_repo_attribution.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_schedule.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_schedule_arm.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_structured_payload.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_watch.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_insights_watch_transport.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_legacy_encoding_recovery.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_local_source_discovery_stats.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_login_token_stdin.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_machine_fingerprint.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_mcp_install.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_mcp_inventory.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_multipart_backoff.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_pii.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_presigned_skip_index.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_processing_checkpoint_api_client.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_release_directive.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_reset_command.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_review_redaction.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_rosetta_self_heal.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_router_commands.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_router_dead_proxy_guard.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_router_stats.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_scheduling_cron_env.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_schtasks_integration.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_secrets_redaction_boundary.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_security_commands.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_segment_chunking.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_segment_session_timeout.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_segmentation_role_gate.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_segmentation_window_scope.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_segmentation_worker_failure_visibility.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_session_accuracy_regressions.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_session_brief.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_session_deferrals.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_session_inventory.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_session_revisions.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sessions_status_chunking.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sessions_status_safe_default.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_skills_command.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sync_backgrounding.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sync_dry_run_checkpoint.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sync_partial_schema.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_sync_runs_full_pipeline.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_token_savings_snapshot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_trim_command.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_trim_hook_opt_in_only_guard.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_update_command.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_copilot.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_cursor_store.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_home_backfill.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_kiro.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_repo_filter.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_upload_repo_roots.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_windows_compat.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_world_model_provenance.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/tests/test_wrap_retry.py +0 -0
- {entelligence_cli-0.1.321 → entelligence_cli-0.1.322}/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.
|
|
3
|
+
Version: 0.1.322
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9ac7865b1402c01f13f3503cd4e0c8c871ed609e
|
|
@@ -118,7 +118,7 @@ def _fallback_iterations(line: dict) -> list | None:
|
|
|
118
118
|
if iterations is None or iterations == []:
|
|
119
119
|
return None
|
|
120
120
|
if not isinstance(iterations, list) or not all(
|
|
121
|
-
isinstance(item, dict) and item.get("type")
|
|
121
|
+
isinstance(item, dict) and isinstance(item.get("type"), str) and item["type"]
|
|
122
122
|
for item in iterations
|
|
123
123
|
):
|
|
124
124
|
raise ValueError("Invalid Claude usage iterations")
|
|
@@ -136,13 +136,18 @@ def _fallback_iterations(line: dict) -> list | None:
|
|
|
136
136
|
)
|
|
137
137
|
if type(value) is not int or value < 0:
|
|
138
138
|
raise ValueError("Invalid Claude fallback token component")
|
|
139
|
-
if
|
|
139
|
+
if len(iterations) == 1 and iterations[0].get("model") in (None, message.get("model")):
|
|
140
140
|
# Native ordinary responses carry one message iteration with model=null.
|
|
141
141
|
# They retain the top-level streaming usage contract.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
return None
|
|
143
|
+
# Any other shape means the response served more than one billed attempt —
|
|
144
|
+
# a fallback after a refusal, or a side call such as an advisor iteration
|
|
145
|
+
# whose tokens the top-level usage does not include. Per-attempt accounting
|
|
146
|
+
# is the only contract that bills all of them. An iteration without a model
|
|
147
|
+
# was served by the response's own model, so only a present one is checked.
|
|
148
|
+
if not all(
|
|
149
|
+
model_id_or_none(item["model"]) for item in iterations if item.get("model") is not None
|
|
150
|
+
):
|
|
146
151
|
raise ValueError("Invalid Claude fallback usage iterations")
|
|
147
152
|
return iterations
|
|
148
153
|
|
|
@@ -190,7 +195,7 @@ def _expand_fallback_requests(requests: dict) -> dict:
|
|
|
190
195
|
"message": {
|
|
191
196
|
**message,
|
|
192
197
|
"id": attempt_key,
|
|
193
|
-
"model": item
|
|
198
|
+
"model": item.get("model") or message.get("model"),
|
|
194
199
|
"usage": attempt_usage,
|
|
195
200
|
},
|
|
196
201
|
}
|
|
@@ -1376,8 +1376,34 @@ class LocalSource:
|
|
|
1376
1376
|
self._record_discovery("claude-code", "different_agent")
|
|
1377
1377
|
return None
|
|
1378
1378
|
|
|
1379
|
-
#
|
|
1380
|
-
# not
|
|
1379
|
+
# `<slug>/<session>/subagents/agent-*.jsonl` are component pieces of
|
|
1380
|
+
# the parent session, not sessions of their own — `get_spans_by_session`
|
|
1381
|
+
# folds them into the parent (`_with_claude_code_subagents`), so
|
|
1382
|
+
# indexing one here would also stand it up as a standalone session and
|
|
1383
|
+
# count its turns, tools and spend twice.
|
|
1384
|
+
#
|
|
1385
|
+
# This is a PATH check because the content check below is not
|
|
1386
|
+
# sufficient on its own: it reads the first parseable line, and newer
|
|
1387
|
+
# Claude Code builds front-load `queue-operation` / `last-prompt` /
|
|
1388
|
+
# `ai-title` records that carry no `isSidechain` flag at all, so the
|
|
1389
|
+
# loop breaks on one of those and admits the file. Measured 2026-09-17:
|
|
1390
|
+
# 461 production sessions have ids shaped `local:claude-code:agent-<hex>`,
|
|
1391
|
+
# every one of them a subagent transcript admitted this way. The Cursor
|
|
1392
|
+
# indexer and `memory/scripts/upload_transcripts.py` both already make
|
|
1393
|
+
# exactly this exclusion. Check the parts BELOW `projects_dir` only: a
|
|
1394
|
+
# configured home (or any ancestor of it) could itself be named
|
|
1395
|
+
# `subagents`, which must not drop real sessions.
|
|
1396
|
+
try:
|
|
1397
|
+
relative_parts = jsonl_file.relative_to(projects_dir).parts
|
|
1398
|
+
except ValueError:
|
|
1399
|
+
relative_parts = ()
|
|
1400
|
+
if "subagents" in relative_parts:
|
|
1401
|
+
self._record_discovery("claude-code", "subagent_component")
|
|
1402
|
+
return None
|
|
1403
|
+
|
|
1404
|
+
# Sub-agent sessions also carry isSidechain=true; skip them — they're
|
|
1405
|
+
# not developer-initiated work. Retained for the older layout, which
|
|
1406
|
+
# wrote a sidechain as a sibling transcript with no `subagents/` parent.
|
|
1381
1407
|
for line in head.split(b"\n"):
|
|
1382
1408
|
line = line.strip()
|
|
1383
1409
|
if not line:
|
|
@@ -117,7 +117,7 @@ class EdgeType(StrEnum):
|
|
|
117
117
|
REFERENCES_TICKET = "references_ticket" # CodingAgentTask / PullRequest → Ticket
|
|
118
118
|
PRODUCED = "produced" # CodingAgentSession → PullRequest
|
|
119
119
|
CONTRIBUTED_CODE_TO = "contributed_code_to" # Observed surviving edits, versioned by PR head
|
|
120
|
-
BILLED_ON = "billed_on" #
|
|
120
|
+
BILLED_ON = "billed_on" # Session/task → their UTC billed-day projection
|
|
121
121
|
SPANS = "spans" # CodingAgentTheme → Repo
|
|
122
122
|
INTRODUCED = "introduced" # CodingAgentTask / PullRequest → Issue
|
|
123
123
|
PRODUCED_FIX = "produced_fix" # CodingAgentTask → Fix (deferred writer)
|
|
@@ -288,7 +288,10 @@ ALLOWED_CONNECTIONS: dict[EdgeType, frozenset[tuple[NodeType, NodeType]]] = {
|
|
|
288
288
|
{(NodeType.CODING_AGENT_SESSION, NodeType.PULL_REQUEST)}
|
|
289
289
|
),
|
|
290
290
|
EdgeType.BILLED_ON: frozenset(
|
|
291
|
-
{
|
|
291
|
+
{
|
|
292
|
+
(NodeType.CODING_AGENT_SESSION, NodeType.CODING_AGENT_BILLED_DAY),
|
|
293
|
+
(NodeType.CODING_AGENT_TASK, NodeType.CODING_AGENT_TASK_BILLED_DAY),
|
|
294
|
+
}
|
|
292
295
|
),
|
|
293
296
|
EdgeType.SPANS: frozenset({(NodeType.CODING_AGENT_THEME, NodeType.REPO)}),
|
|
294
297
|
EdgeType.INTRODUCED: frozenset(
|
|
@@ -90,6 +90,7 @@ class NodeType(StrEnum):
|
|
|
90
90
|
CODING_AGENT_TASK = "CodingAgentTask"
|
|
91
91
|
CODING_AGENT_THEME = "CodingAgentTheme"
|
|
92
92
|
CODING_AGENT_BILLED_DAY = "CodingAgentBilledDay"
|
|
93
|
+
CODING_AGENT_TASK_BILLED_DAY = "CodingAgentTaskBilledDay"
|
|
93
94
|
|
|
94
95
|
# Decisions — architectural / strategic choices extracted from
|
|
95
96
|
# agent sessions (later: meetings, Slack, docs). Carries lifecycle
|
|
@@ -751,7 +752,9 @@ class Person(TenantedNode):
|
|
|
751
752
|
),
|
|
752
753
|
)
|
|
753
754
|
gitlab_login: str | None = Field(default=None, description="GitLab handle.")
|
|
754
|
-
github_user_id: str | None = Field(
|
|
755
|
+
github_user_id: str | None = Field(
|
|
756
|
+
default=None, description="Stable numeric GitHub account ID."
|
|
757
|
+
)
|
|
755
758
|
bitbucket_login: str | None = Field(default=None, description="Bitbucket handle.")
|
|
756
759
|
display_name: str | None = Field(default=None, description="Human name if known.")
|
|
757
760
|
email: str | None = Field(default=None)
|
|
@@ -1018,7 +1021,9 @@ class CodingAgentSession(TenantedNode):
|
|
|
1018
1021
|
default=None,
|
|
1019
1022
|
description="Latest branch observed in the transcript; HEAD means detached checkout.",
|
|
1020
1023
|
)
|
|
1021
|
-
branches: list[str] = Field(
|
|
1024
|
+
branches: list[str] = Field(
|
|
1025
|
+
default_factory=list, description="Distinct observed named branches in transcript order."
|
|
1026
|
+
)
|
|
1022
1027
|
conductor_workspace: str | None = Field(
|
|
1023
1028
|
default=None,
|
|
1024
1029
|
description="When the session ran inside a Conductor (conductor.build) workspace, the "
|
|
@@ -1035,7 +1040,8 @@ class CodingAgentSession(TenantedNode):
|
|
|
1035
1040
|
default=None, description="Active task-set write stamp; matches each task's ingested_at."
|
|
1036
1041
|
)
|
|
1037
1042
|
tasks_projection_complete: bool | None = Field(
|
|
1038
|
-
default=None,
|
|
1043
|
+
default=None,
|
|
1044
|
+
description="Whether the active write certified its exact task set and Session links.",
|
|
1039
1045
|
)
|
|
1040
1046
|
tasks_projection_ids: list[str] | None = Field(
|
|
1041
1047
|
default=None, description="Expected task IDs certified by the completed task-set write."
|
|
@@ -1559,6 +1565,40 @@ class CodingAgentBilledDay(TenantedNode):
|
|
|
1559
1565
|
)
|
|
1560
1566
|
|
|
1561
1567
|
|
|
1568
|
+
class CodingAgentTaskBilledDay(TenantedNode):
|
|
1569
|
+
"""One task's request-attributed usage on one UTC day.
|
|
1570
|
+
|
|
1571
|
+
Unlike :class:`CodingAgentBilledDay`, this projection includes only
|
|
1572
|
+
requests with a durable task range. That makes repository and theme scopes
|
|
1573
|
+
honest when a session also contains unscoped billable work.
|
|
1574
|
+
"""
|
|
1575
|
+
|
|
1576
|
+
node_type: Literal[NodeType.CODING_AGENT_TASK_BILLED_DAY] = Field(
|
|
1577
|
+
default=NodeType.CODING_AGENT_TASK_BILLED_DAY, frozen=True
|
|
1578
|
+
)
|
|
1579
|
+
session_id: str = Field(..., description="Owning CodingAgentSession id.")
|
|
1580
|
+
task_id: str = Field(..., description="Owning CodingAgentTask id.")
|
|
1581
|
+
user_uuid: str | None = Field(default=None, description="Member who ran the parent session.")
|
|
1582
|
+
agent: str = Field(..., description="Agent kind the request came from.")
|
|
1583
|
+
day: str = Field(..., description="UTC calendar day, YYYY-MM-DD.")
|
|
1584
|
+
cost_usd: float = Field(default=0.0, description="Task-linked request cost for the day.")
|
|
1585
|
+
requests: int = Field(default=0, description="Task-linked billing requests that day.")
|
|
1586
|
+
priced_requests: int = Field(default=0, description="Task-linked requests carrying a price.")
|
|
1587
|
+
input_tokens: int = Field(default=0)
|
|
1588
|
+
cache_read_tokens: int = Field(default=0)
|
|
1589
|
+
cache_write_tokens: int = Field(default=0)
|
|
1590
|
+
output_tokens: int = Field(default=0)
|
|
1591
|
+
models_json: str | None = Field(
|
|
1592
|
+
default=None, description="JSON {model: {requests, cost_usd, ...}} for the task/day."
|
|
1593
|
+
)
|
|
1594
|
+
cost_basis: Literal["vendor", "rate_card", "mixed", "allocated"] = Field(
|
|
1595
|
+
default="rate_card", description="Provenance of the task/day dollars."
|
|
1596
|
+
)
|
|
1597
|
+
computed_at: datetime | None = Field(
|
|
1598
|
+
default=None, description="When the attribution job last rebuilt this node."
|
|
1599
|
+
)
|
|
1600
|
+
|
|
1601
|
+
|
|
1562
1602
|
class CodingAgentTheme(TenantedNode):
|
|
1563
1603
|
"""A cluster of related Tasks spanning developers and weeks.
|
|
1564
1604
|
|
|
@@ -1683,7 +1723,10 @@ class Decision(TenantedNode):
|
|
|
1683
1723
|
)
|
|
1684
1724
|
|
|
1685
1725
|
# Provenance
|
|
1686
|
-
applies_to_files: list[str] = Field(
|
|
1726
|
+
applies_to_files: list[str] = Field(
|
|
1727
|
+
default_factory=list,
|
|
1728
|
+
description="Files explicitly governed by the decision, not all files in its session.",
|
|
1729
|
+
)
|
|
1687
1730
|
extraction_source: DecisionSourceLiteral = Field(default="coding_agent_session")
|
|
1688
1731
|
extraction_confidence: float | None = Field(
|
|
1689
1732
|
default=None,
|
|
@@ -1718,6 +1761,7 @@ NODE_MODELS: dict[NodeType, type[MemoryNode]] = {
|
|
|
1718
1761
|
NodeType.CODING_AGENT_TASK: CodingAgentTask,
|
|
1719
1762
|
NodeType.CODING_AGENT_THEME: CodingAgentTheme,
|
|
1720
1763
|
NodeType.CODING_AGENT_BILLED_DAY: CodingAgentBilledDay,
|
|
1764
|
+
NodeType.CODING_AGENT_TASK_BILLED_DAY: CodingAgentTaskBilledDay,
|
|
1721
1765
|
NodeType.DECISION: Decision,
|
|
1722
1766
|
}
|
|
1723
1767
|
|
|
@@ -1783,6 +1827,10 @@ def model_for(
|
|
|
1783
1827
|
node_type: Literal[NodeType.CODING_AGENT_BILLED_DAY],
|
|
1784
1828
|
) -> type[CodingAgentBilledDay]: ...
|
|
1785
1829
|
@overload
|
|
1830
|
+
def model_for(
|
|
1831
|
+
node_type: Literal[NodeType.CODING_AGENT_TASK_BILLED_DAY],
|
|
1832
|
+
) -> type[CodingAgentTaskBilledDay]: ...
|
|
1833
|
+
@overload
|
|
1786
1834
|
def model_for(node_type: Literal[NodeType.DECISION]) -> type[Decision]: ...
|
|
1787
1835
|
@overload
|
|
1788
1836
|
def model_for(node_type: str) -> type[MemoryNode]: ...
|
|
@@ -1808,6 +1856,7 @@ __all__ = [
|
|
|
1808
1856
|
"CodingAgentTask",
|
|
1809
1857
|
"CodingAgentTheme",
|
|
1810
1858
|
"CodingAgentBilledDay",
|
|
1859
|
+
"CodingAgentTaskBilledDay",
|
|
1811
1860
|
"Decision",
|
|
1812
1861
|
"DecisionLifecycleLiteral",
|
|
1813
1862
|
"DecisionScopeLiteral",
|
|
@@ -175,6 +175,45 @@ def _read_high_water_mark(org_uuid: str) -> datetime | None:
|
|
|
175
175
|
return _read_sync_state(org_uuid)[0]
|
|
176
176
|
|
|
177
177
|
|
|
178
|
+
# How many consecutive syncs may fail to capture the SAME session before the
|
|
179
|
+
# watermark is allowed past it. A failure caps the mark just below the failing
|
|
180
|
+
# session so it stays eligible for a retry; that is right for a transient read
|
|
181
|
+
# error and wrong for a malformed transcript, which fails identically forever
|
|
182
|
+
# and pins the mark at its own timestamp. Measured 2026-09-17: the shipped
|
|
183
|
+
# parser rejected 129 of 260 local Claude transcripts, and this org re-pushed
|
|
184
|
+
# 14,702 of 15,913 session rows in 24h because the mark never moved past the
|
|
185
|
+
# oldest of them. Three is a compromise: enough for a genuinely transient cause
|
|
186
|
+
# on a 15-minute schedule, short enough that a permanent one costs under an hour.
|
|
187
|
+
_PARSE_FAILURE_ABANDON_AFTER = 3
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _parse_failures_path(org_uuid: str) -> Path:
|
|
191
|
+
"""Per-org path for the consecutive parse-failure tally, keyed like the state file.
|
|
192
|
+
|
|
193
|
+
A separate file rather than a key in the sync-state file: ``_write_sync_state``
|
|
194
|
+
builds its payload from scratch and would drop the tally on every successful run.
|
|
195
|
+
"""
|
|
196
|
+
d = Path.home() / ".entelligence"
|
|
197
|
+
d.mkdir(exist_ok=True)
|
|
198
|
+
safe = "".join(c if (c.isalnum() or c in "._-") else "_" for c in (org_uuid or "unknown"))
|
|
199
|
+
return d / f"insights_parse_failures.{safe}.json"
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def _read_parse_failures(org_uuid: str) -> dict[str, int]:
|
|
203
|
+
"""Consecutive parse failures per session id. Missing/corrupt reads as empty."""
|
|
204
|
+
with suppress(Exception):
|
|
205
|
+
raw = json.loads(_parse_failures_path(org_uuid).read_text(encoding="utf-8"))
|
|
206
|
+
if isinstance(raw, dict):
|
|
207
|
+
return {str(k): int(v) for k, v in raw.items() if isinstance(v, int)}
|
|
208
|
+
return {}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def _write_parse_failures(org_uuid: str, counts: dict[str, int]) -> None:
|
|
212
|
+
"""Persist the tally. Best-effort: a failure here only costs a retry budget."""
|
|
213
|
+
with suppress(Exception):
|
|
214
|
+
_parse_failures_path(org_uuid).write_text(json.dumps(counts), encoding="utf-8")
|
|
215
|
+
|
|
216
|
+
|
|
178
217
|
def _write_sync_state(
|
|
179
218
|
org_uuid: str, *, watermark: datetime | None, directive_generation: int
|
|
180
219
|
) -> None:
|
|
@@ -3656,6 +3695,40 @@ def _sync_cmd(
|
|
|
3656
3695
|
# failed extractions via its DLQ; Path A's mark must not strand them).
|
|
3657
3696
|
earliest_failed: datetime | None = None
|
|
3658
3697
|
parse_failed = False
|
|
3698
|
+
# Consecutive capture failures per session, so a transcript that fails
|
|
3699
|
+
# forever eventually stops holding the checkpoint (see
|
|
3700
|
+
# `_PARSE_FAILURE_ABANDON_AFTER`). Loaded once per run, written once below.
|
|
3701
|
+
parse_failures = _read_parse_failures(org_uuid)
|
|
3702
|
+
parse_abandoned = 0
|
|
3703
|
+
|
|
3704
|
+
def _note_parse_failure(session_id: str, last: datetime | None) -> None:
|
|
3705
|
+
"""Record a session's capture failure and decide whether it still blocks the mark.
|
|
3706
|
+
|
|
3707
|
+
Within the retry budget the mark is capped just below this session, so
|
|
3708
|
+
it (and everything newer) is re-evaluated next run. Past the budget the
|
|
3709
|
+
session is abandoned: it stops capping, and the loss is stated in the
|
|
3710
|
+
run log and counted in the run stats rather than dropped silently.
|
|
3711
|
+
|
|
3712
|
+
Args:
|
|
3713
|
+
session_id: the session that failed to capture.
|
|
3714
|
+
last: its discovery `last_span_time`, or None when unknown.
|
|
3715
|
+
"""
|
|
3716
|
+
nonlocal earliest_failed, parse_failed, parse_abandoned
|
|
3717
|
+
parse_failed = True
|
|
3718
|
+
count = parse_failures.get(session_id, 0) + 1
|
|
3719
|
+
parse_failures[session_id] = count
|
|
3720
|
+
if count >= _PARSE_FAILURE_ABANDON_AFTER:
|
|
3721
|
+
parse_abandoned += 1
|
|
3722
|
+
runlog.warn(
|
|
3723
|
+
"build",
|
|
3724
|
+
f"session={session_id} failed to capture {count} runs in a row: "
|
|
3725
|
+
"abandoned so the checkpoint can advance past it. Only "
|
|
3726
|
+
"`sync --all` or a resume directive will re-read it",
|
|
3727
|
+
)
|
|
3728
|
+
return
|
|
3729
|
+
if last is not None and (earliest_failed is None or last < earliest_failed):
|
|
3730
|
+
earliest_failed = last
|
|
3731
|
+
|
|
3659
3732
|
# Cursor persists no per-turn tokens locally, so its memory_core-parsed spans
|
|
3660
3733
|
# carry zero tokens and the backend drops the rows for graph parity (#4105).
|
|
3661
3734
|
# Fetch Cursor's billed usage once for this run and stamp it onto each Cursor
|
|
@@ -3715,9 +3788,7 @@ def _sync_cmd(
|
|
|
3715
3788
|
runlog.warn(
|
|
3716
3789
|
"build", f"parse failed for session={disc.session_id} — skipped", exc_info=True
|
|
3717
3790
|
)
|
|
3718
|
-
|
|
3719
|
-
if last is not None and (earliest_failed is None or last < earliest_failed):
|
|
3720
|
-
earliest_failed = last
|
|
3791
|
+
_note_parse_failure(disc.session_id, last)
|
|
3721
3792
|
continue
|
|
3722
3793
|
with suppress(Exception):
|
|
3723
3794
|
facts_envelope.enrich_session_identity(source, disc.session_id, spans)
|
|
@@ -3726,14 +3797,12 @@ def _sync_cmd(
|
|
|
3726
3797
|
# genuinely empty session — keep it retryable (don't advance the mark past
|
|
3727
3798
|
# it) instead of silently dropping it as "no turns" below.
|
|
3728
3799
|
if not spans and disc.span_count > 0:
|
|
3729
|
-
parse_failed = True
|
|
3730
3800
|
runlog.warn(
|
|
3731
3801
|
"build",
|
|
3732
3802
|
f"unreadable session={disc.session_id} "
|
|
3733
3803
|
f"(0 of {disc.span_count} spans read) — skipped",
|
|
3734
3804
|
)
|
|
3735
|
-
|
|
3736
|
-
earliest_failed = last
|
|
3805
|
+
_note_parse_failure(disc.session_id, last)
|
|
3737
3806
|
continue
|
|
3738
3807
|
# Stamp Cursor billed usage onto the root span BEFORE metrics compute, so
|
|
3739
3808
|
# aggregate_session_spans reports real session totals (no-op for non-Cursor
|
|
@@ -3746,14 +3815,12 @@ def _sync_cmd(
|
|
|
3746
3815
|
disc.session_id, spans, repos_by_leaf=repos_by_leaf
|
|
3747
3816
|
)
|
|
3748
3817
|
except (TypeError, ValueError):
|
|
3749
|
-
parse_failed = True
|
|
3750
3818
|
runlog.warn(
|
|
3751
3819
|
"build",
|
|
3752
3820
|
f"metrics failed for session={disc.session_id} — retry pending",
|
|
3753
3821
|
exc_info=True,
|
|
3754
3822
|
)
|
|
3755
|
-
|
|
3756
|
-
earliest_failed = last
|
|
3823
|
+
_note_parse_failure(disc.session_id, last)
|
|
3757
3824
|
continue
|
|
3758
3825
|
if session is None:
|
|
3759
3826
|
continue
|
|
@@ -3938,6 +4005,10 @@ def _sync_cmd(
|
|
|
3938
4005
|
# loop end to end so it cannot silently happen again.
|
|
3939
4006
|
sessions.append(session)
|
|
3940
4007
|
pushed_session_ids.append(disc.session_id)
|
|
4008
|
+
# Captured cleanly, so the retry budget resets: `_PARSE_FAILURE_ABANDON_AFTER`
|
|
4009
|
+
# counts CONSECUTIVE failures, and a transient read error must never
|
|
4010
|
+
# accumulate toward abandoning a session that parses fine on other runs.
|
|
4011
|
+
parse_failures.pop(disc.session_id, None)
|
|
3941
4012
|
# ENT-4430 (part 2): lets the push loop below cap the watermark at a
|
|
3942
4013
|
# specific session's timestamp (via `earliest_failed`, same mechanism
|
|
3943
4014
|
# the parse-failure branches above already use) if that session's
|
|
@@ -3954,6 +4025,13 @@ def _sync_cmd(
|
|
|
3954
4025
|
f"{outside_window} session(s) outside the look-back window by parsed "
|
|
3955
4026
|
"span time (discovery mtime said newer) — not pushed",
|
|
3956
4027
|
)
|
|
4028
|
+
if not dry_run:
|
|
4029
|
+
# Persisted HERE, at the end of capture, not after the push: whether a
|
|
4030
|
+
# transcript parses is independent of whether the push later succeeded,
|
|
4031
|
+
# and a run that aborts on a 429 must still spend the retry budget. A
|
|
4032
|
+
# dry run writes nothing, so its failures cost no budget either.
|
|
4033
|
+
_write_parse_failures(org_uuid, parse_failures)
|
|
4034
|
+
_merge_last_run_stats(org_uuid, parse_abandoned=parse_abandoned)
|
|
3957
4035
|
if cursor_usage_run_state != RUN_STATE_NO_CURSOR_SESSIONS:
|
|
3958
4036
|
# Remembered for the hourly heartbeat: the run-level reason plus the
|
|
3959
4037
|
# per-session tally, so the org's readiness check can name the machines
|
|
@@ -4191,7 +4269,27 @@ def _sync_cmd(
|
|
|
4191
4269
|
e.get("cost_observation", {}).get("complete") is False for e in envelopes
|
|
4192
4270
|
)
|
|
4193
4271
|
deferred_live = bool(os.environ.get("ENTELLIGENCE_LIVE_SYNC")) and pushed < len(sessions)
|
|
4194
|
-
|
|
4272
|
+
# A capture failure is NOT a whole-run failure. Every session that built,
|
|
4273
|
+
# pushed and was acknowledged is durable server-side, and
|
|
4274
|
+
# `_next_high_water_mark` already caps the new mark below the earliest
|
|
4275
|
+
# still-retryable failure. Aborting here discarded that mark too, so one
|
|
4276
|
+
# unparseable transcript froze the checkpoint for every other session in the
|
|
4277
|
+
# batch: the whole backlog then re-pushed on every run and nothing newer ever
|
|
4278
|
+
# settled. This is the exact shape `error_type` used to label
|
|
4279
|
+
# `_PartialCaptureError`: capture lost some sessions, but every session that
|
|
4280
|
+
# DID build was pushed and archived. Those runs now leave through the raise
|
|
4281
|
+
# BELOW the checkpoint write. Anything else (an unproven push, a missing
|
|
4282
|
+
# acknowledgement, a deferred batch) is still a hard abort with the mark
|
|
4283
|
+
# untouched, because those sessions are not stored anywhere yet.
|
|
4284
|
+
capture_only = (
|
|
4285
|
+
parse_failed
|
|
4286
|
+
and sessions
|
|
4287
|
+
and pushed == len(sessions)
|
|
4288
|
+
and envelopes_archived_total == len(sessions)
|
|
4289
|
+
and not unconfirmed
|
|
4290
|
+
and not incomplete_facts
|
|
4291
|
+
)
|
|
4292
|
+
if not capture_only and (
|
|
4195
4293
|
envelopes_archived_total < len(sessions)
|
|
4196
4294
|
or unconfirmed
|
|
4197
4295
|
or parse_failed
|
|
@@ -4214,17 +4312,9 @@ def _sync_cmd(
|
|
|
4214
4312
|
gated_count=repo_gated_total,
|
|
4215
4313
|
error_detail=detail,
|
|
4216
4314
|
)
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
and sessions
|
|
4221
|
-
and pushed == len(sessions)
|
|
4222
|
-
and envelopes_archived_total == len(sessions)
|
|
4223
|
-
and not unconfirmed
|
|
4224
|
-
and not incomplete_facts
|
|
4225
|
-
else click.ClickException
|
|
4226
|
-
)
|
|
4227
|
-
raise error_type(
|
|
4315
|
+
# Always the hard type here: every capture-only failure now leaves via
|
|
4316
|
+
# the `_PartialCaptureError` below, AFTER the checkpoint is written.
|
|
4317
|
+
raise click.ClickException(
|
|
4228
4318
|
f"Sync incomplete ({envelopes_archived_total}/{len(sessions)} archived, "
|
|
4229
4319
|
f"{len(unconfirmed)} storage acknowledgements missing, capture failed={parse_failed}, "
|
|
4230
4320
|
f"request facts truncated={incomplete_facts}). "
|
|
@@ -4304,7 +4394,7 @@ def _sync_cmd(
|
|
|
4304
4394
|
if earliest_failed is None:
|
|
4305
4395
|
_write_unpriced_cursor(org_uuid, unpriced_cursor)
|
|
4306
4396
|
_mark_sync_run(transcripts=False) # a metrics sync ran today
|
|
4307
|
-
|
|
4397
|
+
elif pushed < len(sessions):
|
|
4308
4398
|
# ENT-4528 review: a run that left 429'd batches for "a future run" must
|
|
4309
4399
|
# not stamp the cadence marker — `_should_run_path_a` would then treat
|
|
4310
4400
|
# the next hourly `--agent` fire as "recently synced" and sit on the
|
|
@@ -4315,6 +4405,16 @@ def _sync_cmd(
|
|
|
4315
4405
|
"run complete so the next scheduled fire retries them",
|
|
4316
4406
|
len(sessions) - pushed,
|
|
4317
4407
|
)
|
|
4408
|
+
if parse_failed:
|
|
4409
|
+
# Capture-only: everything that built is pushed, acknowledged and now
|
|
4410
|
+
# checkpointed. Still an error so the run is reported as incomplete and
|
|
4411
|
+
# the cadence marker above stays unstamped while a retry is pending.
|
|
4412
|
+
raise _PartialCaptureError(
|
|
4413
|
+
f"Capture incomplete ({pushed}/{len(sessions)} sessions captured, "
|
|
4414
|
+
f"{parse_abandoned} abandoned). Checkpoint advanced to "
|
|
4415
|
+
f"{(new_hwm if max_seen is not None else hwm)}; "
|
|
4416
|
+
"the next sync retries what is still eligible."
|
|
4417
|
+
)
|
|
4318
4418
|
runlog.line(
|
|
4319
4419
|
"push",
|
|
4320
4420
|
f"{pushed} sent · {sessions_stored_total} stored · "
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: entelligence-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.322
|
|
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
|
|
@@ -235,6 +235,7 @@ tests/test_sessions_status_safe_default.py
|
|
|
235
235
|
tests/test_skills_command.py
|
|
236
236
|
tests/test_sync_backgrounding.py
|
|
237
237
|
tests/test_sync_dry_run_checkpoint.py
|
|
238
|
+
tests/test_sync_parse_failure_checkpoint.py
|
|
238
239
|
tests/test_sync_partial_schema.py
|
|
239
240
|
tests/test_sync_pushes_built_sessions.py
|
|
240
241
|
tests/test_sync_runs_full_pipeline.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "entelligence-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.322"
|
|
8
8
|
description = "AI-powered code review assistant for your terminal - Get instant, intelligent feedback on your code changes"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -546,7 +546,10 @@ class TestClaudeCodeTranscriptPaths:
|
|
|
546
546
|
|
|
547
547
|
|
|
548
548
|
class TestFallbackClaudeCodeCostEvents:
|
|
549
|
-
@pytest.mark.parametrize(
|
|
549
|
+
@pytest.mark.parametrize(
|
|
550
|
+
"iterations",
|
|
551
|
+
[{}, "bad", False, [None], [{"type": ""}], [{"input_tokens": 1, "output_tokens": 2}]],
|
|
552
|
+
)
|
|
550
553
|
def test_unknown_iteration_contract_is_not_recovered_as_top_level_usage(
|
|
551
554
|
self, tmp_path, iterations
|
|
552
555
|
):
|
|
@@ -14,7 +14,7 @@ from tests.test_sync_pushes_built_sessions import ORG, RECENT, ins
|
|
|
14
14
|
from tests.test_sync_pushes_built_sessions import harness as harness
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def
|
|
17
|
+
def test_rejected_metrics_preserves_replay_and_keeps_the_reject_eligible(harness, tmp_path): # noqa: F811
|
|
18
18
|
home = tmp_path / "claude-source"
|
|
19
19
|
project = home / "projects" / "-audit"
|
|
20
20
|
project.mkdir(parents=True)
|
|
@@ -64,7 +64,12 @@ def test_rejected_metrics_preserves_replay_and_checkpoint(harness, tmp_path): #
|
|
|
64
64
|
harness.run()
|
|
65
65
|
assert [p["session_id"] for p in harness.pushed()] == ["local:claude-code:healthy"]
|
|
66
66
|
assert ins._read_client_directive_generation("metrics_generation", ORG, "audit-user") == 0
|
|
67
|
-
|
|
67
|
+
# ENT-4702: the checkpoint now advances for the session that DID land, but
|
|
68
|
+
# `_next_high_water_mark` caps it below the rejected one, which is exactly
|
|
69
|
+
# why the repaired run below still re-pushes that session.
|
|
70
|
+
after = ins._read_sync_state(ORG)
|
|
71
|
+
assert after != before
|
|
72
|
+
assert after[0] is not None
|
|
68
73
|
# Repair the missing timestamp without changing any measured token count.
|
|
69
74
|
path = project / "incomplete.jsonl"
|
|
70
75
|
records = [json.loads(line) for line in path.read_text().splitlines()]
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""A session that cannot be parsed must not freeze the checkpoint for the rest.
|
|
2
|
+
|
|
3
|
+
Two defects, both measured on 2026-09-17 against a nine-day Agent Insights
|
|
4
|
+
outage on this machine:
|
|
5
|
+
|
|
6
|
+
* One unparseable transcript set ``parse_failed``, and the abort gate in
|
|
7
|
+
``_sync_cmd`` raised BEFORE the watermark write, so the mark never moved,
|
|
8
|
+
even for sessions newer than the failure that pushed and acknowledged fine.
|
|
9
|
+
``_next_high_water_mark`` already caps the mark below the earliest failure;
|
|
10
|
+
the gate simply never let it run.
|
|
11
|
+
* Even with the write reached, a PERMANENTLY unparseable session pins the cap
|
|
12
|
+
at its own timestamp forever: the same backlog re-pushes on every run and
|
|
13
|
+
nothing newer ever settles. Retrying is right for a transient read error and
|
|
14
|
+
wrong for a malformed transcript, so the retry is now bounded.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import sys
|
|
20
|
+
from datetime import timedelta
|
|
21
|
+
from types import SimpleNamespace
|
|
22
|
+
|
|
23
|
+
import pytest
|
|
24
|
+
|
|
25
|
+
import entelligence_cli.commands.insights # noqa: F401
|
|
26
|
+
from entelligence_cli import _vendor # noqa: F401
|
|
27
|
+
from tests.test_sync_pushes_built_sessions import ORG, RECENT, _Source, _spans
|
|
28
|
+
from tests.test_sync_pushes_built_sessions import harness as harness # noqa: F401
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
ins = sys.modules["entelligence_cli.commands.insights"]
|
|
32
|
+
|
|
33
|
+
OLDER = RECENT - timedelta(hours=2)
|
|
34
|
+
MIDDLE = RECENT - timedelta(hours=1)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
_SPAN_TIMES = {"old": OLDER, "mid": MIDDLE, "new": RECENT}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class _TimedSource(_Source):
|
|
41
|
+
"""``_Source`` with a per-session ``last_span_time`` and chosen parse failures.
|
|
42
|
+
|
|
43
|
+
The shared-`last` base fixture cannot express "the failure is newer than the
|
|
44
|
+
good sessions", which is the whole point of the cap.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
def __init__(self, ids, failures):
|
|
48
|
+
super().__init__(ids)
|
|
49
|
+
self._failures = set(failures)
|
|
50
|
+
|
|
51
|
+
def discover_sessions(self):
|
|
52
|
+
return [
|
|
53
|
+
SimpleNamespace(
|
|
54
|
+
session_id=f"local:claude-code:{i}",
|
|
55
|
+
last_span_time=_SPAN_TIMES[i],
|
|
56
|
+
span_count=2,
|
|
57
|
+
)
|
|
58
|
+
for i in self._ids
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
def get_spans_by_session(self, sid):
|
|
62
|
+
short = sid.rsplit(":", 1)[-1]
|
|
63
|
+
if short in self._failures:
|
|
64
|
+
raise ValueError("invalid usage")
|
|
65
|
+
return _spans(short, when=_SPAN_TIMES[short])
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _failing_source(order, failures):
|
|
69
|
+
"""A source over ``order`` whose ``failures`` sessions raise on parse."""
|
|
70
|
+
return _TimedSource(list(order), failures)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def test_a_newer_failure_still_lets_older_good_sessions_settle(harness): # noqa: F811
|
|
74
|
+
"""The mark advances to the newest session BELOW the failure, not nowhere."""
|
|
75
|
+
harness.state.update(source=_failing_source(["old", "mid", "new"], {"new"}))
|
|
76
|
+
|
|
77
|
+
with pytest.raises(ins._PartialCaptureError):
|
|
78
|
+
harness.run()
|
|
79
|
+
|
|
80
|
+
assert sorted(s["session_id"] for s in harness.pushed()) == [
|
|
81
|
+
"local:claude-code:mid",
|
|
82
|
+
"local:claude-code:old",
|
|
83
|
+
]
|
|
84
|
+
watermark = ins._read_sync_state(ORG)[0]
|
|
85
|
+
assert watermark is not None, "checkpoint frozen: the whole run was discarded"
|
|
86
|
+
assert watermark == MIDDLE
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_a_permanently_unparseable_session_is_abandoned_after_three_runs(harness): # noqa: F811
|
|
90
|
+
"""The cap cannot outlive the retries: run 3 gives up and lets the mark pass."""
|
|
91
|
+
for run_index in range(1, 4):
|
|
92
|
+
harness.state.update(
|
|
93
|
+
source=_failing_source(["old", "new"], {"old"}),
|
|
94
|
+
hwm=ins._read_sync_state(ORG)[0],
|
|
95
|
+
)
|
|
96
|
+
with pytest.raises(ins._PartialCaptureError):
|
|
97
|
+
harness.run()
|
|
98
|
+
watermark = ins._read_sync_state(ORG)[0]
|
|
99
|
+
if run_index < 3:
|
|
100
|
+
# Still retrying: the cap holds just below the failure, so `new`
|
|
101
|
+
# stays eligible and is pushed again next run.
|
|
102
|
+
assert watermark == OLDER - timedelta(seconds=1)
|
|
103
|
+
assert ins._read_last_run_stats(ORG).get("parse_abandoned") in (None, 0)
|
|
104
|
+
|
|
105
|
+
assert watermark == RECENT
|
|
106
|
+
assert ins._read_last_run_stats(ORG).get("parse_abandoned") == 1
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_a_session_that_parses_again_clears_its_failure_count(harness): # noqa: F811
|
|
110
|
+
"""A transient read error must not accumulate toward abandonment."""
|
|
111
|
+
harness.state.update(source=_failing_source(["old", "new"], {"old"}))
|
|
112
|
+
with pytest.raises(ins._PartialCaptureError):
|
|
113
|
+
harness.run()
|
|
114
|
+
assert ins._read_parse_failures(ORG).get("local:claude-code:old") == 1
|
|
115
|
+
|
|
116
|
+
harness.state.update(
|
|
117
|
+
source=_failing_source(["old", "new"], set()),
|
|
118
|
+
hwm=ins._read_sync_state(ORG)[0],
|
|
119
|
+
)
|
|
120
|
+
harness.run()
|
|
121
|
+
assert ins._read_parse_failures(ORG) == {}
|