Define prospective fragment-sequence protocol boundary

#46
Archive_Specifications.md CHANGED
@@ -2,22 +2,32 @@
2
 
3
  ## Scope and Protocol Version
4
 
5
- These specifications apply to recordings and drawings created beginning July
6
- 13, 2025 unless a metadata row documents a deviation.
7
-
8
- The corresponding metadata identifier is:
9
-
10
- ```text
11
- acquisition_protocol_version = standard-2025-07-13
12
- ```
13
-
14
- The identifier records the governing protocol. It does not imply that every
15
- published file has identical encoded dimensions, orientation, codec, audio, or
16
- post-processing history.
 
 
 
 
 
 
 
 
17
 
18
  ## Capture Configuration
19
 
20
- The owner-confirmed default workflow since July 13, 2025 is:
 
 
21
 
22
  - Device: Samsung Galaxy S23 Ultra, model `SM-S918U`
23
  - Application: Framelapse 2; observed current version 11.7
@@ -48,15 +58,20 @@ transformation should be asserted only when supported by provenance evidence.
48
 
49
  ### Acquisition evidence and canonical representation
50
 
51
- Framelapse source fragments are retained unchanged as acquisition evidence. A
52
- reviewed drawing may be represented canonically either by one selected
53
- chronological InShot assembly or by a complete, verified `RecNN` sequence of
54
- unchanged source fragments. In fragment-sequence mode, every source file has its
55
- own canonical metadata row while grouping, order, completeness, and derivative
56
- coverage remain in a separate noncanonical relationship manifest. This does not
57
- change the 29-field schema or retroactively redefine existing records. Dynamic
58
- browser previews and physical-reference photographs remain noncanonical access
59
- or evidence layers linked through persistent identity.
 
 
 
 
 
60
 
61
  A 2160 × 3840 portrait H.264, 30-fps InShot processing profile is documented as
62
  a candidate. It does not become a canonical protocol boundary until one complete
 
2
 
3
  ## Scope and Protocol Version
4
 
5
+ These specifications apply to recordings and drawings created beginning July
6
+ 13, 2025 unless a metadata row documents a deviation. Two protocol identifiers
7
+ now distinguish the canonical workflows:
8
+
9
+ - `standard-2025-07-13` — the earlier Standard workflow established July 13,
10
+ 2025.
11
+ - `standard-2026-08-27` — the prospective canonical fragment-sequence workflow
12
+ established August 27, 2026.
13
+
14
+ Protocol assignment is not a blanket finish-date cutover. In the current
15
+ index, `standard-2026-08-27` applies only to the 186 `canonical_fragment`
16
+ `record_id` values in the six dated relationship sidecars from August 27
17
+ through September 2, 2026. Every other Standard row remains
18
+ `standard-2025-07-13`, including the 19 historical `RecNN` rows outside those
19
+ sidecars. A `RecNN` filename suffix alone never assigns the prospective
20
+ protocol.
21
+
22
+ The identifier records the governing workflow. It does not imply that every
23
+ published file has identical encoded dimensions, orientation, codec, audio, or
24
+ post-processing history.
25
 
26
  ## Capture Configuration
27
 
28
+ The owner-confirmed capture default established under the earlier Standard
29
+ workflow, and inherited by the prospective fragment-sequence workflow unless a
30
+ row documents a deviation, is:
31
 
32
  - Device: Samsung Galaxy S23 Ultra, model `SM-S918U`
33
  - Application: Framelapse 2; observed current version 11.7
 
58
 
59
  ### Acquisition evidence and canonical representation
60
 
61
+ Framelapse source fragments are retained unchanged as acquisition evidence. A
62
+ reviewed drawing may be represented canonically either by one selected
63
+ chronological InShot assembly or by a complete, verified `RecNN` sequence of
64
+ unchanged source fragments. In fragment-sequence mode, every source file has its
65
+ own canonical metadata row while grouping, order, completeness, and derivative
66
+ coverage remain in a separate noncanonical relationship manifest. This does not
67
+ change the 29-field schema or retroactively redefine existing records. Dynamic
68
+ browser previews and physical-reference photographs remain noncanonical access
69
+ or evidence layers linked through persistent identity.
70
+
71
+ Under `standard-2026-08-27`, all `RecNN` members in one prospective grouping
72
+ share the documented finish date and finish time of the complete
73
+ grouping/physical work. That timestamp is not the individual end time of each
74
+ fragment. `RecNN` records chronological position within the group.
75
 
76
  A 2160 × 3840 portrait H.264, 30-fps InShot processing profile is documented as
77
  a candidate. It does not become a canonical protocol boundary until one complete
CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## Unreleased — September 2 complete fragment-sequence ingestion, second batch
4
 
5
  - Added 29 creator-confirmed, unchanged canonical Framelapse source fragments
 
1
  # Changelog
2
 
3
+ ## Unreleased — focused Standard protocol-version boundary
4
+
5
+ - Defined `standard-2025-07-13` as the earlier Standard workflow and
6
+ `standard-2026-08-27` as the prospective canonical fragment-sequence
7
+ workflow without changing the 29-field metadata schema.
8
+ - Applied `standard-2026-08-27` only to the 186 canonical-fragment
9
+ `record_id` values in the six dated relationship sidecars from August 27
10
+ through September 2, 2026. The remaining 363 Standard rows retain
11
+ `standard-2025-07-13`.
12
+ - Left all 19 historical `RecNN` rows outside those sidecars on
13
+ `standard-2025-07-13`; a `RecNN` suffix alone does not assign the prospective
14
+ protocol or establish reviewed grouping completeness.
15
+ - Defined prospective timestamp scope: all `RecNN` members in one grouping
16
+ share the documented finish date and finish time of the complete
17
+ grouping/physical work. The timestamp is not an individual fragment end
18
+ time; `RecNN` records chronological position within the group.
19
+ - Added validation for exact sidecar-to-protocol membership and shared
20
+ prospective grouping timestamps. No MP4, path, `record_id`, Xet identity,
21
+ byte size, technical field, provenance relationship, or `SHA256SUMS` payload
22
+ entry changed.
23
+
24
  ## Unreleased — September 2 complete fragment-sequence ingestion, second batch
25
 
26
  - Added 29 creator-confirmed, unchanged canonical Framelapse source fragments
README.md CHANGED
@@ -383,10 +383,12 @@ additions; metadata and release validation are required.
383
 
384
  Each canonical metadata row now includes:
385
 
386
- - a persistent `record_id`
387
- - `collection_tier = standard`
388
- - `is_canonical = true`
389
- - `acquisition_protocol_version = standard-2025-07-13`
 
 
390
  - descriptive session fields
391
  - encoded video properties
392
  - repository content hash and size
@@ -482,20 +484,27 @@ downloadable. See the [sidecar schema](Physical_References/SCHEMA.md) and
482
 
483
  ## Acquisition and Stored-Video Orientation
484
 
