fix: probe lane ffprobes the OPENED source, not the sealed frame

downloadSealed fetched raw bytes (getSealedObject) and handed ciphertext to
ffprobe — every direct upload failed 'Invalid data found'. The lane now uses
getObject, whose magic branch opens SPENC1 and SPENC2 alike.
This commit is contained in:
glass beadian 2026-10-16 11:21:08 +00:00
parent 11b7619653
commit df62aa88d4

View file

@ -166,7 +166,7 @@ export class ProduceRunner {
private async runProbe(job: ClaimedProduceJob): Promise<void> {
const directory = await mkdtemp(join(this.deps.scratchRoot, "probe-"));
try {
const bytes = await this.downloadSealed(job.source.storageKey);
const bytes = await this.downloadSource(job.source.storageKey);
const inputPath = join(directory, scratchAssetName(job.source.storageKey, "bin"));
await writeFile(inputPath, bytes, { mode: 0o600 });
await this.deps.jobs.progress(job.jobId, 50);
@ -195,13 +195,13 @@ export class ProduceRunner {
}
/**
* Fetch the sealed source. getSealedObject is the raw read (the api's twin);
* getObject then picks the frame branch by magic, so both SPENC1 (api-sealed)
* and SPENC2 (browser-sealed direct upload) sources probe identically here.
* Fetch the source PLAINTEXT: getObject picks the frame branch by magic, so
* SPENC1 (api-sealed) and SPENC2 (browser-sealed direct upload) sources open
* identically before ffprobe. getSealedObject stays for CEK-header reads.
*/
private async downloadSealed(storageKey: string): Promise<Buffer> {
private async downloadSource(storageKey: string): Promise<Buffer> {
try {
return await withTimeout(this.deps.storage.getSealedObject(storageKey), this.downloadTimeoutMs, "download failed");
return await withTimeout(this.deps.storage.getObject(storageKey), this.downloadTimeoutMs, "download failed");
} catch (error: unknown) {
if (error instanceof Error && error.name === "download failed") throw error;
throw produceError("download failed");