Skip to content

feat(registry): community plugin registry, versioned releases and submission CI - #3

Merged
MemerGamer merged 5 commits into
mainfrom
community-registry
Nov 17, 2026
Merged

MemerGamer merged 5 commits into
mainfrom
community-registry

Conversation

@MemerGamer

Copy link
Copy Markdown
Member

Part of AniMathIO/AniMathIO#304 (registry half; the editor half implements against docs/registry.md).

What

  • community-plugins.json + schemas/community-plugins.schema.json: id, name, author, description, repo, optional path, license (SPDX, OSI/OFL), min_abi. Lists Code Snippets.
  • Versioned downloads: release-plugin.yml — tag <plugin-id>@<version> (or workflow_dispatch with path=community/<name>) builds the plugin with its build.sh, smoke-tests it with the released CLI and creates a GitHub release with <id>-<version>.amplugin + <id>-<version>.amplugin.sha256. Tag must be on main, plugin must be in the registry, plugin.toml id/version must match, an existing release is never replaced.
  • One static file for the editor: community-index.json (+ schemas/community-index.schema.json), generated by scripts/registry.py index in index.yml (after every release, on registry changes, every 6 h for plugins released from other repos). It re-downloads the latest release asset, recomputes the SHA-256, checks the .sha256 asset and the manifest. Fetch URL: https://raw.githubusercontent.com/AniMathIO/plugins/main/community-index.json. Format and client rules: docs/registry.md. An empty index is committed so the URL works before the first release.
  • Submission CI registry.yml: schema, unique/unreserved/not-delisted ids, repo public and not archived, OSI/OFL license (and GitHub-detected license among the declared ids for external repos), README table in sync (generated between markers), strict release resolution, build for wasm32-wasip2 + load/render with the released 2.1.0 CLI (scripts/registry_smoke.py, pinned AppImage SHA via a local composite action). Actions pinned by digest.
  • RELEASING.md (exact first-release tag command), README Community plugins/Installing, CONTRIBUTING (rules, release recipe for external repos, review, delisting).

Decision to review: Code Snippets id renamed

org.animathio.community.code-snippets -> io.github.animathio.code-snippets. The host rejects every org.animathio.* id from the user plugin folder (check_plugin_id, allow_reserved_ids = false), so the old id could never be installed from the registry; it only worked through ANIMATHIO_PLUGIN_DIR. Plugin 0.1.0 was never released. Projects that used the old id via ANIMATHIO_PLUGIN_DIR would need the id swapped.

Validated locally

  • python3 -m unittest discover -s scripts (19 offline tests: schema/id/license rules, tag matching, latest-version selection, checksum/manifest/ABI mismatch, transient-vs-gone handling).
  • scripts/dry-run-release.sh community/code-snippets <2.1.0 cli>: build, assets, smoke render, index from local assets, schema validation, sha256sum -c.
  • registry.py validate online (GitHub API), index --strict against real GitHub (no release yet -> allowed for hosted), existing community/code-snippets/smoke.py after the rename.
  • Workflow YAML parses; not run on GitHub yet (no act): the first run is this PR's registry/Plugins checks.

Deferred / caveats

  • External-repo path of check_submission.py (download asset, clone at tag, build, compare) is untested against a live third-party repo.
  • Only the latest version per plugin is indexed; assets are not signed (provenance attestation could be added).
  • effect/audio-effect/animation-preset/importer plugins are checked for loading only; CLI has no way to enumerate their parameters.
  • Scheduled workflows are paused by GitHub after 60 days of repo inactivity.

🤖 Generated with Claude Code

MemerGamer and others added 3 commits November 17, 2026 00:27
…mission CI

- community-plugins.json + JSON Schema, listing Code Snippets
- release-plugin.yml: tag <plugin-id>@<version> builds, smoke-tests and publishes
  <id>-<version>.amplugin + .sha256 as a GitHub release
- generated community-index.json (latest version, download URL, SHA-256, ABI) built
  from the registry and releases by index.yml; format in docs/registry.md
- registry.yml submission CI: schema, unique/unreserved ids, public repo, OSI/OFL
  license, README table in sync, release resolution, build and released-CLI render
- rename Code Snippets to io.github.animathio.code-snippets (org.animathio.* is reserved
  and the host refuses it in the user plugin folder)

