1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2026 Vallés Puig, Ramon
//! # Provenance metadata
//!
//! ## Scientific scope
//!
//! Reproducible astronomical pipelines must be able to answer the
//! question "where did this number come from?" for every dataset they
//! consume — was it the literature curve cited in a paper, a specific
//! release of a vendored ASCII table, the output of an external service
//! pulled at build time, or a derived product computed at runtime?
//! The provenance record carried by every typed dataset in this crate
//! lets downstream consumers audit the literature source, file version,
//! and (optionally) cryptographic hash of the bytes that produced any
//! computed result, without having to re-derive that information from
//! file paths or imported strings.
//!
//! This is the same hygiene principle followed by the IVOA Provenance
//! Data Model and by IERS conventions when distributing reference data.
//!
//! ## Technical scope
//!
//! This module provides:
//!
//! - [`Provenance`] — full record (origin, version, retrieval timestamp,
//! optional SHA-256 checksum, free-form notes).
//! - [`DataSource`] — origin classifier with variants for
//! `LiteratureCitation`, `BundledFile`, `External`, and `Computed`.
//! - Builder helpers: [`Provenance::new`], [`Provenance::bundled_file`],
//! [`Provenance::cited`], [`Provenance::computed`],
//! [`Provenance::with_version`], [`Provenance::with_notes`].
//!
//! All fields are owned `String` / `Option<String>` for portability; no
//! external serialization is implied. Re-exported from the `spectra` and
//! `tables` feature modules for backwards compatibility.
//!
//! The [`checksum`] submodule provides a const-evaluable SHA-256 and the
//! [`assert_data_checksum!`](crate::assert_data_checksum) macro for
//! pinning the hash of any [`include_str!`] / [`include_bytes!`] data
//! blob shipped inside the crate. Mismatches become hard compile errors.
//!
//! ## References
//!
//! - International Virtual Observatory Alliance (2020). *IVOA Provenance
//! Data Model*. IVOA Recommendation, version 1.0.
//! <https://www.ivoa.net/documents/ProvenanceDM/>.
//! - IERS Conventions (2010). *IERS Technical Note 36*, Chapter 1
//! (citing reference data products).
/// Where a dataset's samples originally came from.
/// Full provenance record for a dataset.