cjm-transcript-correction-core 0.0.4__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {cjm_transcript_correction_core-0.0.4/cjm_transcript_correction_core.egg-info → cjm_transcript_correction_core-0.0.6}/PKG-INFO +103 -7
  2. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/README.md +99 -5
  3. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/__init__.py +1 -0
  4. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/cli.py +1581 -0
  5. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/graph.py +2566 -0
  6. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core/journal.py +21 -1
  7. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/launch.py +104 -0
  8. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/models.py +414 -0
  9. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core/pipeline.py +10 -5
  10. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core/signals.py +135 -2
  11. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/spine.py +1166 -0
  12. cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core/state.py +90 -0
  13. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6/cjm_transcript_correction_core.egg-info}/PKG-INFO +103 -7
  14. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core.egg-info/SOURCES.txt +7 -1
  15. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core.egg-info/requires.txt +3 -1
  16. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/pyproject.toml +1 -1
  17. cjm_transcript_correction_core-0.0.6/tests/test_bench.py +178 -0
  18. cjm_transcript_correction_core-0.0.6/tests/test_cli.py +132 -0
  19. cjm_transcript_correction_core-0.0.6/tests/test_gestures.py +717 -0
  20. cjm_transcript_correction_core-0.0.6/tests/test_graph.py +1052 -0
  21. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/tests/test_journal.py +9 -2
  22. cjm_transcript_correction_core-0.0.6/tests/test_models.py +128 -0
  23. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/tests/test_signals.py +31 -0
  24. cjm_transcript_correction_core-0.0.6/tests/test_state.py +54 -0
  25. cjm_transcript_correction_core-0.0.4/cjm_transcript_correction_core/__init__.py +0 -1
  26. cjm_transcript_correction_core-0.0.4/cjm_transcript_correction_core/cli.py +0 -220
  27. cjm_transcript_correction_core-0.0.4/cjm_transcript_correction_core/graph.py +0 -1024
  28. cjm_transcript_correction_core-0.0.4/cjm_transcript_correction_core/models.py +0 -196
  29. cjm_transcript_correction_core-0.0.4/tests/test_cli.py +0 -37
  30. cjm_transcript_correction_core-0.0.4/tests/test_graph.py +0 -274
  31. cjm_transcript_correction_core-0.0.4/tests/test_models.py +0 -60
  32. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/LICENSE +0 -0
  33. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/MANIFEST.in +0 -0
  34. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core.egg-info/dependency_links.txt +0 -0
  35. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core.egg-info/entry_points.txt +0 -0
  36. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/cjm_transcript_correction_core.egg-info/top_level.txt +0 -0
  37. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/setup.cfg +0 -0
  38. {cjm_transcript_correction_core-0.0.4 → cjm_transcript_correction_core-0.0.6}/tests/test_pipeline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cjm-transcript-correction-core
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: A frontend-agnostic core for the transcript correction workflow — the first downstream graph-extension core; composes the graph-storage capability worker into a headless pipeline that applies unified, non-destructive corrections (text, punctuation, segmentation) as a supersede-able overlay on a committed decomposition spine, recomputes the review worklist from deterministic signals, and exposes a CLI as its first driver.
5
5
  Author-email: "Christian J. Mills" <9126128+cj-mills@users.noreply.github.com>
6
6
  License: Apache-2.0
@@ -10,10 +10,12 @@ Classifier: Programming Language :: Python :: 3 :: Only
10
10
  Requires-Python: >=3.12
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: cjm_substrate>=0.0.57
13
+ Requires-Dist: cjm_substrate>=0.0.61
14
14
  Requires-Dist: cjm_context_graph_primitives>=0.0.15
15
+ Requires-Dist: cjm-capability-primitives>=0.0.12
15
16
  Requires-Dist: cjm-context-graph-layer>=0.0.11
16
17
  Requires-Dist: cjm-transcript-graph-schema>=0.0.7
18
+ Requires-Dist: numpy
17
19
  Dynamic: license-file
18
20
 
19
21
  # cjm-transcript-correction-core
@@ -24,59 +26,112 @@ A frontend-agnostic core for the transcript correction workflow — the first do
24
26
 
25
27
  ## Modules
26
28
 
29
+ - **`cjm_transcript_correction_core`**
27
30
  - **`cjm_transcript_correction_core.cli`** — The CLI driver — the correction core's first (and currently only) frontend. run <decomp-manifest> corrects the committed spine in the decomp graph DB, pointing the graph worker at that shared DB via load-time config, with optional session resume/reopen; review runs the interactive text-correction loop (the cross-transcriber diff is intra-graph since stage 5).
28
31
  - **`cjm_transcript_correction_core.graph`** — The correction overlay's graph I/O: targeted (scale-shaped) reads of a committed spine via the graph-storage query action, construction of Correction / CorrectionSession nodes + CORRECTS / SUPERSEDES / DERIVED_FROM / REVIEWED edges, the in-core effective-spine projection (layer-0 + applied corrections), and commit through the job queue. Hand-rolled (revolution-1) = direct CR-18 spec material; append-only on layer-0 (never update/delete a Segment).
29
32
  - **`cjm_transcript_correction_core.journal`** — Live append-through for the correction verbs — the workflow journal's domain half.
33
+ - **`cjm_transcript_correction_core.launch`** — The shared launch surface every correction shell drives through: the
30
34
  - **`cjm_transcript_correction_core.models`** — Overlay data shapes for the transcript-correction workflow: the Correction / CorrectionSession graph nodes + their relation registry, the read view of a committed spine segment, the worklist item, run configuration, and the correction run manifest (proto-bundle that chains decomp -> correction).
31
35
  - **`cjm_transcript_correction_core.pipeline`** — The headless correction workflow: load a decomp run manifest, resolve the shared graph DB, start/resume/reopen a CorrectionSession, recompute the worklist from deterministic signals + persisted review state, run the D14 empty-segment prune (first operation), and record a chainable correction run manifest — with a cheapest-form HITL approval seam.
