
Audio System Enhancements: - Complete PipeWire configuration with WirePlumber session management - AI-powered noise suppression using RNNoise plugin - GUI applications: EasyEffects, pavucontrol, Helvum, qpwgraph, pwvucontrol - Pre-configured audio presets for microphone noise suppression - Desktop integration with auto-start and helper scripts - Validation tools and interactive audio management utilities - Real-time audio processing with RTKit optimization - Cross-application compatibility (Discord, Zoom, OBS, etc.) MCP (Model Context Protocol) Implementation in Guile Scheme: - Modular MCP server architecture with clean separation of concerns - JSON-RPC transport layer with WebSocket and stdio support - Protocol compliance with MCP specification - Comprehensive error handling and validation - Router system for tool and resource management - Integration layer for NixOS Home Lab management - Full test suite with unit and integration tests - Documentation and usage examples Technical Details: - Removed conflicting ALSA udev rules while maintaining compatibility - Fixed package dependencies and service configurations - Successfully deployed and tested on congenital-optimist machine - Functional programming approach using Guile Scheme modules - Type-safe protocol implementation with validation - Async/await pattern support for concurrent operations This represents a significant enhancement to the Home Lab infrastructure, providing both professional-grade audio capabilities and a robust MCP server implementation for AI assistant integration.
66 lines
2.2 KiB
Scheme
66 lines
2.2 KiB
Scheme
;; Unit Tests for Validation Module
|
|
;; Tests the message validation and schema enforcement
|
|
|
|
(define-module (tests validation-tests)
|
|
#:use-module (srfi srfi-64)
|
|
#:use-module (mcp server validation)
|
|
#:use-module (mcp server jsonrpc)
|
|
#:export (run-validation-tests))
|
|
|
|
(define (run-validation-tests)
|
|
"Run all Validation module tests"
|
|
(test-begin "Validation Tests")
|
|
|
|
;; Test message validation
|
|
(test-group "Message Validation"
|
|
(test-message-validation))
|
|
|
|
;; Test schema validation
|
|
(test-group "Schema Validation"
|
|
(test-schema-validation))
|
|
|
|
;; Test parameter validation
|
|
(test-group "Parameter Validation"
|
|
(test-parameter-validation))
|
|
|
|
(test-end "Validation Tests"))
|
|
|
|
(define (test-message-validation)
|
|
"Test MCP message validation"
|
|
|
|
(test-assert "Validate valid request"
|
|
(let ((request (make-jsonrpc-request 1 "test-method" #f)))
|
|
(not (validation-error? (validate-mcp-message request)))))
|
|
|
|
(test-assert "Validate valid response"
|
|
(let ((response (make-jsonrpc-response 1 "result")))
|
|
(not (validation-error? (validate-mcp-message response))))))
|
|
|
|
(define (test-schema-validation)
|
|
"Test JSON schema validation"
|
|
|
|
;; Test object schema validation
|
|
(test-assert "Validate object against schema"
|
|
(let ((data `(("name" . "test")
|
|
("version" . "1.0")))
|
|
(schema `(("type" . "object")
|
|
("required" . ("name" "version"))
|
|
("properties" . (("name" . (("type" . "string")))
|
|
("version" . (("type" . "string"))))))))
|
|
(not (validation-error? (validate-schema data schema '())))))
|
|
|
|
;; Test required field validation
|
|
(test-assert "Reject missing required fields"
|
|
(let ((data `(("name" . "test")))
|
|
(schema `(("type" . "object")
|
|
("required" . ("name" "version")))))
|
|
(validation-error? (validate-schema data schema '())))))
|
|
|
|
(define (test-parameter-validation)
|
|
"Test MCP method parameter validation"
|
|
|
|
;; Test tool parameter validation
|
|
(test-assert "Validate tool parameters"
|
|
(let ((params `(("name" . "test-tool")
|
|
("arguments" . (("arg1" . "value1"))))))
|
|
(not (validation-error? (validate-tool-params params))))))
|