ADR-0011 — Git-based plugin registry and lockfile
Status: Accepted
Context
Section titled “Context”The store must exist early for adoption but should not require running a backend service.
Decision
Section titled “Decision”- A plugin is a git repository with semver tags. A registry is a git repository containing an index (name → repo URL, publisher, verified flag), like Go modules or the Terraform registry.
cicord.yamllists registries;source: cicord/welcomeresolves through the registry namedcicord.cicord.lockpins, per plugin: resolved version, commit SHA, content integrity hash and requested capabilities.cicord plugin add/cicord plugin updatemaintain it; the runtime refuses registry plugins missing from the lockfile.- Local plugins (
source: ./plugins/x) are not locked; they are part of the repo.
Consequences
Section titled “Consequences”- Publishing = pushing a tag + a PR to the registry index. A web store front can be built on top of the index later.
- Signing and verified publishers: see “Update (2026-11-23)”.
Update (2026-11-21): apt/Homebrew-style sources
Section titled “Update (2026-11-21): apt/Homebrew-style sources”Product decision: the store works like apt sources / Homebrew taps.
- A project has several plugin repositories (
cicord.yaml spec.registries). The official Cicord registry is present by default (name: cicord, trustofficial); users can add unofficial repositories (community, their own dev/test repos) from the admin UI or the CLI, at their own risk. - Each registry entry gets a trust level:
official(Cicord-maintained, verified publishers, signed index — later) orunofficial. Unofficial sources are clearly labelled everywhere (store, install dialog, plugin cards) and installing from them requires an explicit confirmation showing the requested capabilities. - Adding/removing a registry from the admin UI is a write-back change to
cicord.yaml(commit or PR per policy), like any other configuration. - Plugin references stay
<registry>/<plugin>; the same plugin name may exist in several registries (no implicit priority: the registry is part of the reference). Search in the admin UI spans all registries, grouped by source. cicord plugin add/cicord.lockunchanged;cicord registry add|remove|list|updatemirror the admin UI. The runtime refreshes registry indexes periodically and on demand.
Update (2026-11-22): implementation decisions
Section titled “Update (2026-11-22): implementation decisions”- Trust is computed, never declared. A registry is
officialonly when its normalized URL is the official registry’s; any other entry ofspec.registriesisunofficial.verifiedin an index is ignored outside the official registry. - The official source is implicit. It is not declared in
cicord.yaml; the namecicordis reserved (cicord validaterejects a registry namedcicord). Until the official registry repository exists, the official source is the plugin catalog bundled in the binary; installing from it copies the plugin toplugins/<name>/. - Review = install. The admin UI shows what a plugin requests from its
plugin.yamlat the resolved version; the install request carries that version, commit and integrity, and the runtime refuses (409 changed) when the latest version now resolves differently. - No code from unofficial sources before consent. Listing slash commands evaluates the plugin, so it is only done for official sources before installation.
- URLs. The admin UI accepts
https://registries only; an https registry may only list https plugin repositories.file://and local paths are for the CLI (development). Store fetches made for admin UI users only connect to public addresses: the check runs in the dialer, for every connection (DNS rebinding, redirects), with proxies bypassed.CICORD_ALLOW_PRIVATE_REGISTRIES=truelifts it for registries on the operator’s network. - Names. Registry and plugin names match
^[a-z0-9][a-z0-9-]{0,63}$(they become cache directories); index keys that do not are ignored. Registry URLs may not embed credentials, and URLs are redacted from errors. - Project-level rights. Adding or removing a source changes
cicord.yaml: bearer, or admin on every server of the project. Installing needs admin on the target server.
Update (2026-11-23): signed official index, verified publishers, publishing
Section titled “Update (2026-11-23): signed official index, verified publishers, publishing”- Signature envelope. The official registry’s
index.yamlcomes withindex.yaml.sig:format: cicord-registry-signature-v1,registry(normalized URL),serial,expires(RFC 3339, UTC) andindex-sha256(of the exact bytes ofindex.yaml), then oneed25519 <key-id> <base64>line per signing key. Each signature covers the canonical envelope (cicord-registry-signature-v1\nregistry: …\nserial: …\nexpires: …\nindex-sha256: …\n). Signing the bare index bytes was rejected in review: an old, validly signed index could be replayed forever (e.g. one still listing a plugin later removed for a vulnerability), and a signature would not be bound to its registry. - Official = official URL + valid, current signature.
FetchIndexrefuses (ErrBadSignature, fail closed) an index from an official URL unless a signature by an embedded official key verifies, the hash matches,registryis an official URL, the envelope has not expired, andserialis not lower than the highest serial already seen for the official registry. There is one serial for the official registry (keyofficial), shared by all its URLs (aliases, mirrors: one logical registry signed by the same keys), so an old envelope signed for one URL cannot be replayed after a higher serial was seen through another. It is stored on first use (trust on first use) in the runtime’s state store (KV scopecicord:registry-serials, survives restarts) or, for the CLI, in a file next to the plugin cache. Such a source is an error source (signature: "invalid"), never an unofficial fallback; the Store checks it again (defense in depth) whatever fetcher it uses. The embedded keys are a list (rotation: sign with old and new keys during the transition). - Cadence. Maintainers re-sign after every index change and on a schedule (weekly CI,
30-day validity,
cicord registry signcaps it at 180 days): the expiry bounds how long a runtime that never saw a newer index can be served an old one. The private key never lives in a repository (cicord registry keygen|sign|verify). - Verified publishers (
verified: true) are only honoured from a verified official index. - Implicit official registry. When the build has an official URL, the official remote
registry is part of source
cicord, without acicord.yamlentry (the name stays reserved). The Store lists the union of bundled and remote plugins; a plugin in both comes from the registry only if its indexversionis a semver greater than the bundled one (the bundled copy needs no network and is known to work with the binary). Remote installs lockcicord/<name>incicord.lock; the runtime resolves it from the lock like any registry plugin. The official URL is a package variable (set in tests);CICORD_DEV_OFFICIAL_REGISTRYoverrides it only in a development build, i.e. one with a test key embedded at build time (-ldflags -X …devOfficialKey); release builds ignore it. None of this is reachable fromcicord.yamlor the API. - Publishing.
cicord plugin publishvalidates (build + inspect), requires a clean tree and a new semver, tagsv<version>(pushed with--push) and writes the index entry to a local registry checkout (or prints it). Index entries gain optionalversion(latest release, used by the union rule) andcommit(its tag’s commit: resolving that version fails if the tag was moved). Publishing to the official registry is a pull request to its repository; its maintainers review, setverified, and sign. - Not decided here (owner): the official registry repository, its URL, and the
production signing key (
registry.OfficialURLsandregistry.OfficialKeysare empty until then, so todaycicordis the bundled plugins only). The repository and URL were decided on 2026-11-24 (below); the key is still the owner’s step.
Update (2026-11-24): the official registry is a monorepo
Section titled “Update (2026-11-24): the official registry is a monorepo”- Repository. The official registry is
https://github.com/cicord/cicord-plugins(registry.OfficialURLs), approved by the owner:plugins/<name>/for each official plugin and the signedindex.yamlat the root. One repository keeps review, CI and signing in one place for the official plugins and accepted community plugins. - Index
path. An index entry may name the plugin directory inside its repository (path: plugins/polls). Such a plugin is released with the tags<name>/v<semver>(several plugins share the repository, not their tags); entries withoutpathkeep barev<semver>tags.pathis validated as hostile input (relative, no..or hidden segments) and is pinned incicord.lockwith the commit. - Integrity of a subtree. Only the plugin directory is downloaded, and the content hash covers its files with paths relative to it: a plugin hashes the same in its own repository and in a monorepo. The signed-index format does not change.
- Publishing.
cicord plugin publishdetects a plugin below the repository root (or--path), checks only that directory for uncommitted changes, compares versions with that plugin’s tags only, tags<name>/v<version>and writespath. A registry that is also the repository of its plugins publishes with--registry .. - Without the production key. Until the owner embeds it (
registry.OfficialKeys), a build cannot verify the official index: it does not fetch it at all (registry.ErrNoOfficialKey, anErrBadSignature), and sourcecicordlists the bundled plugins with an explanation instead of an “invalid signature” state. The bundled copies stay in every build for offline and first installs.