Two backlog trees are complete: `docs/project/backlog/` (75 files, every WP done) and `docs/project/refactor-backlog-setup/` (the arc before it). Move both under `docs/project/archive/` with `git mv`, so history stays intact through `git log --follow`. `SHOWCASE-ROADMAP.md` moves with them, because it points at the now-archived backlog README. Add `docs/project/archive/README.md`. It states that these trees are historical and names the two directories that are still live. Repoint every inbound reference named in RD-30's Files table: CLAUDE.md, the root README, both backend READMEs, `LetterHtml.cs`, `a11y.mdx`, the `document-feature` and `new-ssp` skills, and the readable-codebase PLAN, README, and RD-19 ticket. Fix two upward-relative links inside the moved WP files (WP-68, WP-69) that gained a directory level and would otherwise break. Repoint `.prettierignore`'s two agent-prompt exclusions to their new path, so prettier keeps leaving those files' exact wording alone. Mark RD-30 done and check off its acceptance criteria; flip its README row to done. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
WP-47 — Runtime feature flags (catalog-in-code, admin-toggled)
Status: done Phase: 8 — platform/DX/showcase
Why
Ops needs to turn features on/off at runtime without a deploy. Mirrors the two house templates: the capability spine (server-resolved, FE reads) and the org-template runtime-SQLite config (admin edits at runtime). Per ADR-0004 the catalog (which flags exist + defaults) is config-as-code; only the on/off state is runtime.
Decisions (locked with the user)
- Catalog in code (typed, build-validated); on/off state in SQLite; admin toggles at runtime.
- FE + backend enforcement — the FE hides the surface AND the server enforces (a flag can guard a real feature, not just UI).
Outcome
- Backend:
Domain/Features/FeatureFlags.cs(catalog: one flaginschrijving-open, default on) +Data/FeatureFlagStore.cs(FeatureFlagEntityin SQLite + migration;All()merges catalog defaults with overrides,IsEnabled,Setrejects unknown keys).GET /flags(readable, drives FE gating) +PUT /admin/flags/{key}(gated by newflags:managecap +FlagsAdmin). Enforced end-to-end:POST /applicationsfor aregistratiereturns 403 wheninschrijving-openis off. - FE:
shared/domain/feature-flag.ts+feature-flags.adapter.ts(parse boundary) +shared/application/feature-flags.store.ts(root singleton,enabled(key)deny-by-default,set). Capabilityflags:manage(union + me.adapter + role.interceptor/api/v1/admin/flags). The "Inschrijven" nav item + dashboard action hide when the flag is off. Admin toggle pagebeheer/ui/feature-flags.page.tsat/beheer/functies, inADMIN_LINKS. - Tests: catalog-unique + endpoint (admin-only toggle, 404 unknown key, close→403 / reopen→201).
/mecap-list test updated. Backend 136; typed client regenerated.
Acceptance criteria
- Admin toggles a flag at runtime; state persists (SQLite) and the whole app reads it.
- FE hides the flagged feature AND the backend enforces it (registration close → 403).
npm run cigreen (dep:check, localized build, backenddotnet test, drift clean after commit).