omids-validator 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. omids_validator/__init__.py +11 -0
  2. omids_validator/__main__.py +11 -0
  3. omids_validator/acquisition_profiles.py +478 -0
  4. omids_validator/cli.py +185 -0
  5. omids_validator/data/metadata_requirements.json +337 -0
  6. omids_validator/data/rules.json +364 -0
  7. omids_validator/file_types.py +46 -0
  8. omids_validator/inventory.py +133 -0
  9. omids_validator/models.py +60 -0
  10. omids_validator/participant_table.py +128 -0
  11. omids_validator/participants.py +235 -0
  12. omids_validator/patient_metadata.py +150 -0
  13. omids_validator/reporters/__init__.py +1 -0
  14. omids_validator/reporters/html_report.py +607 -0
  15. omids_validator/reporters/json_report.py +74 -0
  16. omids_validator/reporters/markdown_report.py +283 -0
  17. omids_validator/reporters/report_data.py +79 -0
  18. omids_validator/reporters/terminal.py +18 -0
  19. omids_validator/rule_catalog.py +279 -0
  20. omids_validator/rules/__init__.py +5 -0
  21. omids_validator/rules/layer0_structure.py +316 -0
  22. omids_validator/rules/layer1_naming.py +191 -0
  23. omids_validator/rules/layer2_sidecars.py +292 -0
  24. omids_validator/rules/layer3_metadata.py +144 -0
  25. omids_validator/rules/layer4_image_headers.py +152 -0
  26. omids_validator/rules/layer5_dataset.py +261 -0
  27. omids_validator/rules_document.py +192 -0
  28. omids_validator/validator.py +274 -0
  29. omids_validator-0.2.0.dist-info/METADATA +158 -0
  30. omids_validator-0.2.0.dist-info/RECORD +34 -0
  31. omids_validator-0.2.0.dist-info/WHEEL +5 -0
  32. omids_validator-0.2.0.dist-info/entry_points.txt +3 -0
  33. omids_validator-0.2.0.dist-info/licenses/LICENSE +677 -0
  34. omids_validator-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,364 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "rules": {
4
+ "MIDS-001": {
5
+ "layer": 0,
6
+ "status": "active",
7
+ "title": "Invalid dataset path",
8
+ "severity": "error",
9
+ "description": "The supplied dataset path must exist, be readable, and be a directory.",
10
+ "next_step": {
11
+ "kind": "manual",
12
+ "text": "Provide the path to an existing readable MIDS dataset directory."
13
+ }
14
+ },
15
+ "MIDS-002": {
16
+ "layer": 0,
17
+ "status": "active",
18
+ "title": "Unexpected item in dataset root",
19
+ "severity": "error",
20
+ "description": "The dataset root may contain only subject directories named `sub-<ID>` and `participants.tsv`.",
21
+ "next_step": {
22
+ "kind": "manual",
23
+ "text": "Move the affected root items outside the MIDS dataset or organize them within the appropriate subject directory."
24
+ }
25
+ },
26
+ "MIDS-003": {
27
+ "layer": 0,
28
+ "status": "active",
29
+ "title": "Invalid subject identifier",
30
+ "severity": "error",
31
+ "description": "Subject directories must follow `sub-<ID>`, where `<ID>` contains only accepted alphanumeric characters.",
32
+ "next_step": {
33
+ "kind": "manual",
34
+ "text": "Rename the subject directory and corresponding file identifiers to a valid `sub-<ID>`."
35
+ }
36
+ },
37
+ "MIDS-004": {
38
+ "layer": 0,
39
+ "status": "active",
40
+ "title": "Invalid session identifier",
41
+ "severity": "error",
42
+ "description": "Session directories, when present, must follow `ses-<ID>`, where `<ID>` contains only accepted alphanumeric characters.",
43
+ "next_step": {
44
+ "kind": "manual",
45
+ "text": "Rename the session directory and corresponding file identifiers to a valid `ses-<ID>`."
46
+ }
47
+ },
48
+ "MIDS-005": {
49
+ "layer": 0,
50
+ "status": "active",
51
+ "title": "Mixed session and direct-datatype structure",
52
+ "severity": "error",
53
+ "description": "Within one subject, imaging data must either be stored inside `ses-<ID>` session directories or directly inside datatype directories. The two layouts cannot be mixed for the same subject.",
54
+ "next_step": {
55
+ "kind": "manual",
56
+ "text": "Choose one layout for the subject: place all imaging data inside session directories, or place all datatype directories directly inside the subject directory."
57
+ }
58
+ },
59
+ "MIDS-006": {
60
+ "layer": 0,
61
+ "status": "active",
62
+ "title": "Unrecognized datatype item",
63
+ "severity": "error",
64
+ "description": "Items at the imaging-data level must be supported datatype directories: `mr-anat`, `mr-quant`, `ct`, or `rx`.",
65
+ "next_step": {
66
+ "kind": "review",
67
+ "text": "Move the affected item into the appropriate supported datatype directory, or move it outside the MIDS dataset."
68
+ }
69
+ },
70
+ "MIDS-007": {
71
+ "layer": 0,
72
+ "status": "active",
73
+ "title": "Empty datatype directory",
74
+ "severity": "warning",
75
+ "description": "A recognized datatype directory contains no image data.",
76
+ "next_step": {
77
+ "kind": "review",
78
+ "text": "Determine whether the directory represents an incomplete conversion or an unused datatype directory."
79
+ }
80
+ },
81
+ "MIDS-008": {
82
+ "layer": 0,
83
+ "status": "active",
84
+ "title": "Subject contains no recognized imaging data",
85
+ "severity": "warning",
86
+ "description": "A subject directory contains no images in recognized datatype directories.",
87
+ "next_step": {
88
+ "kind": "review",
89
+ "text": "Determine whether imaging data are missing, stored in an unsupported location, or intentionally absent for this subject."
90
+ }
91
+ },
92
+ "MIDS-009": {
93
+ "layer": 0,
94
+ "status": "active",
95
+ "title": "Operating-system artifact present",
96
+ "severity": "warning",
97
+ "description": "A common operating-system artifact is present in the dataset. The most common example is `.DS_Store`, which macOS creates automatically.",
98
+ "next_step": {
99
+ "kind": "manual",
100
+ "text": "Remove the reported operating-system artifact before sharing the dataset."
101
+ }
102
+ },
103
+ "MIDS-101": {
104
+ "layer": 1,
105
+ "status": "active",
106
+ "title": "Unsupported item in datatype directory",
107
+ "severity": "error",
108
+ "description": "Datatype directories may contain only recognized finished image files and their metadata sidecars.",
109
+ "next_step": {
110
+ "kind": "manual",
111
+ "text": "Move the unsupported item outside the datatype directory or convert it to a supported dataset file."
112
+ }
113
+ },
114
+ "MIDS-102": {
115
+ "layer": 1,
116
+ "status": "active",
117
+ "title": "Filename subject identifier mismatch",
118
+ "severity": "error",
119
+ "description": "Every supported image and JSON filename must contain a subject identifier matching its containing subject directory.",
120
+ "next_step": {
121
+ "kind": "manual",
122
+ "text": "Correct the filename subject identifier so it matches the containing subject directory."
123
+ }
124
+ },
125
+ "MIDS-103": {
126
+ "layer": 1,
127
+ "status": "active",
128
+ "title": "Recognized suffix in wrong datatype directory",
129
+ "severity": "error",
130
+ "description": "A recognized acquisition suffix must be stored in its associated datatype directory.",
131
+ "next_step": {
132
+ "kind": "manual",
133
+ "text": "Move the affected image and its sidecars to the datatype directory associated with the recognized suffix."
134
+ }
135
+ },
136
+ "MIDS-104": {
137
+ "layer": 1,
138
+ "status": "active",
139
+ "title": "Case-conflicting filename",
140
+ "severity": "warning",
141
+ "description": "Two filenames in the same datatype directory differ only by capitalization.",
142
+ "next_step": {
143
+ "kind": "manual",
144
+ "text": "Resolve the case-conflicting filenames so they remain distinct and portable across filesystems."
145
+ }
146
+ },
147
+ "MIDS-201": {
148
+ "layer": 2,
149
+ "status": "active",
150
+ "title": "Missing primary JSON sidecar",
151
+ "severity": "error",
152
+ "description": "Every NIfTI image requires a matching primary JSON sidecar in the same datatype directory.",
153
+ "next_step": {
154
+ "kind": "tool",
155
+ "tool": "dcm2omids",
156
+ "text": "Reconvert the source DICOM data with dcm2omids to regenerate the NIfTI images and their primary JSON sidecars."
157
+ }
158
+ },
159
+ "MIDS-202": {
160
+ "layer": 2,
161
+ "status": "active",
162
+ "title": "Malformed primary JSON sidecar",
163
+ "severity": "error",
164
+ "description": "A primary JSON sidecar must contain syntactically valid, readable UTF-8 JSON.",
165
+ "next_step": {
166
+ "kind": "tool",
167
+ "tool": "dcm2omids",
168
+ "text": "Regenerate the affected primary sidecar from the source DICOM data with dcm2omids, or correct the reported JSON problem."
169
+ }
170
+ },
171
+ "MIDS-203": {
172
+ "layer": 2,
173
+ "status": "active",
174
+ "title": "Malformed optional JSON sidecar",
175
+ "severity": "warning",
176
+ "description": "A present patient or extra JSON sidecar must contain syntactically valid, readable UTF-8 JSON.",
177
+ "next_step": {
178
+ "kind": "tool",
179
+ "tool": "dcm2omids",
180
+ "text": "Regenerate the affected optional sidecar from the source DICOM data with dcm2omids."
181
+ }
182
+ },
183
+ "MIDS-204": {
184
+ "layer": 2,
185
+ "status": "active",
186
+ "title": "Optional patient JSON sidecar is absent",
187
+ "severity": "info",
188
+ "description": "The optional `<image-stem>_patient.json` sidecar is absent.",
189
+ "next_step": {
190
+ "kind": "none",
191
+ "text": "No action is required unless patient-sidecar metadata are needed for the intended use."
192
+ }
193
+ },
194
+ "MIDS-205": {
195
+ "layer": 2,
196
+ "status": "active",
197
+ "title": "Optional extra JSON sidecar is absent",
198
+ "severity": "info",
199
+ "description": "The optional `<image-stem>_extra.json` sidecar is absent.",
200
+ "next_step": {
201
+ "kind": "none",
202
+ "text": "No action is required unless extra-sidecar metadata are needed for the intended use."
203
+ }
204
+ },
205
+ "MIDS-206": {
206
+ "layer": 2,
207
+ "status": "active",
208
+ "title": "Orphan JSON sidecar",
209
+ "severity": "warning",
210
+ "description": "A primary, patient, or extra JSON sidecar exists without a corresponding NIfTI image.",
211
+ "next_step": {
212
+ "kind": "review",
213
+ "text": "Determine whether the corresponding image is missing or the orphan sidecar no longer belongs in the dataset."
214
+ }
215
+ },
216
+ "MIDS-207": {
217
+ "layer": 2,
218
+ "status": "active",
219
+ "title": "Invalid extra JSON structure",
220
+ "severity": "warning",
221
+ "description": "An extra JSON sidecar must contain exactly the expected meta and extra top-level structures.",
222
+ "next_step": {
223
+ "kind": "tool",
224
+ "tool": "dcm2omids",
225
+ "text": "Regenerate the affected extra sidecar with dcm2omids or correct its top-level structure."
226
+ }
227
+ },
228
+ "MIDS-301": {
229
+ "layer": 3,
230
+ "status": "active",
231
+ "title": "Mandatory metadata field is missing",
232
+ "severity": "warning",
233
+ "description": "A metadata field classified as mandatory for the recognized acquisition profile is absent from the primary JSON sidecar.",
234
+ "next_step": {
235
+ "kind": "review",
236
+ "text": "Recover the reported field from the source acquisition metadata or study records where available."
237
+ }
238
+ },
239
+ "MIDS-302": {
240
+ "layer": 3,
241
+ "status": "deferred",
242
+ "title": "Metadata field has an invalid type",
243
+ "severity": "info",
244
+ "description": "A recognized metadata field is present but cannot be interpreted using its verified expected type.",
245
+ "next_step": {
246
+ "kind": "none",
247
+ "text": "This rule is deferred until representative output and expected JSON types are verified."
248
+ }
249
+ },
250
+ "MIDS-303": {
251
+ "layer": 3,
252
+ "status": "active",
253
+ "title": "Mandatory metadata field is empty",
254
+ "severity": "warning",
255
+ "description": "A mandatory metadata field is present but contains no usable value.",
256
+ "next_step": {
257
+ "kind": "review",
258
+ "text": "Recover the reported value from the source acquisition metadata or study records where available."
259
+ }
260
+ },
261
+ "MIDS-304": {
262
+ "layer": 3,
263
+ "status": "active",
264
+ "title": "Optional metadata field is missing",
265
+ "severity": "info",
266
+ "description": "A metadata field classified as optional for the recognized acquisition profile is absent from the primary JSON sidecar.",
267
+ "next_step": {
268
+ "kind": "none",
269
+ "text": "No action is required unless the optional field is needed for the intended analysis or reuse."
270
+ }
271
+ },
272
+ "MIDS-401": {
273
+ "layer": 4,
274
+ "status": "active",
275
+ "title": "Unreadable or invalid NIfTI file",
276
+ "severity": "error",
277
+ "description": "The image cannot be opened and interpreted as a NIfTI file.",
278
+ "next_step": {
279
+ "kind": "tool",
280
+ "tool": "dcm2omids",
281
+ "text": "Reconvert the affected source imaging data with dcm2omids or replace the unreadable NIfTI file from an authoritative source."
282
+ }
283
+ },
284
+ "MIDS-402": {
285
+ "layer": 4,
286
+ "status": "active",
287
+ "title": "Acquisition dimension outlier",
288
+ "severity": "warning",
289
+ "description": "An image's dimensions differ from the common shape for the same image type across the dataset.",
290
+ "next_step": {
291
+ "kind": "review",
292
+ "text": "Compare the affected image with the expected acquisition dimensions and determine whether the difference is intentional."
293
+ }
294
+ },
295
+ "MIDS-501": {
296
+ "layer": 5,
297
+ "status": "active",
298
+ "title": "Conflicting participants table filenames",
299
+ "severity": "error",
300
+ "description": "The dataset contains exact `participants.tsv` and one or more filenames that differ from it only by capitalization.",
301
+ "next_step": {
302
+ "kind": "manual",
303
+ "text": "Resolve the conflicting participants-table files and retain one authoritative exactly named `participants.tsv`."
304
+ }
305
+ },
306
+ "MIDS-502": {
307
+ "layer": 5,
308
+ "status": "active",
309
+ "title": "Participants table is invalid",
310
+ "severity": "error",
311
+ "description": "`participants.tsv` must be valid tab-separated data with one coherent `participant_id` key per row.",
312
+ "next_step": {
313
+ "kind": "manual",
314
+ "text": "Correct the reported table structure, participant identifier, or row-level problem."
315
+ }
316
+ },
317
+ "MIDS-503": {
318
+ "layer": 5,
319
+ "status": "active",
320
+ "title": "Participant inventory mismatch",
321
+ "severity": "warning",
322
+ "description": "The subject directories and `participant_id` values do not describe the same subject set.",
323
+ "next_step": {
324
+ "kind": "command",
325
+ "command": "omids_validator DATASET --participants",
326
+ "text": "Use `--participants` to add subject directories missing from the table; review participant rows that have no corresponding subject directory."
327
+ }
328
+ },
329
+ "MIDS-504": {
330
+ "layer": 5,
331
+ "status": "active",
332
+ "title": "Participants table is absent",
333
+ "severity": "warning",
334
+ "description": "The dataset does not contain a root-level file named exactly `participants.tsv`.",
335
+ "next_step": {
336
+ "kind": "command",
337
+ "command": "omids_validator DATASET --participants",
338
+ "text": "Create or populate `participants.tsv` from the subject-directory inventory."
339
+ }
340
+ },
341
+ "MIDS-505": {
342
+ "layer": 5,
343
+ "status": "active",
344
+ "title": "Patient age differs within an imaging session",
345
+ "severity": "warning",
346
+ "description": "Within one imaging session for a subject, all non-empty string `Age` values in readable patient JSON sidecars must be identical. A subject without explicit session directories is treated as having one imaging session. Missing age values do not trigger this rule.",
347
+ "next_step": {
348
+ "kind": "review",
349
+ "text": "Review the conflicting age values against the acquisition dates and appropriate source records."
350
+ }
351
+ },
352
+ "MIDS-506": {
353
+ "layer": 5,
354
+ "status": "active",
355
+ "title": "Patient sex differs within a subject",
356
+ "severity": "info",
357
+ "description": "Across all imaging sessions for a subject, non-empty string `Sex` values in readable patient JSON sidecars are expected to be identical. Missing sex values do not trigger this rule.",
358
+ "next_step": {
359
+ "kind": "review",
360
+ "text": "Review the differing values in the study context. Patient sex metadata may legitimately change or be corrected over time; this informational finding helps distinguish an intended update from a coding or conversion error and must not be used to overwrite values automatically."
361
+ }
362
+ }
363
+ }
364
+ }
@@ -0,0 +1,46 @@
1
+ """Recognize supported image and JSON files from their names.
2
+
3
+ These small path helpers are shared by the dataset inventory, the validation
4
+ coordinator, the scan-type definitions, and Layers 0 through 4.
5
+ """
6
+
7
+ from pathlib import Path
8
+
9
+
10
+ SUPPORTED_FILE_EXTENSIONS = (".nii", ".nii.gz", ".json")
11
+
12
+
13
+ def is_nifti_file(path: Path) -> bool:
14
+ """Return whether a file has a supported NIfTI extension."""
15
+
16
+ normalized_name = path.name.casefold()
17
+ return path.is_file() and normalized_name.endswith((".nii", ".nii.gz"))
18
+
19
+
20
+ def is_json_file(path: Path) -> bool:
21
+ """Return whether a file has a JSON extension."""
22
+
23
+ return path.is_file() and path.name.casefold().endswith(".json")
24
+
25
+
26
+ def is_supported_file(path: Path) -> bool:
27
+ """Return whether a file is a supported NIfTI image or JSON sidecar."""
28
+
29
+ return path.is_file() and path.name.casefold().endswith(
30
+ SUPPORTED_FILE_EXTENSIONS
31
+ )
32
+
33
+
34
+ def nifti_stem(path: Path) -> str | None:
35
+ """Return a NIfTI filename without its extension, or ``None``."""
36
+
37
+ normalized_name = path.name.casefold()
38
+
39
+ if not path.is_file():
40
+ return None
41
+ if normalized_name.endswith(".nii.gz"):
42
+ return path.name[:-7]
43
+ if normalized_name.endswith(".nii"):
44
+ return path.name[:-4]
45
+
46
+ return None
@@ -0,0 +1,133 @@
1
+ """Scan a dataset once and organize its paths for the validation rules.
2
+
3
+ The coordinator builds one ``DatasetInventory`` and shares it with the layer
4
+ modules and participant-table code.
5
+ """
6
+
7
+ from dataclasses import dataclass
8
+ from pathlib import Path
9
+ from types import MappingProxyType
10
+ from typing import Iterable, Mapping
11
+
12
+ from omids_validator.file_types import is_nifti_file
13
+
14
+
15
+ VALID_DATATYPE_DIRECTORIES = frozenset({"mr-anat", "mr-quant", "ct", "rx"})
16
+
17
+
18
+ @dataclass(frozen=True)
19
+ class DatasetInventory:
20
+ """A read-only list of paths found below one dataset root."""
21
+
22
+ root: Path
23
+ root_items: tuple[Path, ...]
24
+ all_items: tuple[Path, ...]
25
+ _children_by_directory: Mapping[Path, tuple[Path, ...]]
26
+
27
+ @classmethod
28
+ def from_items(
29
+ cls,
30
+ root: Path,
31
+ items: Iterable[Path],
32
+ ) -> "DatasetInventory":
33
+ """Create an inventory and index each path by its direct parent."""
34
+
35
+ sorted_items = tuple(sorted(items, key=lambda path: str(path)))
36
+ children_lists: dict[Path, list[Path]] = {}
37
+ for item in sorted_items:
38
+ children_lists.setdefault(item.parent, []).append(item)
39
+
40
+ children_by_directory = {
41
+ directory: tuple(children)
42
+ for directory, children in children_lists.items()
43
+ }
44
+ return cls(
45
+ root=root,
46
+ root_items=children_by_directory.get(root, ()),
47
+ all_items=sorted_items,
48
+ _children_by_directory=MappingProxyType(children_by_directory),
49
+ )
50
+
51
+ def children(self, directory: Path) -> tuple[Path, ...]:
52
+ """Return already-discovered direct children of ``directory``."""
53
+
54
+ return self._children_by_directory.get(directory, ())
55
+
56
+ def with_added_item(self, path: Path) -> "DatasetInventory":
57
+ """Return a new inventory snapshot containing one newly created path."""
58
+
59
+ if path in self.all_items:
60
+ return self
61
+ return DatasetInventory.from_items(self.root, (*self.all_items, path))
62
+
63
+ def subject_directories(self) -> tuple[Path, ...]:
64
+ """Return root directories that declare themselves as subjects."""
65
+
66
+ return tuple(
67
+ item
68
+ for item in self.root_items
69
+ if item.is_dir() and item.name.startswith("sub-")
70
+ )
71
+
72
+ def session_directories(
73
+ self,
74
+ subject_directory: Path,
75
+ ) -> tuple[Path, ...]:
76
+ """Return session directories immediately below one subject."""
77
+
78
+ return tuple(
79
+ item
80
+ for item in self.children(subject_directory)
81
+ if item.is_dir() and item.name.startswith("ses-")
82
+ )
83
+
84
+ def datatype_directories(
85
+ self,
86
+ subject_directory: Path,
87
+ ) -> tuple[Path, ...]:
88
+ """Return recognized datatype directories for one subject."""
89
+
90
+ datatype_directories = [
91
+ item
92
+ for item in self.children(subject_directory)
93
+ if item.is_dir() and item.name in VALID_DATATYPE_DIRECTORIES
94
+ ]
95
+
96
+ for session_directory in self.session_directories(subject_directory):
97
+ datatype_directories.extend(
98
+ item
99
+ for item in self.children(session_directory)
100
+ if item.is_dir() and item.name in VALID_DATATYPE_DIRECTORIES
101
+ )
102
+
103
+ return tuple(datatype_directories)
104
+
105
+ def relative_path(self, path: Path) -> str:
106
+ """Return a path relative to the dataset root."""
107
+
108
+ return str(path.relative_to(self.root))
109
+
110
+ def nifti_image_paths(self) -> tuple[Path, ...]:
111
+ """Return discovered NIfTI images in recognized datatype folders."""
112
+
113
+ image_paths: list[Path] = []
114
+
115
+ for subject_directory in self.subject_directories():
116
+ for datatype_directory in self.datatype_directories(
117
+ subject_directory
118
+ ):
119
+ image_paths.extend(
120
+ path
121
+ for path in self.children(datatype_directory)
122
+ if is_nifti_file(path)
123
+ )
124
+
125
+ return tuple(image_paths)
126
+
127
+
128
+ def build_inventory(dataset_root: Path) -> DatasetInventory:
129
+ """Scan a valid dataset directory once and return its inventory."""
130
+
131
+ root = dataset_root.resolve()
132
+ all_items = tuple(sorted(root.rglob("*"), key=lambda path: str(path)))
133
+ return DatasetInventory.from_items(root, all_items)
@@ -0,0 +1,60 @@
1
+ """Define findings, validation runs, and reports shared across the package."""
2
+
3
+ from dataclasses import dataclass
4
+ from enum import Enum
5
+ from typing import Any
6
+
7
+
8
+ class Severity(str, Enum):
9
+ """Allowed levels of attention for a validation finding.
10
+
11
+ Inheriting from ``str`` means values serialize naturally as ``"error"``,
12
+ ``"warning"``, and ``"info"`` in a future JSON report.
13
+ """
14
+
15
+ ERROR = "error"
16
+ WARNING = "warning"
17
+ INFO = "info"
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class Finding:
22
+ """One issue or observation produced by a validation rule.
23
+
24
+ ``frozen=True`` prevents a finding from being accidentally changed after a
25
+ rule returns it. Paths are stored relative to the dataset root whenever
26
+ possible so reports remain portable between computers.
27
+ """
28
+
29
+ rule_id: str
30
+ severity: Severity
31
+ title: str
32
+ message: str
33
+ path: str | None = None
34
+
35
+
36
+ @dataclass(frozen=True)
37
+ class ValidationRun:
38
+ """Context for one validation request."""
39
+
40
+ timestamp: str
41
+ inspect_images: bool
42
+ participants_requested: bool
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ class ValidationReport:
47
+ """The single coordinator output consumed by future report renderers.
48
+
49
+ This object contains no open files or filesystem handles. Report modules
50
+ can therefore serialize or render it without running validation again.
51
+ """
52
+
53
+ schema_version: str
54
+ validator_version: str
55
+ dataset_root: str
56
+ run: ValidationRun
57
+ findings: tuple[Finding, ...]
58
+ summary: dict[str, int]
59
+ inventory: dict[str, Any]
60
+ actions: tuple[dict[str, Any], ...] = ()