# Vectrune artifact catalog v1

The official catalog is at https://vectrune.com/artifacts/index.json and its
schema is at https://vectrune.com/artifacts/index-v1.schema.json. A catalog is
one static UTF-8 JSON document, up to 1 MiB, served over HTTPS without redirects.
Authors can use a `file://` index for local testing. No registry service or
account is required to host a catalog.

Set `schema_version` to 1 and give the catalog a display `name`. Each entry in
`packages` has a unique lowercase `id`, a display name and summary, `kind`
(`rune` or `native`), an HTTPS `git` clone URL, and a `homepage` for package
documentation. Optional `translations` map locale strings to translated
summaries. Local fixtures may use local Git URLs.

A package can provide a `documentation` object with an HTTPS `url` for its
rendered HTML usage guide and an HTTPS `source` link to the `.rune` file
in its Git repository. The official catalog requires both. Keep the guide in
the package repository and publish the rendered page from there. Document the
supported CLI commands, added sections and builtins, and Rune files users
can import. Label preview or version-specific functionality. Catalog clients
may link to this page without fetching it during dependency installation.

Each package has a `releases` array with unique SemVer `version` values, and
a `default_version` equal to one listed version. A release records the full
lowercase Git `commit` SHA and a public HTTPS `url` for the release or revision.
When present, `tag` names the Git tag at that commit. The tag and release URL
are informational. Consumers use the exact commit to install Git source.
Avoid changing the Git source or commit of a published version.

```sh
vectrune deps add kafka
vectrune deps add health --version 0.1.0
vectrune deps add widget --repository https://example.org/vectrune/index.json
```

The index URL and package ID identify a catalog entry. Each command selects
one index. A third-party index takes effect only when explicitly selected.
The local alias defaults to the package ID and can be changed with `--name`.
The generated project manifest records the Git source and commit. The normal
lockfile records and verifies the installed tree, so locked restores need only
Git and never contact the catalog. Clients reject unknown major schema versions
and may ignore additional fields in v1.

Catalog inclusion does not authorize code execution. A native package lists
its own release downloads and setup instructions. Build or download the
matching library and approve it separately. The catalog does not download or
run native binaries, and does not replace per-dependency signature policies.

## Submitting published versions

For a first listing, add one file at `teaching_website/artifacts/packages/<id>.json`
and open a catalog pull request. Use the same package object as the entries
in the published index, with a filename that matches the package ID.
Validate the entries from the repository root:

```sh
python3 teaching_website/artifacts_metadata.py
```

The Pages build generates the v1 index and site cards from these entries.
After listing, a repository can use the workflow scaffolded by `vectrune deps init`
to update its package file.
Set `VECTRUNE_CATALOG_TOKEN` to a credential that can push to the official
catalog or a fork and open a public pull request. A classic PAT with
`public_repo` from a dedicated automation account with a catalog fork is one
option. Set `VECTRUNE_CATALOG_FORK` to the fork's owner and repository name
if its path differs from `<account>/vectrune`. Set
`VECTRUNE_CATALOG_PACKAGE_ID` if the listed ID differs from the scaffold name.

The workflow resolves the published tag to a commit, checks native asset
checksums when applicable, and opens a pull request for review. By default
it appends the version and leaves the default in place. Set
`VECTRUNE_CATALOG_PROMOTE=true` to propose a new stable default. A workflow
authorized only by its repository's `GITHUB_TOKEN` cannot create a cross-repo
catalog PR. Releases created by that token also do not trigger a separate
`release: published` workflow. Run the scaffolded submission workflow with
the published tag from the Actions tab, or call the reusable
`catalog-submission.yml` from the publishing workflow. For a reusable call,
pin it to the full SHA of a reviewed revision that supports package files.
The workflow loads its tools from that revision and reads package files
from the current catalog. If an existing add-on's workflow reads the old
`teaching_website/artifacts/index.json` source file, update it to a current
`vectrune deps init` scaffold or the reviewed reusable workflow before
submitting another release.
