feat(yoga): her 35 source evaluators and 131 upstream-only rule changes, with her card fields and blocked rows; the chart page reads card_status (BUG-2301)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
This commit is contained in:
@@ -204,6 +204,12 @@ BATCH = [
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description='Historical batch, draft output only; not a runtime migration.')
|
||||
parser.add_argument('--output', required=True)
|
||||
output = Path(parser.parse_args().output).resolve()
|
||||
if output == RULES.resolve():
|
||||
parser.error('Refusing to overwrite active Yoga rules with a historical batch')
|
||||
data = json.loads(RULES.read_text(encoding="utf-8"))
|
||||
existing = {r["id"] for r in data["rules"]}
|
||||
existing_names = {(r.get("name"), r.get("dedup_key")) for r in data["rules"]}
|
||||
@@ -218,7 +224,9 @@ def main():
|
||||
added.append(item["id"])
|
||||
|
||||
data["total_rules"] = len(data["rules"])
|
||||
RULES.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
data['runtime_enabled'] = False
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
output.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8", newline="\n")
|
||||
|
||||
print(f"added={len(added)} skipped={len(skipped)} total={len(data['rules'])}")
|
||||
print("added ids:")
|
||||
|
||||
@@ -326,10 +326,13 @@ def report_yoga_table(packet):
|
||||
# BUG-2089: the other rule names that hit this same fact, each with its own engine row (effects).
|
||||
others = [{**(engine_row(other) or {}), **other} for other in same_fact.get(index, [])]
|
||||
display = {**(old_row or {}), **row}
|
||||
if not display.get("combination"):
|
||||
if not display.get("combination") and row.get("condition") != "not_available_yet":
|
||||
display["combination"] = row.get("condition")
|
||||
if old_row is None:
|
||||
condition = _text(row.get("condition"))
|
||||
# BUG-2301: `not_available_yet` is the layer's status key for a missing condition, not text.
|
||||
if condition == "not_available_yet":
|
||||
condition = ""
|
||||
if condition and not HAN.search(condition):
|
||||
display["combination_en"] = condition
|
||||
elif condition:
|
||||
|
||||
+1658
-30
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user