Skip to content

Remove dead object enable.trash / enable.mru capability flags (ADR-0049 enforce-or-remove) #3207

Description

@os-zhuang

Follow-up to #2377 (ADR-0049 enforce-or-remove). The final object dead-property slice deliberately deferred from #3199 (merged as 5754a23).

What

Two object capability flags in the enable block are ledger-classified dead but still authored across the system objects:

Property Schema Ledger
enable.trash object.zod.ts:110 — z.boolean().default(true) spec/liveness/object.json → status: dead, "no behavior-changing reader"
enable.mru object.zod.ts:113 — z.boolean().default(true) spec/liveness/object.json → status: dead, "no behavior-changing reader"

No runtime consumer reads either flag — verified by grep across plugins/services/objectql/runtime. The only non-setter references are the generated i18n form labels (capabilities.trash / capabilities.mru) and the authorWarn-skip note in lint-liveness-properties.ts. Authoring them is a false affordance: toggling "Enable Recycle Bin" or "Track Recently Viewed" off changes nothing.

Why it was deferred (not a quick win)

Unlike the other #2377 removals, these are inert default(true) flags explicitly set by the system-object definitions:

  • trash: set in 44 *.object.ts files
  • mru: set in 39 *.object.ts files

(mostly sys-*.object.ts across packages/metadata-core and packages/platform-objects). Removing the schema property is breaking (next major) and forces touching all ~44 files to drop the now-rejected keys. High churn, low value — so #3199 left them dead + authorWarn-skipped rather than block that PR.

Proposed work (same pattern as #3199)

  1. Remove trash and mru from the enable capabilities schema in packages/spec/src/data/object.zod.ts.
  2. Add rejecting tombstones for enable.trash / enable.mru in UNKNOWN_KEY_GUIDANCE (point authors at the removal, matching the tags/active/abstract tombstones).
  3. Delete the enable: { … trash, mru … } entries from all ~44 setter *.object.ts files.
  4. Remove the two entries from packages/spec/liveness/object.json and update the ledger README count table.
  5. Drop the capabilities.trash / capabilities.mru entries from the object authoring form (object.form.ts) and regenerate the metadata-forms i18n bundles (os i18n extract, all 4 locales).
  6. Regenerate api-surface.json + reference docs (gen:schema + gen:docs); run check:docs.
  7. Add a minor changeset (launch-window policy — breaking spec changes ship as minor, per check-changeset-no-major), with a migration note: the flags never gated behavior, so removal is drop-the-key only.

Verification

  • pnpm --filter @objectstack/spec test (full)
  • Spec property liveness gate (check-liveness.mts)
  • Full-repo build/typecheck — a missed setter surfaces as an ObjectSchema.create() unknown-key throw
  • check:docs + check:api-surface

Notes

  • Non-breaking at runtime: the metadata registry parses objects via ObjectSchema.parse(), which strips unknown keys — a stale trash/mru in a persisted payload is a no-op, not an error. The break is purely author-side (ObjectSchema.create() on hand-authored *.object.ts).
  • Scope is intentionally just these two flags. Every other [11.0][A2] Remove dead author-facing metadata properties (ADR-0049 enforce-or-remove) #2377 property is already removed or confirmed live.

Activity

  1. os-zhuang commented on Aug 2, 2026

    @os-zhuang
    ContributorAuthor

    裁决(维护者 2026-08-02 委托,按四轴评估:长远合理性 / 防 AI 静默犯错 / 实际业务 / 不扩边界):remove —— 删除 enable.trash / enable.mru;#3146 维持 parked,现阶段不实现软删除。

    • 边界:回收站是一整条产品线(UI、保留期、清空、权限),当前没有业务需求拉动(Implement soft delete (recycle bin): enable.trash / softDelete are spec-only with zero runtime readers #3146 零运行时读者、已 parked)。创业阶段不为一个死键立一个功能。
    • 防 AI 犯错:spec-only 的 enable.trash 让作者以为自己有了回收站——典型静默失效(ADR-0078 点名的形状),删除即修复。
    • 长远:未来真做软删除时,以实现驱动重新设计 spec 形状(经 ADR),而不是被一个从未生效的旧键绑架。

    实施走 spec-property-retirement 流程,UNKNOWN_KEY_GUIDANCE 墓碑指向 #3146 作为立项位。v17 major 窗口内落地。


    Generated by Claude Code

  2. os-zhuang commented on Aug 2, 2026

    @os-zhuang
    ContributorAuthor

    这个功能暂时不是重点,可以移除

  3. self-assigned this
    on Aug 3, 2026
  4. os-zhuang commented on Aug 3, 2026

    @os-zhuang
    ContributorAuthor

    🔒 认领(A 道 · ADR-0049 批次;#2902 已核实为 PR #2943 既有实现并关单,#3715 按 owner call 维持搁置)


    Generated by Claude Code

  5. os-zhuang commented on Aug 3, 2026

    @os-zhuang
    ContributorAuthor

    ✅ 验收通过(ACCEPT) — PR #4734 已转正并开 auto-merge。

    重要事实修正:本单主体工作早在 2026-07-24 已由 PR #3414(88346ba58)落地(schema 移除 + .strict() 墓碑、~45 处 setter 删除、ledger/form/i18n/docs 全套),issue 未随之关闭——与 #2902/#2943 同型的「实现了没关单」。实施 agent 按纪律动手前重验现场,避免了二次实现,并把 PR 收窄到对照 2026-08-02 裁决的两处真实缺口:

    1. 补 ADR-0087 D2 conversion(object-enable-trash-mru-removed,protocol 17,retiredFromLoadPath,嵌套下钻外科式剥离):此前存量 16.x sys_metadata 行重放后仍带死键,被 .strict() 诊断永久误标 metadata_spec_invalid(违反 [P2] The spec contract stops at authored source — stored metadata is rehydrated unparsed, unconverted, and ungated #3903 不变式),且 os migrate meta --from 16 无法改写源码。fixture + stored 重放测试 + cli e2e 全绿。
    2. 墓碑死指针修正:feat(spec)!: remove dead enable.trash/mru capability flags (#2377 close-out, ADR-0049) #3414 落的墓碑指向已关闭的 [P2] Aspirational config — prune or mark experimental #1893,违背裁决「指向 Implement soft delete (recycle bin): enable.trash / softDelete are spec-only with zero runtime readers #3146 作为立项位」;现 trash → Implement soft delete (recycle bin): enable.trash / softDelete are spec-only with zero runtime readers #3146(parked)、restore guidance 与 api-derivation 注释同步修正,pin 断言含 Implement soft delete (recycle bin): enable.trash / softDelete are spec-only with zero runtime readers #3146 且不含 [P2] Aspirational config — prune or mark experimental #1893。

    对 diff 逐项核对通过;两个实施判断予以确认:mru 墓碑不硬指 #3146(该单只立项软删除,精确指针优于字面遵从),已消费 changeset 由 minor 翻正 major(v17 pre 窗口,check-changeset-no-major 有 RC EXEMPTION;breaking 移除列在 Minor Changes 会误导升级 agent)。

    流程教训入档:#2902、#3207 一天内两例「已实现未关单」。后续派单前 PM 先做 main 现势快查;os-dev 动手前重验现场的纪律继续保持。附带产出:#4736(i18n config 常驻噪音,未认领)。


    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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions