# Release archive format, version 1

The website reads this data in the browser. Releasing a new approved tag requires
updating **only `archive/`**, not rebuilding or deploying any HTML, CSS, or JS.
Here `archive/` means the server's public archive URL, backed locally by
persistent `dist/archive/` outside Git. It is separate from the static-only
`dist/website/` and `dist/website.tar.gz` + `.sha256` transfer; neither contains
packages or an archive. The checkout's root `archive/` holds legacy private
source collections, and `dist/mirror/` holds private deduplicated corresponding
sources and verified artifact records. Never publish either private store.
The repository's `website/DEPLOYMENT.md` describes local
test/release management, local-backup recovery and verified-mirror-backed asset
selection. The schema below is the browser contract.

## Publication boundary

Only tagged releases explicitly approved by Terry belong in the public index's
`releases` list. Creating a tag, compiling binaries, or discovering a directory
does not grant approval.
Keep unapproved builds out of the approved release catalog. An explicitly
selected untagged snapshot is presented as the **latest untagged release**,
separately from tagged history; generating it does not authorize upload.
Tagged-release artifacts, source, manuals, and provenance must come from the
approved tagged commit and follow the project's release process. Never rename
development binaries into a tagged release.

Isolated local test catalogs may use unmistakable synthetic/candidate IDs with
the same schema, but they are not public release catalogs. A candidate's base
`source_commit` does not identify its entire dirty source; retain its complete
candidate source record. Target-aware tooling enforces this separation,
but cannot infer publication approval from structurally valid JSON.

## `archive/meta.json`

An empty, valid index is:

```json
{
  "schema_version": 1,
  "latest_stable": null,
  "releases": []
}
```

A release entry has these required fields:

| Field | Meaning |
| --- | --- |
| `tag` | Approved Git tag, such as `v1.0.1` |
| `directory` | Same value as `tag`; one relative directory name |
| `channel` | `stable` or `prerelease` |
| `published_at` | UTC timestamp, exactly `YYYY-MM-DDTHH:MM:SSZ` |

`latest_stable` must name a listed stable tag; it must be null if there are no
stable entries. Tags must be unique. The latest stable release displays first;
other entries display newest publication date first. No filename or lexical tag
ordering is used to guess the latest stable version.

### Untagged snapshot extension

Only a snapshot selecting an untagged candidate may additionally contain:

```json
"latest_untagged": {
  "tag": "untagged",
  "directory": "untagged",
  "channel": "untagged",
  "assembled_at": "2026-10-01T00:00:00Z"
}
```

This is a separate current-build pointer, **never an entry in `releases`**.
Its manifest lives locally at `dist/archive/untagged/meta.json`, served as
`archive/untagged/meta.json`, has `tag: "untagged"` and
requires candidate `source_identity`. Assembly time is not publication time.
The browser displays it first as **LATEST UNTAGGED RELEASE** on a dark-red
panel while keeping tagged history available below. Tagged and untagged
snapshots use the same UI; only the latest wording/red untagged distinction
changes, and displayed fields vary with the metadata. Replacing a snapshot
replaces the previous provisional directory, not tagged history or private
mirror sources. Tagged snapshots omit both the field and directory, even if a
previous local snapshot selected a candidate.

