1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
//! # The tier-2 extension seam
//!
//! `API_SPEC.md` §3 splits every exported symbol into three tiers: **stable
//! API** (harmonized across bindings, breaks only at a major), **extension
//! seam** (named and documented, may differ between bindings, may break at a
//! minor), and **private** (unreachable).
//!
//! The crate root is the stable tier: every `earthsci_ast::<name>` path is a
//! `pub use` in `lib.rs` and is pinned symbol-by-symbol by `api-surface.json`.
//! This module is the tier-2 half of the same contract — the ONE place where a
//! Rust-only internal is deliberately handed to a caller. Every entry here is
//! reachable on purpose, was demanded by a real consumer, and carries **no**
//! cross-binding promise: it may be renamed or removed in a minor release.
//!
//! Everything not re-exported here or from the crate root is `pub(crate)` and
//! genuinely unreachable — the module list in `lib.rs` is no longer a de-facto
//! API.
//!
//! ## Membership rule
//!
//! An item belongs here when it is not in the root re-export list AND either:
//!
//! 1. a real consumer names it — a test, a bench, an example, or one of the
//! `src/bin` binaries, all of which link this crate from outside; or
//! 2. it has no in-crate caller at all. A `pub fn` nobody in the crate calls
//! existed only to be called from OUTSIDE the crate, so demoting it would
//! not encapsulate it — it would delete it, and `rustc` would say so with a
//! `dead_code` warning. Those are re-exported here rather than silenced
//! with `allow(dead_code)`, which would leave them alive but unreachable.
//!
//! An item with in-crate callers and no outside consumer is neither: it is
//! private, and it stays private.
//!
//! ## What is NOT here
//!
//! Four seams keep their own top-level module path because `API_SPEC.md` §3/§7
//! already names them that way, and one more is a build-harness detail:
//!
//! - [`crate::intern`], [`crate::performance`], [`crate::simulate_array`] —
//! named verbatim in §3 as `earthsci_ast::intern::*`, `::performance::*`,
//! `::simulate_array::*`.
//! - [`crate::provider`] — §7's "Runtime I/O" family: the provider/refresh
//! protocol a host binds to, whose concrete implementations live in
//! EarthSciIO.
//! - `crate::esio_provider` (feature `esio`) and `crate::wasm`
//! (feature `wasm`) — opt-in bridges whose whole purpose is to be called
//! from outside; the wasm one is a `wasm_bindgen` ABI and cannot be
//! `pub(crate)` at all.
//! - `crate::adapter_support` — `#[doc(hidden)]` argument parsing for the
//! conformance-adapter *binaries*, which are separate crate targets and so
//! cannot see `pub(crate)`.
//!
//! ## Naming
//!
//! Submodules mirror the private module a symbol comes from, so provenance
//! survives the demotion and generic names (`expand`, `gather`) do not
//! collide.
/// Aggregate (`sum_product` / semiring FAQ) range resolution.
/// `polygon_area` expressed as a `sum_product` FAQ over the clip ring,
/// evaluated through the array simulator. Native-only, like the runtime it
/// drives; the wasm regridder keeps the imperative `polygon_area`.
/// Pure, I/O-free structural and expression analysis helpers. Written for the
/// `esm` CLI's `analyze` subcommand, which is a separate crate target.
/// Planar spatial-index broad phase behind the overlap join-gate, plus the
/// brute-force oracle, the visit counter the scaling tests assert on, and the
/// driver kill-switch the differential tests flip.
/// Refresh-cadence partitioning internals, including the five predicates the
/// cross-language cadence corpus is written against.
/// Classification queries with no cross-binding counterpart. The esm-spec
/// section 6.3.1 family itself is the stable tier, at the crate root.
/// Simulation-output derivation internals.
/// The structured diagnostic carrier every raise site funnels through.
/// Document-editing operations with no root re-export. The four event
/// operations are `stable` in the four OTHER bindings (`api-surface.json`);
/// Rust implements them but has never named them at the crate root, so they
/// live here rather than silently becoming dead code. Promoting them to the
/// stable tier is a manifest change, not an encapsulation one — see the H-3
/// report.
/// The shared single-message error newtype that `CadenceError`,
/// `JoinError` and friends alias. `EsmError` (the crate-wide enum) is the
/// stable tier, at the crate root; this is the newtype those aliases wrap, and
/// `wildlandfire.esm/run-model-rs` names it directly.
/// Flatten-pass internals.
/// Geometry kernels with no cross-binding counterpart.
/// The load-time `expression_templates` rewrite (esm-spec §9.6). Raw-JSON by
/// design — see item 14 of `API_SPEC.md` §8.
/// Scalar-simulation internals. The `EsmProblem` / `solve` surface itself is
/// the stable tier, at the crate root.
/// Event-level substitution. The model-level entry points are the stable tier
/// (`substitute`, `substitute_in_model`, ...); these reach one event, trigger
/// or affect at a time and are Rust-only.
/// A data loader's declared `unit_conversion` (esm-spec section 8.5). `stable`
/// in Julia and Python; in Rust its only in-crate caller is the feature-gated
/// `esio_provider`, so without this re-export the whole module is dead on a
/// default build.
/// Projection-pushdown desugar internals.
/// Build-time value invention (derived index sets). The `apply_*` /
/// `materialize_*` entry points are the stable tier, at the crate root; this
/// predicate has no native caller left and none at all on wasm32.
/// Document types that are part of the serialized schema but are not in the
/// stable root re-export list — reachable so a caller can name them in a
/// signature, not promised across bindings.