Skip to content

[讨论]Nullable workspace 与 mixed owner 表 scope owner review #1069

Description

@JAVA-LW

Parent issue: #1063

Issue 元数据

  • 标题:[讨论]Nullable workspace 与 mixed owner 表 scope owner review
  • 层级:L2 Epic / Workstream Issue
  • 分级:G4 Architecture / Data Risk
  • 标签:type:design, area:backend, level:l2, grade:g4, priority:p2, risk:high, size:s, phase:discussion, child-issue, needs-design, contract, migration, user-data
  • 父 issue:[待开发]ADR:scope_id 扩容 routing 语义与 owner-chain 规则 #1063
  • 直接子 issue:待本 L2 决策后拆 L3

已确认事实

需求复述

本 L2 只处理 nullable workspace 与 mixed owner 表。目标是决定这些表需要 discriminator、拆表、显式 system scope,还是继续停在 needs_owner_review

初始候选表

  • audit_logs
  • plugin_tasks
  • roles

待决策事项

  • audit_logs 的 null workspace_id 表示 system/root 审计、跨 workspace 审计,还是历史缺失。
  • plugin_tasks 的 null workspace_id 表示 system task、安装级 task,还是运行态 workspace task。
  • roles 是否继续使用 scope_kind 承载 system/workspace discriminator,以及 scope_id 如何从该 discriminator 推导。

验收证据

  • 每张表有 discriminator / owner-chain / 继续 review 的明确结论。
  • 如果选择迁移,L3 必须证明 nullable 历史行不会被错误塞进 workspace scope 或 SYSTEM_SCOPE_ID
  • schema-hygiene reason 必须保持具体,不允许用默认值静默通过。

停止 / 升级条件

  • 如果 null owner 语义无法区分历史缺失和真实 system/global,停止迁移。
  • 如果需要新增 scope_kind 或改变权限/审计可见性,拆独立 L1/L2 决策。
  • 如果某表同时承载 system 和 workspace 数据但没有 discriminator,不允许自动 migration。

生命周期

  • 当前阶段:phase:discussion
  • 关闭条件:三张表完成 mixed owner 结论,并拆出已确认范围的 L3 / 或保留明确 needs_owner_review。

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend API, service, repository, or runtime workchild-issueChild implementation issuecontractContract or API semantics changegrade:g4Architecture or data risk worklevel:l2Epic / workstream issuemigrationDatabase or persisted data migrationneeds-designNeeds design or contract approvalphase:discussionRequirement discussion and decision shapingpriority:p2Medium priorityrisk:highHigh risk if implemented incorrectlysize:sSmall implementation and review sizetype:designDesign or contract shaping workuser-dataMay expose or affect user-owned content

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions