Repository navigation
Add runnable examples, package metadata and the 0.1.0 changeset - #66
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares
@cosyte/synthfor its 0.1.0 release. No change undersrc/.What changes
examples/: four runnable programs, each importing@cosyte/synthby name (resolved through the package's ownexportstodist/) and checking its own output withnode: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 theCOSYTE-SYNTHauthority, PID-13 a555-01xxphone, 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.mdhas 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 nodist/or no example.examplesjob inci.yml(Node 22 and 24): install, build,pnpm examples. Actions pinned by SHA as in the other jobs. Not a determinism job, noif:, noneeds:;pnpm run determinism:digeststill reconciles the workflow (PASS locally). Not a required context.examples/tsconfig.jsonmaps the package name tosrc/fortscand typescript-eslint only;pnpm typecheckaddstsc --noEmit -p examples;lintandformataddexamples/.console.log(...)) instead of leaving bare expressions; same calls, same imports.homepagehttps://docs.cosyte.com/synth.repositoryandbugswere already correct.docs-content/intro.mdanddocs-content/installation.mdsay0.1instead of pre-alpha0.0.x;.changeset/README.mdstates the0.1.xladder plus the determinism window's rule that a changed seed-to-bytes mapping needs a major 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 across0.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)
typecheckandlint(also with nodist/),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/*.tsat the SSN and email floor (a planted dashed SSN there is a hit). Its HL7 segment detectors do not parse string literals in.tsfiles anywhere in this repo (a planted PID literal undertest/is not a hit either), which is why none of these examples carries a literal segment.README quickstart, from a packed tarball
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/deid0.0.9.https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9