Skip to content

S0035-hl7-vendor-refresh: adopt @cosyte/hl7 0.0.10 from the registry, with the regression evidence - #39

Merged
NSchatz merged 3 commits into
mainfrom
sdd/S0035-hl7-vendor-refresh
Aug 21, 2026
Merged

S0035-hl7-vendor-refresh: adopt @cosyte/hl7 0.0.10 from the registry, with the regression evidence#39
NSchatz merged 3 commits into
mainfrom
sdd/S0035-hl7-vendor-refresh

Conversation

@NSchatz

@NSchatz NSchatz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Spec: work/specs/S0035-hl7-vendor-refresh/spec.md in the umbrella repository.
Durable record in this checkout: documentation/hl7-refresh/record.md.

What this is

@cosyte/hl7 moves from a pnpm pack archive committed into this repository at
0.0.1 to a plain registry devDependency at 0.0.10, resolved through
pnpm-lock.yaml, with no copy of the library source left anywhere in the
checkout. @cosyte/fhir is untouched and stays vendored: the registry does not
have it.

The deliverable is not the version number. This package sits in a PHI dataflow
and its promise is never a confident wrong FHIR value, so a green suite was not
accepted as evidence on its own.

The measurement

Every HL7 v2 fixture the repository carries was collected mechanically into a
frozen corpus (124), four synthetic inputs were authored for the malformed,
truncated, empty and wrong-version classes, and all 128 were transformed once on
each side of the bump. The compared surface, meaning the FHIR output plus every
diagnostic in emission order, is BYTE-IDENTICAL across all 128 members. Both
captures are committed so a reviewer reruns the comparison rather than believing
it:

diff -u documentation/hl7-refresh/surface-pre-refresh.json \
        documentation/hl7-refresh/surface-post-refresh.json

One hunk, each file's own label. No emitted FHIR value moved, no diagnostic
moved, and src/ is untouched by this change.

Scope notes a reviewer should check first

  • buildAdt and encodeComposite both exist at 0.0.10 and NEITHER is adopted
    here. The visit-carrying Patient plus Encounter output stays deferred and
    routes to a follow-on item; the reverse path keeps building its fields by hand.
  • Two suites added, none removed or relaxed. Exactly one expected value was
    edited: the count of paths declared binary in .gitattributes, which this
    refresh's own end state moved from two to one by deleting the tarball. It
    stayed a pinned literal, it tracks no upstream difference, and section 5b of
    the record carries its before and after form with the ruling that authorized
    it.
  • phi-scan-overrides.md is untouched and no --allow-fixture bypass was used.

Gates

build, typecheck, lint, phi-scan, check:no-emdash,
check:no-internal-refs, check:agent-notes and format:check all exit zero.
pnpm run test is 31 files, 524 tests, 524 passed, 0 failed.

… dependency moves

Freezes the comparison basis for the @cosyte/hl7 refresh, captured at
76984bb with @cosyte/hl7 0.0.1 installed
from vendor/cosyte-hl7-0.0.0.tgz.

- test/_support/hl7-baseline-corpus.json: 124 distinct HL7 v2 fixtures,
  COLLECTED from the repository's own fixture suites by
  test/_support/hl7-corpus-probe.ts rather than transcribed, so completeness
  is measured. Frozen here on purpose: some members are messages the reverse
  path serialized, so re-deriving after a bump would move the input as well
  as the output.
- test/_support/hl7-malformed-classes.ts: one authored synthetic input per
  malformed class (malformed, truncated, empty, wrong-version), carrying no
  person data at all, so each class has a measured pre-refresh behaviour.
- scripts/hl7-refresh-capture.ts: the compared surface capture (FHIR bundle
  plus the diagnostics emitted alongside it, in emission order), with the two
  normalizations it applies stated in its header.
- documentation/hl7-refresh/surface-pre-refresh.json: that capture over all
  128 corpus members on the stale dependency.

Gates at this commit: build, typecheck, lint, test (29 files, 504 tests),
phi-scan, check:no-emdash, check:no-internal-refs, check:agent-notes and
format:check all exit zero. phi-scan-overrides.md is untouched.
The parser was nine published versions behind and pinned to a pnpm pack
archive committed into this repository, so the version the tests actually
exercised was watched by no dependency route. It is now a plain registry
devDependency resolved through pnpm-lock.yaml, and no copy of the library
source remains anywhere in the checkout.

Measured, not assumed: the compared surface (the FHIR output plus every
diagnostic in emission order) over all 128 baseline corpus members is
BYTE-IDENTICAL before and after. No emitted FHIR value moved, no diagnostic
moved, no call site needed adapting, and src/ is untouched by this change.
Both captures are committed so the comparison reruns rather than being
believed: documentation/hl7-refresh/surface-{pre,post}-refresh.json.

- package.json + pnpm-lock.yaml: @cosyte/hl7 file:vendor/... -> ^0.0.10,
  resolving to exactly one version whose integrity hash matches the registry
  query recorded in the record. No overrides or resolutions entry was written.
- vendor/cosyte-hl7-0.0.0.tgz deleted; scripts/vendor-refresh.sh no longer
  re-creates it; the stale RECONCILE_EXEMPT entry in scripts/phi-scan.ts and
  the prose in .gitattributes, scripts/check-no-emdash.mjs, CLAUDE.md,
  documentation/agent-notes.md and docs-content/installation.md follow the
  code. @cosyte/fhir is unaffected and stays vendored: the registry lacks it.
- test/messages/malformed-classes.test.ts: the three fail-safe properties for
  each of the four malformed classes, plus a corpus-wide sweep asserting every
  diagnostic carries a registry-static message at a positional locator.
- test/upstream-capabilities.test.ts: buildAdt and encodeComposite both exist
  now, recorded as calls that compile and run. NEITHER IS ADOPTED HERE: the
  visit-carrying Patient plus Encounter output stays deferred and routes to a
  follow-on item, and the reverse path keeps building its RawFields by hand.
- documentation/hl7-refresh/record.md: registry evidence, the end-state checks,
  the capability inventory and regression plan, the normalizations, the
  fail-safe measurements class by class, the PHI scan, and the three answers.

phi-scan-overrides.md is untouched and no --allow-fixture bypass was used.

Gates: build, typecheck, lint, phi-scan, check:no-emdash,
check:no-internal-refs, check:agent-notes and format:check all exit zero.
pnpm run test is 523 passed, 1 failed, and the one failure is NOT behavioural:
test/scripts/no-emdash-gate.test.ts pins the number of vendored archives
declared binary in .gitattributes at 2, and removing the hl7 tarball makes it
1. Changing that constant is an expectation edit the governing spec permits
only to track an adopted diagnostic difference, and there is none, so it is
left for a human ruling rather than made here. See the blocked report.
…ate moved

Deleting vendor/cosyte-hl7-0.0.0.tgz took this tree from two paths declared
binary in .gitattributes to one, and test/scripts/no-emdash-gate.test.ts pins
that count as a literal, so the assertion had to be corrected or it would keep
claiming something about the tree that stopped being true.

ONE literal, 2 -> 1, in that ONE file, on the operator decision of 2026-08-21
(operator-decision-ac3-does-not-freeze-a-removed-subject.md): AC3's freeze
protects expectations from being bent to make failing behaviour pass, and does
not reach an assertion whose SUBJECT this chore legitimately removed. Every
other expectation in the suite stays frozen.

The pin stays a pin. It is not converted to a shape, a range or a count derived
from .gitattributes, because the comment beside it records why the number is
pinned: a refuter showed a shape-only assertion here leaves a widened skip
condition completely green, and that reasoning survives at one path exactly as
it did at two. The comment is corrected to say one rather than two.

documentation/hl7-refresh/record.md gains section 5b: the before and after form,
the cause named as what it is (the required end state removed the subject, NOT
an upstream difference), and the ruling that authorized it. The adopted
difference enumeration is still empty and this edit deliberately does not join
it, since dressing a tree fact up as an AC6b difference would be false.

Gates on the refreshed checkout, all exit zero: build, typecheck, lint,
phi-scan, check:no-emdash, check:no-internal-refs, check:agent-notes,
format:check, and pnpm run test at 31 files, 524 tests, 524 passed, 0 failed.
The compared surface was re-verified, not re-asserted: the committed pre and
post captures still differ by one hunk, each file's own label, over all 128
corpus members, and a fresh capture reproduces the committed post-refresh file
byte for byte.
@NSchatz
NSchatz merged commit 13750f1 into main Aug 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant