edfcore 0.5.35 → 0.5.37

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.
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
109
109
  readonly reserved: 224;
110
110
  };
111
111
  /** Published package version. Kept in sync with package.json by a test. */
112
- export declare const VERSION = "0.5.35";
112
+ export declare const VERSION = "0.5.37";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.5.35';
82
+ export const VERSION = '0.5.37';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,55 @@ alone does not tell you whether you were affected.
6
6
  edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
7
7
  defect; those are called out below.
8
8
 
9
+ ## 0.5.37
10
+
11
+ - **Added** the safety property for the CLI. `fuzz.test.ts` states it for the library — for any byte
12
+ sequence, edfcore either parses it or throws an `EdfError`, never a bare `TypeError`, never a
13
+ hang, never believable garbage. The CLI is a second surface over the same parser, with its own
14
+ formatting, six commands and exit codes, and nothing had ever pointed it at bytes nobody chose.
15
+ Every CLI test in the suite feeds it a file written to make a point.
16
+ - That matters because of how `cli.ts` ends. `main()` catches everything and reports
17
+ `edfcore: ${error.message}` with exit 1, so a `TypeError` escaping `runCli` does not crash — it
18
+ arrives as a line with no code, no byte offset and no `Next:` clause, wearing the prefix a real
19
+ diagnostic wears. The failure is indistinguishable from a working refusal unless something checks
20
+ the class.
21
+ - Two properties now run over ~1,300 cases — random bytes, single-bit flips of a good file,
22
+ truncation at every length, and each header and per-signal field replaced with something that
23
+ breaks it. Every rejection is an `EdfError` whose message opens with a bracketed code and ends
24
+ with a `Next:` clause. And nothing reaches stdout before a rejection, so
25
+ `edfcore json big.edf > out.json` either writes a whole document or writes nothing — a redirect
26
+ cannot leave a half-written file beside a non-zero exit.
27
+ - The exit codes are checked for reachability rather than assumed: 0 for a clean file, 1 for one
28
+ that reads and fails validation, 2 for bad usage. `parseArgs` over 500 arbitrary argv arrays
29
+ throws nothing but `CliUsageError`, which is what keeps 2 distinguishable from 1.
30
+
31
+ ## 0.5.36
32
+
33
+ - **Added** the `ByteSource` `data-sources.md` tells you to write, written and read through. "Writing
34
+ your own ByteSource" is the section that makes the interface a promise rather than an
35
+ implementation detail — "the whole job is: know the length, return exactly the bytes asked for, and
36
+ reject otherwise" — and it prints a complete forty-line adapter over a range-returning object
37
+ store, with four rules under it "in order of how badly they bite". None of it was run.
38
+ `source-contract.test.ts` covers the contract from edfcore's side, with sources written for the
39
+ test; the adapter a reader would copy had nothing.
40
+ - It is now transcribed and used: a recording is opened over it, a window is read, and the samples
41
+ are compared against the same file through `byteSource`. The store streams in irregular pieces —
42
+ 7, 1, 4096, 3 — which is the whole reason the adapter has a loop, and a test that returned each
43
+ range in one go would never reach it. That is asserted too: no single piece the store hands back
44
+ is a whole read.
45
+ - Each of the four rules is then broken on purpose, in an adapter of its own. A short return is
46
+ caught by the adapter, which can name the key and the range, and by edfcore anyway for a source
47
+ that does not check. A padded one is the dangerous case: on a plain EDF every sample of every
48
+ record comes back as a legal zero with no diagnostic at all, and only the annotation region of an
49
+ EDF+ notices, with `TIMEKEEPING_TAL_MISSING`. A reused buffer is shown corrupting an array a
50
+ caller had already been handed, which the page's own per-read allocation does not.
51
+ - The fourth is the page's Warning, and it is the one worth having under test: "edfcore itself does
52
+ not poll the signal between reads. A custom `ByteSource` that ignores `options.signal` makes
53
+ cancellation a complete no-op, including for a long `validateRecording` sweep that issues hundreds
54
+ of reads." A whole-file sweep and a chunked index traversal both run to completion over an
55
+ already-aborted signal, serving twenty reads after the abort. A stated limitation nobody checks is
56
+ indistinguishable from a bug.
57
+
9
58
  ## 0.5.35
10
59
 
11
60
  - **Added** the resolution of every name a `Next:` clause points at. `next-clause.test.ts` proves
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.35",
3
+ "version": "0.5.37",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.5.35';
96
+ export const VERSION = '0.5.37';