Skip to content

Adopt pinned schemas and ecosystem validators for generated plugin conformance (build-time + doctor) #133

Description

@ScriptedAlchemy

Why

Real-host usage exposed Cursor conformance defects (#126, #127) that build-time validation should have caught. Research across Cursor's official surface, the validator ecosystem, and TraceDecay's working implementation (the layered build/install/doctor pattern) yields a concrete adoption plan. This feeds #100 (capability evidence), #101 (read-only Doctor), and #108 (target-aware Skills).

Build-time validation to integrate (structure)

  • Vendor pinned schemas by commit and validate every EMITTED (rendered, not source) manifest/config against them with ajv + ajv-formats in adapter fixture tests, each with malformed negative-case fixtures so a permissive schema cannot pass vacuously:
  • Agent Skills frontmatter: @skill-tools/core (npm) for spec lint; note the spec pins the Python skills-ref reference validator and has no official frontmatter JSON schema — treat spec text as authoritative. (npm naming traps: skills-ref and skill-validator on npm are squatted, unrelated packages.)
  • Layout resolution like the host: stage the final deploy tree and verify every manifest-declared path resolves with no absolute paths or ..; containment after symlink resolution; flat plugin-skill scan (Cursor does not recurse); folder-name == frontmatter-name; unique deploy paths; UTF-8; deterministic ordering; no unresolved placeholders; every ${VAR} in mcp.json declared in the manifest variables schema.
  • Root tokens per contract: ${CURSOR_PLUGIN_ROOT} (Cursor Plugin hooks), ${PLUGIN_ROOT}/${PLUGIN_DATA} (portable, args/env/cwd only) — never cross-contract.

Behavior validation (CI, opt-in lane)

  • MCP: @modelcontextprotocol/conformance official suite, --spec-version 2025-11-25, against generated servers.
  • Host-native fixture replay stays the pattern for hooks (checked-in real event fixtures, typed unavailable for missing evidence — TraceDecay's model).

Install-time / doctor (feeds #101 stage 1)

  • TraceDecay's layered pattern is the reference: emitted artifact manifest with per-file digests at build; read-only doctor checks discovery path, manifest parse/schema, component pointers, inventory + digests, MCP command/args existence, exact hook wiring, host activation state, version drift (a loading plugin can still be stale), and recent host logs for spawn/placeholder failures. Typed findings (current/stale/drifted/missing/corrupt/unsupported/activation-required), never repairs.
  • Cursor specifics: local plugins load only from a real directory under ~/.cursor/plugins/local (staff-confirmed: symlinks resolving outside are rejected; docs saying otherwise are wrong) or agent --plugin-dir; loader failures can be SILENT (skipped plugins report failures=0), so doctor must not rely on host error surfaces.

Sequencing

  1. Cursor pinned-schema fixture validation rides the Cursor target artifacts don't match how Cursor actually loads local plugins (manifest location, hooks doc collision, root tokens) #126/Cursor install instruction 'clone (or symlink)' fails: Cursor rejects local-plugin symlinks resolving outside ~/.cursor/plugins/local #127 fix (in flight).
  2. Claude/Codex schema vendoring + Agent Skills lint: with Compile target-aware Skills with host frontmatter and interpolation #108's Skill IR work.
  3. MCP conformance CI lane: with Build a real RSC Agent Document renderer with streaming semantics #96/Compile filesystem routes into the Agent Bundle meta-framework #93 generated-server landings.
  4. Doctor integration: Add safe managed lifecycle for generated host bundles #101 stage 1.

Research provenance: three-agent web/local research pass, 2026-08-31; TraceDecay checkout at /fast/projects/tracedecay (descriptor contracts, schema self-tests, transactional install verification, read-only doctor) and its known-loading Cursor plugin as ground truth.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthost-integrationAgent host capabilities, projection, discovery, and lifecycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions