Repository navigation
Caline setup 前缀守卫修复:project_slug 区分共享库他项目(照搬 Cbox #7) - #20
Merged
todosdev[bot] merged 1 commit intoNov 18, 2026
Merged
Conversation
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.
Summary
4b12081)。system_settings中播种当前项目身份project_slug: PROJECT_SLUG("caline")。findForeignPrefixConflict,仅在探测到外来三件套且其project_slug === PROJECT_SLUG时判定为 409 冲突,放行共享库中的兄弟项目及存量旧项目。Changes
worker/src/lib/setup.ts:PROJECT_SLUG常量,将project_slug: PROJECT_SLUG纳入DEFAULT_SETTINGS字典(INSERT OR IGNORE播种)。findForeignPrefixConflict,遍历检测到的前缀读取其project_slug设置,仅在foreignPrefix !== prefix && slug === PROJECT_SLUG时记录冲突并返回 409。table-collision守卫逻辑不变。worker/test/setup-guard.test.ts:PROJECT_SLUG与生效前缀。worker/test/setup.test.ts:/api/setup成功后校验project_slug落库断言。Testing
pnpm check:identity: 验证通过,项目身份令牌在白名单外零残留。pnpm --filter ./worker test test/setup: 33/33 测试全部通过。pnpm build:client && pnpm test: 全仓 4 个子包 426 项测试全部通过(shared 12、client 27、worker 241、web 146)。pnpm format:check && pnpm lint && pnpm typecheck: 格式、代码检查与类型检查全部通过。0098bd5构建与校验通过(completed/success)。