ctxtop 4.0.0 → 4.1.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 (89) hide show
  1. package/.antigravity-plugin/plugin.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHECKSUMS.sha256 +59 -42
  4. package/README.md +351 -330
  5. package/bin/ah-statusline.mjs +30 -0
  6. package/bin/ctxtop.mjs +330 -5
  7. package/config/default_flightcheck.json +19 -0
  8. package/config/modelCatalog.json +165 -0
  9. package/hooks/handlers/compact-lifecycle.mjs +323 -8
  10. package/hooks/handlers/config-change.mjs +402 -0
  11. package/hooks/handlers/hookIo.mjs +56 -0
  12. package/hooks/handlers/post-model-switch.mjs +111 -0
  13. package/hooks/handlers/post-tool-use.mjs +117 -16
  14. package/hooks/handlers/pre-model-switch.mjs +823 -24
  15. package/hooks/handlers/pre-tool-use.mjs +271 -4
  16. package/hooks/handlers/stop-gate.mjs +297 -11
  17. package/hooks/handlers/user-prompt-submit.mjs +224 -0
  18. package/hooks/hooks.json +50 -0
  19. package/hooks/post_tool_use.mjs +8 -0
  20. package/hooks/register.js +48 -9
  21. package/hooks/session_start.mjs +11 -1
  22. package/hooks/stop.mjs +11 -1
  23. package/package.json +11 -4
  24. package/packages/antigravity/package.json +1 -1
  25. package/packages/claude-code/package.json +1 -1
  26. package/packages/core/package.json +1 -1
  27. package/packages/engine-node/package.json +1 -1
  28. package/packages/mcp/package.json +1 -1
  29. package/packages/mcp/src/server.mjs +1 -1
  30. package/packages/pro/package.json +1 -1
  31. package/plugin.json +1 -1
  32. package/sidecars/horizon-daemon/server.mjs +38 -2
  33. package/skills/handoff/SKILL.md +8 -0
  34. package/src/adapters/antigravity/index.mjs +31 -1
  35. package/src/adapters/claude-code/index.mjs +40 -1
  36. package/src/cli/horizon_hud.mjs +254 -52
  37. package/src/config/modelCatalog.json +84 -0
  38. package/src/core/bucket_b_runtime.mjs +1200 -0
  39. package/src/core/constants.mjs +191 -4
  40. package/src/core/detectors_det01_to_16.mjs +54 -5
  41. package/src/core/doc_indexer.mjs +338 -0
  42. package/src/core/layer5_hygiene.mjs +118 -0
  43. package/src/core/parser.mjs +2 -1
  44. package/src/core/paths.mjs +3 -2
  45. package/src/core/rsl_clash_auditor.mjs +423 -0
  46. package/src/core/rsl_distiller.mjs +372 -0
  47. package/src/core/rsl_ledger.mjs +969 -0
  48. package/src/core/rsl_triage.mjs +909 -0
  49. package/src/core/session_auditor.mjs +658 -0
  50. package/src/core/shield_manager.mjs +1417 -0
  51. package/src/core/task_quota_router.mjs +1 -1
  52. package/src/core-isomorphic/coach/cacheGravityRouter.mjs +874 -47
  53. package/src/core-isomorphic/coach/resumeToolsetAuditor.mjs +321 -0
  54. package/src/core-isomorphic/coach/smartCompactAdvisor.mjs +305 -0
  55. package/src/core-isomorphic/coach/ttlWatchdog.mjs +13 -6
  56. package/src/core-isomorphic/config/anthropicModelCatalog.json +404 -1
  57. package/src/core-isomorphic/config/catalogLoader.mjs +546 -46
  58. package/src/core-isomorphic/config/horizonConfig.mjs +47 -1
  59. package/src/core-isomorphic/diagnostics/prompt_hygiene_governor.mjs +266 -0
  60. package/src/core-isomorphic/economics/cacheGravity.mjs +18 -0
  61. package/src/core-isomorphic/economics/cliffBreaker.mjs +98 -12
  62. package/src/core-isomorphic/economics/driftLatency.mjs +114 -0
  63. package/src/core-isomorphic/guards/bucketBAlphaBeta.mjs +860 -0
  64. package/src/core-isomorphic/guards/bucketBGamma.mjs +442 -0
  65. package/src/core-isomorphic/guards/bucketBHeuristics.mjs +37 -0
  66. package/src/core-isomorphic/guards/circuitBreakers.mjs +191 -191
  67. package/src/core-isomorphic/guards/det01_03_shell_secret.mjs +154 -5
  68. package/src/core-isomorphic/guards/det04_12_thrash_rot.mjs +103 -11
  69. package/src/core-isomorphic/guards/det13_20_mcp_scope.mjs +311 -1
  70. package/src/core-isomorphic/guards/docIndexCore.mjs +446 -0
  71. package/src/core-isomorphic/guards/losslessPostSanitizer.mjs +16 -0
  72. package/src/core-isomorphic/guards/slopsquatGate.mjs +551 -0
  73. package/src/core-isomorphic/index.js +1 -0
  74. package/src/core-isomorphic/telemetry/telemetryBridge.mjs +36 -12
  75. package/src/core-isomorphic/ui/horizonPanelHtml.mjs +293 -237
  76. package/src/core-isomorphic/ui/modViews.mjs +35 -9
  77. package/src/diagnostics/claudeHookCapabilities.mjs +396 -0
  78. package/src/diagnostics/doctorEngine.mjs +95 -3
  79. package/src/engine-node/db/probe.mjs +234 -2
  80. package/src/engine-node/index.mjs +3 -0
  81. package/src/engine-node/sensors/blindspots.mjs +13 -6
  82. package/src/hooks/antigravity_rsl_hook.mjs +250 -0
  83. package/src/hooks/claude_rsl_hook.mjs +288 -0
  84. package/src/hooks/post_invocation.mjs +196 -4
  85. package/src/hooks/pre_invocation.mjs +732 -22
  86. package/src/hooks/session_start.mjs +39 -1
  87. package/src/utils/modelSwitchTelemetry.mjs +308 -0
  88. package/src/utils/sessionCalibration.mjs +657 -0
  89. package/src/webview/horizon_panel.html +1325 -317
