Build the in-memory JTMS and taxonomy for the persistent stores — the store-to-belief
recover, which installs a belief image (vaelii.impl.belief-image) or rebuilds from
the records and writes one.
It sits just below vaelii.core, above settle, so the two callers that recover a store
both reach it downward and neither reaches up: vaelii.core exposes it as the public
recover, and vaelii.impl.io.import recovers the records a dump just landed
(docs/namespaces.md, "The layering"). recover orchestrates the layers below —
rebuild-tms over the JTMS, special/rebuild-taxonomy, the roster rebuilds in kb, and
the closing settle — so the top of that orchestration lives here rather than inside any
one of them. The contract recover holds to is on vaelii.core/recover; docs/taxonomy.md
and docs/nmtms.md carry the mechanism.
Build the in-memory JTMS and taxonomy for the persistent stores — the store-to-belief `recover`, which installs a belief image (`vaelii.impl.belief-image`) or rebuilds from the records and writes one. It sits just below `vaelii.core`, above `settle`, so the two callers that recover a store both reach it downward and neither reaches up: `vaelii.core` exposes it as the public `recover`, and `vaelii.impl.io.import` recovers the records a dump just landed (docs/namespaces.md, "The layering"). `recover` orchestrates the layers below — `rebuild-tms` over the JTMS, `special/rebuild-taxonomy`, the roster rebuilds in `kb`, and the closing `settle` — so the top of that orchestration lives here rather than inside any one of them. The contract `recover` holds to is on `vaelii.core/recover`; docs/taxonomy.md and docs/nmtms.md carry the mechanism.
(recover kb)The implementation of vaelii.core/recover — build the in-memory JTMS and taxonomy for
the persistent stores. The public contract, and when a caller runs it, are on
vaelii.core/recover; the mechanism is here, in vaelii.impl.belief-image and in
docs/taxonomy.md.
A :disk-snapshot KB whose belief image still describes its records, its source and
its policies installs the image and recovers nothing (belief-image/install!). Every
other KB, and that one whenever the image is declined, recovers from the records
(recover-from-records) and then writes an image for the next open
(belief-image/save!, a no-op for a KB that takes none). Both paths register the
close-time refresh (belief-image/register-close!).
The implementation of `vaelii.core/recover` — build the in-memory JTMS and taxonomy for the persistent stores. The public contract, and when a caller runs it, are on `vaelii.core/recover`; the mechanism is here, in `vaelii.impl.belief-image` and in docs/taxonomy.md. A `:disk-snapshot` KB whose belief image still describes its records, its source and its policies installs the image and recovers nothing (`belief-image/install!`). Every other KB, and that one whenever the image is declined, recovers from the records (`recover-from-records`) and then writes an image for the next open (`belief-image/save!`, a no-op for a KB that takes none). Both paths register the close-time refresh (`belief-image/register-close!`).
(recover-with-image kb dir records)recover, trying the belief image in dir first — an export dump's, which
vaelii.impl.io.import lands the records of. records is the content fingerprint of
the records the import landed, {:sentexes fp :justifications fp}, in the form the
dump's manifest carries. Returns {:belief :installed} or {:belief :recovered :reason r}, r the reason belief-image/install-from! gave for declining the image.
`recover`, trying the belief image in `dir` first — an export dump's, which
`vaelii.impl.io.import` lands the records of. `records` is the content fingerprint of
the records the import landed, `{:sentexes fp :justifications fp}`, in the form the
dump's manifest carries. Returns `{:belief :installed}` or `{:belief :recovered :reason
r}`, `r` the reason `belief-image/install-from!` gave for declining the image.(register-fresh-store! kb)Register the belief image's close-time save for kb when it opened over an empty
store, and return kb. Such a KB builds its belief assert by assert and never runs
recover, so without this its first image would wait for the next open's recover. A
KB opened over a populated store registers inside recover instead, and one opened
with :recover? false over a populated store registers nowhere: it holds no belief to
write. belief-image/save! refuses a KB whose network does not cover its records, so
a loader that fills this KB and skips the recover leaves nothing to write.
Register the belief image's close-time save for `kb` when it opened over an empty store, and return `kb`. Such a KB builds its belief assert by assert and never runs `recover`, so without this its first image would wait for the next open's recover. A KB opened over a populated store registers inside `recover` instead, and one opened with `:recover? false` over a populated store registers nowhere: it holds no belief to write. `belief-image/save!` refuses a KB whose network does not cover its records, so a loader that fills this KB and skips the recover leaves nothing to write.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |