fix(evolve-lite): tighten learn skill to only extract high-signal guidelines#122
Conversation
…delines Narrow guideline extraction to three categories: shortcuts (reducing wasted steps), error prevention, and user corrections. Add explicit exclusion list, quality gate checklist, and enforce that zero entities is a valid output when no corrections occurred. Also restrict entity_io.py to an allowlist of types (guideline, preference) so the LLM can no longer invent types like "observation" that store codebase facts instead of reasoning chain corrections.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReframes evolve-learn skill output from "actionable entities" to "guidelines" with a three-category model (shortcuts, error prevention, user corrections), tightens extraction and Quality Gate rules, and restricts persisted entity types to an allowlist ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@platform-integrations/bob/evolve-lite/skills/evolve-learn/SKILL.md`:
- Line 54: The SKILL.md says the entity `type` must be "guideline" but the save
code in platform-integrations/claude/plugins/evolve-lite/lib/entity_io.py
currently accepts both "guideline" and "preference" (see the validation around
write_entity_file/write_entity_file() call); fix the mismatch by either (A)
updating SKILL.md to document that both "guideline" and "preference" are valid,
or (B) enforcing guideline-only in the skill save path by validating the entity
`type` before calling write_entity_file() (reject or coerce non-"guideline"
types), and ensure the code path and SKILL.md remain consistent.
- Line 36: Update the ambiguous entity-count sentence in SKILL.md: replace the
phrase "Maximum 3-5 entities." in the line beginning "For each identified
shortcut, error, or user correction, create one entity." with clearer wording
such as "up to 5 entities; output 0 when none qualify." Ensure the new text
reads as a single rule (e.g., "For each identified shortcut, error, or user
correction, create one entity — up to 5 entities; output 0 when none qualify.")
so the zero-entity path is explicit.
In `@platform-integrations/claude/plugins/evolve-lite/lib/entity_io.py`:
- Around line 265-268: entity.get("type") may be non-string/unhashable which
causes the allowlist check against _ALLOWED_TYPES to raise; update the
assignment and validation around entity_type (the variable set from
entity.get("type", "guideline") and the membership check against _ALLOWED_TYPES)
to first coerce or validate to a string (e.g., if not isinstance(entity_type,
str): entity_type = str(entity_type) or simply set entity_type =
entity.get("type", "guideline") and then if not isinstance(entity_type, str) set
entity_type = "guideline") before performing the "in _ALLOWED_TYPES" check so
unhashable types cannot raise and invalid types fallback to "guideline".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 79416854-a1b4-4379-aa84-9d396bf9a25b
📒 Files selected for processing (2)
platform-integrations/bob/evolve-lite/skills/evolve-learn/SKILL.mdplatform-integrations/claude/plugins/evolve-lite/lib/entity_io.py
platform-integrations/bob/evolve-lite/skills/evolve-learn/SKILL.md
Outdated
Show resolved
Hide resolved
Addresses CodeRabbit review finding: Clarify entity count rule to avoid ambiguity
Add isinstance check before the allowlist membership test so non-string or unhashable types fall back to "guideline" instead of raising. Addresses CodeRabbit review finding: Handle non-string type values before allowlist check
Narrow guideline extraction to three categories: shortcuts (reducing wasted steps), error prevention, and user corrections. Add explicit exclusion list, quality gate checklist, and enforce that zero entities is a valid output when no corrections occurred.
Also restrict entity_io.py to an allowlist of types (guideline, preference) so the LLM can no longer invent types like "observation" that store codebase facts instead of reasoning chain corrections.
For #103
Summary by CodeRabbit
Documentation
Changes