Audit each claim in an escalation brief
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, writtenkind|sources, wheresourcesis a list of citations separated by,, each writtenchannel#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:
- Trim and lowercase the allowed channels.
- 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. - Split the sources on
,, trim and lowercase each citation, and drop empty ones. - An empty kind:
"malformed". - No citations:
"uncited". - 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". - A
disagreementwith fewer than 2 distinct citations:"one_sided". - Otherwise:
"ok".
Examples
audit_brief_claims(claim_lines: list[str], allowed_channels: list[str]) -> list[str]Example 1
Input
audit_brief_claims(["ask|support#4", "disagreement|support#9,billing#12"], ["support", "billing"])Output
["ok", "ok"]Example 2
Input
audit_brief_claims(["commitment|", "timeline|hr#3"], ["support"])Output
["uncited", "out_of_scope"]Example 3
Input
audit_brief_claims(["disagreement|support#9"], ["support"])Output
["one_sided"]