Repository navigation
Give the skill core type a strongly typed SkillNode model (closes #3101) - #3145
Conversation
Pragmatic Code Review — PR #3145 (closes #3101)Review Type: Initial review (no prior reviews or comments on the PR) SummaryThis is a good consolidation. Skill fields were read in five separate places, each with its own logic, and now one model reads them. That model is Requirements Check
Code Review Findings🟡 [Improvement] One raw skill read is left in the doc generator 🟡 [Improvement] 🟡 [Improvement] No test for the new "skip a malformed skill" path 🟢 [Nit] The default lives in two places 🟢 [Nit] CLI JSON output changed slightly 🟢 [Nit] Comment wording in 🟢 [Positive] Architecture and placement Recommendation: APPROVEAll acceptance criteria in production code are met, the precedence logic is correct against the actual write path, and the change clearly improves code health. Before merge, I recommend fixing the |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (53717b8)✅ Addressed
⏭️ Skipped
Re-review: NO RE-REVIEW NEEDED. The changes are small and low-risk: one narrowed patch, one read switched to the typed model, one constant, and a test that I confirmed fails on the mutant. |
Skill fields were decoded ad hoc from the properties bag in five places, each guessing between the hoisted `properties.skill.*` shape and the flat one. `SkillNode` (nodespace-types, re-exported from core::models) is now the only reader and writer: - from_node / from_properties decode either shape, preferring the `skill` bucket per field, and reject wrong-typed fields - SkillNodeBehavior::validate and get_embeddable_content, find_skills, SkillUpdater and `nodespace skill guidance` all read through it - skill_ops::SkillProperties and the unused agent::props helpers deleted - Seeds build skills via NodeTemplate::skill(SkillNode::new(..)); the seeded templates are byte-identical to before (verified by snapshot diff) Lives in nodespace-types rather than core so the CLI, a gRPC client with no runtime core dependency, can decode skill fields too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…alformed skip - SkillUpdater writes only the description (SkillNode::description_patch) instead of the whole config, so a concurrent edit to tool_whitelist or max_iterations is not clobbered and no default is written onto the node - gen_skill_md reads Playbook skill descriptions through SkillNode - core schema's max_iterations default uses DEFAULT_SKILL_MAX_ITERATIONS - New test: find_skills drops a malformed skill (planted by raw store write) and still returns the valid one; verified it fails when the skip is replaced by a fallback Skipped: debug! on get_embeddable_content's decode failure (validate blocks that shape on write; negligible diagnostic value). The JSON null -> "" note was already in the PR body. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
53717b8 to
8dc7802
Compare
Summary
Closes #3101.
skillfields were decoded from the properties bag in five independent places, and each one guessed between the hoistedproperties.skill.*shape and the flat shape.SkillNodeis now the only thing that reads or writes them.SkillNode(nodespace-types/src/skill.rs, re-exported asnodespace_core::models::SkillNode) has typedname,description,exclusion: Option<String>,tool_whitelist: Vec<String>,max_iterations: u32andnode_types: Vec<String>.from_node/from_propertiesread either shape. Theskillbucket wins, checked field by field.max_iterations.properties()/into_nodewrite the flat shape, which the store then hoists.SkillNodeBehavior::validate(its field checks are now the model's),get_embeddable_contentanddefault_metadata,find_skillsplus its exclusion rerank,SkillUpdater, andnodespace skill guidancein the CLI.skill_ops::SkillPropertiesand the unusednodespace_agent::propshelpers.NodeTemplate::skill(SkillNode::new(..).with_exclusion(..), guidance). Every measurement comment stays next to its field.Why nodespace-types instead of core/models
The CLI is a gRPC client and has no runtime dependency on core. It still has to decode a skill's description, and core's
Nodeis alreadynodespace_types::Node, so the model lives in the shared crate. Because of that, the seed constructor isNodeTemplate::skill(...)in core rather thanSkillNode::template(...).Behavior notes
find_skillsnow leaves out a skill whose properties fail to decode, with a warning.validaterejects that shape on write, so only a raw store write can produce one.validatenow also type-checksnode_types.--jsonguidancedescriptionis""when unset. It used to benull.Verification
root_properties, tier and the full guidance markdown of every seeded skill before and after the change. The two snapshots are byte-identical.live_skill_retrieval_stability.rs(ignored by default; needs the embedding model) passes 13/13 against the locked nomic GGUF.🤖 Generated with Claude Code