recordingbackfill

command
v0.25.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command recordingbackfill migrates call-recording audio files (and their JSON sidecars) that were ingested before v0.21.2 (#164) and therefore still carry a raw phone number in plaintext:

  • filenames of the form {rawNumber}_{YYYYMMDDHHMMSS}[-N].{ext}, and/or
  • sidecars ({audioPath}.meta.json) with a plaintext "number" field.

Both are rewritten to the current scheme: filenames of the form {numHash}_{YYYYMMDDHHMMSS}[-N].{ext} and sidecars carrying "number_hash" only (see internal/api/ingest_recording.go). Renaming an audio file changes the SourceID that WhisperCollector computes for it ("transcript:"+relPath) — this tool renames the corresponding documents.source_id row in the SAME migration step so that the existing call-transcript document is neither re-transcribed nor orphaned. See internal/recordingbackfill's package doc for the full hazard analysis and crash-safety ordering.

Usage

recordingbackfill [--execute] [--dir <path>]

DRY_RUN is the default: with no flags, the tool only scans and logs the actions it WOULD take (no file or database mutation). Pass --execute to actually perform the migration. This mirrors a hard project rule from a past ops incident: scripts that mutate production data default to dry-run and require an explicit opt-in flag to mutate anything.

--dir overrides the recording root directory; it defaults to $WHISPER_AUDIO_DIR (the same directory WhisperCollector scans).

Idempotent: files already in the new scheme (hash-format filename with a number_hash-only sidecar) are detected and skipped on every run, so running this tool twice — or resuming after an interrupted --execute run — is safe.

Exit codes: 0 success, 1 on a fatal error OR when any file could not be migrated cleanly (skips due to an undetectable phone number, per-file errors, or source_id conflicts — see the logged summary for details).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL