docs: WS-7 closure — RFC status + SECURITY_AUDIT + BACKLOG + sync config

PR-4 commit 3 — closure-bookkeeping nu de implementation-PRs en de
twee runbooks gemerged zijn.

- RFC-WS-7-OBSERVABILITY.md: nieuwe §9 Implementation status (mei 2026)
  vat samen welke acceptance criteria via PR-1..PR-4 zijn voldaan en
  welke (1, 2, 7, 9, 10) op Bert's deploy-checklist resteren. Pointer
  naar ARCH-OBSERVABILITY.md als levende reference; de RFC blijft
  historisch document.
- SECURITY_AUDIT.md: nieuwe sectie 'WS-7 Observability — finale audit
  (mei 2026)' tussen A13-10 en Positive Findings. Bevat (1) acceptance
  criteria checklist met status per criterium, (2) processing register
  entry voor GlitchTip (controller-not-processor, retention 90 dagen,
  TLS+full-disk-encryption+2FA), (3) zeven security controls die WS-7
  introduceert (PII scrubbing, CSP whitelist, sourcemap upload-only,
  listener registration discipline, runtime portal-context-split,
  multi-tenant tag invariant, impersonation.active binary signal),
  (4) pointer naar runbooks/observability-erasure.md voor Art. 17.
- BACKLOG.md: status-overzicht-tabel boven de OBS-entries. Toegevoegd
  als entry: OBS-2 (early-pipeline log context,  Resolved), OBS-3
  (sentry-context middleware coverage,  Resolved — opgevouwen in
  AuthScopeContextListener), OBS-5 (Crewli render handlers report()
  invariant,  Resolved via 48f2a00 + ExceptionReportingTest), en
  OBS-9 (Active — staging environment GlitchTip CSP whitelist follow-up
  bij staging-introductie). Bestaande OBS-1, 4, 6, 7 ongewijzigd
  (Active); OBS-8 staat al op Resolved sinds dee1401.
- .claude-sync.conf: drie nieuwe doc-paths toegevoegd
  (ARCH-OBSERVABILITY.md, runbooks/observability-triage.md,
  runbooks/observability-erasure.md). Post-commit sync-claude-docs
  hook regenereert SYNC_MANIFEST.md met deze entries.

Closes WS-7 documentation acceptance criteria 8 (ARCH) en 14
(SECURITY_AUDIT). Resterende criteria (1, 2, 7, 9, 10) zijn
deploy-checklist door Bert.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-07 19:47:12 +02:00
parent bf89090850
commit e9da01ffce
4 changed files with 244 additions and 1 deletions

View File

@@ -1643,7 +1643,21 @@ _Voeg nieuwe items toe met prefix: ARCH-, COMM-, OPS-, VOL-, ART-, FORM-, SUP-,
---
## Observability follow-ups (post WS-7 PR-2)
## Observability follow-ups (post WS-7)
> **Status overzicht (mei 2026, na WS-7 closure):**
>
> | Entry | Status |
> |---|---|
> | OBS-1 | Active — wacht op volunteer-rol introductie |
> | OBS-2 | ✅ Resolved (PR-2 architectural-fixes — opgevouwen in AuthScopeContextListener) |
> | OBS-3 | ✅ Resolved (PR-2 architectural-fixes — auto-discovery uit + explicit registratie maakt route-conditional binding overbodig) |
> | OBS-4 | Active — pre-PHPUnit 12 cleanup |
> | OBS-5 | ✅ Resolved (PR-2 smoke-test fix `48f2a00` + `ExceptionReportingTest`) |
> | OBS-6 | Active — wachten op SETUP.md update of CI smoke check |
> | OBS-7 | Active — coverage-test scope-creep, expanded coverage waardevol |
> | OBS-8 | ✅ Resolved (final hardening commits `215405a`, `a939820`, `dee1401`) |
> | OBS-9 | Active — alleen relevant bij staging-introductie |
### OBS-1 — Promote ActorType::VOLUNTEER when volunteer role is introduced
@@ -1666,6 +1680,45 @@ modellering. Geen blocker.
**Refs:** `app/Enums/Observability/ActorType.php`,
RFC-WS-7-OBSERVABILITY.md §3.6.
### OBS-2 — Early-pipeline log context user_id ✅ Resolved
**Aanleiding:** Tijdens PR-2 architectural-fixes ontdekt dat
`Log::withContext` in `BindRequestLogContext` middleware geen
`user_id` had voor log-regels die vóór auth:sanctum draaiden, omdat
de middleware run op api-group-level (vóór per-route auth).
**Status:** Resolved in PR-2 architectural-fixes. `AuthScopeContextListener::bindForUser()`
roept `Log::withContext(['user_id' => $user->id, ...])` aan zodra het
`Authenticated` of `TokenAuthenticated` event vuurt. Vanaf dat punt
in de request-pipeline dragen alle log-regels `user_id`. Pre-auth
log-regels (CSRF / rate-limiter middleware logs) hebben nog steeds
geen `user_id`, maar dat is correct gedrag — er is op dat moment ook
nog geen geauthenticeerde gebruiker.
**Refs:** `app/Listeners/Observability/AuthScopeContextListener.php`,
`app/Http/Middleware/BindRequestLogContext.php`.
### OBS-3 — Sentry-context middleware coverage assertion ✅ Resolved
**Aanleiding:** PR-2 originele design had de Sentry-context binding
als route-level middleware aliased per route group. Risico: een
nieuwe route-group die de alias vergeet had silently geen
auth-scope tags op gecaptured events.
**Status:** Resolved in PR-2 architectural-fixes. De binding is
verplaatst van middleware naar `AuthScopeContextListener` op het
`Authenticated` / `TokenAuthenticated` event. Listener fires
universeel op élke auth-resolution; geen route-conditional binding
meer mogelijk. Daarmee is een coverage-assertion test overbodig — de
listener kan niet "vergeten" worden zoals een route alias dat kon.
Combineer met OBS-8 (auto-discovery uit + explicit registration via
`EventListenerRegistrationTest`): listener-aanwezigheid is
empirisch gevalideerd op test-niveau.
**Refs:** `app/Listeners/Observability/AuthScopeContextListener.php`,
`tests/Feature/Observability/EventListenerRegistrationTest.php`.
### OBS-4 — PHPUnit metadata-in-doc-comment deprecation cleanup
**Aanleiding:** PHPUnit warnt dat metadata in doc-comments (zoals
@@ -1684,6 +1737,30 @@ upgrade gepland wordt — nu blokkeert het niets.
**Refs:** PHPUnit changelog, de drie genoemde test-files.
### OBS-5 — Crewli render handlers report() invariant ✅ Resolved
**Aanleiding:** PR-2 smoke test toonde dat backend-exceptions geen
events naar GlitchTip stuurden ondanks correct geconfigureerde SDK.
Root cause: sentry-laravel 4.x heeft de `Integration::handles($exceptions)`
registratie-stap die NIET wordt auto-aangeroepen door de package's
ServiceProvider; de host-app moet dit expliciet doen in
`bootstrap/app.php`.
**Status:** Resolved via commit `48f2a00`
`fix: route controller exceptions through sentry-laravel reporter`
+ `tests/Feature/Observability/ExceptionReportingTest.php` als
regression-guard. ExceptionReportingTest installeert een recording
`before_send` hook en verifieert dat `RuntimeException` wel,
`ValidationException`/`AuthorizationException`/`NotFoundHttpException`
niet captured worden — exact de boundary uit RFC §3.10.
OBS-7 (hieronder) breidt deze coverage uit naar Crewli's eigen
render handlers.
**Refs:** `bootstrap/app.php`,
`tests/Feature/Observability/ExceptionReportingTest.php`,
RFC-WS-7-OBSERVABILITY.md §3.10.
### OBS-6 — sentry-laravel installation gap awareness
**Aanleiding:** WS-7 PR-2 smoke test faalde silent omdat sentry-laravel
@@ -1785,3 +1862,30 @@ registration niet meer kan voorkomen.
**Refs:** `bootstrap/app.php`, `app/Providers/AppServiceProvider.php`,
`tests/Feature/Observability/EventListenerRegistrationTest.php`,
RFC-WS-7-OBSERVABILITY.md §3.6.
### OBS-9 — Staging environment GlitchTip CSP whitelist
**Aanleiding:** PR-3 CSP-fix whitelist alleen `localhost:8200` (dev) en
`monitoring.hausdesign.nl` (prod) hard-coded in respectievelijk
`apps/app/index.html` meta-tag en `deploy/nginx/csp-spa.conf`. Wanneer
een staging-omgeving wordt geïntroduceerd (RFC §3.3 noemt
`.env.staging` als voorbeeld), zal de bijbehorende GlitchTip-host
niet ge-whitelist zijn — events worden dan stilletjes geblokkeerd
door browser-CSP zonder waarschuwing aan de test-runner.
**Wat:**
- Bij staging-introductie: voeg staging GlitchTip-host toe aan
`deploy/nginx/csp-spa.conf` óf maak `apps/app/index.html` meta-CSP
environment-aware via Vite build-time injection (vergelijkbaar met
`VITE_SENTRY_DSN_FRONTEND` patroon).
- Update `tests/Feature/Security/CspConnectsToObservabilityTest.php`
met staging-assertion zodat de regression-guard de nieuwe environment
dekt.
**Prioriteit:** Laag — alleen relevant wanneer staging-omgeving wordt
opgezet.
**Refs:** `apps/app/index.html`, `deploy/nginx/csp-spa.conf`,
`tests/Feature/Security/CspConnectsToObservabilityTest.php`,
RFC-WS-7-OBSERVABILITY.md §3.3, ARCH-OBSERVABILITY.md §7 + §10.4.