Finishes the master-cms-module feature (Units 1-4): runs Build and Test across master-backend, slave-availability-extension and frontend-cms-page, fixes a missing Availability EF migration for MasterRegistration and a TanStack Query v5 mutation-callback type break, adds the missing MasterModule appsettings section, and documents the module in README.md. Also seeds a tech-debt-backlog feature to track dead config and pre-existing/introduced frontend lint findings for later cleanup.
5.5 KiB
Code Generation Plan — Unit 4: documentation
Unit Context
- Scope: Update
README.md(root) with a Master CMS Module section covering the new module, migrations, and production env vars; replace the default Vite templatefrontend/README.mdwas never actually replaced by Unit 3 and still contains boilerplate — bring it in line with the rest of the documented feature set. - Depends on: Units 1-3 (master-backend, slave-availability-extension, frontend-cms-page) — documents their final, built-and-tested patterns.
- No new code: Documentation only; no business logic, no NFRs, no tests. Functional Design / NFR Requirements / NFR Design were correctly skipped for this unit.
Steps
-
Step 1 — Root README: Add "Master CMS Module" section Add a new
## Master CMS Modulesection toREADME.mdafter the existing "Nieuwe Module Toevoegen" section, covering:- What the module does (Owner registers/manages slave CMS instances; slaves enforce master-controlled availability)
- Architecture summary:
SlpModularCms.Modules.Master(per-moduleMasterDbContext), extendedSlpModularCms.Modules.Availability(slave-sideMasterRegistration+ two-phaseAvailabilityMiddleware) - Registration flow: Owner adds a slave URL via
/cms→ Master generates an API key → Master pushes registration to the slave's/api/v1/master/register(X-Master-Api-Keyheader) - Status flow: Owner toggles status on Master → Master pushes to slave synchronously → fail-open on push failure (DB change not rolled back) →
IntegrityCheckBackgroundServiceretries/reconciles onIntegrityCheckIntervalMinutes(default 60) - Fail-open behavior: slave defaults
_masterIsAvailable = trueat startup; no TTL on cached status
-
Step 2 — Root README: Extend "Database Migraties" section Add a subsection noting that
SlpModularCms.Modules.MasterandSlpModularCms.Modules.Availabilityare per-moduleDbContexts with their own migrations, applied automatically at startup viaDatabase.Migrate(). Document the exact commands:dotnet ef migrations add <Naam> --project src\SlpModularCms.Modules.Master --startup-project src\SlpModularCms.Api dotnet ef migrations add <Naam> --project src\SlpModularCms.Modules.Availability --startup-project src\SlpModularCms.Api --context AvailabilityDbContextNote the
--contextrequirement for the Availability project (it now hosts two logical concerns sharing oneAvailabilityDbContext, butdotnet efneeds disambiguation because the API composes multipleDbContexttypes across modules). -
Step 3 — Root README: Extend "Productie Setup" section Add the new production-relevant configuration:
MasterModuleoptions actually consumed by the code (bound from config sectionMasterModule):IntegrityCheckIntervalMinutes(default 60),HttpTimeoutSeconds(default 10),MasterUrl. Revised during execution:CacheMinutesandApiKeyare declared onMasterModuleOptionsbut never read anywhere in the codebase (verified viadotnet-appsettingsskill pass) — they were superseded by Unit 2's actual design (per-instance encrypted keys, no-TTL cache). Left undocumented here per user decision; tracked as TD-001 in the newtech-debt-backlogfeature instead of documenting dead config as if live.- Data Protection key ring warning (per NFR tech-stack-decisions.md): the API key encryption uses ASP.NET Core Data Protection with the default file-system key store. For containerized/multi-instance deployments, configure a persistent key ring (
PersistKeysToDbContext,PersistKeysToAzureBlobStorage, etc.) — otherwise a container restart makes all storedApiKeyvalues undecryptable, breaking master↔slave communication until instances are re-added. - Added during execution: actual
MasterModuleconfig section added toappsettings.jsonandappsettings.Development.json(was completely missing before this unit, discovered via thedotnet-appsettingsskill pass).
-
Step 4 — Replace
frontend/README.mdReplace the default Vite/React template content with a short pointer document: describe the frontend briefly and redirect to the rootREADME.md's "Frontend Development (CMS Admin UI)" section, which already documents setup, scripts, and configuration in full. Avoids duplicating content that already exists and stays in sync. -
Step 5 — Update feature state Mark Unit 4 (documentation) Code Generation complete in
aidlc-docs/features/master-cms-module/aidlc-state.md; updateaidlc-docs/active-features.mdstatus.
Deviations From Plan (logged during execution)
- Missing EF migration found & fixed:
SlpModularCms.Modules.Availabilityhad no migration forMasterRegistration(Unit 2 gap). Generated during Build & Test, before this unit started — seeaidlc-docs/features/master-cms-module/construction/build-and-test/build-and-test-summary.md. - Lint baseline correction: the "all pre-existing" claim for frontend lint findings in the Build & Test summary was based on a contaminated comparison; corrected via a clean
git worktreecheckout. 2 of the 6 lint findings are new (Unit 3); all 6 moved totech-debt-backlog(TD-002/TD-003) rather than fixed in-flight, per user decision. - appsettings gap found & fixed:
MasterModuleconfig section was entirely absent fromappsettings.json/appsettings.Development.jsondespiteMasterModuleOptions.BindConfiguration("MasterModule")in code. Added both files during this unit's execution (see Step 3).