Skip to content

claude-plugins CI: each plugin's files match its public source at the tag its version names, so the marketplace copy cannot drift again - #15

Merged
houman44 merged 5 commits into
mainfrom
stream/yellow/20261111-154204-goal_claude_plugins_mirror_matches_tagge
Nov 12, 2026
Merged

houman44 merged 5 commits into
mainfrom
stream/yellow/20261111-154204-goal_claude_plugins_mirror_matches_tagge

Conversation

@houman44

Copy link
Copy Markdown
Contributor

Goal: goal_claude_plugins_mirror_matches_tagged_source_2026-11-11. Propose-only: please review, do not merge as is (see Finding).

Finding: the cejel copy has already drifted, so this check fails on main today

Run against the real tags, the check passes dunstan and fails cejel:

$ pnpm run check
$ node scripts/check-plugin-sources.mjs
ok dunstan 0.1.21 matches BargLabs/dunstan@v0.1.21:plugins/dunstan (4 files compared)
FAIL cejel 0.6.11: 1 mismatch(es) against BargLabs/cejel@v0.6.11:plugins/cejel
  mismatch: README.md: section "## Known issues" of BargLabs/cejel@v0.6.11 differs in the copy
[ELIFECYCLE] Command failed with exit code 1.

The card says every section of cejel's source README is in the copy unchanged. One isn't. In the second bullet of ## Known issues, the source at v0.6.11 says:

may run whichever cejel is on your PATH instead of the pinned version. From 0.6.4, Cejel prints a warning when npx ran a different cejel than it resolved, where it can tell which version was asked for. The warning comes from the cejel that ran, so one older than 0.6.4 on your PATH prints nothing. Run it from another directory.

The copy has only "…instead of the pinned version. Run it from another directory." (the text from before 0.6.4). The card says not to edit plugins/, so this PR does not touch the copy. If this PR merges as is, the new workflow will be red on main until plugins/cejel/README.md is synced from BargLabs/cejel@v0.6.11 in a separate PR. That PR should land first, or together with this one.

Items

  • Done: A. scripts/plugin-sources.json lists the source of each plugin in marketplace.json: BargLabs/dunstan and BargLabs/cejel, at plugins/<name>. If a plugin has no entry, or an entry has no plugin, the check fails.

  • Done: B. scripts/check-plugin-sources.mjs uses Node built-ins only. It reads the version from each copy's plugin.json, then reads the source tree at v<version> through GitHub's REST API (git refs, trees and blobs), sending GITHUB_TOKEN when it is set. Every file except README.md is compared byte for byte. The README rule:

    • The introduction must be identical.
    • Every ## section of the source must be present, byte-identical and in the same order.
    • The copy may add sections headed ## Install or starting with ## Changes.
    • A ## line inside a fenced code block is not a heading.
    • Blank lines at the end of a section are treated as the separator and not compared, so an added section between two source sections doesn't count as an edit.

    A file only in the copy fails, except .claude-plugin/icon.png. A file only in the source fails. A missing tag fails. A source it cannot read (an API error, a truncated tree, a submodule, a path with no files) fails and is never a pass. The check prints one line per plugin and one per mismatch, naming the file and the tag, and exits 1 on any failure.

  • Done: C. scripts/check-plugin-sources.test.mjs has 14 node:test cases. They run against fixture directories built in a temp dir, through a local source reader, with no network. They cover every case on the card, plus three more: an added section with another name fails, an edited introduction fails, and an entry with no plugin fails. Each failure test checks the exact line the check prints, not just the exit status. The tests were committed red first (d317d8b, failing with ERR_MODULE_NOT_FOUND because the script did not exist yet).

  • Done: D. package.json gains only the test and check scripts, and pnpm-lock.yaml is unchanged. .github/workflows/plugin-sources.yml runs npm test and then npm run check on pull_request and on push to main. It uses Node 22 and permissions: contents: read. actions/checkout (v7.0.1) and actions/setup-node (v7.1.0) are pinned by full SHA, and checkout sets persist-credentials: false. The workflow has no secrets. It passes the job's own github.token as GITHUB_TOKEN for rate limits only.

  • Done: E. README.md gets an "Updating a plugin" section.

Verification

  • pnpm test: 14 of 14 pass locally (Node 26.7.0).
  • pnpm run check against the real tags: output above. It exits 1 because of the cejel finding.
  • Not run: the workflow itself, and npm test under Node 22. The sandbox did not allow running npm, and CI has not run on this branch yet.
  • No file under plugins/ changes.
{
  "dunstan": "0.1",
  "headCommit": "2d72008e0b3689f11b397a4538453aa2d8cbe4fc",
  "filesChanged": [
    ".github/workflows/plugin-sources.yml",
    "README.md",
    "package.json",
    "scripts/check-plugin-sources.mjs",
    "scripts/check-plugin-sources.test.mjs",
    "scripts/plugin-sources.json"
  ]
}

No tests claim: this repository has no turbo pipeline, and its CI publishes no JUnit record that a claim could be checked against. No checks claim, per alfred#2645.

🤖 Generated with Claude Code

houman44 and others added 5 commits November 11, 2026 15:43
…ory and path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eck, red until the check exists

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ource at the tag its version names

Every file byte for byte, the README by section (the copy may add
"Install" and "Changes..." sections), extra files fail except
.claude-plugin/icon.png, and an unreadable source or a missing tag fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests and pushes to main

package.json gains two scripts, test and check, and no dependency.
The workflow reads contents only, uses no secret, pins its actions by
full commit SHA, and passes the job's own token for API rate limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith its tagged source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@houman44
houman44 merged commit a810100 into main Nov 12, 2026
1 check failed
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