Skip to content

ADR-0057 data lifecycle follow-ups: retire per-plugin sweepers, dev telemetry datasource + db:clean, Studio surface, PG rotation (tracking) #2834

Description

@os-zhuang

Follow-up tracking for ADR-0057 (system data lifecycle & retention) after P1–P4 shipped in #2791 (docs/skills in #2818, tracking issue #2786 closed). Each item is independently shippable.

Items

References

🤖 Generated with Claude Code

Activity

  1. os-zhuang commented on Jul 11, 2026

    @os-zhuang
    ContributorAuthor

    ④ PostgreSQL native-partition Rotator — evaluated, deferred with a design sketch (not shipping unverified DDL)

    Neither this environment nor CI has a PostgreSQL service (driver-sql tests run better-sqlite3 only), so a PARTITION BY RANGE implementation would land as code no test can ever execute — exactly the unverified-claim class ADR-0049/0054 exist to block. Current behavior on PG is already correct (rotation falls back to an equivalent age-based reap; the declared bound holds — only reclamation is row-wise instead of O(1)), so this is an optimization, not a gap.

    Design sketch for whenever a PG service lands in CI:

    • SqlDriver.supportsRotation becomes dialect-aware (isSqlite || isPostgres).
    • PG path in ensureRotation: base table converted once to PARTITION BY RANGE (created_at) (requires a rebuild: rename → create partitioned → attach legacy as the first partition); per-period partitions <table>__r<key> created via CREATE TABLE … PARTITION OF … FOR VALUES FROM/TO; expiry = DETACH PARTITION CONCURRENTLY + DROP TABLE (O(1), lock-light).
    • No view needed (unlike SQLite): the partitioned parent IS the queryable name, and writes route by the partition key natively — the shard-wise write redirects the SQLite path needs don't apply.
    • Prereqs: a postgres service container in the CI dogfood/driver jobs + a sql-driver-rotation.pg.test.ts gated on OS_TEST_PG_URL.

    Also noted while doing ③ (i18n regen): the *.objects.generated.ts bundles have extract-config drift. The committed bundles carry curated zh-CN translations for objects (e.g. sys_audit_log) that live outside packages/platform-objects/scripts/i18n-extract.config.ts's import set (plugin-audit etc.) — so a plain re-run of os i18n extract deletes those curated translations. ③'s PR therefore regenerated only the metadata-forms bundles and left the objects bundles untouched. Fix candidates: import the missing sys_* objects into the extract config, or split per-package bundles. Worth its own small item before anyone re-runs the extractor for object keys.

    🤖 Generated with Claude Code


    Generated by Claude Code

  2. self-assigned this
    on Jul 15, 2026
  3. os-zhuang commented on Jul 15, 2026

    @os-zhuang
    ContributorAuthor

    Closing — every item is now resolved:

    🤖 Generated with Claude Code


    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

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions