Skip to content

Component: Smrt.SmrtSpace.Archive

Canonical source: SmrtApps/src/Smrt.SmrtSpace.Archive/README.md (mirrored below)


Smrt.SmrtSpace.Archive

Overview & Responsibilities

  • Provides the SmartSpace Archive append-only SQLite writer used to persist SmrtSpace save metadata and content text/JSON.
  • Ensures archive storage follows SmrtHub operational data conventions (SmrtDB under Local AppData).
  • Creates and maintains the archive schema (tables + indexes + FTS search surface) on first use.

Public surface / Entry points

  • Library API only (no UI or hosted service).
  • Primary entry point: SmartSpaceArchiveWriter.

Dependencies & Integrations

  • Uses Smrt.Config for SmrtDB path resolution.
  • Uses Smrt.Logging for policy-aligned logging.
  • Intended for consumption by runtime components that persist SmartSpace save metadata.

Configuration & Log Paths

  • Archive database: %LOCALAPPDATA%/SmrtHub/SmrtDB/smart-space-archive/archive.db.
  • Logging uses the standard %LOCALAPPDATA%/SmrtHub/Logs/<component>/ conventions via Smrt.Logging.

Runtime flows

  • SmartSpaceArchiveWriter.Append(...):
  • Ensures the archive database, schema, and FTS index exist.
  • Inserts entries and associated search rows in a single transaction.
  • Avoids updates or deletes (append-only).

Key APIs

  • SmartSpaceArchivePaths.GetDatabasePath() — resolves the canonical SQLite path.
  • SmartSpaceArchiveWriter.Append(entries) — inserts archive entries.

Testing & Validation

  • Build the project: dotnet build SmrtApps/src/Smrt.SmrtSpace.Archive/Smrt.SmrtSpace.Archive.csproj -c Debug.
  • Validate archive schema creation by invoking the writer from the SmrtSpaceArchive runtime app.
  • Unit tests: dotnet test SmrtApps/src/Smrt.SmrtSpace.Archive.Tests/Smrt.SmrtSpace.Archive.Tests.csproj -c Debug.

Support Bundle & Diagnostics

  • The archive database lives under SmrtDB and is included in operational data exports.
  • Archive entries store content text/JSON; image bytes are never persisted.
  • Avoid logging raw clipboard content; log metadata only.

Directory Map

  • SmartSpaceArchiveEntry.cs — archive entry data contract.
  • SmartSpaceArchivePaths.cs — canonical SmrtDB path helper.
  • SmartSpaceArchiveWriter.cs — SQLite writer implementation.
  • Smrt.SmrtSpace.Archive.csproj — .NET 8 class library project.
  • bin/, obj/ — build outputs.