ifc-lite-processing 9.4.0

Shared IFC processing pipeline and types used by server and FFI
Documentation
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! #4067: the per-load CSG diagnostics summary `tracing::warn!` in
//! `processor/mod.rs` used to describe EVERY recorded `CsgFailure` as
//! "cut dropped, host kept uncut." That is false for a `KernelError` record —
//! `rust/geometry/src/csg/topology_diagnostic.rs` is the sole production
//! emitter, and its doc comment is explicit that it "record[s] accepted
//! nonempty open-topology results without changing the returned mesh" — the
//! mesh the caller returns is the SAME one that was about to be returned
//! anyway, not a dropped cut replaced by an un-cut host.
//!
//! Pulled the message choice out into its own pure function so the text can
//! be asserted directly, without standing up a tracing-subscriber capture
//! harness just to check a string literal.
//!
//! Its tests live in the sibling `csg_summary_tests.rs`, declared from
//! `processor/mod.rs` (same pattern as `determinism_tests.rs` /
//! `simplify_session_tests.rs` off `lib.rs`), rather than as an inline
//! `#[cfg(test)] mod tests` here: an inline `mod tests` lives inside the
//! same file `scripts/check-test-revert-oracle.mjs` reverts to prove a
//! changed test observes the production change it covers, so it would be
//! deleted along with the code on that revert.

/// Choose the summary phrase for the CSG diagnostics warning, given how many
/// of this load's records are genuine drops (host kept uncut) versus
/// `KernelError` accepts (mesh unchanged, informational open-topology
/// finding — see module doc above). `dropped` and `open_topology_accepted`
/// are disjoint partitions of the same failure list, so exactly one of the
/// three arms applies.
pub(super) fn csg_summary_message(dropped: usize, open_topology_accepted: usize) -> &'static str {
    if dropped == 0 && open_topology_accepted > 0 {
        "CSG diagnostics during geometry extraction (accepted result(s) recorded an open-topology audit finding; mesh unchanged, non-gating)"
    } else if open_topology_accepted == 0 {
        "CSG failures during geometry extraction (cut dropped, host kept uncut)"
    } else {
        "CSG diagnostics during geometry extraction (mix of cuts dropped with host kept uncut, and accepted results that recorded an open-topology audit finding with mesh unchanged)"
    }
}