cctally 1.108.0 → 1.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +6 -6
  3. package/bin/_cctally_account.py +4 -0
  4. package/bin/_cctally_alerts.py +6 -2
  5. package/bin/_cctally_cache.py +1652 -166
  6. package/bin/_cctally_config.py +3 -2
  7. package/bin/_cctally_core.py +594 -33
  8. package/bin/_cctally_dashboard.py +1585 -201
  9. package/bin/_cctally_dashboard_conversation.py +494 -48
  10. package/bin/_cctally_dashboard_envelope.py +167 -11
  11. package/bin/_cctally_dashboard_share.py +154 -36
  12. package/bin/_cctally_dashboard_sources.py +2615 -422
  13. package/bin/_cctally_db.py +678 -5
  14. package/bin/_cctally_diagnosis_sources.py +238 -26
  15. package/bin/_cctally_doctor.py +99 -18
  16. package/bin/_cctally_five_hour.py +1295 -40
  17. package/bin/_cctally_forecast.py +124 -28
  18. package/bin/_cctally_journal.py +408 -38
  19. package/bin/_cctally_milestone_history.py +150 -14
  20. package/bin/_cctally_parser.py +5 -0
  21. package/bin/_cctally_percent_breakdown.py +6 -1
  22. package/bin/_cctally_project.py +48 -76
  23. package/bin/_cctally_quota.py +39 -7
  24. package/bin/_cctally_quota_model.py +17 -2
  25. package/bin/_cctally_record.py +1647 -443
  26. package/bin/_cctally_rederive.py +899 -30
  27. package/bin/_cctally_refresh.py +2 -1
  28. package/bin/_cctally_share.py +24 -5
  29. package/bin/_cctally_source_analytics.py +1035 -78
  30. package/bin/_cctally_statusline.py +83 -19
  31. package/bin/_cctally_store.py +61 -4
  32. package/bin/_cctally_transcript.py +27 -2
  33. package/bin/_cctally_tui.py +264 -76
  34. package/bin/_cctally_weekrefs.py +28 -5
  35. package/bin/_lib_blocks.py +127 -20
  36. package/bin/_lib_cache_report.py +20 -5
  37. package/bin/_lib_codex_conversation_query.py +297 -64
  38. package/bin/_lib_codex_hooks.py +102 -0
  39. package/bin/_lib_codex_metadata.py +207 -0
  40. package/bin/_lib_conversation.py +119 -0
  41. package/bin/_lib_conversation_dispatch.py +31 -1
  42. package/bin/_lib_conversation_query.py +315 -51
  43. package/bin/_lib_conversation_retention.py +413 -25
  44. package/bin/_lib_dashboard_sources.py +267 -7
  45. package/bin/_lib_diagnosis.py +10 -0
  46. package/bin/_lib_diff_kernel.py +12 -1
  47. package/bin/_lib_doctor.py +230 -8
  48. package/bin/_lib_ingest_frontier.py +1366 -49
  49. package/bin/_lib_journal.py +19 -2
  50. package/bin/_lib_merge_gate.py +307 -0
  51. package/bin/_lib_pricing.py +588 -29
  52. package/bin/_lib_record.py +130 -12
  53. package/bin/_lib_rederive.py +903 -2
  54. package/bin/_lib_render.py +9 -3
  55. package/bin/_lib_retained_size.py +27 -2
  56. package/bin/_lib_segment_summary.py +66 -8
  57. package/bin/_lib_share_templates.py +28 -18
  58. package/bin/_lib_snapshot_cache.py +115 -1
  59. package/bin/_lib_source_retry.py +320 -0
  60. package/bin/_lib_statusline_candidates.py +400 -36
  61. package/bin/_lib_tick_stats.py +119 -0
  62. package/bin/_lib_view_models.py +256 -76
  63. package/bin/cctally +69 -0
  64. package/dashboard/static/assets/ConversationsView-BB9vUiL6.js +72 -0
  65. package/dashboard/static/assets/{DoctorModal-CWn3U4Wl.js → DoctorModal-DFY2iPDf.js} +1 -1
  66. package/dashboard/static/assets/ModalRoot-DvRKHbQE.js +1 -0
  67. package/dashboard/static/assets/ProjectsDrillPanel-DAv39uSo.js +1 -0
  68. package/dashboard/static/assets/SourceDetailModal-DSAWo2Fp.js +1 -0
  69. package/dashboard/static/assets/{UpdateModal-D3m8GG6V.js → UpdateModal-R_9dOVnh.js} +3 -3
  70. package/dashboard/static/assets/dashboardStream.shared-worker-DbG6Ef0T.js +1 -0
  71. package/dashboard/static/assets/index-COhxe3vU.css +1 -0
  72. package/dashboard/static/assets/index-DdU62sov.js +13 -0
  73. package/dashboard/static/assets/outlineNavigation-BOCLcRa6.js +9 -0
  74. package/dashboard/static/assets/useKeymap-CW7Up0Ay.js +1 -0
  75. package/dashboard/static/dashboard.html +3 -3
  76. package/package.json +4 -1
  77. package/dashboard/static/assets/ConversationsView-BOSaBRtu.js +0 -72
  78. package/dashboard/static/assets/ModalRoot-SR070V6c.js +0 -1
  79. package/dashboard/static/assets/ProjectsDrillPanel-QLI9i5mZ.js +0 -1
  80. package/dashboard/static/assets/SourceDetailModal-pv0wlFxl.js +0 -1
  81. package/dashboard/static/assets/dashboardStream.shared-worker-1XTMV3nr.js +0 -1
  82. package/dashboard/static/assets/index-BHu4mxd8.css +0 -1
  83. package/dashboard/static/assets/index-CIWsbux3.js +0 -13
  84. package/dashboard/static/assets/outlineNavigation-CJvKqmLV.js +0 -9
  85. package/dashboard/static/assets/useKeymap-ffqsS5G0.js +0 -1
