perishables

perishables 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.

perishables auditing lapsed verifications, sandboxed Python attestation mismatches, SHA-256 source drift, native LookML semantic errors, and all 19 reference corpus fixtures

Why Syntax Validation Passes Decayed Truth

Side-by-side comparison showing five structurally valid OKF and LookML lines that pass syntax linters while failing perishables point-in-time verification Side-by-side comparison showing five structurally valid OKF and LookML lines that pass syntax linters while failing perishables point-in-time verification

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

How perishables evaluates OKF bundle decay against an explicit AuditClock and grades seven semantic ecosystems through one Definition graph How perishables evaluates OKF bundle decay against an explicit AuditClock and grades seven semantic ecosystems through one Definition graph

  • Pinned AuditClock (perishables-core + perishables). Zero ambient clock or mtime reads; derives unverified, machine-confirmed, or human-reviewed strictly from current events, checks stale_after and superseded_by graphs, hashes bundled sources, and runs python3 -I -B inside an isolated 0700 scratch directory (--no-exec for untrusted bundles).
  • Unified Definition grading (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

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

CommandSynopsisPurpose
auditperishables audit <BUNDLE> --as-of <TIMESTAMP> [OPTIONS]Recompute trust tiers, check currency, supersession, freshness, provenance, SHA-256 drift, and Attested Computation results
driftperishables drift <BUNDLE> [OPTIONS]Verify recorded sources[].sha256 digests against on-disk bundle files
corpusperishables corpus [CORPUS_DIR | FIXTURES_DIR] [OPTIONS]Run all 19 reference fixtures against LABEL.toml expectations and verify zero directory mutation
gradeperishables grade <FILE>... [--ecosystem <NAME>] [OPTIONS]Grade one or more semantic-layer files with automatic or explicit ecosystem selection
grade-dbtperishables grade-dbt <MANIFEST.JSON> [OPTIONS]Grade dbt manifest.json or semantic_manifest.json
grade-ossieperishables grade-ossie <MODEL.JSON|MODEL.YAML> [OPTIONS]Grade Apache Ossie JSON or YAML semantic models
grade-snowflakeperishables grade-snowflake <VIEW.YAML> [--changed-at <TS>] [OPTIONS]Grade Snowflake semantic view YAML exports
grade-databricksperishables grade-databricks <SPACE.JSON> [OPTIONS]Grade Databricks Genie serialized_space JSON
grade-cubeperishables grade-cube <FILE> [OPTIONS]Grade Cube /v1/meta JSON, .yaml, or declarative .js models
grade-lookerperishables grade-looker <MODEL.JSON|FILE.LOOKML...> [OPTIONS]Grade Looker API JSON or single/multi-file native .lookml projects
grade-atscaleperishables grade-atscale <MODEL.JSON> [OPTIONS]Grade AtScale JSON model exports

Common CLI flags

  • --as-of <YYYY-MM-DD|RFC3339>: Required on audit. Sets the pinned evaluation instant (AuditClock).
  • --changed-at <YYYY-MM-DD|RFC3339|EPOCH>: Optional on grade and grade-snowflake. Supplies the semantic view's last-altered timestamp for LAPSED_VERIFIED_QUERY.
  • --ecosystem <dbt|ossie|snowflake|databricks|cube|looker|atscale>: Pins the reader used by perishables grade.
  • --format <text|json|sarif|github>: Selects output format (corpus supports text and json; all other commands support all four).
  • --output <PATH> / -o <PATH>: Writes the rendered report to PATH. For audit and drift, PATH must lie outside the audited bundle directory.
  • --no-exec: Skips Python subprocess execution of Attested Computation blocks during audit. Concepts claiming an attested result emit UNATTESTED_CLAIM.
  • --timing: Includes wall-clock elapsed_ms on executed computations (omitted by default for byte-identical determinism).

Exit codes

CodeMeaning
0Clean pass (zero gate findings)
1Gate failure (one or more trust findings, semantic findings, or corpus mismatches)
2Usage error, unreadable path, or input syntax error

Finding code summary

OKF bundle audit (12 codes)

CodeTrigger
LAPSED_VERIFICATIONVerification at predates generated.at, causing recomputed_tier to drop below raw_tier
MALFORMED_VERIFICATIONVerification entry lacks by actor or parseable at timestamp
DANGLING_SUPERSEDED_BYsuperseded_by points to a missing concept, external URI, or root-escaping ../ path
SUPERSESSION_CYCLEsuperseded_by chain revisits a concept or exceeds 64 hops
SUPERSEDED_WITHOUT_DEPRECATEDConcept carries superseded_by while status is not deprecated
STALE_BUT_STABLEPinned AuditClock is at or past stale_after while status is stable
UNPARSEABLE_STALE_AFTERstale_after fails calendar or RFC 3339 parsing
ATTESTED_RESULT_MISMATCHDeterministic Python re-execution succeeded and differed from claimed_result
UNATTESTED_CLAIMConcept claims an attested result whose computation is missing, non-deterministic, failed, non-local, or skipped via --no-exec
UNRESOLVED_CITATIONMarkdown body cites [^label] with no matching sources[].id
MISSING_SOURCEIn-bundle sources[].resource file does not exist in the bundle inventory
SOURCE_DRIFTOn-disk file SHA-256 digest differs from sources[].sha256

Cross-ecosystem semantic grading (6 codes)

CodeTrigger
DANGLING_METRIC_REFERENCEMetric, LookML measure/dimension SQL, Cube view, or AtScale hierarchy references a missing field, measure, metric, or attribute
NAME_COLLISIONTwo or more items or synonym aliases claim the same case-insensitive display name
LAPSED_VERIFIED_QUERYVerified query verified_at predates --changed-at
DANGLING_RELATIONSHIPRelationship, join, or LookML extends names a missing model, table, cube, or view
BENCHMARK_WITHOUT_ANSWERStored ground-truth benchmark or verified query has an empty question or empty SQL
AMBIGUOUS_JOIN_PATHDirect 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) -> AuditReport
  • audit_sarif(bundle, *, as_of, no_exec=False, output=None, binary=None) -> dict[str, Any]
  • drift(bundle_path, *, binary=None) -> DriftReport
  • corpus(fixtures_dir=None, *, binary=None) -> CorpusReport
  • grade(paths, *, ecosystem=None, changed_at=None, binary=None) -> GradeReport
  • grade_dbt(manifest, *, binary=None) -> GradeReport
  • grade_ossie(model, *, binary=None) -> GradeReport
  • grade_snowflake(view, *, changed_at=None, binary=None) -> GradeReport
  • grade_databricks(space, *, binary=None) -> GradeReport
  • grade_cube(paths, *, binary=None) -> GradeReport
  • grade_looker(paths, *, binary=None) -> GradeReport
  • grade_atscale(model, *, binary=None) -> GradeReport
  • grade_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) -> str
  • find_binary(binary=None) -> Path (honors PERISHABLES_BIN)

