Skip to main content

Module fact

Module fact 

Source
Expand description

Normalized fact schema.

Every analysis pass emits its results as a stream of Fact records sharing one canonical shape. A fact is:

  1. A stable FactId — the SHA-256 of the canonical serialisation of every other field, so re-emitting the same fact under the same inputs produces the same id.
  2. A FactKind discriminator naming the family it belongs to (declaration, reference, edge, opacity, …).
  3. A typed payload — the per-family struct carrying the actual evidence.
  4. A FactProvenance record naming the analysis pass that emitted the fact (component name, version, run id).

Downstream consumers (lineage, doc, SAST, bindings) walk a FactStore and filter by kind. This keeps the engine’s internal wiring loose — passes don’t need to know about each other, only that they emit compatible Facts.

§/oracle evidence

  • DATABASE-REFERENCE.md PL/SQL Language Reference — the fact families (declarations, references, dependency edges, dynamic-SQL evidence) trace 1:1 to the PL/SQL declaration / reference / call grammar.
  • LOW-LEVEL-CATALOGS.md Data Dictionary View Families — each fact family has a server-side mirror (ALL_OBJECTS for declarations, ALL_DEPENDENCIES for edges, ALL_SOURCE.WRAPPED for the wrapped-source opacity fact, …).

Structs§

Fact
A fact record. Wraps a typed payload with stable id + family
FactId
Stable identity for a fact — fact:<hex> form.
FactProvenance
Provenance — which analysis pass produced the fact, when, at what engine version.
FactStore
Append-only collector — analysis passes push facts in; consumers walk them out.

Enums§

FactKind
What family a fact belongs to. Drives consumer dispatch without having to match the payload.
FactPayload
Discriminated payload — one variant per FactKind. The per-family types are intentionally lightweight; consumers that need richer detail re-fetch from the originating crate’s model (e.g. lineage’s LineageResult).

Functions§

mint_fact
Build a Fact with the canonical id derived from (kind, provenance, payload). The id is fact:<hex> so it doesn’t collide with the sha256: namespace other engine bytes use.