Expand description
Feature-history execution with exact name resolution and stable output names.
execute_history updates its live SceneMap after every feature. Reference
parameters resolve by exact name; misses produce structured unresolved
entries in FeatureResult. Output names must preserve saved-document naming
conventions because later features store those names as references.
Feature descriptors retain {type, inputParams, persistentData, timestamp}.
Numeric parameters accept literals or expressions evaluated against Env.
Registry borrows stay local to each operation and never span feature execution. Features call Rust operations directly, preserving names on resident solids. Removed scene solids and consumed intermediates must release their handles.
Re-exports§
pub use assembly::AssemblyState;pub use assembly::ConstraintEntry;pub use context_offer::feature_context_applicable;pub use context_offer::SelectionProbe;
Modules§
- assembly
- Assembly constraint state, lifecycle, and solver mapping.
- context_
offer - Selection-context applicability — kernel-owned show/no-show for the app’s selection context bar.
- extension
- Scoped, interpreter-independent history extension provider.
- nurbs_
solid - The NURBS Solid’s cage resolver, which the engine’s cage editor reads its
handles through (
resolve_cage,primitive_cage,has_persisted_cage). NS — NURBS Solid: a smooth body shaped by a control cage. - part_
pins - A part’s symbol pins ARE its harness ports, bound by label (eCAD plan
decision 8): the pin/port report, following an edit from one side to the
other, and resolving a placed part’s pin to its port id (see
part_pins.rs). A part’s symbol PINS are its declared connection POINTS (eCAD plan decision 8: pins and points are bound in the part, never on an assembly or a placed component). - pmi
- PMI — Product and Manufacturing Information: the document’s
pmiblock (views that own annotations), the annotation type table with its schemas and selection predicates, and the history tail that resolves every annotation against the just-built scene into a typedPmiReport. - ports
- PORTS — a part’s declared connection points, as PART DATA rather than history features.
- wire_
harness - Wire-harness routing: the document’s
wireHarnessblock, the sided port graph, per-connection routes and the bundle solids — solved at the tail of every run likeassembly(seewire_harness.rs). Wire harness — the document’swireHarnessblock, the SIDED port graph, per-connection routing, and the bundle solids. Solved at the tail of every history run (likeassembly), against the ports and spline segments the run published.
Structs§
- Added
Solid - A solid produced by a feature: its resident handle, its solid name, and its
named faces/edges (
(topology_id, name)). the caller tessellates/pulls names via the handle; the scene-map registers the names for downstream reference resolution. - Axis
- A named world-space line — a revolve/sweep axis. Published by SKETCH features
(every sketch line geometry, construction included) and resolvable from a
resident solid edge, so an
axis/path reference resolves fully headless. - Component
Record - One scene component: an ACOMP instance’s identity, pose, and member solids.
Rides the
crate::feature_pipeline::FeatureResultcomponentsside-channel intoSceneMap::apply, exactly like profiles/frames — the scene’s component set is rebuilt from feature results every history run (a projected view, never an owning data structure). - EdgeRef
- Env
- The expression environment: the variable bindings produced by evaluating the
prelude (
resolution = 32), the injectedconfiguratorobject, and the user’sexpressionsstatements in order. - FaceRef
- Feature
Context - The read-only context handed to each feature’s
execute. Features resolve theirreference_selectionparams againstsceneand read numeric params viaFeatureContext::number(which evaluates expression strings againstenv). - Feature
Descriptor - One feature as serialized by
PartHistory.toSerializable. Permissive: unknown fields are ignored, so an entire saved part file’sfeatures[]deserializes as-is.input_paramsstays aserde_json::Value(an object) so features read their own params with their own type knowledge (which params are numeric). - Feature
Result - Frame
- An orthonormal placement frame — a named plane (DATUM/PLANE feature) or a
resolved sketch plane.
z_axisis the plane normal. - Fulfilment
- What a SUCCESSFUL feature did with what it was asked, when that is not “everything, exactly” (plan: typed-refusal-reporting, item 3). Requested and applied are reference names as the document wrote them; every rejected one says which kind of rejection and why. A partial fulfilment is a different answer from the one asked for, so it is reported on the feature that made it and displayed by the app beside the feature; it is never a refusal class (a partial selection is a separate outcome) and never carries geometry.
- History
Progress - A feature about to EXECUTE inside
execute_history_observed— a dirty one, not a cached replay (replays are instant and are not reported). - History
Request - The
execute_history_jsonrequest: the expression source, the configurator state, and the ordered feature list. Permissive — a whole saved part file parses as a request (extra top-level fields ignored). - History
Result - The whole-history output.
- Isolated
Scene Metadata - The
take_store/restore_storebracket as an RAII guard, for OUT-OF-CRATE producers that build a payload against a LIVE document. - Parts
Library Entry - One unique part payload.
dirtyis RESIDENT-ONLY state: set byrefresh_library_entry(edit-in-context / update-components) when the new document builds differently, it forces the ACOMP self-heal lane on the next run even with a readable snapshot, and clears when the heal rewrites the snapshot. - Port
Record - One resolved connection point, keyed in
SceneMap::portsby its ADDRESS (J1.VCC,ACOMP3:J1.VCConce placed - seeports.rs). Published by the ports tail, by the WAYPOINT feature (under its own feature id) and by an ACOMP re-publishing a placed part’s points. - Profile
Loop - One closed boundary of a
SketchProfile: head-to-tail world-space curves plus the per-curve source edge name ({sketchId}:G{gid}, parallel tocurves). The profile-consumers stamp sidewall names fromedge_names(extrude →{name}_E). - Rejected
- One reference a successful feature did not act on.
- Scene
Map - The live scene-map. Exact-match resolution only (contract rule 1).
- Scene
Point - The output of one feature execution.
A named world point a feature published (a SKETCH publishes every solved
point as
{sketchId}:P{pid}; a spline its anchors, a helix its ends).constructioncarries the sketch point’s own flag: a construction point (the sketcher’s ◐ toggle, or a materialized external reference) still resolves by name — a helix may start at one — but it is NOT model geometry, so a placement consumer (the hole) skips it exactly as the profile skips construction lines. Serialized because the render-side build report carries it across the worker boundary. - Sketch
Profile - A solved sketch’s extracted profile, placed in 3D. Produced by the SKETCH
pipeline feature and consumed BY NAME by the profile-consumers (extrude,
revolve, loft, sweep, rib, sheet-metal tab/contour-flange) — the exact-BREP
replacement for the old “marshal the resolved curves into
inputParams”.
Enums§
- Feature
Refusal - What a feature’s
buildhands back when it refuses. A feature that drives a typed producer propagates theKernelRefusalwhole (?converts it), so its class reachesFeatureResult::refusal; one that drives a stringly producer propagates the text. There is noFrom<FeatureRefusal> for String: the text of a typed refusal is read throughFeatureRefusal::message, never by dropping the class. - Port
Kind - What a connection point is to the harness router: a cable END, or a pass-through that joins spline paths into a network. Not a user param any more - it is decided by WHICH producer made the record (a declared port point is a termination, a WAYPOINT feature is a waypoint).
- Rejected
Kind - Why a reference was rejected. Closed; a new kind is a producer that exists.
Functions§
- add_
part_ to_ library - INSERT: hand the opened sub-part document over to the library. Executes the
document once, snapshots, stores the entry, and returns the EFFECTIVE part
name (the ACOMP
partNamethe app must reference): - add_
part_ to_ library_ impl add_part_to_libraryfor native callers: the same insert, its error as text.- annotate_
rename - Annotate an UNRESOLVED reference with the name that replaced it, when the miss looks like the per-loop naming change.
- assign_
sketch_ loop_ ids - Assign every closed loop’s id onto the geometries of a SOLVED sketch document, in place, and report whether anything changed.
- clear_
history_ cache - Drop the whole cache, freeing every owned handle + tree. Called by the caller on a part/document switch (and by every Rust test for hermeticity).
- clear_
history_ cache_ json - wasm boundary for
clear_history_cache. - execute_
feature - Resolve one feature descriptor to a
FeatureResultagainst the current scene. Each stub’s arm calls its ownfeatures::<feat>::executeso a fan-out agent implementing a feature touches ONLY that file — never this dispatch. - execute_
history - Run a whole feature history incrementally: build the expression env once, then walk the ordered features. A CLEAN feature (see the cache section above) replays its cached result; a DIRTY one re-executes (its old outputs are freed first). On a feature error, record it and HALT (abort-on-error); errored results are never cached. Never panics.
- execute_
history_ json - Deserialize a history request, run it, and serialize the per-feature results.
The handles in the result are
u32s the caller tessellates / pulls names from via the existing*_handlewasm exports. - execute_
history_ observed execute_historywith a progress observer.observeis called immediately BEFORE each feature the run executes (cached replays are not reported); returningfalsestops the run at that boundary — the feature is not executed, nothing after it runs, and the result holds what was built so far. The boundary is the only cooperative stop the kernel offers: nothing inside a feature (a boolean, a blend, a sew) checks anything.- face_
transform_ pivot - The pivot a Transform Face whose
facesarenamesgets by default, read off the scene the results BEFORE it build — the value the app stores intopivotwhen the selection is committed, and the valuebuildfalls back to for a nullpivot, because both go throughresolve_selectionandselection_centre.Nonewhen the selection does not resolve to faces on one solid. - feature_
hidden_ params - The DIALOG FIELD-VISIBILITY hook, kernel-owned like the schemas themselves.
- feature_
schema_ catalogue - Assemble the catalogue from every feature’s own
schema(). The assembly constraint schemas join the export under their ownassemblyConstraintsnamespace so the dialog engine renders them with the same machinery. - first_
reference_ name - The first reference name of a
reference_selectionparam value (a plain string, a{name}object, or an array of either — post-sanitization it is an array). Exact match only; no[N]index / snapshot scoring. - flat_
pattern_ dxf - Export the flat pattern of the sheet-metal body
handleas DXF (R12 ASCII). Runs the unfold TRANSIENTLY off the resident tree — no feature, no history mutation. Errors if the handle carries no sheet-metal tree. - flat_
pattern_ svg - Export the flat pattern of the sheet-metal body
handleas SVG — the DXF sibling offlat_pattern_dxf. - follow_
saved_ rows - The rows rule of
refresh_library_entry_implfor a door that rewrites an entry’sdocumentin thepartsLibraryblock itself (the app’s Update components): that block is what Save writes. Rows taken fromoldfollow the same build ofnew; any other rows are dropped, as no reopen could take them. - follow_
saved_ rows_ known follow_saved_rowsfor a caller that has already askedsame_build(old, new): it is not asked again (each asks parses both whole documents as requests, ~5 ms for an l500 module).- install_
parts_ library - INSTALL a library wholesale — the app → history-runner channel (the runner owns its own thread-local store, and the per-run request no longer carries the block, so this is how a background thread/worker learns the library).
- is_
sheet_ metal_ handle - Whether the resident solid
handlecarries a sheet-metal tree — the SheetTree-free predicate the export lane filters resident solids with (so the native engine picks the flat-pattern target without touchingSheetTree). - kernel_
source_ stamp - This build’s identity for
PartsLibraryEntry::snapshot_producer: the hash of the kernel source thatbuild.rscomputes.Nonewhen the build could not compute it, which disables stale-snapshot invalidation rather than making every snapshot look stale on every run. - missing_
library_ parts - The PREFLIGHT for a run: every part name the request’s ACOMP features reference that the root store cannot resolve, in request order.
- native_
import_ payload - Encode
solidsas a native IMPORT3D payload: stamp the names this feature would stamp underfeature_name, then seal them into theio/snapshotcontainer. The result is exactly what thenativeBrepsource above reads back, so a part is named identically however it arrived — imported live from a text source, or restored from a payload built here. - native_
import_ payload_ with_ appearance native_import_payloadcarrying the import’s COLOURS into the payload.- parts_
library_ json - The current library in the
partsLibraryblock shape — what SAVE must serialize into the document (never the loaded block: this copy carries healed snapshots, refreshes, and GC). - parts_
library_ map - A CLONE of the root store — what the app hands a runner through
install_parts_library. (parts_library_jsonis the SAVE door; this is the in-process one, with no JSON round trip on the native paths.) - parts_
library_ revision - The ROOT store’s current revision (see
REVISION). Two reads that differ mean the library changed in between; two that agree mean it did not. - pattern_
component_ instance - A Pattern Component instance id (
APAT1.ACOMP3.i4) as(pattern, seed, n). - pattern_
parse_ suppressed - The part Pattern’s
suppressedinstance numbers, as the feature reads them. - reference_
names - ALL reference names of a
reference_selectionparam, in order (amultipleselection). Also accepts a single string or{name}object; empties are dropped. - refresh_
library_ entry - UPDATE (update-components / edit-in-place commit): replace an existing
entry’s document + signature. When the new document BUILDS differently
(
same_build) the entry is marked DIRTY: the next history run’s ACOMP self-heal lane re-executes the document, re-snapshots, and every instance of the part follows. When it builds the same — only its symbol, pads or BOM attributes moved — the snapshot and ports still describe it and are kept, so the part is not rebuilt for an edit that changed no geometry. - refresh_
library_ entry_ impl refresh_library_entryfor native callers: its error as text.- same_
build - Whether two part documents build the same solids and ports, so that one’s snapshot serves the other.
- scene_
metadata_ colors_ json - Every record carrying an imported COLOUR, as
{name: "#RRGGBB"}. - stable_
json_ hash - Stable content hash of a JSON value: sorted-key walk (never trusts a serializer’s map ordering), string leaves verbatim.
Type Aliases§
- Parts
Library Map - The library map shape as it travels in the history request / save file.