Skip to main content

sim_lib_standard_core/
lib.rs

1#![cfg_attr(not(feature = "native-export"), forbid(unsafe_code))]
2#![cfg_attr(feature = "native-export", deny(unsafe_code))]
3#![deny(missing_docs)]
4//! Standard distribution core for the SIM runtime.
5//!
6//! The kernel defines the capability, claim, codec, and `ExportRecord`
7//! contracts; this crate supplies the standard-distribution behavior:
8//! capabilities, claims, diff, fidelity, the conformance harness, install,
9//! guest-runtime policy kits, language-profile support, the lisp codec surface,
10//! polyglot/profile support, and read/construct.
11//!
12//! # Characterizing a migration
13//!
14//! Define a bounded [`ScenarioSpec`] from public inputs and semantic observation
15//! lanes. Capture the old behavior as a [`CharacterizationCapture`], perform the
16//! refactor, and capture the same scenario again. A strict
17//! [`compare_characterization_captures`] result is either identical or contains
18//! stable paths plus the canonical value from each side. Failure locations are
19//! semantic evidence; debug output and private implementation fields are not.
20
21pub mod cap;
22mod capture;
23pub mod characterization;
24pub mod claims;
25pub mod diff;
26pub mod fidelity;
27pub mod guest_kit;
28pub mod harness;
29pub mod install;
30pub mod lang_profile;
31pub mod lisp;
32pub mod matrix;
33mod matrix_claims;
34#[cfg(feature = "native-export")]
35mod native;
36pub mod observation;
37pub mod polyglot;
38pub mod profile;
39pub mod read_construct;
40pub mod registry;
41pub mod scenario;
42
43pub use cap::{standard_diff_capability, standard_install_capability, standard_test_capability};
44pub use capture::{
45    CaptureComparison, CaptureComparisonProjection, CaptureDifference, CharacterizationCapture,
46    characterization_capture_kind, characterization_capture_predicate,
47    compare_characterization_captures, publish_characterization_capture,
48};
49pub use characterization::{
50    EVIDENCE_LANE_INVENTORY, EXPLICIT_PROJECTION_FIELDS, EvidenceLane, EvidenceLaneInventory,
51    ExplicitProjectionField, characterization_source_fixtures,
52};
53pub use claims::{
54    publish_badge_claims, publish_badge_claims_for_lib, publish_profile_claims,
55    publish_profile_claims_for_lib, standard_capability_predicate, standard_eval_policy_predicate,
56    standard_lowering_predicate, standard_numeric_predicate, standard_reader_predicate,
57    standard_unsupported_predicate,
58};
59pub use diff::{
60    ProfileDiff, ProfileDiffStatus, ProfileDifference, profile_diff_symbol, standard_diff_op_key,
61    standard_diff_stub,
62};
63pub use fidelity::{FidelityBadge, fidelity_badge_class_symbol};
64pub use guest_kit::{Arity, CoercionPolicy, GuestRuntimeKit, TruthPolicy, adjust_values};
65pub use harness::{
66    ConformanceHarness, ConformanceOutcome, ConformanceStatus, ConformanceTestCase,
67    ConformanceTestReport, OrganTestReport, StandardTestReport,
68    standard_reported_fidelity_level_predicate, standard_reported_fidelity_predicate,
69    standard_test_case_predicate, standard_test_op_key, standard_test_organ_predicate,
70    standard_test_profile_predicate, standard_test_result_predicate, standard_test_run_kind,
71    standard_test_status_predicate, standard_test_stub,
72};
73pub use install::{StandardInstallReport, install_profile_stub, standard_install_op_key};
74pub use lang_profile::{
75    FidelityBadgeSpec, ProfileBackingLib, ProfileOrganPublisher, fidelity_badge,
76    install_language_profile, language_profile_lib_symbol,
77};
78pub use lisp::{lisp_stub_symbols, standard_fidelity_symbol, standard_profile_symbol};
79pub use matrix::{
80    ConformanceMatrix, ExprRoundTripCase, ExprRoundTripObservation, LanguageRow,
81    LanguageRowBuilder, MatrixCellKind, MatrixCellResult, MatrixRunReport, MatrixRunner,
82    SourceConformanceCase, SourceConformanceCaseKind, SourceExpectation, SourceObservation,
83    compare_expr_observation, compare_source_observation,
84};
85pub use observation::{
86    BoundedLane, CanonicalFailure, CanonicalObservation, CanonicalOutcome, FailureLocation,
87    GuestValueProjection, project_guest_value,
88};
89pub use polyglot::{
90    ProfileFunction, ProfileFunctionBinding, SharedOrganRuntime, profile_function_value,
91};
92pub use profile::{
93    GuestProfileEvidence, LanguageProfile, OrganUse, language_profile_class_symbol,
94    sim_expression_profile, sim_expression_profile_symbol, standard_binding_organ_symbol,
95    standard_control_organ_symbol, standard_pattern_organ_symbol, standard_sequence_organ_symbol,
96};
97pub use read_construct::{
98    FidelityBadgeValue, LanguageProfileValue, install_standard_core_classes,
99    standard_core_classes_lib_symbol,
100};
101pub use registry::ProfileRegistry;
102pub use scenario::{
103    CharacterizationScenario, ScenarioDriver, ScenarioInput, ScenarioLimits,
104    ScenarioObservationLane, ScenarioSpec,
105};
106
107/// Cookbook recipes for this lib, embedded at build time.
108pub static RECIPES: sim_cookbook::EmbeddedDir =
109    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
110
111#[cfg(test)]
112mod guest_kit_tests;
113#[cfg(test)]
114mod harness_tests;
115#[cfg(test)]
116mod matrix_tests;
117#[cfg(test)]
118mod neutral_characterization_tests;
119#[cfg(test)]
120mod tests;