485
- The acquisition protocol effective July 13, 2025 is documented in
486
- `Archive_Specifications.md`. Framelapse source fragments remain unchanged
487
- acquisition evidence. For reviewed fragment ingestions, a drawing may be
488
- represented canonically either by one selected chronological assembly or by a
489
- complete, verified `RecNN` sequence of unchanged source fragments. Grouping,
490
- order, completeness, and noncanonical derivative coverage for those ingestions
491
- remain in separate dated relationship manifests; the active 29-field metadata
492
- schema is unchanged. The manifests do not backfill every historical `RecNN`
493
- record. Outside them, `RecNN` establishes recording order only, and any
494
- grouping or completeness claim is limited to evidence explicitly recorded in
495
- `notes` or other documentation. A documented 4K/30-fps InShot processing
496
- profile remains a candidate and does not retroactively redefine existing
497
- records. See the
498
- [capture and ingest protocol](Physical_References/CAPTURE_AND_INGEST_PROTOCOL.md).
 
 
 
 
 
 
 
499
 
500
  The dated relationship sidecars preserve each ingestion as a separate pinned
501
  observation layer. The
@@ -517,8 +526,9 @@ rows. The
517
  [`2026-09-02 sidecar`](Standard_Time_Lapses/Provenance/2026-09-02/fragment_sequence_relationships.csv)
518
  has 61 canonical fragments across five complete sequences and no derivative
519
  rows. In all six, `fragment_set_label` is a descriptive grouping label, not a
520
- global `work_id`. The nested derivative payloads are not included in the 677
521
- active rows or the active byte and duration totals.
 
522
 
523
  The protocol's capture orientation and a file's stored pixel orientation are
524
  different concepts. The `orientation`, `width_px`, and `height_px` metadata
@@ -720,8 +730,9 @@ For reproducible work:
720
  Run the included validator before publishing a metadata change:
721
 
722
  ```bash
723
- python tools/validate_metadata.py metadata.csv \
724
- --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv
 
725
  ```
726
 
727
  `tools/enrich_prestandard.py` reproduces the Pre-Standard technical fields
 
383
 
384
  Each canonical metadata row now includes:
385
 
386
+ - a persistent `record_id`
387
+ - `collection_tier = standard`
388
+ - `is_canonical = true`
389
+ - an `acquisition_protocol_version`: 363 earlier-workflow rows use
390
+ `standard-2025-07-13`, while the 186 canonical fragments in the six dated
391
+ relationship sidecars use `standard-2026-08-27`
392
  - descriptive session fields
393
  - encoded video properties
394
  - repository content hash and size
 
484
 
485
  ## Acquisition and Stored-Video Orientation
486
 
487
+ The earlier Standard workflow established July 13, 2025 is identified as
488
+ `standard-2025-07-13`. The prospective canonical fragment-sequence workflow
489
+ established August 27, 2026 is identified as `standard-2026-08-27`; this is a
490
+ sidecar-defined membership boundary, not a blanket finish-date cutover.
491
+ Framelapse source fragments remain unchanged acquisition evidence. For reviewed
492
+ fragment ingestions, a drawing may be represented canonically either by one
493
+ selected chronological assembly or by a complete, verified `RecNN` sequence of
494
+ unchanged source fragments. Grouping, order, completeness, and noncanonical
495
+ derivative coverage for those ingestions remain in separate dated relationship
496
+ manifests; the active 29-field metadata schema is unchanged.
497
+
498
+ All `RecNN` members in one prospective grouping share the documented finish
499
+ date and finish time of the complete grouping/physical work. The timestamp is
500
+ not the individual end time of each fragment; `RecNN` records chronological
501
+ position within the group. The manifests do not backfill every historical
502
+ `RecNN` record. The 19 historical `RecNN` rows outside the six sidecars retain
503
+ `standard-2025-07-13`; their grouping or completeness claims remain limited to
504
+ evidence explicitly recorded in `notes` or other documentation. A documented
505
+ 4K/30-fps InShot processing profile remains a candidate and does not
506
+ retroactively redefine existing records. See the
507
+ [capture and ingest protocol](Physical_References/CAPTURE_AND_INGEST_PROTOCOL.md).
508
 
509
  The dated relationship sidecars preserve each ingestion as a separate pinned
510
  observation layer. The
 
526
  [`2026-09-02 sidecar`](Standard_Time_Lapses/Provenance/2026-09-02/fragment_sequence_relationships.csv)
527
  has 61 canonical fragments across five complete sequences and no derivative
528
  rows. In all six, `fragment_set_label` is a descriptive grouping label, not a
529
+ global `work_id`. Together they identify exactly 186 canonical fragments for
530
+ `standard-2026-08-27`. The nested derivative payloads are not included in the
531
+ 677 active rows or the active byte and duration totals.
532
 
533
  The protocol's capture orientation and a file's stored pixel orientation are
534
  different concepts. The `orientation`, `width_px`, and `height_px` metadata
 
730
  Run the included validator before publishing a metadata change:
731
 
732
  ```bash
733
+ python tools/validate_metadata.py metadata.csv \
734
+ --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv \
735
+ --fragment-relationships-root Standard_Time_Lapses/Provenance
736
  ```
737
 
738
  `tools/enrich_prestandard.py` reproduces the Pre-Standard technical fields
SCHEMA.md CHANGED
@@ -30,7 +30,9 @@ Examples:
30
  orientation, such as `9x12` or `12x9`.
31
  - `RecNN` — optional recording-sequence identifier used when documented order
32
  must be preserved or otherwise identical filenames require distinction.
33
- Numbering begins with `Rec01` and may continue across finish dates.
 
 
34
  - `ext` — file extension.
35
 
36
  ### Filename rules
@@ -44,7 +46,10 @@ Examples:
44
  - `0000` is reserved for a documented midnight finish time.
45
  - `RecNN` identifies recording order only. It does not by itself establish a
46
  separate drawing, session, or completion state, and it does not reset merely
47
- because the documented finish date changes.
 
 
 
48
  - `UnknownTime` records uncertainty; it is not replaced by an inferred time.
49
  - Paper-surface variants such as `HotPress` and `ColdPress` may remain encoded
50
  in filenames until a dedicated metadata field is added.
@@ -82,7 +87,7 @@ legacy files canonical.
82
  | `record_id` | string | Persistent identity in the form `tla-` plus 16 lowercase hexadecimal characters. |
83
  | `collection_tier` | enum | `standard` for this index. |
84
  | `is_canonical` | boolean | `true` for every row in this index. |
85
- | `acquisition_protocol_version` | string | Protocol identifier; Standard rows use `standard-2025-07-13`. |
86
 
87
  The initial `record_id` values were generated from a namespaced SHA-256 of the
88
  published repository path. Once assigned, the stored value is authoritative and
@@ -108,8 +113,8 @@ uncertainty, not failed technical ingestion.
108
 
109
  | Field | Type | Meaning |
110
  | --- | --- | --- |
