From fb44159261274cd4017069a41bf5edaa714e754b Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 16 Jun 2026 01:31:00 +0900 Subject: [PATCH] ticket: record plugin tool schema fix --- .yoi/tickets/00001KV5W3PHA/item.md | 2 +- .yoi/tickets/00001KV5W3PHA/thread.md | 64 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/.yoi/tickets/00001KV5W3PHA/item.md b/.yoi/tickets/00001KV5W3PHA/item.md index 7fb78c30..d9837ce2 100644 --- a/.yoi/tickets/00001KV5W3PHA/item.md +++ b/.yoi/tickets/00001KV5W3PHA/item.md @@ -2,7 +2,7 @@ title: 'Plugin: register enabled Tool surface from packages' state: 'inprogress' created_at: '2026-06-15T14:48:59Z' -updated_at: '2026-06-15T16:26:34Z' +updated_at: '2026-06-15T16:30:49Z' assignee: null readiness: 'implementation_ready' risk_flags: ['plugin', 'tool-registry', 'model-visible-schema', 'capability-boundary', 'profile-config'] diff --git a/.yoi/tickets/00001KV5W3PHA/thread.md b/.yoi/tickets/00001KV5W3PHA/thread.md index c8bb05dc..32c2f94b 100644 --- a/.yoi/tickets/00001KV5W3PHA/thread.md +++ b/.yoi/tickets/00001KV5W3PHA/thread.md @@ -229,3 +229,67 @@ Conclusion: - Changes requested. Do not integrate until nested schema validation is fail-closed and covered. --- + + + +## Implementation report + +Follow-up implementation report after reviewer request_changes: + +New commit: +- `3413bae7 fix: reject nested plugin tool schema errors` + +Changed file: +- `crates/pod/src/feature/plugin.rs` + +Schema validation behavior updated: +- Replaced shallow root-only validation with recursive validation of an explicit supported subset. +- Every schema node must be a JSON object with supported string `type`. +- Supported `type` values: + - `object` + - `array` + - `string` + - `number` + - `integer` + - `boolean` + - `null` +- Supported keywords: + - `type` + - `title` + - `description` + - `properties` + - `required` + - `additionalProperties` + - `items` + - `enum` + +Recursive/fail-closed behavior: +- `properties.*` values are recursively validated as schema objects. +- `items` is only allowed on array schemas and recursively validates a schema object. +- `additionalProperties` is only allowed on object schemas and must be boolean or recursively valid schema object. +- Non-object nested schema nodes reject registration. +- Unknown/problematic keywords reject registration. +- Unsupported `type` values reject registration. +- `required` must be an array of unique strings. +- `required` entries must be declared in `properties` when `properties` exists. +- `enum` must be non-empty array with unique entries. + +Regression tests added: +- Direct validation rejects: + - `properties.query = "not-a-schema"` + - invalid recursive `items` + - invalid recursive `additionalProperties` + - duplicate `required` entries +- Registration test confirms nested invalid schema does not register a Plugin Tool and emits an `invalid input_schema` diagnostic with nested path. + +Validation reported by coder: +- Passed: `cargo test -p pod plugin::tests --no-default-features` +- Passed: `cargo test -p manifest plugin --no-default-features` +- Passed: `cargo check -p pod -p manifest -p llm-worker` +- Passed: `cargo fmt --check` +- Passed: `git diff --check` + +Repository status: +- Child implementation worktree clean after follow-up commit. + +---