cc-steer 0.9.0__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.
- cc_steer-0.9.0/LICENSE +133 -0
- cc_steer-0.9.0/PKG-INFO +116 -0
- cc_steer-0.9.0/README.md +79 -0
- cc_steer-0.9.0/cc_steer/__init__.py +1 -0
- cc_steer-0.9.0/cc_steer/__main__.py +6 -0
- cc_steer-0.9.0/cc_steer/assets/base.css +66 -0
- cc_steer-0.9.0/cc_steer/assets/dashboard.css +58 -0
- cc_steer-0.9.0/cc_steer/assets/index.html +44 -0
- cc_steer-0.9.0/cc_steer/assets/js/cards.js +38 -0
- cc_steer-0.9.0/cc_steer/assets/js/detail.js +20 -0
- cc_steer-0.9.0/cc_steer/assets/js/dom.js +27 -0
- cc_steer-0.9.0/cc_steer/assets/js/filters.js +116 -0
- cc_steer-0.9.0/cc_steer/assets/js/lineage.js +84 -0
- cc_steer-0.9.0/cc_steer/assets/js/main.js +64 -0
- cc_steer-0.9.0/cc_steer/assets/js/state.js +10 -0
- cc_steer-0.9.0/cc_steer/assets/js/stats.js +37 -0
- cc_steer-0.9.0/cc_steer/claude.py +64 -0
- cc_steer-0.9.0/cc_steer/cli.py +520 -0
- cc_steer-0.9.0/cc_steer/dashboard.py +261 -0
- cc_steer-0.9.0/cc_steer/detectors.py +162 -0
- cc_steer-0.9.0/cc_steer/enrich.py +171 -0
- cc_steer-0.9.0/cc_steer/evaluate.py +165 -0
- cc_steer-0.9.0/cc_steer/export.py +559 -0
- cc_steer-0.9.0/cc_steer/formats.py +108 -0
- cc_steer-0.9.0/cc_steer/golden_triage.json +401 -0
- cc_steer-0.9.0/cc_steer/models.py +10 -0
- cc_steer-0.9.0/cc_steer/py.typed +0 -0
- cc_steer-0.9.0/cc_steer/refine.py +176 -0
- cc_steer-0.9.0/cc_steer/report.py +505 -0
- cc_steer-0.9.0/cc_steer/scan.py +73 -0
- cc_steer-0.9.0/cc_steer/serve.py +44 -0
- cc_steer-0.9.0/cc_steer/sidecar.py +219 -0
- cc_steer-0.9.0/cc_steer/spec.py +37 -0
- cc_steer-0.9.0/cc_steer/store.py +428 -0
- cc_steer-0.9.0/cc_steer/triage.py +465 -0
- cc_steer-0.9.0/pyproject.toml +112 -0
cc_steer-0.9.0/LICENSE
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Required Notice: Copyright Yasyf Mohamedali (https://github.com/yasyf/cc-steer)
|
|
2
|
+
|
|
3
|
+
# PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree
|
|
10
|
+
to them as both strict obligations and conditions to all
|
|
11
|
+
your licenses.
|
|
12
|
+
|
|
13
|
+
## Copyright License
|
|
14
|
+
|
|
15
|
+
The licensor grants you a copyright license for the
|
|
16
|
+
software to do everything you might do with the software
|
|
17
|
+
that would otherwise infringe the licensor's copyright
|
|
18
|
+
in it for any permitted purpose. However, you may
|
|
19
|
+
only distribute the software according to [Distribution
|
|
20
|
+
License](#distribution-license) and make changes or new works
|
|
21
|
+
based on the software according to [Changes and New Works
|
|
22
|
+
License](#changes-and-new-works-license).
|
|
23
|
+
|
|
24
|
+
## Distribution License
|
|
25
|
+
|
|
26
|
+
The licensor grants you an additional copyright license
|
|
27
|
+
to distribute copies of the software. Your license
|
|
28
|
+
to distribute covers distributing the software with
|
|
29
|
+
changes and new works permitted by [Changes and New Works
|
|
30
|
+
License](#changes-and-new-works-license).
|
|
31
|
+
|
|
32
|
+
## Notices
|
|
33
|
+
|
|
34
|
+
You must ensure that anyone who gets a copy of any part of
|
|
35
|
+
the software from you also gets a copy of these terms or the
|
|
36
|
+
URL for them above, as well as copies of any plain-text lines
|
|
37
|
+
beginning with `Required Notice:` that the licensor provided
|
|
38
|
+
with the software. For example:
|
|
39
|
+
|
|
40
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
41
|
+
|
|
42
|
+
## Changes and New Works License
|
|
43
|
+
|
|
44
|
+
The licensor grants you an additional copyright license to
|
|
45
|
+
make changes and new works based on the software for any
|
|
46
|
+
permitted purpose.
|
|
47
|
+
|
|
48
|
+
## Patent License
|
|
49
|
+
|
|
50
|
+
The licensor grants you a patent license for the software that
|
|
51
|
+
covers patent claims the licensor can license, or becomes able
|
|
52
|
+
to license, that you would infringe by using the software.
|
|
53
|
+
|
|
54
|
+
## Noncommercial Purposes
|
|
55
|
+
|
|
56
|
+
Any noncommercial purpose is a permitted purpose.
|
|
57
|
+
|
|
58
|
+
## Personal Uses
|
|
59
|
+
|
|
60
|
+
Personal use for research, experiment, and testing for
|
|
61
|
+
the benefit of public knowledge, personal study, private
|
|
62
|
+
entertainment, hobby projects, amateur pursuits, or religious
|
|
63
|
+
observance, without any anticipated commercial application,
|
|
64
|
+
is use for a permitted purpose.
|
|
65
|
+
|
|
66
|
+
## Noncommercial Organizations
|
|
67
|
+
|
|
68
|
+
Use by any charitable organization, educational institution,
|
|
69
|
+
public research organization, public safety or health
|
|
70
|
+
organization, environmental protection organization,
|
|
71
|
+
or government institution is use for a permitted purpose
|
|
72
|
+
regardless of the source of funding or obligations resulting
|
|
73
|
+
from the funding.
|
|
74
|
+
|
|
75
|
+
## Fair Use
|
|
76
|
+
|
|
77
|
+
You may have "fair use" rights for the software under the
|
|
78
|
+
law. These terms do not limit them.
|
|
79
|
+
|
|
80
|
+
## No Other Rights
|
|
81
|
+
|
|
82
|
+
These terms do not allow you to sublicense or transfer any of
|
|
83
|
+
your licenses to anyone else, or prevent the licensor from
|
|
84
|
+
granting licenses to anyone else. These terms do not imply
|
|
85
|
+
any other licenses.
|
|
86
|
+
|
|
87
|
+
## Patent Defense
|
|
88
|
+
|
|
89
|
+
If you make any written claim that the software infringes or
|
|
90
|
+
contributes to infringement of any patent, your patent license
|
|
91
|
+
for the software granted under these terms ends immediately. If
|
|
92
|
+
your company makes such a claim, your patent license ends
|
|
93
|
+
immediately for work on behalf of your company.
|
|
94
|
+
|
|
95
|
+
## Violations
|
|
96
|
+
|
|
97
|
+
The first time you are notified in writing that you have
|
|
98
|
+
violated any of these terms, or done anything with the software
|
|
99
|
+
not covered by your licenses, your licenses can nonetheless
|
|
100
|
+
continue if you come into full compliance with these terms,
|
|
101
|
+
and take practical steps to correct past violations, within
|
|
102
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
103
|
+
end immediately.
|
|
104
|
+
|
|
105
|
+
## No Liability
|
|
106
|
+
|
|
107
|
+
***As far as the law allows, the software comes as is, without
|
|
108
|
+
any warranty or condition, and the licensor will not be liable
|
|
109
|
+
to you for any damages arising out of these terms or the use
|
|
110
|
+
or nature of the software, under any kind of legal claim.***
|
|
111
|
+
|
|
112
|
+
## Definitions
|
|
113
|
+
|
|
114
|
+
The **licensor** is the individual or entity offering these
|
|
115
|
+
terms, and the **software** is the software the licensor makes
|
|
116
|
+
available under these terms.
|
|
117
|
+
|
|
118
|
+
**You** refers to the individual or entity agreeing to these
|
|
119
|
+
terms.
|
|
120
|
+
|
|
121
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
122
|
+
or other kind of organization that you work for, plus all
|
|
123
|
+
organizations that have control over, are under the control of,
|
|
124
|
+
or are under common control with that organization. **Control**
|
|
125
|
+
means ownership of substantially all the assets of an entity,
|
|
126
|
+
or the power to direct its management and policies by vote,
|
|
127
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
128
|
+
|
|
129
|
+
**Your licenses** are all the licenses granted to you for the
|
|
130
|
+
software under these terms.
|
|
131
|
+
|
|
132
|
+
**Use** means anything you do with the software requiring one
|
|
133
|
+
of your licenses.
|
cc_steer-0.9.0/PKG-INFO
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cc-steer
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Your best training data is rotting in ~/.claude.
|
|
5
|
+
Keywords:
|
|
6
|
+
Author: Yasyf Mohamedali
|
|
7
|
+
Author-email: Yasyf Mohamedali <yasyfm@gmail.com>
|
|
8
|
+
License-Expression: PolyForm-Noncommercial-1.0.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Requires-Dist: anyio>=4.4
|
|
17
|
+
Requires-Dist: cc-transcript>=8,<9
|
|
18
|
+
Requires-Dist: click>=8
|
|
19
|
+
Requires-Dist: datasets>=3.2
|
|
20
|
+
Requires-Dist: fastapi>=0.115
|
|
21
|
+
Requires-Dist: huggingface-hub>=0.27
|
|
22
|
+
Requires-Dist: pydantic>=2
|
|
23
|
+
Requires-Dist: spawnllm>=0.5.1,<0.6
|
|
24
|
+
Requires-Dist: uvicorn>=0.30
|
|
25
|
+
Requires-Dist: pytest>=8.0 ; extra == 'dev'
|
|
26
|
+
Requires-Dist: ty>=0.0.44 ; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.8 ; extra == 'dev'
|
|
28
|
+
Requires-Dist: httpx>=0.27 ; extra == 'dev'
|
|
29
|
+
Requires-Python: >=3.13
|
|
30
|
+
Project-URL: Homepage, https://github.com/yasyf/cc-steer
|
|
31
|
+
Project-URL: Documentation, https://yasyf.github.io/cc-steer/
|
|
32
|
+
Project-URL: Repository, https://github.com/yasyf/cc-steer
|
|
33
|
+
Project-URL: Issues, https://github.com/yasyf/cc-steer/issues
|
|
34
|
+
Project-URL: Changelog, https://github.com/yasyf/cc-steer/blob/main/CHANGELOG.md
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# 
|
|
39
|
+
|
|
40
|
+
**Your best training data is rotting in ~/.claude.** cc-steer mines every correction, interrupt, and rejected plan from your transcripts into judge-refined, TRL-ready SFT/DPO/KTO pairs on HuggingFace.
|
|
41
|
+
|
|
42
|
+
[](https://github.com/yasyf/cc-steer/actions/workflows/ci.yml)
|
|
43
|
+
[](https://pypi.org/project/cc-steer/)
|
|
44
|
+
[](https://github.com/yasyf/cc-steer/blob/main/LICENSE)
|
|
45
|
+
|
|
46
|
+
## Get started
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uvx cc-steer scan
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
One pass over `~/.claude/projects` fills `~/.cc-steer/feedback.db` with every correction you typed, every plan you rejected, and every inline review comment — conversational context included. `stats` shows what landed:
|
|
53
|
+
|
|
54
|
+
<img src="https://github.com/yasyf/cc-steer/raw/main/docs/assets/demo.png" alt="Terminal running 'uvx cc-steer stats' — 980 steering events counted across four source kinds" width="700">
|
|
55
|
+
|
|
56
|
+
Driving with an agent? Paste this:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
Run `uvx cc-steer scan` to mine my Claude Code transcripts into ~/.cc-steer/feedback.db.
|
|
60
|
+
Then run `uvx cc-steer stats` and report how much steering was collected per source kind.
|
|
61
|
+
Docs: https://yasyf.github.io/cc-steer/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Use cases
|
|
67
|
+
|
|
68
|
+
### Build a training set from feedback you already gave
|
|
69
|
+
|
|
70
|
+
You've spent months telling Claude "no, not like that", and that signal evaporates as transcripts rotate out. Judge the corpus, then distill the accepted events into atomic pairs, the corrective ones grounded in the code they fault:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
uvx cc-steer triage
|
|
74
|
+
uvx cc-steer refine
|
|
75
|
+
uvx cc-steer enrich
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`uvx cc-steer pairs` prints the deliverable: training pairs distilled from your own steering, each carrying the conversational window and code evidence behind it.
|
|
79
|
+
|
|
80
|
+
### See how you actually steer, across every project
|
|
81
|
+
|
|
82
|
+
Your taste is mostly tacit — you notice a rule when it's violated. The corpus makes it legible:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
uvx cc-steer list --source plan_review
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
On my machine the split is 698 mid-session corrections, 219 rejected plans, 41 review comments, and 22 interrupts. Another machine's history folds in too: mirror it with rsync and point `scan --transcripts` at it (repeatable, so several mirrors fold into one scan).
|
|
89
|
+
|
|
90
|
+
### Push a private SFT/DPO/KTO dataset to your HuggingFace namespace
|
|
91
|
+
|
|
92
|
+
A judged corpus in SQLite trains nothing. Export projects it into TRL-ready configs:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
uvx cc-steer export --push
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
traces: train 1156 test 115
|
|
100
|
+
sft: train 499 test 67
|
|
101
|
+
dpo: train 363 test 44
|
|
102
|
+
kto: train 1156 test 115
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Four configs land as per-split parquet in a private `<hf-user>/cc-steer-traces`, next to a generated dataset card. Splits group on the session hash, so a session never straddles train and test.
|
|
106
|
+
|
|
107
|
+
## More in the docs
|
|
108
|
+
|
|
109
|
+
- **Incremental scanning** — content digests and one-transaction commits make re-scans cheap and interrupt-safe — [scan](https://yasyf.github.io/cc-steer/reference/cli/scan.html)
|
|
110
|
+
- **Judge, audit, eval** — prompt-versioned triage, a seeded audit sample, and mechanical metrics with no LLM calls — [triage](https://yasyf.github.io/cc-steer/reference/cli/triage.html)
|
|
111
|
+
- **Pair dashboard** — browse refined pairs and their full lineage in a local web UI — [view-samples](https://yasyf.github.io/cc-steer/reference/cli/view_samples.html)
|
|
112
|
+
- **Python API** — drive the scanner and the feedback store from your own code — [reference](https://yasyf.github.io/cc-steer/reference/)
|
|
113
|
+
|
|
114
|
+
Status: alpha — the pipeline runs end to end; the judge prompt still iterates (v6 today).
|
|
115
|
+
|
|
116
|
+
Read the [docs](https://yasyf.github.io/cc-steer/) for the full guide. Licensed under [PolyForm Noncommercial 1.0.0](LICENSE).
|
cc_steer-0.9.0/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 
|
|
2
|
+
|
|
3
|
+
**Your best training data is rotting in ~/.claude.** cc-steer mines every correction, interrupt, and rejected plan from your transcripts into judge-refined, TRL-ready SFT/DPO/KTO pairs on HuggingFace.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/yasyf/cc-steer/actions/workflows/ci.yml)
|
|
6
|
+
[](https://pypi.org/project/cc-steer/)
|
|
7
|
+
[](https://github.com/yasyf/cc-steer/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
## Get started
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uvx cc-steer scan
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
One pass over `~/.claude/projects` fills `~/.cc-steer/feedback.db` with every correction you typed, every plan you rejected, and every inline review comment — conversational context included. `stats` shows what landed:
|
|
16
|
+
|
|
17
|
+
<img src="https://github.com/yasyf/cc-steer/raw/main/docs/assets/demo.png" alt="Terminal running 'uvx cc-steer stats' — 980 steering events counted across four source kinds" width="700">
|
|
18
|
+
|
|
19
|
+
Driving with an agent? Paste this:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Run `uvx cc-steer scan` to mine my Claude Code transcripts into ~/.cc-steer/feedback.db.
|
|
23
|
+
Then run `uvx cc-steer stats` and report how much steering was collected per source kind.
|
|
24
|
+
Docs: https://yasyf.github.io/cc-steer/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Use cases
|
|
30
|
+
|
|
31
|
+
### Build a training set from feedback you already gave
|
|
32
|
+
|
|
33
|
+
You've spent months telling Claude "no, not like that", and that signal evaporates as transcripts rotate out. Judge the corpus, then distill the accepted events into atomic pairs, the corrective ones grounded in the code they fault:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uvx cc-steer triage
|
|
37
|
+
uvx cc-steer refine
|
|
38
|
+
uvx cc-steer enrich
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`uvx cc-steer pairs` prints the deliverable: training pairs distilled from your own steering, each carrying the conversational window and code evidence behind it.
|
|
42
|
+
|
|
43
|
+
### See how you actually steer, across every project
|
|
44
|
+
|
|
45
|
+
Your taste is mostly tacit — you notice a rule when it's violated. The corpus makes it legible:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uvx cc-steer list --source plan_review
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
On my machine the split is 698 mid-session corrections, 219 rejected plans, 41 review comments, and 22 interrupts. Another machine's history folds in too: mirror it with rsync and point `scan --transcripts` at it (repeatable, so several mirrors fold into one scan).
|
|
52
|
+
|
|
53
|
+
### Push a private SFT/DPO/KTO dataset to your HuggingFace namespace
|
|
54
|
+
|
|
55
|
+
A judged corpus in SQLite trains nothing. Export projects it into TRL-ready configs:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uvx cc-steer export --push
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
traces: train 1156 test 115
|
|
63
|
+
sft: train 499 test 67
|
|
64
|
+
dpo: train 363 test 44
|
|
65
|
+
kto: train 1156 test 115
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Four configs land as per-split parquet in a private `<hf-user>/cc-steer-traces`, next to a generated dataset card. Splits group on the session hash, so a session never straddles train and test.
|
|
69
|
+
|
|
70
|
+
## More in the docs
|
|
71
|
+
|
|
72
|
+
- **Incremental scanning** — content digests and one-transaction commits make re-scans cheap and interrupt-safe — [scan](https://yasyf.github.io/cc-steer/reference/cli/scan.html)
|
|
73
|
+
- **Judge, audit, eval** — prompt-versioned triage, a seeded audit sample, and mechanical metrics with no LLM calls — [triage](https://yasyf.github.io/cc-steer/reference/cli/triage.html)
|
|
74
|
+
- **Pair dashboard** — browse refined pairs and their full lineage in a local web UI — [view-samples](https://yasyf.github.io/cc-steer/reference/cli/view_samples.html)
|
|
75
|
+
- **Python API** — drive the scanner and the feedback store from your own code — [reference](https://yasyf.github.io/cc-steer/reference/)
|
|
76
|
+
|
|
77
|
+
Status: alpha — the pipeline runs end to end; the judge prompt still iterates (v6 today).
|
|
78
|
+
|
|
79
|
+
Read the [docs](https://yasyf.github.io/cc-steer/) for the full guide. Licensed under [PolyForm Noncommercial 1.0.0](LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Collect developer steering signals from existing Claude Code transcripts."""
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
:root{--bg:#0d1117;--panel:#161b22;--border:#30363d;--fg:#e6edf3;--muted:#8b949e;--accent:#58a6ff}
|
|
2
|
+
*{box-sizing:border-box}
|
|
3
|
+
body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}
|
|
4
|
+
h1,h2{font-weight:600}
|
|
5
|
+
header.top{padding:24px;border-bottom:1px solid var(--border)}
|
|
6
|
+
header.top .sub{color:var(--muted)}
|
|
7
|
+
section{padding:16px 24px}
|
|
8
|
+
.stat-cards{display:flex;gap:12px;flex-wrap:wrap}
|
|
9
|
+
.stat{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:12px 16px}
|
|
10
|
+
.stat .n{font-size:20px;font-weight:600}
|
|
11
|
+
.stat .l{color:var(--muted);font-size:12px}
|
|
12
|
+
table.dist{border-collapse:collapse;margin-top:14px}
|
|
13
|
+
table.dist td{padding:2px 10px 2px 0;white-space:nowrap}
|
|
14
|
+
.bar{display:inline-block;height:10px;background:var(--accent);border-radius:3px;vertical-align:middle}
|
|
15
|
+
.narrative{background:var(--panel);border:1px solid var(--border);border-left:3px solid var(--accent);
|
|
16
|
+
border-radius:8px;padding:14px 18px;max-width:80ch;margin-top:14px}
|
|
17
|
+
.card{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:12px 16px;margin:12px 0}
|
|
18
|
+
.card header{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
|
|
19
|
+
.badge{font-size:11px;padding:2px 8px;border-radius:10px;background:#21262d;border:1px solid var(--border)}
|
|
20
|
+
.badge-transcript_message{color:#8b949e}.badge-review_comment{color:#7ee787}.badge-plan_review{color:#d2a8ff}
|
|
21
|
+
.badge-interrupt_rejection{color:#ff7b72}.badge-superset_issue{color:#ffa657}
|
|
22
|
+
time{color:var(--muted);font-size:12px}
|
|
23
|
+
.chip{font-size:11px;color:var(--muted);background:#21262d;border-radius:6px;padding:1px 6px}
|
|
24
|
+
.text pre{white-space:pre-wrap;word-break:break-word;margin:0;font:inherit}
|
|
25
|
+
details.ctx{margin-top:10px}
|
|
26
|
+
details.ctx summary{color:var(--accent);cursor:pointer}
|
|
27
|
+
.turn{border-left:2px solid var(--border);padding:4px 0 4px 10px;margin:6px 0}
|
|
28
|
+
.turn .role{font-size:10px;text-transform:uppercase;color:var(--muted)}
|
|
29
|
+
.turn .tools{font-size:10px;color:var(--accent);margin-left:6px}
|
|
30
|
+
.turn pre{white-space:pre-wrap;word-break:break-word;margin:2px 0 0;font:inherit;color:var(--muted)}
|
|
31
|
+
.turn-user pre{color:var(--fg)}
|
|
32
|
+
.turn-trigger{border-left-color:var(--accent)}
|
|
33
|
+
.turn-trigger .role::after{content:" \2190 pushed back on";color:var(--accent)}
|
|
34
|
+
.lineage{display:flex;flex-direction:column;gap:14px}
|
|
35
|
+
.stage{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:12px 16px}
|
|
36
|
+
.stage h3{margin:0 0 10px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
|
|
37
|
+
.stage-detector{border-left:3px solid var(--muted)}
|
|
38
|
+
.stage-judge{border-left:3px solid var(--accent)}
|
|
39
|
+
.stage-auditor{border-left:3px solid #d2a8ff}
|
|
40
|
+
.stage-refiner{border-left:3px solid #7ee787}
|
|
41
|
+
.stage-golden{border-left:3px solid #ffa657}
|
|
42
|
+
.verdict,.pair{border:1px solid var(--border);border-radius:6px;padding:8px 10px;margin:8px 0}
|
|
43
|
+
.vhead{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
|
|
44
|
+
.vsum,.vrat,.paction,.pdirection{white-space:pre-wrap;word-break:break-word;margin:2px 0;font:inherit}
|
|
45
|
+
.vrat,.pdirection{color:var(--muted)}
|
|
46
|
+
.pverbatim{border-left:2px solid #7ee787;margin:6px 0;padding:2px 0 2px 10px;color:var(--fg)}
|
|
47
|
+
.orig pre{white-space:pre-wrap;word-break:break-word;margin:0 0 8px;color:var(--muted)}
|
|
48
|
+
mark{background:#7ee78733;color:var(--fg);border-radius:3px}
|
|
49
|
+
.evidence{margin-top:8px}
|
|
50
|
+
.panes{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}
|
|
51
|
+
.pane{flex:1;min-width:220px;border:1px solid var(--border);border-radius:6px;padding:6px 8px}
|
|
52
|
+
.pane .plabel{font-size:10px;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
|
|
53
|
+
.pane .del,.pane .ins{white-space:pre-wrap;word-break:break-word;padding:0 4px;border-radius:3px}
|
|
54
|
+
.pane .del{background:#ff7b7222}
|
|
55
|
+
.pane .ins{background:#7ee78722}
|
|
56
|
+
.pane .del::before{content:"- ";color:#ff7b72}
|
|
57
|
+
.pane .ins::before{content:"+ ";color:#7ee787}
|
|
58
|
+
.chip-git{color:#ffa657}
|
|
59
|
+
.flip{font-size:11px;color:#ffa657}
|
|
60
|
+
.agree{font-size:11px;color:#7ee787}
|
|
61
|
+
.disagree{font-size:11px;color:#ff7b72}
|
|
62
|
+
.muted{color:var(--muted)}
|
|
63
|
+
.badge.pass{color:#7ee787}.badge.fail{color:#ff7b72}
|
|
64
|
+
.cat-wrong_approach{color:#ff7b72}.cat-incorrect_change{color:#ffa657}.cat-unwanted_action{color:#f0883e}
|
|
65
|
+
.cat-style_violation{color:#d2a8ff}.cat-premature{color:#79c0ff}.cat-direction{color:#56d364}
|
|
66
|
+
.cat-operational_directive,.cat-status_update,.cat-new_task,.cat-question,.cat-other{color:#8b949e}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
header.top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
|
|
2
|
+
.head-right{display:flex;align-items:center;gap:12px}
|
|
3
|
+
#stat-strip{color:var(--muted);font-size:12px;text-align:right}
|
|
4
|
+
#stats-toggle{background:var(--panel);color:var(--fg);border:1px solid var(--border);
|
|
5
|
+
border-radius:8px;padding:4px 12px;cursor:pointer;font:inherit}
|
|
6
|
+
#stats.hidden{display:none}
|
|
7
|
+
.comp h2{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:18px 0 0}
|
|
8
|
+
.comp table.dist td{padding:3px 12px 3px 0}
|
|
9
|
+
.app{display:flex;align-items:flex-start}
|
|
10
|
+
#filters{width:236px;flex:none;position:sticky;top:0;max-height:100vh;overflow:auto;
|
|
11
|
+
padding:16px;border-right:1px solid var(--border)}
|
|
12
|
+
.facet-group{margin-bottom:18px}
|
|
13
|
+
.facet-group h3{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:0 0 8px}
|
|
14
|
+
.facet-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;
|
|
15
|
+
border:0;color:var(--fg);font:inherit;padding:4px 6px;border-radius:6px;cursor:pointer}
|
|
16
|
+
.facet-row:hover{background:var(--panel)}
|
|
17
|
+
.facet-row.on{background:var(--panel);box-shadow:inset 2px 0 0 var(--accent)}
|
|
18
|
+
.facet-row.empty{opacity:.4}
|
|
19
|
+
.facet-row .fcheck{width:12px;color:var(--accent)}
|
|
20
|
+
.facet-row .fv{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:130px}
|
|
21
|
+
.facet-count{margin-left:auto;color:var(--muted);font-size:11px}
|
|
22
|
+
main{flex:1;min-width:0;padding:0 24px 48px}
|
|
23
|
+
#toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;position:sticky;top:0;
|
|
24
|
+
background:var(--bg);padding:14px 0;z-index:2;border-bottom:1px solid var(--border)}
|
|
25
|
+
.views{display:flex;gap:6px}
|
|
26
|
+
.view-btn{background:var(--panel);color:var(--fg);border:1px solid var(--border);border-radius:14px;
|
|
27
|
+
padding:4px 12px;cursor:pointer;font:inherit}
|
|
28
|
+
.view-btn.active{background:var(--accent);color:#0d1117;border-color:var(--accent)}
|
|
29
|
+
#search{flex:1;min-width:200px;background:var(--panel);color:var(--fg);border:1px solid var(--border);
|
|
30
|
+
border-radius:6px;padding:6px 10px;font:inherit}
|
|
31
|
+
#count{color:var(--muted)}
|
|
32
|
+
#active{display:flex;flex-wrap:wrap;gap:6px;padding:10px 0}
|
|
33
|
+
#active:empty{display:none}
|
|
34
|
+
.achip{background:var(--panel);border:1px solid var(--border);border-radius:12px;color:var(--fg);
|
|
35
|
+
font:inherit;font-size:12px;padding:2px 10px;cursor:pointer}
|
|
36
|
+
.achip:hover{border-color:var(--accent)}
|
|
37
|
+
.achip.clear{color:var(--muted)}
|
|
38
|
+
.card{cursor:pointer}
|
|
39
|
+
.card:hover{border-color:var(--accent)}
|
|
40
|
+
.card.sel{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
|
|
41
|
+
.card-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
|
|
42
|
+
.direction{color:var(--accent);margin-top:6px}
|
|
43
|
+
.chip-lang{color:var(--accent);border:1px solid var(--accent)}
|
|
44
|
+
.st-refined{color:#7ee787}.st-accepted{color:#58a6ff}.st-noise{color:#8b949e}.st-unjudged{color:#6e7681}
|
|
45
|
+
details.diff{margin-top:8px}
|
|
46
|
+
details.diff summary{color:var(--accent);cursor:pointer}
|
|
47
|
+
#backdrop{position:fixed;inset:0;background:#00000066;opacity:0;pointer-events:none;
|
|
48
|
+
transition:opacity .22s ease;z-index:10}
|
|
49
|
+
#backdrop.open{opacity:1;pointer-events:auto}
|
|
50
|
+
#detail{position:fixed;top:0;right:0;height:100vh;width:min(760px,92vw);background:var(--bg);
|
|
51
|
+
border-left:1px solid var(--border);transform:translateX(100%);transition:transform .22s ease;
|
|
52
|
+
z-index:20;overflow:auto;box-shadow:-16px 0 40px #00000066}
|
|
53
|
+
#detail.open{transform:translateX(0)}
|
|
54
|
+
#detail-bar{position:sticky;top:0;display:flex;justify-content:flex-end;padding:8px;
|
|
55
|
+
background:var(--bg);border-bottom:1px solid var(--border)}
|
|
56
|
+
#detail-close{background:var(--panel);color:var(--fg);border:1px solid var(--border);
|
|
57
|
+
border-radius:8px;width:30px;height:30px;cursor:pointer;font:inherit}
|
|
58
|
+
#detail-body{padding:16px 24px}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>cc-steer dashboard</title>
|
|
7
|
+
<link rel="stylesheet" href="/static/base.css">
|
|
8
|
+
<link rel="stylesheet" href="/static/dashboard.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<header class="top">
|
|
12
|
+
<div>
|
|
13
|
+
<h1>cc-steer — training pairs</h1>
|
|
14
|
+
<div class="sub">refined pairs & their lineage</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="head-right">
|
|
17
|
+
<span id="stat-strip"></span>
|
|
18
|
+
<button id="stats-toggle">stats ▾</button>
|
|
19
|
+
</div>
|
|
20
|
+
</header>
|
|
21
|
+
<section id="stats" class="hidden"></section>
|
|
22
|
+
<div class="app">
|
|
23
|
+
<aside id="filters"></aside>
|
|
24
|
+
<main>
|
|
25
|
+
<div id="toolbar">
|
|
26
|
+
<div class="views">
|
|
27
|
+
<button class="view-btn active" data-view="pairs">refined pairs</button>
|
|
28
|
+
<button class="view-btn" data-view="candidates">all candidates</button>
|
|
29
|
+
</div>
|
|
30
|
+
<input id="search" type="search" placeholder="search…">
|
|
31
|
+
<span id="count"></span>
|
|
32
|
+
</div>
|
|
33
|
+
<div id="active"></div>
|
|
34
|
+
<div id="list"></div>
|
|
35
|
+
</main>
|
|
36
|
+
</div>
|
|
37
|
+
<div id="backdrop"></div>
|
|
38
|
+
<aside id="detail">
|
|
39
|
+
<div id="detail-bar"><button id="detail-close">✕</button></div>
|
|
40
|
+
<div id="detail-body"><p class="muted">select a row to see its lineage</p></div>
|
|
41
|
+
</aside>
|
|
42
|
+
<script type="module" src="/static/js/main.js"></script>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { state } from "./state.js";
|
|
2
|
+
import { esc, chip, badge, diffPane } from "./dom.js";
|
|
3
|
+
|
|
4
|
+
export function evidenceHtml(ev) {
|
|
5
|
+
if (!ev) return "";
|
|
6
|
+
const git = ev.source === "git" ? '<span class="chip chip-git">git</span>' : "";
|
|
7
|
+
const correct = ev.correct ? diffPane("correct", ev.correct) : "";
|
|
8
|
+
return `<details class="diff"><summary>code evidence</summary>` +
|
|
9
|
+
`<div class="vhead"><span class="chip">${esc(ev.file_path)}</span>${git}</div>` +
|
|
10
|
+
`<div class="panes">${diffPane("incorrect", ev.incorrect)}${correct}</div></details>`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function pairRow(r) {
|
|
14
|
+
const file = r.evidence ? `<span class="chip">${esc(r.evidence.file_path)}</span>` : "";
|
|
15
|
+
const lang = r.language ? `<span class="chip chip-lang">${esc(r.language)}</span>` : "";
|
|
16
|
+
return `<article class="card" data-key="${esc(r.dedup_key)}"><header class="card-head">` +
|
|
17
|
+
badge("cat-" + (r.category || "other"), r.category || "—") + badge("badge-" + r.source_kind, r.source_kind) +
|
|
18
|
+
`${chip(r.project)}<span class="chip">pair ${r.pair_index}</span>${file}${lang}</header>` +
|
|
19
|
+
`<div class="text"><pre>${esc(r.action)}</pre></div>` +
|
|
20
|
+
`<blockquote class="pverbatim">${esc(r.direction_verbatim)}</blockquote>` +
|
|
21
|
+
`<div class="direction">↳ ${esc(r.direction)}</div>${evidenceHtml(r.evidence)}</article>`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function candRow(r) {
|
|
25
|
+
const cat = r.category ? badge("cat-" + r.category, r.category) : "";
|
|
26
|
+
const pc = r.pair_count ? `<span class="chip">${r.pair_count} pairs</span>` : "";
|
|
27
|
+
const flip = r.flipped ? '<span class="flip">flip</span>' : "";
|
|
28
|
+
const agree = r.agreement ? `<span class="${esc(r.agreement)}">${esc(r.agreement)}</span>` : "";
|
|
29
|
+
const gold = r.golden ? badge(r.golden, "golden " + r.golden) : "";
|
|
30
|
+
return `<article class="card" data-key="${esc(r.dedup_key)}"><header class="card-head">` +
|
|
31
|
+
badge("st-" + r.status, r.status) + cat + badge("badge-" + r.source_kind, r.source_kind) +
|
|
32
|
+
`${chip(r.project)}${pc}${flip}${agree}${gold}</header>` +
|
|
33
|
+
`<div class="text"><pre>${esc(r.text)}</pre></div></article>`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function rowHtml(r) {
|
|
37
|
+
return state.view === "pairs" ? pairRow(r) : candRow(r);
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { state } from "./state.js";
|
|
2
|
+
import { lineageHtml } from "./lineage.js";
|
|
3
|
+
|
|
4
|
+
export function openDetail(key) {
|
|
5
|
+
for (const c of state.cards) c.classList.toggle("sel", c.dataset.key === key);
|
|
6
|
+
document.getElementById("detail").classList.add("open");
|
|
7
|
+
document.getElementById("backdrop").classList.add("open");
|
|
8
|
+
const body = document.getElementById("detail-body");
|
|
9
|
+
body.innerHTML = '<p class="muted">loading…</p>';
|
|
10
|
+
body.scrollTop = 0;
|
|
11
|
+
fetch("/api/lineage/" + encodeURIComponent(key))
|
|
12
|
+
.then((res) => res.ok ? res.json().then(lineageHtml) : '<p class="muted">no lineage</p>')
|
|
13
|
+
.then((html) => { body.innerHTML = html; });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function closeDetail() {
|
|
17
|
+
document.getElementById("detail").classList.remove("open");
|
|
18
|
+
document.getElementById("backdrop").classList.remove("open");
|
|
19
|
+
for (const c of state.cards) c.classList.remove("sel");
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Small HTML-building helpers shared across the renderers. esc() is the single
|
|
2
|
+
// escape point — every value interpolated into markup must pass through it.
|
|
3
|
+
export function esc(s) {
|
|
4
|
+
return (s == null ? "" : String(s))
|
|
5
|
+
.replaceAll("&", "&")
|
|
6
|
+
.replaceAll("<", "<")
|
|
7
|
+
.replaceAll(">", ">")
|
|
8
|
+
.replaceAll('"', """)
|
|
9
|
+
.replaceAll("'", "'");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function chip(t) {
|
|
13
|
+
return t ? `<span class="chip">${esc(t)}</span>` : "";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function badge(cls, t) {
|
|
17
|
+
return `<span class="badge ${cls}">${esc(t)}</span>`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function diffLines(cls, text) {
|
|
21
|
+
return text.split("\n").map((l) => `<div class="${cls}">${esc(l)}</div>`).join("");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function diffPane(label, side) {
|
|
25
|
+
return `<div class="pane"><div class="plabel">${esc(label)}</div>` +
|
|
26
|
+
diffLines("del", side.old) + diffLines("ins", side.new) + "</div>";
|
|
27
|
+
}
|