35f2c06f42
DO-1 (regression): the orderedList start hardening `Number(x)||1` let a
negative/fractional start through into the marker ("-3.", "2.5.") — marked
can't tokenize it, so the whole list re-imported as a paragraph (structure
corruption); start=0 churned. Both the markdown and raw-HTML export paths
now use `Number.isInteger(raw) && raw > 1 ? raw : 1`, so any degenerate
start collapses to the default "1." markers / bare <ol> (list always valid).
New ordered-list-start-normalization test pins {0,-3,2.5} → valid start=1
list, byte-stable; the round-trip fuzz keeps to integers >=2 (num 2,3,5,42).
DO-2 (nightly was non-functional): NUM_RUNS=5000 OOM'd the worker and the
crash was misreported as a "counterexample" issue whose prefix-dedup then
locked out all future issues. Reworked to shard 8 fresh vitest processes
(600 runs each, distinct seeds, --max-old-space-size) so deep fuzzing
never OOMs; a failing shard's output is preserved, and issue creation
discriminates a real fast-check counterexample from an infra/OOM failure
(distinct titles + scoped dedup). The two issue steps use `always() &&`
so they actually run on the failure path.
DO-3: envInt extracted to test/generative/env-int.ts + unit-tested.
DO-4: nightly dispatch inputs go through env: (no ${{ }} in run:).
DO-5: attr-arbitraries.ts docblock synced (column.width/orderedList.start
are fixed+fuzzed, not pinned it.fails).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 lines
562 B
TypeScript
11 lines
562 B
TypeScript
/**
|
|
* Parse an integer-ish environment variable with a default fallback.
|
|
*
|
|
* Used to read PROPERTY_SEED / PROPERTY_NUM_RUNS in the generative property
|
|
* suites. An unset/empty/non-numeric value falls back to `dflt`, but an explicit
|
|
* `"0"` is honored (a valid fast-check seed) — `Number(x) || dflt` would wrongly
|
|
* swallow 0. See flat-roundtrip.property.test.ts / nested-roundtrip.property.test.ts.
|
|
*/
|
|
export const envInt = (v: string | undefined, dflt: number): number =>
|
|
v !== undefined && v !== '' && Number.isFinite(Number(v)) ? Number(v) : dflt;
|