@cosyte/astm 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,8 +9,40 @@ this file is maintained by hand (Changesets handles the version bump and publish
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
- The first pre-alpha release (`0.0.1`) will ship the initial public API surface. The package begins
13
- its public history at `0.0.x`, per the cosyte version ladder (`0.0.x` until first alpha).
12
+ ### Fixed
13
+
14
+ - **Publish status corrected across the public surface.** `@cosyte/astm` has been published on npm at
15
+ `0.0.1` since 2026-07-22 and the repository is public, but `README.md`, `docs-content/intro.md`, and
16
+ `docs-content/installation.md` each still opened with "pre-alpha (`0.0.x`), not yet published to
17
+ npm" (and the installation page told readers to consume the package from source instead). Those
18
+ three status blocks, plus the project guide, now state the real published version. The install
19
+ instructions no longer describe a package that does not exist.
20
+ - **`VERSION` no longer lies about the release.** The published `0.0.1` exported `VERSION === "0.0.0"`
21
+ while `package.json` read `0.0.1`, which the documented install smoke test (print `VERSION`) surfaces
22
+ directly to an installer. The constant is corrected to `0.0.1`, `scripts/sync-version.mjs` now
23
+ rewrites it from `package.json` inside the release `version` script, and `test/sanity.test.ts`
24
+ asserts the two agree so a skipped sync fails the build instead of shipping. The declaration is now
25
+ annotated `: string` (matching `@cosyte/hl7`), so the emitted type is `string` rather than the
26
+ version literal.
27
+ - Removed `cosyte-astm-0.0.0.tgz`, a 307 KB `pnpm pack` artifact committed to the repository root that
28
+ carried a stale `0.0.0` `dist/`, and added `*.tgz` to `.gitignore` so pack output cannot be
29
+ committed again.
30
+
31
+ ### Changed
32
+
33
+ - The `README.md` status block is replaced by a "What it covers" summary of the record, framing and
34
+ transport, emit, profile, and terminology layers. Per the public-surface rule, a README describes
35
+ what the software does, not our internal phase numbering; the ASTM designations `E1381` and `E1394`
36
+ are reference material and stay. Same removal of internal cross-references a reader cannot follow
37
+ from `docs-content/limitations.md` and `docs-content/quickstart.md`, leaving the surrounding
38
+ sentences intact.
39
+ - The released `0.0.1` entries now sit under a dated `## [0.0.1] - 2026-07-22` heading with a link to
40
+ its tag, instead of sitting under `[Unreleased]` behind a sentence saying `0.0.1` "will ship".
41
+
42
+ ## [0.0.1] - 2026-07-22
43
+
44
+ The first pre-alpha release. The package begins its public history at `0.0.x`, per the cosyte version
45
+ ladder (`0.0.x` until first alpha).
14
46
 
15
47
  ### Added
16
48
 
@@ -347,12 +379,5 @@ EOT` session **reassembles exactly the source records**; a **raw-TCP stream equa
347
379
  interactive contention/timeout/retransmit **timing**) is a thin consumer adapter, and the standard's
348
380
  exact numeric timeouts / retry counts are deferred (we model transitions, not timers).
349
381
 
350
- ### Deprecated
351
-
352
- ### Removed
353
-
354
- ### Fixed
355
-
356
- ### Security
357
-
358
382
  [Unreleased]: https://github.com/cosyte/astm/commits/main
383
+ [0.0.1]: https://github.com/cosyte/astm/releases/tag/v0.0.1
package/README.md CHANGED
@@ -8,39 +8,42 @@ parser that turns real-world, vendor-quirky input into **warnings** rather than
8
8
  a serializer that always emits spec-clean output (Postel's Law). It mirrors the API shape of the
9
9
  reference parser, [`@cosyte/hl7`](https://github.com/cosyte/hl7).
10
10
 
11
- > **Status:** pre-alpha (`0.0.x`), not yet published to npm. Phase 1 ships the **record** layer
12
- > (`H`/`P`/`O`/`R`/`L` read, delimiter self-declaration, escape decode); Phase 2 adds **safety-critical
13
- > result semantics** — HL7 Table 0078 abnormal flags, result status (with correction `C` / cancel `X`),
14
- > reference-range parsing, and the units-absent discipline; Phase 3 adds **identity depth, comments, and
15
- > timestamp hardening** — the three distinct patient IDs, mother's maiden name, full order fields, the
16
- > `C` comment record attached by position (orphans surfaced, never dropped), and partial timestamps
17
- > preserved and flagged, never zero-filled. Phase 4 adds the **`Q` request-information record + the
18
- > host-query flow** (a `Q`-bearing message is classified a request, **never** read as a result set) and
19
- > the **`M`/`S` records surfaced verbatim** (vendor QC/calibration data, never interpreted into clinical
20
- > fields) — the **record-content layer is now feature-complete**. Phase 5 adds the **E1381/CLSI-LIS01
21
- > frame codec**: `decodeAstmFrames` decodes a framed byte stream into frames + reassembled record
22
- > bytes, **verifies the modulo-256 checksum** (a bad frame is surfaced untrusted and never merged),
23
- > tracks **frame-number sequencing** (a gap is never silently bridged), and **reassembles** the
24
- > 240-byte-limited multi-frame records; `parseFramedAstm` composes the framing and record layers at the
25
- > edge. Phase 6 adds the **transport layer**: `detectFraming` auto-detects framed (serial / cobas 4800 /
26
- > Iguana) vs raw (cobas b121, framing dropped) streams, and `ltpReduce` is a **pure, socket-free**
27
- > receiver-side `ENQ`/`ACK`/`NAK`/`EOT` state machine whose one rule mirrors `mllp`'s ACK-failsafe — a
28
- > bad-checksum frame is **NAK**ed, never falsely **ACK**ed. Phase 7 adds the **spec-clean serializers +
29
- > builders** — `serializeAstmRecords` / `buildAstmMessage` emit canonical `H|\^&` records (embedded
30
- > delimiters re-escaped, nothing clinical fabricated) and `composeAstmFrames` / `serializeFramedAstm`
31
- > frame them with **computed** checksums + frame numbers and the 240-byte split, so both layers
32
- > round-trip by construction. Phase 8 adds the vendor **profile** system — `defineAstmProfile()` builds
33
- > a provenance-backed profile whose quirk tolerances downgrade _expected_, non-safety-critical
34
- > deviations to a `PROFILE_QUIRK_APPLIED` warning (values are never altered), guarded by a
35
- > definition-time safety gate that refuses to tolerate any result value / flag / status / range /
36
- > units, patient or comment context, message-kind, or frame / LTP integrity warning — a profile can
37
- > never make a bad checksum "ok" or a cancelled result read "final." Named per-vendor profiles are
38
- > deferred pending a public vendor-attributed quirk document. Phase 9 adds **LIVD-aware LOINC
39
- > recognition** — `applyLivd(msg, catalog)` maps an analyzer's local test code to a standard **LOINC**
40
- > from a **consumer-supplied** IICC LIVD catalog (`defineLivdCatalog`), as an **additive, advisory**
41
- > annotation that never mutates the raw code/value and **never guesses a LOINC** (an unmapped or
42
- > ambiguous code surfaces as such). No LOINC / SNOMED / LIVD dictionary is bundled — the package stays a
43
- > structural recognizer, and the consumer brings their own catalog.
11
+ > **Status:** published on npm at `0.0.1`, on the pre-alpha `0.0.x` ladder. Both layers are
12
+ > feature-complete, but the public surface can still change within `0.0.x`, before `0.1.0`.
13
+
14
+ ## What it covers
15
+
16
+ - **Records (E1394 / LIS02-A2).** `H`/`P`/`O`/`R`/`C`/`Q`/`M`/`S`/`L` are read with per-header
17
+ delimiter self-declaration and escape decode, so an escaped delimiter inside a value reads as one
18
+ component. Result semantics are modeled and fail-safe: HL7 Table 0078 abnormal flags, result status
19
+ (a correction `C` or cancel `X` never reads as active-final), reference ranges kept verbatim, and a
20
+ missing unit flagged rather than defaulted. The practice-, laboratory-, and third patient IDs stay
21
+ distinct; a `C` comment attaches to its parent by position and an orphan is surfaced, never dropped;
22
+ a partial timestamp is preserved and flagged, never zero-filled. A `Q`-bearing message is classified
23
+ as a host query and is never read as a result set, and `M`/`S` vendor QC and calibration records are
24
+ surfaced verbatim rather than interpreted into clinical fields.
25
+ - **Framing and transport (E1381 / LIS01-A2).** `decodeAstmFrames` turns a framed byte stream into
26
+ frames plus reassembled record bytes: it verifies the modulo-256 checksum (a bad frame is surfaced
27
+ untrusted and never merged), tracks frame-number sequencing (a gap is never silently bridged), and
28
+ reassembles the 240-byte-limited multi-frame records. `detectFraming` routes framed streams (serial,
29
+ cobas 4800, Iguana) from raw ones (cobas b121, framing dropped), and `ltpReduce` is a pure,
30
+ socket-free `ENQ`/`ACK`/`NAK`/`EOT` receiver state machine that NAKs a frame the codec did not vouch
31
+ for rather than fabricating an ACK. `parseFramedAstm` composes both layers at the edge.
32
+ - **Emit.** `serializeAstmRecords` and `buildAstmMessage` emit canonical `H|\^&` records with embedded
33
+ delimiters re-escaped and nothing clinical fabricated; `composeAstmFrames` and `serializeFramedAstm`
34
+ frame them with computed checksums, frame numbers, and the 240-byte split. Both layers round-trip by
35
+ construction.
36
+ - **Vendor profiles.** `defineAstmProfile()` builds a provenance-backed profile whose tolerances
37
+ downgrade _expected_, non-safety-critical deviations to a `PROFILE_QUIRK_APPLIED` warning without
38
+ ever altering a value, behind a definition-time safety gate that refuses to tolerate any result
39
+ value, flag, status, range, or units warning, any patient or comment context, any message-kind
40
+ ambiguity, and any frame or transport integrity warning. A profile can never make a bad checksum
41
+ "ok" or a cancelled result read "final." Named per-vendor profiles await a public,
42
+ vendor-attributed quirk document.
43
+ - **Terminology, bring your own.** `applyLivd(msg, catalog)` maps an analyzer's local test code to a
44
+ LOINC from a consumer-supplied IICC LIVD catalog as an additive, advisory annotation that never
45
+ mutates the raw code or value and never guesses a LOINC. No LOINC, SNOMED, or LIVD dictionary is
46
+ bundled: the package stays a structural recognizer and you bring the catalog.
44
47
 
45
48
  ## Decode a framed byte stream
46
49
 
package/dist/index.cjs CHANGED
@@ -1972,7 +1972,7 @@ function concatBytes3(chunks) {
1972
1972
  }
1973
1973
 
1974
1974
  // src/index.ts
1975
- var VERSION = "0.0.0";
1975
+ var VERSION = "0.0.2";
1976
1976
 
1977
1977
  exports.ALL_ASTM_WARNING_CODES = ALL_ASTM_WARNING_CODES;
1978
1978
  exports.ASTM_ACK = ACK;