@oddstate/core 0.1.0 → 0.2.0
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/README.md +91 -83
- package/dist/corpus-data.js +1 -1
- package/dist/search-data.js +1 -1
- package/package.json +1 -1
package/dist/corpus-data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated from the verified Oddstate corpus.
|
|
2
|
-
export const corpus = {"categories":[{"id":"data-formats","title":"Data formats","description":"How structured data changes when it crosses format and parser boundaries."},{"id":"databases","title":"Databases","description":"How query semantics, constraints and connection settings affect stored data and query results."},{"id":"dates-and-times","title":"Dates and times","description":"Calendar values, instants, time zones and clock changes."},{"id":"filesystem-and-paths","title":"Filesystem and paths","description":"Path interpretation, file URLs and the behaviour of open file handles."},{"id":"runtime-and-concurrency","title":"Runtime and concurrency","description":"How memory views, event ordering and execution contexts affect programs."},{"id":"text-and-encoding","title":"Text and encoding","description":"How byte sequences, code points and string representations affect text processing."},{"id":"web-platform","title":"Web platform","description":"Behaviour specified by web APIs and formats."}],"cases":[{"metadata":{"id":"abort-signal-late-listener","title":"An AbortSignal does not replay abort for late listeners","summary":"An abort listener added after cancellation never sees the past event. Check the signal’s current state before starting work.","category":"web-platform","references":[{"title":"DOM Standard: AbortSignal interface","url":"https://dom.spec.whatwg.org/#abortsignal","kind":"specification"},{"title":"DOM Standard: Signal abort","url":"https://dom.spec.whatwg.org/#abortsignal-signal-abort","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A cancellation reason passed unchanged to AbortController.abort()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Listener call counts for registration before and after abort, and the state stored on the signal."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3c9f0cac47e2fac2082d96d2fdcd59c4136bd2576100031f402d0787f01386d5"}}},"markdown":"# An AbortSignal does not replay abort for late listeners\n\nWhen a caller hands off an already aborted signal, registering an `abort`\nlistener leaves that listener waiting. The DOM standard dispatches the\nevent when transitioning the signal to aborted, and `signal.aborted` and\n`signal.reason` preserve the resulting state.\n\n## Observed behaviour\n\nThe listener registered before `abort()` ran once. The late listener stayed\nuninvoked even after a second call to `abort()`.\n`signal.throwIfAborted()` threw the original reason object.\n\n## Application considerations\n\nWhen wrapping an operation to accept an `AbortSignal`, check it before\nstarting work, then observe future aborts for work already in progress.\nThis covers a cancellation that happened before your stage of a pipeline\nreceived the signal.\n","fixtureContents":{"input":"{\n \"reason\": \"Import cancelled before the next stage\"\n}\n","expected":"{\n \"earlyCalls\": 1,\n \"lateCalls\": 0,\n \"aborted\": true\n}\n"}},{"metadata":{"id":"base64url-atob-alphabet","title":"Buffer accepts base64url characters that atob() rejects","summary":"Buffer.from(value, \"base64\") accepts both alphabets. atob() handles unpadded standard Base64 but rejects Base64url-specific characters.","category":"text-and-encoding","references":[{"title":"Node.js: Buffer encodings for base64 and base64url","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#buffers-and-character-encodings","kind":"documentation"},{"title":"WHATWG Infra: forgiving-base64 decode","url":"https://infra.spec.whatwg.org/#forgiving-base64-decode","kind":"specification"},{"title":"RFC 4648: URL-safe Base64 alphabet","url":"https://www.rfc-editor.org/rfc/rfc4648.html#section-5","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Compares Node Buffer conversion with Node’s web-compatible atob()."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Standard padded, standard unpadded and URL-safe unpadded encodings for the same two bytes."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The two decoded byte values."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f573333765325fcfe714c4aa741a2c5f7c520940a2f21c94753e26af9ec7dfc4"}}},"markdown":"# Buffer accepts base64url characters that atob() rejects\n\nThe bytes `FB FF` encode as `+/8=` in standard Base64 and as `-_8` in unpadded\nBase64url. Node’s `Buffer.from()` accepts the URL-safe alphabet even when asked\nto decode `\"base64\"`. `atob()` accepts omitted padding but requires standard\nalphabet characters.\n\n## Observed behaviour\n\nBoth decoders read the standard strings, including the unpadded control. Only\nBuffer decoded the URL-safe fixture. `atob()` threw `InvalidCharacterError` for\nthat variant.\n\n## Application considerations\n\nIdentify the alphabet required by an interchange format before validating or\ndecoding it. Node Buffer’s success alone does not establish interoperability\nwith a consumer using `atob()`.\n","fixtureContents":{"input":"{\n \"standard\": \"+/8=\",\n \"unpadded\": \"+/8\",\n \"urlSafe\": \"-_8\"\n}\n","expected":"[\n 251,\n 255\n]\n"}},{"metadata":{"id":"buffer-view-byte-range","title":"Buffer.buffer can include bytes outside a Buffer view","summary":"A view’s ArrayBuffer can contain framing bytes before and after its payload. Preserve byteOffset and byteLength when passing the view to a binary API.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Buffer byteOffset","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufbyteoffset","kind":"documentation"},{"title":"Node.js: Buffer subarray()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufsubarraystart-end","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a dedicated backing array so the extra bytes are deterministic and independent of Node’s Buffer pool."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A synthetic frame with a one-byte prefix, a two-byte big-endian payload and a one-byte suffix. The payload end is exclusive."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The byte sequences exposed by the backing store and by the payload view, and the decoded payload."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"afa38a3702a41f047e8fb9d73e4464b2eb15c31f1640ee9d437ff2ecb59c1c9e"}}},"markdown":"# Buffer.buffer can include bytes outside a Buffer view\n\nA two-byte payload in a four-byte frame remains backed by the whole frame\nafter `Buffer.subarray()`. Passing `payload.buffer` alone to another API\nincludes both framing bytes. A `DataView` constructed from the buffer,\n`byteOffset` and `byteLength` reads only the payload.\n\n## Observed behaviour\n\nIn Node, rebuilding a typed array from the backing buffer exposed\n`[162, 0, 42, 255]`. Providing the view’s offset and length exposed\n`[0, 42]`, which decoded as the big-endian integer `42`. The test uses a\ndedicated array so the extra bytes do not depend on how Node pools Buffers.\n\n## Application considerations\n\nWhen sending a Buffer slice to an encoder or checksum function, pass the view\ndirectly if the API accepts one. If the API needs a standalone `ArrayBuffer`,\ncopy just the view’s byte range. A full backing store can include unrelated\ncontent.\n","fixtureContents":{"input":"{\n \"frame\": [\n 162,\n 0,\n 42,\n 255\n ],\n \"payloadStart\": 1,\n \"payloadEnd\": 3\n}\n","expected":"{\n \"wholeBackingBytes\": [\n 162,\n 0,\n 42,\n 255\n ],\n \"payloadBytes\": [\n 0,\n 42\n ],\n \"payloadValue\": 42\n}\n"}},{"metadata":{"id":"calendar-day-across-dst","title":"Adding 24 hours can change tomorrow’s local time","summary":"Across a daylight-saving transition, Date.setDate() can preserve the local hour while 24 elapsed hours shift it.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap","date-set-utc-month-overflow"],"references":[{"title":"ECMAScript 2026: Date.prototype.setDate","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.setdate","kind":"specification"},{"title":"IANA time zone database 2026e: North America, US rules and New York","url":"https://data.iana.org/time-zones/tzdb-2026e/northamerica","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses America/New_York at the March and November 2024 transitions."},"fixtures":[{"id":"daily-reminder-starts","file":"input.json","format":"json","role":"input","description":"09:00 local on the day before each 2024 New York DST transition."},{"id":"next-reminder-results","file":"expected.json","format":"json","role":"expected","description":"UTC instants, local hours and elapsed hours for both approaches."}],"verification":{"timeZone":"America/New_York","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"55344d6f0c2877085e9116c242140a4fd4dc1c8d8be7409cb0eeba7fed22f5b0"}}},"markdown":"# Adding 24 hours can change tomorrow’s local time\n\nA daily reminder set for `09:00` in New York on 9 March 2024 moves to\n`10:00` the next morning if the app adds 24 elapsed hours. The clock moves\nforward that night. Adding one local day with `setDate()` keeps the reminder\nat `09:00` in this example because the method works with local calendar fields.\n\n## Observed behaviour\n\nIn Node with `America/New_York` selected, the next local `09:00` was 23 elapsed\nhours away at the spring transition and 25 at the autumn transition. Adding\n24 hours reached `10:00` in spring and `08:00` in autumn.\n\n## Application considerations\n\nSchedule a daily reminder by local date and time in its intended time zone.\nUse elapsed time for a requirement such as “24 hours after the previous event”.\n`Date.setDate()` uses the runtime’s local zone. A reminder that falls inside\na clock change also needs a policy for gaps and repeated times.\n","fixtureContents":{"daily-reminder-starts":"[\n \"2024-03-09T09:00:00\",\n \"2024-11-02T09:00:00\"\n]\n","next-reminder-results":"[\n {\n \"calendarDay\": {\n \"instant\": \"2024-03-10T13:00:00.000Z\",\n \"localHour\": 9,\n \"elapsedHours\": 23\n },\n \"after24Hours\": {\n \"instant\": \"2024-03-10T14:00:00.000Z\",\n \"localHour\": 10,\n \"elapsedHours\": 24\n }\n },\n {\n \"calendarDay\": {\n \"instant\": \"2024-11-03T14:00:00.000Z\",\n \"localHour\": 9,\n \"elapsedHours\": 25\n },\n \"after24Hours\": {\n \"instant\": \"2024-11-03T13:00:00.000Z\",\n \"localHour\": 8,\n \"elapsedHours\": 24\n }\n }\n]\n"}},{"metadata":{"id":"collator-base-sensitivity-by-locale","title":"Intl.Collator base sensitivity treats ä differently in German and Swedish","summary":"With sensitivity set to base, German collation can treat a and ä as equivalent while Swedish keeps them distinct and sorts ä after z.","category":"text-and-encoding","relatedCases":["turkish-locale-lowercase","unicode-normalized-keys"],"references":[{"title":"ECMA-402: CompareStrings and locale-specific base letters","url":"https://tc39.es/ecma402/#sec-comparestrings","kind":"specification"},{"title":"Unicode CLDR 49: Swedish collation tailoring","url":"https://www.unicode.org/cldr/charts/49/collation/sv.html","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires ICU data for de and sv. Observed with ICU 79.1 and CLDR 49.0 using the default collation for each locale."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two requested locales, a letter pair and a three-word list arranged to show the position of ä relative to z."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Comparison signs and sort order under base sensitivity with the default German and Swedish collations."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0425c1d05dcb87b5eef4ed25aded63768c369f95500f6abb68c9c640bf67687c"}}},"markdown":"# Intl.Collator base sensitivity treats ä differently in German and Swedish\n\nWith `sensitivity: \"base\"`, German collation compares `a` and `ä` as\nequivalent, while Swedish treats them as different letters. ECMA-402\nleaves the identification of base letters to the effective locale.\nThe CLDR standard Swedish ordering puts `ä` after `z`.\n\n## Observed behaviour\n\nNode with ICU 79.1 and CLDR 49.0 sorted `Ähre` before `Apfel` and\n`Zoll` in German. In Swedish it sorted `Ähre` last. The test checks the\nsign of `compare()` because ECMA-402 specifies the sign and leaves the\nexact non-zero number to the implementation.\n\n## Application considerations\n\nUse the intended locale for accent-insensitive matching and sorting.\nA user-facing equality comparison at base sensitivity can merge terms\nin one locale that users of another locale expect to remain distinct.\n","fixtureContents":{"input":"{\n \"locales\": [\n \"de\",\n \"sv\"\n ],\n \"comparison\": [\n \"a\",\n \"ä\"\n ],\n \"words\": [\n \"Zoll\",\n \"Ähre\",\n \"Apfel\"\n ]\n}\n","expected":"{\n \"de\": {\n \"comparisonSign\": 0,\n \"sorted\": [\n \"Ähre\",\n \"Apfel\",\n \"Zoll\"\n ]\n },\n \"sv\": {\n \"comparisonSign\": -1,\n \"sorted\": [\n \"Apfel\",\n \"Zoll\",\n \"Ähre\"\n ]\n }\n}\n"}},{"metadata":{"id":"csv-duplicate-header-columns","title":"Duplicate CSV headers can discard earlier columns","summary":"csv-parse with columns enabled keeps the last value for a repeated header unless group_columns_by_name collects all values.","category":"data-formats","relatedCases":["csv-relaxed-column-count"],"references":[{"title":"CSV Parse: columns option","url":"https://csv.js.org/parse/options/columns/","kind":"documentation"},{"title":"CSV Parse: group_columns_by_name option","url":"https://csv.js.org/parse/options/group_columns_by_name/","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the workspace’s pinned csv-parse version with header-based object mapping."},"fixtures":[{"id":"contacts","file":"contacts.txt","format":"text","role":"input","description":"LF-terminated CSV with a repeated phone header and two contact numbers in order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Default and grouped object results."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"aed6e5cc2cfdaec273f31b83b8b8306a87290a2c63e9217bc50f32138575e12b"}}},"markdown":"# Duplicate CSV headers can discard earlier columns\n\nMapping `customer,phone,phone` to an object gives both phone columns the same\nproperty name. The `columns` option in `csv-parse` keeps the last value by\ndefault. `group_columns_by_name` collects repeated values in column order.\n\n## Observed behaviour\n\nThe default import kept `555-0142`. Grouping kept both phone numbers in an\narray, and the customer field stayed scalar.\n\n## Application considerations\n\nValidate header uniqueness before importing when each column should have a\ndistinct meaning. If repetition represents a list, enable grouping and account\nfor the resulting array values in validation.\n","fixtureContents":{"contacts":"customer,phone,phone\nA41,555-0101,555-0142\n","expected":"{\n \"defaultRows\": [\n {\n \"customer\": \"A41\",\n \"phone\": \"555-0142\"\n }\n ],\n \"groupedRows\": [\n {\n \"customer\": \"A41\",\n \"phone\": [\n \"555-0101\",\n \"555-0142\"\n ]\n }\n ]\n}\n"}},{"metadata":{"id":"csv-quoted-newline","title":"A quoted newline can belong to one CSV field","summary":"Splitting CSV on line breaks breaks multiline fields such as delivery notes.","category":"data-formats","references":[{"title":"RFC 4180 §2: CSV records and quoted fields","url":"https://www.rfc-editor.org/rfc/rfc4180.html#section-2","kind":"specification"},{"title":"CSV Parse: synchronous API","url":"https://csv.js.org/parse/api/sync/","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses csv-parse 7.0.3 with CRLF record separators and a header row."},"fixtures":[{"id":"multiline-deliveries","file":"deliveries.txt","format":"text","role":"input","description":"Export with CRLF record separators and a CRLF inside a quoted delivery note. The final record ends with CRLF."},{"id":"parsed-deliveries","file":"expected.json","format":"json","role":"expected","description":"Two delivery records with the embedded CRLF retained in the first note."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"7398e4066e06fcd84cbc37c01c82d2735dc3db5497aa92828115db23f8f88dc1"}}},"markdown":"# A quoted newline can belong to one CSV field\n\nA CSV delivery note such as `\"Leave by the side door\\r\\nRing the bell once\"`\ncontains a line break inside a single field. In RFC 4180’s CSV format,\ndouble quotes let a field contain a line break. Splitting at every line\nbreak divides that delivery record in two.\n\n## Observed behaviour\n\nWith a header row and CRLF record separators configured, `csv-parse` returned\ntwo delivery records and retained the embedded CRLF in the first note.\nSplitting those same bytes at CRLF yielded four nonempty physical lines,\nincluding the header.\n\n## Application considerations\n\nUse a CSV parser configured for the exporter’s dialect before validating\ncolumns or counting records. Keep the original CRLF fixture when writing\nimport tests. Normalising the line endings would change the value the parser\nshould return for the multiline note.\n","fixtureContents":{"multiline-deliveries":"order_id,delivery_note\r\nA101,\"Leave by the side door\r\nRing the bell once\"\r\nA102,Collect at the desk\r\n","parsed-deliveries":"[\n {\n \"order_id\": \"A101\",\n \"delivery_note\": \"Leave by the side door\\r\\nRing the bell once\"\n },\n {\n \"order_id\": \"A102\",\n \"delivery_note\": \"Collect at the desk\"\n }\n]\n"}},{"metadata":{"id":"csv-relaxed-column-count","title":"Relaxed CSV column counts can drop fields during object mapping","summary":"In csv-parse, relaxed column counts with a header can yield missing properties and silently discard extra fields.","category":"data-formats","relatedCases":["csv-quoted-newline"],"references":[{"title":"CSV Parse: relax_column_count with columns","url":"https://csv.js.org/parse/options/relax_column_count/","kind":"documentation"},{"title":"CSV Parse: inconsistent columns issue #73","url":"https://github.com/adaltas/node-csv-parse/issues/73","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the workspace’s pinned csv-parse 7.0.3 with and without header mapping."},"fixtures":[{"id":"deliveries","file":"deliveries.txt","format":"text","role":"input","description":"Header and three LF-terminated delivery rows. The rows have an explicit empty note, an absent note, and a surplus field respectively."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The strict parsing error and relaxed results with and without object mapping."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"c1e721b34db3054f8a9a56bcb4dcc2821915b621eb9fe3cabbe02c9b0ec343b7"}}},"markdown":"# Relaxed CSV column counts can drop fields during object mapping\n\nWith an `id,note` header, `A10,` contains an empty note and `A11` lacks\nthe field entirely. Enabling both `columns` and `relax_column_count` in\n`csv-parse` accepts both rows. It also accepts a row with surplus fields,\nbut fields beyond the header have no corresponding object property.\n\n## Observed behaviour\n\nStrict header parsing rejected the uneven rows. The relaxed object\nmode returned an empty string for `A10` and omitted the `note` property\nfor `A11`. It silently left `Call on arrival` out of the third object.\nRelaxed array mode preserved each field and each row’s original width.\n\n## Application considerations\n\nWhen investigating a broken export, read rows as arrays or inspect the raw\nrecord before mapping fields to column names. Decide whether a missing field\nand an explicitly empty field mean the same thing for the importer.\n","fixtureContents":{"deliveries":"id,note\nA10,\nA11\nA12,Leave at door,Call on arrival\n","expected":"{\n \"strictError\": \"CSV_RECORD_INCONSISTENT_COLUMNS\",\n \"records\": [\n {\n \"id\": \"A10\",\n \"note\": \"\"\n },\n {\n \"id\": \"A11\"\n },\n {\n \"id\": \"A12\",\n \"note\": \"Leave at door\"\n }\n ],\n \"rawRows\": [\n [\n \"id\",\n \"note\"\n ],\n [\n \"A10\",\n \"\"\n ],\n [\n \"A11\"\n ],\n [\n \"A12\",\n \"Leave at door\",\n \"Call on arrival\"\n ]\n ]\n}\n"}},{"metadata":{"id":"date-only-utc","title":"Date-only strings can display as the previous day","summary":"JavaScript parses YYYY-MM-DD as UTC. In a time zone west of UTC, a birthday can display a day early.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap"],"references":[{"title":"ECMAScript 2026 — Date.parse","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixture's local dates and instants use America/Los_Angeles in January 2024."},"fixtures":[{"id":"date-inputs","file":"input.json","format":"json","role":"input","description":"Three forms of January 15, 2024 with and without a time and UTC offset."},{"id":"parsed-dates","file":"expected.json","format":"json","role":"expected","description":"UTC instants and the local day of month in Los Angeles."}],"verification":{"timeZone":"America/Los_Angeles","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"bcb9d6579fbb2b1702d2f85ffd0c3870c50a1b38c518fd62a7f8ed3ac773e4eb"}}},"markdown":"# Date-only strings can display as the previous day\n\nIn Los Angeles, `new Date(\"2024-01-15\").getDate()` returns `14`. JavaScript\ninterprets a date-only string in the ECMAScript date time string format as\nmidnight UTC. Adding a time without an offset switches to local time. Adding `Z`\nmakes the time UTC again.\n\n## Observed behaviour\n\nWith `America/Los_Angeles` selected, Node parsed `2024-01-15` and\n`2024-01-15T00:00:00Z` as `2024-01-15T00:00:00.000Z`. It parsed\n`2024-01-15T00:00:00` as `2024-01-15T08:00:00.000Z`.\n\n## Application considerations\n\nKeep a birthday as a date-only value through storage and display to avoid an\noff-by-one day error. If a field represents an instant, include an explicit\noffset or `Z` in the serialised value.\n","fixtureContents":{"date-inputs":"{\n \"dateOnly\": \"2024-01-15\",\n \"localMidnight\": \"2024-01-15T00:00:00\",\n \"utcMidnight\": \"2024-01-15T00:00:00Z\"\n}\n","parsed-dates":"{\n \"utcFromDateOnly\": \"2024-01-15T00:00:00.000Z\",\n \"utcFromLocalMidnight\": \"2024-01-15T08:00:00.000Z\",\n \"localDayFromDateOnly\": 14\n}\n"}},{"metadata":{"id":"date-rejects-rfc3339-leap-second","title":"An RFC 3339 leap second is outside ECMAScript Date’s format","summary":"RFC 3339 permits a seconds field of 60 at a positive leap second. Node’s Date accepts the neighbouring instants and rejects that timestamp.","category":"dates-and-times","references":[{"title":"RFC 3339: restrictions and leap seconds","url":"https://www.rfc-editor.org/rfc/rfc3339.html#section-5.7","kind":"specification"},{"title":"ECMAScript: Date Time String Format","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date-time-string-format","kind":"specification"},{"title":"IERS Bulletin C 52: December 2016 leap second","url":"https://datacenter.iers.org/versionMetadata.php?filename=mt%2Fbulletinc-052.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Date rejection is an observation on the verified Node runtime. Implementations can apply fallback heuristics to inputs outside the ECMAScript format."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"The announced 2016 UTC leap second and the valid labels immediately before and after it."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Date’s millisecond values for both neighbouring labels."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"211231f36364e2c8cec9636ba684a7406871b627b97e971c60c8d3a2f78a267b"}}},"markdown":"# An RFC 3339 leap second is outside ECMAScript Date’s format\n\n`2016-12-31T23:59:60Z` labels the leap second announced by IERS. RFC 3339\npermits `60` for that moment. The ECMAScript Date Time String Format defines its\nseconds field from `00` through `59`.\n\n## Observed behaviour\n\nNode’s `Date.parse()` returned a millisecond value for each neighbouring UTC\nlabel and `NaN` for the seconds field that Date considers invalid. Date’s\nmillisecond values put the neighbours one second apart on its own time scale.\n\n## Application considerations\n\nIf an importer receives formal RFC 3339 timestamps, decide how it represents\nleap seconds before converting values to `Date`. Preserving the original input\nallows upstream telemetry to be reconciled later.\n","fixtureContents":{"input":"{\n \"before\": \"2016-12-31T23:59:59Z\",\n \"leap\": \"2016-12-31T23:59:60Z\",\n \"after\": \"2017-01-01T00:00:00Z\"\n}\n","expected":"{\n \"before\": 1483228799000,\n \"after\": 1483228800000\n}\n"}},{"metadata":{"id":"date-set-utc-month-overflow","title":"Date.setUTCMonth() can skip February","summary":"Changing January 31 to February retains the day of the month and rolls into March.","category":"dates-and-times","references":[{"title":"ECMAScript 2026: Date.prototype.setUTCMonth","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.setutcmonth","kind":"specification"},{"title":"ECMAScript 2026: MakeDay","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-makeday","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"january-dates","file":"input.json","format":"json","role":"input","description":"January 31 in a common year and a leap year, with the requested UTC month index."},{"id":"month-results","file":"expected.json","format":"json","role":"expected","description":"UTC results for the default day and for an explicit first day of the target month."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"de586982cf7ce2bc4a5466dc6bb87cf607667b907bfb998927b63f9a4454b04a"}}},"markdown":"# Date.setUTCMonth() can skip February\n\nCalling `setUTCMonth(1)` on 31 January 2023 moves the date to 3 March. February\nhas index `1`. With the day argument omitted, ECMAScript uses the original day\nof the month, so day 31 of February rolls over into the following month.\n\n## Observed behaviour\n\nNode produced 3 March in 2023 and 2 March in leap year 2024. Passing\n`setUTCMonth(1, 1)` selected 1 February in both years. The fixture uses UTC\nthroughout so local time-zone changes do not enter the calculation.\n\n## Application considerations\n\nFor monthly billing or renewals, define what should happen when the target\nmonth is shorter. If the policy is to use the last day of that month, calculate\nthat day explicitly. For a recurring renewal, keep the original preferred day\nso subsequent months can use it when available.\n","fixtureContents":{"january-dates":"{\n \"starts\": [\n \"2023-01-31T12:00:00.000Z\",\n \"2024-01-31T12:00:00.000Z\"\n ],\n \"targetMonthIndex\": 1\n}\n","month-results":"[\n {\n \"overflow\": \"2023-03-03T12:00:00.000Z\",\n \"firstDay\": \"2023-02-01T12:00:00.000Z\"\n },\n {\n \"overflow\": \"2024-03-02T12:00:00.000Z\",\n \"firstDay\": \"2024-02-01T12:00:00.000Z\"\n }\n]\n"}},{"metadata":{"id":"date-timeclip-range","title":"A Date outside the TimeClip range serialises to null","summary":"One millisecond beyond ±8.64 × 10¹⁵ yields an invalid Date. toISOString() throws a RangeError, while toJSON() returns null.","category":"dates-and-times","references":[{"title":"ECMAScript: TimeClip","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-timeclip","kind":"specification"},{"title":"ECMAScript: Date.prototype.toISOString","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.toisostring","kind":"specification"},{"title":"ECMAScript: Date.prototype.toJSON","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.tojson","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Positive and negative millisecond boundaries plus the adjacent out-of-range values."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Expected ISO strings at both limits and null for invalid dates."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"1dea198715f21a57ab1da1fbbf80619d23015be4949764749b1c879df840a6a4"}}},"markdown":"# A Date outside the TimeClip range serialises to null\n\nAn epoch value of `8640000000000000` milliseconds creates a valid ECMAScript\n`Date`. Adding one millisecond exceeds the `TimeClip` range and creates a Date\nwhose time value is `NaN`.\n\n## Observed behaviour\n\nBoth endpoints formatted as ISO strings. The adjacent out-of-range values caused\n`toISOString()` to throw `RangeError` and appeared as `null` when the containing\nobjects were stringified.\n\n## Application considerations\n\nValidate timestamp units and check the constructed date’s time value before\nserialising. A timestamp accidentally expressed in microseconds can otherwise\nlook like an explicitly missing value in a JSON payload.\n","fixtureContents":{"input":"{\n \"cases\": [\n 8640000000000000,\n 8640000000000001,\n -8640000000000000,\n -8640000000000001\n ]\n}\n","expected":"[\n \"+275760-09-13T00:00:00.000Z\",\n null,\n \"-271821-04-20T00:00:00.000Z\",\n null\n]\n"}},{"metadata":{"id":"dst-repeated-local-time","title":"Date picks the earlier instant when a local time occurs twice","summary":"During the New York DST fall-back, two instants display as 01:30. An offsetless Date picks the earlier one.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap","calendar-day-across-dst"],"references":[{"title":"ECMAScript 2026: UTC conversion at local time transitions","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-utc-t","kind":"specification"},{"title":"IANA time zone database 2026e: North America, US rules and New York","url":"https://data.iana.org/time-zones/tzdb-2026e/northamerica","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses America/New_York at the November 2024 transition."},"fixtures":[{"id":"repeated-local-time","file":"input.json","format":"json","role":"input","description":"An ambiguous New York local time and two timestamps with explicit offsets."},{"id":"repeated-time-results","file":"expected.json","format":"json","role":"expected","description":"Both UTC instants and their shared local clock fields."}],"verification":{"timeZone":"America/New_York","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"7f638e0e3f63fd9ace22e0fdff81144f0aa9ff24dfcf8fa59d314ec938c2aebd"}}},"markdown":"# Date picks the earlier instant when a local time occurs twice\n\nIn New York, `2024-11-03T01:30:00` could mean `05:30Z` or `06:30Z`. At the end\nof daylight saving time, the clock moved back and passed through `01:30` twice.\nAn offsetless ECMAScript `Date` chooses the earlier instant when the local time\nis ambiguous.\n\n## Observed behaviour\n\nWith `America/New_York` selected, Node parsed the offsetless timestamp as\n`2024-11-03T05:30:00.000Z`, the same instant as the version with `-04:00`. The\n`-05:00` version was one elapsed hour later. Both instants had local clock\nfields of `01:30`.\n\n## Application considerations\n\nIf a booking can fall within the repeated hour, decide how to ask the user which\noccurrence they mean. Once resolved, store the instant or the full local\ntimestamp with its offset. Keep the named time zone if display depends on it. A\ncron-style scheduler also needs a policy for whether a job runs once or twice\nduring the DST fall-back.\n","fixtureContents":{"repeated-local-time":"{\n \"local\": \"2024-11-03T01:30:00\",\n \"earlier\": \"2024-11-03T01:30:00-04:00\",\n \"later\": \"2024-11-03T01:30:00-05:00\"\n}\n","repeated-time-results":"{\n \"earlier\": \"2024-11-03T05:30:00.000Z\",\n \"later\": \"2024-11-03T06:30:00.000Z\",\n \"localClock\": {\n \"hour\": 1,\n \"minute\": 30\n }\n}\n"}},{"metadata":{"id":"emoji-grapheme-length","title":"Emoji string length can differ from grapheme count","summary":"JavaScript length counts UTF-16 code units. Intl.Segmenter can count a joined emoji as one grapheme cluster.","category":"text-and-encoding","relatedCases":["unicode-normalized-keys"],"references":[{"title":"ECMAScript 2026: The String type","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type","kind":"specification"},{"title":"ECMA-402: Intl.Segmenter.prototype.segment","url":"https://tc39.es/ecma402/#sec-intl.segmenter.prototype.segment","kind":"specification"},{"title":"Unicode Standard Annex #29: Default grapheme cluster boundaries","url":"https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses Node's Intl.Segmenter with English locale and grapheme granularity."},"fixtures":[{"id":"display-labels","file":"input.json","format":"json","role":"input","description":"A joined emoji alone and followed by punctuation."},{"id":"text-counts","file":"expected.json","format":"json","role":"expected","description":"Code unit counts, code point counts and grapheme segments for each label."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ccb91c1493d6e6d8fc30214936fc9649df039ad77e74b3eaef4975276d5fe517"}}},"markdown":"# Emoji string length can differ from grapheme count\n\n`\"👩🏽💻\".length` is `7`, even though the joined emoji is one grapheme cluster.\nJavaScript string length counts UTF-16 code units. String iteration counts\nUnicode code points. The woman, skin tone modifier, zero-width joiner and\nlaptop are four code points within one cluster.\n\n## Observed behaviour\n\nNode counted seven code units and four code points. With grapheme\ngranularity, `Intl.Segmenter` returned a single segment for the emoji\nand a separate segment for the exclamation mark in `\"👩🏽💻!\"`.\n\n## Application considerations\n\nWhen truncating labels to a visible character limit, work at grapheme\nboundaries so a cut cannot split this emoji. Keep any separate storage\nor transport limit in the units required by that system.\n","fixtureContents":{"display-labels":"[\n \"👩🏽💻\",\n \"👩🏽💻!\"\n]\n","text-counts":"[\n {\n \"codeUnits\": 7,\n \"codePoints\": 4,\n \"graphemes\": [\n \"👩🏽💻\"\n ]\n },\n {\n \"codeUnits\": 8,\n \"codePoints\": 5,\n \"graphemes\": [\n \"👩🏽💻\",\n \"!\"\n ]\n }\n]\n"}},{"metadata":{"id":"event-emitter-async-context","title":"An EventEmitter listener can run in a different async context","summary":"A normal EventEmitter calls listeners in the emitter’s current context. AsyncLocalStorage.snapshot() can restore the context captured when registering a callback.","category":"runtime-and-concurrency","references":[{"title":"Node.js: passing arguments and this to EventEmitter listeners","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#passing-arguments-and-this-to-listeners","kind":"documentation"},{"title":"Node.js: AsyncLocalStorage.snapshot()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/async_context.html#static-method-asynclocalstoragesnapshot","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An event and payload, with distinct request and queue context values for subscription and emission."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The respective context and event payload observed by ordinary and snapshot-wrapped listeners."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"359096fa64e9992ce1971a1012d2b8a6846dc4efee00d13ece93084b45197457"}}},"markdown":"# An EventEmitter listener can run in a different async context\n\nA listener registered during request `42` can see the queue worker’s context\nwhen that worker calls `emit()`. A normal `EventEmitter` invokes listeners\nsynchronously, so `AsyncLocalStorage.getStore()` observes the context\nactive at emission. `AsyncLocalStorage.snapshot()` can run a callback in a\npreviously captured context.\n\n## Observed behaviour\n\nBoth listeners received the same job result. The ordinary listener saw the\nqueue context, and the listener wrapped in a snapshot taken during\nregistration saw the request context.\n\n## Application considerations\n\nFor logging and trace correlation, decide whether an event belongs to the\nrequest that subscribed or to the work that emitted it. Capture context\ndeliberately for request-scoped callbacks on shared emitters. The test uses\nthe standard `EventEmitter`, whose behaviour differs from\n`EventEmitterAsyncResource`.\n","fixtureContents":{"input":"{\n \"event\": \"job-result\",\n \"subscribeContext\": \"request:42\",\n \"emitContext\": \"queue:worker-1\",\n \"payload\": \"ready\"\n}\n","expected":"{\n \"ordinary\": {\n \"context\": \"queue:worker-1\",\n \"payload\": \"ready\"\n },\n \"captured\": {\n \"context\": \"request:42\",\n \"payload\": \"ready\"\n }\n}\n"}},{"metadata":{"id":"events-once-same-tick","title":"Sequential events.once() awaits can miss the second event","summary":"A synchronous batch can emit the second event before the first await resumes. Register both event promises before yielding.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Caveats when awaiting multiple events","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#caveats-when-awaiting-multiple-events","kind":"documentation"},{"title":"Node.js: Synchronous EventEmitter dispatch","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#asynchronous-vs-synchronous","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two named notifications and payloads for consecutive emits in one nextTick callback."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The payload arrays resolved by early listeners and the abort error used to end the late wait."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"772543aee9819e566462f0414cc119cc5e5f29f8f6df00c4d2769455d27bfaf3"}}},"markdown":"# Sequential events.once() awaits can miss the second event\n\nIf an emitter sends `ready` and `finished` in the same synchronous batch,\n`await once(emitter, \"ready\")` can resume after `finished` has already\nbeen emitted. `EventEmitter.emit()` calls listeners synchronously. The\ncontinuation of the first `await` runs after the current callback returns.\n\n## Observed behaviour\n\nWith both events emitted in one `process.nextTick()` callback, registering\nthe `finished` listener after awaiting `ready` missed the notification.\nThe test aborts the late wait after the batch so it can assert the failure\nwithout a wall-clock timeout. Registering both event promises before\nawaiting either captured both payloads.\n\n## Application considerations\n\nIn wrappers around event-based APIs, register all expected event listeners\nbefore starting an operation that can emit them together. When an operation\nmay fail before emitting one event, give the outstanding waits an explicit\ncleanup path.\n","fixtureContents":{"input":"{\n \"first\": {\n \"name\": \"ready\",\n \"payload\": \"job-42\"\n },\n \"second\": {\n \"name\": \"finished\",\n \"payload\": \"accepted\"\n }\n}\n","expected":"{\n \"first\": [\n \"job-42\"\n ],\n \"second\": [\n \"accepted\"\n ],\n \"lateError\": \"AbortError\"\n}\n"}},{"metadata":{"id":"execfile-maxbuffer-utf8-bytes","title":"execFile() maxBuffer counts bytes before decoding stdout","summary":"Node’s child process can exceed maxBuffer with a multibyte character even when the decoded string would fit by JavaScript length.","category":"runtime-and-concurrency","relatedCases":["utf8-byte-length"],"references":[{"title":"Node.js: maxBuffer and Unicode","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/child_process.html#maxbuffer-and-unicode","kind":"documentation"},{"title":"Node.js: child_process.execFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/child_process.html#child_processexecfilefile-args-options-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Spawns the same Node executable without a shell or a PATH lookup. The child writes only its argument to stdout."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two four-code-unit strings and a four-byte stdout budget."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The error code for an exceeded stdout buffer."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"9dac6799ac39d7f9769dd48070bb64f0fab8efe88e5eac7acabd51d2f58c139a"}}},"markdown":"# execFile() maxBuffer counts bytes before decoding stdout\n\nBoth `ABCD` and `éBCD` have JavaScript length four. A child writing them to\nstdout produces four and five UTF-8 bytes respectively. `execFile()` enforces\n`maxBuffer` on bytes even when the caller requests a decoded string.\n\n## Observed behaviour\n\nThe ASCII child completed and returned all four characters. The accented child\nexceeded `maxBuffer` and its promise rejected with Node’s stdout buffer error.\n\n## Application considerations\n\nSet output limits in bytes and handle overflow when a process produces localised\ntext. For potentially large output, use a streaming child process API and apply\na separate bounded policy.\n","fixtureContents":{"input":"{\n \"ascii\": \"ABCD\",\n \"accented\": \"éBCD\",\n \"maxBuffer\": 4\n}\n","expected":"{\n \"code\": \"ERR_CHILD_PROCESS_STDIO_MAXBUFFER\"\n}\n"}},{"metadata":{"id":"fetch-decoded-body-content-length","title":"Fetch can decode a gzip body while retaining its encoded Content-Length","summary":"Node’s fetch exposes decoded bytes for a gzip response. Content-Length stays the size of the encoded representation.","category":"web-platform","relatedCases":["gzip-concatenated-members"],"references":[{"title":"RFC 9110: Content-Length","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-8.6","kind":"specification"},{"title":"WHATWG Fetch: handling content codings","url":"https://fetch.spec.whatwg.org/#concept-http-network-fetch","kind":"specification"},{"title":"Undici issue #2514: compressed response headers after decoding","url":"https://github.com/nodejs/undici/issues/2514","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with the workspace’s pinned Undici MockAgent. Both responses are offline."},"fixtures":[{"id":"gzip-response","file":"body.bin","format":"binary","role":"input","description":"Exact gzip bytes for twelve repetitions of the sample line. Serve with Content-Encoding gzip and a Content-Length of 51."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Origin, request paths and the plaintext line and repetition count."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Encoded and decoded lengths in bytes."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"6e6f4e19412e3a152e6ff29a936ca6e7a6b60642bdf1235f1a39967793746c4f"}}},"markdown":"# Fetch can decode a gzip body while retaining its encoded Content-Length\n\nA gzip-compressed HTTP response can advertise `Content-Length: 51` and yield 312\ndecoded bytes from `response.arrayBuffer()`. Content-Length describes the\nencoded representation sent in that response. Fetch handles content codings\nbefore exposing its body.\n\n## Observed behaviour\n\nWith Node’s offline HTTP dispatcher, the gzip response retained its encoding and\nlength headers while its body decoded to the same bytes as the uncompressed\ncontrol. The control’s length matched its body.\n\n## Application considerations\n\nKeep transfer size and decoded size separate in progress indicators. When\nforwarding decoded bytes, set headers that describe the bytes actually being\nsent.\n","fixtureContents":{"gzip-response":"H4sIAAAAAAAC/8vJzEu1UiguTSpOLsosKMnMz1NITC7JLEvlyhmVwSMDAMRjVrY4AQAA","input":"{\n \"origin\": \"https://example.test\",\n \"encoded\": \"/encoded\",\n \"plain\": \"/plain\",\n \"line\": \"line: subscription active\\n\",\n \"rows\": 12\n}\n","expected":"{\n \"encodedLength\": 51,\n \"decodedLength\": 312\n}\n"}},{"metadata":{"id":"fetch-http-error","title":"fetch() resolves on HTTP 404","summary":"A 404 fulfils the Fetch promise with Response.ok set to false. A network error rejects it.","category":"web-platform","references":[{"title":"WHATWG Fetch Standard: fetch() method","url":"https://fetch.spec.whatwg.org/#fetch-method","kind":"specification"},{"title":"WHATWG Fetch Standard: Response.ok","url":"https://fetch.spec.whatwg.org/#dom-response-ok","kind":"specification"},{"title":"Undici 7.30.2: MockAgent","url":"https://github.com/nodejs/undici/blob/v7.30.2/docs/docs/api/MockAgent.md","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with Undici 7.30.2 MockAgent as the offline HTTP dispatcher."},"fixtures":[{"id":"http-scenarios","file":"input.json","format":"json","role":"input","description":"One HTTP 404 response and one transport failure for the same request."},{"id":"fetch-results","file":"expected.json","format":"json","role":"expected","description":"Status, ok flag and body for the fulfilled Response, and the rejection type for the network failure."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"94cac04827ca7b2fff7f27e886f37c9b2beb8c8433eefdb1e37180e1d1887604"}}},"markdown":"# fetch() resolves on HTTP 404\n\nWhen an endpoint returns HTTP `404`, `await fetch(url)` gives you a\n`Response` with `ok === false`. Fetch considers status codes 200 through\n299 to be OK. An HTTP error status still produces a response. A network\nerror rejects the promise instead.\n\n## Observed behaviour\n\nUsing an offline dispatcher, Node’s global `fetch()` fulfilled with a\n`404` response and the body `\"Product not found\"`. When the dispatcher\nsimulated a transport error for the same URL, `fetch()` rejected with\n`TypeError`. The test uses no live endpoint.\n\n## Application considerations\n\nCheck `response.ok` or the status codes your application expects after\nawaiting the request. Handle network failures separately. A missing\nproduct may call for an empty state, while a connection failure may\ncall for a retry.\n","fixtureContents":{"http-scenarios":"{\n \"origin\": \"https://catalogue.example\",\n \"path\": \"/products/missing\",\n \"notFound\": {\n \"status\": 404,\n \"body\": \"Product not found\"\n },\n \"networkError\": \"Connection interrupted\"\n}\n","fetch-results":"{\n \"notFound\": {\n \"status\": 404,\n \"ok\": false,\n \"body\": \"Product not found\"\n },\n \"networkError\": \"TypeError\"\n}\n"}},{"metadata":{"id":"fetch-redirect-post-method","title":"Fetch turns a POST into GET on 303 and preserves it on 307","summary":"The redirect status determines whether Fetch drops the original body or sends the POST again to the redirected URL.","category":"web-platform","relatedCases":["fetch-http-error"],"references":[{"title":"WHATWG Fetch Standard: HTTP-redirect fetch","url":"https://fetch.spec.whatwg.org/#http-redirect-fetch","kind":"specification"},{"title":"RFC 9110: 303 See Other","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.4","kind":"specification"},{"title":"RFC 9110: 307 Temporary Redirect","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.8","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with the pinned Undici MockAgent, same-origin URLs and a replayable string body."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two same-origin redirects from requests with the same method and replayable string body."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The required method and body at each redirect destination, plus the final response text and status."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"85277d228162d2525ea0619d6f86d990219223f4e7c4a376ab3770699a45e864"}}},"markdown":"# Fetch turns a POST into GET on 303 and preserves it on 307\n\nFollowing a `303 See Other` after a form POST sends a GET to the new\nURL. Following a `307 Temporary Redirect` sends another POST with the\noriginal body when Fetch can replay it. The server’s chosen status changes\nwhat reaches the destination even when the client code stays the same.\n\n## Observed behaviour\n\nAn offline dispatcher observed a bodyless GET at `/receipt` after a\n`303` and a POST carrying `quantity=2` at `/new-submit` after a `307`.\nNode’s global `fetch()` followed each redirect to the expected destination.\n\n## Application considerations\n\nUse `303` when the next request retrieves a receipt or results page.\nUse `307` when the new endpoint should receive the original submission.\nTest the destination method and body when migrating an endpoint. This\nfixture uses a replayable string. A one-shot request stream has different\nreplay constraints.\n","fixtureContents":{"input":"{\n \"origin\": \"https://example.test\",\n \"method\": \"POST\",\n \"body\": \"quantity=2\",\n \"redirects\": [\n {\n \"status\": 303,\n \"from\": \"/submit\",\n \"to\": \"/receipt\"\n },\n {\n \"status\": 307,\n \"from\": \"/old-submit\",\n \"to\": \"/new-submit\"\n }\n ]\n}\n","expected":"{\n \"result\": [\n {\n \"method\": \"GET\",\n \"body\": null,\n \"result\": \"receipt\"\n },\n {\n \"method\": \"POST\",\n \"body\": \"quantity=2\",\n \"result\": \"accepted\"\n }\n ],\n \"status\": 200\n}\n"}},{"metadata":{"id":"file-url-host-windows-unc","title":"Windows mode converts a hosted file URL to a UNC path","summary":"fileURLToPath() converts a hosted file URL to a Windows network path and rejects the same URL in POSIX mode.","category":"filesystem-and-paths","relatedCases":["file-url-reserved-filename"],"references":[{"title":"Node.js fileURLToPath() platform modes","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlfileurltopathurl-options","kind":"documentation"},{"title":"Node.js ERR_INVALID_FILE_URL_HOST","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/errors.html#err_invalid_file_url_host","kind":"documentation"},{"title":"Microsoft Learn: UNC paths","url":"https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses explicit windows true and false options on the same runtime. The test performs no filesystem or network access."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A hosted file URL and a local drive-letter file URL."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The UNC path, local path in each grammar and POSIX rejection code."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"d7356384180de0567d798ae7e6190a6d6da5ae5821cbe7993aa038b49c7de534"}}},"markdown":"# Windows mode converts a hosted file URL to a UNC path\n\nIn Windows mode, `file://nas/exports/orders.csv` converts to\n`\\\\nas\\exports\\orders.csv`. That UNC path names a file on a share. Node’s POSIX\nconversion rejects the same non-local host.\n\n## Observed behaviour\n\nThe explicit Windows option produced a UNC path for the hosted URL and a drive\npath for the local URL. The explicit POSIX option rejected the hosted URL and\nreturned `/C:/exports/orders.csv` for the local one.\n\n## Application considerations\n\nConvert stored file URLs according to the environment that will use the path. A\npath can parse successfully in its target grammar even when the named file or\nshare is unavailable.\n","fixtureContents":{"input":"{\n \"remote\": \"file://nas/exports/orders.csv\",\n \"local\": \"file:///C:/exports/orders.csv\"\n}\n","expected":"{\n \"remoteWindows\": \"\\\\\\\\nas\\\\exports\\\\orders.csv\",\n \"localWindows\": \"C:\\\\exports\\\\orders.csv\",\n \"localPosix\": \"/C:/exports/orders.csv\",\n \"error\": \"ERR_INVALID_FILE_URL_HOST\"\n}\n"}},{"metadata":{"id":"file-url-reserved-filename","title":"A filename containing # or % needs file URL conversion","summary":"pathToFileURL() encodes literal hash and percent characters. Interpolating the same path into a file URL can change the filename.","category":"filesystem-and-paths","references":[{"title":"Node.js: pathToFileURL()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlpathtofileurlpath-options","kind":"documentation"},{"title":"Node.js: fileURLToPath()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlfileurltopathurl-options","kind":"documentation"},{"title":"WHATWG URL Standard: URL parsing","url":"https://url.spec.whatwg.org/#concept-url-parser","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the explicit POSIX conversion mode. No filesystem access is required."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An absolute POSIX path containing a literal percent-escape lookalike and a hash."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The encoded URL and pathname, and the altered path and fragment from direct interpolation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"70e558e0a5b73a5b60b2b68abcb6416c88a674335b2bf3602cc219f5627a2a5c"}}},"markdown":"# A filename containing # or % needs file URL conversion\n\nThe file named `/exports/part%20#2.csv` contains a literal percent sign\nand hash. In a URL, `%20` represents a space and `#` starts a fragment.\n`pathToFileURL()` encodes both characters so `fileURLToPath()` can recover\nthe original name.\n\n## Observed behaviour\n\nIn Node’s explicit POSIX mode the conversion round-tripped the full path.\nDirect interpolation into a `file:` URL produced a fragment of `#2.csv`\nand decoded the filesystem path as `/exports/part `, ending in a space.\nReading the correctly encoded URL’s `pathname` still returned URL escapes.\n\n## Application considerations\n\nUse the filesystem path converters at the boundary between native paths and\nfile URLs, such as when resolving import locations supplied as filenames.\nKeep the literal `%20` in the fixture to catch double decoding as well as\nfragment loss.\n","fixtureContents":{"input":"{\n \"path\": \"/exports/part%20#2.csv\"\n}\n","expected":"{\n \"url\": \"file:///exports/part%2520%232.csv\",\n \"pathname\": \"/exports/part%2520%232.csv\",\n \"interpolatedPath\": \"/exports/part \",\n \"interpolatedHash\": \"#2.csv\"\n}\n"}},{"metadata":{"id":"filehandle-readfile-current-position","title":"FileHandle.readFile() starts at the current file position","summary":"Reading a header with a FileHandle can advance its cursor, leaving readFile() to return only the remaining bytes.","category":"filesystem-and-paths","references":[{"title":"Node.js: FileHandle.read()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlereadbuffer-offset-length-position","kind":"documentation"},{"title":"Node.js: FileHandle.readFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlereadfileoptions","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a regular, seekable file. The reproducer opens independent handles for the two read modes."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Byte length of the fixed-width signature at the start of the file."},{"id":"file","file":"records.txt","format":"text","role":"input","description":"ASCII signature EVT1 followed by a line feed and two records. The file ends with a line feed."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Header bytes and the text returned by readFile() after sequential and explicitly positioned reads."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"41ffb0a6eb7ec713ee4774fc6554612118e8e64a71fdfcb9f8c7223f4366276e"}}},"markdown":"# FileHandle.readFile() starts at the current file position\n\nAfter reading the four-byte `EVT1` signature using a file handle,\n`handle.readFile()` can return only the bytes following the signature.\nA read with `position: null` uses and advances the handle’s current\nposition. An explicit numeric position reads without moving that cursor.\n\n## Observed behaviour\n\nReading the same signature at position `null` and at position `0` returned\nthe same four bytes from two fresh handles. The next `readFile()` started\nafter the signature in the first case and at the start of the file in the\nsecond.\n\n## Application considerations\n\nWhen sniffing a file format before sending the whole file to a parser, use\na positioned header read or reopen the file. A sequential read is useful\nwhen the parser expects only the remaining bytes.\n","fixtureContents":{"input":"{\n \"headerBytes\": 4\n}\n","file":"EVT1\naccepted\nqueued\n","expected":"{\n \"header\": \"EVT1\",\n \"afterSequentialRead\": \"\\naccepted\\nqueued\\n\",\n \"afterPositionedRead\": \"EVT1\\naccepted\\nqueued\\n\"\n}\n"}},{"metadata":{"id":"filehandle-writefile-leaves-tail","title":"FileHandle.writeFile() can leave bytes from a longer file","summary":"Writing a shorter document to an existing r+ handle leaves a stale suffix. Opening the pathname with the default w flag truncates it.","category":"filesystem-and-paths","relatedCases":["filehandle-readfile-current-position"],"references":[{"title":"Node.js: FileHandle.writeFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlewritefiledata-options","kind":"documentation"},{"title":"Node.js: File system flags r+ and w","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#file-system-flags","kind":"documentation"},{"title":"Node.js issue #22554: writeFile on an existing descriptor","url":"https://github.com/nodejs/node/issues/22554","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a fresh r+ handle at byte zero and two ASCII JSON strings without final newlines."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Old and replacement JSON text, with a shorter replacement."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Byte-for-byte contents after writing through the existing handle."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"e49c357f3c82c806185f5bd7257a63c1ca9ca333ee0a3d69e78d7960963db33b"}}},"markdown":"# FileHandle.writeFile() can leave bytes from a longer file\n\nWriting `{\"state\":\"ok\"}` to an existing handle opened with `r+` can leave bytes\nfrom `{\"state\":\"previous\"}` at the end of the file. The handle writes the\nsupplied bytes from its cursor. Calling `fs.writeFile()` on a pathname opens\nwith `w` by default to truncate the file before writing.\n\n## Observed behaviour\n\nThe handle overwrote the prefix and left a suffix. `JSON.parse()` rejected the\nresulting document. Writing the same replacement through the pathname’s default\n`w` open produced valid JSON.\n\n## Application considerations\n\nUse a pathname write or explicitly truncate when replacing complete content.\nChoose a separate temporary-file and rename workflow if readers require atomic\nreplacement.\n","fixtureContents":{"input":"{\n \"older\": \"{\\\"state\\\":\\\"previous\\\"}\",\n \"replacement\": \"{\\\"state\\\":\\\"ok\\\"}\"\n}\n","expected":"{\n \"leftover\": \"{\\\"state\\\":\\\"ok\\\"}ious\\\"}\"\n}\n"}},{"metadata":{"id":"float32-nodata-sentinel-rounding","title":"A Float32 no-data sentinel can differ from its JSON number","summary":"A binary32 raster sample rounds the configured no-data value. Compare using the sample precision before filtering invalid measurements.","category":"data-formats","relatedCases":["pcap-header-byte-order"],"references":[{"title":"ECMAScript: Math.fround and Float32 rounding","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-math.fround","kind":"specification"},{"title":"ECMAScript: DataView.prototype.getFloat32","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-dataview.prototype.getfloat32","kind":"specification"},{"title":"GDAL RFC 15: raster no-data and masks","url":"https://gdal.org/en/stable/development/rfc/rfc15_nodatabitmask.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixture is a synthetic band payload with four little-endian float32 samples. It has no enclosing raster container."},"fixtures":[{"id":"sample-band","file":"samples.bin","format":"binary","role":"input","description":"Four little-endian binary32 values from a synthetic raster band. The second is the no-data value."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Decimal JSON metadata declaring the binary32 no-data sentinel."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The decoded band and the valid samples after removing no-data."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ab8f8ed95c06111482e90ac8cb5ec5133a27a721c56aae21f0c732fc14990935"}}},"markdown":"# A Float32 no-data sentinel can differ from its JSON number\n\nThe metadata number `-3.4028235e38` and a binary32 raster sample stored from\nthat number can compare unequal. JSON parsing delivers a double-precision\nJavaScript Number. The sample has been rounded to the nearest binary32 value.\n\n## Observed behaviour\n\nReading the four samples with `DataView.getFloat32()` and filtering by exact\nequality with the JSON number kept the no-data pixel. Applying `Math.fround()`\nto the metadata before filtering matched the stored sentinel and excluded it.\n\n## Application considerations\n\nCompare no-data values in the precision of the declared sample format, or\nconsume the format’s validity mask when provided. This fixture supplies raw band\nbytes alongside the metadata.\n","fixtureContents":{"sample-band":"AACgP///f/8AgADDAAAAAA==","input":"{\n \"noData\": -3.4028235e+38\n}\n","expected":"{\n \"samples\": [\n 1.25,\n -3.4028234663852886e+38,\n -128.5,\n 0\n ],\n \"valid\": [\n 1.25,\n -128.5,\n 0\n ]\n}\n"}},{"metadata":{"id":"form-query-repeated-keys","title":"URLSearchParams.get() returns the first repeated value","summary":"Use URLSearchParams.getAll() to read duplicate query parameters in the order they appeared.","category":"web-platform","references":[{"title":"WHATWG URL Standard — application/x-www-form-urlencoded parsing","url":"https://url.spec.whatwg.org/#urlencoded-parsing","kind":"specification"},{"title":"WHATWG URL Standard: URLSearchParams.get","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-get","kind":"specification"},{"title":"WHATWG URL Standard — URLSearchParams.getAll","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-getall","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"raw-query","file":"query.txt","format":"text","role":"input","description":"Raw query with repeated tags, bare and encoded plus signs, and two kinds of empty field. Pass the bytes as UTF-8 text directly to URLSearchParams."},{"id":"decoded-query","file":"expected.json","format":"json","role":"expected","description":"Decoded entries in encounter order and all values for the tag key."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"fdcb0b57718088a5bf258972f7b33c7e4fae9e5845f60fcd579d09a034ace5d3"}}},"markdown":"# URLSearchParams.get() returns the first repeated value\n\nFor `tag=tea&tag=coffee`, `URLSearchParams.get(\"tag\")` returns `\"tea\"`.\n`getAll(\"tag\")` returns both values in input order. Form query parsing keeps one\nentry per pair, even when several pairs share a name.\n\n## Observed behaviour\n\nIn Node, `getAll(\"tag\")` returned `[\"red tea\", \"red+tea\", \"green\"]` for the\nfixture and `get(\"tag\")` returned `\"red tea\"`. The fixture also distinguishes\nthree form decoding details.\n\n- A bare plus becomes a space. The parser decodes `red+tea` as `red tea` and\n `red%2Btea` as `red+tea`.\n- A bare field (`flag`) and an explicitly empty field (`empty=`) both yield\n `\"\"`.\n- An absent name yields `null` from `get()`.\n\n## Application considerations\n\nUse `getAll()` when repeated fields represent a list. For a field that should\noccur once, decide whether to reject duplicates or select one before converting\nthe query into a single-value record.\n","fixtureContents":{"raw-query":"tag=red+tea&tag=red%2Btea&flag&empty=&tag=green","decoded-query":"{\n \"entries\": [\n [\"tag\", \"red tea\"],\n [\"tag\", \"red+tea\"],\n [\"flag\", \"\"],\n [\"empty\", \"\"],\n [\"tag\", \"green\"]\n ],\n \"tags\": [\"red tea\", \"red+tea\", \"green\"]\n}\n"}},{"metadata":{"id":"formdata-blob-filename","title":"FormData gives an unnamed Blob the filename blob","summary":"Appending a bare Blob creates a multipart file part named blob. Pass a filename explicitly when the receiving service uses it.","category":"web-platform","references":[{"title":"XMLHttpRequest Standard: FormData.append()","url":"https://xhr.spec.whatwg.org/#dom-formdata-append","kind":"specification"},{"title":"HTML Standard: creating a form entry","url":"https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry","kind":"specification"},{"title":"RFC 7578: Content-Disposition and filenames","url":"https://www.rfc-editor.org/rfc/rfc7578.html#section-4.2","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Tests Node’s Request multipart serialisation and parsing. The generated boundary is intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"CSV content, media type, multipart field and explicit filename. Both variants send the same bytes."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The filename that appears in each file part and its Content-Disposition header."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"fd0f85e98c4aaea39046cc724fc28a7023461c79ce792a1fd64c5db056e6cb0b"}}},"markdown":"# FormData gives an unnamed Blob the filename blob\n\nAppending a bare `Blob` to `FormData` creates a file entry with the\ndefault filename `blob`. The form entry algorithm converts the Blob to a\nFile and uses the optional third argument to override that name. A generated\nCSV can therefore reach a service with the right bytes and an unexpected\nfilename.\n\n## Observed behaviour\n\nNode serialised `filename=\"blob\"` without a third argument and\n`filename=\"daily.csv\"` with one. Parsing those multipart requests reproduced\nthe same CSV data and media type, with the corresponding filenames.\n\n## Application considerations\n\nSupply a filename for generated uploads when the receiver uses the name\nfor display, routing or extension checks. Test the multipart part’s\ndisposition separately from its content and media type.\n","fixtureContents":{"input":"{\n \"field\": \"attachment\",\n \"name\": \"daily.csv\",\n \"type\": \"text/csv\",\n \"text\": \"queue,count\\npending,2\\n\"\n}\n","expected":"{\n \"defaultName\": \"blob\",\n \"explicitName\": \"daily.csv\",\n \"defaultDisposition\": \"Content-Disposition: form-data; name=\\\"attachment\\\"; filename=\\\"blob\\\"\",\n \"explicitDisposition\": \"Content-Disposition: form-data; name=\\\"attachment\\\"; filename=\\\"daily.csv\\\"\"\n}\n"}},{"metadata":{"id":"fs-exclusive-create-competing-writes","title":"The wx flag lets one writer create a shared destination","summary":"Competing writes with the wx flag cannot both win. One creates the file and the other fails with EEXIST without overwriting it.","category":"filesystem-and-paths","references":[{"title":"Node.js: File system flags w and wx","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#file-system-flags","kind":"documentation"},{"title":"POSIX open(): O_CREAT and O_EXCL","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses two concurrent writes to a new path on a local temporary filesystem. The winner is intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two different candidate contents for one output file."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Counts and error code for losing a create race."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b31dacb05858fd10b55e80e63d2010816915ef3e0aad0c5c0750202f0bf0683b"}}},"markdown":"# The wx flag lets one writer create a shared destination\n\nTwo jobs can both see that `claimed.txt` is absent before either writes. Opening\nwith `wx` makes the existence check part of creating the file. A competing\nwriter receives `EEXIST`.\n\n## Observed behaviour\n\nIn the concurrent write test one job fulfilled and one rejected. The file\ncontained the complete contents supplied by the winner. Either job could win.\n\n## Application considerations\n\nUse an exclusive create for a destination that should be claimed once. Treat a\ncreate conflict as an expected outcome. This fixture covers a local filesystem,\nwhere the exclusive flag is meaningful.\n","fixtureContents":{"input":"{\n \"name\": \"claimed.txt\",\n \"writers\": [\n \"slot=worker-a\\n\",\n \"slot=worker-b\\n\"\n ]\n}\n","expected":"{\n \"winners\": 1,\n \"loserCode\": \"EEXIST\"\n}\n"}},{"metadata":{"id":"gzip-concatenated-members","title":"A gzip file can contain more than one compressed member","summary":"Concatenated gzip members form a valid gzip file. A decompressor that stops at the first member can silently omit later log batches.","category":"data-formats","references":[{"title":"RFC 1952: gzip file and member layout","url":"https://www.rfc-editor.org/rfc/rfc1952.html#section-2.2","kind":"specification"},{"title":"Node.js: zlib.Gunzip and concatenated members","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/zlib.html#class-zlibgunzip","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"first-member","file":"first-member.bin","format":"binary","role":"input","description":"A valid single gzip member containing the first line of a synthetic log. The decompressed line ends with LF."},{"id":"combined-members","file":"combined-members.bin","format":"binary","role":"input","description":"A complete gzip file made by appending an independently compressed second log line to first-member.bin. Pass the full byte sequence to a gzip decoder."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The exact text of both decompressed members, including trailing line feeds."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ba6c0f5f07e3606aba1640debeb7c8185c47cce509d1a5fdf2b7a1b803f42ddf"}}},"markdown":"# A gzip file can contain more than one compressed member\n\nAppending one complete gzip file to another creates a valid file with two\ngzip members. RFC 1952 places members directly one after another. A tool\nthat reads one member can report success and omit the second log batch.\n\n## Observed behaviour\n\nNode’s `gunzipSync()` returned both lines from the combined file. The first\nmember alone returned only the first line. The bytes after that first member\nalso decompressed independently to the second line.\n\n## Application considerations\n\nWhen importing logs or exports assembled from separately compressed batches,\ntest that the reader advances through all members. Use the combined fixture\nas an entire gzip file. Its `.bin` suffix is a corpus convention.\n","fixtureContents":{"first-member":"H4sIAAAAAAAC/zMyMDLRNTDVNTAKMTCwMjCIUkhKLEnO0E3kAgCjb7khGgAAAA==","combined-members":"H4sIAAAAAAAC/zMyMDLRNTDVNTAKMTCwMjCIUkhKLEnO0E3kAgCjb7khGgAAAB+LCAAAAAAAAv8zMjAy0TUw1TUwCjEwtDIwiFJISixJztBN4gIAFt2blxoAAAA=","expected":"{\n \"firstLine\": \"2024-05-02T00:00Z batch-a\\n\",\n \"secondLine\": \"2024-05-02T01:00Z batch-b\\n\"\n}\n"}},{"metadata":{"id":"hard-link-shares-in-place-writes","title":"A hard-linked file sees in-place writes through its other name","summary":"fs.link() creates another name for the same file. Editing one name changes the contents read through the other, while a byte copy keeps its original contents.","category":"filesystem-and-paths","references":[{"title":"Node.js: fs.link()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fslinkexistingpath-newpath-callback","kind":"documentation"},{"title":"POSIX link(): creating a new link to an existing file","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/link.html","kind":"specification"},{"title":"Node.js: fs.copyFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fscopyfilesrc-dest-mode-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires a temporary filesystem that supports hard links to regular files. The source and links are created on the same volume."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Names for a working file, hard link and independent copy, with the contents before and after editing."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"dfc28abd69a50b1bf83ba89bbf47fe980410c6dfafa8fcdd991dc3ddb7df53f0"}}},"markdown":"# A hard-linked file sees in-place writes through its other name\n\nAfter `fs.link()` creates a second name for a file, both names can read newly\nwritten bytes. A hard link points to the same file, so it behaves differently\nfrom a copy made for an archive.\n\n## Observed behaviour\n\nA write through the original pathname changed the contents returned from the\nhard link. A separate file made with `copyFileSync()` still returned the old\nline. The write updated the original file in place.\n\n## Application considerations\n\nUse an independent copy if a backup must preserve the previous bytes. Hard links\ncan share storage safely when some other rule makes the original content\nimmutable.\n","fixtureContents":{"input":"{\n \"source\": \"working.txt\",\n \"hardLink\": \"pinned.txt\",\n \"copy\": \"snapshot.txt\",\n \"before\": \"invoice=waiting\\n\",\n \"after\": \"invoice=done\\n\"\n}\n"}},{"metadata":{"id":"intl-default-calendar-changes-year","title":"Intl.DateTimeFormat can display year 2567 for a 2024 instant","summary":"Thai locale data selects the Buddhist calendar by default. An explicit Gregorian calendar produces a different year for the same UTC instant.","category":"dates-and-times","relatedCases":["intl-hour-cycle-midnight"],"references":[{"title":"ECMA-402: DateTimeFormat construction and calendar selection","url":"https://tc39.es/ecma402/#sec-intl.datetimeformat","kind":"specification"},{"title":"Unicode CLDR 49: supplemental calendar preferences by territory","url":"https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/supplemental/supplementalData.xml","kind":"source-data"},{"title":"Unicode LDML: calendar types and calendar preference data","url":"https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses ICU 79.1 and CLDR 49.0 in the recorded run with Thai locale data and explicit Latin digits."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An instant in 2024, a Thai locale and a Gregorian override."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Resolved calendar identifiers and rendered year fields."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b1b988f20aaf4d41f32ace8803ae11bfc0e3730db275bda71b86bbdc0fa14214"}}},"markdown":"# Intl.DateTimeFormat can display year 2567 for a 2024 instant\n\nThe Thai locale can display Gregorian year `2024` as Buddhist year `2567`.\n`Intl.DateTimeFormat` chooses a calendar from locale data unless the caller\nprovides a calendar option.\n\n## Observed behaviour\n\nFor the same UTC instant, Node resolved the Thai formatter’s default to\n`buddhist`. Selecting `gregory` produced `2024`. The test reads the year field\nand selects Latin digits so typography and era suffixes play no role.\n\n## Application considerations\n\nLocalise years for display. If a component expects Gregorian fields, set the\ncalendar explicitly and pass a machine timestamp through persistence and API\nboundaries.\n","fixtureContents":{"input":"{\n \"instant\": \"2024-01-01T00:00:00Z\",\n \"locale\": \"th-TH\",\n \"override\": \"gregory\"\n}\n","expected":"{\n \"localeDefault\": {\n \"calendar\": \"buddhist\",\n \"year\": \"2567\"\n },\n \"gregorian\": {\n \"calendar\": \"gregory\",\n \"year\": \"2024\"\n }\n}\n"}},{"metadata":{"id":"intl-hour-cycle-midnight","title":"Intl.DateTimeFormat can display 00:30 as 24:30","summary":"The h24 hour cycle labels the zero hour as 24. h23 formats the same instant with hour 00.","category":"dates-and-times","references":[{"title":"ECMA-402: FormatDateTimePattern hour field","url":"https://tc39.es/ecma402/#sec-formatdatetimepattern","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses en-GB with explicit UTC, hour cycles and Latin numerals. Observed with ICU 79.1 and CLDR 49.0."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A half hour after midnight and a midday control, both in UTC."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Hour and minute field values for each cycle, independent of punctuation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"dd85bc767b85ef2829cbfbfe15d1a9e658903744a45f802d857bda03a6a1031f"}}},"markdown":"# Intl.DateTimeFormat can display 00:30 as 24:30\n\nThe instant `2024-01-01T00:30:00Z` can display with an hour field of `24`.\nECMA-402’s `h24` cycle numbers hours from 1 through 24. Its `h23` cycle uses 0\nthrough 23.\n\n## Observed behaviour\n\nIn Node’s locale data, both cycles produced minute `30`. The midnight hour\ndiffered and the midday hour stayed `12`. The assertions read `formatToParts()`\nfields so locale punctuation plays no role.\n\n## Application considerations\n\nSet `hourCycle: \"h23\"` when a 24-hour display contract expects `00` at midnight.\nUse a machine timestamp to exchange instants, since a formatted display can use\nconventions that a parser rejects.\n","fixtureContents":{"input":"{\n \"midnight\": \"2024-01-01T00:30:00Z\",\n \"midday\": \"2024-01-01T12:30:00Z\",\n \"locale\": \"en-GB\"\n}\n","expected":"{\n \"h23\": [\n [\n \"00\",\n \"30\"\n ],\n [\n \"12\",\n \"30\"\n ]\n ],\n \"h24\": [\n [\n \"24\",\n \"30\"\n ],\n [\n \"12\",\n \"30\"\n ]\n ]\n}\n"}},{"metadata":{"id":"json-duplicate-keys","title":"JSON.parse() keeps the last value for duplicate keys","summary":"When a JSON object repeats a property name, JavaScript overwrites the earlier value during parsing.","category":"data-formats","relatedCases":["json-integer-precision"],"references":[{"title":"ECMAScript 2026: JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"},{"title":"RFC 8259 §4: JSON objects and duplicate names","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-4","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Other JSON parsers may reject duplicates or report them differently."},"fixtures":[{"id":"repeated-property","file":"input.json","format":"json","role":"input","description":"Raw JSON containing two quantity properties in encounter order."},{"id":"parsed-object","file":"expected.json","format":"json","role":"expected","description":"The order line after JavaScript retained the final quantity."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5cca9331fcc55abd4c16e6584a3beef13258120624829cea5811230dac1f213c"}}},"markdown":"# JSON.parse() keeps the last value for duplicate keys\n\n`JSON.parse('{\"quantity\":1,\"quantity\":3}')` returns an object with\n`quantity: 3`. ECMAScript gives later values precedence when a JSON object\nrepeats a property name. RFC 8259 recommends unique names for interoperability.\nDifferent parsers can handle duplicates differently.\n\n## Observed behaviour\n\nNode kept the final quantity from the raw JSON fixture. Its reviver saw\nonly the surviving value, so it could not identify the two occurrences.\nCopy the input as raw text. Parsing it and writing it back removes the\nduplicate that makes the fixture useful.\n\n## Application considerations\n\nWhen duplicate keys are invalid for an import or an API, check the original\npayload with a parser that can detect them. Validation of the object returned\nby `JSON.parse()` only sees the surviving property.\n","fixtureContents":{"repeated-property":"{\n \"sku\": \"tea-01\",\n \"quantity\": 1,\n \"quantity\": 3\n}\n","parsed-object":"{\n \"sku\": \"tea-01\",\n \"quantity\": 3\n}\n"}},{"metadata":{"id":"json-integer-precision","title":"JSON.parse can round large integer IDs","summary":"Distinct JSON numbers can become the same JavaScript value outside the safe integer range.","category":"data-formats","references":[{"title":"RFC 8259 §6 — JSON numbers and interoperability","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-6","kind":"specification"},{"title":"ECMAScript 2026 — JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"This observation applies to ECMAScript Number values. Other JSON parsers may preserve larger integers."},"fixtures":[{"id":"number-literals","file":"input.json","format":"json","role":"input","description":"Raw JSON with adjacent large integer literals and a quoted decimal string."},{"id":"parsed-values","file":"expected.json","format":"json","role":"expected","description":"Values produced by JSON.parse with the large unquoted integer rounded."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ca65c795e0fdec3fc5bd67fa8d267306bef540c7c6d05cc2929904a9309520cb"}}},"markdown":"# JSON.parse can round large integer IDs\n\n`JSON.parse(\"9007199254740993\")` returns `9007199254740992`. The result is\nexactly representable as a JavaScript `Number`, but it is outside the safe\ninteger range. RFC 8259 identifies the inclusive range from `−(2^53−1)` to\n`2^53−1` in which binary64 implementations agree exactly on integer values.\n\n## Observed behaviour\n\nIn Node, the unquoted integers `9007199254740992` and `9007199254740993` parsed\nto the same number. The quoted value `\"9007199254740993\"` preserved every digit.\nUse the raw input fixture when testing a parser so it receives the original\nliterals.\n\n## Application considerations\n\nIf identifiers can exceed the safe integer range, agree on decimal strings in\nthe wire format. Converting an already parsed number to a string preserves the\nrounded value. Other JSON parsers may use a number representation that preserves\nlarger integers.\n","fixtureContents":{"number-literals":"{\n \"safe\": 9007199254740991,\n \"rounded\": 9007199254740993,\n \"sameValue\": 9007199254740992,\n \"exact\": \"9007199254740993\"\n}\n","parsed-values":"{\n \"safe\": 9007199254740991,\n \"rounded\": 9007199254740992,\n \"sameValue\": 9007199254740992,\n \"exact\": \"9007199254740993\"\n}\n"}},{"metadata":{"id":"json-merge-patch-replaces-arrays","title":"JSON Merge Patch replaces whole arrays","summary":"SQLite json_patch() merges object members recursively and replaces an entire array when the patch supplies one.","category":"data-formats","relatedCases":["json-stringify-undefined"],"references":[{"title":"RFC 7396: JSON Merge Patch processing","url":"https://www.rfc-editor.org/rfc/rfc7396.html#section-2","kind":"specification"},{"title":"SQLite json_patch()","url":"https://www.sqlite.org/json1.html#jpatch","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses SQLite’s implementation of RFC 7396 through node:sqlite."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A settings document and patch with parallel object and array updates."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The merged object and replacement array."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f75cd33d9e76c79b7344e3adee547bd9c22c37246e16e74595e99ae3d6826414"}}},"markdown":"# JSON Merge Patch replaces whole arrays\n\nA JSON Merge Patch with `\"channels\":[\"push\"]` replaces the complete channel\nlist. A patch with `\"view\":{\"theme\":\"dark\"}` updates the theme while preserving\nother members of that object. RFC 7396 applies recursive merging to object\nmembers and treats arrays as whole values.\n\n## Observed behaviour\n\nSQLite’s `json_patch()` retained the existing density alongside the new theme.\nThe channel list in the result contained only `push`.\n\n## Application considerations\n\nUse merge patch when the caller supplies the desired full array. If a client\nsends only a newly selected channel expecting the update to keep the old ones,\nexpose an operation that appends individual choices.\n","fixtureContents":{"input":"{\n \"original\": {\n \"view\": {\n \"density\": \"compact\",\n \"theme\": \"light\"\n },\n \"channels\": [\n \"email\",\n \"sms\"\n ]\n },\n \"patch\": {\n \"view\": {\n \"theme\": \"dark\"\n },\n \"channels\": [\n \"push\"\n ]\n }\n}\n","expected":"{\n \"view\": {\n \"density\": \"compact\",\n \"theme\": \"dark\"\n },\n \"channels\": [\n \"push\"\n ]\n}\n"}},{"metadata":{"id":"json-reviver-deletes-array-slot","title":"A JSON.parse() reviver can leave a hole in an array","summary":"Returning undefined from the reviver deletes an array property while preserving the length and later indices.","category":"data-formats","relatedCases":["json-stringify-undefined"],"references":[{"title":"ECMAScript: InternalizeJSONProperty","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-internalizejsonproperty","kind":"specification"},{"title":"ECMAScript: Array.prototype.map","url":"https://tc39.es/ecma262/2026/multipage/indexed-collections.html#sec-array.prototype.map","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"queue-json","file":"queue.json","format":"json","role":"input","description":"Raw JSON with an explicit null between two job IDs. Feed the text to JSON.parse() with a reviver."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The preserved length and callback indices for the dense and sparse forms."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5dd4eb1c25bd9abdf4a0f237ea90b8775c1079255a04de2a1dc6494ee6f6876e"}}},"markdown":"# A JSON.parse() reviver can leave a hole in an array\n\nA `JSON.parse()` reviver that returns `undefined` for the middle element of\n`[\"A10\",null,\"A12\"]` deletes the property at index 1. The array keeps its length\nand `A12` stays at index 2. Array methods such as `map()` skip that hole.\n\n## Observed behaviour\n\nBoth arrays had length three. `Object.hasOwn()` found index 1 in the original\nand reported it absent in the revived array. `map()` visited two indices after\nrevival. Serialising the sparse array displayed `null` at the hole again.\n\n## Application considerations\n\nFilter the parsed array explicitly when null placeholders should be removed and\nindices may move. Keep explicit nulls when the three positions belong to fixed\nfields.\n","fixtureContents":{"queue-json":"{\n \"queue\": [\n \"A10\",\n null,\n \"A12\"\n ]\n}\n","expected":"{\n \"length\": 3,\n \"dense\": [\n 0,\n 1,\n 2\n ],\n \"sparse\": [\n 0,\n 2\n ]\n}\n"}},{"metadata":{"id":"json-stringify-undefined","title":"JSON.stringify() omits undefined object properties","summary":"An undefined object property disappears from JSON, while an undefined array entry becomes null.","category":"data-formats","references":[{"title":"ECMAScript 2026: JSON.stringify","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.stringify","kind":"specification"},{"title":"ECMAScript 2026: SerializeJSONObject and SerializeJSONArray","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-serializejsonobject","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"property-and-array-inputs","file":"input.json","format":"json","role":"input","description":"Set the named property to undefined and replace the array placeholder at undefinedIndex with undefined before serialising."},{"id":"serialised-values","file":"expected.json","format":"json","role":"expected","description":"Exact JSON output for an undefined object property, an explicit null and an undefined array entry."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5eb41f9018ddcf10b43e2712f90268a9895f5a081e9aa71357bc4e1e2d1e1760"}}},"markdown":"# JSON.stringify() omits undefined object properties\n\n`JSON.stringify({ nickname: undefined })` produces `{}`.\n`JSON.stringify([undefined])` produces `[null]`. ECMAScript leaves\nundefined properties out of JSON objects and writes `null` at undefined\narray positions, keeping the array’s length and ordering.\n\n## Observed behaviour\n\nNode omitted the object property set to `undefined` and kept the same\nproperty when set to `null`. In the array, the undefined entry came out\nas `null` between the two strings. The input fixture describes where to\ninsert `undefined` in JavaScript because JSON has no `undefined` literal.\n\n## Application considerations\n\nA patch endpoint might treat an omitted property as “leave unchanged” and\n`null` as “clear this value”. Construct the payload to match the endpoint’s\ncontract, and check the serialised request in tests. If an array needs to\ndistinguish two kinds of empty entry, give them distinct JSON representations.\n","fixtureContents":{"property-and-array-inputs":"{\n \"property\": \"nickname\",\n \"array\": [\n \"tea\",\n \"replace me\",\n \"coffee\"\n ],\n \"undefinedIndex\": 1\n}\n","serialised-values":"{\n \"undefinedProperty\": \"{}\",\n \"nullProperty\": \"{\\\"nickname\\\":null}\",\n \"undefinedArrayEntry\": \"[\\\"tea\\\",null,\\\"coffee\\\"]\"\n}\n"}},{"metadata":{"id":"lord-howe-dst-gap","title":"Lord Howe’s DST gap shifts local times by 30 minutes","summary":"Date moves a nonexistent local time from 02:15 to 02:45 during Lord Howe’s daylight-saving transition.","category":"dates-and-times","relatedCases":["date-only-utc","dst-repeated-local-time"],"references":[{"title":"ECMAScript 2026 — UTC conversion at local time transitions","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-utc-t","kind":"specification"},{"title":"IANA time zone database 2026e — Australasia, Lord Howe Island rules","url":"https://data.iana.org/time-zones/tzdb-2026e/australasia","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires Australia/Lord_Howe rules for the October 2024 transition."},"fixtures":[{"id":"transition-times","file":"input.json","format":"json","role":"input","description":"Offsetless local timestamps before, during and after the spring gap."},{"id":"resolved-times","file":"expected.json","format":"json","role":"expected","description":"getTimezoneOffset values (UTC minus local time, in minutes), and the instant and local time resolved from the gap."}],"verification":{"timeZone":"Australia/Lord_Howe","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"87f2a483350c01d748f2ee691b7563f69592324331e15cc759e5f4319fc95db5"}}},"markdown":"# Lord Howe’s DST gap shifts local times by 30 minutes\n\nOn 6 October 2024 in `Australia/Lord_Howe`, an appointment entered at `02:15`\nresolves to `02:45`. At the spring-forward transition, the clock jumped from\n`02:00` to `02:30` as the offset changed from UTC+10:30 to UTC+11:00. For a\nnonexistent local time, the ECMAScript `Date` conversion uses the offset from\nbefore the transition.\n\n## Observed behaviour\n\nWith `Australia/Lord_Howe` selected, Node resolved `2024-10-06T02:15:00` to\n`2024-10-05T15:45:00.000Z`, which displays as `02:45` locally. Only one elapsed\nminute separated `01:59` from `02:30`. The expected fixture records\n`getTimezoneOffset()` in minutes as UTC minus local time, so UTC+10:30 appears\nas `-630`.\n\n## Application considerations\n\nFor appointments entered as local clock times, decide whether to reject a\nskipped time, move it or ask the user to choose. Comparing the requested fields\nwith the resolved instant’s local fields in the same zone exposes the shift.\n","fixtureContents":{"transition-times":"{\n \"beforeGap\": \"2024-10-06T01:59:00\",\n \"inGap\": \"2024-10-06T02:15:00\",\n \"afterGap\": \"2024-10-06T02:30:00\"\n}\n","resolved-times":"{\n \"offsetBeforeInMinutes\": -630,\n \"offsetAfterInMinutes\": -660,\n \"resolvedInstant\": \"2024-10-05T15:45:00.000Z\",\n \"resolvedLocalHour\": 2,\n \"resolvedLocalMinute\": 45\n}\n"}},{"metadata":{"id":"mkdtemp-prefix-needs-separator","title":"mkdtemp() appends to its prefix and can create a sibling","summary":"Passing a directory path as the mkdtemp() prefix creates a sibling whose name starts with that path. A trailing separator makes the result a child.","category":"filesystem-and-paths","references":[{"title":"Node.js fs.mkdtemp() prefix and directory separator","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fsmkdtempprefix-options-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the host platform’s directory separator. Random suffix contents are intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Name of the existing subdirectory to pass with and without a trailing separator."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Whether the generated directory is directly inside the intended directory."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3523d5fe5b8f056d89bb59886f70259c5efa45757dfdb4bc88cdb74d0431ae7d"}}},"markdown":"# mkdtemp() appends to its prefix and can create a sibling\n\nGiven an existing directory named `cache`, `mkdtemp(cachePath)` can create a\nsibling named `cacheRANDOM`. The function appends characters to the supplied\nprefix. Passing `cachePath` followed by the platform separator puts the suffix\ninside `cache`.\n\n## Observed behaviour\n\nIn Node, the bare prefix produced a child of the containing directory whose\nbasename started with `cache`. The prefix ending in a separator produced a\ndirectory directly under `cache`.\n\n## Application considerations\n\nWhen a temporary file or directory belongs inside a managed storage area, test\nits actual parent before relying on cleanup that only covers that area. Use the\nhost separator when constructing the prefix.\n","fixtureContents":{"input":"{\n \"folder\": \"cache\"\n}\n","expected":"{\n \"prefixOnly\": false,\n \"directoryPrefix\": true\n}\n"}},{"metadata":{"id":"multiple-set-cookie-headers","title":"Multiple Set-Cookie headers cannot be split on commas","summary":"An Expires date contains a comma. Headers.getSetCookie() preserves each Set-Cookie field value separately.","category":"web-platform","references":[{"title":"WHATWG Fetch Standard: Headers.getSetCookie()","url":"https://fetch.spec.whatwg.org/#dom-headers-getsetcookie","kind":"specification"},{"title":"WHATWG Fetch Standard: Forbidden response-header names","url":"https://fetch.spec.whatwg.org/#forbidden-response-header-name","kind":"specification"},{"title":"RFC 6265: Set-Cookie examples and syntax","url":"https://www.rfc-editor.org/rfc/rfc6265.html#section-3","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Verified with Node’s Headers. Browser fetch filters Set-Cookie from network responses."},"fixtures":[{"id":"cookie-header-fields","file":"input.json","format":"json","role":"input","description":"Two separate Set-Cookie values. The first has an Expires attribute containing a comma."},{"id":"cookie-header-results","file":"expected.json","format":"json","role":"expected","description":"Results of reading each field value separately and of splitting the combined string on commas."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"45c36cd9f0b35c98e57678714e80c1ec6077d8191b6ed198ed38be0d492540bd"}}},"markdown":"# Multiple Set-Cookie headers cannot be split on commas\n\n`Expires=Wed, 21 Oct 2037 07:28:00 GMT` contains a comma inside a single\n`Set-Cookie` field. Splitting a combined header string on commas breaks that\ndate apart. The Fetch API’s `Headers.getSetCookie()` gives you the\nindividual field values directly.\n\n## Observed behaviour\n\nNode’s `Headers` exposed both complete values via `getSetCookie()`.\nSplitting the string from `get(\"Set-Cookie\")` produced three fragments\ninstead of two values because it split the expiry date.\n\n## Application considerations\n\nWhen forwarding response cookies on the server, append each field value\nseparately. Browser Fetch filters `Set-Cookie` from the response headers\nmade available to page scripts, so these assertions use server-side\n`Headers`.\n","fixtureContents":{"cookie-header-fields":"[\n \"session=example; Expires=Wed, 21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n]\n","cookie-header-results":"{\n \"separateValues\": [\n \"session=example; Expires=Wed, 21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n ],\n \"commaSplit\": [\n \"session=example; Expires=Wed\",\n \"21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n ]\n}\n"}},{"metadata":{"id":"path-join-versus-resolve-root","title":"path.join() and path.resolve() handle a later absolute segment differently","summary":"Node’s POSIX join appends the segment, while resolve starts from a later absolute path and discards earlier segments.","category":"filesystem-and-paths","relatedCases":["windows-drive-relative-path"],"references":[{"title":"Node.js: path.join()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#pathjoinpaths","kind":"documentation"},{"title":"Node.js: path.resolve()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#pathresolvepaths","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses path.posix with explicit absolute bases. The reproducer performs no filesystem operations."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A base directory and otherwise identical destination strings with and without a leading slash."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Results for the absolute and relative arguments."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"95f78dfb2876d39d7ab1d81e6ff1302f2e6edfa3187c9e846342623399a9522e"}}},"markdown":"# path.join() and path.resolve() handle a later absolute segment differently\n\nGiven `/imports/staged` and `/archive/report.csv`, `path.posix.join()` keeps\nboth segments. `path.posix.resolve()` scans from the right and anchors the\nresult at the later absolute path.\n\n## Observed behaviour\n\nNode returned `/imports/staged/archive/report.csv` from `join()` and\n`/archive/report.csv` from `resolve()`. Both APIs kept the base when the\ndestination omitted the leading slash.\n\n## Application considerations\n\nDecide whether a machine-specific absolute setting should override the\napplication’s default directory. Test both forms when refactoring configuration\ncode between the two APIs.\n","fixtureContents":{"input":"{\n \"base\": \"/imports/staged\",\n \"absolute\": \"/archive/report.csv\",\n \"relative\": \"archive/report.csv\"\n}\n","expected":"{\n \"joinAbsolute\": \"/imports/staged/archive/report.csv\",\n \"resolveAbsolute\": \"/archive/report.csv\",\n \"relative\": \"/imports/staged/archive/report.csv\"\n}\n"}},{"metadata":{"id":"pcap-header-byte-order","title":"A classic PCAP header can use either byte order","summary":"Classic PCAP’s opening bytes indicate how to read multibyte header fields. DataView’s default order misreads fields from a little-endian capture.","category":"data-formats","references":[{"title":"libpcap: pcap-savefile file header","url":"https://github.com/the-tcpdump-group/libpcap/blob/master/pcap-savefile.manfile.in","kind":"documentation"},{"title":"IETF PCAP Capture File Format Internet-Draft: File header","url":"https://datatracker.ietf.org/doc/html/draft-ietf-opsawg-pcap-09#section-4","kind":"documentation"},{"title":"ECMAScript: DataView.prototype.getUint32()","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-dataview.prototype.getuint32","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Covers the two microsecond-resolution classic PCAP magic values. The fixtures contain no packets."},"fixtures":[{"id":"big-endian","file":"big-endian.bin","format":"binary","role":"input","description":"Complete empty classic PCAP file with a big-endian, microsecond-resolution header, Ethernet link type and snapshot length 65535."},{"id":"little-endian","file":"little-endian.bin","format":"binary","role":"input","description":"Complete empty classic PCAP file with the same header values in little-endian byte order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The two magic byte patterns interpreted as big-endian, the common decoded header and the misread snapshot length."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"549cfb30c79b08998a42703bb7f95aa30ed02e20c382a38724f4613c12ba378b"}}},"markdown":"# A classic PCAP header can use either byte order\n\nA classic PCAP file can store the snapshot length `65535` as either\n`00 00 FF FF` or `FF FF 00 00`. The capture writer’s byte order determines\nwhich bytes appear. For microsecond-resolution PCAP files, the opening magic\nbytes distinguish the two orders.\n\n## Observed behaviour\n\n`DataView.getUint32()` uses big-endian order when its byte-order argument\nis omitted. Reading the little-endian fixture that way produced\n`4294901760` at the snapshot length field. Passing the order indicated\nby the magic bytes yielded the same version, snapshot length and link\ntype in both fixtures.\n\n## Application considerations\n\nRead the file’s byte order before interpreting lengths or version fields.\nThe two fixtures are complete empty captures with a 24-byte file header.\nReaders that also support nanosecond-resolution PCAP or PCAPNG need\nadditional cases for those formats.\n","fixtureContents":{"big-endian":"obLD1AACAAQAAAAAAAAAAAAA//8AAAAB","little-endian":"1MOyoQIABAAAAAAAAAAAAP//AAABAAAA","expected":"{\n \"bigEndianMagic\": 2712847316,\n \"littleEndianMagicReadAsBigEndian\": 3569595041,\n \"header\": {\n \"major\": 2,\n \"minor\": 4,\n \"snapshotLength\": 65535,\n \"linkType\": 1\n },\n \"wrongSnapshotLength\": 4294901760\n}\n"}},{"metadata":{"id":"pipeline-premature-close-prefix","title":"A stream pipeline can receive bytes and still fail with premature close","summary":"Destroying the source before its normal end makes pipeline() reject with ERR_STREAM_PREMATURE_CLOSE, even after some bytes reached the destination.","category":"runtime-and-concurrency","relatedCases":["writable-backpressure-accepted-chunk"],"references":[{"title":"Node.js: stream.pipeline()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#streampipelinesource-transforms-destination-callback","kind":"documentation"},{"title":"Node.js: ERR_STREAM_PREMATURE_CLOSE","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/errors.html#err_stream_premature_close","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses in-memory PassThrough streams. The test waits for a delivered chunk before ending or destroying the source."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A common prefix sent before clean end or premature destruction."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The pipeline error code when the source closes without ending."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"c80552ec5af4b2719cf8909162d23fc987e506cac862b1e056650c9f75c18b3b"}}},"markdown":"# A stream pipeline can receive bytes and still fail with premature close\n\nA destination can receive `job=import` and then have its stream pipeline fail.\n`pipeline()` checks how the streams complete. A source destroyed before readable\nend can close without finishing its output.\n\n## Observed behaviour\n\nBoth runs delivered the same prefix. The run that called `end()` completed. The\nrun that called `destroy()` without ending rejected with\n`ERR_STREAM_PREMATURE_CLOSE`.\n\n## Application considerations\n\nWait for pipeline completion before treating a partial export or upload as\nfinished. If consumers need atomic visibility, write to a temporary destination\nand publish only after completion.\n","fixtureContents":{"input":"{\n \"prefix\": \"job=import\\n\"\n}\n","expected":"{\n \"earlyClose\": \"ERR_STREAM_PREMATURE_CLOSE\"\n}\n"}},{"metadata":{"id":"promise-all-rejection-side-effects","title":"Promise.all() can reject before another task writes","summary":"A rejected input settles the aggregate promise while sibling operations continue. Their writes can happen after the caller starts handling the error.","category":"runtime-and-concurrency","references":[{"title":"ECMAScript: PerformPromiseAll","url":"https://tc39.es/ecma262/2026/multipage/control-abstraction-objects.html#sec-performpromiseall","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A pending audit record and the error message for the independent operation."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The append-only audit log at aggregate rejection and after the pending operation is explicitly released."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"1334ff4648f0653be23dd2a372eedff4eaafa874a25c269f5f255891d430dbaa"}}},"markdown":"# Promise.all() can reject before another task writes\n\nWhen one operation in `Promise.all()` rejects, the caller can handle that\nfailure before another operation completes its write. ECMAScript uses the\naggregate promise’s reject function for each input rejection. This settles\nthe aggregate without stopping work that other inputs represent.\n\n## Observed behaviour\n\nOne input failed while the audit write was waiting on an explicitly\ncontrolled promise. The audit log was empty when the aggregate rejected.\nAfter releasing the write, the record appeared. The fixture uses no timers\nor external storage.\n\n## Application considerations\n\nIf the error handler retries or cleans up shared resources, account for\noperations from the first attempt that may still be running. Wait for every\noperation when cleanup requires them to finish. If they support cancellation,\nsignal it explicitly and still account for writes that already completed.\n","fixtureContents":{"input":"{\n \"record\": \"audit:export-requested\",\n \"failure\": \"Destination unavailable\"\n}\n","expected":"{\n \"atRejection\": [],\n \"afterPendingWrite\": [\n \"audit:export-requested\"\n ]\n}\n"}},{"metadata":{"id":"raw-deflate-versus-zlib-wrapper","title":"Raw DEFLATE and zlib-wrapped DEFLATE need different decoders","summary":"inflateRawSync() reads raw DEFLATE blocks. inflateSync() expects the zlib header and checksum around those blocks.","category":"data-formats","relatedCases":["gzip-concatenated-members"],"references":[{"title":"RFC 1950: zlib format","url":"https://www.rfc-editor.org/rfc/rfc1950.html#section-2.2","kind":"specification"},{"title":"RFC 1951: DEFLATE block format","url":"https://www.rfc-editor.org/rfc/rfc1951.html#section-3","kind":"specification"},{"title":"Node.js zlib inflate and inflateRaw","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/zlib.html#convenience-methods","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"raw-deflate","file":"raw.bin","format":"binary","role":"input","description":"Raw DEFLATE blocks for the sample reading. Supply the full bytes to a raw decoder."},{"id":"zlib-wrapped","file":"zlib.bin","format":"binary","role":"input","description":"The same blocks wrapped in zlib framing with its header and Adler-32 trailer."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The exact decoded text, including its line feed."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4f8db068868cacee26ce462a8675e84ce4e7543c2bdf20b0f94393b452dc4a2f"}}},"markdown":"# Raw DEFLATE and zlib-wrapped DEFLATE need different decoders\n\nA raw DEFLATE stream starts with compressed blocks. A zlib stream puts a header\nbefore those blocks and an Adler-32 checksum after them. A format description\nthat only says “deflate” leaves the expected framing unclear.\n\n## Observed behaviour\n\nNode decoded the two fixtures to the same reading using `inflateRawSync()` and\n`inflateSync()` respectively. Trying to inflate raw DEFLATE as a zlib stream\nproduced an incorrect header error. Decoding the wrapped fixture as raw DEFLATE\nalso raised a data error.\n\n## Application considerations\n\nCheck whether the protocol defines zlib framing before selecting a decoder. Keep\nexamples of both forms when testing imports that get data from different\nproducers.\n","fixtureContents":{"raw-deflate":"K0pNTMnMS7c1NNIz5QIA","zlib-wrapped":"eJwrSk1MycxLtzU00jPlAgAgwQPo","expected":"{\n \"reading\": \"reading=12.5\\n\"\n}\n"}},{"metadata":{"id":"read-stream-inclusive-end","title":"createReadStream() treats the end offset as inclusive","summary":"A file stream includes the byte at end. Buffer.subarray() uses an exclusive end, so the same indices select different bytes.","category":"filesystem-and-paths","relatedCases":["buffer-view-byte-range"],"references":[{"title":"Node.js fs.createReadStream() start and end offsets","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fscreatereadstreampath-options","kind":"documentation"},{"title":"Node.js Buffer.subarray() end offset","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufsubarraystart-end","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"letters","file":"letters.txt","format":"text","role":"input","description":"Six ASCII letters followed by LF. All offsets are zero-based."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Two byte ranges including a single byte when start equals end."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The UTF-8 text selected by the stream and by the same offsets in subarray()."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"47ffd8064d0b6e71de900d7c59a9d14250ec19ca3b17e648842d7b962ad102f0"}}},"markdown":"# createReadStream() treats the end offset as inclusive\n\nFor the bytes `ABCDEF`, `createReadStream()` with `start: 2, end: 4` reads\n`CDE`. The file API counts both endpoints, while `Buffer.subarray(2, 4)` stops\nbefore `E`.\n\n## Observed behaviour\n\nNode returned three bytes from the stream and two from the view. The range with\nboth offsets at 4 yielded one byte from the file and an empty view.\n\n## Application considerations\n\nConvert the endpoint when sharing ranges across file streams and slicing APIs.\nInclude a single-byte range in tests so an off-by-one conversion cannot pass\nunnoticed.\n","fixtureContents":{"letters":"ABCDEF\n","input":"[\n {\n \"start\": 2,\n \"end\": 4\n },\n {\n \"start\": 4,\n \"end\": 4\n }\n]\n","expected":"[\n {\n \"file\": \"CDE\",\n \"buffer\": \"CD\"\n },\n {\n \"file\": \"E\",\n \"buffer\": \"\"\n }\n]\n"}},{"metadata":{"id":"readable-stream-tee-cancellation","title":"Cancelling one teed stream leaves its sibling readable","summary":"ReadableStream.tee() keeps the original source alive for the other branch. A branch’s cancel promise can remain pending while the sibling is active.","category":"web-platform","references":[{"title":"WHATWG Streams Standard: ReadableStream.tee()","url":"https://streams.spec.whatwg.org/#rs-tee","kind":"specification"},{"title":"WHATWG Streams Standard: ReadableStreamDefaultTee","url":"https://streams.spec.whatwg.org/#readable-stream-default-tee","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"One queued chunk and two distinct reasons for cancelling the tee’s branches."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Source cancellation calls before and after cancelling both branches, plus the chunk read by the surviving branch."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"db0578ea71c7ba7bf1728d718b19bd3004ea3aae385933ad34378b5e83f689d3"}}},"markdown":"# Cancelling one teed stream leaves its sibling readable\n\nAfter `ReadableStream.tee()` splits a stream, cancelling a preview branch\nleaves the archive branch able to read. The tee keeps its source active\nfor that branch. The first `cancel()` can remain pending until the sibling\ncancels or the source finishes.\n\n## Observed behaviour\n\nThe preview’s cancellation was still pending after the archive read the\nqueued record. The source’s `cancel()` ran once, after the archive also\ncancelled, and received both reasons in branch order. The source remained\nopen during the first cancellation.\n\n## Application considerations\n\nIf the same code owns both branches, start cancellation of the first\nwithout awaiting it before dealing with the second. With separate\nconsumers, make teardown account for a branch that stops reading while\nthe sibling still needs data.\n","fixtureContents":{"input":"{\n \"chunk\": \"record:42\",\n \"reasons\": [\n \"preview closed\",\n \"archive stopped\"\n ]\n}\n","expected":"{\n \"whileSiblingActive\": [],\n \"siblingRead\": {\n \"value\": \"record:42\",\n \"done\": false\n },\n \"sourceCancellations\": [\n [\n \"preview closed\",\n \"archive stopped\"\n ]\n ]\n}\n"}},{"metadata":{"id":"regex-word-boundary-accented-letter","title":"A JavaScript regex word boundary can miss an accented word","summary":"JavaScript’s regex word boundary follows the engine’s word-character rules. A Unicode word segmenter can find café where a whole-word regex misses it.","category":"text-and-encoding","relatedCases":["emoji-grapheme-length"],"references":[{"title":"ECMAScript: IsWordChar and WordCharacters","url":"https://tc39.es/ecma262/2026/multipage/text-processing.html#sec-iswordchar","kind":"specification"},{"title":"Unicode UAX #29: Word boundaries","url":"https://unicode.org/reports/tr29/#Word_Boundaries","kind":"specification"},{"title":"ECMA-402: Intl.Segmenter","url":"https://tc39.es/ecma402/#segmenter-objects","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the u flag without case folding and English word segmentation. Observed with ICU 79.1 and CLDR 49.0."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Sentence with both accented and unaccented café/cafe tokens. The candidate words contain no regex metacharacters."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Regex and locale-segmenter hits in candidate order."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"62d333c7bfaf8fb94c04c2f9c00dc46e8843f6a16861231581906aafc3bd1b54"}}},"markdown":"# A JavaScript regex word boundary can miss an accented word\n\nA `\\bcafé\\b` expression can miss `café,` even with the `u` flag. The boundary\nrequires a change between word and non-word characters. In that mode, `é` and\nthe comma both fall outside the regex’s word characters.\n\n## Observed behaviour\n\nThe regex found the unaccented control and missed the accented word.\n`Intl.Segmenter` with word granularity identified both as words in the same\nsentence.\n\n## Application considerations\n\nFor whole-word search in human-readable content, use segmentation suited to the\ntext’s locale. Keep fixtures with punctuation after a non-ASCII letter as well\nas ASCII controls.\n","fixtureContents":{"input":"{\n \"line\": \"Check café, then read cafe.\",\n \"words\": [\n \"café\",\n \"cafe\"\n ],\n \"locale\": \"en\"\n}\n","expected":"{\n \"regex\": [\n false,\n true\n ],\n \"segments\": [\n true,\n true\n ]\n}\n"}},{"metadata":{"id":"relative-url-trailing-slash","title":"new URL() drops the last base segment without a trailing slash","summary":"Resolving a relative endpoint against /api/v1 gives a different path from resolving it against /api/v1/.","category":"web-platform","references":[{"title":"WHATWG URL Standard: URL constructor","url":"https://url.spec.whatwg.org/#dom-url-url","kind":"specification"},{"title":"WHATWG URL Standard: Basic URL parser, relative state","url":"https://url.spec.whatwg.org/#relative-state","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"api-base-urls","file":"input.json","format":"json","role":"input","description":"A relative endpoint and two HTTPS bases that differ only by a trailing slash."},{"id":"resolved-endpoints","file":"expected.json","format":"json","role":"expected","description":"Resolved endpoints with and without the version path segment."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3b8cf78ddff4dffd8e439ab3645cfd5b5cb591497a12dd1c55f0b2226c5e31dc"}}},"markdown":"# new URL() drops the last base segment without a trailing slash\n\n`new URL(\"users\", \"https://example.com/api/v1\")` yields\n`https://example.com/api/users`. When resolving a relative path against\nan HTTPS base, the URL parser removes the last base path segment before\nappending the new path. With a trailing slash, that last segment is empty.\n\n## Observed behaviour\n\nIn Node, resolving `users` kept the `v1` segment only when the base\nended in `/api/v1/`. The fixture differs by one slash and records the\nresulting full URL in each case.\n\n## Application considerations\n\nIf an API client accepts a base URL as a directory prefix, define it\nwith a trailing slash. Test a base that includes a version path so a\nmissing slash cannot silently direct requests to a different endpoint.\n","fixtureContents":{"api-base-urls":"{\n \"endpoint\": \"users\",\n \"baseWithoutSlash\": \"https://example.com/api/v1\",\n \"baseWithSlash\": \"https://example.com/api/v1/\"\n}\n","resolved-endpoints":"{\n \"withoutSlash\": \"https://example.com/api/users\",\n \"withSlash\": \"https://example.com/api/v1/users\"\n}\n"}},{"metadata":{"id":"response-body-lock-versus-disturbed","title":"A locked Response body can be unusable while bodyUsed is false","summary":"getReader() locks the stream without consuming it. Releasing an unread lock lets Response.text() work, but releasing after a read leaves the body disturbed.","category":"web-platform","relatedCases":["readable-stream-tee-cancellation"],"references":[{"title":"WHATWG Fetch: Body mixin and unusable bodies","url":"https://fetch.spec.whatwg.org/#body-mixin","kind":"specification"},{"title":"WHATWG Streams: getReader() and locks","url":"https://streams.spec.whatwg.org/#rs-get-reader","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses locally constructed Node Response objects, one unread and one read through its stream."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"The response text used for both lock and consumption paths."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"bodyUsed before and after reading the stream."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"769a18b9f53b97967e85d751567aa272941da50b1c51cfc491874565fedbb6de"}}},"markdown":"# A locked Response body can be unusable while bodyUsed is false\n\nAcquiring a reader from `response.body` locks the stream. Fetch prohibits body\nconsumption methods while the stream is locked. `bodyUsed` reflects whether the\nstream has been read from or cancelled, which is a separate condition.\n\n## Observed behaviour\n\nNode rejected `text()` with `TypeError` while the unread reader held the lock.\nReleasing that reader let `text()` return the full text. Reading from a second\nresponse and releasing its lock left `bodyUsed` true and `text()` still\nrejected.\n\n## Application considerations\n\nGive one component ownership of reading a response body. Code that borrows a\nreader should release it and communicate whether it consumed bytes, since\nchecking `bodyUsed` alone misses an outstanding lock.\n","fixtureContents":{"input":"{\n \"body\": \"shipment=queued\\n\"\n}\n","expected":"{\n \"lockedUnread\": false,\n \"disturbed\": true\n}\n"}},{"metadata":{"id":"response-json-no-content","title":"Response.json() rejects on a successful 204 response","summary":"HTTP 204 is successful but carries no body, so Response.json() rejects with SyntaxError. A response containing the JSON literal null parses successfully.","category":"web-platform","relatedCases":["fetch-http-error"],"references":[{"title":"RFC 9110: 204 No Content","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.5","kind":"specification"},{"title":"WHATWG Fetch Standard: Body.json()","url":"https://fetch.spec.whatwg.org/#dom-body-json","kind":"specification"},{"title":"WHATWG Fetch issue #113: 204 and json","url":"https://github.com/whatwg/fetch/issues/113","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses locally constructed Response objects to isolate body consumption from transport."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A 204 with no body and a 200 whose body holds the four-character JSON literal null."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Both responses are OK, but only the second parses to JavaScript null."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3cabc00b016e53a17314c520704cbaf19540aa0309ae8778e727ed8642c99631"}}},"markdown":"# Response.json() rejects on a successful 204 response\n\nA successful `204 No Content` response has no content for `response.json()`\nto parse. Fetch applies JSON parsing to an empty byte sequence for an absent\nbody. The JSON literal `null` requires four bytes, so a response carrying\nthat literal parses differently.\n\n## Observed behaviour\n\nNode’s `Response.ok` was true for both fixtures. The `204` had\n`response.body === null` and `json()` rejected with `SyntaxError`.\nThe `200` had a body stream and `json()` resolved to JavaScript `null`.\n\n## Application considerations\n\nIf a DELETE or update endpoint documents `204`, branch on that status\nbefore decoding the response. Preserve errors for malformed bodies on\nstatuses that should carry JSON.\n","fixtureContents":{"input":"{\n \"noContent\": {\n \"status\": 204\n },\n \"jsonNull\": {\n \"status\": 200,\n \"body\": \"null\"\n }\n}\n","expected":"{\n \"ok\": true,\n \"missingBodyValue\": null,\n \"noContentError\": \"SyntaxError\",\n \"parsedJsonValue\": null\n}\n"}},{"metadata":{"id":"rfc3339-sort-different-offsets","title":"RFC 3339 text can sort differently from its instants","summary":"Lexical timestamp sorting can reverse chronological order when UTC offsets differ. Normalising to UTC gives consistent sort keys for the fixture.","category":"dates-and-times","references":[{"title":"RFC 3339: ordering conditions","url":"https://www.rfc-editor.org/rfc/rfc3339.html#section-5.1","kind":"specification"},{"title":"ECMAScript: Date.prototype.toISOString","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.toisostring","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixtures use four-digit years and whole seconds. The normalised keys have a common offset and fractional precision."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two timestamps with different offsets whose displayed hours suggest the opposite order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The lexical order of the inputs and the chronological order of the UTC keys."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0637b1b51fe83fcc6795a8c1e586bc207660be6fe5810a4dcb516075f1f3faaa"}}},"markdown":"# RFC 3339 text can sort differently from its instants\n\n`07:15Z` sorts before `08:45+02:00` as text, even though the latter instant\noccurs 30 minutes earlier. RFC 3339 describes when string ordering works,\nincluding a common offset representation and the same number of fractional\ndigits.\n\n## Observed behaviour\n\nThe original strings sorted in reverse chronological order. Sorting their\n`toISOString()` values put `06:45Z` ahead of `07:15Z` and agreed with comparison\nof the epoch milliseconds.\n\n## Application considerations\n\nFor chronological indexes, use epoch values or normalise to a consistent\ntimestamp format at ingestion. Keep the original text separately when its\nreported offset matters.\n","fixtureContents":{"input":"[\n \"2024-05-01T08:45:00+02:00\",\n \"2024-05-01T07:15:00Z\"\n]\n","expected":"{\n \"lexical\": [\n \"2024-05-01T07:15:00Z\",\n \"2024-05-01T08:45:00+02:00\"\n ],\n \"utc\": [\n \"2024-05-01T06:45:00.000Z\",\n \"2024-05-01T07:15:00.000Z\"\n ]\n}\n"}},{"metadata":{"id":"search-params-reserialisation","title":"URLSearchParams.sort() can reserialise %20 as +","summary":"Sorting a URL’s searchParams can change its query string even when the decoded entries stay the same.","category":"web-platform","relatedCases":["form-query-repeated-keys"],"references":[{"title":"WHATWG URL Standard: URLSearchParams and its encoding rules","url":"https://url.spec.whatwg.org/#urlsearchparams","kind":"specification"},{"title":"WHATWG URL Standard: URLSearchParams.sort()","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-sort","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"encoded-url","file":"input.json","format":"json","role":"input","description":"One URL containing a percent-encoded space in a single search parameter."},{"id":"query-serialisation-results","file":"expected.json","format":"json","role":"expected","description":"The original query, the reserialised URL and the unchanged decoded entry."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"2f76d0bedf8e7162a055a82a6532aa9119e0ed0f4da02e7c7842f2c46d19887a"}}},"markdown":"# URLSearchParams.sort() can reserialise %20 as +\n\nSorting `searchParams` on `https://example.com/search?q=red%20tea`\nchanges the URL to `https://example.com/search?q=red+tea`. The decoded\nvalue is still `\"red tea\"`. `URLSearchParams.sort()` updates its associated\nURL using form serialisation, which writes spaces as `+`.\n\n## Observed behaviour\n\nNode changed `url.search` from `\"?q=red%20tea\"` to `\"?q=red+tea\"`.\nThere was only one parameter, so its position and decoded value stayed\nthe same. The same change appeared in `url.href`.\n\n## Application considerations\n\nIf a cache key depends on the exact URL string, decide whether to keep\nthe original query or use a consistent serialisation at every boundary.\nKeep the original string before changing `searchParams` when you need\nto compare it byte for byte.\n","fixtureContents":{"encoded-url":"{\n \"url\": \"https://example.com/search?q=red%20tea\"\n}\n","query-serialisation-results":"{\n \"before\": \"?q=red%20tea\",\n \"after\": \"?q=red+tea\",\n \"href\": \"https://example.com/search?q=red+tea\",\n \"entries\": [\n [\n \"q\",\n \"red tea\"\n ]\n ]\n}\n"}},{"metadata":{"id":"sqlite-abort-leaves-transaction-open","title":"A SQLite constraint error can leave earlier transaction writes in place","summary":"SQLite’s default ABORT conflict policy rolls back the failing statement and leaves the transaction active with earlier writes.","category":"databases","relatedCases":["sqlite-replace-cascades-delete"],"references":[{"title":"SQLite: ABORT conflict resolution","url":"https://www.sqlite.org/lang_conflict.html","kind":"documentation"},{"title":"SQLite transaction behaviour on errors","url":"https://www.sqlite.org/lang_transaction.html#response_to_errors_within_a_transaction","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Exercises a default UNIQUE conflict in a single explicit transaction using node:sqlite."},"fixtures":[{"id":"batch-setup","file":"setup.txt","format":"text","role":"input","description":"SQLite schema for an import and a row already present before the transaction."},{"id":"conflicting-batch","file":"batch.txt","format":"text","role":"input","description":"One multi-row INSERT. Its second row conflicts with the seeded code."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Rows before the transaction, and visible after the conflicting statement fails."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0fdee9c4a04030c90a1484be4da13609460c234f7b9b7403a8f5c2b0b83368c7"}}},"markdown":"# A SQLite constraint error can leave earlier transaction writes in place\n\nA two-row insert can fail inside a SQLite transaction after a previous insert\nsucceeded. The default `ABORT` policy undoes the failing statement, including\nits earlier rows. The transaction stays open and prior statements remain part of\nit.\n\n## Observed behaviour\n\nThe insert of `prepared` survived a later unique constraint error.\n`batch-first`, from the failing statement, disappeared. An explicit `ROLLBACK`\nthen removed `prepared`.\n\n## Application considerations\n\nOn any failed step in an all-or-nothing import, explicitly roll back the\ntransaction. For recovery that keeps previous work, make the transaction\nboundaries deliberate.\n","fixtureContents":{"batch-setup":"CREATE TABLE jobs (id INTEGER PRIMARY KEY, code TEXT UNIQUE);\nINSERT INTO jobs VALUES (1, 'existing');\n","conflicting-batch":"INSERT INTO jobs VALUES (3, 'batch-first'), (4, 'existing');\n","expected":"{\n \"persisted\": [\n \"existing\"\n ],\n \"afterFailure\": [\n \"existing\",\n \"prepared\"\n ]\n}\n"}},{"metadata":{"id":"sqlite-foreign-keys-per-connection","title":"SQLite foreign key enforcement belongs to each connection","summary":"Two SQLite connections to one database can enforce its foreign keys differently. A connection with enforcement disabled can write an orphan that both can read.","category":"databases","references":[{"title":"SQLite: enabling foreign key support","url":"https://www.sqlite.org/foreignkeys.html#fk_enable","kind":"documentation"},{"title":"SQLite: PRAGMA foreign_key_check","url":"https://www.sqlite.org/pragma.html#pragma_foreign_key_check","kind":"documentation"},{"title":"Node.js: DatabaseSync constructor options","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/sqlite.html#new-databasesyncpath-options","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s built-in SQLite with explicit enableForeignKeyConstraints options, a temporary database file and a runtime that supports foreign keys."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An invoice and a customer ID that has no matching row in setup.txt."},{"id":"schema","file":"setup.txt","format":"text","role":"input","description":"SQLite SQL script creating a customer and an invoice table with a foreign key. Use one database file for both connections."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The connection settings, SQLite’s extended foreign key error code and the persisted violation reported by foreign_key_check."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5cb4d56b0b79126a6b1f34500187c3bb1dd5348feaaa86aab92d5bfeea47e750"}}},"markdown":"# SQLite foreign key enforcement belongs to each connection\n\nTwo connections can open the same SQLite file and disagree about whether\nan invoice may refer to a missing customer. SQLite applies foreign key\nenforcement per connection. A foreign key declaration lives in the shared\nschema, but enforcement settings belong to the writer.\n\n## Observed behaviour\n\nWith enforcement enabled, Node’s SQLite connection rejected an insert\nfor customer `404` with the SQLite foreign key constraint error.\nThe second connection, opened with enforcement disabled, accepted the\nsame insert. The first connection then reported the orphan using\n`PRAGMA foreign_key_check`.\n\n## Application considerations\n\nSet or confirm foreign key enforcement on every connection used by the\napplication, including import tools and migration scripts. Enabling the\nsetting leaves existing rows in place. Use `foreign_key_check` when you\nneed to detect violations already written to a database.\n","fixtureContents":{"input":"{\n \"invoiceId\": 1,\n \"missingCustomerId\": 404\n}\n","schema":"CREATE TABLE customers (id INTEGER PRIMARY KEY);\nCREATE TABLE invoices (\n id INTEGER PRIMARY KEY,\n customer_id INTEGER NOT NULL REFERENCES customers (id)\n);\n\nINSERT INTO customers (id) VALUES (42);\n","expected":"{\n \"checked\": 1,\n \"unchecked\": 0,\n \"errorCode\": 787,\n \"violations\": [\n {\n \"table\": \"invoices\",\n \"rowid\": 1,\n \"parent\": \"customers\",\n \"fkid\": 0\n }\n ]\n}\n"}},{"metadata":{"id":"sqlite-left-join-count-star","title":"COUNT(*) after a LEFT JOIN counts unmatched parent rows","summary":"An empty child join still yields a null-extended row for the parent. COUNT(child.id) excludes it when the child ID is non-nullable.","category":"databases","relatedCases":["sqlite-not-in-null"],"references":[{"title":"SQLite SELECT: LEFT JOIN null-extension","url":"https://www.sqlite.org/lang_select.html#fromclause","kind":"documentation"},{"title":"SQLite: COUNT aggregate","url":"https://www.sqlite.org/lang_aggfunc.html#count","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses SQLite with an explicit non-nullable issue ID."},"fixtures":[{"id":"projects-and-issues","file":"setup.txt","format":"text","role":"input","description":"Runnable SQLite script with one populated project and one project without issues."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Per-project ID, joined row count and non-null issue count."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4e6979ccd902656f8c429eb1406f76746c1f0d927afc7f1c49cd725b979e536c"}}},"markdown":"# COUNT(*) after a LEFT JOIN counts unmatched parent rows\n\nA project with no issues can show a count of one after a `LEFT JOIN`. SQLite\nemits a row containing the project and NULL child columns. `COUNT(*)` counts\nthat row, while `COUNT(issues.id)` excludes its NULL child ID.\n\n## Observed behaviour\n\nThe populated project produced two for both counts. The empty project produced\none joined row and zero issue IDs.\n\n## Application considerations\n\nUse a non-nullable child column for a count of matching children. Keep an empty\nparent in dashboard and report fixtures.\n","fixtureContents":{"projects-and-issues":"CREATE TABLE projects (id TEXT PRIMARY KEY);\nCREATE TABLE issues (id INTEGER PRIMARY KEY, project_id TEXT NOT NULL);\nINSERT INTO projects VALUES ('active'), ('empty');\nINSERT INTO issues VALUES (1, 'active'), (2, 'active');\n","expected":"[\n [\n \"active\",\n 2,\n 2\n ],\n [\n \"empty\",\n 1,\n 0\n ]\n]\n"}},{"metadata":{"id":"sqlite-not-in-null","title":"A NULL in a SQLite NOT IN subquery can hide unmatched rows","summary":"NOT IN evaluates to NULL for an unmatched ID when the right-hand set contains NULL. WHERE then filters out that ID too.","category":"databases","references":[{"title":"SQLite: IN and NOT IN result matrix","url":"https://www.sqlite.org/lang_expr.html#the_in_and_not_in_operators","kind":"documentation"},{"title":"SQLite: WHERE clause filtering","url":"https://www.sqlite.org/lang_select.html#whereclause","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s built-in SQLite with an in-memory database. The left-hand IDs are non-null, and the right-hand column permits NULL."},"fixtures":[{"id":"schema-and-rows","file":"setup.txt","format":"text","role":"input","description":"SQLite SQL script for an in-memory database. It inserts two shipments and a hold list with one known ID and one NULL."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The shipment IDs returned by each anti-join with the NULL entry present or removed."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4f1259e13d9d503c042e150af96dd97ecec2565a438bb6413f7ce47b12657c73"}}},"markdown":"# A NULL in a SQLite NOT IN subquery can hide unmatched rows\n\nA hold list containing shipment `101` and `NULL` can make\n`WHERE id NOT IN (SELECT shipment_id FROM holds)` return no shipments.\nFor shipment `102`, the unknown hold ID makes the comparison unknown.\nSQLite keeps only rows for which the `WHERE` condition is true.\n\n## Observed behaviour\n\nWith the `NULL` present, `NOT IN` returned no rows. `NOT EXISTS`\nwith an equality match returned shipment `102` because no hold row\nmatched that ID. Removing the `NULL` made `NOT IN` return `102` too.\n\n## Application considerations\n\nWhen selecting rows that lack a match, check the nullability of the keys\nreturned by the subquery. If a null hold should match no shipment, an\nexplicit `NOT EXISTS` equality check expresses that policy. The fixture\nassumes non-null shipment IDs.\n","fixtureContents":{"schema-and-rows":"CREATE TABLE shipments (id INTEGER PRIMARY KEY);\nCREATE TABLE holds (shipment_id INTEGER);\n\nINSERT INTO shipments (id) VALUES (101), (102);\nINSERT INTO holds (shipment_id) VALUES (101), (NULL);\n","expected":"{\n \"notInWithNull\": [],\n \"notExistsWithNull\": [\n 102\n ],\n \"notInWithoutNull\": [\n 102\n ]\n}\n"}},{"metadata":{"id":"sqlite-numeric-affinity-leading-zero","title":"SQLite NUMERIC affinity can strip leading zeros from text IDs","summary":"Binding a JavaScript string does not guarantee text storage in a NUMERIC column. The same input in a TEXT column keeps its original digits.","category":"databases","relatedCases":["json-integer-precision"],"references":[{"title":"SQLite: Type affinity and conversion rules","url":"https://www.sqlite.org/datatype3.html#type_affinity","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses ordinary SQLite tables with TEXT and NUMERIC affinity and string bindings."},"fixtures":[{"id":"columns","file":"setup.txt","format":"text","role":"input","description":"SQLite schema with a text identifier and a parallel NUMERIC column."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Two digit-only labels that differ by padding and one alphanumeric control."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Stored values and SQLite storage types for the two affinities."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"8427e932478f4b3bbe90e4af6614b944f7a9fc6949b538103cc1e383972c665f"}}},"markdown":"# SQLite NUMERIC affinity can strip leading zeros from text IDs\n\nBinding `\"000123\"` as a string can still make SQLite store the integer `123`. A\n`NUMERIC` column applies affinity to text that represents a number. A `TEXT`\ncolumn keeps the padded input.\n\n## Observed behaviour\n\nBoth digit-only identifiers produced the same integer in the numeric column. The\nalphanumeric control stayed text in both columns.\n\n## Application considerations\n\nDeclare columns for IDs, postal codes or product codes with `TEXT` affinity when\nthe original spelling carries meaning. Supply padded digits and their unpadded\ncounterpart in import tests.\n","fixtureContents":{"columns":"CREATE TABLE imports (row_id INTEGER PRIMARY KEY, text_id TEXT, numeric_id NUMERIC);\n","input":"{\n \"codes\": [\n \"000123\",\n \"123\",\n \"A123\"\n ]\n}\n","expected":"[\n [\n \"000123\",\n \"text\",\n 123,\n \"integer\"\n ],\n [\n \"123\",\n \"text\",\n 123,\n \"integer\"\n ],\n [\n \"A123\",\n \"text\",\n \"A123\",\n \"text\"\n ]\n]\n"}},{"metadata":{"id":"sqlite-replace-cascades-delete","title":"SQLite INSERT OR REPLACE can delete dependent rows","summary":"On a primary key conflict, SQLite REPLACE deletes the conflicting row before inserting its replacement. An update-style UPSERT preserves its dependent rows.","category":"databases","relatedCases":["sqlite-foreign-keys-per-connection"],"references":[{"title":"SQLite: ON CONFLICT and REPLACE","url":"https://www.sqlite.org/lang_conflict.html","kind":"documentation"},{"title":"SQLite: ON DELETE CASCADE","url":"https://www.sqlite.org/foreignkeys.html#fk_actions","kind":"documentation"},{"title":"SQLite: UPSERT","url":"https://www.sqlite.org/lang_upsert.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses in-memory SQLite with foreign keys explicitly enabled."},"fixtures":[{"id":"account-and-invoice","file":"setup.txt","format":"text","role":"input","description":"Runnable SQLite schema and data. Account 7 has one invoice and ON DELETE CASCADE is part of its foreign key."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Existing account ID and replacement name."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Final account name and invoice IDs for each operation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"42962156f491b3c68b9a581e072a21035e289c40fca335a61bff6a94e5d1a57f"}}},"markdown":"# SQLite INSERT OR REPLACE can delete dependent rows\n\nReplacing account `7` can also delete invoice `51`. On a primary key conflict,\nSQLite’s `INSERT OR REPLACE` deletes the conflicting row and then inserts the\nreplacement. The deletion can trigger `ON DELETE CASCADE`.\n\n## Observed behaviour\n\nStarting each operation from the same schema and rows, both statements changed\nthe account name. `INSERT OR REPLACE` removed its invoice.\n`ON CONFLICT(id) DO UPDATE` changed the account in place and kept the invoice.\n\n## Application considerations\n\nChoose an update-style UPSERT when related rows must survive. Include dependants\nin a regression fixture so tests observe more than the replacement account.\n","fixtureContents":{"account-and-invoice":"CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL);\nCREATE TABLE invoices (id INTEGER PRIMARY KEY, account_id INTEGER REFERENCES accounts(id) ON DELETE CASCADE);\nINSERT INTO accounts VALUES (7, 'Before');\nINSERT INTO invoices VALUES (51, 7);\n","input":"{\n \"id\": 7,\n \"name\": \"After\"\n}\n","expected":"{\n \"replace\": {\n \"name\": \"After\",\n \"invoices\": []\n },\n \"upsert\": {\n \"name\": \"After\",\n \"invoices\": [\n 51\n ]\n }\n}\n"}},{"metadata":{"id":"sqlite-returning-before-after-trigger","title":"SQLite RETURNING reports values before AFTER triggers change them","summary":"UPDATE RETURNING emits values from the top-level statement. A later SELECT can observe additional changes made by an AFTER trigger.","category":"databases","references":[{"title":"SQLite: RETURNING limitations and trigger changes","url":"https://www.sqlite.org/lang_returning.html#limitations_and_caveats","kind":"documentation"},{"title":"SQLite: CREATE TRIGGER","url":"https://www.sqlite.org/lang_createtrigger.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses node:sqlite and an AFTER UPDATE OF trigger that modifies a different column."},"fixtures":[{"id":"revision-trigger","file":"setup.txt","format":"text","role":"input","description":"SQLite schema with an AFTER UPDATE OF title trigger that increments the row’s revision."},{"id":"input","file":"input.json","format":"json","role":"input","description":"The edited title supplied to the update."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Title and revision returned by UPDATE RETURNING and by the subsequent SELECT."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4daffa49a81767f29c9206bb47f82419f5b350bbe5190944f46fed89ca73bce5"}}},"markdown":"# SQLite RETURNING reports values before AFTER triggers change them\n\nAn `UPDATE … RETURNING revision` can return `1` while the row ends the statement\nat revision `2`. SQLite’s RETURNING clause reports values seen by the top-level\nstatement. An `AFTER` trigger can subsequently modify the row.\n\n## Observed behaviour\n\nThe update returned the edited title with the original revision. Selecting the\nsame row afterwards showed the edited title and incremented revision.\n\n## Application considerations\n\nIf a response needs final values affected by triggers, re-read the row after the\nstatement. Use the same transaction when another writer must be prevented from\nchanging the row before the read.\n","fixtureContents":{"revision-trigger":"CREATE TABLE documents (id INTEGER PRIMARY KEY, title TEXT, revision INTEGER);\nINSERT INTO documents VALUES (1, 'Draft', 1);\nCREATE TRIGGER bump_revision AFTER UPDATE OF title ON documents BEGIN\n UPDATE documents SET revision = old.revision + 1 WHERE id = old.id;\nEND;\n","input":"{\n \"title\": \"Published\"\n}\n","expected":"{\n \"returned\": [\n \"Published\",\n 1\n ],\n \"stored\": [\n \"Published\",\n 2\n ]\n}\n"}},{"metadata":{"id":"sqlite-sum-empty-is-null","title":"SQLite SUM returns NULL when a group has no numeric values","summary":"SQLite SUM() returns NULL for zero non-null values, while TOTAL() returns zero and uses floating-point arithmetic.","category":"databases","relatedCases":["sqlite-left-join-count-star"],"references":[{"title":"SQLite: SUM and TOTAL","url":"https://www.sqlite.org/lang_aggfunc.html#sumunc","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses integer cent values and SQLite’s built-in aggregates."},"fixtures":[{"id":"amounts","file":"setup.txt","format":"text","role":"input","description":"SQLite script with a charge, a refund and a pending entry with an unknown amount."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"SUM, TOTAL and non-null count for settled, pending and missing filters."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"bad9046cce1b1f1d2fc72d04f2979cf363788cb87ec7d7163fa535a7a40ba743"}}},"markdown":"# SQLite SUM returns NULL when a group has no numeric values\n\nA charge and its matching refund have a sum of zero. A pending payment with NULL\ncents has no amount to sum. SQLite’s `SUM()` preserves this distinction, and\n`TOTAL()` maps the empty or all-NULL aggregate to zero.\n\n## Observed behaviour\n\nThe settled payments returned zero from both aggregates. The pending filter and\na filter with no rows returned NULL from `SUM()` and zero from `TOTAL()`.\n\n## Application considerations\n\nDecide whether a financial report should display zero or missing data. A count\nof non-null values can preserve the distinction even when display logic\nsubstitutes zero.\n","fixtureContents":{"amounts":"CREATE TABLE payments (kind TEXT, cents INTEGER);\nINSERT INTO payments VALUES ('settled', 200), ('settled', -200), ('pending', NULL);\n","expected":"{\n \"settled\": [\n 0,\n 0,\n 2\n ],\n \"pending\": [\n null,\n 0,\n 0\n ],\n \"missing\": [\n null,\n 0,\n 0\n ]\n}\n"}},{"metadata":{"id":"sqlite-unique-allows-multiple-nulls","title":"SQLite UNIQUE allows multiple NULL values","summary":"A UNIQUE constraint rejects a repeated assigned reference and permits multiple rows whose reference is NULL.","category":"databases","relatedCases":["sqlite-not-in-null"],"references":[{"title":"SQLite: UNIQUE constraints and NULL handling","url":"https://www.sqlite.org/lang_createtable.html#uniqueconst","kind":"documentation"},{"title":"SQLite: NULL handling compared across engines","url":"https://www.sqlite.org/nulls.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Exercises a single nullable reference column in SQLite. Other databases can have different defaults."},"fixtures":[{"id":"queue-schema","file":"setup.txt","format":"text","role":"input","description":"SQLite schema for an outgoing queue with a nullable unique remote reference."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Two jobs without a remote reference and two attempts to use the same assigned reference."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Stored references, in insertion order, and the duplicate constraint code."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"6c62fa8d834aa1f286c20eb50c2c816ed76621fd5c34a93318e70bbfa9d335f9"}}},"markdown":"# SQLite UNIQUE allows multiple NULL values\n\nAn outgoing queue can store multiple jobs with a NULL `remote_ref` under a\n`UNIQUE` constraint. SQLite treats NULLs as distinct for this constraint.\nAssigning the same concrete reference to two rows still raises a uniqueness\nerror.\n\n## Observed behaviour\n\nTwo NULL inserts and the first `msg-12` insert succeeded. The second `msg-12`\nproduced the SQLite unique constraint error. Both pending rows remained in the\ntable.\n\n## Application considerations\n\nUse `NOT NULL` as well when every row must carry a unique value. If pending jobs\nmay lack an assigned reference, SQLite’s default uniqueness semantics can\nsupport that lifecycle.\n","fixtureContents":{"queue-schema":"CREATE TABLE outgoing (id INTEGER PRIMARY KEY, remote_ref TEXT UNIQUE);\n","input":"{\n \"references\": [\n null,\n null,\n \"msg-12\",\n \"msg-12\"\n ]\n}\n","expected":"{\n \"stored\": [\n null,\n null,\n \"msg-12\"\n ],\n \"duplicate\": 2067\n}\n"}},{"metadata":{"id":"sqlite-wal-read-snapshot","title":"A SQLite WAL reader can keep seeing old data after a writer commits","summary":"An open read transaction in SQLite WAL mode sees its original snapshot until it ends. Another connection can commit changes in the meantime.","category":"databases","relatedCases":["sqlite-foreign-keys-per-connection"],"references":[{"title":"SQLite: isolation and WAL snapshot reads","url":"https://www.sqlite.org/isolation.html","kind":"documentation"},{"title":"SQLite: read and write transactions","url":"https://www.sqlite.org/lang_transaction.html#read_transactions_versus_write_transactions","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires a locally writable temporary filesystem that supports SQLite WAL locking and sidecar files."},"fixtures":[{"id":"wal-queue","file":"setup.txt","format":"text","role":"input","description":"SQLite script placing a local file database in WAL mode and inserting one queued job."},{"id":"input","file":"input.json","format":"json","role":"input","description":"The next state committed by the writer."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"State seen by the reader before the commit, during the old snapshot and after it ends."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ab45e1a82242c6cfee2f36b62602527b990a1c4cad81381d80a51390ff16afe0"}}},"markdown":"# A SQLite WAL reader can keep seeing old data after a writer commits\n\nA SQLite connection in a read transaction can still see `queued` after another\nconnection commits `completed` for the same job. WAL mode lets the writer commit\nwhile the reader’s snapshot stays stable.\n\n## Observed behaviour\n\nThe reader established its snapshot with a select, then read the old value again\nafter a separate connection committed. Ending the read transaction let its next\nselect see the new value.\n\n## Application considerations\n\nEnd a long-lived read transaction before a refresh that needs current data.\nKeeping the transaction open is useful for a report that must read several\ntables consistently.\n","fixtureContents":{"wal-queue":"PRAGMA journal_mode=WAL;\nCREATE TABLE jobs (id INTEGER PRIMARY KEY, state TEXT);\nINSERT INTO jobs VALUES (1, 'queued');\n","input":"{\n \"newState\": \"completed\"\n}\n","expected":"[\n \"queued\",\n \"queued\",\n \"completed\"\n]\n"}},{"metadata":{"id":"sqlite-window-default-frame-peers","title":"SQLite’s default window frame groups rows with equal sort keys","summary":"A SUM window ordered by timestamp uses the default RANGE frame and includes its timestamp peers. ROWS with a tie-break produces per-row running totals.","category":"databases","relatedCases":["sqlite-sum-empty-is-null"],"references":[{"title":"SQLite: default frame specification and peers","url":"https://www.sqlite.org/windowfunctions.html#frame_specifications","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses integer timestamps and cents to isolate SQLite’s window-frame semantics."},"fixtures":[{"id":"payments","file":"setup.txt","format":"text","role":"input","description":"SQLite table and payments with two rows sharing a recorded timestamp."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Payment IDs with default-frame and explicitly row-based cumulative totals."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"06d73bc577d47f8f1c650820ee8e5561532aa2b318f9398106192cfc07d3def9"}}},"markdown":"# SQLite’s default window frame groups rows with equal sort keys\n\nTwo payments with timestamp `200` can show the same running total in\n`SUM(cents) OVER (ORDER BY recorded)`. SQLite’s default `RANGE` frame includes\nevery peer with the current sort key.\n\n## Observed behaviour\n\nThe first timestamp-200 row’s default total already included the second payment\nat that timestamp. An explicit `ROWS` frame and a unique secondary key increased\nthe balance once per payment.\n\n## Application considerations\n\nSpecify `ROWS` with a stable tie-break for line-by-line balances. The default\nframe is useful when every row at one timestamp should show a shared total.\n","fixtureContents":{"payments":"CREATE TABLE payments (id INTEGER PRIMARY KEY, recorded INTEGER, cents INTEGER);\nINSERT INTO payments VALUES (1, 100, 10), (2, 200, 20), (3, 200, 5);\n","expected":"[\n [\n 1,\n 10,\n 10\n ],\n [\n 2,\n 35,\n 30\n ],\n [\n 3,\n 35,\n 35\n ]\n]\n"}},{"metadata":{"id":"structured-clone-transfers-buffer","title":"Transferring an ArrayBuffer detaches every source view","summary":"structuredClone() with a transfer list moves the backing buffer. Sibling typed arrays become empty and an existing DataView can no longer read it.","category":"runtime-and-concurrency","relatedCases":["buffer-view-byte-range"],"references":[{"title":"HTML Standard: StructuredSerializeWithTransfer","url":"https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializewithtransfer","kind":"specification"},{"title":"ECMAScript: DataView get operations","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-getviewvalue","kind":"specification"},{"title":"Node.js: transferring TypedArrays and Buffers","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#considerations-when-transferring-typedarrays-and-buffers","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Transfers a dedicated ArrayBuffer with structuredClone(). SharedArrayBuffer and pooled Node Buffers are outside this test."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Bytes for a dedicated ArrayBuffer and the offset of a second view that shares its storage."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The transferred contents, the original sibling contents before transfer and the detached byte length."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"a7565fc0cab3fa62b15bdb6f9705de8b17dc6f61546e1824e285a0c8db2f8bbe"}}},"markdown":"# Transferring an ArrayBuffer detaches every source view\n\nTransferring the backing buffer of one typed array also detaches other views\nof that buffer. The HTML structured clone algorithm distinguishes ordinary\ncopying from ownership transfer. This matters when a worker receives a\nbuffer that the sender was still using to read headers or track progress.\n\n## Observed behaviour\n\nAn ordinary `structuredClone()` left both source views readable. Transferring\nthe same backing buffer delivered all four bytes to the clone. The original\nbuffer and both typed arrays reported zero bytes. An existing `DataView`\nthrew `TypeError` when asked to read the detached storage.\n\n## Application considerations\n\nTransfer a dedicated buffer when the sender is finished with every view of\nit. If the sender or another consumer still needs those bytes, clone or copy\nthe relevant range before transfer. Node applies extra restrictions to some\npooled Buffers.\n","fixtureContents":{"input":"{\n \"bytes\": [\n 24,\n 32,\n 40,\n 48\n ],\n \"siblingStart\": 2\n}\n","expected":"{\n \"receivedBytes\": [\n 24,\n 32,\n 40,\n 48\n ],\n \"siblingBytes\": [\n 40,\n 48\n ],\n \"detachedByteLength\": 0\n}\n"}},{"metadata":{"id":"textencoder-encodeinto-partial-scalar","title":"TextEncoder.encodeInto() stops before splitting a UTF-8 character","summary":"encodeInto() reports UTF-16 code units read and UTF-8 bytes written. A buffer can have spare bytes that cannot fit the next character.","category":"text-and-encoding","relatedCases":["utf8-byte-length"],"references":[{"title":"WHATWG Encoding: TextEncoder.encodeInto()","url":"https://encoding.spec.whatwg.org/#dom-textencoder-encodeinto","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"ASCII prefix and suffix around a surrogate pair, with three destination sizes and a fill byte."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Code units read, bytes written, and full destination bytes after each attempt."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"7316f5453e7bdcc21220e07b728c08f4fbf7e261378a45edbacb7c380dfc72f4"}}},"markdown":"# TextEncoder.encodeInto() stops before splitting a UTF-8 character\n\nEncoding `A💡Z` into four bytes writes only `A`. The next character needs four\nUTF-8 bytes and has three available. `encodeInto()` stops before that character\nand reports one UTF-16 code unit read.\n\n## Observed behaviour\n\nAt capacity five, the encoder consumed `A💡`, a total of three UTF-16 code\nunits, and wrote five bytes. At capacity six it wrote the final `Z` as well. The\nsentinel fill made untouched bytes visible in the four-byte result.\n\n## Application considerations\n\nResume from the reported `read` offset into the JavaScript string and advance\nthe output cursor by `written`. Ensure a refill can fit the next character when\nno input was consumed.\n","fixtureContents":{"input":"{\n \"text\": \"A💡Z\",\n \"capacities\": [\n 4,\n 5,\n 6\n ],\n \"fill\": 255\n}\n","expected":"[\n {\n \"read\": 1,\n \"written\": 1,\n \"bytes\": [\n 65,\n 255,\n 255,\n 255\n ]\n },\n {\n \"read\": 3,\n \"written\": 5,\n \"bytes\": [\n 65,\n 240,\n 159,\n 146,\n 161\n ]\n },\n {\n \"read\": 4,\n \"written\": 6,\n \"bytes\": [\n 65,\n 240,\n 159,\n 146,\n 161,\n 90\n ]\n }\n]\n"}},{"metadata":{"id":"timer-unref-allows-process-exit","title":"An unref() timer alone cannot keep a Node process alive","summary":"A pending setTimeout callback can disappear at process exit after unref(). A referenced timer lets the callback run before exit.","category":"runtime-and-concurrency","references":[{"title":"Node.js: timeout.unref() and the event loop","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/timers.html#timeoutunref","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Spawns the same Node executable with an otherwise idle script. The test checks exit status and output without asserting elapsed time."},"fixtures":[{"id":"child-program","file":"child.txt","format":"text","role":"input","description":"Run via node -e with arguments: ref or unref, delay in milliseconds, and the message to write."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Delay and output for both child runs."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The stdout contents after a clean exit for each timer mode."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"290311bd2d64b80ffb8c3cfeed2291e3ed81d103ebeb3eb0b57475e103173f4a"}}},"markdown":"# An unref() timer alone cannot keep a Node process alive\n\nScheduling a final status flush with `setTimeout()` and calling `unref()` lets\nan otherwise idle Node process exit before the flush runs. The timer is still\nscheduled while other work keeps the event loop alive.\n\n## Observed behaviour\n\nThe child exited successfully with and without `unref()`. Only the referenced\ntimer wrote the status line. The test compares child output and does not rely on\nmeasuring the delay.\n\n## Application considerations\n\nUse unreferenced timers for optional maintenance. Await required flushes or give\nthem another explicit lifetime guarantee before the process exits.\n","fixtureContents":{"child-program":"const mode = process.argv[1];\nconst delay = Number(process.argv[2]);\nconst message = process.argv[3];\nconst timeout = setTimeout(() => process.stdout.write(message), delay);\n\nif (mode === \"unref\") {\n timeout.unref();\n}\n","input":"{\n \"delayMs\": 30,\n \"message\": \"status flush finished\\n\"\n}\n","expected":"{\n \"ref\": \"status flush finished\\n\",\n \"unref\": \"\"\n}\n"}},{"metadata":{"id":"trim-versus-unicode-white-space","title":"String.trim() and Unicode White_Space remove different characters","summary":"ECMAScript trim removes U+FEFF but keeps U+0085. A Unicode White_Space property escape does the reverse for those two characters.","category":"text-and-encoding","relatedCases":["utf8-bom-textdecoder"],"references":[{"title":"ECMAScript: White Space","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-language-lexical-grammar.html#sec-white-space","kind":"specification"},{"title":"ECMAScript: TrimString","url":"https://tc39.es/ecma262/2026/multipage/text-processing.html#sec-trimstring","kind":"specification"},{"title":"Unicode 17.0: PropList White_Space data","url":"https://www.unicode.org/Public/17.0.0/ucd/PropList.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses code points with longstanding property assignments. Test strings are constructed from exported code point numbers."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A short field and the NEL, BOM and NBSP code points to put around it with String.fromCodePoint()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Whether each wrapper disappears with trim() and with the Unicode White_Space property."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f9f3dd5feb00e18f13425f6c689b7fa8c272e5a36eac301277301f2896610640"}}},"markdown":"# String.trim() and Unicode White_Space remove different characters\n\n`String.trim()` retains a NEXT LINE character (NEL, U+0085) at the edge of a\nfield. A regular expression using Unicode’s `White_Space` property removes it.\nFor U+FEFF, the byte order mark (BOM) character in decoded text, the two rules\nreverse.\n\n## Observed behaviour\n\nNode trimmed non-breaking space (NBSP, U+00A0) with both rules. It removed NEL\nonly with `\\p{White_Space}` and removed the BOM only with `trim()`. ECMAScript\ndefines its own whitespace set for string trimming.\n\n## Application considerations\n\nPick the rule specified by the input format. If a record parser and an input\nvalidator apply different definitions of whitespace, test both NEL and the BOM\nrather than assuming they agree.\n","fixtureContents":{"input":"{\n \"field\": \"ready\",\n \"wrappers\": [\n 133,\n 65279,\n 160\n ]\n}\n","expected":"[\n {\n \"trimmed\": false,\n \"unicode\": true\n },\n {\n \"trimmed\": true,\n \"unicode\": false\n },\n {\n \"trimmed\": true,\n \"unicode\": true\n }\n]\n"}},{"metadata":{"id":"truncate-extends-with-zeroes","title":"fs.truncate() can grow a file and fill the new bytes with zeros","summary":"A requested length larger than the current file extends it with readable zero bytes, while a shorter length removes trailing bytes.","category":"filesystem-and-paths","references":[{"title":"Node.js fs.truncate() extends with null bytes","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fstruncatepath-len-callback","kind":"documentation"},{"title":"POSIX truncate(): file length changes","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/truncate.html","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a regular file and checks logical contents. Disk allocation is filesystem-dependent."},"fixtures":[{"id":"packet-prefix","file":"packet.bin","format":"binary","role":"input","description":"Four raw bytes for a synthetic binary record. Copy to a writable file before truncating."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Requested lengths for extending and then shrinking the four-byte sample."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Exact bytes after each file length operation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"87c38185d78c891fab33d9769e72ce3857a8df57e6cd28d3382416e7bf15cb84"}}},"markdown":"# fs.truncate() can grow a file and fill the new bytes with zeros\n\nCalling `truncate()` with length 8 on a four-byte file extends it. The original\nprefix stays in place and reads from the additional bytes yield zeros.\n\n## Observed behaviour\n\nNode returned all four original bytes followed by four zeros. Truncating the\nsame file to length 2 then left only the first two bytes.\n\n## Application considerations\n\nCheck the requested size before using truncate as a cleanup operation for a\npartial binary write. A size that exceeds the amount written can make an\nincomplete record grow to the expected length with zero-filled fields.\n","fixtureContents":{"packet-prefix":"SUQABw==","input":"{\n \"longer\": 8,\n \"shorter\": 2\n}\n","expected":"{\n \"extended\": [\n 73,\n 68,\n 0,\n 7,\n 0,\n 0,\n 0,\n 0\n ],\n \"shortened\": [\n 73,\n 68\n ]\n}\n"}},{"metadata":{"id":"turkish-locale-lowercase","title":"Turkish dotted and dotless I change lowercase matching","summary":"toLocaleLowerCase() with tr maps I and İ differently from JavaScript’s locale-independent toLowerCase().","category":"text-and-encoding","relatedCases":["unicode-normalized-keys"],"references":[{"title":"ECMA-402: String.prototype.toLocaleLowerCase","url":"https://tc39.es/ecma402/#sup-string.prototype.tolocalelowercase","kind":"specification"},{"title":"Unicode Character Database 18.0.0: SpecialCasing","url":"https://www.unicode.org/Public/18.0.0/ucd/SpecialCasing.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses the tr locale explicitly and compares it with locale-independent lowercasing."},"fixtures":[{"id":"dotted-and-dotless-inputs","file":"input.json","format":"json","role":"input","description":"Uppercase I and İ with both lowercase forms for testing text lookup."},{"id":"lowercase-keys","file":"expected.json","format":"json","role":"expected","description":"Expected locale-independent and Turkish lowercase keys in input order."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"78ce5e7795a355a98f2eab5da0d1ccd7ba7af2e36fa14873839be02a5f3d7ef5"}}},"markdown":"# Turkish dotted and dotless I change lowercase matching\n\n`\"I\".toLowerCase()` returns `\"i\"`. With `\"I\".toLocaleLowerCase(\"tr\")`, the\nresult is `\"ı\"`, a dotless i. Turkish casing pairs dotless uppercase `I` with\n`ı` and dotted uppercase `İ` with `i`.\n\n## Observed behaviour\n\nNode’s locale-independent lowercasing mapped `İ` to `\"i\\u0307\"`, an `i` followed\nby a combining dot. With the Turkish locale, `İ` mapped to plain `i`. The\nfixture includes both lowercase forms to show which keys match under each rule.\n\n## Application considerations\n\nIf a lookup in Turkish text should ignore case, apply the same explicit locale\nwhen creating keys and when looking them up. Choose a stable comparison rule for\nmachine identifiers, where changing the user’s locale should usually leave\nexisting keys reachable.\n","fixtureContents":{"dotted-and-dotless-inputs":"[\n \"I\",\n \"İ\",\n \"i\",\n \"ı\"\n]\n","lowercase-keys":"{\n \"localeIndependent\": [\n \"i\",\n \"i̇\",\n \"i\",\n \"ı\"\n ],\n \"turkish\": [\n \"ı\",\n \"i\",\n \"i\",\n \"ı\"\n ]\n}\n"}},{"metadata":{"id":"unicode-normalized-keys","title":"A Map lookup can miss canonically equivalent Unicode keys","summary":"A composed key and a decomposed spelling of café can require NFC normalisation to match in a JavaScript Map.","category":"text-and-encoding","references":[{"title":"Unicode Standard Annex #15 — Normalization Forms","url":"https://www.unicode.org/reports/tr15/#Norm_Forms","kind":"specification"},{"title":"ECMAScript 2026: Map.prototype.get","url":"https://tc39.es/ecma262/2026/multipage/keyed-collections.html#sec-map.prototype.get","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"equivalent-keys","file":"input.json","format":"json","role":"input","description":"Two canonically equivalent spellings and a ligature with a compatibility equivalent."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"06a047242f6c72909c6da11679b4b567bee430a7b34ab82efe76d62eb4d8c513"}}},"markdown":"# A Map lookup can miss canonically equivalent Unicode keys\n\nA `Map` storing `\"caf\\u00e9\"` misses a lookup for `\"cafe\\u0301\"`. Both spellings\ndisplay as `café`. The first uses a single accented letter and the second uses\nan `e` followed by a combining acute accent. Unicode Normalisation Form C (NFC)\ngives both spellings the same representation.\n\n## Observed behaviour\n\nIn Node, the lookup succeeded after applying `normalize(\"NFC\")` to the key at\ninsertion and lookup. The fixture also shows the scope of NFC. It preserves the\ndistinction between the ligature `ffi` and `ffi`. NFKC maps them together.\n\n## Application considerations\n\nIf an index should match canonically equivalent text, apply the same\nnormalisation to writes and lookups. During migration, existing entries can\nconverge on one key, so decide how to handle those collisions.\n","fixtureContents":{"equivalent-keys":"{\n \"storedKey\": \"caf\\u00e9\",\n \"lookupKey\": \"cafe\\u0301\",\n \"value\": \"menu\",\n \"ligature\": \"\\ufb03\",\n \"letters\": \"ffi\"\n}\n"}},{"metadata":{"id":"uri-encoding-lone-surrogate","title":"URI APIs handle a lone UTF-16 surrogate differently","summary":"encodeURIComponent() throws URIError for an unpaired surrogate. URLSearchParams converts the same input to U+FFFD before percent encoding.","category":"text-and-encoding","relatedCases":["utf8-split-sequence"],"references":[{"title":"ECMAScript: Encode (URI)","url":"https://tc39.es/ecma262/2026/multipage/global-object.html#sec-encode","kind":"specification"},{"title":"Web IDL: USVString conversion","url":"https://webidl.spec.whatwg.org/#idl-USVString","kind":"specification"},{"title":"WHATWG URL: URLSearchParams","url":"https://url.spec.whatwg.org/#interface-urlsearchparams","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"UTF-16 code units for a lone high surrogate and a valid surrogate pair. Build the strings with String.fromCharCode()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The original percent-encoded scalar value and the replacement value used by URLSearchParams."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"bc21b3adc9876580d8457ec390d1a71ea0610e054f4ae28290704cf61e477336"}}},"markdown":"# URI APIs handle a lone UTF-16 surrogate differently\n\nA string containing only the UTF-16 code unit `0xD800` has no corresponding\nUnicode scalar value. `encodeURIComponent()` rejects it. The `URLSearchParams`\ninterface uses Web IDL’s `USVString` conversion, which repairs malformed UTF-16\nby substituting the replacement character U+FFFD.\n\n## Observed behaviour\n\nBoth APIs encoded the valid light bulb surrogate pair identically. For the lone\nsurrogate, `encodeURIComponent()` threw `URIError` and `URLSearchParams`\nproduced `q=%EF%BF%BD`.\n\n## Application considerations\n\nChoose whether to reject or repair ill-formed UTF-16 before using text as an\nidentifier or query parameter. A lossy conversion can change a value silently as\nit goes into a URL.\n","fixtureContents":{"input":"{\n \"lone\": [\n 55296\n ],\n \"paired\": [\n 55357,\n 56481\n ]\n}\n","expected":"{\n \"paired\": \"%F0%9F%92%A1\",\n \"replacement\": \"�\",\n \"query\": \"q=%EF%BF%BD\"\n}\n"}},{"metadata":{"id":"url-idna-unicode-hostname","title":"A Unicode HTTPS hostname serialises as ASCII in new URL()","summary":"WHATWG URL parsing applies domain-to-ASCII conversion to HTTPS hosts. A Unicode spelling and its Punycode form can produce the same hostname and origin.","category":"web-platform","references":[{"title":"WHATWG URL: domain to ASCII","url":"https://url.spec.whatwg.org/#concept-domain-to-ascii","kind":"specification"},{"title":"Unicode UTS #46: IDNA Compatibility Processing","url":"https://www.unicode.org/reports/tr46/","kind":"specification"},{"title":"Node.js: URL constructor and domainToUnicode()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#new-urlinput-base","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses HTTPS example domains without network activity. Node’s domainToUnicode() is used for the reverse display conversion."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A Unicode HTTPS URL, its ASCII spelling and a distinct ASCII control."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Canonical ASCII host, canonical URL, origin and decoded display host."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"afb39a5f80e0194cfa0906b6d6f4e1bf2ef6156fd207f4d6e9d412e1d8350682"}}},"markdown":"# A Unicode HTTPS hostname serialises as ASCII in new URL()\n\nParsing `https://BÜCHER.example/catalogue` gives `xn--bcher-kva.example` as the\nhostname. For HTTPS, the WHATWG host parser applies domain-to-ASCII conversion\nbefore serialisation.\n\n## Observed behaviour\n\nNode produced identical canonical URLs and origins for the Unicode input and its\nASCII Punycode spelling. The plain `bucher.example` control remained a different\ndomain. `domainToUnicode()` decoded the canonical hostname for display.\n\n## Application considerations\n\nIf application keys represent parsed URL origins, derive them from `URL.origin`\nconsistently. Preserve the user’s original spelling separately when it matters\nfor display.\n","fixtureContents":{"input":"{\n \"unicode\": \"https://BÜCHER.example/catalogue\",\n \"ascii\": \"https://xn--bcher-kva.example/catalogue\",\n \"distinct\": \"https://bucher.example/catalogue\"\n}\n","expected":"{\n \"host\": \"xn--bcher-kva.example\",\n \"href\": \"https://xn--bcher-kva.example/catalogue\",\n \"origin\": \"https://xn--bcher-kva.example\",\n \"display\": \"bücher.example\"\n}\n"}},{"metadata":{"id":"utf8-bom-textdecoder","title":"TextDecoder strips a leading UTF-8 BOM by default","summary":"Setting ignoreBOM to true retains U+FEFF in decoded text, which can cause JSON.parse() to reject the result.","category":"text-and-encoding","relatedCases":["utf8-split-sequence"],"references":[{"title":"WHATWG Encoding Standard: TextDecoder common algorithms","url":"https://encoding.spec.whatwg.org/#interface-textdecoder","kind":"specification"},{"title":"RFC 8259 §8.1: JSON encoding and the byte order mark","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-8.1","kind":"specification"},{"title":"ECMAScript 2026: JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"json-with-bom","file":"with-bom.bin","format":"binary","role":"input","description":"UTF-8 BOM bytes EF BB BF followed by a JSON object, with no final newline."},{"id":"json-without-bom","file":"without-bom.bin","format":"binary","role":"input","description":"The same JSON bytes without the leading BOM."},{"id":"decoded-object","file":"expected.json","format":"json","role":"expected","description":"The JSON content after decoding without a leading BOM."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b8e9e56d71fcdef94faf4b24d633105468b5473f9066657ce97f1f5616c6403c"}}},"markdown":"# TextDecoder strips a leading UTF-8 BOM by default\n\nWhen the bytes `EF BB BF` precede `{\"total\":1}`, a default UTF-8 `TextDecoder`\nreturns the JSON text without the byte order mark (BOM). The Encoding Standard\nskips the leading mark by default. Setting `ignoreBOM: true` bypasses that\nspecial handling and retains `U+FEFF`.\n\n## Observed behaviour\n\nIn Node, the default decoder produced identical text for both binary fixtures,\nand `JSON.parse()` accepted it. With `ignoreBOM: true`, the fixture with a BOM\ndecoded to a string beginning with `U+FEFF`. `JSON.parse()` rejected that string\nwith an unexpected token error at the leading mark.\n\n## Application considerations\n\nDecide whether an importer accepts a leading BOM. RFC 8259 says JSON sent over a\nnetwork must omit it and permits parsers to ignore it on input. If the original\nbytes matter, for example when comparing checksums, keep them alongside the\ndecoded text.\n","fixtureContents":{"json-with-bom":"77u/eyJ0b3RhbCI6MX0=","json-without-bom":"eyJ0b3RhbCI6MX0=","decoded-object":"{\n \"total\": 1\n}\n"}},{"metadata":{"id":"utf8-byte-length","title":"JavaScript string length can undercount UTF-8 bytes","summary":"Use TextEncoder to measure a UTF-8 byte limit when JavaScript length only counts UTF-16 code units.","category":"text-and-encoding","relatedCases":["emoji-grapheme-length"],"references":[{"title":"ECMAScript 2026: The String type","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type","kind":"specification"},{"title":"WHATWG Encoding Standard: TextEncoder","url":"https://encoding.spec.whatwg.org/#interface-textencoder","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"byte-limit-inputs","file":"input.json","format":"json","role":"input","description":"ASCII, accented, CJK and supplementary characters with a four-byte field budget."},{"id":"length-and-budget-results","file":"expected.json","format":"json","role":"expected","description":"UTF-16 code unit counts, UTF-8 byte counts and whether each value fits."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"d1803c04a639bb4e1b941453dc90a4c6675409419fb4b758116f5ca9b46c86fd"}}},"markdown":"# JavaScript string length can undercount UTF-8 bytes\n\n`\"cafe\"` and `\"café\"` both have JavaScript length `4`. In UTF-8 they\ntake four and five bytes respectively, so only `\"cafe\"` fits into a\nfour-byte field. JavaScript length counts UTF-16 code units.\n`TextEncoder` produces UTF-8 bytes.\n\n## Observed behaviour\n\nIn Node, the accented word exceeded the four-byte budget. The same check\nrejected `\"漢字\"` at six bytes and accepted `\"💡\"` at exactly four bytes,\neven though both have JavaScript length `2`.\n\n## Application considerations\n\nMeasure the bytes at the boundary that enforces the limit. Encode the\nfield itself for a field limit. If the limit applies to a complete JSON\nrequest, measure the serialised body, including its syntax and escaping.\n","fixtureContents":{"byte-limit-inputs":"{\n \"maxBytes\": 4,\n \"values\": [\n \"cafe\",\n \"café\",\n \"漢字\",\n \"💡\"\n ]\n}\n","length-and-budget-results":"[\n {\n \"codeUnits\": 4,\n \"utf8Bytes\": 4,\n \"fits\": true\n },\n {\n \"codeUnits\": 4,\n \"utf8Bytes\": 5,\n \"fits\": false\n },\n {\n \"codeUnits\": 2,\n \"utf8Bytes\": 6,\n \"fits\": false\n },\n {\n \"codeUnits\": 2,\n \"utf8Bytes\": 4,\n \"fits\": true\n }\n]\n"}},{"metadata":{"id":"utf8-split-sequence","title":"TextDecoder can corrupt UTF-8 decoded chunk by chunk","summary":"Streaming keeps a character intact across a byte boundary where separate decodes insert replacement characters.","category":"text-and-encoding","references":[{"title":"WHATWG Encoding Standard — TextDecoder","url":"https://encoding.spec.whatwg.org/#interface-textdecoder","kind":"specification"},{"title":"WHATWG Encoding Standard — UTF-8 decoder","url":"https://encoding.spec.whatwg.org/#utf-8-decoder","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"first-chunk","file":"first-chunk.bin","format":"binary","role":"input","description":"ASCII A followed by the first two bytes of U+1F4A1."},{"id":"second-chunk","file":"second-chunk.bin","format":"binary","role":"input","description":"The final two bytes of U+1F4A1 followed by ASCII B and LF."},{"id":"decoded-strings","file":"expected.json","format":"json","role":"expected","description":"The decoded stream and the strings obtained by decoding each chunk separately."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"97e107dab21bc6a483bc504139e6b0d592af19b218b449d0bce3c90e0ddd935a"}}},"markdown":"# TextDecoder can corrupt UTF-8 decoded chunk by chunk\n\n`TextDecoder` produces replacement characters (`U+FFFD`) when it decodes\n`41 F0 9F` and `92 A1 42 0A` separately. Together the chunks contain valid UTF-8\nfor `A💡B` followed by a line feed. The first chunk ends partway through the\nfour-byte encoding of `💡` and the second starts with its continuation bytes.\n\n## Observed behaviour\n\nIn Node, independent decodes produced `A�` and `��B` followed by a line feed.\nPassing `{ stream: true }` for each chunk on one decoder preserved the\ncharacter. A final empty `decode()` call flushed the decoder. In fatal mode,\nflushing after only the first chunk threw `TypeError`.\n\n## Application considerations\n\nUse one decoder per byte stream and flush it at the end. Choose fatal mode when\nmalformed or truncated input must be rejected. Replacement mode can keep a\ndisplay readable when best-effort decoding is appropriate.\n","fixtureContents":{"first-chunk":"QfCf","second-chunk":"kqFCCg==","decoded-strings":"{\n \"streamed\": \"A💡B\\n\",\n \"independentChunks\": [\"A�\", \"��B\\n\"]\n}\n"}},{"metadata":{"id":"windows-drive-relative-path","title":"A Windows path with a drive letter can still be relative","summary":"path.win32 resolves C:reports\\daily.csv against a directory on C:, while C:\\reports\\daily.csv starts at the drive root.","category":"filesystem-and-paths","references":[{"title":"Microsoft Learn: Traditional DOS paths","url":"https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths","kind":"documentation"},{"title":"Node.js: Windows and POSIX path handling","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#windows-vs-posix","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses explicit path.win32 and path.posix operations. The test supplies a base directory and makes no Windows filesystem calls."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two Windows paths distinguished by the separator after C:, with a fixed working directory on the same drive."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The Windows resolution of both paths and the basename of the rooted path under each path grammar."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"9b169c554438dbe9b8bcbf7dcfeaa6e696aa525ee281064435d558e63b378dc9"}}},"markdown":"# A Windows path with a drive letter can still be relative\n\n`C:reports\\daily.csv` names a path relative to the current directory on\ndrive `C:`. Adding a backslash after the colon anchors it at the root of that\ndrive. A configuration parser that checks only for a drive letter can accept\na location whose meaning changes with the working directory.\n\n## Observed behaviour\n\n`path.win32.isAbsolute()` returns false for the drive-relative input and true\nfor the rooted input. With `C:\\jobs\\nightly` as the supplied base,\n`path.win32.resolve()` keeps that directory only for the relative input.\n`path.posix.basename()` treats the backslashes as ordinary characters.\nThe test exercises the path grammars without opening files.\n\n## Application considerations\n\nUse `path.win32` to interpret Windows paths in a manifest on any host. If a\nsetting requires a fully qualified Windows path, account for paths that name a\ndrive without its root and paths that start at the root of the current drive\nwithout naming it. A fixed base on the same drive makes the fixture independent\nof per-drive working directories.\n","fixtureContents":{"input":"{\n \"base\": \"C:\\\\jobs\\\\nightly\",\n \"driveRelative\": \"C:reports\\\\daily.csv\",\n \"driveAbsolute\": \"C:\\\\reports\\\\daily.csv\"\n}\n","expected":"{\n \"relativeResolved\": \"C:\\\\jobs\\\\nightly\\\\reports\\\\daily.csv\",\n \"absoluteResolved\": \"C:\\\\reports\\\\daily.csv\",\n \"posixBasename\": \"C:\\\\reports\\\\daily.csv\",\n \"windowsBasename\": \"daily.csv\"\n}\n"}},{"metadata":{"id":"worker-environment-snapshot","title":"A Worker keeps the environment from when it was created","summary":"By default, a Node Worker gets its own process.env copy. Updating the parent after Worker construction leaves the worker’s value unchanged.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Worker environment options","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#new-workerfilename-options","kind":"documentation"},{"title":"Node.js: process.env","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/process.html#processenv","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a Node worker thread with the default env option. A message gates worker reads so the ordering is independent of startup timing."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A synthetic environment key and values written before creation, after creation and inside the worker."},{"id":"worker","file":"worker.txt","format":"text","role":"input","description":"CommonJS worker source. Start it with Worker’s eval option, then post the input key and workerWrite fields."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The value read and then written by the worker, alongside the parent’s independent value."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ad551f521312be49cfd80c6b972320c4a4f3b11040aa1d4fe8ca129cbad74514"}}},"markdown":"# A Worker keeps the environment from when it was created\n\nA worker created while `ODDSTATE_WORKER_MODE=draft` still reads `draft`\nafter the parent changes the variable to `active`. Node copies the parent\nenvironment at construction by default. A worker can read its copy much\nlater, so the time of the first read is irrelevant.\n\n## Observed behaviour\n\nThe parent changed the value and only then sent a message asking the worker\nto read it. The worker saw the initial value, wrote `worker-only` to its\nown copy and reported that value. The parent still saw `active`.\n\n## Application considerations\n\nFor a long-lived worker pool, send configuration changes through messages\nor supply configuration with each job. Node offers `SHARE_ENV` when shared\nmutable environment state is intentional.\n","fixtureContents":{"input":"{\n \"key\": \"ODDSTATE_WORKER_MODE\",\n \"original\": \"draft\",\n \"updated\": \"active\",\n \"workerWrite\": \"worker-only\"\n}\n","worker":"const { parentPort } = require(\"node:worker_threads\");\nparentPort.once(\"message\", ({ key, workerWrite }) => {\n const inherited = process.env[key];\n process.env[key] = workerWrite;\n parentPort.postMessage({ inherited, afterWrite: process.env[key] });\n});\n","expected":"{\n \"worker\": {\n \"inherited\": \"draft\",\n \"afterWrite\": \"worker-only\"\n },\n \"parentAfterWrite\": \"active\"\n}\n"}},{"metadata":{"id":"worker-message-drops-class-prototype","title":"A Node message channel drops custom class prototypes","summary":"MessagePort.postMessage() clones a custom instance as a plain object. Its own data survives, along with supported nested built-in types such as Date.","category":"runtime-and-concurrency","relatedCases":["structured-clone-transfers-buffer"],"references":[{"title":"Node.js: cloning objects with prototypes and accessors","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#considerations-when-cloning-objects-with-prototypes-classes-and-accessors","kind":"documentation"},{"title":"HTML: StructuredSerializeInternal","url":"https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s MessageChannel in one process to exercise the structured clone used for worker messages."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Data for an invoice instance with a computed label and Date field."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The original prototype getter’s label and whether the clone has that property."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b9cfa7d09c587fb9ee1e9071a61124a7fb52b915fbac952f2cda7ec92609b0dd"}}},"markdown":"# A Node message channel drops custom class prototypes\n\nSending an `Invoice` instance through a Node `MessagePort` can preserve its own\nID while losing access to `invoice.label`. Structured cloning copies eligible\nown properties. The custom prototype that supplies the getter is absent on the\nreceiver.\n\n## Observed behaviour\n\nThe sender’s getter produced `invoice/N31`. The receiver got a plain object with\nthe same ID and a `Date` with the same timestamp, without a `label` property.\n\n## Application considerations\n\nSend explicit records over worker boundaries. Reconstruct an instance at the\nreceiver if worker code needs its class methods, or send computed fields as own\ndata when they are part of the message contract.\n","fixtureContents":{"input":"{\n \"id\": \"N31\",\n \"paidAt\": \"2024-04-05T11:10:00.000Z\"\n}\n","expected":"{\n \"originalLabel\": \"invoice/N31\",\n \"labelPreserved\": false\n}\n"}},{"metadata":{"id":"writable-backpressure-accepted-chunk","title":"Writable.write() returning false has already queued the chunk","summary":"At the highWaterMark, Node’s Writable asks the caller to wait for drain before the next write. Retrying the current chunk would duplicate it.","category":"runtime-and-concurrency","references":[{"title":"Node.js: writable.write() and backpressure","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#writablewritechunk-encoding-callback","kind":"documentation"},{"title":"Node.js: Writable drain event","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#event-drain","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a Writable whose test double controls when its pending write callback completes."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A two-byte chunk and a two-byte high-water mark."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The write return value and the bytes received by the sink."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"970fb793000621f5e54c4d433c55d44ea143a4e6c57028ed596d72bad40cead8"}}},"markdown":"# Writable.write() returning false has already queued the chunk\n\nA Writable with a two-byte `highWaterMark` can return `false` after accepting\n`Q7`. The flag indicates backpressure. The sink can already have received the\nchunk while its completion callback remains pending.\n\n## Observed behaviour\n\nThe sink received `Q7` once before `write()` returned `false`. Completing the\npending write then triggered `drain` without a retry.\n\n## Application considerations\n\nPause production when a write returns false, then send the next chunk after\n`drain`. Resending the current chunk can duplicate an export record.\n","fixtureContents":{"input":"{\n \"chunk\": \"Q7\",\n \"highWaterMark\": 2\n}\n","expected":"{\n \"canContinue\": false,\n \"received\": [\n \"Q7\"\n ]\n}\n"}}]};
|
|
2
|
+
export const corpus = {"categories":[{"id":"data-formats","title":"Data formats","description":"How structured data changes when it crosses format and parser boundaries."},{"id":"databases","title":"Databases","description":"How query semantics, constraints and connection settings affect stored data and query results."},{"id":"dates-and-times","title":"Dates and times","description":"Calendar values, instants, time zones and clock changes."},{"id":"filesystem-and-paths","title":"Filesystem and paths","description":"Path interpretation, file URLs and the behaviour of open file handles."},{"id":"runtime-and-concurrency","title":"Runtime and concurrency","description":"How memory views, event ordering and execution contexts affect programs."},{"id":"text-and-encoding","title":"Text and encoding","description":"How byte sequences, code points and string representations affect text processing."},{"id":"web-platform","title":"Web platform","description":"Behaviour specified by web APIs and formats."}],"cases":[{"metadata":{"id":"abort-signal-late-listener","title":"An AbortSignal does not replay abort for late listeners","summary":"An abort listener added after cancellation never sees the past event. Check the signal’s current state before starting work.","category":"web-platform","references":[{"title":"DOM Standard: AbortSignal interface","url":"https://dom.spec.whatwg.org/#abortsignal","kind":"specification"},{"title":"DOM Standard: Signal abort","url":"https://dom.spec.whatwg.org/#abortsignal-signal-abort","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A cancellation reason passed unchanged to AbortController.abort()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Listener call counts for registration before and after abort, and the state stored on the signal."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3c9f0cac47e2fac2082d96d2fdcd59c4136bd2576100031f402d0787f01386d5"}}},"markdown":"# An AbortSignal does not replay abort for late listeners\n\nWhen a caller hands off an already aborted signal, registering an `abort`\nlistener leaves that listener waiting. The DOM standard dispatches the\nevent when transitioning the signal to aborted, and `signal.aborted` and\n`signal.reason` preserve the resulting state.\n\n## Observed behaviour\n\nThe listener registered before `abort()` ran once. The late listener stayed\nuninvoked even after a second call to `abort()`.\n`signal.throwIfAborted()` threw the original reason object.\n\n## Application considerations\n\nWhen wrapping an operation to accept an `AbortSignal`, check it before\nstarting work. For example, a parser handed an already aborted signal can call\n`signal.throwIfAborted()` before opening the file. Listen for later aborts\nwhile the work is running and remove the listener when the work finishes.\n","fixtureContents":{"input":"{\n \"reason\": \"Import cancelled before the next stage\"\n}\n","expected":"{\n \"earlyCalls\": 1,\n \"lateCalls\": 0,\n \"aborted\": true\n}\n"}},{"metadata":{"id":"base64url-atob-alphabet","title":"Buffer accepts base64url characters that atob() rejects","summary":"Buffer.from(value, \"base64\") accepts both alphabets. atob() handles unpadded standard Base64 but rejects Base64url-specific characters.","category":"text-and-encoding","references":[{"title":"Node.js: Buffer encodings for base64 and base64url","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#buffers-and-character-encodings","kind":"documentation"},{"title":"WHATWG Infra: forgiving-base64 decode","url":"https://infra.spec.whatwg.org/#forgiving-base64-decode","kind":"specification"},{"title":"RFC 4648: URL-safe Base64 alphabet","url":"https://www.rfc-editor.org/rfc/rfc4648.html#section-5","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Compares Node Buffer conversion with Node’s web-compatible atob()."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Standard padded, standard unpadded and URL-safe unpadded encodings for the same two bytes."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The two decoded byte values."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f573333765325fcfe714c4aa741a2c5f7c520940a2f21c94753e26af9ec7dfc4"}}},"markdown":"# Buffer accepts base64url characters that atob() rejects\n\nThe bytes `FB FF` encode as `+/8=` in standard Base64 and as `-_8` in unpadded\nBase64url. Node’s `Buffer.from()` accepts the URL-safe alphabet even when asked\nto decode `\"base64\"`. In that alphabet, `-` replaces `+` and `_` replaces `/`.\n`atob()` accepts the unpadded standard form `+/8` but rejects `-_8`.\n\n## Observed behaviour\n\nBoth decoders read the standard strings, including the unpadded control. Only\nBuffer decoded the URL-safe fixture. `atob()` threw `InvalidCharacterError` for\nthat variant.\n\n## Application considerations\n\nIdentify the alphabet required by an interchange format before validating or\ndecoding it. Node Buffer’s success alone does not establish interoperability\nwith a consumer using `atob()`.\n","fixtureContents":{"input":"{\n \"standard\": \"+/8=\",\n \"unpadded\": \"+/8\",\n \"urlSafe\": \"-_8\"\n}\n","expected":"[\n 251,\n 255\n]\n"}},{"metadata":{"id":"buffer-view-byte-range","title":"Buffer.buffer can include bytes outside a Buffer view","summary":"A view’s ArrayBuffer can contain framing bytes before and after its payload. Preserve byteOffset and byteLength when passing the view to a binary API.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Buffer byteOffset","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufbyteoffset","kind":"documentation"},{"title":"Node.js: Buffer subarray()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufsubarraystart-end","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a dedicated backing array so the extra bytes are deterministic and independent of Node’s Buffer pool."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A synthetic frame with a one-byte prefix, a two-byte big-endian payload and a one-byte suffix. The payload end is exclusive."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The byte sequences exposed by the backing store and by the payload view, and the decoded payload."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"afa38a3702a41f047e8fb9d73e4464b2eb15c31f1640ee9d437ff2ecb59c1c9e"}}},"markdown":"# Buffer.buffer can include bytes outside a Buffer view\n\nA two-byte payload in a four-byte frame remains backed by the whole frame\nafter `Buffer.subarray()`. Passing `payload.buffer` alone to another API\nincludes both framing bytes. A `DataView` constructed from the buffer,\n`byteOffset` and `byteLength` reads only the payload.\n\n## Observed behaviour\n\nIn Node, rebuilding a typed array from the backing buffer exposed\n`[162, 0, 42, 255]`. The following view exposed only `[0, 42]` and read\nthose bytes as the big-endian integer `42`.\n\n```js\nconst view = new DataView(\n payload.buffer,\n payload.byteOffset,\n payload.byteLength,\n);\nview.getUint16(0, false); // 42\n```\n\nThe test uses a dedicated array so the extra bytes do not depend on how Node\npools Buffers.\n\n## Application considerations\n\nWhen sending a Buffer slice to an encoder or checksum function, pass the view\ndirectly if the API accepts one. If the API needs a standalone `ArrayBuffer`,\ncopy just the view’s byte range. A full backing store can include unrelated\ncontent.\n","fixtureContents":{"input":"{\n \"frame\": [\n 162,\n 0,\n 42,\n 255\n ],\n \"payloadStart\": 1,\n \"payloadEnd\": 3\n}\n","expected":"{\n \"wholeBackingBytes\": [\n 162,\n 0,\n 42,\n 255\n ],\n \"payloadBytes\": [\n 0,\n 42\n ],\n \"payloadValue\": 42\n}\n"}},{"metadata":{"id":"calendar-day-across-dst","title":"Adding 24 hours can change tomorrow’s local time","summary":"Across a daylight-saving transition, Date.setDate() can preserve the local hour while 24 elapsed hours shift it.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap","date-set-utc-month-overflow"],"references":[{"title":"ECMAScript 2026: Date.prototype.setDate","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.setdate","kind":"specification"},{"title":"IANA time zone database 2026e: North America, US rules and New York","url":"https://data.iana.org/time-zones/tzdb-2026e/northamerica","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses America/New_York at the March and November 2024 transitions."},"fixtures":[{"id":"daily-reminder-starts","file":"input.json","format":"json","role":"input","description":"09:00 local on the day before each 2024 New York DST transition."},{"id":"next-reminder-results","file":"expected.json","format":"json","role":"expected","description":"UTC instants, local hours and elapsed hours for both approaches."}],"verification":{"timeZone":"America/New_York","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"55344d6f0c2877085e9116c242140a4fd4dc1c8d8be7409cb0eeba7fed22f5b0"}}},"markdown":"# Adding 24 hours can change tomorrow’s local time\n\nA daily reminder set for `09:00` in New York on 9 March 2024 moves to\n`10:00` the next morning if the app adds 24 elapsed hours. New York’s clock\njumps ahead by an hour that night, so the next local `09:00` arrives after\nonly 23 elapsed hours. Adding one local day with `setDate()` keeps the reminder\nat `09:00` in this example because the method works with local calendar fields.\n\n## Observed behaviour\n\nIn Node with `America/New_York` selected, the next local `09:00` was 23 elapsed\nhours away at the spring transition and 25 at the autumn transition. Adding\n24 hours reached `10:00` in spring and `08:00` in autumn.\n\n## Application considerations\n\nSchedule a daily reminder by local date and time in its intended time zone.\nUse elapsed time for a requirement such as “24 hours after the previous event”.\n`Date.setDate()` uses the runtime’s local zone. A reminder that falls inside\na clock change also needs a policy for gaps and repeated times.\n","fixtureContents":{"daily-reminder-starts":"[\n \"2024-03-09T09:00:00\",\n \"2024-11-02T09:00:00\"\n]\n","next-reminder-results":"[\n {\n \"calendarDay\": {\n \"instant\": \"2024-03-10T13:00:00.000Z\",\n \"localHour\": 9,\n \"elapsedHours\": 23\n },\n \"after24Hours\": {\n \"instant\": \"2024-03-10T14:00:00.000Z\",\n \"localHour\": 10,\n \"elapsedHours\": 24\n }\n },\n {\n \"calendarDay\": {\n \"instant\": \"2024-11-03T14:00:00.000Z\",\n \"localHour\": 9,\n \"elapsedHours\": 25\n },\n \"after24Hours\": {\n \"instant\": \"2024-11-03T13:00:00.000Z\",\n \"localHour\": 8,\n \"elapsedHours\": 24\n }\n }\n]\n"}},{"metadata":{"id":"collator-base-sensitivity-by-locale","title":"Intl.Collator base sensitivity treats ä differently in German and Swedish","summary":"With sensitivity set to base, German collation can treat a and ä as equivalent while Swedish keeps them distinct and sorts ä after z.","category":"text-and-encoding","relatedCases":["turkish-locale-lowercase","unicode-normalized-keys"],"references":[{"title":"ECMA-402: CompareStrings and locale-specific base letters","url":"https://tc39.es/ecma402/#sec-comparestrings","kind":"specification"},{"title":"Unicode CLDR 49: Swedish collation tailoring","url":"https://www.unicode.org/cldr/charts/49/collation/sv.html","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires ICU data for de and sv. Observed with ICU 79.1 and CLDR 49.0 using the default collation for each locale."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two requested locales, a letter pair and a three-word list arranged to show the position of ä relative to z."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Comparison signs and sort order under base sensitivity with the default German and Swedish collations."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0425c1d05dcb87b5eef4ed25aded63768c369f95500f6abb68c9c640bf67687c"}}},"markdown":"# Intl.Collator base sensitivity treats ä differently in German and Swedish\n\nAn accent-insensitive comparison with `sensitivity: \"base\"` can match `a`\nwith `ä` in German. Swedish collation treats them as separate base letters,\nso the same comparison keeps them distinct. ECMA-402\nleaves the identification of base letters to the effective locale.\nThe CLDR standard Swedish ordering puts `ä` after `z`.\n\n## Observed behaviour\n\nNode with ICU 79.1 and CLDR 49.0 sorted `Ähre` before `Apfel` and\n`Zoll` in German. In Swedish it sorted `Ähre` last. The test checks the\nsign of `compare()` because ECMA-402 specifies the sign and leaves the\nexact non-zero number to the implementation.\n\n## Application considerations\n\nUse the intended locale for accent-insensitive matching and sorting.\nA user-facing equality comparison at base sensitivity can merge terms\nin one locale that users of another locale expect to remain distinct.\n","fixtureContents":{"input":"{\n \"locales\": [\n \"de\",\n \"sv\"\n ],\n \"comparison\": [\n \"a\",\n \"ä\"\n ],\n \"words\": [\n \"Zoll\",\n \"Ähre\",\n \"Apfel\"\n ]\n}\n","expected":"{\n \"de\": {\n \"comparisonSign\": 0,\n \"sorted\": [\n \"Ähre\",\n \"Apfel\",\n \"Zoll\"\n ]\n },\n \"sv\": {\n \"comparisonSign\": -1,\n \"sorted\": [\n \"Apfel\",\n \"Zoll\",\n \"Ähre\"\n ]\n }\n}\n"}},{"metadata":{"id":"csv-duplicate-header-columns","title":"Duplicate CSV headers can discard earlier columns","summary":"csv-parse with columns enabled keeps the last value for a repeated header unless group_columns_by_name collects all values.","category":"data-formats","relatedCases":["csv-relaxed-column-count"],"references":[{"title":"CSV Parse: columns option","url":"https://csv.js.org/parse/options/columns/","kind":"documentation"},{"title":"CSV Parse: group_columns_by_name option","url":"https://csv.js.org/parse/options/group_columns_by_name/","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the workspace’s pinned csv-parse version with header-based object mapping."},"fixtures":[{"id":"contacts","file":"contacts.txt","format":"text","role":"input","description":"LF-terminated CSV with a repeated phone header and two contact numbers in order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Default and grouped object results."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"aed6e5cc2cfdaec273f31b83b8b8306a87290a2c63e9217bc50f32138575e12b"}}},"markdown":"# Duplicate CSV headers can discard earlier columns\n\nMapping `customer,phone,phone` to an object gives both phone columns the same\nproperty name. The `columns` option in `csv-parse` keeps the last value by\ndefault. `group_columns_by_name` collects repeated values in column order.\n\n## Observed behaviour\n\nThe same contact row gives two different shapes for the `phone` property.\n\n- Default with `columns`: `phone: \"555-0142\"`.\n- With grouping enabled: `phone: [\"555-0101\", \"555-0142\"]`.\n\nThe customer ID remains a string in both modes.\n\n## Application considerations\n\nValidate header uniqueness before importing when each column should have a\ndistinct meaning. If repetition represents a list, enable grouping and account\nfor the resulting array values in validation.\n","fixtureContents":{"contacts":"customer,phone,phone\nA41,555-0101,555-0142\n","expected":"{\n \"defaultRows\": [\n {\n \"customer\": \"A41\",\n \"phone\": \"555-0142\"\n }\n ],\n \"groupedRows\": [\n {\n \"customer\": \"A41\",\n \"phone\": [\n \"555-0101\",\n \"555-0142\"\n ]\n }\n ]\n}\n"}},{"metadata":{"id":"csv-quoted-newline","title":"A quoted newline can belong to one CSV field","summary":"Splitting CSV on line breaks breaks multiline fields such as delivery notes.","category":"data-formats","references":[{"title":"RFC 4180 §2: CSV records and quoted fields","url":"https://www.rfc-editor.org/rfc/rfc4180.html#section-2","kind":"specification"},{"title":"CSV Parse: synchronous API","url":"https://csv.js.org/parse/api/sync/","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses csv-parse 7.0.3 with CRLF record separators and a header row."},"fixtures":[{"id":"multiline-deliveries","file":"deliveries.txt","format":"text","role":"input","description":"Export with CRLF record separators and a CRLF inside a quoted delivery note. The final record ends with CRLF."},{"id":"parsed-deliveries","file":"expected.json","format":"json","role":"expected","description":"Two delivery records with the embedded CRLF retained in the first note."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"7398e4066e06fcd84cbc37c01c82d2735dc3db5497aa92828115db23f8f88dc1"}}},"markdown":"# A quoted newline can belong to one CSV field\n\nA CSV delivery note such as `\"Leave by the side door\\r\\nRing the bell once\"`\ncontains a line break inside a single field. In RFC 4180’s CSV format,\ndouble quotes let a field contain a line break. Splitting at every line\nbreak divides that delivery record in two.\n\n## Observed behaviour\n\nWith a header row and CRLF record separators configured, `csv-parse` returned\ntwo delivery records and retained the embedded CRLF in the first note.\nSplitting those same bytes at CRLF yielded four nonempty physical lines,\nincluding the header.\n\n## Application considerations\n\nUse a CSV parser configured for the exporter’s dialect before validating\ncolumns or counting records. Keep the original CRLF fixture when writing\nimport tests. Normalising the line endings would change the value the parser\nshould return for the multiline note.\n","fixtureContents":{"multiline-deliveries":"order_id,delivery_note\r\nA101,\"Leave by the side door\r\nRing the bell once\"\r\nA102,Collect at the desk\r\n","parsed-deliveries":"[\n {\n \"order_id\": \"A101\",\n \"delivery_note\": \"Leave by the side door\\r\\nRing the bell once\"\n },\n {\n \"order_id\": \"A102\",\n \"delivery_note\": \"Collect at the desk\"\n }\n]\n"}},{"metadata":{"id":"csv-relaxed-column-count","title":"Relaxed CSV column counts can drop fields during object mapping","summary":"In csv-parse, relaxed column counts with a header can yield missing properties and silently discard extra fields.","category":"data-formats","relatedCases":["csv-quoted-newline"],"references":[{"title":"CSV Parse: relax_column_count with columns","url":"https://csv.js.org/parse/options/relax_column_count/","kind":"documentation"},{"title":"CSV Parse: inconsistent columns issue #73","url":"https://github.com/adaltas/node-csv-parse/issues/73","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the workspace’s pinned csv-parse 7.0.3 with and without header mapping."},"fixtures":[{"id":"deliveries","file":"deliveries.txt","format":"text","role":"input","description":"Three LF-terminated delivery rows under an id,note header. A10 has an empty note, A11 has no note field, and A12 has a third field with no header."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The strict parsing error and relaxed results with and without object mapping."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"c1e721b34db3054f8a9a56bcb4dcc2821915b621eb9fe3cabbe02c9b0ec343b7"}}},"markdown":"# Relaxed CSV column counts can drop fields during object mapping\n\nWith an `id,note` header, `A10,` contains an empty note and `A11` lacks\nthe field entirely. Enabling both `columns` and `relax_column_count` in\n`csv-parse` accepts both rows. It also accepts a row with surplus fields,\nbut fields beyond the header have no corresponding object property.\n\n## Observed behaviour\n\nStrict parsing rejected the file. With relaxed column counts and object mapping,\nthe same three rows became these objects.\n\n```json\n[\n { \"id\": \"A10\", \"note\": \"\" },\n { \"id\": \"A11\" },\n {\n \"id\": \"A12\",\n \"note\": \"Leave at door\"\n }\n]\n```\n\nThe third row also contained `Call on arrival` in a column with no header. In\narray mode, all three fields survived and every row kept its original width.\n\n## Application considerations\n\nWhen investigating a broken export, read rows as arrays or inspect the raw\nrecord before mapping fields to column names. Decide whether a missing field\nand an explicitly empty field mean the same thing for the importer.\n","fixtureContents":{"deliveries":"id,note\nA10,\nA11\nA12,Leave at door,Call on arrival\n","expected":"{\n \"strictError\": \"CSV_RECORD_INCONSISTENT_COLUMNS\",\n \"records\": [\n {\n \"id\": \"A10\",\n \"note\": \"\"\n },\n {\n \"id\": \"A11\"\n },\n {\n \"id\": \"A12\",\n \"note\": \"Leave at door\"\n }\n ],\n \"rawRows\": [\n [\n \"id\",\n \"note\"\n ],\n [\n \"A10\",\n \"\"\n ],\n [\n \"A11\"\n ],\n [\n \"A12\",\n \"Leave at door\",\n \"Call on arrival\"\n ]\n ]\n}\n"}},{"metadata":{"id":"date-only-utc","title":"Date-only strings can display as the previous day","summary":"JavaScript parses YYYY-MM-DD as UTC. In a time zone west of UTC, a birthday can display a day early.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap"],"references":[{"title":"ECMAScript 2026 — Date.parse","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixture's local dates and instants use America/Los_Angeles in January 2024."},"fixtures":[{"id":"date-inputs","file":"input.json","format":"json","role":"input","description":"Three forms of January 15, 2024 with and without a time and UTC offset."},{"id":"parsed-dates","file":"expected.json","format":"json","role":"expected","description":"UTC instants and the local day of month in Los Angeles."}],"verification":{"timeZone":"America/Los_Angeles","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"bcb9d6579fbb2b1702d2f85ffd0c3870c50a1b38c518fd62a7f8ed3ac773e4eb"}}},"markdown":"# Date-only strings can display as the previous day\n\nIn Los Angeles, `new Date(\"2024-01-15\").getDate()` returns `14`.\nECMAScript interprets this ISO-style date-only string as midnight UTC. That\ninstant is still 4 pm on 14 January in Los Angeles, and `getDate()` reads the\nlocal day of the month.\n\n## Observed behaviour\n\nWith `America/Los_Angeles` selected, Node produced these UTC instants.\n\n- `2024-01-15` → `2024-01-15T00:00:00.000Z` (date-only defaults to UTC).\n- `2024-01-15T00:00:00` → `2024-01-15T08:00:00.000Z` (no offset on a date-time means local time).\n- `2024-01-15T00:00:00Z` → `2024-01-15T00:00:00.000Z` (`Z` explicitly selects UTC).\n\n## Application considerations\n\nKeep a birthday as a date-only value, such as the string `2024-01-15` or\nseparate year, month and day fields, to avoid an off-by-one day error. If a field represents an instant, include an explicit\noffset or `Z` in the serialised value.\n","fixtureContents":{"date-inputs":"{\n \"dateOnly\": \"2024-01-15\",\n \"localMidnight\": \"2024-01-15T00:00:00\",\n \"utcMidnight\": \"2024-01-15T00:00:00Z\"\n}\n","parsed-dates":"{\n \"utcFromDateOnly\": \"2024-01-15T00:00:00.000Z\",\n \"utcFromLocalMidnight\": \"2024-01-15T08:00:00.000Z\",\n \"localDayFromDateOnly\": 14\n}\n"}},{"metadata":{"id":"date-rejects-rfc3339-leap-second","title":"An RFC 3339 leap second is outside ECMAScript Date’s format","summary":"RFC 3339 permits a seconds field of 60 at a positive leap second. Node’s Date accepts the neighbouring instants and rejects that timestamp.","category":"dates-and-times","references":[{"title":"RFC 3339: restrictions and leap seconds","url":"https://www.rfc-editor.org/rfc/rfc3339.html#section-5.7","kind":"specification"},{"title":"ECMAScript: Date Time String Format","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date-time-string-format","kind":"specification"},{"title":"ECMAScript: Date time values and time range","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-time-values-and-time-range","kind":"specification"},{"title":"IERS Bulletin C 52: December 2016 leap second","url":"https://datacenter.iers.org/versionMetadata.php?filename=mt%2Fbulletinc-052.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Date rejection is an observation on the verified Node runtime. Implementations can apply fallback heuristics to inputs outside the ECMAScript format."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"The announced 2016 UTC leap second and the valid labels immediately before and after it."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Date’s millisecond values for both neighbouring labels."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"211231f36364e2c8cec9636ba684a7406871b627b97e971c60c8d3a2f78a267b"}}},"markdown":"# An RFC 3339 leap second is outside ECMAScript Date’s format\n\n`2016-12-31T23:59:60Z` labels the leap second announced by IERS. RFC 3339\npermits `60` for that moment. The ECMAScript Date Time String Format defines its\nseconds field from `00` through `59`.\n\n## Observed behaviour\n\nNode’s `Date.parse()` returned `NaN` for the leap second. It parsed the\nsurrounding labels, `2016-12-31T23:59:59Z` and `2017-01-01T00:00:00Z`, as\ninstants 1,000 milliseconds apart. ECMAScript Date’s time scale assigns\n86,400 seconds to each day and has no separate slot for the leap second.\n\n## Application considerations\n\nIf an importer receives formal RFC 3339 timestamps, decide how it represents\nleap seconds before converting values to `Date`. Preserving the original input\nallows upstream telemetry to be reconciled later.\n","fixtureContents":{"input":"{\n \"before\": \"2016-12-31T23:59:59Z\",\n \"leap\": \"2016-12-31T23:59:60Z\",\n \"after\": \"2017-01-01T00:00:00Z\"\n}\n","expected":"{\n \"before\": 1483228799000,\n \"after\": 1483228800000\n}\n"}},{"metadata":{"id":"date-set-utc-month-overflow","title":"Date.setUTCMonth() can skip February","summary":"Changing January 31 to February retains the day of the month and rolls into March.","category":"dates-and-times","references":[{"title":"ECMAScript 2026: Date.prototype.setUTCMonth","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.setutcmonth","kind":"specification"},{"title":"ECMAScript 2026: MakeDay","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-makeday","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"january-dates","file":"input.json","format":"json","role":"input","description":"January 31 in a common year and a leap year, with the requested UTC month index."},{"id":"month-results","file":"expected.json","format":"json","role":"expected","description":"UTC results for the default day and for an explicit first day of the target month."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"de586982cf7ce2bc4a5466dc6bb87cf607667b907bfb998927b63f9a4454b04a"}}},"markdown":"# Date.setUTCMonth() can skip February\n\nCalling `setUTCMonth(1)` on 31 January 2023 moves the date to 3 March. February\nhas index `1`. With the day argument omitted, ECMAScript uses the original day\nof the month, so day 31 of February rolls over into the following month.\n\n## Observed behaviour\n\nNode produced 3 March in 2023 and 2 March in leap year 2024. Passing\n`setUTCMonth(1, 1)` selected 1 February in both years. The fixture uses UTC\nthroughout so local time-zone changes do not enter the calculation.\n\n## Application considerations\n\nFor monthly billing or renewals, define what should happen when the target\nmonth is shorter. If the policy is to use the last day of that month, calculate\nthat day explicitly. For a recurring renewal, keep the original preferred day\nso subsequent months can use it when available.\n","fixtureContents":{"january-dates":"{\n \"starts\": [\n \"2023-01-31T12:00:00.000Z\",\n \"2024-01-31T12:00:00.000Z\"\n ],\n \"targetMonthIndex\": 1\n}\n","month-results":"[\n {\n \"overflow\": \"2023-03-03T12:00:00.000Z\",\n \"firstDay\": \"2023-02-01T12:00:00.000Z\"\n },\n {\n \"overflow\": \"2024-03-02T12:00:00.000Z\",\n \"firstDay\": \"2024-02-01T12:00:00.000Z\"\n }\n]\n"}},{"metadata":{"id":"date-timeclip-range","title":"A Date outside the TimeClip range serialises to null","summary":"One millisecond beyond ±8.64 × 10¹⁵ yields an invalid Date. toISOString() throws a RangeError, while toJSON() returns null.","category":"dates-and-times","references":[{"title":"ECMAScript: TimeClip","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-timeclip","kind":"specification"},{"title":"ECMAScript: Date.prototype.toISOString","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.toisostring","kind":"specification"},{"title":"ECMAScript: Date.prototype.toJSON","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.tojson","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Positive and negative millisecond boundaries plus the adjacent out-of-range values."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Expected ISO strings at both limits and null for invalid dates."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"1dea198715f21a57ab1da1fbbf80619d23015be4949764749b1c879df840a6a4"}}},"markdown":"# A Date outside the TimeClip range serialises to null\n\nAn epoch value of `8640000000000000` milliseconds creates a valid ECMAScript\n`Date`. Adding one millisecond exceeds the `TimeClip` range and creates a Date\nwhose time value is `NaN`.\n\n## Observed behaviour\n\nBoth endpoints formatted as ISO strings. One millisecond past either endpoint,\n`toISOString()` threw `RangeError`. The same invalid Date appeared as `null`\ninside JSON because `JSON.stringify()` calls `Date.prototype.toJSON()`, which\nreturns `null` for a non-finite time value.\n\n## Application considerations\n\nValidate the timestamp units and check `Number.isFinite(date.getTime())` before\nserialising. A timestamp accidentally expressed in microseconds can otherwise\nlook like an explicitly missing value in a JSON payload.\n","fixtureContents":{"input":"{\n \"cases\": [\n 8640000000000000,\n 8640000000000001,\n -8640000000000000,\n -8640000000000001\n ]\n}\n","expected":"[\n \"+275760-09-13T00:00:00.000Z\",\n null,\n \"-271821-04-20T00:00:00.000Z\",\n null\n]\n"}},{"metadata":{"id":"dst-repeated-local-time","title":"Date picks the earlier instant when a local time occurs twice","summary":"During the New York DST fall-back, two instants display as 01:30. An offsetless Date picks the earlier one.","category":"dates-and-times","relatedCases":["lord-howe-dst-gap","calendar-day-across-dst"],"references":[{"title":"ECMAScript 2026: UTC conversion at local time transitions","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-utc-t","kind":"specification"},{"title":"IANA time zone database 2026e: North America, US rules and New York","url":"https://data.iana.org/time-zones/tzdb-2026e/northamerica","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses America/New_York at the November 2024 transition."},"fixtures":[{"id":"repeated-local-time","file":"input.json","format":"json","role":"input","description":"An ambiguous New York local time and two timestamps with explicit offsets."},{"id":"repeated-time-results","file":"expected.json","format":"json","role":"expected","description":"Both UTC instants and their shared local clock fields."}],"verification":{"timeZone":"America/New_York","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"7f638e0e3f63fd9ace22e0fdff81144f0aa9ff24dfcf8fa59d314ec938c2aebd"}}},"markdown":"# Date picks the earlier instant when a local time occurs twice\n\nIn New York, `2024-11-03T01:30:00` could mean `05:30Z` or `06:30Z`. At the end\nof daylight saving time, the clock moved back and passed through `01:30` twice.\nAn offsetless ECMAScript `Date` chooses the earlier instant when the local time\nis ambiguous.\n\n## Observed behaviour\n\nWith `America/New_York` selected, Node parsed the offsetless timestamp as\n`2024-11-03T05:30:00.000Z`, the same instant as the version with `-04:00`. The\n`-05:00` version was one elapsed hour later. Both instants had local clock\nfields of `01:30`.\n\n## Application considerations\n\nIf a booking can fall within the repeated hour, decide how to ask the user which\noccurrence they mean. Once resolved, store the instant or the full local\ntimestamp with its offset. Keep the named time zone if display depends on it. A\ncron-style scheduler also needs a policy for whether a job runs once or twice\nduring the DST fall-back.\n","fixtureContents":{"repeated-local-time":"{\n \"local\": \"2024-11-03T01:30:00\",\n \"earlier\": \"2024-11-03T01:30:00-04:00\",\n \"later\": \"2024-11-03T01:30:00-05:00\"\n}\n","repeated-time-results":"{\n \"earlier\": \"2024-11-03T05:30:00.000Z\",\n \"later\": \"2024-11-03T06:30:00.000Z\",\n \"localClock\": {\n \"hour\": 1,\n \"minute\": 30\n }\n}\n"}},{"metadata":{"id":"emoji-grapheme-length","title":"Emoji string length can differ from grapheme count","summary":"JavaScript length counts UTF-16 code units. Intl.Segmenter can count a joined emoji as one grapheme cluster.","category":"text-and-encoding","relatedCases":["unicode-normalized-keys"],"references":[{"title":"ECMAScript 2026: The String type","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type","kind":"specification"},{"title":"ECMA-402: Intl.Segmenter.prototype.segment","url":"https://tc39.es/ecma402/#sec-intl.segmenter.prototype.segment","kind":"specification"},{"title":"Unicode Standard Annex #29: Default grapheme cluster boundaries","url":"https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses Node's Intl.Segmenter with English locale and grapheme granularity."},"fixtures":[{"id":"display-labels","file":"input.json","format":"json","role":"input","description":"A joined emoji alone and followed by punctuation."},{"id":"text-counts","file":"expected.json","format":"json","role":"expected","description":"Code unit counts, code point counts and grapheme segments for each label."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ccb91c1493d6e6d8fc30214936fc9649df039ad77e74b3eaef4975276d5fe517"}}},"markdown":"# Emoji string length can differ from grapheme count\n\n`\"👩🏽💻\".length` is `7`, even though the joined emoji is one grapheme cluster.\nJavaScript string length counts UTF-16 code units. String iteration counts\nUnicode code points. The woman, skin tone modifier, zero-width joiner and\nlaptop are four code points within one cluster.\n\n## Observed behaviour\n\nIn Node, three ways to count `emoji = \"👩🏽💻\"` returned three answers.\n\n- `emoji.length` counted 7 UTF-16 code units.\n- `[...emoji].length` counted 4 Unicode code points.\n- `Intl.Segmenter` with `granularity: \"grapheme\"` found 1 cluster.\n\nThe exclamation mark in `\"👩🏽💻!\"` formed a separate grapheme.\n\n## Application considerations\n\nWhen truncating labels to a visible character limit, work at grapheme\nboundaries so a cut cannot split this emoji. Keep any separate storage\nor transport limit in the units required by that system.\n","fixtureContents":{"display-labels":"[\n \"👩🏽💻\",\n \"👩🏽💻!\"\n]\n","text-counts":"[\n {\n \"codeUnits\": 7,\n \"codePoints\": 4,\n \"graphemes\": [\n \"👩🏽💻\"\n ]\n },\n {\n \"codeUnits\": 8,\n \"codePoints\": 5,\n \"graphemes\": [\n \"👩🏽💻\",\n \"!\"\n ]\n }\n]\n"}},{"metadata":{"id":"event-emitter-async-context","title":"An EventEmitter listener can run in a different async context","summary":"A normal EventEmitter calls listeners in the emitter’s current context. AsyncLocalStorage.snapshot() can restore the context captured when registering a callback.","category":"runtime-and-concurrency","references":[{"title":"Node.js: passing arguments and this to EventEmitter listeners","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#passing-arguments-and-this-to-listeners","kind":"documentation"},{"title":"Node.js: AsyncLocalStorage.snapshot()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/async_context.html#static-method-asynclocalstoragesnapshot","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An event and payload, with distinct request and queue context values for subscription and emission."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The respective context and event payload observed by ordinary and snapshot-wrapped listeners."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"359096fa64e9992ce1971a1012d2b8a6846dc4efee00d13ece93084b45197457"}}},"markdown":"# An EventEmitter listener can run in a different async context\n\nA listener registered during request `42` can see the queue worker’s context\nwhen that worker calls `emit()`. A normal `EventEmitter` invokes listeners\nsynchronously, so `AsyncLocalStorage.getStore()` observes the context\nactive at emission. `AsyncLocalStorage.snapshot()` can run a callback in a\npreviously captured context.\n\n## Observed behaviour\n\nBoth listeners received the same job result. The ordinary listener saw the\nqueue context, and the listener wrapped in a snapshot taken during\nregistration saw the request context.\n\n## Application considerations\n\nFor logging and trace correlation, decide whether an event belongs to the\nrequest that subscribed or to the work that emitted it. Capture context\ndeliberately for request-scoped callbacks on shared emitters. The test uses\nthe standard `EventEmitter`, whose behaviour differs from\n`EventEmitterAsyncResource`.\n","fixtureContents":{"input":"{\n \"event\": \"job-result\",\n \"subscribeContext\": \"request:42\",\n \"emitContext\": \"queue:worker-1\",\n \"payload\": \"ready\"\n}\n","expected":"{\n \"ordinary\": {\n \"context\": \"queue:worker-1\",\n \"payload\": \"ready\"\n },\n \"captured\": {\n \"context\": \"request:42\",\n \"payload\": \"ready\"\n }\n}\n"}},{"metadata":{"id":"events-once-same-tick","title":"Sequential events.once() awaits can miss the second event","summary":"A synchronous batch can emit the second event before the first await resumes. Register both event promises before yielding.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Caveats when awaiting multiple events","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#caveats-when-awaiting-multiple-events","kind":"documentation"},{"title":"Node.js: Synchronous EventEmitter dispatch","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/events.html#asynchronous-vs-synchronous","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two named notifications and payloads for consecutive emits in one nextTick callback."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The payload arrays resolved by early listeners and the abort error used to end the late wait."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"772543aee9819e566462f0414cc119cc5e5f29f8f6df00c4d2769455d27bfaf3"}}},"markdown":"# Sequential events.once() awaits can miss the second event\n\nIf an emitter sends `ready` and `finished` in the same synchronous batch,\n`await once(emitter, \"ready\")` can resume after `finished` has already\nbeen emitted. `EventEmitter.emit()` calls listeners synchronously. The\ncontinuation of the first `await` runs after the current callback returns.\n\n## Observed behaviour\n\nWith both events emitted in one `process.nextTick()` callback, registering\nthe `finished` listener after awaiting `ready` missed the notification.\nThe test aborts the late wait after the batch so it can assert the failure\nwithout a wall-clock timeout. The test captured both payloads by calling `once()` for both events before\nawaiting either. Creating the second promise is what attaches its listener.\n\n## Application considerations\n\nIn wrappers around event-based APIs, register all expected event listeners\nbefore starting an operation that can emit them together. When an operation\nmay fail before emitting one event, give the outstanding waits an explicit\ncleanup path.\n","fixtureContents":{"input":"{\n \"first\": {\n \"name\": \"ready\",\n \"payload\": \"job-42\"\n },\n \"second\": {\n \"name\": \"finished\",\n \"payload\": \"accepted\"\n }\n}\n","expected":"{\n \"first\": [\n \"job-42\"\n ],\n \"second\": [\n \"accepted\"\n ],\n \"lateError\": \"AbortError\"\n}\n"}},{"metadata":{"id":"execfile-maxbuffer-utf8-bytes","title":"execFile() maxBuffer counts bytes before decoding stdout","summary":"Node’s child process can exceed maxBuffer with a multibyte character even when the decoded string would fit by JavaScript length.","category":"runtime-and-concurrency","relatedCases":["utf8-byte-length"],"references":[{"title":"Node.js: maxBuffer and Unicode","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/child_process.html#maxbuffer-and-unicode","kind":"documentation"},{"title":"Node.js: child_process.execFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/child_process.html#child_processexecfilefile-args-options-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Spawns the same Node executable without a shell or a PATH lookup. The child writes only its argument to stdout."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two four-code-unit strings and a four-byte stdout budget."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The error code for an exceeded stdout buffer."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"9dac6799ac39d7f9769dd48070bb64f0fab8efe88e5eac7acabd51d2f58c139a"}}},"markdown":"# execFile() maxBuffer counts bytes before decoding stdout\n\nBoth `ABCD` and `éBCD` have JavaScript length four. A child writing them to\nstdout produces four and five UTF-8 bytes respectively. `execFile()` enforces\n`maxBuffer` on bytes even when the caller requests a decoded string.\n\n## Observed behaviour\n\nThe ASCII child completed and returned all four characters. The accented child\nexceeded the four-byte `maxBuffer` limit. The promisified call rejected with\n`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`.\n\n## Application considerations\n\nSet output limits in bytes and handle overflow when a process produces localised\ntext. For potentially large output, use a streaming child process API and apply\nyour own limit as you read the chunks.\n","fixtureContents":{"input":"{\n \"ascii\": \"ABCD\",\n \"accented\": \"éBCD\",\n \"maxBuffer\": 4\n}\n","expected":"{\n \"code\": \"ERR_CHILD_PROCESS_STDIO_MAXBUFFER\"\n}\n"}},{"metadata":{"id":"fetch-decoded-body-content-length","title":"Fetch can decode a gzip body while retaining its encoded Content-Length","summary":"Node’s fetch exposes decoded bytes for a gzip response. Content-Length stays the size of the encoded representation.","category":"web-platform","relatedCases":["gzip-concatenated-members"],"references":[{"title":"RFC 9110: Content-Length","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-8.6","kind":"specification"},{"title":"WHATWG Fetch: handling content codings","url":"https://fetch.spec.whatwg.org/#concept-http-network-fetch","kind":"specification"},{"title":"Undici issue #2514: compressed response headers after decoding","url":"https://github.com/nodejs/undici/issues/2514","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with the workspace’s pinned Undici MockAgent. Both responses are offline."},"fixtures":[{"id":"gzip-response","file":"body.bin","format":"binary","role":"input","description":"Exact gzip bytes for twelve repetitions of the sample line. Serve with Content-Encoding gzip and a Content-Length of 51."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Origin, request paths and the plaintext line and repetition count."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Encoded and decoded lengths in bytes."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"6e6f4e19412e3a152e6ff29a936ca6e7a6b60642bdf1235f1a39967793746c4f"}}},"markdown":"# Fetch can decode a gzip body while retaining its encoded Content-Length\n\nA gzip-compressed HTTP response can advertise `Content-Length: 51` and yield 312\ndecoded bytes from `response.arrayBuffer()`. Content-Length describes the\nencoded representation sent in that response. Fetch handles content codings\nbefore exposing its body.\n\n## Observed behaviour\n\nWith Node’s offline HTTP dispatcher, the gzip response retained its encoding and\nlength headers while its body decoded to the same bytes as the uncompressed\ncontrol. The control’s length matched its body.\n\n## Application considerations\n\nA progress bar that counts decoded bytes against the encoded\n`Content-Length` can go past 100%. Use an encoded-byte count if that is what\nyou want to measure, or show decoded bytes without a percentage when their\ntotal is unknown. When forwarding the decoded body, remove the original\n`Content-Encoding` and remove or recalculate `Content-Length`.\n","fixtureContents":{"gzip-response":"H4sIAAAAAAAC/8vJzEu1UiguTSpOLsosKMnMz1NITC7JLEvlyhmVwSMDAMRjVrY4AQAA","input":"{\n \"origin\": \"https://example.test\",\n \"encoded\": \"/encoded\",\n \"plain\": \"/plain\",\n \"line\": \"line: subscription active\\n\",\n \"rows\": 12\n}\n","expected":"{\n \"encodedLength\": 51,\n \"decodedLength\": 312\n}\n"}},{"metadata":{"id":"fetch-http-error","title":"fetch() resolves on HTTP 404","summary":"A 404 fulfils the Fetch promise with Response.ok set to false. A network error rejects it.","category":"web-platform","references":[{"title":"WHATWG Fetch Standard: fetch() method","url":"https://fetch.spec.whatwg.org/#fetch-method","kind":"specification"},{"title":"WHATWG Fetch Standard: Response.ok","url":"https://fetch.spec.whatwg.org/#dom-response-ok","kind":"specification"},{"title":"Undici 7.30.2: MockAgent","url":"https://github.com/nodejs/undici/blob/v7.30.2/docs/docs/api/MockAgent.md","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with Undici 7.30.2 MockAgent as the offline HTTP dispatcher."},"fixtures":[{"id":"http-scenarios","file":"input.json","format":"json","role":"input","description":"One HTTP 404 response and one transport failure for the same request."},{"id":"fetch-results","file":"expected.json","format":"json","role":"expected","description":"Status, ok flag and body for the fulfilled Response, and the rejection type for the network failure."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"94cac04827ca7b2fff7f27e886f37c9b2beb8c8433eefdb1e37180e1d1887604"}}},"markdown":"# fetch() resolves on HTTP 404\n\nWhen an endpoint returns HTTP `404`, `await fetch(url)` gives you a\n`Response` with `ok === false`. Fetch considers status codes 200 through\n299 to be OK. An HTTP error status still produces a response. A network\nerror rejects the promise instead.\n\n## Observed behaviour\n\nUsing an offline dispatcher, Node’s global `fetch()` fulfilled with a\n`404` response and the body `\"Product not found\"`. When the dispatcher\nsimulated a transport error for the same URL, `fetch()` rejected with\n`TypeError`. The test uses no live endpoint.\n\n## Application considerations\n\nCheck `response.ok` or the endpoint’s expected status codes before treating\nthe body as a successful result. Handle network failures separately. A missing\nproduct may call for an empty state, while a connection failure may\ncall for a retry.\n","fixtureContents":{"http-scenarios":"{\n \"origin\": \"https://catalogue.example\",\n \"path\": \"/products/missing\",\n \"notFound\": {\n \"status\": 404,\n \"body\": \"Product not found\"\n },\n \"networkError\": \"Connection interrupted\"\n}\n","fetch-results":"{\n \"notFound\": {\n \"status\": 404,\n \"ok\": false,\n \"body\": \"Product not found\"\n },\n \"networkError\": \"TypeError\"\n}\n"}},{"metadata":{"id":"fetch-redirect-post-method","title":"Fetch turns a POST into GET on 303 and preserves it on 307","summary":"The redirect status determines whether Fetch drops the original body or sends the POST again to the redirected URL.","category":"web-platform","relatedCases":["fetch-http-error"],"references":[{"title":"WHATWG Fetch Standard: HTTP-redirect fetch","url":"https://fetch.spec.whatwg.org/#http-redirect-fetch","kind":"specification"},{"title":"RFC 9110: 303 See Other","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.4","kind":"specification"},{"title":"RFC 9110: 307 Temporary Redirect","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.8","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s global fetch with the pinned Undici MockAgent, same-origin URLs and a replayable string body."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two same-origin redirects from requests with the same method and replayable string body."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The required method and body at each redirect destination, plus the final response text and status."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"85277d228162d2525ea0619d6f86d990219223f4e7c4a376ab3770699a45e864"}}},"markdown":"# Fetch turns a POST into GET on 303 and preserves it on 307\n\nFollowing a `303 See Other` after a form POST sends a GET to the new\nURL. Following a `307 Temporary Redirect` sends another POST with the\noriginal body when Fetch can replay it. The server’s chosen status changes\nwhat reaches the destination even when the client code stays the same.\n\n## Observed behaviour\n\nThe first request was a POST with `quantity=2` in both runs. The offline\nfixture checked the next request sent by Node’s `fetch()`.\n\n- `303`: `GET /receipt`, with no request body.\n- `307`: `POST /new-submit`, with `quantity=2` in the body.\n\n## Application considerations\n\nUse `303` when the next request retrieves a receipt or results page.\nUse `307` when the new endpoint should receive the original submission.\nTest the destination method and body when migrating an endpoint. This\nfixture uses a replayable string. A `307` can fail if the original body is a stream that Fetch cannot replay.\n","fixtureContents":{"input":"{\n \"origin\": \"https://example.test\",\n \"method\": \"POST\",\n \"body\": \"quantity=2\",\n \"redirects\": [\n {\n \"status\": 303,\n \"from\": \"/submit\",\n \"to\": \"/receipt\"\n },\n {\n \"status\": 307,\n \"from\": \"/old-submit\",\n \"to\": \"/new-submit\"\n }\n ]\n}\n","expected":"{\n \"result\": [\n {\n \"method\": \"GET\",\n \"body\": null,\n \"result\": \"receipt\"\n },\n {\n \"method\": \"POST\",\n \"body\": \"quantity=2\",\n \"result\": \"accepted\"\n }\n ],\n \"status\": 200\n}\n"}},{"metadata":{"id":"file-url-host-windows-unc","title":"Windows mode converts a hosted file URL to a UNC path","summary":"fileURLToPath() converts a hosted file URL to a Windows network path and rejects the same URL in POSIX mode.","category":"filesystem-and-paths","relatedCases":["file-url-reserved-filename"],"references":[{"title":"Node.js fileURLToPath() platform modes","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlfileurltopathurl-options","kind":"documentation"},{"title":"Node.js ERR_INVALID_FILE_URL_HOST","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/errors.html#err_invalid_file_url_host","kind":"documentation"},{"title":"Microsoft Learn: UNC paths","url":"https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses explicit windows true and false options on the same runtime. The test performs no filesystem or network access."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A hosted file URL and a local drive-letter file URL."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The UNC path, local path in each grammar and POSIX rejection code."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"d7356384180de0567d798ae7e6190a6d6da5ae5821cbe7993aa038b49c7de534"}}},"markdown":"# Windows mode converts a hosted file URL to a UNC path\n\nIn Windows mode, `file://nas/exports/orders.csv` converts to\n`\\\\nas\\exports\\orders.csv`. That UNC path names a file on a share. Node’s POSIX\nconversion rejects the same non-local host.\n\n## Observed behaviour\n\nWith `fileURLToPath(url, { windows: true })`, the hosted URL became a UNC path\nand the local URL became a drive path. The explicit POSIX option rejected the hosted URL and\nreturned `/C:/exports/orders.csv` for the local one.\n\n## Application considerations\n\nConvert stored file URLs according to the environment that will use the path. A\npath can parse successfully in its target grammar even when the named file or\nshare is unavailable.\n","fixtureContents":{"input":"{\n \"remote\": \"file://nas/exports/orders.csv\",\n \"local\": \"file:///C:/exports/orders.csv\"\n}\n","expected":"{\n \"remoteWindows\": \"\\\\\\\\nas\\\\exports\\\\orders.csv\",\n \"localWindows\": \"C:\\\\exports\\\\orders.csv\",\n \"localPosix\": \"/C:/exports/orders.csv\",\n \"error\": \"ERR_INVALID_FILE_URL_HOST\"\n}\n"}},{"metadata":{"id":"file-url-reserved-filename","title":"A filename containing # or % needs file URL conversion","summary":"pathToFileURL() encodes literal hash and percent characters. Interpolating the same path into a file URL can change the filename.","category":"filesystem-and-paths","references":[{"title":"Node.js: pathToFileURL()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlpathtofileurlpath-options","kind":"documentation"},{"title":"Node.js: fileURLToPath()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#urlfileurltopathurl-options","kind":"documentation"},{"title":"WHATWG URL Standard: URL parsing","url":"https://url.spec.whatwg.org/#concept-url-parser","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the explicit POSIX conversion mode. No filesystem access is required."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An absolute POSIX path containing a literal percent-escape lookalike and a hash."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The encoded URL and pathname, and the altered path and fragment from direct interpolation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"70e558e0a5b73a5b60b2b68abcb6416c88a674335b2bf3602cc219f5627a2a5c"}}},"markdown":"# A filename containing # or % needs file URL conversion\n\nThe file named `/exports/part%20#2.csv` contains a literal percent sign\nand hash. In a URL, `%20` represents a space and `#` starts a fragment.\n`pathToFileURL()` encodes both characters so `fileURLToPath()` can recover\nthe original name.\n\n## Observed behaviour\n\nIn Node’s explicit POSIX mode the conversion round-tripped the full path.\nDirect interpolation into a `file:` URL produced a fragment of `#2.csv`\nand decoded the filesystem path as `/exports/part `, ending in a space.\nThe correctly encoded URL ends in `part%2520%232.csv`. Its `pathname` still\nhas those escapes because it is a URL component. Use `fileURLToPath()` to get\nthe native filename.\n\n## Application considerations\n\nUse the filesystem path converters at the boundary between native paths and\nfile URLs, such as when resolving import locations supplied as filenames.\nKeep the literal `%20` in the fixture to catch double decoding as well as\nfragment loss.\n","fixtureContents":{"input":"{\n \"path\": \"/exports/part%20#2.csv\"\n}\n","expected":"{\n \"url\": \"file:///exports/part%2520%232.csv\",\n \"pathname\": \"/exports/part%2520%232.csv\",\n \"interpolatedPath\": \"/exports/part \",\n \"interpolatedHash\": \"#2.csv\"\n}\n"}},{"metadata":{"id":"filehandle-readfile-current-position","title":"FileHandle.readFile() starts at the current file position","summary":"Reading a header with a FileHandle can advance its cursor, leaving readFile() to return only the remaining bytes.","category":"filesystem-and-paths","references":[{"title":"Node.js: FileHandle.read()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlereadbuffer-offset-length-position","kind":"documentation"},{"title":"Node.js: FileHandle.readFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlereadfileoptions","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a regular, seekable file. The reproducer opens independent handles for the two read modes."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Length of the four-byte EVT1 signature. The first record starts after the signature and its line feed."},{"id":"file","file":"records.txt","format":"text","role":"input","description":"ASCII signature EVT1 followed by a line feed and two records. The file ends with a line feed."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Header bytes and the text returned by readFile() after sequential and explicitly positioned reads."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"41ffb0a6eb7ec713ee4774fc6554612118e8e64a71fdfcb9f8c7223f4366276e"}}},"markdown":"# FileHandle.readFile() starts at the current file position\n\nAfter reading the four-byte `EVT1` signature using a file handle,\n`handle.readFile()` can return only the bytes following the signature.\nA read with `position: null` uses and advances the handle’s current\nposition. An explicit numeric position reads without moving that cursor.\n\n## Observed behaviour\n\nReading the same signature at position `null` and at position `0` returned\nthe same four bytes from two fresh handles. The next `readFile()` started\nafter the signature in the first case and at the start of the file in the\nsecond.\n\n## Application considerations\n\nWhen sniffing a file format before sending the whole file to a parser, use\na positioned header read such as `handle.read(buffer, 0, 4, 0)`, or reopen the\nfile before passing it on. A sequential read is useful\nwhen the parser expects only the remaining bytes.\n","fixtureContents":{"input":"{\n \"headerBytes\": 4\n}\n","file":"EVT1\naccepted\nqueued\n","expected":"{\n \"header\": \"EVT1\",\n \"afterSequentialRead\": \"\\naccepted\\nqueued\\n\",\n \"afterPositionedRead\": \"EVT1\\naccepted\\nqueued\\n\"\n}\n"}},{"metadata":{"id":"filehandle-writefile-leaves-tail","title":"FileHandle.writeFile() can leave bytes from a longer file","summary":"Writing a shorter document to an existing r+ handle leaves a stale suffix. Opening the pathname with the default w flag truncates it.","category":"filesystem-and-paths","relatedCases":["filehandle-readfile-current-position"],"references":[{"title":"Node.js: FileHandle.writeFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#filehandlewritefiledata-options","kind":"documentation"},{"title":"Node.js: File system flags r+ and w","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#file-system-flags","kind":"documentation"},{"title":"Node.js issue #22554: writeFile on an existing descriptor","url":"https://github.com/nodejs/node/issues/22554","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a fresh r+ handle at byte zero and two ASCII JSON strings without final newlines."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Old and replacement JSON text, with a shorter replacement."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Byte-for-byte contents after writing through the existing handle."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"e49c357f3c82c806185f5bd7257a63c1ca9ca333ee0a3d69e78d7960963db33b"}}},"markdown":"# FileHandle.writeFile() can leave bytes from a longer file\n\nWriting `{\"state\":\"ok\"}` to an existing handle opened with `r+` can leave bytes\nfrom `{\"state\":\"previous\"}` at the end of the file. The handle writes the\nsupplied bytes from its cursor. Calling `fs.writeFile()` on a pathname opens\nwith `w` by default to truncate the file before writing.\n\n## Observed behaviour\n\nFrom the start of the `r+` handle, the shorter write produced\n`{\"state\":\"ok\"}ious\"}`. The trailing bytes came from the old document, so\n`JSON.parse()` rejected the result. Writing the same replacement through the pathname’s default\n`w` open produced valid JSON.\n\n## Application considerations\n\nUse a pathname write with the default `w` flag when replacing complete\ncontent. If you reuse a handle, write from the start and set the file length\nexplicitly so old trailing bytes are removed.\nChoose a separate temporary-file and rename workflow if readers require atomic\nreplacement.\n","fixtureContents":{"input":"{\n \"older\": \"{\\\"state\\\":\\\"previous\\\"}\",\n \"replacement\": \"{\\\"state\\\":\\\"ok\\\"}\"\n}\n","expected":"{\n \"leftover\": \"{\\\"state\\\":\\\"ok\\\"}ious\\\"}\"\n}\n"}},{"metadata":{"id":"float32-nodata-sentinel-rounding","title":"A Float32 no-data sentinel can differ from its JSON number","summary":"A binary32 raster sample rounds the configured no-data value. Compare using the sample precision before filtering invalid measurements.","category":"data-formats","relatedCases":["pcap-header-byte-order"],"references":[{"title":"ECMAScript: Math.fround and Float32 rounding","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-math.fround","kind":"specification"},{"title":"ECMAScript: DataView.prototype.getFloat32","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-dataview.prototype.getfloat32","kind":"specification"},{"title":"GDAL RFC 15: raster no-data and masks","url":"https://gdal.org/en/stable/development/rfc/rfc15_nodatabitmask.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixture is a synthetic band payload with four little-endian float32 samples. It has no enclosing raster container."},"fixtures":[{"id":"sample-band","file":"samples.bin","format":"binary","role":"input","description":"Four little-endian Float32 samples from a synthetic raster band. Read each group of four bytes as one sample. The second is the no-data marker."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Decimal JSON metadata declaring the binary32 no-data sentinel."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The decoded band and the valid samples after removing no-data."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ab8f8ed95c06111482e90ac8cb5ec5133a27a721c56aae21f0c732fc14990935"}}},"markdown":"# A Float32 no-data sentinel can differ from its JSON number\n\nA raster can reserve a pixel value to mean “no measurement”. Here the JSON\nmetadata declares `-3.4028235e38` as that no-data value. The raster stores\nsamples in 32-bit floating-point format (binary32), where the nearest value is\n`-3.4028234663852886e38`. Both values become JavaScript numbers when read,\nand they still differ.\n\n## Observed behaviour\n\nReading the four samples with `DataView.getFloat32()` and filtering by exact\nequality with the JSON number kept the no-data pixel. Applying `Math.fround()`\nto the metadata before filtering matched the stored sentinel and excluded it. The remaining samples were `1.25`, `-128.5` and `0`.\n\n## Application considerations\n\nCompare no-data values in the precision of the declared sample format, or\nconsume the format’s validity mask when provided. This fixture supplies raw band\nbytes alongside the metadata.\n","fixtureContents":{"sample-band":"AACgP///f/8AgADDAAAAAA==","input":"{\n \"noData\": -3.4028235e+38\n}\n","expected":"{\n \"samples\": [\n 1.25,\n -3.4028234663852886e+38,\n -128.5,\n 0\n ],\n \"valid\": [\n 1.25,\n -128.5,\n 0\n ]\n}\n"}},{"metadata":{"id":"form-query-repeated-keys","title":"URLSearchParams.get() returns the first repeated value","summary":"Use URLSearchParams.getAll() to read duplicate query parameters in the order they appeared.","category":"web-platform","references":[{"title":"WHATWG URL Standard — application/x-www-form-urlencoded parsing","url":"https://url.spec.whatwg.org/#urlencoded-parsing","kind":"specification"},{"title":"WHATWG URL Standard: URLSearchParams.get","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-get","kind":"specification"},{"title":"WHATWG URL Standard — URLSearchParams.getAll","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-getall","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"raw-query","file":"query.txt","format":"text","role":"input","description":"Raw query with repeated tags, bare and encoded plus signs, and two kinds of empty field. Pass the bytes as UTF-8 text directly to URLSearchParams."},{"id":"decoded-query","file":"expected.json","format":"json","role":"expected","description":"Decoded entries in encounter order and all values for the tag key."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"fdcb0b57718088a5bf258972f7b33c7e4fae9e5845f60fcd579d09a034ace5d3"}}},"markdown":"# URLSearchParams.get() returns the first repeated value\n\nFor `tag=tea&tag=coffee`, `URLSearchParams.get(\"tag\")` returns `\"tea\"`.\n`getAll(\"tag\")` returns both values in input order. Form query parsing keeps one\nentry per pair, even when several pairs share a name.\n\n## Observed behaviour\n\nIn Node, `getAll(\"tag\")` returned `[\"red tea\", \"red+tea\", \"green\"]` for the\nfixture and `get(\"tag\")` returned `\"red tea\"`. The fixture also distinguishes\nthree form decoding details.\n\n- A bare plus becomes a space. The parser decodes `red+tea` as `red tea` and\n `red%2Btea` as `red+tea`.\n- A bare field (`flag`) and an explicitly empty field (`empty=`) both yield\n `\"\"`.\n- An absent name yields `null` from `get()`.\n\n## Application considerations\n\nUse `getAll()` when repeated fields represent a list. For a field that should\noccur once, decide whether to reject duplicates or select one before converting\nthe query into a single-value record.\n","fixtureContents":{"raw-query":"tag=red+tea&tag=red%2Btea&flag&empty=&tag=green","decoded-query":"{\n \"entries\": [\n [\"tag\", \"red tea\"],\n [\"tag\", \"red+tea\"],\n [\"flag\", \"\"],\n [\"empty\", \"\"],\n [\"tag\", \"green\"]\n ],\n \"tags\": [\"red tea\", \"red+tea\", \"green\"]\n}\n"}},{"metadata":{"id":"formdata-blob-filename","title":"FormData gives an unnamed Blob the filename blob","summary":"FormData uses blob as the default filename of a bare Blob. The form field keeps the name passed as the first argument to append().","category":"web-platform","references":[{"title":"XMLHttpRequest Standard: FormData.append()","url":"https://xhr.spec.whatwg.org/#dom-formdata-append","kind":"specification"},{"title":"HTML Standard: creating a form entry","url":"https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry","kind":"specification"},{"title":"RFC 7578: Content-Disposition and filenames","url":"https://www.rfc-editor.org/rfc/rfc7578.html#section-4.2","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Tests Node’s Request multipart serialisation and parsing. The generated boundary is intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"CSV content, media type, multipart field and explicit filename. Both variants send the same bytes."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The filename that appears in each file part and its Content-Disposition header."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"fd0f85e98c4aaea39046cc724fc28a7023461c79ce792a1fd64c5db056e6cb0b"}}},"markdown":"# FormData gives an unnamed Blob the filename blob\n\nAppending a bare `Blob` to `FormData` creates a file entry with the\ndefault filename `blob`. The form entry algorithm converts the Blob to a\nFile and uses the optional third argument to override that name. A generated\nCSV can therefore reach a service with the right bytes and an unexpected\nfilename.\n\n## Observed behaviour\n\nNode serialised `filename=\"blob\"` without a third argument and\n`filename=\"daily.csv\"` with one. Parsing those multipart requests reproduced\nthe same CSV data and media type, with the corresponding filenames.\n\n## Application considerations\n\nSupply a filename with `form.append(fieldName, csvBlob, \"daily.csv\")` when the\nreceiver uses it for display, routing or extension checks. The first argument\nstill controls the name of the form field. Test the multipart part’s\ndisposition separately from its content and media type.\n","fixtureContents":{"input":"{\n \"field\": \"attachment\",\n \"name\": \"daily.csv\",\n \"type\": \"text/csv\",\n \"text\": \"queue,count\\npending,2\\n\"\n}\n","expected":"{\n \"defaultName\": \"blob\",\n \"explicitName\": \"daily.csv\",\n \"defaultDisposition\": \"Content-Disposition: form-data; name=\\\"attachment\\\"; filename=\\\"blob\\\"\",\n \"explicitDisposition\": \"Content-Disposition: form-data; name=\\\"attachment\\\"; filename=\\\"daily.csv\\\"\"\n}\n"}},{"metadata":{"id":"fs-exclusive-create-competing-writes","title":"The wx flag lets one writer create a shared destination","summary":"Competing writes with the wx flag cannot both win. One creates the file and the other fails with EEXIST without overwriting it.","category":"filesystem-and-paths","references":[{"title":"Node.js: File system flags w and wx","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#file-system-flags","kind":"documentation"},{"title":"POSIX open(): O_CREAT and O_EXCL","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses two concurrent writes to a new path on a local temporary filesystem. The winner is intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two different candidate contents for one output file."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Counts and error code for losing a create race."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b31dacb05858fd10b55e80e63d2010816915ef3e0aad0c5c0750202f0bf0683b"}}},"markdown":"# The wx flag lets one writer create a shared destination\n\nTwo jobs can both see that `claimed.txt` is absent before either writes. Opening\nwith `wx` makes the existence check part of creating the file. A competing\nwriter receives `EEXIST`.\n\n## Observed behaviour\n\nIn the concurrent write test one job fulfilled and one rejected. The file\ncontained the complete contents supplied by the winner. Either job could win.\n\n## Application considerations\n\nUse an exclusive create for a destination that should be claimed once. Treat a\ncreate conflict as an expected outcome. This fixture covers a local filesystem,\nwhere the exclusive flag is meaningful.\n","fixtureContents":{"input":"{\n \"name\": \"claimed.txt\",\n \"writers\": [\n \"slot=worker-a\\n\",\n \"slot=worker-b\\n\"\n ]\n}\n","expected":"{\n \"winners\": 1,\n \"loserCode\": \"EEXIST\"\n}\n"}},{"metadata":{"id":"gzip-concatenated-members","title":"A gzip file can contain more than one compressed member","summary":"Concatenated gzip members form a valid gzip file. A decompressor that stops at the first member can silently omit later log batches.","category":"data-formats","references":[{"title":"RFC 1952: gzip file and member layout","url":"https://www.rfc-editor.org/rfc/rfc1952.html#section-2.2","kind":"specification"},{"title":"Node.js: zlib.Gunzip and concatenated members","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/zlib.html#class-zlibgunzip","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"first-member","file":"first-member.bin","format":"binary","role":"input","description":"A valid single gzip member containing the first line of a synthetic log. The decompressed line ends with LF."},{"id":"combined-members","file":"combined-members.bin","format":"binary","role":"input","description":"A complete gzip file made by appending an independently compressed second log line to first-member.bin. Pass the full byte sequence to a gzip decoder."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The exact text of both decompressed members, including trailing line feeds."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ba6c0f5f07e3606aba1640debeb7c8185c47cce509d1a5fdf2b7a1b803f42ddf"}}},"markdown":"# A gzip file can contain more than one compressed member\n\nAppending one complete gzip file to another creates a valid file with two\ngzip members. RFC 1952 places members directly one after another. A tool\nthat reads one member can report success and omit the second log batch.\n\n## Observed behaviour\n\nNode’s `gunzipSync()` returned both lines from the combined file. The first\nmember alone returned only the first line. The bytes after that first member\nalso decompressed independently to the second line.\n\n## Application considerations\n\nWhen importing logs or exports assembled from separately compressed batches,\ntest that the reader advances through all members. Use the combined fixture\nas an entire gzip file. Its `.bin` suffix is a corpus convention.\n","fixtureContents":{"first-member":"H4sIAAAAAAAC/zMyMDLRNTDVNTAKMTCwMjCIUkhKLEnO0E3kAgCjb7khGgAAAA==","combined-members":"H4sIAAAAAAAC/zMyMDLRNTDVNTAKMTCwMjCIUkhKLEnO0E3kAgCjb7khGgAAAB+LCAAAAAAAAv8zMjAy0TUw1TUwCjEwtDIwiFJISixJztBN4gIAFt2blxoAAAA=","expected":"{\n \"firstLine\": \"2024-05-02T00:00Z batch-a\\n\",\n \"secondLine\": \"2024-05-02T01:00Z batch-b\\n\"\n}\n"}},{"metadata":{"id":"hard-link-shares-in-place-writes","title":"A hard-linked file sees in-place writes through its other name","summary":"fs.link() creates another name for the same file. Editing one name changes the contents read through the other, while a byte copy keeps its original contents.","category":"filesystem-and-paths","references":[{"title":"Node.js: fs.link()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fslinkexistingpath-newpath-callback","kind":"documentation"},{"title":"POSIX link(): creating a new link to an existing file","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/link.html","kind":"specification"},{"title":"Node.js: fs.copyFile()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fscopyfilesrc-dest-mode-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires a temporary filesystem that supports hard links to regular files. The source and links are created on the same volume."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Names for a working file, hard link and independent copy, with the contents before and after editing."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"dfc28abd69a50b1bf83ba89bbf47fe980410c6dfafa8fcdd991dc3ddb7df53f0"}}},"markdown":"# A hard-linked file sees in-place writes through its other name\n\nAfter `fs.link()` creates a second name for a file, both names can read newly\nwritten bytes. A hard link points to the same file, so it behaves differently\nfrom a copy made for an archive.\n\n## Observed behaviour\n\nA write through the original pathname changed the contents returned from the\nhard link. A separate file made with `copyFileSync()` still returned the old\nline. The write updated the original file in place.\n\n## Application considerations\n\nUse an independent copy if a backup must preserve the previous bytes. Hard links\ncan share storage safely when some other rule makes the original content\nimmutable.\n","fixtureContents":{"input":"{\n \"source\": \"working.txt\",\n \"hardLink\": \"pinned.txt\",\n \"copy\": \"snapshot.txt\",\n \"before\": \"invoice=waiting\\n\",\n \"after\": \"invoice=done\\n\"\n}\n"}},{"metadata":{"id":"intl-default-calendar-changes-year","title":"Intl.DateTimeFormat can display year 2567 for a 2024 instant","summary":"Thai locale data selects the Buddhist calendar by default. An explicit Gregorian calendar produces a different year for the same UTC instant.","category":"dates-and-times","relatedCases":["intl-hour-cycle-midnight"],"references":[{"title":"ECMA-402: DateTimeFormat construction and calendar selection","url":"https://tc39.es/ecma402/#sec-intl.datetimeformat","kind":"specification"},{"title":"Unicode CLDR 49: supplemental calendar preferences by territory","url":"https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/supplemental/supplementalData.xml","kind":"source-data"},{"title":"Unicode LDML: calendar types and calendar preference data","url":"https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Data","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses ICU 79.1 and CLDR 49.0 in the recorded run with Thai locale data and explicit Latin digits."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An instant in 2024, a Thai locale and a Gregorian override."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Resolved calendar identifiers and rendered year fields."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b1b988f20aaf4d41f32ace8803ae11bfc0e3730db275bda71b86bbdc0fa14214"}}},"markdown":"# Intl.DateTimeFormat can display year 2567 for a 2024 instant\n\nThe Thai locale can display Gregorian year `2024` as Buddhist year `2567`.\n`Intl.DateTimeFormat` chooses a calendar from locale data unless the caller\nprovides a calendar option.\n\n## Observed behaviour\n\nFor the same UTC instant, Node resolved the Thai formatter’s default to\n`buddhist`. Selecting `gregory` produced `2024`. The test reads the year field\nand selects Latin digits so typography and era suffixes play no role.\n\n## Application considerations\n\nLet the locale choose the calendar when the display should follow the reader’s\nconventions. Set `calendar: \"gregory\"` when a form or report specifically calls\nfor a Gregorian year. Store and exchange the timestamp independently of its\ndisplay format.\n","fixtureContents":{"input":"{\n \"instant\": \"2024-01-01T00:00:00Z\",\n \"locale\": \"th-TH\",\n \"override\": \"gregory\"\n}\n","expected":"{\n \"localeDefault\": {\n \"calendar\": \"buddhist\",\n \"year\": \"2567\"\n },\n \"gregorian\": {\n \"calendar\": \"gregory\",\n \"year\": \"2024\"\n }\n}\n"}},{"metadata":{"id":"intl-hour-cycle-midnight","title":"Intl.DateTimeFormat can display 00:30 as 24:30","summary":"The h24 hour cycle labels the zero hour as 24. h23 formats the same instant with hour 00.","category":"dates-and-times","references":[{"title":"ECMA-402: FormatDateTimePattern hour field","url":"https://tc39.es/ecma402/#sec-formatdatetimepattern","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses en-GB with explicit UTC, hour cycles and Latin numerals. Observed with ICU 79.1 and CLDR 49.0."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A half hour after midnight and a midday control, both in UTC."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Hour and minute field values for each cycle, independent of punctuation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"dd85bc767b85ef2829cbfbfe15d1a9e658903744a45f802d857bda03a6a1031f"}}},"markdown":"# Intl.DateTimeFormat can display 00:30 as 24:30\n\nThe instant `2024-01-01T00:30:00Z` can display with an hour field of `24`.\nECMA-402’s `h24` cycle numbers hours from 1 through 24. Its `h23` cycle uses 0\nthrough 23.\n\n## Observed behaviour\n\nFor `00:30` UTC, the `h23` formatter produced hour `00` and the `h24`\nformatter produced hour `24`. Both produced hour `12` for `12:30` UTC. The test\nreads the hour and minute fields with `formatToParts()`, independent of the\nlocale’s punctuation.\n\n## Application considerations\n\nSet `hourCycle: \"h23\"` when a 24-hour display contract expects `00` at midnight.\nUse a machine timestamp to exchange instants, since a formatted display can use\nconventions that a parser rejects.\n","fixtureContents":{"input":"{\n \"midnight\": \"2024-01-01T00:30:00Z\",\n \"midday\": \"2024-01-01T12:30:00Z\",\n \"locale\": \"en-GB\"\n}\n","expected":"{\n \"h23\": [\n [\n \"00\",\n \"30\"\n ],\n [\n \"12\",\n \"30\"\n ]\n ],\n \"h24\": [\n [\n \"24\",\n \"30\"\n ],\n [\n \"12\",\n \"30\"\n ]\n ]\n}\n"}},{"metadata":{"id":"json-duplicate-keys","title":"JSON.parse() keeps the last value for duplicate keys","summary":"When a JSON object repeats a property name, JavaScript overwrites the earlier value during parsing.","category":"data-formats","relatedCases":["json-integer-precision"],"references":[{"title":"ECMAScript 2026: JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"},{"title":"RFC 8259 §4: JSON objects and duplicate names","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-4","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Other JSON parsers may reject duplicates or report them differently."},"fixtures":[{"id":"repeated-property","file":"input.json","format":"json","role":"input","description":"Raw JSON containing two quantity properties in encounter order."},{"id":"parsed-object","file":"expected.json","format":"json","role":"expected","description":"The order line after JavaScript retained the final quantity."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5cca9331fcc55abd4c16e6584a3beef13258120624829cea5811230dac1f213c"}}},"markdown":"# JSON.parse() keeps the last value for duplicate keys\n\n`JSON.parse('{\"quantity\":1,\"quantity\":3}')` returns an object with\n`quantity: 3`. ECMAScript gives later values precedence when a JSON object\nrepeats a property name. RFC 8259 recommends unique names for interoperability.\nDifferent parsers can handle duplicates differently.\n\n## Observed behaviour\n\nNode kept the final quantity from the raw JSON fixture. Its reviver saw\nonly the surviving value, so it could not identify the two occurrences.\nCopy the input as raw text. Parsing it and writing it back removes the\nduplicate that makes the fixture useful.\n\n## Application considerations\n\nWhen duplicate keys are invalid for an import or an API, check the original\npayload with a parser that can detect them. Validation of the object returned\nby `JSON.parse()` only sees the surviving property.\n","fixtureContents":{"repeated-property":"{\n \"sku\": \"tea-01\",\n \"quantity\": 1,\n \"quantity\": 3\n}\n","parsed-object":"{\n \"sku\": \"tea-01\",\n \"quantity\": 3\n}\n"}},{"metadata":{"id":"json-integer-precision","title":"JSON.parse can round large integer IDs","summary":"Distinct JSON numbers can become the same JavaScript value outside the safe integer range.","category":"data-formats","references":[{"title":"RFC 8259 §6 — JSON numbers and interoperability","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-6","kind":"specification"},{"title":"ECMAScript 2026 — JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"This observation applies to ECMAScript Number values. Other JSON parsers may preserve larger integers."},"fixtures":[{"id":"number-literals","file":"input.json","format":"json","role":"input","description":"Raw JSON with adjacent large integer literals and a quoted decimal string."},{"id":"parsed-values","file":"expected.json","format":"json","role":"expected","description":"Values produced by JSON.parse with the large unquoted integer rounded."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ca65c795e0fdec3fc5bd67fa8d267306bef540c7c6d05cc2929904a9309520cb"}}},"markdown":"# JSON.parse can round large integer IDs\n\n`JSON.parse(\"9007199254740993\")` returns `9007199254740992`. A JavaScript\n`Number` has enough precision for every integer through `2^53 - 1` in\nmagnitude. At `2^53`, the gap to the next representable number is two,\nso the next integer rounds to a neighbour. RFC 8259 identifies the safe\ninteger range as the interoperable range for binary64 JSON parsers.\n\n## Observed behaviour\n\nIn Node, the unquoted integers `9007199254740992` and `9007199254740993` parsed\nto the same number. The quoted value `\"9007199254740993\"` preserved every digit.\nUse the raw input fixture when testing a parser so it receives the original\nliterals.\n\n## Application considerations\n\nIf identifiers can exceed the safe integer range, agree on decimal strings in\nthe wire format. Converting an already parsed number to a string preserves the\nrounded value. Other JSON parsers may use a number representation that preserves\nlarger integers.\n","fixtureContents":{"number-literals":"{\n \"safe\": 9007199254740991,\n \"rounded\": 9007199254740993,\n \"sameValue\": 9007199254740992,\n \"exact\": \"9007199254740993\"\n}\n","parsed-values":"{\n \"safe\": 9007199254740991,\n \"rounded\": 9007199254740992,\n \"sameValue\": 9007199254740992,\n \"exact\": \"9007199254740993\"\n}\n"}},{"metadata":{"id":"json-merge-patch-replaces-arrays","title":"JSON Merge Patch replaces whole arrays","summary":"SQLite json_patch() merges object members recursively and replaces an entire array when the patch supplies one.","category":"data-formats","relatedCases":["json-stringify-undefined"],"references":[{"title":"RFC 7396: JSON Merge Patch processing","url":"https://www.rfc-editor.org/rfc/rfc7396.html#section-2","kind":"specification"},{"title":"SQLite json_patch()","url":"https://www.sqlite.org/json1.html#jpatch","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses SQLite’s implementation of RFC 7396 through node:sqlite."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A settings document and patch with parallel object and array updates."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The merged object and replacement array."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f75cd33d9e76c79b7344e3adee547bd9c22c37246e16e74595e99ae3d6826414"}}},"markdown":"# JSON Merge Patch replaces whole arrays\n\nA JSON Merge Patch with `\"channels\":[\"push\"]` replaces the complete channel\nlist. A patch with `\"view\":{\"theme\":\"dark\"}` updates the theme while preserving\nother members of that object. RFC 7396 applies recursive merging to object\nmembers and treats arrays as whole values.\n\n## Observed behaviour\n\nWith the settings fixture, SQLite’s `json_patch()` changed the theme to\n`dark` and kept the existing density. The channel list contained only `push`.\nThe earlier selections disappeared even though the patch did not name them.\n\n## Application considerations\n\nUse merge patch when the caller supplies the desired full array. If a client\nsends only a newly selected channel expecting the update to keep the old ones,\nexpose an operation that appends individual choices.\n","fixtureContents":{"input":"{\n \"original\": {\n \"view\": {\n \"density\": \"compact\",\n \"theme\": \"light\"\n },\n \"channels\": [\n \"email\",\n \"sms\"\n ]\n },\n \"patch\": {\n \"view\": {\n \"theme\": \"dark\"\n },\n \"channels\": [\n \"push\"\n ]\n }\n}\n","expected":"{\n \"view\": {\n \"density\": \"compact\",\n \"theme\": \"dark\"\n },\n \"channels\": [\n \"push\"\n ]\n}\n"}},{"metadata":{"id":"json-reviver-deletes-array-slot","title":"A JSON.parse() reviver can leave a hole in an array","summary":"Returning undefined from the reviver deletes an array property while preserving the length and later indices.","category":"data-formats","relatedCases":["json-stringify-undefined"],"references":[{"title":"ECMAScript: InternalizeJSONProperty","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-internalizejsonproperty","kind":"specification"},{"title":"ECMAScript: Array.prototype.map","url":"https://tc39.es/ecma262/2026/multipage/indexed-collections.html#sec-array.prototype.map","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"queue-json","file":"queue.json","format":"json","role":"input","description":"Raw JSON with an explicit null between two job IDs. Feed the text to JSON.parse() with a reviver."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The preserved length and callback indices for the dense and sparse forms."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5dd4eb1c25bd9abdf4a0f237ea90b8775c1079255a04de2a1dc6494ee6f6876e"}}},"markdown":"# A JSON.parse() reviver can leave a hole in an array\n\nA `JSON.parse()` reviver that returns `undefined` for the middle element of\n`[\"A10\",null,\"A12\"]` deletes the property at index 1. The array keeps its length\nand `A12` stays at index 2. Array methods such as `map()` skip that hole.\n\n## Observed behaviour\n\nThe revived array still had length three. `Object.hasOwn(array, 1)` went from\n`true` to `false`, and `map()` visited indices 0 and 2. Stringifying the array\nproduced `[\"A10\",null,\"A12\"]` because JSON uses `null` in place of the hole.\n\n## Application considerations\n\nFilter the parsed array explicitly when null placeholders should be removed and\nindices may move. Keep explicit nulls when the three positions belong to fixed\nfields.\n","fixtureContents":{"queue-json":"{\n \"queue\": [\n \"A10\",\n null,\n \"A12\"\n ]\n}\n","expected":"{\n \"length\": 3,\n \"dense\": [\n 0,\n 1,\n 2\n ],\n \"sparse\": [\n 0,\n 2\n ]\n}\n"}},{"metadata":{"id":"json-stringify-undefined","title":"JSON.stringify() omits undefined object properties","summary":"An undefined object property disappears from JSON, while an undefined array entry becomes null.","category":"data-formats","references":[{"title":"ECMAScript 2026: JSON.stringify","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.stringify","kind":"specification"},{"title":"ECMAScript 2026: SerializeJSONObject and SerializeJSONArray","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-serializejsonobject","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"property-and-array-inputs","file":"input.json","format":"json","role":"input","description":"Set the named property to undefined and replace the array placeholder at undefinedIndex with undefined before serialising."},{"id":"serialised-values","file":"expected.json","format":"json","role":"expected","description":"Exact JSON output for an undefined object property, an explicit null and an undefined array entry."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5eb41f9018ddcf10b43e2712f90268a9895f5a081e9aa71357bc4e1e2d1e1760"}}},"markdown":"# JSON.stringify() omits undefined object properties\n\n`JSON.stringify({ nickname: undefined })` produces `{}`.\n`JSON.stringify([undefined])` produces `[null]`. ECMAScript leaves\nundefined properties out of JSON objects and writes `null` at undefined\narray positions, keeping the array’s length and ordering.\n\n## Observed behaviour\n\nNode omitted the object property set to `undefined` and kept the same\nproperty when set to `null`. In the array, the undefined entry came out\nas `null` between the two strings. The input fixture describes where to\ninsert `undefined` in JavaScript because JSON has no `undefined` literal.\n\n## Application considerations\n\nA profile form can start with an unset `nickname`. For a patch endpoint\nwhere omission means “leave unchanged”, assigning `undefined` sends no update.\nSending an explicit `null` can mean “clear this value” if the endpoint supports\nit. Test the JSON body that reaches the API. If an array needs to\ndistinguish two kinds of empty entry, give them distinct JSON representations.\n","fixtureContents":{"property-and-array-inputs":"{\n \"property\": \"nickname\",\n \"array\": [\n \"tea\",\n \"replace me\",\n \"coffee\"\n ],\n \"undefinedIndex\": 1\n}\n","serialised-values":"{\n \"undefinedProperty\": \"{}\",\n \"nullProperty\": \"{\\\"nickname\\\":null}\",\n \"undefinedArrayEntry\": \"[\\\"tea\\\",null,\\\"coffee\\\"]\"\n}\n"}},{"metadata":{"id":"lord-howe-dst-gap","title":"Lord Howe’s DST gap shifts local times by 30 minutes","summary":"Date moves a nonexistent local time from 02:15 to 02:45 during Lord Howe’s daylight-saving transition.","category":"dates-and-times","relatedCases":["date-only-utc","dst-repeated-local-time"],"references":[{"title":"ECMAScript 2026 — UTC conversion at local time transitions","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-utc-t","kind":"specification"},{"title":"IANA time zone database 2026e — Australasia, Lord Howe Island rules","url":"https://data.iana.org/time-zones/tzdb-2026e/australasia","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires Australia/Lord_Howe rules for the October 2024 transition."},"fixtures":[{"id":"transition-times","file":"input.json","format":"json","role":"input","description":"Offsetless local timestamps before, during and after the spring gap."},{"id":"resolved-times","file":"expected.json","format":"json","role":"expected","description":"getTimezoneOffset values (UTC minus local time, in minutes), and the instant and local time resolved from the gap."}],"verification":{"timeZone":"Australia/Lord_Howe","evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","tzdataVersion":"2026e","scenarioHash":"87f2a483350c01d748f2ee691b7563f69592324331e15cc759e5f4319fc95db5"}}},"markdown":"# Lord Howe’s DST gap shifts local times by 30 minutes\n\nOn 6 October 2024 in `Australia/Lord_Howe`, an appointment entered at `02:15`\nresolves to `02:45`. At the spring-forward transition, the clock jumped from\n`02:00` to `02:30` as the offset changed from UTC+10:30 to UTC+11:00. For a\nnonexistent local time, the ECMAScript `Date` conversion uses the offset from\nbefore the transition. That places the resolved instant 30 minutes later on\nthe local clock than the requested fields.\n\n## Observed behaviour\n\nWith `Australia/Lord_Howe` selected, Node resolved `2024-10-06T02:15:00` to\n`2024-10-05T15:45:00.000Z`, which displays as `02:45` locally. Only one elapsed\nminute separated `01:59` from `02:30`. The expected fixture records\n`getTimezoneOffset()` in minutes as UTC minus local time, so UTC+10:30 appears\nas `-630`.\n\n## Application considerations\n\nFor appointments entered as local clock times, decide whether to reject a\nskipped time, move it or ask the user to choose. Comparing the requested fields\nwith the resolved instant’s local fields in the same zone exposes the shift.\n","fixtureContents":{"transition-times":"{\n \"beforeGap\": \"2024-10-06T01:59:00\",\n \"inGap\": \"2024-10-06T02:15:00\",\n \"afterGap\": \"2024-10-06T02:30:00\"\n}\n","resolved-times":"{\n \"offsetBeforeInMinutes\": -630,\n \"offsetAfterInMinutes\": -660,\n \"resolvedInstant\": \"2024-10-05T15:45:00.000Z\",\n \"resolvedLocalHour\": 2,\n \"resolvedLocalMinute\": 45\n}\n"}},{"metadata":{"id":"mkdtemp-prefix-needs-separator","title":"mkdtemp() appends to its prefix and can create a sibling","summary":"Passing a directory path as the mkdtemp() prefix creates a sibling whose name starts with that path. A trailing separator makes the result a child.","category":"filesystem-and-paths","references":[{"title":"Node.js fs.mkdtemp() prefix and directory separator","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fsmkdtempprefix-options-callback","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the host platform’s directory separator. Random suffix contents are intentionally unspecified."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Name of the existing subdirectory to pass with and without a trailing separator."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Whether the generated directory is directly inside the intended directory."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3523d5fe5b8f056d89bb59886f70259c5efa45757dfdb4bc88cdb74d0431ae7d"}}},"markdown":"# mkdtemp() appends to its prefix and can create a sibling\n\nGiven an existing directory named `cache`, `mkdtemp(cachePath)` can create a\nsibling named `cacheRANDOM`. The function appends characters to the supplied\nprefix. Passing `cachePath` followed by the platform separator puts the suffix\ninside `cache`.\n\n## Observed behaviour\n\nIn Node, the bare prefix produced a child of the containing directory whose\nbasename started with `cache`. The prefix ending in a separator produced a\ndirectory directly under `cache`.\n\n## Application considerations\n\nWhen cleanup only scans the managed cache directory, a sibling will be left\nbehind. Pass `cachePath + path.sep` to put the random name inside the cache, or\nuse `path.join(cachePath, \"job-\")` to add a name prefix within that directory.\n","fixtureContents":{"input":"{\n \"folder\": \"cache\"\n}\n","expected":"{\n \"prefixOnly\": false,\n \"directoryPrefix\": true\n}\n"}},{"metadata":{"id":"multiple-set-cookie-headers","title":"Multiple Set-Cookie headers cannot be split on commas","summary":"An Expires date contains a comma. Headers.getSetCookie() preserves each Set-Cookie field value separately.","category":"web-platform","references":[{"title":"WHATWG Fetch Standard: Headers.getSetCookie()","url":"https://fetch.spec.whatwg.org/#dom-headers-getsetcookie","kind":"specification"},{"title":"WHATWG Fetch Standard: Forbidden response-header names","url":"https://fetch.spec.whatwg.org/#forbidden-response-header-name","kind":"specification"},{"title":"RFC 6265: Set-Cookie examples and syntax","url":"https://www.rfc-editor.org/rfc/rfc6265.html#section-3","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Verified with Node’s Headers. Browser fetch filters Set-Cookie from network responses."},"fixtures":[{"id":"cookie-header-fields","file":"input.json","format":"json","role":"input","description":"Two separate Set-Cookie values. The first has an Expires attribute containing a comma."},{"id":"cookie-header-results","file":"expected.json","format":"json","role":"expected","description":"Results of reading each field value separately and of splitting the combined string on commas."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"45c36cd9f0b35c98e57678714e80c1ec6077d8191b6ed198ed38be0d492540bd"}}},"markdown":"# Multiple Set-Cookie headers cannot be split on commas\n\n`Expires=Wed, 21 Oct 2037 07:28:00 GMT` contains a comma inside a single\n`Set-Cookie` field. Splitting a combined header string on commas breaks that\ndate apart. The Fetch API’s `Headers.getSetCookie()` gives you the\nindividual field values directly.\n\n## Observed behaviour\n\nNode’s `Headers` exposed both complete values via `getSetCookie()`.\nSplitting the string from `get(\"Set-Cookie\")` produced three fragments\ninstead of two values because it split the expiry date.\n\n## Application considerations\n\nWhen forwarding response cookies on the server, iterate over\n`headers.getSetCookie()` and append one `Set-Cookie` field for each value. Browser Fetch filters `Set-Cookie` from the response headers\nmade available to page scripts, so these assertions use server-side\n`Headers`.\n","fixtureContents":{"cookie-header-fields":"[\n \"session=example; Expires=Wed, 21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n]\n","cookie-header-results":"{\n \"separateValues\": [\n \"session=example; Expires=Wed, 21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n ],\n \"commaSplit\": [\n \"session=example; Expires=Wed\",\n \"21 Oct 2037 07:28:00 GMT; Path=/\",\n \"theme=dark; Path=/\"\n ]\n}\n"}},{"metadata":{"id":"path-join-versus-resolve-root","title":"path.join() and path.resolve() handle a later absolute segment differently","summary":"Node’s POSIX join appends the segment, while resolve starts from a later absolute path and discards earlier segments.","category":"filesystem-and-paths","relatedCases":["windows-drive-relative-path"],"references":[{"title":"Node.js: path.join()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#pathjoinpaths","kind":"documentation"},{"title":"Node.js: path.resolve()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#pathresolvepaths","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses path.posix with explicit absolute bases. The reproducer performs no filesystem operations."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A base directory and otherwise identical destination strings with and without a leading slash."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Results for the absolute and relative arguments."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"95f78dfb2876d39d7ab1d81e6ff1302f2e6edfa3187c9e846342623399a9522e"}}},"markdown":"# path.join() and path.resolve() handle a later absolute segment differently\n\nGiven `/imports/staged` and `/archive/report.csv`, `path.posix.join()` keeps\nboth segments. `path.posix.resolve()` scans from the right and anchors the\nresult at the later absolute path.\n\n## Observed behaviour\n\nNode returned `/imports/staged/archive/report.csv` from `join()` and\n`/archive/report.csv` from `resolve()`. Both APIs kept the base when the\ndestination omitted the leading slash.\n\n## Application considerations\n\nDecide whether a machine-specific absolute setting should override the\napplication’s default directory. Test both forms when refactoring configuration\ncode between the two APIs.\n","fixtureContents":{"input":"{\n \"base\": \"/imports/staged\",\n \"absolute\": \"/archive/report.csv\",\n \"relative\": \"archive/report.csv\"\n}\n","expected":"{\n \"joinAbsolute\": \"/imports/staged/archive/report.csv\",\n \"resolveAbsolute\": \"/archive/report.csv\",\n \"relative\": \"/imports/staged/archive/report.csv\"\n}\n"}},{"metadata":{"id":"pcap-header-byte-order","title":"A classic PCAP header can use either byte order","summary":"Classic PCAP’s opening bytes indicate how to read multibyte header fields. DataView’s default order misreads fields from a little-endian capture.","category":"data-formats","references":[{"title":"libpcap: pcap-savefile file header","url":"https://github.com/the-tcpdump-group/libpcap/blob/master/pcap-savefile.manfile.in","kind":"documentation"},{"title":"IETF PCAP Capture File Format Internet-Draft: File header","url":"https://datatracker.ietf.org/doc/html/draft-ietf-opsawg-pcap-09#section-4","kind":"documentation"},{"title":"ECMAScript: DataView.prototype.getUint32()","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-dataview.prototype.getuint32","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Covers the two microsecond-resolution classic PCAP magic values. The fixtures contain no packets."},"fixtures":[{"id":"big-endian","file":"big-endian.bin","format":"binary","role":"input","description":"Complete empty classic PCAP file with a big-endian, microsecond-resolution header, Ethernet link type and snapshot length 65535."},{"id":"little-endian","file":"little-endian.bin","format":"binary","role":"input","description":"Complete empty classic PCAP file with the same header values in little-endian byte order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The two magic byte patterns interpreted as big-endian, the common decoded header and the misread snapshot length."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"549cfb30c79b08998a42703bb7f95aa30ed02e20c382a38724f4613c12ba378b"}}},"markdown":"# A classic PCAP header can use either byte order\n\nA classic PCAP file can store the snapshot length `65535` as either\n`00 00 FF FF` or `FF FF 00 00`. The capture writer’s byte order determines\nwhich bytes appear. For microsecond-resolution PCAP files, the opening magic\nbytes distinguish the two orders. `A1 B2 C3 D4` marks big-endian fields\nand `D4 C3 B2 A1` marks little-endian fields.\n\n## Observed behaviour\n\n`DataView.getUint32()` uses big-endian order when its byte-order argument\nis omitted. Reading the little-endian fixture that way produced\n`4294901760` at the snapshot length field. Passing the order indicated\nby the magic bytes yielded the same version, snapshot length and link\ntype in both fixtures.\n\n## Application considerations\n\nRead the file’s byte order before interpreting lengths or version fields.\nThe two fixtures are complete empty captures with a 24-byte file header.\nReaders that also support nanosecond-resolution PCAP or PCAPNG need\nadditional cases for those formats.\n","fixtureContents":{"big-endian":"obLD1AACAAQAAAAAAAAAAAAA//8AAAAB","little-endian":"1MOyoQIABAAAAAAAAAAAAP//AAABAAAA","expected":"{\n \"bigEndianMagic\": 2712847316,\n \"littleEndianMagicReadAsBigEndian\": 3569595041,\n \"header\": {\n \"major\": 2,\n \"minor\": 4,\n \"snapshotLength\": 65535,\n \"linkType\": 1\n },\n \"wrongSnapshotLength\": 4294901760\n}\n"}},{"metadata":{"id":"pipeline-premature-close-prefix","title":"A stream pipeline can receive bytes and still fail with premature close","summary":"Destroying the source before its normal end makes pipeline() reject with ERR_STREAM_PREMATURE_CLOSE, even after some bytes reached the destination.","category":"runtime-and-concurrency","relatedCases":["writable-backpressure-accepted-chunk"],"references":[{"title":"Node.js: stream.pipeline()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#streampipelinesource-transforms-destination-callback","kind":"documentation"},{"title":"Node.js: ERR_STREAM_PREMATURE_CLOSE","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/errors.html#err_stream_premature_close","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses in-memory PassThrough streams. The test waits for a delivered chunk before ending or destroying the source."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A common prefix sent before clean end or premature destruction."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The pipeline error code when the source closes without ending."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"c80552ec5af4b2719cf8909162d23fc987e506cac862b1e056650c9f75c18b3b"}}},"markdown":"# A stream pipeline can receive bytes and still fail with premature close\n\nA destination can receive `job=import` and then have its stream pipeline fail.\n`pipeline()` waits for normal stream completion. A source can close after\nbeing destroyed and never signal that it reached the end of its data.\n\n## Observed behaviour\n\nBoth runs delivered the same prefix. The run that called `end()` completed. The\nrun that called `destroy()` without ending rejected with\n`ERR_STREAM_PREMATURE_CLOSE`.\n\n## Application considerations\n\nWait for pipeline completion before treating a partial export or upload as\nfinished. If consumers need atomic visibility, write to a temporary destination\nand publish only after completion.\n","fixtureContents":{"input":"{\n \"prefix\": \"job=import\\n\"\n}\n","expected":"{\n \"earlyClose\": \"ERR_STREAM_PREMATURE_CLOSE\"\n}\n"}},{"metadata":{"id":"promise-all-rejection-side-effects","title":"Promise.all() can reject before another task writes","summary":"A rejected input settles the aggregate promise while sibling operations continue. Their writes can happen after the caller starts handling the error.","category":"runtime-and-concurrency","references":[{"title":"ECMAScript: PerformPromiseAll","url":"https://tc39.es/ecma262/2026/multipage/control-abstraction-objects.html#sec-performpromiseall","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A pending audit record and the error message for the independent operation."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The append-only audit log at aggregate rejection and after the pending operation is explicitly released."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"1334ff4648f0653be23dd2a372eedff4eaafa874a25c269f5f255891d430dbaa"}}},"markdown":"# Promise.all() can reject before another task writes\n\nSuppose an import and an audit write are both in progress. If the import fails,\n`await Promise.all([importResult, auditWrite])` can throw while the audit write\nis still running. `Promise.all()` settles its own promise on the first\nrejection. It has no cancellation mechanism for the underlying operations.\n\n## Observed behaviour\n\nOne input failed while the audit write was waiting on an explicitly\ncontrolled promise. The audit log was empty when the aggregate rejected.\nAfter releasing the write, the record appeared. The fixture uses no timers\nor external storage.\n\n## Application considerations\n\nIf the error handler retries or cleans up shared resources, account for\noperations from the first attempt that may still be running. Use `Promise.allSettled()` when cleanup needs every operation to have finished,\nand inspect the results for failures. If they support cancellation,\nsignal it explicitly and still account for writes that already completed.\n","fixtureContents":{"input":"{\n \"record\": \"audit:export-requested\",\n \"failure\": \"Destination unavailable\"\n}\n","expected":"{\n \"atRejection\": [],\n \"afterPendingWrite\": [\n \"audit:export-requested\"\n ]\n}\n"}},{"metadata":{"id":"raw-deflate-versus-zlib-wrapper","title":"Raw DEFLATE and zlib-wrapped DEFLATE need different decoders","summary":"inflateRawSync() reads raw DEFLATE blocks. inflateSync() expects the zlib header and checksum around those blocks.","category":"data-formats","relatedCases":["gzip-concatenated-members"],"references":[{"title":"RFC 1950: zlib format","url":"https://www.rfc-editor.org/rfc/rfc1950.html#section-2.2","kind":"specification"},{"title":"RFC 1951: DEFLATE block format","url":"https://www.rfc-editor.org/rfc/rfc1951.html#section-3","kind":"specification"},{"title":"Node.js zlib inflate and inflateRaw","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/zlib.html#convenience-methods","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"raw-deflate","file":"raw.bin","format":"binary","role":"input","description":"Raw DEFLATE blocks for the sample reading. Supply the full bytes to a raw decoder."},{"id":"zlib-wrapped","file":"zlib.bin","format":"binary","role":"input","description":"The same blocks wrapped in zlib framing with its header and Adler-32 trailer."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The exact decoded text, including its line feed."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4f8db068868cacee26ce462a8675e84ce4e7543c2bdf20b0f94393b452dc4a2f"}}},"markdown":"# Raw DEFLATE and zlib-wrapped DEFLATE need different decoders\n\nA raw DEFLATE stream starts with compressed blocks. A zlib stream puts a header\nbefore those blocks and an Adler-32 checksum after them. A format description\nthat only says “deflate” leaves the expected framing unclear.\n\n## Observed behaviour\n\nNode decoded the two fixtures to the same reading using `inflateRawSync()` and\n`inflateSync()` respectively. Trying to inflate raw DEFLATE as a zlib stream\nproduced an incorrect header error. Decoding the wrapped fixture as raw DEFLATE\nalso raised a data error.\n\n## Application considerations\n\nCheck whether the protocol defines zlib framing before selecting a decoder. Keep\nexamples of both forms when testing imports that get data from different\nproducers.\n","fixtureContents":{"raw-deflate":"K0pNTMnMS7c1NNIz5QIA","zlib-wrapped":"eJwrSk1MycxLtzU00jPlAgAgwQPo","expected":"{\n \"reading\": \"reading=12.5\\n\"\n}\n"}},{"metadata":{"id":"read-stream-inclusive-end","title":"createReadStream() treats the end offset as inclusive","summary":"A file stream includes the byte at end. Buffer.subarray() uses an exclusive end, so the same indices select different bytes.","category":"filesystem-and-paths","relatedCases":["buffer-view-byte-range"],"references":[{"title":"Node.js fs.createReadStream() start and end offsets","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fscreatereadstreampath-options","kind":"documentation"},{"title":"Node.js Buffer.subarray() end offset","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/buffer.html#bufsubarraystart-end","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"letters","file":"letters.txt","format":"text","role":"input","description":"Six ASCII letters followed by LF. All offsets are zero-based."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Zero-based offsets for a range spanning several bytes and a range with identical start and end. Use each pair with both APIs."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The UTF-8 text selected by the stream and by the same offsets in subarray()."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"47ffd8064d0b6e71de900d7c59a9d14250ec19ca3b17e648842d7b962ad102f0"}}},"markdown":"# createReadStream() treats the end offset as inclusive\n\nFor the bytes `ABCDEF`, `createReadStream()` with `start: 2, end: 4` reads\n`CDE`. The file API counts both endpoints, while `Buffer.subarray(2, 4)` stops\nbefore `E`.\n\n## Observed behaviour\n\nNode returned three bytes from the stream and two from the view. The range with\nboth offsets at 4 yielded one byte from the file and an empty view.\n\n## Application considerations\n\nFor a non-empty range, subtract one from the exclusive slice end before passing\nit to the file stream. Handle an empty slice separately.\nInclude a single-byte range in tests so an off-by-one conversion cannot pass\nunnoticed.\n","fixtureContents":{"letters":"ABCDEF\n","input":"[\n {\n \"start\": 2,\n \"end\": 4\n },\n {\n \"start\": 4,\n \"end\": 4\n }\n]\n","expected":"[\n {\n \"file\": \"CDE\",\n \"buffer\": \"CD\"\n },\n {\n \"file\": \"E\",\n \"buffer\": \"\"\n }\n]\n"}},{"metadata":{"id":"readable-stream-tee-cancellation","title":"Cancelling one teed stream leaves its sibling readable","summary":"ReadableStream.tee() keeps the original source alive for the other branch. A branch’s cancel promise can remain pending while the sibling is active.","category":"web-platform","references":[{"title":"WHATWG Streams Standard: ReadableStream.tee()","url":"https://streams.spec.whatwg.org/#rs-tee","kind":"specification"},{"title":"WHATWG Streams Standard: ReadableStreamDefaultTee","url":"https://streams.spec.whatwg.org/#readable-stream-default-tee","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"One queued chunk and two distinct reasons for cancelling the tee’s branches."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Source cancellation calls before and after cancelling both branches, plus the chunk read by the surviving branch."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"db0578ea71c7ba7bf1728d718b19bd3004ea3aae385933ad34378b5e83f689d3"}}},"markdown":"# Cancelling one teed stream leaves its sibling readable\n\nAfter `ReadableStream.tee()` splits a stream, cancelling a preview branch\nleaves the archive branch able to read. The tee keeps its source active\nfor that branch. The first `cancel()` can remain pending until the sibling\ncancels or the source finishes.\n\n## Observed behaviour\n\nThe preview’s cancellation was still pending after the archive read the\nqueued record. The source’s `cancel()` ran once, after the archive also\ncancelled, and received both reasons in branch order. The source remained\nopen during the first cancellation.\n\n## Application considerations\n\nIf the same code needs to cancel both branches, start both cancellations before\nawaiting either, for example with `Promise.all([preview.cancel(), archive.cancel()])`.\nIf the branches have active readers, cancel through those readers. Awaiting\nthe first cancellation before handling the second can stall teardown while\nthe sibling remains open.\n","fixtureContents":{"input":"{\n \"chunk\": \"record:42\",\n \"reasons\": [\n \"preview closed\",\n \"archive stopped\"\n ]\n}\n","expected":"{\n \"whileSiblingActive\": [],\n \"siblingRead\": {\n \"value\": \"record:42\",\n \"done\": false\n },\n \"sourceCancellations\": [\n [\n \"preview closed\",\n \"archive stopped\"\n ]\n ]\n}\n"}},{"metadata":{"id":"regex-word-boundary-accented-letter","title":"A JavaScript regex word boundary can miss an accented word","summary":"JavaScript’s regex word boundary follows the engine’s word-character rules. A Unicode word segmenter can find café where a whole-word regex misses it.","category":"text-and-encoding","relatedCases":["emoji-grapheme-length"],"references":[{"title":"ECMAScript: IsWordChar and WordCharacters","url":"https://tc39.es/ecma262/2026/multipage/text-processing.html#sec-iswordchar","kind":"specification"},{"title":"Unicode UAX #29: Word boundaries","url":"https://unicode.org/reports/tr29/#Word_Boundaries","kind":"specification"},{"title":"ECMA-402: Intl.Segmenter","url":"https://tc39.es/ecma402/#segmenter-objects","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses the u flag without case folding and English word segmentation. Observed with ICU 79.1 and CLDR 49.0."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Sentence with both accented and unaccented café/cafe tokens. The candidate words contain no regex metacharacters."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Regex and locale-segmenter hits in candidate order."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"62d333c7bfaf8fb94c04c2f9c00dc46e8843f6a16861231581906aafc3bd1b54"}}},"markdown":"# A JavaScript regex word boundary can miss an accented word\n\nA `\\bcafé\\b` expression can miss `café,` even with the `u` flag. The boundary\nrequires a change between word and non-word characters. In that mode, `é` and\nthe comma both fall outside the regex’s word characters. The boundary at the\nend of `café` therefore fails even though the literal letters match.\n\n## Observed behaviour\n\nThe regex found the unaccented control and missed the accented word.\n`Intl.Segmenter` with word granularity identified both as words in the same\nsentence.\n\n## Application considerations\n\nFor whole-word search in human-readable content, use segmentation suited to the\ntext’s locale. Keep fixtures with punctuation after a non-ASCII letter as well\nas ASCII controls.\n","fixtureContents":{"input":"{\n \"line\": \"Check café, then read cafe.\",\n \"words\": [\n \"café\",\n \"cafe\"\n ],\n \"locale\": \"en\"\n}\n","expected":"{\n \"regex\": [\n false,\n true\n ],\n \"segments\": [\n true,\n true\n ]\n}\n"}},{"metadata":{"id":"relative-url-trailing-slash","title":"new URL() drops the last base segment without a trailing slash","summary":"Resolving a relative endpoint against /api/v1 gives a different path from resolving it against /api/v1/.","category":"web-platform","references":[{"title":"WHATWG URL Standard: URL constructor","url":"https://url.spec.whatwg.org/#dom-url-url","kind":"specification"},{"title":"WHATWG URL Standard: Basic URL parser, relative state","url":"https://url.spec.whatwg.org/#relative-state","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"api-base-urls","file":"input.json","format":"json","role":"input","description":"A relative endpoint and two HTTPS bases that differ only by a trailing slash."},{"id":"resolved-endpoints","file":"expected.json","format":"json","role":"expected","description":"Resolved endpoints with and without the version path segment."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3b8cf78ddff4dffd8e439ab3645cfd5b5cb591497a12dd1c55f0b2226c5e31dc"}}},"markdown":"# new URL() drops the last base segment without a trailing slash\n\n`new URL(\"users\", \"https://example.com/api/v1\")` yields\n`https://example.com/api/users`. When resolving a relative path against\nan HTTPS base, the URL parser removes the last base path segment before\nappending the new path. With a trailing slash, that last segment is empty.\n\n## Observed behaviour\n\nThe two bases differ by one slash. Resolving `users` against each base gave\nthese paths on the same host.\n\n- Base path `/api/v1` → `/api/users`.\n- Base path `/api/v1/` → `/api/v1/users`.\n\n## Application considerations\n\nIf an API client accepts a base URL as a directory prefix, define it\nwith a trailing slash. Test a base that includes a version path so a\nmissing slash cannot silently direct requests to a different endpoint.\n","fixtureContents":{"api-base-urls":"{\n \"endpoint\": \"users\",\n \"baseWithoutSlash\": \"https://example.com/api/v1\",\n \"baseWithSlash\": \"https://example.com/api/v1/\"\n}\n","resolved-endpoints":"{\n \"withoutSlash\": \"https://example.com/api/users\",\n \"withSlash\": \"https://example.com/api/v1/users\"\n}\n"}},{"metadata":{"id":"response-body-lock-versus-disturbed","title":"A locked Response body can be unusable while bodyUsed is false","summary":"getReader() locks the stream without consuming it. Releasing an unread lock lets Response.text() work, but releasing after a read leaves the body disturbed.","category":"web-platform","relatedCases":["readable-stream-tee-cancellation"],"references":[{"title":"WHATWG Fetch: Body mixin and unusable bodies","url":"https://fetch.spec.whatwg.org/#body-mixin","kind":"specification"},{"title":"WHATWG Streams: getReader() and locks","url":"https://streams.spec.whatwg.org/#rs-get-reader","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses locally constructed Node Response objects, one unread and one read through its stream."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"The response text used for both lock and consumption paths."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The bodyUsed flags for a stream with an unread reader and for a stream that has been read."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"769a18b9f53b97967e85d751567aa272941da50b1c51cfc491874565fedbb6de"}}},"markdown":"# A locked Response body can be unusable while bodyUsed is false\n\nAcquiring a reader from `response.body` locks the stream. Fetch’s body methods,\nsuch as `text()` and `json()`, reject when the stream is locked or when a read\nor cancellation has disturbed it. `bodyUsed` reports only the disturbed state.\n\n## Observed behaviour\n\nNode’s `text()` behaved differently in three states.\n\n- Reader acquired, with no read: `bodyUsed` was false and `text()` rejected.\n- Unread reader released: `bodyUsed` was false and `text()` returned the text.\n- Reader read and then released: `bodyUsed` stayed true and `text()` rejected.\n\nThe rejected calls both produced `TypeError`.\n\n## Application considerations\n\nGive one component ownership of reading a response body. Code that borrows a\nreader should release it and communicate whether it started reading or\ncancelled the stream. Checking `bodyUsed` alone misses an outstanding lock.\n","fixtureContents":{"input":"{\n \"body\": \"shipment=queued\\n\"\n}\n","expected":"{\n \"lockedUnread\": false,\n \"disturbed\": true\n}\n"}},{"metadata":{"id":"response-json-no-content","title":"Response.json() rejects on a successful 204 response","summary":"HTTP 204 is successful but carries no body, so Response.json() rejects with SyntaxError. A response containing the JSON literal null parses successfully.","category":"web-platform","relatedCases":["fetch-http-error"],"references":[{"title":"RFC 9110: 204 No Content","url":"https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.5","kind":"specification"},{"title":"WHATWG Fetch Standard: Body.json()","url":"https://fetch.spec.whatwg.org/#dom-body-json","kind":"specification"},{"title":"WHATWG Fetch issue #113: 204 and json","url":"https://github.com/whatwg/fetch/issues/113","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses locally constructed Response objects to isolate body consumption from transport."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A 204 with no body and a 200 whose body holds the four-character JSON literal null."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Both responses are OK, but only the second parses to JavaScript null."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"3cabc00b016e53a17314c520704cbaf19540aa0309ae8778e727ed8642c99631"}}},"markdown":"# Response.json() rejects on a successful 204 response\n\nA successful `204 No Content` response has no content for `response.json()`\nto parse. Fetch applies JSON parsing to an empty byte sequence for an absent\nbody. The JSON literal `null` requires four bytes, so a response carrying\nthat literal parses differently.\n\n## Observed behaviour\n\nNode’s `Response.ok` was true for both fixtures. The `204` had\n`response.body === null` and `json()` rejected with `SyntaxError`.\nThe `200` had a body stream and `json()` resolved to JavaScript `null`.\n\n## Application considerations\n\nIf a DELETE or update endpoint documents `204`, branch on that status\nbefore decoding the response. Keep parsing the statuses that promise JSON. This lets errors in those bodies\nsurface instead of treating all parse failures as an empty response.\n","fixtureContents":{"input":"{\n \"noContent\": {\n \"status\": 204\n },\n \"jsonNull\": {\n \"status\": 200,\n \"body\": \"null\"\n }\n}\n","expected":"{\n \"ok\": true,\n \"missingBodyValue\": null,\n \"noContentError\": \"SyntaxError\",\n \"parsedJsonValue\": null\n}\n"}},{"metadata":{"id":"rfc3339-sort-different-offsets","title":"RFC 3339 text can sort differently from its instants","summary":"Lexical timestamp sorting can reverse chronological order when UTC offsets differ. Normalising to UTC gives consistent sort keys for the fixture.","category":"dates-and-times","references":[{"title":"RFC 3339: ordering conditions","url":"https://www.rfc-editor.org/rfc/rfc3339.html#section-5.1","kind":"specification"},{"title":"ECMAScript: Date.prototype.toISOString","url":"https://tc39.es/ecma262/2026/multipage/numbers-and-dates.html#sec-date.prototype.toisostring","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The fixtures use four-digit years and whole seconds. The normalised keys have a common offset and fractional precision."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two timestamps with different offsets whose displayed hours suggest the opposite order."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The lexical order of the inputs and the chronological order of the UTC keys."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0637b1b51fe83fcc6795a8c1e586bc207660be6fe5810a4dcb516075f1f3faaa"}}},"markdown":"# RFC 3339 text can sort differently from its instants\n\n`07:15Z` sorts before `08:45+02:00` as text, even though the latter instant\noccurs 30 minutes earlier. RFC 3339 describes when string ordering works,\nincluding the same offset and offset spelling, and the same number of\nfractional-second digits.\n\n## Observed behaviour\n\nThe original strings sorted in reverse chronological order. Sorting their\n`toISOString()` values put `06:45Z` ahead of `07:15Z` and agreed with comparison\nof the epoch milliseconds.\n\n## Application considerations\n\nFor chronological indexes, use epoch values at the precision your input\nrequires, or normalise to a fixed-width UTC timestamp at ingestion. Keep the original text separately when its\nreported offset matters.\n","fixtureContents":{"input":"[\n \"2024-05-01T08:45:00+02:00\",\n \"2024-05-01T07:15:00Z\"\n]\n","expected":"{\n \"lexical\": [\n \"2024-05-01T07:15:00Z\",\n \"2024-05-01T08:45:00+02:00\"\n ],\n \"utc\": [\n \"2024-05-01T06:45:00.000Z\",\n \"2024-05-01T07:15:00.000Z\"\n ]\n}\n"}},{"metadata":{"id":"search-params-reserialisation","title":"URLSearchParams.sort() can reserialise %20 as +","summary":"Sorting a URL’s searchParams can change its query string even when the decoded entries stay the same.","category":"web-platform","relatedCases":["form-query-repeated-keys"],"references":[{"title":"WHATWG URL Standard: URLSearchParams and its encoding rules","url":"https://url.spec.whatwg.org/#urlsearchparams","kind":"specification"},{"title":"WHATWG URL Standard: URLSearchParams.sort()","url":"https://url.spec.whatwg.org/#dom-urlsearchparams-sort","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"encoded-url","file":"input.json","format":"json","role":"input","description":"One URL containing a percent-encoded space in a single search parameter."},{"id":"query-serialisation-results","file":"expected.json","format":"json","role":"expected","description":"The original query, the reserialised URL and the unchanged decoded entry."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"2f76d0bedf8e7162a055a82a6532aa9119e0ed0f4da02e7c7842f2c46d19887a"}}},"markdown":"# URLSearchParams.sort() can reserialise %20 as +\n\nSorting `searchParams` on `https://example.com/search?q=red%20tea`\nchanges the URL to `https://example.com/search?q=red+tea`. The decoded\nvalue is still `\"red tea\"`. `URLSearchParams.sort()` updates its associated\nURL using URL-encoded form rules, which write spaces as `+`.\n\n## Observed behaviour\n\nNode changed `url.search` from `\"?q=red%20tea\"` to `\"?q=red+tea\"`.\nThere was only one parameter, so its position and decoded value stayed\nthe same. The same change appeared in `url.href`.\n\n## Application considerations\n\nIf a cache key depends on the exact URL string, decide whether to keep\nthe original query or use a consistent serialisation at every boundary.\nKeep the original string before changing `searchParams` when you need\nto compare it byte for byte, for example when verifying a signature over the\noriginal query.\n","fixtureContents":{"encoded-url":"{\n \"url\": \"https://example.com/search?q=red%20tea\"\n}\n","query-serialisation-results":"{\n \"before\": \"?q=red%20tea\",\n \"after\": \"?q=red+tea\",\n \"href\": \"https://example.com/search?q=red+tea\",\n \"entries\": [\n [\n \"q\",\n \"red tea\"\n ]\n ]\n}\n"}},{"metadata":{"id":"sqlite-abort-leaves-transaction-open","title":"A SQLite constraint error can leave earlier transaction writes in place","summary":"SQLite’s default ABORT conflict policy rolls back the failing statement and leaves the transaction active with earlier writes.","category":"databases","relatedCases":["sqlite-replace-cascades-delete"],"references":[{"title":"SQLite: ABORT conflict resolution","url":"https://www.sqlite.org/lang_conflict.html","kind":"documentation"},{"title":"SQLite transaction behaviour on errors","url":"https://www.sqlite.org/lang_transaction.html#response_to_errors_within_a_transaction","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Exercises a default UNIQUE conflict in a single explicit transaction using node:sqlite."},"fixtures":[{"id":"batch-setup","file":"setup.txt","format":"text","role":"input","description":"SQLite schema for an import and a row already present before the transaction."},{"id":"conflicting-batch","file":"batch.txt","format":"text","role":"input","description":"One multi-row INSERT. Its second row conflicts with the seeded code."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Rows before the transaction, and visible after the conflicting statement fails."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"0fdee9c4a04030c90a1484be4da13609460c234f7b9b7403a8f5c2b0b83368c7"}}},"markdown":"# A SQLite constraint error can leave earlier transaction writes in place\n\nA two-row insert can fail inside a SQLite transaction after a previous insert\nsucceeded. The default `ABORT` policy undoes the failing statement, including\nits earlier rows. The transaction stays open and prior statements remain part of\nit.\n\n## Observed behaviour\n\nThe import inserted `prepared` in its own statement, then tried a two-row\ninsert whose second row duplicated a code. After the error, `prepared` was\nstill visible in the transaction, and `batch-first` was gone. An explicit\n`ROLLBACK` removed `prepared` too.\n\n## Application considerations\n\nOn any failed step in an all-or-nothing import, explicitly roll back the\ntransaction. For recovery that keeps previous work, make the transaction\nboundaries deliberate.\n","fixtureContents":{"batch-setup":"CREATE TABLE jobs (id INTEGER PRIMARY KEY, code TEXT UNIQUE);\nINSERT INTO jobs VALUES (1, 'existing');\n","conflicting-batch":"INSERT INTO jobs VALUES (3, 'batch-first'), (4, 'existing');\n","expected":"{\n \"persisted\": [\n \"existing\"\n ],\n \"afterFailure\": [\n \"existing\",\n \"prepared\"\n ]\n}\n"}},{"metadata":{"id":"sqlite-foreign-keys-per-connection","title":"SQLite foreign key enforcement belongs to each connection","summary":"Two SQLite connections to one database can enforce its foreign keys differently. A connection with enforcement disabled can write an orphan that both can read.","category":"databases","references":[{"title":"SQLite: enabling foreign key support","url":"https://www.sqlite.org/foreignkeys.html#fk_enable","kind":"documentation"},{"title":"SQLite: PRAGMA foreign_key_check","url":"https://www.sqlite.org/pragma.html#pragma_foreign_key_check","kind":"documentation"},{"title":"Node.js: DatabaseSync constructor options","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/sqlite.html#new-databasesyncpath-options","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s built-in SQLite with explicit enableForeignKeyConstraints options, a temporary database file and a runtime that supports foreign keys."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"An invoice and a customer ID that has no matching row in setup.txt."},{"id":"schema","file":"setup.txt","format":"text","role":"input","description":"SQLite SQL script creating a customer and an invoice table with a foreign key. Use one database file for both connections."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The connection settings, SQLite’s extended foreign key error code and the persisted violation reported by foreign_key_check."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"5cb4d56b0b79126a6b1f34500187c3bb1dd5348feaaa86aab92d5bfeea47e750"}}},"markdown":"# SQLite foreign key enforcement belongs to each connection\n\nTwo connections can open the same SQLite file and disagree about whether\nan invoice may refer to a missing customer. SQLite applies foreign key\nenforcement per connection. A foreign key declaration lives in the shared\nschema, but enforcement settings belong to the writer.\n\n## Observed behaviour\n\nWith enforcement enabled, Node’s SQLite connection rejected an insert\nfor customer `404` with the SQLite foreign key constraint error.\nThe second connection, opened with enforcement disabled, accepted the\nsame insert. The first connection then reported the orphan using\n`PRAGMA foreign_key_check`.\n\n## Application considerations\n\nSet or confirm foreign key enforcement on every connection used by the\napplication, including each member of a connection pool and any separate import\ntools. Configure it when opening the connection. SQLite ignores changes to\n`PRAGMA foreign_keys` inside a transaction. Enabling the setting leaves existing\nrows in place. Use `foreign_key_check` when you\nneed to detect violations already written to a database.\n","fixtureContents":{"input":"{\n \"invoiceId\": 1,\n \"missingCustomerId\": 404\n}\n","schema":"CREATE TABLE customers (id INTEGER PRIMARY KEY);\nCREATE TABLE invoices (\n id INTEGER PRIMARY KEY,\n customer_id INTEGER NOT NULL REFERENCES customers (id)\n);\n\nINSERT INTO customers (id) VALUES (42);\n","expected":"{\n \"checked\": 1,\n \"unchecked\": 0,\n \"errorCode\": 787,\n \"violations\": [\n {\n \"table\": \"invoices\",\n \"rowid\": 1,\n \"parent\": \"customers\",\n \"fkid\": 0\n }\n ]\n}\n"}},{"metadata":{"id":"sqlite-left-join-count-star","title":"COUNT(*) after a LEFT JOIN counts unmatched parent rows","summary":"A LEFT JOIN still returns one row for a parent with no matching children. COUNT(*) counts that row, while COUNT(child.id) skips its NULL child ID.","category":"databases","relatedCases":["sqlite-not-in-null"],"references":[{"title":"SQLite SELECT: LEFT JOIN null-extension","url":"https://www.sqlite.org/lang_select.html#fromclause","kind":"documentation"},{"title":"SQLite: COUNT aggregate","url":"https://www.sqlite.org/lang_aggfunc.html#count","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses SQLite with an explicit non-nullable issue ID."},"fixtures":[{"id":"projects-and-issues","file":"setup.txt","format":"text","role":"input","description":"Runnable SQLite script with one populated project and one project without issues."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Per-project ID, joined row count and non-null issue count."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4e6979ccd902656f8c429eb1406f76746c1f0d927afc7f1c49cd725b979e536c"}}},"markdown":"# COUNT(*) after a LEFT JOIN counts unmatched parent rows\n\nA project with no issues can show a count of one after a `LEFT JOIN`. SQLite\nemits a row containing the project and NULL child columns. `COUNT(*)` counts\nthat row, while `COUNT(issues.id)` excludes its NULL child ID.\n\n## Observed behaviour\n\nThe populated project produced two for both counts. The empty project produced\none joined row and zero issue IDs.\n\n## Application considerations\n\nUse a child column that is always non-NULL in real child rows, such as the\nissue ID in this schema. If your issue table also has a nullable\n`closed_at` column, `COUNT(issues.closed_at)` would skip open issues.\nKeep a project with no issues in report tests.\n","fixtureContents":{"projects-and-issues":"CREATE TABLE projects (id TEXT PRIMARY KEY);\nCREATE TABLE issues (id INTEGER PRIMARY KEY, project_id TEXT NOT NULL);\nINSERT INTO projects VALUES ('active'), ('empty');\nINSERT INTO issues VALUES (1, 'active'), (2, 'active');\n","expected":"[\n [\n \"active\",\n 2,\n 2\n ],\n [\n \"empty\",\n 1,\n 0\n ]\n]\n"}},{"metadata":{"id":"sqlite-not-in-null","title":"A NULL in a SQLite NOT IN subquery can hide unmatched rows","summary":"NOT IN evaluates to NULL for an unmatched ID when the right-hand set contains NULL. WHERE then filters out that ID too.","category":"databases","references":[{"title":"SQLite: IN and NOT IN result matrix","url":"https://www.sqlite.org/lang_expr.html#the_in_and_not_in_operators","kind":"documentation"},{"title":"SQLite: WHERE clause filtering","url":"https://www.sqlite.org/lang_select.html#whereclause","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s built-in SQLite with an in-memory database. The left-hand IDs are non-null, and the right-hand column permits NULL."},"fixtures":[{"id":"schema-and-rows","file":"setup.txt","format":"text","role":"input","description":"SQLite SQL script for an in-memory database. It inserts two shipments and a hold list with one known ID and one NULL."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The shipment IDs returned by each anti-join with the NULL entry present or removed."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4f1259e13d9d503c042e150af96dd97ecec2565a438bb6413f7ce47b12657c73"}}},"markdown":"# A NULL in a SQLite NOT IN subquery can hide unmatched rows\n\nA hold list containing shipment `101` and `NULL` can make\n`WHERE id NOT IN (SELECT shipment_id FROM holds)` return no shipments.\nFor shipment `102`, that test asks whether `102` differs from both `101`\nand the unknown hold ID. The first comparison is true and the second yields\n`NULL`, so the combined result is `NULL`. SQLite keeps only rows for which\n`WHERE` is true.\n\n## Observed behaviour\n\nWith the `NULL` present, `NOT IN` returned no rows. `NOT EXISTS`\nwith an equality match returned shipment `102` because no hold row\nmatched that ID. Removing the `NULL` made `NOT IN` return `102` too.\n\n## Application considerations\n\nWhen selecting rows that lack a match, check the nullability of the keys\nreturned by the subquery. If a null hold should match no shipment, an\nexplicit `NOT EXISTS` equality check expresses that policy. The fixture\nassumes non-null shipment IDs.\n","fixtureContents":{"schema-and-rows":"CREATE TABLE shipments (id INTEGER PRIMARY KEY);\nCREATE TABLE holds (shipment_id INTEGER);\n\nINSERT INTO shipments (id) VALUES (101), (102);\nINSERT INTO holds (shipment_id) VALUES (101), (NULL);\n","expected":"{\n \"notInWithNull\": [],\n \"notExistsWithNull\": [\n 102\n ],\n \"notInWithoutNull\": [\n 102\n ]\n}\n"}},{"metadata":{"id":"sqlite-numeric-affinity-leading-zero","title":"SQLite NUMERIC affinity can strip leading zeros from text IDs","summary":"Binding a JavaScript string does not guarantee text storage in a NUMERIC column. The same input in a TEXT column keeps its original digits.","category":"databases","relatedCases":["json-integer-precision"],"references":[{"title":"SQLite: Type affinity and conversion rules","url":"https://www.sqlite.org/datatype3.html#type_affinity","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses ordinary SQLite tables with TEXT and NUMERIC affinity and string bindings."},"fixtures":[{"id":"columns","file":"setup.txt","format":"text","role":"input","description":"SQLite schema with a text identifier and a parallel NUMERIC column."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Two digit-only labels that differ by padding and one alphanumeric control."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Stored values and SQLite storage types for the two affinities."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"8427e932478f4b3bbe90e4af6614b944f7a9fc6949b538103cc1e383972c665f"}}},"markdown":"# SQLite NUMERIC affinity can strip leading zeros from text IDs\n\nBinding `\"000123\"` as a string can still make SQLite store the integer `123`. A\n`NUMERIC` column applies affinity to text that represents a number. A `TEXT`\ncolumn keeps the padded input.\n\n## Observed behaviour\n\nBoth digit-only identifiers produced the same integer in the numeric column. The\nalphanumeric control stayed text in both columns.\n\n## Application considerations\n\nDeclare columns for IDs, postal codes or product codes with `TEXT` affinity when\nthe original spelling carries meaning. Supply padded digits and their unpadded\ncounterpart in import tests.\n","fixtureContents":{"columns":"CREATE TABLE imports (row_id INTEGER PRIMARY KEY, text_id TEXT, numeric_id NUMERIC);\n","input":"{\n \"codes\": [\n \"000123\",\n \"123\",\n \"A123\"\n ]\n}\n","expected":"[\n [\n \"000123\",\n \"text\",\n 123,\n \"integer\"\n ],\n [\n \"123\",\n \"text\",\n 123,\n \"integer\"\n ],\n [\n \"A123\",\n \"text\",\n \"A123\",\n \"text\"\n ]\n]\n"}},{"metadata":{"id":"sqlite-replace-cascades-delete","title":"SQLite INSERT OR REPLACE can delete dependent rows","summary":"On a primary key conflict, SQLite REPLACE deletes the conflicting row before inserting its replacement. An update-style UPSERT preserves its dependent rows.","category":"databases","relatedCases":["sqlite-foreign-keys-per-connection"],"references":[{"title":"SQLite: ON CONFLICT and REPLACE","url":"https://www.sqlite.org/lang_conflict.html","kind":"documentation"},{"title":"SQLite: ON DELETE CASCADE","url":"https://www.sqlite.org/foreignkeys.html#fk_actions","kind":"documentation"},{"title":"SQLite: UPSERT","url":"https://www.sqlite.org/lang_upsert.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses in-memory SQLite with foreign keys explicitly enabled."},"fixtures":[{"id":"account-and-invoice","file":"setup.txt","format":"text","role":"input","description":"Runnable SQLite schema and data. Account 7 has one invoice and ON DELETE CASCADE is part of its foreign key."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Existing account ID and replacement name."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Final account name and invoice IDs for each operation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"42962156f491b3c68b9a581e072a21035e289c40fca335a61bff6a94e5d1a57f"}}},"markdown":"# SQLite INSERT OR REPLACE can delete dependent rows\n\nReplacing account `7` can also delete invoice `51`. On a primary key conflict,\nSQLite’s `INSERT OR REPLACE` deletes the conflicting row and then inserts the\nreplacement. The deletion can trigger `ON DELETE CASCADE`.\n\n## Observed behaviour\n\nBoth statements changed account `7` to the new name. Starting from the same\nrows each time, the invoice table ended up with different contents.\n\n- `INSERT OR REPLACE`: invoice `51` was gone.\n- `ON CONFLICT(id) DO UPDATE`: invoice `51` still pointed to account `7`.\n\n## Application considerations\n\nChoose an update-style UPSERT when related rows must survive. Include dependants\nin a regression fixture so tests observe more than the replacement account.\n","fixtureContents":{"account-and-invoice":"CREATE TABLE accounts (id INTEGER PRIMARY KEY, name TEXT NOT NULL);\nCREATE TABLE invoices (id INTEGER PRIMARY KEY, account_id INTEGER REFERENCES accounts(id) ON DELETE CASCADE);\nINSERT INTO accounts VALUES (7, 'Before');\nINSERT INTO invoices VALUES (51, 7);\n","input":"{\n \"id\": 7,\n \"name\": \"After\"\n}\n","expected":"{\n \"replace\": {\n \"name\": \"After\",\n \"invoices\": []\n },\n \"upsert\": {\n \"name\": \"After\",\n \"invoices\": [\n 51\n ]\n }\n}\n"}},{"metadata":{"id":"sqlite-returning-before-after-trigger","title":"SQLite RETURNING reports values before AFTER triggers change them","summary":"UPDATE RETURNING emits values from the top-level statement. A later SELECT can observe additional changes made by an AFTER trigger.","category":"databases","references":[{"title":"SQLite: RETURNING limitations and trigger changes","url":"https://www.sqlite.org/lang_returning.html#limitations_and_caveats","kind":"documentation"},{"title":"SQLite: CREATE TRIGGER","url":"https://www.sqlite.org/lang_createtrigger.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses node:sqlite and an AFTER UPDATE OF trigger that modifies a different column."},"fixtures":[{"id":"revision-trigger","file":"setup.txt","format":"text","role":"input","description":"SQLite schema with an AFTER UPDATE OF title trigger that increments the row’s revision."},{"id":"input","file":"input.json","format":"json","role":"input","description":"The edited title supplied to the update."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Title and revision returned by UPDATE RETURNING and by the subsequent SELECT."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"4daffa49a81767f29c9206bb47f82419f5b350bbe5190944f46fed89ca73bce5"}}},"markdown":"# SQLite RETURNING reports values before AFTER triggers change them\n\nAn `UPDATE … RETURNING revision` can return `1` while the row ends the statement\nat revision `2`. SQLite’s RETURNING clause reports values seen by the top-level\nstatement. An `AFTER` trigger can subsequently modify the row.\n\n## Observed behaviour\n\nThe update returned the edited title with the original revision. Selecting the\nsame row afterwards showed the edited title and incremented revision.\n\n## Application considerations\n\nIf a response needs final values affected by triggers, re-read the row after the\nstatement. Use the same transaction when another writer must be prevented from\nchanging the row before the read.\n","fixtureContents":{"revision-trigger":"CREATE TABLE documents (id INTEGER PRIMARY KEY, title TEXT, revision INTEGER);\nINSERT INTO documents VALUES (1, 'Draft', 1);\nCREATE TRIGGER bump_revision AFTER UPDATE OF title ON documents BEGIN\n UPDATE documents SET revision = old.revision + 1 WHERE id = old.id;\nEND;\n","input":"{\n \"title\": \"Published\"\n}\n","expected":"{\n \"returned\": [\n \"Published\",\n 1\n ],\n \"stored\": [\n \"Published\",\n 2\n ]\n}\n"}},{"metadata":{"id":"sqlite-sum-empty-is-null","title":"SQLite SUM returns NULL for empty or all-NULL input","summary":"SQLite SUM() returns NULL when there are no non-NULL inputs. TOTAL() returns the floating-point value 0.0.","category":"databases","relatedCases":["sqlite-left-join-count-star"],"references":[{"title":"SQLite: SUM and TOTAL","url":"https://www.sqlite.org/lang_aggfunc.html#sumunc","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses integer cent values and SQLite’s built-in aggregates."},"fixtures":[{"id":"amounts","file":"setup.txt","format":"text","role":"input","description":"SQLite script with a charge, a refund and a pending entry with an unknown amount."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"SUM, TOTAL and COUNT(cents) for settled payments, a pending NULL amount and a filter that matches no rows."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"bad9046cce1b1f1d2fc72d04f2979cf363788cb87ec7d7163fa535a7a40ba743"}}},"markdown":"# SQLite SUM returns NULL for empty or all-NULL input\n\nA charge and its matching refund add up to zero. A pending payment with NULL\ncents has no amount to sum. SQLite’s `SUM()` skips NULL inputs and returns\nNULL when there are no non-NULL inputs. `TOTAL()` returns `0.0` for that\nsame empty or all-NULL input.\n\n## Observed behaviour\n\nThe settled payments returned zero from both aggregates. The pending filter and\na filter with no rows returned NULL from `SUM()` and zero from `TOTAL()`.\n\n## Application considerations\n\nIn a report, `COALESCE(SUM(cents), 0)` makes both situations display as zero.\nInclude `COUNT(cents)` if readers still need to tell an actual zero balance\nfrom an unreported amount.\n\nA group with no numeric values can still contain non-NULL text.\nFor example, SQLite returns `0.0` for `SUM('unknown')`. Validate imported\namounts before summing them.\n","fixtureContents":{"amounts":"CREATE TABLE payments (kind TEXT, cents INTEGER);\nINSERT INTO payments VALUES ('settled', 200), ('settled', -200), ('pending', NULL);\n","expected":"{\n \"settled\": [\n 0,\n 0,\n 2\n ],\n \"pending\": [\n null,\n 0,\n 0\n ],\n \"missing\": [\n null,\n 0,\n 0\n ]\n}\n"}},{"metadata":{"id":"sqlite-unique-allows-multiple-nulls","title":"SQLite UNIQUE allows multiple NULL values","summary":"A UNIQUE constraint rejects a repeated assigned reference and permits multiple rows whose reference is NULL.","category":"databases","relatedCases":["sqlite-not-in-null"],"references":[{"title":"SQLite: UNIQUE constraints and NULL handling","url":"https://www.sqlite.org/lang_createtable.html#uniqueconst","kind":"documentation"},{"title":"SQLite: NULL handling compared across engines","url":"https://www.sqlite.org/nulls.html","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Exercises a single nullable reference column in SQLite. Other databases can have different defaults."},"fixtures":[{"id":"queue-schema","file":"setup.txt","format":"text","role":"input","description":"SQLite schema for an outgoing queue with a nullable unique remote reference."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Two jobs without a remote reference and two attempts to use the same assigned reference."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Stored references, in insertion order, and the duplicate constraint code."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"6c62fa8d834aa1f286c20eb50c2c816ed76621fd5c34a93318e70bbfa9d335f9"}}},"markdown":"# SQLite UNIQUE allows multiple NULL values\n\nAn outgoing queue can store multiple jobs with a NULL `remote_ref` under a\n`UNIQUE` constraint. SQLite treats NULLs as distinct for this constraint.\nAssigning the same concrete reference to two rows still raises a uniqueness\nerror.\n\n## Observed behaviour\n\nTwo NULL inserts and the first `msg-12` insert succeeded. The second `msg-12`\nproduced the SQLite unique constraint error. Both pending rows remained in the\ntable.\n\n## Application considerations\n\nUse `NOT NULL` as well when every row must carry a unique value. If pending jobs\nmay lack an assigned reference, SQLite’s default uniqueness semantics can\nsupport that lifecycle.\n","fixtureContents":{"queue-schema":"CREATE TABLE outgoing (id INTEGER PRIMARY KEY, remote_ref TEXT UNIQUE);\n","input":"{\n \"references\": [\n null,\n null,\n \"msg-12\",\n \"msg-12\"\n ]\n}\n","expected":"{\n \"stored\": [\n null,\n null,\n \"msg-12\"\n ],\n \"duplicate\": 2067\n}\n"}},{"metadata":{"id":"sqlite-wal-read-snapshot","title":"A SQLite WAL reader can keep seeing old data after a writer commits","summary":"An open read transaction in SQLite WAL mode sees its original snapshot until it ends. Another connection can commit changes in the meantime.","category":"databases","relatedCases":["sqlite-foreign-keys-per-connection"],"references":[{"title":"SQLite: isolation and WAL snapshot reads","url":"https://www.sqlite.org/isolation.html","kind":"documentation"},{"title":"SQLite: read and write transactions","url":"https://www.sqlite.org/lang_transaction.html#read_transactions_versus_write_transactions","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Requires a locally writable temporary filesystem that supports SQLite WAL locking and sidecar files."},"fixtures":[{"id":"wal-queue","file":"setup.txt","format":"text","role":"input","description":"SQLite script placing a local file database in WAL mode and inserting one queued job."},{"id":"input","file":"input.json","format":"json","role":"input","description":"The next state committed by the writer."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"State seen by the reader before the commit, during the old snapshot and after it ends."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ab45e1a82242c6cfee2f36b62602527b990a1c4cad81381d80a51390ff16afe0"}}},"markdown":"# A SQLite WAL reader can keep seeing old data after a writer commits\n\nA SQLite connection in a read transaction can still see `queued` after another\nconnection commits `completed` for the same job. WAL mode lets the writer commit\nwhile the reader’s snapshot stays stable.\n\n## Observed behaviour\n\nThe reader’s first `SELECT` established its snapshot and returned `queued`.\nAfter the other connection committed `completed`, the same `SELECT` still\nreturned `queued` inside that transaction. It returned `completed` after the\nreader ended the transaction.\n\n## Application considerations\n\nEnd a long-lived read transaction before a refresh that needs current data.\nKeeping the transaction open is useful for a report that must read several\ntables consistently.\n","fixtureContents":{"wal-queue":"PRAGMA journal_mode=WAL;\nCREATE TABLE jobs (id INTEGER PRIMARY KEY, state TEXT);\nINSERT INTO jobs VALUES (1, 'queued');\n","input":"{\n \"newState\": \"completed\"\n}\n","expected":"[\n \"queued\",\n \"queued\",\n \"completed\"\n]\n"}},{"metadata":{"id":"sqlite-window-default-frame-peers","title":"SQLite’s default window frame groups rows with equal sort keys","summary":"A SUM window ordered by timestamp uses the default RANGE frame and includes its timestamp peers. ROWS with a tie-break produces per-row running totals.","category":"databases","relatedCases":["sqlite-sum-empty-is-null"],"references":[{"title":"SQLite: default frame specification and peers","url":"https://www.sqlite.org/windowfunctions.html#frame_specifications","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses integer timestamps and cents to isolate SQLite’s window-frame semantics."},"fixtures":[{"id":"payments","file":"setup.txt","format":"text","role":"input","description":"SQLite table and payments with two rows sharing a recorded timestamp."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Each row gives the payment ID, the total with the default RANGE frame, and the total with a ROWS frame and an ID tie-break."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"06d73bc577d47f8f1c650820ee8e5561532aa2b318f9398106192cfc07d3def9"}}},"markdown":"# SQLite’s default window frame groups rows with equal sort keys\n\nTwo payments with timestamp `200` can show the same running total in\n`SUM(cents) OVER (ORDER BY recorded)`. SQLite’s default `RANGE` frame runs from the start through the current sort key. All rows tied on that key\nare peers, so both payments are already part of the total for the first one.\n\n## Observed behaviour\n\nThe default totals were `10, 35, 35`. Ordering by timestamp and payment ID with\na row-based frame gave `10, 30, 35`.\n\n```sql\nSUM(cents) OVER (\n ORDER BY recorded, id\n ROWS BETWEEN UNBOUNDED PRECEDING\n AND CURRENT ROW\n)\n```\n\n## Application considerations\n\nSpecify `ROWS` with a stable tie-break for line-by-line balances. The default\nframe is useful when every row at one timestamp should show a shared total.\n","fixtureContents":{"payments":"CREATE TABLE payments (id INTEGER PRIMARY KEY, recorded INTEGER, cents INTEGER);\nINSERT INTO payments VALUES (1, 100, 10), (2, 200, 20), (3, 200, 5);\n","expected":"[\n [\n 1,\n 10,\n 10\n ],\n [\n 2,\n 35,\n 30\n ],\n [\n 3,\n 35,\n 35\n ]\n]\n"}},{"metadata":{"id":"structured-clone-transfers-buffer","title":"Transferring an ArrayBuffer detaches every source view","summary":"structuredClone() with a transfer list moves the backing buffer. Sibling typed arrays become empty and an existing DataView can no longer read it.","category":"runtime-and-concurrency","relatedCases":["buffer-view-byte-range"],"references":[{"title":"HTML Standard: StructuredSerializeWithTransfer","url":"https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializewithtransfer","kind":"specification"},{"title":"ECMAScript: DataView get operations","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-getviewvalue","kind":"specification"},{"title":"Node.js: transferring TypedArrays and Buffers","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#considerations-when-transferring-typedarrays-and-buffers","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Transfers a dedicated ArrayBuffer with structuredClone(). SharedArrayBuffer and pooled Node Buffers are outside this test."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Bytes for a dedicated ArrayBuffer and the offset of a second view that shares its storage."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The transferred contents, the original sibling contents before transfer and the detached byte length."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"a7565fc0cab3fa62b15bdb6f9705de8b17dc6f61546e1824e285a0c8db2f8bbe"}}},"markdown":"# Transferring an ArrayBuffer detaches every source view\n\nTransferring the backing buffer of one typed array also detaches other views\nof that buffer. A normal structured clone copies the bytes. With\n`structuredClone(buffer, { transfer: [buffer] })`, the receiving buffer gets\nthe bytes and the original buffer is detached. All its views lose access to\ntheir shared storage. This matters when a worker receives a\nbuffer that the sender was still using to read headers or track progress.\n\n## Observed behaviour\n\nAn ordinary `structuredClone()` left both source views readable. Transferring\nthe same backing buffer delivered all four bytes to the clone. The original\nbuffer and both typed arrays reported zero bytes. An existing `DataView`\nthrew `TypeError` when asked to read the detached storage.\n\n## Application considerations\n\nTransfer a dedicated buffer when the sender is finished with every view of\nit. If the sender or another consumer still needs those bytes, clone or copy\nthe relevant range before transfer. Node applies extra restrictions to some\npooled Buffers.\n","fixtureContents":{"input":"{\n \"bytes\": [\n 24,\n 32,\n 40,\n 48\n ],\n \"siblingStart\": 2\n}\n","expected":"{\n \"receivedBytes\": [\n 24,\n 32,\n 40,\n 48\n ],\n \"siblingBytes\": [\n 40,\n 48\n ],\n \"detachedByteLength\": 0\n}\n"}},{"metadata":{"id":"textencoder-encodeinto-partial-scalar","title":"TextEncoder.encodeInto() stops before splitting a UTF-8 character","summary":"encodeInto() reports UTF-16 code units read and UTF-8 bytes written. A buffer can have spare bytes that cannot fit the next character.","category":"text-and-encoding","relatedCases":["utf8-byte-length"],"references":[{"title":"WHATWG Encoding: TextEncoder.encodeInto()","url":"https://encoding.spec.whatwg.org/#dom-textencoder-encodeinto","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"The string A💡Z, destination sizes of 4, 5 and 6 bytes, and a fill byte for spotting untouched space."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Code units read, bytes written, and full destination bytes after each attempt."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"7316f5453e7bdcc21220e07b728c08f4fbf7e261378a45edbacb7c380dfc72f4"}}},"markdown":"# TextEncoder.encodeInto() stops before splitting a UTF-8 character\n\nEncoding `A💡Z` into four bytes writes only `A`. The next character needs four\nUTF-8 bytes and has three available. `encodeInto()` stops before that character\nand reports one UTF-16 code unit read.\n\n## Observed behaviour\n\nThe fixture tries three destination sizes for `A💡Z`.\n\n- 4 bytes: writes `A` and reports `{ read: 1, written: 1 }`.\n- 5 bytes: writes `A💡` and reports `{ read: 3, written: 5 }`.\n- 6 bytes: writes `A💡Z` and reports `{ read: 4, written: 6 }`.\n\nThe unused bytes in the four-byte destination kept their original fill value.\n\n## Application considerations\n\nResume from the reported `read` offset into the JavaScript string and advance\nthe output cursor by `written`. Ensure a refill can fit the next character when\nno input was consumed.\n","fixtureContents":{"input":"{\n \"text\": \"A💡Z\",\n \"capacities\": [\n 4,\n 5,\n 6\n ],\n \"fill\": 255\n}\n","expected":"[\n {\n \"read\": 1,\n \"written\": 1,\n \"bytes\": [\n 65,\n 255,\n 255,\n 255\n ]\n },\n {\n \"read\": 3,\n \"written\": 5,\n \"bytes\": [\n 65,\n 240,\n 159,\n 146,\n 161\n ]\n },\n {\n \"read\": 4,\n \"written\": 6,\n \"bytes\": [\n 65,\n 240,\n 159,\n 146,\n 161,\n 90\n ]\n }\n]\n"}},{"metadata":{"id":"timer-unref-allows-process-exit","title":"An unref() timer alone cannot keep a Node process alive","summary":"A pending setTimeout callback can disappear at process exit after unref(). A referenced timer lets the callback run before exit.","category":"runtime-and-concurrency","references":[{"title":"Node.js: timeout.unref() and the event loop","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/timers.html#timeoutunref","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Spawns the same Node executable with an otherwise idle script. The test checks exit status and output without asserting elapsed time."},"fixtures":[{"id":"child-program","file":"child.txt","format":"text","role":"input","description":"Run via node -e with arguments: ref or unref, delay in milliseconds, and the message to write."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Delay and output for both child runs."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The stdout contents after a clean exit for each timer mode."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"290311bd2d64b80ffb8c3cfeed2291e3ed81d103ebeb3eb0b57475e103173f4a"}}},"markdown":"# An unref() timer alone cannot keep a Node process alive\n\nScheduling a final status flush with `setTimeout()` and calling `unref()` lets\nan otherwise idle Node process exit before the flush runs. The timer is still\nscheduled while other work keeps the event loop alive.\n\n## Observed behaviour\n\nThe child exited successfully with and without `unref()`. Only the referenced\ntimer wrote the status line. The test compares child output and does not rely on\nmeasuring the delay.\n\n## Application considerations\n\nUse unreferenced timers for optional maintenance. Keep a timer referenced when\nits callback is required to finish the job, or start the flush directly and\nwait for completion. Awaiting a promise tied to an unreferenced timer does not\nkeep Node alive on its own.\n","fixtureContents":{"child-program":"const mode = process.argv[1];\nconst delay = Number(process.argv[2]);\nconst message = process.argv[3];\nconst timeout = setTimeout(() => process.stdout.write(message), delay);\n\nif (mode === \"unref\") {\n timeout.unref();\n}\n","input":"{\n \"delayMs\": 30,\n \"message\": \"status flush finished\\n\"\n}\n","expected":"{\n \"ref\": \"status flush finished\\n\",\n \"unref\": \"\"\n}\n"}},{"metadata":{"id":"trim-versus-unicode-white-space","title":"String.trim() and Unicode White_Space remove different characters","summary":"ECMAScript trim removes U+FEFF but keeps U+0085. A Unicode White_Space property escape does the reverse for those two characters.","category":"text-and-encoding","relatedCases":["utf8-bom-textdecoder"],"references":[{"title":"ECMAScript: White Space","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-language-lexical-grammar.html#sec-white-space","kind":"specification"},{"title":"ECMAScript: TrimString","url":"https://tc39.es/ecma262/2026/multipage/text-processing.html#sec-trimstring","kind":"specification"},{"title":"Unicode 17.0: PropList White_Space data","url":"https://www.unicode.org/Public/17.0.0/ucd/PropList.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses code points with longstanding property assignments. Test strings are constructed from exported code point numbers."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A short field and the NEL, BOM and NBSP code points to put around it with String.fromCodePoint()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Whether each wrapper disappears with trim() and with the Unicode White_Space property."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"f9f3dd5feb00e18f13425f6c689b7fa8c272e5a36eac301277301f2896610640"}}},"markdown":"# String.trim() and Unicode White_Space remove different characters\n\n`String.trim()` retains a NEXT LINE character (NEL, U+0085) at the edge of a\nfield. A regular expression using Unicode’s `White_Space` property removes it.\nFor U+FEFF, the byte order mark (BOM) character in decoded text, the two rules\nreverse.\n\n## Observed behaviour\n\nNode trimmed non-breaking space (NBSP, U+00A0) with both rules. It removed NEL\nonly with `\\p{White_Space}` and removed the BOM only with `trim()`. ECMAScript\ndefines its own whitespace set for string trimming.\n\n## Application considerations\n\nPick the rule specified by the input format. For example, a field containing\nonly U+0085 still looks non-empty after `trim()`. If the importer strips\nUnicode `White_Space` first, that same field becomes empty. Test both NEL and\nthe BOM when a validator and importer use different whitespace rules.\n","fixtureContents":{"input":"{\n \"field\": \"ready\",\n \"wrappers\": [\n 133,\n 65279,\n 160\n ]\n}\n","expected":"[\n {\n \"trimmed\": false,\n \"unicode\": true\n },\n {\n \"trimmed\": true,\n \"unicode\": false\n },\n {\n \"trimmed\": true,\n \"unicode\": true\n }\n]\n"}},{"metadata":{"id":"truncate-extends-with-zeroes","title":"fs.truncate() can grow a file and fill the new bytes with zeros","summary":"A requested length larger than the current file extends it with readable zero bytes, while a shorter length removes trailing bytes.","category":"filesystem-and-paths","references":[{"title":"Node.js fs.truncate() extends with null bytes","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/fs.html#fstruncatepath-len-callback","kind":"documentation"},{"title":"POSIX truncate(): file length changes","url":"https://pubs.opengroup.org/onlinepubs/9799919799/functions/truncate.html","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a regular file and checks logical contents. Disk allocation is filesystem-dependent."},"fixtures":[{"id":"packet-prefix","file":"packet.bin","format":"binary","role":"input","description":"Four raw bytes for a synthetic binary record. Copy to a writable file before truncating."},{"id":"input","file":"input.json","format":"json","role":"input","description":"Requested lengths for extending and then shrinking the four-byte sample."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Exact bytes after each file length operation."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"87c38185d78c891fab33d9769e72ce3857a8df57e6cd28d3382416e7bf15cb84"}}},"markdown":"# fs.truncate() can grow a file and fill the new bytes with zeros\n\nCalling `truncate()` with length 8 on a four-byte file extends it. The original\nprefix stays in place and reads from the additional bytes yield zeros.\n\n## Observed behaviour\n\nNode returned all four original bytes followed by four zeros. Truncating the\nsame file to length 2 then left only the first two bytes.\n\n## Application considerations\n\nCheck the requested size before using truncate as a cleanup operation for a\npartial binary write. Extending a file to the expected size can make an\nincomplete record pass a size check while its unwritten fields read as zero.\n","fixtureContents":{"packet-prefix":"SUQABw==","input":"{\n \"longer\": 8,\n \"shorter\": 2\n}\n","expected":"{\n \"extended\": [\n 73,\n 68,\n 0,\n 7,\n 0,\n 0,\n 0,\n 0\n ],\n \"shortened\": [\n 73,\n 68\n ]\n}\n"}},{"metadata":{"id":"turkish-locale-lowercase","title":"Turkish dotted and dotless I change lowercase matching","summary":"toLocaleLowerCase() with tr maps I and İ differently from JavaScript’s locale-independent toLowerCase().","category":"text-and-encoding","relatedCases":["unicode-normalized-keys"],"references":[{"title":"ECMA-402: String.prototype.toLocaleLowerCase","url":"https://tc39.es/ecma402/#sup-string.prototype.tolocalelowercase","kind":"specification"},{"title":"Unicode Character Database 18.0.0: SpecialCasing","url":"https://www.unicode.org/Public/18.0.0/ucd/SpecialCasing.txt","kind":"source-data"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"The reproducer uses the tr locale explicitly and compares it with locale-independent lowercasing."},"fixtures":[{"id":"dotted-and-dotless-inputs","file":"input.json","format":"json","role":"input","description":"Uppercase I and İ with both lowercase forms for testing text lookup."},{"id":"lowercase-keys","file":"expected.json","format":"json","role":"expected","description":"Expected locale-independent and Turkish lowercase keys in input order."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"78ce5e7795a355a98f2eab5da0d1ccd7ba7af2e36fa14873839be02a5f3d7ef5"}}},"markdown":"# Turkish dotted and dotless I change lowercase matching\n\n`\"I\".toLowerCase()` returns `\"i\"`. With `\"I\".toLocaleLowerCase(\"tr\")`, the\nresult is `\"ı\"`, a dotless i. Turkish casing pairs dotless uppercase `I` with\n`ı` and dotted uppercase `İ` with `i`.\n\n## Observed behaviour\n\nNode’s locale-independent lowercasing mapped `İ` to `\"i\\u0307\"`, an `i` followed\nby a combining dot. With the Turkish locale, `İ` mapped to plain `i`. The\nfixture includes both lowercase forms to show which keys match under each rule.\n\n## Application considerations\n\nIf a lookup in Turkish text should ignore case, apply the same explicit locale\nwhen creating keys and when looking them up. Choose a stable comparison rule for\nmachine identifiers, where changing the user’s locale should usually leave\nexisting keys reachable.\n","fixtureContents":{"dotted-and-dotless-inputs":"[\n \"I\",\n \"İ\",\n \"i\",\n \"ı\"\n]\n","lowercase-keys":"{\n \"localeIndependent\": [\n \"i\",\n \"i̇\",\n \"i\",\n \"ı\"\n ],\n \"turkish\": [\n \"ı\",\n \"i\",\n \"i\",\n \"ı\"\n ]\n}\n"}},{"metadata":{"id":"unicode-normalized-keys","title":"A Map lookup can miss canonically equivalent Unicode keys","summary":"A composed key and a decomposed spelling of café can require NFC normalisation to match in a JavaScript Map.","category":"text-and-encoding","references":[{"title":"Unicode Standard Annex #15 — Normalization Forms","url":"https://www.unicode.org/reports/tr15/#Norm_Forms","kind":"specification"},{"title":"ECMAScript 2026: Map.prototype.get","url":"https://tc39.es/ecma262/2026/multipage/keyed-collections.html#sec-map.prototype.get","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"equivalent-keys","file":"input.json","format":"json","role":"input","description":"Two canonically equivalent spellings and a ligature with a compatibility equivalent."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"06a047242f6c72909c6da11679b4b567bee430a7b34ab82efe76d62eb4d8c513"}}},"markdown":"# A Map lookup can miss canonically equivalent Unicode keys\n\nA `Map` storing `\"caf\\u00e9\"` misses a lookup for `\"cafe\\u0301\"`. Both spellings\ndisplay as `café`. The first uses a single accented letter and the second uses\nan `e` followed by a combining acute accent. Unicode Normalisation Form C (NFC)\ngives both spellings the same representation. `Map` compares the underlying\nstrings exactly, so the normalisation has to happen before the comparison.\n\n## Observed behaviour\n\nIn Node, the lookup succeeded after applying `normalize(\"NFC\")` to the key at\ninsertion and lookup. The fixture also shows the scope of NFC. It preserves the\ndistinction between the ligature `ffi` and `ffi`. NFKC maps them together.\n\n## Application considerations\n\nIf an index should match canonically equivalent text, apply the same\nnormalisation to writes and lookups. During migration, existing entries can\nconverge on one key, so decide how to handle those collisions.\n","fixtureContents":{"equivalent-keys":"{\n \"storedKey\": \"caf\\u00e9\",\n \"lookupKey\": \"cafe\\u0301\",\n \"value\": \"menu\",\n \"ligature\": \"\\ufb03\",\n \"letters\": \"ffi\"\n}\n"}},{"metadata":{"id":"uri-encoding-lone-surrogate","title":"URI APIs handle a lone UTF-16 surrogate differently","summary":"encodeURIComponent() throws URIError for an unpaired surrogate. URLSearchParams converts the same input to U+FFFD before percent encoding.","category":"text-and-encoding","relatedCases":["utf8-split-sequence"],"references":[{"title":"ECMAScript: Encode (URI)","url":"https://tc39.es/ecma262/2026/multipage/global-object.html#sec-encode","kind":"specification"},{"title":"Web IDL: USVString conversion","url":"https://webidl.spec.whatwg.org/#idl-USVString","kind":"specification"},{"title":"WHATWG URL: URLSearchParams","url":"https://url.spec.whatwg.org/#interface-urlsearchparams","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"UTF-16 code units for a lone high surrogate and a valid surrogate pair. Build the strings with String.fromCharCode()."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The original percent-encoded scalar value and the replacement value used by URLSearchParams."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"bc21b3adc9876580d8457ec390d1a71ea0610e054f4ae28290704cf61e477336"}}},"markdown":"# URI APIs handle a lone UTF-16 surrogate differently\n\nJavaScript can hold a UTF-16 string containing only `0xD800`. This code unit\nis a high surrogate and needs a matching low surrogate to encode a Unicode\ncharacter. `encodeURIComponent()` rejects an unpaired surrogate. The `URLSearchParams`\ninterface uses Web IDL’s `USVString` conversion, which repairs malformed UTF-16\nby substituting the replacement character U+FFFD.\n\n## Observed behaviour\n\nBoth APIs encoded the valid light bulb surrogate pair identically. For the lone\nsurrogate, `encodeURIComponent()` threw `URIError` and `URLSearchParams`\nproduced `q=%EF%BF%BD`.\n\n## Application considerations\n\nChoose whether to reject or repair ill-formed UTF-16 before using text as an\nidentifier or query parameter. A lossy conversion can change a value silently as\nit goes into a URL.\n","fixtureContents":{"input":"{\n \"lone\": [\n 55296\n ],\n \"paired\": [\n 55357,\n 56481\n ]\n}\n","expected":"{\n \"paired\": \"%F0%9F%92%A1\",\n \"replacement\": \"�\",\n \"query\": \"q=%EF%BF%BD\"\n}\n"}},{"metadata":{"id":"url-idna-unicode-hostname","title":"A Unicode HTTPS hostname serialises as ASCII in new URL()","summary":"WHATWG URL parsing applies domain-to-ASCII conversion to HTTPS hosts. A Unicode spelling and its Punycode form can produce the same hostname and origin.","category":"web-platform","references":[{"title":"WHATWG URL: domain to ASCII","url":"https://url.spec.whatwg.org/#concept-domain-to-ascii","kind":"specification"},{"title":"Unicode UTS #46: IDNA Compatibility Processing","url":"https://www.unicode.org/reports/tr46/","kind":"specification"},{"title":"Node.js: URL constructor and domainToUnicode()","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/url.html#new-urlinput-base","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses HTTPS example domains without network activity. Node’s domainToUnicode() is used for the reverse display conversion."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A Unicode HTTPS URL, its ASCII spelling and a distinct ASCII control."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"Canonical ASCII host, canonical URL, origin and decoded display host."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"afb39a5f80e0194cfa0906b6d6f4e1bf2ef6156fd207f4d6e9d412e1d8350682"}}},"markdown":"# A Unicode HTTPS hostname serialises as ASCII in new URL()\n\nParsing `https://BÜCHER.example/catalogue` gives `xn--bcher-kva.example` as the\nhostname. For HTTPS, the WHATWG host parser applies domain-to-ASCII conversion\nbefore serialisation. Punycode provides an ASCII spelling for the non-ASCII\nlabel, with the `xn--` prefix marking that spelling.\n\n## Observed behaviour\n\nNode produced identical canonical URLs and origins for the Unicode input and its\nASCII Punycode spelling. The plain `bucher.example` control remained a different\ndomain. `domainToUnicode()` decoded the canonical hostname for display.\n\n## Application considerations\n\nIf application keys represent parsed URL origins, derive them from `URL.origin`\nconsistently. Preserve the user’s original spelling separately when it matters\nfor display.\n","fixtureContents":{"input":"{\n \"unicode\": \"https://BÜCHER.example/catalogue\",\n \"ascii\": \"https://xn--bcher-kva.example/catalogue\",\n \"distinct\": \"https://bucher.example/catalogue\"\n}\n","expected":"{\n \"host\": \"xn--bcher-kva.example\",\n \"href\": \"https://xn--bcher-kva.example/catalogue\",\n \"origin\": \"https://xn--bcher-kva.example\",\n \"display\": \"bücher.example\"\n}\n"}},{"metadata":{"id":"utf8-bom-textdecoder","title":"TextDecoder strips a leading UTF-8 BOM by default","summary":"Setting ignoreBOM to true retains U+FEFF in decoded text, which can cause JSON.parse() to reject the result.","category":"text-and-encoding","relatedCases":["utf8-split-sequence"],"references":[{"title":"WHATWG Encoding Standard: TextDecoder common algorithms","url":"https://encoding.spec.whatwg.org/#interface-textdecoder","kind":"specification"},{"title":"RFC 8259 §8.1: JSON encoding and the byte order mark","url":"https://www.rfc-editor.org/rfc/rfc8259.html#section-8.1","kind":"specification"},{"title":"ECMAScript 2026: JSON.parse","url":"https://tc39.es/ecma262/2026/multipage/structured-data.html#sec-json.parse","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"json-with-bom","file":"with-bom.bin","format":"binary","role":"input","description":"UTF-8 BOM bytes EF BB BF followed by a JSON object, with no final newline."},{"id":"json-without-bom","file":"without-bom.bin","format":"binary","role":"input","description":"The same JSON bytes without the leading BOM."},{"id":"decoded-object","file":"expected.json","format":"json","role":"expected","description":"The JSON content after decoding without a leading BOM."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b8e9e56d71fcdef94faf4b24d633105468b5473f9066657ce97f1f5616c6403c"}}},"markdown":"# TextDecoder strips a leading UTF-8 BOM by default\n\nWhen the bytes `EF BB BF` precede `{\"total\":1}`, a default UTF-8 `TextDecoder`\nreturns the JSON text without the byte order mark (BOM). The Encoding Standard\nskips the leading mark by default. Setting `ignoreBOM: true` bypasses that\nspecial handling and retains `U+FEFF`.\n\n## Observed behaviour\n\nIn Node, the default decoder produced identical text for both binary fixtures,\nand `JSON.parse()` accepted it. With `ignoreBOM: true`, the fixture with a BOM\ndecoded to a string beginning with `U+FEFF`. `JSON.parse()` rejected that string\nwith an unexpected token error at the leading mark.\n\n## Application considerations\n\nDecide whether an importer accepts a leading BOM. The option name can be\nconfusing. `ignoreBOM: true` ignores the mark’s special role and returns it as\npart of the decoded text. RFC 8259 says JSON sent over a\nnetwork must omit it and permits parsers to ignore it on input. If the original\nbytes matter, for example when comparing checksums, keep them alongside the\ndecoded text.\n","fixtureContents":{"json-with-bom":"77u/eyJ0b3RhbCI6MX0=","json-without-bom":"eyJ0b3RhbCI6MX0=","decoded-object":"{\n \"total\": 1\n}\n"}},{"metadata":{"id":"utf8-byte-length","title":"JavaScript string length can undercount UTF-8 bytes","summary":"Use TextEncoder to measure a UTF-8 byte limit when JavaScript length only counts UTF-16 code units.","category":"text-and-encoding","relatedCases":["emoji-grapheme-length"],"references":[{"title":"ECMAScript 2026: The String type","url":"https://tc39.es/ecma262/2026/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type","kind":"specification"},{"title":"WHATWG Encoding Standard: TextEncoder","url":"https://encoding.spec.whatwg.org/#interface-textencoder","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"byte-limit-inputs","file":"input.json","format":"json","role":"input","description":"ASCII, accented, CJK and supplementary characters with a four-byte field budget."},{"id":"length-and-budget-results","file":"expected.json","format":"json","role":"expected","description":"UTF-16 code unit counts, UTF-8 byte counts and whether each value fits."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"d1803c04a639bb4e1b941453dc90a4c6675409419fb4b758116f5ca9b46c86fd"}}},"markdown":"# JavaScript string length can undercount UTF-8 bytes\n\n`\"cafe\"` and `\"café\"` both have JavaScript length `4`. In UTF-8 they\ntake four and five bytes respectively, so only `\"cafe\"` fits into a\nfour-byte field. JavaScript length counts UTF-16 code units. In `café`, the `é` uses one of\nthose units and takes two bytes in UTF-8. `TextEncoder` gives the actual\nUTF-8 bytes.\n\n## Observed behaviour\n\nIn Node, the accented word exceeded the four-byte budget. The same check\nrejected `\"漢字\"` at six bytes and accepted `\"💡\"` at exactly four bytes,\neven though both have JavaScript length `2`.\n\n## Application considerations\n\nMeasure the bytes at the boundary that enforces the limit. Encode the\nfield itself for a field limit. If the limit applies to a complete JSON\nrequest, measure the serialised body, including its syntax and escaping.\n","fixtureContents":{"byte-limit-inputs":"{\n \"maxBytes\": 4,\n \"values\": [\n \"cafe\",\n \"café\",\n \"漢字\",\n \"💡\"\n ]\n}\n","length-and-budget-results":"[\n {\n \"codeUnits\": 4,\n \"utf8Bytes\": 4,\n \"fits\": true\n },\n {\n \"codeUnits\": 4,\n \"utf8Bytes\": 5,\n \"fits\": false\n },\n {\n \"codeUnits\": 2,\n \"utf8Bytes\": 6,\n \"fits\": false\n },\n {\n \"codeUnits\": 2,\n \"utf8Bytes\": 4,\n \"fits\": true\n }\n]\n"}},{"metadata":{"id":"utf8-split-sequence","title":"TextDecoder can corrupt UTF-8 decoded chunk by chunk","summary":"Streaming keeps a character intact across a byte boundary where separate decodes insert replacement characters.","category":"text-and-encoding","references":[{"title":"WHATWG Encoding Standard — TextDecoder","url":"https://encoding.spec.whatwg.org/#interface-textdecoder","kind":"specification"},{"title":"WHATWG Encoding Standard — UTF-8 decoder","url":"https://encoding.spec.whatwg.org/#utf-8-decoder","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24},"fixtures":[{"id":"first-chunk","file":"first-chunk.bin","format":"binary","role":"input","description":"ASCII A and the first two bytes of the four-byte UTF-8 light bulb character (U+1F4A1). Feed this chunk first."},{"id":"second-chunk","file":"second-chunk.bin","format":"binary","role":"input","description":"The final two bytes of U+1F4A1, then ASCII B and LF. Feed this chunk to the same streaming decoder."},{"id":"decoded-strings","file":"expected.json","format":"json","role":"expected","description":"The decoded stream and the strings obtained by decoding each chunk separately."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"97e107dab21bc6a483bc504139e6b0d592af19b218b449d0bce3c90e0ddd935a"}}},"markdown":"# TextDecoder can corrupt UTF-8 decoded chunk by chunk\n\n`TextDecoder` produces replacement characters (`U+FFFD`) when it decodes\n`41 F0 9F` and `92 A1 42 0A` separately. Together the chunks contain valid UTF-8\nfor `A💡B` followed by a line feed. The first chunk ends partway through the\nfour-byte encoding of `💡` and the second starts with its continuation bytes.\n\n## Observed behaviour\n\nIn Node, independent decodes produced `A�` and `��B` followed by a line feed.\nA streaming decoder remembers the incomplete character between calls.\n\n```js\nfunction decodeChunks(chunks) {\n const utf8 = new TextDecoder();\n const mode = { stream: true };\n let text = \"\";\n\n for (const chunk of chunks) {\n text += utf8.decode(chunk, mode);\n }\n\n return text + utf8.decode();\n}\n```\n\nWith the two fixture chunks, this returns `\"A💡B\\n\"`. The last call flushes any\nremaining input. In fatal mode, flushing after only the first chunk threw\n`TypeError`.\n\n## Application considerations\n\nUse one decoder per byte stream and flush it at the end. Choose fatal mode when\nmalformed or truncated input must be rejected. Replacement mode can keep a\ndisplay readable when best-effort decoding is appropriate.\n","fixtureContents":{"first-chunk":"QfCf","second-chunk":"kqFCCg==","decoded-strings":"{\n \"streamed\": \"A💡B\\n\",\n \"independentChunks\": [\"A�\", \"��B\\n\"]\n}\n"}},{"metadata":{"id":"windows-drive-relative-path","title":"A Windows path with a drive letter can still be relative","summary":"path.win32 resolves C:reports\\daily.csv against a directory on C:, while C:\\reports\\daily.csv starts at the drive root.","category":"filesystem-and-paths","references":[{"title":"Microsoft Learn: Traditional DOS paths","url":"https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths","kind":"documentation"},{"title":"Node.js: Windows and POSIX path handling","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/path.html#windows-vs-posix","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses explicit path.win32 and path.posix operations. The test supplies a base directory and makes no Windows filesystem calls."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Two Windows paths distinguished by the separator after C:, with a fixed working directory on the same drive."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The Windows resolution of both paths and the basename of the rooted path under each path grammar."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"9b169c554438dbe9b8bcbf7dcfeaa6e696aa525ee281064435d558e63b378dc9"}}},"markdown":"# A Windows path with a drive letter can still be relative\n\n`C:reports\\daily.csv` names a path relative to the current directory on\ndrive `C:`. Adding a backslash after the colon anchors it at the root of that\ndrive. A configuration parser that checks only for a drive letter can accept\na location whose meaning changes with the working directory.\n\n## Observed behaviour\n\n`path.win32.isAbsolute()` returns false for the drive-relative input and true\nfor the rooted input. With `C:\\jobs\\nightly` as the supplied base,\n`path.win32.resolve()` keeps that directory only for the relative input.\n`path.posix.basename()` treats the backslashes as ordinary characters.\nThe test exercises the path grammars without opening files.\n\n## Application considerations\n\nUse `path.win32` to interpret Windows paths in a manifest on any host. If a\nsetting requires a fully qualified Windows path, account for paths that name a\ndrive without its root and paths that start at the root of the current drive\nwithout naming it. A fixed base on the same drive makes the fixture independent\nof per-drive working directories.\n","fixtureContents":{"input":"{\n \"base\": \"C:\\\\jobs\\\\nightly\",\n \"driveRelative\": \"C:reports\\\\daily.csv\",\n \"driveAbsolute\": \"C:\\\\reports\\\\daily.csv\"\n}\n","expected":"{\n \"relativeResolved\": \"C:\\\\jobs\\\\nightly\\\\reports\\\\daily.csv\",\n \"absoluteResolved\": \"C:\\\\reports\\\\daily.csv\",\n \"posixBasename\": \"C:\\\\reports\\\\daily.csv\",\n \"windowsBasename\": \"daily.csv\"\n}\n"}},{"metadata":{"id":"worker-environment-snapshot","title":"A Worker keeps the environment from when it was created","summary":"By default, a Node Worker gets its own process.env copy. Updating the parent after Worker construction leaves the worker’s value unchanged.","category":"runtime-and-concurrency","references":[{"title":"Node.js: Worker environment options","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#new-workerfilename-options","kind":"documentation"},{"title":"Node.js: process.env","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/process.html#processenv","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a Node worker thread with the default env option. A message gates worker reads so the ordering is independent of startup timing."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A synthetic environment key and values written before creation, after creation and inside the worker."},{"id":"worker","file":"worker.txt","format":"text","role":"input","description":"CommonJS worker source. Start it with Worker’s eval option, then post the input key and workerWrite fields."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The value read and then written by the worker, alongside the parent’s independent value."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"ad551f521312be49cfd80c6b972320c4a4f3b11040aa1d4fe8ca129cbad74514"}}},"markdown":"# A Worker keeps the environment from when it was created\n\nA worker created while `ODDSTATE_WORKER_MODE=draft` still reads `draft`\nafter the parent changes the variable to `active`. By default, Node gives the worker a copy of the parent’s environment when\n`new Worker()` runs. Reading `process.env` later reads that copy.\n\n## Observed behaviour\n\nThe parent changed the value and only then sent a message asking the worker\nto read it. The worker saw the initial value, wrote `worker-only` to its\nown copy and reported that value. The parent still saw `active`.\n\n## Application considerations\n\nFor a long-lived worker pool, send configuration changes through messages\nor supply configuration with each job. Node offers `SHARE_ENV` when shared\nmutable environment state is intentional.\n","fixtureContents":{"input":"{\n \"key\": \"ODDSTATE_WORKER_MODE\",\n \"original\": \"draft\",\n \"updated\": \"active\",\n \"workerWrite\": \"worker-only\"\n}\n","worker":"const { parentPort } = require(\"node:worker_threads\");\nparentPort.once(\"message\", ({ key, workerWrite }) => {\n const inherited = process.env[key];\n process.env[key] = workerWrite;\n parentPort.postMessage({ inherited, afterWrite: process.env[key] });\n});\n","expected":"{\n \"worker\": {\n \"inherited\": \"draft\",\n \"afterWrite\": \"worker-only\"\n },\n \"parentAfterWrite\": \"active\"\n}\n"}},{"metadata":{"id":"worker-message-drops-class-prototype","title":"A Node message channel drops custom class prototypes","summary":"MessagePort.postMessage() clones a custom instance as a plain object. Its own data survives, along with supported nested built-in types such as Date.","category":"runtime-and-concurrency","relatedCases":["structured-clone-transfers-buffer"],"references":[{"title":"Node.js: cloning objects with prototypes and accessors","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/worker_threads.html#considerations-when-cloning-objects-with-prototypes-classes-and-accessors","kind":"documentation"},{"title":"HTML: StructuredSerializeInternal","url":"https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal","kind":"specification"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses Node’s MessageChannel in one process to exercise the structured clone used for worker messages."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"Data for an invoice instance with a computed label and Date field."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The original prototype getter’s label and whether the clone has that property."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"b9cfa7d09c587fb9ee1e9071a61124a7fb52b915fbac952f2cda7ec92609b0dd"}}},"markdown":"# A Node message channel drops custom class prototypes\n\nSending an `Invoice` instance through a Node `MessagePort` can preserve its own\nID while losing access to `invoice.label`. Structured cloning copies eligible\nown properties. The custom prototype that supplies the getter is absent on the\nreceiver.\n\n## Observed behaviour\n\nThe sender’s getter produced `invoice/N31`. The receiver got a plain object with\nthe same ID and a `Date` with the same timestamp, without a `label` property.\n\n## Application considerations\n\nSend explicit records over worker boundaries. Reconstruct an instance at the\nreceiver if worker code needs its class methods, or send computed fields as own\ndata when they are part of the message contract.\n","fixtureContents":{"input":"{\n \"id\": \"N31\",\n \"paidAt\": \"2024-04-05T11:10:00.000Z\"\n}\n","expected":"{\n \"originalLabel\": \"invoice/N31\",\n \"labelPreserved\": false\n}\n"}},{"metadata":{"id":"writable-backpressure-accepted-chunk","title":"Writable.write() returning false has already queued the chunk","summary":"At the highWaterMark, Node’s Writable asks the caller to wait for drain before the next write. Retrying the current chunk would duplicate it.","category":"runtime-and-concurrency","references":[{"title":"Node.js: writable.write() and backpressure","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#writablewritechunk-encoding-callback","kind":"documentation"},{"title":"Node.js: Writable drain event","url":"https://nodejs.org/download/release/latest-v24.x/docs/api/stream.html#event-drain","kind":"documentation"}],"compatibility":{"runtime":"node","minimumMajor":24,"notes":"Uses a Writable whose test double controls when its pending write callback completes."},"fixtures":[{"id":"input","file":"input.json","format":"json","role":"input","description":"A two-byte chunk and a two-byte high-water mark."},{"id":"expected","file":"expected.json","format":"json","role":"expected","description":"The write return value and the bytes received by the sink."}],"verification":{"evidence":{"date":"2026-12-02","nodeVersion":"24.22.3","platform":"darwin","architecture":"arm64","scenarioHash":"970fb793000621f5e54c4d433c55d44ea143a4e6c57028ed596d72bad40cead8"}}},"markdown":"# Writable.write() returning false has already queued the chunk\n\nA Writable with a two-byte `highWaterMark` can return `false` after accepting\n`Q7`. The flag indicates backpressure. The sink can already have received the\nchunk while its completion callback remains pending.\n\n## Observed behaviour\n\nThe sink received `Q7` once before `write()` returned `false`. Completing the\npending write then triggered `drain` without a retry.\n\n## Application considerations\n\nPause production when a write returns false, then send the next chunk after\n`drain`. Resending the current chunk can duplicate an export record. When the\ninput is already a readable stream, `pipeline()` can manage backpressure and\npropagate stream errors.\n","fixtureContents":{"input":"{\n \"chunk\": \"Q7\",\n \"highWaterMark\": 2\n}\n","expected":"{\n \"canContinue\": false,\n \"received\": [\n \"Q7\"\n ]\n}\n"}}]};
|