Skip to content

[Decision] After a record is deleted and purged, its field values stay in the audit log, the activity feed and in-app notifications: should the platform offer an erasure that reaches those copies? #37391

Backlog

Description

@objectstack-fleet

repo:hotcrm#2 · sunhaolin · session_017xRBcV3h25dAMNWki8e1ns

Filing gate: ② a decision only the maintainer can make (rewriting stored values of the append-only compliance ledger, a new permission boundary, a public-contract addition) · Source: fleet (acceptance note of objectstack-ai/hotcrm#2798, routed here by the seat record on that PR).

  • Business reason: an administrator answering a right-of-erasure request deletes the person's records and purges the recycle bin, and the product then offers no way to remove the copies of that person's field values it wrote elsewhere. Who benefits: a deployment that holds personal data and receives such a request. If nothing is decided, the platform's own texts keep calling the purge "the privacy-erasure door".
  • Reader who acts: the maintainer rules the direction and the sub-forks below; the PM seat then files the cards listed under "After the ruling".
  • Dedupe: gh api -X GET search/issues -f q='repo:objectstack-ai/objectstack is:issue <terms>', closed cards included. GDPR 13 hits, anonymise OR anonymize OR anonymization 0, "right to be forgotten" OR "right of erasure" OR "data subject" 50, recycle bin purge audit 30, PII 30, privacy erasure 6, redact sys_audit_log deleted record 13, erasure audit log deleted record values 148 (the bare word matches TypeScript type erasure). No card, open or closed, asks for erasure of the audit, activity or inbox copies. The nearest prior ruling is decision(plugin-auth): sys_audit_log rows the admin identity endpoints wrote before #21174's fix still carry user-field values in free metadata. Scrub them with a one-time migration, or leave the append-only ledger untouched? #21198 (closed not_planned), read below.

维护者速读

  • 问题:管理员按「删除权」请求删掉一个人的记录并清空回收站之后,这个人的姓名、邮箱等字段值仍留在审计日志(至少 90 天,配了归档库是 7 年,没配归档库则一直留着)、动态记录(14 天后自动清掉)和站内通知(90 天后自动清掉)里,产品里没有任何办法删掉这些副本;这是 HotCRM 核对隐私文档时在 18.6.0 上测出来的,目前没有查到任何客户或部署提出过这个请求。
  • 选项:A 平台不做,只把文档和接口说明改成实话(清除不含这三处副本、各自多久过期),1 到 2 个文档 PR;B 平台提供「擦除一条记录的历史」操作,把审计、动态、通知里这条记录的值换成「已擦除」标记,审计行本身(谁、何时、做了什么)保留并留下一条签名的修改记录,约 6 到 8 个 PR 外加一份架构决定的补注;C 给字段加「个人信息」标记,审计和动态从一开始就不存这些字段的值,约 3 到 5 个 PR,代价是审计从此看不到这些字段被改成了什么;D 靠保留期,动态和通知的期限今天已经可以按组织调整,审计日志的 7 年归档期调不了,只需补文档。
  • 推荐 B 作为方向、现在不开工(工作量是 A 的三倍以上):审计日志里存着整条记录的完整副本,存人员数据的平台迟早要能应请求把它擦掉,审计防篡改的设计也已经为「值被合规擦除」留好了位置,但眼下没有客户拉动,所以现在只落「文档说实话」这一步,等第一个部署提出需求、或审计封存默认开启时再建。
  • 不定会怎样:平台自己的接口说明继续把「永久删除」叫作隐私擦除入口,管理员会以为已经擦干净;等审计封存默认开启后,被法律要求擦除的运营者只能直接改数据库,而校验工具会把这种改动报成篡改。

Analysis

Background. On @objectstack 18.6.0 a by-id delete is snapshotted into the recycle bin (30 days by default). An administrator can purge one entry or empty an object's bin. hotcrm measured on the booted app, on crm_contact, with a database scan after the purge: the business table and the bin hold 0 rows, and sys_audit_log (2 rows: the create row's new_value, the delete row's old_value), sys_activity (2 rows, metadata) and sys_inbox_message (1 row, an in-app notification about the new contact) still match the erased person's values. The measurement is at rest. What the product's own read doors then serve is narrower, read from source on origin/main db77cc493a and unchanged at the 18.6.0 tag (@objectstack/objectql@18.6.0, 958ee03594):

Store Who is served a deleted record's rows How long the row lives
sys_audit_log only a holder of view_all_audit_log (platform administrators by default) and system context; field-level redaction still applies to them 90 days hot, then archive-then-delete with 7 years in the archive; with no archive datasource registered, nothing is ever deleted
sys_activity no API reader (a row whose parent record no longer exists is excluded for every caller) 14 days
sys_inbox_message the recipient, in their own inbox 90 days

The three stores are what one measurement on one object found. Source reading shows other stores that copy record values and were not measured: the approval request's payload snapshot and sys_comment (neither declares a lifecycle), the sent-mail log, sys_notification and its deliveries (90 days), automation runs (30 days), files, the search and knowledge indexes, the archive datasource, exported proof bundles and backups.

Governing text. No single text decides the question. Six texts bound it:

docs/NORTH-STAR.md carries no line on erasure, privacy or GDPR (0 hits) and promises no compliance regime. The published package page does: content/docs/plugins/packages.mdx lists @objectstack/plugin-audit under "When to use: SOC 2, HIPAA, GDPR compliance, security monitoring". AGENTS.md has no rule on erasure.

Option B, and the ledger half of option C, cannot land under ADR-0052 as the #21198 ruling read it. That ruling says a rewrite "would have needed a dated note under that decision". docs/adr/** is the maintainer's hand.

Protocol. A: none (a docblock sentence and reference pages change wording; no key changes). B: added (an operation, a capability and an audit action are new public surface, so they are a Feature card of their own, never a Bug option). C: added (a field key with its reader, an ADR-0049 pair). D: none for the documentation; a keep override would add a settings key.

Premises (re-check). Each read on origin/main db77cc493a, at the card's creation time.

  • The ledger is append-only and keeps rows 90 days hot and 7 years archived: git grep -n -E "managedBy: 'append-only'|keep: '7y'" origin/main -- packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts → 2 hits.
  • With no archive datasource the ledger is never deleted: git grep -n "nothing is ever deleted, and the table grows" origin/main -- packages/plugins/plugin-audit/README.md → 1 hit.
  • Activity rows live 14 days, inbox rows 90: git grep -n "maxAge: '14d'" origin/main -- packages/plugins/plugin-audit/src/objects/sys-activity.object.ts → 1 hit; git grep -n "expireAfter: '90d'" origin/main -- packages/services/service-messaging/src/objects/inbox-message.object.ts → 1 hit.
  • A deleted record's ledger rows are served only to the audit capability: git grep -n "A record that no longer exists is read by no caller" origin/main -- packages/plugins/plugin-audit/src/audit-log-read-visibility.ts → 1 hit.
  • No object is sealed yet, so a rewrite today owes no amendment: git grep -n -E "seal\s*:" origin/main -- packages/plugins/plugin-audit/src/objects → 0 hits.
  • The override setting reaches maxAge and expireAfter only: git grep -n -E "name: '(maxAge|expireAfter)'" origin/main -- packages/objectql/src/lifecycle/lifecycle-settings.ts → 2 hits; the sweep's own comment says governance "deliberately does NOT reach" keep (packages/objectql/src/lifecycle/lifecycle-service.ts).
  • The spec names the permanent delete the privacy-erasure door: git grep -n "privacy-erasure door" origin/main -- packages/spec/src/data/data-engine.zod.ts → 1 hit.
  • The permanent delete has no REST door: git grep -n "permanent" origin/main -- packages/rest/src ':!*.test.ts' → 0 hits on the delete route (1 unrelated hit in meta-item-read-gate.ts).
  • Ledger and activity rows name their record by a pointer pair, so a per-record selection needs no guessing: object_name and record_id are declared on both objects; sys_inbox_message has neither and is reached through sys_notification.source_object / source_id.
  • A purge by a person writes no ledger row: git grep -n "a purge by a person is an event-specific writer's to record" origin/main -- packages/plugins/plugin-audit/src/audit-writers.ts → 1 hit, and no such writer exists in the package.

Question. After an administrator deletes a person's record and purges it, what should the platform do about the copies of that record's field values it wrote into the audit ledger, the activity feed and the inbox?

Option What it does What the customer sees Effort
A Nothing in the runtime. The platform's texts say plainly what a purge removes and what stays, with each store's window; the permanent docblock stops calling itself the privacy-erasure door without that limit. An administrator knows the audit copy stays for the ledger's retention, the activity copy 14 days, the inbox copy 90 days. A request to erase them cannot be completed in the product. area:docs plus one docblock sentence in the spec lane · 1 to 2 PRs · precedent objectstack-ai/hotcrm#2798 (+15/−3) for the app page
B An "erase a record's history" operation, separate from purge, addressed by object and record id. It purges the bin entry, replaces the record's values in ledger rows with a redaction marker through the ADR-0154 amendment writer (hot store and archive), removes the record's activity and notification rows, and writes one ledger row recording the erasure. Ledger rows stay: who, when, which action, which record. An administrator completes the request in the product and gets an answer that counts, per store, what was redacted, removed or refused. os audit verify reports those rows redacted, not modified. domain:server + spec + cli + ui · 6 to 8 PRs and a dated ADR note, read off these precedents: hot rewrite #24722 (+1159/−35), archive rewrite #24934 (+896/−69), amendment before rewrite #32630 (+2533/−142), engine verb #30990 (+1130/−58), REST doors #31595 (+1889/−56), grants #31438 (+1088/−325)
C A field-level key that marks a field as personal data. The audit and activity writers store a marker in place of that field's value from the first write on, as they already do for secret and password fields. The ledger records that a personal field changed and never what it changed from or to. Rows already written keep their values. A field nobody marked keeps being copied. spec + plugin-audit + docs · 3 to 5 PRs · no precedent for a classification key with a reader (the earlier DataClassification and compliance schemas were removed as unenforced, ADR-0056 D8)
D Retention only. Activity and inbox windows are already overridable per organization; the texts say so. Optionally the archive's keep becomes overridable. The copies expire on a schedule. A request is answered "within the window", which for the ledger is 7 years, or never where no archive datasource exists. Already shipped by #2791 (+2605/−28) · the delta is A's documentation · a keep override: 1 PR, no precedent, and recorded as deliberately excluded

Business meaning: A is "we keep the books as written and tell you so". B is "we black out one person's details in the books, keep every line, and sign a note saying we did". C is "we never write certain details into the books". D is "the books are shredded on a schedule, nobody's page earlier than another's".

Why B is a separate operation and not a side effect of purge. Purge and empty have uses that are not erasure: emptying a bin to reclaim storage would redact the history of every record in it, and the 30-day reap would do the same on a timer. The grant differs too (see the human floor).

Why B redacts and never deletes ledger rows. ADR-0154 D8 lets expiry remove only a prefix of a chain. A row removed from the middle reads missing once the ledger is sealed, which is the tampering verdict.

The four axes

① Long-term soundness (weighted ≥50%). The ledger does not hold an event trail alone. Its create row holds the whole record and its delete row holds the whole record again, so it is a second copy of the personal data with the longest life of any copy. Two years out, a platform for enterprise applications that hold people's data is asked how an erasure request is completed, and the mainstream answer is an explicit operation that reaches the history: Dataverse lets an administrator delete the audit history of one record, HubSpot's permanent delete of a contact removes its history, and Salesforce deletes field history with the hard-deleted record. The tamper-evidence design already carries this end state: per-column commitments exist so that a redaction can be shown to be the only change, and redacted is a passing verdict. Without B, once the ledger is sealed by default, an operator under a legal duty to erase has one route, a direct database edit, and the verifier reports it as tampering. A keeps the ledger free of any rewrite and is sound only if the platform's texts stop naming an erasure door. C answers a different need: erasing a whole record needs no per-field mark, because every value of the record goes; a mark is what anonymising a live record in place would need. C also blinds the ledger for the fields an auditor asks about first (who changed this contact's email, from what to what). D cannot answer a request with a date on it, and shortening the ledger for everyone to serve one person defeats the ledger.

