Hero-module: Units Generation (unit-of-work, dependency, requirement-map)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 14:48:24 +01:00
co-authored by Claude Sonnet 5.5
parent d00d9c9120
commit a29dc22620
5 changed files with 129 additions and 11 deletions
@@ -47,7 +47,7 @@
- [x] User Stories (SKIP: one persona, acceptance criteria in the requirements)
- [x] Workflow Planning (approved by Bryan 2026-11-16)
- [x] Application Design (artifacts in inception/application-design/, awaiting approval)
- [ ] Units Generation - EXECUTE
- [x] Units Generation (unit-of-work.md, -dependency.md, -story-map.md; plan answered 2026-11-16)
### 🟢 CONSTRUCTION PHASE
- [ ] Functional Design - EXECUTE
- [ ] NFR Requirements - EXECUTE
@@ -0,0 +1,43 @@
# Unit dependencies: hero-module
Rows depend on columns (X = needs it built first; (c) = only a contract, no code dependency).
| | H1 | H3 | H2 | H4 | H5 | H6 | ASF golden files | SLS input |
|---|---|---|---|---|---|---|---|---|
| **H1** Image pipeline | n/a | | | | | | | |
| **H3** Media store and serving | X (addresses, options) | n/a | | | | | | |
| **H2** Hero module backend | X | X | n/a | | | | (c) JSON shape | |
| **H4** Injection | | | X | n/a | | | X (tests) | (c) title lines |
| **H5** Admin | | | X (API) | | n/a | | | |
| **H6** Delivery | | | X | X | X | n/a | | |
```mermaid
flowchart LR
H1["H1 Image pipeline"] --> H3["H3 Media store<br/>and serving"]
H1 --> H2["H2 Hero backend"]
H3 --> H2
H2 --> H4["H4 Injection"]
H2 --> H5["H5 Admin"]
H3 --> H5
H4 --> T1(["First test deploy"])
T1 --> H5
H4 --> H6["H6 Delivery"]
H5 --> H6
classDef u fill:#FFA726,stroke:#E65100,color:#000;
classDef m fill:#CE93D8,stroke:#6A1B9A,color:#000;
class H1,H2,H3,H4,H5,H6 u;
class T1 m;
```
Text alternative: H1 feeds H3 and H2; H3 feeds H2; H2 feeds H4 and H5; the first test deploy follows H4; H5 and H4 feed H6.
## Shared resources and contracts
- The Core data block contract (H4) changes how Offerings writes `#cms-data`: its golden files must stay green.
- The public JSON shape (H2) is a contract with the ASF and SLS sessions; the golden files from ASF (13f78c4) drive H4.
- The media address scheme (H1) is used by H2 (data), H3 (endpoint) and H4 (HTML).
- One migration (H2); no change to existing tables.
## Parallelism
H2 and H3 can be built in parallel after H1 by different sessions, but the work is done by one session in the order above; the ASF and SLS sessions work on their sides in parallel from the first test deploy.
@@ -0,0 +1,42 @@
# Requirement to unit map: hero-module
User stories were skipped for this feature (one persona, acceptance criteria in the requirements), so the requirement IDs of `requirements.md` are mapped to units instead.
| Requirement | H1 | H3 | H2 | H4 | H5 | H6 |
|---|---|---|---|---|---|---|
| FR-01 one hero per site | | | X | | | |
| FR-02 text fields | | | X | | X | |
| FR-03 buttons and target validation | | | X | | X | |
| FR-04 slides | | | X | | X | |
| FR-05 schedule | | | X | | X | |
| FR-06 language-ready model | | | X | | | |
| FR-07 roles and public access | | | X | | | |
| FR-10 upload, real type, formats | X | | X | | X | |
| FR-11 metadata stripped | X | | | | | |
| FR-12 variants, resize and compress | X | | X | | | |
| FR-13 focus and crop per ratio, preview | X | | X | | X | |
| FR-14 own address, hash, immutable | X | X | | | | |
| FR-15 preload equals img | | | | X | | |
| FR-16 no orphans | | X | X | | | |
| FR-17 reuse check | done (SDA: nothing to reuse) | | | | | |
| FR-20 public contract | | | X | | | |
| FR-21 injection into the first HTML | | | | X | | |
| FR-22 only the first slide injected | | | | X | | |
| FR-23 fail-open, cache, ETag | | | | X | | |
| FR-24 schedule and inactive without rebuild | | | X | X | | |
| FR-25 admin screens | | | | | X | |
| FR-30 seed script | | | | | | X |
| FR-31 static texts reviewed | | | | | | X (SLS and ASF sessions) |
| FR-32 `release/*` CI | H0 (done) | | | | | |
| FR-33 backend texts | | | X | | | |
| NFR-01 LCP | | | | X | | X (measure) |
| NFR-02 live | | | X | X | | |
| NFR-03 page weight | X | | | | | X |
| NFR-04 upload safety | X | X | | | | |
| NFR-05 platforms and licence | X | | | | | X |
| NFR-06 storage | | X | | | | X (checklist) |
| NFR-07 accessibility | | | X | X | X | |
| NFR-08 compatibility | | | | X | | X |
| NFR-09 resilience | | | | X | | |
Every FR and NFR has at least one unit.
@@ -0,0 +1,33 @@
# Units of work: hero-module
One deployable service (the CMS host); the units are build parts with their own tests. Delivery: **one pull request for H1 to H6**, merged only after Bryan accepts the result on the test hosts (decision 2026-11-16). The first test deploy comes after H1 to H4; H5 follows.
## Code organisation (brownfield, existing layout)
| Area | Location |
|---|---|
| Media service | `src/SlpModularCms.Core/Media/` (+ tests in `SlpModularCms.Core.Tests/Media/`) |
| Data block and injection | `src/SlpModularCms.Core/Hosting/Website/` (+ tests in `SlpModularCms.Core.Tests/Hosting/`) |
| Hero module | `src/SlpModularCms.Modules.Hero/` and `src/SlpModularCms.Modules.Hero.Tests/` (new projects, in the solution folders Application/Modules and Tests/Modules, added to `SlpModularCms.Ci.slnf`) |
| Offerings change | `src/SlpModularCms.Modules.Offerings/Services/` |
| Master and sites | `src/SlpModularCms.Api`, `Api.SlpSoftware`, `Api.AndreaSlopFotografie` (module reference, committed defaults, `SiteContractTests`); not `Api.Slave` |
| Admin | `frontend/src/features/hero/` |
| Scripts, docs | `scripts/Seed-Hero.ps1`, `docs/hero-module.md`, `docs/release-checklist-productie.md`, `scripts/smoke-site.sh`, `openapi/slpsoftware.v1.json` |
## Units
| Unit | Responsibility | Main artifacts | Per-unit stages |
|---|---|---|---|
| **H0** (done) | `release/*` rule for SLP production | workflow, docs (PR #16, 0824bfa) | none |
| **H1** Image pipeline | Library proof and choice; `IImageProcessor`, `IMediaUploadGuard`, `ImageRejectedException`, pure `FocusMath`, `VariantPlanner`, `MediaPaths`; limits and options | `Core/Media/*`, tests incl. property tests, image fixtures | Functional Design, NFR Requirements (proof), NFR Design, Code Generation |
| **H3** Media store and serving | `IMediaStore`, `FileSystemMediaStore`, `/media/...` endpoint, rate-limit policy, startup check of the directory, options | `Core/Media/*`, host registration | Functional Design, Infrastructure Design (directory outside the release, backup, permissions), Code Generation |
| **H2** Hero module backend | Entities, migration, repositories, `HeroService`, `HeroImageService`, `PublicHeroService`, controllers, `ButtonTargetValidator`, texts, OpenAPI | `Modules.Hero`, tests | Functional Design, Code Generation |
| **H4** Injection | `ICmsDataBlockContributor`, `CmsDataBlockTransform`, Offerings contributor (byte-identical), `HeroHtmlTransform`, `HeroPictureRenderer`, ASF golden files (13f78c4) | `Core/Hosting/Website`, `Modules.Hero`, `Modules.Offerings`, golden files | Functional Design, Code Generation |
| **H5** Admin | Hero screen, slide list, upload, focus editor with previews, TypeScript `focusMath` twin | `frontend/src/features/hero` | Functional Design, Code Generation |
| **H6** Delivery | Seed script (test), docs, smoke test, checklist, LCP measurement, OpenAPI snapshot | scripts, docs | Code Generation, Build and Test |
NFR Requirements and NFR Design run for H1 and H3 (library, limits, upload safety, storage) and, for the LCP budgets, for H4. Security Baseline and property-based (partial) rules apply as recorded in the requirements.
## Build order
1. H1 (library proof first), 2. H3 (needs H1 for addresses), 3. H2, 4. H4, then **first test deploy** and integration with the ASF and SLS sessions, 5. H5, 6. H6.
@@ -17,12 +17,12 @@ Vul per vraag de letter in na `[Answer]:` (of "alle aanbevelingen"). Dit is een
## Plan (stappen)
- [x] 1. Eenheden afgeleid uit uitvoeringsplan en ontwerp
- [ ] 2. Vragen hieronder beantwoord
- [ ] 3. Antwoorden geanalyseerd
- [ ] 4. `unit-of-work.md` (definities en verantwoordelijkheden, codeorganisatie)
- [ ] 5. `unit-of-work-dependency.md` (afhankelijkheden, bouwvolgorde)
- [ ] 6. `unit-of-work-story-map.md` (user stories zijn overgeslagen: de requirements-ID's FR/NFR worden aan units gekoppeld)
- [ ] 7. Grenzen en afhankelijkheden gecontroleerd; alle FR/NFR hebben een unit
- [x] 2. Vragen hieronder beantwoord (2026-11-16, alle aanbevelingen)
- [x] 3. Antwoorden geanalyseerd: geen vaagheid of tegenstrijdigheid
- [x] 4. `unit-of-work.md` (definities en verantwoordelijkheden, codeorganisatie)
- [x] 5. `unit-of-work-dependency.md` (afhankelijkheden, bouwvolgorde)
- [x] 6. `unit-of-work-story-map.md` (user stories zijn overgeslagen: de requirements-ID's FR/NFR worden aan units gekoppeld)
- [x] 7. Grenzen en afhankelijkheden gecontroleerd; alle FR/NFR hebben een unit
## Vragen
@@ -36,7 +36,7 @@ H0 is al los gemerged.
Aanbeveling: A. De sites hebben markers, module en admin samen nodig om iets te zien; stapsgewijs mergen levert niets zichtbaars op en vergroot het aantal reviews.
[Answer]:
[Answer]: A. Eén PR voor H1 t/m H6, pas gemerged na Bryans acceptatie op de testhosts.
### Vraag 2 — Wanneer de eerste test-deploy?
@@ -46,7 +46,7 @@ Aanbeveling: A. De sites hebben markers, module en admin samen nodig om iets te
Aanbeveling: A. Dat ontsluit het werk van de sites één stap eerder en laat de LCP en het contract vroeg meten.
[Answer]:
[Answer]: A. Eerste test-deploy na H1 t/m H4; H5 volgt.
### Vraag 3 — Hoe pakken we de bibliotheekproef aan (onderdeel van H1 en NFR Requirements)?
@@ -58,7 +58,7 @@ De proef vergelijkt ImageSharp, NetVips, Magick.NET en SkiaSharp op: invoerforma
Aanbeveling: A.
[Answer]:
[Answer]: A. Lokaal op win-x64 en in een linux-arm64-container; de echte Pi bevestigt het bij de eerste test-deploy.
### Vraag 4 — Welke projecten verwijzen naar de Hero-module?
@@ -68,4 +68,4 @@ Aanbeveling: A.
Aanbeveling: A (zelfde regel als Offerings; `SiteContractTests` leggen de samenstelling vast).
[Answer]:
[Answer]: A. Master-Api en beide sites verwijzen vanaf H2; de Slave niet.