hawdb 0.24.0

An embedded Rust graph database for local data-plane workloads
Documentation
// Copyright 2026 Nowledge
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use super::*;
use hawdb_search::candidate_evidence as owner;

#[test]
fn candidate_facade_preserves_owner_types_and_entrypoints() {
    let advisor: owner::NowledgeMemRetrievalProjectionAdvisor =
        crate::nowledge_mem::NowledgeMemRetrievalProjectionAdvisor::default();
    let request: owner::NowledgeMemSearchCandidateRequest =
        crate::NowledgeMemSearchCandidateRequest::text("candidate", 4)
            .with_retrieval_projection_advisor(advisor);
    let facade: crate::NowledgeMemSearchCandidateRequest = request.clone();
    assert_eq!(facade, request);
    let options: owner::NowledgeMemSearchCandidateReadinessOptions =
        crate::NowledgeMemSearchCandidateReadinessOptions::lancedb_replacement_candidate_read();
    let _: crate::NowledgeMemSearchCandidateReadinessOptions = options;
    let _: fn(
        owner::NowledgeMemSearchCandidateReport,
        &owner::NowledgeMemSearchCandidateReadinessOptions,
    ) -> crate::NowledgeMemSearchCandidateReadinessReport =
        crate::NowledgeMemSearchCandidateReadinessReport::from_candidate_report;
    let _: fn(
        &crate::NowledgeMemSearchCandidateOutput,
        &owner::NowledgeMemSearchCandidateReadinessOptions,
    ) -> owner::NowledgeMemSearchCandidateReadinessReport =
        owner::NowledgeMemSearchCandidateOutput::readiness_report;

    let mut accumulator: owner::NowledgeMemSearchCandidateShadowAccumulator =
        crate::NowledgeMemSearchCandidateShadowAccumulator::new();
    accumulator.record_compare_candidate_ids(&["candidate"], &["candidate"]);
    accumulator.record_filter_pushdown_fields(
        1,
        NOWLEDGE_SEARCH_PROJECTION_SCAN_FILTER_FIELDS
            .iter()
            .copied(),
    );
    let evidence: crate::NowledgeMemSearchCandidateShadowEvidence = accumulator.evidence();
    let filter: crate::NowledgeMemSearchCandidateFilterPushdownEvidence =
        evidence.filter_pushdown.clone().unwrap();
    let _: owner::NowledgeMemSearchCandidateFilterPushdownEvidence = filter.clone();
    let _: crate::NowledgeMemSearchCandidateFieldSummary = filter.field_summaries[0].clone();
    assert_eq!(
        crate::nowledge_mem_search_candidate_shadow_evidence_json(&evidence),
        owner::nowledge_mem_search_candidate_shadow_evidence_json(&evidence)
    );
    let _: fn(&serde_json::Value) -> Result<owner::NowledgeMemSearchCandidateShadowAccumulator> =
        crate::parse_search_candidate_shadow_probe;
}