Skip to main content

Crate fathomdb_engine

Crate fathomdb_engine 

Source

Re-exports§

pub use lifecycle::Subscription;

Modules§

lifecycle
Lifecycle observability data types.

Structs§

CheckIntegrityOpts
Doctor check-integrity invocation flags. quick and round_trip are accepted in 0.6.0 but treated as default; only full activates PRAGMA integrity_check. Per dev/design/recovery.md § Doctor-only flags.
CorruptionDetail
Stable corruption-on-open detail carried by EngineOpenError::Corruption.
CounterSnapshot
Snapshot of engine-internal counters returned by Engine::counters.
DumpProfileReport
Result of [Engine::dump_profile]. Mirrors the open-time embedder posture + the per-kind vector configuration registered in _fathomdb_vector_kinds.
DumpRowCountsReport
Result of [Engine::dump_row_counts]. Canonical tables only; projection / FTS / vec0 shadow tables are excluded. Order matches fathomdb_schema::CANONICAL_TABLES.
DumpSchemaReport
Result of [Engine::dump_schema]. user_version is the PRAGMA user_version sentinel. Canonical tables appear first per fathomdb_schema::CANONICAL_TABLES, then remaining non-sqlite_* tables alphabetically. Indexes follow the same alphabetical rule.
Engine
ExciseReport
Phase 9 Pack B excise report (AC-028a/b/c). Counts are post-excise totals; projections_invalidated reports the shadow-row invalidation total (FTS5 + vec0 + projection terminal) for the excised source.
Explanation
0.8.8 EXP-OBS (Slice 5) — the opt-in retrieval explanation payload returned behind search_explained (the explain=true surface). Built from the engine’s OWN fusion/rerank machinery (fuse_three_arms per-arm ranks, ce_rerank blend components) — no parallel machinery (R-OBS-3). Carries a query-level QueryTrace plus a per-hit breakdown parallel to (and in the same order as) SearchResult.results.
ExtractDocument
G11 (Slice 15) — a document sent to a BYO-LLM extraction harness via Engine::ingest_with_extractor.
Finding
Single doctor finding record. Stable report-shape per AC-043c. The code and doc_anchor strings are stable dispatch keys owned by dev/design/recovery.md § Code-to-operator-action cross-reference.
GraphFrontierStats
G0 Phase-2 (E0a / BLOCK-1) — graph-arm frontier instrumentation. A side-channel meter (deliberately NOT a SearchResult/SearchHit field — byte stability) that proves whether the graph arm seeds a non-empty frontier. Under the current doc-seeded path the frontier is empty (doc nodes carry logical_id = NULL), so seeds_resolved == 0 and resolved_seed_rate == 0.0 — this meter is the measurement that proves it (and, post-C1, the 0→>0 flip).
IngestWithExtractorReceipt
G11 (Slice 15) — receipt returned by Engine::ingest_with_extractor.
IntegrityReport
Three-section integrity report. AC-043a pins exactly these three keys.
MeanRecomputeReport
0.7.2 PR-2b — result of [Engine::recompute_mean] (the manual doctor recompute-mean path) and of the shared in-transaction recompute core. drift_cos_before is the cosine between the freshly derived corpus mean and the previously-pinned mean (1.0 when nothing was pinned yet, i.e. a first pin). mean_was_pinned distinguishes a refresh of an existing mean from an initial pin. See dev/design/embedder.md §0.3.
NodeRecord
Slice 30 (G2) — an active canonical node row returned by read.get / read.get_many.
OpStoreRow
Slice 30 (G3) — one operational_mutations row returned by read.collection / read.mutations. id is the autoincrement PK (the after-id cursor key).
OpenReport
OpenedEngine
PerHitExplain
0.8.8 EXP-OBS (Slice 5) — per-hit provenance + score breakdown. One entry per returned SearchHit, same order. *_rank is the 0-based rank the hit’s body held in that arm’s pre-fusion list (None = absent from that arm).
QueryTrace
0.8.8 EXP-OBS (Slice 5) — query-level retrieval trace. Reuses the existing search_reranked knobs + the active embedder identity; timings are coarse per-stage wall-clock (monotonic) captured only on the explain path.
RebuildReport
Structured result of a rebuild operation. rows_invalidated is the total shadow-state rows truncated before re-derivation; rows_rebuilt is the count of rows the synchronous rebuild loop re-materialised (asynchronous re-enqueue work performed by the projection scheduler is not counted here). projection_cursor_after is the post-rebuild value of the projection cursor.
RecoveryHint
Recovery dispatch surface attached to a corruption detail.
SafeExportArtifact
Result of a successful [Engine::safe_export] call. The returned manifest_sha256 equals the SHA-256 of the export file bytes (per AC-039a) and matches the sha256 field written into the manifest JSON.
SchemaObject
Single table or index entry emitted by [Engine::dump_schema].
SearchExpandResult
Slice 20 (G6) — result of Engine::search_expand: initial search hits plus nodes reached by bounded BFS expansion that are not already in the search hit set.
SearchFilter
G10 — closed metadata filter for Engine::search_filtered (Slice 10).
SearchHit
A single structured search hit (G1 / AC-057a-clean).
SearchResult
Hybrid search result. results carries structured SearchHits in vector-first, dedup-on-body order. Derives Clone, Debug, PartialEq but not Eq — each hit carries a score: f64.
SoftFallback
Soft-fallback signal carried on hybrid search results.
TableRowCount
Single canonical-table row count emitted by [Engine::dump_row_counts].
TraceEvent
Single canonical-row tracing record. table is one of "canonical_nodes" or "canonical_edges".
TraceReport
Phase 9 Pack B trace report (AC-042). One event per canonical row attributable to the requested source_id, ordered by write_cursor ascending.
TruncateWalReport
Result of [Engine::truncate_wal]. Carries the three counters returned by PRAGMA wal_checkpoint(TRUNCATE): busy, log_frames, checkpointed_frames.
VerifyEmbedderReport
Result of [Engine::verify_embedder]. stored_identity is the name:revision pair persisted in _fathomdb_embedder_profiles; supplied_identity echoes the operator’s input verbatim.
WriteReceipt

