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