edfcore 0.2.31 → 0.2.33

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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,35 @@ 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.2.33
10
+
11
+ - **Fixed** annotations being dropped with no diagnostic naming them. `TIMEKEEPING_TAL_NONCONFORMANT`
12
+ covers several unrelated defects behind one once-per-call flag. Most lose nothing — the onset is
13
+ unambiguous either way — but a timekeeping TAL that carries TEXT has swallowed an annotation: the
14
+ writer merged an event into it, and the text appears in no field of the result. Because the flag
15
+ was shared, a file whose FIRST record used the widespread `+t 0x14 0x00` shorthand — which is most
16
+ of the real corpus — reported that shorthand and then suppressed every dropped event after it. On
17
+ a six-record fixture: two annotations gone, `annotations` empty, and one warning naming record 0
18
+ and a different, harmless cause. `strict: true` did not help either; it threw on record 0's
19
+ benign shorthand and never reached the real problem. The text-carrying kind is now reported for
20
+ every affected record, with the text and the byte offset where it still is; the harmless kinds
21
+ are still capped at one per call, and each message now says which of the two it is.
22
+
23
+ ## 0.2.32
24
+
25
+ - **Documented, not fixed**, and the distinction is the point: `sampleIndexAt`, `sampleStartTicks`
26
+ and `sampleStartSeconds` measure the signal's own SAMPLE GRID, which equals elapsed recording
27
+ time only when the recording is contiguous. On a file with a seven-second hole,
28
+ `sampleStartSeconds(signal, 12, d)` answers 3 s for a sample whose record truly begins at 10 s,
29
+ and `sampleIndexAt(signal, 10, d)` names record 10 of a six-record file. This is the fifth
30
+ instance the 0.2.25 property test found, and the one that cannot be fixed by arithmetic: the
31
+ three take a signal, a number and a record duration — no index, no timeline — so a gap is not in
32
+ their arguments and nothing inside them could find it. Changing that would mean changing their
33
+ signatures, which is a 0.3 decision, not a patch. Until then the contract is stated in the source,
34
+ in the docs and in the property test, which now pins both regimes: exact agreement with
35
+ `readRecords` on a contiguous file, and the grid behaviour on a discontinuous one. `index.locate`,
36
+ `segmentAt`/`gapAt` and `chunk.firstSampleIndex` are the recording-axis answers.
37
+
9
38
  ## 0.2.31
10
39
 
11
40
  - **Fixed** `readEnvelopeAtResolution` not delivering the resolution it was asked for. A chunk
@@ -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.2.31";
112
+ export declare const VERSION = "0.2.33";
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.2.31';
82
+ export const VERSION = '0.2.33';
83
83
  //# sourceMappingURL=constants.js.map
@@ -14,6 +14,24 @@
14
14
  *
15
15
  * These do the arithmetic in integers on `(record, sampleWithinRecord)` instead, which is the
16
16
  * same rule `trimToWindow` follows.
17
+ *
18
+ * WHAT THEY MEASURE, PRECISELY: position on the SIGNAL'S OWN SAMPLE GRID. Sample `n` is the `n`th
19
+ * sample the file stores for that signal, and its time is `n * recordDuration / samplesPerRecord`.
20
+ * On a CONTIGUOUS recording that is also elapsed recording time, and the two ideas are the same
21
+ * number — which is why the distinction is easy to miss.
22
+ *
23
+ * ON A DISCONTINUOUS FILE THEY ARE NOT THE SAME. Samples are adjacent in the array across a gap
24
+ * while their times are not, so `sampleStartSeconds(signal, 12, d)` answers 3 s for a sample whose
25
+ * record truly begins at 10 s, and `sampleIndexAt(signal, 10, d)` answers with a record index past
26
+ * the end of a six-record file. These functions receive a signal, a number and a record duration —
27
+ * no index, no timeline — so they CANNOT detect a gap, cannot bound the answer by the record
28
+ * count, and are not being modest about it: the information is not in their arguments.
29
+ *
30
+ * So the contract is stated rather than guessed at. For a file that may be discontinuous, use
31
+ * `index.locate(seconds)` for time to record, `segmentAt`/`gapAt` to find out whether an instant
32
+ * has data at all, and `chunk.firstSampleIndex` for the sample index a read actually produced.
33
+ * `contiguityOf(index)` answers which regime you are in. On a contiguous file — the common case,
34
+ * and every plain EDF or EDF+C — these are exact and are what you want.
17
35
  */