111
- | `date` | `YYYY-MM-DD` | Documented finish date label associated with the record; temporal scope is not normalized. |
112
- | `time` | `HH:MM` or blank | Documented finish time label associated with the record; blank means unknown and temporal scope is not normalized. |
113
  | `tool` | semicolon list | Ordered unique set of documented tools. |
114
  | `medium` | semicolon list | Ordered unique set of documented media. |
115
  | `support` | string | Physical drawing surface. |
@@ -128,11 +133,15 @@ to one value. A future paired representation should use a structured field and
128
  must be based on documented evidence rather than token position.
129
 
130
  `date` and `time` preserve the best documented finish labels associated with a
131
- row. The current 29-field schema does not distinguish whether the source
132
- documentation scoped a label to an individual recording, a recording session,
133
- a reviewed fragment sequence, or the physical work. Equal values, differing
134
- values, and `RecNN` suffixes do not resolve that scope. Use `notes` and
135
- revision-pinned sidecars only where they make a narrower claim.
 
 
 
 
136
 
137
  ### Encoded-video fields
138
 
@@ -251,6 +260,12 @@ belong to the same fragment set. Derivative rows and payloads remain outside
251
  the canonical metadata and Viewer configurations even when stored in the
252
  repository.
253
 
 
 
 
 
 
 
254
  Canonical-fragment evidence requires `owner-confirmed`, `checksum-computed`,
255
  `media-probed`, `demux-verified`, and `sampled-decode-verified`.
256
  `boundary-frame-verified` is included only when that separate visual check was
@@ -265,11 +280,17 @@ moving branch, placeholder, or inferred value is invalid. Remote inventory,
265
  Xet-identity, and relationship-join validation must be completed against that
266
  commit. The captured inventory also binds the exact bytes of that revision's
267
  `metadata.csv`, so a local join cannot substitute metadata from a different
268
- commit. A dated sidecar does not introduce `work_id`, backfill
269
- historical rows, change `standard-2025-07-13`, or create a new dataset version.
270
- Consequently, an active `RecNN` row absent from these dated sidecars has not
271
- been reviewed into this relationship layer; absence does not establish that no
272
- relationship exists.
 
 
 
 
 
 
273
 
274
  ## Physical-reference sidecar
275
 
@@ -323,6 +344,9 @@ Before publication, the validator must confirm:
323
  from both active indexes
324
  - fragment-sequence positions are contiguous and complete-sequence derivative
325
  source lists exactly match their own ordered fragment set
 
 
 
326
  - noncanonical derivative payloads remain absent from both active indexes and
327
  Viewer configurations
328
  - relationship paths, Xet identities, sizes, and canonical `record_id` joins
@@ -334,7 +358,8 @@ Run:
334
 
335
  ```bash
336
  python tools/validate_metadata.py metadata.csv \
337
- --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv
 
338
 
339
  python tools/validate_sha256sums.py SHA256SUMS \
340
  --repo-json repo_api_blobs.json \
 
30
  orientation, such as `9x12` or `12x9`.
31
  - `RecNN` — optional recording-sequence identifier used when documented order
32
  must be preserved or otherwise identical filenames require distinction.
33
+ Numbering begins with `Rec01`. Historical numbering may continue across
34
+ finish-date labels; the prospective protocol has the narrower timestamp rule
35
+ defined below.
36
  - `ext` — file extension.
37
 
38
  ### Filename rules
 
46
  - `0000` is reserved for a documented midnight finish time.
47
  - `RecNN` identifies recording order only. It does not by itself establish a
48
  separate drawing, session, or completion state, and it does not reset merely
49
+ because a historical documented finish-date label changes. Under
50
+ `standard-2026-08-27`, all members of one documented prospective grouping
51
+ instead share the grouping timestamp and `RecNN` records chronological
52
+ position within that group.
53
  - `UnknownTime` records uncertainty; it is not replaced by an inferred time.
54
  - Paper-surface variants such as `HotPress` and `ColdPress` may remain encoded
55
  in filenames until a dedicated metadata field is added.
 
87
  | `record_id` | string | Persistent identity in the form `tla-` plus 16 lowercase hexadecimal characters. |
88
  | `collection_tier` | enum | `standard` for this index. |
89
  | `is_canonical` | boolean | `true` for every row in this index. |
90
+ | `acquisition_protocol_version` | enum | Governing Standard workflow: `standard-2025-07-13` for the earlier Standard workflow or `standard-2026-08-27` for canonical fragments reviewed into the prospective fragment-sequence workflow. Assignment is based on documented sidecar membership, not finish date or a `RecNN` suffix alone. |
91
 
92
  The initial `record_id` values were generated from a namespaced SHA-256 of the
93
  published repository path. Once assigned, the stored value is authoritative and
 
113
 
114
  | Field | Type | Meaning |
115
  | --- | --- | --- |
116
+ | `date` | `YYYY-MM-DD` | Documented finish date. For `standard-2026-08-27`, this is the finish date of the complete grouping/physical work shared by every member; earlier records retain their historically documented label. |
117
+ | `time` | `HH:MM` or blank | Documented finish time; blank means unknown. For `standard-2026-08-27`, this is the finish time of the complete grouping/physical work shared by every member. |
118
  | `tool` | semicolon list | Ordered unique set of documented tools. |
119
  | `medium` | semicolon list | Ordered unique set of documented media. |
120
  | `support` | string | Physical drawing surface. |
 
133
  must be based on documented evidence rather than token position.
134
 
135
  `date` and `time` preserve the best documented finish labels associated with a
136
+ row. For the earlier Standard workflow, the current 29-field schema does not
137
+ distinguish whether the source documentation scoped a label to an individual
138
+ recording, a recording session, a reviewed fragment sequence, or the physical
139
+ work. Equal values, differing values, and `RecNN` suffixes do not resolve that
140
+ historical scope. For `standard-2026-08-27`, the scope is explicit: every
141
+ `RecNN` member in one prospective grouping carries the documented finish date
142
+ and finish time of the complete grouping/physical work. The timestamp is not
143
+ the individual end time of each fragment; `RecNN` records chronological
144
+ position within the group.
145
 
146
  ### Encoded-video fields
147
 
 
260
  the canonical metadata and Viewer configurations even when stored in the
261
  repository.
262
 
263
+ For canonical fragments governed by `standard-2026-08-27`, every member of a
264
+ `fragment_set_label` must have the same metadata `date` and `time`. Those values
265
+ document the finish of the complete grouping/physical work, not the individual
266
+ end time of each fragment. `sequence_position` and its matching `RecNN` suffix
267
+ carry chronological position.
268
+
269
  Canonical-fragment evidence requires `owner-confirmed`, `checksum-computed`,
270
  `media-probed`, `demux-verified`, and `sampled-decode-verified`.
271
  `boundary-frame-verified` is included only when that separate visual check was
 
280
  Xet-identity, and relationship-join validation must be completed against that
281
  commit. The captured inventory also binds the exact bytes of that revision's
282
  `metadata.csv`, so a local join cannot substitute metadata from a different
283
+ commit. The pinned receipt remains historical evidence and is not rewritten
284
+ when the active metadata later records a protocol boundary.
285
+
286
+ The canonical-fragment `record_id` values in the six sidecars dated
287
+ `2026-08-27`, `2026-08-29`, `2026-08-30`, `2026-08-31`, `2026-09-01`, and
288
+ `2026-09-02` are the current membership authority for
289
+ `standard-2026-08-27`. Noncanonical derivative rows do not receive a canonical
290
+ protocol value. A dated sidecar does not introduce `work_id`, change any
291
+ `record_id`, or backfill unrelated historical rows. Consequently, an active
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
 
 
344
  from both active indexes
345
  - fragment-sequence positions are contiguous and complete-sequence derivative
346
  source lists exactly match their own ordered fragment set
347
+ - `standard-2026-08-27` appears on exactly the canonical-fragment IDs in the
348
+ supplied dated sidecars, every other Standard row remains
349
+ `standard-2025-07-13`, and each prospective group shares one finish timestamp
350
  - noncanonical derivative payloads remain absent from both active indexes and
351
  Viewer configurations
352
  - relationship paths, Xet identities, sizes, and canonical `record_id` joins
 
358
 
359
  ```bash
