Skip to content

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

Closed

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

  1. added
    enhancement
    host-integration
    on Sep 1, 2026
  2. ScriptedAlchemy commented on Sep 1, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Implemented the Claude real-host validation slice in #193: bounded claude plugin validate <dir> --strict, typed AB warning/error/unavailable diagnostics, CLI strict policy, capability evidence, and a real packed --plugin-dir registration proof on Claude Code 2.1.251.

    claude plugin details inventory/token projection remains intentionally deferred to #187 because token costing is host-owned and should not be partially reimplemented.

  3. ScriptedAlchemy commented on Sep 1, 2026

    @ScriptedAlchemy
    OwnerAuthor

    #218 adds the missing runtime half of conformance: emitted manifest schemas alone would not catch MCP result-schema drift, older/newer server-client skew, stale installed/running versions, or live progress hidden until terminal settlement. Please treat its serialized round-trip and installed-host lifecycle cases as acceptance criteria for this issue's build/doctor layers.

  4. ScriptedAlchemy commented on Sep 2, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Scope boundary with #218, now that its stage 1 is starting: this issue keeps every check that can pass on bytes at rest — pinned ecosystem schemas over rendered manifests/configs with malformed negative fixtures, skills frontmatter lint, layout resolution/containment and root-token rules, the @modelcontextprotocol/conformance CI lane, and doctor's static findings (#236/#243, #193 already landed against this issue).

    #218 takes every check that requires a live exchange or a spawned process: serialized results round-tripped through the exact runtime resultSchema validators, the additive-field/version-skew matrix, stateful lifecycle replay (live progress before terminal, restart durability), and the source/artifact/installed/running version quadruple.

    Doctor remains the shared reporting surface: this issue feeds it static findings; #218 adds the runtime/running-process lane. Per the earlier comment here, #218's serialized round-trip and installed-host lifecycle cases stay acceptance criteria for this issue's build/doctor layers — neither issue's suite may claim the other's evidence.

  5. ScriptedAlchemy commented on Sep 2, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Evaluated Effect v4 Schema (with Schema.toType / Schema.toEncoded projections, per the v4 projections docs) as a candidate for the wire-contract seams — declined for the rc.112 cycle; recorded in docs/effect-conventions.md via #286 (merged as d6b5386), mirroring the @effect/platform-node precedent (#271).

    Short version, relevant to this issue's pinned-schemas scope:

    • Projections have nothing to bridge today. Every contract in packages/agent-bundle/src/contracts/* is JSON-plain (string timestamps, no transformations), so the encoded and type sides are structurally identical and toType/toEncoded are near-identity. The actual dual maintenance (contract types + hand-written Workbench decoders) is a single-source-of-truth problem the pinned zod already solves with z.infer.
    • Strictness travels wrong. Effect Schema's exact-key rejection is a per-decode parse option (onExcessProperty: "error", default "ignore"), not schema-carried like z.strictObject — the wrong shape after the feat(identity): derive package name/version into project identity (stages 1-2) #121 exact-key regression.
    • zod can't leave (MCP SDK interop + public authoring surface), so Schema would be a second schema runtime in the Workbench bundle: measured +46.5 kB min / +14.6 kB gzip over the atoms baseline (rsbuild all-in-one, rc.112).

    Seam inventory from the eval, for whoever picks up schema single-sourcing here: zod strict decoders in 9 Workbench client modules plus server-side events/ipc.ts (#209) and events/projection.ts (#279 envelope); hand-rolled exact-key guards in runtime-client, artifact-client, comparison-client, and the three mcp/* clients; hand-rolled diagnostics in config/validate.ts; node:util parseArgs for CLI args. Revisit Schema at Effect GA or on the first contract that genuinely diverges between encoded and decoded sides.

  6. added 2 commits that reference this issue on Sep 2, 2026
  7. ScriptedAlchemy commented on Sep 2, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Stage 1 landed — Codex + Cursor ecosystem validators (#326 merged as 6370e7d, #327 merged as f5721e6), completing the per-ecosystem host-validator roster this issue started with the Claude slice (#193).

    Honesty posture, with dated real-binary evidence (2026-09-02):

    • Codex (validateCodexPlugin, AB6030–AB6033): codex-cli 0.147.0 publishes install/marketplace verbs but no plugin-validate command — recorded in capability evidence; the validator says so on every report and validates .codex-plugin/plugin.json, hooks/hooks.json, .mcp.json, and the marketplace manifest against the vendored pinned schemas with malformed negative fixtures. codex app-server generate-json-schema was exercised for the pinned drift lane: observed 0.147.0 emits 285 app-server protocol schemas and none of the pinned hook command schemas, so that case reports as evidence-backed unassessable info (strict-independent), never a fake drift warning; genuine hash drift on comparable files stays warning / strict-error. Live and pinned hashes are recorded in capabilities/codex-0.147.0.json.
    • Cursor (validateCursorPlugin, AB6026–AB6029): cursor-agent 2026.08.31-4057e58 exposes no plugin-validate verb (--help + plugin --help captured); every report carries the transparency info naming the vendored pin (cursor/plugins@0701892). Local bytes-at-rest checks: strict pinned-schema validation (plugin/mcp/hooks/marketplace, each with unknown-key negative fixtures), manifest-candidate precedence, symlink realpath containment (mirroring the pinned loader's realpath rejection), and ${CURSOR_PLUGIN_ROOT} restricted to the loader-substituted fields pinned in mcp.pathTokens + hook commands (incl. streamable-http url/headers). CLI absence never gates the local checks.

    Both are wired into validate({ hostValidation }) alongside the Claude validator (union report type), exported from the public and test APIs, registered in docs/diagnostics.md, and shipped with minor changesets. Gates ran locally on the final rebases: build/typecheck green, lint 0 errors 0 warnings, unit pools 2583 and 2607 passed with 0 failures.

    Remaining scope, staged next: Agent Skills spec lint + the @modelcontextprotocol/conformance CI lane, then doctor static-findings integration.

  8. added 2 commits that reference this issue on Sep 2, 2026
  9. ScriptedAlchemy commented on Sep 2, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Stage 2 landed — skills spec lint + the official MCP conformance CI lane (#334 merged as fb25f47, #338 merged as 3c3daba).

    • Skills lint (feat(validation): enforce the pinned Agent Skills instruction-body rule with ecosystem-lint provenance (#133) #334): @skill-tools/[email protected] was evaluated for real on 2026-09-02 — it is genuine (github.com/skill-tools/skill-tools, not one of the npm squats this issue warns about) but lower fidelity than the pinned contract: no pinned spec revision, an internally inconsistent description-length warning, open frontmatter where the pinned schema is closed, and name/directory mismatch downgraded to a warning. Verdict not-integrated-lower-fidelity, recorded in full (npm metadata, tarball sha1/integrity, 17 observed rule ids, six limitations) in schemas/agent-skills/PROVENANCE.json and pinned by test. The one mandatory spec rule the evaluation surfaced as missing — a nonempty Markdown instruction body after frontmatter — is now enforced natively at artifact validation as AB6034 with a negative fixture.
    • MCP conformance lane (test(mcp): opt-in official conformance lane against a generated route server (#133) #338): the official @modelcontextprotocol/[email protected] active suite at --spec-version 2025-11-25 runs against a server built by the real pipeline — the generated stdio artifact stays untouched behind a loopback streamable-HTTP bridge that owns only transport and lifecycle. Recorded run (2026-09-02, repeated on the landing rebase): 30 scenarios, 7 passed, 23 expected failures (each a dated baseline entry: 3 genuinely unsupported optional operation families — completion/complete, logging/setLevel, resource subscribe/unsubscribe — plus canonical test_* fixtures the reused harness doesn't provide), 0 skipped, 0 unexpected; the runner rejects stale baseline entries. Strictly opt-in: manually dispatched workflow + env-gated script, excluded from all default pools, per the Generate an Agent Bundle framework test harness on top of Rstest #103 cost rule and the native-host-smoke posture.

    Both landed with local gates on their final rebases: lint 0/0, unit pools 2615 passed / 0 failed, and one real conformance-lane pass. Remaining scope: doctor static-findings integration (in flight).

  10. added a commit that references this issue on Sep 2, 2026
  11. ScriptedAlchemy commented on Sep 2, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Closing: the bytes-at-rest scope this issue retained under the #218 scope split is delivered. Evidence roster (all gates run locally on each landing rebase — build, typecheck, rslint 0/0, full unit pools 0 failures):

    Landed this wave (wave/133- lanes):*

    Previously landed against this issue's scope: #193 (Claude devtools validation), the pinned-schema fixture validation and layout/containment/root-token rules in validate-artifact* (AB6011/AB6012/AB6014 et al.), per-host vendored schemas with PROVENANCE hashes, #306 (portable pinned to Agent Plugins 1.0.0), and the #236/#243 read-only doctor this wave extends.

    Acceptance criteria from the scope split (posted here earlier): #218's serialized round-trip and installed-host lifecycle cases are landed and green on main — contract matrix stage 1 (#272), stateful lifecycle replay (#309), and the installed-host contract matrix (#311). Neither issue's suite claims the other's evidence: this issue's validators are bytes-at-rest only; every live-exchange check lives in the #218 lanes.

    Stage comments above carry the per-stage detail. Follow-up opportunity recorded on #338: add canonical-shaped conformance routes to shrink the fixture-gap portion of the expected-failures baseline.

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

    enhancementhost-integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions