enolaDocsConsume a snapshot

Documentation

Consume a snapshot

Run Enola as a subprocess and load the graph into your own store.

01 · Generate

Produce a snapshot

One repositoryshell
enola --generate /path/to/repo
Several repositories, one linked graphshell
enola --generate cluster.yaml --out /var/lib/acme/enola-graph

One repository writes to its own .enola/. A cluster writes once, to --out, or to ~/.enola/graphs/<key>/ without it, and the run prints the directory as Output:.

Exit code 0 means the files are current. On any other code, do not read files already in the directory. When nothing changed, the run prints Snapshot unchanged and writes nothing. Keep extractor_cache.json between runs to stay fast.

02 · Read

Load the files

File Contents
receipt.json Format version, snapshot id, provenance, counts and extraction quality
facts.jsonl The graph, one fact with its relations per line
insights.json Findings with their evidence
flows.json The ways into the program, ranked by reach
docs.jsonl Full comments, joined to facts by id
  1. Read the receipt first. Reject a format_version you do not support. Skip the load when snapshot_id is the one you have.
  2. Check what you read against fact_count, insight_count and output_hashes. Trust flows.json and docs.jsonl only when output_hashes lists them.
  3. Load facts by id. Several records can share one, so merge their relations and keep every location.
  4. Load relations by target_id. When it is absent, keep the target name as unresolved. Do not pick a match.
  5. Load findings. A missing fact_id in the evidence is valid.
  6. Show the quality block. Parse errors and excluded files say how complete the graph is.

03 · Concurrency

Read while a run writes

A run publishes by renaming files into place, receipt.json last, and keeps the snapshot before it in previous/. A reader should read the receipt first and compare each file with output_hashes. On a mismatch, read again a moment later, or read previous/.

04 · Upgrade

Plan for a new Enola

The Enola version is part of snapshot_id, so an upgrade changes it and you should load again. Accept unknown kinds and properties within a supported format_version.

Complete rules are in INTEGRATING.md, and every field is in the schema. The graph explains what the facts mean.