"""The challenge, scored. Each candidate read in its seat against the nine members fixed under seal (../rev/rev_rows_sealed.py,
2026-12-01T01:57:18Z), 1 or 0, with the words that carry each 1. Written after reading. Writes challenge.json."""
import json
FEAT = ["F1 company", "F2 evening/feast", "F3 bread and wine", "F4 presider blesses first", "F5 messianic figure", "F6 the hand",
        "F7 seats by rank", "F8 the end", "F9 the many/covenant"]
A = {  # antecedents
 "1QS VI 2-9 with 1QSa II 11-22 (the source)": {
   "F1": "ten men (1QS VI 3; 1QSa II 22); the congregation", "F3": "הלחם והתירוש", "F4": "the priest blesses the first of the bread",
   "F5": "משיח ישראל at the table (1QSa II 20)", "F6": "let no one stretch out his hand before the priest (II 18; restored)",
   "F7": "each by his rank; according to his glory", "F8": "in the last days (1QSa I 1)", "F9": "הרבים, the session of the Many (1QS VI 8)"},
 "Josephus, War 2.128-133 (the Essenes at table)": {
   "F1": "only the members; no outsider may enter (2.129)", "F2": "they dine again on returning in the evening (2.131-132)",
   "F4": "the priest prays before the food (προκατεύχεται ὁ ἱερεύς)", "F6": "unlawful to taste before the prayer (ἀθέμιτον)"},
 "Philo, De vita contemplativa 64-89 (the Therapeutae)": {
   "F1": "the company (σύστημα)", "F2": "the feast after seven sevens; the all-night vigil (παννυχίς)",
   "F7": "they recline in the order of admission (ταῖς εἰσκρίσεσιν; ἐν τάξεσι)"},
 "Genesis 14:18-20 (Melchizedek)": {
   "F3": "ἄρτους καὶ οἶνον", "F4": "the priest of the Most High blesses (ηὐλόγησεν)",
   "F5": "king and priest in one person (βασιλεὺς Σαλήμ … ἱερεύς); a figure of the end in 11Q13"},
 "Revelation 3:20-21": {"F5": "the speaker himself", "F7": "to sit with me on my throne", "F8": "to the one who conquers"},
 "Revelation 19:7-9": {"F5": "the Lamb", "F8": "the marriage supper of the Lamb"},
 "Exodus 12 (the Passover)": {"F1": "the whole congregation (πᾶσα συναγωγή), counted by souls (12:3-4)", "F2": "at evening; that night"},
 "Exodus 24:1-11": {"F1": "Moses, Aaron, Nadab, Abihu, seventy elders", "F9": "the blood of the covenant (24:8)"},
 "Joseph and Aseneth 8 (Latin, as seated)": {"F3": "panem benedictum vite … calicem benedictum incorruptionis", "F8": "the rest prepared for your elect; for ever"},
}
T = {  # tellings of the supper itself: the target, scored apart
 "Matthew 26:17-30": {"F1": "with the twelve", "F2": "evening; the Passover", "F3": "bread; cup; fruit of the vine", "F4": "taking bread, he blessed",
   "F5": "the Christ", "F6": "the one who dipped his hand with me (τὴν χεῖρα)", "F8": "drink it new in my Father's kingdom", "F9": "covenant; for many"},
 "Mark 14:17-26": {"F1": "with the twelve", "F2": "evening; the Passover", "F3": "bread; cup; fruit of the vine", "F4": "blessed", "F5": "the Christ",
   "F8": "drink it new in the kingdom of God", "F9": "covenant; for many"},
 "Luke 22:14-30": {"F1": "the apostles; the twelve tribes (22:30)", "F2": "the hour; the Passover", "F3": "bread; cup; fruit of the vine",
   "F4": "gave thanks (the cup first, then the bread)", "F5": "the Christ", "F6": "the hand of the one who hands me over is with me on the table (22:21)",
   "F7": "who is the greatest (22:24-27); thrones (22:30)", "F8": "until the kingdom of God comes; eat and drink at my table in my kingdom",
   "F9": "the new covenant in my blood"},
 "1 Corinthians 11:20-26": {"F1": "the assembly (ἐκκλησία)", "F2": "the night in which he was handed over", "F3": "bread; cup",
   "F4": "having given thanks", "F5": "the Lord", "F6": "each goes ahead with his own supper (προλαμβάνει); wait for one another (11:33)",
   "F8": "until he comes", "F9": "the new covenant"},
}
def tab(D): return {k: {"score": len(v), "of": 9, "members": v} for k, v in D.items()}
out = {"features": FEAT, "antecedents": tab(A), "tellings": tab(T),
       "finder": "search.json: 201 windows of the seated Septuagint, Philo and Josephus have bread with wine or a cup and a blessing; read, none carries more than Genesis 14 (three)",
       "P6": max(len(v) for k, v in A.items() if not k.startswith("1QS")) <= 5 and len(A["1QS VI 2-9 with 1QSa II 11-22 (the source)"]) == max(len(v) for v in A.values())}
json.dump(out, open("challenge.json", "w"), ensure_ascii=False, indent=1)
for k, v in A.items(): print(len(v), k)
print("--"); [print(len(v), k) for k, v in T.items()]; print("P6", out["P6"])
