From 98132f77c451766615d04ca3244755a41cde2fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= Date: Tue, 4 Aug 2026 20:50:30 +0100 Subject: [PATCH 1/3] docs: refresh PROJECT_STATUS + PERFORMANCE_BASELINE after BIT-28082 Align objectives matrix and open-work section with the Aug 2026 governance sweep children; lead the performance baseline with May HIT evidence instead of the superseded April cache-gap summary. Paperclip-Issue: BIT-28131 Paperclip-Run: 52ceb27e-9eda-4fe2-92f2-3794e4a40d1c --- .claude/settings.local.json | 17 ++++++++ docs/PERFORMANCE_BASELINE.md | 77 ++++++++++++++++++++++-------------- docs/PROJECT_STATUS.md | 39 ++++++++++++++---- 3 files changed, 97 insertions(+), 36 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..2b59fd4 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,17 @@ +{ + "permissions": { + "allow": [ + "Bash(/opt/bitreport/news-platform/scripts/paperclip-issue-update.sh:*)", + "Bash(/opt/bitreport/news-platform/scripts/paperclip:*)", + "Bash(curl:*)", + "Bash(env)", + "Bash(env:*)" + ], + "additionalDirectories": [ + "/home/paperclip/.paperclip/instances/default/companies/ab3f6b5f-624e-4e31-9002-6fd63ef40f03", + "/home/paperclip/.paperclip/instances/default/companies/ab3f6b5f-624e-4e31-9002-6fd63ef40f03/acp-engine/agents/49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e", + "/home/paperclip/.paperclip/instances/default/workspaces/49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e" + ], + "defaultMode": "default" + } +} diff --git a/docs/PERFORMANCE_BASELINE.md b/docs/PERFORMANCE_BASELINE.md index 84896ed..29ef949 100644 --- a/docs/PERFORMANCE_BASELINE.md +++ b/docs/PERFORMANCE_BASELINE.md @@ -62,21 +62,43 @@ Cache Rule applied to both zones via `deploy/scripts/cf-cache-rules-apply.sh` (` ## Executive Summary -Baseline performance audit reveals **critical cache implementation gap**: Neither production domain is returning `Cache-Control` headers, preventing Cloudflare edge caching. TTFB measurements show ~300ms for all requests instead of target <30ms (cache HIT) / <200ms (cache MISS). +**Current posture (post May 2026 addendum — [BIT-21610](/BIT/issues/BIT-21610) / [BIT-21912](/BIT/issues/BIT-21912)):** -**Status:** ⚠️ **TARGETS NOT MET** — Cache layer misconfiguration blocks target achievement. +| Area | Status | +|------|--------| +| `Cache-Control` on Astro pages | ✅ Present (`s-maxage=60, stale-while-revalidate=300`) | +| 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) | + +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. + +**Docs refresh:** [BIT-28131](/BIT/issues/BIT-28131) under governance sweep [BIT-28082](/BIT/issues/BIT-28082). --- ## Architecture Targets vs. Actual Measurements +### Current (May 2026 re-measurement + edge HIT) + | Metric | Target | Actual | Status | Notes | |--------|--------|--------|--------|-------| -| **TTFB (cache HIT)** | < 30 ms | ~300 ms | ❌ MISS | No Cache-Control headers; Cloudflare marking as DYNAMIC | -| **TTFB (cache MISS)** | < 200 ms | ~300 ms | ❌ MISS | Same as HIT; cache not functioning | -| **LCP** | < 2.5 s | *Not measured* | ⚠️ BLOCKED | Requires Chrome DevTools or web.dev API | -| **CLS** | < 0.1 | *Not measured* | ⚠️ BLOCKED | Requires Chrome DevTools or web.dev API | -| **Lighthouse Performance** | ≥ 90 | *Not measured* | ⚠️ BLOCKED | npm environment issue; requires npm fix | +| **TTFB (cache HIT)** | < 30 ms | ~81–130 ms | ⚠️ | Edge HIT confirmed; Free-plan floor vs aspirational target ([BIT-28133](/BIT/issues/BIT-28133)) | +| **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) | + +### Historical (April 2026 baseline — superseded for cache/TTFB) + +| Metric | Target | Actual (2026-04-11) | Status | Notes | +|--------|--------|---------------------|--------|-------| +| **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 | --- @@ -159,44 +181,41 @@ The frontend (Astro) is not setting Cache-Control headers on responses. Per `doc --- -## Blocking Issues +## Open follow-ups (post May 2026) -### Issue 1: Missing Cache-Control Headers (CRITICAL) +Cache-Control + edge HIT are **resolved** (see May addendum). Remaining gaps under [BIT-28082](/BIT/issues/BIT-28082): -**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` +| 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. --- ## Measurement Limitations -The following metrics could not be measured due to environmental constraints: +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)** - - Requires Chrome DevTools Protocol or lighthouse CLI - - npm environment has tsx dependency issue preventing lighthouse installation - - Alternative: Use web.dev PageSpeed Insights API (requires key) - -2. **Lighthouse Performance Score** - - Same npm issue prevents CLI invocation - - Could be obtained via web.dev PageSpeed Insights or Chrome User Experience Report +1. **LCP / CLS (Core Web Vitals)** — needs Chrome DevTools Protocol, Lighthouse CLI, or PageSpeed Insights +2. **Lighthouse Performance Score** — same tooling path ### Recommendation -Once Cache-Control headers are implemented: -1. Run Lighthouse audit again (should see improvement from reduced TTFB) -2. Measure LCP/CLS with web.dev or Chrome DevTools -3. Update baseline with full metrics +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 --- ## Next Steps -1. **Immediate:** Create [BIT-2081](/BIT/issues/BIT-2081) — Implement Cache-Control headers in Astro frontend -2. **After fix merged:** Re-run full audit to validate target achievement -3. **Archive:** Update this baseline document with complete measurements +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 --- diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index 783f494..e8a4580 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -1,6 +1,8 @@ # Estado do projecto — [CLI] News Platform -Documento de **paridade entre objectivos e entregas** no repositório **news-platform** (workspace Paperclip **[CLI] News platform**, `urlKey` **cli-news-platform**). Complementa o índice de runbooks em [`docs/runbooks/README.md`](runbooks/README.md) e a arquitectura em [`docs/architecture.md`](architecture.md). O sweep de governance **[BIT-2030](/BIT/issues/BIT-2030)** (2026-04) está **fechado no board** quando o pai está `done` após todos os filhos directos terminarem (wake `issue_children_completed` pode voltar a abrir o pai brevemente até esse fecho); [BIT-1911](/BIT/issues/BIT-1911) permanece referência histórica do ciclo anterior. +Documento de **paridade entre objectivos e entregas** no repositório **news-platform** (workspace Paperclip **[CLI] News platform**, `urlKey` **cli-news-platform**). Complementa o índice de runbooks em [`docs/runbooks/README.md`](runbooks/README.md) e a arquitectura em [`docs/architecture.md`](architecture.md). + +**Sweep actual:** [BIT-28082](/BIT/issues/BIT-28082) (2026-08) — governance docs vs objectives; pai `done` após criar filhos accionáveis. Sweep anterior [BIT-2030](/BIT/issues/BIT-2030) (2026-04) permanece referência histórica; [BIT-1911](/BIT/issues/BIT-1911) é o ciclo legado anterior. ## Objectivos do projecto @@ -9,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), LCP < 2.5 s, CLS < 0.1, Lighthouse ≥ 90. | +| 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). | | 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. | @@ -26,16 +28,16 @@ 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 | ✅ Auditoria + validação prod + edge cache (HIT) | [BIT-349](/BIT/issues/BIT-349); [BIT-2080](/BIT/issues/BIT-2080) / [BIT-21610](/BIT/issues/BIT-21610) `done`; Cloudflare [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/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) | | 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 | | 6 | Deploy em LXC | ✅ Entregue | [BIT-347](/BIT/issues/BIT-347), [BIT-352](/BIT/issues/BIT-352), [BIT-426](/BIT/issues/BIT-426) | | 7 | Deploy automático | ✅ Entregue | [BIT-352](/BIT/issues/BIT-352) — `webhook-deploy.sh` + `deploy-hook-server.mjs` | -| 8 | Monitorização com alertas | ✅ Entregue | [BIT-744](/BIT/issues/BIT-744), [BIT-746](/BIT/issues/BIT-746) — healthcheck + Ntfy | +| 8 | Monitorização com alertas | ✅ Entregue (fiabilidade CT222 em revisão) | [BIT-744](/BIT/issues/BIT-744), [BIT-746](/BIT/issues/BIT-746); open: [BIT-28132](/BIT/issues/BIT-28132) | | 9 | Domínio andebol.net | ✅ Entregue | [BIT-497](/BIT/issues/BIT-497), [BIT-507](/BIT/issues/BIT-507), [BIT-584](/BIT/issues/BIT-584)–[BIT-626](/BIT/issues/BIT-626) | | 10 | Agregador multi-source | ✅ Entregue | [BIT-709](/BIT/issues/BIT-709)–[BIT-713](/BIT/issues/BIT-713) | -| 11 | Pipeline de escrita AI | ✅ Automação entregue | [BIT-741](/BIT/issues/BIT-741) — pipeline; timer systemd [BIT-2079](/BIT/issues/BIT-2079) `done` | +| 11 | Pipeline de escrita AI | ✅ Automação entregue (guard featured-image + fiabilidade CT222) | [BIT-741](/BIT/issues/BIT-741); timer [BIT-2079](/BIT/issues/BIT-2079) `done`; [BIT-28134](/BIT/issues/BIT-28134) `done`; open: [BIT-28132](/BIT/issues/BIT-28132) | | 12 | Internacionalização PT-PT | ✅ Entregue | [BIT-739](/BIT/issues/BIT-739) | ## Árvore do repositório (resumo) @@ -68,10 +70,23 @@ Alinhados à descrição do projecto no Paperclip e ao [`docs/architecture.md`]( ## Árvore de issues (sweep actual e filhos) +### Sweep 2026-08 — [BIT-28082](/BIT/issues/BIT-28082) + +| 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-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 | + +### Sweep 2026-04 — [BIT-2030](/BIT/issues/BIT-2030) (histórico) + | Issue | Título (resumo) | Estado | Relação | |-------|-----------------|--------|---------| | [BIT-2030](/BIT/issues/BIT-2030) | [Governance] Docs vs objectives sweep — cli-news-platform | `done` | **Pai** — sweep 2026-04 (todos os filhos directos `done`) | -| [BIT-2078](/BIT/issues/BIT-2078) | Add docs/PROJECT_STATUS.md — objectives vs delivery matrix | `done` | **Filho** — este ficheiro | +| [BIT-2078](/BIT/issues/BIT-2078) | Add docs/PROJECT_STATUS.md — objectives vs delivery matrix | `done` | **Filho** — criação deste ficheiro | | [BIT-2079](/BIT/issues/BIT-2079) | Automate andebol.net writer pipeline — systemd timer on LXC | `done` | **Filho** — automação LXC | | [BIT-2080](/BIT/issues/BIT-2080) | Core Web Vitals audit — verify TTFB/LCP/Lighthouse targets | `done` | **Filho** — baseline em [`PERFORMANCE_BASELINE.md`](PERFORMANCE_BASELINE.md) | | [BIT-21610](/BIT/issues/BIT-21610) | Prod validation — Cache-Control / TTFB vs PERFORMANCE_BASELINE | `done` | **Filho** — fecho pós-auditoria (Nginx / edge / medição) | @@ -84,7 +99,16 @@ Alinhados à descrição do projecto no Paperclip e ao [`docs/architecture.md`]( ## Entregáveis em falta / work-in-progress -Nenhum filho directo aberto sob **[BIT-2030](/BIT/issues/BIT-2030)** (sweep governance 2026-04 encerrado). Novo trabalho de plataforma deve abrir issues no projecto **cli-news-platform** com workspace correcto. +Filhos abertos sob o sweep **[BIT-28082](/BIT/issues/BIT-28082)** (pai `done`; projecto **cli-news-platform** permanece `in_progress` enquanto houver filhos activos): + +| 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` | + +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. ## Referências rápidas @@ -95,5 +119,6 @@ Nenhum filho directo aberto sob **[BIT-2030](/BIT/issues/BIT-2030)** (sweep gove | Monitorização | [`docs/monitoring.md`](monitoring.md) | | Índice de runbooks | [`docs/runbooks/README.md`](runbooks/README.md) | | Multi-domínio | [`docs/domains.md`](domains.md) | +| Performance baseline | [`docs/PERFORMANCE_BASELINE.md`](PERFORMANCE_BASELINE.md) | | Padrões de repositórios (meta paperclip) | `docs/PRODUCT_REPOSITORY_STANDARDS.md` no repositório **paperclip** | | Ambientes LXC | `docs/environments/03-lxc.md` no repositório **paperclip** | From 1ec9b6919cd7676459d31c0f6028b90ae512580e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= Date: Tue, 4 Aug 2026 20:50:46 +0100 Subject: [PATCH 2/3] chore: drop accidental .claude settings from BIT-28131 commit Paperclip-Issue: BIT-28131 Paperclip-Run: 52ceb27e-9eda-4fe2-92f2-3794e4a40d1c --- .claude/settings.local.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 2b59fd4..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(/opt/bitreport/news-platform/scripts/paperclip-issue-update.sh:*)", - "Bash(/opt/bitreport/news-platform/scripts/paperclip:*)", - "Bash(curl:*)", - "Bash(env)", - "Bash(env:*)" - ], - "additionalDirectories": [ - "/home/paperclip/.paperclip/instances/default/companies/ab3f6b5f-624e-4e31-9002-6fd63ef40f03", - "/home/paperclip/.paperclip/instances/default/companies/ab3f6b5f-624e-4e31-9002-6fd63ef40f03/acp-engine/agents/49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e", - "/home/paperclip/.paperclip/instances/default/workspaces/49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e" - ], - "defaultMode": "default" - } -} 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 3/3] 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