zl-q
14f99d6dc4
fix: update CREEM product IDs for production environment
2026-05-11 19:39:38 +08:00
zl-q
f07e307e82
feat: integrate CREEM web payment for credits purchase
...
Replace abandoned iOS App Store route with CREEM Merchant of Record
payment integration for web-based credits purchase.
Backend changes:
- Add CreemClient for CREEM API communication
- Add CreemService for checkout creation and webhook handling
- Add creem_transactions table for payment tracking
- Fix webhook payload parsing (id, order.id, customer.id structure)
- Integrate with existing points ledger system
Frontend changes:
- Display dynamic prices from CREEM API
- Support decimal price formatting (e.g., $1.00)
- Add checkout flow with redirect to CREEM hosted page
2026-05-11 18:38:21 +08:00
qzl
6432c24e20
fix(security): disable Swagger in prod, remove dead debug field, harden env config
2026-04-30 11:47:48 +08:00
qzl
98f4a8d07a
fix: update production app configuration
2026-04-30 11:07:57 +08:00
ZL-Q
203cdd9330
fix(deploy): reduce backend worker footprint
2026-04-29 21:28:21 +08:00
qzl
16cb47e75a
feat: 新增追问模式和iOS本地化,重构后端输出模型
2026-04-29 14:26:15 +08:00
ZL-Q
f497afbff2
feat: 实现AI拒答机制和语言控制优化
...
- 添加 RunStatus.REFUSED 状态,AI可明确表达拒答意图
- 优化 System Prompt 使用视觉强调提高AI对拒答规则的遵守
- User Prompt 添加 SCOPE CHECK 和语言约束
- Worker Rules 添加多语言版本角色扮演规则
- Runner 传递 language 参数到 worker stage
- json_finalize 添加语言约束参数
- 更新单元测试匹配新的 prompt 结构
2026-04-29 01:38:59 +08:00
ZL-Q
adb2b3bcc3
chore: 整合 migration 文件并优化配置
...
- 整合 18 个分散的 migration 文件为 5 个模块化文件
- settings.py 支持 .env.local 覆盖 .env
- 移除 user schema 中未使用的 country 字段正则
- 更新 profile protocol 文档移除 country 字段
- pyproject.toml 添加 ruff 到 dev 依赖
- 简化 integration test conftest 邮箱 fixture
2026-04-29 00:37:45 +08:00
qzl
dab47f0cb3
chore: 优化本地开发环境配置
...
- 添加 .env.local 支持,app.sh 和 dev-migrate.sh 自动覆盖
- Docker Compose 使用 profiles 区分 dev/prod 环境
- 改进认证 dev session 判断逻辑,使用 test account 配置
- 修复 CoinPackageCard 重复代码问题
- 清理 opencode 配置,移除敏感信息
- 新增 infra/docker/README.md 文档
- 修复 ruff/pyright/flutter lint 错误
- 更新测试用例移除已删除的 country 字段
2026-04-28 18:49:38 +08:00
ZL-Q
86062d5e78
fix: 修复 packages 接口访问不存在字段导致的运行时错误
...
- 移除 router 中对 result.region、result.currency、pkg.price 的访问
- 修正 pkg.type.value 为 pkg.type (type 是 Literal 不是 Enum)
- 更新协议文档以反映实际实现
- 新增 Apple IAP 协议文档
- 标记未使用的错误码为 RESERVED
2026-04-28 17:31:24 +08:00
ZL-Q
295dbc09ab
feat(payment): 优化套餐配置和支付服务
...
- 简化套餐配置结构,删除冗余的 default.yaml 和 us.yaml
- 优化 Apple IAP 服务和验证逻辑
- 更新套餐数据模型和协议文档
- 添加支付相关测试用例
2026-04-28 17:21:14 +08:00
ZL-Q
a940f2ea47
feat(notification): 通知标题和正文支持多语言
...
- 通知静态配置支持 title/body i18n
- 前端通知列表和详情页展示本地化内容
- 新增数据库迁移脚本
- 更新通知协议文档
2026-04-28 17:20:17 +08:00
ZL-Q
b9617ae152
refactor(settings): 统一语言设置,合并 interface_language 和 ai_language
...
- 后端 Schema 将 interface_language 和 ai_language 合并为 language
- 前端设置界面只保留一个语言选项
- AI 回复语言统一使用 language 设置
- 更新协议文档
- 新增数据库迁移脚本
2026-04-28 17:19:47 +08:00
ZL-Q
940c67e642
feat(points): 实现积分流水列表功能
...
- 后端新增 GET /api/v1/points/ledger 接口
- 前端新增积分流水列表页面
- 积分中心添加「查看流水」入口
- 重命名 AccountDeleteScreen 为 AccountDataScreen
- 流水列表支持分页加载和空状态展示
2026-04-28 17:19:08 +08:00
ZL-Q
a83001de0d
feat(locale): 实现 App 启动时语言和时区自动设置
...
- 新增系统语言/时区读取工具函数
- SessionStore 扩展支持时区存储
- 启动流程自动检测并保存系统语言/时区
- 注册时传递语言/时区到后端
- 登录后从服务器同步语言/时区
2026-04-28 17:18:16 +08:00
ZL-Q
87f92987b2
feat: 实现 iOS Apple Pay 内购支付功能
...
前端:
- 集成 in_app_purchase 插件,实现 IAP 支付流程
- 添加支付模块 (payments/) 处理产品获取、购买、验证
- 积分中心页面集成 Apple Pay 购买入口
- 设置页面重构: 关于/隐私/协议直接展示,删除 legal_center 子页面
- 修复欢迎引导页滚动检测阈值问题
- 修复解卦结果页 iOS 侧滑返回手势被阻止的问题
- 邀请码绑定按钮临时禁用(待后端实现)
后端:
- 新增 apple_iap_transactions 表记录交易
- 实现 Apple 服务器端验证 (App Store Server API)
- 支付成功后自动发放积分
- 支持 Sandbox/Production 环境切换
- 添加退款处理和交易状态机
协议:
- 更新积分流水协议,支持 purchase/refund 类型
- 新增 PAYMENT_* 错误码
2026-04-28 10:45:29 +08:00
qzl
285bb91851
feat: enable local supabase and update llm catalog
...
- Enable supabase in docker-compose.yml for local development
- Update llm_catalog.yaml with deepseek-v4-flash configuration
2026-04-27 11:00:13 +08:00
qzl
5325793203
fix: correct tests and type annotations for cloud supabase migration
2026-04-25 15:53:44 +08:00
qzl
6a2a9d2c87
feat(feedback): implement user feedback collection system with email reporting
...
Backend:
- Add user_feedback table with RLS policy
- Create feedback submission API (multipart/form-data)
- Implement xlsx report generation with embedded images
- Add scheduled email delivery via Feishu SMTP
- Create HTML email templates (daily_report, no_feedback)
Frontend:
- Add feedback screen with type selection and image picker
- Support anonymous submission via skipAuth flag
- Collect device info and app version
Protocol:
- Document feedback API contract and error codes
- Update http-error-codes.md with FEEDBACK_* codes
2026-04-20 12:49:54 +08:00
qzl
913ed26f8d
feat(privacy): add personalized ads toggle in settings
...
- Add PrivacySettings schema with can_sell field (default: false)
- Move privacy toggle to GeneralSettingsScreen with clear labeling
- Update l10n for zh/en/zh_hant with user-friendly copy
- Clean up redundant PrivacyNotificationSettingsScreen
- Update profile-protocol.md to reflect new privacy schema
- Fix basedpyright warnings in user.py
2026-04-17 13:11:09 +08:00
qzl
c79c773d67
feat(notification): add target_mode enum constraint and merge register-notifications script
...
- Add NotificationTargetMode enum (new_users/exist_users/all_users/user_ids)
- Create Alembic migrations: drop duplicate indexes, add target_mode column
- Merge register-notifications.sh into dev-migrate.sh sync-notifications subcommand
- Shorten notification config path: static/notification/notifications -> static/notifications
- Update registration flow to dispatch notifications by target_mode
- Add is_first_registration to RegisterBonusResult for first-time user detection
- Remove dead code: link_published_notifications_to_user
- Update welcome_points.yaml to target new_users only
- Add 44 unit tests + 1 integration test, all passing
2026-04-16 17:50:57 +08:00
qzl
ff40ff9dd8
feat: 新人初始礼包购买追踪功能
...
- 数据库:添加 has_purchased_starter_pack 字段到 register_bonus_claims
- 后端:创建静态配置管理套餐信息,支持按国家/地区区分
- 后端:新增 GET /api/v1/points/packages API 返回可用套餐
- 后端:创建 utils/paths.py 统一路径管理
- 前端:动态获取套餐信息,移除硬编码
- 前端:添加 ProductCode 枚举约束,前后端类型安全
- 配置:Profile 默认国家改为 US(ISO 3166-1 alpha-2)
- 文档:更新协议文档说明新 API 和字段
2026-04-16 16:11:09 +08:00
qzl
443c0c80ae
fix: 修复后端代码违规并更新协议文档
...
- 修复 notifications 模块 datetime.now() 缺少时区问题
- 用 ApiProblemError 替换 BaseService 中的 HTTPException
- 更新协议文档:添加错误码、繁体字段、邀请相关协议
- 升级 Docker 镜像版本
2026-04-16 10:51:08 +08:00
qzl
69b34bd723
feat: 添加起卦教程首次访问追踪和Agent时间上下文
...
- 后端 ProfileSettingsV1 添加 DivinationTutorialSettings 字段
- 前端三个起卦页面添加首次访问检测,自动弹出教程
- 教程展示后更新 settings 标记,避免重复弹出
- 使用本地状态管理避免并发更新覆盖问题
- Agent 系统提示添加时间上下文信息
2026-04-15 18:56:41 +08:00
qzl
c2b726e7bd
feat(agent): session deletion anonymization for iOS compliance
...
Replace soft-delete with anonymize + hard-delete to meet iOS App Store
data retention requirements. Non-PII fields are preserved in
anonymous_session_snapshots for analytics.
- Add anonymous_session_snapshots table and ORM model
- Implement anonymizer to extract non-PII fields before deletion
- Remove points_ledger.biz_id FK constraint (snapshot-style reference)
- Preserve transaction history while allowing session deletion
- Add 14 unit tests + 1 integration test
2026-04-15 18:18:39 +08:00
qzl
9598d162dd
feat: 六爻算法修复 + prompt架构重构 + i18n输出规则
...
算法修复 (P0/P1):
- P0-1: 空亡判断改为仅从日柱计算(年月空亡标注但不断事)
- P0-2: 暗动判断重写为静爻+旺相+日冲三条件
- P1-1: 月破独立标注
- P1-2: 动不为空、旺不为空
- P1-3: 三合局判断
- P1-4: 反吟伏吟判断
- P1-5: 日辰十二长生
- P1-6: 回头生克判断
Prompt架构重构:
- 删除system_prompt中_build_env_section,不再泄露用户上下文到prompt
- 删除if is_chinese分支,_LANGUAGE_LABELS已覆盖全部语言映射
- 安全规则改为六爻专属约束,拒绝无关问题
- sign_level枚举值在所有语言版本中统一为简体中文(schema严格约束)
- _WORKER_ROLE_PLAYING始终为中文,不因ai_language切换
- _WORKER_OUTPUT_RULES按ai_language分zh-CN/zh-Hant/en三版本
- worker_rules.py独立文件管理多语言输出规则
- runner ai_language从user_context.settings.preferences提取传入prompt
清理死代码:
- 删除UserPreferences/RuntimePromptContext及辅助函数
- 删除runner中runtime_client_time参数链路
- 删除SystemAgentRuntimeConfig.extra_context
- 删除sections.py中env section marker
- 删除agent_prompt.py中AgentPromptRegistry死代码
安全规则:
- AGENTS.md添加Git Safety规则(禁止未经批准的破坏性git操作)
- opencode.json添加高危git命令审批配置
测试:
- 新增22个六爻算法单元测试(空亡/暗动/月破/三合局等)
- 重写7个prompt测试适配新签名
- 全部85个单元测试通过
2026-04-15 16:45:57 +08:00
qzl
c74e3f688c
fix: 修复 basedpyright 类型错误和语言设置同步问题
...
runner.py: 将 user_text 解构从 tuple 第二元素改为第一元素(str),
消除 str | list[dict[str,Any]] 与 Msg.content 的类型不兼容问题。
简化了始终为 true 的 user_blocks 条件分支。
repository.py: 将 result.rowcount 的 type: ignore 替换为基于
pyright: ignore[reportAttributeAccessIssue],消除 basedpyright 错误。
app.dart: 保存 profile 时同步 _locale 和 session store 中的语言标记。
2026-04-14 12:42:35 +08:00
qzl
55bac03eb0
fix: 修复历史卦象列表无法显示及六爻解卦提示词逻辑错误
...
后端 Pydantic schema 添加 Hant 繁体字段支持(guaNameHant,
targetGuaNameHant, spiritNameHant, relationNameHant),解决
DerivedDivinationData extra=forbid 拒绝 AI 输出的繁体字段导致
agent_output 解析失败、历史记录为空的问题。
六爻解卦提示词修复:增加静卦五行生克链分析、假破假空降权、
六冲中性判断、用神核对防捏造、空亡数据对照等硬约束。
前端 Dart model 同步添加 Hant 字段(反向兼容,缺省为空字符串)。
其他:硬币翻转动画修复、弹窗单按钮居中、起卦按钮布局调整、
繁体 l10n 清理、pre-commit 排除集成测试。
2026-04-14 12:37:19 +08:00
qzl
97976b20bf
perf: recover lost files (locale_selector.dart, terminology.py, app_zh_hant.arb)
...
These files were accidentally omitted during cherry-pick workflow.
They were present in 639ef12 but dropped when switching to git apply workflow.
2026-04-14 11:49:45 +08:00
qzl
dc66afb5a8
perf: reduce LLM input tokens by ~50% via prompt deduplication
...
- Remove JSON appendix from user_prompt (saves ~3000 chars, 85% reduction)
- Consolidate identity: remove English system_prompt identity, merge into agent_prompt Chinese identity
- Simplify system_prompt output rules: keep only Language Requirement, remove Answer Rules (duplicate with agent_prompt)
- Enhance follow-up context: include more divination_derived fields (changing_yaos, fushen, wu_xing, etc.)
- Fix bug: lowerName -> lower_name in user_prompt (Pydantic snake_case)
- Update tests to reflect new prompt structure
2026-04-14 11:18:59 +08:00
qzl
1e22f27de2
feat: integrate invite API and improve notification handling
...
- Add invite code display and binding functionality via API
- Fix notification unread count sync on auth state change
- Improve notification mark read with server state validation
- Add auth state listener to trigger notification refresh
- Add YaoCoinConverter for coin-to-yao type conversion
- Remove YaoLegend from divination screens (UI cleanup)
- Abbreviate relation labels in yao detail view
- Add re-register notice to account delete screen
- Update 'coins' terminology to 'points' in localization
- Fix backend points consumption to only run in CHAT mode
- Add HttpxAuthNoiseFilter to suppress auth endpoint logging
- Fix notification static_schema import path
- Add test coverage for notification bloc error handling
- Update AGENTS.md page header rules and image handling
- Delete deprecated run-dev.sh script
2026-04-13 14:52:22 +08:00
qzl
c55be6d3fd
fix: preserve points balance across account re-registration
...
Persist a per-email balance snapshot before account deletion and restore it on same-email re-registration, preventing both unintended balance reset and repeated signup bonus grants.
2026-04-13 11:28:58 +08:00
qzl
4b258bb4d0
feat: 静态通知同步 + 积分审计 JSONB 序列化修复
2026-04-10 19:23:38 +08:00
qzl
3f3d613d99
feat: 实现站内通知系统
...
- 后端: 新增 notifications/user_notifications 表迁移及 ORM 模型
- 后端: 实现 schema/repository/service/router 全套通知 API
- GET /api/v1/notifications (列表+游标分页)
- GET /api/v1/notifications/unread-count
- PATCH /api/v1/notifications/{id}/read (幂等)
- PATCH /api/v1/notifications/mark-all-read (幂等)
- 后端: payload 使用 Pydantic discriminated union (none/open_route/open_url)
- 后端: 19 个单元测试全部通过
- Flutter: 通知 feature 完整实现 (models/apis/repositories/bloc/UI)
- Flutter: Home 页通知按钮接入真实页面,显示未读 badge
- Flutter: 14 个测试全部通过
- 协议文档: notification-inbox-protocol.md 及错误码注册
2026-04-10 18:50:08 +08:00
qzl
0ac8b81a66
feat: 添加 points_audit_ledger 及 JSON 字段 Pydantic Schema 约束
2026-04-10 12:28:18 +08:00
qzl
46513829cd
feat: 添加账号删除功能
2026-04-10 10:40:44 +08:00
qzl
17a1303f00
fix: 修复 pre-commit hook 基于pyright 配置
2026-04-08 18:00:08 +08:00
qzl
e80a82bef4
docs: 更新协议文档,删除废弃计划文档
...
- 更新 http-error-codes, user-points-chat-data-protocol
- 更新 divination-run-protocol, profile-protocol
- 删除废弃的后端和前端设计计划文档
2026-04-08 17:23:02 +08:00
qzl
c121c1092f
feat(invite): 添加邀请码功能模块
2026-04-07 18:43:49 +08:00
qzl
b22673ce49
feat(settings): 添加通知偏好设置和后端 API 集成
2026-04-07 18:43:42 +08:00
qzl
b18a205bf3
refactor(schema): 重构数据库模型和 schema,清理废弃表
2026-04-07 18:43:34 +08:00
qzl
a65d041436
refactor(agentscope): 重构提示词模块和运行时任务处理
2026-04-07 18:43:24 +08:00
ZL-Q
8a18b3528b
feat: 实现用户画像、占卜历史与后端用户管理模块
2026-04-06 01:28:10 +08:00
qzl
d87b2e1e3a
feat: 接入起卦后端流程并完善积分扣减链路
2026-04-03 19:04:46 +08:00
qzl
f245eec5f6
feat: 实现起卦、设置与积分系统
2026-04-03 16:56:47 +08:00
qzl
31594558eb
feat: 切换邮箱认证并重构前后端启动与门禁
2026-04-02 18:39:35 +08:00
qzl
92cdfd9fca
chore: 迁移到 social-app 架构,集成 Supabase 和 taskiq worker
2026-04-02 16:36:35 +08:00
qzl
695adb7d6f
feat: initial commit
2026-03-31 13:32:22 +08:00