# Fan-out and judge: reviewers answer in parallel, then a judge picks one verdict with a reason. import "agentic.lms"; proposal = ARGV.get(0, "Replace the nightly cron jobs with lmscript scripts checked in next to the code."); seats = ["security reviewer", "operations engineer", "finance lead"]; fn review(seat) { return {seat: seat, view: ask(agent(seat, "judge proposals from your seat"), f"Proposal: {proposal}\nGive one risk and one benefit in 2 sentences.")}; } views = parallel_map(seats, review, 3); notes = ""; for (v in views) { notes = notes + f"[{v.seat}] {v.view}\n"; println(f"{v.seat}: {v.view}"); } judge = agent("judge", "weigh the reviews and decide"); schema = {type: "object", required: ["verdict", "reason"], properties: { verdict: {type: "string", enum: ["accept", "accept with conditions", "reject"]}, reason: {type: "string", maxLength: 500}}}; decision = ask_json(judge, f"Proposal: {proposal}\nReviews:\n{notes}", schema); if (decision != null) { println(f"verdict={decision.verdict}: {decision.reason}"); }