fix(insta-lab): 선별 zero-pref 크래시 가드 + judge max_tokens 상향 + 404 테스트

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-11 02:31:18 +09:00
parent 7d1857c8a4
commit 83398c8413
4 changed files with 16 additions and 1 deletions

View File

@@ -40,3 +40,8 @@ def test_decision_invalid_400(client):
sid = db.add_card_slate({"keyword": "x", "category": "economy"})
r = client.post(f"/api/insta/slates/{sid}/decision", json={"decision": "maybe"})
assert r.status_code == 400
def test_decision_unknown_slate_404(client):
r = client.post("/api/insta/slates/99999/decision", json={"decision": "approved"})
assert r.status_code == 404

View File

@@ -45,3 +45,11 @@ def test_claude_included_when_provided():
cands = [_cand(1, "A", "economy", 0.5, NOW)]
out = score_candidates(cands, [], {"economy": 1.0}, {1: 1.0}, threshold=0.0, now_iso=NOW)
assert out[0]["breakdown"]["claude"] == 1.0
def test_all_zero_prefs_no_crash():
cands = [{"id": 1, "keyword": "A", "category": "economy", "score": 0.8,
"suggested_at": "2026-06-11T00:00:00Z"}]
prefs = {"economy": 0.0, "psychology": 0.0}
out = score_candidates(cands, [], prefs, None, threshold=0.0, now_iso="2026-06-11T00:00:00Z")
assert out[0]["breakdown"]["account_fit"] == 0.0 # 0가중 → fit 0, 크래시 없음