Skip to content

Add runnable examples, a working quickstart, metadata and the 0.1.0 changeset - #67

Merged
NSchatz merged 1 commit into
mainfrom
release-0.1-prep
Sep 25, 2026
Merged

NSchatz merged 1 commit into
mainfrom
release-0.1-prep

Conversation

@NSchatz

@NSchatz NSchatz commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Prepares @cosyte/deid for its 0.1.0 release. No change under src/.

What changes

  • README quickstart fixed. The first runnable block after ## Install read name and dob without defining them, so the published quickstart failed from a clean install with ReferenceError: name is not defined. It now declares synthetic inputs inline (ZZFAMILY^ZZGIVEN, 19900215), prints the transformed values and the manifest's decisions, and shows that output in a text block beside it.
  • examples/: four runnable programs, each importing @cosyte/deid by name (resolved through the package's own exports to dist/) and checking its own output with node:assert:
    • deidentify-a-model.ts: the core engine on a locus model; the manifest carries no input value.
    • deidentify-an-hl7-message.ts: the @cosyte/deid/hl7 adapter on the repository's synthetic ORU^R01 (test/fixtures/hl7/oru-r01.hl7); no input identifier survives in the output or the manifest.
    • fail-closed.ts: free text blocked with no redactor, with a throwing redactor and with an empty one; a consumer redaction recorded as DEID_FREETEXT_CONSUMER_REDACTED; a keyed transform with no key refused (DEID_NO_KEY); a safe-harbor-labelled date-shift policy refused (DEID_POLICY_INVALID).
    • expert-determination-support.ts: the support report; determination is null and the disclaimer leads the Markdown.
    • examples/README.md has the table and says what the library does not do: no certification, no determination.
  • pnpm examples (scripts/run-examples.ts, modelled on hl7's runner): runs every top-level example with tsx, fails on any non-zero exit, refuses (exit 2) with no dist/ or no example.
  • CI: a new examples job in ci.yml (Node 22 and 24): install, build, pnpm examples. Actions pinned by SHA, as in smoke.yml. Not in the ci-required-checks ruleset.
  • Gates cover the examples before any build: examples/tsconfig.json maps the package name to src/ for tsc and typescript-eslint only; pnpm typecheck adds tsc --noEmit -p examples; lint and format add examples/.
  • package.json: description names the six formats and the fail-closed posture, wider keywords, homepage https://docs.cosyte.com/deid. repository and bugs were already correct.
  • Status lines in the README, docs-content/intro.md and docs-content/installation.md say 0.1 instead of pre-alpha 0.0.x; .changeset/README.md states the 0.1.x ladder (the text mllp already carries).
  • Changeset what-0-1-means.md (minor, so the release is 0.1.0 rather than 0.0.10): what 0.1 covers, what the version promises below 1.0, what it is not (no certification, no compliance claim), what is not covered yet. Checked against the shared release-notes renderer with every pending changeset: no refusal, no violation.

Checks run locally (pnpm 10.0.0, Node 24)

typecheck, lint, test (58 files, 1231 tests), build, attw, smoke, format:check, phi-scan (all-mode and --staged), check (test-selection and agent-notes), check:no-emdash, check:no-internal-refs, examples (4 of 4): all exit 0. A planted PID segment under examples/ is a hit for the all-mode PHI scan CI runs.

README quickstart, from a packed tarball

pnpm build && npm pack                                  # cosyte-deid-0.0.9.tgz
npm install ./cosyte-deid-0.0.9.tgz                     # into an empty directory; the install block names no peer
node qs-extract.mjs node_modules/@cosyte/deid/README.md # block at README line 46
node quickstart.mts                                     # exit 0

Output: [ null, '1990', '5.4 mmol/L' ] and [ 'PID-5 NAMES removed', 'PID-7 DATES transformed' ]. The same check against the published 0.0.9 exits 1 with the ReferenceError.

https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9

…hangeset

The README quickstart read two variables it never defined, so the
published block failed with "ReferenceError: name is not defined" from a
clean install. It now declares synthetic inputs inline, prints what the
pass returned, and shows that output beside it. Verified from a packed
tarball in an empty directory with node quickstart.mts: exit 0.

Four examples cover the jobs the README presents, each importing
@cosyte/deid by name (resolved through the package's own exports to
dist/) and checking its own output: the core engine on a locus model,
the HL7 v2 adapter on the repository's synthetic ORU^R01, the fail-closed
cases (free text blocked, a throwing or empty redactor still blocked, no
key refused, a mislabelled policy refused), and the Expert Determination
support report, whose determination is always null. The examples README
says plainly what the library does not do: no certification, no
determination. Inputs are the ZZ-placeholder shapes of test/fixtures.

pnpm examples (scripts/run-examples.ts) runs them all and refuses when
there is no build or no example. A new examples job in ci.yml installs,
builds and runs it on Node 22 and 24, actions pinned by SHA, not yet a
required context. examples/tsconfig.json maps the package name to src/
for tsc and typescript-eslint only, so pnpm typecheck, pnpm lint and
format cover examples/ before any build; at run time nothing maps it.

package.json: the description names the formats and the fail-closed
posture, keywords widen, homepage moves to docs.cosyte.com/deid. The
status lines in the README and two docs pages say 0.1 rather than
pre-alpha 0.0.x, and .changeset/README.md states the 0.1.x ladder. The
new changeset tells a user what 0.1 covers, what the version promises,
what it is not, and what is not covered yet.

Claude-Session: https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9
@NSchatz
NSchatz enabled auto-merge (squash) September 25, 2026 20:38
@NSchatz
NSchatz merged commit 6cb30d9 into main Sep 25, 2026
14 checks passed
@NSchatz
NSchatz deleted the release-0.1-prep branch September 25, 2026 20:40
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