Report types and error handling

  • AuditReport.passed, GradeReport.passed, CorpusReport.passed, and DriftReport.clean return bool.
  • Calling .raise_for_findings() on an AuditReport, GradeReport, or DriftReport raises PerishablesError (exit_code=1) when any gate finding is present.
  • Invalid CLI arguments, missing files, or malformed JSON/YAML/LookML inputs raise PerishablesError with exit_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 by and a parseable at timestamp. Events missing either field emit MALFORMED_VERIFICATION and count toward no tier.
  • A well-formed event is current when its at instant is equal to or later than generated.at on the same concept, or when generated.at is absent. Events earlier than generated.at emit LAPSED_VERIFICATION.
  • Zero current events yield unverified. One or more current events with no human: actor yield machine-confirmed (including process: and team: actors, because a team handle does not identify an individual human reviewer). At least one current human: event yields human-reviewed.
  • Every audit reports both raw_tier (from all well-formed events) and recomputed_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 emit DANGLING_SUPERSEDED_BY.
  • Bundles declaring okf_version 0.2 or earlier, or omitting okf_version, receive the SPEC 12.1 root-relative fallback when relative resolution fails. Any hop resolved via that fallback is recorded in ChainReport::fallback_targets and surfaced as an informational NOTE.
  • 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_by while its status is not deprecated emits SUPERSEDED_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 omits status, which defaults to stable), the auditor emits STALE_BUT_STABLE.
  • A stale concept with status: deprecated no longer claims currency and is surfaced as an informational NOTE rather than a finding.
  • An unparseable stale_after string is never treated as fresh and emits UNPARSEABLE_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 a sources entry id. Unmatched citations emit UNRESOLVED_CITATION.
  • In-bundle sources file paths must exist in the bundle file inventory. Missing files emit MISSING_SOURCE. External URLs are never fetched offline.
  • Concepts carrying no sources list at all are conformant and surface as an informational NOTE rather than a finding.
  • When an in-bundle sources entry records a sha256 digest, check_drift hashes the file bytes via FIPS 180-4 SHA-256 and emits SOURCE_DRIFT on mismatch.