@@ -67,7 +67,7 @@ function renderHtmlHorizonCells(grid) {
67
67
  ? CELL_CATEGORIES.D.colorHex
68
68
  : cat === 'W'
69
69
  ? CELL_CATEGORIES.W.colorHex
70
- : '#1e293b';
70
+ : 'var(--bg-elevated)';
71
71
  const label =
72
72
  cat === '.'
73
73
  ? `Cell ${idx + 1}: Available capacity`
@@ -393,50 +393,83 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
393
393
  <style>
394
394
  :root {
395
395
  color-scheme: dark;
396
- --bg: #0d1117;
397
- --card: #161b22;
398
- --card-alt: #1f2937;
399
- --border: rgba(240, 246, 252, 0.12);
400
- --fg: #e6edf3;
401
- --muted: #8b949e;
402
- --good: #2ea043;
403
- --warn: #d29922;
404
- --bad: #f85149;
405
- --accent: #58a6ff;
406
- --ring-track: rgba(240, 246, 252, 0.10);
396
+ --bg-canvas: #0B0C0E;
397
+ --bg-surface: #121417;
398
+ --bg-elevated: #1B1E23;
399
+ --hairline: rgba(255, 255, 255, 0.07);
400
+ --text-primary: #F1F3F4;
401
+ --text-secondary: #9AA0A6;
402
+ --text-muted: #80868B;
403
+ --status-critical: #D93025;
404
+ --status-warning: #F29900;
405
+ --status-nominal: #1E8E3E;
406
+ --accent-focus: #1A73E8;
407
+ --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Google Sans", sans-serif;
408
+ --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
409
+ --control-height: 28px;
410
+ --control-radius: 6px;
411
+ --ease-snappy: 140ms cubic-bezier(0.2, 0, 0, 1);
412
+
413
+ --bg: var(--bg-canvas);
414
+ --card: var(--bg-surface);
415
+ --card-alt: var(--bg-elevated);
416
+ --border: var(--hairline);
417
+ --fg: var(--text-primary);
418
+ --muted: var(--text-muted);
419
+ --good: var(--status-nominal);
420
+ --warn: var(--status-warning);
421
+ --bad: var(--status-critical);
422
+ --accent: var(--accent-focus);
423
+ --ring-track: var(--bg-elevated);
407
424
  }
408
425
  @media (prefers-color-scheme: light) {
409
426
  :root {
410
427
  color-scheme: light;
411
- --bg: #f6f8fa;
412
- --card: #ffffff;
413
- --card-alt: #f3f4f6;
414
- --border: #d0d7de;
415
- --fg: #1f2328;
416
- --muted: #57606a;
417
- --good: #116329;
418
- --warn: #7d4e00;
419
- --bad: #cf222e;
420
- --accent: #0550ae;
421
- --ring-track: rgba(31, 35, 40, 0.10);
428
+ --bg-canvas: #F8F9FA;
429
+ --bg-surface: #FFFFFF;
430
+ --bg-elevated: #F1F3F4;
431
+ --hairline: rgba(0, 0, 0, 0.08);
432
+ --text-primary: #111315;
433
+ --text-secondary: #3C4043;
434
+ --text-muted: #5F6368;
435
+ --status-critical: #D93025;
436
+ --status-warning: #B06000;
437
+ --status-nominal: #137333;
438
+ --accent-focus: #1A73E8;
422
439
  }
423
440
  .ah-wordmark { filter: invert(1) brightness(0.14); }
424
441
  }
442
+ [data-theme="light"] {
443
+ color-scheme: light;
444
+ --bg-canvas: #F8F9FA;
445
+ --bg-surface: #FFFFFF;
446
+ --bg-elevated: #F1F3F4;
447
+ --hairline: rgba(0, 0, 0, 0.08);
448
+ --text-primary: #111315;
449
+ --text-secondary: #3C4043;
450
+ --text-muted: #5F6368;
451
+ --status-critical: #D93025;
452
+ --status-warning: #B06000;
453
+ --status-nominal: #137333;
454
+ --accent-focus: #1A73E8;
455
+ }
456
+ [data-theme="light"] .ah-wordmark { filter: invert(1) brightness(0.14); }
425
457
  * { box-sizing: border-box; }
426
458
  body {
427
459
  margin: 0;
428
- padding: 8px 10px;
429
- background: var(--bg);
430
- color: var(--fg);
431
- font: 12px/1.38 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
460
+ padding: 8px 12px;
461
+ background: var(--bg-canvas);
462
+ color: var(--text-primary);
463
+ font: 12px/1.4 var(--font-sans);
432
464
  font-variant-numeric: tabular-nums;
465
+ -webkit-font-smoothing: antialiased;
433
466
  }
434
467
  .ah-wrap {
435
468
  max-width: 420px;
436
469
  margin: 0 auto;
437
470
  display: flex;
438
471
  flex-direction: column;
439
- gap: 6px;
472
+ gap: 4px;
440
473
  }
441
474
  .ah-view-radio {
442
475
  position: absolute;
@@ -449,41 +482,43 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
449
482
  justify-content: space-between;
450
483
  gap: 6px;
451
484
  padding-bottom: 4px;
452
- border-bottom: 1px solid var(--border);
485
+ border-bottom: 1px solid var(--hairline);
453
486
  }
454
- .ah-brand-sub { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
487
+ .ah-brand-sub { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
455
488
  .ah-brand {
456
489
  display: flex;
457
- flex-direction: column;
458
- align-items: flex-start;
490
+ flex-direction: row;
491
+ align-items: baseline;
492
+ flex-wrap: wrap;
459
493
  min-width: 0;
460
- color: var(--fg);
494
+ color: var(--text-primary);
461
495
  }
462
- .ah-wordmark { height: 26px; width: auto; max-width: 100%; object-fit: contain; display: block; }
496
+ .ah-wordmark { height: 20px; width: auto; max-width: 100%; object-fit: contain; display: block; }
463
497
  .ah-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
464
- .ah-logo { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; display: block; box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.3); }
498
+ .ah-logo { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; display: block; }
465
499
  .ah-tabs.ah-tabs-row { display: flex; }
466
500
  .ah-tabs-row .ah-tab-label { flex: 1 1 0; text-align: center; }
467
501
  .ah-tabs {
468
502
  display: inline-flex;
469
- background: var(--card);
470
- border: 1px solid var(--border);
471
- border-radius: 5px;
472
- padding: 1px;
503
+ background: var(--bg-surface);
504
+ border: 1px solid var(--hairline);
505
+ border-radius: 6px;
506
+ padding: 2px;
473
507
  }
474
508
  .ah-tab-label {
475
509
  padding: 2px 8px;
476
- font-size: 11px;
510
+ font-size: 10.5px;
477
511
  font-weight: 600;
478
- color: var(--muted);
512
+ color: var(--text-muted);
479
513
  border-radius: 4px;
480
514
  cursor: pointer;
481
515
  user-select: none;
516
+ transition: opacity var(--ease-snappy);
482
517
  }
483
518
  #viewModeSimple:checked ~ .ah-wrap .ah-tabs label[for="viewModeSimple"],
484
519
  #viewModeAdvanced:checked ~ .ah-wrap .ah-tabs label[for="viewModeAdvanced"] {
485
- background: var(--card-alt);
486
- color: var(--fg);
520
+ background: var(--bg-elevated);
521
+ color: var(--text-primary);
487
522
  }
488
523
  #viewModeSimple:checked ~ .ah-wrap #advancedViewContainer {
489
524
  display: none;
@@ -494,32 +529,29 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
494
529
  #simpleViewContainer {
495
530
  display: flex;
496
531
  flex-direction: column;
497
- gap: 8px;
532
+ gap: 0;
498
533
  }