@@ -978,7 +978,8 @@ def _hook_tick_oauth_refresh(
978
978
  BUT do NOT call _bust_statusline_cache().
979
979
 
980
980
  `throttle_seconds` controls the DB-snapshot freshness gate (skip the
981
- fetch if the newest weekly_usage_snapshots row is younger than this).
981
+ fetch if the newest genuinely observed weekly_usage_snapshots row is
982
+ younger than this; a `weekly_observation_held` row is not one).
982
983
  `None` => read `oauth_usage.throttle_seconds` from config (falling back
983
984
  to HOOK_TICK_DEFAULT_THROTTLE_SECONDS on validation error). An explicit
984
985
  value bypasses config so `cmd_hook_tick`'s already-resolved
@@ -423,15 +423,34 @@ def _build_report_snapshot(
423
423
  rows = view.rows # oldest-first; matches chart's left→right walk.
424
424
  snap_rows: list = []
425
425
  chart_pts: list = []
426
- for i, r in enumerate(rows):
426
+ # The base label is the ISO `week_start_date`, kept exactly as it is so
427
+ # every uncredited artifact byte stays put. That column is the SHARED
428
+ # billing-cycle join key, though, so a credited week renders it twice —
429
+ # the same defect CLI-side surfaces do not have, because they read
430
+ # `display_start_date`. Switching this site to `r.week_label` would move
431
+ # every existing ISO date in every share artifact, so share gets its own
432
+ # collision path over the ISO base instead (#750 S4 §3.3).
433
+ _vm = sys.modules["cctally"]._load_sibling("_lib_view_models")
434
+
435
+ def _iso_base(r):
427
436
  wsd = r.week_start_date.isoformat() if r.week_start_date else None
428
437
  if isinstance(wsd, str) and wsd:
429
438
  try:
430
- week_label = dt.date.fromisoformat(wsd).isoformat()
439
+ return dt.date.fromisoformat(wsd).isoformat()
431
440
  except ValueError:
432
- week_label = wsd
433
- else:
434
- week_label = "—"
441
+ return wsd
442
+ return "—"
443
+
444
+ week_labels = _vm.apply_label_collision_suffixes(
445
+ # `getattr`, because this builder is also driven by hand-built row
446
+ # stand-ins that carry only the fields the artifact renders. A row
447
+ # with no instant simply cannot be disambiguated, and keeps its base.
448
+ [(_iso_base(r), _iso_base(r), getattr(r, "week_start_at", None))
449
+ for r in rows],
450
+ display_tz=display_tz,
451
+ )
452
+ for i, r in enumerate(rows):
453
+ week_label = week_labels[i]
435
454
  # Preserve None vs 0.0 distinction (parity with terminal/JSON).
436
455
  # Terminal _render_weekly_table renders missing values as "—";
437
456
  # share artifact follows the same convention. Coercing None to