SHA-7 补齐 W2 缺口:期初积分 RPC 与学习包模块启停配置 - #44
Draft
WardLu wants to merge 1 commit into
Draft
Conversation
补齐 W2 两个缺口: - 期初积分:learning_confirm_opening_balance 受控 RPC,每个孩子仅可确认一次, 生成独立 initial_balance 流水;仅放宽 initial_balance 的 ±1000 限额。 - 学习包模块启停:内容包代码注册表 + 孩子级 content_config,四模块归并入「学习」, 首页与成长日历只统计已启用模块。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联
feat/growth-loop-integration(PR SHA-4 Growth Loop MVP 集成:合并 codex/growth-loop-mvp 到最新 main (SHA-5) #43)构建,补齐 SHA-7 的两个 W2 缺口。缺失项 1:期初积分(opening balance)
supabase/migrations/20260816120000_growth_loop_opening_balance.sql(proposal-only):initial_balance放宽learning_point_ledger的 ±1000 单笔限额(±1000000),其余 entry_type 保持原限额;learning_confirm_opening_balance:security definer、空search_path、全限定对象名、函数内复核auth.uid()/ 家庭 / 孩子归属(owner/guardian)、最小权限授予(仅 authenticated 可执行)、幂等(同一 request 重复调用返回原行,同孩子重复确认抛learning_opening_balance_already_confirmed)、事务 + 孩子级行锁。supabase/tests/growth_loop_opening_balance_test.sql:单次成功、重复确认拒绝、跨孩子隔离、非成员越权拒绝(函数与直读账本)。缺失项 2:学习包/内容包模块启停(W2)
src/learning-content-package.js:稳定包 ID/版本/名称/建议年龄/适用目标,四个模块(语文/数学/英语/绘本)的稳定 ID、名称、图标、既有内容入口、记录类型;不新增内容包数据库表。learning_profile_states.state的learning.content_config(独立配置键 +schema_version: 1),随既有学习状态按孩子同步(learning_save_state整体信封、mergeObjects深度合并、v2 envelope 原样透传)。n/4,启用两个显示n/2;未启用学习包时隐藏学习模块统计(不显示0/4)。验证
npm run test:unit:20 文件 / 120 用例全通过(含新增 opening balance 与内容包注册表用例)。npm run test:db(本地隔离实例,SHADOW_MATE_TEST_DB_URL=127.0.0.1:54312):7 文件 / 179 用例全通过(含新增 20 个 opening balance 用例)。npm run check:Static checks passed。npm run build:vite build 通过。npm run test:e2e):offline 25/25、offline-tts-error + offline-tts-warmup 6/6、tts-system-fallback 1/1、growth-loop 2/2 全通过;导航归并后相关用例已改经「学习」中枢进入模块。迁移为 proposal-only,已在本地隔离实例验证,未在共享生产实例执行。