feat(claude_sdk): add CSDK-021, CSDK-022 TypeScript description quality rules - #90
Open
bradAGI wants to merge 1 commit into
Open
feat(claude_sdk): add CSDK-021, CSDK-022 TypeScript description quality rules#90bradAGI wants to merge 1 commit into
bradAGI wants to merge 1 commit into
Conversation
…ty rules CSDK-017/018 cover the Python side; the TypeScript half was missing. CSDK-014 only checks that a description exists, so a tool whose description reads "TODO: describe this tool." or "Gets data." passes today while leaving the tool in exactly the state CSDK-014 exists to prevent. The gap costs more on the TypeScript side than in Python, and the rule text says so: CSDK-014's own explanation notes there is no docstring fallback, so the description argument is the entire prompt-side account of the tool. The Zod input schema does not compensate — it constrains the shape of the arguments once the model has decided to call this tool, and says nothing about whether calling it was the right move.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSDK-017/018 (merged in #40) cover the Python side of description quality; the TypeScript half was missing. CSDK-014 only checks that a description exists, so a tool whose description reads
"TODO: describe this tool."or"Gets data."passes today — while sitting in exactly the state CSDK-014 exists to prevent.The gap costs more on the TypeScript side than in Python, and CSDK-014's own explanation already says why: there's no docstring fallback, so the
descriptionargument is the entire prompt-side account of the tool. In Python a thin docstring at least sits next to readable source; here the string is the interface.CSDK-022 also names the mitigation people assume covers this: the Zod input schema doesn't compensate. It constrains the shape of the arguments once the model has decided to call this tool, and says nothing about whether calling it was the right move. Schema validation passing and the run being wrong are compatible.
Both predicates confirmed working against TypeScript tools rather than assumed —
has_description_textreadsToolDef.Description, which for TS is the explicit description argument.Verification — engine built at
main:Fire (one tool described
"TODO: describe this tool.", one"Gets data."):CSDK-021, CSDK-022, CSDK-203Silent (full description naming when to prefer the neighboring tool):
CSDK-203(CSDK-203 is the pre-existing missing-CLAUDE.md repo rule.)
CSDK-022 pairs
description_length_lt: 40withhas_docstring: trueso it doesn't double-report against CSDK-014 on an empty description, same as CSDK-018.No new predicates, so no
schema_versionbump.