
Bitwarden Server Seeder 数据密度验证verification.md 的 Q0–Q11 SQL 查询与预设期望值详解【免费下载链接】serverBitwarden infrastructure/backend (API, database, Docker, etc).项目地址: https://gitcode.com/GitHub_Trending/ser/server本文以 Bitwarden 开源仓库中util/Seeder/Seeds/docs/verification.md为主体讲解如何用手写 SQL 查询Q0–Q11验证 Seeder 密度算法density modeling的输出是否符合预设Scale 与 Validation 预设的期望分布并完整覆盖文档中 9 个 Scale 预设与 4 个 Validation 预设的逐项期望值。读完本文你将能够对任意一个dotnet run -- preset --name {name} --mangle生成的组织独立跑通整套验证查询、对照期望值做 pass/fail 判定并理解每条查询背后对应哪一条密度参数membership.shape、collectionFanOut、directAccessRatio、cipherAssignment.*等。文档定位谁来用、什么时候用verification.md开头就明确了自己的读者画像面向开发者Developer-facing用于在跑完某个 Scale 或 Validation 预设后核对数据库中的实际分布与预设 JSON 中声明的密度参数是否一致正常 Seeder 用户无需关心。文档推荐的两种使用方式手动模式Manual Usage先执行 Q0 按组织名查出 Organization ID再把该 ID 粘贴进其余查询。让 Claude Code 代跑文档给出的标准三步——播种预设dotnet run -- preset --name scale.md-balanced-sterling-cooper --mangle把 Seeder 输出含 Org ID贴给 Claude Code并要求对 Org ID {id} 执行 Q1–Q8并与 verification.md 中 Sterling Cooper 的期望值对比Claude Code 逐条执行查询、输出 pass/fail 表格并标记超差项。文档特别指出密度算法最初就是这样被验证的——Claude Code 跑完所有查询、对照期望值逐项判定当场暴露出若干分布 bug 并在同一会话中被修复。因此这套查询同时充当了回归检查手册的角色。验证查询全集Q0–Q11所有查询都带NOLOCK提示、使用OrgId UNIQUEIDENTIFIER变量直接面向 SQL Server 的dboschema 表Organization、Group、GroupUser、Collection、CollectionGroup、CollectionUser、CollectionCipher、Cipher、OrganizationUser。以下按文档顺序完整列出。Q0找到 Organization IDSELECT Id, [Name] FROM [dbo].[Organization] WITH (NOLOCK) WHERE [Name] PASTE_ORG_NAME_HERE;拿到Id后把下面所有查询里的PASTE_ORG_ID_HERE替换掉即可。Q1Group 成员分布验证membership.shape与membership.skew。成员计数应体现 Uniform大致均等、PowerLaw递减或 MegaGroup一个占绝对多数三种形态之一DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT G.[Name], COUNT(GU.OrganizationUserId) AS Members FROM [dbo].[Group] G WITH (NOLOCK) LEFT JOIN [dbo].[GroupUser] GU WITH (NOLOCK) ON G.Id GU.GroupId WHERE G.OrganizationId OrgId GROUP BY G.[Name] ORDER BY Members DESC;Q2CollectionGroup 记录总数验证collectionFanOut。总数应落在collections * min到collections * max之间DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS CollectionGroupCount FROM [dbo].[CollectionGroup] CG WITH (NOLOCK) INNER JOIN [dbo].[Collection] C WITH (NOLOCK) ON CG.CollectionId C.Id WHERE C.OrganizationId OrgId;Q3权限分布验证permissions权重零权重权限必须产生零条记录。查询用UNION ALL把CollectionUser与CollectionGroup两个来源合并统计ReadWrite 定义为三个标志位全 0DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT CollectionUser AS [Source], COUNT(*) AS Total, SUM(CASE WHEN CU.ReadOnly 1 THEN 1 ELSE 0 END) AS ReadOnly, SUM(CASE WHEN CU.Manage 1 THEN 1 ELSE 0 END) AS Manage, SUM(CASE WHEN CU.HidePasswords 1 THEN 1 ELSE 0 END) AS HidePasswords, SUM(CASE WHEN CU.ReadOnly 0 AND CU.Manage 0 AND CU.HidePasswords 0 THEN 1 ELSE 0 END) AS ReadWrite FROM [dbo].[CollectionUser] CU WITH (NOLOCK) INNER JOIN [dbo].[OrganizationUser] OU WITH (NOLOCK) ON CU.OrganizationUserId OU.Id WHERE OU.OrganizationId OrgId UNION ALL SELECT CollectionGroup, COUNT(*), SUM(CASE WHEN CG.ReadOnly 1 THEN 1 ELSE 0 END), SUM(CASE WHEN CG.Manage 1 THEN 1 ELSE 0 END), SUM(CASE WHEN CG.HidePasswords 1 THEN 1 ELSE 0 END), SUM(CASE WHEN CG.ReadOnly 0 AND CG.Manage 0 AND CG.HidePasswords 0 THEN 1 ELSE 0 END) FROM [dbo].[CollectionGroup] CG WITH (NOLOCK) INNER JOIN [dbo].[Collection] C WITH (NOLOCK) ON CG.CollectionId C.Id WHERE C.OrganizationId OrgId;Q4孤儿 CipherOrphan Ciphers验证cipherAssignment.orphanRate。孤儿指没有任何CollectionCipher分配的 cipherDECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS TotalCiphers, SUM(CASE WHEN CC.CipherId IS NULL THEN 1 ELSE 0 END) AS Orphans FROM [dbo].[Cipher] CI WITH (NOLOCK) LEFT JOIN (SELECT DISTINCT CipherId FROM [dbo].[CollectionCipher] WITH (NOLOCK)) CC ON CI.Id CC.CipherId WHERE CI.OrganizationId OrgId;Q5Direct Access 比例验证directAccessRatio。文档强调计算式为int(userCount * directAccessRatio) / userCount因此小组织会出现截断误差注意总用户数只统计[Status] 2ConfirmedDECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT TotalOrgUsers, UsersWithDirectAccess, CAST(UsersWithDirectAccess AS FLOAT) / NULLIF(TotalOrgUsers, 0) AS DirectAccessRatio FROM ( SELECT (SELECT COUNT(*) FROM [dbo].[OrganizationUser] WITH (NOLOCK) WHERE OrganizationId OrgId AND [Status] 2) AS TotalOrgUsers, (SELECT COUNT(DISTINCT CU.OrganizationUserId) FROM [dbo].[CollectionUser] CU WITH (NOLOCK) INNER JOIN [dbo].[OrganizationUser] OU WITH (NOLOCK) ON CU.OrganizationUserId OU.Id WHERE OU.OrganizationId OrgId) AS UsersWithDirectAccess ) T;Q6Cipher 分布形态验证cipherAssignment.skew。变异系数 CV 接近 0 表示 uniformCV 偏高表示 heavyRightDECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS Collections, MIN(CipherCount) AS MinCiphers, MAX(CipherCount) AS MaxCiphers, AVG(CipherCount) AS AvgCiphers, CASE WHEN AVG(CipherCount) 0 THEN STDEV(CipherCount) / AVG(CipherCount) ELSE 0 END AS CoefficientOfVariation FROM ( SELECT C.Id, COUNT(CC.CipherId) AS CipherCount FROM [dbo].[Collection] C WITH (NOLOCK) LEFT JOIN [dbo].[CollectionCipher] CC WITH (NOLOCK) ON C.Id CC.CollectionId WHERE C.OrganizationId OrgId GROUP BY C.Id ) T;Q7每用户 Collection 数分布验证userCollections。CV 接近 0 uniformCV 0.5 power-lawDECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS UsersWithDirectAccess, MIN(CollectionCount) AS MinCollections, MAX(CollectionCount) AS MaxCollections, AVG(CollectionCount) AS AvgCollections, CASE WHEN AVG(CollectionCount) 0 THEN STDEV(CollectionCount) / AVG(CollectionCount) ELSE 0 END AS CoefficientOfVariation FROM ( SELECT CU.OrganizationUserId, COUNT(DISTINCT CU.CollectionId) AS CollectionCount FROM [dbo].[CollectionUser] CU WITH (NOLOCK) INNER JOIN [dbo].[OrganizationUser] OU WITH (NOLOCK) ON CU.OrganizationUserId OU.Id WHERE OU.OrganizationId OrgId GROUP BY CU.OrganizationUserId ) T;Q8多 Collection Cipher 比例验证cipherAssignment.multiCollectionRate比例应近似配置值DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS TotalAssignedCiphers, SUM(CASE WHEN CollectionCount 1 THEN 1 ELSE 0 END) AS MultiCollectionCiphers, MAX(CollectionCount) AS MaxCollectionsPerCipher FROM ( SELECT CC.CipherId, COUNT(DISTINCT CC.CollectionId) AS CollectionCount FROM [dbo].[CollectionCipher] CC WITH (NOLOCK) INNER JOIN [dbo].[Cipher] CI WITH (NOLOCK) ON CC.CipherId CI.Id WHERE CI.OrganizationId OrgId GROUP BY CC.CipherId ) T;Q9已删除的组织 Cipher验证cipherAssignment.deletedRate与maxDeletedCiphers适用于所有 Scale 预设的组织 cipherDECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS TotalOrgCiphers, SUM(CASE WHEN DeletedDate IS NOT NULL THEN 1 ELSE 0 END) AS DeletedCiphers FROM [dbo].[Cipher] WITH (NOLOCK) WHERE OrganizationId OrgId;Q10个人池中的 Archived/Deleted Cipher验证cipherAssignment.archivedRate、deletedRate、archivedAndDeletedOverlapRate但对象是个人非组织cipher 池——仅适用于配置了density.personalCiphers的预设Sterling Cooper、Wayne Enterprises、Weyland-Yutani。由于个人 cipher 不挂OrganizationId查询通过OrganizationUser限定到被播种组织的用户归档判定复用dbo.CipherDetails中计算ArchivedDate的同款 JSON 路径模式Archives列中按大写 UserId 取值DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS TotalPersonalCiphers, SUM(CASE WHEN JSON_VALUE(C.[Archives], CONCAT($., UPPER(CONVERT(VARCHAR(36), C.UserId)), )) IS NOT NULL THEN 1 ELSE 0 END) AS ArchivedCiphers, SUM(CASE WHEN C.DeletedDate IS NOT NULL THEN 1 ELSE 0 END) AS DeletedCiphers, SUM(CASE WHEN C.DeletedDate IS NOT NULL AND JSON_VALUE(C.[Archives], CONCAT($., UPPER(CONVERT(VARCHAR(36), C.UserId)), )) IS NOT NULL THEN 1 ELSE 0 END) AS BothArchivedAndDeleted FROM [dbo].[Cipher] C WITH (NOLOCK) WHERE C.OrganizationId IS NULL AND C.UserId IN ( SELECT OU.UserId FROM [dbo].[OrganizationUser] OU WITH (NOLOCK) WHERE OU.OrganizationId OrgId );Q11组织池中的 Archived/Deleted Cipher同样验证三个 rate但对象是组织 cipher适用于每个Scale 预设。文档解释组织 cipher 的归档是独立于个人池的且归档对象是轮询round-robin选出的某位组织成员见GenerateCiphersStep因此只需检查Archives列是否非空无需像 Q10 那样限定到具体用户DECLARE OrgId UNIQUEIDENTIFIER PASTE_ORG_ID_HERE; SELECT COUNT(*) AS TotalOrgCiphers, SUM(CASE WHEN Archives IS NOT NULL THEN 1 ELSE 0 END) AS ArchivedCiphers, SUM(CASE WHEN DeletedDate IS NOT NULL THEN 1 ELSE 0 END) AS DeletedCiphers, SUM(CASE WHEN DeletedDate IS NOT NULL AND Archives IS NOT NULL THEN 1 ELSE 0 END) AS BothArchivedAndDeleted FROM [dbo].[Cipher] WITH (NOLOCK) WHERE OrganizationId OrgId;源码侧印证期望值从哪里来文档中的每个Check都对应预设 JSON 里density块的一个参数。以 Sterling Cooper 预设 为例其density块是density: { membership: { shape: powerLaw, skew: 0.6 }, collectionFanOut: { min: 1, max: 5, shape: powerLaw, emptyGroupRate: 0.1 }, directAccessRatio: 0.5, permissions: { readOnly: 0.55, readWrite: 0.20, manage: 0.15, hidePasswords: 0.10 }, cipherAssignment: { skew: heavyRight, orphanRate: 0.08, multiCollectionRate: 0.20, maxCollectionsPerCipher: 3, deletedRate: 0.03, archivedRate: 0.06, archivedAndDeletedOverlapRate: 0.02 }, userCollections: { min: 1, max: 10, shape: powerLaw, skew: 0.5 }, personalCiphers: { shape: realistic } }与 verification.md 中 Sterling Cooper 的期望值表逐行对应PowerLaw(skew 0.6) 的 50 组 → Q1fan-out 1–5 × 500 个 collection → Q2 的 500–2,500 区间directAccessRatio 0.5→ Q5四档权限权重 → Q3orphanRate 0.08× 5,000 → Q4 的约 400 条孤儿archivedRate 0.06300被钳制到上限 50 → Q11 的 50 条归档。再看 Initech 预设directAccessRatio: 1.0解释了为什么该预设 Q2 期望 0 条 CollectionGroupDirectAccessRatio 是 1.0CollectionGroup 生成被整体跳过orphanRate: 0.85解释了 Q4 期望 85% 孤儿。从源码结构看这些参数由util/Seeder/Steps/下的步骤消费CreateGroupsStep成员分布、CreateCollectionsStepfan-out、CreateCipherCollectionsStep与GenerateCiphersStepcipher 分配、归档/删除Q11 注释即指向GenerateCiphersStep。参数与实现的映射关系是文档中每条期望值可复算的根本原因——这也是 Q0–Q11 能充当回归检查的前提。Scale 预设期望值9 个预设全量以下完整继承 verification.md 的期望值表。判定标准与预设 JSON 的density参数对照容差内视为 pass。1. Central PerkXSCheckExpectedMembership shapeUniform — 2 组每组约 3 人。CollectionGroups10–20 条记录。每 collection 1–2 组的 uniform fan-out。Permissions约 50% Manage、40% ReadWrite、10% ReadOnly、0% HidePasswords。Orphan ciphers0 / 2000% 孤儿率。Direct access ratio0.8 —— 约 80% 的访问路径是直接 CollectionUser。Collections per userUniform 1–3。Min1Max3Avg2。Multi-collection rate200 个非孤儿 cipher 中 20% 位于 2 个 collection约 40 条。Archived org ciphers约 8 / 2004% 率低于 50 上限。Deleted org ciphers约 4 / 2002% 率低于 25 上限其中约 2 条同时归档1% 重叠约 2 条仅删除。2. Planet ExpressSMCheckExpectedMembership shapePowerLaw(skew 0.4) —— 首组最大8 组间温和递减。CollectionGroups200–400 条。每 collection 2–4 组的 uniform fan-out。Permissions约 40% ReadOnly、30% ReadWrite、25% Manage、5% HidePasswords。Orphan ciphers约 37 / 7505%。Direct access ratio0.7。Collections per userPowerLaw 1–5(skew 0.3)。首用户最多 5 个多数 1–2。CV 0.3。Multi-collection rate约 713 个非孤儿 cipher 中 15% 位于 2 个 collection约 107 条。Archived org ciphers约 45 / 7506%。Deleted org ciphers约 22 / 7503%约 15 条同时归档2% 重叠约 7 条仅删除。3. Bluth CompanySMCheckExpectedMembership shapePowerLaw(skew 0.7) —— 4 组间陡降首组占绝对多数。CollectionGroups25–125 条。每 collection 1–5 组的 PowerLaw fan-out。Permissions约 82% ReadOnly、9% ReadWrite、5% Manage、4% HidePasswords。Orphan ciphers约 75 / 50015%。Direct access ratio0.6。Collections per userUniform 1–3。Min1Max3Avg2。Multi-collection rate约 425 个非孤儿 cipher 中 10%约 42 条。Archived org ciphers约 40 / 5008%。Deleted org ciphers约 20 / 5004%约 15 条同时归档3% 重叠约 5 条仅删除。4. Sterling CooperMDCheckExpectedMembership shapePowerLaw(skew 0.6) —— 50 组间中度递减。CollectionGroups500–2,500 条。每 collection 1–5 个活跃组的 PowerLaw fan-out。Permissions约 55% ReadOnly、20% ReadWrite、15% Manage、10% HidePasswords。Orphan ciphers约 400 / 5,0008%。Direct access ratio0.5 —— 直接访问与组中介访问大致各半。Empty group rate约 26% —— 50 组中约 13 组因幂律尾部截断而 0 成员。Collections per userPowerLaw 1–10(skew 0.5)。首用户最多 10 个多数 1–2。CV 0.5。Multi-collection rate约 4,600 个非孤儿 cipher 中 20% 位于 2–3 个 collection单 cipher 最多 3 个。Archived org ciphers50 / 5,0006% 300钳制到 50 上限。Deleted org ciphers25 / 5,0003% 150钳制到 25 上限。25 条全部同时归档2% 重叠 100钳制后——0 条仅删除。Archived personal ciphers约 3,638 个个人 cipher 中的 50 个6% 约 218钳制到 50。Deleted personal ciphers约 3,638 中的 25 个3% 钳制到 25。25 条全部同时归档2% 重叠 约 73钳制到min(archivedTarget, maxDeletedCiphers) 25——0 条仅删除。该钳制可对照ArchiveAndDeleteRateTests.BothTarget_NeverExceedsMaxDeletedCiphers_EvenWhenArchivedCeilingIsHigher单测。Sterling Cooper 的归档/删除项同时落在组织池与个人池因为archivedRate/deletedRate/archivedAndDeletedOverlapRate对两个池分别独立生效。5. Umbrella CorpMDCheckExpectedMembership shapeMegaGroup(skew 0.5) —— 组 1 约 72% 成员其余 7 组平分剩余。CollectionGroups800–2,400 条。每 collection 1–3 组的 FrontLoaded fan-out。Permissions约 50% ReadWrite、20% Manage、20% ReadOnly、10% HidePasswords。Orphan ciphers约 600 / 3,00020%。Direct access ratio0.9。Collections per userPowerLaw 1–15(skew 0.6)。CV 0.5。Multi-collection rate约 2,400 个非孤儿 cipher 中 25% 位于 2–3 个 collection单 cipher 最多 3 个。Archived org ciphers50 / 3,0008% 240钳制到 50。Deleted org ciphers25 / 3,0004% 120钳制到 25。25 条全部同时归档3% 重叠 90钳制后——0 条仅删除。6. Wayne EnterprisesLGCheckExpectedMembership shapePowerLaw(skew 0.7) —— 100 组间陡降首几组明显更大。CollectionGroups2,000–10,000 条。每 collection 1–5 个活跃组的 PowerLaw fan-out。Permissions约 82% ReadOnly、9% ReadWrite、5% Manage、4% HidePasswords。Orphan ciphers约 1,000 / 10,00010%。Direct access ratio0.5。Empty group rate约 30% —— 100 组中约 30 组 0 成员幂律尾部截断。Collections per userPowerLaw 1–25(skew 0.6)。CV 0.5。Multi-collection rate约 9,000 个非孤儿 cipher 中 25% 位于 2–4 个 collection单 cipher 最多 4 个。Archived org ciphers50 / 10,0006% 600钳制到 50。Deleted org ciphers25 / 10,0003% 300钳制到 25。25 条全部同时归档2% 重叠 200钳制后——0 条仅删除。Archived personal ciphers约 14,525 个个人 cipher 中的 50 个6% 约 872钳制到 50。Deleted personal ciphers约 14,525 中的 25 个3% 钳制到 25。25 条全部同时归档2% 重叠钳制方式同 Sterling Cooper——0 条仅删除。Wayne Enterprises 的组织池与个人池都播种归档/删除项。7. Tyrell CorpLGCheckExpectedMembership shapePowerLaw(skew 0.8) —— 75 组间极陡递减首组非常大。CollectionGroups4,600–18,400 条。每 collection 2–8 个活跃组的 PowerLaw fan-out。Permissions约 82% ReadOnly、9% ReadWrite、5% Manage、4% HidePasswords。Orphan ciphers约 2,550 / 17,00015%。Direct access ratio0.6。Empty group rate20% —— 75 组中约 15 组 0 成员。Collections per userPowerLaw 1–30(skew 0.7)。CV 0.5。Multi-collection rate约 14,450 个非孤儿 cipher 中 30% 位于 2–4 个 collection单 cipher 最多 4 个。Archived org ciphers50 / 17,0008% 1,360钳制到 50。Deleted org ciphers25 / 17,0004% 680钳制到 25。25 条全部同时归档3% 重叠 510钳制后——0 条仅删除。8. Weyland-YutaniXLCheckExpectedMembership shapePowerLaw(skew 0.8) —— 500 组间极陡递减长尾小群体。CollectionGroups1,200–3,600 条。每 collection 1–3 个活跃组的 PowerLaw fan-out。Permissions约 55% ReadWrite、25% ReadOnly、10% Manage、10% HidePasswords。Orphan ciphers约 1,500 / 15,00010%。Direct access ratio0.4 —— 多数访问经组中介。Empty group rate约 68% —— 500 组中约 341 组 0 成员幂律尾部截断。Collections per userPowerLaw 1–50(skew 0.8)。CV 0.5。Multi-collection rate约 13,500 个非孤儿 cipher 中 30% 位于 2–5 个 collection单 cipher 最多 5 个。Archived org ciphers50 / 15,0004% 600钳制到 50。Deleted org ciphers25 / 15,0003% 450钳制到 25。25 条全部同时归档1% 重叠 150钳制后——0 条仅删除。Archived personal ciphers约 11,000 个个人 cipher 中的 50 个4% 440钳制到 50。Deleted personal ciphers约 11,000 中的 25 个3% 钳制到 25。25 条全部同时归档1% 重叠 110同式钳制——0 条仅删除。Weyland-Yutani 同样在组织池与个人池双池播种归档/删除项。9. InitechXLCheckExpectedMembership shapeMegaGroup(skew 0.95) —— 组 1 约 93% 成员其余 4 组平分剩余。CollectionGroups0 条记录。DirectAccessRatio 是 1.0CollectionGroup 生成被整体跳过。Permissions约 30% Manage、30% ReadWrite、30% ReadOnly、10% HidePasswords。Orphan ciphers约 12,750 / 15,00085%。Direct access ratio1.0 —— 100% 直接 CollectionUser 访问。Collections per userPowerLaw 1–20(skew 0.5)。首用户最多 20 个多数 1 个。CV 0.2。Multi-collection rate约 2,250 个非孤儿 cipher 中 15% 位于 2–3 个 collection单 cipher 最多 3 个。Archived org ciphers50 / 15,0008% 1,200钳制到 50。Deleted org ciphers25 / 15,0005% 750钳制到 25。25 条全部同时归档3% 重叠 450钳制后——0 条仅删除。Validation 预设期望值4 个预设全量Validation 预设用于 Seeder 开发阶段的算法验证非通用用途逐个跑--mangle后对照下表的Check/Expected判定。1. Power-Law Distributiondotnet run -- preset --name validation.density-modeling-power-law-test --mangleCheckExpectedGroups10 组。首组约 50 人递减到 1最后 2 组 0 成员20% 空组率。CollectionGroups 0 条。靠前 collection 分到的组更多PowerLaw fan-out。Permissions约 50% ReadOnly、30% ReadWrite、15% Manage、5% HidePasswords。Orphan ciphers约 50 / 50010%。DirectAccessRatio0.6。2. MegaGroup Distributiondotnet run -- preset --name validation.density-modeling-mega-group-test --mangleCheckExpectedGroups5 组。组 1 约 90 人90.5%组 2–5 平分约 10 人。CollectionUsers0 条。DirectAccessRatio 为 0.0 —— 全部访问经组。CollectionGroups 0。前 10 个 collection 各得 3 组FrontLoaded其余各 1 组。PermissionsReadOnly / ReadWrite / Manage / HidePasswords 各 25%均匀切分。3. Empty Groupsdotnet run -- preset --name validation.density-modeling-empty-groups-test --mangleCheckExpectedGroups共 10 组5 组各约 10 人5 组 0 人50% 空组。CollectionGroups只引用那 5 个非空组。DirectAccessRatio0.5 —— 约一半用户获得直接 CollectionUser 记录。4. No DensityBaseline基线dotnet run -- preset --name validation.density-modeling-no-density-test --mangleCheckExpectedGroups5 组每组约 10 人uniform round-robin。CollectionGroups0 条。无 density 不生成 CollectionGroup。Permissions每用户首次分配为 Manage之后为 ReadOnly原始轮转模式。Orphan ciphers0。每个 cipher 至少分配进一个 collection。延伸阅读路径预设目录与各预设组成org roster ciphers 的装配方式presets.md其中 Scale 表列出了 9 个预设的 Users/Groups/Collections/Ciphers 规模与本文期望值表相互印证密度参数 JSON Schema字段取值范围的权威定义util/Seeder/Seeds/schemas/preset.schema.json在 presets.md 中被声明为 source of truthFixture 与 Preset 的分层架构architecture.mdSeeder 使用入口与 Quick Startutil/Seeder/Seeds/README.md 与 util/Seeder/README.md。适用前提本文所有查询面向 SQL Server 的dboschema 与NOLOCK语义验证对象为通过dotnet run -- preset --name {name} --mangle播种的 Bitwarden Seeder 数据--mangle会改写组织名以避免与既有数据冲突因此 Q0 应按 Seeder 实际打印的组织名检索。【免费下载链接】serverBitwarden infrastructure/backend (API, database, Docker, etc).项目地址: https://gitcode.com/GitHub_Trending/ser/server创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考