perishables
perishables is a deterministic, point-in-time trust auditor for Open Knowledge Format (OKF) bundles and seven analytics semantic layers, implemented in safe Rust over std with zero external runtime or build crates.
Why Syntax Validation Passes Decayed Truth
Schema linters verify that YAML, JSON, or LookML parses structurally. perishables evaluates whether verification timestamps postdate generation, stability horizons hold at --as-of, referenced source files match their FIPS 180-4 SHA-256 digests, AST-screened Attested Computation blocks reproduce claimed numbers, and semantic metric graphs resolve cleanly.
Point-in-Time Bundle Audit & Seven-Ecosystem Semantic Graph
- Pinned
AuditClock(perishables-core+perishables). Zero ambient clock ormtimereads; derivesunverified,machine-confirmed, orhuman-reviewedstrictly from current events, checksstale_afterandsuperseded_bygraphs, hashes bundled sources, and runspython3 -I -Binside an isolated0700scratch directory (--no-execfor untrusted bundles). - Unified
Definitiongrading (perishables-semantic). Native zero-dependency readers normalize dbt, Apache Ossie, Snowflake, Databricks Genie, Cube, Looker / native LookML, and AtScale models into one graph to convict dangling references, case-folded synonym collisions, lapsed verified queries, broken joins, empty benchmarks, and join fan-traps.
Chapters in This Book
- Quickstart: Install
perishables, audit OKF bundles, grade semantic models, and configure GitHub Actions. - CLI and Python SDK Reference: Exit codes (
0,1,2),text/json/sarif/githuboutput schemas, and typed Python dataclasses. - OKF Trust Model & Attested Computation: Normative rules for currency, tiers, supersession, provenance, and Python AST sandboxing.
- Seven-Ecosystem Grading & Native LookML Reader: Vendor normalization rules, LookML lexer/parser scope, and
extends/includeresolution. - Claims & Corpus, Comparison & FAQ: 19-fixture traceability matrix, tool comparisons, and operational FAQs.
Quickstart
1. Install perishables
Choose whichever channel matches your environment. None of the prebuilt channels require a Rust compiler.
# PyPI wheel (bundles native Rust CLI + typed Python SDK)
pip install perishables
# Run directly with uv without a persistent install
uvx perishables --version
# Prebuilt Linux / macOS tarball verified against SHA256SUMS
curl -fsSL https://raw.githubusercontent.com/david-engelmann/perishables/main/install.sh | sh
# Build from source via crates.io (or download prebuilt via cargo-binstall)
cargo install perishables
Verify the installed binary:
perishables --version
2. Audit an Open Knowledge Format bundle
Every audit invocation takes an explicit --as-of date (YYYY-MM-DD) or UTC RFC 3339 timestamp (YYYY-MM-DDTHH:MM:SSZ) so results never depend on the host wall clock:
# Clean control bundle (exits 0)
perishables audit corpus/fixtures/clean-team-verified --as-of 2026-11-20
# Planted lapsed-verification bundle (exits 1 with LAPSED_VERIFICATION)
perishables audit corpus/fixtures/t1-lapsed --as-of 2026-11-20
# Audit an untrusted bundle without spawning Python subprocesses
perishables audit ./untrusted-bundle --as-of 2026-11-20 --no-exec
# Check SHA-256 source hashes independently
perishables drift ./bundle
3. Grade analytics semantic layers
Grade individual vendor files with grade-<ecosystem> or pass multiple files across ecosystems to perishables grade:
perishables grade-dbt manifest.json
perishables grade-ossie model.yaml
perishables grade-snowflake view.yaml --changed-at 2026-11-20
perishables grade-databricks space.json
perishables grade-cube model.js
perishables grade-looker orders.view.lookml customers.view.lookml sales.model.lookml
perishables grade-atscale model.json
# Unified multi-file SARIF 2.1.0 report
perishables grade model.yaml orders.view.lookml --format sarif --output semantic.sarif
4. Drive from Python
The perishables package provides frozen, typed standard-library dataclasses over the bundled binary:
from pathlib import Path
import tempfile
import perishables
# 1. Audit a clean OKF bundle
clean = perishables.audit("corpus/fixtures/clean-team-verified", as_of="2026-11-20")
clean.raise_for_findings()
# 2. Emit SARIF 2.1.0 for a lapsed bundle
with tempfile.TemporaryDirectory() as tmp:
sarif_path = Path(tmp) / "audit.sarif"
sarif = perishables.audit_sarif(
"corpus/fixtures/t1-lapsed",
as_of="2026-11-20",
no_exec=True,
output=sarif_path,
)
assert sarif["runs"][0]["results"][0]["ruleId"] == "LAPSED_VERIFICATION"
# 3. Grade semantic definitions across dbt, LookML, and Snowflake
lookml = perishables.grade_looker("crates/perishables-semantic/tests/fixtures/lookml-clean.lookml")
lookml.raise_for_findings()
5. Wire into GitHub Actions
Use the composite action at david-engelmann/perishables@v0.1.4 to annotate pull requests directly:
name: Trust Gate
on: [pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: david-engelmann/perishables@v0.1.4
with:
command: audit
path: ./knowledge-bundle
as-of: "2026-11-20"
format: github
- uses: david-engelmann/perishables@v0.1.4
with:
command: grade-looker
path: "views/orders.view.lookml models/sales.model.lookml"
format: github
6. Enable shell tab completions
Generate shell completions for bash, zsh, fish, or powershell:
python3 -m perishables completions bash > ~/.local/share/bash-completion/completions/perishables
python3 -m perishables completions zsh > ~/.zfunc/_perishables
python3 -m perishables completions fish > ~/.config/fish/completions/perishables.fish
CLI and Python SDK Reference
CLI subcommands
| Command | Synopsis | Purpose |
|---|---|---|
audit | perishables audit <BUNDLE> --as-of <TIMESTAMP> [OPTIONS] | Recompute trust tiers, check currency, supersession, freshness, provenance, SHA-256 drift, and Attested Computation results |
drift | perishables drift <BUNDLE> [OPTIONS] | Verify recorded sources[].sha256 digests against on-disk bundle files |
corpus | perishables corpus [CORPUS_DIR | FIXTURES_DIR] [OPTIONS] | Run all 19 reference fixtures against LABEL.toml expectations and verify zero directory mutation |
grade | perishables grade <FILE>... [--ecosystem <NAME>] [OPTIONS] | Grade one or more semantic-layer files with automatic or explicit ecosystem selection |
grade-dbt | perishables grade-dbt <MANIFEST.JSON> [OPTIONS] | Grade dbt manifest.json or semantic_manifest.json |
grade-ossie | perishables grade-ossie <MODEL.JSON|MODEL.YAML> [OPTIONS] | Grade Apache Ossie JSON or YAML semantic models |
grade-snowflake | perishables grade-snowflake <VIEW.YAML> [--changed-at <TS>] [OPTIONS] | Grade Snowflake semantic view YAML exports |
grade-databricks | perishables grade-databricks <SPACE.JSON> [OPTIONS] | Grade Databricks Genie serialized_space JSON |
grade-cube | perishables grade-cube <FILE> [OPTIONS] | Grade Cube /v1/meta JSON, .yaml, or declarative .js models |
grade-looker | perishables grade-looker <MODEL.JSON|FILE.LOOKML...> [OPTIONS] | Grade Looker API JSON or single/multi-file native .lookml projects |
grade-atscale | perishables grade-atscale <MODEL.JSON> [OPTIONS] | Grade AtScale JSON model exports |
Common CLI flags
--as-of <YYYY-MM-DD|RFC3339>: Required onaudit. Sets the pinned evaluation instant (AuditClock).--changed-at <YYYY-MM-DD|RFC3339|EPOCH>: Optional ongradeandgrade-snowflake. Supplies the semantic view's last-altered timestamp forLAPSED_VERIFIED_QUERY.--ecosystem <dbt|ossie|snowflake|databricks|cube|looker|atscale>: Pins the reader used byperishables grade.--format <text|json|sarif|github>: Selects output format (corpussupportstextandjson; all other commands support all four).--output <PATH>/-o <PATH>: Writes the rendered report toPATH. Forauditanddrift,PATHmust lie outside the audited bundle directory.--no-exec: Skips Python subprocess execution ofAttested Computationblocks duringaudit. Concepts claiming an attested result emitUNATTESTED_CLAIM.--timing: Includes wall-clockelapsed_mson executed computations (omitted by default for byte-identical determinism).
Exit codes
| Code | Meaning |
|---|---|
0 | Clean pass (zero gate findings) |
1 | Gate failure (one or more trust findings, semantic findings, or corpus mismatches) |
2 | Usage error, unreadable path, or input syntax error |
Finding code summary
OKF bundle audit (12 codes)
| Code | Trigger |
|---|---|
LAPSED_VERIFICATION | Verification at predates generated.at, causing recomputed_tier to drop below raw_tier |
MALFORMED_VERIFICATION | Verification entry lacks by actor or parseable at timestamp |
DANGLING_SUPERSEDED_BY | superseded_by points to a missing concept, external URI, or root-escaping ../ path |
SUPERSESSION_CYCLE | superseded_by chain revisits a concept or exceeds 64 hops |
SUPERSEDED_WITHOUT_DEPRECATED | Concept carries superseded_by while status is not deprecated |
STALE_BUT_STABLE | Pinned AuditClock is at or past stale_after while status is stable |
UNPARSEABLE_STALE_AFTER | stale_after fails calendar or RFC 3339 parsing |
ATTESTED_RESULT_MISMATCH | Deterministic Python re-execution succeeded and differed from claimed_result |
UNATTESTED_CLAIM | Concept claims an attested result whose computation is missing, non-deterministic, failed, non-local, or skipped via --no-exec |
UNRESOLVED_CITATION | Markdown body cites [^label] with no matching sources[].id |
MISSING_SOURCE | In-bundle sources[].resource file does not exist in the bundle inventory |
SOURCE_DRIFT | On-disk file SHA-256 digest differs from sources[].sha256 |
Cross-ecosystem semantic grading (6 codes)
| Code | Trigger |
|---|---|
DANGLING_METRIC_REFERENCE | Metric, LookML measure/dimension SQL, Cube view, or AtScale hierarchy references a missing field, measure, metric, or attribute |
NAME_COLLISION | Two or more items or synonym aliases claim the same case-insensitive display name |
LAPSED_VERIFIED_QUERY | Verified query verified_at predates --changed-at |
DANGLING_RELATIONSHIP | Relationship, join, or LookML extends names a missing model, table, cube, or view |
BENCHMARK_WITHOUT_ANSWER | Stored ground-truth benchmark or verified query has an empty question or empty SQL |
AMBIGUOUS_JOIN_PATH | Direct and multi-hop relationships connect the same model pair at conflicting grains |
Python SDK reference (perishables)
All functions live at the top level of import perishables and rely exclusively on the Python standard library.
Core functions
audit(bundle_path, *, as_of, no_exec=False, timing=False, binary=None) -> AuditReportaudit_sarif(bundle, *, as_of, no_exec=False, output=None, binary=None) -> dict[str, Any]drift(bundle_path, *, binary=None) -> DriftReportcorpus(fixtures_dir=None, *, binary=None) -> CorpusReportgrade(paths, *, ecosystem=None, changed_at=None, binary=None) -> GradeReportgrade_dbt(manifest, *, binary=None) -> GradeReportgrade_ossie(model, *, binary=None) -> GradeReportgrade_snowflake(view, *, changed_at=None, binary=None) -> GradeReportgrade_databricks(space, *, binary=None) -> GradeReportgrade_cube(paths, *, binary=None) -> GradeReportgrade_looker(paths, *, binary=None) -> GradeReportgrade_atscale(model, *, binary=None) -> GradeReportgrade_sarif(paths, *, ecosystem=None, changed_at=None, output=None, binary=None) -> dict[str, Any]completions(shell="bash") -> str("bash","zsh","fish","powershell")version(*, binary=None) -> strfind_binary(binary=None) -> Path(honorsPERISHABLES_BIN)
Report types and error handling
AuditReport.passed,GradeReport.passed,CorpusReport.passed, andDriftReport.cleanreturnbool.- Calling
.raise_for_findings()on anAuditReport,GradeReport, orDriftReportraisesPerishablesError(exit_code=1) when any gate finding is present. - Invalid CLI arguments, missing files, or malformed JSON/YAML/LookML inputs raise
PerishablesErrorwithexit_code=2.
OKF trust model and design specification
perishables audits whether the trust claims inside an Open Knowledge Format v0.3 bundle hold at a pinned moment in time. Structural validators check whether frontmatter fields are well-formed. perishables checks whether those claims remain current, coherent, and supported by their sources and computations.
Trust model
Verification currency and tier recomputation
Under OKF v0.3 SPEC 5.2 and 5.3, trust tiers are derived from current verification events and never stored.
- A verification event is well-formed when it carries both
byand a parseableattimestamp. Events missing either field emitMALFORMED_VERIFICATIONand count toward no tier. - A well-formed event is current when its
atinstant is equal to or later thangenerated.aton the same concept, or whengenerated.atis absent. Events earlier thangenerated.atemitLAPSED_VERIFICATION. - Zero current events yield
unverified. One or more current events with nohuman:actor yieldmachine-confirmed(includingprocess:andteam:actors, because a team handle does not identify an individual human reviewer). At least one currenthuman:event yieldshuman-reviewed. - Every audit reports both
raw_tier(from all well-formed events) andrecomputed_tier(from current events only), exposing silent tier drops after regeneration.
Supersession chains
Under SPEC 5.4 and SPEC 6, superseded_by holds a single in-bundle concept path and is valid only when status is deprecated.
- Leading
/paths resolve from the bundle root. Relative paths resolve from the directory of the carrying concept. External URIs (https://,urn:, and other RFC 3986 schemes) and..segments that escape the bundle root fail resolution and emitDANGLING_SUPERSEDED_BY. - Bundles declaring
okf_version0.2or earlier, or omittingokf_version, receive the SPEC 12.1 root-relative fallback when relative resolution fails. Any hop resolved via that fallback is recorded inChainReport::fallback_targetsand surfaced as an informationalNOTE. - Chains that revisit a node or exceed 64 hops emit
SUPERSESSION_CYCLE. Multi-hop chains and headless cycles are deduplicated so each defective chain head or canonical cycle representative emits one finding. - Any concept carrying
superseded_bywhile its status is notdeprecatedemitsSUPERSEDED_WITHOUT_DEPRECATED.
Freshness (stale_after)
Under SPEC 5.5 and SPEC 11.2, a concept is stale when the pinned AuditClock is equal to or later than stale_after.
- Stale means check again rather than false. When a stale concept still presents
status: stable(or omitsstatus, which defaults tostable), the auditor emitsSTALE_BUT_STABLE. - A stale concept with
status: deprecatedno longer claims currency and is surfaced as an informationalNOTErather than a finding. - An unparseable
stale_afterstring is never treated as fresh and emitsUNPARSEABLE_STALE_AFTER.
Provenance and source drift
Under SPEC 5.1, provenance is checked strictly on stated bundle facts without network fetches.
- Inline Markdown footnote citations (
[^label]) outside fenced code blocks, inline code spans, and footnote definition lines must match asourcesentryid. Unmatched citations emitUNRESOLVED_CITATION. - In-bundle
sourcesfile paths must exist in the bundle file inventory. Missing files emitMISSING_SOURCE. External URLs are never fetched offline. - Concepts carrying no
sourceslist at all are conformant and surface as an informationalNOTErather than a finding. - When an in-bundle
sourcesentry records asha256digest,check_drifthashes the file bytes via FIPS 180-4 SHA-256 and emitsSOURCE_DRIFTon mismatch.
Locked library interface
perishables-core exposes four locked entry points for downstream upkeep engines.
recompute_tier(concept, clock) -> TierReportcheck_currency(bundle, clock) -> Vec<Finding>walk_supersession(bundle, start) -> ChainReportcheck_supersession(bundle) -> Vec<Finding>
All twelve FindingCode labels are closed under semantic versioning. Changing the meaning of a published FindingCode requires a major version bump.
Scope discipline
perishables audits trust claims rather than document syntax or world truth. The following checks remain intentionally outside scope.
- General SPEC 11.1 schema conformance on untyped Markdown files, which belongs to structural validators.
- Enforcing a closed
typetaxonomy, since OKF v0.3 allows open domain types. - Checking ordinary prose hyperlinks outside
superseded_byandsources. - Assigning subjective numeric credibility scores to sources or authors.
Attested Computation execution and attestation design
Open Knowledge Format v0.3 section 10 defines Attested Computation concepts that pair a declared computation and parameter contract with a claimed result. perishables implements deterministic local re-execution in crates/perishables/src/execute.rs.
Verdict vocabulary and gate behavior
Every concept with type: Attested Computation receives one verdict.
| Verdict | Gate effect | Meaning |
|---|---|---|
RECOMPUTED_MATCH | Pass | Computation ran cleanly under the deterministic profile and matched the claimed result |
MISMATCH | ATTESTED_RESULT_MISMATCH | Computation ran cleanly and produced a value different from the claimed result |
NOT_ATTESTABLE | UNATTESTED_CLAIM when claimed | Missing runtime, missing code block or linked .py file, invalid parameter identifier or typed literal, or missing claimed result |
NOT_EXECUTABLE_IN_PROFILE | UNATTESTED_CLAIM when claimed | Declared runtime (such as bigquery or snowflake) lies outside the local deterministic allowlist |
NON_DETERMINISTIC_PROFILE | UNATTESTED_CLAIM when claimed | AST pre-screen detected a restricted module import, builtin call, or dunder attribute |
EXECUTION_FAILED | UNATTESTED_CLAIM when claimed | Interpreter exited non-zero, failed to assign result, exceeded output capture bounds, or timed out |
SKIPPED | None | Caller explicitly passed --no-exec to disable subprocess execution |
RECOMPUTED_MATCH is the sole verdict that confirms an attested claim. Whenever a bundle states a claimed result whose computation cannot be verified under the profile, UNATTESTED_CLAIM trips the gate so broken or unverifiable claims never pass silently.
Deterministic Python profile
- Parameter validation and binding checks every declared parameter name against ASCII Python identifier rules, rejecting reserved keywords,
result, and blocked builtins. Parameter values bind ahead of the computation code as validatedint,float,bool, or control-escaped Python string literals, and the SHA-256 digest of that bound source is recorded asartifact_hashbefore execution. - AST determinism pre-screen parses the bound source with Python
ast.parseprior to bytecode compilation. Comments and string literals are ignored by construction. Imports of OS, filesystem, clock, RNG, network, threading, subprocess, serialization, and introspection modules, relative imports, references toopen,eval,exec,compile,__import__,input, andbreakpoint, and dunder escape attributes (__builtins__,__globals__,__subclasses__,__loader__,__spec__, and__import__) exit immediately asNON_DETERMINISTIC_PROFILEbefore user code runs. - Isolated subprocess execution invokes Python with
-I -Binside an exclusive0700scratch directory that is deleted immediately upon completion, draining stdout and stderr concurrently with a 1 MiB cap under a wall-clock timeout (5000ms default) and best-effortRLIMIT_ASorRLIMIT_DATAbounds.
Travelling verdicts and in-toto mapping
ComputationReport records every field required to serialize a verifiable in-toto Statement v1 predicate without re-running the computation.
- Subject pairs the concept id with the
sha256artifact_hashof the bound parameters plus computation text, so any edit to parameters or code invalidates stale statements without executing code. - Predicate carries the verdict name, optional reason, claimed and recomputed tokens,
pythonprofile identifier,perishablesversion, pinnedas_oftimestamp, and configuredtimeout_msbound, deliberately omitting machine-dependentelapsed_msso statements remain byte-comparable across runs.
Cross-ecosystem semantic grading
Semantic layers used by AI analysts and BI tools make the same structural, naming, currency, and ground-truth claims as Open Knowledge Format bundles. perishables-semantic normalizes vendor definitions into a single Definition struct and runs six format-blind finding rules plus coverage and orphan observations over the result.
Finding codes
| Code | Meaning |
|---|---|
DANGLING_METRIC_REFERENCE | A metric, LookML measure, Cube view selection, or AtScale hierarchy level references a missing measure, field, metric, or attribute |
NAME_COLLISION | Two or more metrics, measures, dimensions, or synonym aliases claim the same case-insensitive display name |
LAPSED_VERIFIED_QUERY | A verified query records a verified_at instant earlier than the definition's changed_at timestamp |
DANGLING_RELATIONSHIP | A declared relationship, join, or extends parent names a model, table, cube, or view absent from the definition |
BENCHMARK_WITHOUT_ANSWER | A stored ground-truth benchmark or verified query has an empty question or empty expected SQL |
AMBIGUOUS_JOIN_PATH | Two models connect both directly and over a two-edge or three-edge alternate join route that aggregates at a different grain |
Informational notes
Observations that highlight coverage gaps or graph dead ends without representing contradictions travel as Note items and never fail the gate.
- Missing
descriptionor missinglabelon metrics, measures, and dimensions - Missing
synonymson items within documents that actively use synonyms elsewhere - Measures unreferenced by any metric in name-linked manifests such as dbt
- Multi-model definitions where a field-carrying model is reached by zero declared relationships
- Verified queries missing
verified_byorverified_at, sample questions without stored answers, unmatched LookMLincludeglobs, and Cubeai_contextstrings at or past the 2,000-character silent truncation threshold
Ecosystem readers and boundaries
dbt (grade-dbt)
Reads semantic_manifest.json and full manifest.json (semantic_models and metrics), extracting simple, ratio, derived, and cumulative type_params references. Git-level freshness and free-form meta dictionaries lie outside the offline manifest reader.
Apache Ossie (grade-ossie)
Reads Ossie JSON and YAML documents identically. Datasets map to models, fields map to dimensions, root relationships map to join edges, and ai_context.synonyms at model, dataset, field, and metric scope enter collision detection.
Snowflake semantic views (grade-snowflake)
Reads semantic view YAML exported via SYSTEM$READ_YAML_FROM_SEMANTIC_VIEW. Tables map to models, facts map to measures, dimensions and time_dimensions map to dimensions, synonyms map to aliases, relationships map to joins, and verified_queries populate both verifications (accepting integer epoch seconds or RFC 3339 timestamps in verified_at) and ground_truth. Callers pass object-metadata modification time via --changed-at to enable LAPSED_VERIFIED_QUERY.
Databricks Genie (grade-databricks)
Reads exported or API-fetched serialized_space JSON. Unity Catalog data_sources.tables and column_configs map to models and dimensions, benchmarks.questions and instructions.example_question_sqls map to ground_truth, and config.sample_questions map to unverifiable_questions. Live warehouse SQL execution and unexported OntoRank scores stay outside offline grading.
Cube (grade-cube)
Reads REST /v1/meta JSON, YAML model files, and JavaScript cube(...) and view(...) files. Cube joins map to relationships, meta.ai_context character counts are checked against the 2,000-character truncation limit, and JS view includes and excludes selections validate against qualified cube.member fields. Arbitrary JavaScript functions or computed keys outside the declarative subset return reader errors rather than partial grades.
Looker and LookML (grade-looker)
Reads assembled Looker API JSON (views and explores) as well as single or multi-file native .lookml projects. See docs/LOOKML.md for full grammar and project-scope rules.
AtScale (grade-atscale)
Reads JSON model exports. Dimension attributes populate both dimensions and qualified attributes, measures and calculation_groups enter collision detection via caption, and hierarchies validate every level attribute reference against the parent dimension.
Native LookML reader
perishables-semantic includes a native LookML lexer, block-tree parser, and project-scoped semantic normalizer in crates/perishables-semantic/src/lookml.rs. Native file grading catches SQL field-reference and view-inheritance defects that assembled API exports omit.
Grammar subset
The parser produces an ordered intermediate tree of Item::Prop(String, Value) and Item::Block(String, Option<String>, Vec<Item>) values exposed via perishables_semantic::parse_tree.
- Blocks cover
view,explore,dimension,dimension_group,measure,join,set, andparameterblocks with bareword or quoted names. - Properties cover barewords, double-quoted strings with backslash escapes, bracketed lists (
[a, b]), and raw SQL or HTML chunks (sql,sql_on,sql_table_name,html) terminated strictly by;;. - Comments starting with
#outside quoted strings and outside raw;;SQL chunks run to end of line.#characters inside SQL chunks remain intact as SQL content. - Strict error boundary ensures any file with unbalanced braces, unterminated strings, or missing
;;terminators returnsErr(String)rather than a partial grade.
Mapping to the normalized model
- Each
viewbecomes a model inDefinition::model_names. dimensionanddimension_groupblocks map toDimensionitems carryinglabel,description, andsynonymsalias claims.measureblocks map toMetricitems whosemeasure_refsare extracted from${field}and${view.field}interpolations insidesql, excluding Looker's${TABLE}pseudo-reference.explorejoinblocks map toRelationshipedges from the explore's base view (view_name, defaulting to the explore name) to each joined view.
Project scope across multiple files
When perishables grade-looker or read_lookml_project receives multiple .lookml files, project-level resolution activates.
- Cross-file merging combines views, explores, and
includedirectives across all supplied files. extendsresolution records eachextends: [parent]declaration as a structural relationship (flagging missing parent views viaDANGLING_RELATIONSHIP) and iteratively inherits parent dimensions and measures not overridden by the child view while preserving qualifiedchild.fieldaddressability.- Qualified field resolution populates
Definition::qualified_fields(view.field) across own and inherited fields so dotted${other_view.field}references inside measure and dimension SQL resolve project-wide and fail withDANGLING_METRIC_REFERENCEwhen a target view or field is absent. includepattern coverage matches modelincludeglobs against provided file paths and records unmatched patterns as informational coverage notes.
Architecture
perishables is organized as a three-crate Rust workspace with zero external runtime dependencies. Every parser, cryptographic hash, calendar calculation, graph check, and report serializer is implemented directly on the Rust standard library.
Crate boundaries
perishables-core <- pure std library, OKF bundle loader, trust checks, SHA-256, RFC 3339
perishables-semantic <- 7-ecosystem semantic-layer readers + format-blind grading engine
perishables <- CLI binary, Python AST sandbox executor, text/json/sarif/github formatters
perishables-core
perishables-core loads Open Knowledge Format bundles from disk or in-memory concept slices and evaluates trust claims against a pinned AuditClock.
frontmatter.rsparses the YAML frontmatter subset used in OKF Markdown files, strips unquoted#comments, extracts fenced code blocks (```and~~~) with info-string attributes, extracts footnote citations outside code blocks and footnote definitions, and scans UTF-8 bodies for claimed attested results.time.rsvalidates proleptic Gregorian calendar dates (including 4-year, 100-year, and 400-year leap rules) and RFC 3339 timestamps, converting to and from UTC epoch seconds via Howard Hinnant's civil-day algorithms.hash.rsimplements FIPS 180-4 SHA-256 over byte slices for deterministic source drift verification and bound computation artifact digests.bundle.rsinventories bundle files in sorted path order while skipping hidden files, reserved files (index.mdandlog.md), and symlinks so directory cycles cannot overflow the stack and symlinks cannot escape the bundle root.checks.rsimplements the four locked calls (recompute_tier,check_currency,walk_supersession, andcheck_supersession) alongsidecheck_freshness,check_provenance,check_drift, andinfo_notes.
perishables-semantic
perishables-semantic normalizes semantic-layer definitions from seven analytics platforms into a single Definition model and evaluates six closed finding codes plus coverage and orphan notes.
- Hand-written format readers live in
json.rs,yaml.rs,js.rs, andlookml.rs. Every reader rejects inputs outside its stated subset with an explicitErr(String)rather than producing partial grades. - Ecosystem adapters live in
lib.rs(dbt),ossie.rs,snowflake.rs,databricks.rs,cube.rs,looker.rs,lookml.rs, andatscale.rs. - Shared rule families (
check_dangling,check_collisions,check_currency,check_relationships,check_join_paths,check_ground_truth, andnotes) operate strictly onDefinitionwithout consulting vendor syntax.
perishables
perishables provides the CLI dispatcher (main.rs), the deterministic Python re-execution harness (execute.rs), and zero-dependency structured output formatters (render.rs).
execute.rsvalidates parameter identifiers, binds typed or string-escaped parameter literals ahead of user code, hashes the bound source before execution, pre-screens the Python AST viaast.parse, enforces timeouts and concurrent 1 MiB pipe draining across threads, and cleans up an exclusive0700scratch directory after each run.render.rsemits canonicaltext, RFC 8259json, OASISsarif2.1.0, and GitHub Actionsgithubworkflow annotations.
Determinism guarantees
- Every timestamp comparison uses an explicit
AuditClocksupplied on the command line or API. No check callsSystemTime::now(). Bundle::loadtraverses directories in lexicographical order and ignores host filesystemmtimemetadata so fresh clones and historical checkouts produce identical reports.- Findings and notes are canonically sorted before rendering.
- Wall-clock execution duration (
elapsed_ms) is omitted from defaultauditoutput and included only when--timingis explicitly passed.
Claims and evidence
Every load-bearing promise in README.md and docs/ maps directly to a CI guard, a planted-defect fixture in corpus/fixtures/, or a named test suite in the workspace.
Workspace guarantees
| Claim | Enforcement |
|---|---|
| Zero external runtime or build crates in the dependency tree | .github/workflows/ci.yml (Verify zero external dependencies in Cargo.lock asserts Cargo.lock lists only perishables, perishables-core, and perishables-semantic). |
Zero ambient wall-clock or host filesystem mtime reads | AuditClock required explicitly on recompute_tier, check_currency, and check_freshness, plus sorted directory traversal in crates/perishables-core/src/bundle.rs. |
| Zero mutation of audited bundle directories | perishables corpus computes recursive pre-audit and post-audit SHA-256 digests of every fixture directory and asserts unchanged=true across all 19 fixtures. |
| Untrusted bundles can be audited with zero subprocess spawns | --no-exec CLI flag tested in crates/perishables/tests/cli.rs, emitting UNATTESTED_CLAIM (execution skipped (--no-exec)) whenever an attested result is claimed. |
Deterministic byte-for-byte output across text, json, sarif, and github | Canonical finding and note sorting in crates/perishables/src/render.rs, verified in crates/perishables/tests/cli.rs. |
OKF finding codes (perishables-core and corpus/)
| Finding code | Planted-defect fixture(s) | What the gate proves |
|---|---|---|
LAPSED_VERIFICATION | corpus/fixtures/t1-lapsed | Downgrades raw=human-reviewed to recomputed=unverified and fails when generated_at is newer than verified_at. |
SUPERSESSION_CYCLE | corpus/fixtures/t2-cycle-two, corpus/fixtures/t2-cycle-three | Detects 2-node and 3-node cycles in superseded_by chains without looping. |
DANGLING_SUPERSEDED_BY | corpus/fixtures/t3-dangling-missing, t3-dangling-external, t3-dangling-escape | Rejects missing targets, external URLs, and bundle-escaping ../../ paths in superseded_by. |
STALE_BUT_STABLE | corpus/fixtures/t4-stale-stable | Flags status: stable concepts whose stale_after timestamp has passed at the pinned AuditClock. |
ATTESTED_RESULT_MISMATCH | corpus/fixtures/t5-attested-mismatch | Re-runs deterministic Python Attested Computation in an isolated scratch directory and fails when output differs from claimed_result. |
UNATTESTED_CLAIM | corpus/fixtures/t5-unattested-claim | Rejects attested result claims backed by non-local or disallowed runtimes (such as bigquery) or skipped under --no-exec. |
UNRESOLVED_CITATION | corpus/fixtures/t6-provenance-footnote | Flags Markdown body [^id] citations outside code blocks that match no declared sources entry. |
MISSING_SOURCE | corpus/fixtures/t6-provenance-missing-file | Flags in-bundle sources.resource paths missing from disk or escaping the bundle root. |
SUPERSEDED_WITHOUT_DEPRECATED | corpus/fixtures/t7-superseded-without-deprecated | Flags concepts carrying superseded_by while still declaring status: stable. |
UNPARSEABLE_STALE_AFTER | corpus/fixtures/t8-malformed-stale-after | Rejects unparseable or invalid calendar dates on stale_after so malformed dates never silently pass as fresh. |
MALFORMED_VERIFICATION | corpus/fixtures/t8-malformed-verification | Rejects verification events missing timestamps or carrying invalid metadata. |
SOURCE_DRIFT | corpus/fixtures/t9-source-drift | Hashes bundled source files with FIPS 180-4 SHA-256 and fails when on-disk bytes diverge from recorded digests. |
Clean controls (0 findings) | clean-healthy-chain, clean-machine-confirmed, clean-no-trust-fields, clean-team-verified | Proves zero false positives across healthy supersession chains, machine and team verifications, and plain unverified notes. |
Cross-ecosystem semantic grading (perishables-semantic)
| Finding code | Planted-defect fixture(s) | What the gate proves |
|---|---|---|
DANGLING_METRIC_REFERENCE | crates/perishables-semantic/tests/fixtures/dangling.json (dbt), atscale-dangling.json, lookml-field.lookml, lookml-dimension-field.lookml, cube-view-dangling.js | One finding per reference to an undefined measure, dimension, or field, across every reader. |
NAME_COLLISION | crates/perishables-semantic/tests/fixtures/collision.json (dbt), ossie-collision.json, looker-defects.json, lookml-defects.lookml | One finding per case-folded display name or synonym claimed by two or more fields. |
LAPSED_VERIFIED_QUERY | crates/perishables-semantic/tests/fixtures/snowflake-lapsed.yaml | A stored verified query whose verification predates the definition change is flagged, never re-credited. |
DANGLING_RELATIONSHIP | crates/perishables-semantic/tests/fixtures/cube-dangling.json, looker-defects.json, lookml-defects.lookml | Joins, relationships, and extends parents naming missing targets are flagged per reference. |
BENCHMARK_WITHOUT_ANSWER | crates/perishables-semantic/tests/fixtures/databricks-benchmark.json | A stored benchmark whose question or expected SQL is empty cannot be graded and is flagged. |
AMBIGUOUS_JOIN_PATH | crates/perishables-semantic/tests/fixtures/cube-fan.json | Two models joined by both a direct route and a longer alternate route are flagged as a fan trap. |
| Ecosystem | Input shapes | Enforcing test suites |
|---|---|---|
| dbt Semantic Layer | semantic_manifest.json and full manifest.json | crates/perishables-semantic/tests/ and crates/perishables/tests/cli.rs |
| Apache Ossie | JSON and YAML semantic models | crates/perishables-semantic/src/ossie.rs and integration tests |
| Snowflake | Exported Semantic View YAML (--changed-at) | crates/perishables-semantic/src/snowflake.rs and CLI tests |
| Databricks Genie | Serialized Genie space JSON | crates/perishables-semantic/src/databricks.rs and CLI tests |
| Cube | REST /v1/meta JSON, .yaml models, and .js cube(...) / view(...) files | crates/perishables-semantic/src/cube.rs, js.rs, and CLI tests |
| Looker and native LookML | Assembled API JSON and .view.lookml / .model.lookml files (extends, include globs) | crates/perishables-semantic/src/looker.rs, lookml.rs, and CLI tests |
| AtScale | Exported model JSON | crates/perishables-semantic/src/atscale.rs and CLI tests |
How perishables compares to other tools
perishables occupies a focused layer in the documentation and analytics stack: offline, deterministic point-in-time trust and semantic integrity auditing. It complements syntax validators, warehouse compilers, and live data observability tools rather than replacing them.
Summary matrix
| Tool category | Examples | What those tools check | What perishables adds |
|---|---|---|---|
| Schema and syntax validators | JSON Schema, yamllint, Markdown linters | Whether YAML, JSON, or Markdown conforms to structural field types | Whether verification timestamps postdate generation (LAPSED_VERIFICATION), stale_after holds at --as-of, superseded_by chains are acyclic, sources SHA-256 hashes match disk (SOURCE_DRIFT), and Attested Computation results reproduce |
| Single-vendor semantic compilers | dbt parse, MetricFlow CLI | Syntax and single-tool DAG validity inside one vendor toolchain | Zero-dependency, sub-second offline grading across seven semantic ecosystems under one finding taxonomy, including case-insensitive label/synonym collisions (NAME_COLLISION), fan-trap routes (AMBIGUOUS_JOIN_PATH), ground-truth SQL completeness, and verified-query currency |
| Warehouse-connected BI validators | spectacles (Looker), live BI SQL runners | Whether generated SQL executes without database errors against a live cloud warehouse via API credentials | Offline .view.lookml and .model.lookml grading with zero Looker API or warehouse credentials, catching ${field} / ${view.field} dangling references, missing extends parents, and duplicate business synonyms before code leaves a developer laptop or PR |
| Live data observability platforms | Monte Carlo, Elementary, Soda, Great Expectations | Runtime warehouse table freshness, row-count anomalies, null rates, and distribution drift | Repository-time contract and provenance auditing over committed OKF bundles and semantic definitions, deterministic to the second via --as-of |
Detailed comparisons
Versus JSON Schema, YAML linters, and frontmatter validators
A JSON Schema or frontmatter validator confirms that verified is an array of objects with by and at strings and that sources entries have sha256 strings. Every planted defect in corpus/fixtures/ (t1-lapsed through t9-source-drift) is structurally valid Markdown and YAML that passes schema validation.
perishables evaluates the relationships between those fields, time, files, and code:
- Comparing
verified[].atagainstgenerated.atto catch silently stale human sign-off (LAPSED_VERIFICATION). - Comparing
stale_afteragainst a pinnedAuditClock(STALE_BUT_STABLE,UNPARSEABLE_STALE_AFTER). - Walking multi-hop
superseded_bygraphs across the bundle inventory (SUPERSESSION_CYCLE,DANGLING_SUPERSEDED_BY,SUPERSEDED_WITHOUT_DEPRECATED). - Matching Markdown
[^footnote]citations tosourcesentries and hashing referenced files on disk (UNRESOLVED_CITATION,MISSING_SOURCE,SOURCE_DRIFT). - Re-running deterministic Python
Attested Computationblocks in an AST-screened sandbox (ATTESTED_RESULT_MISMATCH,UNATTESTED_CLAIM).
Versus dbt parse and MetricFlow
dbt parse and MetricFlow validate a dbt project within the Python dbt runtime. If your organization only uses dbt and already runs dbt parse in CI, dbt parse handles dbt-internal Jinja rendering and model compilation.
perishables addresses two gaps that single-vendor compilers leave open:
- Cross-ecosystem uniformity. Analytics teams routinely pair dbt models with LookML views, Snowflake Cortex semantic views, Databricks Genie spaces, Cube models, AtScale exports, or Apache Ossie definitions.
perishablesgrades all seven formats with one static binary, one exit-code contract, and one SARIF 2.1.0 ruleset (CROSS-ECOSYSTEM.md). - AI-analyst and business-vocabulary hazards. Compilers rarely fail when two measures share a case-insensitive display label or business synonym (
NAME_COLLISION), when a Databricks Genie benchmark question lacks expected SQL (BENCHMARK_WITHOUT_ANSWER), when a Snowflake verified query predates a semantic view edit (LAPSED_VERIFIED_QUERY), or when direct and transitive joins create an aggregation fan trap (AMBIGUOUS_JOIN_PATH).
Versus spectacles and live Looker validators
Tools such as spectacles authenticate against a Looker instance and execute EXPLAIN or SELECT queries against your cloud warehouse to catch dialect-specific SQL errors and missing database columns.
perishables grade-looker (LOOKML.md) operates purely on .lookml files (or Looker API JSON) with zero network access and zero warehouse spend:
- Runs in milliseconds inside pre-commit hooks, air-gapped CI runners, or local agent loops.
- Catches broken
${field}and${view.field}interpolations acrossmeasure,dimension, anddimension_groupSQL blocks (DANGLING_METRIC_REFERENCE), missing join orextendstargets (DANGLING_RELATIONSHIP), ambiguous join loops (AMBIGUOUS_JOIN_PATH), and duplicate labels or synonyms (NAME_COLLISION). - Pairs naturally with warehouse SQL validators: run
perishables grade-lookeron every edit and PR commit, then run live warehouse SQL checks on staging merges.
Versus live data-freshness monitors
Warehouse observability tools monitor whether physical ETL tables loaded on schedule and whether column values drifted in production. perishables audits whether human-authored and AI-consumed definitions, metric contracts, and attested claims remain trustworthy and internally consistent in version control. A warehouse table can load fresh rows every hour while the metric definition or executive memo built on top of it cites a drifted extract or a superseded formula; perishables catches the latter.
Explicit non-goals
Keeping perishables fast, offline, and zero-dependency requires clear boundaries on what it will not do:
- No live warehouse SQL execution.
perishablesnever opens network connections to Snowflake, BigQuery, Databricks, Postgres, or Looker APIs, and does not validate physical table columns against live database catalogs. - No Jinja or full-JS execution in semantic readers.
perishables-semanticgrades compiledmanifest.json/semantic_manifest.jsonfor dbt and declarativecube(...)/view(...)models for Cube, returning explicit reader errors on arbitrary dynamic code rather than guessing partial grades. - No LLM or heuristic prose scoring. Every finding in
perishablesis a deterministic boolean rule backed by a planted-defect fixture (CLAIMS.md). It never calls an LLM or assigns probabilistic confidence scores. - No in-place bundle rewriting.
perishablesdiagnoses decay and outputs machine-readable verdicts (text,json,sarif,github); updating claims and recording newhuman:verifications belongs to explicit human review or downstream upkeep workflows.
Frequently asked questions
General and determinism
Why does perishables audit require --as-of instead of reading the system clock?
Point-in-time reproducibility is a core design invariant. If perishables called SystemTime::now(), the same commit could pass CI on Friday and fail on Monday with zero repository changes, and historical audits could not be reproduced byte-for-byte. Passing an explicit date (--as-of 2026-11-20 or --as-of "$(date -u +%Y-%m-%d)" in a scheduled CI job) makes the evaluation instant an explicit, logged input to the audit. See ARCHITECTURE.md for the full determinism contract.
Why does the workspace have zero external Rust dependencies?
perishables sits in CI gates and audits provenance, SHA-256 source hashes, and attested claims. Keeping Cargo.lock restricted to the three first-party crates (perishables-core, perishables-semantic, and perishables) eliminates transitive supply-chain churn, advisory noise, proc-macro build latency, and parser behavior shifts across dependency upgrades. Every parser (YAML frontmatter, JSON, YAML subset, Cube JS subset, native LookML), RFC 3339 proleptic Gregorian calendar conversion, and FIPS 180-4 SHA-256 digest is implemented in safe Rust (#![forbid(unsafe_code)]) and fuzz-tested under fuzz/.
Does perishables ever modify files inside a bundle or semantic project?
No. Loading and auditing are strictly read-only, and perishables audit / perishables drift reject --output paths located inside the target bundle directory. Every run of perishables corpus computes recursive SHA-256 directory digests before and after auditing all 19 reference fixtures to prove zero file creation or mutation.
OKF bundle auditing
When should I pass --no-exec?
Pass --no-exec (or no_exec=True in the Python SDK) whenever auditing an untrusted bundle from an external contributor or running in a locked-down environment where spawning python3 subprocesses is undesirable. Without --no-exec, perishables pre-screens Attested Computation blocks with ast.parse and runs them under python3 -I -B in an isolated 0700 scratch directory with timeout and memory limits, as detailed in ATTESTATION.md. With --no-exec, zero subprocesses run; any concept that claims an attested result emits UNATTESTED_CLAIM (execution skipped (--no-exec)) rather than silently passing unverified claims.
Why did a concept with verified events drop to unverified or machine-confirmed?
Under the Open Knowledge Format v0.3 trust model (DESIGN.md), trust tiers are recomputed from current verification events rather than stored:
- If a verification event's
attimestamp is earlier thangenerated.aton the same concept, the content changed after the review, so the event is classified as lapsed (LAPSED_VERIFICATION) and excluded fromrecomputed_tier. - Only actors with the
human:prefix (such ashuman:alice@example.com) qualify forhuman-reviewed. Automated (process:) and group (team:) handles yieldmachine-confirmedbecause a group alias does not identify an accountable individual human reviewer. - Events missing
byor a valid calendarattimestamp emitMALFORMED_VERIFICATIONand count toward no tier.
Does STALE_BUT_STABLE mean the metric or claim is wrong?
No. stale_after marks a review horizon: stale means check again, not false. STALE_BUT_STABLE fires when the pinned --as-of instant is at or past stale_after while the concept still declares status: stable (or omits status). Re-verifying the concept and advancing stale_after, or marking a retired concept status: deprecated, clears the finding.
Semantic-layer grading
Should I run perishables grade or perishables grade-<ecosystem>?
Both run the exact same normalized Definition checks (CROSS-ECOSYSTEM.md):
- Use
perishables grade-<ecosystem>(grade-dbt,grade-ossie,grade-snowflake,grade-databricks,grade-cube,grade-looker,grade-atscale) when grading a single known ecosystem explicitly. - Use
perishables grade <file>...when grading mixed files in one pass (auto-detected by file extension and JSON/YAML structure, or pinned via--ecosystem <name>) and emitting a unified JSON or SARIF 2.1.0 report.
Why does grade-looker accept multiple .lookml files at once?
Single-file LookML linting misses cross-view defects. Passing all .view.lookml and .model.lookml files together (perishables grade-looker views/*.view.lookml models/*.model.lookml) activates project-scoped resolution (LOOKML.md): extends inheritance is resolved across views, qualified ${other_view.field} references in measure and dimension SQL are checked project-wide, explore joins validate target views, and unmatched include globs surface as coverage notes.
Why did grade-snowflake not flag LAPSED_VERIFIED_QUERY until I passed --changed-at?
Snowflake semantic view YAML exports (SYSTEM$READ_YAML_FROM_SEMANTIC_VIEW) carry verified_at timestamps on individual verified_queries, whereas the last-altered timestamp of the semantic view object lives in Snowflake catalog metadata or git history. Passing --changed-at <YYYY-MM-DD|RFC3339|epoch> supplies that comparison timestamp explicitly without consulting host file mtime.
CI, SARIF, and Python packaging
Do I need a Rust toolchain to use perishables from Python or CI?
No. Prebuilt wheels on PyPI (pip install perishables or uvx perishables) bundle the compiled native Rust perishables binary alongside the typed Python SDK. On Linux and macOS runners without Python or Rust, install.sh downloads the prebuilt release archive and verifies it against SHA256SUMS before installation. In GitHub Actions, david-engelmann/perishables@v0.1.4 installs the release binary automatically.
Why does perishables exit with code 1 when generating a SARIF file?
Exit code 1 signals that one or more trust or semantic findings were convicted, while still writing the complete SARIF 2.1.0 document to --output <path> (or stdout). In GitHub Actions, upload the SARIF artifact with if: always() (or if: success() || failure()) so findings appear in GitHub Code Scanning even when the gate fails the pull request. From Python, perishables.audit_sarif(...) and perishables.grade_sarif(...) return the parsed SARIF dictionary cleanly on both exit codes 0 and 1, raising PerishablesError only on usage or parse errors (exit code 2).