@cosyte/astm 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -7
- package/README.md +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -38
package/CHANGELOG.md
CHANGED
|
@@ -53,6 +53,9 @@ exists for.
|
|
|
53
53
|
|
|
54
54
|
### Changed
|
|
55
55
|
|
|
56
|
+
- **Published through npm trusted publishing, with provenance.** The code, API and behavior are
|
|
57
|
+
unchanged from 0.1.0. Only the README and some doc comments differ: a few doc comments now write
|
|
58
|
+
number ranges with "to".
|
|
56
59
|
- **Every published release now carries a machine-readable dependency inventory as a downloadable
|
|
57
60
|
asset.** No published value, type, warning code or emitted byte moves: this entry is release
|
|
58
61
|
infrastructure only, and nothing under `src/` is touched. The inventory is a CycloneDX document
|
|
@@ -387,7 +390,7 @@ exists for.
|
|
|
387
390
|
adding a workflow that would have to be made a required context separately. It asserts that every
|
|
388
391
|
pointer resolves, that no section a pointer reaches is empty, that the record stays reachable from
|
|
389
392
|
the always-read file, and that the always-read file still links the record by path. It asserts
|
|
390
|
-
**no** ecosystem-wide contract: several
|
|
393
|
+
**no** ecosystem-wide contract: several Cosyte repos carry no such record at all, and a gate
|
|
391
394
|
phrased as though every repo did would be an overclaim.
|
|
392
395
|
- **The matcher was re-derived against this tree rather than ported, and that was the whole job.**
|
|
393
396
|
Both sibling spellings score **zero** here: the path-qualified form used by `ccda` and `mllp`,
|
|
@@ -1430,7 +1433,7 @@ exists for.
|
|
|
1430
1433
|
**The refusal removes no capability.** `composeAstmFrames` already accepted `Uint8Array`, so a
|
|
1431
1434
|
consumer who knows their instrument's code page encodes with their own encoder and passes bytes,
|
|
1432
1435
|
which are written through untouched. A stream whose every character is Latin-1 is byte-identical
|
|
1433
|
-
to before, the full `0x00
|
|
1436
|
+
to before, the full `0x00` to `0xFF` range included. The **record** layer is deliberately unchanged:
|
|
1434
1437
|
`serializeAstmRecords` returns a `string`, which is not yet bytes, so the caller keeps the choice.
|
|
1435
1438
|
|
|
1436
1439
|
**Stated no wider than it was measured.** This closes the string-to-bytes step only. It is not a
|
|
@@ -1907,7 +1910,7 @@ phase 8` passes while `Phase 8` reds). An arm keyed on a following digit was wri
|
|
|
1907
1910
|
acceptance under a tolerating profile) is _measured_, on the tree before and after the change.
|
|
1908
1911
|
|
|
1909
1912
|
- **The em dash (U+2014) is gone from every tracked file, and a CI gate keeps it out**
|
|
1910
|
-
(`EMDASH-CONFORMANCE`). The brand rule bans the character outright across every
|
|
1913
|
+
(`EMDASH-CONFORMANCE`). The brand rule bans the character outright across every Cosyte surface
|
|
1911
1914
|
and names commit messages explicitly; this package was the last one it had not reached, and the
|
|
1912
1915
|
only one where it did not arrive on a clean tree. **1,129 occurrences across 108 of the 142
|
|
1913
1916
|
tracked files** were rewritten with a comma, a colon, or a period. The sweep and the gate are one
|
|
@@ -2371,7 +2374,7 @@ phase 8` passes while `Phase 8` reds). An arm keyed on a following digit was wri
|
|
|
2371
2374
|
|
|
2372
2375
|
## [0.0.1] - 2026-07-22
|
|
2373
2376
|
|
|
2374
|
-
The first pre-alpha release. The package begins its public history at `0.0.x`, per the
|
|
2377
|
+
The first pre-alpha release. The package begins its public history at `0.0.x`, per the Cosyte version
|
|
2375
2378
|
ladder (`0.0.x` until first alpha).
|
|
2376
2379
|
|
|
2377
2380
|
### Added
|
|
@@ -2499,7 +2502,7 @@ warnings: readonly AstmFrameWarning[] }`. A frame is `<STX> FN text <ETB|ETX> CS
|
|
|
2499
2502
|
- **Modulo-256 checksum** over the bytes after `STX` up to and **including** the `ETB`/`ETX`
|
|
2500
2503
|
terminator, two hex chars: **verified on decode, emitted uppercase, accepted lowercase** (a real
|
|
2501
2504
|
vendor quirk). `computeChecksum` / `toChecksumHex` / `parseChecksumHex` exported.
|
|
2502
|
-
- **Frame-number `0
|
|
2505
|
+
- **Frame-number `0` to `7` sequencing** (rolls over `7 → 0 → 1`, starts at `1`) and **multi-frame record
|
|
2503
2506
|
reassembly**: text is capped at **240 bytes** (the seven control bytes are **not** counted), `ETB`
|
|
2504
2507
|
is intermediate / `ETX` final. `parseFramedAstm(bytes, opts?)` composes the framing and record layers
|
|
2505
2508
|
at the edge (decode → reassemble trusted records → `parseAstmRecords`).
|
|
@@ -2535,7 +2538,7 @@ defaulted: boolean; warnings }`. A leading `STX`/`ENQ` ⇒ **framed** (serial, a
|
|
|
2535
2538
|
by `ltpInitialState()`. Events are the four LTP control signals (`enq`/`ack`/`nak`/`eot`) plus a
|
|
2536
2539
|
codec-decoded `frame`; actions are `sendAck` / `sendNak` / `sendEot` / `deliverRecord`. It models
|
|
2537
2540
|
the LIS01-A2 establishment → transfer → termination phases as `neutral ⇄ transfer`, reassembling
|
|
2538
|
-
`ETB…ETX` runs into delivered records and tracking the `0
|
|
2541
|
+
`ETB…ETX` runs into delivered records and tracking the `0` to `7` frame sequence.
|
|
2539
2542
|
- **ACK-failsafe (safety-critical, borrowed from `mllp`).** A frame the codec did not vouch for (a
|
|
2540
2543
|
**bad checksum**, an **unterminated** frame, or one **out of sequence**) is answered with `NAK`,
|
|
2541
2544
|
**never** a fabricated positive `ACK`, and its bytes are **never** appended to a record or
|
|
@@ -2572,7 +2575,7 @@ EOT` session **reassembles exactly the source records**; a **raw-TCP stream equa
|
|
|
2572
2575
|
counters, the `L` terminator) is **computed, not guessed** (a sequence number may be overridden).
|
|
2573
2576
|
- **Frame encoder.** `composeAstmFrames(records, opts?)` is the exact inverse of `decodeAstmFrames`:
|
|
2574
2577
|
it wraps reassembled record bytes into `<STX> FN text <ETB|ETX> CS <CR><LF>` frames with the
|
|
2575
|
-
modulo-256 **checksum** and the `0
|
|
2578
|
+
modulo-256 **checksum** and the `0` to `7` **frame number** **computed** (never accepted-as-given or
|
|
2576
2579
|
faked; emitted uppercase), numbered continuously across the stream (start `1`, roll over `7 → 0`),
|
|
2577
2580
|
and every record over **240** text bytes **split** `ETB…ETX` (the seven control bytes never counted).
|
|
2578
2581
|
`serializeFramedAstm(msg | records)` composes both emit layers at the edge: the mirror of
|
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ ASTM instrument traffic carries PHI. This section says what the library does wit
|
|
|
105
105
|
|
|
106
106
|
## API
|
|
107
107
|
|
|
108
|
-
`@cosyte/astm` is a zero-dependency TypeScript toolkit that follows the
|
|
108
|
+
`@cosyte/astm` is a zero-dependency TypeScript toolkit that follows the Cosyte parser archetype: a lenient
|
|
109
109
|
parser that turns real-world, vendor-quirky input into **warnings** rather than failures, paired with
|
|
110
110
|
a serializer that always emits spec-clean output (Postel's Law). It mirrors the API shape of the
|
|
111
111
|
reference parser, [`@cosyte/hl7`](https://github.com/cosyte/hl7).
|
|
@@ -529,7 +529,7 @@ An HL7 v2 `DTM` can state its own offset and an ASTM timestamp never can, so the
|
|
|
529
529
|
differently on purpose: `hl7ToISO` may end in `Z` or `+HH:MM`, `astmToISO` never does. That
|
|
530
530
|
difference is the standards', not the API's.
|
|
531
531
|
|
|
532
|
-
### The
|
|
532
|
+
### The Cosyte parser archetype
|
|
533
533
|
|
|
534
534
|
- **Postel's Law**: liberal parser (lenient default + warnings), conservative serializer (always
|
|
535
535
|
spec-clean), so quirks don't propagate downstream on round-trip.
|
package/dist/index.cjs
CHANGED
|
@@ -3144,7 +3144,7 @@ function concatBytes3(chunks) {
|
|
|
3144
3144
|
}
|
|
3145
3145
|
|
|
3146
3146
|
// src/index.ts
|
|
3147
|
-
var VERSION = "0.1.
|
|
3147
|
+
var VERSION = "0.1.1";
|
|
3148
3148
|
|
|
3149
3149
|
exports.ABNORMAL_FLAG_CODES = ABNORMAL_FLAG_CODES;
|
|
3150
3150
|
exports.ABNORMAL_FLAG_VOCABULARY = ABNORMAL_FLAG_VOCABULARY;
|