/// Simplified interactive review session with guided rewrite rounds.
///
/// Demonstrates a collect → iterative-review → finalize pattern where
/// the reviewer can request revisions before reaching a final decision.
session interactiveReview {
  idle_timeout = 10m
  max_rounds = 10

  phase collect {
    node collectContext : CollectReviewContextOperator {
      input {
        applicantId = ctx.applicantId
        riskLevel = ctx.riskLevel
      }
    }
    then -> review
  }

  phase review {
    max_rounds = 3
    yield_on = [reviewRound]
    round {
      node reviewRound : DecideReviewOperator {
        input {
          applicantId = ctx.collect.output.collectContext.applicantId
          riskLevel = ctx.collect.output.collectContext.riskLevel
        }
      }
    }
    until reviewRound.output.decision != "needs_revision"
    then -> finalize
  }

  phase finalize {
    node summarize : CsSessionCloser {
      input {
        resolution = ctx.review.output.reviewRound.decision
      }
    }
  }
}