499
534
  .ah-card {
500
- background: var(--card);
501
- border: 1px solid var(--border);
502
- border-radius: 10px;
503
- padding: 10px 12px;
535
+ background: var(--bg-surface);
536
+ border: 1px solid var(--hairline);
537
+ border-radius: 6px;
538
+ padding: 8px 10px;
504
539
  }
505
- /* Option A+ Hybrid Apple Bento Card styling (preserves #simpleViewContainer .ah-card selector) */
540
+ /* Full-bleed 1px hairline telemetry rows (preserves #simpleViewContainer .ah-card selector) */
506
541
  #simpleViewContainer .ah-card {
507
- background: var(--card);
508
- border: 1px solid var(--border);
509
- border-radius: 10px;
510
- padding: 10px 12px;
542
+ background: transparent;
543
+ border: 0;
544
+ border-bottom: 1px solid var(--hairline);
545
+ border-radius: 0;
546
+ padding: 8px 0;
511
547
  margin-bottom: 0;
512
548
  }
513
- .ah-card[data-severity="healthy"] { border-left: 3px solid var(--good); }
514
- .ah-card[data-severity="warn"] { border-left: 3px solid var(--warn); }
515
- .ah-card[data-severity="critical"] { border-left: 3px solid var(--bad); }
516
- .ah-card[data-hold="true"] { border-left: 3px solid var(--accent); }
517
549
  .ah-verdict-row {
518
550
  display: flex;
519
551
  align-items: center;
520
552
  justify-content: space-between;
521
553
  gap: 6px;
522
- margin-bottom: 8px;
554
+ margin-bottom: 4px;
523
555
  }
524
556
  .ah-verdict-left {
525
557
  display: flex;
@@ -533,12 +565,13 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
533
565
  border-radius: 50%;
534
566
  flex-shrink: 0;
535
567
  }
