Archived
feat(scenarios): scenario sequences assigned by reading for the 70 verified cases
scenario-sequences.json: for each of the 70 fact-checked summaries, the ordered set of the eleven labels the summary supports, with a rationale, the pattern that was attempted where the attack was foiled, and the coverage gaps met. 35 cases carry two scenarios, 6 three, 1 none (an empty-premises burglary). Three site labels are not supported by their own summary (222, 231, 349). Export: assigned scenarios show green in the S: columns with the sequence and notes on the row; engine proposals stay blue for the unassigned cases. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZZENdTLzNGsbNy4DyF1yt
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
a2e7290400
commit
2dafc871e0
@@ -33,12 +33,14 @@ STORE = BASE / "sourced-articles.json"
|
||||
OVERRIDES = BASE / "summary-overrides.json"
|
||||
MANIFEST = BASE / "case-files-manifest.json"
|
||||
DETENTION = BASE / "detention-flag-corrections.json"
|
||||
SEQUENCES = BASE / "scenario-sequences.json"
|
||||
SITE = Path.home() / "Documents/Claude/GART/05-strategy-marketing-sales/Marketing/gart-io/stats-gart-io-v3"
|
||||
|
||||
RED = PatternFill("solid", fgColor="F4B6B6")
|
||||
ORANGE = PatternFill("solid", fgColor="F9D5A7")
|
||||
YELLOW = PatternFill("solid", fgColor="FFF2A8")
|
||||
BLUE = PatternFill("solid", fgColor="BDD7EE")
|
||||
GREEN = PatternFill("solid", fgColor="C6E0B4")
|
||||
HEAD = PatternFill("solid", fgColor="D9D9D9")
|
||||
|
||||
FLAGS = ["kidnappings", "violence_torture", "drugs_alcohol", "weapons", "theft", "life_taken"]
|
||||
@@ -96,6 +98,7 @@ def main():
|
||||
if DETENTION.exists():
|
||||
for c in json.loads(DETENTION.read_text(encoding="utf-8")):
|
||||
det[int(c["target"].split()[-1])] = c
|
||||
seqs = json.loads(SEQUENCES.read_text(encoding="utf-8")) if SEQUENCES.exists() else {}
|
||||
sys.path.insert(0, str(SITE))
|
||||
try:
|
||||
from scenario_signature import build_signature
|
||||
@@ -113,7 +116,7 @@ def main():
|
||||
"detention_decision"]
|
||||
new_cols = ["venue_of_control", "held_duration", "outcome", "arrests", "amount_demanded_usd", "amount_taken_usd"]
|
||||
SCEN = VOCAB["scenario (11 labels)"]
|
||||
scen_cols = ["S: " + n for n in SCEN] + ["scenarios_in_order"]
|
||||
scen_cols = ["S: " + n for n in SCEN] + ["scenarios_in_order", "scenario_notes"]
|
||||
cols = base_cols + scen_cols + FLAGS + cov_cols + new_cols + ["summary_db", "summary_revised"]
|
||||
LABEL = {"kidnappings": "detention"} # the DB column keeps its old name; the export shows the glossary name
|
||||
ws.append([LABEL.get(c, c) for c in cols])
|
||||
@@ -167,11 +170,19 @@ def main():
|
||||
if k.startswith("S: "):
|
||||
if v == "p":
|
||||
cell.fill = BLUE
|
||||
elif v == "1?":
|
||||
cell.fill = YELLOW
|
||||
elif v == 1 and sq:
|
||||
cell.fill = GREEN
|
||||
elif v is None and r.get("scenario") not in SCEN:
|
||||
cell.fill = RED
|
||||
continue
|
||||
if k == "scenarios_in_order":
|
||||
cell.fill = ORANGE if "(p)" in (v or "") or len(tags) == 1 else None
|
||||
cell.fill = GREEN if sq else ORANGE
|
||||
continue
|
||||
if k == "scenario_notes":
|
||||
if sq and (sq["gaps"] or not sq["v1_label_supported"]):
|
||||
cell.fill = YELLOW
|
||||
continue
|
||||
if k in FLAGS and v is None:
|
||||
cell.fill = RED
|
||||
@@ -201,7 +212,7 @@ def main():
|
||||
cell.fill = BLUE if v not in (None, "") else ORANGE
|
||||
ws.freeze_panes = "B2"
|
||||
for j, k in enumerate(cols, 1):
|
||||
ws.column_dimensions[get_column_letter(j)].width = 60 if k in ("summary_db", "summary_revised", "description", "scenarios_in_order") else (
|
||||
ws.column_dimensions[get_column_letter(j)].width = 60 if k in ("summary_db", "summary_revised", "description", "scenarios_in_order", "scenario_notes") else (
|
||||
28 if k in ("victim", "location", "money_wanted", "url") else (8 if k.startswith("S: ") else 14))
|
||||
ws.auto_filter.ref = ws.dimensions
|
||||
|
||||
@@ -272,6 +283,7 @@ def main():
|
||||
"detention flag with an accepted or proposed change (shown as old -> new)"),
|
||||
("blue", BLUE, "filled by a rule from existing data (venue from scenario, held from the flag, outcome from Dodged/life_taken, "
|
||||
"USD parsed from money_wanted, scenario tags proposed by the site's keyword engine): a proposal, not verified"),
|
||||
("green", GREEN, "scenario assigned by reading the verified summary (scenario-sequences.json); 1? in yellow = the site's label is not supported by the summary"),
|
||||
("none", None, "present and verified")]
|
||||
ws5.append(["note", "column 'detention' on the attacks sheet is the DB field 'kidnappings' (the detention violence category, see DEFINITIONS.md)"])
|
||||
ws5.append(["colour", "meaning"])
|
||||
|
||||
Reference in New Issue
Block a user