Class: OllamaAgent::Runtime::PostConditionVerifier

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_agent/runtime/post_condition_verifier.rb

Overview

Runs declarative post-condition checks through IsolatedValidator (array exec only).

Instance Method Summary collapse

Constructor Details

#initialize(isolated_validator:) ⇒ PostConditionVerifier

Returns a new instance of PostConditionVerifier.



7
8
9
# File 'lib/ollama_agent/runtime/post_condition_verifier.rb', line 7

def initialize(isolated_validator:)
  @isolated_validator = isolated_validator
end

Instance Method Details

#verify(manifest_id:, checks:, logical_stamp:) ⇒ Hash

Returns :passed (Boolean), :results (Array of result hashes).

Parameters:

  • manifest_id (String)
  • checks (Array<Hash>)

    each hash: :name, :command (Array<String>); optional :expect_exit (default 0).

  • logical_stamp (String)

Returns:

  • (Hash)

    :passed (Boolean), :results (Array of result hashes).



15
16
17
18
# File 'lib/ollama_agent/runtime/post_condition_verifier.rb', line 15

def verify(manifest_id:, checks:, logical_stamp:)
  results = checks.map { |check| run_check(manifest_id, check, logical_stamp) }
  { passed: results.all? { |row| row[:ok] }, results: results }
end