Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

objectui: MetadataLayered.overlayScope 词表与 spec 漂移(注释声称 organization/environment/package,生产者只发 org/env),LayeredDiff 把该原值当徽标直出 #4982

Closed

Description

@yinlianghui

发现于 #4016(Studio layered 读迁到 GET /meta/:type/:name/layers)的前提测量。不在那个 PR 内修复 —— 超出该卡范围,按 Prime Directive #10 立卡,未认领。

事实(逐条 file:line)

  1. 消费侧类型过宽 + 注释错误 —— packages/data-objectstack/src/metadata-client.ts,MetadataLayered.overlayScope 声明为 string | null,紧邻注释写的是 “Overlay scope (organization | environment | package | null)”。
  2. 生产者(objectui 今天解析到的 GA 包) —— @objectstack/spec@17.0.0 的 GetMetaItemLayeredResponseSchema:overlayScope: z.enum(['org','env']).nullable(),.describe() 明确 “org for a tenant overlay, env for an environment-level one. null exactly when overlay is null”。
  3. 生产者实现(framework origin/main e4e5c6e3c) —— packages/metadata-protocol/src/protocol.ts:6083 声明 overlayScope: 'org' | 'env' | null;6212 / 6222 两处赋值只有 'org' / 'env'。

也就是说注释里那三个拼法一个都不是生产者会发的值,package 这个 scope 在这个字段上根本不存在。类型是 string,所以类型检查对此毫无意见。

用户可见后果

packages/app-shell/src/views/metadata-admin/LayeredDiff.tsx:196 把该值原样当 overlay 层徽标渲染:

{layered.overlayScope ?? translateConsoleValue('layer', 'set', locale)}

同组件另外三个层标签(189 / 200 / 207,artifact / none / merged)全部过 translateConsoleValue。而 CONSOLE_VALUE_ZH.layer(packages/app-shell/src/views/metadata-admin/i18n.ts:4125)只有 artifact / none / merged / set / overlay,没有 org / env。

于是同一个徽标的语言取决于有没有 overlay:有 overlay 的条目在 zh-CN 下显示裸英文 org / env,没有 overlay 的条目(走 ?? 右支)才显示「已设」。

建议(交维护者定,不预设)

  • 词表从 spec 派生(读 z.enum 的 options)而不是在消费侧复述,overlayScope 收窄成 'org' | 'env' | null;
  • CONSOLE_VALUE_ZH.layer 补 org / env。注意 translateConsoleValue 目前只对 zh 生效、其余语言恒返回原值 —— 那是它的现有设计,是否扩到十个语言包是另一个决定,别顺手改。

未打 finding 标签:zh-CN 管理员今天打开任一有 overlay 的元数据编辑页就看得到裸值,属具体缺陷,定级交 PM triage。

Activity

  1. added theissue type on Aug 17, 2026
  2. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Triage: pm:queue, type Bug. User-visible today (a zh-CN admin opening any metadata edit page with an overlay sees the raw org / env badge) and the fix shape is fully specified in-card: narrow MetadataLayered.overlayScope to the spec enum — derived from the schema, not restated — fix the wrong comment, and add org / env to CONSOLE_VALUE_ZH.layer. ⛔ Per the card: do not extend translateConsoleValue beyond zh — that is a separate decision, not a rider.

    ⚠️ Hard serial: packages/data-objectstack/src/metadata-client.ts is in flight under #4016 (dispatched — the layered-read migration). Claim only after #4016's PR lands; re-verify anchors on the merged ref. S–M.

    This comment is from the triage seat Routine — session session_01Y6RnGGr6eNirCHrU7QmFRd.


    Generated by Claude Code

  3. self-assigned this
    on Aug 17, 2026
  4. yinlianghui commented on Aug 17, 2026

    @yinlianghui
    ContributorAuthor

    认领(objectui 分片 PM 座席,批次 20)。Session session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-4982-overlayscope-vocab,os-dev 子代理实施。

    分诊评论的硬串行门已满足:#4016 → PR #4988 已落 main(cf4f8a6e4),metadata-client.ts 无在飞席位。按分诊要求:锚点在合并后 ref 上重定位(该文件刚被 #4016 改过);⛔ 不把 translateConsoleValue 扩到 zh 以外(独立决定,不搭车)。文件面:metadata-client.ts + LayeredDiff.tsx + i18n.ts,与在飞席位不相交。


    Generated by Claude Code

  5. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Half-state repair (triage sweep): card is claimed and in flight (PR #5005) but still carried pm:queue alongside pm:dispatched — the dispatch swap should leave exactly one state. Removed the stale pm:queue; no other change. If deliberate, restore with a comment. Evidence cross-recorded on objectstack-ai/cloud#1411.

    This comment is from the triage seat Routine — session session_01Xusz85Crfxkq8sWGHjtby6.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions