|
| 1 | +# Schema/lint layer for the shipped agent plugin bundles. Mirrors the official |
| 2 | +# Cursor marketplace validation workflow: |
| 3 | +# https://github.com/cursor/plugins/blob/main/.github/workflows/validate-plugins.yml |
| 4 | +# (ajv + ajv-formats against the plugin/marketplace JSON schemas; the schemas |
| 5 | +# are vendored in tests/fixtures/cursor-schemas/). |
| 6 | +# |
| 7 | +# The Rust contract tests for the bundles already run in ci.yml — do not add |
| 8 | +# plain cargo test jobs here. The MCP conformance smoke below is the one |
| 9 | +# exception: it needs a built binary plus npx, which cargo test can't provide. |
| 10 | +name: Plugin Validation |
| 11 | + |
| 12 | +on: |
| 13 | + pull_request: |
| 14 | + paths: |
| 15 | + - "cursor-plugin/**" |
| 16 | + - "codex-plugin/**" |
| 17 | + - "tests/fixtures/cursor-schemas/**" |
| 18 | + # Plugin/skill test modules (e.g. plugin_manifest_schema_test.rs, |
| 19 | + # plugin_skill_contract_test.rs, the skill lint tests). |
| 20 | + - "tests/agent_suite/*plugin*" |
| 21 | + - "tests/agent_suite/*skill*" |
| 22 | + - "scripts/mcp-conformance-smoke.sh" |
| 23 | + # The Inspector smoke is the workflow's SDK-backed coverage for |
| 24 | + # `tracedecay serve` protocol and tool-schema compatibility. |
| 25 | + - "src/serve.rs" |
| 26 | + - "src/main.rs" |
| 27 | + - "src/lib.rs" |
| 28 | + - "src/mcp/**" |
| 29 | + - "Cargo.toml" |
| 30 | + - "Cargo.lock" |
| 31 | + - ".github/workflows/plugin-validation.yml" |
| 32 | + |
| 33 | +permissions: |
| 34 | + contents: read |
| 35 | + |
| 36 | +concurrency: |
| 37 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 38 | + cancel-in-progress: true |
| 39 | + |
| 40 | +jobs: |
| 41 | + manifest-schema: |
| 42 | + name: Manifest schema |
| 43 | + runs-on: ubuntu-latest |
| 44 | + timeout-minutes: 5 |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v7 |
| 47 | + |
| 48 | + - uses: actions/setup-node@v4 |
| 49 | + with: |
| 50 | + node-version: 22 |
| 51 | + |
| 52 | + # Pinned, unlike upstream's floating `npm install ajv ajv-formats`. |
| 53 | + - name: Install ajv-cli |
| 54 | + run: npm install --no-save ajv-cli@5.0.0 ajv-formats@2.1.1 |
| 55 | + |
| 56 | + - name: Compile vendored schemas |
| 57 | + run: | |
| 58 | + npx --no-install ajv compile --spec=draft7 -c ajv-formats \ |
| 59 | + -s tests/fixtures/cursor-schemas/plugin.schema.json \ |
| 60 | + -s tests/fixtures/cursor-schemas/marketplace.schema.json \ |
| 61 | + -s tests/fixtures/cursor-schemas/mcp.schema.json \ |
| 62 | + -s tests/fixtures/cursor-schemas/hooks.schema.json |
| 63 | +
|
| 64 | + - name: Validate Cursor plugin manifest |
| 65 | + run: | |
| 66 | + npx --no-install ajv validate --spec=draft7 -c ajv-formats --errors=text \ |
| 67 | + -s tests/fixtures/cursor-schemas/plugin.schema.json \ |
| 68 | + -d cursor-plugin/.cursor-plugin/plugin.json |
| 69 | +
|
| 70 | + # The Codex manifest follows Codex's own layout (e.g. its `interface` |
| 71 | + # block), so the Cursor schema does not apply; keep it to a strict JSON |
| 72 | + # well-formedness check alongside the other bundle JSON files. |
| 73 | + - name: Check bundle JSON files parse |
| 74 | + run: | |
| 75 | + set -euo pipefail |
| 76 | + find cursor-plugin codex-plugin -name '*.json' -print0 | |
| 77 | + while IFS= read -r -d '' f; do |
| 78 | + python3 -c "import json,sys; json.load(open(sys.argv[1]))" "$f" \ |
| 79 | + || { echo "invalid JSON: $f" >&2; exit 1; } |
| 80 | + echo "ok: $f" |
| 81 | + done |
| 82 | +
|
| 83 | + # Drives a real `tracedecay serve` stdio server through the MCP Inspector |
| 84 | + # CLI (pinned version), which embeds the official TypeScript MCP SDK client |
| 85 | + # — covering protocol-version negotiation and SDK-side schema validation |
| 86 | + # that the in-repo Rust MCP tests cannot. See scripts/mcp-conformance-smoke.sh. |
| 87 | + mcp-conformance-smoke: |
| 88 | + name: MCP conformance smoke |
| 89 | + runs-on: ubuntu-latest |
| 90 | + timeout-minutes: 20 |
| 91 | + steps: |
| 92 | + - uses: actions/checkout@v7 |
| 93 | + |
| 94 | + - uses: actions/setup-node@v4 |
| 95 | + with: |
| 96 | + node-version: 22 |
| 97 | + |
| 98 | + - uses: dtolnay/rust-toolchain@stable |
| 99 | + |
| 100 | + - uses: Swatinem/rust-cache@v2 |
| 101 | + |
| 102 | + - name: Build tracedecay |
| 103 | + run: cargo build --bin tracedecay --locked |
| 104 | + |
| 105 | + - name: Run MCP conformance smoke |
| 106 | + run: scripts/mcp-conformance-smoke.sh |
| 107 | + env: |
| 108 | + TRACEDECAY_BIN: target/debug/tracedecay |
0 commit comments