feat(claude_sdk): add CSDK-021, CSDK-022 TypeScript description quality rules - #90
feat(claude_sdk): add CSDK-021, CSDK-022 TypeScript description quality rules#90bradAGI 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.
|
Thanks @bradAGI. The framing is right, and the Zod paragraph in CSDK-022 is the part I would have written myself: the schema constrains the arguments after the model has already decided to call the tool, and says nothing about whether calling it was the right move. Checked against Two notes. This should land together with trustabl/trustabl#167. It also needs a rationale doc in |
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.