From 2802355a1aa10e783e17d63a1ae13f54b7cf9f3b Mon Sep 17 00:00:00 2001 From: ThePolish Date: Fri, 13 Nov 2026 10:58:37 -0500 Subject: [PATCH 1/2] Publish maintenance outputs atomically and encode retained fields correctly --- .../scripts/dev/tests/test_maintenance.py | 154 ++++++++++++++++++ Resources/scripts/dvmetaburn.zsh | 6 +- Resources/scripts/lib/artifacts.zsh | 4 + Resources/scripts/lib/cleanup.zsh | 44 +++++ Resources/scripts/lib/encode.zsh | 16 ++ Resources/scripts/lib/logging.zsh | 4 +- Resources/scripts/lib/pipeline.zsh | 130 +-------------- Resources/scripts/lib/stitch.zsh | 18 +- 8 files changed, 245 insertions(+), 131 deletions(-) diff --git a/Resources/scripts/dev/tests/test_maintenance.py b/Resources/scripts/dev/tests/test_maintenance.py index 79115bc..2bb6821 100644 --- a/Resources/scripts/dev/tests/test_maintenance.py +++ b/Resources/scripts/dev/tests/test_maintenance.py @@ -323,6 +323,11 @@ def test_mp4_burnin_and_deinterlace_modes(self): data = subprocess.check_output([str(FFMPEG), "-v", "error", "-sseof", "-0.04", "-i", str(out), "-frames:v", "1", "-pix_fmt", "gray", "-f", "rawvideo", "-"], timeout=10) self.assertTrue(data and max(data) > 180) + frames = self.probe(out, "-select_streams", "v", "-show_frames")["frames"] + self.assertTrue(all(f["interlaced_frame"] == (1 if mode == "off" else 0) for f in frames)) + if mode == "off": + self.assertTrue(all(f["top_field_first"] == 0 for f in frames)) + out.unlink() def test_switchable_ass_covers_final_frame(self): self.cli("--format=mkv", "--burn-mode=subtitleTrack", "--deinterlace=off") @@ -379,6 +384,7 @@ def test_batch_cleanup_after_all_clips_and_stitch_boundaries(self): self.assertGreaterEqual(starts[2], 37 / FPS - .04) self.assertFalse(list((self.work / "scratch").glob("**/run.*"))) self.assertEqual(len(list((self.work / "output").glob("*.mkv"))), 1) + out.unlink() # No-stitch batch must also keep its workspace through the second clip. self.cli("--mode=batch", "--format=mov", "--burn-mode=off", "--scratch-cleanup=success", source=batch) self.assertTrue((self.work / "output/part0_conv.mov").exists()) @@ -445,5 +451,153 @@ def test_encoder_failure_is_reported_and_workspace_retained(self): self.assertEqual(json.loads(manifests[-1].read_text())["status"], "error") + def test_subtitle_bitstream_is_bottom_field_first(self): + self.cli("--format=mkv", "--burn-mode=subtitleTrack", "--deinterlace=off") + elementary = self.work / "elementary.h264" + run([FFMPEG, "-v", "error", "-i", self.output("_dvsub.mkv"), "-map", "0:v", "-c", "copy", elementary]) + frames = self.probe(elementary, "-show_frames")["frames"] + self.assertEqual(len(frames), 37) + self.assertTrue(all(f["interlaced_frame"] == 1 and f["top_field_first"] == 0 for f in frames)) + + def safety_modes(self): + return [("mov", "off", "off", False), ("mp4", "off", "off", False), + ("mp4", "burnin", "off", False), ("mp4", "burnin", "60p", False), + ("mkv", "subtitleTrack", "off", False), + ("mkv", "subtitleTrack", "off", True), + ("mp4", "burnin", "off", True), ("mp4", "off", "off", "audio")] + + def safety_wrapper(self, behavior): + wrapper = self.work / "encoder.zsh" + wrapper.write_text('#!/bin/zsh\n' + + 'if [[ "${@[-1]}" == */.dvmeta-output.*/output.* ]]; then\n' + + ' print -r -- partial > "${@[-1]}"\n' + behavior + '\nfi\n' + + 'exec ' + __import__('shlex').quote(str(FFMPEG)) + ' "$@"\n') + wrapper.chmod(0o755) + return wrapper + + def test_all_encode_routes_reject_partial_or_invalid_success(self): + for behavior in ("exit 42", "exit 0"): + wrapper = self.safety_wrapper(behavior) + for index, (fmt, burn, deint, fallback) in enumerate(self.safety_modes()): + with self.subTest(behavior=behavior, mode=index): + flags = ["--format="+fmt, "--burn-mode="+burn, "--deinterlace="+deint, + "--output-base=case"+str(index), "--ffmpeg="+str(wrapper), + "--missing-meta=skip_burnin_convert"] + if fallback == "audio": flags.append("--output-mode=audio") + result = self.cli(*flags, metadata=DVRESCUE if fallback is True else None, check=False) + self.assertNotEqual(result.returncode, 0, result.stdout) + self.assertEqual(list((self.work / "output").iterdir()), []) + + def test_all_encode_routes_cancel_without_final_or_stage(self): + wrapper = self.safety_wrapper('print -r -- ready > "$DVMETA_CANCEL_READY"; while true; do sleep 0.1; done') + for index, (fmt, burn, deint, fallback) in enumerate(self.safety_modes()): + with self.subTest(mode=index): + marker = self.work / "ready" + marker.unlink(missing_ok=True) + args = ["/bin/zsh", str(ENTRY), "--ffmpeg="+str(wrapper), + "--dvrescue="+str(DVRESCUE if fallback is True else self.metadata), + "--fontfile="+str(FONT), "--scratch-dir="+str(self.work / "scratch"), + "--dest-dir="+str(self.work / "output"), "--output-base=case"+str(index), + "--format="+fmt, "--burn-mode="+burn, "--deinterlace="+deint, + "--missing-meta=skip_burnin_convert"] + if fallback == "audio": args.append("--output-mode=audio") + args.append(str(self.source)) + with (self.work / "cancel.log").open("w") as log: + proc = subprocess.Popen(args, stdout=log, stderr=log, + env=dict(os.environ, DVMETA_CANCEL_READY=str(marker))) + try: + deadline = time.monotonic()+15 + while not marker.exists() and proc.poll() is None and time.monotonic()&2; } +owned_workspace_token=test; output_stage_dirs=(); active_child_pid=""; ffmpeg_bin=$2 +run_output_command /bin/cp "$3" "$4" +''' + procs = [subprocess.Popen(["zsh", "-c", code, "test", str(LIB), str(FFMPEG), str(self.source), str(t)], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for t in targets] + results = [p.communicate(timeout=20) for p in procs] + self.assertEqual(sum(p.returncode == 0 for p in procs), 2 if distinct else 1, results) + for t in set(targets): + self.assertEqual(t.read_bytes(), self.source.read_bytes()); t.unlink() + self.assertEqual(list(output.iterdir()), []) + + + def test_progressive_and_top_field_first_are_not_forced_to_bottom(self): + for label, options, expected in [("progressive", [], (0, 0)), + ("top", ["-flags", "+ilme+ildct", "-top", "1", "-x264-params", "tff=1"], (1, 1))]: + with self.subTest(source=label): + source = self.work / (label+".avi") + run([FFMPEG, "-v", "error", "-i", self.source, "-c:v", "libx264", *options, + "-c:a", "copy", source]) + self.cli("--format=mp4", "--burn-mode=off", "--output-base="+label, source=source) + out = self.work / "output" / (label+"_conv.mp4") + frames = self.probe(out, "-select_streams", "v", "-show_frames")["frames"] + self.assertTrue(all((f["interlaced_frame"], f["top_field_first"]) == expected for f in frames)) + + def test_cancel_final_concat_preserves_existing_export(self): + batch = self.work / "batch" + batch.mkdir() + for i in range(2): shutil.copyfile(self.source, batch/(str(i)+".avi")) + output = self.work / "output" + output.mkdir() + final = output/"batch_stitched_conv.mov" + final.write_bytes(b"owner export") + marker = self.work/"ready" + wrapper = self.work/"concat-cancel.zsh" + import shlex + wrapper.write_text('#!/bin/zsh\nfor arg in "$@"; do\nif [[ "$arg" == concat ]]; then\n' + + 'print partial > "${@[-1]}"\nprint ready > '+shlex.quote(str(marker))+'\n' + + 'while true; do sleep 0.1; done\nfi\ndone\nexec '+shlex.quote(str(FFMPEG))+' "$@"\n') + wrapper.chmod(0o755) + args = ["zsh", str(ENTRY), "--mode=batch", "--stitch-batch", "--format=mov", "--burn-mode=off", + "--ffmpeg="+str(wrapper), "--dvrescue="+str(self.metadata), "--scratch-dir="+str(self.work/"scratch"), + "--dest-dir="+str(output), str(batch)] + with (self.work/"cancel.log").open('w') as log: + proc = subprocess.Popen(args, stdout=log, stderr=log) + try: + deadline = time.monotonic()+15 + while not marker.exists() and proc.poll() is None and time.monotonic() $final_stitch_out" >&2 exit 1 fi diff --git a/Resources/scripts/lib/artifacts.zsh b/Resources/scripts/lib/artifacts.zsh index 6d79f14..c1d4c5d 100644 --- a/Resources/scripts/lib/artifacts.zsh +++ b/Resources/scripts/lib/artifacts.zsh @@ -247,6 +247,10 @@ finish_run() { return "$exit_code" fi + if [[ "$status_label" != success ]]; then + burn_output="" subtitle_output="" passthrough_output="" + last_burn_output_path="" last_subtitle_output_path="" last_passthrough_output_path="" + fi write_versions_file "$versions_file" write_run_manifest "$manifest_path" "$status_label" "$input_path" "$artifact_dir" "$dvrescue_xml" "$dvrescue_log" "$timeline_path" "$cmd_path" "$ass_path" "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" diff --git a/Resources/scripts/lib/cleanup.zsh b/Resources/scripts/lib/cleanup.zsh index 7a3ec62..1e09de4 100644 --- a/Resources/scripts/lib/cleanup.zsh +++ b/Resources/scripts/lib/cleanup.zsh @@ -25,6 +25,7 @@ initialize_run_workspace() { typeset -gr owned_scratch_root="$run_scratch_root" typeset -gr owned_workspace_token="$workspace_token" typeset -g run_had_failure=0 active_child_pid="" + typeset -ga output_stage_dirs=() # Keep the original inputs and destination available to the deletion guard. typeset -ga protected_run_paths=("$@" "${dest_dir:-}" "${stitch_input_list:-}") if [[ -n "${stitch_input_list:-}" && -f "$stitch_input_list" ]]; then @@ -86,6 +87,12 @@ exit_run_workspace() { local rc="$1" status_label=success trap - EXIT (( rc != 0 || run_had_failure != 0 )) && status_label=failure + local stage_dir + for stage_dir in "${output_stage_dirs[@]}"; do + [[ -d "$stage_dir" && ! -L "$stage_dir" && + -f "$stage_dir/.dvmeta-owner" && ! -L "$stage_dir/.dvmeta-owner" && + "$(<"$stage_dir/.dvmeta-owner")" == "${owned_workspace_token:-}" ]] && rm -rf -- "$stage_dir" + done if workspace_is_owned; then # Transient subprocess files are never useful diagnostic artifacts. rm -rf -- "$run_scratch_root/tmp" @@ -169,3 +176,40 @@ emit_debug_snapshots() { log_file_excerpt "timeline debug preview" "$timeline_path" 10 log_file_excerpt "timestamp.cmd preview" "$cmd_path" 10 } + +# Encode beside the destination, validate, then publish with link(2)'s exclusive +# creation semantics. /bin/link never follows a destination directory like ln. +# A crash may leave a hidden stage, but never a partial final or overwritten export. +run_output_command() { + local -a command=("$@") + local destination="${command[-1]}" stage_dir stage_file rc=0 + if [[ -e "$destination" || -L "$destination" ]]; then + warn "[publish] Destination exists; choose a new output name: $destination" + return 1 + fi + stage_dir=$(mktemp -d "${destination:h}/.dvmeta-output.XXXXXXXX") || return 1 + output_stage_dirs+=("$stage_dir") + print -rn -- "$owned_workspace_token" > "$stage_dir/.dvmeta-owner" || return 1 + stage_file="$stage_dir/output.${destination:e}" + command[-1]="$stage_file" + run_owned_command "${command[@]}" || rc=$? + if (( rc == 0 )) && [[ -s "$stage_file" ]]; then + run_owned_command "$ffmpeg_bin" -nostdin -v error -xerror -i "$stage_file" \ + -map '0:v?' -map '0:a?' -f null - || rc=$? + else + rc=1 + fi + if (( rc == 0 )); then + /bin/link "$stage_file" "$destination" || rc=$? + fi + rm -rf -- "$stage_dir" + (( rc == 0 )) || warn "[publish] Output was not published: $destination" + return "$rc" +} + +# Copy a completed scratch result into a sibling stage before exclusive publish. +# This remains atomic when scratch and destination are on different volumes. +publish_completed_output() { + local source="$1" destination="$2" + run_output_command /bin/cp "$source" "$destination" +} diff --git a/Resources/scripts/lib/encode.zsh b/Resources/scripts/lib/encode.zsh index 9d8a007..a10fba2 100644 --- a/Resources/scripts/lib/encode.zsh +++ b/Resources/scripts/lib/encode.zsh @@ -245,3 +245,19 @@ log_container_resolution() { info "[mux] Container: ${effective_format} | Video: ${resolved_video_codec:-unknown} | Audio: ${resolved_audio_codec:-unknown} | Subtitles: ${subtitle_label}" } + +# Inspect decoded field order, not just a container tag. FFmpeg showinfo reports +# B/T/P for the decoded frame. DV uses a consistent order within a recording. +interlaced_video_args() { + local source="$1" report order + report=$("$ffmpeg_bin" -nostdin -hide_banner -i "$source" -map 0:v:0 \ + -vf showinfo -frames:v 1 -an -f null - 2>&1) || return 1 + order=$(print -r -- "$report" | sed -n 's/.* i:\([BTP]\) .*/\1/p' | head -1) + reply=() + case "$order" in + B) reply=(-flags +ilme+ildct -top 0 -x264-params bff=1) ;; + T) reply=(-flags +ilme+ildct -top 1 -x264-params tff=1) ;; + P) ;; + *) warn "Cannot determine decoded field order: $source"; return 1 ;; + esac +} diff --git a/Resources/scripts/lib/logging.zsh b/Resources/scripts/lib/logging.zsh index 00b2292..96e0275 100644 --- a/Resources/scripts/lib/logging.zsh +++ b/Resources/scripts/lib/logging.zsh @@ -113,7 +113,9 @@ run_stage() { set +e local rc=0 - if [[ "$1" == "${ffmpeg_bin:-}" || "$1" == "${dvrescue_bin:-}" ]]; then + if [[ "$1" == "${ffmpeg_bin:-}" && ( "$stage" == encode || "$stage" == audio-extract ) ]]; then + run_output_command "$@" || rc=$? + elif [[ "$1" == "${ffmpeg_bin:-}" || "$1" == "${dvrescue_bin:-}" ]]; then run_owned_command "$@" || rc=$? else "$@" || rc=$? diff --git a/Resources/scripts/lib/pipeline.zsh b/Resources/scripts/lib/pipeline.zsh index 3d60a35..5d36719 100644 --- a/Resources/scripts/lib/pipeline.zsh +++ b/Resources/scripts/lib/pipeline.zsh @@ -202,6 +202,11 @@ process_file_core() { fi last_dvrescue_status=$dv_status + if [[ "$format" != mov && "$deinterlace_mode" == off ]]; then + interlaced_video_args "$source_video" || return 1 + codec_args+=("${reply[@]}") + fi + local deinterlace_vf="" local -a deinterlace_fps_args=() if [[ "$out_ext" == "mp4" || "$out_ext" == "mkv" ]]; then @@ -220,23 +225,12 @@ process_file_core() { # Transcode-only mode: no metadata if [[ "$burn_mode" == "off" ]]; then local final_out="${base}_conv.${out_ext}" - local work_out="" - if [[ -n "$deinterlace_vf" ]]; then - work_out="${artifact_dir%/}/output.work.${out_ext}" - fi echo "[PATH] FINAL_OUT=$final_out" - echo "[PATH] WORK_OUT=$work_out" echo "[INFO] Transcode-only conversion (no burn-in) to: $final_out" debug_log "Running transcode-only encode with args: ${codec_args[*]}" ensure_cleanup_stage echo "[WRITE] -> $final_out" - if [[ -n "$work_out" ]]; then - echo "[WRITE] -> $work_out" - fi local transcode_target="$final_out" - if [[ -n "$work_out" ]]; then - transcode_target="$work_out" - fi local -a transcode_cmd=("$ffmpeg_bin" -y -i "$source_video") if [[ -n "$deinterlace_vf" ]]; then transcode_cmd+=(-vf "$deinterlace_vf") @@ -263,20 +257,6 @@ process_file_core() { return 1 fi - if [[ -n "$work_out" ]]; then - log_move "$work_out" "$final_out" - if mv -f "$work_out" "$final_out"; then - : - else - exit_status=$? - manifest_status="error" - passthrough_output="$final_out" - last_passthrough_output_path="$passthrough_output" - finish_run "$exit_status" "$manifest_status" "$source_video" "$artifact_dir" "$dvrescue_xml" "$dvrescue_log" "$timeline_debug" "$cmdfile" "$ass_target" "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" "$run_manifest" - echo "Failed to move scratch output into place: $work_out -> $final_out" >&2 - return 1 - fi - fi exit_status=0 manifest_status="success" @@ -355,22 +335,11 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" skip_burnin_convert) echo "[WARN] Missing timestamp metadata for $source_video; converting without subtitle track." >&2 local final_out="${base}_conv.${out_ext}" - local work_out="" - if [[ -n "$deinterlace_vf" ]]; then - work_out="${artifact_dir%/}/output.work.${out_ext}" - fi echo "[PATH] FINAL_OUT=$final_out" - echo "[PATH] WORK_OUT=$work_out" echo "[INFO] Missing metadata fallback: writing transcode-only output to $final_out (stitch-batch will use *_conv.* parts)." >&2 ensure_cleanup_stage echo "[WRITE] -> $final_out" - if [[ -n "$work_out" ]]; then - echo "[WRITE] -> $work_out" - fi local subtitle_fallback_target="$final_out" - if [[ -n "$work_out" ]]; then - subtitle_fallback_target="$work_out" - fi local -a subtitle_fallback_cmd=("$ffmpeg_bin" -y -i "$source_video") if [[ -n "$deinterlace_vf" ]]; then subtitle_fallback_cmd+=(-vf "$deinterlace_vf") @@ -397,20 +366,6 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" return 1 fi - if [[ -n "$work_out" ]]; then - log_move "$work_out" "$final_out" - if mv -f "$work_out" "$final_out"; then - : - else - exit_status=$? - manifest_status="error" - passthrough_output="$final_out" - last_passthrough_output_path="$passthrough_output" - finish_run "$exit_status" "$manifest_status" "$source_video" "$artifact_dir" "$dvrescue_xml" "$dvrescue_log" "$timeline_debug" "$cmdfile" "$ass_target" "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" "$run_manifest" - echo "Failed to move scratch output into place: $work_out -> $final_out" >&2 - return 1 - fi - fi exit_status=0 manifest_status="success" @@ -444,24 +399,13 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" # We have a valid ASS file – mux it as MKV with true ASS subtitles local final_out="${base}_dvsub.mkv" - local work_out="" - if [[ -n "$deinterlace_vf" ]]; then - work_out="${artifact_dir%/}/output.work.${out_ext}" - fi echo "[PATH] FINAL_OUT=$final_out" - echo "[PATH] WORK_OUT=$work_out" local mux_target="$final_out" - if [[ -n "$work_out" ]]; then - mux_target="$work_out" - fi local -a sub_video_args=("${codec_args[@]}") local subtitle_codec="ass" echo "[INFO] Muxing subtitle track into: $final_out" >&2 echo "[WRITE] -> $final_out" - if [[ -n "$work_out" ]]; then - echo "[WRITE] -> $work_out" - fi local font_attach="$font" local font_filename="${font_attach:t}" @@ -504,20 +448,6 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" return 1 fi - if [[ -n "$work_out" ]]; then - log_move "$work_out" "$final_out" - if mv -f "$work_out" "$final_out"; then - : - else - exit_status=$? - manifest_status="error" - finish_run "$exit_status" "$manifest_status" "$source_video" "$artifact_dir" \ - "$dvrescue_xml" "$dvrescue_log" "$timeline_debug" "$cmdfile" "$ass_target" \ - "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" "$run_manifest" - echo "Failed to move scratch output into place: $work_out -> $final_out" >&2 - return 1 - fi - fi exit_status=0 manifest_status="success" @@ -545,22 +475,11 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" skip_burnin_convert) echo "[WARN] Converting without burn-in due to missing timestamp metadata." >&2 local final_out="${base}_conv.${out_ext}" - local work_out="" - if [[ -n "$deinterlace_vf" ]]; then - work_out="${artifact_dir%/}/output.work.${out_ext}" - fi echo "[PATH] FINAL_OUT=$final_out" - echo "[PATH] WORK_OUT=$work_out" echo "[INFO] Missing metadata fallback: writing transcode-only output to $final_out (stitch-batch will use *_conv.* parts)." >&2 ensure_cleanup_stage echo "[WRITE] -> $final_out" - if [[ -n "$work_out" ]]; then - echo "[WRITE] -> $work_out" - fi local timeline_fallback_target="$final_out" - if [[ -n "$work_out" ]]; then - timeline_fallback_target="$work_out" - fi local -a timeline_fallback_cmd=("$ffmpeg_bin" -y -i "$source_video") if [[ -n "$deinterlace_vf" ]]; then timeline_fallback_cmd+=(-vf "$deinterlace_vf") @@ -586,20 +505,6 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" echo "ffmpeg encode failed for: $source_video" >&2 return 1 fi - if [[ -n "$work_out" ]]; then - log_move "$work_out" "$final_out" - if mv -f "$work_out" "$final_out"; then - : - else - exit_status=$? - manifest_status="error" - passthrough_output="$final_out" - last_passthrough_output_path="$passthrough_output" - finish_run "$exit_status" "$manifest_status" "$source_video" "$artifact_dir" "$dvrescue_xml" "$dvrescue_log" "$timeline_debug" "$cmdfile" "$ass_target" "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" "$run_manifest" - echo "Failed to move scratch output into place: $work_out -> $final_out" >&2 - return 1 - fi - fi exit_status=0 manifest_status="success" passthrough_output="$final_out" @@ -668,23 +573,12 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" local final_out="${base}_dateburn.${out_ext}" - local work_out="" - if [[ -n "$deinterlace_vf" ]]; then - work_out="${artifact_dir%/}/output.work.${out_ext}" - fi echo "[PATH] FINAL_OUT=$final_out" - echo "[PATH] WORK_OUT=$work_out" echo "[INFO] Burning DV metadata into: $final_out" echo "[WRITE] -> $final_out" - if [[ -n "$work_out" ]]; then - echo "[WRITE] -> $work_out" - fi debug_log "ffmpeg burn-in filtergraph: $vf" debug_log "ffmpeg burn-in args: ${codec_args[*]}" local burn_target="$final_out" - if [[ -n "$work_out" ]]; then - burn_target="$work_out" - fi local -a burn_cmd=( "$ffmpeg_bin" -y -i "$source_video" -vf "$vf" @@ -709,20 +603,6 @@ debug_log "ASS font family resolved to: '$subtitle_font_name'" return 1 fi - if [[ -n "$work_out" ]]; then - log_move "$work_out" "$final_out" - if mv -f "$work_out" "$final_out"; then - : - else - exit_status=$? - manifest_status="error" - burn_output="$final_out" - last_burn_output_path="$burn_output" - finish_run "$exit_status" "$manifest_status" "$source_video" "$artifact_dir" "$dvrescue_xml" "$dvrescue_log" "$timeline_debug" "$cmdfile" "$ass_target" "$burn_output" "$subtitle_output" "$passthrough_output" "$versions_file" "$run_manifest" - echo "Failed to move scratch output into place: $work_out -> $final_out" >&2 - return 1 - fi - fi exit_status=0 manifest_status="success" diff --git a/Resources/scripts/lib/stitch.zsh b/Resources/scripts/lib/stitch.zsh index 72ebf1a..febd69f 100644 --- a/Resources/scripts/lib/stitch.zsh +++ b/Resources/scripts/lib/stitch.zsh @@ -86,9 +86,14 @@ stitch_sources() { prepare_subprocess_env local -a stitch_reencode_cmd build_codec_args "$format" "$effective_quality_kind" + local -a stitch_codecs=("${reply[@]}") + if [[ "$format" != mov && "$deinterlace_mode" == off && "$output_mode" != audio ]]; then + interlaced_video_args "$inputs[1]" || return 1 + stitch_codecs+=("${reply[@]}") + fi stitch_reencode_cmd=( "$ffmpeg_bin" -y -f concat -safe 0 -i "$list_file" - "${reply[@]}" + "${stitch_codecs[@]}" "${sanitized_extra_args[@]}" "$stitched_path" ) @@ -201,7 +206,7 @@ stitch_batch_folder() { "$stitched_path" ) log_ffmpeg_command "stitch-batch-copy" "${stitch_copy_cmd[@]}" - if run_owned_command "${stitch_copy_cmd[@]}"; then + if run_output_command "${stitch_copy_cmd[@]}"; then stitch_inputs_resolved="$list_file" stitched_source="$stitched_path" return 0 @@ -211,14 +216,19 @@ stitch_batch_folder() { prepare_subprocess_env local -a stitch_reencode_cmd build_codec_args "$format" "$effective_quality_kind" + local -a stitch_codecs=("${reply[@]}") + if [[ "$format" != mov && "$deinterlace_mode" == off && "$output_mode" != audio ]]; then + interlaced_video_args "$inputs[1]" || return 1 + stitch_codecs+=("${reply[@]}") + fi stitch_reencode_cmd=( "$ffmpeg_bin" -y -f concat -safe 0 -i "$list_file" - "${reply[@]}" + "${stitch_codecs[@]}" "${sanitized_extra_args[@]}" "$stitched_path" ) log_ffmpeg_command "stitch-batch-encode" "${stitch_reencode_cmd[@]}" - if run_owned_command "${stitch_reencode_cmd[@]}"; then + if run_output_command "${stitch_reencode_cmd[@]}"; then stitch_inputs_resolved="$list_file" stitched_source="$stitched_path" return 0 From f39aa4ac5718e438a2b233e4dfb6856726ee9502 Mon Sep 17 00:00:00 2001 From: ThePolish Date: Fri, 13 Nov 2026 11:03:07 -0500 Subject: [PATCH 2/2] Publish maintenance verification and shared distribution supplements --- .github/workflows/release-integrity.yml | 53 +++ DEV.md | 15 +- Resources/licenses/NOTICE.txt | 349 ++++++++++++++++++ docs/COMMUNITY_VALIDATION.md | 2 +- docs/DEV_TESTS.md | 4 + docs/LICENSING.md | 4 +- docs/MAINTENANCE_1.0.7.md | 14 +- docs/PROJECT_STATUS.md | 18 +- docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md | 14 + docs/audit/2026-11-13/DVRESCUE-NOTICES.txt | 347 +++++++++++++++++ .../audit/2026-11-13/dvrescue-provenance.json | 112 ++++++ .../dvrescue-supplement-delivery.json | 202 ++++++++++ .../maintenance-output-verification.json | 116 ++++++ readme.md | 6 +- scripts/tests/test_release_integrity.py | 66 ++++ scripts/verify_release.py | 71 ++++ 16 files changed, 1381 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release-integrity.yml create mode 100644 docs/audit/2026-11-13/DVRESCUE-NOTICES.txt create mode 100644 docs/audit/2026-11-13/dvrescue-provenance.json create mode 100644 docs/audit/2026-11-13/dvrescue-supplement-delivery.json create mode 100644 docs/audit/2026-11-13/maintenance-output-verification.json create mode 100644 scripts/tests/test_release_integrity.py create mode 100644 scripts/verify_release.py diff --git a/.github/workflows/release-integrity.yml b/.github/workflows/release-integrity.yml new file mode 100644 index 0000000..77d29ff --- /dev/null +++ b/.github/workflows/release-integrity.yml @@ -0,0 +1,53 @@ +name: Application release integrity +on: + pull_request: + paths: + - scripts/verify_release.py + - scripts/tests/** + - .github/workflows/release-integrity.yml + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: Application release tag to verify + required: true + type: string +permissions: + contents: read +jobs: + gate-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: python3 -m unittest discover -s scripts/tests -v + verify: + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && !startsWith(github.event.release.tag_name, 'examples-')) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - name: Download and validate application release + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} + run: | + mkdir release-check + gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --pattern BUILD-MANIFEST.json --pattern '*.zip' --dir release-check + python3 - <<'PY' + import json, os, pathlib, subprocess + root = pathlib.Path('release-check') + m = json.loads((root/'BUILD-MANIFEST.json').read_text()) + commit = m['source_commit'] + import re + assert re.fullmatch('[0-9a-f]{40}', commit), 'Invalid source commit' + tag_commit = subprocess.check_output(['git','rev-parse',os.environ['RELEASE_TAG']+'^{commit}'], text=True).strip() + assert tag_commit == commit, 'Release tag and source manifest differ' + project = root/'project.pbxproj' + project.write_bytes(subprocess.check_output(['git','show',commit+':DVMetaDataBurnIn.xcodeproj/project.pbxproj'])) + subprocess.run(['python3','scripts/verify_release.py','--tag',os.environ['RELEASE_TAG'], + '--manifest',str(root/'BUILD-MANIFEST.json'),'--archive',str(root/pathlib.Path(m['archive']['name']).name), + '--project',str(project)], check=True) + PY diff --git a/DEV.md b/DEV.md index 93b6328..baf2dfd 100644 --- a/DEV.md +++ b/DEV.md @@ -47,7 +47,7 @@ Default workspaces are `~/Library/Logs/DVMeta/run.XXXXXXXX/`. With `--scratch-di - `tmp/`: subprocess temporary files; removed on handled exit after the tracked child stops. - `artifacts/`: separate per-clip directories, logs, timeline, ASS, versions, manifests, and stitch intermediates. -`TMPDIR` and `TMPPREFIX` point inside the run. Output filenames and user-selected output locations are retained. A batch cleans its workspace once, after every clip and final concat, rather than at the end of each clip. The GUI's **Open temp folder** button opens its latest workspace; if that workspace was explicitly cleaned, it opens the existing parent folder. +`TMPDIR` and `TMPPREFIX` point inside the run. Output filenames and user-selected output locations are retained. Current maintenance refuses existing final names, including symlinks and directories. Encodes are staged in a private sibling directory, fully decoded for validation, and published through an exclusive hard link. Filesystems without hard-link support (for example exFAT) fail safely; select an APFS/HFS+ destination. Validation adds one decode pass. Handled failure/cancellation removes the owned stage; SIGKILL/power loss may retain a hidden stage. Existing exports are never deleted. A batch cleans its workspace once, after every clip and final concat, rather than at the end of each clip. The GUI's **Open temp folder** button opens its latest workspace; if that workspace was explicitly cleaned, it opens the existing parent folder. CLI cleanup controls retain their meanings: @@ -91,3 +91,16 @@ Use the actual Xcode path on another Mac. These checks exercise Swift allocation The `v1.0.7-maintenance.1` prerelease is built from the exact commit identified by its tag and `BUILD-MANIFEST.json`. Its Release app is copied into an isolated package staging directory, existing license texts and application source/build identity are included, and the outer app is ad-hoc signed without replacing the bundled tools. The ZIP is created with macOS `ditto` to preserve executable permissions and metadata. It is extracted again for signature/resource checks and a CLI self-test before upload. Published assets are downloaded and checked against SHA-256. The prerelease remains separate from the stable release. The premature source integration was reversed by PR #193; main retains stable 1.0.6 and maintenance needs owner testing/approval before future integration. The app manifest does not establish dependency build provenance. See [current status](docs/PROJECT_STATUS.md) and the [distribution audit](docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md) for unresolved source/notice evidence. The handoff ZIP in Nextcloud includes the source snapshot, release assets, validation logs, Git diffs/receipts and the end-to-end summary. No credentials, private keys, unrelated project files or original footage belong in that handoff. + +## Release integrity + +Before publishing any new application package, create external and embedded `BUILD-MANIFEST.json` files identifying the exact full source commit, release tag and application version. The external manifest also records the archive name/size/SHA-256, executable hash and bundled-tool hashes; the unchanged Preview 1 manifest is a concrete example. Keep the tag pointing at that source commit. Include all bundled notices, including the DVRescue supplement appended to `Resources/licenses/NOTICE.txt`. + +Run against the exact source checkout and final ZIP: + +```sh +python3 scripts/verify_release.py --tag v1.0.7-maintenance.2 --manifest /path/to/BUILD-MANIFEST.json --archive /path/to/application.zip --project DVMetaDataBurnIn.xcodeproj/project.pbxproj +python3 -m unittest discover -s scripts/tests -v +``` + +Use the intended tag and actual paths. This example is not a new release announcement. Never upload after a failed check. The `Application release integrity` workflow repeats validation on newly published application releases, or manually for a specified tag, and compares the tag's source project to the archive. Example-data releases are excluded. Historical packages without manifests are not retrospectively certified. The existing 1.0.4beta ZIP contains version 1.0.3; its tag and bytes are preserved, with actual runtime provenance unknown. Integrity checks do not establish licensing compliance, signing, GUI or player acceptance. diff --git a/Resources/licenses/NOTICE.txt b/Resources/licenses/NOTICE.txt index 916fa77..e8d59fe 100644 --- a/Resources/licenses/NOTICE.txt +++ b/Resources/licenses/NOTICE.txt @@ -22,3 +22,352 @@ Author page: https://nicholaskruse.com/work/uavosd VCR OSD Mono Font, by Riciery Leal Distributed as free for personal and commercial use per the author’s comments. Source: https://www.dafont.com/font-comment.php?file=vcr_osd_mono + + +DVRescue 24.07 distribution notice supplement — 2026-11-13 + +Applies to executable SHA-256: +396f26f02b6ad16fa406b890964df20ddc16424a0c99314892ec12859283ad4f + +This supplements, and does not replace, existing notices in DVMetaDataBurnIn. +The application remains MIT Copyright (c) 2025 Zach Zarzycki. +This product uses MediaInfo library, Copyright (c) 2002-2024 MediaArea.net SARL. +https://mediaarea.net/MediaInfo + +Texts below are preserved from MediaArea's official DVRescue 24.07 all-in-one +source package. Source-bundle inclusion alone is not proof that every optional +component is linked. The matching binary contains MediaInfoLib, ZenLib, serial, +TinyXML2 and DeckLink wrapper type information. It dynamically uses Apple's +system zlib, libc++ and frameworks, which this application does not redistribute. + +This is a partial remediation, not certification of a complete dependency +inventory. The source archive omits DeckLinkAPI.h, although the binary contains +DeckLink support. The exact SDK version/terms and any additional build-specific +components still need publisher evidence (#195). No unverified build identity +or third-party permission is asserted. See the accompanying provenance JSON. + + +===== DVRescue original publisher notice ===== +Source: dvrescue/LICENSE.txt + +BSD 3-Clause License + +Copyright (c) 2019-2020, Moving Image Preservation of Puget Sound +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +===== MediaInfoLib 24.06 ===== +Source: MediaInfoLib/LICENSE + +BSD 2-Clause License + +Copyright (c) 2002-2024, MediaArea.net SARL +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +===== ZenLib (source bundle 0.4.41; binary version unconfirmed) ===== +Source: ZenLib/License.txt + +Copyright (c) 2002-2020 MediaArea.net SARL. All rights reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + + +===== Serial ===== +Source: dvrescue/Source/ThirdParty/serial/LICENSE + +Copyright (c) 2012 William Woodall, John Harrison + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +===== CCDecoder ===== +Source: dvrescue/Source/ThirdParty/ccdecoder/ccdecoder.h + +/* + * ccdecoder - A standalone Closed Captions (CC) decoder + * Copyright (C) 2012-2012 MediaArea.net SARL, Info@MediaArea.net + * Copyright (C) 2012-2012 RGB Networks + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + ***************************************************************************/ + +===== TinyXML2 ===== +Source: MediaInfoLib/Source/ThirdParty/tinyxml2/tinyxml2.h + +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +===== tfsxml ===== +Source: MediaInfoLib/Source/ThirdParty/tfsxml/tfsxml.h + +/* Copyright (c) MediaArea.net SARL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +(MIT License) + +*/ + +===== AES ===== +Source: MediaInfoLib/Source/ThirdParty/aes-gladman/aes.h + +/* +--------------------------------------------------------------------------- +Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. + +The redistribution and use of this software (with or without changes) +is allowed without the payment of fees or royalties provided that: + + source code distributions include the above copyright notice, this + list of conditions and the following disclaimer; + + binary distributions include the above copyright notice, this list + of conditions and the following disclaimer in their documentation. + +This software is provided 'as is' with no explicit or implied warranties +in respect of its operation, including, but not limited to, correctness +and fitness for purpose. +--------------------------------------------------------------------------- +Issue Date: 20/12/2007 + + This file contains the definitions required to use AES in C. See aesopt.h + for optimisation details. +*/ + +===== SHA1 ===== +Source: MediaInfoLib/Source/ThirdParty/sha1-gladman/sha1.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 01/08/2005 +*/ + +===== SHA2 ===== +Source: MediaInfoLib/Source/ThirdParty/sha2-gladman/sha2.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 01/08/2005 +*/ + +===== HMAC ===== +Source: MediaInfoLib/Source/ThirdParty/hmac-gladman/hmac.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 26/08/2003 + + This is an implementation of HMAC, the FIPS standard keyed hash function +*/ + +===== MD5 ===== +Source: MediaInfoLib/Source/ThirdParty/md5/md5.c + +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + */ diff --git a/docs/COMMUNITY_VALIDATION.md b/docs/COMMUNITY_VALIDATION.md index 79f80ac..9dd5b73 100644 --- a/docs/COMMUNITY_VALIDATION.md +++ b/docs/COMMUNITY_VALIDATION.md @@ -78,7 +78,7 @@ zsh "$APP_RES/scripts/dvmetaburn.zsh" --mode=single --layout=stacked --format=mo python3 "$REPO/scripts/verify_train_demo.py" --ffmpeg "$FFMPEG" --ffprobe "$FFPROBE" --dvrescue "$DVRESCUE" --reference "$SOURCE" "$WORK/generated/train-check_conv.mov" > "$WORK/verification.json" ``` -Use separate destinations for concurrent runs and keep originals untouched. Scratch is deliberately retained here for diagnosis. CLI success is a CLI result. A GUI report should separately describe file selection, progress, folder queue behavior, Finder workspace access and Stop. Cancellation can leave a partial final output ([#198](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/198)); test with disposable derivatives in a new destination. +Use separate destinations for concurrent runs and keep originals untouched. Scratch is deliberately retained here for diagnosis. CLI success is a CLI result. A GUI report should separately describe file selection, progress, folder queue behavior, Finder workspace access and Stop. Stable and the original Preview 1 can leave a partial final output on cancellation; current maintenance stages and validates outputs, then refuses collisions ([#198](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/198)); test with disposable derivatives in a new destination. ## 5. Observe playback and report the result diff --git a/docs/DEV_TESTS.md b/docs/DEV_TESTS.md index b6d566e..ffb1a61 100644 --- a/docs/DEV_TESTS.md +++ b/docs/DEV_TESTS.md @@ -65,3 +65,7 @@ Test mixed metadata using original camera footage only when the owner chooses ap ## Optional real-footage fixture The [train preservation demonstration](examples/TRAIN_DV_PRESERVATION.md) includes hash-pinned downloads and explicit-path verification commands. It is opt-in and is not downloaded or processed by the default tests. Its single-clip CLI evidence does not replace GUI, motion/audio, target-player, or Apple Silicon acceptance. + +## Current output-safety and field-signaling regressions + +The maintenance suite now has 33 tests plus three shell smoke checks. Tests include partial and invalid-success encoder output, TERM in every final encode route, final-concat cancellation, existing file/symlink/directory preservation, same-name publication races and distinct concurrent destinations. Frame tests check decoded BFF/TFF/progressive flags and an extracted raw H.264 stream, independently of container tags. Synthetic tests are separate from the [new train CLI receipt](audit/2026-11-13/maintenance-output-verification.json). GUI and player acceptance remain manual; hard-link publication is tested on the local filesystem, not certified on every removable/network volume. diff --git a/docs/LICENSING.md b/docs/LICENSING.md index e8b0d4c..1dc41bb 100644 --- a/docs/LICENSING.md +++ b/docs/LICENSING.md @@ -9,7 +9,7 @@ See the [distribution audit](THIRD_PARTY_DISTRIBUTION_AUDIT.md) for all eight pu | Component | Observed version and notice | Scope and remaining evidence | | --- | --- | --- | | FFmpeg | Bundled x86_64 `8.0.1-tessus`; `-buildconf` includes `--enable-gpl --enable-version3`; `-L` states GPL version 3 or later. [GPLv3 text](../Resources/licenses/COPYING.GPLv3), [existing FFmpeg notice](../Resources/licenses/LICENSE.md). | This specific binary reports GPL-3.0-or-later. Other FFmpeg configurations can have different terms. The executable now matches the supplier download by SHA-256. Exact corresponding source/build materials and complete external-library notices remain unresolved in issue #194. | -| DVRescue | Bundled x86_64 24.07, reporting MediaInfoLib 24.06. [BSD-3-Clause notice](../Resources/licenses/dvrescue_LICENSE.txt), copyright 2019–2025 MIPoPS. | Preserve its notice. The bundled notice does not fully inventory dependency licensing; this is not a complete distribution audit. | +| DVRescue | Bundled x86_64 24.07, reporting MediaInfoLib 24.06. [BSD-3-Clause notice](../Resources/licenses/dvrescue_LICENSE.txt), copyright 2019–2025 MIPoPS. | Official 24.07 package matches the binary. Verified dependency notices are now appended to the bundled notice and supplied beside historical downloads; exact DeckLink SDK/build mapping remains open in #195. | | UAV OSD fonts | UAV-OSD-Mono and UAV-OSD-Sans-Mono; attribution to Nicholas Kruse. | Existing notice references free personal/commercial use and author pages; author-linked font bytes and use permission are verified, while explicit redistribution/embedding terms remain unresolved in issue #196. | | VCR OSD Mono | Attribution to Riciery Leal (mrmanet). | Existing notice relies on author comments for permission; author-linked font bytes and use permission are verified, while explicit redistribution/embedding terms remain unresolved in issue #196. | @@ -22,7 +22,7 @@ Resources/bin/ffmpeg -L Resources/bin/dvrescue --version ``` -The application's MIT license does not replace component terms. These observations do not establish blanket distribution compliance. Resolving the source/build and font-notice gaps is follow-up work; this documentation change does not replace bundled binaries or rewrite third-party terms. +The application's MIT license does not replace component terms. These observations do not establish blanket distribution compliance. Verified DVRescue notice gaps are partially repaired by the [supplement](audit/2026-11-13/DVRESCUE-NOTICES.txt). Exact remaining FFmpeg, DeckLink/build and font evidence is listed in the distribution audit. No bundled binary or third-party terms were replaced. ## Train footage and extracted frames diff --git a/docs/MAINTENANCE_1.0.7.md b/docs/MAINTENANCE_1.0.7.md index d123c6a..a628d38 100644 --- a/docs/MAINTENANCE_1.0.7.md +++ b/docs/MAINTENANCE_1.0.7.md @@ -4,6 +4,18 @@ See the [verified project status](PROJECT_STATUS.md) for the definitive current summary, [distribution audit](THIRD_PARTY_DISTRIBUTION_AUDIT.md) for dependency gaps, and [community guide](COMMUNITY_VALIDATION.md) for independent testing. +## Current maintenance fixes after Preview 1 + +Runtime commit `2802355` is exclusive to maintenance; stable main remains 1.0.6. The published `v1.0.7-maintenance.1` app and train derivatives remain unchanged and do not include these fixes. + +- Every final encode (MOV, MP4, subtitles, missing-metadata fallback and audio routing) uses a private stage beside its destination. A successful encoder exit, nonempty output and complete FFmpeg decode are required before exclusive publication. Final batch concat is copied to the destination filesystem before the same check. Existing files, symlinks and directories cause failure; two racing writers cannot overwrite each other. Failed/cancelled jobs do not advertise an output as successfully published. +- Publication uses an exclusive hard link. APFS/HFS+ support this; exFAT and other filesystems without hard links fail safely. Full validation costs one additional decode pass. SIGKILL or power loss may leave a hidden `.dvmeta-output.*` directory, never an intentionally partial final name. No later job sweeps old stages. This is atomic visibility, not a power-loss durability guarantee. +- Deinterlacing-off H.264 enables interlaced x264 coding with the first decoded frame's BFF/TFF order. Progressive input remains progressive; deinterlaced outputs remain progressive. Mixed field orders inside one source are not certified. Concat re-encode fallbacks retain the same policy. +- **33 synthetic regressions and three shell checks pass**, including raw H.264 decoded flags, BFF/TFF/progressive inputs, partial/invalid encoders, cancellation, existing exports and simultaneous writers. The Intel Xcode 15.4 Release build passes; this is not GUI or Apple Silicon acceptance. +- Fresh [train results](audit/2026-11-13/maintenance-output-verification.json): original SHA-256 unchanged; 238 DV frames and decoded PCM preserved in MOV; 238 bottom-field-first H.264 frames in both MP4/MKV; 476 progressive frames at 60p; nine subtitle events covering the last frame. These are new CLI checks, separate from the historical public videos. + +Issue #198's publication defect is fixed with focused evidence. #197 remains open only for its moving-picture/player acceptance criterion. GUI Stop/queues, subjective audio/motion, broader footage, native Apple Silicon and Rosetta remain unverified. Licensing evidence dependencies are separate; see [current status](PROJECT_STATUS.md). + ## Historical preview validation — November 12, 2026 Implementation, synthetic regression checks, and the native Xcode build are complete. The maintenance changes first passed the native build at 1.0.6; the application was then updated to **1.0.7** and its Debug and Release builds passed. Distribution is the `v1.0.7-maintenance.1` prerelease from `maintenance/1.0.7`. This describes the original preview gate. A later source-integration authorization was misunderstood and superseded by the owner clarification and corrective PR #193; it is not current approval to integrate maintenance code. GUI, player, motion/audio, additional real-camera scenarios and Apple Silicon acceptance still limit release readiness. See [release notes](releases/1.0.7-maintenance.1.md). @@ -96,7 +108,7 @@ Local unsigned build outputs (the distribution copy is separately ad-hoc signed) 2. Perform GUI acceptance from that build: Finder workspace access, folder queues, Stop during each processing stage, two app instances with distinct outputs, and the retention controls. Syntax and CLI checks do not prove Swift lifecycle or UI behavior. 3. Review real camcorder footage and player rendering: timestamp appearance and date transitions, 480i motion/field order, 30p/60p motion, switchable subtitles, and clip joins. The original synthetic suite used generated positive metadata and actual DVRescue for missing RDT. The November 13 train supplement subsequently added positive actual DVRescue extraction and rendering/tail measurements from one real-camera clip. It does not supply independent camera-clock truth or broader real-camera acceptance. Full damaged-tape/camera coverage, native Apple Silicon operation, distribution signing, and audio/quality subjective acceptance remain unverified. 4. Retain existing per-clip/continuous routing; this release does not invent a new distinction between those modes. Mixed metadata burn-in stitching is automated; heterogeneous subtitle-stream stitching and player-specific edge cases merit real-footage follow-up. -5. The ownership guard intentionally preserves workspaces containing selected inputs/outputs, including generated `--selftest` outputs. SIGKILL/power loss cannot run cleanup traps. Existing final-output overwrite behavior and names are unchanged; callers running identical inputs concurrently should use distinct destinations. Direct-output encoder failures can still leave a partial final file; this maintenance change does not delete potentially preexisting user exports. +5. The ownership guard intentionally preserves workspaces containing selected inputs/outputs, including generated `--selftest` outputs. SIGKILL/power loss cannot run cleanup traps. This historical Preview 1 limitation is superseded on current maintenance by `2802355`: staged publication refuses collisions and does not delete preexisting exports. The unchanged Preview 1 package still has the old behavior. 6. Further library/UI restructuring and dormant compatibility helpers were left alone where removal would provide little benefit without broader GUI/real-footage validation. No architecture rewrite or new runtime dependency was introduced. Rebuild using [DEV.md](../DEV.md), then perform the remaining manual acceptance checks in [DEV_TESTS.md](DEV_TESTS.md). The owner authorized publication of the maintenance prerelease and a draft pull request. The November 13 integration decision was superseded: PR #193 restored stable 1.0.6 on main. The 1.0.7 implementation remains an unconfirmed preview; future integration requires owner testing and explicit acceptance. The train supplement above supplies the bounded real-footage evidence. diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index 4f3151e..357c5b2 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -1,11 +1,11 @@ # Verified project status -Audited November 13, 2026. This is the current summary; dated reports below preserve historical evidence. +Updated November 13, 2026 after PR #200 and maintenance engineering verification. This is the current summary; dated reports below preserve historical evidence. ## Application and branch policy -- **Stable application: 1.0.6.** `main` at `da0a3b97126578d45d24e65573e85367c1f7979e` retains the pre-maintenance runtime. Its public package is still named [1.0.6 beta](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/1.0.6beta); “stable” describes the owner's retained baseline, not completed compatibility certification. -- **Maintenance preview: 1.0.7.** `maintenance/1.0.7` at `ad21e2bbedfc00a2c97f7d1771f12fe8c046811b` retains the runtime from preview commit `5f7e13e0b9f94b98bfef32c5d828aae614265583`. [Preview 1](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/v1.0.7-maintenance.1) remains a prerelease. Documentation commits after these audit baselines do not promote application code. +- **Stable application: 1.0.6.** The stable runtime restored at `da0a3b97126578d45d24e65573e85367c1f7979e` remains on `main`, which retains the pre-maintenance runtime. Its public package is still named [1.0.6 beta](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/1.0.6beta); “stable” describes the owner's retained baseline, not completed compatibility certification. +- **Experimental implementation: 1.0.7.** [`maintenance/1.0.7`](https://github.com/shardsofaperture/DVMetaDataBurnIn/tree/maintenance/1.0.7) includes runtime fix `2802355` for final-output safety and H.264 field signaling. [Preview 1](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/v1.0.7-maintenance.1) is still the original `5f7e13e` package and does **not** contain those fixes. No stable release or tag is changed. - PR #191 prematurely integrated maintenance code; [PR #193](https://github.com/shardsofaperture/DVMetaDataBurnIn/pull/193) restored stable runtime on main. That historical integration is **superseded**, not ongoing authorization. Main and maintenance share public documentation/licensing corrections. Only owner testing and explicit acceptance can authorize future runtime integration. - All eight published app ZIPs contain x86_64 FFmpeg and DVRescue executables. The stable 1.0.6 app executable (and older apps) has x86_64/arm64 slices; preview 1.0.7 is x86_64-only. An arm64 UI slice does not make the Intel tools native or prove Apple Silicon operation. Current packages declare macOS **12.0 minimum**. Native build/tool evidence is Intel macOS 14 with Xcode 15.4; this is not testing across all macOS 12+ versions. Native Apple Silicon and Rosetta operation remain unverified. No Windows/Linux application support is claimed. Preview signing is ad-hoc, not notarized. @@ -25,8 +25,16 @@ Source references for maintenance claims: [encode.zsh](https://github.com/shards Published evidence is the separate [train example release](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/examples-train-dv-v1), its original/derivative hashes, stream measurements, metadata rows, transition images and reproduction commands. The owner's supplied MP4 has unknown producing app version; only the four identified maintenance derivatives are bound to `5f7e13e`. CLI results do not prove GUI acceptance. No independent tester reports or adoption evidence were established by this audit; owner-supplied footage and maintainer-run checks are identified as such. +## Completed engineering and distribution corrections + +PR #200 integrated documentation only. Main's Swift, Xcode project, runtime scripts, tools and fonts still match the restored 1.0.6 baseline. Narrow shared documentation updates preserve that boundary. + +Maintenance runtime `2802355` passes 33 synthetic regressions and three shell checks, including failed/cancelled encodes, destination collisions and extracted H.264 bitstream flags. Fresh train CLI checks preserve 238 DV frames and PCM in MOV, correctly signal 238 bottom-field-first H.264 frames in MP4/MKV, retain 476 progressive frames at 60p and nine subtitles ending at 7.95 seconds. [Machine-readable results](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/audit/2026-11-13/maintenance-output-verification.json) and the [maintenance report](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/MAINTENANCE_1.0.7.md) distinguish these checks from player/GUI acceptance. Historical table rows above describe Preview 1, not the new code. + +The original official DVRescue 24.07 package now matches the distributed executable byte for byte. Twelve verified notice texts are preserved in [the supplement](audit/2026-11-13/DVRESCUE-NOTICES.txt) and appended to the existing bundled notice. [Provenance](audit/2026-11-13/dvrescue-provenance.json) also identifies remaining DeckLink/build-manifest uncertainty; #195 is not closed by partial notice repair. The [release integrity gate](../scripts/verify_release.py) rejects mismatched tags, manifests, built versions and hashes. The historical 1.0.4beta ZIP remains unchanged and labeled as containing version 1.0.3; its actual runtime provenance is not inferred from either label. + ## Outstanding work -Before claiming distribution readiness, resolve [FFmpeg corresponding source and notices #194](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/194), [DVRescue dependency evidence #195](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/195), and [font redistribution/embedding evidence #196](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/196). The [distribution audit](THIRD_PARTY_DISTRIBUTION_AUDIT.md) distinguishes confirmed facts from missing evidence; opening issues does not resolve them. The application MIT license is verified and unchanged. +Application submission evidence is materially improved, but **complete distribution readiness cannot yet be claimed**. Exact FFmpeg corresponding source/build materials and dependency notices (#194), DVRescue DeckLink SDK/build mapping (#195), and explicit font redistribution/embedding evidence (#196) remain external evidence dependencies. See the [distribution audit](THIRD_PARTY_DISTRIBUTION_AUDIT.md) for exact findings. Application MIT terms and authorship remain unchanged. -Before promoting 1.0.7, complete owner GUI acceptance, broader player/subtitle testing, visual motion and audio-quality checks, more real-camera scenarios, and applicable platform acceptance. Use the [community validation guide](COMMUNITY_VALIDATION.md) and the [maintenance report](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/MAINTENANCE_1.0.7.md). Direct DV/Digital8 and HDV capture remain [planned development](ROADMAP.md), not implemented capabilities. +Accepting the entire 1.0.7 release is not required to complete documentation, notice repair or the packaging gate. Before promoting 1.0.7, complete GUI queues/Stop, player subtitle/motion/audio review, broader real-camera cases and platform acceptance. #197 remains open for its explicit moving-picture/player criterion after the automated field-signaling fix. #198 concerns publication safety, with GUI acceptance tracked separately. Use the [community validation guide](COMMUNITY_VALIDATION.md). Direct DV/Digital8 and HDV capture remain [planned](ROADMAP.md). diff --git a/docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md b/docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md index 2921f64..491a280 100644 --- a/docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md +++ b/docs/THIRD_PARTY_DISTRIBUTION_AUDIT.md @@ -46,3 +46,17 @@ DVRescue SHA-256 is `396f26f02b6ad16fa406b890964df20ddc16424a0c99314892ec1285928 [Font-origin checks](audit/2026-11-13/font-origin-checks.json) record source download URLs, hashes, package contents and name-table versions. Author statements establish free use, including commercial use. They do not explicitly settle unmodified app redistribution, font attachment in MKV, or all attribution conditions. No OFL, public-domain dedication or new license is inferred. [#196](https://github.com/shardsofaperture/DVMetaDataBurnIn/issues/196) specifies the permission evidence needed; nobody was contacted by this audit. Existing notices and binaries remain intact. Application archives and train media were not replaced. [Sample rights](LICENSING.md#train-footage-and-extracted-frames) remain distinct from software/font rights. No issue is resolved solely because this document now records it. + +## Distribution remediation, November 13, 2026 + +The [DVRescue provenance receipt](audit/2026-11-13/dvrescue-provenance.json) identifies the original [official 24.07 DMG](https://mediaarea.net/download/binary/dvrescue/24.07/dvrescue_CLI_24.07_Mac.dmg), SHA-256 `6cda2ec5f951ebe5984da2fd5a1cbe574831bb2aa7d21de0da8218625aa12484`. Extracting its package without installing it yields exactly the application's `396f26f0…` executable. The newer 24.07.1 package differs and was not substituted. + +The official [all-in-one 24.07 source bundle](https://mediaarea.net/download/binary/dvrescue/24.07/dvrescue_CLI_24.07_GNU_FromSource.tar.gz) contains MediaInfoLib **24.06**, matching the binary, plus ZenLib source 0.4.41 and bundled third-party notices. This resolves the misleading split-download 24.04 lead. Twelve original notice texts are now preserved in [DVRESCUE-NOTICES.txt](audit/2026-11-13/DVRESCUE-NOTICES.txt), with source-file hashes in the receipt, and appended to [the existing bundled NOTICE](../Resources/licenses/NOTICE.txt) so future Xcode builds include them. Original copyright texts remain intact, including both the publisher's 2019–2020 DVRescue notice and the preexisting 2019–2025 notice. + +For every historical application release, additive `DVRESCUE-NOTICES-2026-11-13.txt`, `DVRESCUE-PROVENANCE-2026-11-13.json`, and `DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt` accompany the unchanged ZIP. Their download links and hashes are verified after upload. These materials repair missing verified notices; they do not claim a complete dependency audit. Binary type information establishes MediaInfoLib, ZenLib, serial, TinyXML2 and DeckLink support. System zlib/libc++/frameworks are dynamically referenced and are not redistributed here. The source bundle omits `DeckLinkAPI.h`; an exact publisher build manifest, SDK revision and applicable notice mapping are still needed. Source-bundle versions are not asserted as independently proven binary versions. #195 remains open for that narrow requirement. + +FFmpeg: the supplier page, version-specific API, binary configuration and public source leads still do not provide exact patches, static-library source revisions and controlling build scripts for `430d60fb…`. No generic upstream tarball is presented as corresponding source. #194 needs the publisher's exact build/source materials and durable delivery alongside all affected downloads. Replacement cannot repair missing provenance for already-published historical bytes; no replacement or source compilation was performed. + +Fonts: author-linked font packages and author use statements were rechecked. Explicit permission covering app redistribution and MKV font attachment is still absent; third-party font catalog labels are not substituted for the authors' terms. #196 needs permission from Nicholas Kruse (both UAV fonts) and Riciery Leal (VCR OSD Mono), including attribution conditions, or authoritative preexisting terms covering these exact files. Existing train assets and fonts remain unchanged. No supplier or author was contacted and no permission was invented. + +Historical packaging: `1.0.4beta` contains Info.plist 1.0.3. Its release notes already disclose this. The new [release gate](../scripts/verify_release.py) and [GitHub workflow](../.github/workflows/release-integrity.yml) compare tag, source project version, external/embedded manifests, app Info.plist and archive/executable/tool hashes. [Packaging instructions](../DEV.md#release-integrity) describe the pre-publication check. Seven focused tests and the unchanged Preview 1 ZIP pass. The historical ZIP hash remains `72c89f3312820091b5f58ee9075cc72c59abbf768020c6299d074212584f9972`; no claim is made that its mismatch is only cosmetic. diff --git a/docs/audit/2026-11-13/DVRESCUE-NOTICES.txt b/docs/audit/2026-11-13/DVRESCUE-NOTICES.txt new file mode 100644 index 0000000..29e8dbb --- /dev/null +++ b/docs/audit/2026-11-13/DVRESCUE-NOTICES.txt @@ -0,0 +1,347 @@ +DVRescue 24.07 distribution notice supplement — 2026-11-13 + +Applies to executable SHA-256: +396f26f02b6ad16fa406b890964df20ddc16424a0c99314892ec12859283ad4f + +This supplements, and does not replace, existing notices in DVMetaDataBurnIn. +The application remains MIT Copyright (c) 2025 Zach Zarzycki. +This product uses MediaInfo library, Copyright (c) 2002-2024 MediaArea.net SARL. +https://mediaarea.net/MediaInfo + +Texts below are preserved from MediaArea's official DVRescue 24.07 all-in-one +source package. Source-bundle inclusion alone is not proof that every optional +component is linked. The matching binary contains MediaInfoLib, ZenLib, serial, +TinyXML2 and DeckLink wrapper type information. It dynamically uses Apple's +system zlib, libc++ and frameworks, which this application does not redistribute. + +This is a partial remediation, not certification of a complete dependency +inventory. The source archive omits DeckLinkAPI.h, although the binary contains +DeckLink support. The exact SDK version/terms and any additional build-specific +components still need publisher evidence (#195). No unverified build identity +or third-party permission is asserted. See the accompanying provenance JSON. + + +===== DVRescue original publisher notice ===== +Source: dvrescue/LICENSE.txt + +BSD 3-Clause License + +Copyright (c) 2019-2020, Moving Image Preservation of Puget Sound +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +===== MediaInfoLib 24.06 ===== +Source: MediaInfoLib/LICENSE + +BSD 2-Clause License + +Copyright (c) 2002-2024, MediaArea.net SARL +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +===== ZenLib (source bundle 0.4.41; binary version unconfirmed) ===== +Source: ZenLib/License.txt + +Copyright (c) 2002-2020 MediaArea.net SARL. All rights reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + + +===== Serial ===== +Source: dvrescue/Source/ThirdParty/serial/LICENSE + +Copyright (c) 2012 William Woodall, John Harrison + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +===== CCDecoder ===== +Source: dvrescue/Source/ThirdParty/ccdecoder/ccdecoder.h + +/* + * ccdecoder - A standalone Closed Captions (CC) decoder + * Copyright (C) 2012-2012 MediaArea.net SARL, Info@MediaArea.net + * Copyright (C) 2012-2012 RGB Networks + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + ***************************************************************************/ + +===== TinyXML2 ===== +Source: MediaInfoLib/Source/ThirdParty/tinyxml2/tinyxml2.h + +/* +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +===== tfsxml ===== +Source: MediaInfoLib/Source/ThirdParty/tfsxml/tfsxml.h + +/* Copyright (c) MediaArea.net SARL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +(MIT License) + +*/ + +===== AES ===== +Source: MediaInfoLib/Source/ThirdParty/aes-gladman/aes.h + +/* +--------------------------------------------------------------------------- +Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. + +The redistribution and use of this software (with or without changes) +is allowed without the payment of fees or royalties provided that: + + source code distributions include the above copyright notice, this + list of conditions and the following disclaimer; + + binary distributions include the above copyright notice, this list + of conditions and the following disclaimer in their documentation. + +This software is provided 'as is' with no explicit or implied warranties +in respect of its operation, including, but not limited to, correctness +and fitness for purpose. +--------------------------------------------------------------------------- +Issue Date: 20/12/2007 + + This file contains the definitions required to use AES in C. See aesopt.h + for optimisation details. +*/ + +===== SHA1 ===== +Source: MediaInfoLib/Source/ThirdParty/sha1-gladman/sha1.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 01/08/2005 +*/ + +===== SHA2 ===== +Source: MediaInfoLib/Source/ThirdParty/sha2-gladman/sha2.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 01/08/2005 +*/ + +===== HMAC ===== +Source: MediaInfoLib/Source/ThirdParty/hmac-gladman/hmac.h + +/* + --------------------------------------------------------------------------- + Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software in both source and binary + form is allowed (with or without changes) provided that: + + 1. distributions of this source code include the above copyright + notice, this list of conditions and the following disclaimer; + + 2. distributions in binary form include the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other associated materials; + + 3. the copyright holder's name is not used to endorse products + built using this software without specific written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this product + may be distributed under the terms of the GNU General Public License (GPL), + in which case the provisions of the GPL apply INSTEAD OF those given above. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 26/08/2003 + + This is an implementation of HMAC, the FIPS standard keyed hash function +*/ + +===== MD5 ===== +Source: MediaInfoLib/Source/ThirdParty/md5/md5.c + +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + */ diff --git a/docs/audit/2026-11-13/dvrescue-provenance.json b/docs/audit/2026-11-13/dvrescue-provenance.json new file mode 100644 index 0000000..87d20a7 --- /dev/null +++ b/docs/audit/2026-11-13/dvrescue-provenance.json @@ -0,0 +1,112 @@ +{ + "verified_on": "2026-11-13", + "binary_sha256": "396f26f02b6ad16fa406b890964df20ddc16424a0c99314892ec12859283ad4f", + "official_package": { + "url": "https://mediaarea.net/download/binary/dvrescue/24.07/dvrescue_CLI_24.07_Mac.dmg", + "sha256": "6cda2ec5f951ebe5984da2fd5a1cbe574831bb2aa7d21de0da8218625aa12484", + "pkg_sha256": "4975e65c4fcc8f1974971fb5ecdca908c7118f3ca42c4e076dd0e364942b4483", + "extracted_binary_path": "Payload/usr/local/bin/dvrescue", + "extracted_binary_sha256": "396f26f02b6ad16fa406b890964df20ddc16424a0c99314892ec12859283ad4f", + "matches_all_eight_audited_application_releases": true + }, + "source_package": { + "url": "https://mediaarea.net/download/binary/dvrescue/24.07/dvrescue_CLI_24.07_GNU_FromSource.tar.gz", + "sha256": "e3089cf62757bb2a87bb38c353acf37c03195bcc8bcbf17565f7cb9b8ee51a72", + "MediaInfoLib_version_in_source": "24.06", + "ZenLib_version_in_source": "0.4.41", + "relationship": "Official same-release source bundle, not a reproduced or certified exact build." + }, + "original_notice_matches_source": true, + "supplement_sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "notice_sources": [ + { + "component": "DVRescue original publisher notice", + "source_path": "dvrescue/LICENSE.txt", + "source_file_sha256": "1f5d32d4ce23eb17c41ff1e78fb12860d9d04dfa2dd2a73f6f6deecde6b0fe55", + "notice_extraction": "complete file" + }, + { + "component": "MediaInfoLib 24.06", + "source_path": "MediaInfoLib/LICENSE", + "source_file_sha256": "0da6dfefb15805c2b3ce678ee79e77ab17ceb72c0f5c05b7fde7a4bcd72e10b2", + "notice_extraction": "complete file" + }, + { + "component": "ZenLib (source bundle 0.4.41; binary version unconfirmed)", + "source_path": "ZenLib/License.txt", + "source_file_sha256": "054f4c5881d8906df8b1255fdbb2eaa78f7422829cfa1c67eb1c9e252493bdde", + "notice_extraction": "complete file" + }, + { + "component": "Serial", + "source_path": "dvrescue/Source/ThirdParty/serial/LICENSE", + "source_file_sha256": "bb12b3c857da4804ccd00816a1daae298e75d314012346bb1a8995a496e2f9d0", + "notice_extraction": "complete file" + }, + { + "component": "CCDecoder", + "source_path": "dvrescue/Source/ThirdParty/ccdecoder/ccdecoder.h", + "source_file_sha256": "1059632148829e62e1dbfe0cff17dd1bbe176d663310f00614f64fb14983d1b9", + "notice_extraction": "first complete block comment" + }, + { + "component": "TinyXML2", + "source_path": "MediaInfoLib/Source/ThirdParty/tinyxml2/tinyxml2.h", + "source_file_sha256": "5818b3ac3d93901fe1e3cb3b629acc1dd60fc3a5b4bf5b300d85d105e4f30761", + "notice_extraction": "first complete block comment" + }, + { + "component": "tfsxml", + "source_path": "MediaInfoLib/Source/ThirdParty/tfsxml/tfsxml.h", + "source_file_sha256": "05010af214bdb43aef3c101848e24dec8ccd13e8106a2185830a937cd18ef924", + "notice_extraction": "first complete block comment" + }, + { + "component": "AES", + "source_path": "MediaInfoLib/Source/ThirdParty/aes-gladman/aes.h", + "source_file_sha256": "d3e9d50fd725d383e347b6dabd1f628e2b161eae686f7b0fdd90e459b7d0aa5f", + "notice_extraction": "first complete block comment" + }, + { + "component": "SHA1", + "source_path": "MediaInfoLib/Source/ThirdParty/sha1-gladman/sha1.h", + "source_file_sha256": "29afe2942fe194d6363519bcfe71059534805c6b515bdfcf34eff674838453da", + "notice_extraction": "first complete block comment" + }, + { + "component": "SHA2", + "source_path": "MediaInfoLib/Source/ThirdParty/sha2-gladman/sha2.h", + "source_file_sha256": "24666d80313c8340eb67da183a78c9a227d7969fd3b541a001b23f9ed2546379", + "notice_extraction": "first complete block comment" + }, + { + "component": "HMAC", + "source_path": "MediaInfoLib/Source/ThirdParty/hmac-gladman/hmac.h", + "source_file_sha256": "bd31fff867c6a12d935843735e780abf92ab1855c714ae848d22a62fde07c976", + "notice_extraction": "first complete block comment" + }, + { + "component": "MD5", + "source_path": "MediaInfoLib/Source/ThirdParty/md5/md5.c", + "source_file_sha256": "4326950bed41acf6aa7180dadea2c49fb27a84d0d16754b1e65434e337ee1cf5", + "notice_extraction": "first complete block comment" + } + ], + "unresolved": [ + "DeckLink SDK revision and redistribution notice mapping: source bundle omits DeckLinkAPI.h despite binary DeckLink type information.", + "Publisher build manifest confirming all static component revisions and modifications." + ], + "dynamic_dependencies": [ + "\t/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)", + "\t/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1858.112.0)", + "\t/System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation (compatibility version 1.0.0, current version 2.0.0)", + "\t/System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia (compatibility version 1.0.0, current version 1.0.0)", + "\t/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)", + "\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)", + "\t/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)", + "\t/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)", + "\t/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)" + ], + "supplement_repository_path": "docs/audit/2026-11-13/DVRESCUE-NOTICES.txt", + "bundled_notice": "Resources/licenses/NOTICE.txt (original text retained; supplement appended)" +} diff --git a/docs/audit/2026-11-13/dvrescue-supplement-delivery.json b/docs/audit/2026-11-13/dvrescue-supplement-delivery.json new file mode 100644 index 0000000..1ca7d99 --- /dev/null +++ b/docs/audit/2026-11-13/dvrescue-supplement-delivery.json @@ -0,0 +1,202 @@ +[ + { + "tag": "v1.0.7-maintenance.1", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/v1.0.7-maintenance.1/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/v1.0.7-maintenance.1/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/v1.0.7-maintenance.1/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "1.0.6beta", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.6beta/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.6beta/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.6beta/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "1.0.5beta", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.5beta/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.5beta/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.5beta/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "1.0.4beta", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.4beta/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.4beta/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.4beta/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "1.0.0beta", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.0beta/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.0beta/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/1.0.0beta/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "0.3.0alpha", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.3.0alpha/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.3.0alpha/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.3.0alpha/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "0.2.0alpha", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.2.0alpha/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.2.0alpha/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/0.2.0alpha/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + }, + { + "tag": "alpha", + "original_assets_unchanged": true, + "release_body_readback_matches": true, + "supplements": [ + { + "name": "DVRESCUE-NOTICES-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/alpha/DVRESCUE-NOTICES-2026-11-13.txt", + "sha256": "a2f0c9345256d868dc9d4a80852de302bff49e61cf5b002fe3111c18f4c13e05", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-PROVENANCE-2026-11-13.json", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/alpha/DVRESCUE-PROVENANCE-2026-11-13.json", + "sha256": "e4d9e07cafc192f330fc8af1862701a27a9dcd248bbd5036b09ad6dfbb4f9dc8", + "public_readback_matches": true + }, + { + "name": "DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "url": "https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/download/alpha/DVRESCUE-SUPPLEMENT-SHA256SUMS-2026-11-13.txt", + "sha256": "eacdc36ec174587c1f118b6664ff42dea8a3e3151269b414e06e118fc9bc6073", + "public_readback_matches": true + } + ] + } +] diff --git a/docs/audit/2026-11-13/maintenance-output-verification.json b/docs/audit/2026-11-13/maintenance-output-verification.json new file mode 100644 index 0000000..2cf2e23 --- /dev/null +++ b/docs/audit/2026-11-13/maintenance-output-verification.json @@ -0,0 +1,116 @@ +{ + "date": "2026-11-13", + "runtime_commit": "2802355a1aa10e783e17d63a1ae13f54b7cf9f3b", + "source_sha256_before": "13be6af4cc481e5eea0a8ed9daee8d9ef329abd79ccc5c6620147604cefcca0a", + "source_sha256_after": "13be6af4cc481e5eea0a8ed9daee8d9ef329abd79ccc5c6620147604cefcca0a", + "results": [ + { + "mode": "copy", + "file": "copy_conv.mov", + "sha256": "c982b5d7d8dff7d13c1875d446abf87e0ce55dc74ff3e8176b8e69241fb75c2c", + "frames": 238, + "field_order": null, + "decoded_interlaced_frames": 238, + "decoded_top_first_frames": 0, + "width": 720, + "height": 480, + "sample_aspect_ratio": "8:9", + "frame_rate": "2997/100", + "video_payload_sha256": "a89282b9c5e8b74add7d2f214df113a268ce52f69f43392c96fab33c4634a04f", + "audio_payload_sha256": "7361915b0c317d46f4e3d4d8110255c74d175f6ca2704f0ac80661ada01ba065" + }, + { + "mode": "interlaced", + "file": "interlaced_dateburn.mp4", + "sha256": "59cccae2e754861ae3422b3dbb33427a01ccd5a43848d86ccd463f20566638f7", + "frames": 238, + "field_order": "bb", + "decoded_interlaced_frames": 238, + "decoded_top_first_frames": 0, + "width": 720, + "height": 480, + "sample_aspect_ratio": "8:9", + "frame_rate": "2997/100" + }, + { + "mode": "subtitles", + "file": "subtitles_dvsub.mkv", + "sha256": "2d121955e9e89c9ea01f3a77fbbd2d6d57c4b86d544b9b0e3d05d96255bf2538", + "frames": 238, + "field_order": "bt", + "decoded_interlaced_frames": 238, + "decoded_top_first_frames": 0, + "width": 720, + "height": 480, + "sample_aspect_ratio": "8:9", + "frame_rate": "2997/100", + "subtitle_events": 9, + "subtitle_end": 7.95 + }, + { + "mode": "progressive", + "file": "progressive_dateburn.mp4", + "sha256": "166b42c12e2a3c2fb24efe0f6b356183fe28e27879588be8b0c574396d6fc114", + "frames": 476, + "field_order": "progressive", + "decoded_interlaced_frames": 0, + "decoded_top_first_frames": 0, + "width": 720, + "height": 480, + "sample_aspect_ratio": "8:9", + "frame_rate": "60000/1001" + } + ], + "scope": "Fresh CLI encodes with maintenance fixes. Original and published derivatives unchanged. GUI, player motion/audio and Apple Silicon acceptance not performed.", + "synthetic_regressions": 33, + "shell_smoke_checks": 3, + "native_release_build": "Xcode 15.4 Intel, passed", + "runtime_files_sha256": { + "Resources/scripts/dvmetaburn.zsh": "93b4bd5186e43e85ec8256dcbed2518dc5ee2d2abd38beea3cd30c6091800a79", + "Resources/scripts/lib/artifacts.zsh": "afedeef6e26648a7b273b96bd6f0dcdab6e8bf8eb2d822e81b6bbfd5dd239251", + "Resources/scripts/lib/cleanup.zsh": "3ba43fbaf1929fe7fbf82531489b97a5f0d361eb91d2f730be23e45e16bfe9bf", + "Resources/scripts/lib/dvrescue.zsh": "7e5a913ce23195b838ae51b42ce5c9586af23102c043cb9a20b3d7dfb9a2371a", + "Resources/scripts/lib/encode.zsh": "e14dd66183011cbc9077c765ad3fde8c775c5899458013d9f33dde23814c6497", + "Resources/scripts/lib/env.zsh": "c9c1febf02990e5b39e99f43c8b391938eb23ab3e85ad8262428c27f376188ad", + "Resources/scripts/lib/filtergraph.zsh": "fec9bd3194738455b1843e6cc2f274e933ca6a336dff0f312f4e181d7cbb7a22", + "Resources/scripts/lib/logging.zsh": "04cc0ff3399e7a3a31849ac8b3c58f2feeda22eb17fef4d5ea66f857053b6fdd", + "Resources/scripts/lib/pathing.zsh": "937f5ee6f75fc28e0ec7c049048b5a6dcbaf7b12cfe25611222f13be73e27d1d", + "Resources/scripts/lib/pipeline.zsh": "829f5b25c327b428ec8ecdff2a762aa55f429b6efdb07c25374a5664bbc0024b", + "Resources/scripts/lib/stitch.zsh": "098b00d912f0d83b462e3e9d1f71ef4d7ad049573dc9ff5d2583dc4a9970e6c0", + "Resources/scripts/lib/timeline.zsh": "a1ca75c90b90f374886ce660f15dd0726402bd0189e5a0ecb1c727edb8cc00f8" + }, + "reproduction": { + "source": "Published train-01-original-dv.avi, unchanged hash above", + "common_cli_options": [ + "--mode=single", + "--layout=stacked", + "--fontname=UAV OSD Sans Mono", + "--fontfile=Resources/fonts/UAV-OSD-Sans-Mono.ttf", + "--ffmpeg=Resources/bin/ffmpeg", + "--dvrescue=Resources/bin/dvrescue" + ], + "modes": [ + [ + "--format=mov", + "--burn-mode=off", + "--deinterlace=off" + ], + [ + "--format=mp4", + "--burn-mode=burnin", + "--deinterlace=off" + ], + [ + "--format=mkv", + "--burn-mode=subtitleTrack", + "--deinterlace=off" + ], + [ + "--format=mp4", + "--burn-mode=burnin", + "--deinterlace=60p" + ] + ], + "destination": "Use a new separate --dest-dir and --scratch-dir per run; generated videos were not uploaded." + } +} diff --git a/readme.md b/readme.md index ab895f6..b676f15 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,9 @@ A free, open-source macOS application for preserving the recording context of le > I created this because I could not find a suitable free, open-source macOS workflow for recovering and displaying my original camcorder recording dates without assembling command-line tools myself. — Zach Zarzycki (ThePolish) -**[Download the current application (1.0.6 beta)](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/1.0.6beta)** · **[Train demonstration: original and processed videos](docs/examples/TRAIN_DV_PRESERVATION.md)** · **[Preservation roadmap](docs/ROADMAP.md)** +**[Recommended established release: v1.0.6 (published as beta)](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/1.0.6beta)** · **[Train demonstration: original and processed videos](docs/examples/TRAIN_DV_PRESERVATION.md)** · **[Preservation roadmap](docs/ROADMAP.md)** + +**Active experimental development:** [`maintenance/1.0.7`](https://github.com/shardsofaperture/DVMetaDataBurnIn/tree/maintenance/1.0.7) · [Preview 1 download](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/v1.0.7-maintenance.1) · [tests and known limitations](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/MAINTENANCE_1.0.7.md). The branch includes newer fixes than the unchanged preview package. Stable application source remains [v1.0.6 on main](https://github.com/shardsofaperture/DVMetaDataBurnIn/tree/main). The train demonstration includes the complete supplied DV AVI, the owner's timestamped MP4, and separately identified maintenance-generated comparisons. Downloadable hashes, measured stream properties, genuine before/after frames, and reproduction commands make the results inspectable. @@ -26,7 +28,7 @@ The stable 1.0.6 package contains an **Intel/Apple Silicon app executable**, but The separate [1.0.7 maintenance preview](https://github.com/shardsofaperture/DVMetaDataBurnIn/releases/tag/v1.0.7-maintenance.1) improves subtitle-tail timing, temporary workspace isolation, batch error handling, and cancellation cleanup. **This is the unconfirmed maintenance branch.** Its 1.0.7 application changes remain here for owner testing; `main` retains the stable 1.0.6 application code plus the shared documentation, licensing, videos, and roadmap. No maintenance code is approved for stable integration yet. GUI, player, and Apple Silicon acceptance are still open. The train examples exercise that preview's CLI, not its GUI. -[Maintenance status and remaining acceptance](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/MAINTENANCE_1.0.7.md) separates historical synthetic tests/native builds from current real-footage measurements. GUI queues/Stop, player rendering, subjective audio and motion quality, and Apple Silicon acceptance remain open. File selection, progress reporting, and final-output publication also need further work. +[Maintenance status and remaining acceptance](https://github.com/shardsofaperture/DVMetaDataBurnIn/blob/maintenance/1.0.7/docs/MAINTENANCE_1.0.7.md) separates historical synthetic tests/native builds from current real-footage measurements. GUI queues/Stop, player rendering, subjective audio and motion quality, and Apple Silicon acceptance remain open. File selection and progress reporting still need further work. Current maintenance adds atomic final publication and H.264 field signaling fixes; the unchanged Preview 1 download predates them. Publication currently requires a destination filesystem supporting hard links (APFS/HFS+); unsupported filesystems fail safely. ## Use and build diff --git a/scripts/tests/test_release_integrity.py b/scripts/tests/test_release_integrity.py new file mode 100644 index 0000000..6d814e3 --- /dev/null +++ b/scripts/tests/test_release_integrity.py @@ -0,0 +1,66 @@ +import hashlib +import importlib.util +import json +from pathlib import Path +import plistlib +import tempfile +import unittest +import zipfile + +spec = importlib.util.spec_from_file_location('verify_release', Path(__file__).parents[1]/'verify_release.py') +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) + + +class IntegrityTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + self.archive = self.root/'app.zip' + self.project = self.root/'project.pbxproj' + self.project.write_text('MARKETING_VERSION = 1.0.7;\nMARKETING_VERSION = 1.0.7;') + self.manifest = dict(release_tag='v1.0.7-maintenance.2', version='1.0.7', source_commit='a'*40, + executable_sha256=hashlib.sha256(b'app').hexdigest(), bundled_tools_sha256={}) + self.package() + + def package(self, version='1.0.7', embedded=None): + with zipfile.ZipFile(self.archive, 'w') as z: + z.writestr('App.app/Contents/Info.plist', plistlib.dumps(dict(CFBundleShortVersionString=version, CFBundleExecutable='App'))) + z.writestr('App.app/Contents/MacOS/App', b'app') + z.writestr('App.app/Contents/Resources/BUILD-MANIFEST.json', json.dumps(embedded or self.manifest)) + self.manifest['archive'] = dict(name='app.zip', bytes=self.archive.stat().st_size, + sha256=hashlib.sha256(self.archive.read_bytes()).hexdigest()) + + def check(self): + return module.verify('v1.0.7-maintenance.2', self.manifest, self.archive, self.project) + + def test_valid_package(self): + self.assertEqual(self.check()['result'], 'passed') + + def test_historical_style_plist_mismatch(self): + self.package(version='1.0.6') + with self.assertRaisesRegex(ValueError, 'Info.plist'): self.check() + + def test_project_mismatch(self): + self.project.write_text('MARKETING_VERSION = 1.0.6;') + with self.assertRaisesRegex(ValueError, 'Source project'): self.check() + + def test_manifest_version_mismatch(self): + self.manifest['version'] = '1.0.6' + with self.assertRaisesRegex(ValueError, 'Tag and manifest'): self.check() + + def test_embedded_commit_mismatch(self): + self.package(embedded=dict(self.manifest, source_commit='b'*40)) + with self.assertRaisesRegex(ValueError, 'Embedded build'): self.check() + + def test_archive_tampering(self): + self.manifest['archive']['sha256'] = '0'*64 + with self.assertRaisesRegex(ValueError, 'SHA-256'): self.check() + + def test_executable_mismatch(self): + self.manifest['executable_sha256'] = '0'*64 + with self.assertRaisesRegex(ValueError, 'executable hash'): self.check() + + +if __name__ == '__main__': unittest.main() diff --git a/scripts/verify_release.py b/scripts/verify_release.py new file mode 100644 index 0000000..f6b2e1a --- /dev/null +++ b/scripts/verify_release.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +"""Fail closed on application release identity; Python standard library only.""" +import argparse +import hashlib +import json +from pathlib import Path +import plistlib +import re +import zipfile + + +def verify(tag, manifest, archive, project=None): + match = re.fullmatch(r'v?(\d+\.\d+\.\d+)(?:beta|alpha|[-.][A-Za-z0-9.-]+)?', tag) + if not match: + raise ValueError('Not an application version tag') + version = match[1] + if manifest['release_tag'] != tag or manifest['version'] != version: + raise ValueError('Tag and manifest version differ') + commit = manifest['source_commit'] + if not re.fullmatch(r'[0-9a-f]{40}', commit): + raise ValueError('Manifest requires a full source commit') + if project: + versions = re.findall(r'MARKETING_VERSION = ([^;]+);', project.read_text()) + if not versions or set(versions) != {version}: + raise ValueError('Source project and release version differ') + identity = manifest['archive'] + if archive.name != identity['name'] or archive.stat().st_size != identity['bytes']: + raise ValueError('Archive name or size differs from manifest') + if hashlib.sha256(archive.read_bytes()).hexdigest() != identity['sha256']: + raise ValueError('Archive SHA-256 differs from manifest') + with zipfile.ZipFile(archive) as z: + if z.testzip() is not None: + raise ValueError('ZIP CRC failure') + plists = [n for n in z.namelist() if n.endswith('.app/Contents/Info.plist') and not n.startswith('__MACOSX/')] + if len(plists) != 1: + raise ValueError('Expected exactly one application Info.plist') + plist = plistlib.loads(z.read(plists[0])) + if plist['CFBundleShortVersionString'] != version: + raise ValueError('Built Info.plist and release version differ') + prefix = plists[0].removesuffix('Info.plist') + embedded = json.loads(z.read(prefix+'Resources/BUILD-MANIFEST.json')) + for key in ('release_tag', 'version', 'source_commit'): + if embedded[key] != manifest[key]: + raise ValueError('Embedded build identity differs: '+key) + binary = z.read(prefix+'MacOS/'+plist['CFBundleExecutable']) + if hashlib.sha256(binary).hexdigest() != manifest['executable_sha256']: + raise ValueError('App executable hash differs') + for tool, expected in manifest['bundled_tools_sha256'].items(): + if tool not in ('ffmpeg', 'dvrescue'): + raise ValueError('Unexpected bundled tool') + if hashlib.sha256(z.read(prefix+'Resources/'+tool)).hexdigest() != expected: + raise ValueError('Bundled tool hash differs: '+tool) + return {'tag': tag, 'version': version, 'source_commit': commit, + 'archive_sha256': identity['sha256'], 'result': 'passed'} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--tag', required=True) + parser.add_argument('--manifest', type=Path, required=True) + parser.add_argument('--archive', type=Path, required=True) + parser.add_argument('--project', type=Path) + args = parser.parse_args() + try: + print(json.dumps(verify(args.tag, json.loads(args.manifest.read_text()), args.archive, args.project), indent=2)) + except (ValueError, KeyError, OSError, zipfile.BadZipFile) as error: + parser.exit(1, 'Release validation failed: '+str(error)+'\n') + + +if __name__ == '__main__': + main()