Main snapshots
Install @mitre/hdf-converters@next to follow the newest successfully published development snapshot of main. Other publishable @mitre/hdf-* libraries use the same next channel. Snapshot publication can lag merges while builds are queued or failed; it is not a promise that the registry already contains current HEAD. next is a per-package alias, moved one package at a time after the whole snapshot has passed its install checks, so after a failed promotion one package's next can lag the others; the run summary and https://registry.npmjs.org/-/package/@mitre%2f<name>/dist-tags show where each stands. Consumers who need every package at one version pin that version.
Each snapshot has an immutable version such as 3.8.0-next.12345.1. Pin that exact version for reproducible downstream builds. Go consumers use the matching v3.8.0-next.12345.1 module version. Go has no dist-tag, so the branch next stands in for it: it points at the newest snapshot's prepared commit, which carries the module tags, so go get github.com/mitre/hdf-libs/hdf-converters/v3@next records that snapshot's module version rather than a pseudo-version. The Go module proxy caches its answer for @next separately for each module, for up to 30 minutes, so through the proxy @next can lag the branch and sibling modules requested @next can resolve to different snapshots. Consumers who need sibling modules at one snapshot pin its version (@v3.8.0-next.<run>.<attempt>), as with npm, or request them together with GOPROXY=direct, which reads the branch itself. Snapshot versions remain available when next advances: a version, once published, is immutable, while next is mutable and only ever points at a version whose complete snapshot passed the install checks.
Channels and authorization
| Channel | Purpose | Publication authority |
|---|---|---|
next | Latest successfully published main snapshot | Automatic snapshot workflow |
branch next (Go) | The same snapshot, for go get <module>@next | Automatic snapshot workflow |
rc | Maintainer-selected formal release candidate | Existing formal release process |
stable on @mitre/hdf-converters | Stable v3 converter release | Existing formal release process |
latest on the other libraries | Stable release | Existing formal release process |
The converter package's latest belongs to Heimdall's v2 line and is never assigned a v3 snapshot or release. The snapshot workflow does not publish formal root v* tags or GitHub Releases. Formal releases retain maintainer approval, the hardware-backed signing policy, provenance, and the release-preparation review process. Enforcing a specific signing subkey in CI is a separate follow-up; this implementation does not add that enforcement.
Preparation, build and npm publication run under the GitHub Actions service identity; only the tag push and the move of the Go branch next run as the mitre-hdf-libs GitHub App, described under Tag signatures and Promotion gate. A read-only preparation job checks out the commit that triggered the run and, through scripts/derive-snapshot-version.sh and scripts/prepare-snapshot.sh, creates versioned manifests and version constants without installing workspace dependencies. The dependency build runs on a separate runner; the tag writer receives the preparation artifact by its immutable ID, checks its commit and parent, and uses its module inventory. Build outputs cannot select the Git source or version to tag. Their version-rewrite commits are derived from main, contain only the npm manifest, Go module and hdf-engine version changes, and are not committed back to main or represented as maintainer-signed commits. An artifact attestation covers the package tarballs and a manifest identifying both the source SHA and prepared commit. npm publication also requests provenance through OIDC Trusted Publishing.
Versions
Preparation finds the highest stable root version reachable from the selected source commit. It chooses the next patch when hdf-schema/src/schemas is unchanged since that release, or the next minor when that directory changed, and floors the result at the version hdf-schema/package.json declares, so a merged prepare-release commit whose tag has not been pushed yet, including one for a major, is never undercut by a snapshot. It never infers a major release on its own. A major-version transition needs an explicit preparation process; the snapshot module inventory currently requires the v3 module paths.
The prerelease suffix combines the GitHub workflow run ID and attempt number. Each complete attempt gets a fresh version, including a rerun of the same source. These numbers identify publication attempts, not commits or release candidates. Gaps are expected, and snapshots do not create or advance rc.
The prepared commit receives a snapshots/vVERSION tag and matching module tags such as hdf-converters/vVERSION, all annotated tags signed by the MITRE snapshot key (see Tag signatures). Its sibling Go requirements name the same version, and the hdf-engine version constants (hdf-engine/src/version.ts, hdf-engine/go/engine.go) are stamped with it, so the documents and MCP handles a snapshot produces report the snapshot version rather than the previous release. PR CI’s standard Go consumer-graph check validates the source dependency graph, and the snapshot version-rewrite helper verifies matching sibling requirements. These checks run before publication; they do not fetch the newly tagged modules from the Go proxy. Snapshots use the same Go verification level as formal releases rather than adding a separate post-tag fetch job.
Tag signatures
Every snapshot tag, snapshots/v* and each hdf-*/v*-next.* module tag, is an annotated tag signed by the MITRE snapshot key: an ed25519 key, fingerprint A8AD EE1A 8DEF C056 7653 5E10 300F B5EF 8218 0E11, expiring 2028-11-05. It is a software key held as a repository secret and used by the workflow with no human present, which is the point of a snapshot. It is not the maintainer's hardware-backed release key, and a signature from it says only that the tag was created by the snapshot workflow. Stable v* tags are signed by the maintainer's key under the release process, and the release_tags ruleset refuses v* refs from the snapshot identity.
The tagger is the bot user of the mitre-hdf-libs GitHub App, mitre-hdf-libs[bot] <353107672+mitre-hdf-libs[bot]@users.noreply.github.com>, which is also the key's user ID. The App is owned by the MITRE organization and installed on this repository alone; the tag job mints a short-lived installation token scoped to this repository with contents: write, pushes the tags with it, and the token is revoked when the job ends. The job's own GITHUB_TOKEN stays read-only.
The public half of the key is published in the repository at .github/snapshot-signing-key.asc. To verify a snapshot tag, import it and ask git to check the tag:
gpg --import .github/snapshot-signing-key.asc
git tag -v hdf-converters/v3.8.0-next.12345.1Substitute the tag you are verifying; run git fetch origin --tags first if it is not local. A good result prints gpg: Good signature from "353107672+mitre-hdf-libs[bot]@users.noreply.github.com" and a Primary key fingerprint: line to compare with the fingerprint above. The WARNING: This key is not certified with a trusted signature! line is expected: it says the key is not in your web of trust, not that the signature is bad. Without the import, git tag -v fails with Can't check signature: No public key. The same file is served at https://raw.githubusercontent.com/mitre/hdf-libs/main/.github/snapshot-signing-key.asc for consumers without a checkout.
GitHub's UI shows no Verified badge for these tags and its API reports their signature as not verified. GitHub verifies a tag by matching the signature to a GPG key registered on the account that owns the tagger email, and a GitHub App's bot user has no key store to register one in. The guarantee is the signature plus the published key, checked with the commands above, not the badge.
Inside the job, the private key is imported into a temporary keyring created outside the checkout, with the passphrase passed on a file descriptor so no gpg call can prompt or log it; the keyring is removed in a step that runs even when the job fails. Before signing, the job checks that the secret holds exactly the key published in .github/snapshot-signing-key.asc and refuses to sign otherwise, so rotating the key means replacing the secrets and the published file together.
Concurrent merges and recovery
Every push to main triggers the workflow, including documentation and dependency changes. GitHub concurrency keeps one running publication and one pending run; newer pushes replace the pending run. Each run builds the commit that triggered it, which is the commit its npm provenance and build attestation name. Intermediate commits replaced in the pending slot never receive a snapshot. The running publication finishes even if main advances during its build; the newer commit's own run follows. Preparation fails closed if main has already moved past the triggering commit when it starts, so a run that lost that race, or a rerun of an older run, never moves next back to older code.
The single workflow serializes preparation, build, tag and npm publication. A complete rerun builds the same commit under a fresh version, and is refused once main has moved past it. The snapshot installs at the selected source with frozen workspace dependencies, then selects the prepared commit and builds and packs from it, so the stamped version constants reach the published dist/; the packed npm archives then use the same install/import smoke check as formal pre-release verification. The full lint, test and security suite stays in PR CI. Publication performs the build, version validation and shared npm smoke check without rerunning that suite.
Before any npm write, the publisher validates the complete archive batch with scripts/check-snapshot-archives.sh against the inventory scripts/list-npm-packages.sh derives from the trusted source checkout; the same inventory drives CI packing, the pre-release smoke test and the formal release, so a new package reaches every path or none. It requires exact snapshot names, versions and sibling pins, one regular package manifest per archive, and no publication configuration beyond public access. Preparation also refuses to tag or publish anything until @mitre/hdf-converters carries a stable dist-tag, because snapshots take over the next alias that stable v3 installs previously used. Registry and channel selection come from explicit publication commands. Packages initially publish under snapshot-staging. The workflow advances their next aliases only after the entire publication batch succeeds. npm does not provide a transaction across package dist-tags: a failed promotion can leave aliases temporarily split. Consumers needing a coordinated snapshot should pin exact versions; each package pins its runtime sibling dependencies to the same snapshot version.
To recover from a failure before publication on the newest commit, select Re-run all jobs on its run, which builds the same commit under a fresh version. For a failure after publication (the wait, an install check or the promotion), select Re-run failed jobs: the publish job re-runs against the same version and archives, skips every package the registry already serves at that version, waits again, runs both install checks again, and re-advances next for every package. Both re-runs refuse once main has moved past the commit; the newer commit's own run covers it. The exception is Re-run failed jobs when only advance-go-next failed: preparation and publication do not run again, so the job's own checks decide: it refuses a source main has moved past when next does not exist, and when it does, refuses any move to an older source or an older snapshot of the same source. The re-run advances next when those checks allow it, and otherwise leaves it where it was. For anything older, manually run Main snapshots on main with no inputs, which snapshots the current tip under a fresh version. Already published immutable versions and Git tags remain available; the workflow never deletes or overwrites them. A partially published failed attempt may leave staging versions that never become next. Unlike formal releases, snapshots do not compare registry contents to resume partially published immutable versions.
Promotion gate
Publication and promotion are separate steps of the publish job, in this order: publish every archive (scripts/publish-snapshot-packages.sh, which skips a package the registry already serves at the version), wait until the registry serves every package's version and proxy.golang.org serves every module (scripts/wait-for-snapshot-publication.sh: 10 minutes, polled every 30 seconds; the proxy is asked only after the registry has answered, because a premature ask makes the proxy cache a not-found), install every package from the registry into an external consumer and import it (scripts/check-npm-consumers.sh --registry-version), resolve and build every module through the proxy (scripts/check-go-consumers.sh), and only then move next for each package and read every alias back until it converges (scripts/promote-snapshot-next.sh: 5 minutes, every 15 seconds; npm applies dist-tag writes asynchronously and has lost an acknowledged write once).
Once the publish job succeeds, the advance-go-next job moves the branch next to the prepared commit (scripts/advance-snapshot-go-next.sh). It runs as the mitre-hdf-libs App, like the tag job, and refuses a commit that is not the version's snapshots/v tag or not a child of the source, a source that is not on main, a source behind main's tip when next does not yet exist, and any move to a snapshot built from an older source or to an older snapshot of the same source (two snapshots of one commit are ordered by version: release, then run ID, then attempt), so a late re-run never takes next back. It pushes with a lease and reads the branch back. A failure here leaves npm next advanced and the Go branch on the previous snapshot, which the run summary states; Re-run failed jobs retries it.
A wait timeout is a failed run. Its message states that the versions are published and immutable, that the install checks did not run, that next was not advanced for any package, and that Re-run failed jobs is the recovery. A failed install check fails the run with the check's own output and advances nothing. A promotion that does not converge fails the run naming each package whose next still differs, and the run summary carries the per-package table either way. Never repair next by hand with npm dist-tag; the re-run re-issues the add for every package and reads the registry back, which is the oracle.
Maintainer activation
Before enabling the first snapshot publication:
- Verify the GitHub environments
npm-snapshotsandsnapshot-tagsallow only themainbranch. These environments were created during security remediation, without the formal release environment's per-release reviewer requirement. Keep the formalnpm-publishenvironment and release-tag rules unchanged. The tag-writing andadvance-go-nextjobs usesnapshot-tags; npm trustsnpm-snapshots. - Add a separate npm Trusted Publisher for
mitre/hdf-libs, calling workflowsnapshot.yml, environmentnpm-snapshots, to each public@mitre/hdf-*package listed inhdf-*/package.json. Permit direct publication and Allow npm dist-tag. Preserve existing formal-release and Heimdall publisher configurations. - Initialize the converter package's
stablealias to the current released v3 version (npm dist-tag add @mitre/hdf-converters@<version> stable) before this change merges: the READMEs already instruct@stable, and preparation refuses to tag or publish anything until the alias exists. Confirm itslateststill points to v2. - Verify the immutable module/snapshot tag ruleset protects
snapshots/**andhdf-*/**against updates and deletion. It retains the maintainer-team bypass and permits new module/snapshot tags; the workflow pushes an explicit, atomic snapshot ref list as themitre-hdf-libsApp, which must be able to create those tags and must appear on the bypass list of no ruleset that covers tags, so therelease_tagsruleset keeps it offv*. Formal rootv*creation protections remain unchanged. Formal module-tag creation authorization and exact signing-key enforcement need the separate release-hardening work; this immutability rule does not supply them. - Set what the tag and
advance-go-nextjobs read on thesnapshot-tagsenvironment: the variableSNAPSHOT_APP_CLIENT_ID(themitre-hdf-libsApp's Client ID, shown on its settings page and distinct from its numeric App ID; it is public, so a variable rather than a secret), and three secrets:SNAPSHOT_APP_PRIVATE_KEY(a private key generated on the App's settings page), andSNAPSHOT_GPG_PRIVATE_KEYandSNAPSHOT_GPG_PASSPHRASE(the armored private half of the MITRE snapshot key and its passphrase). The App needscontents: writeandmetadata: readon this repository only. Because the environment deploys frommainalone, a token can be minted only frommain. - Verify the
Snapshot next branchruleset coversrefs/heads/nextalone and restricts creation, updates, deletion and force pushes, with two bypass actors: themitre-hdf-libsApp, because movingnextis never a fast-forward (each prepared commit is a child of its own source), and organization admins, for recovery. No other writer can touch the branch. This is the one ruleset the App bypasses; it covers a single branch and no tag, so the rule above still holds for every ruleset that covers tags. It does not require signed commits: the prepared commit is authored unsigned by the Actions identity, and the snapshot's signature is on its tags. - Merge the implementation and inspect the first publication's attestations, matching module versions, npm consumer result, npm
nextaliases, the Go branchnext(go list -m github.com/mitre/hdf-libs/hdf-converters/v3@nextwithGOPROXY=directreports the snapshot version), and the tag signatures with the commands under Tag signatures. External settings and live publication cannot be verified by local tests. Complete this activation near the first publish: newly configured npm trust relationships expire if not validated within two days.
npm Trusted Publishing binds the package to the repository, workflow and environment; it does not provide a next-only version or alias restriction. The validation above prevents a compromised build artifact from requesting stable publication, but compromise of the privileged publisher itself remains a broader authority risk. Signing Git tags alone cannot restrict that independent npm authority. Before activating npm trust, check for older eligible snapshot runs: reruns retain historical workflow definitions. If vulnerable runs exist, retire their workflow identity before enabling trust for the hardened implementation.
CI, pre-release consumer checks, formal publication and snapshots all use npm 11.21.0 from the shared integrity-pinned npm setup action, which only the jobs that run npm invoke. The same client performs consumer installs and OIDC dist-tag operations. It does not need a persistent npm token or a copy of a maintainer's signing key. The formal workflow continues using the same preparation and approval boundary; changes to formal publishing mechanics still require its RC pipeline validation before the next stable release.
See the developer guide and release verification for build commands and artifact verification.