18
36
  import type { EdfSampleLocation, EdfSignal } from './types.js';
19
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sample-grid.d.ts","sourceRoot":"","sources":["../src/sample-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA0B/D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,GAC1B,iBAAiB,CAoBnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAcR;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAKR"}
1
+ {"version":3,"file":"sample-grid.d.ts","sourceRoot":"","sources":["../src/sample-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA0B/D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,GAC1B,iBAAiB,CAoBnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAcR;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAKR"}
@@ -14,6 +14,24 @@
14
14
  *
15
15
  * These do the arithmetic in integers on `(record, sampleWithinRecord)` instead, which is the
16
16
  * same rule `trimToWindow` follows.
17
+ *
18
+ * WHAT THEY MEASURE, PRECISELY: position on the SIGNAL'S OWN SAMPLE GRID. Sample `n` is the `n`th
19
+ * sample the file stores for that signal, and its time is `n * recordDuration / samplesPerRecord`.
20
+ * On a CONTIGUOUS recording that is also elapsed recording time, and the two ideas are the same
21
+ * number — which is why the distinction is easy to miss.
22
+ *
23
+ * ON A DISCONTINUOUS FILE THEY ARE NOT THE SAME. Samples are adjacent in the array across a gap
24
+ * while their times are not, so `sampleStartSeconds(signal, 12, d)` answers 3 s for a sample whose
25
+ * record truly begins at 10 s, and `sampleIndexAt(signal, 10, d)` answers with a record index past
26
+ * the end of a six-record file. These functions receive a signal, a number and a record duration —
27
+ * no index, no timeline — so they CANNOT detect a gap, cannot bound the answer by the record
28
+ * count, and are not being modest about it: the information is not in their arguments.
29
+ *
30
+ * So the contract is stated rather than guessed at. For a file that may be discontinuous, use
31
+ * `index.locate(seconds)` for time to record, `segmentAt`/`gapAt` to find out whether an instant
32
+ * has data at all, and `chunk.firstSampleIndex` for the sample index a read actually produced.
33
+ * `contiguityOf(index)` answers which regime you are in. On a contiguous file — the common case,
34
+ * and every plain EDF or EDF+C — these are exact and are what you want.
17
35
  */
18
36
  import { TICKS_PER_SECOND } from './constants.js';
19
37
  import { secondsToTicks } from './tal/ticks.js';
@@ -1 +1 @@
1
- {"version":3,"file":"sample-grid.js","sourceRoot":"","sources":["../src/sample-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,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IAC5D,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,6FAA6F;IAC7F,6DAA6D;IAC7D,IAAI,SAAS,GAAG,SAAS,KAAK,EAAE;QAAE,OAAO,QAAQ,CAAC;IAClD,OAAO,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnD,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,kBAAkB,CAChC,MAAiB,EACjB,WAAmB,EACnB,mBAA2B;IAE3B,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,KAAK,GAAG,gBAAgB,CAAC;IACvC,MAAM,SAAS,GAAG,KAAK,GAAG,gBAAgB,CAAC;IAC3C,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACtE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/tal/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,KAAK,EACV,wBAAwB,EAExB,oBAAoB,EACpB,SAAS,EAET,WAAW,EACZ,MAAM,aAAa,CAAC;AAqSrB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAiJtB"}
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/tal/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,OAAO,KAAK,EACV,wBAAwB,EAExB,oBAAoB,EACpB,SAAS,EAET,WAAW,EACZ,MAAM,aAAa,CAAC;AAyUrB,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAoJtB"}
@@ -156,29 +156,33 @@ function reportTimekeepingMissing(sink, context) {
156
156
  specReference: TIMEKEEPING_SPEC,
157
157
  });
158
158
  }
