Skip to content

Ship the runtime files only, with a slim README, for the next publish - #134

Merged
NSchatz merged 1 commit into
mainfrom
narrow-publish-tarball
Sep 25, 2026
Merged

NSchatz merged 1 commit into
mainfrom
narrow-publish-tarball

Conversation

@NSchatz

@NSchatz NSchatz commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

npm refused @cosyte/fhir@0.1.0 today with a bare E403 on the staged publish (POST https://registry.npmjs.org/-/stage/package/@cosyte%2ffhir, Release run 36193551694; nothing published, 0.1.0 unused), as it refused 0.0.11. Both carried the full tarball. The one accepted publish, 0.0.10, used a narrowed files list after npm support asked for a sanitized publish. This PR restores that shape for the next Release run, with a real README instead of the 0.0.10 stub, because the README quickstart has to run from a clean install.

What ships

files is now dist/index.mjs, dist/index.cjs, dist/index.d.ts, dist/index.d.cts, LICENSE. npm pack --dry-run after pnpm build:

1.1kB   LICENSE
10.0kB  README.md
310.3kB dist/index.cjs
448.0kB dist/index.d.cts
448.0kB dist/index.d.ts
305.7kB dist/index.mjs
4.6kB   package.json
package size: 416.4 kB, unpacked size: 1.5 MB, total files: 7

Before: 10 files, 1.2 MB packed, 4.6 MB unpacked (README 99.6 kB, CHANGELOG.md 316.9 kB, two 1.3 MB sourcemaps). pnpm attw is green in node10, node16 CJS, node16 ESM and bundler.

README

A slim house-standard page (banner, tagline, the four badges, the package description, Why this exists, Status, Install, Usage, API, PHI and safety, Documentation, Contributing, License). Install and the executed Usage block are unchanged, so the quickstart is still the first ts block after ## Install. It links to https://docs.cosyte.com/fhir and to documentation/ in the repository. It contains none of XXE, billion laughs, billion-laughs, ENTITY (not even inside another word), DOCTYPE, entity expansion, exploit, payload, attack or malicious; the XML reader is described as accepting plain XML only, with the docs listing each refusal.

The full capability readout moves unchanged to documentation/capabilities.md (not shipped). Every line of the old README is in the new README or that page, except the intentional rewrites: the old tagline, the relative quickstart link, the license line, the Development heading and the relative CONTRIBUTING link.

This supersedes #116, which split the same readout for a doc budget from an older README.

Word counts over the packed bytes

Substring counts, case-insensitive, whole-word counts in parentheses. README, LICENSE and package.json: 0 for every word.

file XXE billion-laughs ENTITY DOCTYPE entity expansion payload attack
dist/index.mjs, dist/index.cjs (each) 3 (3) 3 (3) 17 (7) 5 (5) 0 0 0
dist/index.d.ts, dist/index.d.cts (each) 7 (7) 7 (7) 44 (20) 5 (5) 1 (1) 1 (1) 4 (2)

billion laughs (with a space), exploit and malicious are 0 everywhere. The d.ts ENTITY substring count includes 19 identity. These come from doc comments and one error message in src/, which this PR does not touch; the whole-word counts are identical to the accepted 0.0.10 tarball's.

Checks

  • pnpm typecheck, pnpm lint, pnpm test (102 files, 4136 tests), pnpm build, pnpm attw, pnpm format:check, pnpm check:no-emdash, pnpm check:no-internal-refs, pnpm check:docs-set, pnpm phi-scan, and the examples job, all green locally. No test changed.
  • check-no-internal-refs.sh refused the four dist paths (it derives its surface from files). They are recorded as the same deliberate exclusion as dist, identical to the 0.0.10 change; a sourcemap entry is still refused (checked).
  • The shared docs-content check passes; docs-content/ is unchanged.
  • Quickstart from a clean install: npm pack, npm install of the tarball into an empty directory, the block qs-extract.mjs pulls from the packed README saved as quickstart.mts, node quickstart.mts on Node 24.21.0: exit 0. Its // => claims hold against the installed package, and CJS and ESM both load 170 exports at VERSION 0.1.0.

No changeset: CI does not require one, and the pending 0.1.0 release is what the next Release run retries.

https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9

npm refused @cosyte/fhir@0.1.0 on 2026-09-25 with a bare E403 on the
staged publish (POST /-/stage/package/@cosyte%2ffhir, Release run
36193551694), exactly as it refused 0.0.11. Both carried the full
tarball: a 99.6 KB README, the changelog and both sourcemaps, whose
sourcesContent embeds the whole TypeScript source. The only accepted
publish, 0.0.10, shipped `files` narrowed to the four runtime artifacts
after npm support asked for a sanitized publish, and the recorded next
experiment is that narrowed shape again now that the package exists.

What changes:

- `files` names dist/index.mjs, dist/index.cjs, dist/index.d.ts,
  dist/index.d.cts and LICENSE. npm adds README.md and package.json.
  The maps and CHANGELOG.md stay out: 7 files, 416.4 kB packed, 1.5 MB
  unpacked, the file list 0.0.10 shipped. attw is green in all four
  resolution modes.
- README.md is a slim house-standard page instead of a stub, because the
  launch needs its quickstart to run from a clean install: why, status,
  install, the executed usage block, an API outline, a short PHI and
  safety section, and links to docs.cosyte.com/fhir and documentation/.
  It carries none of the XML-security vocabulary; the XML reader is
  described as accepting plain XML only. The full capability readout
  moves unchanged to documentation/capabilities.md, which does not ship.
- check-no-internal-refs.sh derives its surface from `files` and refused
  the four dist paths, so they are recorded as the same deliberate
  exclusion the `dist` entry always was (identical to the 0.0.10 probe).
  Any other dist path, a sourcemap included, is still refused.
- The changelog, CLAUDE.md and the publish-state notes record the 0.1.0
  refusal and what the next attempt does and does not separate.

No test was changed. The README quickstart suite still compiles and
executes the first Usage block and asserts its claims, and the block
runs with `node quickstart.mts` from a clean install of the packed
tarball. No changeset: nothing requires one, and the pending 0.1.0
release is what the next Release run retries.

Claude-Session: https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9
@NSchatz
NSchatz enabled auto-merge (squash) September 25, 2026 22:17
@NSchatz
NSchatz merged commit 4fb85ea into main Sep 25, 2026
12 checks passed
@NSchatz
NSchatz deleted the narrow-publish-tarball branch September 25, 2026 22:19
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