automovie 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -139
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.d.ts +5 -2
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js +6 -2
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.d.ts +3 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js +3 -1
- package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js.map +1 -1
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.d.ts +5 -2
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js +5 -2
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_RENDER_OPTIONS.d.ts +6 -2
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js +8 -2
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js.map +1 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.d.ts +3 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js +12 -1
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js.map +1 -1
- package/lib/AutoMovieCaptureBackend.d.ts +4 -6
- package/lib/AutoMovieCaptureHost.d.ts +73 -53
- package/lib/AutoMovieCaptureHost.js +89 -56
- package/lib/AutoMovieCaptureHost.js.map +1 -1
- package/lib/AutoMovieCommand.d.ts +69 -20
- package/lib/AutoMovieFfmpegStaticPath.d.ts +6 -0
- package/lib/AutoMovieFfmpegStaticPath.js +3 -0
- package/lib/AutoMovieFfmpegStaticPath.js.map +1 -0
- package/lib/AutoMovieMp4Boxes.d.ts +78 -0
- package/lib/AutoMovieMp4Boxes.js +227 -0
- package/lib/AutoMovieMp4Boxes.js.map +1 -0
- package/lib/AutoMovieRenderOutputReservation.d.ts +18 -0
- package/lib/AutoMovieRenderOutputReservation.js +118 -0
- package/lib/AutoMovieRenderOutputReservation.js.map +1 -0
- package/lib/IAutoMovieChromium.d.ts +13 -57
- package/lib/IAutoMovieDeliveryAudioTrack.d.ts +17 -0
- package/lib/IAutoMovieDeliveryAudioTrack.js +3 -0
- package/lib/IAutoMovieDeliveryAudioTrack.js.map +1 -0
- package/lib/IAutoMovieDeliveryProfileFinding.d.ts +21 -0
- package/lib/IAutoMovieDeliveryProfileFinding.js +3 -0
- package/lib/IAutoMovieDeliveryProfileFinding.js.map +1 -0
- package/lib/IAutoMovieFfmpegSources.d.ts +11 -0
- package/lib/IAutoMovieFfmpegSources.js +3 -0
- package/lib/IAutoMovieFfmpegSources.js.map +1 -0
- package/lib/IAutoMovieReviewObservation.d.ts +66 -0
- package/lib/IAutoMovieReviewObservation.js +3 -0
- package/lib/IAutoMovieReviewObservation.js.map +1 -0
- package/lib/IAutoMovieVerification.d.ts +163 -0
- package/lib/IAutoMovieVerification.js +3 -0
- package/lib/IAutoMovieVerification.js.map +1 -0
- package/lib/auditAutoMovieAlphaSamples.d.ts +23 -0
- package/lib/auditAutoMovieAlphaSamples.js +183 -0
- package/lib/auditAutoMovieAlphaSamples.js.map +1 -0
- package/lib/auditAutoMovieDeliveryProfile.d.ts +33 -0
- package/lib/auditAutoMovieDeliveryProfile.js +93 -0
- package/lib/auditAutoMovieDeliveryProfile.js.map +1 -0
- package/lib/captureAutoMovie.d.ts +23 -11
- package/lib/captureAutoMovie.js +102 -18
- package/lib/captureAutoMovie.js.map +1 -1
- package/lib/createAutoMovieDeliveryAudioLog.d.ts +31 -0
- package/lib/createAutoMovieDeliveryAudioLog.js +110 -0
- package/lib/createAutoMovieDeliveryAudioLog.js.map +1 -0
- package/lib/createAutoMovieDeliveryAudioScan.d.ts +39 -0
- package/lib/createAutoMovieDeliveryAudioScan.js +125 -0
- package/lib/createAutoMovieDeliveryAudioScan.js.map +1 -0
- package/lib/createAutoMovieVerificationInputScope.d.ts +19 -0
- package/lib/createAutoMovieVerificationInputScope.js +147 -0
- package/lib/createAutoMovieVerificationInputScope.js.map +1 -0
- package/lib/createAutoMovieVerificationMediaHash.d.ts +5 -0
- package/lib/createAutoMovieVerificationMediaHash.js +61 -0
- package/lib/createAutoMovieVerificationMediaHash.js.map +1 -0
- package/lib/decodeAutoMovieDeliveryAudio.d.ts +24 -0
- package/lib/decodeAutoMovieDeliveryAudio.js +77 -0
- package/lib/decodeAutoMovieDeliveryAudio.js.map +1 -0
- package/lib/deriveAutoMovieProjectName.d.ts +14 -11
- package/lib/deriveAutoMovieProjectName.js +14 -11
- package/lib/deriveAutoMovieProjectName.js.map +1 -1
- package/lib/findAutoMovieFreePort.d.ts +5 -10
- package/lib/findAutoMovieFreePort.js +5 -10
- package/lib/findAutoMovieFreePort.js.map +1 -1
- package/lib/formatAutoMovieInspectUrl.d.ts +6 -10
- package/lib/formatAutoMovieInspectUrl.js +6 -10
- package/lib/formatAutoMovieInspectUrl.js.map +1 -1
- package/lib/hashAutoMovieFile.d.ts +5 -0
- package/lib/hashAutoMovieFile.js +16 -0
- package/lib/hashAutoMovieFile.js.map +1 -0
- package/lib/importAutoMovieVerificationEntry.d.mts +2 -0
- package/lib/importAutoMovieVerificationEntry.mjs +6 -0
- package/lib/importAutoMovieVerificationEntry.mjs.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/inspectAutoMovie.d.ts +15 -9
- package/lib/inspectAutoMovie.js +25 -9
- package/lib/inspectAutoMovie.js.map +1 -1
- package/lib/inspectAutoMovieVerificationCapture.d.ts +15 -0
- package/lib/inspectAutoMovieVerificationCapture.js +221 -0
- package/lib/inspectAutoMovieVerificationCapture.js.map +1 -0
- package/lib/inspectAutoMovieVerificationDelivery.d.ts +13 -0
- package/lib/inspectAutoMovieVerificationDelivery.js +247 -0
- package/lib/inspectAutoMovieVerificationDelivery.js.map +1 -0
- package/lib/inspectAutoMovieVerificationReview.d.ts +11 -0
- package/lib/inspectAutoMovieVerificationReview.js +141 -0
- package/lib/inspectAutoMovieVerificationReview.js.map +1 -0
- package/lib/launchAutoMovieChromium.d.ts +9 -11
- package/lib/launchAutoMovieChromium.js +10 -11
- package/lib/launchAutoMovieChromium.js.map +1 -1
- package/lib/listAutoMovieReleaseFindings.d.ts +9 -0
- package/lib/listAutoMovieReleaseFindings.js +58 -0
- package/lib/listAutoMovieReleaseFindings.js.map +1 -0
- package/lib/loadAutoMovieProductionModule.d.ts +11 -10
- package/lib/loadAutoMovieProductionModule.js +18 -10
- package/lib/loadAutoMovieProductionModule.js.map +1 -1
- package/lib/loadAutoMovieVerificationModule.d.ts +6 -0
- package/lib/loadAutoMovieVerificationModule.js +246 -0
- package/lib/loadAutoMovieVerificationModule.js.map +1 -0
- package/lib/planAutoMovieChromiumLaunch.d.ts +7 -13
- package/lib/planAutoMovieChromiumLaunch.js +7 -13
- package/lib/planAutoMovieChromiumLaunch.js.map +1 -1
- package/lib/planAutoMovieDeliveryAudioDecode.d.ts +10 -0
- package/lib/planAutoMovieDeliveryAudioDecode.js +29 -0
- package/lib/planAutoMovieDeliveryAudioDecode.js.map +1 -0
- package/lib/planAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/planAutoMovieDeliveryDecode.js +57 -0
- package/lib/planAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/planAutoMovieDeliveryInput.d.ts +11 -0
- package/lib/planAutoMovieDeliveryInput.js +26 -0
- package/lib/planAutoMovieDeliveryInput.js.map +1 -0
- package/lib/planAutoMovieModulePageViteConfig.d.ts +13 -10
- package/lib/planAutoMovieModulePageViteConfig.js +13 -10
- package/lib/planAutoMovieModulePageViteConfig.js.map +1 -1
- package/lib/promptAutoMovieProjectName.d.ts +6 -10
- package/lib/promptAutoMovieProjectName.js +6 -10
- package/lib/promptAutoMovieProjectName.js.map +1 -1
- package/lib/publishAutoMovieRenderAttempt.d.ts +32 -0
- package/lib/publishAutoMovieRenderAttempt.js +91 -0
- package/lib/publishAutoMovieRenderAttempt.js.map +1 -0
- package/lib/readAutoMovieAddArguments.d.ts +10 -11
- package/lib/readAutoMovieAddArguments.js +10 -11
- package/lib/readAutoMovieAddArguments.js.map +1 -1
- package/lib/readAutoMovieCaptureHostOptions.d.ts +19 -17
- package/lib/readAutoMovieCaptureHostOptions.js +16 -17
- package/lib/readAutoMovieCaptureHostOptions.js.map +1 -1
- package/lib/readAutoMovieCommandArguments.d.ts +6 -9
- package/lib/readAutoMovieCommandArguments.js +9 -10
- package/lib/readAutoMovieCommandArguments.js.map +1 -1
- package/lib/readAutoMovieCreateArguments.d.ts +7 -11
- package/lib/readAutoMovieCreateArguments.js +7 -11
- package/lib/readAutoMovieCreateArguments.js.map +1 -1
- package/lib/readAutoMovieDeliveryAudioTrack.d.ts +21 -0
- package/lib/readAutoMovieDeliveryAudioTrack.js +104 -0
- package/lib/readAutoMovieDeliveryAudioTrack.js.map +1 -0
- package/lib/readAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/readAutoMovieDeliveryDecode.js +209 -0
- package/lib/readAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/readAutoMovieDeliveryProbe.d.ts +35 -0
- package/lib/readAutoMovieDeliveryProbe.js +363 -0
- package/lib/readAutoMovieDeliveryProbe.js.map +1 -0
- package/lib/readAutoMovieErrorCode.d.ts +9 -0
- package/lib/readAutoMovieErrorCode.js +18 -0
- package/lib/readAutoMovieErrorCode.js.map +1 -0
- package/lib/readAutoMovieInspectHostOptions.d.ts +15 -16
- package/lib/readAutoMovieInspectHostOptions.js +11 -15
- package/lib/readAutoMovieInspectHostOptions.js.map +1 -1
- package/lib/readAutoMovieNameOption.d.ts +4 -10
- package/lib/readAutoMovieNameOption.js +4 -10
- package/lib/readAutoMovieNameOption.js.map +1 -1
- package/lib/readAutoMoviePageTimeout.d.ts +13 -0
- package/lib/readAutoMoviePageTimeout.js +21 -0
- package/lib/readAutoMoviePageTimeout.js.map +1 -0
- package/lib/readAutoMovieRenderOptions.d.ts +24 -16
- package/lib/readAutoMovieRenderOptions.js +23 -16
- package/lib/readAutoMovieRenderOptions.js.map +1 -1
- package/lib/readAutoMovieReviewObservation.d.ts +6 -0
- package/lib/readAutoMovieReviewObservation.js +108 -0
- package/lib/readAutoMovieReviewObservation.js.map +1 -0
- package/lib/readAutoMovieReviewOptions.d.ts +32 -24
- package/lib/readAutoMovieReviewOptions.js +82 -18
- package/lib/readAutoMovieReviewOptions.js.map +1 -1
- package/lib/readAutoMovieRevision.d.ts +3 -9
- package/lib/readAutoMovieRevision.js +3 -9
- package/lib/readAutoMovieRevision.js.map +1 -1
- package/lib/readAutoMovieVerifyOptions.d.ts +17 -0
- package/lib/readAutoMovieVerifyOptions.js +45 -0
- package/lib/readAutoMovieVerifyOptions.js.map +1 -0
- package/lib/readAutoMovieVideoProbe.d.ts +6 -10
- package/lib/readAutoMovieVideoProbe.js +20 -13
- package/lib/readAutoMovieVideoProbe.js.map +1 -1
- package/lib/recordAutoMoviePlayback.d.ts +18 -11
- package/lib/recordAutoMoviePlayback.js +26 -13
- package/lib/recordAutoMoviePlayback.js.map +1 -1
- package/lib/renderAutoMovie.d.ts +16 -10
- package/lib/renderAutoMovie.js +31 -14
- package/lib/renderAutoMovie.js.map +1 -1
- package/lib/renderAutoMovieScaffoldNextSteps.d.ts +10 -10
- package/lib/renderAutoMovieScaffoldNextSteps.js +10 -10
- package/lib/renderAutoMovieVideo.d.ts +53 -15
- package/lib/renderAutoMovieVideo.js +290 -45
- package/lib/renderAutoMovieVideo.js.map +1 -1
- package/lib/resolveAutoMovieFfmpeg.d.ts +12 -15
- package/lib/resolveAutoMovieFfmpeg.js +12 -17
- package/lib/resolveAutoMovieFfmpeg.js.map +1 -1
- package/lib/reviewAutoMovie.d.ts +10 -10
- package/lib/reviewAutoMovie.js +15 -10
- package/lib/reviewAutoMovie.js.map +1 -1
- package/lib/reviewAutoMovieFile.d.ts +21 -0
- package/lib/reviewAutoMovieFile.js +378 -0
- package/lib/reviewAutoMovieFile.js.map +1 -0
- package/lib/run.d.ts +32 -18
- package/lib/run.js +67 -23
- package/lib/run.js.map +1 -1
- package/lib/runAutoMovieDeliveryAudioDecode.d.ts +18 -0
- package/lib/runAutoMovieDeliveryAudioDecode.js +28 -0
- package/lib/runAutoMovieDeliveryAudioDecode.js.map +1 -0
- package/lib/runAutoMovieDeliveryDecode.d.ts +19 -0
- package/lib/runAutoMovieDeliveryDecode.js +42 -0
- package/lib/runAutoMovieDeliveryDecode.js.map +1 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.d.ts +28 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.js +77 -0
- package/lib/runAutoMovieDeliveryReferenceDecode.js.map +1 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.d.ts +20 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.js +56 -0
- package/lib/runAutoMovieDeliverySourceAudioDecode.js.map +1 -0
- package/lib/runAutoMovieFfmpeg.d.ts +15 -10
- package/lib/runAutoMovieFfmpeg.js +36 -13
- package/lib/runAutoMovieFfmpeg.js.map +1 -1
- package/lib/runAutoMovieVerification.d.ts +28 -0
- package/lib/runAutoMovieVerification.js +393 -0
- package/lib/runAutoMovieVerification.js.map +1 -0
- package/lib/sameAutoMovieReviewFile.d.ts +2 -0
- package/lib/sameAutoMovieReviewFile.js +57 -0
- package/lib/sameAutoMovieReviewFile.js.map +1 -0
- package/lib/selectAutoMovieProjectName.d.ts +8 -11
- package/lib/selectAutoMovieProjectName.js +8 -11
- package/lib/selectAutoMovieProjectName.js.map +1 -1
- package/lib/serveAutoMovieDrawPage.d.ts +14 -11
- package/lib/serveAutoMovieDrawPage.js +14 -11
- package/lib/serveAutoMovieDrawPage.js.map +1 -1
- package/lib/serveAutoMovieInspectorPage.d.ts +4 -8
- package/lib/serveAutoMovieInspectorPage.js +3 -9
- package/lib/serveAutoMovieInspectorPage.js.map +1 -1
- package/lib/verifyAutoMovie.d.ts +19 -0
- package/lib/verifyAutoMovie.js +44 -0
- package/lib/verifyAutoMovie.js.map +1 -0
- package/lib/writeAutoMovieModulePage.d.ts +17 -12
- package/lib/writeAutoMovieModulePage.js +13 -11
- package/lib/writeAutoMovieModulePage.js.map +1 -1
- package/lib/writeAutoMovieVerificationReceipt.d.ts +2 -0
- package/lib/writeAutoMovieVerificationReceipt.js +75 -0
- package/lib/writeAutoMovieVerificationReceipt.js.map +1 -0
- package/package.json +8 -8
- package/src/AUTOMOVIE_CAPTURE_OPTIONS.ts +6 -2
- package/src/AUTOMOVIE_DEFAULT_PROJECT_NAME.ts +3 -1
- package/src/AUTOMOVIE_INSPECT_OPTIONS.ts +5 -2
- package/src/AUTOMOVIE_RENDER_OPTIONS.ts +8 -2
- package/src/AUTOMOVIE_REVIEW_OPTIONS.ts +12 -1
- package/src/AutoMovieCaptureBackend.ts +4 -6
- package/src/AutoMovieCaptureHost.ts +122 -68
- package/src/AutoMovieCommand.ts +71 -20
- package/src/AutoMovieFfmpegStaticPath.ts +7 -0
- package/src/AutoMovieMp4Boxes.ts +263 -0
- package/src/AutoMovieRenderOutputReservation.ts +97 -0
- package/src/IAutoMovieChromium.ts +13 -57
- package/src/IAutoMovieDeliveryAudioTrack.ts +19 -0
- package/src/IAutoMovieDeliveryProfileFinding.ts +24 -0
- package/src/IAutoMovieFfmpegSources.ts +13 -0
- package/src/IAutoMovieReviewObservation.ts +59 -0
- package/src/IAutoMovieVerification.ts +207 -0
- package/src/auditAutoMovieAlphaSamples.ts +201 -0
- package/src/auditAutoMovieDeliveryProfile.ts +125 -0
- package/src/captureAutoMovie.ts +137 -28
- package/src/createAutoMovieDeliveryAudioLog.ts +141 -0
- package/src/createAutoMovieDeliveryAudioScan.ts +150 -0
- package/src/createAutoMovieVerificationInputScope.ts +156 -0
- package/src/createAutoMovieVerificationMediaHash.ts +32 -0
- package/src/decodeAutoMovieDeliveryAudio.ts +95 -0
- package/src/deriveAutoMovieProjectName.ts +14 -11
- package/src/findAutoMovieFreePort.ts +5 -10
- package/src/formatAutoMovieInspectUrl.ts +6 -10
- package/src/hashAutoMovieFile.ts +12 -0
- package/src/importAutoMovieVerificationEntry.mts +6 -0
- package/src/index.ts +9 -0
- package/src/inspectAutoMovie.ts +28 -11
- package/src/inspectAutoMovieVerificationCapture.ts +292 -0
- package/src/inspectAutoMovieVerificationDelivery.ts +301 -0
- package/src/inspectAutoMovieVerificationReview.ts +130 -0
- package/src/launchAutoMovieChromium.ts +14 -12
- package/src/listAutoMovieReleaseFindings.ts +87 -0
- package/src/loadAutoMovieProductionModule.ts +22 -15
- package/src/loadAutoMovieVerificationModule.ts +278 -0
- package/src/planAutoMovieChromiumLaunch.ts +7 -13
- package/src/planAutoMovieDeliveryAudioDecode.ts +26 -0
- package/src/planAutoMovieDeliveryDecode.ts +66 -0
- package/src/planAutoMovieDeliveryInput.ts +25 -0
- package/src/planAutoMovieModulePageViteConfig.ts +13 -10
- package/src/promptAutoMovieProjectName.ts +6 -10
- package/src/publishAutoMovieRenderAttempt.ts +89 -0
- package/src/readAutoMovieAddArguments.ts +10 -11
- package/src/readAutoMovieCaptureHostOptions.ts +22 -17
- package/src/readAutoMovieCommandArguments.ts +8 -10
- package/src/readAutoMovieCreateArguments.ts +7 -11
- package/src/readAutoMovieDeliveryAudioTrack.ts +137 -0
- package/src/readAutoMovieDeliveryDecode.ts +269 -0
- package/src/readAutoMovieDeliveryProbe.ts +499 -0
- package/src/readAutoMovieErrorCode.ts +13 -0
- package/src/readAutoMovieInspectHostOptions.ts +15 -16
- package/src/readAutoMovieNameOption.ts +4 -10
- package/src/readAutoMoviePageTimeout.ts +19 -0
- package/src/readAutoMovieRenderOptions.ts +34 -16
- package/src/readAutoMovieReviewObservation.ts +146 -0
- package/src/readAutoMovieReviewOptions.ts +133 -28
- package/src/readAutoMovieRevision.ts +3 -9
- package/src/readAutoMovieVerifyOptions.ts +50 -0
- package/src/readAutoMovieVideoProbe.ts +24 -13
- package/src/recordAutoMoviePlayback.ts +26 -13
- package/src/renderAutoMovie.ts +38 -17
- package/src/renderAutoMovieScaffoldNextSteps.ts +10 -10
- package/src/renderAutoMovieVideo.ts +474 -85
- package/src/resolveAutoMovieFfmpeg.ts +17 -24
- package/src/reviewAutoMovie.ts +21 -16
- package/src/reviewAutoMovieFile.ts +479 -0
- package/src/run.ts +75 -25
- package/src/runAutoMovieDeliveryAudioDecode.ts +45 -0
- package/src/runAutoMovieDeliveryDecode.ts +63 -0
- package/src/runAutoMovieDeliveryReferenceDecode.ts +107 -0
- package/src/runAutoMovieDeliverySourceAudioDecode.ts +71 -0
- package/src/runAutoMovieFfmpeg.ts +48 -14
- package/src/runAutoMovieVerification.ts +487 -0
- package/src/sameAutoMovieReviewFile.ts +23 -0
- package/src/selectAutoMovieProjectName.ts +8 -11
- package/src/serveAutoMovieDrawPage.ts +16 -12
- package/src/serveAutoMovieInspectorPage.ts +6 -9
- package/src/verifyAutoMovie.ts +67 -0
- package/src/writeAutoMovieModulePage.ts +17 -12
- package/src/writeAutoMovieVerificationReceipt.ts +51 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IAutoMovieControlRecord,
|
|
3
|
+
IAutoMovieDeliveryContentAudit,
|
|
4
|
+
IAutoMovieDrawnVideoResult,
|
|
5
|
+
} from "@automovie/interface";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import * as fs from "node:fs/promises";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
|
|
10
|
+
import type { IAutoMovieVerification } from "./IAutoMovieVerification";
|
|
11
|
+
|
|
12
|
+
type AutoMovieAuditedClock = Pick<
|
|
13
|
+
IAutoMovieDeliveryContentAudit.IResult["expected"],
|
|
14
|
+
"frameRate" | "frameCount"
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
type AutoMovieReportedFrame = Pick<
|
|
18
|
+
IAutoMovieDrawnVideoResult["frames"][number],
|
|
19
|
+
"index" | "seconds"
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
type AutoMovieDeliveryOutcome = Pick<
|
|
23
|
+
IAutoMovieVerification.IResult,
|
|
24
|
+
"state" | "message" | "evidence"
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
/** Fields the existing render report publishes for its file and attempt. */
|
|
28
|
+
interface IRenderReport {
|
|
29
|
+
readonly subject: string;
|
|
30
|
+
readonly status: "published" | "blocked" | "failed";
|
|
31
|
+
readonly video: string | null;
|
|
32
|
+
readonly source: { readonly file: string; readonly sha256: string } | null;
|
|
33
|
+
readonly frames?: readonly AutoMovieReportedFrame[];
|
|
34
|
+
readonly delivery?: { readonly expected?: AutoMovieAuditedClock } | null;
|
|
35
|
+
readonly failure?: { readonly message?: string };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Verify the promoted movie beside its report using the digest of the staged
|
|
40
|
+
* bytes audited before publication. Required controls carry the same digest. A
|
|
41
|
+
* blocked or failed attempt reports any previous movie separately.
|
|
42
|
+
*
|
|
43
|
+
* @param check The production's delivery criterion.
|
|
44
|
+
* @param root The directory holding the production and its outputs.
|
|
45
|
+
* @returns The file-binding verdict and its owning report.
|
|
46
|
+
*/
|
|
47
|
+
export async function inspectAutoMovieVerificationDelivery(
|
|
48
|
+
check: IAutoMovieVerification.IDelivery,
|
|
49
|
+
root: string,
|
|
50
|
+
hashFile: (file: string) => Promise<string>,
|
|
51
|
+
): Promise<AutoMovieDeliveryOutcome> {
|
|
52
|
+
const evidence: string = check.report;
|
|
53
|
+
const reportPath: string = path.resolve(root, evidence);
|
|
54
|
+
let report: IRenderReport;
|
|
55
|
+
try {
|
|
56
|
+
report = JSON.parse(await fs.readFile(reportPath, "utf8")) as IRenderReport;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof SyntaxError)
|
|
59
|
+
return {
|
|
60
|
+
state: "unobserved",
|
|
61
|
+
message: `Rerender ${check.subject} to replace its malformed render report.`,
|
|
62
|
+
evidence,
|
|
63
|
+
};
|
|
64
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
65
|
+
return {
|
|
66
|
+
state: "not-run",
|
|
67
|
+
message: `Render ${check.subject} and inspect its latest report.`,
|
|
68
|
+
evidence,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (report?.subject !== check.subject)
|
|
72
|
+
return {
|
|
73
|
+
state: "unobserved",
|
|
74
|
+
message: `The report does not describe ${check.subject}.`,
|
|
75
|
+
evidence,
|
|
76
|
+
};
|
|
77
|
+
if (report.status === "blocked" || report.status === "failed") {
|
|
78
|
+
const previous: string[] = [];
|
|
79
|
+
for (const file of ["film.mp4", "film.mov"]) {
|
|
80
|
+
const candidate: string = path.resolve(path.dirname(reportPath), file);
|
|
81
|
+
try {
|
|
82
|
+
if ((await fs.stat(candidate)).isFile())
|
|
83
|
+
previous.push(path.relative(root, candidate));
|
|
84
|
+
} catch (error) {
|
|
85
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
state: "failed",
|
|
90
|
+
message:
|
|
91
|
+
`Latest render ${report.status}. ${report.failure?.message ?? "Inspect the render report."}` +
|
|
92
|
+
(previous.length === 0
|
|
93
|
+
? ""
|
|
94
|
+
: ` Previous output: ${previous.join(", ")}.`),
|
|
95
|
+
evidence,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const auditedHash: string | undefined = report.source?.sha256;
|
|
99
|
+
if (
|
|
100
|
+
report.status !== "published" ||
|
|
101
|
+
typeof report.video !== "string" ||
|
|
102
|
+
report.video.length === 0 ||
|
|
103
|
+
report.video !== path.basename(report.video) ||
|
|
104
|
+
typeof report.source?.file !== "string" ||
|
|
105
|
+
!report.source.file.trim() ||
|
|
106
|
+
!validDigest(auditedHash)
|
|
107
|
+
)
|
|
108
|
+
return {
|
|
109
|
+
state: "unobserved",
|
|
110
|
+
message: "The report lacks a bound publication.",
|
|
111
|
+
evidence,
|
|
112
|
+
};
|
|
113
|
+
const directory: string = path.dirname(reportPath);
|
|
114
|
+
const file: string = path.join(directory, report.video);
|
|
115
|
+
let hash: string;
|
|
116
|
+
try {
|
|
117
|
+
hash = await hashFile(file);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
120
|
+
return {
|
|
121
|
+
state: "unobserved",
|
|
122
|
+
message: `Restore the published movie at ${path.relative(root, file)}.`,
|
|
123
|
+
evidence,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (hash !== auditedHash)
|
|
127
|
+
return {
|
|
128
|
+
state: "stale",
|
|
129
|
+
message: `The bytes of ${report.video} differ from its published report.`,
|
|
130
|
+
evidence,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const match: string = `Published bytes match ${path.relative(root, file)}.`;
|
|
134
|
+
if (check.controls === undefined || check.controls.length === 0)
|
|
135
|
+
return { state: "passed", message: match, evidence };
|
|
136
|
+
const frames: readonly AutoMovieReportedFrame[] | undefined = report.frames;
|
|
137
|
+
const expected: AutoMovieAuditedClock | undefined = report.delivery?.expected;
|
|
138
|
+
if (
|
|
139
|
+
!Array.isArray(frames) ||
|
|
140
|
+
frames.length === 0 ||
|
|
141
|
+
frames.length !== expected?.frameCount ||
|
|
142
|
+
frames.some(
|
|
143
|
+
(frame: AutoMovieReportedFrame, index: number): boolean =>
|
|
144
|
+
frame?.index !== index ||
|
|
145
|
+
!Number.isFinite(frame.seconds) ||
|
|
146
|
+
frame.seconds < 0,
|
|
147
|
+
)
|
|
148
|
+
)
|
|
149
|
+
return {
|
|
150
|
+
state: "unobserved",
|
|
151
|
+
message: `Rerender ${check.subject} to record the frame indices and times for its required controls.`,
|
|
152
|
+
evidence,
|
|
153
|
+
};
|
|
154
|
+
const recordPath: string = path.join(directory, "controls", "record.json");
|
|
155
|
+
const controlEvidence: string = path.relative(root, recordPath);
|
|
156
|
+
const controls: AutoMovieDeliveryOutcome = await inspectControlRecord({
|
|
157
|
+
recordPath,
|
|
158
|
+
evidence: controlEvidence,
|
|
159
|
+
subject: check.subject,
|
|
160
|
+
hash,
|
|
161
|
+
expected,
|
|
162
|
+
frames,
|
|
163
|
+
required: check.controls,
|
|
164
|
+
});
|
|
165
|
+
return controls.state === "passed"
|
|
166
|
+
? { state: "passed", message: `${match} ${controls.message}`, evidence }
|
|
167
|
+
: controls;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function inspectControlRecord(props: {
|
|
171
|
+
recordPath: string;
|
|
172
|
+
evidence: string;
|
|
173
|
+
subject: string;
|
|
174
|
+
hash: string;
|
|
175
|
+
expected: AutoMovieAuditedClock | undefined;
|
|
176
|
+
frames: readonly AutoMovieReportedFrame[];
|
|
177
|
+
required: readonly string[];
|
|
178
|
+
}): Promise<AutoMovieDeliveryOutcome> {
|
|
179
|
+
const { recordPath, evidence, subject, hash, expected, frames } = props;
|
|
180
|
+
const required: string[] = [...new Set(props.required)];
|
|
181
|
+
const passes: string = required.join(", ");
|
|
182
|
+
const unobserved = (message: string): AutoMovieDeliveryOutcome => ({
|
|
183
|
+
state: "unobserved",
|
|
184
|
+
message,
|
|
185
|
+
evidence,
|
|
186
|
+
});
|
|
187
|
+
let controls: IAutoMovieControlRecord | null;
|
|
188
|
+
try {
|
|
189
|
+
controls = JSON.parse(
|
|
190
|
+
await fs.readFile(recordPath, "utf8"),
|
|
191
|
+
) as IAutoMovieControlRecord | null;
|
|
192
|
+
} catch (error) {
|
|
193
|
+
if (
|
|
194
|
+
(error as NodeJS.ErrnoException).code !== "ENOENT" &&
|
|
195
|
+
!(error instanceof SyntaxError)
|
|
196
|
+
)
|
|
197
|
+
throw error;
|
|
198
|
+
return unobserved(
|
|
199
|
+
`Restore the control record for ${passes} at ${evidence}.`,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
if (
|
|
203
|
+
controls === null ||
|
|
204
|
+
typeof controls.film !== "string" ||
|
|
205
|
+
!validDigest(controls.filmSha256)
|
|
206
|
+
)
|
|
207
|
+
return unobserved(
|
|
208
|
+
`Render ${passes} to record the subject and film digest.`,
|
|
209
|
+
);
|
|
210
|
+
if (controls.film !== subject || controls.filmSha256 !== hash)
|
|
211
|
+
return {
|
|
212
|
+
state: "stale",
|
|
213
|
+
message: "The control record is bound to a different film.",
|
|
214
|
+
evidence,
|
|
215
|
+
};
|
|
216
|
+
if (!matchesClock(controls.clock, expected))
|
|
217
|
+
return unobserved(
|
|
218
|
+
`Render ${passes} with a control record matching the movie frame count and rate.`,
|
|
219
|
+
);
|
|
220
|
+
const channels: readonly IAutoMovieControlRecord.IChannel[] = Array.isArray(
|
|
221
|
+
controls.channels,
|
|
222
|
+
)
|
|
223
|
+
? controls.channels
|
|
224
|
+
: [];
|
|
225
|
+
const incomplete: string[] = required.filter((pass: string): boolean => {
|
|
226
|
+
const matches: IAutoMovieControlRecord.IChannel[] = channels.filter(
|
|
227
|
+
(channel: IAutoMovieControlRecord.IChannel): boolean =>
|
|
228
|
+
channel?.pass === pass,
|
|
229
|
+
);
|
|
230
|
+
return matches.length !== 1 || !completeSequence(matches[0]!, frames);
|
|
231
|
+
});
|
|
232
|
+
if (incomplete.length !== 0)
|
|
233
|
+
return unobserved(
|
|
234
|
+
`Render a complete control record for ${incomplete.join(", ")}.`,
|
|
235
|
+
);
|
|
236
|
+
return {
|
|
237
|
+
state: "passed",
|
|
238
|
+
message: `The control record for ${passes} matches at ${evidence}. Use its frame digests to verify the image files for transfer.`,
|
|
239
|
+
evidence,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function matchesClock(
|
|
244
|
+
clock: IAutoMovieControlRecord.IClock | null | undefined,
|
|
245
|
+
expected: AutoMovieAuditedClock | null | undefined,
|
|
246
|
+
): boolean {
|
|
247
|
+
const count: number | undefined = expected?.frameCount;
|
|
248
|
+
const rate: AutoMovieAuditedClock["frameRate"] | undefined =
|
|
249
|
+
expected?.frameRate;
|
|
250
|
+
const controlRate: IAutoMovieControlRecord.IClock["frameRate"] | undefined =
|
|
251
|
+
clock?.frameRate;
|
|
252
|
+
return (
|
|
253
|
+
typeof count === "number" &&
|
|
254
|
+
Number.isSafeInteger(count) &&
|
|
255
|
+
count > 0 &&
|
|
256
|
+
clock?.frameCount === count &&
|
|
257
|
+
Array.isArray(controlRate) &&
|
|
258
|
+
controlRate.length === 2 &&
|
|
259
|
+
Array.isArray(rate) &&
|
|
260
|
+
rate.length === 2 &&
|
|
261
|
+
rate.every(
|
|
262
|
+
(term: number, index: number): boolean =>
|
|
263
|
+
Number.isSafeInteger(term) && term > 0 && controlRate[index] === term,
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function completeSequence(
|
|
269
|
+
channel: IAutoMovieControlRecord.IChannel,
|
|
270
|
+
reported: readonly AutoMovieReportedFrame[],
|
|
271
|
+
): boolean {
|
|
272
|
+
if (
|
|
273
|
+
channel.frameCount !== reported.length ||
|
|
274
|
+
!Array.isArray(channel.frames) ||
|
|
275
|
+
channel.frames.length !== reported.length ||
|
|
276
|
+
channel.convention?.pass !== channel.pass ||
|
|
277
|
+
typeof channel.inputPattern !== "string" ||
|
|
278
|
+
channel.inputPattern.trim() === ""
|
|
279
|
+
)
|
|
280
|
+
return false;
|
|
281
|
+
|
|
282
|
+
const sequence: ReturnType<typeof createHash> = createHash("sha256");
|
|
283
|
+
for (const [index, frame] of channel.frames.entries()) {
|
|
284
|
+
if (
|
|
285
|
+
frame?.index !== index ||
|
|
286
|
+
frame.seconds !== reported[index]!.seconds ||
|
|
287
|
+
!validDigest(frame.sha256)
|
|
288
|
+
)
|
|
289
|
+
return false;
|
|
290
|
+
sequence.update(`${frame.sha256}\n`);
|
|
291
|
+
}
|
|
292
|
+
return sequence.digest("hex") === channel.sequenceSha256;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function validDigest(value: unknown): value is string {
|
|
296
|
+
return (
|
|
297
|
+
typeof value === "string" &&
|
|
298
|
+
value.length === 64 &&
|
|
299
|
+
/^[a-f0-9]+$/u.test(value)
|
|
300
|
+
);
|
|
301
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
|
|
4
|
+
import type { IAutoMovieReviewObservation } from "./IAutoMovieReviewObservation";
|
|
5
|
+
import type { IAutoMovieVerification } from "./IAutoMovieVerification";
|
|
6
|
+
import { readAutoMovieReviewObservation } from "./readAutoMovieReviewObservation";
|
|
7
|
+
import { sameAutoMovieReviewFile } from "./sameAutoMovieReviewFile";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Check the existing review owner's explicit observation of the exact file. Its
|
|
11
|
+
* author, activity, actual frame scope and decision are all required. A machine
|
|
12
|
+
* locator or a still satisfies no playback or listening check.
|
|
13
|
+
*
|
|
14
|
+
* @param check The production's required file observation and frame interval.
|
|
15
|
+
* @param root The production directory that resolves both source files.
|
|
16
|
+
* @returns The current review outcome and its owning observation.
|
|
17
|
+
*/
|
|
18
|
+
export async function inspectAutoMovieVerificationReview(
|
|
19
|
+
check: IAutoMovieVerification.IReview,
|
|
20
|
+
root: string,
|
|
21
|
+
hashFile: (file: string) => Promise<string>,
|
|
22
|
+
): Promise<
|
|
23
|
+
Pick<IAutoMovieVerification.IResult, "state" | "message" | "evidence">
|
|
24
|
+
> {
|
|
25
|
+
const evidence: string = check.observation;
|
|
26
|
+
const [from, end]: IAutoMovieVerification.IReview["frames"] = check.frames;
|
|
27
|
+
if (
|
|
28
|
+
!Number.isSafeInteger(from) ||
|
|
29
|
+
!Number.isSafeInteger(end) ||
|
|
30
|
+
from < 0 ||
|
|
31
|
+
from >= end
|
|
32
|
+
)
|
|
33
|
+
throw new Error(
|
|
34
|
+
"A review check needs a nonempty zero-based frame interval.",
|
|
35
|
+
);
|
|
36
|
+
const pending = (message: string) => ({
|
|
37
|
+
state: "awaiting-review" as const,
|
|
38
|
+
message,
|
|
39
|
+
evidence,
|
|
40
|
+
});
|
|
41
|
+
let source: string;
|
|
42
|
+
try {
|
|
43
|
+
source = await fs.readFile(path.resolve(root, evidence), "utf8");
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
46
|
+
return pending(
|
|
47
|
+
`Record ${check.viewed} review of frames ${from}–${end - 1}.`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
let value: IAutoMovieReviewObservation;
|
|
51
|
+
try {
|
|
52
|
+
value = readAutoMovieReviewObservation(JSON.parse(source) as unknown);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
const reason: string =
|
|
55
|
+
error instanceof SyntaxError
|
|
56
|
+
? "Invalid file review JSON"
|
|
57
|
+
: error instanceof Error
|
|
58
|
+
? error.message
|
|
59
|
+
: String(error);
|
|
60
|
+
return {
|
|
61
|
+
state: "unobserved",
|
|
62
|
+
message: `${reason}. Select a valid ${check.viewed} receipt for frames ${from}–${end - 1}.`,
|
|
63
|
+
evidence,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const file: string = path.resolve(root, check.file);
|
|
67
|
+
if (
|
|
68
|
+
value.subject !== check.subject ||
|
|
69
|
+
!(await sameAutoMovieReviewFile(path.resolve(root, value.file), file))
|
|
70
|
+
)
|
|
71
|
+
return pending("The observation addresses a different subject or video.");
|
|
72
|
+
try {
|
|
73
|
+
if ((await hashFile(file)) !== value.sha256)
|
|
74
|
+
return {
|
|
75
|
+
state: "stale",
|
|
76
|
+
message: "The reviewer observed earlier bytes at this path.",
|
|
77
|
+
evidence,
|
|
78
|
+
};
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
81
|
+
return {
|
|
82
|
+
state: "unobserved",
|
|
83
|
+
message: `Restore or render ${check.file} before requesting review.`,
|
|
84
|
+
evidence,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (
|
|
88
|
+
value.viewed !== check.viewed ||
|
|
89
|
+
value.observed === null ||
|
|
90
|
+
value.observed.firstFrame > from ||
|
|
91
|
+
value.observed.endFrame < end ||
|
|
92
|
+
value.reviewer === null ||
|
|
93
|
+
value.decision === null ||
|
|
94
|
+
(check.occurrence !== undefined &&
|
|
95
|
+
(value.cut.state !== "resolved" ||
|
|
96
|
+
value.cut.entry !== check.occurrence.entry ||
|
|
97
|
+
value.cut.shot !== check.occurrence.shot))
|
|
98
|
+
)
|
|
99
|
+
return pending(
|
|
100
|
+
`Record ${check.viewed} and a named decision for the current video over frames ${from}–${end - 1}.`,
|
|
101
|
+
);
|
|
102
|
+
const observation: NonNullable<IAutoMovieReviewObservation["observed"]> =
|
|
103
|
+
value.observed;
|
|
104
|
+
if (check.viewed === "still" && end - from !== 1)
|
|
105
|
+
return pending("A still decision can cover only one frame.");
|
|
106
|
+
if (check.viewed !== "still") {
|
|
107
|
+
// Frame selection can intersect a piece of a frame outside a reviewer’s
|
|
108
|
+
// requested interval. Compare the actual reported span as well.
|
|
109
|
+
const stride: number =
|
|
110
|
+
(observation.end.ticks - observation.start.ticks) /
|
|
111
|
+
(observation.endFrame - observation.firstFrame);
|
|
112
|
+
const [numerator, denominator]: typeof observation.start.timeBase =
|
|
113
|
+
observation.start.timeBase;
|
|
114
|
+
const frameStart: (frame: number) => number = (frame: number): number =>
|
|
115
|
+
(frame * stride * numerator) / denominator;
|
|
116
|
+
if (
|
|
117
|
+
value.requested.to === null ||
|
|
118
|
+
value.requested.from > frameStart(from) ||
|
|
119
|
+
value.requested.to < frameStart(end)
|
|
120
|
+
)
|
|
121
|
+
return pending(
|
|
122
|
+
"The recorded continuous review covers only part of the required span.",
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
state: value.decision === "accepted" ? "passed" : "failed",
|
|
127
|
+
message: `Recorded ${value.viewed} ${value.decision} by ${value.reviewer}. ${value.note}`,
|
|
128
|
+
evidence,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -2,21 +2,20 @@ import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
|
|
|
2
2
|
import type { IAutoMovieChromium } from "./IAutoMovieChromium";
|
|
3
3
|
import { planAutoMovieChromiumLaunch } from "./planAutoMovieChromiumLaunch";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The command that installs the Chromium build the production's
|
|
7
|
+
* `playwright-core` pins for headless use; `playwright-core`'s own command, so
|
|
8
|
+
* the revision is the one the production launches.
|
|
9
|
+
*/
|
|
6
10
|
const INSTALL: string = "npx playwright-core install chromium-headless-shell";
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
|
-
* Launch headless Chromium for a capture backend, and describe the launch the
|
|
10
|
-
*
|
|
11
|
-
* A launch that fails because the browser executable is missing is rethrown as an error naming `npx playwright-core install chromium-headless-shell` and `CHROME_PATH`; any other failure is rethrown with the backend named.
|
|
13
|
+
* Launch headless Chromium for a capture backend, and describe the launch the
|
|
14
|
+
* way a record names it: the backend, then the Chromium version.
|
|
12
15
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No other browser or backend is tried after a failure.
|
|
17
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms One launch.
|
|
18
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each capture host launches its own browser.
|
|
19
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned browser is the caller's to close; a failed launch leaves none.
|
|
16
|
+
* A launch that fails because the browser executable is missing is rethrown as
|
|
17
|
+
* an error naming `npx playwright-core install chromium-headless-shell` and
|
|
18
|
+
* `CHROME_PATH`; any other failure is rethrown with the backend named.
|
|
20
19
|
*/
|
|
21
20
|
export async function launchAutoMovieChromium(props: {
|
|
22
21
|
/** Playwright's `chromium`, loaded from the production. */
|
|
@@ -31,7 +30,10 @@ export async function launchAutoMovieChromium(props: {
|
|
|
31
30
|
/** The launched browser. */
|
|
32
31
|
browser: IAutoMovieChromium.IBrowser;
|
|
33
32
|
|
|
34
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* The backend and Chromium version, such as `swiftshader; Chromium
|
|
35
|
+
* 131.0.6778.33`.
|
|
36
|
+
*/
|
|
35
37
|
backend: string;
|
|
36
38
|
}> {
|
|
37
39
|
const plan: ReturnType<typeof planAutoMovieChromiumLaunch> =
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IAutoMovieDeliveryContentAudit,
|
|
3
|
+
IAutoMovieDrawnVideoResult,
|
|
4
|
+
IAutoMovieInspectionDiagnostics,
|
|
5
|
+
} from "@automovie/interface";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Selects the first usable cursor in each audit while retaining complete
|
|
9
|
+
* details in the report.
|
|
10
|
+
*
|
|
11
|
+
* A content finding whose detector `skip` names does not block; a transparent
|
|
12
|
+
* render skips `black`, which reads a transparent frame as black.
|
|
13
|
+
*/
|
|
14
|
+
export function listAutoMovieReleaseFindings(
|
|
15
|
+
diagnostics: IAutoMovieDrawnVideoResult["diagnostics"] | null,
|
|
16
|
+
delivery: IAutoMovieDeliveryContentAudit.IResult,
|
|
17
|
+
skip: readonly string[] = [],
|
|
18
|
+
): string[] {
|
|
19
|
+
const details: string[] = [];
|
|
20
|
+
if (diagnostics?.hasBlockingFinding) {
|
|
21
|
+
const blocking: IAutoMovieInspectionDiagnostics.IEpisode | undefined =
|
|
22
|
+
diagnostics.episodes.find(
|
|
23
|
+
({
|
|
24
|
+
worst: { finding },
|
|
25
|
+
}: IAutoMovieInspectionDiagnostics.IEpisode): boolean =>
|
|
26
|
+
finding.category === "error" && finding.confidence === "confirmed",
|
|
27
|
+
);
|
|
28
|
+
const first: IAutoMovieInspectionDiagnostics.IObservation | undefined =
|
|
29
|
+
blocking?.first.finding.category === "error" &&
|
|
30
|
+
blocking.first.finding.confidence === "confirmed"
|
|
31
|
+
? blocking.first
|
|
32
|
+
: blocking?.worst;
|
|
33
|
+
details.push(
|
|
34
|
+
first === undefined
|
|
35
|
+
? "Scene inspection failed"
|
|
36
|
+
: first.finding.code +
|
|
37
|
+
cursor(first.time.filmSeconds, first.time.outputFrame),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
if (diagnostics?.unresolvedRequiredCoverage) {
|
|
41
|
+
const unresolved:
|
|
42
|
+
| IAutoMovieInspectionDiagnostics.ICoverageRange
|
|
43
|
+
| undefined = diagnostics.coverage.find(
|
|
44
|
+
({ coverage }: IAutoMovieInspectionDiagnostics.ICoverageRange): boolean =>
|
|
45
|
+
coverage.required &&
|
|
46
|
+
(coverage.status === "deferred" || coverage.status === "unsupported"),
|
|
47
|
+
);
|
|
48
|
+
details.push(
|
|
49
|
+
unresolved === undefined
|
|
50
|
+
? "Required scene inspection coverage is unresolved"
|
|
51
|
+
: "Required scene " +
|
|
52
|
+
unresolved.coverage.check +
|
|
53
|
+
" coverage is unresolved" +
|
|
54
|
+
cursor(unresolved.first.filmSeconds, unresolved.first.outputFrame),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
for (const finding of delivery.findings) {
|
|
59
|
+
if (!finding.blocking) continue;
|
|
60
|
+
if (finding.kind !== "content") {
|
|
61
|
+
details.push(finding.media + ": " + finding.reason);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (skip.includes(finding.detector)) continue;
|
|
65
|
+
const {
|
|
66
|
+
ticks,
|
|
67
|
+
timeBase: [numerator, denominator],
|
|
68
|
+
}: IAutoMovieDeliveryContentAudit.ITimestamp = finding.start;
|
|
69
|
+
details.push(
|
|
70
|
+
finding.outcome +
|
|
71
|
+
" " +
|
|
72
|
+
finding.detector +
|
|
73
|
+
cursor((ticks * numerator) / denominator, finding.firstOutputFrame),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return details;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Formats the available output frame and film seconds without inventing an
|
|
81
|
+
* audio frame.
|
|
82
|
+
*/
|
|
83
|
+
function cursor(seconds: number, frame?: number): string {
|
|
84
|
+
return (
|
|
85
|
+
(frame === undefined ? "" : " at frame " + frame) + " (" + seconds + " s)"
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -2,29 +2,36 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Load a package as the production at `root` resolves it, for the capture
|
|
5
|
+
* Load a package as the production at `root` resolves it, for the capture
|
|
6
|
+
* host's optional peers: `@automovie/render`, `vite`, `playwright-core` and
|
|
7
|
+
* `ffmpeg-static`.
|
|
6
8
|
*
|
|
7
|
-
* The command itself depends on none of them, so `npx automovie create`
|
|
9
|
+
* The command itself depends on none of them, so `npx automovie create`
|
|
10
|
+
* installs nothing a capture needs. Resolve dependencies from the production in
|
|
11
|
+
* order to diagnose a missing package or an installed module that fails to
|
|
12
|
+
* initialize. Preserve the original failure as the cause.
|
|
8
13
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No copy beside the command is tried, so a capture never draws with a renderer the production did not install.
|
|
13
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms One resolution; Node caches the module.
|
|
14
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Node's module cache serves a second load of the same package.
|
|
15
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module stays in Node's cache for the process, as any import does.
|
|
14
|
+
* @param root The production's folder.
|
|
15
|
+
* @param id The package to load.
|
|
16
|
+
* @returns The package's exports, typed by the module's declared type T.
|
|
16
17
|
*/
|
|
17
|
-
export function loadAutoMovieProductionModule(
|
|
18
|
+
export function loadAutoMovieProductionModule<T = unknown>(
|
|
18
19
|
root: string,
|
|
19
20
|
id: string,
|
|
20
|
-
):
|
|
21
|
+
): T {
|
|
21
22
|
const load: NodeJS.Require = createRequire(path.join(root, "package.json"));
|
|
22
23
|
try {
|
|
23
24
|
return load(id);
|
|
24
25
|
} catch (error) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
let resolved: string;
|
|
27
|
+
try {
|
|
28
|
+
resolved = load.resolve(id);
|
|
29
|
+
} catch {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`${id} is not installed in ${root}. Add it to the production's dependencies.`,
|
|
32
|
+
{ cause: error },
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Could not load ${id} at ${resolved}`, { cause: error });
|
|
29
36
|
}
|
|
30
37
|
}
|