# AI-DLC State Tracking ## Project Information - **Feature Name**: E-mail notifications for identity (invitation, new activation link, password reset) - **Feature Slug**: identity-email-notifications - **Project Type**: Brownfield - **Start Date**: 2026-11-08 - **Current Stage**: COMPLETE - operations done; in production on SlpSoftware since 2026-11-10 (run 639, master e671078) - **Branch**: feature/identity-email-notifications (branched from feature/andreaslop-site-hosting at e9feb37; own branch, not merged anywhere) - **Request Type**: Feature (Bryan chose real e-mail over a workaround button; relayed by session "CMS & API") ## Workspace State - **Existing Code**: Yes - **Reverse Engineering Needed**: No - reuse aidlc-docs/_shared/reverse-engineering/ - **Workspace Root**: K:\Development\Projects\SlpModularCms ## Code Location Rules - **Application Code**: Workspace root (NEVER in aidlc-docs/) - **Feature Documentation**: aidlc-docs/features/identity-email-notifications/ only ## Language Configuration - **Documentation Language**: English - **Conversation Language**: User Language (Dutch) - **Note**: Inherited from the other features in this workspace. ## External Requester (hand-off) - **Session**: "CMS & API", relays Bryan's decisions. Questions for Bryan go through that session. No implementation before the answers are in. - **Reference implementation (read-only)**: K:\Development\Projects\SimpleDeckApp (MailKit/MimeKit `SmtpEmailSender`, `IEmailSender.SendAsync(to, subject, htmlBody, ct)`, `EmailOptions` section "Email"). ## Extension Configuration | Extension | Enabled | Decided At | |---|---|---| | Security Baseline | Yes (Q15 A) | Requirements Analysis | | Property-Based Testing | Yes - partial PBT-02,03,07,08,09 (Q16 B) | Requirements Analysis | ## Operations Configuration - **Include Operations Phase**: Yes (Q17 A) - **Decided At**: Requirements Analysis ## Stage Progress ### INCEPTION - [x] Workspace Detection - Complete - [x] Requirements Analysis - P1-P5 decided by Bryan (relayed); requirements.md updated - [~] User Stories - skipped (see execution plan) - [x] Workflow Planning - approved (relayed) - [x] Application Design - approved (relayed); D1 picker in invite dialog, D2 stamp in access token (U3) - [x] Units Generation - U1 mail-foundation, U2 identity-mail-flows, U3 password-reset ### CONSTRUCTION - [x] U1 mail-foundation - Infrastructure Design (construction/mail-foundation/infrastructure-design/infrastructure-design.md), Code Generation done, build and tests green (see code-summary.md); hand-back pending - [x] U2 identity-mail-flows - Code Generation done, build and tests green (see construction/identity-mail-flows/code/code-summary.md); includes D1 and D2; hand-back pending - [x] U3 password-reset - Code Generation done, build and tests green (see construction/password-reset/code/code-summary.md); hand-back pending (D2, the security stamp in the access token, was built in U2) - [~] Build and Test - summary written (construction/build-and-test/build-and-test-summary.md); manual real test mail on ASF test pending - [ ] Operations (deployment, monitoring, production readiness incl. SPF/DKIM alignment checklist) - Hand-back written (handback.md); Operations questions issued (operations/plans/operations-questions.md), nothing executed until answered ### OPERATIONS - [x] Deployment Setup - approved answers Q1 A, Q2 A (ASF production separate, IIS), Q3 A, Q7 A; operations/deployment/* - [x] Monitoring Setup - Q4 B (config-related mail failures at Error), Q5 A; log-level change built and tested; operations/monitoring/* - [x] Production Readiness - checklist written; verdict: not yet (real test mails, Sentry rule, Bryan's approval); operations/production-readiness-checklist.md - Open for a later feature: ASF production on IIS (hosting assumptions listed in operations/deployment/deployment-plan.md) ### Late fixes after the first test deploys (2026-11-09/10, all on the branch) - [x] Mail layout: SLP red, dark-mode button, logo swap (dark variant) and white badge, site name next to the logo, dark card that stands out (page `#0a0e14`, card `#273244`, 1px border), inline card border `#d1d5db` and Outlook `data-ogsb`/`data-ogsc` rules, 16 px gutter around the card. Light mode unchanged. Real behaviour in the Gmail app (Gmail and non-Gmail account) and Outlook still to be confirmed by a real test mail. - [x] Master/slave status: the slave's fail-open grace period now runs from the master's last contact (poll, push, registration), not from the last successful poll (a pushed "not available" fell open at the next failed poll). Poll failures log `master_poll_failed reason=... detail=...` (first stack frame, `url_absolute`, `scheme`, `key_present`; never URL, key or message). - [x] Master URL: the shipped `appsettings.json` holds a placeholder; the hourly/start-up integrity check (no request) used it and re-registered slaves with it, so their polls failed. Now `MasterUrlRules` (absolute http(s), no credentials/query/fragment): the master skips background checks on an unusable value (warning), a slave refuses one (400 `invalid_master_url`), the poller reports `invalid_master_url`. **The variable is `MasterModule__MasterUrl`** (section `MasterModule`); an earlier note said `Master__MasterUrl`, which is never bound - corrected in `operations/deployment/deployment-plan.md`. - [x] Availability gate: an expired token on a blocked route answers 401 (not 503) so the app refreshes its session and passes as admin; missing, forged, wrong-key and non-admin tokens stay 503. - [x] Session at start-up: a refresh without a verdict (429/5xx/network) ends in an "unreachable" retry screen, not as a guest; Retry-After is sent (refresh 15 s) and honoured (max 15 s per wait). - [x] Logout hang: with the CMS switched off (own setting or master) signing out froze the app. Cause: the AppLayout effect "NotAvailable -> go to /dashboard" also ran for a guest, which the authenticated route sent back to /login - an endless navigation loop. Fixed (only for an authenticated user); test `LogoutWhileCmsOff.test.tsx` never finished on the old code. - [ ] Not built, decisions with Bryan: own rate-limit policy for `Setup/status`, judge the admin token only when a request is really blocked, a visible error state with "Reload" and a fetch timeout (see `../contact-feature/contact-feature-prereqs.md`, local commit 3f060a8, not pushed). - Merge to master: **not approved**. Bryan wants to test both test environments first (including run 635 / 65ee73f); the CMS session may merge later on his explicit go (Gitea PR with merge commit and green CI unless he chooses otherwise). ### Completion (2026-11-10, relayed by "CMS & API" from Bryan) - [x] Everything tested and approved by Bryan on both test environments (ASF test, SlpSoftware test): mails (light and dark, Gmail app and Thunderbird), disabling the CMS and signing out while disabled, ASF status and poll, role change, owner. CI run 636 (2818b74) green. - [x] Merged to master on 2026-11-10 through PR #11 (merge commit e671078; 66 commits, including the 24 of `feature/andreaslop-site-hosting`, which was never merged separately and is therefore handled by the same PR). - [x] SlpSoftware production deployed 2026-11-10 (run 639, master e671078); Pi-Main reports it healthy: mail on, migrations applied, no master-URL warnings, `/health` 200. - [x] `MasterModule__MasterUrl` set on the test and the production master host. - [ ] Not built (decisions with Bryan, kept in `../contact-feature/contact-feature-prereqs.md`): own rate-limit policy for `Setup/status`, judging the admin token only on a real block, a visible error state with "Reload" and a fetch timeout. The availability-gate change (public routes never 503) belongs to the contact feature. - Open recommendation for Bryan: check SPF/DKIM/DMARC alignment on a real production mail ("show original" in Gmail and Outlook). - Out of scope, separate piece of work: ASF production on IIS (see `operations/deployment/deployment-plan.md`). - Follow-up: the contact feature (prerequisites in `../contact-feature/contact-feature-prereqs.md`).