Exception: Smith::SeedMismatch
- Defined in:
- lib/smith/errors.rb
Overview
Raised when restore detects that the workflow’s seed_messages builder now produces a different digest than what was persisted (i.e., the system prompt or seed template changed in code after this workflow was already running). Only fires when the workflow opts into ‘seed_validation :strict`; the default `:off` skips validation and `:warn` logs without raising.
Instance Attribute Summary collapse
-
#current_digest ⇒ Object
readonly
Returns the value of attribute current_digest.
-
#stored_digest ⇒ Object
readonly
Returns the value of attribute stored_digest.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
-
#initialize(workflow:, stored_digest:, current_digest:) ⇒ SeedMismatch
constructor
A new instance of SeedMismatch.
Constructor Details
#initialize(workflow:, stored_digest:, current_digest:) ⇒ SeedMismatch
Returns a new instance of SeedMismatch.
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/smith/errors.rb', line 128 def initialize(workflow:, stored_digest:, current_digest:) @workflow = workflow @stored_digest = stored_digest @current_digest = current_digest super( "seed_messages drift detected for #{workflow}: stored digest #{stored_digest.inspect}, " \ "current digest #{current_digest.inspect}. The seed_messages block changed after this " \ "workflow was persisted. Restoring this state would mix old + new prompt context." ) end |
Instance Attribute Details
#current_digest ⇒ Object (readonly)
Returns the value of attribute current_digest.
126 127 128 |
# File 'lib/smith/errors.rb', line 126 def current_digest @current_digest end |
#stored_digest ⇒ Object (readonly)
Returns the value of attribute stored_digest.
126 127 128 |
# File 'lib/smith/errors.rb', line 126 def stored_digest @stored_digest end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
126 127 128 |
# File 'lib/smith/errors.rb', line 126 def workflow @workflow end |