Locked library interface

perishables-core exposes four locked entry points for downstream upkeep engines.

  • recompute_tier(concept, clock) -> TierReport
  • check_currency(bundle, clock) -> Vec<Finding>
  • walk_supersession(bundle, start) -> ChainReport
  • check_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 type taxonomy, since OKF v0.3 allows open domain types.
  • Checking ordinary prose hyperlinks outside superseded_by and sources.
  • 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.

VerdictGate effectMeaning
RECOMPUTED_MATCHPassComputation ran cleanly under the deterministic profile and matched the claimed result
MISMATCHATTESTED_RESULT_MISMATCHComputation ran cleanly and produced a value different from the claimed result
NOT_ATTESTABLEUNATTESTED_CLAIM when claimedMissing runtime, missing code block or linked .py file, invalid parameter identifier or typed literal, or missing claimed result
NOT_EXECUTABLE_IN_PROFILEUNATTESTED_CLAIM when claimedDeclared runtime (such as bigquery or snowflake) lies outside the local deterministic allowlist
NON_DETERMINISTIC_PROFILEUNATTESTED_CLAIM when claimedAST pre-screen detected a restricted module import, builtin call, or dunder attribute
EXECUTION_FAILEDUNATTESTED_CLAIM when claimedInterpreter exited non-zero, failed to assign result, exceeded output capture bounds, or timed out
SKIPPEDNoneCaller 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

  1. 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 validated int, float, bool, or control-escaped Python string literals, and the SHA-256 digest of that bound source is recorded as artifact_hash before execution.
  2. AST determinism pre-screen parses the bound source with Python ast.parse prior 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 to open, eval, exec, compile, __import__, input, and breakpoint, and dunder escape attributes (__builtins__, __globals__, __subclasses__, __loader__, __spec__, and __import__) exit immediately as NON_DETERMINISTIC_PROFILE before user code runs.
  3. Isolated subprocess execution invokes Python with -I -B inside an exclusive 0700 scratch directory that is deleted immediately upon completion, draining stdout and stderr concurrently with a 1 MiB cap under a wall-clock timeout (5000 ms default) and best-effort RLIMIT_AS or RLIMIT_DATA bounds.

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 sha256 artifact_hash of 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, python profile identifier, perishables version, pinned as_of timestamp, and configured timeout_ms bound, deliberately omitting machine-dependent elapsed_ms so 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

CodeMeaning
DANGLING_METRIC_REFERENCEA metric, LookML measure, Cube view selection, or AtScale hierarchy level references a missing measure, field, metric, or attribute
NAME_COLLISIONTwo or more metrics, measures, dimensions, or synonym aliases claim the same case-insensitive display name
LAPSED_VERIFIED_QUERYA verified query records a verified_at instant earlier than the definition's changed_at timestamp
DANGLING_RELATIONSHIPA declared relationship, join, or extends parent names a model, table, cube, or view absent from the definition
BENCHMARK_WITHOUT_ANSWERA stored ground-truth benchmark or verified query has an empty question or empty expected SQL
AMBIGUOUS_JOIN_PATHTwo 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 description or missing label on metrics, measures, and dimensions
  • Missing synonyms on 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_by or verified_at, sample questions without stored answers, unmatched LookML include globs, and Cube ai_context strings 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, and parameter blocks 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 returns Err(String) rather than a partial grade.

