INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.2.11',
    '2026-07-07T00:00:00+08:00',
    '新增上下文组装模拟器页面',
    '新增 /context 页面，可查询指定 scope 下的会话、消息、长期记忆、摘要和工具，便于分析排错。',
    '[
        "新增上下文组装模拟器页面（/context），支持按 scope（channel + account_id + from_user_id）查询。",
        "页面展示：活跃会话详情及消息列表、组装后的系统上下文预览、历史会话表、长期记忆、会话摘要（上次会话/近一周）和可用工具列表。",
        "导航栏新增「上下文」入口链接。",
        "ias-service 新增 context_simulator 和 context_simulator_data 模块，升级至 0.1.8。",
        "ias-http 更新 shell.rs 和 base.html 导航栏，升级至 0.1.6。",
        "无数据库结构变化。"
    ]'::jsonb,
    '{
        "ias-common": "0.1.0",
        "ias-ai": "0.1.2",
        "ias-wechat": "0.1.0",
        "ias-context": "0.1.1",
        "ias-http": "0.1.6",
        "ias-mail": "0.1.14",
        "ias-service": "0.1.8",
        "ias-main": "0.2.11"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
