ctxloop 0.3.1__tar.gz → 0.3.2__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.
Files changed (46) hide show
  1. {ctxloop-0.3.1/src/ctxloop.egg-info → ctxloop-0.3.2}/PKG-INFO +1 -1
  2. {ctxloop-0.3.1 → ctxloop-0.3.2}/pyproject.toml +1 -1
  3. {ctxloop-0.3.1 → ctxloop-0.3.2/src/ctxloop.egg-info}/PKG-INFO +1 -1
  4. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/__init__.py +1 -1
  5. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/dashboard.py +32 -32
  6. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_integrations.py +4 -0
  7. {ctxloop-0.3.1 → ctxloop-0.3.2}/LICENSE +0 -0
  8. {ctxloop-0.3.1 → ctxloop-0.3.2}/NOTICE +0 -0
  9. {ctxloop-0.3.1 → ctxloop-0.3.2}/README.md +0 -0
  10. {ctxloop-0.3.1 → ctxloop-0.3.2}/setup.cfg +0 -0
  11. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop/__init__.py +0 -0
  12. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop/__main__.py +0 -0
  13. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop.egg-info/SOURCES.txt +0 -0
  14. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop.egg-info/dependency_links.txt +0 -0
  15. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop.egg-info/entry_points.txt +0 -0
  16. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop.egg-info/requires.txt +0 -0
  17. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/ctxloop.egg-info/top_level.txt +0 -0
  18. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/__main__.py +0 -0
  19. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/ab.py +0 -0
  20. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/baseline.py +0 -0
  21. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/bench.py +0 -0
  22. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/cli.py +0 -0
  23. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/engine.py +0 -0
  24. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/hooks.py +0 -0
  25. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/installer.py +0 -0
  26. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/ledger.py +0 -0
  27. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/mcp_server.py +0 -0
  28. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/memory_client.py +0 -0
  29. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/memory_eval.py +0 -0
  30. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/probe.py +0 -0
  31. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/project.py +0 -0
  32. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/py.typed +0 -0
  33. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/retrieval.py +0 -0
  34. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/router.py +0 -0
  35. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/semantic.py +0 -0
  36. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/shellfilter.py +0 -0
  37. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/slicer.py +0 -0
  38. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/tokens.py +0 -0
  39. {ctxloop-0.3.1 → ctxloop-0.3.2}/src/graphsnip/usage.py +0 -0
  40. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_core.py +0 -0
  41. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_memory_client.py +0 -0
  42. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_memory_cross_runtime.py +0 -0
  43. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_memory_eval.py +0 -0
  44. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_memory_integration.py +0 -0
  45. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_refresh.py +0 -0
  46. {ctxloop-0.3.1 → ctxloop-0.3.2}/tests/test_semantic.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxloop
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Token-saving layer on top of Graphify: symbol-level code slicing, context packs, a savings ledger with an honest baseline, hooks and MCP for Claude Code, Copilot and Codex.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/naubadnithinkumar/ctxloop
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ctxloop"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "Token-saving layer on top of Graphify: symbol-level code slicing, context packs, a savings ledger with an honest baseline, hooks and MCP for Claude Code, Copilot and Codex."
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxloop
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Token-saving layer on top of Graphify: symbol-level code slicing, context packs, a savings ledger with an honest baseline, hooks and MCP for Claude Code, Copilot and Codex.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/naubadnithinkumar/ctxloop
@@ -1,3 +1,3 @@
1
1
  """graphsnip: a token-saving layer on top of Graphify."""
2
2
 
3
- __version__ = "0.3.1"
3
+ __version__ = "0.3.2"
@@ -228,10 +228,13 @@ def _fold(fid: str, title: str, summary: str, body: str, open_: bool = False) ->
228
228
  f'<span class="fs">{e(summary)}</span></summary><div class="fb">{body}</div></details></section>')
229
229
 
230
230
 