360
  python tools/validate_metadata.py metadata.csv \
361
+ --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv \
362
+ --fragment-relationships-root Standard_Time_Lapses/Provenance
363
 
364
  python tools/validate_sha256sums.py SHA256SUMS \
365
  --repo-json repo_api_blobs.json \
VALIDATION.md CHANGED
@@ -1,6 +1,48 @@
1
- # Validation Report
2
-
3
- ## Scope and publication boundary
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  Hugging Face PR #45 begins at exact Hub `main` revision
6
  `81d5675113fcd5e26eac0289c228f7ccfe552e42`. It adds 29 unchanged canonical
@@ -204,16 +246,17 @@ visual authentication of absent media.
204
 
205
  ## Regression tests
206
 
207
- The dependency-free suites currently run 30 tests covering repository receipt
208
- binding, fragment-size joins and verification levels, semantic documentation
209
- and metadata invariants, and physical-reference identity, hash-state, pairing,
210
- manifest, and metadata-join failures.
 
211
 
212
  ```bash
213
  python -m unittest discover -s tools -p "test_*.py"
214
  ```
215
 
216
- Result: **30/30 passed**.
217
 
218
  ## Outstanding curator questions and limitations
219
 
@@ -221,11 +264,14 @@ These remain explicit; validation must not guess their answers:
221
 
222
  1. One Pre-Standard record has no support token or independent support evidence;
223
  its `support` remains blank and its `notes` state the limitation.
224
- 2. The current schema does not normalize whether a documented finish label
225
- applies to a recording, session, reviewed fragment sequence, or physical work.
 
 
226
  3. Nineteen active Standard `RecNN` rows are outside the six dated fragment
227
- sidecars. Their existing notes and changelog evidence remain authoritative;
228
- sidecar absence does not establish no relationship or sequence completeness.
 
229
  4. Twenty-seven physical-reference rows retain explicit conflict evidence.
230
  Conflict language is an adjudication queue, not proof that 27 canonical
231
  timestamps are wrong.
@@ -243,8 +289,9 @@ These remain explicit; validation must not guess their answers:
243
  Validate both active indexes locally:
244
 
245
  ```bash
246
- python tools/validate_metadata.py metadata.csv \
247
- --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv
 
248
  ```
249
 
250
  Validate the payload checksum manifest against a blob-enabled repository
@@ -268,13 +315,16 @@ python tools/capture_hub_inventory.py \
268
  --validation-file metadata.csv \
269
  --validation-file Pre_Standard_Time_Lapses/metadata.csv
270
 
271
- python tools/validate_metadata.py metadata.csv \
272
- --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv \
273
- --repo-inventory-json repo_inventory_xet.json
 
274
  ```
275
 
276
- Validate the dated fragment sidecars separately because each preserves its own
277
- source revision:
 
 
278
 
279
  ```bash
280
  python tools/validate_fragment_relationships.py \
@@ -285,24 +335,24 @@ python tools/validate_fragment_relationships.py \
285
  --relationships Standard_Time_Lapses/Provenance/2026-08-29/fragment_sequence_relationships.csv \
286
  --metadata metadata.csv
287
 
288
- python tools/validate_fragment_relationships.py \
289
- --relationships Standard_Time_Lapses/Provenance/2026-08-30/fragment_sequence_relationships.csv \
290
- --metadata metadata.csv \
291
- --repo-inventory-json repo_inventory_7293edcc.json
292
 
293
- python tools/validate_fragment_relationships.py \
294
- --relationships Standard_Time_Lapses/Provenance/2026-08-31/fragment_sequence_relationships.csv \
295
- --metadata metadata.csv \
296
- --repo-inventory-json repo_inventory_480bc7e2.json
297
 
298
  python tools/validate_fragment_relationships.py \
299
  --relationships Standard_Time_Lapses/Provenance/2026-09-01/fragment_sequence_relationships.csv \
300
- --metadata metadata.csv \
301
  --repo-inventory-json repo_inventory_fe66d1db.json
302
 
303
  python tools/validate_fragment_relationships.py \
304
  --relationships Standard_Time_Lapses/Provenance/2026-09-02/fragment_sequence_relationships.csv \
305
- --metadata metadata.csv \
306
  --repo-inventory-json repo_inventory_7fca6fcc.json
