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:110z.boolean().default(true) spec/liveness/object.jsonstatus: dead, "no behavior-changing reader"
enable.mru object.zod.ts:113z.boolean().default(true) spec/liveness/object.jsonstatus: 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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