159
- /**
160
- * What is non-conformant about a timekeeping TAL, or `undefined` when it is exactly
161
- * `+onset 0x14 0x14 0x00`.
162
- *
163
- * Zero texts is the widespread `+t 0x14 0x00` shorthand. EDFlib rejects that file outright; we
164
- * treat "zero texts" and "one empty text" as the same thing and keep going, because the onset is
165
- * unambiguous either way and refusing the file would refuse a large part of the real corpus.
166
- */
167
159
  function timekeepingDefect(tal) {
168
160
  if (tal.durationRaw !== undefined) {
169
- return `carries the duration "${tal.durationRaw}", which a timekeeping TAL never has`;
161
+ return {
162
+ reason: `carries the duration "${tal.durationRaw}", which a timekeeping TAL never has`,
163
+ destructive: false,
164
+ };
170
165
  }
171
166
  if (tal.texts.length === 0) {
172
- return ('omits the mandatory empty text and is written "+onset 0x14 0x00" — the widespread ' +
173
- 'shorthand, which EDFlib rejects outright');
167
+ return {
168
+ reason: 'omits the mandatory empty text and is written "+onset 0x14 0x00" — the widespread ' +
169
+ 'shorthand, which EDFlib rejects outright',
170
+ destructive: false,
171
+ };
174
172
  }
175
173
  const texts = tal.texts.map((run) => run.text).filter((text) => text.length > 0);
176
174
  if (texts.length > 0) {
177
- return (`carries the text ${texts.map((text) => `"${text}"`).join(', ')}, which is dropped: the ` +
178
- 'timekeeping TAL is not an annotation');
175
+ return {
176
+ reason: `carries the text ${texts.map((text) => `"${text}"`).join(', ')}, which is dropped: the ` +
177
+ 'timekeeping TAL is not an annotation',
178
+ destructive: true,
179
+ };
179
180
  }
180
181
  if (tal.texts.length > 1) {
181
- return `carries ${tal.texts.length} empty texts, where the grammar allows exactly one`;
182
+ return {
183
+ reason: `carries ${tal.texts.length} empty texts, where the grammar allows exactly one`,
184
+ destructive: false,
185
+ };
182
186
  }
183
187
  return undefined;
184
188
  }
