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:
+43
@@ -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.
|
||||
+42
@@ -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.
|
||||
Reference in New Issue
Block a user