Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Strand/Collect/Backfiller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ final class Backfiller {

/// #67 diag: the clock reference the offload ACTUALLY decoded with, captured on the first chunk of the
/// session. Surfaces whether the stale-RTC timestamp correction (FIX #72's `correctedWall`) could even
/// engage. `sessionUsedIdentityRef` = GET_CLOCK never correlated, so decode fell back to an identity
/// engage. `sessionUsedIdentityRef` = no clock correlation had landed when the first chunk decoded, so
/// that decode fell back to an identity
/// ref (device==wall==now) → clock offset 0 → correction OFF. On a strap whose RTC has reset, that
/// silently stores the strap's stale (years-old) timestamps verbatim, so the night lands off the recent
/// timeline and reads as "missed sleep". Paired with the persisted-nights DATE RANGE below, one strap
Expand Down Expand Up @@ -306,7 +307,7 @@ final class Backfiller {
let offset = wall - device
let days = offset / 86_400
if usedIdentityRef {
line += " · clock ref: IDENTITY fallback (GET_CLOCK never correlated) - stale-record correction OFF"
line += " · clock ref: IDENTITY fallback (no clock correlation at decode) - stale-record correction OFF"
} else if abs(offset) > 86_400 {
line += " · strap clock \(days >= 0 ? "\(days)d behind" : "\(-days)d ahead") wall - correction engaged"
} else {
Expand Down
2 changes: 1 addition & 1 deletion StrandTests/BackfillerSessionTallyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class BackfillerSessionTallyTests: XCTestCase {
let line = Backfiller.sessionClockDiagLine(nightKeys: [marchDay],
device: 1_783_486_611, wall: 1_783_486_611,
usedIdentityRef: true)
XCTAssertEqual(line, "Backfill: rows landed on 2024-03-24 · clock ref: IDENTITY fallback (GET_CLOCK never correlated) - stale-record correction OFF")
XCTAssertEqual(line, "Backfill: rows landed on 2024-03-24 · clock ref: IDENTITY fallback (no clock correlation at decode) - stale-record correction OFF")
}

// A genuinely stale-but-correlated ref: the correction IS engaged and the behind-by days are named.
Expand Down