Skip to content

Releases: icdevsorg/inspect-mo

Improvements and metadata

04 Sep 00:43

Choose a tag to compare

[0.1.1] - 2025-09-03

🎉 Major Feature: ICRC16 CandyShared Integration

Added

  • Complete ICRC16 Validation Suite: 15 validation rule variants for CandyShared metadata structures
    • icrc16CandyType - Validate CandyShared type matches expected
    • icrc16CandySize - Validate metadata size limits
    • icrc16CandyDepth - Prevent excessive nesting
    • icrc16PropertyExists - Require specific properties
    • icrc16ArrayLength - Validate array sizes
    • icrc16BoolValue - Validate boolean values
    • icrc16IntRange - Validate integer ranges
    • icrc16NatRange - Validate natural number ranges
    • icrc16FloatRange - Validate float ranges
    • icrc16TextPattern - Validate text patterns (regex)
    • icrc16BlobSize - Validate blob sizes
    • icrc16ClassStructure - Validate class properties
    • icrc16ArrayStructure - Validate array element types
    • icrc16ValueSet - Validate against allowed values
    • icrc16CustomCandyCheck - Custom validation logic

🛠️ ValidationRule Array Utilities

Added

  • appendValidationRule: Append single validation rule to existing array
  • combineValidationRules: Combine multiple validation rule arrays efficiently
  • ValidationRuleBuilder: Fluent interface for building complex validation rule sets
    • Method chaining support: .addRule().addRules().build()
    • Type-safe rule construction with generics support
    • Comprehensive utility functions for common validation patterns

Performance Characteristics

  • Linear Complexity: All operations are O(n) with excellent performance
  • Memory Efficient: ~5K-20K instructions, 272B heap usage
  • Production Ready: Comprehensive testing with deployed canister validation

🔧 Core Enhancement: Efficient Argument Size Validation

Added

  • inspectOnlyArgSize Function: O(1) argument size checking without parsing overhead
    • Provides direct access to blob size in bytes for efficient size validation
    • Integrates seamlessly with existing InspectMo validation pipeline
    • No message parsing required - direct Blob.size() operation for maximum performance
    • Returns Nat representing exact argument size for pre-validation filtering

🔒 Security & Quality Assurance

Security Review Completed

  • DoS Protection: Depth limits (maxDepth=10) and size constraints prevent resource exhaustion
  • Memory Safety: Linear complexity operations, bounded memory growth
  • Input Validation: Type-safe CandyShared validation with graceful error handling
  • Information Security: Error messages sanitized to prevent sensitive data leakage

Testing & Validation

  • Production Canister Testing: All features validated with deployed canisters on IC
    • ValidationRule Array Utilities: Canister ufxgi-4p777-77774-qaadq-cai
    • DeFi Protocol Example: Canister uzt4z-lp777-77774-qaabq-cai
    • File Manager Example: Canister umunu-kh777-77774-qaaca-cai
    • Basic Functionality: Canister vizcg-th777-77774-qaaea-cai
  • Comprehensive Unit Tests: test/inspect-arg-size.test.mo with edge case validation
  • Integration Tests: Full pipeline testing with real canister deployment
  • Performance Benchmarks: All targets met with excellent efficiency metrics

🏗️ Platform Integration

  • Mixed Validation Pipelines: Seamless integration of traditional + ICRC16 validation rules
  • Production Examples:
    • examples/simple-icrc16.mo - Basic ICRC16 validation patterns
    • examples/icrc16-user-management.mo - Complex ICRC16 integration with user profiles
  • Comprehensive Testing: 15/15 PIC.js tests passing with real canister deployment
  • Complete Documentation: Full ICRC16 integration guide in API.md and EXAMPLES.md

Dependencies

  • Added mo:candy/types v0.3.1 for CandyShared type definitions

Technical

  • ErasedValidator Integration: ICRC16 rules follow the same type-safe pattern as traditional validation
  • Type Safety: Full compile-time validation of ICRC16 metadata structures
  • Performance: Efficient validation with minimal runtime overhead
  • Real-World Testing: Validated through actual canister deployment and execution

Documentation

  • Updated README.md to highlight ICRC16 as a key feature
  • Added comprehensive ICRC16 section to docs/API.md
  • Added production-ready ICRC16 example to docs/EXAMPLES.md
  • Updated workplan to reflect ICRC16 completion
  • Created ICRC16_INTEGRATION_SUCCESS.md documenting achievement

Initial Release

26 Aug 18:52

Choose a tag to compare

[0.1.0] - 2025-08-25

  • Initial public preview release
  • Local-only code generation workflow (ts-node; npm run codegen)
  • dfx.json cleaned (no unsupported hooks)
  • Docker assets removed from repo
  • Docs: added Local code generation section to README
  • Tooling: modernized Jest/ts-jest config (removed deprecated globals); TypeScript esModuleInterop enabled
  • Docs sweep: removed inaccurate "DFX prebuild hooks" claims; documented manual codegen and CI example (npm run codegen && dfx build)
  • Tests: PocketIC/Jest integration suites passing locally (13 suites, 133 tests)
  • Limitations: Rate limiting is stubbed, not functional in 0.1.0; RBAC examples are illustrative only