Skip to content

ADR-0027: MF White List flat file packages, caches, store contracts and lookup - #363

Draft
milten89 wants to merge 1 commit into
developfrom
docs/319-flat-file-storage-adr
Draft

milten89 wants to merge 1 commit into
developfrom
docs/319-flat-file-storage-adr

Conversation

@milten89

Copy link
Copy Markdown
Owner

Closes #319

Draft: merge only after release/1.1 is cut, so the record ships with the flat-file code in 1.2.0 and can be corrected in place until release/1.2 is cut (ADR-0022). The merging PR sets status: accepted in the record and the index.

What it decides

  • Packages: OpenUrzednik.MF.WhiteList.FlatFile (download, checksum, decode, hash chain, checks, refresher, the contracts, the disk stores, both built-in archive formats; SharpCompress per ADR-0024), .DependencyInjection (with Polly.Core and the rejection handler), .Hosting (Microsoft.Extensions.Hosting.Abstractions 8.0.0, approved 2026-11-22), and store packages with their own ADRs. The base OpenUrzednik.MF.WhiteList API doesn't change.
  • Contracts, frozen at release: IWhiteListFlatFileStore (hot), IWhiteListFlatFileArchiveStore (cold) and IWhiteListFlatFileArchiveFormat (encode before saving, decode on restore; the ministry's .7z by default, the library's binary day file built in). Stores see only 64-byte WhiteListFlatFileHash values, never identifiers. Failures are results (ADR-0002).
  • Caches: central HotCacheMaxDays = 2 and ColdCacheMaxFiles = 30; size limits are store options (MaxTotalBytes on the disk archive store). Disk-store defaults under local application data, not temp.
  • Disk store: one binary day file (header, 64K prefix index, sorted lists), memory-mapped.
  • Lookup: exact hash first, mask candidates only after a miss; the result carries VatStatus?, VirtualAccount and FileDate, no hash. Evidence is the kept ministry archive.
  • Configuration: typed options per store, nested under the flat-file configuration section; provider-named DI extensions on IHttpClientBuilder.

Follow-ups

Checks

  • reviewer agent: no blocking findings; its 9 should-fix and 7 nit findings are applied (package dependencies, the DI package's rejection handler and download timeout, the binary day file as the working format, OpenBinaryAsync, ADR-0021 error subclasses, Retry-After first, persistent default directories, provider-named DI extensions, the legal-basis checklist item).
  • Docs only: no build or tests run.

🤖 Generated with Claude Code

…ts and lookup

Proposed record for the flat-file packages (#319): the base package with
the disk stores, frozen hot-store, archive-store and archive-format
contracts, a 64-byte hash struct, central day and file limits with size
limits in the stores, a memory-mapped binary day file, the ministry's
.7z as the default cold-cache format, and the refresher with a thin
hosting package. Merged after release/1.1 is cut, so it ships in 1.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milten89 milten89 added the documentation Improvements or additions to documentation label Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Flat file: storage and lookup ADR

1 participant