307
  ```
308
 
 
1
+ # Validation Report
2
+
3
+ ## Current local protocol-boundary candidate
4
+
5
+ Branch `codex/protocol-version-boundary-2026-08-27` starts at exact Hub `main`
6
+ revision `9cfe7996247900b3b3f69ef3cc78cf54ce734266`. The candidate is local only;
7
+ it has not been pushed, merged, tagged, or released. No MP4 was materialized in
8
+ the working checkout.
9
+
10
+ The focused change keeps the 29-field schema and assigns protocol versions from
11
+ documented relationship membership rather than a date cutoff or filename
12
+ inference:
13
+
14
+ | Check | Result |
15
+ | --- | ---: |
16
+ | Canonical Standard rows | 549 |
17
+ | Earlier workflow, `standard-2025-07-13` | 363 |
18
+ | Prospective workflow, `standard-2026-08-27` | 186 |
19
+ | Dated fragment sidecars | 6 |
20
+ | Prospective groupings with one shared finish timestamp | 25 / 25 |
21
+ | Historical `RecNN` rows outside the sidecars, retained on the earlier protocol | 19 / 19 |
22
+ | Metadata columns before / after | 29 / 29 |
23
+ | Non-protocol metadata field changes | 0 |
24
+ | MP4 path or payload changes | 0 |
25
+ | Relationship-sidecar changes | 0 |
26
+ | `SHA256SUMS` byte changes | 0 |
27
+ | Regression tests | 35 / 35 passed |
28
+
29
+ The candidate `metadata.csv` remains 370,833 bytes and has ordinary SHA-256
30
+ `d516da7a4341dddf0b2b5ad50f6200f283ea0cdefc6de465882fbc021abfba8a`.
31
+ Exactly 186 `acquisition_protocol_version` values changed; every other field in
32
+ every row is byte-for-byte equivalent after CSV parsing. In particular, all
33
+ `record_id`, `file_name`, `hub_xet_hash`, `size_bytes`, encoded-video fields,
34
+ and provenance fields are unchanged. `SHA256SUMS` remains byte-identical at
35
+ SHA-256 `21e9c6dd4cb976754a73201cf5a5dcab8b4402a03781b9afe9ae8ea5f2c4b351`.
36
+
37
+ The metadata validator passed against the base revision's 732-file Hub
38
+ inventory with zero path, Xet-identity, or size mismatches. All six fragment
39
+ sidecars passed both current structural/metadata joins and their original
40
+ pinned-revision inventory checks using the metadata bytes from each declared
41
+ `source_hub_revision`. Checksum coverage passed for all 683 payloads (682 MP4
42
+ and one ZIP), totaling 2,100,077,836,521 bytes. The 309-row physical-reference
43
+ relationship validation also passed against its pinned source metadata.
44
+
45
+ ## Scope and publication boundary
46
 
47
  Hugging Face PR #45 begins at exact Hub `main` revision
48
  `81d5675113fcd5e26eac0289c228f7ccfe552e42`. It adds 29 unchanged canonical
 
246
 
247
  ## Regression tests
248
 
249
+ The dependency-free suites currently run 35 tests covering repository receipt
250
+ binding, fragment-size joins and verification levels, semantic documentation
251
+ and metadata invariants, the exact protocol-version boundary and prospective
252
+ timestamp scope, and physical-reference identity, hash-state, pairing, manifest,
253
+ and metadata-join failures.
254
 
255
  ```bash
256
  python -m unittest discover -s tools -p "test_*.py"
257
  ```
258
 
259
+ Result: **35/35 passed**.
260
 
261
  ## Outstanding curator questions and limitations
262
 
 
264
 
265
  1. One Pre-Standard record has no support token or independent support evidence;
266
  its `support` remains blank and its `notes` state the limitation.
267
+ 2. The earlier Standard and Pre-Standard workflows do not normalize whether a
268
+ documented finish label applies to a recording, session, reviewed fragment
269
+ sequence, or physical work. Under `standard-2026-08-27`, the scope is the
270
+ complete prospective grouping/physical work.
271
  3. Nineteen active Standard `RecNN` rows are outside the six dated fragment
272
+ sidecars and retain `standard-2025-07-13`. Their existing notes and changelog
273
+ evidence remain authoritative; sidecar absence does not establish no
274
+ relationship or sequence completeness.
275
  4. Twenty-seven physical-reference rows retain explicit conflict evidence.
276
  Conflict language is an adjudication queue, not proof that 27 canonical
277
  timestamps are wrong.
 
289
  Validate both active indexes locally:
290
 
291
  ```bash
292
+ python tools/validate_metadata.py metadata.csv \
293
+ --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv \
294
+ --fragment-relationships-root Standard_Time_Lapses/Provenance
295
  ```
296
 
297
  Validate the payload checksum manifest against a blob-enabled repository
 
315
  --validation-file metadata.csv \
316
  --validation-file Pre_Standard_Time_Lapses/metadata.csv
317
 
318
+ python tools/validate_metadata.py metadata.csv \
319
+ --pre-standard-metadata Pre_Standard_Time_Lapses/metadata.csv \
320
+ --fragment-relationships-root Standard_Time_Lapses/Provenance \
321
+ --repo-inventory-json repo_inventory_xet.json
322
  ```
323
 
324
+ Validate the dated fragment sidecars against current metadata for structural
325
+ joins. For a pinned-inventory check, use the exact historical `metadata.csv`
326
+ downloaded from that sidecar's `source_hub_revision`; substituting the current
327
+ metadata bytes would invalidate the receipt:
328
 
329
  ```bash
330
  python tools/validate_fragment_relationships.py \
 
335
  --relationships Standard_Time_Lapses/Provenance/2026-08-29/fragment_sequence_relationships.csv \
336
  --metadata metadata.csv
337
 
338
+ python tools/validate_fragment_relationships.py \
339
+ --relationships Standard_Time_Lapses/Provenance/2026-08-30/fragment_sequence_relationships.csv \
340
+ --metadata pinned/7293edccff883b4c604d710addbf26c85910cfcc/metadata.csv \
341
+ --repo-inventory-json repo_inventory_7293edcc.json
342
 
343
+ python tools/validate_fragment_relationships.py \
344
+ --relationships Standard_Time_Lapses/Provenance/2026-08-31/fragment_sequence_relationships.csv \
345
+ --metadata pinned/480bc7e24261e6d3bbcacd261a00782b7e40211a/metadata.csv \
346
+ --repo-inventory-json repo_inventory_480bc7e2.json
347
 
348
  python tools/validate_fragment_relationships.py \
349
  --relationships Standard_Time_Lapses/Provenance/2026-09-01/fragment_sequence_relationships.csv \
350
+ --metadata pinned/fe66d1dbb117486c2046376423316fd2cc25d488/metadata.csv \
351
  --repo-inventory-json repo_inventory_fe66d1db.json
352
 
353
  python tools/validate_fragment_relationships.py \
354
  --relationships Standard_Time_Lapses/Provenance/2026-09-02/fragment_sequence_relationships.csv \
355
+ --metadata pinned/7fca6fcc36d873b92a6c64fff5980e8d5afde5a6/metadata.csv \
356
  --repo-inventory-json repo_inventory_7fca6fcc.json
357
  ```
358
 
metadata.csv CHANGED
The diff for this file is too large to render. See raw diff
 
tools/test_semantic_consistency.py CHANGED
@@ -4,12 +4,16 @@
4
  from __future__ import annotations
5
 
6
  import csv
 
7
  import re
 
8
  import unittest
9
  from pathlib import Path
 
10
 
11
 
12
  ROOT = Path(__file__).resolve().parents[1]
 
13
 
14
 
15
  def read_rows(path: Path) -> list[dict[str, str]]:
@@ -17,6 +21,18 @@ def read_rows(path: Path) -> list[dict[str, str]]:
17
  return list(csv.DictReader(handle))
18
 
19
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  class SemanticConsistencyTests(unittest.TestCase):
21
  @classmethod
22
  def setUpClass(cls) -> None:
