Class: RosettAi::Compiler::BehaviourCompiler

Inherits:
CompilationPipeline show all
Defined in:
lib/rosett_ai/compiler/behaviour_compiler.rb

Overview

Backward-compatible wrapper around CompilationPipeline.

Preserves the original 3-argument constructor and defaults the backend to the Claude engine backend. Existing callers that instantiate BehaviourCompiler continue to work without modification.

Constant Summary collapse

GENERATED_MARKER =
'<!-- rosett-ai-claude-managed'

Constants inherited from CompilationPipeline

CompilationPipeline::NON_COMPILABLE_CATEGORIES, CompilationPipeline::PROJECT_ONLY_CATEGORIES, CompilationPipeline::VALID_SCOPES

Instance Attribute Summary

Attributes inherited from CompilationPipeline

#additional_source_dirs, #backend, #schema_dir, #scope, #source_dir, #target_dir

Instance Method Summary collapse

Methods inherited from CompilationPipeline

#checksum, #compile, #conflict_warnings, #diff, #discover_categories, #lockfile_data, #managed_file?, #orphaned_files, #skipped_project_categories, #validate!

Constructor Details

#initialize(source_dir:, target_dir:, schema_dir:) ⇒ BehaviourCompiler

Backward-compatible wrapper that defaults to the Claude engine backend.

Parameters:

  • source_dir (String, Pathname)

    directory containing behaviour YAML files

  • target_dir (String, Pathname)

    directory for compiled output files

  • schema_dir (String, Pathname)

    directory containing JSON Schema files



21
22
23
24
25
26
27
28
# File 'lib/rosett_ai/compiler/behaviour_compiler.rb', line 21

def initialize(source_dir:, target_dir:, schema_dir:)
  super(
    source_dir: source_dir,
    target_dir: target_dir,
    schema_dir: schema_dir,
    backend: Backend.for('claude')
  )
end

Instance Method Details

#render(category, data) ⇒ String

Delegates render to the backend for backward compatibility.

Parameters:

  • category (String)

    the behaviour category name

  • data (Hash)

    behaviour data to render

Returns:

  • (String)

    rendered output from the backend



35
36
37
# File 'lib/rosett_ai/compiler/behaviour_compiler.rb', line 35

def render(category, data)
  backend.render(data.merge('category' => category))
end