Close the forms of forgetting that are not named like removal

The retention claim covered methods named like removal and nothing else,
so the archive forgot everything on assignment: archive = LineageArchive{}
discarded every record, and assigning a copy taken before a death
restored that organism's living state, defeating terminal death as well.

The copy and move policy is now part of the interface rather than left to
the defaults. Both forms of assignment are deleted, which also makes the
archive unswappable since swapping needs them. Declaring the copy
constructor suppresses the implicit moves, so a move decays to a copy and
a moved-from archive still holds every record rather than being emptied
the way a moved-from container would be.

Copying stays available on purpose: a clone takes nothing from the
original, and GENOME_MODEL expects migrations to be rehearsed on cloned
worlds. Deleting the move constructor as well would be stricter but would
stop an archive being returned from a function, so it decays instead.

The interface tests now cover assignment, replacement from a temporary
and swapping alongside the named methods, each with a std::vector
positive control so the checks are known to be live. Runtime checks
confirm a copy taken before a death leaves the original's terminal record
standing, and that a moved-from archive still holds everything. All four
static assertions were confirmed to fail with the deletions removed.

ADR-0034 said the type offered no way to forget. That was too narrow, and
the Decision and Alternatives now say why assignment counts.

Native Release, clang-tidy analysis, ASan and format checks pass 21/21.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-23 17:07:17 -04:00
co-authored by Claude Opus 5
parent 8020347f9b
commit 29ce255cfb
4 changed files with 85 additions and 0 deletions
+13
View File
@@ -35,6 +35,19 @@ inline constexpr std::size_t max_archived_organisms = 65'536;
// this interface rather than a rule a caller has to remember.
class LineageArchive {
public:
LineageArchive() = default;
// Copyable: cloning an archive takes nothing away from the original, and
// GENOME_MODEL expects migrations to be rehearsed on cloned worlds.
// Declaring the copy constructor also suppresses the implicit moves, so a
// move decays to a copy and a moved-from archive still holds every record.
LineageArchive(const LineageArchive&) = default;
// Not assignable, in either form. Assignment is a removal operation that is
// simply not named like one: it discards every record the target holds. It
// would also let a copy taken earlier be written back, restoring an organism
// already recorded as dead, and death is terminal.
LineageArchive& operator=(const LineageArchive&) = delete;
LineageArchive& operator=(LineageArchive&&) = delete;
// A parent must already be present, so ancestry never dangles and the parent
// graph cannot contain a cycle: a cycle would need a member admitted first.
[[nodiscard]] std::expected<void, HistoryError> admit(const Genome& genome);