0025: Selected numeric samples
Selected samples use the existing supplied catalogue, effective composition and shared reports under ADR 0016: Selected samples with explicit admission and coverage. Model and Sample sources have distinct roles and identities while sharing input admission, acquisition, decoding and exact-number limits. Sample sources never become model roots or namespace contributors, even when their JSON resembles SDF.
A typed JSON value has an owned conventional projection preserving checked number lexemes. Consuming catalogue construction moves eligible projection storage; borrowed construction makes a bounded copy. Dedicated sample views expose optional original spans: original byte samples retain their spans, while typed projections and all their descendants have none. The existing original-source JSON view cannot expose a typed projection as original source text. This preserves the distinction in ADR 0007: Generated SDF and sample JSON.
Each typed constructor meters aggregate metadata, duplicate-name comparisons, text/key scans, projection and decoding against one remaining work allowance. Traversals are charged before they run, so separate affordable phases cannot collectively exceed the constructor allowance.
Sample context includes only facts needed by the selected value. Shared composition and parameter rules select relevant work before scheduling it. Mandatory reference chains and references affecting needed qualities remain required. Descriptive metadata, Property interaction flags, documentary default, declaration sdfRequired and unused descendants do not trigger a model assessment. Skipped descendants have unestablished effective meaning; selected context availability is independent of whole-view completeness. Needed model findings, sample constraint findings and operation limitations keep separate domains and authoritative counts.
Alternative traversal excludes those skipped descendants before scheduling, and copying carries that unavailable state alongside donor meanings and contributor origins. Established alternatives retain their own views under ADR 0024: Effective alternatives and nullable characteristics. Scalar const, enum and nested choices use those final alternatives for whole-branch sample witnesses under ADR 0015: Bounded value equality in a resolved data context and ADR 0016: Selected samples with explicit admission and coverage; needed unavailable equality or compound meaning remains unfinished.
Exact comparisons and positive-step membership use normalized decimal coefficients and powers under ADR 0012: Exact numbers and JSON input policies. They do not round through floating point or expand buffers according to exponent magnitude. A sample operation begins with the numeric allowance remaining after all model and sample parsing and shares that remainder across its comparisons and divisibility work. Independent operations on the immutable catalogue begin with the same remainder. Parsed storage and decoding work remain acquisition dimensions; derived storage and semantic work remain operation dimensions.
The fixed nine areas of esdieff.sample/1 retain their membership while numeric support is added. Unknown type or abstract meaning, unresolved alternatives and exhausted needed work suppress affected proofs. An established independent bound rejection can coexist with unfinished const or other obligations; unsupported applicable meaning never becomes success. Ordinary numeric descriptions can complete the sample profile without certifying model grammar or conformance.
The borrowed Sample result exposes a mandatory meaning view for abstract values, const and final admission. The two area statuses agree with the existing nine-area profile. Each part has a finite set of supporting references and actual limitations; not-applicable areas have empty sets. General Appendix C supports a complete ordinary admission without asserting that const was applicable. A whole alternative witness replaces tentative sample proof and limitations. Undetermined admission has no admission proof, while a necessary independent rejection retains its own support even when another area is unfinished.
Consulted interpretations are a separate request-level observation. Byte-string or POSIX consultation occurs when that operation actually attempts the corresponding denotation or comparison, including an unsuccessful attempt and an attempt later discarded by a complete witness. A recognized name, null-only sample, unknown context or refused preflight supplies no consultation by itself. Mandatory meaning and consultation remain present when optional conditions, locations, witnesses and coverage rows are omitted.
The declaring selector is mandatory identity metadata, independent of displayed-location limits and an older effective result’s remaining storage. One bounded constructor validates source roles, handle ownership and supported roles, measures at most 8192 declaring pointer bytes and precharges exact requested string and ancestry capacities. It has 65664 metadata work units shared across identity lookup, measurement, syntax and copying. Before scanning a key it checks the remaining pointer ceiling; escaped growth stops at that ceiling. This allowance does not resolve references or establish model or sample meaning. Action/Event suffixes can produce an internal description pointer of 8206 bytes. Composition, parameter checks, dependency scope and arithmetic still share one semantic operation budget.
Each sample registration pre-admits an additional 163930 wire bytes: two quoted declaring pointers of 8192 bytes and one quoted description pointer of 8206 bytes cost 147546 at worst JSON escaping, with 16384 for fixed sample fields. The fixed inventory bounds 128 member/scalar slots at 64 wire bytes each (8192), three 256-ID scope arrays plus the single root (3076), nine optional coverage rows (2304) and eight boundary omission records (2048), totaling 15620. Common source records and caller metadata retain their existing reserve. Dynamic conditions, witnesses and explanations draw only from optional detail allowances.
Wire size and owned storage are distinct. The sample allowance uses the existing four-times ownership/DTO reserve, 655720 bytes, plus its share of the existing four-times output/growth reserve. It adds no second output allowance. Within ownership, the two strings request at most 16398 bytes, ancestry at most 8192 machine-word entries, and model/scope vectors exactly one slot each. Fixed state/result records are included. All requested capacities are charged before allocation, and registration checks their combined bound with the mandatory DTO allowance against 655720. A limited model can occupy that slot without an effective arena; derived exhaustion does not prevent reporting the retained selector, causes or known findings.
The mandatory DTO group is precharged before construction, from ownership rather than optional scratch. Its 506140-byte bound covers 512 staged fixed slots at 512 bytes each, two simultaneous sets of up to 769 scope-array values at 128 bytes each, 40988 bytes of simultaneous pointer payload copies, and six 256-entry numeric identity vectors. The supported JSON metadata layouts and bounded literal keys are accounted separately from optional condition storage. At an exact mandatory wire cap, optional scratch is zero; the mandatory identity, minimum result and DTO still fit their pre-admitted ownership group. These are conservative capacity bounds rather than measurements of process memory.
The Sample encoder appends the actual result DTO directly to the shared output after the base envelope. It avoids a simultaneous temporary serialization string while preserving field order, escaping, exact numbers and the existing output-growth allowance. Human fallback retains its real first result while generating replacement metadata. Both result graphs, source records and complete emitted bytes remain charged to their original ownership groups; direct serialization adds no allowance or relaxed growth debit.
Considered Options
Reacquiring a sample through a second catalogue would obscure joint limits and source identity. Reusing original-source views for generated projections would invent byte provenance. Broad selected-model validation followed by diagnostic filtering would spend work and create findings for unrequested context. Resetting numeric work for each constraint would ignore input parsing and allow repeated obligations to evade the limit. Converting numbers to a machine float or appending exponent-sized zero buffers would change exactness or resource guarantees. A separate sample report would duplicate the shared outcome, scope and presentation contracts without a needed domain boundary.