@@ -24,6 +40,40 @@ class SemanticConsistencyTests(unittest.TestCase):
24
  cls.pre_standard_rows = read_rows(
25
  ROOT / "Pre_Standard_Time_Lapses" / "metadata.csv"
26
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  def test_pre_standard_tool_medium_contract_is_independent(self) -> None:
29
  schema = (ROOT / "Pre_Standard_Time_Lapses" / "SCHEMA.md").read_text(
@@ -63,6 +113,109 @@ class SemanticConsistencyTests(unittest.TestCase):
63
  self.assertEqual(row["support"], "IllustrationBoard")
64
  self.assertIn(".IllustrationBoard.30x40.", row["file_name"])
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  def test_readme_audio_count_matches_active_indexes(self) -> None:
67
  active = self.standard_rows + self.pre_standard_rows
68
  audio_count = sum(row["has_audio"].lower() == "true" for row in active)
 
4
  from __future__ import annotations
5
 
6
  import csv
7
+ import importlib.util
8
  import re
9
+ import tempfile
10
  import unittest
11
  from pathlib import Path
12
+ from types import ModuleType
13
 
14
 
15
  ROOT = Path(__file__).resolve().parents[1]
16
+ TOOLS = ROOT / "tools"
17
 
18
 
19
  def read_rows(path: Path) -> list[dict[str, str]]:
 
21
  return list(csv.DictReader(handle))
22
 
23
 
24
+ def load_module(name: str, path: Path) -> ModuleType:
25
+ spec = importlib.util.spec_from_file_location(name, path)
26
+ if spec is None or spec.loader is None:
27
+ raise RuntimeError(f"unable to load {path}")
28
+ module = importlib.util.module_from_spec(spec)
29
+ spec.loader.exec_module(module)
30
+ return module
31
+
32
+
33
+ validate_metadata = load_module("validate_metadata", TOOLS / "validate_metadata.py")
34
+
35
+
36
  class SemanticConsistencyTests(unittest.TestCase):
37
  @classmethod
38
  def setUpClass(cls) -> None:
 
40
  cls.pre_standard_rows = read_rows(
41
  ROOT / "Pre_Standard_Time_Lapses" / "metadata.csv"
42
  )
43
+ cls.fragment_sidecars = sorted(
44
+ (ROOT / "Standard_Time_Lapses" / "Provenance").glob(
45
+ "*/fragment_sequence_relationships.csv"
46
+ )
47
+ )
48
+ cls.fragment_rows = [
49
+ row
50
+ for path in cls.fragment_sidecars
51
+ for row in read_rows(path)
52
+ if row["object_role"] == "canonical_fragment"
53
+ ]
54
+ cls.fragment_record_ids = {row["record_id"] for row in cls.fragment_rows}
55
+ cls.standard_by_id = {row["record_id"]: row for row in cls.standard_rows}
56
+
57
+ def validate_standard_rows(
58
+ self, rows: list[dict[str, str]]
59
+ ) -> dict[str, object]:
60
+ with tempfile.TemporaryDirectory(prefix="tla-protocol-test-") as temp_dir:
61
+ metadata_path = Path(temp_dir) / "metadata.csv"
62
+ with metadata_path.open("w", encoding="utf-8", newline="") as handle:
63
+ writer = csv.DictWriter(
64
+ handle,
65
+ fieldnames=list(rows[0]),
66
+ lineterminator="\n",
67
+ )
68
+ writer.writeheader()
69
+ writer.writerows(rows)
70
+ return validate_metadata.validate(
71
+ metadata_path,
72
+ None,
73
+ None,
74
+ None,
75
+ ROOT / "Standard_Time_Lapses" / "Provenance",
76
+ )
77
 
78
  def test_pre_standard_tool_medium_contract_is_independent(self) -> None:
79
  schema = (ROOT / "Pre_Standard_Time_Lapses" / "SCHEMA.md").read_text(
 
113
  self.assertEqual(row["support"], "IllustrationBoard")
114
  self.assertIn(".IllustrationBoard.30x40.", row["file_name"])
115
 
116
+ def test_protocol_boundary_matches_six_fragment_sidecars(self) -> None:
117
+ prospective_ids = {
118
+ row["record_id"]
119
+ for row in self.standard_rows
120
+ if row["acquisition_protocol_version"] == "standard-2026-08-27"
121
+ }
122
+ earlier_ids = {
123
+ row["record_id"]
124
+ for row in self.standard_rows
125
+ if row["acquisition_protocol_version"] == "standard-2025-07-13"
126
+ }
127
+
128
+ self.assertEqual(
129
+ [path.parent.name for path in self.fragment_sidecars],
130
+ [
131
+ "2026-08-27",
132
+ "2026-08-29",
133
+ "2026-08-30",
134
+ "2026-08-31",
135
+ "2026-09-01",
136
+ "2026-09-02",
137
+ ],
138
+ )
139
+ self.assertEqual(len(self.fragment_rows), 186)
140
+ self.assertEqual(len(self.fragment_record_ids), 186)
141
+ self.assertEqual(prospective_ids, self.fragment_record_ids)
142
+ self.assertEqual(
143
+ earlier_ids,
144
+ set(self.standard_by_id).difference(prospective_ids),
145
+ )
146
+
147
+ def test_historical_recnn_rows_keep_the_earlier_protocol(self) -> None:
148
+ recnn_ids = {
149
+ row["record_id"]
150
+ for row in self.standard_rows
151
+ if re.search(r"\.Rec\d+\.mp4$", row["file_name"])
152
+ }
153
+ historical_ids = recnn_ids.difference(self.fragment_record_ids)
154
+
155
+ self.assertEqual(len(historical_ids), 19)
156
+ self.assertEqual(
157
+ {
158
+ self.standard_by_id[record_id]["acquisition_protocol_version"]
159
+ for record_id in historical_ids
160
+ },
161
+ {"standard-2025-07-13"},
162
+ )
163
+
164
+ def test_prospective_group_timestamps_are_shared(self) -> None:
165
+ groups: dict[str, set[tuple[str, str]]] = {}
166
+ for row in self.fragment_rows:
167
+ metadata = self.standard_by_id[row["record_id"]]
168
+ groups.setdefault(row["fragment_set_label"], set()).add(
169
+ (metadata["date"], metadata["time"])
170
+ )
171
+
172
+ self.assertEqual(len(groups), 25)
173
+ self.assertTrue(all(len(timestamps) == 1 for timestamps in groups.values()))
174
+ schema = (ROOT / "SCHEMA.md").read_text(encoding="utf-8")
175
+ normalized_schema = re.sub(r"\s+", " ", schema)
176
+ self.assertIn("complete grouping/physical work", normalized_schema)
177
+ self.assertIn(
178
+ "not the individual end time of each fragment", normalized_schema
179
+ )
180
+
181
+ def test_metadata_validator_rejects_protocol_boundary_drift(self) -> None:
182
+ rows = [dict(row) for row in self.standard_rows]
183
+ prospective_row = next(
184
+ row for row in rows if row["record_id"] in self.fragment_record_ids
185
+ )
186
+ prospective_row["acquisition_protocol_version"] = "standard-2025-07-13"
187
+ report = self.validate_standard_rows(rows)
188
+
189
+ self.assertFalse(report["ok"])
190
+ self.assertTrue(
191
+ any("sidecar-defined boundary" in error for error in report["errors"]),
192
+ report["errors"],
193
+ )
194
+
195
+ def test_metadata_validator_rejects_prospective_timestamp_drift(self) -> None:
196
+ rows = [dict(row) for row in self.standard_rows]
197
+ prospective_row = next(
198
+ row for row in rows if row["record_id"] in self.fragment_record_ids
199
+ )
200
+ original_time = prospective_row["time"]
201
+ changed_time = "23:59" if original_time != "23:59" else "23:58"
202
+ prospective_row["time"] = changed_time
203
+ prospective_row["file_name"] = prospective_row["file_name"].replace(
204
+ f".{original_time.replace(':', '')}.",
205
+ f".{changed_time.replace(':', '')}.",
206
+ 1,
207
+ )
208
+ report = self.validate_standard_rows(rows)
209
+
210
+ self.assertFalse(report["ok"])
211
+ self.assertTrue(
212
+ any(
213
+ "do not share one documented finish date and time" in error
214
+ for error in report["errors"]
215
+ ),
216
+ report["errors"],
217
+ )
218
+
219
  def test_readme_audio_count_matches_active_indexes(self) -> None:
220
  active = self.standard_rows + self.pre_standard_rows
221
  audio_count = sum(row["has_audio"].lower() == "true" for row in active)
tools/validate_metadata.py CHANGED
@@ -23,6 +23,12 @@ TIME_RE = re.compile(r"^(?:[01]\d|2[0-3]):[0-5]\d$")
23
  DIMENSIONS_RE = re.compile(r"^\d+(?:\.\d+)?x\d+(?:\.\d+)?$")
24
  DIRECT_STANDARD_RE = re.compile(r"^Standard_Time_Lapses/[^/]+\.mp4$")
25
  DIRECT_PRE_STANDARD_RE = re.compile(r"^Pre_Standard_Time_Lapses/[^/]+\.mp4$")
 
 
 
 
 
 
26
 
27
  REQUIRED_FIELDS = [
28
  "file_name",
@@ -90,6 +96,69 @@ def valid_calendar_date(value: str) -> bool:
90
  return True
91
 
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  def validate_multi_value(
94
  row: dict[str, str], label: str, field: str, errors: list[str]
95
  ) -> None:
@@ -180,6 +249,7 @@ def validate(
180
  viewer_json: Path | None,
181
  pre_standard_metadata: Path | None,
182
  repo_files_json: Path | None,
 
183
  ) -> dict[str, object]:
184
  fields, rows = load_csv(metadata_csv)
185
  errors: list[str] = []
@@ -188,6 +258,16 @@ def validate(
188
  repo_counts: dict[str, int] = {}
189
  repo_unindexed_standard: list[str] = []
190
  repo_unindexed_pre_standard: list[str] = []
 
 
 
 
 
 
 
 
 
 
191
 
192
  missing_fields = [field for field in REQUIRED_FIELDS if field not in fields]
193
  if missing_fields:
@@ -212,7 +292,19 @@ def validate(
212
  errors.append(f"{label}: collection_tier must be standard")
213
  if row.get("is_canonical", "").lower() != "true":
214
  errors.append(f"{label}: is_canonical must be true")
215
- if row.get("acquisition_protocol_version") != "standard-2025-07-13":
 
 
 
 
 
 
 
 
 
 
 
 
216
  errors.append(f"{label}: unexpected acquisition protocol version")
217
  if not valid_calendar_date(row.get("date", "")):
218
  errors.append(f"{label}: invalid or missing finish date")
@@ -240,6 +332,38 @@ def validate(
240
 
241
  validate_technical_row(row, label, errors)
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  standard_30x40_non_board = sum(
244
  row.get("dimensions") == "30x40"
245
  and row.get("support") != "IllustrationBoard"
@@ -547,6 +671,19 @@ def validate(
547
  ),
548
  "unknown_finish_dates": sum(not row.get("date") for row in all_active_rows),
549
  "unknown_finish_times": sum(not row.get("time") for row in all_active_rows),
 
 
 
 
 
 
 
 
 
 
 
 
 
550
  "orientation_counts": dict(sorted(orientations.items())),
551
  "audio_counts": dict(sorted(audio.items())),
552
  "playback_hours": round(sum(durations) / 3600, 2),
@@ -567,6 +704,14 @@ def main() -> None:
567
  dest="repo_files_json",
568
  type=Path,
569
  )
 
 
 
 
 
 
 
 
570
  parser.add_argument("--output", type=Path)
571
  args = parser.parse_args()
572
 
@@ -575,6 +720,7 @@ def main() -> None:
575
  args.viewer_json,
576
  args.pre_standard_metadata,
577
  args.repo_files_json,
 
578
  )
579
  rendered = json.dumps(report, indent=2, sort_keys=True)
580
  if args.output:
 
23
  DIMENSIONS_RE = re.compile(r"^\d+(?:\.\d+)?x\d+(?:\.\d+)?$")
24
  DIRECT_STANDARD_RE = re.compile(r"^Standard_Time_Lapses/[^/]+\.mp4$")
25
  DIRECT_PRE_STANDARD_RE = re.compile(r"^Pre_Standard_Time_Lapses/[^/]+\.mp4$")
26
+ EARLIER_STANDARD_PROTOCOL = "standard-2025-07-13"
27
+ PROSPECTIVE_FRAGMENT_PROTOCOL = "standard-2026-08-27"
28
+ STANDARD_PROTOCOLS = {
29
+ EARLIER_STANDARD_PROTOCOL,
30
+ PROSPECTIVE_FRAGMENT_PROTOCOL,
31
+ }
32
 
33
  REQUIRED_FIELDS = [
34
  "file_name",
 
96
  return True
97
 
98
 
99
+ def load_fragment_protocol_membership(
100
+ relationships_root: Path,
101
+ errors: list[str],
102
+ ) -> tuple[set[str], dict[str, list[str]], int]:
103
+ """Load canonical-fragment membership from dated relationship sidecars."""
104
+
105
+ sidecars = sorted(
106
+ relationships_root.glob("*/fragment_sequence_relationships.csv")
107
+ )
108
+ if not sidecars:
109
+ errors.append(
110
+ f"no dated fragment relationship sidecars found under {relationships_root}"
111
+ )
112
+ return set(), {}, 0
113
+
114
+ required_fields = {
115
+ "fragment_set_label",
116
+ "object_role",
117
+ "record_id",
118
+ }
119
+ prospective_ids: set[str] = set()
120
+ groups: dict[str, list[str]] = {}
121
+
122
+ for sidecar in sidecars:
123
+ try:
124
+ fields, relationship_rows = load_csv(sidecar)
125
+ except (OSError, ValueError) as exc:
126
+ errors.append(f"{sidecar}: unable to load fragment relationships: {exc}")
127
+ continue
128
+ missing_fields = sorted(required_fields.difference(fields))
129
+ if missing_fields:
130
+ errors.append(
131
+ f"{sidecar}: missing protocol-boundary fields: {missing_fields}"
132
+ )
133
+ continue
134
+
135
+ for index, relationship in enumerate(relationship_rows, start=2):
136
+ if relationship.get("object_role") != "canonical_fragment":
137
+ continue
138
+ record_id = relationship.get("record_id", "")
139
+ label = relationship.get("fragment_set_label", "")
140
+ row_label = f"{sidecar} row {index}"
141
+ if not RECORD_ID_RE.fullmatch(record_id):
142
+ errors.append(f"{row_label}: canonical fragment has invalid record_id")
143
+ continue
144
+ if not label:
145
+ errors.append(
146
+ f"{row_label}: canonical fragment has no fragment_set_label"
147
+ )
148
+ continue
149
+ if record_id in prospective_ids:
150
+ errors.append(
151
+ f"{row_label}: canonical record_id {record_id} occurs in "
152
+ "multiple dated sidecars"
153
+ )
154
+ continue
155
+ prospective_ids.add(record_id)
156
+ group_key = f"{sidecar.parent.name}/{label}"
157
+ groups.setdefault(group_key, []).append(record_id)
158
+
159
+ return prospective_ids, groups, len(sidecars)
160
+
161
+
162
  def validate_multi_value(
163
  row: dict[str, str], label: str, field: str, errors: list[str]
164
  ) -> None:
 
249
  viewer_json: Path | None,
250
  pre_standard_metadata: Path | None,
251
  repo_files_json: Path | None,
252
+ fragment_relationships_root: Path | None = None,
253
  ) -> dict[str, object]:
254
  fields, rows = load_csv(metadata_csv)
255
  errors: list[str] = []
 
258
  repo_counts: dict[str, int] = {}
259
  repo_unindexed_standard: list[str] = []
260
  repo_unindexed_pre_standard: list[str] = []
261
+ prospective_fragment_ids: set[str] = set()
262
+ prospective_fragment_groups: dict[str, list[str]] = {}
263
+ fragment_sidecar_count = 0
264
+
265
+ if fragment_relationships_root:
266
+ (
267
+ prospective_fragment_ids,
268
+ prospective_fragment_groups,
269
+ fragment_sidecar_count,
270
+ ) = load_fragment_protocol_membership(fragment_relationships_root, errors)
271
 
272
  missing_fields = [field for field in REQUIRED_FIELDS if field not in fields]
273
  if missing_fields:
 
292
  errors.append(f"{label}: collection_tier must be standard")
293
  if row.get("is_canonical", "").lower() != "true":
294
  errors.append(f"{label}: is_canonical must be true")
295
+ protocol = row.get("acquisition_protocol_version", "")
296
+ if fragment_relationships_root:
297
+ expected_protocol = (
298
+ PROSPECTIVE_FRAGMENT_PROTOCOL
299
+ if row.get("record_id") in prospective_fragment_ids
300
+ else EARLIER_STANDARD_PROTOCOL
301
+ )
302
+ if protocol != expected_protocol:
303
+ errors.append(
304
+ f"{label}: acquisition protocol {protocol!r} does not match "
305
+ f"sidecar-defined boundary {expected_protocol!r}"
306
+ )
307
+ elif protocol not in STANDARD_PROTOCOLS:
308
  errors.append(f"{label}: unexpected acquisition protocol version")
309
  if not valid_calendar_date(row.get("date", "")):
310
  errors.append(f"{label}: invalid or missing finish date")
 
332
 
333
  validate_technical_row(row, label, errors)
334
 
335
+ if fragment_relationships_root:
336
+ rows_by_id = {
337
+ row.get("record_id", ""): row for row in rows if row.get("record_id")
338
+ }
339
+ missing_fragment_ids = sorted(prospective_fragment_ids.difference(rows_by_id))
340
+ if missing_fragment_ids:
341
+ errors.append(
342
+ f"{len(missing_fragment_ids)} sidecar-defined canonical fragments are absent "
343
+ "from metadata.csv"
344
+ )
345
+ for group_label, record_ids in prospective_fragment_groups.items():
346
+ group_rows = [
347
+ rows_by_id[record_id]
348
+ for record_id in record_ids
349
+ if record_id in rows_by_id
350
+ ]
351
+ timestamps = {
352
+ (row.get("date", ""), row.get("time", "")) for row in group_rows
353
+ }
354
+ if len(group_rows) == len(record_ids) and len(timestamps) != 1:
355
+ errors.append(
356
+ f"{group_label}: prospective fragment members do not share one "
357
+ "documented finish date and time"
358
+ )
359
+ elif len(group_rows) == len(record_ids) and timestamps:
360
+ finish_date, finish_time = next(iter(timestamps))
361
+ if not finish_date or not finish_time:
362
+ errors.append(
363
+ f"{group_label}: prospective fragment grouping must have a "
364
+ "documented finish date and time"
365
+ )
366
+
367
  standard_30x40_non_board = sum(
368
  row.get("dimensions") == "30x40"
369
  and row.get("support") != "IllustrationBoard"
 
671
  ),
672
  "unknown_finish_dates": sum(not row.get("date") for row in all_active_rows),
673
  "unknown_finish_times": sum(not row.get("time") for row in all_active_rows),
674
+ "protocol_version_counts": dict(
675
+ sorted(
676
+ Counter(
677
+ row.get("acquisition_protocol_version", "") for row in rows
678
+ ).items()
679
+ )
680
+ ),
681
+ "protocol_boundary": {
682
+ "checked": fragment_relationships_root is not None,
683
+ "fragment_relationship_sidecars": fragment_sidecar_count,
684
+ "prospective_record_ids": len(prospective_fragment_ids),
685
+ "earlier_standard_rows": len(rows) - len(prospective_fragment_ids),
686
+ },
687
  "orientation_counts": dict(sorted(orientations.items())),
688
  "audio_counts": dict(sorted(audio.items())),
689
  "playback_hours": round(sum(durations) / 3600, 2),
 
704
  dest="repo_files_json",
705
  type=Path,
706
  )
707
+ parser.add_argument(
708
+ "--fragment-relationships-root",
709
+ type=Path,
710
+ help=(
711
+ "directory containing dated fragment_sequence_relationships.csv "
712
+ "sidecars that define the Standard protocol-version boundary"
713
+ ),
714
+ )
715
  parser.add_argument("--output", type=Path)
716
  args = parser.parse_args()
717
 
 
720
  args.viewer_json,
721
  args.pre_standard_metadata,
722
  args.repo_files_json,
723
+ args.fragment_relationships_root,
724
  )
725
  rendered = json.dumps(report, indent=2, sort_keys=True)
726
  if args.output: