Skip to main content

A frontend-agnostic core for the audio transcription workflow — composes isolated capability workers (audio conversion, VAD segmentation, batch transcription, persistence) into a headless pipeline, with a CLI as its first driver.

Project description

cjm-transcription-core

A frontend-agnostic core for the audio transcription workflow — composes isolated capability workers (audio conversion, VAD segmentation, batch transcription, persistence) into a headless pipeline, with a CLI as its first driver.

Modules

  • cjm_transcription_core.boundaries — Wall-clock-aware segment boundary computation: group VAD speech chunks into segments cut at silence-gap midpoints. Pure logic — no capability calls. Final home of the algorithm originally validated in cjm-transcription-audio-segment's AudioSegmentService.compute_segment_boundaries (that library is retired to cj-mills_deferred/).
  • cjm_transcription_core.cli — The CLI driver — the workflow core's first (and currently only) frontend. Ships in-package as the cjm-transcription-core console script so the driver can never skew from the core. GUI presentation drivers come later and consume the same pipeline module; they never reimplement it (CLI-first / headless-core principle).
  • cjm_transcription_core.emission — Graph-root emission (CR-18 revolution 2): a completed source EMITS Source -> AudioSegment -> Transcript into the shared context graph — the graph BEGINS at transcription (where-graph-begins resolution: ingestion is the first EXTENDER that plants the root). Deterministic identity tuples make emission idempotent: re-runs (cache hits included) collide into verified no-ops instead of duplicating roots (the E13 hazard, relocated into graph creation and discharged).
  • cjm_transcription_core.models — Data shapes for the transcription pipeline: run configuration + the run-manifest result containers. The run manifest is the pipeline's durable output record: which sources were processed, how they were segmented, and where each segment's transcription landed (capability data DBs remain the authoritative text store; the manifest records the run's shape + provenance pointers). It is a deliberate proto-bundle — the CR-20 provenance-bundle infrastructure is expected to absorb/replace it.
  • cjm_transcription_core.pipeline — The headless transcription pipeline: VAD analysis -> boundary computation -> segment cutting -> per-segment model-input conversion -> transcription, composed over capability workers via the substrate's JobQueue. Between-stage outputs are threaded manually (run job -> read result -> submit next); the per-segment fan-out rides a CR-16 ports Composition with OutputRef bindings (this module was the real-world consumer of the original submit_sequence piping gap — pass-2 evidence in claude-docs/pass-2-evidence.md). HITL approval seams use the cheapest viable form (log + optional CLI prompt) per the cores-cluster guard-rails; each seam carries its 5-field HITL-assist annotation in its docstring.
  • tests_manual.measure_cold_parallel_overlap_e2e — Cold-run parallel-overlap measurement (stage-5 closeout; the carried G11
  • tests_manual.validate_oom_backstop_e2e — OOM backstop stress test (stage-3 ledger): Voxtral-Small-24B on a 24GB GPU.
  • tests_manual.validate_stage8_sn1_both_transcribers_e2e — Stage-8 SN-I BOTH-TRANSCRIBER parity — the voxtral Option-C migration (build step 2).
  • tests_manual.validate_stage8_sn1_e2e — Stage-8 SN-I closeout — the whisper Option-C migration validated at scale.

API

cjm_transcription_core.boundaries

  • compute_segment_boundaries function — Group VAD chunks into segments cut at silence-gap midpoints.

cjm_transcription_core.cli

  • build_parser function — Build the CLI parser (subcommands: run).
  • load_capabilities function — Discover manifests + load each requested capability (default instance).
  • main function — CLI entry point (console script: cjm-transcription-core).
  • parse_max_concurrent function — Parse repeatable --max-concurrent NAME=N values into a per-capability cap map.
  • run_command function — Execute the run subcommand: full pipeline over the given audio files.

cjm_transcription_core.emission

  • build_source_emission function — Build the graph-root payload for one source (pure; no capability calls).
  • emit_source_graph function — Idempotently emit one source's graph root through the task channel.

cjm_transcription_core.models

  • PipelineConfig class — Configuration for one transcription pipeline run.
  • RunManifest class — Durable record of one pipeline run (proto-bundle; see CR-20).
  • SegmentRecord class — One segment of a source audio file, with per-transcriber transcripts.
  • SourceResult class — Pipeline result for one source audio file.
  • new_run_id function — Generate a unique, sortable run id.

cjm_transcription_core.pipeline

  • analyze_vad function — Run VAD analysis on one model-ready audio file (task channel: vad/detect_speech).
  • build_segment_composition function — Build the per-source fan-out composition: N independent [preprocess→]convert→(T× transcribe) pipes.
  • collect_capability_info function — Record capability identity + data-DB pointers for the run manifest (provenance).
  • confirm_seam function — HITL approval seam in its cheapest viable form (log + optional CLI prompt).
  • convert_for_vad function — Convert a source to MODEL-READY audio for VAD via the ffmpeg convert action.
  • cut_segments function — Cut the source audio at the computed boundaries via ffmpeg segment_audio.
  • normalize_vad_result function — Normalize a typed VAD result into sorted speech chunks + the reported duration.
  • probe_duration function — Probe a media file's duration via the ffmpeg capability's get_info action.
  • records_from_composition function — Fold a completed segment composition back into SegmentRecords.
  • run_pipeline function — Run the transcription pipeline over the given sources, in order.
  • run_source function — Run the full pipeline for one source: VAD → boundaries → cut → [preprocess →] convert → transcribe.
  • submit_and_wait function — Submit one capability job, wait for it, and return its result (raise on failure).
  • tier1_segment_checks function — Tier-1 deterministic pre-filters for the boundary-review seam (no AI).
  • tier1_transcript_checks function — Tier-1 deterministic pre-filters for the transcript-review seam (no AI).

tests_manual.measure_cold_parallel_overlap_e2e

  • lane_intervals function — (start, end) UTC intervals for completed jobs of one instance.
  • main function
  • merge function — Merge overlapping intervals so a side can't double-count itself.
  • overlap_seconds function — Total seconds where any interval of A overlaps any interval of B.
  • self_overlap_max function — Max simultaneously in-flight jobs within one lane + seconds at depth >= 2.

tests_manual.validate_oom_backstop_e2e

  • empirical_rows function
  • main function
  • pipe_composition function

tests_manual.validate_stage8_sn1_both_transcribers_e2e

  • check_discovery function — Milestone 1: {whisper, voxtral} compatible set, manifest-surface-based.
  • journal_max_seq function
  • journal_rows function
  • main function
  • run function

tests_manual.validate_stage8_sn1_e2e

  • journal_max_seq function
  • journal_rows function
  • main function
  • run function

Dependencies

Depends on: cjm-substrate

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

cjm_transcription_core-0.0.1.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjm_transcription_core-0.0.1-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file cjm_transcription_core-0.0.1.tar.gz.

File metadata

  • Download URL: cjm_transcription_core-0.0.1.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for cjm_transcription_core-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b0a14533b55c0bf81b8ce18985e668cbb37e566a25b573127cef68319850ca1f
MD5 5e0c738a9d17a6bf9bc16fad46de1be5
BLAKE2b-256 d26dcc4107f6341fa3adaf573ca7179a369f54022d3a1f4917bd02b19533dfac

See more details on using hashes here.

File details

Details for the file cjm_transcription_core-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_transcription_core-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e5691092aacf1f6662f3704d32406fa5b69b9266dbbef42d2d62067b27abfdd
MD5 b2286a20c8a56bcea6ac0d4ca6341b68
BLAKE2b-256 33d00b743ead4a4adf0e2e4948ea35495967844da37ec9873ac4ab1e07a5034f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page