perishables 0.1.0__py3-none-win_amd64.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.
LICENSE-APACHE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
LICENSE-MIT ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Engelmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,506 @@
1
+ """Typed Python interface and bundled CLI wrapper for ``perishables``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ import json
7
+ import os
8
+ from pathlib import Path
9
+ import shutil
10
+ import subprocess
11
+ import sys
12
+ import sysconfig
13
+ from typing import Any, Sequence
14
+
15
+ __all__ = [
16
+ "__version__",
17
+ "AuditReport",
18
+ "ComputationRecord",
19
+ "CorpusFixtureRecord",
20
+ "CorpusReport",
21
+ "DriftReport",
22
+ "FindingRecord",
23
+ "GradeReport",
24
+ "NoteRecord",
25
+ "PerishablesError",
26
+ "SemanticCounts",
27
+ "TierRecord",
28
+ "audit",
29
+ "corpus",
30
+ "drift",
31
+ "find_binary",
32
+ "grade",
33
+ "version",
34
+ ]
35
+
36
+ __version__ = "0.1.0"
37
+
38
+ PathInput = str | os.PathLike[str]
39
+
40
+
41
+ class PerishablesError(RuntimeError):
42
+ """Raised on CLI usage errors or when ``raise_for_findings`` trips."""
43
+
44
+ def __init__(self, message: str, *, exit_code: int = 2) -> None:
45
+ super().__init__(message)
46
+ self.exit_code = exit_code
47
+
48
+
49
+ @dataclass(frozen=True, slots=True)
50
+ class TierRecord:
51
+ """Recomputed trust tier for one OKF concept."""
52
+
53
+ concept_id: str
54
+ raw_tier: str
55
+ recomputed_tier: str
56
+
57
+
58
+ @dataclass(frozen=True, slots=True)
59
+ class ComputationRecord:
60
+ """Re-execution outcome for an OKF Attested Computation block."""
61
+
62
+ concept_id: str
63
+ verdict: str
64
+ reason: str | None
65
+ claimed: str | None
66
+ recomputed: str | None
67
+ artifact_hash: str | None
68
+ timeout_ms: int | None
69
+ elapsed_ms: int | None = None
70
+
71
+
72
+ @dataclass(frozen=True, slots=True)
73
+ class FindingRecord:
74
+ """One deterministic trust or semantic integrity finding."""
75
+
76
+ code: str
77
+ detail: str
78
+ concept_id: str | None = None
79
+ item: str | None = None
80
+
81
+
82
+ @dataclass(frozen=True, slots=True)
83
+ class NoteRecord:
84
+ """Informational note emitted during bundle auditing or semantic grading."""
85
+
86
+ text: str
87
+ concept_id: str | None = None
88
+ item: str | None = None
89
+
90
+
91
+ @dataclass(frozen=True, slots=True)
92
+ class AuditReport:
93
+ """Structured report produced by ``perishables audit``."""
94
+
95
+ schema_version: str
96
+ tool_version: str
97
+ bundle: str
98
+ as_of: str
99
+ result: str
100
+ concepts_count: int
101
+ tiers: tuple[TierRecord, ...]
102
+ computations: tuple[ComputationRecord, ...]
103
+ notes: tuple[NoteRecord, ...]
104
+ findings: tuple[FindingRecord, ...]
105
+ exit_code: int
106
+
107
+ @property
108
+ def passed(self) -> bool:
109
+ """True when zero trust findings were emitted."""
110
+ return self.result == "PASS" and self.exit_code == 0
111
+
112
+ def raise_for_findings(self) -> None:
113
+ """Raise ``PerishablesError`` when any finding was convicted."""
114
+ if not self.passed:
115
+ codes = ", ".join(f.code for f in self.findings) or "unknown"
116
+ raise PerishablesError(
117
+ f"perishables audit failed on {self.bundle} ({len(self.findings)} findings: {codes})",
118
+ exit_code=self.exit_code,
119
+ )
120
+
121
+
122
+ @dataclass(frozen=True, slots=True)
123
+ class DriftReport:
124
+ """Structured report produced by ``perishables drift``."""
125
+
126
+ schema_version: str
127
+ tool_version: str
128
+ bundle: str
129
+ result: str
130
+ findings: tuple[FindingRecord, ...]
131
+ exit_code: int
132
+
133
+ @property
134
+ def clean(self) -> bool:
135
+ """True when all recorded source SHA-256 hashes match on disk."""
136
+ return self.result == "NONE" and self.exit_code == 0
137
+
138
+ def raise_for_findings(self) -> None:
139
+ """Raise ``PerishablesError`` when source drift was detected."""
140
+ if not self.clean:
141
+ raise PerishablesError(
142
+ f"perishables drift detected {len(self.findings)} drifted source(s) in {self.bundle}",
143
+ exit_code=self.exit_code,
144
+ )
145
+
146
+
147
+ @dataclass(frozen=True, slots=True)
148
+ class SemanticCounts:
149
+ """Normalized entity counts across a graded semantic definition."""
150
+
151
+ models: int
152
+ measures: int
153
+ dimensions: int
154
+ metrics: int
155
+
156
+
157
+ @dataclass(frozen=True, slots=True)
158
+ class GradeReport:
159
+ """Structured report produced by ``perishables grade`` or ``grade-*``."""
160
+
161
+ schema_version: str
162
+ tool_version: str
163
+ command: str
164
+ ecosystem: str | None
165
+ result: str
166
+ counts: SemanticCounts | None
167
+ findings: tuple[FindingRecord, ...]
168
+ notes: tuple[NoteRecord, ...]
169
+ reports: tuple["GradeReport", ...]
170
+ exit_code: int
171
+
172
+ @property
173
+ def passed(self) -> bool:
174
+ """True when zero semantic grading findings were emitted."""
175
+ return self.result == "PASS" and self.exit_code == 0
176
+
177
+ def raise_for_findings(self) -> None:
178
+ """Raise ``PerishablesError`` when semantic grading convicted findings."""
179
+ if not self.passed:
180
+ all_findings = self.findings or tuple(
181
+ f for sub in self.reports for f in sub.findings
182
+ )
183
+ codes = ", ".join(f.code for f in all_findings) or "unknown"
184
+ raise PerishablesError(
185
+ f"perishables {self.command} failed ({len(all_findings)} findings: {codes})",
186
+ exit_code=self.exit_code,
187
+ )
188
+
189
+
190
+ @dataclass(frozen=True, slots=True)
191
+ class CorpusFixtureRecord:
192
+ """Outcome for one fixture inside ``perishables corpus``."""
193
+
194
+ name: str
195
+ set: str
196
+ status: str
197
+ unchanged: bool
198
+ findings: tuple[str, ...]
199
+
200
+
201
+ @dataclass(frozen=True, slots=True)
202
+ class CorpusReport:
203
+ """Structured report produced by ``perishables corpus``."""
204
+
205
+ schema_version: str
206
+ tool_version: str
207
+ corpus_version: str
208
+ as_of: str
209
+ result: str
210
+ fixtures_count: int
211
+ failures_count: int
212
+ fixtures: tuple[CorpusFixtureRecord, ...]
213
+ exit_code: int
214
+
215
+ @property
216
+ def passed(self) -> bool:
217
+ """True when every reference fixture matched its planted labels."""
218
+ return self.result == "PASS" and self.failures_count == 0 and self.exit_code == 0
219
+
220
+
221
+ def find_binary(binary: PathInput | None = None) -> Path:
222
+ """Locate the bundled or installed ``perishables`` executable."""
223
+ if binary is not None:
224
+ candidate = Path(binary)
225
+ if candidate.is_file():
226
+ return candidate
227
+ raise FileNotFoundError(f"perishables binary not found at {candidate}")
228
+
229
+ env_override = os.environ.get("PERISHABLES_BIN", "").strip()
230
+ if env_override:
231
+ candidate = Path(env_override)
232
+ if candidate.is_file():
233
+ return candidate
234
+ raise FileNotFoundError(
235
+ f"PERISHABLES_BIN points to missing file {candidate}"
236
+ )
237
+
238
+ exe_names = (
239
+ ("perishables.exe", "perishables")
240
+ if os.name == "nt"
241
+ else ("perishables",)
242
+ )
243
+ search_dirs: list[Path] = []
244
+ scripts_dir = sysconfig.get_path("scripts")
245
+ if scripts_dir:
246
+ search_dirs.append(Path(scripts_dir))
247
+ py_dir = Path(sys.executable).resolve().parent
248
+ search_dirs.extend([py_dir, py_dir / "Scripts", py_dir / "bin"])
249
+
250
+ repo_root = Path(__file__).resolve().parents[2]
251
+ search_dirs.extend(
252
+ [
253
+ repo_root / "target" / "release",
254
+ repo_root / "target" / "debug",
255
+ ]
256
+ )
257
+
258
+ for directory in search_dirs:
259
+ for name in exe_names:
260
+ candidate = directory / name
261
+ if candidate.is_file():
262
+ return candidate
263
+
264
+ found = shutil.which("perishables")
265
+ if found:
266
+ return Path(found)
267
+
268
+ raise FileNotFoundError(
269
+ "could not locate the perishables executable; install the wheel or set PERISHABLES_BIN"
270
+ )
271
+
272
+
273
+ def _invoke_json(
274
+ args: Sequence[str],
275
+ *,
276
+ binary: PathInput | None = None,
277
+ ) -> tuple[dict[str, Any], int]:
278
+ exe = find_binary(binary)
279
+ completed = subprocess.run(
280
+ [str(exe), *args],
281
+ capture_output=True,
282
+ text=True,
283
+ encoding="utf-8",
284
+ check=False,
285
+ )
286
+ if completed.returncode not in (0, 1):
287
+ detail = completed.stderr.strip() or completed.stdout.strip() or "command failed"
288
+ raise PerishablesError(detail, exit_code=completed.returncode)
289
+ try:
290
+ payload = json.loads(completed.stdout)
291
+ except json.JSONDecodeError as exc:
292
+ raise PerishablesError(
293
+ f"failed to decode JSON output from perishables: {exc}",
294
+ exit_code=completed.returncode,
295
+ ) from exc
296
+ return payload, completed.returncode
297
+
298
+
299
+ def version(*, binary: PathInput | None = None) -> str:
300
+ """Return the version string reported by ``perishables --version``."""
301
+ exe = find_binary(binary)
302
+ completed = subprocess.run(
303
+ [str(exe), "--version"],
304
+ capture_output=True,
305
+ text=True,
306
+ encoding="utf-8",
307
+ check=False,
308
+ )
309
+ if completed.returncode != 0:
310
+ raise PerishablesError(
311
+ completed.stderr.strip() or "failed to query perishables version",
312
+ exit_code=completed.returncode,
313
+ )
314
+ parts = completed.stdout.strip().split()
315
+ return parts[-1] if parts else completed.stdout.strip()
316
+
317
+
318
+ def audit(
319
+ bundle_path: PathInput,
320
+ *,
321
+ as_of: str,
322
+ no_exec: bool = False,
323
+ timing: bool = False,
324
+ binary: PathInput | None = None,
325
+ ) -> AuditReport:
326
+ """Audit an Open Knowledge Format bundle at a pinned ``as_of`` instant."""
327
+ cmd = ["audit", os.fspath(bundle_path), "--as-of", as_of, "--format", "json"]
328
+ if no_exec:
329
+ cmd.append("--no-exec")
330
+ if timing:
331
+ cmd.append("--timing")
332
+ data, code = _invoke_json(cmd, binary=binary)
333
+ tiers = tuple(
334
+ TierRecord(
335
+ concept_id=row["concept_id"],
336
+ raw_tier=row["raw_tier"],
337
+ recomputed_tier=row["recomputed_tier"],
338
+ )
339
+ for row in data.get("tiers", ())
340
+ )
341
+ computations = tuple(
342
+ ComputationRecord(
343
+ concept_id=row["concept_id"],
344
+ verdict=row["verdict"],
345
+ reason=row.get("reason"),
346
+ claimed=row.get("claimed"),
347
+ recomputed=row.get("recomputed"),
348
+ artifact_hash=row.get("artifact_hash"),
349
+ timeout_ms=row.get("timeout_ms"),
350
+ elapsed_ms=row.get("elapsed_ms"),
351
+ )
352
+ for row in data.get("computations", ())
353
+ )
354
+ notes = tuple(
355
+ NoteRecord(text=row["text"], concept_id=row.get("concept_id"))
356
+ for row in data.get("notes", ())
357
+ )
358
+ findings = tuple(
359
+ FindingRecord(
360
+ code=row["code"],
361
+ detail=row["detail"],
362
+ concept_id=row.get("concept_id"),
363
+ )
364
+ for row in data.get("findings", ())
365
+ )
366
+ return AuditReport(
367
+ schema_version=data["schema_version"],
368
+ tool_version=data["tool_version"],
369
+ bundle=data["bundle"],
370
+ as_of=data["as_of"],
371
+ result=data["result"],
372
+ concepts_count=int(data["concepts_count"]),
373
+ tiers=tiers,
374
+ computations=computations,
375
+ notes=notes,
376
+ findings=findings,
377
+ exit_code=code,
378
+ )
379
+
380
+
381
+ def drift(
382
+ bundle_path: PathInput,
383
+ *,
384
+ binary: PathInput | None = None,
385
+ ) -> DriftReport:
386
+ """Verify SHA-256 content hashes of in-bundle OKF sources."""
387
+ data, code = _invoke_json(
388
+ ["drift", os.fspath(bundle_path), "--format", "json"],
389
+ binary=binary,
390
+ )
391
+ findings = tuple(
392
+ FindingRecord(
393
+ code=row["code"],
394
+ detail=row["detail"],
395
+ concept_id=row.get("concept_id"),
396
+ )
397
+ for row in data.get("findings", ())
398
+ )
399
+ return DriftReport(
400
+ schema_version=data["schema_version"],
401
+ tool_version=data["tool_version"],
402
+ bundle=data["bundle"],
403
+ result=data["result"],
404
+ findings=findings,
405
+ exit_code=code,
406
+ )
407
+
408
+
409
+ def _parse_grade_payload(data: dict[str, Any], exit_code: int) -> GradeReport:
410
+ raw_counts = data.get("counts")
411
+ counts = (
412
+ SemanticCounts(
413
+ models=int(raw_counts["models"]),
414
+ measures=int(raw_counts["measures"]),
415
+ dimensions=int(raw_counts["dimensions"]),
416
+ metrics=int(raw_counts["metrics"]),
417
+ )
418
+ if isinstance(raw_counts, dict)
419
+ else None
420
+ )
421
+ findings = tuple(
422
+ FindingRecord(
423
+ code=row["code"],
424
+ detail=row["detail"],
425
+ item=row.get("item"),
426
+ )
427
+ for row in data.get("findings", ())
428
+ )
429
+ notes = tuple(
430
+ NoteRecord(text=row["text"], item=row.get("item"))
431
+ for row in data.get("notes", ())
432
+ )
433
+ sub_reports = tuple(
434
+ _parse_grade_payload(sub, 1 if sub.get("result") == "FAIL" else 0)
435
+ for sub in data.get("reports", ())
436
+ )
437
+ return GradeReport(
438
+ schema_version=data["schema_version"],
439
+ tool_version=data["tool_version"],
440
+ command=data["command"],
441
+ ecosystem=data.get("ecosystem"),
442
+ result=data["result"],
443
+ counts=counts,
444
+ findings=findings,
445
+ notes=notes,
446
+ reports=sub_reports,
447
+ exit_code=exit_code,
448
+ )
449
+
450
+
451
+ def grade(
452
+ paths: PathInput | Sequence[PathInput],
453
+ *,
454
+ ecosystem: str | None = None,
455
+ changed_at: str | None = None,
456
+ binary: PathInput | None = None,
457
+ ) -> GradeReport:
458
+ """Grade one or more semantic-layer definitions across supported ecosystems."""
459
+ if isinstance(paths, (str, os.PathLike)):
460
+ file_args = [os.fspath(paths)]
461
+ else:
462
+ file_args = [os.fspath(p) for p in paths]
463
+ if not file_args:
464
+ raise PerishablesError("grade requires at least one path", exit_code=2)
465
+
466
+ cmd = ["grade", *file_args, "--format", "json"]
467
+ if ecosystem is not None:
468
+ cmd.extend(["--ecosystem", ecosystem])
469
+ if changed_at is not None:
470
+ cmd.extend(["--changed-at", changed_at])
471
+ data, code = _invoke_json(cmd, binary=binary)
472
+ return _parse_grade_payload(data, code)
473
+
474
+
475
+ def corpus(
476
+ fixtures_dir: PathInput | None = None,
477
+ *,
478
+ binary: PathInput | None = None,
479
+ ) -> CorpusReport:
480
+ """Run the planted-defect reference corpus gate."""
481
+ cmd = ["corpus"]
482
+ if fixtures_dir is not None:
483
+ cmd.append(os.fspath(fixtures_dir))
484
+ cmd.extend(["--format", "json"])
485
+ data, code = _invoke_json(cmd, binary=binary)
486
+ fixtures = tuple(
487
+ CorpusFixtureRecord(
488
+ name=row["name"],
489
+ set=row["set"],
490
+ status=row["status"],
491
+ unchanged=bool(row["unchanged"]),
492
+ findings=tuple(row.get("findings", ())),
493
+ )
494
+ for row in data.get("fixtures", ())
495
+ )
496
+ return CorpusReport(
497
+ schema_version=data["schema_version"],
498
+ tool_version=data["tool_version"],
499
+ corpus_version=data["corpus_version"],
500
+ as_of=data["as_of"],
501
+ result=data["result"],
502
+ fixtures_count=int(data["fixtures_count"]),
503
+ failures_count=int(data["failures_count"]),
504
+ fixtures=fixtures,
505
+ exit_code=code,
506
+ )
perishables/py.typed ADDED
File without changes
@@ -0,0 +1,236 @@
1
+ Metadata-Version: 2.4
2
+ Name: perishables
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: License :: OSI Approved :: Apache Software License
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Rust
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Typing :: Typed
22
+ License-File: LICENSE-APACHE
23
+ License-File: LICENSE-MIT
24
+ Summary: Deterministic trust-claim auditor for Open Knowledge Format bundles and cross-ecosystem semantic layers.
25
+ Keywords: okf,semantic-layer,dbt,lookml,snowflake,databricks,audit
26
+ Author: David Engelmann
27
+ License-Expression: MIT OR Apache-2.0
28
+ Requires-Python: >=3.10
29
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
30
+ Project-URL: Changelog, https://github.com/david-engelmann/perishables/blob/main/CHANGELOG.md
31
+ Project-URL: Documentation, https://github.com/david-engelmann/perishables/blob/main/docs/README.md
32
+ Project-URL: Homepage, https://github.com/david-engelmann/perishables
33
+ Project-URL: Issues, https://github.com/david-engelmann/perishables/issues
34
+ Project-URL: Repository, https://github.com/david-engelmann/perishables
35
+
36
+ <p align="center">
37
+ <a href="https://github.com/david-engelmann/perishables">
38
+ <picture>
39
+ <source media="(prefers-color-scheme: dark)" srcset="docs/media/perishables-lockup-dark.svg">
40
+ <img src="docs/media/perishables-lockup-light.svg" alt="perishables" height="56">
41
+ </picture>
42
+ </a>
43
+ </p>
44
+
45
+ <h3 align="center">Point-in-time trust auditor for Open Knowledge Format bundles and seven analytics semantic layers, in zero-dependency Rust.</h3>
46
+
47
+ <p align="center">
48
+ Verified claims have a shelf life. Schema validators check whether metadata fields parse. <code>perishables</code> checks whether those claims remain current, provenance-intact, acyclic, and computationally true at a pinned instant in time, with zero external crates in its dependency tree.
49
+ </p>
50
+
51
+ <p align="center">
52
+ <a href="docs/README.md"><b>Docs</b></a> ·
53
+ <a href="docs/ARCHITECTURE.md">Architecture</a> ·
54
+ <a href="docs/DESIGN.md">OKF Trust Model</a> ·
55
+ <a href="docs/CROSS-ECOSYSTEM.md">7 Semantic Layers</a> ·
56
+ <a href="docs/CLAIMS.md">Claims &amp; Corpus</a> ·
57
+ <a href="https://github.com/david-engelmann/perishables/releases">Releases</a>
58
+ </p>
59
+
60
+ <p align="center">
61
+ <a href="https://github.com/david-engelmann/perishables/actions/workflows/ci.yml?query=branch%3Amain"><img src="https://github.com/david-engelmann/perishables/actions/workflows/ci.yml/badge.svg?branch=main&event=push" alt="CI on main"></a>
62
+ <a href="https://crates.io/crates/perishables"><img src="https://img.shields.io/crates/v/perishables?color=c2410c&label=crates.io" alt="crates.io version"></a>
63
+ <a href="https://pypi.org/project/perishables/"><img src="https://img.shields.io/pypi/v/perishables?color=c2410c&label=pypi" alt="PyPI version"></a>
64
+ <a href="https://docs.rs/perishables-core"><img src="https://img.shields.io/docsrs/perishables-core" alt="docs.rs"></a>
65
+ <a href="Cargo.lock"><img src="https://img.shields.io/badge/external%20deps-0-success" alt="0 external dependencies"></a>
66
+ <a href="LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue" alt="MIT or Apache-2.0 license"></a>
67
+ </p>
68
+
69
+ <p align="center">
70
+ <img src="docs/media/money-shot.gif"
71
+ alt="A two-part view with live point-in-time evidence and corpus status above and real perishables CLI runs below, catching a lapsed verification, an Attested Computation mismatch, SHA-256 source drift, native LookML dangling references and name collisions, and passing all 19 reference corpus fixtures with zero mutations"
72
+ width="900">
73
+ </p>
74
+
75
+ <p align="center"><sub>Every terminal line above comes from real executions of the <code>perishables</code> release binary against checked-in corpus fixtures and LookML models.</sub></p>
76
+
77
+ ## Why perishables
78
+
79
+ Documentation bundles, AI context packs, and enterprise semantic layers rot quietly. A metric verified in June is regenerated in October while its frontmatter still reads `human-reviewed`. A raw CSV extract changes on disk while footnotes still cite the old numbers. A LookML measure references a deleted base field or introduces a duplicate business synonym. Schema validators pass every single one of those files because the syntax is still valid YAML, JSON, or LookML.
80
+
81
+ `perishables` evaluates whether trust claims still hold at an explicit `--as-of` instant.
82
+
83
+ - **Recomputed trust tiers.** Ignores stale self-reported tiers when underlying content was regenerated after its last verification (`LAPSED_VERIFICATION`), and flags `stable` concepts whose `stale_after` horizon has passed (`STALE_BUT_STABLE`).
84
+ - **Cryptographic provenance and supersession integrity.** Hashes bundled source files with in-tree FIPS 180-4 SHA-256 to catch silent byte drift (`SOURCE_DRIFT`), verifies every `[^id]` footnote and in-bundle path, and walks `superseded_by` graphs to convict cycles, missing targets, and root-escaping `../` paths.
85
+ - **Re-executed `Attested Computation` blocks.** Pre-screens deterministic Python blocks through `ast.parse`, binds typed parameters safely inside an isolated `0700` scratch folder with memory and timeout bounds, and compares the live result against the claimed figure (`ATTESTED_RESULT_MISMATCH`, `UNATTESTED_CLAIM`). Pass `--no-exec` when auditing untrusted bundles without subprocess execution.
86
+ - **Format-blind grading across seven semantic layers.** Hand-written JSON, YAML, JavaScript, and native LookML readers normalize definitions from **dbt**, **Apache Ossie**, **Snowflake**, **Databricks Genie**, **Cube**, **Looker / LookML**, and **AtScale** into one `Definition` graph, catching dangling references, name and synonym collisions, fan-trap joins, lapsed verified queries, and incomplete ground-truth benchmarks.
87
+ - **Zero external crates, zero ambient state, zero bundle writes.** `Cargo.lock` contains only the three workspace crates. No check reads `SystemTime::now()` or filesystem `mtime`, and `perishables corpus` hashes all 19 reference fixtures before and after auditing to prove zero directory mutation.
88
+
89
+ <p align="center">
90
+ <picture>
91
+ <source media="(prefers-color-scheme: dark)" srcset="docs/media/shelf-life-proof-dark.svg">
92
+ <img src="docs/media/shelf-life-proof-light.svg"
93
+ alt="Side-by-side comparison showing syntax-only schema validation passing four decayed or broken claims while perishables at --as-of 2026-11-20 convicts LAPSED_VERIFICATION, SOURCE_DRIFT, ATTESTED_RESULT_MISMATCH, and DANGLING_METRIC_REFERENCE"
94
+ width="860">
95
+ </picture>
96
+ </p>
97
+
98
+ ## How it works
99
+
100
+ <p align="center">
101
+ <picture>
102
+ <source media="(prefers-color-scheme: dark)" srcset="docs/media/how-it-works-dark.svg">
103
+ <img src="docs/media/how-it-works-light.svg"
104
+ alt="OKF bundles and seven analytics semantic ecosystems flow into perishables-core and perishables-semantic under a pinned AuditClock with zero external dependencies, emitting deterministic terminal, SARIF 2.1.0, GitHub Actions, and JSON verdicts"
105
+ width="860">
106
+ </picture>
107
+ </p>
108
+
109
+ | Crate | Kind | External runtime deps | Role |
110
+ | --- | --- | --- | --- |
111
+ | [`perishables-core`](crates/perishables-core/README.md) | library | none (`std` only) | OKF bundle loader, YAML frontmatter and Markdown fence parser, proleptic Gregorian calendar math, FIPS 180-4 SHA-256, and the locked four-call trust surface. |
112
+ | [`perishables-semantic`](crates/perishables-semantic/README.md) | library | none (`std` only) | Hand-written JSON, YAML, JS, and native LookML readers plus format-blind semantic grading rules across seven analytics ecosystems. |
113
+ | [`perishables`](crates/perishables/README.md) | binary and library | none (`std` only) | CLI dispatcher (`audit`, `drift`, `corpus`, `grade`, `grade-*`), AST-screened Python sandbox executor, and `text`, `json`, `sarif`, and `github` formatters. |
114
+
115
+ ## Quickstart
116
+
117
+ Install `perishables` from PyPI, from crates.io, with `cargo binstall perishables`, or from the prebuilt Linux, macOS, and Windows archives on GitHub Releases.
118
+
119
+ ```sh
120
+ pip install perishables
121
+ # or run directly without installing
122
+ uvx perishables --version
123
+ # or install from crates.io
124
+ cargo install perishables
125
+ ```
126
+
127
+ The PyPI wheel bundles the native Rust `perishables` binary alongside a typed standard-library Python SDK.
128
+
129
+ ```python
130
+ import perishables
131
+
132
+ report = perishables.audit("corpus/fixtures/clean-team-verified", as_of="2026-11-20")
133
+ report.raise_for_findings()
134
+ ```
135
+
136
+ ### Audit an OKF knowledge bundle
137
+
138
+ Every `audit` run takes an explicit `--as-of` date or RFC 3339 timestamp so results stay reproducible forever across clones and machines.
139
+
140
+ ```sh
141
+ perishables audit ./bundle --as-of 2026-11-20
142
+ perishables audit ./bundle --as-of 2026-11-20 --format sarif --output audit.sarif
143
+ perishables audit ./untrusted-bundle --as-of 2026-11-20 --no-exec
144
+ perishables drift ./bundle
145
+ perishables corpus
146
+ ```
147
+
148
+ Exit code `0` means zero gate findings, `1` means one or more gate findings, and `2` means a command usage or input parse error.
149
+
150
+ ### Grade semantic layers across seven ecosystems
151
+
152
+ Run ecosystem-specific subcommands or the unified `perishables grade` command with `--format text|json|sarif|github`.
153
+
154
+ ```sh
155
+ perishables grade-dbt manifest.json
156
+ perishables grade-ossie model.yaml
157
+ perishables grade-snowflake view.yaml --changed-at 2026-11-20
158
+ perishables grade-databricks space.json
159
+ perishables grade-cube model.js
160
+ perishables grade-looker orders.view.lookml customers.view.lookml sales.model.lookml
161
+ perishables grade-atscale model.json
162
+ perishables grade model.yaml orders.view.lookml --format sarif --output semantic.sarif
163
+ ```
164
+
165
+ ### Finding codes at a glance
166
+
167
+ | Surface | Finding codes enforced |
168
+ | --- | --- |
169
+ | OKF bundle audit (`12` codes, `19` corpus fixtures) | `LAPSED_VERIFICATION`, `MALFORMED_VERIFICATION`, `SUPERSESSION_CYCLE`, `DANGLING_SUPERSEDED_BY`, `SUPERSEDED_WITHOUT_DEPRECATED`, `STALE_BUT_STABLE`, `UNPARSEABLE_STALE_AFTER`, `ATTESTED_RESULT_MISMATCH`, `UNATTESTED_CLAIM`, `UNRESOLVED_CITATION`, `MISSING_SOURCE`, `SOURCE_DRIFT` |
170
+ | Cross-ecosystem semantic grade (`6` rule codes + notes) | `DANGLING_METRIC_REFERENCE`, `NAME_COLLISION`, `LAPSED_VERIFIED_QUERY`, `DANGLING_RELATIONSHIP`, `BENCHMARK_WITHOUT_ANSWER`, `AMBIGUOUS_JOIN_PATH` |
171
+
172
+ ### Embed in Rust or GitHub Actions
173
+
174
+ ```rust
175
+ use perishables_core::{
176
+ AuditClock, Bundle, check_currency, check_drift, check_freshness,
177
+ check_provenance, check_supersession, recompute_tier,
178
+ };
179
+ use std::path::Path;
180
+
181
+ let clock = AuditClock::parse("2026-11-20").expect("valid date");
182
+ let bundle = Bundle::load(Path::new("corpus/fixtures/clean-healthy-chain"))
183
+ .expect("bundle loads");
184
+
185
+ for concept in &bundle.concepts {
186
+ let tier = recompute_tier(concept, &clock);
187
+ println!("{} -> {}", tier.concept_id, tier.recomputed_tier.name());
188
+ }
189
+ assert!(check_currency(&bundle, &clock).is_empty());
190
+ assert!(check_supersession(&bundle).is_empty());
191
+ assert!(check_freshness(&bundle, &clock).is_empty());
192
+ assert!(check_provenance(&bundle).is_empty());
193
+ assert!(check_drift(&bundle).is_empty());
194
+ ```
195
+
196
+ ```yaml
197
+ - uses: david-engelmann/perishables@v0.1.0
198
+ with:
199
+ command: audit
200
+ path: ./knowledge-bundle
201
+ as-of: "2026-11-20"
202
+ format: github
203
+ ```
204
+
205
+ ## Verification
206
+
207
+ Run the full zero-dependency gate locally across formatting, Clippy, unit and integration suites, the 19-fixture planted-defect corpus, rustdoc, and the library example.
208
+
209
+ ```sh
210
+ cargo fmt --all -- --check
211
+ cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
212
+ cargo test --workspace --all-features --locked
213
+ cargo run --locked -- corpus
214
+ RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
215
+ cargo run -p perishables-core --example audit_bundle --locked
216
+ ```
217
+
218
+ ## Documentation
219
+
220
+ | If you want to... | Read |
221
+ | --- | --- |
222
+ | Browse every specification and guide | [Documentation index](docs/README.md) |
223
+ | Understand crate boundaries and determinism guarantees | [Architecture](docs/ARCHITECTURE.md) · [Decisions](DECISIONS.md) |
224
+ | Read the OKF trust-tier, currency, and provenance specification | [OKF trust design](docs/DESIGN.md) · [Attested Computation](docs/ATTESTATION.md) |
225
+ | See how all seven analytics ecosystems map into one grading model | [Cross-ecosystem grading](docs/CROSS-ECOSYSTEM.md) · [Native LookML reader](docs/LOOKML.md) |
226
+ | Verify every claim against its corpus fixture or test | [Claims and corpus traceability](docs/CLAIMS.md) · [Reference corpus](corpus/README.md) |
227
+ | Review Python sandbox hardening, `--no-exec`, and release notes | [Security policy](SECURITY.md) · [Changelog](CHANGELOG.md) |
228
+
229
+ ## Contributing
230
+
231
+ [CONTRIBUTING.md](CONTRIBUTING.md) details the zero-dependency rule, planted-defect fixture requirements, and local verification gates.
232
+
233
+ ## License
234
+
235
+ Licensed under either of [MIT](LICENSE-MIT) or [Apache License, Version 2.0](LICENSE-APACHE) at your option.
236
+
@@ -0,0 +1,11 @@
1
+ LICENSE-APACHE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
+ LICENSE-MIT,sha256=wY4SnbrT-PeIz3hsDxKrA58U79U43FWVyIvV6hfVQe4,1072
3
+ perishables/__init__.py,sha256=iTxOMB80NGMQMI7YLode6ij9w3L7KD-nlTyyqjcKhag,14587
4
+ perishables/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ perishables-0.1.0.data/scripts/perishables.exe,sha256=mREkVQIbVT1i5dYu-vsy51b4o0Z161DEZI4N2tXcm6A,1064960
6
+ perishables-0.1.0.dist-info/METADATA,sha256=eOe6Uf2SCmTrxLLeTh3FV-DNoJPNX_bOYJXXVvWykMM,13448
7
+ perishables-0.1.0.dist-info/WHEEL,sha256=Uvw7WSmy7Kj2FBk8Va4L_dq4MDW8X5Ynby-pOX3ZNS0,94
8
+ perishables-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
9
+ perishables-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=wY4SnbrT-PeIz3hsDxKrA58U79U43FWVyIvV6hfVQe4,1072
10
+ perishables-0.1.0.dist-info/sboms/perishables.cyclonedx.json,sha256=nhYZ27AJOdXFQMBrs7PdRJvtVrDZw4KsvoRb-v6imiI,4203
11
+ perishables-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Engelmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,130 @@
1
+ {
2
+ "bomFormat": "CycloneDX",
3
+ "specVersion": "1.5",
4
+ "version": 1,
5
+ "serialNumber": "urn:uuid:8efca689-2f74-4d87-be4f-5c405959bb1d",
6
+ "metadata": {
7
+ "timestamp": "2026-11-26T00:47:49.668309700Z",
8
+ "tools": [
9
+ {
10
+ "vendor": "CycloneDX",
11
+ "name": "cargo-cyclonedx",
12
+ "version": "0.5.9"
13
+ }
14
+ ],
15
+ "component": {
16
+ "type": "application",
17
+ "bom-ref": "path+file:///D:/a/perishables/perishables/crates/perishables#0.1.0",
18
+ "name": "perishables",
19
+ "version": "0.1.0",
20
+ "description": "Deterministic trust-claim auditor for Open Knowledge Format bundles and cross-ecosystem semantic layers.",
21
+ "scope": "required",
22
+ "licenses": [
23
+ {
24
+ "expression": "MIT OR Apache-2.0"
25
+ }
26
+ ],
27
+ "purl": "pkg:cargo/perishables@0.1.0?download_url=file://.",
28
+ "externalReferences": [
29
+ {
30
+ "type": "documentation",
31
+ "url": "https://docs.rs/perishables"
32
+ },
33
+ {
34
+ "type": "vcs",
35
+ "url": "https://github.com/david-engelmann/perishables"
36
+ }
37
+ ],
38
+ "components": [
39
+ {
40
+ "type": "library",
41
+ "bom-ref": "path+file:///D:/a/perishables/perishables/crates/perishables#0.1.0 bin-target-0",
42
+ "name": "perishables",
43
+ "version": "0.1.0",
44
+ "purl": "pkg:cargo/perishables@0.1.0?download_url=file://.#src/lib.rs"
45
+ },
46
+ {
47
+ "type": "application",
48
+ "bom-ref": "path+file:///D:/a/perishables/perishables/crates/perishables#0.1.0 bin-target-1",
49
+ "name": "perishables",
50
+ "version": "0.1.0",
51
+ "purl": "pkg:cargo/perishables@0.1.0?download_url=file://.#src/main.rs"
52
+ }
53
+ ]
54
+ },
55
+ "properties": [
56
+ {
57
+ "name": "cdx:rustc:sbom:target:all_targets",
58
+ "value": "true"
59
+ }
60
+ ]
61
+ },
62
+ "components": [
63
+ {
64
+ "type": "library",
65
+ "bom-ref": "path+file:///D:/a/perishables/perishables/crates/perishables-core#0.1.0",
66
+ "name": "perishables-core",
67
+ "version": "0.1.0",
68
+ "description": "Deterministic trust-layer checks for Open Knowledge Format bundles. Tier recompute, verification currency, supersession chains, freshness, provenance, and source drift.",
69
+ "scope": "required",
70
+ "licenses": [
71
+ {
72
+ "expression": "MIT OR Apache-2.0"
73
+ }
74
+ ],
75
+ "purl": "pkg:cargo/perishables-core@0.1.0?download_url=file://..\\perishables-core",
76
+ "externalReferences": [
77
+ {
78
+ "type": "documentation",
79
+ "url": "https://docs.rs/perishables-core"
80
+ },
81
+ {
82
+ "type": "vcs",
83
+ "url": "https://github.com/david-engelmann/perishables"
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "type": "library",
89
+ "bom-ref": "path+file:///D:/a/perishables/perishables/crates/perishables-semantic#0.1.0",
90
+ "name": "perishables-semantic",
91
+ "version": "0.1.0",
92
+ "description": "Cross-ecosystem semantic-layer trust grader covering dbt, Apache Ossie, Snowflake, Databricks Genie, Cube, Looker and LookML, and AtScale.",
93
+ "scope": "required",
94
+ "licenses": [
95
+ {
96
+ "expression": "MIT OR Apache-2.0"
97
+ }
98
+ ],
99
+ "purl": "pkg:cargo/perishables-semantic@0.1.0?download_url=file://..\\perishables-semantic",
100
+ "externalReferences": [
101
+ {
102
+ "type": "documentation",
103
+ "url": "https://docs.rs/perishables-semantic"
104
+ },
105
+ {
106
+ "type": "vcs",
107
+ "url": "https://github.com/david-engelmann/perishables"
108
+ }
109
+ ]
110
+ }
111
+ ],
112
+ "dependencies": [
113
+ {
114
+ "ref": "path+file:///D:/a/perishables/perishables/crates/perishables#0.1.0",
115
+ "dependsOn": [
116
+ "path+file:///D:/a/perishables/perishables/crates/perishables-core#0.1.0",
117
+ "path+file:///D:/a/perishables/perishables/crates/perishables-semantic#0.1.0"
118
+ ]
119
+ },
120
+ {
121
+ "ref": "path+file:///D:/a/perishables/perishables/crates/perishables-core#0.1.0"
122
+ },
123
+ {
124
+ "ref": "path+file:///D:/a/perishables/perishables/crates/perishables-semantic#0.1.0",
125
+ "dependsOn": [
126
+ "path+file:///D:/a/perishables/perishables/crates/perishables-core#0.1.0"
127
+ ]
128
+ }
129
+ ]
130
+ }