Module: RailsAiBridge::Tools::ConfidenceTag
- Defined in:
- lib/rails_ai_bridge/tools/confidence_tag.rb
Overview
Maps an evidence source to a compact [VERIFIED] / [INFERRED] tag.
Verified only when ActiveRecord reflection or rubydex/Prism agrees. Source-regex extracts and static schema parses stay inferred. Unknown sources under-claim as inferred — there is no third status.
Constant Summary collapse
- VERIFIED =
'[VERIFIED]'- INFERRED =
'[INFERRED]'- VERIFIED_SOURCES =
%i[reflection rubydex prism live].freeze
Class Method Summary collapse
-
.tag(source) ⇒ String
[VERIFIED]or[INFERRED]. -
.tagged(text, source) ⇒ String
textwith a trailing confidence tag.
Class Method Details
.tag(source) ⇒ String
Returns [VERIFIED] or [INFERRED].
20 21 22 23 24 |
# File 'lib/rails_ai_bridge/tools/confidence_tag.rb', line 20 def tag(source) return INFERRED if source.nil? VERIFIED_SOURCES.include?(source.to_sym) ? VERIFIED : INFERRED end |
.tagged(text, source) ⇒ String
Returns text with a trailing confidence tag.
29 30 31 |
# File 'lib/rails_ai_bridge/tools/confidence_tag.rb', line 29 def tagged(text, source) "#{text} #{tag(source)}" end |