Skip to content

feat(P3): Epic 3.1 — SkillVersion, ValidationError, validate() methods [EPIC 3.1]#12

Merged
Deepfreezechill merged 2 commits intomainfrom
epic/3.1-skill-schema
Apr 2, 2026
Merged

feat(P3): Epic 3.1 — SkillVersion, ValidationError, validate() methods [EPIC 3.1]#12
Deepfreezechill merged 2 commits intomainfrom
epic/3.1-skill-schema

Conversation

@Deepfreezechill
Copy link
Copy Markdown
Owner

Summary

Add SkillVersion dataclass, ValidationError exception, and validate() methods to all skill engine types.

Closes #11

Changes

  • SkillVersion: frozen dataclass with parse(), bump_patch/minor/major(), comparison operators, round-trip serialization
  • ValidationError: dedicated exception for schema violations
  • validate(): added to SkillRecord, SkillLineage, SkillJudgment, EvolutionSuggestion, ExecutionAnalysis with cascading validation
  • 99 new tests in tests/test_skill_types.py covering creation, defaults, round-trips, comparison, validation, enums, edge cases
  • 1127 total tests passing, zero regressions

…to skill types

- Add SkillVersion frozen dataclass: semantic versioning with parse(), compare,
  bump_patch/minor/major, and serialization (to_dict/from_dict)
- Add ValidationError exception class for schema validation failures
- Add validate() to SkillLineage: enforces origin-to-parent rules
  (IMPORTED/CAPTURED=0 parents, FIXED=1, DERIVED=1+), generation >= 0
- Add validate() to SkillJudgment: non-empty skill_id
- Add validate() to EvolutionSuggestion: target count rules per evolution type
- Add validate() to ExecutionAnalysis: non-empty task_id
- Add validate() to SkillRecord: non-empty id/name, counter invariants
  (non-negative, applied<=selections, completions<=applied), cascades to lineage
- Export SkillVersion and ValidationError from skill_engine __init__
- Add 99 tests in test_skill_types.py covering all types, enums, validation,
  serialization round-trips, edge cases, and boundary conditions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

🔒 Phase Gate Enforcement — 🚫 FAIL

Check Result Detail
Issue linkage Linked issues: #11
Milestone validation Unknown milestones: Phase 3 — Skill Store Decomposition. Must match a phase in phase-config.yml.

Verdict: FAIL
Timestamp: 2026-04-02T02:41:07.123Z
Run: View workflow run


How to fix: Ensure all prerequisite phases are complete, or add emergency:bypass label with a ## Bypass Reason section in the PR body.

…on, recursion

- F1: SkillVersion default minor=0 (was 1), from_dict default minor=0
- F2: Store._upsert() and _insert_analysis() call validate() before SQL
- F3: Type coercion (int/str) in from_dict for SkillVersion, SkillRecord,
  ExecutionAnalysis with TypeError/ValueError → ValidationError
- F4: Recursive validation: ExecutionAnalysis validates judgments/suggestions,
  SkillRecord guards lineage None check
- F5: 16 hostile-input tests (wrong types, partial payloads, adversarial values)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@VonkraLLC VonkraLLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: /8eyes R2 — all 5 findings fixed. 1142 tests passing.

@Deepfreezechill Deepfreezechill merged commit 54b7bf0 into main Apr 2, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic 3.1: Extract SkillSchema + SkillVersion models from store.py

2 participants