Skip to content

Commit a815454

Browse files
Merge remote-tracking branch 'origin/master' into codex/hook-routing-session-cwd
2 parents ecbcd90 + 0bee3a8 commit a815454

249 files changed

Lines changed: 21759 additions & 6006 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Force LF line endings for test fixtures — tree-sitter grammars
22
# expect Unix line endings and produce wrong parse trees with CRLF.
33
tests/fixtures/** text eol=lf
4+
# Force LF for bundled plugin skill docs; the skill hygiene tests assert the
5+
# canonical source files are LF-only, and Windows checkout otherwise rewrites
6+
# them before the lint runs.
7+
codex-plugin/skills/** text eol=lf
8+
cursor-plugin/skills/** text eol=lf
49
# Force LF for embedded Hermes plugin template assets — they are pulled into
510
# the binary via include_str! and the generated-plugin snapshot test asserts
611
# their exact bytes.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Claude Code installs now register `SessionStart` and `PostToolUse` lifecycle hooks, matching the freshness/steering coverage Cursor, Codex, and Kiro already had: `SessionStart` reports index freshness and injects the LCM context-recovery hint after compaction; `PostToolUse` notifies the daemon for targeted incremental sync after edits and shell commands. Existing installs pick the hooks up via the post-upgrade backfill or `tracedecay doctor`.
13+
- The CLI-fallback steering ("if MCP fails, use `tracedecay tool ...`") now reaches every host with a prompt-rules surface — Claude Code, Copilot/VS Code, Gemini, OpenCode, Kimi, Vibe, and Kiro — instead of only the Cursor rule and Codex session hook.
14+
1015
### Fixed
1116

1217
- **`serve` no longer exits when project resolution fails at startup** — MCP hosts (Cursor especially) never retry a failed server spawn, so one startup exit over a recoverable config problem (uninitialized project, ambiguous global fallback, bad `--path`) turned every later tool call in the session into "Timed out waiting for connection". `serve` now stays alive in a degraded mode: it completes the MCP handshake, lists the real tools, and answers each tool call with an actionable error naming the failure, the fix, and the `tracedecay tool …` CLI fallback. It rechecks the project on every tool call and recovers in-session once `tracedecay init` (or a corrected path) makes resolution succeed — no server toggle or window reload needed.

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ section so the contributor command and blocking/advisory split still match CI.
109109
4. Add a fixture file `tests/fixtures/sample.{ext}` and a test module `tests/extraction_suite/{lang}.rs`, then register it with a `mod {lang};` declaration in `tests/extraction_suite/main.rs`.
110110
5. Update the feature flag tables in `Cargo.toml` and this document.
111111

112+
## Validating Plugins and Skills
113+
114+
Changes under `cursor-plugin/`, `codex-plugin/`, or `src/agents/` are covered
115+
by a layered validation system: vendored JSON-schema checks, per-host skill
116+
frontmatter contracts, cross-bundle sync/parity tests, and a CI
117+
schema-validation workflow. `cursor-plugin/` is the source of truth — never
118+
hand-edit mirrored Codex skills. Before submitting, run:
119+
120+
```bash
121+
cargo nextest run -E 'binary(=agent_suite)'
122+
```
123+
124+
See [`docs/PLUGIN-VALIDATION.md`](docs/PLUGIN-VALIDATION.md) for the full
125+
layer breakdown, schema refresh procedure, and how to add a skill or a new
126+
ecosystem bundle correctly.
127+
112128
## Running Specific Tests
113129

114130
```bash

0 commit comments

Comments
 (0)