Table of Contents

Class ErasureRetention

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

A declaration that one aggregate type must survive an erasure, because the law requires the data it holds to be kept.

public sealed record ErasureRetention : IEquatable<ErasureRetention>
Inheritance
ErasureRetention
Implements
Inherited Members

Remarks

The case this exists for. Article 17(3) withholds the right to erasure to the extent processing is necessary to comply with a legal obligation. For many businesses the obligation covers the customer's IDENTITY, not merely the transaction: a vehicle title transfer, a lien entry or a safety recall notice is worthless without the buyer, and a warranty cannot be honoured without knowing who holds it. Erasing such a record is not compliance; it is a different breach.

The unit is the AGGREGATE TYPE, WHOLE, and that is a legal fact rather than a convenience. An obligation to keep a record attaches to the RECORD. A statute requiring sales records to be kept does not require the buyer and permit deleting the salesperson: a partly-erased record is a MUTATED record, and a mutated record has no evidentiary value — which is the entire reason it was being kept. So EVERY data subject named in a retained aggregate type is covered by that record's obligation for as long as it is in force, and nothing inside it is destroyed for anyone.

An event belongs to exactly one aggregate, which is what makes the unit implementable. An aggregate boundary is also an event boundary, so a retention is honoured without ever having to split a stored event — whose erasure is total, all fields and its type name together. A finer unit has no boundary to use, and would force destroying retained data or keeping erased data with no third option.

What that means for the other people named in the record, and why the certificate must say it. A data subject who appears in a retained aggregate is not erased from it. They are entitled to be told that their personal data lawfully persists there and on what basis, so this declaration's basis, justification and period are carried onto the erasure record for every such subject — not only for whoever the obligation was written with in mind.

What this asks of you in return. The retained aggregate must carry its own copy of whatever it needs. A sales record that reaches its buyer by following a reference into a customer aggregate breaks when that customer is erased. This is ordinary aggregate independence and it is the modelling discipline the retention depends on.

Re-linking is yours. If the subject returns and a new aggregate is created for them, matching it to the retained record is a business decision — on the identifiers, the addresses or the transaction data you hold. The framework does not attempt it and does not keep a hidden link, because a hidden link would be exactly the re-identification the erasure was supposed to remove.

Properties

AggregateType

Gets the aggregate type this retention protects, as it appears in the event store.

public required string AggregateType { get; init; }

Property Value

string

The aggregate type name, matched ordinally.

Basis

Gets the lawful basis under which the data is retained.

public required LegalHoldBasis Basis { get; init; }

Property Value

LegalHoldBasis

The Article 17(3) ground being relied on.

Justification

Gets the written justification recorded against every erasure this retention narrows.

public required string Justification { get; init; }

Property Value

string

A statement naming the obligation, in terms an auditor can evaluate — the statute, the retention schedule or the regulator's requirement. Never a restatement of the basis.

Remarks

Write it about the RECORD, not about a person. The obligation attaches to the record, and this text is shown to every data subject who appears in it — including people the statute was not written with in mind. "Vehicle sales records are kept for six years under the tax code's record-keeping requirement" is a statement an auditor and any named subject can both evaluate; "the buyer's identity is required" reads as one person's obligation and is wrong for everyone else named on the same record. This cannot be checked mechanically — startup validation only refuses a blank justification and one that merely restates the basis.

RetentionPeriod

Gets how long the obligation lasts.

public required TimeSpan RetentionPeriod { get; init; }

Property Value

TimeSpan

The statutory retention period. Must be greater than zero.

Remarks

Required, and required for a reason. A statutory retention ENDS. A retention with no period converts a time-bounded obligation into permanent retention, which is a breach of Article 17 in the other direction — so the period cannot be left unsaid. Being required makes an OMITTED period impossible; startup validation rejects zero and below. Neither makes an absurdly long one impossible, and nothing here pretends otherwise: a period of a thousand years is constructable and is the declaring party's statement to defend.

What the framework does and does not do with it. The period is recorded and REPORTED; it is not a timer that erases anything. The instant at which a particular record's obligation lapses depends on facts the framework does not hold — the transaction date, the jurisdiction, whether the period was extended — and acting on someone else's statutory clock is not a promise we can keep. So the obligation this type creates for you is to release the retention when it expires. What we guarantee is that the period is declared, carried onto the erasure record, and visible.

Tenant

Gets the tenant partition whose obligation this is.

public required KeyedTenantPartition Tenant { get; init; }

Property Value

KeyedTenantPartition

Untenanted for a deployment that is not multi-tenant, or Scoped(string?) naming the tenant that owes the obligation.

Remarks

Why a retention is tenanted at all. A retention is a statement about a jurisdiction and a controller, and in a multi-tenant host neither is a property of the process. A tenant-blind retention makes one tenant inherit another's statute, which is over-retention — the Article 17 breach in the other direction, and the one the mandatory period exists to prevent at the type level.

A single-tenant deployment writes KeyedTenantPartition.Untenanted, and there is no second way to write it. That is why this is a partition and not a string. It is joined against TenantPartition, which an erasure request carries alongside the tenant IDENTITY it was filed as — two facts, because they answer different questions: the identity decides which key decrypts the data, the partition decides whose legal obligations apply.

SUPERSEDED DOCUMENTATION, quoted so a reader who inherited it recognises it. This contract previously claimed that "an untenanted request carries that sentinel — every spelling of untenanted … collapses onto it", and that the ambient identity being a different value "is not an inconsistency — the two describe different things". Both halves were false in the same direction. A single-tenant request was stamped with the ambient identity and compared DIRECTLY against this value, so the join missed; and because a retention miss destroys the key protecting the retained record, the second sentence talked a reader out of noticing the exact mismatch that shredded it. The fields are separate now, so neither claim is needed and neither can be reintroduced.

A mismatch erases rather than retains, and that is the chosen direction. A retention declared for the wrong tenant does not match, so the record is destroyed. That is visible — the erasure record will not name the retention — whereas the opposite default would silently withhold erasure from every other tenant's data subjects.