231
+ THEME_JS = """<script>(function(){var root=document.documentElement,b=document.getElementById("theme-toggle");if(!b)return;function apply(t){root.dataset.colorTheme=t;b.textContent=t==="light"?"Dark mode":"Light mode";b.setAttribute("aria-pressed",String(t==="light"));}var t="dark";try{if(localStorage.getItem("ctxloop-report-theme")==="light")t="light";}catch(e){}apply(t);b.addEventListener("click",function(){var next=root.dataset.colorTheme==="light"?"dark":"light";apply(next);try{localStorage.setItem("ctxloop-report-theme",next);}catch(e){}});})();</script>"""
232
+
231
233
  CSS = """
232
234
 
233
235
  :root{
234
236
  color-scheme:dark;
237
+ --surface-1:#235f3a;--surface-2:#356749;--surface-3:#12241a;--surface-4:#121d18;--surface-5:#173322;--surface-6:#2f7045;--surface-7:#2b2418;--surface-8:#66512c;--surface-9:#12261a;--surface-10:#366d46;--surface-11:#17231c;--surface-12:#a8f0c0;--surface-13:#1b3023;--surface-14:#2b4d38;--surface-15:#345a40;--surface-16:#14241a;--surface-17:#1e3525;--surface-18:#9bffba;--surface-19:#15271b;--surface-20:#407650;--surface-21:#387b4e;--surface-22:#142b1d;--surface-23:#17211c;--surface-24:#37764d;--surface-25:#183322;--surface-26:#715a34;--surface-27:#302719;--surface-28:#0e1713;--surface-29:#4a7858;--surface-30:#1a3723;--surface-31:#0c1510;--surface-32:#0b130e;--surface-33:#306441;--surface-34:#16301e;
235
238
  --bg:#090f0d;--card:#111a17;--ink:#e5eee8;--mut:#92a59a;--line:#2a3930;
236
239
  --brand:#63e58e;--brand2:#63e58e;--grep:#8d9991;--gfy:#78a3b6;
237
240
  --gfyread:#c0a876;--cg:#63e58e;--bad:#f18b81;--ok:#77e6a0;--warn:#efc073;
@@ -243,7 +246,7 @@ body{
243
246
  font:13.5px/1.65 ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
244
247
  -webkit-font-smoothing:antialiased;
245
248
  }
246
- ::selection{background:#235f3a;color:#fff}
249
+ ::selection{background:var(--surface-1);color:#fff}
247
250
  .wrap{max-width:1220px;margin:0 auto;padding:30px 24px 66px}
248
251
  header{
249
252
  display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:18px;
@@ -251,8 +254,8 @@ header{
251
254
  }
252
255
  .brand{display:flex;align-items:center;gap:14px;min-width:0}
253
256
  .logo{
254
- width:46px;height:46px;flex-shrink:0;border-radius:7px;border:1px solid #356749;
255
- background:#12241a;display:grid;place-items:center;color:var(--brand);
257
+ width:46px;height:46px;flex-shrink:0;border-radius:7px;border:1px solid var(--surface-2);
258
+ background:var(--surface-3);display:grid;place-items:center;color:var(--brand);
256
259
  font-size:19px;font-weight:750;letter-spacing:-3px;padding-right:4px;
257
260
  }
258
261
  h1{font-size:24px;line-height:1.25;margin:0 0 7px;letter-spacing:-.05em;font-weight:760}
@@ -260,22 +263,22 @@ h2{font-size:15px;line-height:1.4;margin:0 0 5px;font-weight:740;letter-spacing:
260
263
  .sub{color:var(--mut);font-size:12px;line-height:1.65}
261
264
  .chips{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
262
265
  .chip{
263
- background:#121d18;border:1px solid var(--line);color:var(--mut);
266
+ background:var(--surface-4);border:1px solid var(--line);color:var(--mut);
264
267
  border-radius:5px;padding:4px 9px;font-size:11.5px;white-space:normal
265
268
  }
266
269
  .chip b{color:var(--ink);font-weight:700}
267
270
  .badge{
268
271
  display:inline-block;vertical-align:middle;margin-left:7px;
269
- background:#173322;border:1px solid #2f7045;border-radius:4px;
272
+ background:var(--surface-5);border:1px solid var(--surface-6);border-radius:4px;
270
273
  color:var(--brand);padding:3px 7px;font-size:10px;letter-spacing:0;font-weight:650
271
274
  }
272
- .badge.warn{background:#2b2418;border-color:#66512c;color:var(--warn)}
275
+ .badge.warn{background:var(--surface-7);border-color:var(--surface-8);color:var(--warn)}
273
276
  .grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:14px}
274
277
  .kpi{
275
278
  background:var(--card);border:1px solid var(--line);border-radius:7px;
276
279
  padding:17px 18px;min-width:0
277
280
  }
278
- .kpi.accent{background:#12261a;border:1px solid #366d46;color:var(--ink)}
281
+ .kpi.accent{background:var(--surface-9);border:1px solid var(--surface-10);color:var(--ink)}
279
282
  .kpi.accent .k-l,.kpi.accent .k-s{color:var(--mut)}
280
283
  .kpi.accent .k-v{color:var(--brand)}
281
284
  .k-l{font-size:11px;color:var(--mut);font-weight:600;text-transform:uppercase;letter-spacing:.09em}
@@ -300,17 +303,17 @@ table{width:100%;border-collapse:collapse;font-size:12px}
300
303
  th,td{padding:10px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
301
304
  th{color:var(--mut);font-weight:650;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
302
305
  td.r,th.r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
303
- tbody tr:hover{background:#17231c}
306
+ tbody tr:hover{background:var(--surface-11)}
304
307
  .ok{color:var(--ok);font-weight:700}.no{color:var(--bad);font-weight:700}
305
308
  .muted{color:var(--mut)}
306
- code{color:#a8f0c0;background:#1b3023;border:1px solid #2b4d38;padding:1px 5px;border-radius:3px;font-size:12px;overflow-wrap:anywhere}
309
+ code{color:var(--surface-12);background:var(--surface-13);border:1px solid var(--surface-14);padding:1px 5px;border-radius:3px;font-size:12px;overflow-wrap:anywhere}
307
310
  iframe{width:100%;height:550px;border:1px solid var(--line);border-radius:5px;background:var(--bg)}
308
- .btn{display:inline-block;border:1px solid #345a40;border-radius:5px;padding:6px 12px;font:inherit;font-size:12px;color:var(--brand);text-decoration:none;background:#14241a}
309
- .btn:hover{background:#1e3525;border-color:var(--brand)}
310
- a{color:var(--brand)}a:hover{color:#9bffba}
311
+ .btn{display:inline-block;border:1px solid var(--surface-15);border-radius:5px;padding:6px 12px;font:inherit;font-size:12px;color:var(--brand);text-decoration:none;background:var(--surface-16)}
312
+ .btn:hover{background:var(--surface-17);border-color:var(--brand)}
313
+ a{color:var(--brand)}a:hover{color:var(--surface-18)}
311
314
  details{margin-top:6px}summary{cursor:pointer;color:var(--brand);font-weight:650}
312
315
  details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}
313
- .callout{border-left:3px solid var(--brand);background:#15271b;padding:11px 13px;border-radius:0 4px 4px 0;font-size:12.5px}
316
+ .callout{border-left:3px solid var(--brand);background:var(--surface-19);padding:11px 13px;border-radius:0 4px 4px 0;font-size:12.5px}
314
317
  .fold{padding:0}.fold>details{margin:0}
315
318
  .fold>details>summary{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:15px 19px;color:var(--ink)}
316
319
  .fold>details>summary::after{content:"+ expand";margin-left:auto;color:var(--brand);font-size:11px;font-weight:650}
@@ -325,31 +328,31 @@ details>summary{list-style:none}details>summary::-webkit-details-marker{display:
325
328
  border:1px solid var(--line);background:var(--card);border-radius:5px;
326
329
  padding:6px 10px;color:var(--mut);text-decoration:none;font-size:12px;
327
330
  }
328
- .nav a:hover{color:var(--brand);border-color:#407650}
329
- .nav a[aria-current=page]{color:var(--brand);border-color:#387b4e;background:#142b1d;font-weight:700}
331
+ .nav a:hover{color:var(--brand);border-color:var(--surface-20)}
332
+ .nav a[aria-current=page]{color:var(--brand);border-color:var(--surface-21);background:var(--surface-22);font-weight:700}
330
333
  .nav-icon{display:inline-block;width:20px;font-size:15px;color:var(--mut)}
331
334
  .flow{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:10px 0}
332
- .flow .st{border:1px solid var(--line);border-radius:4px;padding:6px 10px;font-size:12px;background:#17211c}
333
- .flow .st.g{border-color:#37764d;background:#183322}
334
- .flow .st.w{border-color:#715a34;background:#302719}
335
+ .flow .st{border:1px solid var(--line);border-radius:4px;padding:6px 10px;font-size:12px;background:var(--surface-23)}
336
+ .flow .st.g{border-color:var(--surface-24);background:var(--surface-25)}
337
+ .flow .st.w{border-color:var(--surface-26);background:var(--surface-27)}
335
338
  .flow .ar{color:var(--mut)}
336
339
  .tabs{display:flex;gap:5px;flex-wrap:wrap;margin:15px 0 12px}
337
340
  .tab{
338
- border:1px solid var(--line);background:#0e1713;color:var(--mut);
341
+ border:1px solid var(--line);background:var(--surface-28);color:var(--mut);
339
342
  border-radius:4px;padding:6px 10px;font:inherit;font-size:11.5px;cursor:pointer
340
343
  }
341
- .tab:hover{border-color:#4a7858;color:var(--ink)}
342
- .tab.on{background:#1a3723;border-color:#387b4e;color:var(--brand);font-weight:700}
344
+ .tab:hover{border-color:var(--surface-29);color:var(--ink)}
345
+ .tab.on{background:var(--surface-30);border-color:var(--surface-21);color:var(--brand);font-weight:700}
343
346
  .tp[hidden],.views>[hidden],details[hidden]{display:none!important}
344
347
  footer{color:var(--mut);font-size:11.5px;margin-top:25px;border-top:1px solid var(--line);padding-top:16px}
345
348
  .record-search{
346
349
  display:block;width:100%;padding:10px 12px;border:1px solid var(--line);
347
- border-radius:4px;background:#0c1510;color:var(--ink);font:inherit;margin:12px 0
350
+ border-radius:4px;background:var(--surface-31);color:var(--ink);font:inherit;margin:12px 0
348
351
  }
349
352
  .record-search::placeholder{color:var(--mut)}
350
353
  .record-search:focus-visible,.tab:focus-visible,.nav a:focus-visible,.btn:focus-visible,summary:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
351
354
  .views #memory .grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
352
- .record{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;padding:12px;background:#0b130e;border:1px solid var(--line);border-radius:4px}
355
+ .record{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;padding:12px;background:var(--surface-32);border:1px solid var(--line);border-radius:4px}
353
356
  @media(min-width:1100px){
354
357
  .wrap{max-width:1480px;padding-left:228px;position:relative}
355
358
  .nav{
@@ -359,7 +362,7 @@ footer{color:var(--mut);font-size:11.5px;margin-top:25px;border-top:1px solid va
359
362
  }
360
363
  .nav::before{content:"NAVIGATION";font-size:10px;letter-spacing:.14em;color:var(--mut);padding:4px 9px 9px}
361
364
  .nav a{border:1px solid transparent;border-radius:4px;padding:8px 9px;background:transparent}
362
- .nav a[aria-current=page]{border-color:#306441;background:#16301e}
365
+ .nav a[aria-current=page]{border-color:var(--surface-33);background:var(--surface-34)}
363
366
  }
364
367
  @media(max-width:1099px){
365
368
  .two{grid-template-columns:1fr!important}
@@ -381,13 +384,10 @@ footer{color:var(--mut);font-size:11.5px;margin-top:25px;border-top:1px solid va
381
384
  }
382
385
  @media(max-width:420px){.grid4,.views #memory .grid4{grid-template-columns:1fr}}
383
386
  @media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
384
- @media print{
385
- :root{--bg:#fff;--card:#fff;--ink:#18251d;--mut:#4d5f52;--line:#d4ddd6;--brand:#136b36;--cg:#136b36}
386
- .nav{display:none}
387
- .wrap{max-width:100%;padding:0}
388
- .card,.kpi{break-inside:avoid}
389
- }
390
387
 
388
+ .theme-toggle{cursor:pointer;white-space:nowrap}
389
+ :root[data-color-theme="light"]{color-scheme:light;--bg:#f4f6f2;--card:#ffffff;--ink:#203029;--mut:#53675b;--line:#cbd7ce;--brand:#176b38;--brand2:#176b38;--grep:#64756b;--gfy:#356d87;--gfyread:#896422;--cg:#218344;--bad:#a52d2d;--ok:#176b38;--warn:#805410;--surface-1:#247343;--surface-2:#9bbfa5;--surface-3:#e5f2e8;--surface-4:#edf2ee;--surface-5:#e1f1e5;--surface-6:#9bc4a5;--surface-7:#fff4df;--surface-8:#d4b67e;--surface-9:#e7f4e9;--surface-10:#a0c5a9;--surface-11:#edf3ee;--surface-12:#185c32;--surface-13:#e6f0e8;--surface-14:#c3d8c8;--surface-15:#a8c5af;--surface-16:#eaf3eb;--surface-17:#dbece0;--surface-18:#104c29;--surface-19:#e8f3e9;--surface-20:#659b73;--surface-21:#87b394;--surface-22:#e1f0e5;--surface-23:#edf2ee;--surface-24:#87b394;--surface-25:#e1f0e5;--surface-26:#c4a36b;--surface-27:#fff3dd;--surface-28:#f5f7f4;--surface-29:#719c7b;--surface-30:#dceee1;--surface-31:#fafbf9;--surface-32:#f3f6f2;--surface-33:#91b99b;--surface-34:#e1f0e5;}
390
+ @media print{:root,:root[data-color-theme="dark"],:root[data-color-theme="light"]{color-scheme:light;--bg:#f4f6f2;--card:#ffffff;--ink:#203029;--mut:#53675b;--line:#cbd7ce;--brand:#176b38;--brand2:#176b38;--grep:#64756b;--gfy:#356d87;--gfyread:#896422;--cg:#218344;--bad:#a52d2d;--ok:#176b38;--warn:#805410;--surface-1:#247343;--surface-2:#9bbfa5;--surface-3:#e5f2e8;--surface-4:#edf2ee;--surface-5:#e1f1e5;--surface-6:#9bc4a5;--surface-7:#fff4df;--surface-8:#d4b67e;--surface-9:#e7f4e9;--surface-10:#a0c5a9;--surface-11:#edf3ee;--surface-12:#185c32;--surface-13:#e6f0e8;--surface-14:#c3d8c8;--surface-15:#a8c5af;--surface-16:#eaf3eb;--surface-17:#dbece0;--surface-18:#104c29;--surface-19:#e8f3e9;--surface-20:#659b73;--surface-21:#87b394;--surface-22:#e1f0e5;--surface-23:#edf2ee;--surface-24:#87b394;--surface-25:#e1f0e5;--surface-26:#c4a36b;--surface-27:#fff3dd;--surface-28:#f5f7f4;--surface-29:#719c7b;--surface-30:#dceee1;--surface-31:#fafbf9;--surface-32:#f3f6f2;--surface-33:#91b99b;--surface-34:#e1f0e5;} .nav,.theme-toggle{display:none}.wrap{max-width:100%;padding:0}.card,.kpi{break-inside:avoid}}
391
391
  """
