edf2csv 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
3
3
  Notable changes to edf2csv. Versions follow [semantic versioning](https://semver.org); while the
4
4
  major version is 0, a minor bump may contain breaking changes.
5
5
 
6
+ ## 0.4.7
7
+
8
+ ### Added: `npm run fuzz`, which damages real recordings and checks nothing crashes
9
+
10
+ ```bash
11
+ npm run fuzz
12
+ ```
13
+
14
+ ```
15
+ 1200 runs over 300 corrupted recordings (seed 1).
16
+ Every one exited cleanly with something to say.
17
+ ```
18
+
19
+ A header is thirty-odd fields parsed out of bytes, and the ways one can be wrong are not a list
20
+ anybody can write down. A test asserts the cases its author thought of, which are the cases the
21
+ code already handles. Corrupting real recordings asks a different question — is there *any*
22
+ arrangement of bytes that gets past the checks — and it has the advantage of not sharing the
23
+ author's assumptions.
24
+
25
+ The property is deliberately narrow: whatever a damaged file contains, the tool must exit 0, 1
26
+ or 2 and say something. Not a stack trace, and not a hang.
27
+
28
+ Damage is weighted toward the first kilobyte, where the fixed header and the start of the
29
+ signal headers live, because that is where one byte changes the meaning of everything after it.
30
+ A corrupted sample is only a different number; a corrupted sample count is a promise about the
31
+ file's shape that the file no longer keeps. Each file is run four ways — `--info`,
32
+ `--info --json`, a conversion, and a conversion with `--gzip`, which puts a compressor between
33
+ the writer and the file and had a crash of its own as recently as 0.3.1.
34
+
35
+ Runs are deterministic: the same seed produces the same files, so a crash found on one machine
36
+ reproduces on another.
37
+
38
+ **Nothing was found.** 4,000 runs across four seeds and 1,000 corrupted recordings all reported
39
+ cleanly. Two attempts to prove the check could fail were themselves instructive: removing a
40
+ header guard changed nothing, because a later check caught the same case, and forcing the
41
+ generic error branch to misbehave changed nothing either, because corrupted files never reach
42
+ it. The error handling turned out to be layered more thoroughly than expected. Making the
43
+ branch they *do* reach return an out-of-range exit code produced the failure, with the
44
+ recording, the arguments and the message named — so the check is known to work rather than
45
+ assumed to.
46
+
47
+ Like `npm run crossvalidate`, this is opt-in and not part of `npm test`, which stays fast and
48
+ dependency-free.
49
+
6
50
  ## 0.4.6
7
51
 
8
52
  ### Fixed: naming the same recording twice was an error in one place and fine in another
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edf2csv",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Convert EDF, EDF+ and BDF biosignal recordings (European Data Format) to CSV from the command line. Local, streaming, and never resamples or alters units.",
5
5
  "keywords": [
6
6
  "edf",
@@ -61,7 +61,8 @@
61
61
  "test": "npm run build && npm run fixtures && node --test test/*.test.js",
62
62
  "typecheck": "tsc -p tsconfig.json --noEmit",
63
63
  "prepublishOnly": "npm run clean && npm run build && npm test",
64
- "crossvalidate": "npm run build && node test/crossvalidate/generate.mjs && python3 test/crossvalidate/compare.py"
64
+ "crossvalidate": "npm run build && node test/crossvalidate/generate.mjs && python3 test/crossvalidate/compare.py",
65
+ "fuzz": "npm run build && npm run fixtures && node test/fuzz/mutate.mjs"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@types/node": "^22.10.0",