Legal Hold
A record that some subject's data must not be deleted, because litigation, an investigation or a regulator's retention rule says so. A hold outranks a retention schedule and a data-subject erasure request alike: GDPR Article 17(3)(e) carves out exactly this, and FRCP 37(e) is what happens to an organization that deletes anyway.
The hold is a row, not a flag on the data, so placing one does not touch the records it protects and releasing one does not risk them. What matters is that the deletion paths ask: a hold nobody checks is a note, not a hold.
Placing and releasing both demand a written reason, and both are audited with it. A citation names the authority when there is one, and the framework knows the common ones so a typo in a rule number does not read as a different rule.
b.legalHold.create(opts) #
{
db: object, // a b.db handle; required
audit: boolean|object, // true, false, or a b.audit-shaped sink
signWith: object, // a b.auditSign-shaped object with sign()
}
Open the hold register against a database handle. The handle carries place(subjectId, args), release(subjectId, args), isHeld(subjectId), get(subjectId), list(filter?) and history(subjectId).
isHeld is the call a deletion path makes before it deletes. Nothing else stops a delete: the register records the decision, and the code that erases has to read it.
place and release each require args.reason and refuse without one, because a hold with no stated basis cannot be defended later and neither can lifting one. citation names the authority, retainUntil is when the hold lapses, and history keeps every placement and release rather than only the current state.
signWith takes a b.auditSign-shaped object, which signs the register entries so a later reader can tell the record has not been edited.
var b = require("@blamejs/core");
var holds = b.legalHold.create({ db: b.db });
holds.place("customer-42", {
reason: "Acme v. Example, discovery opened 2026-03-01",
citation: "FRCP-37(e)",
});
holds.isHeld("customer-42"); // → true, so the erasure path stops