MindAttic.Storage/SPEC
MindAttic.Storage — Product specification
The complete product, written down before it is built (owner, 2026-11-30, MAT-T360). Every epic, feature and story the finished product will have is listed here, built or not. The ticket tree mirrors this file one to one: every ID below is a ticket. Nothing gets built unless it is here, and anything taken out of here is closed wont-do in the tree.
docs/RELEASE.mdsays which part of this the current milestone delivers.
1. Product definition
In docs/ECOSYSTEM.md MindAttic.Storage owns the files concern: apps store and serve uploaded files through it.
MindAttic.Storage (formerly MindAttic.Media) is drop-in media storage for ASP.NET Core apps: one upload API, one catalog row per file and a /_media/{uid} endpoint that serves the file back safely. Azure was decommissioned on 2026-11-26, so the finished product is a local-disk-only library: MindAttic.Storage 2.0.0 on the local feed, with the frozen Azure package removed once its last consumers have switched.
2. Scope boundary
2.1 In the product
MindAttic.Storage:IMediaStore, the EF model,LocalDiskMediaStore, the spill stream and the media endpoint.- Docs that name the supported path and how consumers move to it.
- Until MS-154: the frozen
MindAttic.Storage.Azurepackage, for consumers that still reference it.
2.2 Never in the product
- New Azure or other cloud backends. Azure is decommissioned; no new cloud work.
- Azure tests, signer or SAS work. The Azure package is frozen until it is removed.
- Image processing. Width and height are recorded when given; nothing resizes or transcodes.
- Databases other than SQL Server. The column mapping targets SQL Server.
- Generic cleanups, bughunts and repo sweeps.
3. Users and roles
- A consuming app (Prose, IdeaCms) adds uploads in two lines and serves files by a stable id.
- A browser fetches
/_media/{uid}and must never be served active content inline.
4. Requirements
Status is built (closed ticket, with evidence) or MS-n: the milestone in §7 that delivers it.
E1. Media storage library — M.MDIA-T39 — built
F1.1 Upload and catalog — M.MDIA-T40 — built
- S1.1.1 Streaming upload with hash — M.MDIA-T41 — built. As an app,
UploadAsyncstreams once, computing size and SHA-256 in the same pass. Evidence:MediaStreams.CopyAndHashAsync. - S1.1.2 Inline or spill by size — M.MDIA-T42 — built. As an app, payloads up to
InlineThresholdBytes(2 MB) live in the row; larger ones spill toMediaRoot/{uid}/{file}. Evidence:ThresholdSpillStream. - S1.1.3 Soft delete — M.MDIA-T43 — built. As an app,
DeleteAsyncflags the row and keeps the file. - S1.1.4 No orphans on failure — M.MDIA-T44 — built. As an app, a cancelled upload removes its spill file. Evidence: 4817589.
- S1.1.5 Legacy names still resolve — M.MDIA-T45 — built. As an app, rows stored under the old naming rule still resolve. Evidence:
MediaNaming.LegacySanitizeFileName.
F1.2 Serving — M.MDIA-T46 — built
- S1.2.1 Media endpoint — M.MDIA-T47 — built. As a browser,
GET /_media/{uid}streams with ETag, Last-Modified and Range. Evidence:MapMediaEndpoints. - S1.2.2 Safe to serve — M.MDIA-T48 — built. As a user, every response carries
nosniffand active content only downloads, under a sandbox CSP. Evidence: fe7d3cb, M.MDIA-T18.
F1.3 Packages 1.0 — M.MDIA-T49 — built
- S1.3.1 Storage 1.0.0 packages — M.MDIA-T50 — built. As a consumer, I reference MindAttic.Storage 1.0.0 from
C:\LocalNuGet, withMIGRATION.mdmapping the old Media names. Evidence: d73f2c1, 5c18aad. - S1.3.2 Azure Blob backend (frozen) — M.MDIA-T51 — built. As an existing consumer,
AddMediaAzurestores files in a blob container. Evidence:src/MindAttic.Storage.Azure.
E2. Local-disk store proven — M.MDIA-T31 — built
F2.1 DI wiring — M.MDIA-T32 — built
- M.MDIA-T4 — built. As an app developer,
AddMediaregisters a scopedLocalDiskMediaStoreasIMediaStoreand applies my options (or the defaults). Acceptance: givenAddMediawith no options, whenIMediaStoreis resolved, then it is aLocalDiskMediaStorewith defaultMediaStoreOptions. Evidence:ServiceCollectionExtensionsTests(build-verified).
E3. Consumers guided off Azure — M.MDIA-T33 — built
F3.1 Overview marks Azure frozen — M.MDIA-T34 — built
- M.MDIA-T10 — built. As a new consumer,
docs/overview.mdpresents the local-disk store as the supported path and the Azure package as frozen. Evidence: the overview's intro, diagram, quick start and "Azure is frozen" notice.
F3.2 Consumer switch note — M.MDIA-T35 — built
- M.MDIA-T36 — built. As Prose or IdeaCms,
MIGRATION.mdnames me as still on Storage.Azure 1.0.0 and tells me how to switch toAddMedia<TContext>with a localMediaRoot. Evidence:MIGRATION.md"Switching off MindAttic.Storage.Azure" (follow-ups PRS-T1408, IDEA-T213). - S3.0.1 One path off Azure (membrane) — M.MDIA-T57 — built. Acceptance: given both docs written, when a consumer starts at the overview, then it reaches
MIGRATION.mdby a link and every API either page names exists in the code. Joins F3.1 and F3.2.
E4. One storage package — M.MDIA-T52 — MS-154
F4.1 Remove the Azure package — M.MDIA-T53 — MS-154
- S4.1.1 Azure project removed — M.MDIA-T54 — MS-154. As the maintainer, once no workspace project references
MindAttic.Storage.Azure, the Azure project, its tests and the signer leave the solution. Acceptance: given a workspace grep finds no Storage.Azure reference, when the solution builds, then it has no Azure project. It also takesIMediaUrlSigner, the endpoint's signed-URL branch andSignedUrlLifetime, which serve only Azure.
F4.2 Storage 2.0 polish and release — M.MDIA-T55 — MS-154
- S4.2.1 Storage 2.0.0 released — M.MDIA-T56 — MS-154. As a consumer, 2.0.0 is on
C:\LocalNuGet, the docs describe the local-disk-only library, and the owner signs off. - S4.0.1 The package on the feed (membrane) — M.MDIA-T58 — MS-154. Acceptance: given 2.0.0 on
C:\LocalNuGet, when a scratch app restores it alone, registersAddMedia, maps/_media/{uid}and stores and reads one file, then it works and the package holds no Azure types. Joins F4.1 and F4.2.
5. Non-functional requirements
- .NET 10, ASP.NET Core and EF Core on SQL Server. Streaming, never buffering whole uploads.
- Active content never renders inline (M.MDIA-LAW-2); public type names and
/_mediastay stable (M.MDIA-LAW-4).
6. Interfaces and dependencies
Platform concerns it uses (docs/ECOSYSTEM.md): none directly; the host app passes its storage root, which it reads through MindAttic.Vault.
- Consumers: Prose (Prose.Core) and IdeaCms (IdeaCms.Blazor). Their switch off Storage.Azure gates MS-154.
7. Release sequence
- MS-57 — MindAttic.Storage 1.x: local-disk store, Azure frozen (active): E2, E3.
- MS-154 — MindAttic.Storage 2.0: local-disk only (planned): E4, ending with polish and release. Reaching it finishes the product.
8. Change log
| Date | Change to scope | Ticket |
|---|---|---|
| 2026-11-30 | Specification written from the BIBLE, charter, MIGRATION.md, code and ticket history; the Azure package's removal became MS-154 | MAT-T397 |
| 2026-11-30 | MAT-T462 single-source pass: 3 renamed, 0 buckets, 1 requires added (MS-154 after MS-57), 0 platform re-points | MAT-T465 |
| 2026-12-01 | Build-up plan phase: ledger 26/26 read and seated (every history credit was the rename sweep, R22); Azure-only code assigned to S4.1.1 (M.MDIA-T54), which now names IMediaUrlSigner and the signer branch; membranes S3.0.1 (M.MDIA-T57) and S4.0.1 (M.MDIA-T58)
|
M.MDIA-T52 |
| 2026-12-01 | Build-up: AddMedia registration tests (ServiceCollectionExtensionsTests); F2.1 built
|
M.MDIA-T4 |
| 2026-12-01 | Build-up: docs/overview.md presents AddMedia as the supported path and marks MindAttic.Storage.Azure frozen; F3.1 built
|
M.MDIA-T10 |
| 2026-12-01 | Build-up: MIGRATION.md names Prose and IdeaCms as still on Storage.Azure 1.0.0 and gives the switch to AddMedia<TContext>; F3.2 built
|
M.MDIA-T36 |
| 2026-12-01 | Build-up membrane: the overview's frozen notice links MIGRATION.md's switch section; a cross-read found every API name on both pages in the code; E3 built | M.MDIA-T57 |