② Real business need, measured. No customer, deployment or data-subject request was found: none of the searches above returns one in this repository, and none in objectstack-ai/hotcrm (erasure 9 hits, GDPR 13, all internal). What exists is the product's own claim and one pilot: hotcrm publishes a "Right of erasure" section and has fixed six cards (hotcrm#696, #711, #720, #1072, #1164, #2161) that kept a person's record deletable; the platform's package page offers the audit plugin for GDPR compliance; the spec calls the permanent delete the privacy-erasure door. Through the product's read doors the leftover values reach platform administrators (ledger) and the notification's recipient (inbox), nobody else. The objectstack-ai/cloud repository could not be read from this session, so a request recorded there is not excluded.

③ Structural AI-error-proofing. The failure to prevent is a false "erased". Under A with today's wording, an assistant that reads "privacy-erasure door" tells an administrator the purge erased the person, and nobody sees the error until an auditor does: silent. Under A with corrected wording there is nothing to declare and nothing to get wrong. B selects rows by a declared pointer pair and a closed column list, with no guessing of which keys look personal; a sealed row whose amendment cannot be written is refused and counted, which is loud. B fails silently in one way: reporting success while a store was not reached. Its answer therefore has to name every store it does not cover. C is the weakest here: it depends on every author, most often an AI writing metadata, marking every personal field, and no publish-time check can know that a free-text field holds a person's details. A missed mark means the value is copied for years and nothing reports it. D declares nothing per application; an override below a consumer's floor is rejected loudly, but a ledger with no archive datasource keeps everything whatever window is set, and says so only in a status line.

