Skip to content

Add runnable examples, package metadata and the 0.1.0 changeset - #66

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/synth for its 0.1.0 release. No change under src/.

What changes

  • examples/: four runnable programs, each importing @cosyte/synth by name (resolved through the package's own exports to dist/) and checking its own output with node:assert. No example holds a literal message; every value is generated at run time.
    • generate-an-hl7-message.ts: ADT^A01 from seed 12345, spec-clean and byte-stable on re-parse, byte-identical for the same seed, different for another; PID-3 under the COSYTE-SYNTH authority, PID-13 a 555-01xx phone, PID-19 a never-issued SSN that is not ITIN-shaped; a seven-family corpus.
    • generate-every-format.ts: FHIR US Core Patient and transaction Bundle, C-CDA CCD, X12 837P, NCPDP NewRx and B1, ASTM result; each spec-clean with zero warnings and byte-identical per seed.
    • vendor-quirk.ts: HL7 v2, C-CDA and ASTM quirks, each producing exactly its intended warning and tolerated by the profile that claims it.
    • deid-pairing-loop.ts: the loop with @cosyte/deid, zero survivors and zero over-scrub across five formats, the three unpaired formats skipped and named.
    • examples/README.md has the table, and says the loop is co-validation, not an independent audit.
  • 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 the other jobs. Not a determinism job, no if:, no needs:; pnpm run determinism:digest still reconciles the workflow (PASS locally). Not a required context.
  • 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/.
  • README quickstart prints its checks (console.log(...)) instead of leaving bare expressions; same calls, same imports.
  • package.json: description names the six formats, wider keywords, homepage https://docs.cosyte.com/synth. 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 plus the determinism window's rule that a changed seed-to-bytes mapping needs a major changeset.
  • 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 (the seed-to-bytes mapping held across 0.x, and the minor-for-breaking rule for the rest), 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 and lint (also with no dist/), test (56 files, 826 tests), build, attw, smoke, format:check, phi-scan (all-mode, 262 files, and --staged), check (test-selection), check:no-emdash, check:no-internal-refs, check:install, check:determinism-window, determinism:digest, examples (4 of 4): all exit 0.

PHI scan note, measured: all-mode reads examples/*.ts at the SSN and email floor (a planted dashed SSN there is a hit). Its HL7 segment detectors do not parse string literals in .ts files anywhere in this repo (a planted PID literal under test/ is not a hit either), which is why none of these examples carries a literal segment.

README quickstart, from a packed tarball

pnpm build && npm pack                                   # cosyte-synth-0.0.9.tgz
npm install ./cosyte-synth-0.0.9.tgz                     # into an empty directory
npm install @cosyte/hl7 @cosyte/fhir @cosyte/ccda @cosyte/x12 @cosyte/ncpdp @cosyte/astm   # from npm, as the install line names
node qs-extract.mjs node_modules/@cosyte/synth/README.md # block at README line 57
node quickstart.mts                                      # exit 0

Installed: astm 0.0.22, ccda 0.0.15, fhir 0.0.10, hl7 0.0.10, ncpdp 0.0.13, x12 0.0.18. Output: true, true, true, then the VXU^V04 MSH segment. The four examples also exit 0 in that directory against those npm peers plus @cosyte/deid 0.0.9.

https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9

The package is about to publish 0.1.0, and a reader of the repository had
no runnable program beyond the README blocks. Four examples now cover the
jobs the README presents: an HL7 v2 ADT^A01 generated from a seed
(spec-clean on re-parse, byte-identical for the same seed, and every
identifier from a reserved range), one artifact in each of the other five
formats round-tripped through its own parser, vendor-quirk fixtures that
each produce exactly their intended warning, and the pairing loop with
@cosyte/deid. Each imports @cosyte/synth by name, resolved through the
package's own exports to dist/, and checks its own output. Nothing in
them is a literal message: every value is generated at run time.

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 like the
other jobs there. It is not a determinism job, carries no if: and no
needs:, and is not a required context yet; pnpm run determinism:digest
still reconciles the workflow.

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.

The README quickstart prints its checks instead of leaving bare
expressions, and still runs verbatim from a packed tarball with the peers
its install line names (exit 0). package.json: a description naming the
six formats, wider keywords, homepage at docs.cosyte.com/synth. The
status lines say 0.1 rather than pre-alpha 0.0.x, .changeset/README.md
states the 0.1.x ladder and the determinism window's major-bump rule, and
the new changeset tells a user what 0.1 covers, what the version
promises (the seed-to-bytes mapping included) and what is not covered.

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