Tool release metadata v1
This specification defines how Morphir authenticates, discovers, selects, and locks tool releases. It profiles The Update Framework 1.0.36 and adds Morphir fields to signed target metadata. TUF remains authoritative for signature verification, root rotation, metadata versioning, expiry, rollback protection, and target hash verification.
The profile applies to tools such as Morphir Desktop. Extensions may reuse the trust and transport machinery, but their release descriptors remain a separate schema.
Trust boundary
A tool repository is one logical source governed by one trusted repository root. A repository can have several mirrors. Mirror URLs choose where bytes come from and do not change what the client trusts.
The CLI receives its first trusted root through an out-of-band path:
- the official Morphir root is embedded in a CLI release;
- an administrator may provision another root with global configuration;
- a user may explicitly import a root file after inspecting its repository identity.
The repository identity is the lowercase SHA-256 digest of the canonical JSON encoding of the initial root's signed object. Root signatures do not affect identity because they can be added or reordered without changing the trusted keys and roles. Moving between mirrors preserves this identity. Replacing the initial root changes the repository identity and requires explicit trust bootstrap.
Trusted root state is durable security data beneath Morphir Home. Cached timestamp, snapshot, targets, release descriptors, and artifact bytes are disposable copies. Cache cleanup must never remove the current trusted root or the installed inventory's exact release locks.
TUF profile
Metadata follows TUF 1.0 JSON with these constraints:
| Concern | Version 1 rule |
|---|---|
| TUF version | spec_version must be compatible with 1.0. The conformance fixture uses 1.0.36. |
| Encoding | UTF-8 JSON. Signed objects use canonical JSON for signature verification, with exactly the rules stated for the plan digest. Those rules govern wherever canonical JSON libraries differ; the same encoding produces repository identity, signature input and plan digests. Target paths are NFC (see target paths). Floating-point values are forbidden. See canonical JSON and the reference TUF implementations and signed text. |
| Keys | Ed25519. An implementation may add a TUF-defined scheme only after adding conformance fixtures. |
| Target hashes | SHA-256 is required. Other TUF hashes may accompany it. |
| Snapshots | consistent_snapshot must be true. |
| Root threshold | The official production repository uses at least two trusted root signatures. Test and explicitly configured development repositories may use one. |
| Targets threshold | At least one targets signature. The official version 1 repository treats the top-level targets role as its publisher authority. |
| Delegations | Version 1 does not assign Morphir semantics to delegated role names. A conforming TUF client may process standard delegations when repository policy enables them. |
Clients apply bounded download limits before parsing metadata. The initial limits are 64 KiB for each root or timestamp file, 1 MiB for a snapshot, 8 MiB for targets metadata, and 1 MiB for a release descriptor. A trusted target's declared length limits every artifact download.
Canonical JSON and the reference TUF implementations
This profile's canonical JSON is not the canonical JSON that the TUF reference implementations write. securesystemslib's encode_canonical, which python-tuf uses, and, by its documented sort, go-securesystemslib's cjson differ from it in two ways:
- Key order. This profile sorts each key's encoded bytes, enclosing quotation marks and escapes included. The reference implementations sort the raw keys. The orders differ when a key is a prefix of another that continues with a character below
"(U+0022), and when a key contains"or\. For{"a b":2,"a":1}this profile writes{"a b":2,"a":1}and securesystemslib 1.6.0 writes{"a":1,"a b":2}. For{"a#":1,"a\"":2}this profile writes thea#member first and securesystemslib thea"member. - NFC. This profile writes every string in NFC; the reference implementations write strings as they are.
So the reference TUF implementations cannot be assumed to sign this repository's metadata. A signature they make over a signed object that holds such keys, or text that is not NFC, does not verify here: it is metadata_signature_invalid.
A tool that signs metadata for this profile must:
- encode
signedby the plan digest rules; - refuse to sign text that is not already NFC, which the signed text rules refuse anyway;
- sign those bytes.
A signing tool that only reorders keys can use the reference implementations when no key in signed differs in order between the two encodings. That holds for metadata whose keys are TUF's own member names, key ids and target paths without such prefixes or characters. Whether the profile should adopt the reference encoding instead is open question Q3.
The cases pin both encodings:
- the
canonical-jsonbinding cases in the toolchaincases.jsongive this profile's bytes beside securesystemslib's for each key pair and for a decomposed string; - the plan digest case
result/setup-plan-key-order.jsoncarries both key pairs; - the signed metadata sets
keyOrderandkeyOrderReferenceTufhold the same targets, signed over this profile's bytes and over the reference encoder's bytes, and their trust cases load and refuse them.
Signed text
Canonical encoding normalizes strings to NFC, so two signed objects whose strings differ only in NFC-equivalent spelling have one signature input. Someone holding the online snapshot and timestamp keys, but not the offline targets key, could then serve targets text that differs from what was signed and re-link it. That attack works against any version 1 repository, whatever targets it publishes, and a client checks root, timestamp and snapshot before it has read targets, so the rule cannot be limited to repositories that carry toolset recipes. Every version 1 client therefore checks the text of every role's signed object, as served (maintainer decision of 10 November 2026, Decision 12):
- a string or member name that is not already NFC by the Unicode 17.0.0 rule is refused with
metadata_signature_invalid. Then the signature input is one-to-one on accepted metadata, and normalization never changes signed text; - target paths are member names of the targets role, so a target path that is not NFC is refused by the same rule. A reader under the toolchain contracts checks target paths first and reports one that is not NFC with its own code,
non_portable_path.
The Rust tool client in morphir-distribution does not apply these rules yet; that follow-up is finos/morphir-rust#331. This repository's toolchain checker applies them. Readers under the toolchain contracts also apply two stricter rules, about case variants of defined members and an integer bound, which are not version 1 rules.
The signed set customText pins the NFC rule: its targets load, and one trust case serves them with the custom text decomposed, under the original targets signature with the snapshot and timestamp re-linked, and is refused. Another trust case serves the non-ASCII target path decomposed the same way, and a toolchain reader refuses it with non_portable_path.
Root rotation
The client persists the newest trusted root. Starting at trusted version N, it requests only N + 1, then continues one version at a time. Each new root must:
- have version
N + 1; - satisfy the old root role threshold;
- satisfy its own new root role threshold;
- pass the remaining TUF root checks.
The client stops after 32 accepted roots in one refresh and asks the user to retry. This bounds one operation without changing trust. A repository must retain every numbered root so an old client can follow the complete chain.
If a threshold of trusted root keys is compromised, ordinary online rotation cannot restore trust. Recovery requires a new root delivered out of band.
Freshness and rollback
One refresh uses a fixed trusted start time for every expiry check. The client rejects expired timestamp, snapshot, targets, and delegated targets metadata. It also applies TUF version and hash checks so a mirror cannot replay an older snapshot or mix metadata versions.
Recommended maximum publication lifetimes for the official repository are:
| Role | Maximum lifetime |
|---|---|
| Timestamp | 24 hours |
| Snapshot | 7 days |
| Targets | 30 days |
| Root | 366 days |
These are publisher limits. A client still trusts the exact signed expires value when it is shorter.
Repository layout
Logical target paths use forward slashes and normalized lowercase identity segments:
releases/<tool-id>/<exact-version>.json
artifacts/<tool-id>/<exact-version>/<platform-archive>
Target paths are relative, contain no empty, . or .. segment, and never contain a backslash or drive prefix. TUF consistent-snapshot rules determine the physical URL used to retrieve a target.
Each release descriptor target has a custom.morphir object:
{
"schemaVersion": 1,
"kind": "tool-release",
"toolId": "desktop",
"version": "1.0.0",
"channels": ["stable"],
"status": "active",
"compatibility": {
"morphirCli": ">=0.4.0-alpha.5, <0.5.0"
},
"platforms": [
{ "os": "windows", "arch": "x86_64" }
]
}
This small record is enough to resolve a release before downloading its descriptor. Its channel membership and status are the current authenticated release state and are authoritative for resolution and revocation. The descriptor repeats the identity, version, compatibility, and immutable artifact contract. A mismatch in those immutable values is release_descriptor_mismatch.
Version 1 descriptors also carry channels and status. Those fields record the state at initial publication. Clients validate their shape but do not compare them with current targets metadata or use them for selection. This keeps the descriptor bytes immutable when a publisher moves a release between channels, yanks it, or revokes it.
An artifact target uses kind: "tool-artifact" and records its tool, version, and platform in the same namespace. The release descriptor references artifact target paths. Length and hashes come only from authenticated TUF target metadata, even if another publication format repeats them.
The release descriptor schema is published as tool-release-v1.schema.json.
Release states
| Status | Moving channel | Exact selection | Already installed |
|---|---|---|---|
active | Eligible | Eligible | Launches normally |
yanked | Excluded | Eligible | Launches normally |
revoked | Excluded | Rejected | Launch is rejected after the revocation is learned and persisted |
Revocation is monotonic for a repository metadata history. A later targets version must not return the same tool version to active or yanked. Republishing different bytes under an existing tool version is forbidden. A corrected build receives a new semantic version.
Publishers change channel membership and release status only in a later signed targets version. A yanked or revoked release has no channel memberships in current targets metadata.
When a refresh learns that an installed release is revoked, the inventory records the trusted targets version and revocation reason before reporting the failure. Offline launch then enforces the known revocation without consulting a mirror.
Channel and exact-version resolution
The request is either one exact semantic version or one channel. The installed lock retains the original request spelling and the exact selected result.
Metadata recognizes these channel names:
stablepreviewinsiderspreview/<segment>, where the segment is a lowercase portable token
insiders and the unsegmented preview request select the same preview family. Publishers should use preview in new metadata. Keeping the requested insiders spelling in the lock preserves user intent.
A resolver performs these steps without network or filesystem effects:
- Authenticate and freshness-check the complete TUF metadata set.
- Keep release records for the requested tool with a matching CLI requirement and platform.
- Exclude revoked releases. Exclude yanked releases for moving channels.
- For
stable, keep only final semantic versions that namestable. - For
previeworinsiders, keep releases namingpreview,insiders, or anypreview/<segment>. - For a segmented preview, keep only the exact segment.
- Select the greatest semantic-version precedence.
An exact request ignores channel membership and may select a prerelease or yanked release. It still enforces the current authenticated status, CLI compatibility, platform availability, and immutable descriptor consistency.
One repository cannot contain two records with the same exact version. It also cannot contain versions with equal semantic precedence but different build metadata. Both would make the selected record depend on document order.
Offering-specific tool ids
A host published in several deployments uses one tool id per separately published offering. Each id is an ordinary version 1 tool release; this section adds no descriptor member and leaves schemaVersion at 1. The .NET host publishes:
| Deployment | Tool id | Example artifact target |
|---|---|---|
native-aot | morphir-dotnet-native-aot | artifacts/morphir-dotnet-native-aot/1.2.3/win-x64.zip |
self-contained | morphir-dotnet-self-contained | artifacts/morphir-dotnet-self-contained/1.2.3/win-x64.zip |
framework-dependent | morphir-dotnet-framework-dependent | artifacts/morphir-dotnet-framework-dependent/1.2.3/linux-arm64.tar.gz |
dotnet-tool | none: the Morphir.Tool NuGet package | packages/nuget/morphir.tool/1.2.3/morphir.tool.1.2.3.nupkg |
All three archive offerings launch morphir (morphir.exe on Windows). The executable name therefore identifies none of them; the tool id, version and platform do. Version 1.2.3 is illustrative.
A toolset recipe maps each offering to its implementation and deployment identity and binds each platform to an exact target and digest:
{
"implementation": "dotnet",
"version": "1.2.3",
"deployment": "native-aot",
"execution": "native-aot",
"source": { "kind": "tool-release", "toolId": "morphir-dotnet-native-aot" },
"platforms": {
"win-x64": {
"target": "artifacts/morphir-dotnet-native-aot/1.2.3/win-x64.zip",
"sha256": "<the authenticated SHA-256 of that target>"
}
}
}
A recipe binding is accepted only when the target is authenticated, its digest equals the authenticated digest, the offering's release descriptor releases/<tool-id>/<version>.json lists that target, and the artifact's version 1 platform is the bound platform. Version 1 platforms do not state a C library, so an offering's Linux artifacts bind only to glibc platforms (linux-x64, linux-arm64); a musl machine is told that no artifact matches.
Version 1 requires compatibility.morphirCli, and its resolver filters releases by the acquiring Morphir CLI's version. A host offering publishes <0.0.0-0, which no version satisfies, so the Morphir CLI never selects a .NET host offering through version 1 resolution: there is no second installer. >=0.0.0 would not do, because it starts matching at the first final CLI release. A manager acquiring an offering through a recipe is not the Morphir CLI and never evaluates the member; it checks the recipe's exact bindings against the authenticated release instead (see toolset recipe limits).
Recipe targets are a separate target kind. Their custom.morphir object is { "kind": "toolset-recipe", "schemaVersion": "0.1.0-draft.1", "preset", "version", "channels", "status" }, versioned by the recipe contract. A version 1 client ignores, for resolution, every target whose custom.morphir.kind it does not define. Such targets are authenticated like any other target, but never selected as a tool release. The reference tool client in morphir-distribution resolves only tool-release targets, and its tests read a repository that also publishes recipe and extension targets. Channel and status follow the release states and channel resolution above.
Mirrors
Mirror order belongs to effective user or administrator configuration. The client tries mirrors in order for each metadata or target path. It verifies every response with the same trusted root, metadata links, declared length, and hashes.
A mirror failure can cause a retry at another mirror. A signature, rollback, expiry, length, or hash failure emits a repository integrity event before any retry. A successful retry must still produce the one metadata version and target digest selected by the trusted update workflow.
Proxy, TLS, timeout, and authentication behavior belongs to transport configuration. HTTPS is required for public mirrors, but TLS never replaces TUF authentication.
Offline and expired metadata
| Operation | Offline behavior |
|---|---|
| Launch an installed active release | Use the installed inventory lock and reverify installed bytes. Do not read repository metadata. |
| Repair an installed release | Use a verified content-addressed object when present. Otherwise report that network access is required. |
| Resolve a moving channel | Use cached metadata only when the complete set is unexpired. |
| Install an exact release not already locked | Require unexpired cached metadata and cached verified target bytes. |
| Refresh metadata | Fail immediately because --offline forbids mirror access. |
Expired repository metadata never invalidates an otherwise valid installed release. It prevents a new resolution. Known revocation state remains durable and continues to block launch.
A failed online refresh leaves the previous trusted metadata and active installed release unchanged. The error reports the repository identity, mirror, metadata role, stable diagnostic code, operation ID, and log path.
Stable diagnostics
Implementations use these codes at the public boundary:
metadata_signature_invalidmetadata_expiredmetadata_rollbackmetadata_link_mismatchmetadata_root_rotation_invalidtarget_length_mismatchtarget_digest_mismatchrelease_descriptor_mismatchrelease_revokedno_compatible_releaseoffline_metadata_unavailable
More detail may appear in structured fields and logs. The code remains stable across TUF library changes.
Conformance fixture
The version 1 fixture contains deterministic test-only Ed25519 keys and signed metadata. It proves:
- a two-of-three trusted root and a dual-threshold root rotation;
- timestamp, snapshot, targets, release descriptor, and artifact authentication;
- expiry and tamper rejection;
- active and revoked release handling;
- deterministic stable, preview, insiders, segmented preview, and exact selection;
- CLI and platform compatibility filtering;
- repository identity that remains unchanged across two mirrors.
The keys and payloads are fixtures. They must never be used by a deployed repository.