Repository navigation
create_schema enum fields silently discarded: prose teaches core_values, serde expects coreValues - #1819
Conversation
…dant ENUM FIELDS prose (closes #1809) agent_guidance.rs taught the model "core_values" while SchemaField expects camelCase "coreValues"; without deny_unknown_fields the mismatched key was silently dropped, surfacing only as a downstream "enum has no values" error two layers from the cause. deny_unknown_fields on SchemaField and CreateSchemaParams turns the drop into an immediate error naming the unknown key. The ENUM FIELDS prose line is deleted rather than corrected — the tool schema already carries this rule correctly (ADR-064: argument shape belongs to the tool schema, not resident prose). Co-Authored-By: Claude <[email protected]>
Code Review SummaryReview Type: Initial Review This PR fixes a well-diagnosed bug: Requirements Check
All five acceptance criteria are met with direct evidence. FindingsCritical IssuesNone. Suggested Improvements
Nitpicks
Verification Performed
Recommendation: APPROVEThis is a clean, well-tested, net-positive fix that satisfies all acceptance criteria with verifiable evidence, introduces no regressions across three crates' full test suites, and correctly applies ADR-064. The one Suggested Improvement (tightening the |
…l schema Deleting the ENUM FIELDS prose line (per ADR-064) also removed the only place documenting that coreValues is conditionally required and non-empty when type="enum" — a constraint flat JSON Schema required arrays can't express on their own. State it directly in the coreValues description for both create_schema and update_schema, keeping the rule in the tool schema rather than reintroducing prose duplication. Addresses non-blocking suggestion from PR #1819 review. Co-Authored-By: Claude <[email protected]>
Address-Review SummaryAddressed the one non-blocking suggestion from the review: ✅ Addressed: Commit: ecb70b5 No recommendations were skipped — the review found no critical or important issues, only this one suggestion, which is now addressed. Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The change is a two-line JSON Schema description-string edit with no logic change. It was verified with PR is ready for merge pending final approval. |
…card (#1823) * Deny unknown fields on every agent-facing tool param struct (closes #1816) Generalizes the coreValues fix (#1819): a small local model that misspells a tool-call argument key had that key silently dropped, surfacing only as an unrelated downstream error two layers from the cause. deny_unknown_fields turns that into an immediate, self-describing rejection naming the bad key (serde's default message also lists the accepted field names). Applied to every struct deserialized directly from raw tool-call JSON: SearchNodesParams/SearchSemanticParams, AgentFilterItem/AgentSortItem, UpdateSchemaParams (create_schema's sibling) and AdditionalConstraints, CreateNodesFromMarkdownParams, and the remaining local_agent::tools structs (CreateRelationshipParams, GetRelatedNodesParams, ResolveQueryParams, SearchSkillsParams, UpdateTaskStatusParams, DeleteNodeParams, AgentGetNodeParams). Also hardened schema-relationship and batch-node structs that aren't currently tool-reachable but sit on the same Value boundary. AgentCreateNodeParams and AgentUpdateNodeParams are deliberately excluded: exec_create_node/exec_update_node intentionally tolerate flat schema-property keys at the top level (promoting them into `properties`), so those structs must keep accepting the same "unknown" keys their callers pre-scan for. One rejection test per newly-guarded tool confirms an unknown key is rejected (not ignored) and that the error names the offending field. Co-Authored-By: Claude <[email protected]> * Address review: cover the remaining unwired structs, document scoping rationale Adds rejection tests and doc comments for the four structs the pragmatic review flagged as inconsistently covered relative to the PR's own scoping logic (none reachable from a tool call today, same as the already-called-out ExecuteQueryInput/QueryNodesInput): - AddSchemaRelationshipParams, RemoveSchemaRelationshipParams, FieldRename (schema/mod.rs) — no add/remove_schema_relationship tool exists - GetMarkdownParams, UpdateRootFromMarkdownParams (markdown/mod.rs) — built only from already-validated Rust fields (get_node's format="markdown" path, the daemon's export_markdown gRPC handler, or nothing at all) Also adds a nested-struct rejection test for AgentFilterItem/AgentSortItem (query_ops.rs) plus one through a real search_nodes payload (agent_params.rs), matching the coverage already given to AdditionalConstraints. And states explicitly, in agent_params.rs's module doc, that serde's stock "unknown field X, expected one of ..." message already satisfies both halves of the acceptance criterion — no custom formatting needed for future additions. Addresses non-blocking suggestions from the PR #1823 review. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Closes #1809