maxwellinked commited on
Commit
742ea73
·
1 Parent(s): b4b58f0

Add exploratory recording timing sidecar (#51)

Browse files

- Add exploratory recording timing sidecar (b2cdda32e53c17c45f3d96987c27bbf23ec1fa11)

Archive_Specifications.md CHANGED
@@ -37,9 +37,12 @@ row documents a deviation, is:
37
  - Capture resolution class: 2160p UHD (4K)
38
  - Still-image size: 4000 × 3000
39
 
40
- The 0.2-second interval is a protocol-level nominal setting, not a confirmed
41
- measurement for every Standard recording. It does not by itself establish a
42
- calibrated real-time basis for any record.
 
 
 
43
 
44
  AE/WB lock, autofocus, and stabilization are owner-reported for certainly the
45
  majority of this period, not confirmed as universal per-record facts. Deviations
@@ -81,11 +84,22 @@ records remain unchanged.
81
 
82
  ## Timing and Calibration Status
83
 
84
- The current protocol documentation does not provide a complete calibrated time
85
- base for motor-control or physical-trajectory measurement. The nominal
86
- 0.2-second setting records the intended protocol; the interval actually used
87
- for an individual recording remains unconfirmed unless separately documented.
88
- In particular, the following may be unknown for a recording:
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  - confirmed per-record frame-capture interval
91
  - real drawing-session duration
@@ -96,9 +110,15 @@ In particular, the following may be unknown for a recording:
96
  - camera model, lens, and mount geometry
97
  - pixel-to-physical coordinate mapping or homography
98
 
99
- `encoded_frame_rate` is playback rate only. It must not be treated as original
100
- drawing-time sampling or used to infer real drawing time unless separately
101
- documented.
 
 
 
 
 
 
102
 
103
  ## Drawing Surfaces
104
 
 
37
  - Capture resolution class: 2160p UHD (4K)
38
  - Still-image size: 4000 × 3000
39
 
40
+ The 0.2-second interval is a protocol-level nominal setting, not a confirmed
41
+ measurement for every Standard recording. It does not by itself establish a
42
+ calibrated real-time basis for any record. The separate exploratory
43
+ [recording-timing sidecar](Standard_Time_Lapses/Provenance/Recording_Timing/README.md)
44
+ documents a narrower empirical calibration for one observable recording
45
+ profile.
46
 
47
  AE/WB lock, autofocus, and stabilization are owner-reported for certainly the
48
  majority of this period, not confirmed as universal per-record facts. Deviations
 
84
 
85
  ## Timing and Calibration Status
86
 
87
+ The current protocol documentation does not provide a complete calibrated time
88
+ base for motor-control or physical-trajectory measurement. The nominal
89
+ 0.2-second setting records the intended protocol; the interval actually used
90
+ for an individual recording remains unconfirmed unless separately documented.
91
+
92
+ At source revision
93
+ `b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e`, the exploratory recording-timing
94
+ sidecar interprets 22 retained device-filename timestamps as recording starts
95
+ and their matching MP4 creation tags as finalization boundaries. Those direct
96
+ observations fit a profile-specific elapsed-time model that is applied to 164
97
+ additional observable-profile-matched fragments. The model is in-sample, has
98
+ no independent holdout, and does not identify its empirical intercept as a
99
+ physical capture constant. Its two-second start allowance is an operational
100
+ review threshold rather than a proven semantic error bound.
101
+
102
+ In particular, the following may still be unknown for a recording:
103
 
104
  - confirmed per-record frame-capture interval
105
  - real drawing-session duration
 
110
  - camera model, lens, and mount geometry
111
  - pixel-to-physical coordinate mapping or homography
112
 
113
+ `encoded_frame_rate` is playback rate only. It must not be treated as original
114
+ drawing-time sampling. The timing sidecar uses decoded frame count only inside
115
+ its separately documented empirical model; it does not recover source-frame
116
+ timestamps, uninterrupted drawing duration, or drawing-active time.
117
+
118
+ Canonical `duration_seconds` remains encoded playback duration. The timing
119
+ model uses separate timestamp-boundary evidence and probed frame counts; it
120
+ does not reinterpret encoded duration or `encoded_frame_rate` as wall-clock
121
+ time.
122
 
123
  ## Drawing Surfaces
124
 
CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## v0.4.0 — Release candidate (2026-09-03)
4
 
5
  This release candidate consolidates every reviewed post-v0.3 change into one
 
1
  # Changelog
2
 
3
+ ## Unreleased
4
+
5
+ ### Exploratory recording-timing sidecar
6
+
7
+ - Added a revision-pinned, noncanonical timing layer for the 186 canonical
8
+ Framelapse fragments in the six dated relationship sidecars.
9
+ - Recorded 22 retained device-filename start observations and matching MP4
10
+ finalization boundaries; used them to fit one profile-specific empirical
11
+ elapsed-time model for 164 additional observable-profile-matched fragments.
12
+ - Preserved one 43,221-second documented-finish conflict without silently
13
+ correcting the existing finish label. The calibration has no independent
14
+ holdout and does not claim drawing-active time or source-frame timestamps.
15
+ - Added deterministic sidecar validation and SHA-256 inventory. No MP4,
16
+ canonical metadata row or field, relationship sidecar, Viewer configuration,
17
+ or root `SHA256SUMS` payload entry changed.
18
+
19
  ## v0.4.0 — Release candidate (2026-09-03)
20
 
21
  This release candidate consolidates every reviewed post-v0.3 change into one
README.md CHANGED
@@ -403,11 +403,18 @@ external references should use `record_id`.
403
  This subtree contains supporting historical records and retained exceptions.
404
  It is not part of the canonical record set.
405
 
406
- `2026-07-31/` preserves the completed provenance release, including mappings
407
- between historical `Series_9x12` filenames and canonical records. The former
408
- full duplicate video snapshot is not retained. Relationships are preserved
409
- through mappings, hashes, metadata, and repository history. See the
410
- [provenance navigation index](Standard_Time_Lapses/Provenance/README.md).
 
 
 
 
 
 
 
411
 
412
  ### `Pre_Standard_Time_Lapses/`
413
 
@@ -460,11 +467,20 @@ The active CSV files and live Viewer use semicolons for multiple `tool` and
460
  observed-value lists; equal list lengths and positional pairing are not
461
  guaranteed. See `SCHEMA.md`.
462
 
463
- The Standard protocol documents a nominal 0.2-second capture interval. This is
464
- a protocol-level default, not a confirmed per-record measurement, and it does
465
- not establish a calibrated real-time basis. `encoded_frame_rate` remains
466
- encoded playback rate, not original drawing-time sampling, and must not be used
467
- to infer real drawing time unless separately documented.
 
 
 
 
 
 
 
 
 
468
 
469
  ### Physical-reference relationship layer
470
 
@@ -579,10 +595,13 @@ source `record_id` and pinned repository revision.
579
  - temporal behavior analysis
580
  - real-world trajectory, velocity, acceleration, or motor-control measurement
581
 
582
- The release does not provide confirmed per-record capture intervals,
583
- acceleration factors, source-frame timestamps, camera calibration, or
584
- pixel-to-physical coordinate mapping. The nominal Standard interval alone is
585
- not calibrated real-time evidence.
 
 
 
586
 
587
  ### Not validated
588
 
@@ -783,8 +802,9 @@ See `CHANGELOG.md` for release-level changes.
783
  does not describe the current snapshot or provide video-payload checksums
784
  - `tools/` — inventory capture, verified download, checksum, enrichment, and
785
  validation helpers
786
- - `Standard_Time_Lapses/Provenance/` — historical evidence and dated
787
- fragment-sequence relationships
 
788
  - `Physical_References/` — physical-reference relationship schema, manifest,
789
  and sidecar
790
 
 
403
  This subtree contains supporting historical records and retained exceptions.
404
  It is not part of the canonical record set.
405
 
406
+ `2026-07-31/` preserves the completed provenance release, including mappings
407
+ between historical `Series_9x12` filenames and canonical records. The former
408
+ full duplicate video snapshot is not retained. Relationships are preserved
409
+ through mappings, hashes, metadata, and repository history. See the
410
+ [provenance navigation index](Standard_Time_Lapses/Provenance/README.md).
411
+
412
+ [`Recording_Timing/`](Standard_Time_Lapses/Provenance/Recording_Timing/README.md)
413
+ is a separate revision-pinned exploratory timing layer for the 186 canonical
414
+ fragments in the six dated relationship sidecars. It contains 22 direct
415
+ filename-to-MP4-boundary observations and 164 profile-matched calibrated
416
+ estimates. It does not change the canonical index or establish drawing-active
417
+ time, per-frame timestamps, or a universal capture interval.
418
 
419
  ### `Pre_Standard_Time_Lapses/`
420
 
 
467
  observed-value lists; equal list lengths and positional pairing are not
468
  guaranteed. See `SCHEMA.md`.
469
 
470
+ The Standard protocol documents a nominal 0.2-second capture interval. It
471
+ remains a protocol-level default, not a confirmed per-record measurement across
472
+ the Standard collection. A separate, revision-pinned
473
+ [recording-timing sidecar](Standard_Time_Lapses/Provenance/Recording_Timing/README.md)
474
+ covers the 186 canonical Framelapse fragments in the six dated relationship
475
+ layers. It keeps 22 device-filename timestamp observations separate from 164
476
+ profile-matched estimates produced by a versioned, in-sample frame-count model.
477
+ The resulting values describe fragment start-to-MP4-finalization wall-clock
478
+ elapsed time; they do not confirm the nominal interval, supply source-frame
479
+ timestamps, or establish drawing-active time.
480
+
481
+ `duration_seconds` and `encoded_frame_rate` remain encoded-playback properties.
482
+ Neither supplies wall-clock or drawing-time calibration by itself, and the
483
+ derived sidecar does not reinterpret them.
484
 
485
  ### Physical-reference relationship layer
486
 
 
595
  - temporal behavior analysis
596
  - real-world trajectory, velocity, acceleration, or motor-control measurement
597
 
598
+ The release does not provide confirmed per-record capture intervals,
599
+ acceleration factors, source-frame timestamps, camera calibration, or
600
+ pixel-to-physical coordinate mapping. The nominal Standard interval alone is
601
+ not calibrated real-time evidence. The exploratory recording-timing sidecar
602
+ adds fragment-level start-to-finalization observations or estimates for 186
603
+ prospective fragments only; it does not close these frame-level or physical
604
+ calibration gaps.
605
 
606
  ### Not validated
607
 
 
802
  does not describe the current snapshot or provide video-payload checksums
803
  - `tools/` — inventory capture, verified download, checksum, enrichment, and
804
  validation helpers
805
+ - `Standard_Time_Lapses/Provenance/` — historical evidence and dated
806
+ fragment-sequence relationships, plus the exploratory revision-pinned
807
+ recording-timing sidecar
808
  - `Physical_References/` — physical-reference relationship schema, manifest,
809
  and sidecar
810
 
SCHEMA.md CHANGED
@@ -1,8 +1,9 @@
1
  # Schema
2
 
3
  This document defines canonical filenames, the active video-object indexes,
4
- and their relationship sidecars. Filenames are human-readable descriptions;
5
- `record_id` is the persistent identity of one published video object.
 
6
 
7
  ## Canonical Filename Format
8
 
@@ -292,6 +293,34 @@ protocol value. A dated sidecar does not introduce `work_id`, change any
292
  `RecNN` row absent from these dated sidecars retains
293
  `standard-2025-07-13`; absence does not establish that no relationship exists.
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  ## Physical-reference sidecar
296
 
297
  `Physical_References/endpoint_references.csv` is an optional derived
@@ -351,6 +380,9 @@ Before publication, the validator must confirm:
351
  Viewer configurations
352
  - relationship paths, Xet identities, sizes, and canonical `record_id` joins
353
  resolve at the exact declared `source_hub_revision`
 
 
 
354
  - `SHA256SUMS` exactly covers every published MP4 and ZIP at the reviewed
355
  revision, with no missing, extra, duplicate, or mismatched entries
356
 
@@ -364,4 +396,6 @@ python tools/validate_metadata.py metadata.csv \
364
  python tools/validate_sha256sums.py SHA256SUMS \
365
  --repo-json repo_api_blobs.json \
366
  --revision "<40-hex-commit>"
 
 
367
  ```
 
1
  # Schema
2
 
3
  This document defines canonical filenames, the active video-object indexes,
4
+ and their relationship and timing sidecars. Filenames are human-readable
5
+ descriptions; `record_id` is the persistent identity of one published video
6
+ object.
7
 
8
  ## Canonical Filename Format
9
 
 
293
  `RecNN` row absent from these dated sidecars retains
294
  `standard-2025-07-13`; absence does not establish that no relationship exists.
295
 
296
+ ## Recording-timing sidecar
297
+
298
+ `Standard_Time_Lapses/Provenance/Recording_Timing/recording_timing.csv` is an
299
+ exploratory derived table for the 186 canonical fragments in those six dated
300
+ relationship sidecars. It joins to the canonical Standard index on `record_id`
301
+ and declares the exact source Hub revision. It is outside both active video
302
+ indexes and does not add or replace canonical metadata fields.
303
+
304
+ The sidecar keeps three timing concepts separate:
305
+
306
+ - `device_filename_start_local` is present only when a retained
307
+ `VID_YYYYMMDD_HHMMSS.mp4` source name supplies a whole-second timestamp
308
+ interpreted as recording start.
309
+ - `format_creation_time_utc` and `video_creation_time_utc` preserve literal MP4
310
+ tags treated as the best-supported file-finalization boundary, not a
311
+ universally guaranteed stop time.
312
+ - `capture_start_time_utc` and `recording_elapsed_seconds` are direct for 22
313
+ rows and profile-specific model estimates for 164 rows, as declared by
314
+ `timing_basis`, `calibration_profile_status`, and `timing_model_id`.
315
+
316
+ Canonical `date` and `time` remain documented group-finish labels. They are not
317
+ overwritten by sidecar starts or MP4 boundaries. The model has no independent
318
+ holdout; its allowances are operational review thresholds, not proven error
319
+ bounds. The sidecar does not establish drawing-active time, continuous work,
320
+ source-frame timestamps, pen contact, or physical motion. Its complete field
321
+ and auxiliary-file contracts are defined in
322
+ [`Recording_Timing/SCHEMA.md`](Standard_Time_Lapses/Provenance/Recording_Timing/SCHEMA.md).
323
+
324
  ## Physical-reference sidecar
325
 
326
  `Physical_References/endpoint_references.csv` is an optional derived
 
380
  Viewer configurations
381
  - relationship paths, Xet identities, sizes, and canonical `record_id` joins
382
  resolve at the exact declared `source_hub_revision`
383
+ - recording-timing identities, direct timestamp arithmetic, calibration
384
+ formulas, sequence chronology, retained conflicts, and bundle hashes resolve
385
+ at the exact declared source revision
386
  - `SHA256SUMS` exactly covers every published MP4 and ZIP at the reviewed
387
  revision, with no missing, extra, duplicate, or mismatched entries
388
 
 
396
  python tools/validate_sha256sums.py SHA256SUMS \
397
  --repo-json repo_api_blobs.json \
398
  --revision "<40-hex-commit>"
399
+
400
+ python tools/validate_recording_timing.py --root .
401
  ```
Standard_Time_Lapses/Provenance/README.md CHANGED
@@ -5,10 +5,19 @@ is outside both active video indexes and Dataset Viewer configurations; nested
5
  placement does not make a media object canonical.
6
 
7
  Each active metadata row continues to identify one published video object.
8
- Relationship sidecars can group those objects without merging their persistent
9
- `record_id` values or asserting undocumented drawing- or session-level facts.
10
-
11
- ## Dated layers
 
 
 
 
 
 
 
 
 
12
 
13
  - [`2026-07-31/`](2026-07-31/) preserves historical filename-to-record mappings
14
  and the pre-rebuild metadata snapshot without retaining the former duplicate
 
5
  placement does not make a media object canonical.
6
 
7
  Each active metadata row continues to identify one published video object.
8
+ Relationship sidecars can group those objects without merging their persistent
9
+ `record_id` values or asserting undocumented drawing- or session-level facts.
10
+
11
+ ## Cross-date derived layers
12
+
13
+ - [`Recording_Timing/`](Recording_Timing/README.md) is an exploratory
14
+ revision-pinned timing layer for the 186 canonical fragments in the six dated
15
+ relationship sidecars. It uses 22 retained device-filename start observations
16
+ to calibrate 164 profile-matched elapsed estimates, preserves one unresolved
17
+ 43,221-second (12:00:21) finish-label conflict, and does not alter canonical
18
+ metadata or claim drawing-active time.
19
+
20
+ ## Dated layers
21
 
22
  - [`2026-07-31/`](2026-07-31/) preserves historical filename-to-record mappings
23
  and the pre-rebuild metadata snapshot without retaining the former duplicate
Standard_Time_Lapses/Provenance/Recording_Timing/README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Recording timing sidecar
2
+
3
+ This directory publishes an exploratory derived timing layer for the 186
4
+ canonical Framelapse source fragments covered by the six dated relationship
5
+ sidecars. The source archive is pinned to Hub revision
6
+ `b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e`.
7
+
8
+ This layer does not alter the canonical 29-field `metadata.csv`, create a new
9
+ canonical media index, or establish an official benchmark or dataset split.
10
+
11
+ ## What the evidence supports
12
+
13
+ For 22 fragments, retained source-device filenames of the form
14
+ `VID_YYYYMMDD_HHMMSS.mp4` provide whole-second local timestamps interpreted as
15
+ recording starts. Their matching MP4 format and video-stream `creation_time`
16
+ tags provide the best-supported finalization boundaries. Those 22 observations
17
+ support the profile-specific empirical model:
18
+
19
+ `estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30`
20
+
21
+ The largest absolute in-sample residual is 0.833 seconds. The 0.8-second term
22
+ is an empirical intercept, not a physical capture constant; it may combine
23
+ timestamp quantization with stable file-opening or finalization overhead.
24
+
25
+ The remaining 164 fragments lack retained device start names. Their observable
26
+ technical profile matches the calibration cohort, so the model is applied with
27
+ a conservative two-second operational review allowance. Device identity and
28
+ Framelapse version are not independently retained for each application row,
29
+ and the calibration has no independent holdout.
30
+
31
+ The literal container tag `com.android.capture.fps=5.000000` is preserved as
32
+ source metadata but is not used as a real-time divisor. Across the 22 direct
33
+ observations, dividing frame count by five understates elapsed wall time by
34
+ 59.6 to 314.8 seconds per fragment.
35
+
36
+ ## Results and retained conflicts
37
+
38
+ - 22 filename-timestamp observations and 164 calibrated estimates
39
+ - 25 owner-confirmed complete fragment sequences
40
+ - 161 within-sequence transitions: 159 positive beyond uncertainty, two
41
+ indistinguishable from zero within uncertainty, and none negative beyond
42
+ uncertainty
43
+ - 24 of 25 final MP4 boundaries within 83 seconds of the documented group
44
+ finish minute
45
+ - one unresolved finish-label conflict for `2026-09-01.0213...`: the final
46
+ MP4 boundary is 43,221 seconds, or 12:00:21, after the documented finish
47
+ minute; no timestamp is silently corrected
48
+
49
+ The selected fragment intervals total approximately 30.548 hours. This mixes
50
+ 22 observed filename-to-boundary intervals with 164 calibrated estimates; it
51
+ is not drawing-active time or corpus calendar span.
52
+
53
+ ## Files
54
+
55
+ - `recording_timing.csv` — 186 fragment-level timing rows
56
+ - `calibration_observations.csv` — the 22 direct calibration observations
57
+ - `calibration_model.json` — constants, fit diagnostics, applicability, and
58
+ exclusions
59
+ - `group_timing_summary.csv` — 25 sequence-level QA summaries
60
+ - `SCHEMA.md` — field definitions and evidence boundaries
61
+ - `source_manifest.json` — pinned source, hash, size, and audit receipts
62
+ - `validation_summary.json` — deterministic validation results
63
+ - `bundle.sha256` — SHA-256 inventory of every other file in this directory
64
+
65
+ From a repository checkout, validate the layer with:
66
+
67
+ ```shell
68
+ python tools/validate_recording_timing.py --root .
69
+ ```
70
+
71
+ That command verifies repository-packet self-consistency: identities and
72
+ receipts, formulas, chronology, summaries, and bundle hashes. It does not
73
+ re-probe the 186 source videos, recompute their ordinary SHA-256 values, verify
74
+ the retained local audit bytes, or re-observe NTFS timestamps. Those limits are
75
+ explicit in `validation_summary.json`; the NTFS cross-check remains local and
76
+ is not part of this publication layer.
77
+
78
+ ## Interpretation boundaries
79
+
80
+ `recording_elapsed_seconds` describes observed or estimated wall-clock time
81
+ from a filename-interpreted or modeled fragment start to the MP4 finalization
82
+ boundary. It does not establish continuous drawing, pen contact, active work,
83
+ source-frame timestamps, intent, attention, or mental state. A positive
84
+ inter-fragment gap marks time between file boundaries; it does not prove the
85
+ artist stopped drawing. A gap within uncertainty is not a proven pause.
Standard_Time_Lapses/Provenance/Recording_Timing/SCHEMA.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Recording timing sidecar schema
2
+
3
+ This schema describes an exploratory derived layer over
4
+ `maxwellinked/time-lapse-artifacts` at revision
5
+ `b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e`. It does not alter the canonical
6
+ 29-field `metadata.csv`.
7
+
8
+ ## Primary table
9
+
10
+ | Field | Type | Meaning |
11
+ | --- | --- | --- |
12
+ | `record_id` | string | Stable canonical record identifier; direct identity join. |
13
+ | `file_path` | string | Canonical repository-relative media path; direct identity join. |
14
+ | `sha256` | string | Ordinary SHA-256 of the source media bytes; direct audit value. |
15
+ | `hub_xet_hash` | string | Hugging Face Xet object identity; kept distinct from ordinary SHA-256. |
16
+ | `fragment_set_label` | string | Owner-reviewed fragment grouping label; not a corpus-wide work_id. |
17
+ | `sequence_position` | integer | One-based chronological fragment position from the relationship sidecar. |
18
+ | `sequence_count` | integer | Fragment count for the owner-confirmed complete sequence. |
19
+ | `source_hub_revision` | string | Pinned Hub revision recorded by the dated relationship sidecar. |
20
+ | `source_audit_id` | string | Logical identifier of the retained local media-probe audit. |
21
+ | `source_filename` | string | Filename recorded in the source audit. Twenty-two retain VID device names; later files use canonical names. |
22
+ | `format_creation_time_utc` | UTC ISO-8601 string | Literal MP4 format-level creation_time tag; best-supported finalization boundary, not universally guaranteed stop time. |
23
+ | `video_creation_time_utc` | UTC ISO-8601 string | Literal video-stream creation_time tag. It equals the format tag for all 186 rows. |
24
+ | `capture_fps_tag_literal` | string | Literal com.android.capture.fps value. Preserved as 5.000000 and explicitly not used as elapsed-time fps. |
25
+ | `video_frame_count` | integer | Direct decoded/probed video frame count. |
26
+ | `local_time_zone` | string | IANA time zone used for local rendering and filename interpretation: America/New_York. |
27
+ | `device_filename_start_local` | ISO-8601 string or blank | Whole-second device-filename timestamp, interpreted as a recording start, parsed only from a retained VID_YYYYMMDD_HHMMSS.mp4 filename. |
28
+ | `format_creation_time_local` | ISO-8601 string | Local rendering of the literal MP4 creation boundary. |
29
+ | `capture_start_time_utc` | UTC ISO-8601 string | Device-filename timestamp interpreted as start for 22 rows; model-derived start for 164 rows. |
30
+ | `capture_start_time_local` | ISO-8601 string | Local rendering of capture_start_time_utc. |
31
+ | `timing_basis` | enum | direct_device_filename_start or calibrated_frame_model. |
32
+ | `recording_elapsed_seconds` | number | Filename-start-to-boundary elapsed for 22 rows; calibrated start-to-boundary estimate for 164 rows. Not drawing-active time. |
33
+ | `start_uncertainty_seconds` | number | Operational timestamp-resolution allowance: 1 second for whole-second device filenames; conservative 2 seconds for calibrated starts. It is not a proven semantic error bound. |
34
+ | `timing_model_id` | string | Versioned calibration method identifier. |
35
+ | `calibration_profile_status` | enum | calibration_observation for 22 direct rows; observable_profile_match_only for 164 applications. |
36
+ | `previous_record_id` | string or blank | Previous member of the same sequence; blank for position 1. |
37
+ | `inter_fragment_gap_seconds` | number or blank | Selected next start minus previous MP4 creation boundary; blank for position 1. |
38
+ | `gap_uncertainty_seconds` | number or blank | Operational uncertainty: 2 seconds when next start is direct, 3 seconds when calibrated. |
39
+ | `gap_status` | enum | blank_for_first, positive_above_uncertainty, within_uncertainty_of_zero, or negative_beyond_uncertainty. |
40
+ | `documented_group_finish_date` | YYYY-MM-DD | Existing group-level documented finish date from canonical metadata; not an individual fragment date. |
41
+ | `documented_group_finish_time` | HH:MM | Existing group-level documented finish minute from canonical metadata; not an individual fragment time. |
42
+ | `group_finish_delta_seconds` | number | Final fragment MP4 creation boundary minus the documented group finish minute. |
43
+ | `group_finish_crosscheck_status` | enum | near_documented_finish_minute when absolute delta is at most 120 seconds; otherwise documented_finish_conflict. |
44
+ | `timing_evidence_state` | semicolon list | Compact direct-versus-derived evidence ledger for the row. |
45
+ | `notes` | string or blank | Only material unresolved timing conflicts; no silent correction. |
46
+
47
+ ## Timing model
48
+
49
+ For the 22 rows with retained `VID_YYYYMMDD_HHMMSS.mp4` source names, the filename supplies a whole-second timestamp interpreted as the recording start and the matching MP4 `creation_time` supplies the best-supported finalization boundary. Those observations calibrate:
50
+
51
+ `estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30`
52
+
53
+ The 0.8-second empirical intercept improves the in-sample fit but is not identified as a physical capture constant; it may combine timestamp quantization and stable open/finalization overhead. The 164 rows without retained device filenames use the model because their observable technical profile matches the calibration cohort. This is an application assumption, not a per-file direct measurement. See `calibration_model.json` and `calibration_observations.csv`.
54
+
55
+ The literal `com.android.capture.fps=5.000000` tag is preserved as source metadata. It is contradicted as an elapsed-time divisor by all 22 direct observations and is not used in the model.
56
+
57
+ ## Auxiliary files
58
+
59
+ - `calibration_observations.csv` contains exactly the 22 primary-table rows with
60
+ direct device-filename starts. It records the start and boundary timestamps,
61
+ frame count, observed and modeled elapsed values, residuals, the rejected
62
+ nominal-five-fps calculation, and video frames per observed wall second. The
63
+ last quantity is a calibration diagnostic, not encoded FPS or capture cadence.
64
+ - `group_timing_summary.csv` contains one row for each of the 25 fragment sets.
65
+ It reports direct and calibrated row counts, first start and last boundary,
66
+ the sum of selected fragment intervals, observed calendar span, gap counts,
67
+ documented finish cross-check, and any retained conflict note.
68
+ - `calibration_model.json` is the versioned model contract. It declares the
69
+ pinned dataset revision, exact rational formula constants, 22-row in-sample
70
+ fit diagnostics, zero holdout rows, application profile, operational
71
+ allowances, and exclusions.
72
+ - `source_manifest.json` binds the pinned canonical metadata and six relationship
73
+ sidecars by path, size, hash, row count, and source revision. Retained local
74
+ audit receipts are identified by logical ID and hash but are not bundled.
75
+ - `validation_summary.json` is the deterministic result summary; it records
76
+ identity, source, calibration, chronology, finish-crosscheck, aggregate, and
77
+ immutability checks without replacing the executable validator.
78
+ - `bundle.sha256` contains the ordinary SHA-256 of every other file in this
79
+ directory. It deliberately does not inventory itself.
80
+
81
+ ## Boundaries
82
+
83
+ The elapsed values describe observed or estimated fragment
84
+ start-to-finalization wall-clock intervals. They do not establish continuous
85
+ drawing, pen contact, drawing-active time, source-frame timestamps, intent,
86
+ attention, or mental state. A positive inter-fragment gap marks time between
87
+ two file boundaries, not necessarily a break from drawing. A gap within
88
+ uncertainty is not a proven pause.
Standard_Time_Lapses/Provenance/Recording_Timing/bundle.sha256 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ 3ab0e8c42716272222fc791ebd19fa70a8847cb1aaa4214089dcd822acd6be21 calibration_model.json
2
+ 3b73b35841363e4cb45f7991a4981b92673fcc6a28d1335dfc37363b42489a7f calibration_observations.csv
3
+ 0c6a904c1f3e653683ee32992f43024f9cb94410bff79d4404d9486c144cba44 group_timing_summary.csv
4
+ 959667ea3d64cd9e5320e33ceda8531c3b1159d8297f310af0f4517789e2c2a6 README.md
5
+ 97e5309502668056e5c4367ae7684597c9ca98a8f7fd12a4d85792a3b783d1cf recording_timing.csv
6
+ 0d34f10e1b410bb8b420b01e9cdfed14be8da3e6a3ec42fe1f4270d9f78c49ab SCHEMA.md
7
+ 7452018578a638c4c3d6d419756c26db3ddcac5d93659ba3fa98c835935e5af2 source_manifest.json
8
+ c0b72660f1c65a7100870b78c40478af3fa4aabab4304d86f5753b26e36c71af validation_summary.json
Standard_Time_Lapses/Provenance/Recording_Timing/calibration_model.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "tla-framelapse-android14-tag5-empirical-v1",
3
+ "status": "revision_pinned_exploratory_in_sample_calibration",
4
+ "source_dataset_revision": "b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e",
5
+ "target_quantity": "fragment start-to-MP4-finalization-boundary wall-clock elapsed time",
6
+ "formula": "estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30",
7
+ "constants": {
8
+ "empirical_intercept_seconds": 0.8,
9
+ "seconds_per_frame_numerator": 7,
10
+ "seconds_per_frame_denominator": 30
11
+ },
12
+ "calibration": {
13
+ "sample_count": 22,
14
+ "group_count": 5,
15
+ "holdout_count": 0,
16
+ "start_reference": "VID_YYYYMMDD_HHMMSS.mp4 source-device filename timestamp, interpreted as a recording start in America/New_York local time",
17
+ "end_reference": "matching format/video MP4 creation_time UTC tag; treated as best-supported finalization boundary",
18
+ "model_residual_seconds_observed_minus_estimated": {
19
+ "minimum": -0.833333,
20
+ "maximum": 0.466667,
21
+ "mean": 0.012121,
22
+ "standard_deviation_population": 0.356405,
23
+ "root_mean_square": 0.356611,
24
+ "maximum_absolute": 0.833333
25
+ },
26
+ "no_offset_seven_thirtieths_residual_seconds": {
27
+ "minimum": -0.033333,
28
+ "maximum": 1.266667,
29
+ "mean": 0.812121
30
+ },
31
+ "video_frames_per_observed_wall_second": {
32
+ "minimum": 4.2731707,
33
+ "maximum": 4.2859425,
34
+ "mean": 4.2815612,
35
+ "standard_deviation_population": 0.0030955
36
+ },
37
+ "nominal_five_fps_error_seconds_observed_minus_n_over_5": {
38
+ "minimum": 59.6,
39
+ "maximum": 314.8,
40
+ "mean": 154.982
41
+ }
42
+ },
43
+ "application": {
44
+ "direct_start_rows": 22,
45
+ "calibrated_estimate_rows": 164,
46
+ "profile_match_fields": [
47
+ "Android version tag 14",
48
+ "MP4 major brand mp42",
49
+ "3840x2160 stored dimensions",
50
+ "HEVC/yuvj420p",
51
+ "-90 degree display rotation",
52
+ "no audio",
53
+ "literal com.android.capture.fps=5.000000",
54
+ "encoded frame rate near 30 fps"
55
+ ],
56
+ "limitation": "Device identity and Framelapse app version are not independently retained for the 164 application rows; applicability is an observable-profile match, not a per-file direct calibration.",
57
+ "direct_filename_timestamp_resolution_allowance_seconds": 1,
58
+ "estimated_start_uncertainty_seconds": 2,
59
+ "calibrated_gap_uncertainty_seconds": 3,
60
+ "uncertainty_note": "These are operational timestamp-resolution allowances for review and flagging, not proven semantic error bounds."
61
+ },
62
+ "exclusions": [
63
+ "The literal capture tag 5.000000 is not used as a real-time divisor.",
64
+ "The model does not measure drawing activity, pen contact, uninterrupted work, source-frame timestamps, or mental state.",
65
+ "The calibration is in-sample and has no independent holdout."
66
+ ]
67
+ }
Standard_Time_Lapses/Provenance/Recording_Timing/calibration_observations.csv ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ record_id,file_path,source_filename,direct_start_local,direct_start_utc,creation_boundary_local,creation_boundary_utc,video_frame_count,observed_elapsed_seconds,nominal_five_fps_elapsed_seconds,nominal_five_fps_error_seconds,model_elapsed_seconds,model_residual_seconds,video_frames_per_observed_wall_second
2
+ tla-46790887b96058b1,Standard_Time_Lapses/2026-08-24.0157.BallpointPen.Ink.Paper.9x12.Rec01.mp4,VID_20260823_233143.mp4,2026-08-23T23:31:43-04:00,2026-08-24T03:31:43.000Z,2026-08-24T00:05:33-04:00,2026-08-24T04:05:33.000000Z,8695,2030,1739,291,2029.633,0.367,4.283251
3
+ tla-ebbce867454d61ea,Standard_Time_Lapses/2026-08-24.0157.BallpointPen.Ink.Paper.9x12.Rec02.mp4,VID_20260824_013639.mp4,2026-08-24T01:36:39-04:00,2026-08-24T05:36:39.000Z,2026-08-24T01:58:23-04:00,2026-08-24T05:58:23.000000Z,5585,1304,1117,187,1303.967,0.033,4.282975
4
+ tla-e31f5059a75da52c,Standard_Time_Lapses/2026-08-24.0638.BallpointPen.Ink.Paper.12x9.Rec01.mp4,VID_20260824_044026.mp4,2026-08-24T04:40:26-04:00,2026-08-24T08:40:26.000Z,2026-08-24T05:00:36-04:00,2026-08-24T09:00:36.000000Z,5182,1210,1036.4,173.6,1209.933,0.067,4.282645
5
+ tla-e6314ca067353edc,Standard_Time_Lapses/2026-08-24.0638.BallpointPen.Ink.Paper.12x9.Rec02.mp4,VID_20260824_061839.mp4,2026-08-24T06:18:39-04:00,2026-08-24T10:18:39.000Z,2026-08-24T06:39:03-04:00,2026-08-24T10:39:03.000000Z,5244,1224,1048.8,175.2,1224.4,-0.4,4.284314
6
+ tla-2b3cc71f11ea0151,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec01.mp4,VID_20260824_074143.mp4,2026-08-24T07:41:43-04:00,2026-08-24T11:41:43.000Z,2026-08-24T07:51:52-04:00,2026-08-24T11:51:52.000000Z,2607,609,521.4,87.6,609.1,-0.1,4.280788
7
+ tla-3a4ed6625d6aae32,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec02.mp4,VID_20260824_090248.mp4,2026-08-24T09:02:48-04:00,2026-08-24T13:02:48.000Z,2026-08-24T09:24:30-04:00,2026-08-24T13:24:30.000000Z,5576,1302,1115.2,186.8,1301.867,0.133,4.282642
8
+ tla-08603b7d034d579a,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec03.mp4,VID_20260825_145801.mp4,2026-08-25T14:58:01-04:00,2026-08-25T18:58:01.000Z,2026-08-25T15:34:42-04:00,2026-08-25T19:34:42.000000Z,9431,2201,1886.2,314.8,2201.367,-0.367,4.284871
9
+ tla-d743accc0cc418b4,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec04.mp4,VID_20260825_160133.mp4,2026-08-25T16:01:33-04:00,2026-08-25T20:01:33.000Z,2026-08-25T16:08:46-04:00,2026-08-25T20:08:46.000000Z,1851,433,370.2,62.8,432.7,0.3,4.274827
10
+ tla-dab77d429267838b,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec05.mp4,VID_20260825_162129.mp4,2026-08-25T16:21:29-04:00,2026-08-25T20:21:29.000Z,2026-08-25T16:37:54-04:00,2026-08-25T20:37:54.000000Z,4216,985,843.2,141.8,984.533,0.467,4.280203
11
+ tla-d611b60118251c73,Standard_Time_Lapses/2026-08-25.1941.BallpointPen.Ink.Paper.9x12.Rec06.mp4,VID_20260825_191231.mp4,2026-08-25T19:12:31-04:00,2026-08-25T23:12:31.000Z,2026-08-25T19:41:28-04:00,2026-08-25T23:41:28.000000Z,7443,1737,1488.6,248.4,1737.5,-0.5,4.284974
12
+ tla-bbb65ede9e37e03c,Standard_Time_Lapses/2026-08-26.1229.BallpointPen.Ink.Paper.9x12.Rec01.mp4,VID_20260826_113641.mp4,2026-08-26T11:36:41-04:00,2026-08-26T15:36:41.000Z,2026-08-26T11:59:19-04:00,2026-08-26T15:59:19.000000Z,5815,1358,1163,195,1357.633,0.367,4.282032
13
+ tla-3adf012f9f23d1d4,Standard_Time_Lapses/2026-08-26.1229.BallpointPen.Ink.Paper.9x12.Rec02.mp4,VID_20260826_122231.mp4,2026-08-26T12:22:31-04:00,2026-08-26T16:22:31.000Z,2026-08-26T12:29:21-04:00,2026-08-26T16:29:21.000000Z,1752,410,350.4,59.6,409.6,0.4,4.273171
14
+ tla-db8e5247b8ffbfcd,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec01.mp4,VID_20260826_124754.mp4,2026-08-26T12:47:54-04:00,2026-08-26T16:47:54.000Z,2026-08-26T12:56:27-04:00,2026-08-26T16:56:27.000000Z,2196,513,439.2,73.8,513.2,-0.2,4.280702
15
+ tla-f4659f0da42cf8e6,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec02.mp4,VID_20260826_130112.mp4,2026-08-26T13:01:12-04:00,2026-08-26T17:01:12.000Z,2026-08-26T13:11:38-04:00,2026-08-26T17:11:38.000000Z,2683,626,536.6,89.4,626.833,-0.833,4.285942
16
+ tla-d985c298e56b626b,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec03.mp4,VID_20260826_135332.mp4,2026-08-26T13:53:32-04:00,2026-08-26T17:53:32.000Z,2026-08-26T14:04:36-04:00,2026-08-26T18:04:36.000000Z,2841,664,568.2,95.8,663.7,0.3,4.278614
17
+ tla-8d4e89f78b6cfb9d,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec04.mp4,VID_20260826_152231.mp4,2026-08-26T15:22:31-04:00,2026-08-26T19:22:31.000Z,2026-08-26T15:37:53-04:00,2026-08-26T19:37:53.000000Z,3946,922,789.2,132.8,921.533,0.467,4.279826
18
+ tla-06b42c49789802b4,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec05.mp4,VID_20260827_044715.mp4,2026-08-27T04:47:15-04:00,2026-08-27T08:47:15.000Z,2026-08-27T05:01:16-04:00,2026-08-27T09:01:16.000000Z,3601,841,720.2,120.8,841.033,-0.033,4.281807
19
+ tla-10c744cb86d89256,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec06.mp4,VID_20260827_053657.mp4,2026-08-27T05:36:57-04:00,2026-08-27T09:36:57.000Z,2026-08-27T05:58:58-04:00,2026-08-27T09:58:58.000000Z,5658,1321,1131.6,189.4,1321,0,4.283119
20
+ tla-56d81a0cc1a81233,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec07.mp4,VID_20260827_063456.mp4,2026-08-27T06:34:56-04:00,2026-08-27T10:34:56.000Z,2026-08-27T07:06:24-04:00,2026-08-27T11:06:24.000000Z,8086,1888,1617.2,270.8,1887.533,0.467,4.282839
21
+ tla-dfeb6702936333a5,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec08.mp4,VID_20260827_073057.mp4,2026-08-27T07:30:57-04:00,2026-08-27T11:30:57.000Z,2026-08-27T07:46:49-04:00,2026-08-27T11:46:49.000000Z,4078,952,815.6,136.4,952.333,-0.333,4.283613
22
+ tla-3e01cce98d9d3ff3,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec09.mp4,VID_20260827_080100.mp4,2026-08-27T08:01:00-04:00,2026-08-27T12:01:00.000Z,2026-08-27T08:14:04-04:00,2026-08-27T12:14:04.000000Z,3358,784,671.6,112.4,784.333,-0.333,4.283163
23
+ tla-e1c799958f3cf010,Standard_Time_Lapses/2026-08-27.0856.BallpointPen.Ink.Paper.9x12.Rec10.mp4,VID_20260827_084919.mp4,2026-08-27T08:49:19-04:00,2026-08-27T12:49:19.000Z,2026-08-27T08:56:45-04:00,2026-08-27T12:56:45.000000Z,1908,446,381.6,64.4,446,0,4.278027
Standard_Time_Lapses/Provenance/Recording_Timing/group_timing_summary.csv ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fragment_set_label,fragment_count,direct_start_count,calibrated_start_count,first_capture_start_utc,last_creation_boundary_utc,recording_elapsed_seconds_sum,group_wall_span_seconds,within_group_gap_seconds_sum,within_uncertainty_gap_count,documented_group_finish_date,documented_group_finish_time,group_finish_delta_seconds,group_finish_crosscheck_status,source_hub_revision,notes
2
+ 2026-08-24.0157.BallpointPen.Ink.Paper.9x12,2,2,0,2026-08-24T03:31:43.000Z,2026-08-24T05:58:23.000000Z,3334,8800,5466,0,2026-08-24,01:57,83,near_documented_finish_minute,8a21015210c19936d3b18175ae3f4061ae1e5d8d,
3
+ 2026-08-24.0638.BallpointPen.Ink.Paper.12x9,2,2,0,2026-08-24T08:40:26.000Z,2026-08-24T10:39:03.000000Z,2434,7117,4683,0,2026-08-24,06:38,63,near_documented_finish_minute,8a21015210c19936d3b18175ae3f4061ae1e5d8d,
4
+ 2026-08-25.1941.BallpointPen.Ink.Paper.9x12,6,6,0,2026-08-24T11:41:43.000Z,2026-08-25T23:41:28.000000Z,7267,129585,122318,0,2026-08-25,19:41,28,near_documented_finish_minute,8a21015210c19936d3b18175ae3f4061ae1e5d8d,
5
+ 2026-08-26.1229.BallpointPen.Ink.Paper.9x12,2,2,0,2026-08-26T15:36:41.000Z,2026-08-26T16:29:21.000000Z,1768,3160,1392,0,2026-08-26,12:29,21,near_documented_finish_minute,8a21015210c19936d3b18175ae3f4061ae1e5d8d,
6
+ 2026-08-27.0856.BallpointPen.Ink.Paper.9x12,10,10,0,2026-08-26T16:47:54.000Z,2026-08-27T12:56:45.000000Z,8957,72531,63574,0,2026-08-27,08:56,45,near_documented_finish_minute,8a21015210c19936d3b18175ae3f4061ae1e5d8d,
7
+ 2026-08-28.0108.BallpointPen.Ink.Paper.9x12,10,0,10,2026-08-27T22:18:23.333Z,2026-08-28T05:08:50.000000Z,8702.468,24626.667,15924.199,0,2026-08-28,01:08,50,near_documented_finish_minute,429541ae7f93c869056df956873f3441d580914c,
8
+ 2026-08-29.0254.BallpointPen.Ink.Paper.9x12,4,0,4,2026-08-28T07:46:26.867Z,2026-08-29T06:55:04.000000Z,1095.433,83317.133,82221.7,0,2026-08-29,02:54,64,near_documented_finish_minute,429541ae7f93c869056df956873f3441d580914c,
9
+ 2026-08-29.0602.BallpointPen.Ink.Paper.9x12,2,0,2,2026-08-29T09:18:02.267Z,2026-08-29T10:02:14.000000Z,2429.666,2651.733,222.067,0,2026-08-29,06:02,14,near_documented_finish_minute,429541ae7f93c869056df956873f3441d580914c,
10
+ 2026-08-29.0716.BallpointPen.Ink.Paper.9x12,3,0,3,2026-08-29T10:23:56.467Z,2026-08-29T11:16:20.000000Z,2415.999,3143.533,727.534,0,2026-08-29,07:16,20,near_documented_finish_minute,429541ae7f93c869056df956873f3441d580914c,
11
+ 2026-08-29.1450.BallpointPen.Ink.Paper.9x12,9,0,9,2026-08-29T15:08:02.800Z,2026-08-29T18:50:55.000000Z,5652.466,13372.2,7719.734,0,2026-08-29,14:50,55,near_documented_finish_minute,7293edccff883b4c604d710addbf26c85910cfcc,
12
+ 2026-08-29.1849.BallpointPen.Ink.Paper.9x12,5,0,5,2026-08-29T20:10:33.400Z,2026-08-29T22:49:22.000000Z,2950.766,9528.6,6577.834,0,2026-08-29,18:49,22,near_documented_finish_minute,7293edccff883b4c604d710addbf26c85910cfcc,
13
+ 2026-08-30.0022.BallpointPen.Ink.Paper.9x12,4,0,4,2026-08-30T01:22:17.933Z,2026-08-30T04:22:19.000000Z,2802.967,10801.067,7998.1,0,2026-08-30,00:22,19,near_documented_finish_minute,7293edccff883b4c604d710addbf26c85910cfcc,
14
+ 2026-08-30.1126.FountainPen.Ink.Paper.9x12,15,0,15,2026-08-30T08:37:00.100Z,2026-08-30T15:26:00.000000Z,9546.467,24539.9,14993.433,0,2026-08-30,11:26,0,near_documented_finish_minute,7293edccff883b4c604d710addbf26c85910cfcc,
15
+ 2026-08-30.1712.BallpointPen.Ink.Paper.9x12,6,0,6,2026-08-30T17:08:10.800Z,2026-08-30T21:12:34.000000Z,2904.433,14663.2,11758.767,0,2026-08-30,17:12,34,near_documented_finish_minute,7293edccff883b4c604d710addbf26c85910cfcc,
16
+ 2026-08-31.0009.BallpointPen.Ink.Paper.9x12,8,0,8,2026-08-30T22:13:58.167Z,2026-08-31T04:09:47.000000Z,4029.999,21348.833,17318.834,0,2026-08-31,00:09,47,near_documented_finish_minute,480bc7e24261e6d3bbcacd261a00782b7e40211a,
17
+ 2026-08-31.0732.BallpointPen.Ink.Paper.9x12,6,0,6,2026-08-31T07:19:38.700Z,2026-08-31T11:32:53.000000Z,3616.334,15194.3,11577.966,0,2026-08-31,07:32,53,near_documented_finish_minute,480bc7e24261e6d3bbcacd261a00782b7e40211a,
18
+ 2026-08-31.1039.BallpointPen.Ink.Paper.9x12,7,0,7,2026-08-31T13:52:19.033Z,2026-08-31T14:39:58.000000Z,2083.434,2858.967,775.533,0,2026-08-31,10:39,58,near_documented_finish_minute,480bc7e24261e6d3bbcacd261a00782b7e40211a,
19
+ 2026-08-31.1212.BallpointPen.Ink.Paper.9x12,11,0,11,2026-08-31T15:11:36.000Z,2026-08-31T16:12:29.000000Z,2635.667,3653,1017.333,0,2026-08-31,12:12,29,near_documented_finish_minute,480bc7e24261e6d3bbcacd261a00782b7e40211a,
20
+ 2026-09-01.0213.BallpointPen.Ink.Paper.9x12,12,0,12,2026-09-01T14:26:06.367Z,2026-09-01T18:13:21.000000Z,5932.767,13634.633,7701.866,1,2026-09-01,02:13,43221,documented_finish_conflict,7fca6fcc36d873b92a6c64fff5980e8d5afde5a6,Final MP4 creation boundary is 43221 seconds after the documented group finish minute in America/New_York; possible 12-hour label discrepancy; no correction applied.
21
+ 2026-09-01.0237.BallpointPen.Ink.Paper.9x12,4,0,4,2026-08-31T21:25:00.633Z,2026-09-01T06:37:07.000000Z,2013.833,33126.367,31112.534,0,2026-09-01,02:37,7,near_documented_finish_minute,fe66d1dbb117486c2046376423316fd2cc25d488,
22
+ 2026-09-01.0619.BallpointPen.Ink.Paper.9x12,9,0,9,2026-09-01T08:20:22.367Z,2026-09-01T10:19:12.000000Z,4881.532,7129.633,2248.101,0,2026-09-01,06:19,12,near_documented_finish_minute,fe66d1dbb117486c2046376423316fd2cc25d488,
23
+ 2026-09-01.2356.BallpointPen.Ink.Paper.9x12,9,0,9,2026-09-02T02:20:14.733Z,2026-09-02T03:56:07.000000Z,4483.7,5752.267,1268.567,0,2026-09-01,23:56,7,near_documented_finish_minute,7fca6fcc36d873b92a6c64fff5980e8d5afde5a6,
24
+ 2026-09-02.0301.BallpointPen.Ink.Paper.9x12,11,0,11,2026-09-02T05:24:00.600Z,2026-09-02T07:01:47.000000Z,3802.334,5866.4,2064.066,1,2026-09-02,03:01,47,near_documented_finish_minute,7fca6fcc36d873b92a6c64fff5980e8d5afde5a6,
25
+ 2026-09-02.0813.BallpointPen.Ink.Paper.9x12,10,0,10,2026-09-02T09:48:35.833Z,2026-09-02T12:13:51.000000Z,3631.433,8715.167,5083.734,0,2026-09-02,08:13,51,near_documented_finish_minute,7fca6fcc36d873b92a6c64fff5980e8d5afde5a6,
26
+ 2026-09-02.2023.BallpointPen.Ink.Paper.9x12,19,0,19,2026-09-02T17:15:45.133Z,2026-09-03T00:23:18.000000Z,10601.767,25652.867,15051.1,0,2026-09-02,20:23,18,near_documented_finish_minute,7fca6fcc36d873b92a6c64fff5980e8d5afde5a6,
Standard_Time_Lapses/Provenance/Recording_Timing/recording_timing.csv ADDED
The diff for this file is too large to render. See raw diff
 
