broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = bool(x["published_editions"])
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [True, True, True, True, True]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [True, True, True, True, True]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['edition-existence'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"]>=min(x["published_editions"],default=0)
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [True, True, True, True, True]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [True, True, True, True, True]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [False, False, False, False, False])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['edition-existence'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A reader receives an unpublished result edition merely because another exists.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision edition-existence: For edition existence, apply the stipulated decision x["edition"] in x["published_editions"].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:sum(q for b,q in zip(x["ids"],x["quantities"]) if b==a) for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 3, 'b': 4}, {'a': 6, 'b': 8}, {'a': 9, 'b': 12}, {'a': 12, 'b': 16}, {'a': 15, 'b': 20}]), ('all final / out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 3, 'b': 4}, {'a': 6, 'b': 8}, {'a': 9, 'b': 12}, {'a': 12, 'b': 16}, {'a': 15, 'b': 20}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['correction-quantity-replacement'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = dict(zip(x["ids"],x["quantities"]))
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 3, 'b': 4}, {'a': 6, 'b': 8}, {'a': 9, 'b': 12}, {'a': 12, 'b': 16}, {'a': 15, 'b': 20}]), ('all final / out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 3, 'b': 4}, {'a': 6, 'b': 8}, {'a': 9, 'b': 12}, {'a': 12, 'b': 16}, {'a': 15, 'b': 20}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 4}, {'a': 4, 'b': 8}, {'a': 6, 'b': 12}, {'a': 8, 'b': 16}, {'a': 10, 'b': 20}])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['correction-quantity-replacement'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A correction quantity is added to the original award instead of replacing it.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision correction-quantity-replacement: For correction quantity replacement, apply the stipulated decision {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if a not in x["notice_ack_version"]]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['correction-notice-edition'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>=x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a'], ['a'], ['a'], ['a'], ['a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['correction-notice-edition'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Acknowledging the original award suppresses a later correction notice or re-emits the acknowledged correction.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision correction-notice-edition: For correction notice edition, apply the stipulated decision [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"]
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['owner-redaction'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = [] if not x["disclose_owner"] else x["owners"]
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x'], ['x', 'y', 'x']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [[None, None, None], [None, None, None], [None, None, None], [None, None, None], [None, None, None]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['owner-redaction'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Owner redaction leaks identity or destroys award-row alignment.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision owner-redaction: For owner redaction, apply the stipulated decision x["owners"] if x["disclose_owner"] else [None]*len(x["owners"]).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = x["ids"]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b']]), ('all final / first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b']]), ('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['edition-revision-cutoff'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v==x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b']]), ('all final / first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b'], ['a', 'b']]), ('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['edition-revision-cutoff'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A historic result edition includes later corrections or drops unchanged awards.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision edition-revision-cutoff: For edition revision cutoff, apply the stipulated decision [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = x["ids"]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all final / all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['lot-publication-scope'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l==x["eligible_lots"][0]] if x["eligible_lots"] else []
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all final / all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['lot-publication-scope'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Result export ignores the approved multi-lot publication scope.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision lot-publication-scope: For lot publication scope, apply the stipulated decision [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]].

split: open-access