Project wavelength min/max: app-side handoff¶
Eve requested two additional reserved AUTO tokens. This is the simulation-templates implementation and a handoff for her to pass along; it has not been sent to another chat. Existing origins keep their current center/span tokens, so using the new pair can wait until the app supports them. No metadata, package or DataLab archive changes are required.
| Token | Value from the normalized project wavelength window |
|---|---|
<INSERT_AUTO_WAVELENGTH_MIN_UM_HERE> |
Minimum wavelength, in micrometers |
<INSERT_AUTO_WAVELENGTH_MAX_UM_HERE> |
Maximum wavelength, in micrometers |
<INSERT_AUTO_WAVELENGTH_CENTER_UM_HERE> |
Arithmetic wavelength midpoint, existing |
<INSERT_AUTO_WAVELENGTH_UM_HERE> |
Existing alias for center |
<INSERT_AUTO_WAVELENGTH_SPAN_UM_HERE> |
Full wavelength span, existing |
Required app changes¶
- Extend the single project-window resolver in
notebook/wavelength.rsto retain normalizedmin_umandmax_umalongsidecenter_umandfull_span_um(field names may follow app conventions). Preserve the raw wavelength endpoints; deriving them back from rounded center/span loses precision. Resolve once per plan, only when at least one wavelength token is consumed. - Keep
sim.xprecedence over legacysim.wls, including rejecting an invalidsim.xrather than falling back. Validate finite positive min <= max. Equal endpoints are valid. For a frequency sweep, uselambda_min = c / f_maxandlambda_max = c / f_min, with the existing GHz/THz-to-micrometer constants. Validate converted endpoints too; tiny frequencies can overflow. - Register both names as reserved wavelength AUTO kinds in
notebook/planning.rs: finite positive number, units micrometers, project provenance and the existing wavelength review policy. Retain the center alias. Neither token takes a default or adds an origin metadata field. Keep source authority and literal serialization. - Extend
notebook/plan_context.rsconsumption detection and fixed-value projection to recognize min-only, max-only and mixed wavelength usage. The reference fields arewavelength_min_umandwavelength_max_um. Populate all consumed values from one resolved window; do not separately reread settings for each token. - Cover presentation, provenance/RPC projections, tests and token documentation wherever wavelength kinds are enumerated. If the existing app allows review overrides, keep one coherent final window: editing either representation must recompute its counterparts and validate the complete interval. Do not treat four values as independent settings or weaken existing authorization for overrides.
- Test both new tokens alone and together, mixed with center/span and its alias;
sim.wls,sim.xprecedence, GHz/THz reversal, zero span, endpoint precision, malformed/missing settings and invalid conversions. Confirm no fallback/default overrides, no extra USER questions, one acquisition per plan, and actual notebook binding without importing a design or executing simulation code.
Reference implementation and checks¶
scripts/project_wavelengths.py now returns wavelength_min_um,
wavelength_max_um, wavelength_um and wavelength_span_um together. The binder
retains that result per plan. Reserved-kind and declaration/provenance schema
registrations are in scripts/contracts/. tests/test_wavelength_bounds.py
exercises complete notebook binding for a fictitious engine as well as authority,
precision, failure and acquisition cases. Both the native compatibility workflow
and the origin publisher validation job run these tests. These reference checks
do not replace app-native/API/UI acceptance.