Repository navigation
fix(review): keep from_attributes live when nested models validate ORM objects - #1383
Open
aniruddhaadak80 wants to merge 1 commit into
Open
aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
…rt#1358) ponytail-review and ponytail-audit marked a live Pydantic from_attributes=True dead after checking one model_validate(dict) call site. A second call site, model_validate(orm_object), needs the flag for nested models, so removing it broke the endpoint at runtime. Both skills now require every use of the owner before a deletion finding: direct calls, tests, config, string and dynamic references, serialization, reflection and framework hooks. When those cannot all be checked, the finding is unverified and no deletion is recommended. The rule ships in the canonical skills, the Claude/Gemini commands, the OpenCode commands and the generated OpenClaw skills, with a regression test pinning the issue's repro.
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.
Closes #1358
Root cause
/ponytail-reviewand/ponytail-auditcould call code, a flag or a config key dead from a single call site. In the issue's repro,ParentResponse.model_validate(entity.model_dump())was checked,PeriodResponse.model_config = ConfigDict(from_attributes=True)looked unused, and the second call site (ParentResponse.model_validate(entity)) was missed. Removing the flag then raisedInput should be a valid dictionary or instance of PeriodResponseat runtime.The base ponytail skill already says "grep every caller" before a bug fix, but the review and audit skills did not apply that rule to deletions.
Fix
The review and audit skills now require every use of the owner before a deletion finding: direct calls, tests, config, string and dynamic references, serialization, reflection and framework hooks. One call site where a setting does nothing does not prove it is dead. The Pydantic case is named explicitly:
from_attributes=Trueon a nested model is live when another call site validates an ORM object, even if the first validates a dict.When the every-use check is not possible, the finding is marked unverified and no deletion is recommended; it goes under
Not checked:instead. The rule ships in all copies hosts actually load:skills/ponytail-review/SKILL.md,skills/ponytail-audit/SKILL.mdcommands/ponytail-review.toml,commands/ponytail-audit.toml.opencode/command/ponytail-review.md,.opencode/command/ponytail-audit.md.openclaw/skills/ponytail-{review,audit}/SKILL.mdTests
Added
tests/delete-liveness.test.jswith the issue's Pydantic repro in the header. It fails if any shipped copy of review/audit:from_attributes/ ORM-object failure modeNo baseline failures. The 2 root-test skips are pre-existing platform skips (grep/sh unavailable paths).