@@ -186,11 +190,17 @@ function reportTimekeepingDefect(sink, context, tal, defect) {
186
190
  sink.report({
187
191
  code: 'TIMEKEEPING_TAL_NONCONFORMANT',
188
192
  message: `the timekeeping TAL of record ${context.recordIndex} (annotation signal ` +
189
- `${context.signal.index}, onset "${tal.onsetRaw}") ${defect}. ` +
193
+ `${context.signal.index}, onset "${tal.onsetRaw}") ${defect.reason}. ` +
190
194
  'Rule: a timekeeping TAL is written "+onset 0x14 0x14 0x00" — one signed onset, no ' +
191
195
  'duration, one empty text. ' +
192
- "Next: the onset was used as this record's start and the file was kept; this is " +
193
- 'reported once per decodeAnnotations() call, so later records are not re-reported.',
196
+ (defect.destructive
197
+ ? "Next: the onset was used as this record's start, but the text above is an " +
198
+ 'annotation the writer merged into the timekeeping TAL and it is in no other field of ' +
199
+ 'the result — read it from the raw bytes at the offset above if you need it. Reported ' +
200
+ 'for EVERY affected record, because each one names a different event that was lost.'
201
+ : "Next: the onset was used as this record's start and the file was kept; nothing was " +
202
+ 'lost. This kind is reported once per decodeAnnotations() call, so later records are ' +
203
+ 'not re-reported.'),
194
204
  field: 'timekeeping TAL',
195
205
  byteOffset: context.fileOffset + tal.byteOffsetInRegion,
196
206
  byteLength: tal.byteLength,
@@ -280,8 +290,12 @@ export function decodeAnnotations(header, recordBytes, records, options) {
280
290
  raw: timekeeping.onsetRaw,
281
291
  };
282
292
  const defect = timekeepingDefect(timekeeping);
283
- if (defect !== undefined && !timekeepingDefectReported) {
284
- timekeepingDefectReported = true;
293
+ // The once-per-call cap applies ONLY to the defects that lose nothing. A dropped text is
294
+ // a distinct annotation per record, available nowhere else in the result, so capping it
295
+ // deletes evidence — and worse, a benign first record used to consume the one slot.
296
+ if (defect !== undefined && (defect.destructive || !timekeepingDefectReported)) {
297
+ if (!defect.destructive)
298
+ timekeepingDefectReported = true;
285
299
  reportTimekeepingDefect(sink, context, timekeeping, defect);
286
300
  }
287
301
  }
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../src/tal/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7C,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,GAItB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,gBAAgB,GAAG,uDAAuD,CAAC;AACjF,MAAM,gBAAgB,GAAG,yDAAyD,CAAC;AACnF,MAAM,UAAU,GAAG,2EAA2E,CAAC;AAE/F,MAAM,WAAW,GAA2C;IAC1D,aAAa,EACX,2FAA2F;QAC3F,kCAAkC;IACpC,2BAA2B,EACzB,0FAA0F;QAC1F,kBAAkB;IACpB,6BAA6B,EAAE,uDAAuD;IACtF,wBAAwB,EAAE,0BAA0B;CACrD,CAAC;AAEF,MAAM,gBAAgB,GAA2C;IAC/D,aAAa,EACX,0FAA0F;QAC1F,6CAA6C;IAC/C,2BAA2B,EACzB,0FAA0F;QAC1F,6CAA6C;IAC/C,6BAA6B,EAC3B,2FAA2F;QAC3F,qDAAqD;IACvD,wBAAwB,EACtB,4FAA4F;QAC5F,qDAAqD;CACxD,CAAC;AAEF,MAAM,qBAAqB,GAA2C;IACpE,aAAa,EAAE,gBAAgB;IAC/B,2BAA2B,EAAE,gBAAgB;IAC7C,6BAA6B,EAAE,gBAAgB;IAC/C,wBAAwB,EAAE,gBAAgB;CAC3C,CAAC;AAEF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BAC7B,WAAW,EAAE,CAAC;gBACd,aAAa,EAAE,gBAAgB;aAChC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,SAAS,IAAI,EAAE,IAAI,SAAS,GAAG,gBAAgB;QAAE,OAAO,SAAS,CAAC;IAEtE,IAAI,MAAM,CAAC,UAAU,KAAK,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC;YACV,IAAI,EAAE,2BAA2B;YACjC,OAAO,EACL,sCAAsC,OAAO,CAAC,KAAK,mCAAmC;gBACtF,kBAAkB,MAAM,wBAAwB,cAAc,CAAC,SAAS,CAAC,gBAAgB;gBACzF,iFAAiF;gBACjF,8CAA8C;gBAC9C,oFAAoF;gBACpF,sDAAsD;gBACtD,sFAAsF;gBACtF,sFAAsF;gBACtF,oCAAoC;YACtC,KAAK,EAAE,iBAAiB;YACxB,GAAG,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE;YAC7B,WAAW,EAAE,OAAO,CAAC,KAAK;YAC1B,aAAa,EAAE,gBAAgB;SAChC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.2.31",
3
+ "version": "0.2.33",
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.2.31';
96
+ export const VERSION = '0.2.33';
@@ -14,6 +14,24 @@
14
14
  *
15
15
  * These do the arithmetic in integers on `(record, sampleWithinRecord)` instead, which is the
16
16
  * same rule `trimToWindow` follows.
17
+ *
18
+ * WHAT THEY MEASURE, PRECISELY: position on the SIGNAL'S OWN SAMPLE GRID. Sample `n` is the `n`th
19
+ * sample the file stores for that signal, and its time is `n * recordDuration / samplesPerRecord`.
20
+ * On a CONTIGUOUS recording that is also elapsed recording time, and the two ideas are the same
21
+ * number — which is why the distinction is easy to miss.
22
+ *
23
+ * ON A DISCONTINUOUS FILE THEY ARE NOT THE SAME. Samples are adjacent in the array across a gap
24
+ * while their times are not, so `sampleStartSeconds(signal, 12, d)` answers 3 s for a sample whose
25
+ * record truly begins at 10 s, and `sampleIndexAt(signal, 10, d)` answers with a record index past
26
+ * the end of a six-record file. These functions receive a signal, a number and a record duration —
27
+ * no index, no timeline — so they CANNOT detect a gap, cannot bound the answer by the record
28
+ * count, and are not being modest about it: the information is not in their arguments.
29
+ *
30
+ * So the contract is stated rather than guessed at. For a file that may be discontinuous, use
31
+ * `index.locate(seconds)` for time to record, `segmentAt`/`gapAt` to find out whether an instant
32
+ * has data at all, and `chunk.firstSampleIndex` for the sample index a read actually produced.
33
+ * `contiguityOf(index)` answers which regime you are in. On a contiguous file — the common case,
34
+ * and every plain EDF or EDF+C — these are exact and are what you want.
17
35
  */
18
36
 
19
37
  import { TICKS_PER_SECOND } from './constants.js';
@@ -252,25 +252,55 @@ function reportTimekeepingMissing(sink: DiagnosticSink, context: RegionContext):
252
252
  * treat "zero texts" and "one empty text" as the same thing and keep going, because the onset is
253
253
  * unambiguous either way and refusing the file would refuse a large part of the real corpus.
254
254
  */
255
- function timekeepingDefect(tal: ParsedTal): string | undefined {
255
+ /**
256
+ * What is wrong with a timekeeping TAL, and whether saying so once is enough.
257
+ *
258
+ * `destructive` is the distinction that matters. Most of these defects lose nothing — the onset is
259
+ * unambiguous and lands in `recordOnsetTicks` either way — so one report per call is the right
260
+ * volume and a per-record flood would bury it. But a timekeeping TAL that carries TEXT is
261
+ * different: that text is an annotation the writer merged into the wrong TAL, it appears nowhere
262
+ * in the result, and each occurrence names a DIFFERENT event that is now gone.
263
+ *
264
+ * Sharing one once-per-call flag between the two meant that a file whose first record used the
265
+ * widespread `+t 0x14 0x00` shorthand — which is most of the real corpus — reported that shorthand
266
+ * and then silently swallowed every dropped event after it. Six records in, two annotations gone,
267
+ * one warning about a benign spelling in record 0 (fixed in 0.2.33).
268
+ */
269
+ interface TimekeepingDefect {
270
+ readonly reason: string;
271
+ /** True when the TAL carried text that exists nowhere in the returned annotations. */
272
+ readonly destructive: boolean;
273
+ }
274
+
275
+ function timekeepingDefect(tal: ParsedTal): TimekeepingDefect | undefined {
256
276
  if (tal.durationRaw !== undefined) {
257
- return `carries the duration "${tal.durationRaw}", which a timekeeping TAL never has`;
277
+ return {
278
+ reason: `carries the duration "${tal.durationRaw}", which a timekeeping TAL never has`,
279
+ destructive: false,
280
+ };
258
281
  }
259
282
  if (tal.texts.length === 0) {
260
- return (
261
- 'omits the mandatory empty text and is written "+onset 0x14 0x00" — the widespread ' +
262
- 'shorthand, which EDFlib rejects outright'
263
- );
283
+ return {
284
+ reason:
285
+ 'omits the mandatory empty text and is written "+onset 0x14 0x00" — the widespread ' +
286
+ 'shorthand, which EDFlib rejects outright',
287
+ destructive: false,
288
+ };
264
289
  }
265
290
  const texts = tal.texts.map((run) => run.text).filter((text) => text.length > 0);
266
291
  if (texts.length > 0) {
267
- return (
268
- `carries the text ${texts.map((text) => `"${text}"`).join(', ')}, which is dropped: the ` +
269
- 'timekeeping TAL is not an annotation'
270
- );
292
+ return {
293
+ reason:
294
+ `carries the text ${texts.map((text) => `"${text}"`).join(', ')}, which is dropped: the ` +
295
+ 'timekeeping TAL is not an annotation',
296
+ destructive: true,
297
+ };
271
298
  }
272
299
  if (tal.texts.length > 1) {
273
- return `carries ${tal.texts.length} empty texts, where the grammar allows exactly one`;
300
+ return {
301
+ reason: `carries ${tal.texts.length} empty texts, where the grammar allows exactly one`,
302
+ destructive: false,
303
+ };
274
304
  }
275
305
  return undefined;
276
306
  }
@@ -279,17 +309,23 @@ function reportTimekeepingDefect(
279
309
  sink: DiagnosticSink,
280
310
  context: RegionContext,
281
311
  tal: ParsedTal,
282
- defect: string,
312
+ defect: TimekeepingDefect,
283
313
  ): void {
284
314
  sink.report({
285
315
  code: 'TIMEKEEPING_TAL_NONCONFORMANT',
286
316
  message:
287
317
  `the timekeeping TAL of record ${context.recordIndex} (annotation signal ` +
288
- `${context.signal.index}, onset "${tal.onsetRaw}") ${defect}. ` +
318
+ `${context.signal.index}, onset "${tal.onsetRaw}") ${defect.reason}. ` +
289
319
  'Rule: a timekeeping TAL is written "+onset 0x14 0x14 0x00" — one signed onset, no ' +
290
320
  'duration, one empty text. ' +
291
- "Next: the onset was used as this record's start and the file was kept; this is " +
292
- 'reported once per decodeAnnotations() call, so later records are not re-reported.',
321
+ (defect.destructive
322
+ ? "Next: the onset was used as this record's start, but the text above is an " +
323
+ 'annotation the writer merged into the timekeeping TAL and it is in no other field of ' +
324
+ 'the result — read it from the raw bytes at the offset above if you need it. Reported ' +
325
+ 'for EVERY affected record, because each one names a different event that was lost.'
326
+ : "Next: the onset was used as this record's start and the file was kept; nothing was " +
327
+ 'lost. This kind is reported once per decodeAnnotations() call, so later records are ' +
328
+ 'not re-reported.'),
293
329
  field: 'timekeeping TAL',
294
330
  byteOffset: context.fileOffset + tal.byteOffsetInRegion,
295
331
  byteLength: tal.byteLength,
@@ -392,8 +428,11 @@ export function decodeAnnotations(
392
428
  raw: timekeeping.onsetRaw,
393
429
  };
394
430
  const defect = timekeepingDefect(timekeeping);
395
- if (defect !== undefined && !timekeepingDefectReported) {
396
- timekeepingDefectReported = true;
431
+ // The once-per-call cap applies ONLY to the defects that lose nothing. A dropped text is
432
+ // a distinct annotation per record, available nowhere else in the result, so capping it
433
+ // deletes evidence — and worse, a benign first record used to consume the one slot.
434
+ if (defect !== undefined && (defect.destructive || !timekeepingDefectReported)) {
435
+ if (!defect.destructive) timekeepingDefectReported = true;
397
436
  reportTimekeepingDefect(sink, context, timekeeping, defect);
398
437
  }
399
438
  }