منبع حقیقت، محتوا، انتشار و رسانه · فصل ۴ — Media Library، Factory، FFmpeg، Workbench و QA · 166
Media Factory Recipes and Deterministic Transforms
Specify a media-transform recipe that binds exact input assets, tool/version, ordered operations, parameters, environment assumptions and expected output properties, then verify reproducibility with output digests or an explicitly bounded equivalence policy when byte-for-byte determinism is not demonstrated. میتواند «Media Factory Recipes و Deterministic Transforms» را در یک pipeline محدود با provenance، rights/version و publication gate تعریف کند.
Lesson summary
Specify a media-transform recipe that binds exact input assets, tool/version, ordered operations, parameters, environment assumptions and expected output properties, then verify reproducibility with output digests or an explicitly bounded equivalence policy when byte-for-byte determinism is not demonstrated.
میتواند «Media Factory Recipes و Deterministic Transforms» را در یک pipeline محدود با provenance، rights/version و publication gate تعریف کند.
This lesson produces
میتواند «Media Factory Recipes و Deterministic Transforms» را در یک pipeline محدود با provenance، rights/version و publication gate تعریف کند.
Who it is for
Foundation
Use a guided lesson-specific evidence matrix and one worked negative case.
Repair
Re-run only the failed owned dimension with a smaller deterministic synthetic fixture.
Experienced
Start from mixed authority/policy/evidence records; require explicit trade-offs and provenance.
Prerequisites
1. A stable preset name is not a stable recipe
A label such as web-final is only a label. If the input, tool build, encoder, parameter set, or metadata changes, the label cannot prove reproducibility. Every transform in this lesson has an auditable recipe_id and recipe_version.
2. The owned CON-015 boundary
CON-015 owns the recipe and reproducibility evidence. CON-014 owns authoritative asset/source/rights/QC records, CON-016 owns command-level execution, CON-017 owns creative variant lineage, and CON-018/CON-022 own publication gates. This lesson makes only bounded transform claims.
3. Bind the exact input with a digest
A filename, path, or thumbnail is not byte identity. The recipe records both input_asset_ref and input_digest. If the digest changes, the next derivative has new lineage; overwriting the old derivative destroys auditability.
4. Treat tool build and environment as recipe inputs
Record tool_id, tool_version, a container image or an environment fingerprint. Identical command text can behave differently across builds or hardware paths, so that change must be typed instead of hidden behind the same preset name.
5. Operation sequence is ordered
Resize-then-crop is not the same recipe as crop-then-resize. Operations and parameters must be ordered and explicit. A changed parameter either requires a new recipe version or must be rejected as recipe drift.
6. Randomness needs a declared policy
If a transform includes seeds, sampling, or behavior that can vary, seed_or_randomness_policy must be NONE, FIXED, or explicitly UNDECLARED. An unknown randomness state cannot support a determinism claim.
7. Metadata and clocks can change bytes
Creation time, encoder tags, or other volatile metadata can alter an output digest even when the media is technically similar. The recipe must say whether such fields are stripped, fixed, or explicitly excluded by a bounded equivalence policy.
8. Define the output spec before execution
Dimensions, container, codec family, sample rate, and other required properties belong in output_spec before the run. The observed output is compared with that contract afterward; “the file plays” is not sufficient evidence.
9. Byte determinism is an evidence claim
Only repeated runs with identical bindings and controlled policies can justify byte_deterministic=true when the output digests match. A repeated command or use of -bitexact alone is not the complete evidence package.
10. Bounded equivalence is different from byte identity
Two byte-different outputs can still satisfy an explicitly defined technical/semantic equivalence policy. The correct decision is then BOUNDED_EQUIVALENCE_ONLY; it must never be relabeled as byte determinism.
11. Link derivation to the run
Every immutable derivative links to the input entity, recipe version, and reproducibility_run_id. PROV can represent entity/activity lineage, while determinism remains a claim proven by the recipe/run evidence.
12. Type the drift
Use states such as INPUT_DRIFT, TOOL_DRIFT, ENVIRONMENT_DRIFT, RECIPE_DRIFT, RANDOMNESS_UNBOUND, and METADATA_TIME_DRIFT. Typed failures are actionable; one vague PASS/FAIL flag is not enough for a media factory.
13. Evidence matrix: declared versus observed
For every run, compare declared and observed input digest, tool/environment, operations/parameters, randomness, metadata policy, output digest, and equivalence result. The typed decision must come from these rows.
14. Lab: eight fixtures and 64 assertions
The synthetic lab includes a byte-identical baseline, parameter drift without a version bump, a new tool/hardware path, timestamp metadata, a changed input digest, unknown randomness, bounded equivalence, and a versioned transfer. The evaluator checks eight outputs per case.
15. Transfer: new digest, new build, new timestamp
The transfer changes an input digest, pins a new tool build, and introduces a timestamp field. Rebuild the recipe evidence to show which changes require a new recipe version, which support only bounded equivalence, and where the decision must be BLOCK or DEFER. The previous result is never the decision authority for the new context.
Assessment
There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.
AF1 formative
Name the CON-015 owned artifact and one adjacent outcome it does not own.
AF2 formative
Why does a stable preset name fail to prove reproducibility after a parameter change?
AF3 formative
When must a byte-different output be labeled bounded equivalence rather than deterministic?
AS1 application
Build a recipe/evidence pack for a supplied synthetic transform run.
AS2 diagnosis
Diagnose a run with a changed tool build and unchanged preset name.
AS3 decision
Issue BYTE_DETERMINISM_VERIFIED, BOUNDED_EQUIVALENCE_ONLY, BLOCK, or DEFER with evidence.
AS4 transfer
Rebuild the decision after input digest, tool build, and timestamp policy change.
AS5 reflection
State the strongest supported claim, one unsupported claim, and one residual risk.
Assessment rubric
- Identity and binding: exact input digest, recipe version, tool build, environment, operations, and parameters are explicit.
- Negative states: drift and UNKNOWN states are preserved rather than coerced into success.
- Determinism boundary: byte identity is never inferred from command text or preset name alone.
- Equivalence: any non-byte claim is constrained by an explicit equivalence policy.
- Transfer: the changed context is re-evaluated from new evidence.
References & freshness
Case studies
Lesson visuals
Lab files
Inspect the eight synthetic cases and implement evaluate_recipe(record) in starter.py. Your result should preserve unknown/drift states, distinguish byte identity from bounded equivalence, and never treat a preset name or rerun alone as proof.