fix(runner): validate numeric SDK list shards
Merged
RU
5d ago+65+65+01234567890123456789-1-1-0123456789
What and why
- Validate numeric SDK shards before collection.
list({ shard: { index: 1.5, total: 2 } })currently selects tests, although the matching CLI flag is rejected. Zero, negative, non-finite, unsafe, and out-of-range values can also silently produce an empty or incorrect selection. - Use the existing
INVALID_CONFIGclassification: both numbers must be positive safe integers, andindexmust be from 1 throughtotal. JavaScript callers passingshard: nullalso get this classified error. Valid shards keep their selections and test IDs; emitted TypeScript declarations remain byte-identical, with no nullable API widening.
Verified
Ran it locally: yes
- The actual built
e2e/runnerlist export and builte2e listCLI ran against real config files and registered test bodies in isolated scratch projects. Listing starts no app, engine or worker, makes no provider call, executes no test body and writes no run report.
| Case | main 06bb7265 | this branch |
|---|---|---|
| 13 invalid numeric SDK shards | Accepted without an error | INVALID_CONFIG |
| Unsharded, first, second, valid empty SDK selection | 2, 1, 1, 0 runnable tests | Same counts and IDs |
| Matching CLI cases | 13 rejected with exit 2; four valid selections | Same output and exit codes |
| Frozen public-barrel integration tests | 13 fail, four pass | All 17 pass |
- Five frozen supplemental owners verify runtime classification and import boundaries. The public API exposes
list; a separate test uses the built internal runner to verify its serialized configuration error. Original 17 owners remain unchanged.
| Review repair | Published e1a5ae9 | This revision |
|---|---|---|
JavaScript list({ shard: null }) | TypeError, no classified code | INVALID_CONFIG |
| Built internal runner with null shard | Test-category ERROR, exit 1 | Configuration INVALID_CONFIG, exit 2 |
| Invalid numeric shard | Rejected before config/test imports | Same |
| Valid first/empty shards | Both modules import; IDs stable; bodies never run | Same |
| Supplemental native owners | Two null assertions fail, three controls pass | All five pass |
- Full check and build pass. The unchanged full suite passes: 4,157 tests passed, two skipped, including all 22 frozen owners. The original 34 public SDK/CLI cases remain byte-identical after this repair.
- Required canonical browser comparison ran six pairs and 76 tests: outcomes, step sequences and counters match. Wall, suite and action timings are classified the same; one individual step remains unresolved. This is a behavior check, with no performance improvement claimed.
- This fixes invalid SDK selection. Current signed head:
cf6a71d56510d8752c6ffce845677712f00962a6; its upstream CI is pending. The earliere1a5ae9checks do not qualify that future head.