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.
Project description
cjm-transcript-correction-core
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.
Modules
cjm_transcript_correction_core.cli— The CLI driver — the correction core's first (and currently only) frontend. run 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).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).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).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.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.tests.test_graph— Tests for cjm_transcript_correction_core.graph — overlay construction + effective spine.tests.test_models— Tests for cjm_transcript_correction_core.models — correction overlay data shapes.tests.test_signals— Tests for cjm_transcript_correction_core.signals — pure deterministic Tier-1 signals.
API
cjm_transcript_correction_core.cli
build_parserfunction — Build the CLI parser (subcommands: run, review).load_capabilitiesfunction — Discover manifests + load each capability, passing per-capability config (CR-2 caller-wins).mainfunction — CLI entry point (console script:cjm-transcript-correction-core).review_commandfunction — Execute thereviewsubcommand: interactive text corrections over the flagged worklist.run_commandfunction — Execute therunsubcommand: correct a decomp manifest's committed spine.
cjm_transcript_correction_core.graph
active_correctionsfunction — Filter to the effective correction set (the layer's resolve_active over a read superseded set).build_correction_nodefunction — Construct a Correction overlay node (pure; commit happens separately).build_prune_correctionfunction — Build one batch grouping Correction that prunes empty segments (D14).build_text_correctionfunction — Build a text_content Correction + its CORRECTS (+ optional SUPERSEDES) edges.commit_nodes_edgesfunction — Commit overlay nodes/edges through the layer's idempotent extend_graph.commit_text_correctionfunction — Commit a text_content correction (node + CORRECTS [+ SUPERSEDES]) + a REVIEWED marker.corrections_to_editsfunction — Map this core's Correction payloads onto the layer's spine-edit vocabulary.count_source_segmentsfunction — Count a Source's segments server-side under its chosen rendition (typed count mode).find_active_text_correctionfunction — Single-segment convenience over the batch read (cross-session; latest wins).find_active_text_corrections_batchfunction — Active text corrections for MANY segments in TWO round-trips (C17).find_corrections_for_sessionfunction — List corrections recorded in a session (typed property filter).find_prior_corrections_by_hashfunction — Cross-transcript correction-cache lookup (targeted; the graph IS the lexicon).get_sessionfunction — Fetch a CorrectionSession node by id (resume/reopen) — typed get, dict shape preserved.load_empty_segmentsfunction — Load ONLY a Source's empty-text segments under its chosen rendition (D14 prune).load_review_markersfunction — Load a session's review markers (typed edge projection over REVIEWED edges).load_source_correctionsfunction — Load every Correction targeting a Source (across sessions) + the superseded-id set.load_source_segmentsfunction — Load a Source's fine Segment spine under its chosen rendition (typed query surface).load_variant_textsfunction — Resolve per-transcriber chunk texts from the segments' CharSlice refs.project_effective_spinefunction — Project the effective spine = layer-0 + applied corrections.record_review_markersfunction — Persist per-(session, segment) review markers as REVIEWED edges.resolve_source_renditionsfunction — Pick the AudioRendition set whose fine Segment spine correction operates on.set_session_statusfunction — Update a session's status + updated_at.source_audio_segment_idsfunction — The Source's coarse spine (one small typed read; ordered by index).start_sessionfunction — Create + commit a new CorrectionSession node.submit_and_waitfunction — Submit one capability job, wait for it, return its result (raise on failure).
cjm_transcript_correction_core.models
Correctionclass — A single non-destructive correction over the committed spine (overlay node).CorrectionConfigclass — Configuration for one correction run.CorrectionManifestclass — Durable record of one correction run (proto-bundle; chainable, CR-20).CorrectionRelationsclass — Registry of edge types the correction overlay adds to the spine graph.CorrectionSessionclass — A resumable, reopen-able correction review over one or more sources.SpineSegmentclass — A committed layer-0 Segment loaded from the graph (read view).WorklistItemclass — One spine segment surfaced for review, with its deterministic Tier-1 flags.new_run_idfunction — Generate a unique, sortable correction run id.
cjm_transcript_correction_core.pipeline
collect_capability_infofunction — Record capability identity + data-DB pointers for the run manifest (provenance).compute_worklistfunction — Recompute the worklist from layer-0 + signals + review state (only decisions persist).confirm_seamfunction — HITL approval seam in its cheapest viable form (log + optional CLI prompt).load_decomp_manifestfunction — Load + lightly validate a decomp-core run manifest (untyped JSON; CR-20 interchange).prune_empty_segmentsfunction — First operation: prune empty (silence) segments as one grouping correction (D14).resolve_graph_db_pathfunction — Resolve the graph DB path: explicit override > the decomp manifest's recorded db_path.review_worklistfunction — Interactive review loop -> text_content corrections (cheapest HITL seam).run_correctionfunction — Correct every source in a decomp run manifest (prune + worklist surfacing).run_reviewfunction — Interactive review pass over a decomp manifest's flagged worklist (text corrections).
cjm_transcript_correction_core.signals
boundary_punct_caps_flagsfunction — Bidirectional boundary punctuation/capitalization heuristics (in-segment only).cluster_variantsfunction — Cluster word variants by phonetic key + edit distance (fix-one-fix-all).compute_signal_flagsfunction — Combine all deterministic Tier-1 signals into per-segment flags.detect_empty_segmentsfunction — Find empty-text segments (silence VAD chunks with no aligned words; decomp D14).fa_coverage_flagsfunction — Flag segments whose forced-alignment coverage looks suspect (Tier-1).levenshteinfunction — Levenshtein edit distance (pure, in-core; variant-clustering primitive).phonetic_keyfunction — Compute a coarse phonetic key for a word (groups like-sounding variants).variant_divergencefunction — Within-segment cross-transcriber divergence (stage 5: intra-graph).
tests.test_graph
test_build_prune_correctionfunctiontest_build_text_correction_and_active_filterfunctiontest_latest_wins_ordering_from_layerfunctiontest_project_effective_spine_prune_replace_supersedefunction
tests.test_models
test_correction_graph_node_mappingfunctiontest_correction_relations_registryfunctiontest_correction_session_nodefunctiontest_manifest_save_round_tripfunctiontest_manifest_shape_and_run_idfunctiontest_spine_segment_and_worklist_itemfunction
tests.test_signals
test_boundary_punct_caps_flagsfunctiontest_clustering_primitivesfunctiontest_compute_signal_flags_combinedfunctiontest_empty_and_coverage_flagsfunctiontest_variant_divergence_within_segmentfunction
Dependencies
Depends on: cjm-substrate
Used by: cjm-transcript-correction-tui
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cjm_transcript_correction_core-0.0.1.tar.gz.
File metadata
- Download URL: cjm_transcript_correction_core-0.0.1.tar.gz
- Upload date:
- Size: 40.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b3c7e93d2c98df2c78dc3129d959794c20e97eae0f0756714d095b0b767eab1
|
|
| MD5 |
a79cc028d016b99f6903ba990e3d2105
|
|
| BLAKE2b-256 |
878886c99e9958b084e34039b3eeaad85bd6ae5bcfb0d18586273b36e746549b
|
File details
Details for the file cjm_transcript_correction_core-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cjm_transcript_correction_core-0.0.1-py3-none-any.whl
- Upload date:
- Size: 37.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67f07248f14adb53241b39cc4344d83c088e8966a749eb00a6417cfcdaa77fca
|
|
| MD5 |
cd0fbcbfe5a7981082e509ab5c8821a7
|
|
| BLAKE2b-256 |
9cc2a22d2da559cfa20cc3c347d2b972abcd053b3bce0c0f804876eef88fe7cb
|