The browser supports this extension for live untagged downloads as well as
local snapshots. Publishing an untagged snapshot uses a separately approved
manual upload; tagged-release import/check/plan reject this extension. See
[DEPLOYMENT.md](DEPLOYMENT.md#real-local-snapshot-tagged-or-untagged).

## `archive/<tag>/meta.json`

| Field | Required | Meaning |
| --- | --- | --- |
| `schema_version` | yes | `1` |
| `tag` | yes | Must match its index entry |
| `version` | yes | Display version, such as `1.0.1` |
| `source_commit` | yes | Full 40- or 64-digit hexadecimal Git commit ID |
| `notes` | no | Plain-text release notes; generated previews omit it until supplied (older empty strings render as no notes) |
| `manual` | no | Relative path to this release's HTML manual |
| `manual_markdown` | no | Relative path to this release's Markdown manual |
| `files` | yes | Nonempty array of file objects below |

The local manager may also generate `source_identity` with exactly `mode`,
`export_sha256` and a list of `artifact_sha256` values from verified mirror
packages. Source identity is retained in metadata, not displayed as a development
footer. The browser does not verify package bytes or grant publication approval. Manager plans and builds reject other undocumented index, manifest,
file, or provenance fields so private/test state cannot be copied into a public
JSON update. Imported older manifests may omit `source_identity`.

Each file has:

| Field | Required | Meaning |
| --- | --- | --- |
| `name` | yes | Actual filename in this release directory |
| `label` | yes | Human-readable download link text |
| `kind` | yes | Display category, e.g. `AppImage`, `deb`, `Arch`, `source`, `checksums` |
| `size` | yes | Nonnegative, safe JSON integer; exact size in bytes |
| `sha256` | yes | 64 hexadecimal digits; checksum of the final file |
| `platform` | no | Display platform, such as `Linux` |
| `architecture` | no | Display architecture, such as `x86-64` or `amd64` |
| `requirements` | no | Plain-text system requirements and compatibility caveats |
| `install` | no | Installation/build instructions: plain text with optional fenced shell command blocks |
| `role` | no | Presentation grouping: `appimage`, `deb`, `arch`, `helper`, `arch-kit`, `source`, `other`; absent is inferred from recognized legacy `kind`, with unknown kinds shown under Other downloads |

Include source archives, dependency/compliance assets, checksum manifests, and
installers in `files`, not just binaries. `meta.json` itself cannot be a file
entry. Filenames must be unique within a release. `SHA256SUMS` can be listed and
hashed, but its own contents should not include its own hash.
When a matched AppImage installer or local Arch source kit is available, list it
in the **same release** with its own size and checksum. A local-source Arch kit
contains its PKGBUILD, .SRCINFO, source tarball and provenance; a PKGBUILD alone
is not a self-contained download or an AUR submission. The browser groups a
`helper` with an AppImage and an `arch-kit` with a prebuilt Arch package when
present. Without a prebuilt Arch package, a standalone `arch-kit` (including
legacy `kind: arch-kit`) is a first-class build choice after the package
options, with “How to build” instructions if provided. An unpaired helper and
unknown kinds appear under Other downloads rather than disappearing. Each source entry is linked once per release, including when more than one
source archive is listed. Optional presentation text does not change verified
file facts; older manifests without roles remain valid.
Public filename components begin with an ASCII letter or digit and may then
contain ASCII letters, digits, `.`, `_`, `+`, `-` and `~` (including ordinary
Debian `.deb` names). Slashes, backslashes, percent escapes, empty/dot
components and the reserved `meta.json` filename are not accepted. Manual
paths may use multiple such components separated by `/`; download names may not.

The site renders metadata as **text, never HTML**. In `install`, put explanations
outside fenced command blocks; delimit each block with a line containing
three backticks followed by `sh`, `bash` or `shell`, and a closing line of three
backticks. Commands appear in contrasting monospace blocks with a Copy button
that copies only the exact command text, without fences, prose or shell prompts.
Separate optional install/removal actions into their own blocks; do not mix an
explanation and a command on one line. Instructions without fences retain the
legacy preformatted display. This is not a general Markdown renderer.
Commands are never executed by the site. No Markdown conversion is performed
on notes. Keep instructions self-contained and version-matched.

Absolute paths and URL schemes are also rejected.
Artifact and manual URLs resolve relative to the release directory, not the
page displaying them. This works under a domain root or a subdirectory.

## Update sequence

Editable catalogs/baselines/assets live in `dist/.state/{release,test}/`, not in
the generated archive. `.state/current/` inventories public outputs. An explicit
verified `add --target release --tag ...` for an already approved release advances
the website revision and latest selection while preserving history; discovering
tags never adds or promotes them implicitly. Snapshot writes the selected public
archive and static outputs, plus a public-only combined preview under
`packaging/build/website/current/site/`. Never serve the `dist/` root.

1. Obtain approval for the exact new tag and assemble its final assets.
2. Generate the metadata from the actual files (`sha256sum` and byte sizes),
   check provenance and license/source completeness, and verify every link.
3. Upload the complete new tag directory, including its `meta.json`, without
   overwriting an existing published release.
4. Update the top-level index **last**, replacing it atomically if possible.
   Explicitly set `latest_stable` when promoting a stable release.
5. Refresh the downloads page and verify the files and hashes on the server.

Static uploads are independent: a static-only site tar must not overwrite or
delete the live `archive/`. Back up `dist/archive/`, `dist/mirror/` and
`dist/.state/` together. A complete public archive backup can reconstruct release
metadata/files using the existing `import --target release` workflow; private
mirror sources must be restored separately.

The browser fetches metadata with `cache: no-store`. Configure the server/CDN
not to retain stale `archive/meta.json` responses (`Cache-Control: no-cache` or
`no-store`); do not force-cache JSON at a reverse proxy. Immutable release
artifacts may use long-lived caching. The frontend validates metadata structure
and paths; it does not download all binaries to recompute checksums. Artifact
hashes and source provenance must be checked before publication.

Missing or invalid indexes show a retryable error. Invalid release manifests
fail independently: valid releases remain visible. An empty index displays a
neutral empty state, not a promise of a release date. No automatic polling or
service worker is used; refresh to see archive updates.
