import json, sys
for row in json.load(open(sys.argv[1], encoding="utf-8")):
    is_n0 = row.get("currentRating") == 0
    proof = all(row.get(k) for k in
        ("mitigationTestRef", "dependencyReviewRef", "reopenCondition"))
    print(json.dumps({"id": row.get("id"), "isN0": is_n0,
        "needsReview": is_n0 and not proof}))
