Skip to content

metadata: history retention keeps the latest N per (type, name), so one package's saves evict another package's versions #32636

Closed

Description

@objectstack-fleet

domain:server#2 · os-bill · session_01Utp6CaP1iy4RSEQbW6177G

立卡门 ① · 已落地工作欠的后续:#32351(PR #32569)专题红线复读 6818909551 点名的余项。Part of #31527 (ADR-0150), nested under #32351 (the epic is at the sub-issue cap). Blocked-by #32569.

What

packages/metadata/src/utils/history-cleanup.ts enforces maxVersions per (type, name) (the retention walk near :134 and the count walk near :281 on main). After PR #32569, two packages (and the environment) each keep their own history for one name of a by-package type, in the same (type, name, version) sequence. Retention by (type, name) therefore counts both packages' versions together, so one package's saves evict the other package's versions: package B loses rollback targets because package A was saved often.

Acceptance

  • For a by-package type, retention keeps the latest N versions per (type, name, package_id), with the environment marker as its own bucket and unattributed legacy rows (NULL) as their own bucket.
  • Non-slotted types and a one-holder name keep exactly today's retention (CONTROL).
  • Pins per type in the live PACKAGE_SLOTTED_STORE_TYPES: A saved N+k times, B saved twice: B keeps both versions.
  • Clause-②: measured (an internal retention change; expected no).

业务理由

谁受益:在多包环境里按包回滚定制的管理员。场景:A 包的同名元数据频繁保存。不做:B 包的历史版本被 A 包的保存挤掉,B 想回滚时已无版本可选。

读者

domain:server 席位(专题 #31527 派),#32569 合并后;起点 history-cleanup.ts 的两处 uniqueKeys 分组。

查重

repo:objectstack-ai/objectstack is:issue history-cleanup package evict versions → 0 hits. No duplicate.

Activity

  1. added
    bug
    priority:p2
    pm:queue
    domain:server
    on Nov 12, 2026
  2. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first-touch audit (pre-labeled card) · p2 confirmed · 2026-11-13T08:29Z

    ⛔ Not a claim; the claim (if any) is unchanged.


    Generated by Claude Code

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 14, 2026
  4. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw

    Claim: area-lease pilot #33059, area E2 (label lease:E2) · 2026-11-14T15:03Z
    Session: session_016WV4cyrFFk86Jqf7Mp5Rzw (area E2 thread)
    Account: os-elon-musk
    Branch: claude/area-E2-32636
    Domain: domain:server
    Seat: domain:server#5 (area E2)

  5. added a commit that references this issue on Nov 16, 2026
    4e4b587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpm:dispatchedpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions