You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filed while planning #151 (ADR 014). #156 proposes that Reset stop selectively preserving any table
and instead drop the entire database and rebuild it in one step from the fresh-database baseline
script — the same path a brand-new install uses. That means, once #156 ships, a Reset will empty the
audit-trail tables (System_AuditEntries, System_ImportConflicts, System_ImportActions, System_ChangeLog) completely, not just rows referencing entities that later changed id. Today these
four tables are excluded from Reset's drop list and survive it unconditionally — #156 removes that
survival entirely.
ADR 014 accepts this loss as the correct behaviour for Reset itself (Reset becomes, by design, "start
over completely"), on the condition that an operator who wants to keep the audit trail has a way to
do so first. This issue is that export mechanism — a genuine functional gap, not yet designed or
implemented.
What needs to be done
Design and implement an export step that writes the current contents of the four audit-trail tables
to a dedicated audit-history folder before a destructive Reset proceeds. Open design questions to
resolve during planning, not decided here:
Trigger: either the export runs automatically and unconditionally as the first step of every
Reset (before the backup DropAndRebuildAsync already takes), or it is a separate, standalone admin
action the operator invokes beforehand. Not open for design: a request parameter letting the caller
opt in/out of the export on a single Reset call. Per CLAUDE.md's "Endpoint side-effect policy
(Single Responsibility)" (added while planning Should System_-prefixed provenance tables purge rows referencing Reset-wiped entities? #151/ADR 014), an endpoint must never grow a flag that
changes what data survives the call — the choice is between "always happens" (a capture step, not a
data-retention decision, so it doesn't violate the policy) and "a fully separate action," not a
toggle on Reset itself.
Format and location: what "a dedicated audit-history folder" means operationally — likely
alongside the existing backup file mechanism (CreateBackup in DatabaseInitializer.cs) rather than
a new persistence concept. Decide the file format (e.g. one JSON file per table, timestamped) and
exact path under the data directory.
Scope of the four tables: confirm all four (System_AuditEntries, System_ImportConflicts, System_ImportActions, System_ChangeLog) export the same way, or whether any has a reason to be
handled differently.
Dependency
Release gate on #156, not an implementation-order dependency. Per ADR 014, a tagged release must
never ship #156's destructive full-rebuild Reset without this export path already present in that same
release — but #249 and #156 can be designed, built, and merged in either order or in parallel.
Definition of done
Design questions above resolved and recorded in a plan doc
Background
Filed while planning #151 (ADR 014). #156 proposes that Reset stop selectively preserving any table
and instead drop the entire database and rebuild it in one step from the fresh-database baseline
script — the same path a brand-new install uses. That means, once #156 ships, a Reset will empty the
audit-trail tables (
System_AuditEntries,System_ImportConflicts,System_ImportActions,System_ChangeLog) completely, not just rows referencing entities that later changed id. Today thesefour tables are excluded from Reset's drop list and survive it unconditionally — #156 removes that
survival entirely.
ADR 014 accepts this loss as the correct behaviour for Reset itself (Reset becomes, by design, "start
over completely"), on the condition that an operator who wants to keep the audit trail has a way to
do so first. This issue is that export mechanism — a genuine functional gap, not yet designed or
implemented.
What needs to be done
Design and implement an export step that writes the current contents of the four audit-trail tables
to a dedicated audit-history folder before a destructive Reset proceeds. Open design questions to
resolve during planning, not decided here:
Reset (before the backup
DropAndRebuildAsyncalready takes), or it is a separate, standalone adminaction the operator invokes beforehand. Not open for design: a request parameter letting the caller
opt in/out of the export on a single
Resetcall. Per CLAUDE.md's "Endpoint side-effect policy(Single Responsibility)" (added while planning Should System_-prefixed provenance tables purge rows referencing Reset-wiped entities? #151/ADR 014), an endpoint must never grow a flag that
changes what data survives the call — the choice is between "always happens" (a capture step, not a
data-retention decision, so it doesn't violate the policy) and "a fully separate action," not a
toggle on Reset itself.
alongside the existing backup file mechanism (
CreateBackupinDatabaseInitializer.cs) rather thana new persistence concept. Decide the file format (e.g. one JSON file per table, timestamped) and
exact path under the data directory.
long-lived homelab install, similar to the pruning concern already raised in Import-table naming standardization + general import-file content provenance (FileResource / FileResourceLine) #227 for a different
table. Decide whether this needs its own retention policy from day one or can defer.
System_AuditEntries,System_ImportConflicts,System_ImportActions,System_ChangeLog) export the same way, or whether any has a reason to behandled differently.
Dependency
Release gate on #156, not an implementation-order dependency. Per ADR 014, a tagged release must
never ship #156's destructive full-rebuild Reset without this export path already present in that same
release — but #249 and #156 can be designed, built, and merged in either order or in parallel.
Definition of done
docs/milestones/maintenance-milestone-v1.8.0/overview.mdupdated to reflect the release-gaterelationship to Reset: use the fresh-database baseline script instead of drop-all-user-tables + replay #156