From 89fc24ceabc9194c41ff3f9710c7cbfae624d846 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Fri, 25 Sep 2026 18:14:02 -0400 Subject: [PATCH] feat(dates): print the numeric offset in the audit report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spec-mirroring review noted the report showed the offset SOURCE but not the offset value — the value is what the operator spot-checks. Each proposed line now ends with offset={+N}m (or - for utc_direct rows). Tests pin the rendered values. --- src/filename_audit.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/filename_audit.rs b/src/filename_audit.rs index 94019a6..8532de6 100644 --- a/src/filename_audit.rs +++ b/src/filename_audit.rs @@ -267,8 +267,16 @@ pub fn format_report(rows: &[AuditRow], skipped: &[SkippedLibrary]) -> String { .tz_source .map(|t| t.as_str().to_string()) .unwrap_or_else(|| "-".into()); + // The numeric offset (minutes ahead of UTC) is the value the + // operator actually spot-checks: a wall pattern resolved with + // empty evidence carries the server zone's offset for that date. + let proposed_offset = row + .proposed + .camera_offset_minutes + .map(|m| format!("{m:+}m")) + .unwrap_or_else(|| "-".into()); out.push_str(&format!( - "{}\t{:<19}\t{:<20}\tlib={} {}\n current: {}\n proposed: {} [{}] tz_source={}\n", + "{}\t{:<19}\t{:<20}\tlib={} {}\n current: {}\n proposed: {} [{}] tz_source={} offset={}\n", if row.changed { "*" } else { " " }, row.pattern, row.rel_path, @@ -278,6 +286,7 @@ pub fn format_report(rows: &[AuditRow], skipped: &[SkippedLibrary]) -> String { format_epoch_utc(Some(row.proposed.timestamp)), row.proposed.source.as_str(), proposed_tz, + proposed_offset, )); } if !skipped.is_empty() { @@ -434,6 +443,8 @@ mod tests { inv.proposed.tz_source.map(|t| t.as_str()), Some("assumed_server") ); + // Server zone America/New_York is EDT (UTC-4) in June. + assert_eq!(inv.proposed.camera_offset_minutes, Some(-240)); assert!(inv.changed, "stored exif date must flag as changed"); // The unix timestamp: utc_direct, no offset, and the stored row @@ -544,6 +555,10 @@ mod tests { assert!(first.contains("*\t"), "changed row must be flagged"); assert!(first.contains("screenshot")); assert!(first.contains("utc_direct")); + // Numeric offset is printed: the wall row carries the server-zone + // offset for that date, timestamp rows have none. + assert!(first.contains("offset=-240m")); + assert!(first.contains("offset=-\n")); // The stored source renders without debug quotes (P1 from // review): `2021-... [exif]`, never `["exif"]`. assert!(first.contains("[exif]"));