nyash-codex
c82ae2365f
refactor(joinir): Phase 44 - Capability-based shape guard
Refactor shape detection from function-name-based to capability-based
architecture for better extensibility and maintainability.
Key changes:
- ShapeCapabilityKind enum: P2CoreSimple/SkipWs/Atoi/ParseNumber
- ShapeCapability: Capability descriptor with future extensibility
- Helper functions:
- capability_for_shape(): Map shape to capability
- is_canonical_shape(): Exact shape-level check
- is_p2_core_capability(): Broad capability family check
- is_supported_by_normalized(): Normalized dev support
Benefits:
- Extensibility: Easy to add new capability kinds
- Clarity: Shape purpose explicit in kind names
- Maintainability: Centralized mapping vs scattered ifs
- Future-ready: Infrastructure for carrier roles, method signatures
Backward compatibility:
- Zero behavioral changes (pure refactoring)
- Canonical set preserved: Pattern2Mini, skip_ws mini/real, atoi mini
- All existing code paths unchanged
Tests: 937/937 PASS
Files: +78 lines (shape_guard.rs), design doc created