Standard_Time_Lapses/Provenance/Recording_Timing/source_manifest.json ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "packet_status": "exploratory_public_derived_sidecar_v1",
3
+ "dataset": "maxwellinked/time-lapse-artifacts",
4
+ "pinned_dataset_revision": "b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e",
5
+ "canonical_metadata": {
6
+ "file_path": "metadata.csv",
7
+ "size_bytes": 370833,
8
+ "sha256": "d516da7a4341dddf0b2b5ad50f6200f283ea0cdefc6de465882fbc021abfba8a",
9
+ "field_count": 29,
10
+ "row_count": 549
11
+ },
12
+ "source_snapshot_schema": {
13
+ "file_path": "SCHEMA.md",
14
+ "size_bytes": 19411,
15
+ "sha256": "3624d5858bd4c0df796775ee6400106eb146101acbf112a515ad4a49c3262082"
16
+ },
17
+ "local_source_audits": [
18
+ {
19
+ "source_audit_id": "ingest_20260827",
20
+ "availability": "retained_locally_not_bundled",
21
+ "size_bytes": 36337,
22
+ "sha256": "ddef8b59b14a491a6490d481d7acfd4f5f799c601247807268af0bda997bade6",
23
+ "base_hub_revision": "69a3e249fc390b43515fa77587b53bd775f75f1e",
24
+ "row_count": 27,
25
+ "object_role_counts": {
26
+ "canonical_fragment": 22,
27
+ "noncanonical_inshot_derivative": 5
28
+ }
29
+ },
30
+ {
31
+ "source_audit_id": "ingest_20260829",
32
+ "availability": "retained_locally_not_bundled",
33
+ "size_bytes": 27954,
34
+ "sha256": "fe89f2d0fe7b3cb1606f60d5772197fc1d0c57821a51782d3ecd3f18c47882d9",
35
+ "base_hub_revision": "c5c4da8fa880e39a56a2cfd032c5c87072442fe1",
36
+ "row_count": 19,
37
+ "object_role_counts": {
38
+ "canonical_fragment": 19
39
+ }
40
+ },
41
+ {
42
+ "source_audit_id": "ingest_20260830",
43
+ "availability": "retained_locally_not_bundled",
44
+ "size_bytes": 56981,
45
+ "sha256": "7d0cc82763bf8e2026fd7c8de078cb0ccba70b774ab65f0867b9b8a77a281d20",
46
+ "base_hub_revision": "44ac040f74f3eb4b2efc647d2d306dfe29a012d5",
47
+ "row_count": 39,
48
+ "object_role_counts": {
49
+ "canonical_fragment": 39
50
+ }
51
+ },
52
+ {
53
+ "source_audit_id": "ingest_20260831",
54
+ "availability": "retained_locally_not_bundled",
55
+ "size_bytes": 46851,
56
+ "sha256": "91f15a43af2346a302b66dde18fa96f8583c61b6de6dfb1389bb4ed01a92a6c8",
57
+ "base_hub_revision": "aa3b60a89a9045f8ecb836fbcab0da1dbb291569",
58
+ "row_count": 32,
59
+ "object_role_counts": {
60
+ "canonical_fragment": 32
61
+ }
62
+ },
63
+ {
64
+ "source_audit_id": "ingest_20260901",
65
+ "availability": "retained_locally_not_bundled",
66
+ "size_bytes": 19217,
67
+ "sha256": "8df0d8eb9a329e9d60dab9db9c2e375df1bb99343f8f26eed214f3ba1f48137b",
68
+ "base_hub_revision": "53b02712af07d278c9456ecb319e970e2954d2c4",
69
+ "row_count": 13,
70
+ "object_role_counts": {
71
+ "canonical_fragment": 13
72
+ }
73
+ },
74
+ {
75
+ "source_audit_id": "ingest_20260902",
76
+ "availability": "retained_locally_not_bundled",
77
+ "size_bytes": 46844,
78
+ "sha256": "4a94d412299388bc88cafd5c0a33b3383be04e30d0b03ead997370945df47c1c",
79
+ "base_hub_revision": "99371163392d9f4b6685da116fb92398a610457e",
80
+ "row_count": 32,
81
+ "object_role_counts": {
82
+ "canonical_fragment": 32
83
+ }
84
+ },
85
+ {
86
+ "source_audit_id": "ingest_20260902_evening",
87
+ "availability": "retained_locally_not_bundled",
88
+ "size_bytes": 42498,
89
+ "sha256": "f6fe34c60f8e2295c1cd9fa7a489aa82bb9b314009276e9b2ff10b7688631043",
90
+ "base_hub_revision": "81d5675113fcd5e26eac0289c228f7ccfe552e42",
91
+ "row_count": 29,
92
+ "object_role_counts": {
93
+ "canonical_fragment": 29
94
+ }
95
+ }
96
+ ],
97
+ "relationship_sidecars": [
98
+ {
99
+ "file_path": "Standard_Time_Lapses/Provenance/2026-08-27/fragment_sequence_relationships.csv",
100
+ "size_bytes": 15322,
101
+ "sha256": "62b1fd9add3be03e3e7198df8f107a416741682c79878b7622c6ea1c34ec4ce8",
102
+ "row_count": 27,
103
+ "object_role_counts": {
104
+ "canonical_fragment": 22,
105
+ "noncanonical_inshot_derivative": 5
106
+ },
107
+ "source_hub_revision": "8a21015210c19936d3b18175ae3f4061ae1e5d8d"
108
+ },
109
+ {
110
+ "file_path": "Standard_Time_Lapses/Provenance/2026-08-29/fragment_sequence_relationships.csv",
111
+ "size_bytes": 12748,
112
+ "sha256": "9648cf53ce35dd30b6c0c8c3c223c4ed68aea9a03d2e7f4843ad6f39e04c7bb7",
113
+ "row_count": 19,
114
+ "object_role_counts": {
115
+ "canonical_fragment": 19
116
+ },
117
+ "source_hub_revision": "429541ae7f93c869056df956873f3441d580914c"
118
+ },
119
+ {
120
+ "file_path": "Standard_Time_Lapses/Provenance/2026-08-30/fragment_sequence_relationships.csv",
121
+ "size_bytes": 26023,
122
+ "sha256": "427b416c617c9bf9400ec574452902180fec94c8a0dbe8fc1526ece7a1bdb50c",
123
+ "row_count": 39,
124
+ "object_role_counts": {
125
+ "canonical_fragment": 39
126
+ },
127
+ "source_hub_revision": "7293edccff883b4c604d710addbf26c85910cfcc"
128
+ },
129
+ {
130
+ "file_path": "Standard_Time_Lapses/Provenance/2026-08-31/fragment_sequence_relationships.csv",
131
+ "size_bytes": 21413,
132
+ "sha256": "e006ba8b30f31b14f750992455c74459a88d50d40e9b4fe57623c5a8dd332272",
133
+ "row_count": 32,
134
+ "object_role_counts": {
135
+ "canonical_fragment": 32
136
+ },
137
+ "source_hub_revision": "480bc7e24261e6d3bbcacd261a00782b7e40211a"
138
+ },
139
+ {
140
+ "file_path": "Standard_Time_Lapses/Provenance/2026-09-01/fragment_sequence_relationships.csv",
141
+ "size_bytes": 8821,
142
+ "sha256": "200d7f4e38d06caf7a472dbaec2b7bae62a3dd1b4fce808b638391b2060a957a",
143
+ "row_count": 13,
144
+ "object_role_counts": {
145
+ "canonical_fragment": 13
146
+ },
147
+ "source_hub_revision": "fe66d1dbb117486c2046376423316fd2cc25d488"
148
+ },
149
+ {
150
+ "file_path": "Standard_Time_Lapses/Provenance/2026-09-02/fragment_sequence_relationships.csv",
151
+ "size_bytes": 40663,
152
+ "sha256": "066ababd2a40c2be23087588603dc680adadd54e7cbb6708ab238c22e216932e",
153
+ "row_count": 61,
154
+ "object_role_counts": {
155
+ "canonical_fragment": 61
156
+ },
157
+ "source_hub_revision": "7fca6fcc36d873b92a6c64fff5980e8d5afde5a6"
158
+ }
159
+ ],
160
+ "source_scope": {
161
+ "audit_rows": 191,
162
+ "relationship_rows": 191,
163
+ "canonical_fragment_rows": 186,
164
+ "excluded_noncanonical_derivative_rows": 5,
165
+ "fragment_groups": 25
166
+ },
167
+ "note": "Absolute local source paths are intentionally omitted. Logical audit IDs, byte sizes, hashes, and source revisions bind the retained local receipts. Direct MP4 tags and frame counts can be re-probed from the pinned public media objects."
168
+ }
Standard_Time_Lapses/Provenance/Recording_Timing/validation_summary.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "pass_with_one_preserved_documented_finish_conflict",
3
+ "verification_level": "repository_packet_self_consistency",
4
+ "pinned_dataset_revision": "b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e",
5
+ "counts": {
6
+ "canonical_timing_rows": 186,
7
+ "direct_device_filename_start_rows": 22,
8
+ "calibrated_frame_model_rows": 164,
9
+ "calibration_groups": 5,
10
+ "fragment_groups": 25,
11
+ "inter_fragment_transitions": 161,
12
+ "excluded_noncanonical_derivatives": 5
13
+ },
14
+ "repository_identity_and_source_checks": {
15
+ "timing_relationship_record_id_path_sets_equal": true,
16
+ "timing_relationship_record_id_path_sha256_xet_matches": true,
17
+ "canonical_metadata_record_id_size_xet_matches": true,
18
+ "canonical_record_ids_paths_sha256_unique": true,
19
+ "format_video_creation_times_equal": true,
20
+ "exact_literal_capture_tag_preserved": "5.000000",
21
+ "literal_capture_tag_used_in_timing_formula": false
22
+ },
23
+ "retained_local_audit_claims_not_reperformed": {
24
+ "audit_relationship_path_sets_equal": true,
25
+ "audit_record_id_sha256_size_matches": true,
26
+ "all_rows_same_observable_technical_profile": true
27
+ },
28
+ "calibration_checks": {
29
+ "model_id": "tla-framelapse-android14-tag5-empirical-v1",
30
+ "formula": "estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30",
31
+ "direct_observation_count": 22,
32
+ "holdout_count": 0,
33
+ "maximum_absolute_model_residual_seconds": 0.833333,
34
+ "nominal_five_fps_minimum_error_seconds": 59.6,
35
+ "nominal_five_fps_maximum_error_seconds": 314.8
36
+ },
37
+ "chronology_checks": {
38
+ "groups_with_contiguous_positions": 25,
39
+ "strictly_increasing_creation_boundaries_within_groups": true,
40
+ "gaps_positive_above_uncertainty": 159,
41
+ "gaps_within_uncertainty_of_zero": 2,
42
+ "gaps_negative_beyond_uncertainty": 0
43
+ },
44
+ "documented_finish_crosscheck": {
45
+ "threshold_seconds": 120,
46
+ "near_minute_groups": 24,
47
+ "maximum_near_minute_delta_seconds": 83,
48
+ "conflict_groups": [
49
+ {
50
+ "fragment_set_label": "2026-09-01.0213.BallpointPen.Ink.Paper.9x12",
51
+ "delta_seconds": 43221,
52
+ "note": "Final MP4 creation boundary is 43221 seconds after the documented group finish minute in America/New_York; possible 12-hour label discrepancy; no correction applied."
53
+ }
54
+ ]
55
+ },
56
+ "aggregate_descriptors": {
57
+ "serialized_recording_elapsed_seconds_sum": 109973.465,
58
+ "serialized_recording_elapsed_hours_sum": 30.548185,
59
+ "note": "This is the exact Decimal sum of the published three-decimal recording_elapsed_seconds values. Calculation before row serialization gives 109973.466666... seconds, 0.001667 seconds higher. The sum mixes 22 directly observed start-to-boundary intervals with 164 calibrated estimates; it is not drawing-active time or corpus calendar span."
60
+ },
61
+ "immutability_checks": {
62
+ "metadata_csv_sha256_unchanged": true,
63
+ "relationship_sidecar_hashes_unchanged": true,
64
+ "canonical_metadata_field_count_unchanged": true
65
+ },
66
+ "not_reperformed_by_repository_validator": [
67
+ "source-media tag and frame-count probing",
68
+ "source-media ordinary SHA-256 hashing",
69
+ "retained local source-audit byte verification",
70
+ "NTFS timestamp observation"
71
+ ]
72
+ }
VALIDATION.md CHANGED
@@ -1,5 +1,50 @@
1
  # Validation Report
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## Current v0.4.0 release candidate
4
 
5
  Branch `codex/prepare-v0.4.0-release` starts at exact Hub `main` revision
@@ -282,7 +327,10 @@ These remain explicit; validation must not guess their answers:
282
  6. Most active indexed videos at this revision contain an audio stream (485 of
283
  677). Stream presence does not establish meaningful signal; rights and
284
  privacy review remain necessary.
285
- 7. Encoded frame rate and playback duration cannot recover real drawing time.
 
 
 
286
  8. The 2012–2016 archive has no public video payload in this release.
287
  9. No official train/validation/test partition or global `work_id` exists.
288
 
 
1
  # Validation Report
2
 
3
+ ## Unreleased exploratory recording-timing layer
4
+
5
+ The recording-timing sidecar is pinned to source revision
6
+ `b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e` and covers exactly the 186
7
+ canonical fragments in the six dated relationship sidecars. The included
8
+ validator passed with repository-packet self-consistency scope.
9
+
10
+ | Check | Result |
11
+ | --- | ---: |
12
+ | Timing rows | 186 |
13
+ | Direct device-filename start observations | 22 |
14
+ | Profile-matched model applications | 164 |
15
+ | Independent holdout observations | 0 |
16
+ | Maximum absolute in-sample model residual | 0.833333 seconds |
17
+ | Owner-confirmed complete source sequences | 25 |
18
+ | Within-sequence transitions | 161 |
19
+ | Positive beyond uncertainty / within uncertainty / negative beyond uncertainty | 159 / 2 / 0 |
20
+ | Final boundaries near documented finish minute | 24 / 25 |
21
+ | Preserved documented-finish conflicts | 1 |
22
+ | Timing bundle files verified | 8 |
23
+ | Repository regression tests | 40 / 40 passed |
24
+
25
+ The one retained conflict is
26
+ `2026-09-01.0213.BallpointPen.Ink.Paper.9x12`, whose final MP4 boundary is
27
+ 43,221 seconds after the documented finish minute. No timestamp is corrected.
28
+ The 109,973.465-second serialized aggregate mixes 22 observed and 164 estimated
29
+ start-to-finalization intervals; it is neither drawing-active time nor corpus
30
+ calendar span. Calculation before three-decimal row serialization differs by
31
+ 0.001667 seconds.
32
+
33
+ The validator recomputes identity joins, timestamp arithmetic, row formulas,
34
+ full-precision calibration metrics, sequence chronology, group summaries,
35
+ validation summaries, source receipts, and bundle hashes:
36
+
37
+ ```bash
38
+ python tools/validate_recording_timing.py --root .
39
+ python -m unittest discover -s tools -p "test_*.py" -v
40
+ ```
41
+
42
+ This repository-only run does not re-probe source-media tags or frame counts,
43
+ rehash the 186 source videos, verify the retained local audit bytes, or
44
+ re-observe NTFS timestamps. No MP4, canonical metadata row or field,
45
+ relationship sidecar, Viewer configuration, or root `SHA256SUMS` payload entry
46
+ is changed by the timing layer.
47
+
48
  ## Current v0.4.0 release candidate
49
 
50
  Branch `codex/prepare-v0.4.0-release` starts at exact Hub `main` revision
 
327
  6. Most active indexed videos at this revision contain an audio stream (485 of
328
  677). Stream presence does not establish meaningful signal; rights and
329
  privacy review remain necessary.
330
+ 7. Encoded frame rate and playback duration cannot by themselves recover
331
+ wall-clock or real drawing time. The recording-timing sidecar provides
332
+ narrower start-to-finalization evidence for 186 matching-profile fragments
333
+ only; it supplies neither drawing-active time nor per-frame timestamps.
334
  8. The 2012–2016 archive has no public video payload in this release.
335
  9. No official train/validation/test partition or global `work_id` exists.
336
 
tools/test_recording_timing.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Focused regression tests for the recording-timing sidecar validator."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import csv
7
+ import hashlib
8
+ import json
9
+ import shutil
10
+ import subprocess
11
+ import sys
12
+ import tempfile
13
+ import unittest
14
+ from pathlib import Path
15
+
16
+
17
+ TOOLS = Path(__file__).resolve().parent
18
+ REPO_ROOT = TOOLS.parent
19
+ VALIDATOR = TOOLS / "validate_recording_timing.py"
20
+ TIMING_RELATIVE = Path(
21
+ "Standard_Time_Lapses/Provenance/Recording_Timing"
22
+ )
23
+ RELATIONSHIP_DATES = (
24
+ "2026-08-27",
25
+ "2026-08-29",
26
+ "2026-08-30",
27
+ "2026-08-31",
28
+ "2026-09-01",
29
+ "2026-09-02",
30
+ )
31
+
32
+
33
+ def rewrite_bundle(timing_dir: Path) -> None:
34
+ entries = []
35
+ for path in sorted(timing_dir.iterdir(), key=lambda item: item.name):
36
+ if path.is_file() and path.name != "bundle.sha256":
37
+ digest = hashlib.sha256(path.read_bytes()).hexdigest()
38
+ entries.append(f"{digest} {path.name}")
39
+ (timing_dir / "bundle.sha256").write_text(
40
+ "\n".join(entries) + "\n", encoding="utf-8", newline="\n"
41
+ )
42
+
43
+
44
+ class RecordingTimingValidatorTests(unittest.TestCase):
45
+ def run_validator(self, root: Path) -> subprocess.CompletedProcess[str]:
46
+ return subprocess.run(
47
+ [sys.executable, str(VALIDATOR), "--root", str(root)],
48
+ check=False,
49
+ capture_output=True,
50
+ text=True,
51
+ encoding="utf-8",
52
+ )
53
+
54
+ def copy_fixture(self, destination: Path) -> Path:
55
+ shutil.copy2(REPO_ROOT / "metadata.csv", destination / "metadata.csv")
56
+ timing_destination = destination / TIMING_RELATIVE
57
+ timing_destination.parent.mkdir(parents=True, exist_ok=True)
58
+ shutil.copytree(REPO_ROOT / TIMING_RELATIVE, timing_destination)
59
+ for date in RELATIONSHIP_DATES:
60
+ relative = Path(
61
+ f"Standard_Time_Lapses/Provenance/{date}/fragment_sequence_relationships.csv"
62
+ )
63
+ target = destination / relative
64
+ target.parent.mkdir(parents=True, exist_ok=True)
65
+ shutil.copy2(REPO_ROOT / relative, target)
66
+ return timing_destination
67
+
68
+ def test_current_repository_packet_passes(self) -> None:
69
+ completed = self.run_validator(REPO_ROOT)
70
+ self.assertEqual(completed.returncode, 0, completed.stdout + completed.stderr)
71
+ summary = json.loads(completed.stdout)
72
+ self.assertEqual(summary["status"], "ok")
73
+ self.assertEqual(summary["timing_rows"], 186)
74
+
75
+ def test_full_precision_metric_regression_is_rejected(self) -> None:
76
+ with tempfile.TemporaryDirectory(prefix="tla-timing-metric-") as temp_dir:
77
+ root = Path(temp_dir)
78
+ timing_dir = self.copy_fixture(root)
79
+ model_path = timing_dir / "calibration_model.json"
80
+ model = json.loads(model_path.read_text(encoding="utf-8"))
81
+ model["calibration"][
82
+ "model_residual_seconds_observed_minus_estimated"
83
+ ]["mean"] = 0.012227
84
+ model_path.write_text(
85
+ json.dumps(model, indent=2) + "\n", encoding="utf-8", newline="\n"
86
+ )
87
+ rewrite_bundle(timing_dir)
88
+ completed = self.run_validator(root)
89
+
90
+ self.assertNotEqual(completed.returncode, 0)
91
+ self.assertIn("calibration model residual metrics mean", completed.stdout)
92
+
93
+ def test_frame_count_mutation_is_rejected_after_bundle_refresh(self) -> None:
94
+ with tempfile.TemporaryDirectory(prefix="tla-timing-frame-") as temp_dir:
95
+ root = Path(temp_dir)
96
+ timing_dir = self.copy_fixture(root)
97
+ timing_path = timing_dir / "recording_timing.csv"
98
+ with timing_path.open("r", encoding="utf-8-sig", newline="") as handle:
99
+ reader = csv.DictReader(handle)
100
+ fieldnames = list(reader.fieldnames or [])
101
+ rows = list(reader)
102
+ calibrated = next(
103
+ row for row in rows if row["timing_basis"] == "calibrated_frame_model"
104
+ )
105
+ calibrated["video_frame_count"] = str(
106
+ int(calibrated["video_frame_count"]) + 30
107
+ )
108
+ with timing_path.open("w", encoding="utf-8", newline="") as handle:
109
+ writer = csv.DictWriter(handle, fieldnames=fieldnames, lineterminator="\n")
110
+ writer.writeheader()
111
+ writer.writerows(rows)
112
+ rewrite_bundle(timing_dir)
113
+ completed = self.run_validator(root)
114
+
115
+ self.assertNotEqual(completed.returncode, 0)
116
+ self.assertIn("calibrated elapsed", completed.stdout)
117
+
118
+ def test_bundle_path_traversal_is_rejected(self) -> None:
119
+ with tempfile.TemporaryDirectory(prefix="tla-timing-bundle-") as temp_dir:
120
+ root = Path(temp_dir)
121
+ timing_dir = self.copy_fixture(root)
122
+ bundle = timing_dir / "bundle.sha256"
123
+ bundle.write_text(
124
+ bundle.read_text(encoding="utf-8")
125
+ + f"{'0' * 64} ../metadata.csv\n",
126
+ encoding="utf-8",
127
+ newline="\n",
128
+ )
129
+ completed = self.run_validator(root)
130
+
131
+ self.assertNotEqual(completed.returncode, 0)
132
+ self.assertIn("malformed entry", completed.stdout)
133
+
134
+ def test_repository_validator_limits_are_explicit(self) -> None:
135
+ summary_path = REPO_ROOT / TIMING_RELATIVE / "validation_summary.json"
136
+ summary = json.loads(summary_path.read_text(encoding="utf-8"))
137
+ self.assertEqual(
138
+ summary["verification_level"], "repository_packet_self_consistency"
139
+ )
140
+ self.assertIn(
141
+ "source-media tag and frame-count probing",
142
+ summary["not_reperformed_by_repository_validator"],
143
+ )
144
+ self.assertIn(
145
+ "NTFS timestamp observation",
146
+ summary["not_reperformed_by_repository_validator"],
147
+ )
148
+
149
+
150
+ if __name__ == "__main__":
151
+ unittest.main()
tools/validate_recording_timing.py ADDED
@@ -0,0 +1,1353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Validate the exploratory recording-timing sidecar and its source joins."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import csv
8
+ import hashlib
9
+ import json
10
+ import math
11
+ import re
12
+ from collections import Counter, defaultdict
13
+ from datetime import datetime, timedelta, timezone
14
+ from decimal import Decimal, InvalidOperation
15
+ from pathlib import Path
16
+ from zoneinfo import ZoneInfo
17
+
18
+
19
+ TIMING_FIELDS = [
20
+ "record_id",
21
+ "file_path",
22
+ "sha256",
23
+ "hub_xet_hash",
24
+ "fragment_set_label",
25
+ "sequence_position",
26
+ "sequence_count",
27
+ "source_hub_revision",
28
+ "source_audit_id",
29
+ "source_filename",
30
+ "format_creation_time_utc",
31
+ "video_creation_time_utc",
32
+ "capture_fps_tag_literal",
33
+ "video_frame_count",
34
+ "local_time_zone",
35
+ "device_filename_start_local",
36
+ "format_creation_time_local",
37
+ "capture_start_time_utc",
38
+ "capture_start_time_local",
39
+ "timing_basis",
40
+ "recording_elapsed_seconds",
41
+ "start_uncertainty_seconds",
42
+ "timing_model_id",
43
+ "calibration_profile_status",
44
+ "previous_record_id",
45
+ "inter_fragment_gap_seconds",
46
+ "gap_uncertainty_seconds",
47
+ "gap_status",
48
+ "documented_group_finish_date",
49
+ "documented_group_finish_time",
50
+ "group_finish_delta_seconds",
51
+ "group_finish_crosscheck_status",
52
+ "timing_evidence_state",
53
+ "notes",
54
+ ]
55
+
56
+ CALIBRATION_FIELDS = [
57
+ "record_id",
58
+ "file_path",
59
+ "source_filename",
60
+ "direct_start_local",
61
+ "direct_start_utc",
62
+ "creation_boundary_local",
63
+ "creation_boundary_utc",
64
+ "video_frame_count",
65
+ "observed_elapsed_seconds",
66
+ "nominal_five_fps_elapsed_seconds",
67
+ "nominal_five_fps_error_seconds",
68
+ "model_elapsed_seconds",
69
+ "model_residual_seconds",
70
+ "video_frames_per_observed_wall_second",
71
+ ]
72
+
73
+ GROUP_FIELDS = [
74
+ "fragment_set_label",
75
+ "fragment_count",
76
+ "direct_start_count",
77
+ "calibrated_start_count",
78
+ "first_capture_start_utc",
79
+ "last_creation_boundary_utc",
80
+ "recording_elapsed_seconds_sum",
81
+ "group_wall_span_seconds",
82
+ "within_group_gap_seconds_sum",
83
+ "within_uncertainty_gap_count",
84
+ "documented_group_finish_date",
85
+ "documented_group_finish_time",
86
+ "group_finish_delta_seconds",
87
+ "group_finish_crosscheck_status",
88
+ "source_hub_revision",
89
+ "notes",
90
+ ]
91
+
92
+ MODEL_ID = "tla-framelapse-android14-tag5-empirical-v1"
93
+ MODEL_INTERCEPT = Decimal("0.8")
94
+ MODEL_FRAME_NUMERATOR = Decimal(7)
95
+ MODEL_FRAME_DENOMINATOR = Decimal(30)
96
+ LOCAL_ZONE_NAME = "America/New_York"
97
+ LOCAL_ZONE = ZoneInfo(LOCAL_ZONE_NAME)
98
+ EXPECTED_ROWS = 186
99
+ EXPECTED_GROUPS = 25
100
+ EXPECTED_DIRECT = 22
101
+ EXPECTED_CALIBRATED = 164
102
+ EXPECTED_TRANSITIONS = 161
103
+ EXPECTED_SOURCE_REVISION = "b4b58f0ce0effb31ebf7671fbb0bd9c11765db4e"
104
+ EXPECTED_SOURCE_SCHEMA_SHA256 = "3624d5858bd4c0df796775ee6400106eb146101acbf112a515ad4a49c3262082"
105
+ EXPECTED_SOURCE_SCHEMA_SIZE = 19411
106
+ EXPECTED_CONFLICT_GROUP = "2026-09-01.0213.BallpointPen.Ink.Paper.9x12"
107
+ EXPECTED_CONFLICT_DELTA = Decimal(43221)
108
+ EXPECTED_RELATIONSHIP_PATHS = {
109
+ f"Standard_Time_Lapses/Provenance/{date}/fragment_sequence_relationships.csv"
110
+ for date in (
111
+ "2026-08-27",
112
+ "2026-08-29",
113
+ "2026-08-30",
114
+ "2026-08-31",
115
+ "2026-09-01",
116
+ "2026-09-02",
117
+ )
118
+ }
119
+
120
+ RECORD_RE = re.compile(r"^tla-[0-9a-f]{16}$")
121
+ HASH_RE = re.compile(r"^[0-9a-f]{64}$")
122
+ REVISION_RE = re.compile(r"^[0-9a-f]{40}$")
123
+ DEVICE_FILENAME_RE = re.compile(
124
+ r"^VID_(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(\d{2})\.mp4$"
125
+ )
126
+
127
+
128
+ def read_csv(path: Path) -> tuple[list[str], list[dict[str, str]]]:
129
+ with path.open("r", encoding="utf-8-sig", newline="") as handle:
130
+ reader = csv.DictReader(handle)
131
+ if not reader.fieldnames:
132
+ raise ValueError(f"missing CSV header: {path}")
133
+ return list(reader.fieldnames), list(reader)
134
+
135
+
136
+ def read_json(path: Path) -> dict[str, object]:
137
+ value = json.loads(path.read_text(encoding="utf-8"))
138
+ if not isinstance(value, dict):
139
+ raise ValueError(f"JSON root must be an object: {path}")
140
+ return value
141
+
142
+
143
+ def sha256_file(path: Path) -> str:
144
+ digest = hashlib.sha256()
145
+ with path.open("rb") as handle:
146
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
147
+ digest.update(chunk)
148
+ return digest.hexdigest()
149
+
150
+
151
+ def parse_decimal(text: str, label: str, errors: list[str]) -> Decimal | None:
152
+ try:
153
+ value = Decimal(text)
154
+ except (InvalidOperation, ValueError):
155
+ errors.append(f"{label}: invalid decimal {text!r}")
156
+ return None
157
+ if not value.is_finite():
158
+ errors.append(f"{label}: decimal is not finite")
159
+ return None
160
+ return value
161
+
162
+
163
+ def parse_int(text: str, label: str, errors: list[str]) -> int | None:
164
+ try:
165
+ value = int(text)
166
+ except ValueError:
167
+ errors.append(f"{label}: invalid integer {text!r}")
168
+ return None
169
+ return value
170
+
171
+
172
+ def parse_timestamp(text: str, label: str, errors: list[str]) -> datetime | None:
173
+ try:
174
+ value = datetime.fromisoformat(text.replace("Z", "+00:00"))
175
+ except ValueError:
176
+ errors.append(f"{label}: invalid ISO-8601 timestamp {text!r}")
177
+ return None
178
+ if value.tzinfo is None:
179
+ errors.append(f"{label}: timestamp has no UTC offset")
180
+ return None
181
+ return value
182
+
183
+
184
+ def device_filename_timestamp(
185
+ source_filename: str, label: str, errors: list[str]
186
+ ) -> datetime | None:
187
+ match = DEVICE_FILENAME_RE.fullmatch(source_filename)
188
+ if not match:
189
+ errors.append(f"{label}: invalid retained device filename")
190
+ return None
191
+ year, month, day, hour, minute, second = map(int, match.groups())
192
+ try:
193
+ return datetime(year, month, day, hour, minute, second, tzinfo=LOCAL_ZONE)
194
+ except ValueError:
195
+ errors.append(f"{label}: invalid date/time in retained device filename")
196
+ return None
197
+
198
+
199
+ def close_decimal(
200
+ actual: Decimal | None,
201
+ expected: Decimal,
202
+ tolerance: Decimal,
203
+ label: str,
204
+ errors: list[str],
205
+ ) -> None:
206
+ if actual is not None and abs(actual - expected) > tolerance:
207
+ errors.append(f"{label}: expected {expected}, found {actual}")
208
+
209
+
210
+ def close_timestamp(
211
+ actual: datetime | None,
212
+ expected: datetime,
213
+ tolerance_seconds: float,
214
+ label: str,
215
+ errors: list[str],
216
+ ) -> None:
217
+ if actual is None:
218
+ return
219
+ difference = abs((actual.astimezone(timezone.utc) - expected.astimezone(timezone.utc)).total_seconds())
220
+ if difference > tolerance_seconds:
221
+ errors.append(f"{label}: timestamp differs by {difference:.6f} seconds")
222
+
223
+
224
+ def decimal_mean(values: list[Decimal]) -> Decimal:
225
+ return sum(values, Decimal(0)) / Decimal(len(values))
226
+
227
+
228
+ def decimal_population_standard_deviation(values: list[Decimal]) -> Decimal:
229
+ mean = decimal_mean(values)
230
+ variance = sum((value - mean) ** 2 for value in values) / Decimal(len(values))
231
+ return variance.sqrt()
232
+
233
+
234
+ def decimal_root_mean_square(values: list[Decimal]) -> Decimal:
235
+ mean_square = sum(value**2 for value in values) / Decimal(len(values))
236
+ return mean_square.sqrt()
237
+
238
+
239
+ def validate_metric_block(
240
+ block: object,
241
+ expected: dict[str, Decimal],
242
+ tolerance: Decimal,
243
+ label: str,
244
+ errors: list[str],
245
+ ) -> None:
246
+ if not isinstance(block, dict):
247
+ errors.append(f"{label} is missing")
248
+ return
249
+ if set(block) != set(expected):
250
+ errors.append(
251
+ f"{label} fields differ: expected {sorted(expected)}, found {sorted(block)}"
252
+ )
253
+ for name, expected_value in expected.items():
254
+ close_decimal(
255
+ parse_decimal(str(block.get(name, "")), f"{label} {name}", errors),
256
+ expected_value,
257
+ tolerance,
258
+ f"{label} {name}",
259
+ errors,
260
+ )
261
+
262
+
263
+ def validate_bundle(timing_dir: Path, errors: list[str]) -> None:
264
+ bundle_path = timing_dir / "bundle.sha256"
265
+ if not bundle_path.is_file():
266
+ errors.append("bundle.sha256 is missing")
267
+ return
268
+ expected_files = {
269
+ path.name for path in timing_dir.iterdir() if path.is_file() and path.name != "bundle.sha256"
270
+ }
271
+ listed_files: set[str] = set()
272
+ for line_number, line in enumerate(
273
+ bundle_path.read_text(encoding="utf-8").splitlines(), start=1
274
+ ):
275
+ match = re.fullmatch(r"([0-9a-f]{64}) ([^/\\]+)", line)
276
+ if not match:
277
+ errors.append(f"bundle.sha256 line {line_number}: malformed entry")
278
+ continue
279
+ expected_hash, name = match.groups()
280
+ if name in listed_files:
281
+ errors.append(f"bundle.sha256: duplicate entry {name}")
282
+ continue
283
+ listed_files.add(name)
284
+ target = timing_dir / name
285
+ if not target.is_file():
286
+ errors.append(f"bundle.sha256: missing listed file {name}")
287
+ elif sha256_file(target) != expected_hash:
288
+ errors.append(f"bundle.sha256: SHA-256 mismatch for {name}")
289
+ if listed_files != expected_files:
290
+ errors.append(
291
+ "bundle.sha256 inventory differs from directory files: "
292
+ f"listed={sorted(listed_files)} actual={sorted(expected_files)}"
293
+ )
294
+
295
+
296
+ def validate_source_receipts(
297
+ root: Path,
298
+ manifest: dict[str, object],
299
+ errors: list[str],
300
+ ) -> list[dict[str, str]]:
301
+ if manifest.get("packet_status") != "exploratory_public_derived_sidecar_v1":
302
+ errors.append("source_manifest packet_status is unexpected")
303
+ if manifest.get("dataset") != "maxwellinked/time-lapse-artifacts":
304
+ errors.append("source_manifest dataset is unexpected")
305
+ if manifest.get("pinned_dataset_revision") != EXPECTED_SOURCE_REVISION:
306
+ errors.append("source_manifest pinned_dataset_revision is unexpected")
307
+
308
+ canonical_metadata = manifest.get("canonical_metadata")
309
+ if not isinstance(canonical_metadata, dict):
310
+ errors.append("source_manifest canonical_metadata is missing")
311
+ return []
312
+ if canonical_metadata.get("file_path") != "metadata.csv":
313
+ errors.append("source_manifest canonical metadata path is unexpected")
314
+ metadata_path = root / str(canonical_metadata.get("file_path", ""))
315
+ if not metadata_path.is_file():
316
+ errors.append(f"pinned metadata source is missing: {metadata_path}")
317
+ return []
318
+ metadata_fields, metadata_rows = read_csv(metadata_path)
319
+ if sha256_file(metadata_path) != canonical_metadata.get("sha256"):
320
+ errors.append("metadata.csv differs from the source_manifest receipt")
321
+ if metadata_path.stat().st_size != canonical_metadata.get("size_bytes"):
322
+ errors.append("metadata.csv byte size differs from the source_manifest receipt")
323
+ if len(metadata_fields) != canonical_metadata.get("field_count"):
324
+ errors.append("metadata.csv field count differs from the source_manifest receipt")
325
+ if len(metadata_rows) != canonical_metadata.get("row_count"):
326
+ errors.append("metadata.csv row count differs from the source_manifest receipt")
327
+
328
+ source_snapshot_schema = manifest.get("source_snapshot_schema")
329
+ if not isinstance(source_snapshot_schema, dict):
330
+ errors.append("source_manifest source_snapshot_schema is missing")
331
+ else:
332
+ if source_snapshot_schema.get("file_path") != "SCHEMA.md":
333
+ errors.append("source snapshot schema path is unexpected")
334
+ if source_snapshot_schema.get("sha256") != EXPECTED_SOURCE_SCHEMA_SHA256:
335
+ errors.append("source snapshot schema SHA-256 receipt is unexpected")
336
+ if source_snapshot_schema.get("size_bytes") != EXPECTED_SOURCE_SCHEMA_SIZE:
337
+ errors.append("source snapshot schema byte-size receipt is unexpected")
338
+
339
+ relationship_rows: list[dict[str, str]] = []
340
+ relationship_sidecars = manifest.get("relationship_sidecars")
341
+ if not isinstance(relationship_sidecars, list) or len(relationship_sidecars) != 6:
342
+ errors.append("source_manifest must list six relationship sidecars")
343
+ return relationship_rows
344
+ listed_paths = {
345
+ str(receipt.get("file_path", ""))
346
+ for receipt in relationship_sidecars
347
+ if isinstance(receipt, dict)
348
+ }
349
+ if listed_paths != EXPECTED_RELATIONSHIP_PATHS:
350
+ errors.append("source_manifest relationship path set is unexpected")
351
+ for receipt in relationship_sidecars:
352
+ if not isinstance(receipt, dict):
353
+ errors.append("source_manifest relationship receipt is not an object")
354
+ continue
355
+ relative_path = str(receipt.get("file_path", ""))
356
+ sidecar_path = root / relative_path
357
+ if not sidecar_path.is_file():
358
+ errors.append(f"relationship sidecar is missing: {relative_path}")
359
+ continue
360
+ _, rows = read_csv(sidecar_path)
361
+ relationship_rows.extend(rows)
362
+ if sha256_file(sidecar_path) != receipt.get("sha256"):
363
+ errors.append(f"relationship sidecar SHA-256 mismatch: {relative_path}")
364
+ if sidecar_path.stat().st_size != receipt.get("size_bytes"):
365
+ errors.append(f"relationship sidecar byte-size mismatch: {relative_path}")
366
+ if len(rows) != receipt.get("row_count"):
367
+ errors.append(f"relationship sidecar row-count mismatch: {relative_path}")
368
+ role_counts = dict(Counter(row.get("object_role", "") for row in rows))
369
+ if role_counts != receipt.get("object_role_counts"):
370
+ errors.append(f"relationship sidecar role counts mismatch: {relative_path}")
371
+ revisions = {row.get("source_hub_revision", "") for row in rows}
372
+ if revisions != {receipt.get("source_hub_revision")}:
373
+ errors.append(f"relationship sidecar source revision mismatch: {relative_path}")
374
+ return relationship_rows
375
+
376
+
377
+ def validate_local_audit_receipts(
378
+ manifest: dict[str, object], errors: list[str]
379
+ ) -> dict[str, int]:
380
+ receipts = manifest.get("local_source_audits")
381
+ if not isinstance(receipts, list) or len(receipts) != 7:
382
+ errors.append("source_manifest must list seven retained local audit receipts")
383
+ return {}
384
+ canonical_counts: dict[str, int] = {}
385
+ total_rows = 0
386
+ total_roles: Counter[str] = Counter()
387
+ for receipt in receipts:
388
+ if not isinstance(receipt, dict):
389
+ errors.append("source_manifest local audit receipt is not an object")
390
+ continue
391
+ audit_id = str(receipt.get("source_audit_id", ""))
392
+ if not audit_id or audit_id in canonical_counts:
393
+ errors.append(f"duplicate or blank source_audit_id: {audit_id!r}")
394
+ continue
395
+ if receipt.get("availability") != "retained_locally_not_bundled":
396
+ errors.append(f"{audit_id}: local audit availability is unexpected")
397
+ digest = receipt.get("sha256")
398
+ if not isinstance(digest, str) or not HASH_RE.fullmatch(digest):
399
+ errors.append(f"{audit_id}: local audit SHA-256 receipt is malformed")
400
+ if not isinstance(receipt.get("size_bytes"), int) or receipt["size_bytes"] <= 0:
401
+ errors.append(f"{audit_id}: local audit byte-size receipt is malformed")
402
+ revision = receipt.get("base_hub_revision")
403
+ if not isinstance(revision, str) or not REVISION_RE.fullmatch(revision):
404
+ errors.append(f"{audit_id}: local audit base revision is malformed")
405
+ row_count = receipt.get("row_count")
406
+ role_counts = receipt.get("object_role_counts")
407
+ if not isinstance(row_count, int) or not isinstance(role_counts, dict):
408
+ errors.append(f"{audit_id}: local audit counts are malformed")
409
+ continue
410
+ if any(not isinstance(value, int) or value < 0 for value in role_counts.values()):
411
+ errors.append(f"{audit_id}: local audit role counts are malformed")
412
+ continue
413
+ if sum(role_counts.values()) != row_count:
414
+ errors.append(f"{audit_id}: local audit role counts do not sum to row_count")
415
+ total_rows += row_count
416
+ total_roles.update(role_counts)
417
+ canonical_counts[audit_id] = int(role_counts.get("canonical_fragment", 0))
418
+ if total_rows != 191 or total_roles != Counter(
419
+ {"canonical_fragment": EXPECTED_ROWS, "noncanonical_inshot_derivative": 5}
420
+ ):
421
+ errors.append("local audit receipt aggregate counts are unexpected")
422
+ expected_scope = {
423
+ "audit_rows": 191,
424
+ "relationship_rows": 191,
425
+ "canonical_fragment_rows": EXPECTED_ROWS,
426
+ "excluded_noncanonical_derivative_rows": 5,
427
+ "fragment_groups": EXPECTED_GROUPS,
428
+ }
429
+ if manifest.get("source_scope") != expected_scope:
430
+ errors.append("source_manifest source_scope differs")
431
+ return canonical_counts
432
+
433
+
434
+ def main() -> None:
435
+ parser = argparse.ArgumentParser()
436
+ parser.add_argument("--root", type=Path, default=Path("."))
437
+ parser.add_argument("--timing-dir", type=Path)
438
+ args = parser.parse_args()
439
+
440
+ root = args.root.resolve()
441
+ timing_dir = (
442
+ args.timing_dir.resolve()
443
+ if args.timing_dir
444
+ else root / "Standard_Time_Lapses" / "Provenance" / "Recording_Timing"
445
+ )
446
+ errors: list[str] = []
447
+
448
+ required_files = {
449
+ "README.md",
450
+ "SCHEMA.md",
451
+ "recording_timing.csv",
452
+ "calibration_observations.csv",
453
+ "group_timing_summary.csv",
454
+ "calibration_model.json",
455
+ "source_manifest.json",
456
+ "validation_summary.json",
457
+ "bundle.sha256",
458
+ }
459
+ missing = sorted(name for name in required_files if not (timing_dir / name).is_file())
460
+ if missing:
461
+ raise SystemExit(f"missing timing files: {missing}")
462
+
463
+ timing_fields, timing_rows = read_csv(timing_dir / "recording_timing.csv")
464
+ calibration_fields, calibration_rows = read_csv(
465
+ timing_dir / "calibration_observations.csv"
466
+ )
467
+ group_fields, group_rows = read_csv(timing_dir / "group_timing_summary.csv")
468
+ model = read_json(timing_dir / "calibration_model.json")
469
+ manifest = read_json(timing_dir / "source_manifest.json")
470
+ validation = read_json(timing_dir / "validation_summary.json")
471
+
472
+ if timing_fields != TIMING_FIELDS:
473
+ errors.append(f"recording_timing.csv field contract differs: {timing_fields}")
474
+ if calibration_fields != CALIBRATION_FIELDS:
475
+ errors.append(
476
+ f"calibration_observations.csv field contract differs: {calibration_fields}"
477
+ )
478
+ if group_fields != GROUP_FIELDS:
479
+ errors.append(f"group_timing_summary.csv field contract differs: {group_fields}")
480
+ if len(timing_rows) != EXPECTED_ROWS:
481
+ errors.append(f"expected {EXPECTED_ROWS} timing rows, found {len(timing_rows)}")
482
+ if len(calibration_rows) != EXPECTED_DIRECT:
483
+ errors.append(
484
+ f"expected {EXPECTED_DIRECT} calibration rows, found {len(calibration_rows)}"
485
+ )
486
+ if len(group_rows) != EXPECTED_GROUPS:
487
+ errors.append(f"expected {EXPECTED_GROUPS} group rows, found {len(group_rows)}")
488
+
489
+ relationship_rows = validate_source_receipts(root, manifest, errors)
490
+ expected_audit_counts = validate_local_audit_receipts(manifest, errors)
491
+ _, metadata_rows = read_csv(root / "metadata.csv")
492
+ metadata_by_id = {row["record_id"]: row for row in metadata_rows}
493
+ canonical_relationships = {
494
+ row["record_id"]: row
495
+ for row in relationship_rows
496
+ if row.get("object_role") == "canonical_fragment"
497
+ }
498
+ if len(canonical_relationships) != EXPECTED_ROWS:
499
+ errors.append(
500
+ f"expected {EXPECTED_ROWS} canonical relationship rows, "
501
+ f"found {len(canonical_relationships)}"
502
+ )
503
+
504
+ for field in ("record_id", "file_path", "sha256", "hub_xet_hash"):
505
+ values = [row.get(field, "") for row in timing_rows]
506
+ if not all(values) or len(values) != len(set(values)):
507
+ errors.append(f"{field} values must be nonblank and unique")
508
+
509
+ timing_by_id = {row["record_id"]: row for row in timing_rows}
510
+ groups: dict[str, list[dict[str, str]]] = defaultdict(list)
511
+ basis_counts: Counter[str] = Counter()
512
+ profile_counts: Counter[str] = Counter()
513
+ audit_counts: Counter[str] = Counter()
514
+ serialized_elapsed_values: list[Decimal] = []
515
+ unrounded_elapsed_values: list[Decimal] = []
516
+
517
+ for row_number, row in enumerate(timing_rows, start=2):
518
+ label = f"recording_timing.csv row {row_number} {row.get('record_id', '')}"
519
+ record_id = row.get("record_id", "")
520
+ if not RECORD_RE.fullmatch(record_id):
521
+ errors.append(f"{label}: invalid record_id")
522
+ if not HASH_RE.fullmatch(row.get("sha256", "")):
523
+ errors.append(f"{label}: invalid ordinary SHA-256")
524
+ if not HASH_RE.fullmatch(row.get("hub_xet_hash", "")):
525
+ errors.append(f"{label}: invalid Xet identity")
526
+ if not REVISION_RE.fullmatch(row.get("source_hub_revision", "")):
527
+ errors.append(f"{label}: invalid source_hub_revision")
528
+
529
+ relationship = canonical_relationships.get(record_id)
530
+ metadata = metadata_by_id.get(record_id)
531
+ if relationship is None:
532
+ errors.append(f"{label}: record_id is absent from canonical relationships")
533
+ else:
534
+ for timing_name, relationship_name in (
535
+ ("file_path", "file_path"),
536
+ ("sha256", "sha256"),
537
+ ("hub_xet_hash", "hub_xet_hash"),
538
+ ("fragment_set_label", "fragment_set_label"),
539
+ ("sequence_position", "sequence_position"),
540
+ ("sequence_count", "sequence_count"),
541
+ ("source_hub_revision", "source_hub_revision"),
542
+ ):
543
+ if row.get(timing_name) != relationship.get(relationship_name):
544
+ errors.append(f"{label}: {timing_name} differs from relationship source")
545
+ if metadata is None:
546
+ errors.append(f"{label}: record_id is absent from metadata.csv")
547
+ else:
548
+ if row.get("file_path") != metadata.get("file_name"):
549
+ errors.append(f"{label}: file_path differs from metadata.csv")
550
+ if row.get("hub_xet_hash") != metadata.get("hub_xet_hash"):
551
+ errors.append(f"{label}: hub_xet_hash differs from metadata.csv")
552
+ if relationship is not None:
553
+ if relationship.get("file_path") != metadata.get("file_name"):
554
+ errors.append(f"{label}: relationship path differs from metadata.csv")
555
+ if relationship.get("hub_xet_hash") != metadata.get("hub_xet_hash"):
556
+ errors.append(f"{label}: relationship Xet identity differs from metadata.csv")
557
+ if relationship.get("size_bytes") != metadata.get("size_bytes"):
558
+ errors.append(f"{label}: relationship byte size differs from metadata.csv")
559
+ if row.get("documented_group_finish_date") != metadata.get("date"):
560
+ errors.append(f"{label}: documented finish date differs from metadata.csv")
561
+ if row.get("documented_group_finish_time") != metadata.get("time"):
562
+ errors.append(f"{label}: documented finish time differs from metadata.csv")
563
+
564
+ if row.get("format_creation_time_utc") != row.get("video_creation_time_utc"):
565
+ errors.append(f"{label}: format/video creation_time values differ")
566
+ if row.get("capture_fps_tag_literal") != "5.000000":
567
+ errors.append(f"{label}: literal capture tag is not preserved")
568
+ if row.get("local_time_zone") != LOCAL_ZONE_NAME:
569
+ errors.append(f"{label}: unexpected local time zone")
570
+ if row.get("timing_model_id") != MODEL_ID:
571
+ errors.append(f"{label}: unexpected timing model ID")
572
+
573
+ frames = parse_int(row.get("video_frame_count", ""), label, errors)
574
+ if frames is not None and frames <= 0:
575
+ errors.append(f"{label}: video_frame_count must be positive")
576
+ boundary = parse_timestamp(
577
+ row.get("format_creation_time_utc", ""), f"{label} creation boundary", errors
578
+ )
579
+ boundary_local = parse_timestamp(
580
+ row.get("format_creation_time_local", ""), f"{label} local boundary", errors
581
+ )
582
+ if boundary is not None and boundary_local is not None:
583
+ close_timestamp(
584
+ boundary_local,
585
+ boundary,
586
+ 0.001,
587
+ f"{label} local/UTC creation boundary",
588
+ errors,
589
+ )
590
+ capture_start = parse_timestamp(
591
+ row.get("capture_start_time_utc", ""), f"{label} capture start", errors
592
+ )
593
+ capture_start_local = parse_timestamp(
594
+ row.get("capture_start_time_local", ""),
595
+ f"{label} local capture start",
596
+ errors,
597
+ )
598
+ if capture_start is not None and capture_start_local is not None:
599
+ close_timestamp(
600
+ capture_start_local,
601
+ capture_start,
602
+ 0.001,
603
+ f"{label} local/UTC capture start",
604
+ errors,
605
+ )
606
+
607
+ basis = row.get("timing_basis", "")
608
+ profile = row.get("calibration_profile_status", "")
609
+ basis_counts[basis] += 1
610
+ profile_counts[profile] += 1
611
+ audit_counts[row.get("source_audit_id", "")] += 1
612
+ elapsed = parse_decimal(
613
+ row.get("recording_elapsed_seconds", ""), f"{label} elapsed", errors
614
+ )
615
+ uncertainty = parse_decimal(
616
+ row.get("start_uncertainty_seconds", ""),
617
+ f"{label} start uncertainty",
618
+ errors,
619
+ )
620
+ if elapsed is not None:
621
+ serialized_elapsed_values.append(elapsed)
622
+ if basis == "direct_device_filename_start":
623
+ if profile != "calibration_observation":
624
+ errors.append(f"{label}: direct row has unexpected profile status")
625
+ direct_start = device_filename_timestamp(row.get("source_filename", ""), label, errors)
626
+ retained_start = parse_timestamp(
627
+ row.get("device_filename_start_local", ""),
628
+ f"{label} retained filename timestamp",
629
+ errors,
630
+ )
631
+ if direct_start is not None:
632
+ close_timestamp(
633
+ retained_start,
634
+ direct_start,
635
+ 0.001,
636
+ f"{label} retained filename timestamp",
637
+ errors,
638
+ )
639
+ close_timestamp(
640
+ capture_start,
641
+ direct_start,
642
+ 0.001,
643
+ f"{label} selected direct start",
644
+ errors,
645
+ )
646
+ if boundary is not None:
647
+ expected_elapsed = Decimal(
648
+ str(
649
+ (
650
+ boundary.astimezone(timezone.utc)
651
+ - direct_start.astimezone(timezone.utc)
652
+ ).total_seconds()
653
+ )
654
+ )
655
+ unrounded_elapsed_values.append(expected_elapsed)
656
+ close_decimal(
657
+ elapsed,
658
+ expected_elapsed,
659
+ Decimal("0.001"),
660
+ f"{label} direct elapsed",
661
+ errors,
662
+ )
663
+ close_decimal(
664
+ uncertainty,
665
+ Decimal(1),
666
+ Decimal(0),
667
+ f"{label} direct uncertainty",
668
+ errors,
669
+ )
670
+ elif basis == "calibrated_frame_model":
671
+ if profile != "observable_profile_match_only":
672
+ errors.append(f"{label}: calibrated row has unexpected profile status")
673
+ if row.get("device_filename_start_local"):
674
+ errors.append(f"{label}: calibrated row has a device filename start")
675
+ if frames is not None:
676
+ expected_elapsed = (
677
+ MODEL_INTERCEPT
678
+ + Decimal(frames) * MODEL_FRAME_NUMERATOR / MODEL_FRAME_DENOMINATOR
679
+ )
680
+ unrounded_elapsed_values.append(expected_elapsed)
681
+ close_decimal(
682
+ elapsed,
683
+ expected_elapsed,
684
+ Decimal("0.0006"),
685
+ f"{label} calibrated elapsed",
686
+ errors,
687
+ )
688
+ if boundary is not None and capture_start is not None:
689
+ expected_start = boundary - timedelta(seconds=float(expected_elapsed))
690
+ close_timestamp(
691
+ capture_start,
692
+ expected_start,
693
+ 0.001,
694
+ f"{label} calibrated start",
695
+ errors,
696
+ )
697
+ close_decimal(
698
+ uncertainty,
699
+ Decimal(2),
700
+ Decimal(0),
701
+ f"{label} calibrated uncertainty",
702
+ errors,
703
+ )
704
+ else:
705
+ errors.append(f"{label}: invalid timing_basis {basis!r}")
706
+
707
+ evidence = row.get("timing_evidence_state", "")
708
+ evidence_tokens = evidence.split(";") if evidence else []
709
+ if not evidence_tokens or len(evidence_tokens) != len(set(evidence_tokens)):
710
+ errors.append(f"{label}: timing_evidence_state is blank or duplicated")
711
+ if "capture-fps-tag-preserved-not-used" not in evidence_tokens:
712
+ errors.append(f"{label}: evidence does not state capture tag non-use")
713
+
714
+ groups[row.get("fragment_set_label", "")].append(row)
715
+
716
+ if basis_counts != Counter(
717
+ {
718
+ "direct_device_filename_start": EXPECTED_DIRECT,
719
+ "calibrated_frame_model": EXPECTED_CALIBRATED,
720
+ }
721
+ ):
722
+ errors.append(f"unexpected timing_basis counts: {dict(basis_counts)}")
723
+ if profile_counts != Counter(
724
+ {
725
+ "calibration_observation": EXPECTED_DIRECT,
726
+ "observable_profile_match_only": EXPECTED_CALIBRATED,
727
+ }
728
+ ):
729
+ errors.append(f"unexpected calibration_profile_status counts: {dict(profile_counts)}")
730
+ if dict(audit_counts) != expected_audit_counts:
731
+ errors.append(
732
+ f"source_audit_id counts differ from retained receipts: {dict(audit_counts)}"
733
+ )
734
+ if len(groups) != EXPECTED_GROUPS:
735
+ errors.append(f"expected {EXPECTED_GROUPS} timing groups, found {len(groups)}")
736
+
737
+ gap_counts: Counter[str] = Counter()
738
+ conflict_groups: dict[str, Decimal] = {}
739
+ near_finish_deltas: list[Decimal] = []
740
+ computed_group_rows: dict[str, dict[str, Decimal | int | str]] = {}
741
+ transition_count = 0
742
+ for group_label, rows in groups.items():
743
+ rows.sort(key=lambda item: int(item["sequence_position"]))
744
+ positions = [int(row["sequence_position"]) for row in rows]
745
+ counts = {int(row["sequence_count"]) for row in rows}
746
+ if positions != list(range(1, len(rows) + 1)) or counts != {len(rows)}:
747
+ errors.append(f"{group_label}: sequence positions/count are not contiguous")
748
+ if len({row["source_hub_revision"] for row in rows}) != 1:
749
+ errors.append(f"{group_label}: mixed source_hub_revision values")
750
+ finish_pairs = {
751
+ (row["documented_group_finish_date"], row["documented_group_finish_time"])
752
+ for row in rows
753
+ }
754
+ if len(finish_pairs) != 1:
755
+ errors.append(f"{group_label}: mixed documented group finish values")
756
+ continue
757
+ finish_date, finish_time = next(iter(finish_pairs))
758
+ try:
759
+ documented_finish = datetime.strptime(
760
+ f"{finish_date} {finish_time}", "%Y-%m-%d %H:%M"
761
+ ).replace(tzinfo=LOCAL_ZONE)
762
+ except ValueError:
763
+ errors.append(f"{group_label}: invalid documented group finish")
764
+ continue
765
+ final_boundary = parse_timestamp(
766
+ rows[-1]["format_creation_time_utc"], f"{group_label} final boundary", errors
767
+ )
768
+ if final_boundary is None:
769
+ continue
770
+ expected_finish_delta = Decimal(
771
+ str(
772
+ (
773
+ final_boundary.astimezone(timezone.utc)
774
+ - documented_finish.astimezone(timezone.utc)
775
+ ).total_seconds()
776
+ )
777
+ )
778
+ expected_finish_status = (
779
+ "near_documented_finish_minute"
780
+ if abs(expected_finish_delta) <= Decimal(120)
781
+ else "documented_finish_conflict"
782
+ )
783
+ for row in rows:
784
+ close_decimal(
785
+ parse_decimal(
786
+ row["group_finish_delta_seconds"],
787
+ f"{group_label} finish delta",
788
+ errors,
789
+ ),
790
+ expected_finish_delta,
791
+ Decimal("0.001"),
792
+ f"{group_label} finish delta",
793
+ errors,
794
+ )
795
+ if row["group_finish_crosscheck_status"] != expected_finish_status:
796
+ errors.append(f"{group_label}: incorrect finish crosscheck status")
797
+ if expected_finish_status == "documented_finish_conflict":
798
+ conflict_groups[group_label] = expected_finish_delta
799
+ else:
800
+ near_finish_deltas.append(abs(expected_finish_delta))
801
+
802
+ elapsed_sum = Decimal(0)
803
+ gap_sum = Decimal(0)
804
+ first_start: datetime | None = None
805
+ previous_boundary: datetime | None = None
806
+ previous_record_id = ""
807
+ within_uncertainty_count = 0
808
+ for index, row in enumerate(rows):
809
+ elapsed_value = parse_decimal(
810
+ row["recording_elapsed_seconds"], f"{group_label} elapsed", errors
811
+ )
812
+ if elapsed_value is not None:
813
+ elapsed_sum += elapsed_value
814
+ start = parse_timestamp(
815
+ row["capture_start_time_utc"], f"{group_label} capture start", errors
816
+ )
817
+ boundary = parse_timestamp(
818
+ row["format_creation_time_utc"], f"{group_label} boundary", errors
819
+ )
820
+ if index == 0:
821
+ first_start = start
822
+ if row["previous_record_id"] or row["inter_fragment_gap_seconds"] or row["gap_uncertainty_seconds"]:
823
+ errors.append(f"{group_label}: first row has previous/gap values")
824
+ if row["gap_status"] != "blank_for_first":
825
+ errors.append(f"{group_label}: first row gap_status is not blank_for_first")
826
+ else:
827
+ transition_count += 1
828
+ if row["previous_record_id"] != previous_record_id:
829
+ errors.append(f"{group_label}: previous_record_id chain is broken")
830
+ if start is not None and previous_boundary is not None:
831
+ expected_gap = Decimal(
832
+ str(
833
+ (
834
+ start.astimezone(timezone.utc)
835
+ - previous_boundary.astimezone(timezone.utc)
836
+ ).total_seconds()
837
+ )
838
+ )
839
+ gap = parse_decimal(
840
+ row["inter_fragment_gap_seconds"], f"{group_label} gap", errors
841
+ )
842
+ close_decimal(
843
+ gap,
844
+ expected_gap,
845
+ Decimal("0.001"),
846
+ f"{group_label} gap",
847
+ errors,
848
+ )
849
+ if gap is not None:
850
+ gap_sum += gap
851
+ uncertainty = Decimal(
852
+ 2 if row["timing_basis"] == "direct_device_filename_start" else 3
853
+ )
854
+ close_decimal(
855
+ parse_decimal(
856
+ row["gap_uncertainty_seconds"],
857
+ f"{group_label} gap uncertainty",
858
+ errors,
859
+ ),
860
+ uncertainty,
861
+ Decimal(0),
862
+ f"{group_label} gap uncertainty",
863
+ errors,
864
+ )
865
+ expected_gap_status = (
866
+ "negative_beyond_uncertainty"
867
+ if expected_gap < -uncertainty
868
+ else "within_uncertainty_of_zero"
869
+ if abs(expected_gap) <= uncertainty
870
+ else "positive_above_uncertainty"
871
+ )
872
+ if row["gap_status"] != expected_gap_status:
873
+ errors.append(f"{group_label}: incorrect gap_status")
874
+ if expected_gap_status == "within_uncertainty_of_zero":
875
+ within_uncertainty_count += 1
876
+ gap_counts[row["gap_status"]] += 1
877
+ previous_boundary = boundary
878
+ previous_record_id = row["record_id"]
879
+
880
+ if first_start is not None:
881
+ wall_span = Decimal(
882
+ str(
883
+ (
884
+ final_boundary.astimezone(timezone.utc)
885
+ - first_start.astimezone(timezone.utc)
886
+ ).total_seconds()
887
+ )
888
+ )
889
+ if abs(wall_span - elapsed_sum - gap_sum) > Decimal("0.01"):
890
+ errors.append(f"{group_label}: elapsed + gaps does not equal wall span")
891
+ computed_group_rows[group_label] = {
892
+ "fragment_count": len(rows),
893
+ "direct_start_count": sum(
894
+ row["timing_basis"] == "direct_device_filename_start" for row in rows
895
+ ),
896
+ "calibrated_start_count": sum(
897
+ row["timing_basis"] == "calibrated_frame_model" for row in rows
898
+ ),
899
+ "elapsed_sum": elapsed_sum,
900
+ "gap_sum": gap_sum,
901
+ "wall_span": wall_span,
902
+ "within_uncertainty_count": within_uncertainty_count,
903
+ "finish_delta": expected_finish_delta,
904
+ "finish_status": expected_finish_status,
905
+ }
906
+
907
+ if transition_count != EXPECTED_TRANSITIONS:
908
+ errors.append(
909
+ f"expected {EXPECTED_TRANSITIONS} transitions, found {transition_count}"
910
+ )
911
+ expected_gap_counts = Counter(
912
+ {"positive_above_uncertainty": 159, "within_uncertainty_of_zero": 2}
913
+ )
914
+ if gap_counts != expected_gap_counts:
915
+ errors.append(f"unexpected transition gap counts: {dict(gap_counts)}")
916
+ if conflict_groups != {EXPECTED_CONFLICT_GROUP: EXPECTED_CONFLICT_DELTA}:
917
+ errors.append(f"unexpected finish conflicts: {conflict_groups}")
918
+
919
+ group_by_label = {row["fragment_set_label"]: row for row in group_rows}
920
+ if len(group_by_label) != len(group_rows):
921
+ errors.append("group_timing_summary.csv has duplicate fragment_set_label values")
922
+ for group_label, computed in computed_group_rows.items():
923
+ row = group_by_label.get(group_label)
924
+ if row is None:
925
+ errors.append(f"group summary is missing {group_label}")
926
+ continue
927
+ for field, key in (
928
+ ("fragment_count", "fragment_count"),
929
+ ("direct_start_count", "direct_start_count"),
930
+ ("calibrated_start_count", "calibrated_start_count"),
931
+ ("within_uncertainty_gap_count", "within_uncertainty_count"),
932
+ ):
933
+ if int(row[field]) != computed[key]:
934
+ errors.append(f"{group_label}: group summary {field} differs")
935
+ for field, key in (
936
+ ("recording_elapsed_seconds_sum", "elapsed_sum"),
937
+ ("within_group_gap_seconds_sum", "gap_sum"),
938
+ ("group_wall_span_seconds", "wall_span"),
939
+ ("group_finish_delta_seconds", "finish_delta"),
940
+ ):
941
+ close_decimal(
942
+ parse_decimal(row[field], f"{group_label} summary {field}", errors),
943
+ computed[key],
944
+ Decimal("0.01"),
945
+ f"{group_label} summary {field}",
946
+ errors,
947
+ )
948
+ if row["group_finish_crosscheck_status"] != computed["finish_status"]:
949
+ errors.append(f"{group_label}: group summary finish status differs")
950
+
951
+ calibration_by_id = {row["record_id"]: row for row in calibration_rows}
952
+ if len(calibration_by_id) != EXPECTED_DIRECT:
953
+ errors.append("calibration observations have duplicate record IDs")
954
+ residuals: list[Decimal] = []
955
+ no_intercept_residuals: list[Decimal] = []
956
+ wall_frame_rates: list[Decimal] = []
957
+ nominal_five_errors: list[Decimal] = []
958
+ for record_id, calibration in calibration_by_id.items():
959
+ timing = timing_by_id.get(record_id)
960
+ label = f"calibration {record_id}"
961
+ if timing is None or timing.get("timing_basis") != "direct_device_filename_start":
962
+ errors.append(f"{label}: does not join to a direct timing row")
963
+ continue
964
+ if calibration["file_path"] != timing["file_path"] or calibration["source_filename"] != timing["source_filename"]:
965
+ errors.append(f"{label}: identity fields differ from timing row")
966
+ start = parse_timestamp(calibration["direct_start_utc"], f"{label} start", errors)
967
+ boundary = parse_timestamp(
968
+ calibration["creation_boundary_utc"], f"{label} boundary", errors
969
+ )
970
+ frames = parse_int(calibration["video_frame_count"], label, errors)
971
+ if start is None or boundary is None or frames is None:
972
+ continue
973
+ observed = Decimal(str((boundary - start).total_seconds()))
974
+ nominal = Decimal(frames) / Decimal(5)
975
+ modeled = MODEL_INTERCEPT + Decimal(frames) * MODEL_FRAME_NUMERATOR / MODEL_FRAME_DENOMINATOR
976
+ residual = observed - modeled
977
+ residuals.append(residual)
978
+ no_intercept_residuals.append(
979
+ observed - Decimal(frames) * MODEL_FRAME_NUMERATOR / MODEL_FRAME_DENOMINATOR
980
+ )
981
+ wall_frame_rates.append(Decimal(frames) / observed)
982
+ nominal_five_errors.append(observed - nominal)
983
+ for field, expected, tolerance in (
984
+ ("observed_elapsed_seconds", observed, Decimal("0.001")),
985
+ ("nominal_five_fps_elapsed_seconds", nominal, Decimal("0.001")),
986
+ ("nominal_five_fps_error_seconds", observed - nominal, Decimal("0.001")),
987
+ ("model_elapsed_seconds", modeled, Decimal("0.0006")),
988
+ ("model_residual_seconds", residual, Decimal("0.0006")),
989
+ ):
990
+ close_decimal(
991
+ parse_decimal(calibration[field], f"{label} {field}", errors),
992
+ expected,
993
+ tolerance,
994
+ f"{label} {field}",
995
+ errors,
996
+ )
997
+ effective = Decimal(frames) / observed
998
+ close_decimal(
999
+ parse_decimal(
1000
+ calibration["video_frames_per_observed_wall_second"],
1001
+ f"{label} video frames per observed wall second",
1002
+ errors,
1003
+ ),
1004
+ effective,
1005
+ Decimal("0.000001"),
1006
+ f"{label} video frames per observed wall second",
1007
+ errors,
1008
+ )
1009
+
1010
+ if model.get("model_id") != MODEL_ID:
1011
+ errors.append("calibration_model.json has an unexpected model_id")
1012
+ if model.get("status") != "revision_pinned_exploratory_in_sample_calibration":
1013
+ errors.append("calibration_model.json has an unexpected status")
1014
+ if model.get("source_dataset_revision") != EXPECTED_SOURCE_REVISION:
1015
+ errors.append("calibration_model.json source revision differs")
1016
+ if model.get("formula") != (
1017
+ "estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30"
1018
+ ):
1019
+ errors.append("calibration_model.json formula differs")
1020
+ constants = model.get("constants")
1021
+ if not isinstance(constants, dict):
1022
+ errors.append("calibration_model.json constants are missing")
1023
+ else:
1024
+ expected_constants = {
1025
+ "empirical_intercept_seconds": float(MODEL_INTERCEPT),
1026
+ "seconds_per_frame_numerator": int(MODEL_FRAME_NUMERATOR),
1027
+ "seconds_per_frame_denominator": int(MODEL_FRAME_DENOMINATOR),
1028
+ }
1029
+ if constants != expected_constants:
1030
+ errors.append(f"calibration model constants differ: {constants}")
1031
+ calibration_model_section = model.get("calibration")
1032
+ if not isinstance(calibration_model_section, dict):
1033
+ errors.append("calibration_model.json calibration section is missing")
1034
+ else:
1035
+ if calibration_model_section.get("sample_count") != EXPECTED_DIRECT:
1036
+ errors.append("calibration model sample_count differs")
1037
+ if calibration_model_section.get("group_count") != 5:
1038
+ errors.append("calibration model group_count differs")
1039
+ if calibration_model_section.get("holdout_count") != 0:
1040
+ errors.append("calibration model must state that no holdout exists")
1041
+ if len(residuals) == EXPECTED_DIRECT:
1042
+ validate_metric_block(
1043
+ calibration_model_section.get(
1044
+ "model_residual_seconds_observed_minus_estimated"
1045
+ ),
1046
+ {
1047
+ "minimum": min(residuals),
1048
+ "maximum": max(residuals),
1049
+ "mean": decimal_mean(residuals),
1050
+ "standard_deviation_population": decimal_population_standard_deviation(
1051
+ residuals
1052
+ ),
1053
+ "root_mean_square": decimal_root_mean_square(residuals),
1054
+ "maximum_absolute": max(abs(value) for value in residuals),
1055
+ },
1056
+ Decimal("0.0000006"),
1057
+ "calibration model residual metrics",
1058
+ errors,
1059
+ )
1060
+ validate_metric_block(
1061
+ calibration_model_section.get(
1062
+ "no_offset_seven_thirtieths_residual_seconds"
1063
+ ),
1064
+ {
1065
+ "minimum": min(no_intercept_residuals),
1066
+ "maximum": max(no_intercept_residuals),
1067
+ "mean": decimal_mean(no_intercept_residuals),
1068
+ },
1069
+ Decimal("0.0000006"),
1070
+ "calibration no-intercept residual metrics",
1071
+ errors,
1072
+ )
1073
+ validate_metric_block(
1074
+ calibration_model_section.get(
1075
+ "video_frames_per_observed_wall_second"
1076
+ ),
1077
+ {
1078
+ "minimum": min(wall_frame_rates),
1079
+ "maximum": max(wall_frame_rates),
1080
+ "mean": decimal_mean(wall_frame_rates),
1081
+ "standard_deviation_population": decimal_population_standard_deviation(
1082
+ wall_frame_rates
1083
+ ),
1084
+ },
1085
+ Decimal("0.00000006"),
1086
+ "calibration video-frames-per-observed-wall-second metrics",
1087
+ errors,
1088
+ )
1089
+ validate_metric_block(
1090
+ calibration_model_section.get(
1091
+ "nominal_five_fps_error_seconds_observed_minus_n_over_5"
1092
+ ),
1093
+ {
1094
+ "minimum": min(nominal_five_errors),
1095
+ "maximum": max(nominal_five_errors),
1096
+ "mean": decimal_mean(nominal_five_errors),
1097
+ },
1098
+ Decimal("0.0006"),
1099
+ "calibration nominal-five-fps error metrics",
1100
+ errors,
1101
+ )
1102
+
1103
+ application = model.get("application")
1104
+ if not isinstance(application, dict):
1105
+ errors.append("calibration_model.json application section is missing")
1106
+ else:
1107
+ expected_application_values = {
1108
+ "direct_start_rows": EXPECTED_DIRECT,
1109
+ "calibrated_estimate_rows": EXPECTED_CALIBRATED,
1110
+ "direct_filename_timestamp_resolution_allowance_seconds": 1,
1111
+ "estimated_start_uncertainty_seconds": 2,
1112
+ "calibrated_gap_uncertainty_seconds": 3,
1113
+ }
1114
+ for name, expected in expected_application_values.items():
1115
+ if application.get(name) != expected:
1116
+ errors.append(f"calibration application {name} differs")
1117
+ if not isinstance(application.get("profile_match_fields"), list) or len(
1118
+ application["profile_match_fields"]
1119
+ ) != 8:
1120
+ errors.append("calibration application profile-match declaration differs")
1121
+
1122
+ if validation.get("status") != "pass_with_one_preserved_documented_finish_conflict":
1123
+ errors.append("validation_summary status differs")
1124
+ if validation.get("verification_level") != "repository_packet_self_consistency":
1125
+ errors.append("validation_summary verification level differs")
1126
+ counts = validation.get("counts")
1127
+ if not isinstance(counts, dict):
1128
+ errors.append("validation_summary counts are missing")
1129
+ else:
1130
+ expected_counts = {
1131
+ "canonical_timing_rows": EXPECTED_ROWS,
1132
+ "direct_device_filename_start_rows": EXPECTED_DIRECT,
1133
+ "calibrated_frame_model_rows": EXPECTED_CALIBRATED,
1134
+ "calibration_groups": 5,
1135
+ "fragment_groups": EXPECTED_GROUPS,
1136
+ "inter_fragment_transitions": EXPECTED_TRANSITIONS,
1137
+ "excluded_noncanonical_derivatives": 5,
1138
+ }
1139
+ if counts != expected_counts:
1140
+ errors.append(f"validation_summary counts differ: {counts}")
1141
+ if validation.get("pinned_dataset_revision") != EXPECTED_SOURCE_REVISION:
1142
+ errors.append("validation_summary pinned revision differs")
1143
+
1144
+ expected_repository_checks = {
1145
+ "timing_relationship_record_id_path_sets_equal": True,
1146
+ "timing_relationship_record_id_path_sha256_xet_matches": True,
1147
+ "canonical_metadata_record_id_size_xet_matches": True,
1148
+ "canonical_record_ids_paths_sha256_unique": True,
1149
+ "format_video_creation_times_equal": True,
1150
+ "exact_literal_capture_tag_preserved": "5.000000",
1151
+ "literal_capture_tag_used_in_timing_formula": False,
1152
+ }
1153
+ if validation.get("repository_identity_and_source_checks") != expected_repository_checks:
1154
+ errors.append("validation_summary repository identity/source checks differ")
1155
+
1156
+ expected_local_claims = {
1157
+ "audit_relationship_path_sets_equal": True,
1158
+ "audit_record_id_sha256_size_matches": True,
1159
+ "all_rows_same_observable_technical_profile": True,
1160
+ }
1161
+ if validation.get("retained_local_audit_claims_not_reperformed") != expected_local_claims:
1162
+ errors.append("validation_summary retained local-audit claims differ")
1163
+
1164
+ calibration_checks = validation.get("calibration_checks")
1165
+ if not isinstance(calibration_checks, dict):
1166
+ errors.append("validation_summary calibration_checks is missing")
1167
+ else:
1168
+ expected_calibration_values = {
1169
+ "model_id": MODEL_ID,
1170
+ "formula": "estimated_elapsed_seconds = 0.8 + video_frame_count * 7 / 30",
1171
+ "direct_observation_count": EXPECTED_DIRECT,
1172
+ "holdout_count": 0,
1173
+ }
1174
+ for name, expected in expected_calibration_values.items():
1175
+ if calibration_checks.get(name) != expected:
1176
+ errors.append(f"validation_summary calibration {name} differs")
1177
+ if residuals:
1178
+ close_decimal(
1179
+ parse_decimal(
1180
+ str(calibration_checks.get("maximum_absolute_model_residual_seconds", "")),
1181
+ "validation_summary maximum absolute residual",
1182
+ errors,
1183
+ ),
1184
+ max(abs(value) for value in residuals),
1185
+ Decimal("0.0000006"),
1186
+ "validation_summary maximum absolute residual",
1187
+ errors,
1188
+ )
1189
+ if nominal_five_errors:
1190
+ for name, expected in (
1191
+ ("nominal_five_fps_minimum_error_seconds", min(nominal_five_errors)),
1192
+ ("nominal_five_fps_maximum_error_seconds", max(nominal_five_errors)),
1193
+ ):
1194
+ close_decimal(
1195
+ parse_decimal(
1196
+ str(calibration_checks.get(name, "")),
1197
+ f"validation_summary {name}",
1198
+ errors,
1199
+ ),
1200
+ expected,
1201
+ Decimal("0.0006"),
1202
+ f"validation_summary {name}",
1203
+ errors,
1204
+ )
1205
+
1206
+ expected_chronology = {
1207
+ "groups_with_contiguous_positions": EXPECTED_GROUPS,
1208
+ "strictly_increasing_creation_boundaries_within_groups": True,
1209
+ "gaps_positive_above_uncertainty": gap_counts["positive_above_uncertainty"],
1210
+ "gaps_within_uncertainty_of_zero": gap_counts["within_uncertainty_of_zero"],
1211
+ "gaps_negative_beyond_uncertainty": gap_counts["negative_beyond_uncertainty"],
1212
+ }
1213
+ if validation.get("chronology_checks") != expected_chronology:
1214
+ errors.append("validation_summary chronology checks differ")
1215
+
1216
+ finish_summary = validation.get("documented_finish_crosscheck")
1217
+ if not isinstance(finish_summary, dict):
1218
+ errors.append("validation_summary documented finish crosscheck is missing")
1219
+ else:
1220
+ if finish_summary.get("threshold_seconds") != 120:
1221
+ errors.append("validation_summary finish threshold differs")
1222
+ if finish_summary.get("near_minute_groups") != len(near_finish_deltas):
1223
+ errors.append("validation_summary near-minute group count differs")
1224
+ if near_finish_deltas:
1225
+ close_decimal(
1226
+ parse_decimal(
1227
+ str(finish_summary.get("maximum_near_minute_delta_seconds", "")),
1228
+ "validation_summary maximum near-minute delta",
1229
+ errors,
1230
+ ),
1231
+ max(near_finish_deltas),
1232
+ Decimal("0.001"),
1233
+ "validation_summary maximum near-minute delta",
1234
+ errors,
1235
+ )
1236
+ conflicts = finish_summary.get("conflict_groups")
1237
+ if not isinstance(conflicts, list) or len(conflicts) != 1:
1238
+ errors.append("validation_summary conflict group receipt differs")
1239
+ else:
1240
+ conflict = conflicts[0]
1241
+ if not isinstance(conflict, dict):
1242
+ errors.append("validation_summary conflict group is malformed")
1243
+ else:
1244
+ if conflict.get("fragment_set_label") != EXPECTED_CONFLICT_GROUP:
1245
+ errors.append("validation_summary conflict label differs")
1246
+ close_decimal(
1247
+ parse_decimal(
1248
+ str(conflict.get("delta_seconds", "")),
1249
+ "validation_summary conflict delta",
1250
+ errors,
1251
+ ),
1252
+ EXPECTED_CONFLICT_DELTA,
1253
+ Decimal("0"),
1254
+ "validation_summary conflict delta",
1255
+ errors,
1256
+ )
1257
+
1258
+ serialized_total = sum(serialized_elapsed_values, Decimal(0))
1259
+ unrounded_total = sum(unrounded_elapsed_values, Decimal(0))
1260
+ aggregate = validation.get("aggregate_descriptors")
1261
+ if not isinstance(aggregate, dict):
1262
+ errors.append("validation_summary aggregate descriptors are missing")
1263
+ else:
1264
+ close_decimal(
1265
+ parse_decimal(
1266
+ str(aggregate.get("serialized_recording_elapsed_seconds_sum", "")),
1267
+ "validation_summary serialized elapsed sum",
1268
+ errors,
1269
+ ),
1270
+ serialized_total,
1271
+ Decimal("0"),
1272
+ "validation_summary serialized elapsed sum",
1273
+ errors,
1274
+ )
1275
+ close_decimal(
1276
+ parse_decimal(
1277
+ str(aggregate.get("serialized_recording_elapsed_hours_sum", "")),
1278
+ "validation_summary serialized elapsed hours",
1279
+ errors,
1280
+ ),
1281
+ serialized_total / Decimal(3600),
1282
+ Decimal("0.0000006"),
1283
+ "validation_summary serialized elapsed hours",
1284
+ errors,
1285
+ )
1286
+ note = aggregate.get("note")
1287
+ if not isinstance(note, str) or "0.001667 seconds" not in note:
1288
+ errors.append("validation_summary aggregate rounding note differs")
1289
+ close_decimal(
1290
+ unrounded_total,
1291
+ Decimal(1649602) / Decimal(15),
1292
+ Decimal("0.000000000000000000001"),
1293
+ "unrounded corpus elapsed total",
1294
+ errors,
1295
+ )
1296
+
1297
+ expected_immutability = {
1298
+ "metadata_csv_sha256_unchanged": True,
1299
+ "relationship_sidecar_hashes_unchanged": True,
1300
+ "canonical_metadata_field_count_unchanged": True,
1301
+ }
1302
+ if validation.get("immutability_checks") != expected_immutability:
1303
+ errors.append("validation_summary immutability checks differ")
1304
+
1305
+ expected_not_reperformed = {
1306
+ "source-media tag and frame-count probing",
1307
+ "source-media ordinary SHA-256 hashing",
1308
+ "retained local source-audit byte verification",
1309
+ "NTFS timestamp observation",
1310
+ }
1311
+ not_reperformed = validation.get("not_reperformed_by_repository_validator")
1312
+ if not isinstance(not_reperformed, list) or set(not_reperformed) != expected_not_reperformed:
1313
+ errors.append("validation_summary non-reperformed checks declaration differs")
1314
+
1315
+ validate_bundle(timing_dir, errors)
1316
+
1317
+ if errors:
1318
+ for error in errors:
1319
+ print(f"ERROR: {error}")
1320
+ raise SystemExit(f"recording timing validation failed with {len(errors)} error(s)")
1321
+
1322
+ print(
1323
+ json.dumps(
1324
+ {
1325
+ "status": "ok",
1326
+ "source_revision": EXPECTED_SOURCE_REVISION,
1327
+ "timing_rows": len(timing_rows),
1328
+ "direct_filename_timestamp_rows": basis_counts[
1329
+ "direct_device_filename_start"
1330
+ ],
1331
+ "calibrated_rows": basis_counts["calibrated_frame_model"],
1332
+ "groups": len(groups),
1333
+ "transitions": transition_count,
1334
+ "gap_status_counts": dict(gap_counts),
1335
+ "finish_conflicts": {
1336
+ key: float(value) for key, value in conflict_groups.items()
1337
+ },
1338
+ "bundle_files_verified": len(
1339
+ [
1340
+ path
1341
+ for path in timing_dir.iterdir()
1342
+ if path.is_file() and path.name != "bundle.sha256"
1343
+ ]
1344
+ ),
1345
+ },
1346
+ indent=2,
1347
+ sort_keys=True,
1348
+ )
1349
+ )
1350
+
1351
+
1352
+ if __name__ == "__main__":
1353
+ main()