From 18d7f15efb62c359f55b23529c3e28c099e309a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= Date: Tue, 4 Aug 2026 20:58:33 +0100 Subject: [PATCH] docs: sync PROJECT_STATUS + baseline with BIT-28130 CWV results Incorporate August Lighthouse addendum and board statuses (BIT-28130 done; follow-ups BIT-28144/28145) so docs do not claim CWV still unmeasured. Paperclip-Issue: BIT-28131 Paperclip-Run: 73c52077-1860-4763-971f-b6d01d6dd8ac --- docs/PERFORMANCE_BASELINE.md | 86 ++++++++++++++++++++++-------------- docs/PROJECT_STATUS.md | 13 +++--- 2 files changed, 62 insertions(+), 37 deletions(-) diff --git a/docs/PERFORMANCE_BASELINE.md b/docs/PERFORMANCE_BASELINE.md index 29ef949..7c9532c 100644 --- a/docs/PERFORMANCE_BASELINE.md +++ b/docs/PERFORMANCE_BASELINE.md @@ -60,9 +60,43 @@ Cache Rule applied to both zones via `deploy/scripts/cf-cache-rules-apply.sh` (` **Independent GET check (2026-05-12 ~23:02 UTC, CI runner):** `andebol.net` pass1 `EXPIRED` / TTFB ~0.42 s, pass2 **`HIT`** / ~0.11 s; `newsproject.bitreport.pt` pass1–2 **`HIT`** / ~0.10–0.13 s — consistent with [BIT-21912](/BIT/issues/BIT-21912) closure evidence. +## Re-Measurement Addendum — 2026-08-04 — LCP / CLS / Lighthouse Performance + +**Date:** 2026-08-04T20:40:00Z +**Auditor:** Peter Spark (CTO Agent) +**Reference:** [BIT-28130](/BIT/issues/BIT-28130), parent [BIT-28082](/BIT/issues/BIT-28082) + +### Method + +Lighthouse CLI **13.4.0** (`npx lighthouse`), Chrome for Testing **149.0.7827.22**, headless (`--headless=new --no-sandbox --disable-gpu --disable-dev-shm-usage`), default mobile config (simulated throttling), `--only-categories=performance`, one run per URL. Home page + one article URL per domain, per acceptance criteria. + +**Methodology caveat:** Lighthouse emitted `"The tested device appears to have a slower CPU than Lighthouse expects"` on every run — the CTO agent's compute host is CPU-constrained relative to Lighthouse's calibration target, which inflates simulated-throttling metrics (TBT especially) versus a reference desktop. Directionally the results below are trustworthy (the andebol.net vs. newsproject.bitreport.pt gap is large and consistent across two page types), but absolute scores should be cross-checked against PageSpeed Insights (Google-hosted, calibrated infra) before being treated as authoritative for SLA/gating purposes. Raw Lighthouse JSON reports retained at `/tmp/lhreports/*.json` on the audit host (not committed — regenerate via the command above if needed). + +### Results + +| URL | LCP | CLS | Lighthouse Performance | LCP Target (<2.5s) | CLS Target (<0.1) | Perf Target (≥90) | +|---|---|---|---|---|---|---| +| `https://andebol.net/` (home) | 7.93 s | 0 | 26 | ❌ FAIL | ✅ PASS | ❌ FAIL | +| `https://andebol.net/article/betclic-e-a-nova-patrocinadora-oficial-da-federacao-de-andebol-de-portugal` | 8.13 s | 0 | 38 | ❌ FAIL | ✅ PASS | ❌ FAIL | +| `https://newsproject.bitreport.pt/` (home) | 2.04 s | 0 | 97 | ✅ PASS | ✅ PASS | ✅ PASS | +| `https://newsproject.bitreport.pt/article/betclic-sorteia-campeonatos-2026-27-calendarios-definidos-para-22-clubes` | 2.02 s | 0 | 60 | ✅ PASS | ✅ PASS | ❌ FAIL | + +Supporting figures: andebol.net home Total Blocking Time 5874 ms, main-thread work 19.5 s (666 tasks, 4.88 s total task time on the main document alone — no render-blocking scripts detected, so the cost is concentrated in style/layout work, consistent with the CPU-throttling caveat above but still a real outlier vs. newsproject). andebol.net article TBT 778 ms. newsproject.bitreport.pt article TBT 7416 ms (this is what drops its performance score to 60 despite LCP passing — worth its own investigation, likely third-party/embed script on article template). + +### Verdict vs. Architecture Targets (`docs/architecture.md` § performance targets) + +**Overall: ❌ TARGETS NOT MET.** 2 of 4 URLs fail LCP + Performance outright (`andebol.net`, both pages). `newsproject.bitreport.pt` passes on home but fails Performance on article pages (TBT-driven). CLS passes on all 4 URLs measured (0 in every run — no layout-shift regressions detected, though this Lighthouse config uses simulated throttling, not field CrUX data). + +### Follow-ups Opened + +- [BIT-28144](/BIT/issues/BIT-28144) — `andebol.net` (home + article) LCP ~8s / Performance ~30: render-path/CSS or third-party investigation (May TTFB was comparable to newsproject; not a network-floor issue alone). +- [BIT-28145](/BIT/issues/BIT-28145) — `newsproject.bitreport.pt` article template TBT 7.4s (score 60, LCP still fine): main-thread profiling on article pages (likely heavy embed/widget). + +--- + ## Executive Summary -**Current posture (post May 2026 addendum — [BIT-21610](/BIT/issues/BIT-21610) / [BIT-21912](/BIT/issues/BIT-21912)):** +**Current posture (May 2026 cache/TTFB + August 2026 CWV — [BIT-21610](/BIT/issues/BIT-21610) / [BIT-21912](/BIT/issues/BIT-21912) / [BIT-28130](/BIT/issues/BIT-28130)):** | Area | Status | |------|--------| @@ -70,9 +104,9 @@ Cache Rule applied to both zones via `deploy/scripts/cf-cache-rules-apply.sh` (` | Cloudflare edge HTML cache | ✅ **HIT** confirmed on `GET /` for andebol.net + newsproject.bitreport.pt | | TTFB (cache HIT) | ⚠️ ~81–130 ms on Cloudflare **Free** (no Argo / Tiered Cache). Architecture aspirational target remains **< 30 ms** — contract reconciliation tracked in [BIT-28133](/BIT/issues/BIT-28133) | | TTFB (cache MISS / origin) | ⚠️ ~220 ms typical (close to < 200 ms) | -| LCP / CLS / Lighthouse | ⏳ Still **unmeasured** on `main` — pending sibling [BIT-28130](/BIT/issues/BIT-28130) | +| LCP / CLS / Lighthouse | ❌ Measured 2026-08-04 ([BIT-28130](/BIT/issues/BIT-28130) `done`) — `andebol.net` fails LCP + Performance on both pages; `newsproject.bitreport.pt` passes home, fails Performance on article (TBT). Follow-ups: [BIT-28144](/BIT/issues/BIT-28144), [BIT-28145](/BIT/issues/BIT-28145). See August addendum above. | -The April 2026 sections below are the **historical baseline** (Cache-Control missing, all requests ~300 ms DYNAMIC). Do not treat the April “TARGETS NOT MET” lead as current production state for cache/TTFB. +The April 2026 sections below are the **historical baseline** (Cache-Control missing, all requests ~300 ms DYNAMIC). Do not treat the April “TARGETS NOT MET” lead as current production state for **cache / TTFB** (edge HIT is confirmed). CWV targets remain unmet per the August measurement. **Docs refresh:** [BIT-28131](/BIT/issues/BIT-28131) under governance sweep [BIT-28082](/BIT/issues/BIT-28082). @@ -88,9 +122,9 @@ The April 2026 sections below are the **historical baseline** (Cache-Control mis | **TTFB (cache MISS)** | < 200 ms | ~220 ms | ⚠️ | Origin-side; improved vs April ~300 ms | | **Cache-Control headers** | present | present | ✅ | [BIT-2261](/BIT/issues/BIT-2261) | | **cf-cache-status (GET)** | HIT | HIT | ✅ | Verify with GET, not HEAD ([BIT-21912](/BIT/issues/BIT-21912)) | -| **LCP** | < 2.5 s | *Not measured* | ⏳ | Pending [BIT-28130](/BIT/issues/BIT-28130) | -| **CLS** | < 0.1 | *Not measured* | ⏳ | Pending [BIT-28130](/BIT/issues/BIT-28130) | -| **Lighthouse Performance** | ≥ 90 | *Not measured* | ⏳ | Pending [BIT-28130](/BIT/issues/BIT-28130) | +| **LCP** | < 2.5 s | 7.93–8.13 s (andebol.net); 2.02–2.04 s (newsproject.bitreport.pt) | ⚠️ mixed | andebol.net fails both pages; newsproject.bitreport.pt passes both — see 2026-08-04 addendum | +| **CLS** | < 0.1 | 0 (all 4 URLs) | ✅ | See 2026-08-04 addendum | +| **Lighthouse Performance** | ≥ 90 | 26 / 38 (andebol.net); 97 / 60 (newsproject.bitreport.pt) | ❌ | Only newsproject.bitreport.pt home passes; see 2026-08-04 addendum | ### Historical (April 2026 baseline — superseded for cache/TTFB) @@ -98,7 +132,7 @@ The April 2026 sections below are the **historical baseline** (Cache-Control mis |--------|--------|---------------------|--------|-------| | **TTFB (cache HIT)** | < 30 ms | ~300 ms | ❌ then | No Cache-Control; DYNAMIC | | **TTFB (cache MISS)** | < 200 ms | ~300 ms | ❌ then | Cache not functioning | -| **LCP / CLS / Lighthouse** | see above | *Not measured* | ⚠️ | Unchanged until BIT-28130 | +| **LCP / CLS / Lighthouse** | see above | *Not measured* | ⚠️ | Measured 2026-08-04, see addendum above | --- @@ -181,41 +215,29 @@ The frontend (Astro) is not setting Cache-Control headers on responses. Per `doc --- -## Open follow-ups (post May 2026) +## Blocking Issues -Cache-Control + edge HIT are **resolved** (see May addendum). Remaining gaps under [BIT-28082](/BIT/issues/BIT-28082): +### Issue 1: Missing Cache-Control Headers (CRITICAL) -| Issue | Gap | -|-------|-----| -| [BIT-28130](/BIT/issues/BIT-28130) | Measure LCP / CLS / Lighthouse on production domains | -| [BIT-28133](/BIT/issues/BIT-28133) | Reconcile aspirational TTFB HIT < 30 ms with Cloudflare Free reality | - -### Historical note (April 2026) - -The original CRITICAL finding was missing Cache-Control on Astro pages. That was fixed via [BIT-2261](/BIT/issues/BIT-2261); the Root Cause / Detailed Measurements sections above retain the April evidence for audit trail. +**Impact:** Prevents all TTFB target achievement +**Scope:** Frontend (Astro pages) +**Action Required:** Implement `Cache-Control: s-maxage=60, stale-while-revalidate=300` on all page routes +**Files to Review:** `frontend/src/pages/*.astro` --- -## Measurement Limitations +## Measurement Limitations (April 2026 — historical) -The following metrics were not measured in the April baseline (and remain open until [BIT-28130](/BIT/issues/BIT-28130)): - -1. **LCP / CLS (Core Web Vitals)** — needs Chrome DevTools Protocol, Lighthouse CLI, or PageSpeed Insights -2. **Lighthouse Performance Score** — same tooling path - -### Recommendation - -1. Complete CWV / Lighthouse measurement ([BIT-28130](/BIT/issues/BIT-28130)) and append results above the April historical sections -2. Decide whether to keep < 30 ms HIT as aspirational or revise architecture targets ([BIT-28133](/BIT/issues/BIT-28133)) -3. Treat Executive Summary + May addendum as current truth for cache/TTFB +At the April audit, LCP/CLS/Lighthouse could not be measured (Lighthouse CLI unavailable on the audit host). **Superseded:** Cache-Control is present (May 2026); LCP/CLS/Lighthouse were measured 2026-08-04 under [BIT-28130](/BIT/issues/BIT-28130) (see August addendum). Remaining gaps are product fixes ([BIT-28144](/BIT/issues/BIT-28144), [BIT-28145](/BIT/issues/BIT-28145)), not missing measurement. --- -## Next Steps +## Next Steps (current) -1. **[BIT-28130](/BIT/issues/BIT-28130):** Measure LCP/CLS/Lighthouse; update this baseline -2. **[BIT-28133](/BIT/issues/BIT-28133):** Resolve TTFB HIT target vs Free-plan floor -3. Keep April sections as historical; treat Executive Summary + May addendum as current truth for cache/TTFB +1. Merge docs refresh [BIT-28131](/BIT/issues/BIT-28131) + QA measurement PR [BIT-28130](/BIT/issues/BIT-28130) so `main` carries both addenda. +2. Resolve Free-plan TTFB HIT contract vs <30 ms aspirational — [BIT-28133](/BIT/issues/BIT-28133). +3. Fix failing CWV/Performance — [BIT-28144](/BIT/issues/BIT-28144) (`andebol.net`), [BIT-28145](/BIT/issues/BIT-28145) (newsproject article TBT). +4. Optional: cross-check absolute Lighthouse scores with PageSpeed Insights (CPU-constrained audit host caveat). --- diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index e8a4580..6c83b58 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -11,7 +11,7 @@ Alinhados à descrição do projecto no Paperclip e ao [`docs/architecture.md`]( | # | Objectivo | Notas | |---|-----------|--------| | 1 | **Plataforma multi-domínio** | Suporte a múltiplos domínios sem alteração de código — apenas ficheiros JSON de config por domínio. | -| 2 | **Frontend SSR performante** | Astro 5 SSR: TTFB < 200 ms (bridge cached / edge MISS), LCP < 2.5 s, CLS < 0.1, Lighthouse ≥ 90. Edge HIT confirmado (May 2026); TTFB HIT < 30 ms é aspiracional em Cloudflare Free (~81–130 ms medidos) — ver [BIT-28133](/BIT/issues/BIT-28133). **LCP/CLS/Lighthouse ainda por medir** — sibling [BIT-28130](/BIT/issues/BIT-28130) (QA). | +| 2 | **Frontend SSR performante** | Astro 5 SSR: TTFB < 200 ms (bridge cached / edge MISS), LCP < 2.5 s, CLS < 0.1, Lighthouse ≥ 90. Edge HIT confirmado (May 2026); TTFB HIT < 30 ms é aspiracional em Cloudflare Free (~81–130 ms medidos) — ver [BIT-28133](/BIT/issues/BIT-28133). **LCP/CLS/Lighthouse medidos 2026-08-04** ([BIT-28130](/BIT/issues/BIT-28130) `done`): `andebol.net` falha LCP+Performance; `newsproject.bitreport.pt` passa na home, falha Performance no artigo (TBT) — follow-ups [BIT-28144](/BIT/issues/BIT-28144), [BIT-28145](/BIT/issues/BIT-28145). | | 3 | **Bridge Fastify + cache Redis** | Camada de normalização e cache entre frontend e WordPress headless (TTL 60 s artigos). | | 4 | **WordPress headless** | CMS headless via REST API; sem tema renderizado — apenas editorial no WP Admin. | | 5 | **SEO de primeira classe** | SSR full-page, Schema.org `NewsArticle`, Open Graph, Twitter Card, sitemap dinâmico. | @@ -28,7 +28,7 @@ Alinhados à descrição do projecto no Paperclip e ao [`docs/architecture.md`]( | # | Objectivo | Estado | Rastreio principal | |---|-----------|--------|--------------------| | 1 | Plataforma multi-domínio | ✅ Entregue | [BIT-345](/BIT/issues/BIT-345), [BIT-494](/BIT/issues/BIT-494)–[BIT-497](/BIT/issues/BIT-497) | -| 2 | Frontend SSR performante | ⚠️ Parcial — edge HIT + Cache-Control OK; CWV/Lighthouse pendentes ([BIT-28130](/BIT/issues/BIT-28130)); contrato TTFB HIT em revisão ([BIT-28133](/BIT/issues/BIT-28133)) | [BIT-349](/BIT/issues/BIT-349); [BIT-2080](/BIT/issues/BIT-2080) / [BIT-21610](/BIT/issues/BIT-21610) `done`; CF [BIT-21847](/BIT/issues/BIT-21847) / [BIT-21912](/BIT/issues/BIT-21912) — [`docs/PERFORMANCE_BASELINE.md`](PERFORMANCE_BASELINE.md) | +| 2 | Frontend SSR performante | ❌ Parcial — edge HIT + Cache-Control OK; CWV medidos 2026-08-04 e **falham** em `andebol.net` (LCP+Performance) e no artigo de `newsproject.bitreport.pt` (TBT); contrato TTFB HIT em revisão ([BIT-28133](/BIT/issues/BIT-28133)) | [BIT-349](/BIT/issues/BIT-349); [BIT-2080](/BIT/issues/BIT-2080) / [BIT-21610](/BIT/issues/BIT-21610) `done`; CF [BIT-21847](/BIT/issues/BIT-21847) / [BIT-21912](/BIT/issues/BIT-21912); [BIT-28130](/BIT/issues/BIT-28130) medição `done`; open: [BIT-28133](/BIT/issues/BIT-28133), [BIT-28144](/BIT/issues/BIT-28144), [BIT-28145](/BIT/issues/BIT-28145) — [`docs/PERFORMANCE_BASELINE.md`](PERFORMANCE_BASELINE.md) | | 3 | Bridge Fastify + Redis | ✅ Entregue | [BIT-350](/BIT/issues/BIT-350), [BIT-2076](/BIT/issues/BIT-2076) (Redis extension fix) | | 4 | WordPress headless | ✅ Entregue | [BIT-351](/BIT/issues/BIT-351) | | 5 | SEO de primeira classe | ✅ Entregue | [BIT-349](/BIT/issues/BIT-349) — SSR, JSON-LD, OG, sitemap, robots | @@ -75,11 +75,13 @@ Alinhados à descrição do projecto no Paperclip e ao [`docs/architecture.md`]( | Issue | Título (resumo) | Estado | Relação | |-------|-----------------|--------|---------| | [BIT-28082](/BIT/issues/BIT-28082) | [Governance] Docs vs objectives sweep — cli-news-platform | `done` | **Pai** — sweep 2026-08 | -| [BIT-28130](/BIT/issues/BIT-28130) | [QA] Measure LCP/CLS/Lighthouse on andebol.net + newsproject (obj #2 gap) | `in_progress` | **Filho** — CWV / Lighthouse ainda por medir | +| [BIT-28130](/BIT/issues/BIT-28130) | [QA] Measure LCP/CLS/Lighthouse on andebol.net + newsproject (obj #2 gap) | `done` | **Filho** — medição 2026-08-04; follow-ups [BIT-28144](/BIT/issues/BIT-28144), [BIT-28145](/BIT/issues/BIT-28145) | | [BIT-28131](/BIT/issues/BIT-28131) | [Docs] Refresh PROJECT_STATUS + PERFORMANCE_BASELINE after BIT-28082 | `in_progress` | **Filho** — este ficheiro + baseline | | [BIT-28132](/BIT/issues/BIT-28132) | [DevOps] CT222 writer-pipeline + monitoring reliability review | `todo` | **Filho** — fiabilidade ops #8/#11 | | [BIT-28133](/BIT/issues/BIT-28133) | [Frontend] Resolve TTFB HIT <30ms target vs Cloudflare Free reality | `in_review` | **Filho** — contrato de performance vs Free plan | | [BIT-28134](/BIT/issues/BIT-28134) | [Automation] Writer-pipeline featured-image regression guard | `done` | **Filho** — guard regressão featured-image | +| [BIT-28144](/BIT/issues/BIT-28144) | andebol.net LCP ~8s / Lighthouse Performance ~30 | `in_progress` | **Follow-up** de BIT-28130 — CWV `andebol.net` | +| [BIT-28145](/BIT/issues/BIT-28145) | newsproject article TBT 7.4s / Performance 60 | `in_progress` | **Follow-up** de BIT-28130 — TBT artigo newsproject | ### Sweep 2026-04 — [BIT-2030](/BIT/issues/BIT-2030) (histórico) @@ -103,12 +105,13 @@ Filhos abertos sob o sweep **[BIT-28082](/BIT/issues/BIT-28082)** (pai `done`; p | Issue | Gap | Estado (board) | |-------|-----|----------------| -| [BIT-28130](/BIT/issues/BIT-28130) | Medir LCP / CLS / Lighthouse (obj #2) | `in_progress` | | [BIT-28131](/BIT/issues/BIT-28131) | Paridade docs PROJECT_STATUS + PERFORMANCE_BASELINE | `in_progress` (este trabalho) | | [BIT-28132](/BIT/issues/BIT-28132) | Review fiabilidade writer-pipeline + monitoring em CT222 | `todo` | | [BIT-28133](/BIT/issues/BIT-28133) | Alinhar target TTFB HIT <30 ms com realidade Cloudflare Free | `in_review` | +| [BIT-28144](/BIT/issues/BIT-28144) | Fix CWV `andebol.net` (LCP ~8s / Perf ~30) | `in_progress` | +| [BIT-28145](/BIT/issues/BIT-28145) | Fix TBT artigo `newsproject.bitreport.pt` (Perf 60) | `in_progress` | -Encerrado neste sweep: [BIT-28134](/BIT/issues/BIT-28134) (`done`). Novo trabalho de plataforma fora destes gaps deve abrir issues no projecto **cli-news-platform** com workspace correcto. +Encerrados neste sweep: [BIT-28130](/BIT/issues/BIT-28130) (medição), [BIT-28134](/BIT/issues/BIT-28134) (guard). Novo trabalho de plataforma fora destes gaps deve abrir issues no projecto **cli-news-platform** com workspace correcto. ## Referências rápidas