Coverage for node / src / stigmem_node / models / tombstones.py: 100%
40 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-25 01:49 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-25 01:49 +0000
1"""RTBF tombstone models."""
3from __future__ import annotations
5from pydantic import BaseModel, Field
8class TombstoneNotice(BaseModel):
9 """Tombstone metadata surfaced to admin callers on time-travel queries.
11 Covered by Spec-X3-Time-Travel-Queries.
12 """
14 entity_uri: str
15 tombstone_id: str
16 legal_hold: bool
17 tombstone_created_at: str
20# ---------------------------------------------------------------------------
21# RTBF Tombstones (Spec-X2-RTBF-Tombstones)
22# ---------------------------------------------------------------------------
25class TombstoneRecord(BaseModel):
26 """Durable record directing every node to suppress facts about entity_uri.
28 Covered by Spec-X2-RTBF-Tombstones.
29 """
31 id: str
32 entity_uri: str
33 scope: str
34 reason: str | None = None
35 signed_by: str
36 key_id: str = ""
37 signature: str
38 created_at: str
39 legal_hold: bool = False
42class TombstoneRevocationRecord(BaseModel):
43 """Record reinstating a tombstoned entity (Spec-X2-RTBF-Tombstones)."""
45 id: str
46 tombstone_id: str
47 reason: str
48 signed_by: str
49 key_id: str = ""
50 signature: str
51 created_at: str
54class TombstoneCreateRequest(BaseModel):
55 entity_uri: str = Field(..., min_length=1)
56 scope: str = Field("*")
57 reason: str | None = None
58 legal_hold: bool = False
61class TombstoneRevokeRequest(BaseModel):
62 reason: str = Field(..., min_length=1)
65class TombstoneStatusResponse(BaseModel):
66 tombstoned: bool
67 tombstones: list[TombstoneRecord]
68 revocations: list[TombstoneRevocationRecord]
71class FederationTombstonesResponse(BaseModel):
72 tombstones: list[TombstoneRecord]
73 revocations: list[TombstoneRevocationRecord]
74 cursor: str | None