fix(core,producer): redact bare relative paths and the known input path

The generic scrub still missed a relative path with no `./` prefix:
`customer/acme-secret/video.mp4` and `assets/bgm.mp3` reached telemetry
completely unredacted, because the absolute rule needs a leading slash and
the `./` rule needs the dot. Adds a rule for them that still leaves `N/A`,
`24/1` and `48000/1001` alone.

Shape matching is a net with holes by construction, so audioPadTrim now
also redacts the exact path it put in the argv, plus its basename, before
the generic scrub runs. It built the argv, so it does not have to guess.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-08-04 02:23:35 -07:00
co-authored by Claude Opus 5
parent d04569e37f
commit e79ab3ab31
4 changed files with 110 additions and 6 deletions
@@ -30,7 +30,7 @@ import {
trackChildProcess,
type AudioMetadata,
} from "@hyperframes/engine";
import { redactTelemetryString } from "@hyperframes/core";
import { redactKnownPaths, redactTelemetryString } from "@hyperframes/core";
/**
* Tolerance used to decide whether an audio file is already short enough to
@@ -461,9 +461,14 @@ async function runFfprobeJson<T>(args: string[], signal?: AbortSignal): Promise<
throw outcome.error ?? new Error(outcome.stderr);
}
if (outcome.reason !== "exit" || outcome.exitCode !== 0) {
// Redacted: raw ffprobe stderr echoes the input path, and this message
// reaches logs and telemetry.
throw new Error(`ffprobe ${outcome.reason}: ${redactTelemetryString(outcome.stderr, 2000)}`);
// Redacted twice, deliberately. The shape-based scrub is a net with
// holes — it cannot know that `customer/acme-secret/video.mp4` is a path
// and `48000/1001` is not — but THIS caller knows the exact path it put
// in the argv, so it names it literally first. The message reaches logs,
// telemetry, and `PadTrimAudioResult.error`.
const probed = args[args.length - 1];
const scrubbed = redactKnownPaths(outcome.stderr, probed === undefined ? [] : [probed]);
throw new Error(`ffprobe ${outcome.reason}: ${redactTelemetryString(scrubbed, 2000)}`);
}
try {
return JSON.parse(stdout) as T;