diff --git a/hive-c0re/assets/app.js b/hive-c0re/assets/app.js index 91c3a21..7a042e7 100644 --- a/hive-c0re/assets/app.js +++ b/hive-c0re/assets/app.js @@ -3,6 +3,13 @@ // and tails the unified dashboard event channel over `/dashboard/stream`. (() => { + // ─── constants ────────────────────────────────────────────────────────── + // Context-window token thresholds — mirror the harness compaction watermarks + // in hive-ag3nt (HIVE_COMPACT_WATERMARK_TOKENS = 150k; auto-reset at 100k). + // TODO: source these from model metadata once damocles lands that feature. + const CTX_WARN_TOKENS = 150_000; // ≥ this → compact territory (red) + const CTX_CAUTION_TOKENS = 100_000; // ≥ this → approaching reset (yellow) + // ─── helpers ──────────────────────────────────────────────────────────── const $ = (id) => document.getElementById(id); const esc = (s) => String(s).replace(/[&<>"]/g, (c) => @@ -551,12 +558,9 @@ `⏰ ${c.pending_reminders}`)); } if (c.ctx_tokens != null) { - // Colour thresholds mirror the harness compaction watermarks: - // < 100k = safe (green), 100k–150k = approaching reset (yellow), - // ≥ 150k = compact territory (red). const k = Math.round(c.ctx_tokens / 1000); - const ctxClass = c.ctx_tokens >= 150_000 ? 'badge-ctx-warn' - : c.ctx_tokens >= 100_000 ? 'badge-ctx-caution' + const ctxClass = c.ctx_tokens >= CTX_WARN_TOKENS ? 'badge-ctx-warn' + : c.ctx_tokens >= CTX_CAUTION_TOKENS ? 'badge-ctx-caution' : 'badge-ctx-ok'; head.append(el('span', {