32
- - **`cjm_transcript_correction_core.signals`** — Pure deterministic Tier-1 signal functions (no capability calls): empty-segment detection, bidirectional boundary punctuation/capitalization heuristics, forced-alignment coverage flags, positional cross-transcriber diff, and phonetic + edit-distance variant clustering. The worklist is recomputed from these each session; revolution-1 builds ZERO new capabilities.
36
+ - **`cjm_transcript_correction_core.signals`** — Pure deterministic Tier-1 signal functions (no capability calls): empty-segment detection, bidirectional boundary punctuation/capitalization heuristics, forced-alignment coverage flags, positional cross-transcriber diff, phonetic + edit-distance variant clustering, and the event-proposal overlay (leg 4: the finetuned detector's spans anchored onto the spine). The worklist is recomputed from these each session; revolution-1 builds ZERO new capabilities.
37
+ - **`cjm_transcript_correction_core.spine`**
38
+ - **`cjm_transcript_correction_core.state`** — Sidecar view-state + spine-picker helpers — the correction TUI's pure
33
39
 
34
40
  ## API
35
41
 
36
42
  ### `cjm_transcript_correction_core.cli`
37
43
 
44
+ - `bench_command` _function_ — Execute the `bench` subcommand: the reserved-tail verdict join.
38
45
  - `build_parser` _function_ — Build the CLI parser (subcommands: run, review).
46
+ - `export_command` _function_ — Execute `export-wordless-propset`: write one spine's effective wordless
47
+ - `extract_command` _function_ — Execute the `extract` subcommand: fold the gated overlay into a manifested dataset.
48
+ - `gate_command` _function_ — Execute the `gate` subcommand: show or assert per-spine extraction gates.
39
49
  - `load_capabilities` _function_ — Discover manifests + load each capability, passing per-capability config (CR-2 caller-wins).
40
50
  - `main` _function_ — CLI entry point (console script: `cjm-transcript-correction-core`).
51
+ - `overlay_event_rows` _function_ — Overlay span records -> dataset event rows for ONE spine (pure).
41
52
  - `review_command` _function_ — Execute the `review` subcommand: interactive text corrections over the flagged worklist.
42
53
  - `run_command` _function_ — Execute the `run` subcommand: correct a decomp manifest's committed spine.
54
+ - `run_extract` _function_ — The extract fold on an ALREADY-OPEN graph seat (flywheel build leg 2,
55
+ - `scan_command` _function_ — Execute `scan-mishomed`: flag authoritative FA words stranded outside
56
+ - `stats_command` _function_ — Execute the `stats` subcommand: flywheel accounting over the shared graph.
57
+ - `transfer_command` _function_ — Execute `transfer-wordless`: replay wordless event inserts across sibling spines.
58
+ - `wordless_donors` _function_ — The EFFECTIVE wordless layer of a spine: labeled, effectively wordless
43
59
 
44
60
  ### `cjm_transcript_correction_core.graph`
45
61
 
46
62
  - `active_corrections` _function_ — Filter to the effective correction set (the layer's resolve_active over a read superseded set).
63
+ - `active_speaker_assignments` _function_ — Project the ACTIVE speaker assignment per segment (latest-wins).
64
+ - `active_speech_overlays` _function_ — The surviving speech-overlay corrections (supersession applied; pure).
65
+ - `aggregate_session_purposes` _function_ — Fold sessions into a per-source purpose mix (pure; d915d545 picker rung).
66
+ - `apply_chunk_inserts` _function_ — Synthesize inserted chunks into the effective spine (DEC 3d3fa2a8).
67
+ - `apply_time_nudges` _function_ — Apply timing corrections onto segment times (latest-wins per edge).
68
+ - `bench_event_proposals` _function_ — The reserved-tail bench join (leg 4, DECs 8e05b87b + 8cf12c22) — pure.
47
69
  - `build_boundary_shift_correction` _function_ — Build a grouping Correction that moves text across one segment boundary.
70
+ - `build_chunk_insert_correction` _function_ — Build an insertion Correction that adds a chunk the skeleton never cut (DEC 3d3fa2a8).
71
+ - `build_chunk_split_corrections` _function_ — Compose a chunk SPLIT from the EXISTING verbs (work item 99c1d2ba) — no
48
72
  - `build_correction_node` _function_ — Construct a Correction overlay node (pure; commit happens separately).
73
+ - `build_extraction_gate_assertion` _function_ — Build one extraction-gate ASSERTION (DEC 8e05b87b — flywheel build leg 1).
49
74
  - `build_mark_correction` _function_ — Build a NON-MUTATING mark Correction (DEC 2a231843: routed attention).
50
75
  - `build_prune_amendment` _function_ — Build a grouping Correction that supersedes a prune with a REDUCED set (unprune).
51
76
  - `build_prune_correction` _function_ — Build one batch grouping Correction that prunes empty segments (D14).
52
77
  - `build_reject_review` _function_ — Build a review Correction that REJECTS a prior correction (reject-as-supersede).
78
+ - `build_speaker_assign_correction` _function_ — Build a speaker Correction — the assignment op envelope (DEC d6df3a8e).
79
+ - `build_speech_overlay_correction` _function_ — Build a NON-MUTATING speech-overlay Correction (check fc42614d, DEC 4e05a066).
53
80
  - `build_text_correction` _function_ — Build a text_content Correction + its CORRECTS (+ optional SUPERSEDES) edges.
81
+ - `build_time_nudge_correction` _function_ — Build a timing Correction that nudges segment boundary TIMES (node + CORRECTS edges).
54
82
  - `commit_boundary_shift_correction` _function_ — Commit a boundary-shift correction (node + CORRECTS x2 [+ SUPERSEDES]) + REVIEWED markers on both segments.
83
+ - `commit_chunk_insert_correction` _function_ — Commit a chunk insertion (node + CORRECTS per flank).
84
+ - `commit_chunk_insert_removal` _function_ — Remove an inserted chunk WITHOUT touching layer-0 (reject-as-supersede).
85
+ - `commit_chunk_split_correction` _function_ — Commit a chunk split: three composed nodes in ONE atomic batch + ONE journal op.
86
+ - `commit_chunk_split_removal` _function_ — UNSPLIT: remove a split's right half AND its whole group (one review
87
+ - `commit_extraction_gate` _function_ — Commit one extraction-gate assertion (node + GATES edge) — the journaled
55
88
  - `commit_mark_correction` _function_ — Commit a mark (node + CORRECTS per anchored segment [+ SUPERSEDES]).
56
89
  - `commit_mark_dismissal` _function_ — Dismiss an open mark WITHOUT a correction (reject-as-supersede).
57
90
  - `commit_nodes_edges` _function_ — Commit overlay nodes/edges through the layer's idempotent extend_graph.
58
91
  - `commit_prune_amendment` _function_ — Commit an unprune amendment (node + DERIVED_FROM edges + SUPERSEDES).
92
+ - `commit_speaker_assign_correction` _function_ — Commit a speaker assignment (node + CORRECTS per segment + ASSIGNS).
93
+ - `commit_speaker_entity` _function_ — Mint a source-spanning Entity into the shared registry (DEC 4ec6a49c).
94
+ - `commit_speech_overlay_correction` _function_ — Commit a speech overlay (node + CORRECTS [+ SUPERSEDES]).
95
+ - `commit_speech_overlay_removal` _function_ — Remove a speech overlay WITHOUT a replacement (reject-as-supersede).
59
96
  - `commit_text_correction` _function_ — Commit a text_content correction (node + CORRECTS [+ SUPERSEDES]) + a REVIEWED marker.
97
+ - `commit_time_nudge_correction` _function_ — Commit a time-nudge correction (node + CORRECTS per touched segment).
98
+ - `correction_stats` _function_ — Fold one Source's ACTIVE overlay into flywheel-accounting counts (pure).
60
99
  - `corrections_to_edits` _function_ — Map this core's Correction payloads onto the layer's spine-edit vocabulary.
61
- - `count_source_segments` _function_ — Count a Source's segments server-side under its chosen rendition (typed count mode).
100
+ - `count_source_segments` _function_ — Count a Source's segments server-side under its chosen rendition + skeleton (typed count mode).
101
+ - `extract_spine_dataset` _function_ — Fold ONE spine's overlay into its v1 insert-span dataset slice (pure).
102
+ - `fa_words_for_transcript` _function_ — One transcript's FA words in source coordinates (the scan-mishomed join,
62
103
  - `find_active_text_correction` _function_ — Single-segment convenience over the batch read (cross-session; latest wins).
63
104
  - `find_active_text_corrections_batch` _function_ — Active text corrections for MANY segments in TWO round-trips (C17).
105
+ - `find_chunk_split_group` _function_ — Resolve a split right-half's GROUP — the ac84360a group marker cashed in.
64
106
  - `find_corrections_for_session` _function_ — List corrections recorded in a session (typed property filter).
65
107
  - `find_prior_corrections_by_hash` _function_ — Cross-transcript correction-cache lookup (targeted; the graph IS the lexicon).
66
108
  - `get_session` _function_ — Fetch a CorrectionSession node by id (resume/reopen) — typed get, dict shape preserved.
109
+ - `labeled_insert_spans` _function_ — Fold the ACTIVE chunk inserts into span records with op-chain provenance (pure).
110
+ - `latest_extraction_gates` _function_ — Fold gate assertions into the live per-spine gate state (pure; latest-wins).
111
+ - `list_source_spines` _function_ — The SPINES coexisting under a Source's chosen rendition (DEC f1024568).
112
+ - `list_speaker_entities` _function_ — Read the source-spanning entity registry (the picker's registry tier).
67
113
  - `load_empty_segments` _function_ — Load ONLY a Source's empty-text segments under its chosen rendition (D14 prune).
114
+ - `load_extraction_gates` _function_ — Read one Source's live per-spine extraction gates (typed property filter).
68
115
  - `load_review_markers` _function_ — Load a session's review markers (typed edge projection over REVIEWED edges).
69
116
  - `load_source_corrections` _function_ — Load every Correction targeting a Source (across sessions) + the superseded-id set.
70
- - `load_source_segments` _function_ — Load a Source's fine Segment spine under its chosen rendition (typed query surface).
117
+ - `load_source_segments` _function_ — Load a Source's fine Segment spine under its chosen rendition + skeleton (typed query surface).
71
118
  - `load_variant_texts` _function_ — Resolve per-transcriber chunk texts from the segments' CharSlice refs.
72
119
  - `mark_anchor_segments` _function_ — Validate a mark anchor and list the Segment ids it touches.
120
+ - `negative_regions` _function_ — Complement the accounted spans below the watermark (pure; DEC 8e05b87b).
73
121
  - `open_marks` _function_ — Filter to the OPEN marks — the pass-2 worklist ('query open marks, walk them').
74
122
  - `project_effective_spine` _function_ — Project the effective spine = layer-0 + applied corrections.
75
123
  - `reanchor_span` _function_ — Re-locate a span anchor in text that may have been edited since mark time.
76
124
  - `record_review_markers` _function_ — Persist per-(session, segment) review markers as REVIEWED edges.
125
+ - `rename_speaker_entity` _function_ — Rename an Entity on its STABLE id — identification IS a rename (DEC 484e2d74).
126
+ - `reorder_gap_inserts` _function_ — Restore TIME order among stacked inserts after the nudge stage
77
127
  - `resolve_source_renditions` _function_ — Pick the AudioRendition set whose fine Segment spine correction operates on.
128
+ - `session_purposes_by_source` _function_ — Read every CorrectionSession once and fold the per-source purpose mix.
129
+ - `set_session_purpose` _function_ — Update a session's purpose + updated_at (the test-session hygiene tag, DEC c86714a4).
78
130
  - `set_session_status` _function_ — Update a session's status + updated_at.
131
+ - `skeleton_hash_for` _function_ — Resolve a skeleton selector to the chosen spine's HASH (pure) — the gate's
79
132
  - `source_audio_segment_ids` _function_ — The Source's coarse spine (one small typed read; ordered by index).
133
+ - `speech_overlay_spans` _function_ — Fold the ACTIVE speech overlays into extraction-facing span records (pure).
134
+ - `spine_where_for` _function_ — Resolve a skeleton selector against the observed spine set (pure).
80
135
  - `start_session` _function_ — Create + commit a new CorrectionSession node.
81
136
  - `submit_and_wait` _function_ — Submit one capability job, wait for it, return its result (raise on failure).
82
137
 
@@ -86,6 +141,11 @@ A frontend-agnostic core for the transcript correction workflow — the first do
86
141
  - `journal_correction_op` _function_ — Append one correction op — envelope + semantic args + the EXACT wires committed.
87
142
  - `segment_anchor` _function_ — The run-independent anchor stamped on every correction op (DEC ccbab9f5 point 5).
88
143
 
144
+ ### `cjm_transcript_correction_core.launch`
145
+
146
+ - `build_parser` _function_ — The TUI driver's argument surface (mirrors correction-core's run/review args).
147
+ - `resolve_settings` _function_ — Resolve the launch settings every shell shares (5daadfc4 workspace
148
+
89
149
  ### `cjm_transcript_correction_core.models`
90
150
 
91
151
  - `Correction` _class_ — A single non-destructive correction over the committed spine (overlay node).
@@ -93,8 +153,12 @@ A frontend-agnostic core for the transcript correction workflow — the first do
93
153
  - `CorrectionManifest` _class_ — Durable record of one correction run (proto-bundle; chainable, CR-20).
94
154
  - `CorrectionRelations` _class_ — Registry of edge types the correction overlay adds to the spine graph.
95
155
  - `CorrectionSession` _class_ — A resumable, reopen-able correction review over one or more sources.
156
+ - `DatasetManifest` _class_ — Durable record of one dataset extraction (chainable; DEC 16159e09).
157
+ - `Entity` _class_ — A source-spanning identity in the shared entity substrate (DEC 4ec6a49c).
158
+ - `ExtractionGate` _class_ — One per-spine extraction-gate ASSERTION (DEC 8e05b87b — flywheel build leg 1).
96
159
  - `SpineSegment` _class_ — A committed layer-0 Segment loaded from the graph (read view).
97
160
  - `WorklistItem` _class_ — One spine segment surfaced for review, with its deterministic Tier-1 flags.
161
+ - `new_dataset_id` _function_ — Generate a unique, sortable dataset id (the new_run_id pattern, dataset kind).
98
162
  - `new_run_id` _function_ — Generate a unique, sortable correction run id.
99
163
 
100
164
  ### `cjm_transcript_correction_core.pipeline`
@@ -115,12 +179,44 @@ A frontend-agnostic core for the transcript correction workflow — the first do
115
179
  - `cluster_variants` _function_ — Cluster word variants by phonetic key + edit distance (fix-one-fix-all).
116
180
  - `compute_signal_flags` _function_ — Combine all deterministic Tier-1 signals into per-segment flags.
117
181
  - `detect_empty_segments` _function_ — Find empty-text segments (silence VAD chunks with no aligned words; decomp D14).
182
+ - `event_span_proposals` _function_ — Anchor pending event proposals onto the spine — the propose lane's paint.
118
183
  - `fa_coverage_flags` _function_ — Flag segments whose forced-alignment coverage looks suspect (Tier-1).
119
184
  - `levenshtein` _function_ — Levenshtein edit distance (pure, in-core; variant-clustering primitive).
185
+ - `load_event_proposal_set` _function_ — Find the latest proposal set for a source (the turns-artifact discovery
120
186
  - `phonetic_key` _function_ — Compute a coarse phonetic key for a word (groups like-sounding variants).
187
+ - `speaker_turn_proposals` _function_ — Dominant diarization cluster per segment — the assign lane's proposal paint.
121
188
  - `variant_divergence` _function_ — Within-segment cross-transcriber divergence (stage 5: intra-graph).
122
189
 
190
+ ### `cjm_transcript_correction_core.spine`
191
+
192
+ - `ChunkRef` _class_ — Where one Segment's VAD-chunk audio lives: the model-input WAV + the chunk-local span.
193
+ - `SeamRef` _class_ — A source-coordinate audio span across one fine-spine boundary (the g/G
194
+ - `SpineView` _class_ — One Source's effective correction spine, cursor-windowed for the TUI.
195
+ - `list_sources` _function_ — Enumerate the graph's Source nodes (the discovery corpus, 2ce81638).
196
+ - `load_source_slice` _function_ — Decode a source-coordinate slice of the ORIGINAL media to playable samples.
197
+ - `match_sources` _function_ — The --source selector (pure; shared by direct open and the picker's seed).
198
+ - `neighbor_word_bound` _function_ — The adjacent word's FA boundary facing an overlay span (pure).
199
+ - `open_stack` _function_ — Bootstrap the graph capability stack, resolving the db path (2ce81638).
200
+ - `parse_entity_input` _function_ — Parse the new-speaker editor line (pure). A leading `?` marks the entity
201
+ - `parse_mark_input` _function_ — Parse the M-editor mark grammar (pure; the DEC 2a231843 TUI gesture).
202
+ - `plan_boundary_shift` _function_ — Plan a ONE-WORD boundary shift (the [ / ] gesture unit).
203
+ - `plan_chunk_insert` _function_ — Plan a chunk insertion into the seam after the cursor (the i gesture unit; pure).
204
+ - `plan_chunk_split` _function_ — Plan a chunk split at a caret position (the S gesture unit; pure).
205
+ - `plan_gate` _function_ — Plan an extraction-gate assertion (the F gesture unit; pure — DEC 8e05b87b).
206
+ - `plan_time_nudge` _function_ — Plan a boundary-time nudge (the ,/. and </> gesture unit; pure).
207
+ - `resolve_mark_class_token` _function_ — Resolve a leading digit token to its menu class (the M picker; pure).
208
+ - `segment_word_tokens` _function_ — Tokenize a segment's text into words WITH character offsets (pure).
209
+ - `snap_word_span` _function_ — Derive a word range's TIME span from FA word timestamps (pure; fc42614d).
210
+ - `source_status` _function_ — Correction-status-at-a-glance for one Source (the picker's detail row).
211
+
212
+ ### `cjm_transcript_correction_core.state`
213
+
214
+ - `load_tui_state` _function_ — Read the per-graph TUI sidecar state (last-focused positions).
215
+ - `save_tui_state` _function_ — Merge one source's view state into the sidecar state file.
216
+ - `selector_for_spine` _function_ — The selector value a picker choice persists (pure): the full skeleton
217
+ - `spine_label` _function_ — One picker row's config summary for a skeleton spine (pure).
218
+
123
219
  ## Dependencies
124
220
 
125
- **Depends on:** `cjm-context-graph-layer`, `cjm-context-graph-primitives`, `cjm-substrate`, `cjm-transcript-graph-schema`
126
- **Used by:** `cjm-transcript-correction-tui`
221
+ **Depends on:** `cjm-capability-primitives`, `cjm-context-graph-layer`, `cjm-context-graph-primitives`, `cjm-substrate`, `cjm-transcript-graph-schema`, `numpy`
222
+ **Used by:** `cjm-transcript-correction-qt`, `cjm-transcript-correction-tui`, `cjm-transcription-core`, `cjm-workflow-hub-qt`, `cjm-workflow-hub-tui`
@@ -6,59 +6,112 @@ A frontend-agnostic core for the transcript correction workflow — the first do
6
6
 
7
7
  ## Modules
8
8
 
9
+ - **`cjm_transcript_correction_core`**
9
10
  - **`cjm_transcript_correction_core.cli`** — The CLI driver — the correction core's first (and currently only) frontend. run <decomp-manifest> corrects the committed spine in the decomp graph DB, pointing the graph worker at that shared DB via load-time config, with optional session resume/reopen; review runs the interactive text-correction loop (the cross-transcriber diff is intra-graph since stage 5).
10
11
  - **`cjm_transcript_correction_core.graph`** — The correction overlay's graph I/O: targeted (scale-shaped) reads of a committed spine via the graph-storage query action, construction of Correction / CorrectionSession nodes + CORRECTS / SUPERSEDES / DERIVED_FROM / REVIEWED edges, the in-core effective-spine projection (layer-0 + applied corrections), and commit through the job queue. Hand-rolled (revolution-1) = direct CR-18 spec material; append-only on layer-0 (never update/delete a Segment).
11
12
  - **`cjm_transcript_correction_core.journal`** — Live append-through for the correction verbs — the workflow journal's domain half.
13
+ - **`cjm_transcript_correction_core.launch`** — The shared launch surface every correction shell drives through: the
12
14
  - **`cjm_transcript_correction_core.models`** — Overlay data shapes for the transcript-correction workflow: the Correction / CorrectionSession graph nodes + their relation registry, the read view of a committed spine segment, the worklist item, run configuration, and the correction run manifest (proto-bundle that chains decomp -> correction).
13
15
  - **`cjm_transcript_correction_core.pipeline`** — The headless correction workflow: load a decomp run manifest, resolve the shared graph DB, start/resume/reopen a CorrectionSession, recompute the worklist from deterministic signals + persisted review state, run the D14 empty-segment prune (first operation), and record a chainable correction run manifest — with a cheapest-form HITL approval seam.
14
- - **`cjm_transcript_correction_core.signals`** — Pure deterministic Tier-1 signal functions (no capability calls): empty-segment detection, bidirectional boundary punctuation/capitalization heuristics, forced-alignment coverage flags, positional cross-transcriber diff, and phonetic + edit-distance variant clustering. The worklist is recomputed from these each session; revolution-1 builds ZERO new capabilities.
16
+ - **`cjm_transcript_correction_core.signals`** — Pure deterministic Tier-1 signal functions (no capability calls): empty-segment detection, bidirectional boundary punctuation/capitalization heuristics, forced-alignment coverage flags, positional cross-transcriber diff, phonetic + edit-distance variant clustering, and the event-proposal overlay (leg 4: the finetuned detector's spans anchored onto the spine). The worklist is recomputed from these each session; revolution-1 builds ZERO new capabilities.
17
+ - **`cjm_transcript_correction_core.spine`**
18
+ - **`cjm_transcript_correction_core.state`** — Sidecar view-state + spine-picker helpers — the correction TUI's pure
15
19
 
16
20
  ## API
17
21
 
18
22
  ### `cjm_transcript_correction_core.cli`
19
23
 
24
+ - `bench_command` _function_ — Execute the `bench` subcommand: the reserved-tail verdict join.
20
25
  - `build_parser` _function_ — Build the CLI parser (subcommands: run, review).
26
+ - `export_command` _function_ — Execute `export-wordless-propset`: write one spine's effective wordless
27
+ - `extract_command` _function_ — Execute the `extract` subcommand: fold the gated overlay into a manifested dataset.
28
+ - `gate_command` _function_ — Execute the `gate` subcommand: show or assert per-spine extraction gates.
21
29
  - `load_capabilities` _function_ — Discover manifests + load each capability, passing per-capability config (CR-2 caller-wins).
22
30
  - `main` _function_ — CLI entry point (console script: `cjm-transcript-correction-core`).
31
+ - `overlay_event_rows` _function_ — Overlay span records -> dataset event rows for ONE spine (pure).
23
32
  - `review_command` _function_ — Execute the `review` subcommand: interactive text corrections over the flagged worklist.
24
33
  - `run_command` _function_ — Execute the `run` subcommand: correct a decomp manifest's committed spine.
34
+ - `run_extract` _function_ — The extract fold on an ALREADY-OPEN graph seat (flywheel build leg 2,
35
+ - `scan_command` _function_ — Execute `scan-mishomed`: flag authoritative FA words stranded outside
36
+ - `stats_command` _function_ — Execute the `stats` subcommand: flywheel accounting over the shared graph.
37
+ - `transfer_command` _function_ — Execute `transfer-wordless`: replay wordless event inserts across sibling spines.
38
+ - `wordless_donors` _function_ — The EFFECTIVE wordless layer of a spine: labeled, effectively wordless
25
39
 
26
40
  ### `cjm_transcript_correction_core.graph`
27
41
 
28
42
  - `active_corrections` _function_ — Filter to the effective correction set (the layer's resolve_active over a read superseded set).
43
+ - `active_speaker_assignments` _function_ — Project the ACTIVE speaker assignment per segment (latest-wins).
44
+ - `active_speech_overlays` _function_ — The surviving speech-overlay corrections (supersession applied; pure).
45
+ - `aggregate_session_purposes` _function_ — Fold sessions into a per-source purpose mix (pure; d915d545 picker rung).
46
+ - `apply_chunk_inserts` _function_ — Synthesize inserted chunks into the effective spine (DEC 3d3fa2a8).
47
+ - `apply_time_nudges` _function_ — Apply timing corrections onto segment times (latest-wins per edge).
48
+ - `bench_event_proposals` _function_ — The reserved-tail bench join (leg 4, DECs 8e05b87b + 8cf12c22) — pure.
29
49
  - `build_boundary_shift_correction` _function_ — Build a grouping Correction that moves text across one segment boundary.
50
+ - `build_chunk_insert_correction` _function_ — Build an insertion Correction that adds a chunk the skeleton never cut (DEC 3d3fa2a8).
51
+ - `build_chunk_split_corrections` _function_ — Compose a chunk SPLIT from the EXISTING verbs (work item 99c1d2ba) — no
30
52
  - `build_correction_node` _function_ — Construct a Correction overlay node (pure; commit happens separately).
53
+ - `build_extraction_gate_assertion` _function_ — Build one extraction-gate ASSERTION (DEC 8e05b87b — flywheel build leg 1).
31
54
  - `build_mark_correction` _function_ — Build a NON-MUTATING mark Correction (DEC 2a231843: routed attention).
32
55
  - `build_prune_amendment` _function_ — Build a grouping Correction that supersedes a prune with a REDUCED set (unprune).
33
56
  - `build_prune_correction` _function_ — Build one batch grouping Correction that prunes empty segments (D14).
34
57
  - `build_reject_review` _function_ — Build a review Correction that REJECTS a prior correction (reject-as-supersede).
58
+ - `build_speaker_assign_correction` _function_ — Build a speaker Correction — the assignment op envelope (DEC d6df3a8e).
59
+ - `build_speech_overlay_correction` _function_ — Build a NON-MUTATING speech-overlay Correction (check fc42614d, DEC 4e05a066).
35
60
  - `build_text_correction` _function_ — Build a text_content Correction + its CORRECTS (+ optional SUPERSEDES) edges.
61
+ - `build_time_nudge_correction` _function_ — Build a timing Correction that nudges segment boundary TIMES (node + CORRECTS edges).
36
62
  - `commit_boundary_shift_correction` _function_ — Commit a boundary-shift correction (node + CORRECTS x2 [+ SUPERSEDES]) + REVIEWED markers on both segments.
63
+ - `commit_chunk_insert_correction` _function_ — Commit a chunk insertion (node + CORRECTS per flank).
64
+ - `commit_chunk_insert_removal` _function_ — Remove an inserted chunk WITHOUT touching layer-0 (reject-as-supersede).
65
+ - `commit_chunk_split_correction` _function_ — Commit a chunk split: three composed nodes in ONE atomic batch + ONE journal op.
66
+ - `commit_chunk_split_removal` _function_ — UNSPLIT: remove a split's right half AND its whole group (one review
67
+ - `commit_extraction_gate` _function_ — Commit one extraction-gate assertion (node + GATES edge) — the journaled
37
68
  - `commit_mark_correction` _function_ — Commit a mark (node + CORRECTS per anchored segment [+ SUPERSEDES]).
38
69
  - `commit_mark_dismissal` _function_ — Dismiss an open mark WITHOUT a correction (reject-as-supersede).
39
70
  - `commit_nodes_edges` _function_ — Commit overlay nodes/edges through the layer's idempotent extend_graph.
40
71
  - `commit_prune_amendment` _function_ — Commit an unprune amendment (node + DERIVED_FROM edges + SUPERSEDES).
72
+ - `commit_speaker_assign_correction` _function_ — Commit a speaker assignment (node + CORRECTS per segment + ASSIGNS).
73
+ - `commit_speaker_entity` _function_ — Mint a source-spanning Entity into the shared registry (DEC 4ec6a49c).
74
+ - `commit_speech_overlay_correction` _function_ — Commit a speech overlay (node + CORRECTS [+ SUPERSEDES]).
75
+ - `commit_speech_overlay_removal` _function_ — Remove a speech overlay WITHOUT a replacement (reject-as-supersede).
41
76
  - `commit_text_correction` _function_ — Commit a text_content correction (node + CORRECTS [+ SUPERSEDES]) + a REVIEWED marker.
77
+ - `commit_time_nudge_correction` _function_ — Commit a time-nudge correction (node + CORRECTS per touched segment).
78
+ - `correction_stats` _function_ — Fold one Source's ACTIVE overlay into flywheel-accounting counts (pure).
42
79
  - `corrections_to_edits` _function_ — Map this core's Correction payloads onto the layer's spine-edit vocabulary.
43
- - `count_source_segments` _function_ — Count a Source's segments server-side under its chosen rendition (typed count mode).
80
+ - `count_source_segments` _function_ — Count a Source's segments server-side under its chosen rendition + skeleton (typed count mode).
81
+ - `extract_spine_dataset` _function_ — Fold ONE spine's overlay into its v1 insert-span dataset slice (pure).
82
+ - `fa_words_for_transcript` _function_ — One transcript's FA words in source coordinates (the scan-mishomed join,
44
83
  - `find_active_text_correction` _function_ — Single-segment convenience over the batch read (cross-session; latest wins).
45
84
  - `find_active_text_corrections_batch` _function_ — Active text corrections for MANY segments in TWO round-trips (C17).
85
+ - `find_chunk_split_group` _function_ — Resolve a split right-half's GROUP — the ac84360a group marker cashed in.
46
86
  - `find_corrections_for_session` _function_ — List corrections recorded in a session (typed property filter).
47
87
  - `find_prior_corrections_by_hash` _function_ — Cross-transcript correction-cache lookup (targeted; the graph IS the lexicon).
48
88
  - `get_session` _function_ — Fetch a CorrectionSession node by id (resume/reopen) — typed get, dict shape preserved.
89
+ - `labeled_insert_spans` _function_ — Fold the ACTIVE chunk inserts into span records with op-chain provenance (pure).
90
+ - `latest_extraction_gates` _function_ — Fold gate assertions into the live per-spine gate state (pure; latest-wins).
91
+ - `list_source_spines` _function_ — The SPINES coexisting under a Source's chosen rendition (DEC f1024568).
92
+ - `list_speaker_entities` _function_ — Read the source-spanning entity registry (the picker's registry tier).
49
93
  - `load_empty_segments` _function_ — Load ONLY a Source's empty-text segments under its chosen rendition (D14 prune).
94
+ - `load_extraction_gates` _function_ — Read one Source's live per-spine extraction gates (typed property filter).
50
95
  - `load_review_markers` _function_ — Load a session's review markers (typed edge projection over REVIEWED edges).
51
96
  - `load_source_corrections` _function_ — Load every Correction targeting a Source (across sessions) + the superseded-id set.
52
- - `load_source_segments` _function_ — Load a Source's fine Segment spine under its chosen rendition (typed query surface).
97
+ - `load_source_segments` _function_ — Load a Source's fine Segment spine under its chosen rendition + skeleton (typed query surface).
53
98
  - `load_variant_texts` _function_ — Resolve per-transcriber chunk texts from the segments' CharSlice refs.
54
99
  - `mark_anchor_segments` _function_ — Validate a mark anchor and list the Segment ids it touches.
100
+ - `negative_regions` _function_ — Complement the accounted spans below the watermark (pure; DEC 8e05b87b).
55
101
  - `open_marks` _function_ — Filter to the OPEN marks — the pass-2 worklist ('query open marks, walk them').
56
102
  - `project_effective_spine` _function_ — Project the effective spine = layer-0 + applied corrections.
57
103
  - `reanchor_span` _function_ — Re-locate a span anchor in text that may have been edited since mark time.
58
104
  - `record_review_markers` _function_ — Persist per-(session, segment) review markers as REVIEWED edges.
105
+ - `rename_speaker_entity` _function_ — Rename an Entity on its STABLE id — identification IS a rename (DEC 484e2d74).
106
+ - `reorder_gap_inserts` _function_ — Restore TIME order among stacked inserts after the nudge stage
59
107
  - `resolve_source_renditions` _function_ — Pick the AudioRendition set whose fine Segment spine correction operates on.
108
+ - `session_purposes_by_source` _function_ — Read every CorrectionSession once and fold the per-source purpose mix.
109
+ - `set_session_purpose` _function_ — Update a session's purpose + updated_at (the test-session hygiene tag, DEC c86714a4).
60
110
  - `set_session_status` _function_ — Update a session's status + updated_at.
111
+ - `skeleton_hash_for` _function_ — Resolve a skeleton selector to the chosen spine's HASH (pure) — the gate's
61
112
  - `source_audio_segment_ids` _function_ — The Source's coarse spine (one small typed read; ordered by index).
113
+ - `speech_overlay_spans` _function_ — Fold the ACTIVE speech overlays into extraction-facing span records (pure).
114
+ - `spine_where_for` _function_ — Resolve a skeleton selector against the observed spine set (pure).
62
115
  - `start_session` _function_ — Create + commit a new CorrectionSession node.
63
116
  - `submit_and_wait` _function_ — Submit one capability job, wait for it, return its result (raise on failure).
64
117
 
@@ -68,6 +121,11 @@ A frontend-agnostic core for the transcript correction workflow — the first do
68
121
  - `journal_correction_op` _function_ — Append one correction op — envelope + semantic args + the EXACT wires committed.
69
122
  - `segment_anchor` _function_ — The run-independent anchor stamped on every correction op (DEC ccbab9f5 point 5).
70
123
 
124
+ ### `cjm_transcript_correction_core.launch`
125
+
126
+ - `build_parser` _function_ — The TUI driver's argument surface (mirrors correction-core's run/review args).
127
+ - `resolve_settings` _function_ — Resolve the launch settings every shell shares (5daadfc4 workspace
128
+
71
129
  ### `cjm_transcript_correction_core.models`
72
130
 
73
131
  - `Correction` _class_ — A single non-destructive correction over the committed spine (overlay node).
@@ -75,8 +133,12 @@ A frontend-agnostic core for the transcript correction workflow — the first do
75
133
  - `CorrectionManifest` _class_ — Durable record of one correction run (proto-bundle; chainable, CR-20).
76
134
  - `CorrectionRelations` _class_ — Registry of edge types the correction overlay adds to the spine graph.
77
135
  - `CorrectionSession` _class_ — A resumable, reopen-able correction review over one or more sources.
136
+ - `DatasetManifest` _class_ — Durable record of one dataset extraction (chainable; DEC 16159e09).
137
+ - `Entity` _class_ — A source-spanning identity in the shared entity substrate (DEC 4ec6a49c).
138
+ - `ExtractionGate` _class_ — One per-spine extraction-gate ASSERTION (DEC 8e05b87b — flywheel build leg 1).
78
139
  - `SpineSegment` _class_ — A committed layer-0 Segment loaded from the graph (read view).
79
140
  - `WorklistItem` _class_ — One spine segment surfaced for review, with its deterministic Tier-1 flags.
141
+ - `new_dataset_id` _function_ — Generate a unique, sortable dataset id (the new_run_id pattern, dataset kind).
80
142
  - `new_run_id` _function_ — Generate a unique, sortable correction run id.
81
143
 
82
144
  ### `cjm_transcript_correction_core.pipeline`
@@ -97,12 +159,44 @@ A frontend-agnostic core for the transcript correction workflow — the first do
97
159
  - `cluster_variants` _function_ — Cluster word variants by phonetic key + edit distance (fix-one-fix-all).
98
160
  - `compute_signal_flags` _function_ — Combine all deterministic Tier-1 signals into per-segment flags.
99
161
  - `detect_empty_segments` _function_ — Find empty-text segments (silence VAD chunks with no aligned words; decomp D14).
162
+ - `event_span_proposals` _function_ — Anchor pending event proposals onto the spine — the propose lane's paint.
100
163
  - `fa_coverage_flags` _function_ — Flag segments whose forced-alignment coverage looks suspect (Tier-1).
101
164
  - `levenshtein` _function_ — Levenshtein edit distance (pure, in-core; variant-clustering primitive).
165
+ - `load_event_proposal_set` _function_ — Find the latest proposal set for a source (the turns-artifact discovery
102
166
  - `phonetic_key` _function_ — Compute a coarse phonetic key for a word (groups like-sounding variants).
167
+ - `speaker_turn_proposals` _function_ — Dominant diarization cluster per segment — the assign lane's proposal paint.
103
168
  - `variant_divergence` _function_ — Within-segment cross-transcriber divergence (stage 5: intra-graph).
104
169
 
170
+ ### `cjm_transcript_correction_core.spine`
171
+
172
+ - `ChunkRef` _class_ — Where one Segment's VAD-chunk audio lives: the model-input WAV + the chunk-local span.
173
+ - `SeamRef` _class_ — A source-coordinate audio span across one fine-spine boundary (the g/G
174
+ - `SpineView` _class_ — One Source's effective correction spine, cursor-windowed for the TUI.
175
+ - `list_sources` _function_ — Enumerate the graph's Source nodes (the discovery corpus, 2ce81638).
176
+ - `load_source_slice` _function_ — Decode a source-coordinate slice of the ORIGINAL media to playable samples.
177
+ - `match_sources` _function_ — The --source selector (pure; shared by direct open and the picker's seed).
178
+ - `neighbor_word_bound` _function_ — The adjacent word's FA boundary facing an overlay span (pure).
179
+ - `open_stack` _function_ — Bootstrap the graph capability stack, resolving the db path (2ce81638).
180
+ - `parse_entity_input` _function_ — Parse the new-speaker editor line (pure). A leading `?` marks the entity
181
+ - `parse_mark_input` _function_ — Parse the M-editor mark grammar (pure; the DEC 2a231843 TUI gesture).
182
+ - `plan_boundary_shift` _function_ — Plan a ONE-WORD boundary shift (the [ / ] gesture unit).
183
+ - `plan_chunk_insert` _function_ — Plan a chunk insertion into the seam after the cursor (the i gesture unit; pure).
184
+ - `plan_chunk_split` _function_ — Plan a chunk split at a caret position (the S gesture unit; pure).
185
+ - `plan_gate` _function_ — Plan an extraction-gate assertion (the F gesture unit; pure — DEC 8e05b87b).
186
+ - `plan_time_nudge` _function_ — Plan a boundary-time nudge (the ,/. and </> gesture unit; pure).
187
+ - `resolve_mark_class_token` _function_ — Resolve a leading digit token to its menu class (the M picker; pure).
188
+ - `segment_word_tokens` _function_ — Tokenize a segment's text into words WITH character offsets (pure).
189
+ - `snap_word_span` _function_ — Derive a word range's TIME span from FA word timestamps (pure; fc42614d).
190
+ - `source_status` _function_ — Correction-status-at-a-glance for one Source (the picker's detail row).
191
+
192
+ ### `cjm_transcript_correction_core.state`
193
+
194
+ - `load_tui_state` _function_ — Read the per-graph TUI sidecar state (last-focused positions).
195
+ - `save_tui_state` _function_ — Merge one source's view state into the sidecar state file.
196
+ - `selector_for_spine` _function_ — The selector value a picker choice persists (pure): the full skeleton
197
+ - `spine_label` _function_ — One picker row's config summary for a skeleton spine (pure).
198
+
105
199
  ## Dependencies
106
200
 
107
- **Depends on:** `cjm-context-graph-layer`, `cjm-context-graph-primitives`, `cjm-substrate`, `cjm-transcript-graph-schema`
108
- **Used by:** `cjm-transcript-correction-tui`
201
+ **Depends on:** `cjm-capability-primitives`, `cjm-context-graph-layer`, `cjm-context-graph-primitives`, `cjm-substrate`, `cjm-transcript-graph-schema`, `numpy`
202
+ **Used by:** `cjm-transcript-correction-qt`, `cjm-transcript-correction-tui`, `cjm-transcription-core`, `cjm-workflow-hub-qt`, `cjm-workflow-hub-tui`