Mapping to the normalized model

  • Each view becomes a model in Definition::model_names.
  • dimension and dimension_group blocks map to Dimension items carrying label, description, and synonyms alias claims.
  • measure blocks map to Metric items whose measure_refs are extracted from ${field} and ${view.field} interpolations inside sql, excluding Looker's ${TABLE} pseudo-reference.
  • explore join blocks map to Relationship edges 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.

  1. Cross-file merging combines views, explores, and include directives across all supplied files.
  2. extends resolution records each extends: [parent] declaration as a structural relationship (flagging missing parent views via DANGLING_RELATIONSHIP) and iteratively inherits parent dimensions and measures not overridden by the child view while preserving qualified child.field addressability.
  3. 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 with DANGLING_METRIC_REFERENCE when a target view or field is absent.
  4. include pattern coverage matches model include globs 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.rs parses 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.rs validates 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.rs implements FIPS 180-4 SHA-256 over byte slices for deterministic source drift verification and bound computation artifact digests.
  • bundle.rs inventories bundle files in sorted path order while skipping hidden files, reserved files (index.md and log.md), and symlinks so directory cycles cannot overflow the stack and symlinks cannot escape the bundle root.
  • checks.rs implements the four locked calls (recompute_tier, check_currency, walk_supersession, and check_supersession) alongside check_freshness, check_provenance, check_drift, and info_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, and lookml.rs. Every reader rejects inputs outside its stated subset with an explicit Err(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, and atscale.rs.
  • Shared rule families (check_dangling, check_collisions, check_currency, check_relationships, check_join_paths, check_ground_truth, and notes) operate strictly on Definition without 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.rs validates parameter identifiers, binds typed or string-escaped parameter literals ahead of user code, hashes the bound source before execution, pre-screens the Python AST via ast.parse, enforces timeouts and concurrent 1 MiB pipe draining across threads, and cleans up an exclusive 0700 scratch directory after each run.
  • render.rs emits canonical text, RFC 8259 json, OASIS sarif 2.1.0, and GitHub Actions github workflow annotations.

Determinism guarantees

  1. Every timestamp comparison uses an explicit AuditClock supplied on the command line or API. No check calls SystemTime::now().
  2. Bundle::load traverses directories in lexicographical order and ignores host filesystem mtime metadata so fresh clones and historical checkouts produce identical reports.
  3. Findings and notes are canonically sorted before rendering.
  4. Wall-clock execution duration (elapsed_ms) is omitted from default audit output and included only when --timing is 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

ClaimEnforcement
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 readsAuditClock 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 directoriesperishables 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 githubCanonical 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 codePlanted-defect fixture(s)What the gate proves
LAPSED_VERIFICATIONcorpus/fixtures/t1-lapsedDowngrades raw=human-reviewed to recomputed=unverified and fails when generated_at is newer than verified_at.
SUPERSESSION_CYCLEcorpus/fixtures/t2-cycle-two, corpus/fixtures/t2-cycle-threeDetects 2-node and 3-node cycles in superseded_by chains without looping.
DANGLING_SUPERSEDED_BYcorpus/fixtures/t3-dangling-missing, t3-dangling-external, t3-dangling-escapeRejects missing targets, external URLs, and bundle-escaping ../../ paths in superseded_by.
STALE_BUT_STABLEcorpus/fixtures/t4-stale-stableFlags status: stable concepts whose stale_after timestamp has passed at the pinned AuditClock.
ATTESTED_RESULT_MISMATCHcorpus/fixtures/t5-attested-mismatchRe-runs deterministic Python Attested Computation in an isolated scratch directory and fails when output differs from claimed_result.
UNATTESTED_CLAIMcorpus/fixtures/t5-unattested-claimRejects attested result claims backed by non-local or disallowed runtimes (such as bigquery) or skipped under --no-exec.
UNRESOLVED_CITATIONcorpus/fixtures/t6-provenance-footnoteFlags Markdown body [^id] citations outside code blocks that match no declared sources entry.
MISSING_SOURCEcorpus/fixtures/t6-provenance-missing-fileFlags in-bundle sources.resource paths missing from disk or escaping the bundle root.
SUPERSEDED_WITHOUT_DEPRECATEDcorpus/fixtures/t7-superseded-without-deprecatedFlags concepts carrying superseded_by while still declaring status: stable.
UNPARSEABLE_STALE_AFTERcorpus/fixtures/t8-malformed-stale-afterRejects unparseable or invalid calendar dates on stale_after so malformed dates never silently pass as fresh.
MALFORMED_VERIFICATIONcorpus/fixtures/t8-malformed-verificationRejects verification events missing timestamps or carrying invalid metadata.
SOURCE_DRIFTcorpus/fixtures/t9-source-driftHashes 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-verifiedProves zero false positives across healthy supersession chains, machine and team verifications, and plain unverified notes.

Cross-ecosystem semantic grading (perishables-semantic)

Finding codePlanted-defect fixture(s)What the gate proves
DANGLING_METRIC_REFERENCEcrates/perishables-semantic/tests/fixtures/dangling.json (dbt), atscale-dangling.json, lookml-field.lookml, lookml-dimension-field.lookml, cube-view-dangling.jsOne finding per reference to an undefined measure, dimension, or field, across every reader.
NAME_COLLISIONcrates/perishables-semantic/tests/fixtures/collision.json (dbt), ossie-collision.json, looker-defects.json, lookml-defects.lookmlOne finding per case-folded display name or synonym claimed by two or more fields.
LAPSED_VERIFIED_QUERYcrates/perishables-semantic/tests/fixtures/snowflake-lapsed.yamlA stored verified query whose verification predates the definition change is flagged, never re-credited.
DANGLING_RELATIONSHIPcrates/perishables-semantic/tests/fixtures/cube-dangling.json, looker-defects.json, lookml-defects.lookmlJoins, relationships, and extends parents naming missing targets are flagged per reference.
BENCHMARK_WITHOUT_ANSWERcrates/perishables-semantic/tests/fixtures/databricks-benchmark.jsonA stored benchmark whose question or expected SQL is empty cannot be graded and is flagged.
AMBIGUOUS_JOIN_PATHcrates/perishables-semantic/tests/fixtures/cube-fan.jsonTwo models joined by both a direct route and a longer alternate route are flagged as a fan trap.
EcosystemInput shapesEnforcing test suites
dbt Semantic Layersemantic_manifest.json and full manifest.jsoncrates/perishables-semantic/tests/ and crates/perishables/tests/cli.rs
Apache OssieJSON and YAML semantic modelscrates/perishables-semantic/src/ossie.rs and integration tests
SnowflakeExported Semantic View YAML (--changed-at)crates/perishables-semantic/src/snowflake.rs and CLI tests
Databricks GenieSerialized Genie space JSONcrates/perishables-semantic/src/databricks.rs and CLI tests
CubeREST /v1/meta JSON, .yaml models, and .js cube(...) / view(...) filescrates/perishables-semantic/src/cube.rs, js.rs, and CLI tests
Looker and native LookMLAssembled API JSON and .view.lookml / .model.lookml files (extends, include globs)crates/perishables-semantic/src/looker.rs, lookml.rs, and CLI tests
AtScaleExported model JSONcrates/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 categoryExamplesWhat those tools checkWhat perishables adds
Schema and syntax validatorsJSON Schema, yamllint, Markdown lintersWhether YAML, JSON, or Markdown conforms to structural field typesWhether 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 compilersdbt parse, MetricFlow CLISyntax and single-tool DAG validity inside one vendor toolchainZero-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 validatorsspectacles (Looker), live BI SQL runnersWhether generated SQL executes without database errors against a live cloud warehouse via API credentialsOffline .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 platformsMonte Carlo, Elementary, Soda, Great ExpectationsRuntime warehouse table freshness, row-count anomalies, null rates, and distribution driftRepository-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[].at against generated.at to catch silently stale human sign-off (LAPSED_VERIFICATION).
  • Comparing stale_after against a pinned AuditClock (STALE_BUT_STABLE, UNPARSEABLE_STALE_AFTER).
  • Walking multi-hop superseded_by graphs across the bundle inventory (SUPERSESSION_CYCLE, DANGLING_SUPERSEDED_BY, SUPERSEDED_WITHOUT_DEPRECATED).
  • Matching Markdown [^footnote] citations to sources entries and hashing referenced files on disk (UNRESOLVED_CITATION, MISSING_SOURCE, SOURCE_DRIFT).
  • Re-running deterministic Python Attested Computation blocks 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:

  1. 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. perishables grades all seven formats with one static binary, one exit-code contract, and one SARIF 2.1.0 ruleset (CROSS-ECOSYSTEM.md).
  2. 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 across measure, dimension, and dimension_group SQL blocks (DANGLING_METRIC_REFERENCE), missing join or extends targets (DANGLING_RELATIONSHIP), ambiguous join loops (AMBIGUOUS_JOIN_PATH), and duplicate labels or synonyms (NAME_COLLISION).
  • Pairs naturally with warehouse SQL validators: run perishables grade-looker on 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. perishables never 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-semantic grades compiled manifest.json / semantic_manifest.json for dbt and declarative cube(...) / 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 perishables is 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. perishables diagnoses decay and outputs machine-readable verdicts (text, json, sarif, github); updating claims and recording new human: 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 at timestamp is earlier than generated.at on the same concept, the content changed after the review, so the event is classified as lapsed (LAPSED_VERIFICATION) and excluded from recomputed_tier.
  • Only actors with the human: prefix (such as human:alice@example.com) qualify for human-reviewed. Automated (process:) and group (team:) handles yield machine-confirmed because a group alias does not identify an accountable individual human reviewer.
  • Events missing by or a valid calendar at timestamp emit MALFORMED_VERIFICATION and 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).