-
Couldn't load subscription status.
- Fork 0
Closed
Description
Overview
Port the existing Go file operations from tools/file_ops/main.go in rules_wasm_component to TinyGo with proper WIT interface bindings.
Tasks
- Create TinyGo module structure and go.mod
- Port JSON batch processing functionality
- Port individual file operations (copy_file, mkdir, etc.)
- Implement WIT interface bindings using wit-bindgen
- Add security validation and path traversal protection
- Create comprehensive test suite
- Add performance benchmarking
- Document TinyGo-specific features and limitations
Key Operations to Port
copy_file: Single file copying with permissionscopy_directory_contents: Recursive directory copyingcreate_directory: Safe directory creation (mkdir -p equivalent)run_command: Command execution (may need WASI limitations)validate_config: JSON configuration validationcontainsPathTraversal: Security validation
Acceptance Criteria
- All JSON batch operations work identically to original Go version
- WIT interface functions are properly exposed and functional
- Security validation prevents path traversal attacks
- Component compiles to valid WASM with TinyGo toolchain
- Performance is within acceptable range of native Go version
- Comprehensive test coverage matches original implementation
Technical Notes
- Use TinyGo 0.38.0 with WASI Preview 2 support
- Target wasm32-wasi architecture
- Implement proper error handling and logging
- Consider WASI limitations for command execution functionality
Related
Part of Phase 2 implementation. Depends on unified WIT interface design.
Metadata
Metadata
Assignees
Labels
No labels