Class: Protege::ConsoleInferenceJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Protege::ConsoleInferenceJob
- Defined in:
- app/jobs/protege/console_inference_job.rb
Overview
Runs a dashboard-originated message through the inference pipeline.
The console counterpart to InferenceJob: enqueued by Gateway.accept_console_message when a
developer sends a message from the HQ console. Because console messages bypass SMTP entirely,
this job operates on a Message that has already been persisted, rather than on an
ActionMailbox::InboundEmail it must ingest first. The remainder of the flow — correlation-ID
restoration, running the Orchestrator's Harness, and recording the outcome — mirrors
InferenceJob.
Lifecycle
- Restore the correlation ID for event tracing.
- Find the
MessageandPersonafrom their IDs. - Transition the message to
processing. - Run the inference loop (+Harness+).
- Mark the message
processedon success,failedon error.
Instance Method Summary collapse
-
#perform(message_id:, persona_id:, correlation_id:) ⇒ void
Process one pre-persisted console message end to end.
Instance Method Details
#perform(message_id:, persona_id:, correlation_id:) ⇒ void
This method returns an undefined value.
Process one pre-persisted console message end to end.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/jobs/protege/console_inference_job.rb', line 30 def perform(message_id:, persona_id:, correlation_id:) restore_correlation_id(correlation_id) = Message.find() persona = Persona.find(persona_id) process(message:, persona:) rescue StandardError => e &.mark_failed!(e) raise end |