Class: RosettAi::Retrofit::RoundTripValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/retrofit/round_trip_validator.rb

Overview

Validates that retrofit output round-trips through compilation.

Compares the original native config with the result of compiling the retrofitted YAML to verify semantic equivalence.

Author:

  • hugo

  • claude

Instance Method Summary collapse

Instance Method Details

#validate(original:, compiled:) ⇒ Hash

Returns validation result with :valid and :differences keys.

Parameters:

  • original (Hash)

    parsed original native config

  • compiled (Hash)

    parsed output of compiling retrofitted YAML

Returns:

  • (Hash)

    validation result with :valid and :differences keys



19
20
21
22
23
24
25
26
# File 'lib/rosett_ai/retrofit/round_trip_validator.rb', line 19

def validate(original:, compiled:)
  differences = find_differences(original, compiled)

  {
    valid: differences.empty?,
    differences: differences
  }
end