ctxloop 0.3.0__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.
- {ctxloop-0.3.0/src/ctxloop.egg-info → ctxloop-0.3.2}/PKG-INFO +11 -8
- {ctxloop-0.3.0 → ctxloop-0.3.2}/README.md +10 -7
- {ctxloop-0.3.0 → ctxloop-0.3.2}/pyproject.toml +2 -2
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop/__init__.py +5 -0
- ctxloop-0.3.2/src/ctxloop/__main__.py +4 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2/src/ctxloop.egg-info}/PKG-INFO +11 -8
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop.egg-info/entry_points.txt +1 -1
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/__init__.py +1 -1
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/cli.py +3 -3
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/dashboard.py +162 -50
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_integrations.py +7 -0
- ctxloop-0.3.0/src/ctxloop/__main__.py +0 -4
- {ctxloop-0.3.0 → ctxloop-0.3.2}/LICENSE +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/NOTICE +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/setup.cfg +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop.egg-info/SOURCES.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop.egg-info/dependency_links.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop.egg-info/requires.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/ctxloop.egg-info/top_level.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/__main__.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/ab.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/baseline.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/bench.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/engine.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/hooks.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/installer.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/ledger.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/mcp_server.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/memory_client.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/memory_eval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/probe.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/project.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/py.typed +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/retrieval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/router.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/semantic.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/shellfilter.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/slicer.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/tokens.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/src/graphsnip/usage.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_core.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_memory_client.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_memory_cross_runtime.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_memory_eval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_memory_integration.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.2}/tests/test_refresh.py +0 -0
- {ctxloop-0.3.0 → 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.
|
|
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
|
|
@@ -19,13 +19,16 @@ Provides-Extra: dev
|
|
|
19
19
|
Requires-Dist: pytest>=8; extra == "dev"
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
<div align="center">
|
|
23
|
+
<img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
**UNDERSTAND / REMEMBER / OPTIMIZE**
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
*Build context. Reuse intelligence. Repeat.*
|
|
27
28
|
|
|
28
|
-
|
|
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
|
|
81
|
+
pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
|
|
79
82
|
cd your-repo
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
**UNDERSTAND / REMEMBER / OPTIMIZE**
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
*Build context. Reuse intelligence. Repeat.*
|
|
6
7
|
|
|
7
|
-
|
|
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
|
|
60
|
+
pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
|
|
58
61
|
cd your-repo
|
|
59
|
-
|
|
60
|
-
|
|
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.
|
|
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"
|
|
@@ -21,7 +21,7 @@ semantic = ["fastembed>=0.3", "numpy>=1.24"]
|
|
|
21
21
|
dev = ["pytest>=8"]
|
|
22
22
|
|
|
23
23
|
[project.scripts]
|
|
24
|
-
ctxloop = "
|
|
24
|
+
ctxloop = "ctxloop:main"
|
|
25
25
|
graphsnip = "graphsnip.cli:main"
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ctxloop
|
|
3
|
-
Version: 0.3.
|
|
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
|
|
@@ -19,13 +19,16 @@ Provides-Extra: dev
|
|
|
19
19
|
Requires-Dist: pytest>=8; extra == "dev"
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
<div align="center">
|
|
23
|
+
<img src="assets/ctxloop.png" alt="CtxLoop terminal logo with infinity loop" width="750">
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
**UNDERSTAND / REMEMBER / OPTIMIZE**
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
*Build context. Reuse intelligence. Repeat.*
|
|
27
28
|
|
|
28
|
-
|
|
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
|
|
81
|
+
pipx install ctxloop # or: pipx install git+https://github.com/naubadnithinkumar/ctxloop
|
|
79
82
|
cd your-repo
|
|
80
|
-
|
|
81
|
-
|
|
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.
|
|
@@ -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=
|
|
475
|
-
ap.add_argument("--version", action="version", version=f"
|
|
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):
|
|
@@ -228,56 +228,168 @@ 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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
--
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
.
|
|
254
|
-
.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
.
|
|
262
|
-
|
|
263
|
-
.
|
|
234
|
+
|
|
235
|
+
:root{
|
|
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;
|
|
238
|
+
--bg:#090f0d;--card:#111a17;--ink:#e5eee8;--mut:#92a59a;--line:#2a3930;
|
|
239
|
+
--brand:#63e58e;--brand2:#63e58e;--grep:#8d9991;--gfy:#78a3b6;
|
|
240
|
+
--gfyread:#c0a876;--cg:#63e58e;--bad:#f18b81;--ok:#77e6a0;--warn:#efc073;
|
|
241
|
+
}
|
|
242
|
+
*{box-sizing:border-box}
|
|
243
|
+
html{scroll-behavior:smooth;scroll-padding-top:60px}
|
|
244
|
+
body{
|
|
245
|
+
margin:0;background:var(--bg);color:var(--ink);
|
|
246
|
+
font:13.5px/1.65 ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
|
|
247
|
+
-webkit-font-smoothing:antialiased;
|
|
248
|
+
}
|
|
249
|
+
::selection{background:var(--surface-1);color:#fff}
|
|
250
|
+
.wrap{max-width:1220px;margin:0 auto;padding:30px 24px 66px}
|
|
251
|
+
header{
|
|
252
|
+
display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:18px;
|
|
253
|
+
border-bottom:1px solid var(--line);margin-bottom:22px;padding-bottom:20px;
|
|
254
|
+
}
|
|
255
|
+
.brand{display:flex;align-items:center;gap:14px;min-width:0}
|
|
256
|
+
.logo{
|
|
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);
|
|
259
|
+
font-size:19px;font-weight:750;letter-spacing:-3px;padding-right:4px;
|
|
260
|
+
}
|
|
261
|
+
h1{font-size:24px;line-height:1.25;margin:0 0 7px;letter-spacing:-.05em;font-weight:760}
|
|
262
|
+
h2{font-size:15px;line-height:1.4;margin:0 0 5px;font-weight:740;letter-spacing:-.02em}
|
|
263
|
+
.sub{color:var(--mut);font-size:12px;line-height:1.65}
|
|
264
|
+
.chips{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
|
|
265
|
+
.chip{
|
|
266
|
+
background:var(--surface-4);border:1px solid var(--line);color:var(--mut);
|
|
267
|
+
border-radius:5px;padding:4px 9px;font-size:11.5px;white-space:normal
|
|
268
|
+
}
|
|
269
|
+
.chip b{color:var(--ink);font-weight:700}
|
|
270
|
+
.badge{
|
|
271
|
+
display:inline-block;vertical-align:middle;margin-left:7px;
|
|
272
|
+
background:var(--surface-5);border:1px solid var(--surface-6);border-radius:4px;
|
|
273
|
+
color:var(--brand);padding:3px 7px;font-size:10px;letter-spacing:0;font-weight:650
|
|
274
|
+
}
|
|
275
|
+
.badge.warn{background:var(--surface-7);border-color:var(--surface-8);color:var(--warn)}
|
|
276
|
+
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:14px}
|
|
277
|
+
.kpi{
|
|
278
|
+
background:var(--card);border:1px solid var(--line);border-radius:7px;
|
|
279
|
+
padding:17px 18px;min-width:0
|
|
280
|
+
}
|
|
281
|
+
.kpi.accent{background:var(--surface-9);border:1px solid var(--surface-10);color:var(--ink)}
|
|
282
|
+
.kpi.accent .k-l,.kpi.accent .k-s{color:var(--mut)}
|
|
283
|
+
.kpi.accent .k-v{color:var(--brand)}
|
|
284
|
+
.k-l{font-size:11px;color:var(--mut);font-weight:600;text-transform:uppercase;letter-spacing:.09em}
|
|
285
|
+
.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}
|
|
286
|
+
.k-s{font-size:11px;color:var(--mut);line-height:1.55}
|
|
287
|
+
.card{background:var(--card);border:1px solid var(--line);border-radius:7px;padding:19px 20px;margin-bottom:14px;min-width:0;overflow-x:auto}
|
|
288
|
+
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
|
|
289
|
+
.chart{width:100%;height:auto;display:block;min-width:0}
|
|
290
|
+
.chart .lbl{font-size:13px;fill:var(--ink)}
|
|
291
|
+
.chart .val{font-size:12px;fill:var(--mut)}
|
|
292
|
+
.chart .num{fill:var(--ink);font-weight:700}
|
|
293
|
+
.chart .axis{font-size:10.5px;fill:var(--mut)}
|
|
294
|
+
.chart .grid{stroke:var(--line);stroke-width:1;stroke-dasharray:3 4}
|
|
295
|
+
.b-grep{fill:var(--grep)}.b-gfy{fill:var(--gfy)}
|
|
296
|
+
.b-gfyread{fill:var(--gfyread)}.b-cg{fill:var(--cg)}
|
|
297
|
+
.area{fill:var(--cg);opacity:.1}
|
|
298
|
+
.l-base{stroke:var(--grep);stroke-width:2}
|
|
299
|
+
.l-ret{stroke:var(--cg);stroke-width:2.5}
|
|
300
|
+
.legend{display:flex;gap:15px;flex-wrap:wrap;font-size:11.5px;color:var(--mut);margin-top:12px}
|
|
301
|
+
.dot{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:6px;vertical-align:0}
|
|
302
|
+
table{width:100%;border-collapse:collapse;font-size:12px}
|
|
303
|
+
th,td{padding:10px 9px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
|
|
304
|
+
th{color:var(--mut);font-weight:650;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
|
|
305
|
+
td.r,th.r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
306
|
+
tbody tr:hover{background:var(--surface-11)}
|
|
307
|
+
.ok{color:var(--ok);font-weight:700}.no{color:var(--bad);font-weight:700}
|
|
308
|
+
.muted{color:var(--mut)}
|
|
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}
|
|
310
|
+
iframe{width:100%;height:550px;border:1px solid var(--line);border-radius:5px;background:var(--bg)}
|
|
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)}
|
|
314
|
+
details{margin-top:6px}summary{cursor:pointer;color:var(--brand);font-weight:650}
|
|
264
315
|
details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}
|
|
265
|
-
.
|
|
266
|
-
.fold
|
|
267
|
-
.
|
|
268
|
-
.
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
.
|
|
272
|
-
.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.
|
|
277
|
-
|
|
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}
|
|
317
|
+
.fold{padding:0}.fold>details{margin:0}
|
|
318
|
+
.fold>details>summary{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:15px 19px;color:var(--ink)}
|
|
319
|
+
.fold>details>summary::after{content:"+ expand";margin-left:auto;color:var(--brand);font-size:11px;font-weight:650}
|
|
320
|
+
.fold>details[open]>summary::after{content:"− collapse"}
|
|
321
|
+
.ft{font-weight:740;font-size:14px}.fs{color:var(--mut);font-size:11.5px;font-weight:400}
|
|
322
|
+
.fb{padding:0 19px 18px}
|
|
323
|
+
.nav{
|
|
324
|
+
position:sticky;top:0;z-index:5;display:flex;gap:7px;flex-wrap:wrap;
|
|
325
|
+
padding:9px 0;margin:-9px 0 18px;background:var(--bg);
|
|
326
|
+
}
|
|
327
|
+
.nav a{
|
|
328
|
+
border:1px solid var(--line);background:var(--card);border-radius:5px;
|
|
329
|
+
padding:6px 10px;color:var(--mut);text-decoration:none;font-size:12px;
|
|
330
|
+
}
|
|
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}
|
|
333
|
+
.nav-icon{display:inline-block;width:20px;font-size:15px;color:var(--mut)}
|
|
334
|
+
.flow{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:10px 0}
|
|
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)}
|
|
338
|
+
.flow .ar{color:var(--mut)}
|
|
339
|
+
.tabs{display:flex;gap:5px;flex-wrap:wrap;margin:15px 0 12px}
|
|
340
|
+
.tab{
|
|
341
|
+
border:1px solid var(--line);background:var(--surface-28);color:var(--mut);
|
|
342
|
+
border-radius:4px;padding:6px 10px;font:inherit;font-size:11.5px;cursor:pointer
|
|
343
|
+
}
|
|
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}
|
|
346
|
+
.tp[hidden],.views>[hidden],details[hidden]{display:none!important}
|
|
347
|
+
footer{color:var(--mut);font-size:11.5px;margin-top:25px;border-top:1px solid var(--line);padding-top:16px}
|
|
348
|
+
.record-search{
|
|
349
|
+
display:block;width:100%;padding:10px 12px;border:1px solid var(--line);
|
|
350
|
+
border-radius:4px;background:var(--surface-31);color:var(--ink);font:inherit;margin:12px 0
|
|
351
|
+
}
|
|
352
|
+
.record-search::placeholder{color:var(--mut)}
|
|
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}
|
|
354
|
+
.views #memory .grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
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}
|
|
356
|
+
@media(min-width:1100px){
|
|
357
|
+
.wrap{max-width:1480px;padding-left:228px;position:relative}
|
|
358
|
+
.nav{
|
|
359
|
+
position:fixed;left:max(14px,calc((100vw - 1480px)/2 + 14px));top:24px;
|
|
360
|
+
width:194px;display:flex;flex-direction:column;gap:4px;
|
|
361
|
+
margin:0;padding:12px;background:var(--card);border:1px solid var(--line);border-radius:7px
|
|
362
|
+
}
|
|
363
|
+
.nav::before{content:"NAVIGATION";font-size:10px;letter-spacing:.14em;color:var(--mut);padding:4px 9px 9px}
|
|
364
|
+
.nav a{border:1px solid transparent;border-radius:4px;padding:8px 9px;background:transparent}
|
|
365
|
+
.nav a[aria-current=page]{border-color:var(--surface-33);background:var(--surface-34)}
|
|
366
|
+
}
|
|
367
|
+
@media(max-width:1099px){
|
|
368
|
+
.two{grid-template-columns:1fr!important}
|
|
369
|
+
}
|
|
370
|
+
@media(max-width:720px){
|
|
371
|
+
.wrap{padding:18px 12px 42px}
|
|
372
|
+
header{gap:12px;padding-bottom:16px}
|
|
373
|
+
h1{font-size:21px}
|
|
374
|
+
.badge{margin-left:0;margin-top:7px}
|
|
375
|
+
.grid4,.views #memory .grid4{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
|
|
376
|
+
.kpi{padding:12px}
|
|
377
|
+
.k-v{font-size:25px}
|
|
378
|
+
.card{padding:14px}
|
|
379
|
+
.nav{flex-wrap:nowrap;overflow-x:auto;padding-bottom:10px}
|
|
380
|
+
.nav a{flex:none;white-space:nowrap}
|
|
381
|
+
.nav-icon{width:auto;margin-right:5px}
|
|
382
|
+
th,td{padding:8px 6px}
|
|
383
|
+
iframe{height:410px}
|
|
384
|
+
}
|
|
385
|
+
@media(max-width:420px){.grid4,.views #memory .grid4{grid-template-columns:1fr}}
|
|
386
|
+
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
|
|
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}}
|
|
278
391
|
"""
|
|
279
392
|
|
|
280
|
-
|
|
281
393
|
def _usd(v: float) -> str:
|
|
282
394
|
return f"-${abs(v):.4f}" if v < 0 else f"${v:.4f}"
|
|
283
395
|
|
|
@@ -689,13 +801,13 @@ 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>
|
|
693
|
-
f'<header><div class="brand"><div class="logo"
|
|
694
|
-
f'<div class="sub">{e(project.root.name)} · generated {now} · v{__version__}</div></div></div><div class="chips">{"".join(chips)}</div></header>'
|
|
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">>_</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)}<button type="button" class="btn theme-toggle" id="theme-toggle" aria-pressed="false">Light mode</button></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>'
|
|
697
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, '
|
|
698
|
-
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>')
|
|
699
811
|
|
|
700
812
|
|
|
701
813
|
_VIS_VERSION = "9.1.6"
|
|
@@ -138,6 +138,13 @@ 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 "<script>" in h
|
|
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
|
|
146
|
+
assert "<title>CtxLoop · Intelligence Report</title>" in h
|
|
147
|
+
assert "--bg:#090f0d" in h and "--brand:#63e58e" in h
|
|
141
148
|
out = write_dashboard(p, bundle=str(repo / "bundle"))
|
|
142
149
|
assert out.exists() and (repo / "bundle" / "graph.html").exists()
|
|
143
150
|
|
|
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
|
|
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
|