R15: Fix D04/D06/D07 partial completion

D04: Add fish name-based fallback in _auto_publish (was external_id only)
D06: Cap confidence at 50% for 1 player, 65% for 2 players
D07: Set caught_at=None for community imports (not published_at)
D08: Already OK - activity_rows has no top-100 limit

- Add Fish import to community_importer.py
- Add 2 unit tests for D06 confidence caps
- Update test_community_importer.py for D04 name match behavior
This commit is contained in:
ik
2026-09-10 05:51:50 +07:00
parent e2bed0db89
commit f550639456
5 changed files with 79 additions and 10 deletions
+5
View File
@@ -56,6 +56,11 @@ def activity_rows(
activity = round(55 * min(1, weighted / 12) + 25 * min(1, len(players) / 6) + 20 * min(1, trophies / 3))
average_confidence = sum(r.source_confidence for r in items) / len(items)
confidence = round(45 * min(1, len(items) / 10) + 35 * min(1, len(players) / 5) + 20 * average_confidence / 100)
# Cap confidence: 1 player → max 50%, 2 players → max 65%
if len(players) == 1:
confidence = min(confidence, 50)
elif len(players) == 2:
confidence = min(confidence, 65)
latest = max(_aware(r.reported_at) for r in items)
baits = Counter(r.bait.name for r in items if r.bait)
freshness_text = _freshness_text(now - latest)