④ Startup focus. A adds no surface. D adds none beyond what shipped. B adds an operation, a capability, an audit action, a door and a Console action, each a permanent obligation, for a need with no external pull, and ADR-0148 already placed "erasure proof" in the enterprise layer on the cloud side. C adds a declared key that every object author must then maintain, in a place where the last classification surface was removed for having no reader.

os-decision-facets

Human floor (the maintainer decides; no seat answers these)

Recommendation

B as the direction, not started now. Derived from ① alone: the ledger holds a full second copy of the record, the mainstream end state is an operation that reaches the history (Dataverse's per-record audit history deletion, HubSpot's permanent delete), and ADR-0154 already defines how a lawful redaction verifies. ② and ④ move the timing, not the letter: with no customer or deployment asking, nothing of B is built until a named trigger fires. The two candidate triggers are the first deployment or customer that files an erasure need, and the change that makes sys_audit_log sealed by default (#31908), whichever comes first. What lands now is A's content, as a correction of texts that overstate (a defect, so it is not a half-built B).

The effort gap is named as required: A is 1 to 2 PRs and B is 6 to 8 plus an ADR note, more than three times. The ① readings are not close on the end state, but they are close on what the next quarter looks like, because "B, later" and "A" dispatch the same work today. The difference is what the ruling records: under A the platform's position is "the ledger is not erased, by design"; under B it is "the ledger will be erasable through the amendment route, built on a trigger".

Not taken, one sentence each:

  • A as the final position: it leaves an operator with a legal duty no route except a database edit that the sealed ledger reports as tampering.
  • C: a whole-record erasure needs no field mark, the mark blinds the ledger for the fields auditors ask about, and a missed mark fails silently.
  • D: it is already shipped for activity and inbox, and for the ledger a window of years is not an answer to a request.

Self-check: only ① picks B; ②③④ flip it: yes for the timing (② measures no external pull and ④ says do not add surface without pull), no for the letter. The maintainer can read the same facts as A.

Confidence gaps, none of which changes the letter:

Sub-forks, to be ruled with the letter

These apply only if the letter is B. Each carries the analyst's reading; every one that touches the human floor is the maintainer's.

  1. Timing: on a named trigger (recommended), or now.
  2. Shape: a separate operation (recommended), or a side effect of purge.
  3. Authority: its own capability that no object grant implies, held by the platform administrator by default (analyst's reading), or the existing recycle-bin grant; and whether the first door is an operator command or an in-product action. Human floor.
  4. Ledger change: redact values and keep rows, through the amendment writer, under a dated note to ADR-0052. Human floor.
  5. Home: mechanism in the framework, proof and certificate on the cloud side (analyst's reading), or all of it on the cloud side. Human floor.
  6. Coverage: a census card of value-copying stores lands before the build, and the operation's answer names every store it does not reach.

After the ruling.

  • A: one area:docs card corrects the platform texts: the recycle-bin reference page, the audit plugin's retention section, the package page's compliance line, and the permanent docblock sentence (spec lane, wording only, Metadata-protocol: none). The reopening trigger is recorded on this card, which then closes. hotcrm#2798 already carries the app's page.
  • B, on a trigger: the same docs card is dispatched now. This card records the direction and the sub-fork answers and leaves the active queue. When the trigger fires, the PM seat files, in order: the ADR note for the maintainer's hand; the census card; a spec Feature card for the operation, the capability and the audit action (Metadata-protocol: added); the plugin-audit and engine card (hot store and archive, through the amendment writer); the door; the Console action; the docs and the hotcrm page.
  • B, now: the same list, started at once, with the docs card folded into its last step.
  • C: a spec Feature card for the key with its reader in the same change (ADR-0049), then the writers and the docs. Rows already written stay as they are unless B's rewrite is ruled as well.
  • D: the docs card as under A. A keep override, if wanted, is its own settings card.
  • Under every letter: hotcrm builds no erasure of platform tables of its own. The app's page says what is true on the pinned release.

Related. objectstack-ai/hotcrm#2794 and PR objectstack-ai/hotcrm#2798 (the measurement); #21198 and ruling record 5942375063 (no rewrite, and the reopening clause); #21207 and ruling record 5950183039 (the bounded rewrite exception); #31908 (the tamper-evidence build); #3146 and ADR-0148 (the recycle bin and the cloud boundary); #8993 (partial masking, the nearest field-level key); ADR-0052, ADR-0057, ADR-0154, ADR-0056.

Activity

  1. added
    needs-user-decision
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:data · Feature · priority:p3 · needs-user-decision · size L; rationale: a decision on whether the platform offers an erasure that reaches copies of a purged record's values (audit log, activity feed, notifications). It is a new capability that rewrites stored compliance-ledger values. A fleet-sourced Feature is p3, and it goes on the weekly list for the maintainer to pick.

    No dispatch until the maintainer rules. If the ruling keeps the purge as it is, the wording that calls the purge "the privacy-erasure door" is a wrong sentence in shipped text, and it becomes its own Bug card at that point.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:dataneeds-user-decisionpriority:p3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions