Follow-up from the v04x-hardening branch final review (Phase 1 of development/post-v040-development-plan.md).
Both n-validation guards — create_mock_data() (R/create_mock_data.R) and the spec layer (R/mock_spec.R, validate_mock_spec() area) — accept n = Inf: is.numeric(Inf) is TRUE and Inf != trunc(Inf) is FALSE, so Inf sails through and fails later with a raw runif/rep error. Pre-existing pattern in the spec layer, mirrored (deliberately) by the Task 2 guard alignment.
Fix: add !is.finite(n) to both guards in one small patch, keeping the shared message "n must be a non-negative whole number." Add n = Inf to the edge-case contract tests for both layers.
Sized XS. No API or seeded-output impact.
Follow-up from the v04x-hardening branch final review (Phase 1 of
development/post-v040-development-plan.md).Both n-validation guards —
create_mock_data()(R/create_mock_data.R) and the spec layer (R/mock_spec.R,validate_mock_spec()area) — acceptn = Inf:is.numeric(Inf)is TRUE andInf != trunc(Inf)is FALSE, soInfsails through and fails later with a rawrunif/reperror. Pre-existing pattern in the spec layer, mirrored (deliberately) by the Task 2 guard alignment.Fix: add
!is.finite(n)to both guards in one small patch, keeping the shared message "n must be a non-negative whole number." Addn = Infto the edge-case contract tests for both layers.Sized XS. No API or seeded-output impact.