536
- .ah-dot-healthy { background: var(--good); }
537
- .ah-dot-warn { background: var(--warn); }
538
- .ah-dot-critical { background: var(--bad); }
568
+ .ah-dot-healthy { background: var(--text-secondary); }
569
+ .ah-dot-warn { background: var(--status-warning); }
570
+ .ah-dot-critical { background: var(--status-critical); }
539
571
  .ah-verdict-title {
540
- font-size: 11px;
541
- font-weight: 700;
572
+ font-size: 12px;
573
+ font-weight: 600;
574
+ color: var(--text-primary);
542
575
  white-space: nowrap;
543
576
  overflow: hidden;
544
577
  text-overflow: ellipsis;
@@ -546,160 +579,168 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
546
579
  .ah-pills {
547
580
  display: flex;
548
581
  flex-wrap: nowrap;
549
- align-items: flex-start;
550
- gap: 6px;
582
+ align-items: center;
583
+ gap: 5px;
551
584
  width: 100%;
552
585
  min-width: 0;
586
+ padding: 4px 0 6px;
587
+ border-bottom: 1px solid var(--hairline);
553
588
  }
554
589
  #modelBadge { flex-shrink: 1; margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
555
590
  .ah-pill {
591
+ font-family: var(--font-mono);
556
592
  font-size: 10px;
557
- font-weight: 600;
593
+ font-weight: 500;
558
594
  font-variant-numeric: tabular-nums;
559
595
  box-sizing: border-box;
560
596
  height: 20px;
561
597
  line-height: 18px;
562
598
  white-space: nowrap;
563
599
  flex-shrink: 0;
564
- padding: 0 8px;
565
- border-radius: 999px;
566
- background: var(--card-alt);
567
- border: 1px solid var(--border);
568
- color: var(--muted);
600
+ padding: 0 6px;
601
+ border-radius: 4px;
602
+ background: var(--bg-surface);
603
+ border: 1px solid var(--hairline);
604
+ color: var(--text-secondary);
569
605
  }
570
606
  .ah-pill-risk {
571
- color: var(--warn);
572
- border-color: rgba(210, 153, 34, 0.45);
607
+ color: var(--status-critical);
608
+ border-color: var(--status-critical);
609
+ font-weight: 600;
573
610
  }
574
611
  .ah-verdict-sub {
575
- font-size: 11px;
576
- color: var(--muted);
577
- margin-top: 4px;
612
+ font-size: 10.5px;
613
+ color: var(--text-secondary);
614
+ margin-top: 3px;
578
615
  white-space: nowrap;
579
616
  overflow: hidden;
580
617
  text-overflow: ellipsis;
581
618
  }
582
- /* Runway Hero + Watch Cache Ring */
619
+ /* Runway Hero + 1D Prompt Cache BulletBar (Zero Radial Gauge Chartjunk) */
583
620
  .ah-hero-row {
584
621
  display: grid;
585
622
  grid-template-columns: minmax(0, 1fr) auto;
586
- align-items: center;
623
+ align-items: end;
587
624
  gap: 10px;
588
- margin-bottom: 8px;
625
+ margin-bottom: 6px;
589
626
  }
590
627
  .ah-runway-hero {
591
- font-size: 18px;
592
- font-weight: 750;
593
- letter-spacing: -0.02em;
594
- line-height: 1.15;
595
- color: var(--fg);
628
+ font-size: 15px;
629
+ font-weight: 600;
630
+ letter-spacing: -0.015em;
631
+ line-height: 1.2;
632
+ color: var(--text-primary);
596
633
  font-variant-numeric: tabular-nums;
597
634
  }
598
- .ah-runway-hero[data-level="bad"] { color: var(--bad); }
599
- .ah-runway-hero[data-level="warn"] { color: var(--warn); }
600
- .ah-runway-hero[data-level="good"] { color: var(--good); }
635
+ .ah-runway-hero[data-level="bad"] { color: var(--status-critical); }
636
+ .ah-runway-hero[data-level="warn"] { color: var(--status-warning); }
637
+ .ah-runway-hero[data-level="good"] { color: var(--text-primary); }
601
638
  .ah-runway-sub {
602
- font-size: 11px;
603
- color: var(--muted);
604
- margin-top: 2px;
639
+ font-family: var(--font-mono);
640
+ font-size: 10.5px;
641
+ color: var(--text-secondary);
642
+ margin-top: 1px;
605
643
  font-variant-numeric: tabular-nums;
606
644
  }
645
+ .ah-ring-col { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
646
+ .ah-ring-cap { font-size: 9.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; line-height: 1.1; }
607
647
  .ah-cache-ring-wrap {
608
- position: relative;
609
- width: 48px;
610
- height: 48px;
611
648
  display: flex;
612
- align-items: center;
613
- justify-content: center;
649
+ flex-direction: column;
650
+ align-items: flex-end;
651
+ gap: 3px;
614
652
  flex-shrink: 0;
615
653
  }
616
- .ah-cache-ring-svg {
617
- width: 48px;
618
- height: 48px;
619
- transform: rotate(-90deg);
654
+ .ah-ring-center {
655
+ display: inline-flex;
656
+ align-items: baseline;
657
+ gap: 5px;
658
+ font-family: var(--font-mono);
659
+ line-height: 1.1;
660
+ font-variant-numeric: tabular-nums;
620
661
  }
621
- .ah-ring-bg {
622
- fill: none;
623
- stroke: var(--ring-track);
624
- stroke-width: 4;
662
+ .ah-ring-pct { font-size: 11px; font-weight: 600; color: var(--text-primary); }
663
+ .ah-ring-ttl { font-size: 10px; color: var(--text-secondary); }
664
+ .ah-cache-bullet {
665
+ position: relative;
666
+ width: 68px;
667
+ height: 6px;
668
+ background: var(--bg-elevated);
669
+ border: 1px solid var(--hairline);
670
+ border-radius: 2px;
671
+ overflow: hidden;
625
672
  }
626
- .ah-ring-fg {
627
- fill: none;
628
- stroke: var(--muted);
629
- stroke-width: 4;
630
- stroke-linecap: round;
673
+ .ah-cache-bullet-fill {
674
+ height: 100%;
675
+ background: var(--text-secondary);
676
+ transition: width var(--ease-snappy);
631
677
  }
632
- .ah-cache-ring-wrap[data-warm="true"] .ah-ring-fg { stroke: var(--good); }
633
- .ah-cache-ring-wrap[data-expiring="true"] .ah-ring-fg { stroke: var(--warn); }
634
- .ah-ring-center {
678
+ .ah-cache-ring-wrap[data-warm="true"] .ah-cache-bullet-fill { background: var(--status-nominal); }
679
+ .ah-cache-ring-wrap[data-expiring="true"] .ah-cache-bullet-fill { background: var(--status-warning); }
680
+ .ah-cache-bullet-tick {
635
681
  position: absolute;
636
- inset: 0;
637
- display: flex;
638
- flex-direction: column;
639
- align-items: center;
640
- justify-content: center;
641
- line-height: 1.05;
642
- font-variant-numeric: tabular-nums;
643
- }
644
- .ah-ring-pct { font-size: 10.5px; font-weight: 700; color: var(--fg); }
645
- .ah-ring-ttl { font-size: 8.5px; color: var(--muted); }
646
- .ah-ring-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
647
- .ah-ring-cap { font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; line-height: 1.1; }
648
- .ah-sec-blurb { font-size: 10px; line-height: 1.35; color: var(--muted); margin: 0 0 6px 0; overflow-wrap: anywhere; }
649
- .ah-sec-name.ah-sec-gap { margin-top: 14px; }
650
- .ah-sec-name { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg); line-height: 1.2; margin: 0 0 1px 0; }
682
+ top: 0;
683
+ bottom: 0;
684
+ left: 80%;
685
+ width: 1.5px;
686
+ background: var(--text-muted);
687
+ }
688
+ .ah-sec-blurb { font-size: 10px; line-height: 1.3; color: var(--text-muted); margin: 0 0 4px 0; overflow-wrap: anywhere; }
689
+ .ah-sec-name.ah-sec-gap { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--hairline); }
690
+ .ah-sec-name { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); line-height: 1.2; margin: 0 0 2px 0; }
651
691
  @media (max-height: 580px) { .ah-sec-blurb { display: none; } }
652
- /* Clean Horizon Bar + Legend */
692
+ /* Clean 40-Cell 1D Horizon Bar + Quantitative Legend */
653
693
  .ah-grid-bar {
654
694
  display: grid;
655
695
  grid-template-columns: repeat(40, 1fr);
656
696
  gap: 1px;
657
- height: 8px;
658
- border-radius: 999px;
697
+ height: 7px;
698
+ border-radius: 2px;
659
699
  overflow: hidden;
660
- background: var(--ring-track);
700
+ background: var(--bg-elevated);
701
+ border: 1px solid var(--hairline);
661
702
  }
662
703
  .ah-cell { display: block; height: 100%; }
663
704
  .ah-ruler {
664
705
  display: flex;
665
706
  justify-content: space-between;
707
+ font-family: var(--font-mono);
666
708
  font-size: 9.5px;
667
709
  font-variant-numeric: tabular-nums;
668
- color: var(--muted);
669
- margin-top: 3px;
710
+ color: var(--text-muted);
711
+ margin-top: 2px;
670
712
  }
671
713
  .ah-bar-legend {
672
714
  display: flex;
673
715
  align-items: center;
674
716
  justify-content: space-between;
675
717
  gap: 8px;
676
- margin-top: 6px;
718
+ margin-top: 4px;
677
719
  font-size: 10.5px;
678
- color: var(--muted);
720
+ color: var(--text-secondary);
679
721
  font-variant-numeric: tabular-nums;
680
722
  }
681
- .ah-bar-legend strong { color: var(--fg); font-weight: 650; }
723
+ .ah-bar-legend strong { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }
682
724
  .ah-top-offender {
683
- margin-top: 6px;
684
- padding-top: 6px;
685
- border-top: 1px solid var(--border);
725
+ margin-top: 4px;
726
+ font-family: var(--font-mono);
686
727
  font-size: 10.5px;
687
728
  font-variant-numeric: tabular-nums;
688
- color: var(--fg);
729
+ color: var(--text-primary);
689
730
  white-space: nowrap;
690
731
  overflow: hidden;
691
732
  text-overflow: ellipsis;
692
733
  }
693
- .ah-offender-kicker { font-weight: 700; color: var(--warn); }
734
+ .ah-offender-kicker { font-family: var(--font-sans); font-weight: 600; color: var(--status-warning); }
694
735
  .ah-hogs-drawer {
695
736
  margin-top: 4px;
696
- font-size: 10px;
697
- color: var(--muted);
737
+ font-size: 10.5px;
738
+ color: var(--text-secondary);
698
739
  }
699
740
  .ah-hogs-drawer summary {
700
741
  cursor: pointer;
701
- color: var(--accent);
702
- font-weight: 600;
742
+ color: var(--text-secondary);
743
+ font-weight: 500;
703
744
  }
704
745
  .ah-hog-row {
705
746
  display: flex;
@@ -707,62 +748,76 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
707
748
  justify-content: space-between;
708
749
  gap: 6px;
709
750
  padding: 3px 0;
710
- border-bottom: 1px dashed var(--border);
751
+ border-bottom: 1px solid var(--hairline);
711
752
  }
712
753
  .ah-hog-row:last-child { border-bottom: none; }
713
- .ah-hog-name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
714
- .ah-hog-meta { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
715
- /* Zone 3: Check-Run Action Card */
754
+ .ah-hog-name { font-family: var(--font-mono); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
755
+ .ah-hog-meta { font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
756
+ /* Primary Remediation ActionPill (28px Tactile Control) */
716
757
  .ah-action-hdr {
717
758
  display: flex;
718
759
  align-items: center;
719
760
  justify-content: space-between;
720
- gap: 6px;
721
- font-size: 11.5px;
722
- font-weight: 700;
761
+ gap: 8px;
762
+ font-size: 11px;
763
+ font-weight: 600;
764
+ color: var(--text-primary);
723
765
  }
724
766
  .ah-action-instr {
725
- margin-top: 5px;
726
- font-size: 11px;
727
- color: var(--fg);
728
- background: var(--card-alt);
729
- padding: 5px 8px;
730
- border-radius: 6px;
731
- border: 1px solid var(--border);
732
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
767
+ margin-top: 4px;
768
+ font-size: 10.5px;
769
+ color: var(--text-secondary);
770
+ font-family: var(--font-mono);
733
771
  }
734
772
  .ah-action-reclaim {
773
+ font-family: var(--font-mono);
735
774
  font-size: 10px;
736
775
  font-variant-numeric: tabular-nums;
737
- color: var(--good);
738
- font-weight: 600;
776
+ color: var(--text-secondary);
777
+ font-weight: 500;
778
+ margin-left: auto;
739
779
  }
740
780
  .ah-btn-copy-compact {
741
781
  cursor: pointer;
742
- border-radius: 6px;
743
- border: 1px solid var(--good);
744
- background: rgba(46, 160, 67, 0.14);
745
- color: var(--fg);
746
- font-size: 10.5px;
747
- font-weight: 650;
748
- padding: 3px 8px;
782
+ min-height: var(--control-height);
783
+ border-radius: var(--control-radius);
784
+ border: 1px solid var(--hairline);
785
+ background: var(--bg-elevated);
786
+ color: var(--text-primary);
787
+ font-family: var(--font-sans);
788
+ font-size: 11px;
789
+ font-weight: 600;
790
+ padding: 4px 10px;
749
791
  flex-shrink: 0;
792
+ transition: opacity var(--ease-snappy), transform var(--ease-snappy);
793
+ }
794
+ .ah-btn-copy-compact:hover { opacity: 0.9; }
795
+ .ah-btn-copy-compact:active { transform: scale(0.985); }
796
+ #priorityActionCard[data-severity="warn"][data-hold="false"] .ah-btn-copy-compact {
797
+ background: var(--accent-focus);
798
+ border-color: var(--accent-focus);
799
+ color: #FFFFFF;
800
+ }
801
+ #priorityActionCard[data-severity="critical"] .ah-btn-copy-compact {
802
+ background: var(--status-critical);
803
+ border-color: var(--status-critical);
804
+ color: #FFFFFF;
750
805
  }
751
806
  details.ah-overflow {
752
- margin-top: 6px;
807
+ margin-top: 5px;
753
808
  font-size: 10.5px;
754
- color: var(--muted);
809
+ color: var(--text-secondary);
755
810
  }
756
811
  details.ah-overflow summary {
757
812
  cursor: pointer;
758
- color: var(--accent);
759
- font-weight: 600;
813
+ color: var(--text-secondary);
814
+ font-weight: 500;
760
815
  }
761
- /* Zone 4+5: Unified Session Activity + Saved Diff Pill */
816
+ /* Session Activity + Saved Quantitative Row */
762
817
  .ah-flight {
763
818
  display: flex;
764
819
  flex-direction: column;
765
- gap: 8px;
820
+ gap: 6px;
766
821
  }
767
822
  .ah-fr-topbar {
768
823
  display: flex;
@@ -772,106 +827,107 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
772
827
  flex-wrap: wrap;
773
828
  }
774
829
  .ah-fr-title {
775
- font-size: 13px;
776
- font-weight: 700;
777
- letter-spacing: 0.06em;
778
- color: var(--fg);
830
+ font-size: 10.5px;
831
+ font-weight: 600;
832
+ letter-spacing: 0.04em;
833
+ text-transform: uppercase;
834
+ color: var(--text-secondary);
779
835
  }
780
836
  .ah-saved-pill-wrap {
781
837
  margin-left: auto;
782
838
  }
783
839
  .ah-saved-pill {
784
840
  display: inline-flex;
785
- align-items: center;
841
+ align-items: baseline;
786
842
  gap: 6px;
787
843
  cursor: pointer;
788
844
  list-style: none;
789
- padding: 2px 8px;
790
- border-radius: 999px;
791
- background: rgba(46, 160, 67, 0.12);
792
- border: 1px solid rgba(46, 160, 67, 0.32);
845
+ padding: 2px 6px;
846
+ border-radius: 4px;
847
+ background: var(--bg-surface);
848
+ border: 1px solid var(--hairline);
849
+ font-family: var(--font-mono);
793
850
  font-size: 10.5px;
794
851
  font-variant-numeric: tabular-nums;
795
852
  }
796
853
  .ah-saved-pill::-webkit-details-marker { display: none; }
797
- .ah-saved-kicker { color: var(--good); font-weight: 700; font-size: 9.5px; text-transform: uppercase; }
798
- .ah-saved-num { color: var(--fg); font-weight: 700; }
799
- .ah-saved-30d { color: var(--muted); font-size: 9.5px; }
854
+ .ah-saved-kicker { font-family: var(--font-sans); color: var(--text-secondary); font-weight: 600; font-size: 10px; }
855
+ .ah-saved-num { color: var(--text-primary); font-weight: 600; }
856
+ .ah-saved-30d { color: var(--text-muted); font-size: 10px; }
800
857
  .ah-saved-why {
801
- margin-top: 6px;
858
+ margin-top: 5px;
802
859
  padding: 6px 8px;
803
- border-radius: 6px;
804
- background: var(--card-alt);
805
- border: 1px solid var(--border);
860
+ border-radius: 4px;
861
+ background: var(--bg-surface);
862
+ border: 1px solid var(--hairline);
806
863
  font-size: 10px;
807
864
  display: flex;
808
865
  flex-direction: column;
809
866
  gap: 3px;
810
867
  }
811
- .ah-saved-driver { color: var(--muted); font-weight: 600; }
812
- .ah-saved-cat-row { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
868
+ .ah-saved-driver { color: var(--text-secondary); font-weight: 600; }
869
+ .ah-saved-cat-row { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
813
870
  .ah-fr-zones-body {
814
871
  display: flex;
815
872
  flex-direction: column;
816
- gap: 8px;
873
+ gap: 6px;
817
874
  }
818
875
  .ah-fr-zone { display: flex; flex-direction: column; min-height: 0; }
819
- .ah-fr-head > span:first-child { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--fg); }
876
+ .ah-fr-head > span:first-child { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
820
877
  .ah-fr-head {
821
878
  display: flex;
822
879
  align-items: center;
823
880
  justify-content: space-between;
824
881
  gap: 6px;
825
882
  font-size: 9.5px;
826
- font-weight: 650;
827
- letter-spacing: 0.05em;
828
- color: var(--muted);
883
+ font-weight: 500;
884
+ color: var(--text-muted);
829
885
  white-space: nowrap;
830
886
  font-variant-numeric: tabular-nums;
831
887
  }
832
- .ah-fr-count { font-size: 10px; color: var(--fg); font-weight: 700; }
888
+ .ah-fr-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-primary); font-weight: 600; }
833
889
  .ah-fr-legend { display: inline-flex; align-items: center; gap: 3px 6px; font-weight: 500; }
834
- .ah-lg { display: inline-block; width: 7px; height: 7px; border-radius: 2px; }
835
- .ah-lg-good { background: var(--good); }
836
- .ah-lg-bad { background: var(--bad); }
837
- .ah-lg-limit { height: 0; width: 9px; border-radius: 0; border-top: 1px dashed var(--bad); }
890
+ .ah-lg { display: inline-block; width: 6px; height: 6px; border-radius: 1px; }
891
+ .ah-lg-good { background: var(--text-secondary); }
892
+ .ah-lg-bad { background: var(--status-critical); }
893
+ .ah-lg-limit { height: 0; width: 8px; border-radius: 0; border-top: 1px dashed var(--text-muted); }
838
894
  .ah-tl-chart {
839
895
  position: relative;
840
896
  display: flex;
841
897
  align-items: flex-end;
842
898
  gap: 2px;
843
899
  height: clamp(56px, 12vh, 84px);
844
- margin-top: 4px;
845
- border-bottom: 1px solid var(--border);
900
+ margin-top: 3px;
901
+ border-bottom: 1px solid var(--hairline);
846
902
  }
847
903
  .ah-tl-slot { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
848
- .ah-tl-bar { display: block; width: 100%; min-height: 2px; border-radius: 2px 2px 0 0; }
849
- .ah-tl-bar.ah-tl-good { background: var(--good); opacity: 0.85; }
850
- .ah-tl-bar.ah-tl-bad { background: var(--bad); }
851
- .ah-tl-bar.ah-tl-neutral { background: var(--muted); opacity: 0.65; }
852
- .ah-tl-empty .ah-tl-bar { height: 2px; background: var(--ring-track); }
853
- .ah-tl-earlier .ah-tl-bar { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 4px); }
904
+ .ah-tl-bar { display: block; width: 100%; min-height: 2px; border-radius: 1px 1px 0 0; }
905
+ .ah-tl-bar.ah-tl-good { background: var(--text-secondary); opacity: 0.75; }
906
+ .ah-tl-bar.ah-tl-bad { background: var(--status-critical); }
907
+ .ah-tl-bar.ah-tl-neutral { background: var(--text-muted); opacity: 0.5; }
908
+ .ah-tl-empty .ah-tl-bar { height: 2px; background: var(--bg-elevated); }
909
+ .ah-tl-earlier .ah-tl-bar { background: repeating-linear-gradient(135deg, var(--text-muted) 0 2px, transparent 2px 4px); }
854
910
  .ah-tl-line { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
855
- .ah-tl-poly-svg { color: var(--fg); opacity: 0.8; }
856
- .ah-tl-limit-svg { color: var(--bad); opacity: 0.7; }
857
- .ah-tl-markers { display: flex; gap: 2px; height: 11px; margin-top: 2px; font-size: 8.5px; line-height: 11px; color: var(--muted); }
911
+ .ah-tl-poly-svg { color: var(--text-primary); opacity: 0.85; }
912
+ .ah-tl-limit-svg { color: var(--text-muted); opacity: 0.7; }
913
+ .ah-tl-markers { display: flex; gap: 2px; height: 11px; margin-top: 2px; font-size: 8.5px; line-height: 11px; color: var(--text-muted); }
858
914
  .ah-tl-mk { flex: 1 1 0; min-width: 0; text-align: center; overflow: hidden; }
859
915
  .ah-tl-detail {
860
916
  min-height: 14px;
861
917
  margin-top: 2px;
862
918
  font-size: 10px;
863
- color: var(--muted);
919
+ color: var(--text-secondary);
864
920
  white-space: nowrap;
865
921
  overflow: hidden;
866
922
  text-overflow: ellipsis;
867
923
  font-variant-numeric: tabular-nums;
868
924
  }
869
- .ah-tl-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--muted); }
870
- .ah-tl-dot.ah-tl-good { background: var(--good); }
871
- .ah-tl-dot.ah-tl-bad { background: var(--bad); }
872
- .ah-fx-list { margin-top: 4px; font-variant-numeric: tabular-nums; }
873
- .ah-fx-empty { padding: 4px 0; font-size: 10.5px; color: var(--muted); }
874
- .ah-fx-row { border-bottom: 1px dashed var(--border); font-size: 10.5px; }
925
+ .ah-tl-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--text-muted); }
926
+ .ah-tl-dot.ah-tl-good { background: var(--text-secondary); }
927
+ .ah-tl-dot.ah-tl-bad { background: var(--status-critical); }
928
+ .ah-fx-list { margin-top: 3px; font-variant-numeric: tabular-nums; }
929
+ .ah-fx-empty { padding: 3px 0; font-size: 10.5px; color: var(--text-muted); }
930
+ .ah-fx-row { border-bottom: 1px solid var(--hairline); font-size: 10.5px; }
875
931
  .ah-fx-row:last-of-type { border-bottom: none; }
