Skip to content

Commit 38693ca

Browse files
committed
fix: stash
1 parent 4127a9b commit 38693ca

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

cspell.config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
"onsessioninitialized",
1313
"onsessionclosed",
1414
"patternfly",
15+
"prefault",
1516
"rereview",
1617
"rsort",
1718
"sparkline",
1819
"streamable",
20+
"treeify",
1921
"unrepresentable",
2022
"unsub"
2123
]

guidelines/skills/review-zod-integration/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Copy this checklist and track progress:
3434
- GitHub: `https://github.com/colinhacks/zod/releases/tag/v{VERSION}`
3535
- For patch bumps within the same minor (e.g. 4.4.1 → 4.4.3), use the **minor** release notes (e.g. v4.4.0) plus any patch-specific notes if present.
3636
4. List **potentially breaking**, **other fixes**, **performance**, and **locales** sections from the release.
37+
5. **Implementation Audit (Conditional)**: If the release notes are ambiguous or if the upgrade involves a minor/major version bump, perform a targeted search of `node_modules/zod/src/` to verify:
38+
- Persistence of internal brands (`_def`, `_zod`).
39+
- Stability of "loose" or "passthrough" logic.
40+
- Compatibility of the `v3` interop layer within the `v4` package.
3741

3842
### Step 2: Repo guidelines
3943

@@ -130,6 +134,7 @@ Reply with:
130134

131135
## Quick PF MCP facts
132136

137+
- **Zod is Required for SDK Routing**: Any tool registered with the MCP SDK MUST have a Zod instance for its `inputSchema` (even a minimal one like `z.any()`) to ensure the SDK passes user arguments correctly to the handler. Without it, handlers receive only a context object.
133138
- Internal tools **require** Zod or raw Zod shapes; JSON Schema is converted via `src/server.schema.ts`.
134139
- Core APIs: `fromJSONSchema`, `toJSONSchema`, `z.looseObject`, raw shapes with `.optional()` — not `z.undefined()`, `z.tuple()`, `.merge()`.
135140
- MCP SDK peer: `zod ^3.25 || ^4.0`.

guidelines/skills/review-zod-integration/reference.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ If release notes only mention these, impact is usually **None**:
5555
| `zod` | Direct production dep; use native `fromJSONSchema` / `toJSONSchema` (not `zod-to-json-schema` in app code) |
5656
| `@modelcontextprotocol/sdk` | Depends on / peers `zod ^3.25 \|\| ^4.0` |
5757

58+
## Audit Depth Policy
59+
60+
| Source | Frequency | Objective |
61+
| :--- | :--- | :--- |
62+
| **Release Notes** | Always | Identify public API changes and security fixes. |
63+
| **Package Metadata** | Always | Verify peer dependencies and entry points. |
64+
| **Source Code Audit** | Minor/Major Bumps | Validate internal state and undocumented behavioral shifts. |
65+
5866
## Report template
5967

6068
Save as: **`YYYYMMDD-zod{version}-update-report.md`** (repo root).
@@ -205,6 +213,7 @@ Use these as patterns when mapping **your** target release notes. Re-grep the co
205213
| Release note | Used in PF MCP? | Impact | Priority | Recommended fix |
206214
|--------------|-----------------|--------|----------|-----------------|
207215
| `fromJSONSchema()` metadata / cyclic input handling | Yes — `jsonSchemaToZod` | Low positive — plugin conversion may differ | None | Monitor plugin edge cases; no code change if tests pass |
216+
| **Metadata retention (round-trip preservation)** | Yes — `fromJSONSchema` / `toJSONSchema` | Low — snapshots may include extra keys | None | Update snapshots if custom keys are now preserved; no code change |
208217
| `z.record()` key transforms | No | None | None | None |
209218
| Skip `__proto__` in object catchall | Indirect — object parsing in tools/options | Low positive | None | None |
210219
| Empty union construction | Indirect — via JSON Schema conversion | Low positive — safer conversion | None | None |
@@ -244,6 +253,11 @@ No release-note item maps to APIs used in PF MCP hot paths; unit, e2e, and audit
244253
| Plugin authoring | Note in `docs/development.md`: prefer JSON Schema or Zod 4.x aligned with server |
245254
```
246255

256+
## Architecture
257+
258+
### SDK Routing Trigger
259+
The MCP SDK requires `inputSchema` to be a Zod instance to route `(args, context)` to tool handlers. We rehydrate minimal Zod in the parent process (via `normalizeInputSchema`) specifically to trigger this signature, while keeping genuine validation in the isolated child process.
260+
247261
## Compatibility Policy (Zod Detection)
248262

249263
To support a diverse plugin ecosystem, PatternFly MCP maintains a "Compatibility-First" approach for Zod schema detection.

0 commit comments

Comments
 (0)