Record Class EscalationRequest

java.lang.Object
java.lang.Record
ai.tabforge.workshop.model.EscalationRequest
Record Components:
reviewId - the paused review session
triggeringFinding - the CRITICAL finding that caused the pause
question - the specific question the developer must answer
availableOptions - the decision types the developer can choose from
escalatedAt - ISO-8601 timestamp when the escalation was created
confidenceNote - optional explanation if confidence affects the severity

public record EscalationRequest(String reviewId, Finding triggeringFinding, String question, List<HumanDecision.DecisionType> availableOptions, String escalatedAt, String confidenceNote) extends Record
Sent to Claude Desktop when a CRITICAL finding requires a human decision.

Analogy: like a circuit breaker tripping — when current (risk) exceeds the safe threshold, the breaker opens (review pauses) and a human must manually reset it. EscalationRequest is the message the breaker sends to the electrician: "I tripped on this specific problem, here are your options, please decide."

Flow:

  1. OrchestratorAgent#escalate() detects CRITICAL finding with confidence ≥ 0.70
  2. Creates EscalationRequest and returns it to OrchestratorAgent
  3. Orchestrator pauses the review, stores the request under reviewId
  4. GetReportTool returns status: AWAITING_HUMAN with this request
  5. Claude Desktop presents the finding to the developer
  6. Developer calls RespondToEscalationTool with their decision
  7. OrchestratorAgent.resumeAfterEscalation() is called → review continues

CERTIFICATION NOTE — Domain 1: Agentic Architecture & Orchestration (27%): EscalationRequest is what the OrchestratorAgent returns to the MCP layer when it cannot proceed autonomously. The orchestrator stores the review session in AWAITING_HUMAN state and attaches this object so GetReportTool can surface it to Claude Desktop. The loop is paused, not terminated — it resumes exactly where it stopped once the human decides.

CERTIFICATION NOTE — Domain 5: Context Management & Reliability (15%): This class represents the "pause point" in an agentic loop — the moment when the system decides it cannot continue autonomously and must involve a human. The exam tests: when should an agent pause? What information must it surface? How does it resume? This record answers all three.

  • Constructor Details

  • Method Details

    • standardQuestion

      public static String standardQuestion(Finding finding)
      Standard escalation question for a CRITICAL finding. Used when confidence ≥ 0.85 (high certainty).

      Called by OrchestratorAgent#escalate() when a CRITICAL finding is detected in SubAgent.execute(). The orchestrator checks confidence, picks this method or uncertaintyQuestion(), creates the EscalationRequest, stores it in the session, and blocks the agent thread on a CountDownLatch until the developer responds via RespondToEscalationTool.

    • uncertaintyQuestion

      public static String uncertaintyQuestion(Finding finding)
      Uncertainty escalation question for a CRITICAL finding with 0.70–0.84 confidence. Includes a note that the agent is not fully certain.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • reviewId

      public String reviewId()
      Returns the value of the reviewId record component.
      Returns:
      the value of the reviewId record component
    • triggeringFinding

      public Finding triggeringFinding()
      Returns the value of the triggeringFinding record component.
      Returns:
      the value of the triggeringFinding record component
    • question

      public String question()
      Returns the value of the question record component.
      Returns:
      the value of the question record component
    • availableOptions

      public List<HumanDecision.DecisionType> availableOptions()
      Returns the value of the availableOptions record component.
      Returns:
      the value of the availableOptions record component
    • escalatedAt

      public String escalatedAt()
      Returns the value of the escalatedAt record component.
      Returns:
      the value of the escalatedAt record component
    • confidenceNote

      public String confidenceNote()
      Returns the value of the confidenceNote record component.
      Returns:
      the value of the confidenceNote record component