ctxloop 0.3.0__tar.gz → 0.3.1__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 (47) hide show
  1. {ctxloop-0.3.0/src/ctxloop.egg-info → ctxloop-0.3.1}/PKG-INFO +11 -8
  2. {ctxloop-0.3.0 → ctxloop-0.3.1}/README.md +10 -7
  3. {ctxloop-0.3.0 → ctxloop-0.3.1}/pyproject.toml +2 -2
  4. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop/__init__.py +5 -0
  5. ctxloop-0.3.1/src/ctxloop/__main__.py +4 -0
  6. {ctxloop-0.3.0 → ctxloop-0.3.1/src/ctxloop.egg-info}/PKG-INFO +11 -8
  7. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/entry_points.txt +1 -1
  8. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/__init__.py +1 -1
  9. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/cli.py +3 -3
  10. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/dashboard.py +160 -48
  11. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_integrations.py +3 -0
  12. ctxloop-0.3.0/src/ctxloop/__main__.py +0 -4
  13. {ctxloop-0.3.0 → ctxloop-0.3.1}/LICENSE +0 -0
  14. {ctxloop-0.3.0 → ctxloop-0.3.1}/NOTICE +0 -0
  15. {ctxloop-0.3.0 → ctxloop-0.3.1}/setup.cfg +0 -0
  16. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/SOURCES.txt +0 -0
  17. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/dependency_links.txt +0 -0
  18. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/requires.txt +0 -0
  19. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/top_level.txt +0 -0
  20. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/__main__.py +0 -0
  21. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/ab.py +0 -0
  22. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/baseline.py +0 -0
  23. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/bench.py +0 -0
  24. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/engine.py +0 -0
  25. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/hooks.py +0 -0
  26. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/installer.py +0 -0
  27. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/ledger.py +0 -0
  28. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/mcp_server.py +0 -0
  29. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/memory_client.py +0 -0
  30. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/memory_eval.py +0 -0
  31. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/probe.py +0 -0
  32. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/project.py +0 -0
  33. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/py.typed +0 -0
  34. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/retrieval.py +0 -0
  35. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/router.py +0 -0
  36. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/semantic.py +0 -0
  37. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/shellfilter.py +0 -0
  38. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/slicer.py +0 -0
  39. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/tokens.py +0 -0
  40. {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/usage.py +0 -0
  41. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_core.py +0 -0
  42. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_client.py +0 -0
  43. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_cross_runtime.py +0 -0
  44. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_eval.py +0 -0
  45. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_integration.py +0 -0
  46. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_refresh.py +0 -0
  47. {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_semantic.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxloop
3
- Version: 0.3.0
3
+ Version: 0.3.1
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
@@ -19,13 +19,16 @@ Provides-Extra: dev
19
19
  Requires-Dist: pytest>=8; extra == "dev"
20
20
  Dynamic: license-file
21
21
 
22
- # CtxLoop (formerly GraphSnip)
22
+ <div align="center">
23
+ <img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
23
24
 
24
- CtxLoop builds and reuses repository context. The new distribution and CLI are `ctxloop`; legacy `graphsnip` commands, imports, MCP tools and project storage remain supported. The new distribution must be published before installing it from a registry.
25
+ **UNDERSTAND / REMEMBER / OPTIMIZE**
25
26
 
26
- <div align="center">
27
+ *Build context. Reuse intelligence. Repeat.*
27
28
 
28
- # graphsnip
29
+ </div>
30
+
31
+ <div align="center">
29
32
 
30
33
  **Give your coding agent the exact code it needs, not whole files, and prove the savings.**
31
34
 
@@ -75,10 +78,10 @@ Graphify is excellent at telling an agent *where* things are. graphsnip adds the
75
78
  ## Quick start
76
79
 
77
80
  ```bash
78
- pipx install graphsnip # or: pipx install git+https://github.com/naubadnithin7/codegraf
81
+ pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
79
82
  cd your-repo
80
- graphsnip init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
81
- graphsnip report --open # savings dashboard (grows as agents use it)
83
+ ctxloop init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
84
+ ctxloop report --open # savings dashboard (grows as agents use it)
82
85
  ```
83
86
 
84
87
  No LLM key needed. Everything runs locally: Graphify parses with tree-sitter, graphsnip slices with tree-sitter.
@@ -1,10 +1,13 @@
1
- # CtxLoop (formerly GraphSnip)
1
+ <div align="center">
2
+ <img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
2
3
 
3
- CtxLoop builds and reuses repository context. The new distribution and CLI are `ctxloop`; legacy `graphsnip` commands, imports, MCP tools and project storage remain supported. The new distribution must be published before installing it from a registry.
4
+ **UNDERSTAND / REMEMBER / OPTIMIZE**
4
5
 
5
- <div align="center">
6
+ *Build context. Reuse intelligence. Repeat.*
6
7
 
7
- # graphsnip
8
+ </div>
9
+
10
+ <div align="center">
8
11
 
9
12
  **Give your coding agent the exact code it needs, not whole files, and prove the savings.**
10
13
 
@@ -54,10 +57,10 @@ Graphify is excellent at telling an agent *where* things are. graphsnip adds the
54
57
  ## Quick start
55
58
 
56
59
  ```bash
57
- pipx install graphsnip # or: pipx install git+https://github.com/naubadnithin7/codegraf
60
+ pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
58
61
  cd your-repo
59
- graphsnip init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
60
- graphsnip report --open # savings dashboard (grows as agents use it)
62
+ ctxloop init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
63
+ ctxloop report --open # savings dashboard (grows as agents use it)
61
64
  ```
62
65
 
63
66
  No LLM key needed. Everything runs locally: Graphify parses with tree-sitter, graphsnip slices with tree-sitter.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ctxloop"
7
- version = "0.3.0"
7
+ version = "0.3.1"
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"
@@ -21,7 +21,7 @@ semantic = ["fastembed>=0.3", "numpy>=1.24"]
21
21
  dev = ["pytest>=8"]
22
22
 
23
23
  [project.scripts]
24
- ctxloop = "graphsnip.cli:main"
24
+ ctxloop = "ctxloop:main"
25
25
  graphsnip = "graphsnip.cli:main"
26
26
 
27
27
  [project.urls]
@@ -1,2 +1,7 @@
1
1
  """CtxLoop public package; legacy implementation remains in graphsnip."""
2
2
  from graphsnip import __version__
3
+
4
+
5
+ def main(argv=None):
6
+ from graphsnip.cli import main as run
7
+ return run(argv, prog="ctxloop")
@@ -0,0 +1,4 @@
1
+ from ctxloop import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxloop
3
- Version: 0.3.0
3
+ Version: 0.3.1
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
@@ -19,13 +19,16 @@ Provides-Extra: dev
19
19
  Requires-Dist: pytest>=8; extra == "dev"
20
20
  Dynamic: license-file
21
21
 
22
- # CtxLoop (formerly GraphSnip)
22
+ <div align="center">
23
+ <img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
23
24
 
24
- CtxLoop builds and reuses repository context. The new distribution and CLI are `ctxloop`; legacy `graphsnip` commands, imports, MCP tools and project storage remain supported. The new distribution must be published before installing it from a registry.
25
+ **UNDERSTAND / REMEMBER / OPTIMIZE**
25
26
 
26
- <div align="center">
27
+ *Build context. Reuse intelligence. Repeat.*
27
28
 
28
- # graphsnip
29
+ </div>
30
+
31
+ <div align="center">
29
32
 
30
33
  **Give your coding agent the exact code it needs, not whole files, and prove the savings.**
31
34
 
@@ -75,10 +78,10 @@ Graphify is excellent at telling an agent *where* things are. graphsnip adds the
75
78
  ## Quick start
76
79
 
77
80
  ```bash
78
- pipx install graphsnip # or: pipx install git+https://github.com/naubadnithin7/codegraf
81
+ pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
79
82
  cd your-repo
80
- graphsnip init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
81
- graphsnip report --open # savings dashboard (grows as agents use it)
83
+ ctxloop init # build graph, wire up Claude Code / Copilot / Codex, write the dashboard
84
+ ctxloop report --open # savings dashboard (grows as agents use it)
82
85
  ```
83
86
 
84
87
  No LLM key needed. Everything runs locally: Graphify parses with tree-sitter, graphsnip slices with tree-sitter.
@@ -1,3 +1,3 @@
1
1
  [console_scripts]
2
- ctxloop = graphsnip.cli:main
2
+ ctxloop = ctxloop:main
3
3
  graphsnip = graphsnip.cli:main
@@ -1,3 +1,3 @@
1
1
  """graphsnip: a token-saving layer on top of Graphify."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.3.1"
@@ -469,10 +469,10 @@ def cmd_doctor(a) -> int:
469
469
  return 0 if ok else 1
470
470
 
471
471
 
472
- def main(argv=None) -> int:
472
+ def main(argv=None, *, prog="graphsnip") -> int:
473
473
  common = _common()
474
- ap = argparse.ArgumentParser(prog="graphsnip", description="Token-saving layer on top of Graphify.")
475
- ap.add_argument("--version", action="version", version=f"graphsnip {__version__}")
474
+ ap = argparse.ArgumentParser(prog=prog, description="Token-saving layer on top of Graphify.")
475
+ ap.add_argument("--version", action="version", version=f"{prog} {__version__}")
476
476
  sub = ap.add_subparsers(dest="cmd")
477
477
 
478
478
  def add(name, fn, help_, **kw):
@@ -229,54 +229,166 @@ def _fold(fid: str, title: str, summary: str, body: str, open_: bool = False) ->
229
229
 
230
230
 
231
231
  CSS = """
232
- :root{--bg:#f6f7f9;--card:#fff;--ink:#121826;--mut:#5b6577;--line:#e3e6ec;--brand:#0f766e;--brand2:#14b8a6;
233
- --grep:#94a3b8;--gfy:#60a5fa;--gfyread:#6366f1;--cg:#0f766e;--bad:#b91c1c;--ok:#15803d;--warn:#b45309}
234
- @media (prefers-color-scheme:dark){:root{--bg:#0b0f17;--card:#121826;--ink:#e8ecf4;--mut:#93a0b6;--line:#243049;--brand:#2dd4bf;--brand2:#5eead4;
235
- --grep:#64748b;--gfy:#60a5fa;--gfyread:#818cf8;--cg:#2dd4bf;--bad:#f87171;--ok:#4ade80;--warn:#fbbf24}}
236
- *{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
237
- .wrap{max-width:1180px;margin:0 auto;padding:28px 18px 60px}
238
- header{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;margin-bottom:22px}
239
- .brand{display:flex;align-items:center;gap:12px}.logo{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,var(--brand),var(--brand2));display:grid;place-items:center;color:#fff;font-weight:800}
240
- h1{font-size:22px;margin:0}h2{font-size:17px;margin:0 0 4px}.sub{color:var(--mut);font-size:13px}
241
- .chips{display:flex;flex-wrap:wrap;gap:8px}.chip{background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px 11px;font-size:12.5px;color:var(--mut)}
242
- .chip b{color:var(--ink)}
243
- .badge{display:inline-block;border-radius:6px;padding:2px 8px;font-size:12px;font-weight:600;background:color-mix(in srgb,var(--brand) 14%,transparent);color:var(--brand)}
244
- .badge.warn{background:color-mix(in srgb,var(--warn) 16%,transparent);color:var(--warn)}
245
- .grid4{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-bottom:18px}
246
- .kpi{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px 18px}
247
- .kpi.accent{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border:none}.kpi.accent .k-l,.kpi.accent .k-s{color:rgba(255,255,255,.88)}
248
- .k-l{font-size:12.5px;color:var(--mut);text-transform:uppercase;letter-spacing:.04em}.k-v{font-size:34px;font-weight:750;line-height:1.15;margin:4px 0}.k-s{font-size:12.5px;color:var(--mut)}
249
- .card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px 20px;margin-bottom:18px}
250
- .two{display:grid;grid-template-columns:1fr 1fr;gap:18px}@media(max-width:900px){.two{grid-template-columns:1fr}}
251
- .chart{width:100%;height:auto;display:block}.chart .lbl{font-size:14px;fill:var(--ink)}.chart .val{font-size:13px;fill:var(--mut)}.chart .num{fill:var(--ink);font-weight:700}
252
- .chart .axis{font-size:11px;fill:var(--mut)}.chart .grid{stroke:var(--line);stroke-width:1}
253
- .b-grep{fill:var(--grep)}.b-gfy{fill:var(--gfy)}.b-gfyread{fill:var(--gfyread)}.b-cg{fill:var(--cg)}
254
- .area{fill:var(--cg);opacity:.16}.l-base{stroke:var(--grep);stroke-width:2.4}.l-ret{stroke:var(--cg);stroke-width:2.8}
255
- .legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--mut);margin-top:6px}.dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}
256
- table{width:100%;border-collapse:collapse;font-size:13.5px}th,td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:left}th{color:var(--mut);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.03em}
257
- td.r,th.r{text-align:right;font-variant-numeric:tabular-nums}.ok{color:var(--ok);font-weight:700}.no{color:var(--bad);font-weight:700}
258
- .muted{color:var(--mut)}code{background:color-mix(in srgb,var(--mut) 15%,transparent);padding:1px 6px;border-radius:5px;font-size:12.5px}
259
- iframe{width:100%;height:560px;border:1px solid var(--line);border-radius:10px;background:var(--card)}
260
- .btn{display:inline-block;border:1px solid var(--line);border-radius:8px;padding:6px 12px;font-size:13px;color:var(--ink);text-decoration:none;background:var(--card)}
261
- .btn:hover{border-color:var(--brand)}
262
- details{margin-top:6px}summary{cursor:pointer;color:var(--brand);font-weight:600}
263
- .callout{border-left:4px solid var(--brand);background:color-mix(in srgb,var(--brand) 8%,transparent);padding:10px 14px;border-radius:0 8px 8px 0;font-size:14px}
232
+
233
+ :root{
234
+ color-scheme:dark;
235
+ --bg:#090f0d;--card:#111a17;--ink:#e5eee8;--mut:#92a59a;--line:#2a3930;
236
+ --brand:#63e58e;--brand2:#63e58e;--grep:#8d9991;--gfy:#78a3b6;
237
+ --gfyread:#c0a876;--cg:#63e58e;--bad:#f18b81;--ok:#77e6a0;--warn:#efc073;
238
+ }
239
+ *{box-sizing:border-box}
240
+ html{scroll-behavior:smooth;scroll-padding-top:60px}
241
+ body{
242
+ margin:0;background:var(--bg);color:var(--ink);
243
+ font:13.5px/1.65 ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
244
+ -webkit-font-smoothing:antialiased;
245
+ }
246
+ ::selection{background:#235f3a;color:#fff}
247
+ .wrap{max-width:1220px;margin:0 auto;padding:30px 24px 66px}
248
+ header{
249
+ display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:18px;
250
+ border-bottom:1px solid var(--line);margin-bottom:22px;padding-bottom:20px;
251
+ }
252
+ .brand{display:flex;align-items:center;gap:14px;min-width:0}
253
+ .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);
256
+ font-size:19px;font-weight:750;letter-spacing:-3px;padding-right:4px;
257
+ }
258
+ h1{font-size:24px;line-height:1.25;margin:0 0 7px;letter-spacing:-.05em;font-weight:760}
259
+ h2{font-size:15px;line-height:1.4;margin:0 0 5px;font-weight:740;letter-spacing:-.02em}
260
+ .sub{color:var(--mut);font-size:12px;line-height:1.65}
261
+ .chips{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
262
+ .chip{
263
+ background:#121d18;border:1px solid var(--line);color:var(--mut);
264
+ border-radius:5px;padding:4px 9px;font-size:11.5px;white-space:normal
265
+ }
266
+ .chip b{color:var(--ink);font-weight:700}
267
+ .badge{
268
+ display:inline-block;vertical-align:middle;margin-left:7px;
269
+ background:#173322;border:1px solid #2f7045;border-radius:4px;
270
+ color:var(--brand);padding:3px 7px;font-size:10px;letter-spacing:0;font-weight:650
271
+ }
272
+ .badge.warn{background:#2b2418;border-color:#66512c;color:var(--warn)}
273
+ .grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:14px}
274
+ .kpi{
275
+ background:var(--card);border:1px solid var(--line);border-radius:7px;
276
+ padding:17px 18px;min-width:0
277
+ }
278
+ .kpi.accent{background:#12261a;border:1px solid #366d46;color:var(--ink)}
279
+ .kpi.accent .k-l,.kpi.accent .k-s{color:var(--mut)}
280
+ .kpi.accent .k-v{color:var(--brand)}
281
+ .k-l{font-size:11px;color:var(--mut);font-weight:600;text-transform:uppercase;letter-spacing:.09em}
282
+ .k-v{font-size:32px;font-weight:780;line-height:1.25;margin:8px 0 6px;letter-spacing:-.07em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
283
+ .k-s{font-size:11px;color:var(--mut);line-height:1.55}
284
+ .card{background:var(--card);border:1px solid var(--line);border-radius:7px;padding:19px 20px;margin-bottom:14px;min-width:0;overflow-x:auto}
285
+ .two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
286
+ .chart{width:100%;height:auto;display:block;min-width:0}
287
+ .chart .lbl{font-size:13px;fill:var(--ink)}
288
+ .chart .val{font-size:12px;fill:var(--mut)}
289
+ .chart .num{fill:var(--ink);font-weight:700}
290
+ .chart .axis{font-size:10.5px;fill:var(--mut)}
291
+ .chart .grid{stroke:var(--line);stroke-width:1;stroke-dasharray:3 4}
292
+ .b-grep{fill:var(--grep)}.b-gfy{fill:var(--gfy)}
293
+ .b-gfyread{fill:var(--gfyread)}.b-cg{fill:var(--cg)}
294
+ .area{fill:var(--cg);opacity:.1}
295
+ .l-base{stroke:var(--grep);stroke-width:2}
296
+ .l-ret{stroke:var(--cg);stroke-width:2.5}
297
+ .legend{display:flex;gap:15px;flex-wrap:wrap;font-size:11.5px;color:var(--mut);margin-top:12px}
298
+ .dot{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:6px;vertical-align:0}
299
+ table{width:100%;border-collapse:collapse;font-size:12px}
300
+ th,td{padding:10px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
301
+ th{color:var(--mut);font-weight:650;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
302
+ td.r,th.r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
303
+ tbody tr:hover{background:#17231c}
304
+ .ok{color:var(--ok);font-weight:700}.no{color:var(--bad);font-weight:700}
305
+ .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}
307
+ 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
+ details{margin-top:6px}summary{cursor:pointer;color:var(--brand);font-weight:650}
264
312
  details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}
265
- .fold{padding:0}.fold>details{margin:0}.fold>details>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 20px;color:var(--ink)}
266
- .fold>details>summary::after{content:"Show ▾";color:var(--brand);font-size:13px;font-weight:600;margin-left:auto}.fold>details[open]>summary::after{content:"Hide ▴"}
267
- .ft{font-weight:700;font-size:16px}.fs{color:var(--mut);font-size:13px;font-weight:400}.fb{padding:0 20px 18px}
268
- .nav{position:sticky;top:0;z-index:5;display:flex;gap:6px;flex-wrap:wrap;padding:8px 0;margin:-8px 0 14px;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(6px)}
269
- .nav a{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:4px 12px;font-size:13px;color:var(--mut);text-decoration:none}.nav a:hover{color:var(--brand);border-color:var(--brand)}
270
- html{scroll-behavior:smooth}.flow{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0}.flow .st{border:1px solid var(--line);border-radius:10px;padding:6px 10px;font-size:13px;background:var(--card)}
271
- .flow .st.g{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 9%,transparent)}.flow .st.w{border-color:var(--warn);background:color-mix(in srgb,var(--warn) 10%,transparent)}.flow .ar{color:var(--mut)}
272
- .tabs{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 8px}.tab{border:1px solid var(--line);background:var(--card);color:var(--mut);border-radius:8px;padding:5px 12px;font:inherit;font-size:13px;cursor:pointer}
273
- .tab.on{background:var(--brand);border-color:var(--brand);color:#fff}.tp[hidden]{display:none}@media(max-width:900px){.two{grid-template-columns:1fr!important}}
274
- footer{color:var(--mut);font-size:12.5px;margin-top:26px}
275
- .views>[hidden],details[hidden]{display:none!important}.nav a[aria-current=page]{background:color-mix(in srgb,var(--brand) 12%,var(--card));color:var(--brand);font-weight:650;border-color:transparent}.nav-icon{display:inline-block;width:23px;font-size:17px}.record-search{display:block;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);font:inherit;margin:12px 0}.views #memory .grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
276
- .record{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;padding:12px;background:var(--bg);border-radius:8px}
277
- @media(min-width:1100px){.wrap{max-width:1500px;padding-left:220px;position:relative}.nav{position:fixed;left:max(12px,calc((100vw - 1500px)/2 + 12px));top:24px;width:185px;display:flex;flex-direction:column;gap:7px;margin:0;padding:12px;background:var(--card);border:1px solid var(--line);border-radius:12px}.nav a{border-radius:7px;padding:8px 10px}}
278
- """
313
+ .callout{border-left:3px solid var(--brand);background:#15271b;padding:11px 13px;border-radius:0 4px 4px 0;font-size:12.5px}
314
+ .fold{padding:0}.fold>details{margin:0}
315
+ .fold>details>summary{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:15px 19px;color:var(--ink)}
316
+ .fold>details>summary::after{content:"+ expand";margin-left:auto;color:var(--brand);font-size:11px;font-weight:650}
317
+ .fold>details[open]>summary::after{content:"− collapse"}
318
+ .ft{font-weight:740;font-size:14px}.fs{color:var(--mut);font-size:11.5px;font-weight:400}
319
+ .fb{padding:0 19px 18px}
320
+ .nav{
321
+ position:sticky;top:0;z-index:5;display:flex;gap:7px;flex-wrap:wrap;
322
+ padding:9px 0;margin:-9px 0 18px;background:var(--bg);
323
+ }
324
+ .nav a{
325
+ border:1px solid var(--line);background:var(--card);border-radius:5px;
326
+ padding:6px 10px;color:var(--mut);text-decoration:none;font-size:12px;
327
+ }
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}
330
+ .nav-icon{display:inline-block;width:20px;font-size:15px;color:var(--mut)}
331
+ .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 .ar{color:var(--mut)}
336
+ .tabs{display:flex;gap:5px;flex-wrap:wrap;margin:15px 0 12px}
337
+ .tab{
338
+ border:1px solid var(--line);background:#0e1713;color:var(--mut);
339
+ border-radius:4px;padding:6px 10px;font:inherit;font-size:11.5px;cursor:pointer
340
+ }
341
+ .tab:hover{border-color:#4a7858;color:var(--ink)}
342
+ .tab.on{background:#1a3723;border-color:#387b4e;color:var(--brand);font-weight:700}
343
+ .tp[hidden],.views>[hidden],details[hidden]{display:none!important}
344
+ footer{color:var(--mut);font-size:11.5px;margin-top:25px;border-top:1px solid var(--line);padding-top:16px}
345
+ .record-search{
346
+ 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
348
+ }
349
+ .record-search::placeholder{color:var(--mut)}
350
+ .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
+ .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}
353
+ @media(min-width:1100px){
354
+ .wrap{max-width:1480px;padding-left:228px;position:relative}
355
+ .nav{
356
+ position:fixed;left:max(14px,calc((100vw - 1480px)/2 + 14px));top:24px;
357
+ width:194px;display:flex;flex-direction:column;gap:4px;
358
+ margin:0;padding:12px;background:var(--card);border:1px solid var(--line);border-radius:7px
359
+ }
360
+ .nav::before{content:"NAVIGATION";font-size:10px;letter-spacing:.14em;color:var(--mut);padding:4px 9px 9px}
361
+ .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}
363
+ }
364
+ @media(max-width:1099px){
365
+ .two{grid-template-columns:1fr!important}
366
+ }
367
+ @media(max-width:720px){
368
+ .wrap{padding:18px 12px 42px}
369
+ header{gap:12px;padding-bottom:16px}
370
+ h1{font-size:21px}
371
+ .badge{margin-left:0;margin-top:7px}
372
+ .grid4,.views #memory .grid4{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
373
+ .kpi{padding:12px}
374
+ .k-v{font-size:25px}
375
+ .card{padding:14px}
376
+ .nav{flex-wrap:nowrap;overflow-x:auto;padding-bottom:10px}
377
+ .nav a{flex:none;white-space:nowrap}
378
+ .nav-icon{width:auto;margin-right:5px}
379
+ th,td{padding:8px 6px}
380
+ iframe{height:410px}
381
+ }
382
+ @media(max-width:420px){.grid4,.views #memory .grid4{grid-template-columns:1fr}}
383
+ @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
+ }
279
390
 
391
+ """
280
392
 
281
393
  def _usd(v: float) -> str:
282
394
  return f"-${abs(v):.4f}" if v < 0 else f"${v:.4f}"
@@ -689,8 +801,8 @@ def build_html(project: Project, graph_href: str, include_details: bool = True)
689
801
 
690
802
  now = datetime.now().strftime("%Y-%m-%d %H:%M")
691
803
  return (f'<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
692
- f'<title>graphsnip dashboard</title><style>{CSS}</style></head><body><div class="wrap">'
693
- f'<header><div class="brand"><div class="logo">cg</div><div><h1>graphsnip <span class="badge{head_cls}">{e(head_label)}</span></h1>'
804
+ f'<title>CtxLoop · Intelligence Report</title><style>{CSS}</style></head><body data-report-theme="terminal"><div class="wrap">'
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>'
694
806
  f'<div class="sub">{e(project.root.name)} · generated {now} · v{__version__}</div></div></div><div class="chips">{"".join(chips)}</div></header>'
695
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>'
696
808
  f'<main class="views"><div class="grid4" id="top">{"".join(kpis)}</div>{"".join(sections)}</main>'
@@ -138,6 +138,9 @@ def test_dashboard_renders_and_escapes(repo):
138
138
  run_bench(str(repo), str(repo / "t2.json"))
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
+ assert 'data-report-theme="terminal"' in h
142
+ assert "<title>CtxLoop · Intelligence Report</title>" in h
143
+ assert "--bg:#090f0d" in h and "--brand:#63e58e" in h
141
144
  out = write_dashboard(p, bundle=str(repo / "bundle"))
142
145
  assert out.exists() and (repo / "bundle" / "graph.html").exists()
143
146
 
@@ -1,4 +0,0 @@
1
- from graphsnip.cli import main
2
-
3
- if __name__ == "__main__":
4
- main()
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