Next

Audit each claim in an escalation brief

Agent buildEasy10 minMicrosoft style

Your task

An escalation lands on your desk as a thread of 90 messages spanning 3 weeks. An agent writes a brief of it, and before anyone trusts the brief, a check audits the citations behind every claim.

Write audit_brief_claims(claim_lines, allowed_channels): the check every brief passes through.

  • claim_lines (list of str): one claim each, written kind|sources, where sources is a list of citations separated by ,, each written channel#message_id. For example "disagreement|support#9,billing#12".
  • allowed_channels (list of str): the channels this escalation lives in.
  • Return one verdict per claim, in input order: "ok", "malformed", "uncited", "out_of_scope" or "one_sided".

Rules:

  1. Trim and lowercase the allowed channels.
  2. Split each claim at its first |. The kind is the part before it (the whole line if there is no |), trimmed and lowercased. The sources are the part after it, or empty.
  3. Split the sources on ,, trim and lowercase each citation, and drop empty ones.
  4. An empty kind: "malformed".
  5. No citations: "uncited".
  6. A citation's channel is the part before its first #, or the whole citation if it has no #. If any citation's channel is not an allowed channel: "out_of_scope".
  7. A disagreement with fewer than 2 distinct citations: "one_sided".
  8. Otherwise: "ok".

Examples

audit_brief_claims(claim_lines: list[str], allowed_channels: list[str]) -> list[str]
Example 1
Inputaudit_brief_claims(["ask|support#4", "disagreement|support#9,billing#12"], ["support", "billing"])
Output["ok", "ok"]
Example 2
Inputaudit_brief_claims(["commitment|", "timeline|hr#3"], ["support"])
Output["uncited", "out_of_scope"]
Example 3
Inputaudit_brief_claims(["disagreement|support#9"], ["support"])
Output["one_sided"]