feat: 拆分 wecom_shown_keys 与 movement_baseline 历史层
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,24 @@ def wecom_skill_desc_limit() -> int:
|
||||
return env_int("DAILY_WECOM_SKILL_DESC_LIMIT", 56)
|
||||
|
||||
|
||||
def wecom_news_desc_limit() -> int:
|
||||
"""企微新闻摘要建议字数;在句读/词边界截断,不加省略号。"""
|
||||
return max(24, env_int("DAILY_WECOM_NEWS_DESC_LIMIT", 72))
|
||||
|
||||
|
||||
def wecom_ai_news_tech_limit() -> int:
|
||||
"""research 模式下技术类时讯条数(叠加在 DAILY_WECOM_AI_NEWS 之上)。"""
|
||||
return max(0, env_int("DAILY_WECOM_AI_NEWS_TECH", 5))
|
||||
|
||||
|
||||
def wecom_pad_pool_size(display_limit: int) -> int:
|
||||
"""Delta 补榜候选池大小(展示条数之上多取,避免去重后凑不满)。"""
|
||||
explicit = env_int("DAILY_WECOM_PAD_POOL", -1)
|
||||
if explicit > 0:
|
||||
return explicit
|
||||
return max(display_limit * 5, 50)
|
||||
|
||||
|
||||
def full_desc_limit() -> int:
|
||||
"""完整版早报摘要长度;0 表示不截断。"""
|
||||
return env_int("DAILY_FULL_DESC_LIMIT", 0)
|
||||
@@ -99,5 +117,53 @@ def delta_baseline_fallback() -> str:
|
||||
return raw if raw in {"full", "empty"} else "full"
|
||||
|
||||
|
||||
def wecom_delta_pad() -> bool:
|
||||
"""Delta 模式下新入榜优先,不足时用当日 Top 榜补满;补榜排除近 N 天 baseline 已出现条目。"""
|
||||
return env_bool("DAILY_WECOM_DELTA_PAD", True)
|
||||
|
||||
|
||||
def delta_pad_lookback_days() -> int:
|
||||
"""补榜时排除近 N 天 baseline 已出现过的条目(默认与异动对比窗口一致)。"""
|
||||
fallback = env_int("DAILY_DELTA_LOOKBACK_DAYS", 7)
|
||||
return max(1, env_int("DAILY_DELTA_PAD_LOOKBACK_DAYS", fallback))
|
||||
|
||||
|
||||
def force_push() -> bool:
|
||||
return env_bool("DAILY_FORCE_PUSH", False)
|
||||
|
||||
|
||||
def schedule_timezone_name() -> str:
|
||||
return (env("DAILY_SCHEDULE_TZ") or "Asia/Shanghai").strip() or "Asia/Shanghai"
|
||||
|
||||
|
||||
def schedule_generate_at() -> str:
|
||||
return (env("DAILY_SCHEDULE_GENERATE_AT") or "08:50").strip() or "08:50"
|
||||
|
||||
|
||||
def schedule_push_at() -> str:
|
||||
return (env("DAILY_SCHEDULE_PUSH_AT") or "09:00").strip() or "09:00"
|
||||
|
||||
|
||||
def board_dedup_days() -> int:
|
||||
return max(1, env_int("DAILY_BOARD_DEDUP_DAYS", 7))
|
||||
|
||||
|
||||
def board_pool_size() -> int:
|
||||
fallback = env_int("DAILY_WECOM_SKILL_POOL", 50)
|
||||
return max(1, env_int("DAILY_BOARD_POOL_SIZE", max(50, fallback)))
|
||||
|
||||
|
||||
def featured_dedup_days() -> int:
|
||||
return max(1, env_int("DAILY_FEATURED_DEDUP_DAYS", 30))
|
||||
|
||||
|
||||
def theme_ban_days() -> int:
|
||||
return max(1, env_int("DAILY_THEME_BAN_DAYS", 7))
|
||||
|
||||
|
||||
def narrative_axis_days() -> int:
|
||||
return max(1, env_int("DAILY_NARRATIVE_AXIS_DAYS", 3))
|
||||
|
||||
|
||||
def news_backfill_enabled() -> bool:
|
||||
return env_bool("DAILY_NEWS_BACKFILL", False)
|
||||
|
||||
Reference in New Issue
Block a user