fix(export): apply the sequence block that a failed replacement skipped; regenerate

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZZENdTLzNGsbNy4DyF1yt
This commit is contained in:
StellarCrow
2026-09-19 00:00:50 +02:00
co-authored by Claude Fable 5.1
parent 2dafc871e0
commit aab11b82cd
3 changed files with 23 additions and 4 deletions
+23 -4
View File
@@ -138,13 +138,32 @@ def main():
tags = build_signature(r, r.get("scenario")) if build_signature else [ tags = build_signature(r, r.get("scenario")) if build_signature else [
{"scenario": r.get("scenario"), "status": "confirmed"}] {"scenario": r.get("scenario"), "status": "confirmed"}]
tagmap = {t["scenario"]: t["status"] for t in tags} tagmap = {t["scenario"]: t["status"] for t in tags}
scen_vals = [(1 if tagmap.get(n) == "confirmed" else ("p" if tagmap.get(n) == "proposed" else None)) for n in SCEN] sq = seqs.get(str(cid))
seq_text = " > ".join([t["scenario"] for t in tags if t["status"] == "confirmed"] if sq:
+ [t["scenario"] + " (p)" for t in tags if t["status"] == "proposed"]) assigned = set(sq["sequence"])
scen_vals = []
for n in SCEN:
if n in assigned:
scen_vals.append(1)
elif n == r.get("scenario") and not sq["v1_label_supported"]:
scen_vals.append("1?")
else:
scen_vals.append(None)
seq_text = " > ".join(sq["sequence"]) or "(none of the eleven labels fits)"
notes = sq["rationale"]
if sq["attempted"]:
notes += " Attempted: " + ", ".join(sq["attempted"]) + "."
if sq["gaps"]:
notes += " GAP: " + "; ".join(sq["gaps"]) + "."
else:
scen_vals = [(1 if tagmap.get(n) == "confirmed" else ("p" if tagmap.get(n) == "proposed" else None)) for n in SCEN]
seq_text = " > ".join([t["scenario"] for t in tags if t["status"] == "confirmed"]
+ [t["scenario"] + " (p)" for t in tags if t["status"] == "proposed"])
notes = None
dossier = next((f.name for f in (BASE / "sources").glob(f"{cid:03d}_*.txt")), None) dossier = next((f.name for f in (BASE / "sources").glob(f"{cid:03d}_*.txt")), None)
d = det.get(cid) d = det.get(cid)
ddec = (f"{d.get('current')} -> {d.get('proposed')} [{d.get('confidence')}] {d.get('status', 'open')}" if d else None) ddec = (f"{d.get('current')} -> {d.get('proposed')} [{d.get('confidence')}] {d.get('status', 'open')}" if d else None)
row = [r.get(k) for k in base_cols] + scen_vals + [seq_text] + [r.get(k) for k in FLAGS] + \ row = [r.get(k) for k in base_cols] + scen_vals + [seq_text, notes] + [r.get(k) for k in FLAGS] + \
[dossier, n_src, chars, untr, sstat, len(r.get("summary") or ""), ddec] [dossier, n_src, chars, untr, sstat, len(r.get("summary") or ""), ddec]
# rule-derived proposals for the new columns # rule-derived proposals for the new columns
venue = held = outcome = None venue = held = outcome = None