cc-transcript 4.0.0__tar.gz → 4.1.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_transcript-4.0.0 → cc_transcript-4.1.0}/PKG-INFO +1 -1
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/decisions.py +10 -10
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/extract/correct.py +2 -5
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/pyproject.toml +1 -1
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/Cargo.lock +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/Cargo.toml +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/LICENSE +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/README.md +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/__init__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/__main__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/_parser_rs.pyi +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/activity.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/backend.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/builders.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/cli.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/context.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/corrections.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/corrections_cli.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/discovery.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/disktruth.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/evidence.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/extract/__init__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/filterspec.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/ids.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/judge/__init__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/judge/llm.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/judge/verdicts.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/messages.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/__init__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/candidates.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/confidence.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/filterspec.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/formats.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/signals.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/sourcekind.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/mining/store.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/models.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/parser.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/py.typed +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/query.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/render.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/rust.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/sentiment/__init__.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/sentiment/buckets.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/sentiment/engine.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/sentiment/lexicon.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/sentiment/scorespec.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/store.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/cc_transcript/tools.py +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/Cargo.toml +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/data/afinn-en-165.tsv +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/data/domain_overrides.tsv +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/event.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/filter.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/lexicon.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/lib.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/model.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/score.rs +0 -0
- {cc_transcript-4.0.0 → cc_transcript-4.1.0}/rust/src/value.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""The unified decision ledger shared by every hook and gate writer.
|
|
2
2
|
|
|
3
|
-
One SQLite table (``
|
|
3
|
+
One SQLite table (``decisions``) records every allow/block/warn/nudge/note
|
|
4
4
|
decision across the family. Python (:class:`DecisionLog`) and cc-review's Go
|
|
5
5
|
daemon write the same file directly, so the DDL below is vendored
|
|
6
6
|
byte-identical into the Go repo and byte-compared in CI. Attribution joins by
|
|
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
|
|
|
22
22
|
from cc_transcript.ids import EventUuid, SessionId, ToolDigest
|
|
23
23
|
|
|
24
24
|
DECISIONS_DDL = """\
|
|
25
|
-
CREATE TABLE IF NOT EXISTS
|
|
25
|
+
CREATE TABLE IF NOT EXISTS decisions (
|
|
26
26
|
id INTEGER PRIMARY KEY,
|
|
27
27
|
ts_ms INTEGER NOT NULL,
|
|
28
28
|
session_id TEXT NOT NULL,
|
|
@@ -39,11 +39,11 @@ CREATE TABLE IF NOT EXISTS decisions_v1 (
|
|
|
39
39
|
UNIQUE (session_id, ts_ms, source, kind, tool_digest)
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
-
CREATE INDEX IF NOT EXISTS
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_session_ts ON decisions (session_id, ts_ms);
|
|
43
43
|
|
|
44
|
-
CREATE INDEX IF NOT EXISTS
|
|
44
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_tool_digest ON decisions (tool_digest);
|
|
45
45
|
|
|
46
|
-
CREATE INDEX IF NOT EXISTS
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_decisions_source_file ON decisions (source_file);
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
Action = Literal["allow", "block", "warn", "nudge", "note"]
|
|
@@ -92,7 +92,7 @@ class Decision:
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
class DecisionLog:
|
|
95
|
-
"""The ``
|
|
95
|
+
"""The ``decisions`` ledger at ``~/.cc-transcript/decisions.db``.
|
|
96
96
|
|
|
97
97
|
Opened in WAL mode with a busy timeout because cc-review's Go daemon
|
|
98
98
|
writes the same file concurrently. Durable by convention: rows are never
|
|
@@ -136,7 +136,7 @@ class DecisionLog:
|
|
|
136
136
|
re-running the same integer-ms timestamp.
|
|
137
137
|
"""
|
|
138
138
|
self.conn.execute(
|
|
139
|
-
f"INSERT OR IGNORE INTO
|
|
139
|
+
f"INSERT OR IGNORE INTO decisions ({DECISION_COLUMNS}) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
140
140
|
(
|
|
141
141
|
decision.ts_ms,
|
|
142
142
|
decision.session_id,
|
|
@@ -158,7 +158,7 @@ class DecisionLog:
|
|
|
158
158
|
return tuple(
|
|
159
159
|
decision_of(row)
|
|
160
160
|
for row in self.conn.execute(
|
|
161
|
-
"SELECT * FROM
|
|
161
|
+
"SELECT * FROM decisions WHERE session_id = ? ORDER BY ts_ms, id", (session_id,)
|
|
162
162
|
)
|
|
163
163
|
)
|
|
164
164
|
|
|
@@ -177,7 +177,7 @@ class DecisionLog:
|
|
|
177
177
|
``[near_ts_ms - window_ms, near_ts_ms]``.
|
|
178
178
|
"""
|
|
179
179
|
row = self.conn.execute(
|
|
180
|
-
"SELECT * FROM
|
|
180
|
+
"SELECT * FROM decisions WHERE session_id = ? AND tool_digest = ? AND ts_ms BETWEEN ? AND ?"
|
|
181
181
|
" ORDER BY ts_ms DESC, id DESC LIMIT 1",
|
|
182
182
|
(session_id, tool_digest, near_ts_ms - window_ms, near_ts_ms),
|
|
183
183
|
).fetchone()
|
|
@@ -205,7 +205,7 @@ class DecisionLog:
|
|
|
205
205
|
"""
|
|
206
206
|
kind_clause, kind_params = ("AND kind = ? ", (kind,)) if kind is not None else ("", ())
|
|
207
207
|
row = self.conn.execute(
|
|
208
|
-
f"SELECT * FROM
|
|
208
|
+
f"SELECT * FROM decisions WHERE session_id = ? AND event = ? {kind_clause}AND ts_ms BETWEEN ? AND ?"
|
|
209
209
|
" ORDER BY ABS(ts_ms - ?), id DESC LIMIT 1",
|
|
210
210
|
(session_id, event, *kind_params, near_ts_ms - window_ms, near_ts_ms + window_ms, near_ts_ms),
|
|
211
211
|
).fetchone()
|
|
@@ -167,12 +167,9 @@ async def extract_correction(
|
|
|
167
167
|
if log.for_anchor(anchor.session_id, anchor.event_uuid):
|
|
168
168
|
return None
|
|
169
169
|
pairs = await anyio.to_thread.run_sync(partial(harvest_pairs, activity, anchor, repo=repo))
|
|
170
|
-
if not pairs:
|
|
170
|
+
if not pairs or (turn := activity.turn_of(anchor)) is None:
|
|
171
171
|
return None
|
|
172
|
-
turn =
|
|
173
|
-
pick = await choose_pair(
|
|
174
|
-
pairs, feedback=feedback, anchor_turn=turn.index if turn else 0, tier=tier, backend=backend
|
|
175
|
-
)
|
|
172
|
+
pick = await choose_pair(pairs, feedback=feedback, anchor_turn=turn.index, tier=tier, backend=backend)
|
|
176
173
|
if pick is None or (row := lower_pair(activity, anchor, pick, source=source)) is None:
|
|
177
174
|
return None
|
|
178
175
|
if repo is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cc-transcript"
|
|
3
|
-
version = "4.
|
|
3
|
+
version = "4.1.0"
|
|
4
4
|
description = "The Claude Code session-activity platform: a superset JSONL parser (Rust fast path, Python reference), typed tool calls with a cross-language content digest, turns/edits/evidence over one spine, context windows with labeled fidelity, unified decision and correction ledgers, LLM judging, and a transcript-investigation CLI."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "PolyForm-Noncommercial-1.0.0"
|
|
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
|
|
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
|