876
932
  .ah-fx-row summary {
877
933
  display: grid;
@@ -883,24 +939,24 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
883
939
  list-style: none;
884
940
  }
885
941
  .ah-fx-row summary::-webkit-details-marker { display: none; }
886
- .ah-fx-turn { color: var(--muted); }
887
- .ah-fx-label { color: var(--fg); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
888
- .ah-fx-mult { font-size: 9px; padding: 0 4px; border-radius: 999px; background: var(--card-alt); border: 1px solid var(--border); color: var(--muted); }
889
- .ah-fx-detail { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
890
- .ah-fx-saved { color: var(--good); font-weight: 650; }
891
- .ah-fx-more { padding: 0 0 4px 32px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
892
- .ah-fx-overflow summary { cursor: pointer; font-size: 10px; color: var(--accent); padding: 3px 0; }
942
+ .ah-fx-turn { font-family: var(--font-mono); color: var(--text-muted); }
943
+ .ah-fx-label { color: var(--text-primary); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
944
+ .ah-fx-mult { font-family: var(--font-mono); font-size: 9px; padding: 0 4px; border-radius: 4px; background: var(--bg-elevated); border: 1px solid var(--hairline); color: var(--text-secondary); }
945
+ .ah-fx-detail { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
946
+ .ah-fx-saved { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }
947
+ .ah-fx-more { padding: 0 0 4px 32px; font-size: 10px; color: var(--text-muted); overflow-wrap: anywhere; }
948
+ .ah-fx-overflow summary { cursor: pointer; font-size: 10px; color: var(--text-secondary); padding: 3px 0; }
893
949
  .ah-fx-rail-armed {
894
950
  display: flex;
895
951
  align-items: center;
896
952
  gap: 6px;
897
- padding-top: 5px;
898
- margin-top: 4px;
899
- border-top: 1px dashed var(--border);
953
+ padding-top: 4px;
954
+ margin-top: 3px;
955
+ border-top: 1px solid var(--hairline);
900
956
  font-size: 10px;
901
- color: var(--muted);
957
+ color: var(--text-muted);
902
958
  }
903
- .ah-rail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
959
+ .ah-rail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-nominal); flex-shrink: 0; }
904
960
  @media (max-height: 580px) {
905
961
  #simpleViewContainer[data-verdict-state="healthy"] .ah-fr-zones-body {
906
962
  display: none;
@@ -989,17 +1045,17 @@ export function renderHorizonPanelHtml(state = {}, options = {}) {
989
1045
  <div class="ah-runway-sub" id="simpleRunwaySub">${escapeHtml(runwaySub)}</div>
990
1046
  </div>
991
1047
  <div class="ah-ring-col">
1048
+ <span class="ah-ring-cap">Prompt cache</span>
992
1049
  <div class="ah-cache-ring-wrap" id="simpleCacheRingWrap" role="img" aria-label="Prompt cache" data-warm="${ringWarm ? 'true' : 'false'}" data-expiring="${ringExpiring ? 'true' : 'false'}" title="Prompt cache ${ringWarm ? `warm ${metrics.ttlClock} (${metrics.ttlTier})` : 'cold'} · ${metrics.cacheHitPct}% hit. 'hit' = share of your prompt served from cache at a discount; 'warm' = time left before the cache expires and the next turn costs full price.">
993
- <svg class="ah-cache-ring-svg" viewBox="0 0 48 48" aria-hidden="true">
994
- <circle class="ah-ring-bg" cx="24" cy="24" r="19"/>
995
- <circle class="ah-ring-fg" cx="24" cy="24" r="19" stroke-dasharray="119.38" stroke-dashoffset="${escapeHtml(ringDashOffset)}"/>
996
- </svg>
997
1050
  <div class="ah-ring-center">
998
1051
  <span class="ah-ring-pct" id="simpleCacheRingPct">${metrics.cacheHitPct}%</span>
999
1052
  <span class="ah-ring-ttl" id="simpleCacheRingTtl">${escapeHtml(metrics.cacheWarm ? metrics.ttlCompact : 'cold')}</span>
1000
1053
  </div>
1054
+ <div class="ah-cache-bullet" aria-hidden="true">
1055
+ <div class="ah-cache-bullet-fill" style="width:${Math.max(0, Math.min(100, Number(metrics.cacheHitPct) || 0))}%"></div>
1056
+ <div class="ah-cache-bullet-tick" title="80% cache hit target"></div>
1057
+ </div>
1001
1058
  </div>
1002
- <span class="ah-ring-cap">Prompt cache</span>
1003
1059
  </div>
1004
1060
  </div>
1005
1061