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.
- {ctxloop-0.3.0/src/ctxloop.egg-info → ctxloop-0.3.1}/PKG-INFO +11 -8
- {ctxloop-0.3.0 → ctxloop-0.3.1}/README.md +10 -7
- {ctxloop-0.3.0 → ctxloop-0.3.1}/pyproject.toml +2 -2
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop/__init__.py +5 -0
- ctxloop-0.3.1/src/ctxloop/__main__.py +4 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1/src/ctxloop.egg-info}/PKG-INFO +11 -8
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/entry_points.txt +1 -1
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/__init__.py +1 -1
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/cli.py +3 -3
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/dashboard.py +160 -48
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_integrations.py +3 -0
- ctxloop-0.3.0/src/ctxloop/__main__.py +0 -4
- {ctxloop-0.3.0 → ctxloop-0.3.1}/LICENSE +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/NOTICE +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/setup.cfg +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/SOURCES.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/dependency_links.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/requires.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/ctxloop.egg-info/top_level.txt +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/__main__.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/ab.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/baseline.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/bench.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/engine.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/hooks.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/installer.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/ledger.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/mcp_server.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/memory_client.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/memory_eval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/probe.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/project.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/py.typed +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/retrieval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/router.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/semantic.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/shellfilter.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/slicer.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/tokens.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/src/graphsnip/usage.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_core.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_client.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_cross_runtime.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_eval.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_memory_integration.py +0 -0
- {ctxloop-0.3.0 → ctxloop-0.3.1}/tests/test_refresh.py +0 -0
- {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.
|
|
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
|
-
|
|
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.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 = "
|
|
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.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
|
-
|
|
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):
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
.
|
|
266
|
-
.fold
|
|
267
|
-
.
|
|
268
|
-
.
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
.
|
|
272
|
-
.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.
|
|
277
|
-
|
|
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>
|
|
693
|
-
f'<header><div class="brand"><div class="logo"
|
|
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>'
|
|
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 "<script>" 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
|
|
|
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
|