Part of AniMathIO/AniMathIO#304

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n and tokens

- external entries need repo_id; validate and the index builder refuse a renamed,
  transferred or re-created repository until re-reviewed
- build third-party sources only for pull requests that add or change the entry and
  run that step without GH_TOKEN; pushes and manual runs only render released assets
- document the trust model in docs/registry.md

Part of AniMathIO/AniMathIO#304

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MemerGamer

Copy link
Copy Markdown
Member Author

Verdict: NEEDS-WORK at 06327eed1598c40af2b0d481ddc7e67df9b6ffe1.

Remaining blocker:

  • Publishing credentials are available to plugin builds — .github/workflows/release-plugin.yml:29 puts GH_TOKEN in the entire release job; that job has contents: write, and checkout at line 31 also retains credentials. At line 64, scripts/registry.py package executes the hosted plugin's arbitrary build.sh (and its native Cargo build dependencies) with those credentials. A malicious/compromised build can directly use the token to alter other releases/assets or repository content. The main-ancestor check does not isolate the plugin build from publishing credentials; listing/review is explicitly not a security audit.
    Required fix: separate build/package/smoke into a read-only job with persist-credentials: false, and publish the resulting artifacts in a separate job/runner that gets write permission and does not execute plugin build scripts. Merely moving GH_TOKEN to a later step in the same runner leaves persisted credentials and cross-step tampering paths. This needs workflow restructuring, so I have left it as a blocking finding rather than applying a partial credential fix.

Small fixes pushed:

  • scripts/registry.py:327: registry validation accepted Windows device-name IDs (e.g. con.example.plugin) that the community installer refuses on every platform. Reject the same prefixes; regression covers device stems and an allowed boundary (com0).
  • docs/registry.md:56 and schemas/community-plugins.schema.json:48: corrected the claim that repository transfers change numeric IDs. Identity pinning detects a different repository at the configured name; it does not detect ownership changes. Updated the misleading test comment too.

Validation: python3 -m unittest discover -s scripts 22 passed. Reviewed checksum recomputation and mismatch rejection, manifest/id/version/ABI consistency, highest-version selection, failure fallback, schemas and editor client rules. Submission uses pull_request (not pull_request_target), read-only permissions and no persisted checkout credentials; tag/input values are passed via environment variables and quoted arguments rather than directly inserted into shell code. No additional shell-injection finding. No live release was created.

No merge performed.

@MemerGamer

Copy link
Copy Markdown
Member Author

Fixed: build/publish split

Addressed the NEEDS-WORK finding in 5e1b1c6:

  • release-plugin.yml: build/package/smoke/checksum generation now run with explicit contents: read and persist-credentials: false. The package and checksum pass through digest-pinned upload/download-artifact actions to a fresh publish runner with contents: write. Publishing does not check out the repository or execute plugin/build scripts; inline trusted workflow code validates metadata, exact filenames and SHA-256 before creating the release. Existing releases remain immutable.
  • index.yml: index generation runs read-only without persisted checkout credentials; a separate write-enabled runner only downloads/copies the JSON and commits it. It executes no repository scripts or plugin code.
  • Submission CI remains pull_request (not pull_request_target), with read-only permissions and no persisted checkout credentials. All added actions are pinned by digest.
  • Updated RELEASING.md to describe the isolation.

Validation: python3 -m unittest discover -s scripts (22 passed), YAML parsing, all workflow shell blocks checked with bash -n, and the actual inline publisher verification accepted a valid checksum and rejected a mismatch. actionlint is not installed. No Rust code changed; no live release created. No merge performed. Please re-check the credential isolation.

@MemerGamer

Copy link
Copy Markdown
Member Author

Re-check (Claude, orchestrator) of 5e1b1c6: MERGE. Build/package jobs run with contents: read and persist-credentials: false; the write-scoped publish job only downloads the artifact, re-verifies the SHA-256 inline and creates the release (no checkout, no plugin code); the index commit job checks out trusted main and commits only community-index.json. Submission CI uses pull_request with read-only permissions.

@MemerGamer
MemerGamer merged commit 5fb9046 into main Nov 17, 2026
2 checks passed
@MemerGamer
MemerGamer deleted the community-registry branch November 17, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant