feat: compact durable logs and refine framework routing

This commit is contained in:
CoolBoy
2026-09-04 10:30:21 +08:00
parent 5b1ec4d3eb
commit ff73768537
13 changed files with 621 additions and 44 deletions

View File

@@ -22,7 +22,7 @@ DEFAULT_FRAMEWORK_MIN_SAMPLES = 300
DEFAULT_GPU_MIN_RECENT_TERMINALS = 20
DEFAULT_FRAMEWORK_MIN_WILSON = 0.05
DEFAULT_COMMUNITY_WINDOW_DAYS = 30
DEFAULT_COMMUNITY_MAX_MODELS = 2000
DEFAULT_COMMUNITY_MAX_MODELS = 200
DEFAULT_COMMUNITY_HYDRATE_PER_REFRESH = 50
NEW_FRAMEWORK_PROMOTION_MARGIN = 1.10
ERROR_RETRY_SECONDS = 300
@@ -248,6 +248,16 @@ class MarketIntelligenceManager:
else:
state = self._base_state(gpus, tasks, now)
community_sample = state.get("communitySample") or {}
if isinstance(community_sample, dict) and len(community_sample) > DEFAULT_COMMUNITY_MAX_MODELS:
cutoff = now - timedelta(days=DEFAULT_COMMUNITY_WINDOW_DAYS)
ordered = sorted(
community_sample.items(),
key=lambda item: parse_datetime((item[1] or {}).get("updateTime")) or cutoff,
reverse=True,
)
state["communitySample"] = dict(ordered[:DEFAULT_COMMUNITY_MAX_MODELS])
queue_due = not _fresh(
state.get("queueUpdatedAt"),
now=now,