---
type: "Source File"
title: "\"\"\"Score all unscored policies using inline analysis."
description: "\"\"\"Score all unscored policies using inline analysis. Run with: python3 score_all.py Reads scores from scores.json (generated externally).\"\"\" import sys, os, json sys.path.insert(0, os.path.dirname(__file__)) import db."
resource: "https://policy.copecheck.com"
tags: ["copecheck", "policy", "source-file", "py"]
timestamp: "2026-04-30T09:43:02Z"
site: "policy"
source_path: "copecheck-policy/score_all.py"
---

# """Score all unscored policies using inline analysis.

Source path: `copecheck-policy/score_all.py`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-04-30T09:43:02Z`

```py
"""Score all unscored policies using inline analysis.
Run with: python3 score_all.py
Reads scores from scores.json (generated externally)."""
import sys, os, json
sys.path.insert(0, os.path.dirname(__file__))
import db

def main():
    scores_file = os.path.join(os.path.dirname(__file__), "scores.json")
    if not os.path.exists(scores_file):
        print("No scores.json found. Generate it first.")
        return

    with open(scores_file) as f:
        all_scores = json.load(f)

    for slug, scores in all_scores.items():
        db.set_policy_scores(slug, scores)
        print(f"  ✓ {slug}: {scores.get('overall_cope_score', '?')}/100 — {scores.get('verdict', '?')}")

    print(f"\nDone! Scored {len(all_scores)} policies.")
    survivors = db.get_surviving_policies()
    print(f"Survivors: {len(survivors)}")
    for s in survivors:
        print(f"  ★ {s['name']} — {s['overall_cope_score']:.0f}/100")

if __name__ == "__main__":
    main()
```