Enums§

ComparisonOp
G4 (Slice 35) — comparison operator for Predicate::JsonPathCompare.
CorruptionKind
Open-path corruption category.
CorruptionLocator
Locator pointing at the corrupted region of the database file.
EmbedderChoice
Caller-facing selector for the embedder used by an opened engine (dev/design/embedder.md §0).
EngineError
EngineOpenError
OpenStage
Engine.open stage at which corruption was detected.
Predicate
G4 (Slice 35) — closed typed predicate for Engine::read_list filter.
PreparedWrite
Batch input shape for Engine::write.
RebuildKind
Which shadow-state surface a RebuildReport describes. Projections covers the full FTS5 + vec0 + projection-terminal rebuild emitted by [Engine::rebuild_projections]. Vec0 covers the vec0-only path emitted by [Engine::rebuild_vec0].
ScalarValue
G4 (Slice 35) — scalar value for Predicate comparisons.
Section
One section of an IntegrityReport. Either every check in the section was clean, or one or more typed Findings describe the detected issue. Per AC-043b.
SoftFallbackBranch
Which retrieval branch produced a hit (or could not contribute).
TraversalDirection
Slice 20 (G5) — direction of graph traversal for Engine::graph_neighbors / Engine::search_expand.
TruncateWalStatus
Typed outcome of [Engine::truncate_wal]. Done matches SQLite’s busy = 0 return from PRAGMA wal_checkpoint(TRUNCATE); any other value surfaces as Busy.
VerifyEmbedderStatus
Typed outcome of [Engine::verify_embedder]. Mismatches do not raise EngineError; the operator workflow needs to see the stored vs. supplied pair to decide on next action.

Constants§

MEAN_VEC_PIN_THRESHOLD
EU-5a2 — number of documents required before the workspace’s _fathomdb_embedder_profiles.mean_vec is pinned for the default profile. Per dev/design/embedder.md §0.3 (compute-once-on-first- ingest lifecycle). Public-visible so the EU-5a2 machinery test can assert the value.
RECENCY_WEIGHT
G12-recency — additive recency weight. Must satisfy two constraints:
RRF_K
G9 — Reciprocal Rank Fusion constant. IR-C (2026-06-10b, performance-output-and-compare.md) found the standard k≈60 slightly too high: the recall gain is concentrated at the top of the list, where a lower k sharpens rank-1/2 contributions. k=30 is the validated operating point (k10 > k30 > k60 > k100 on the sweep, 30 the conservative middle). Fusion is on rank, never raw score.
RRF_WEIGHT_GRAPH
R3 (Slice 30) — graph arm RRF weight. Conservative starting value (equal to RRF_WEIGHT_VECTOR). Without R2 per-class delta data the graph arm weight cannot be calibrated; 1.0 is the minimum non-zero contribution. The graph arm surfaces newly-reachable nodes from BFS traversal; it is not meant to override the primary text/vector signals. Revisable after R2 data arrives. See dev/design/slice-30-design.md §Q2.
RRF_WEIGHT_TEXT
RRF_WEIGHT_VECTOR
G9 / IR-C — per-branch RRF weights. The sweep’s optimum is strongly text-dominant (text:vector ≈ 3:1): the lexical (BM25) arm carries exact-fact recall and the dense arm, over-weighted, is a net drag on exploratory recall (performance-output-and-compare.md, 2026-06-10b/e). A branch contributes weight / (RRF_K + rank).
SEARCH_RERANK_LIMIT
0.7.2 PR-2bc S1 fix-1 — production phase-2 rerank LIMIT for engine search. This is the original hardcoded LIMIT 10; it is the default and the floor for search_limit_override (a test seam may RAISE it but never shrink it below this). There is NO env-var override on the hot path.
TOP_K_BIT_CANDIDATES

Functions§

rerank_passages
0.8.2 Slice E2 — standalone CE rerank of a caller-supplied passage list.