392
392
 
393
393
  def _usd(v: float) -> str:
@@ -803,11 +803,11 @@ def build_html(project: Project, graph_href: str, include_details: bool = True)
803
803
  return (f'<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
804
804
  f'<title>CtxLoop · Intelligence Report</title><style>{CSS}</style></head><body data-report-theme="terminal"><div class="wrap">'
805
805
  f'<header><div class="brand"><div class="logo" aria-hidden="true">&gt;_</div><div><h1>CtxLoop <span class="badge{head_cls}">{e(head_label)}</span></h1>'
806
- f'<div class="sub">{e(project.root.name)} · generated {now} · v{__version__}</div></div></div><div class="chips">{"".join(chips)}</div></header>'
806
+ f'<div class="sub">{e(project.root.name)} · generated {now} · v{__version__}</div></div></div><div class="chips">{"".join(chips)}<button type="button" class="btn theme-toggle" id="theme-toggle" aria-pressed="false">Light mode</button></div></header>'
807
807
  f'<nav class="nav" aria-label="Dashboard sections"><a href="#top"><span class="nav-icon" aria-hidden="true">▦</span>Overview</a><a href="#graph"><span class="nav-icon" aria-hidden="true">◇</span>Knowledge Graph</a><a href="#tokens"><span class="nav-icon" aria-hidden="true">▥</span>Token Analytics</a><a href="#routing"><span class="nav-icon" aria-hidden="true">⇄</span>Model Routing</a><a href="#memory"><span class="nav-icon" aria-hidden="true">◎</span>Memory Engine</a><a href="#skills"><span class="nav-icon" aria-hidden="true">▤</span>Skills Library</a><a href="#evaluations"><span class="nav-icon" aria-hidden="true">⚗</span>Evaluations</a></nav>'
808
808
  f'<main class="views"><div class="grid4" id="top">{"".join(kpis)}</div>{"".join(sections)}</main>'
809
809
  f'<footer>graphsnip is a companion layer on top of Graphify. Graph, communities and AST extraction are Graphify\'s; graphsnip adds symbol-level retrieval, '
810
- f'context packs, hooks, MCP, and this honest accounting.</footer></div>{TAB_JS}{APP_JS}</body></html>')
810
+ f'context packs, hooks, MCP, and this honest accounting.</footer></div>{TAB_JS}{APP_JS}{THEME_JS}</body></html>')
811
811
 
812
812
 
813
813
  _VIS_VERSION = "9.1.6"
@@ -139,6 +139,10 @@ def test_dashboard_renders_and_escapes(repo):
139
139
  h = build_html(p, "graph.html")
140
140
  assert "Tokens saved" in h and "four approaches" in h and "<script>alert(1)" not in h and "&lt;script&gt;" in h
141
141
  assert 'data-report-theme="terminal"' in h
142
+ assert 'id="theme-toggle"' in h
143
+ assert 'data-color-theme="light"' in h
144
+ assert "--bg:#f4f6f2" in h
145
+ assert "ctxloop-report-theme" in h
142
146
  assert "<title>CtxLoop · Intelligence Report</title>" in h
143
147
  assert "--bg:#090f0d" in h and "--brand:#63e58e" in h
144
148
  out = write_dashboard(p, bundle=str(repo / "bundle"))
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes