Class: KairosMcp::KairosChain::FormalizationDecision
- Inherits:
-
Object
- Object
- KairosMcp::KairosChain::FormalizationDecision
- Defined in:
- lib/kairos_mcp/kairos_chain/formalization_decision.rb
Overview
On-chain record of a single formalization decision. Records why a piece of natural language content was (or was not) converted to a formal AST node.
Instance Attribute Summary collapse
-
#ambiguity_after ⇒ Object
readonly
Returns the value of attribute ambiguity_after.
-
#ambiguity_before ⇒ Object
readonly
Returns the value of attribute ambiguity_before.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#decided_by ⇒ Object
readonly
Returns the value of attribute decided_by.
-
#decompile_text ⇒ Object
readonly
Returns the value of attribute decompile_text.
-
#formalization_category ⇒ Object
readonly
Returns the value of attribute formalization_category.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#rationale ⇒ Object
readonly
Returns the value of attribute rationale.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#skill_id ⇒ Object
readonly
Returns the value of attribute skill_id.
-
#skill_version ⇒ Object
readonly
Returns the value of attribute skill_version.
-
#source_decompile_divergence ⇒ Object
readonly
Returns the value of attribute source_decompile_divergence.
-
#source_span ⇒ Object
readonly
Returns the value of attribute source_span.
-
#source_text ⇒ Object
readonly
Returns the value of attribute source_text.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(skill_id:, skill_version:, source_text:, result:, rationale:, formalization_category:, source_span: nil, ambiguity_before: nil, ambiguity_after: nil, decided_by: :human, model: nil, timestamp: Time.now.iso8601, confidence: nil, decompile_text: nil, source_decompile_divergence: nil) ⇒ FormalizationDecision
constructor
A new instance of FormalizationDecision.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(skill_id:, skill_version:, source_text:, result:, rationale:, formalization_category:, source_span: nil, ambiguity_before: nil, ambiguity_after: nil, decided_by: :human, model: nil, timestamp: Time.now.iso8601, confidence: nil, decompile_text: nil, source_decompile_divergence: nil) ⇒ FormalizationDecision
Returns a new instance of FormalizationDecision.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 16 def initialize(skill_id:, skill_version:, source_text:, result:, rationale:, formalization_category:, source_span: nil, ambiguity_before: nil, ambiguity_after: nil, decided_by: :human, model: nil, timestamp: Time.now.iso8601, confidence: nil, decompile_text: nil, source_decompile_divergence: nil) @skill_id = skill_id @skill_version = skill_version @source_text = source_text @source_span = source_span @result = result @rationale = rationale @formalization_category = formalization_category @ambiguity_before = ambiguity_before @ambiguity_after = ambiguity_after @decided_by = decided_by @model = model @timestamp = @confidence = confidence @decompile_text = decompile_text @source_decompile_divergence = source_decompile_divergence end |
Instance Attribute Details
#ambiguity_after ⇒ Object (readonly)
Returns the value of attribute ambiguity_after.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def ambiguity_after @ambiguity_after end |
#ambiguity_before ⇒ Object (readonly)
Returns the value of attribute ambiguity_before.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def ambiguity_before @ambiguity_before end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def confidence @confidence end |
#decided_by ⇒ Object (readonly)
Returns the value of attribute decided_by.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def decided_by @decided_by end |
#decompile_text ⇒ Object (readonly)
Returns the value of attribute decompile_text.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def decompile_text @decompile_text end |
#formalization_category ⇒ Object (readonly)
Returns the value of attribute formalization_category.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def formalization_category @formalization_category end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def model @model end |
#rationale ⇒ Object (readonly)
Returns the value of attribute rationale.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def rationale @rationale end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def result @result end |
#skill_id ⇒ Object (readonly)
Returns the value of attribute skill_id.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def skill_id @skill_id end |
#skill_version ⇒ Object (readonly)
Returns the value of attribute skill_version.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def skill_version @skill_version end |
#source_decompile_divergence ⇒ Object (readonly)
Returns the value of attribute source_decompile_divergence.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def source_decompile_divergence @source_decompile_divergence end |
#source_span ⇒ Object (readonly)
Returns the value of attribute source_span.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def source_span @source_span end |
#source_text ⇒ Object (readonly)
Returns the value of attribute source_text.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def source_text @source_text end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
10 11 12 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 10 def @timestamp end |
Class Method Details
.from_json(json_str) ⇒ Object
65 66 67 68 69 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 65 def self.from_json(json_str) data = JSON.parse(json_str, symbolize_names: true) data.delete(:type) # Remove the type marker new(**data) end |
Instance Method Details
#to_h ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 40 def to_h { type: :formalization_decision, skill_id: @skill_id, skill_version: @skill_version, source_text: @source_text, source_span: @source_span, result: @result, rationale: @rationale, formalization_category: @formalization_category, ambiguity_before: @ambiguity_before, ambiguity_after: @ambiguity_after, decided_by: @decided_by, model: @model, timestamp: @timestamp, confidence: @confidence, decompile_text: @decompile_text, source_decompile_divergence: @source_decompile_divergence } end |
#to_json(*args) ⇒ Object
61 62 63 |
# File 'lib/kairos_mcp/kairos_chain/formalization_decision.rb', line 61 def to_json(*args) to_h.to_json(*args) end |