Provenance in the sidecar, a launch hook for the page, and where it stands

derived_from and merge are top-level sidecar fields (FR-MRG-6): one line
per source in order, and how the composite was made. A build that
predates them keeps the lines as unknown and writes them back. The job
writes the sidecar beside the composite and stages it with its own
record when the composite goes through the outbox.

DARKROOM_START_MERGE=a.CR2,b.CR2 lands on the merge page at startup with
the job running on local files, on the model of DARKROOM_START_IDENTITY,
for looking at the page where synthetic clicks do not reach it. The fetch
and the start are shared with the grid's button.

panorama.md §11 records what exists, the fixture's figures, and the six
things still open, auto-crop first.
This commit is contained in:
2026-09-19 15:24:20 +02:00
parent 2e9a1eb0f0
commit 75d2ceb23c
5 changed files with 282 additions and 107 deletions
+32
View File
@@ -460,6 +460,38 @@ fn run_inner(
return Err(e);
}
log::info!("merge: {}×{} written to {} in {:?}", out_w, out_h, out_path.display(), t.elapsed());
// TRACES: FR-MRG-6
// Provenance, beside the composite: what it was merged from, in order,
// and how. Its own file and its own outbox record, so the drain places
// it as it places the composite; a sidecar that failed to write is
// reported but does not un-write the composite.
let mut sidecar = dr_pipeline::Sidecar::new();
sidecar.derived_from = request.frames.iter().map(|f| f.name.clone()).collect();
sidecar.merge = Some(format!(
"panorama {} {:.1}mm {} frames",
match projection {
Projection::Perspective => "perspective",
Projection::Cylindrical => "cylindrical",
Projection::Spherical => "spherical",
},
focal_full * 36.0 / full_long,
frames.len()
));
let sidecar_path = out_path.with_extension(dr_pipeline::sidecar::EXTENSION);
if let Err(e) = std::fs::write(&sidecar_path, sidecar.to_text()) {
log::warn!("merge: the sidecar could not be written: {e}");
} else if let MergeDestination::Outbox { remote_dir, .. } = &request.destination {
let record = crate::export::destination_record(&sidecar_path);
let name = sidecar_path
.file_name()
.map(|n| n.to_string_lossy().into_owned())
.unwrap_or_default();
if let Err(e) = std::fs::write(&record, format!("{remote_dir}\n{name}\n")) {
log::warn!("merge: the sidecar's record could not be written: {e}");
}
}
Ok(Some(MergeEvent::Done {
path: out_path,
staged,