Commit Graph
67 Commits
Author SHA1 Message Date
tiago-neves e723e3ee5b chore(runtime): WordPress PHP 8.5 + Node.js 24.22.1 baseline (BIT-31729)
Tests / bridge tests (push) Successful in 39s
Tests / writer-pipeline tests (push) Successful in 42s
Tests / writer-pipeline tests (pull_request) Successful in 45s
Tests / frontend lib tests (push) Successful in 55s
Tests / bridge tests (pull_request) Successful in 35s
Tests / frontend lib tests (pull_request) Successful in 47s
Align docker-compose, engines, nvmrc, and CI with the company runtime baseline.
Official wordpress:6-php8.5-fpm ships PHP 8.5.6 today; host Node must move to 24.22.1 Active LTS.

Paperclip-Issue: BIT-31729
Paperclip-Run: 8b5ae44d-b3e7-430e-871e-d5fcb1bd9fb1
2026-10-23 18:52:30 +01:00
tiago-neves 657e1c3bde fix(perf): BIT-28145 follow-up — wire sanitizer tests into npm test, defer non-critical scripts
Tests / writer-pipeline tests (push) Successful in 1m30s
Tests / frontend lib tests (pull_request) Successful in 1m22s
Tests / bridge tests (push) Successful in 1m30s
Tests / frontend lib tests (push) Successful in 1m30s
Tests / bridge tests (pull_request) Successful in 1m23s
Tests / writer-pipeline tests (pull_request) Successful in 1m23s
Post-merge Lighthouse re-verification of PR #47 confirmed article TBT
regression is resolved (7416ms -> 0-348ms, Performance 60 -> 99 median,
5 runs, results in PERFORMANCE_BASELINE.md). This follow-up closes a
gap found during that verification and widens the pass margin:

- bridge/package.json: sanitize-html.test.ts (added in the original
  fix) was never wired into the test/test:coverage scripts, so the
  "28 bridge sanitizer tests pass" claim wasn't actually exercised by
  npm test. Fixed.
- Defer mobile-menu and share-button click handlers to
  requestIdleCallback (institutional/sports headers, ArticleShareBar)
  so they don't compete with hydration-critical work.
- Split Base.astro's theme-flash-prevention script into a minimal
  inline snippet (runs before paint) and the deferred click-handler
  logic, instead of one blocking script.
- bridge articles route: /articles/:slug/related accepts an optional
  ?category_id= to skip a redundant WP post-by-slug fetch when the
  caller already has it.

Paperclip-Agent: Miguel Teixeira (urlKey miguel-teixeira; id 0f722e1a-bc3e-4381-8d98-76fa3c7aea10)
Paperclip-Issue: BIT-28145
2026-08-07 10:20:04 +01:00
spark 5fd457a75d Merge pull request 'fix(perf): BIT-28145 article page TBT 7416ms -> sanitize oEmbed HTML' (#47) from fix/BIT-28145-article-tbt into main
Tests / bridge tests (push) Successful in 1m2s
Tests / frontend lib tests (push) Successful in 1m2s
Tests / writer-pipeline tests (push) Successful in 1m3s
2026-08-05 19:01:40 +01:00
tiago-neves 1e3e6b1a3e docs: close BIT-28133 — architecture.md TTFB contract + PROJECT_STATUS status sync
Tests / bridge tests (push) Successful in 1m1s
Tests / writer-pipeline tests (pull_request) Successful in 55s
Tests / writer-pipeline tests (push) Successful in 1m3s
Tests / bridge tests (pull_request) Successful in 57s
Tests / frontend lib tests (pull_request) Successful in 57s
Tests / frontend lib tests (push) Successful in 1m4s
architecture.md §6 still stated the aspirational <30ms Cloudflare-HIT
target as if it were the production contract; PERFORMANCE_BASELINE.md
and PROJECT_STATUS.md were already revised to the measured <150ms
Free-plan contract via #40/#44 but this table was missed. Also flips
the two BIT-28133 status cells in PROJECT_STATUS.md from in_review to
done now that the contract is reconciled everywhere.
2026-08-05 06:21:22 +01:00
tiago-neves 9e41743c53 fix(deploy): sync deploy/systemd/ units from webhook-deploy.sh (BIT-28183)
Tests / bridge tests (pull_request) Successful in 1m22s
Tests / bridge tests (push) Successful in 1m54s
Tests / writer-pipeline tests (pull_request) Successful in 1m27s
Tests / writer-pipeline tests (push) Successful in 1m56s
Tests / frontend lib tests (push) Successful in 1m56s
Tests / frontend lib tests (pull_request) Successful in 48s
The cron-driven webhook-deploy.sh never refreshed /etc/systemd/system,
so new/changed units in deploy/systemd/ silently rotted in git after
the one-shot deploy.sh bootstrap (root cause of the BIT-28132 gap).
Add a step that copies deploy/systemd/*.service and *.timer to
/etc/systemd/system + daemon-reload whenever deploy/systemd/ changes
in the diff; new units still need one manual systemctl enable --now.

Also record the BIT-28183 decision to keep the 5-minute cron poll as
the permanent deploy path on CT222 and leave news-deploy-hook.service
unenabled, in docs/deployment.md.

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-28183
Paperclip-Run: 267defb1-b2d1-4a95-a8c0-4dd1c777834e
2026-08-05 02:52:17 +01:00
miguel-teixeira 19938a2f6c docs(status): mark BIT-28144 done — andebol.net CWV fix confirmed
Tests / writer-pipeline tests (push) Successful in 36s
Tests / bridge tests (push) Successful in 38s
Tests / frontend lib tests (push) Successful in 57s
Tests / writer-pipeline tests (pull_request) Successful in 1m23s
Tests / bridge tests (pull_request) Successful in 1m20s
Tests / frontend lib tests (pull_request) Successful in 1m0s
2026-08-05 00:31:45 +01:00
miguel-teixeira 1f4e2ae926 docs(perf): BIT-28144 re-measurement #2 — larger sample, article passes, home mostly passes
Tests / writer-pipeline tests (pull_request) Successful in 1m26s
Tests / frontend lib tests (push) Successful in 1m27s
Tests / bridge tests (push) Successful in 1m32s
Tests / writer-pipeline tests (push) Successful in 1m32s
Tests / bridge tests (pull_request) Successful in 1m16s
Tests / frontend lib tests (pull_request) Successful in 1m21s
2026-08-05 00:29:32 +01:00
miguel-teixeira 56f1a555f4 docs(perf): BIT-28144 root cause, fix, deploy + re-measurement addendum
Tests / writer-pipeline tests (push) Successful in 4m54s
Tests / bridge tests (push) Successful in 3m58s
Tests / frontend lib tests (push) Successful in 3m35s
Tests / writer-pipeline tests (pull_request) Successful in 2m31s
Tests / bridge tests (pull_request) Successful in 1m11s
Tests / frontend lib tests (pull_request) Successful in 1m10s
Root cause: FpaAgendaSection (andebol.net-only, up to 48 FPA agenda cards)
Style & Layout main-thread cost, fixed via content-visibility on
.fpa-agenda__card (PR #42, merged as 6b95f4d).

Also documents a separate but directly blocking finding: the ct222-news
deploy cron had been failing silently for ~24h (broken SSH deploy key,
never registered with Gitea) so 15+ merged PRs including this fix never
reached production. Fixed by switching to the standard HTTPS PAT +
credential-helper pattern from CT_DEPLOY_CREDENTIAL_ROTATION_BIT28016;
cron auto-recovered and deployed ec22a04 without further intervention.

Re-measurement is inconclusive on numeric pass/fail: this measurement
host was under heavy unrelated contention (load avg 48-60/24 cores),
confirmed by newsproject.bitreport.pt (a previously-verified-passing
control) also failing in the same session. Fix is confirmed live and
the targeted metric (Style & Layout) improved ~2x in the calmest runs;
authoritative re-verification needs PSI (quota-exhausted today) or a
quiet host window.

Paperclip-Issue: BIT-28144
2026-08-05 00:18:10 +01:00
Xika c792c746f5 docs: revise Free-plan HIT TTFB contract to <150ms (BIT-28133)
Tests / bridge tests (pull_request) Successful in 1m37s
Tests / writer-pipeline tests (pull_request) Successful in 1m39s
Tests / frontend lib tests (pull_request) Successful in 1m23s
Tests / bridge tests (push) Successful in 1m22s
Tests / writer-pipeline tests (push) Successful in 1m22s
Tests / frontend lib tests (push) Successful in 2m4s
Reconcile production SLA with Cloudflare Free measured HIT latency
(~81–130 ms). Keep <30 ms as aspirational only.
2026-08-04 23:41:20 +01:00
miguel-teixeira ee8405980c fix(perf): article TBT 7416ms — strip scripts/styles/iframes/event-handlers, lazy-load images, content-visibility
Tests / bridge tests (push) Successful in 40s
Tests / writer-pipeline tests (push) Successful in 50s
Tests / frontend lib tests (push) Successful in 1m42s
Tests / writer-pipeline tests (pull_request) Successful in 1m21s
Tests / bridge tests (pull_request) Successful in 1m23s
Tests / frontend lib tests (pull_request) Successful in 48s
BIT-28145: newsproject.bitreport.pt article template Total Blocking Time
was 7416ms (Lighthouse Performance 60) vs home 73ms (Performance 97).

Root cause: WordPress oEmbed HTML injected via set:html rendered <script>,
<style>, <link> tags, inline event handlers, and heavy <iframe> embeds
(Twitter, Instagram, YouTube) that blocked the main thread during HTML
parsing. The prior sanitizer only stripped <script> tags and added
loading=lazy to iframes — insufficient for the oEmbed payload.

Changes:
- Enhance bridge and frontend sanitizers to strip <style>, <link>,
  and inline event handlers (on* attributes) in addition to <script>
- Replace <iframe> elements with click-to-load placeholders (eliminates
  iframe document parsing cost from main thread)
- Add loading=lazy + decoding=async to <img> tags in article body
- Add content-visibility:auto to .article-body CSS (skip off-screen render)
- Add embed-placeholder styles in global.css + click handler in [slug].astro
- Parallelize article/related/trending bridge fetches
- Add preconnect hints for gravatar and featured images
- Document root cause in PERFORMANCE_BASELINE.md

Paperclip-Agent: Miguel Teixeira (urlKey miguel-teixeira; id 0f722e1a-bc3e-4381-8d98-76fa3c7aea10)
Paperclip-Issue: BIT-28145
2026-08-04 21:57:16 +01:00
spark d3055a1957 Merge pull request 'test(writer-pipeline): featured-image regression guard for revista-imprensa (BIT-28134)' (#37) from fix/BIT-28134-featured-image-regression-guard into main
Tests / writer-pipeline tests (push) Successful in 37s
Tests / bridge tests (push) Successful in 36s
Tests / frontend lib tests (push) Successful in 44s
2026-08-04 21:08:58 +01:00
José Alves 18d7f15efb docs: sync PROJECT_STATUS + baseline with BIT-28130 CWV results
Tests / writer-pipeline tests (push) Successful in 1m36s
Tests / bridge tests (push) Successful in 3m41s
Tests / frontend lib tests (push) Successful in 3m30s
Tests / writer-pipeline tests (pull_request) Successful in 46s
Tests / bridge tests (pull_request) Successful in 48s
Tests / frontend lib tests (pull_request) Successful in 47s
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
2026-08-04 20:58:33 +01:00
José Alves 98132f77c4 docs: refresh PROJECT_STATUS + PERFORMANCE_BASELINE after BIT-28082
Tests / writer-pipeline tests (push) Successful in 2m29s
Tests / bridge tests (push) Successful in 3m22s
Tests / frontend lib tests (push) Successful in 3m3s
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
2026-08-04 20:50:30 +01:00
José Alves 213c1f87fd test(writer-pipeline): featured-image regression guard for revista-imprensa (BIT-28134)
Tests / writer-pipeline tests (push) Successful in 4m52s
Tests / bridge tests (push) Successful in 2m38s
Tests / frontend lib tests (push) Successful in 3m3s
Tests / bridge tests (pull_request) Successful in 4m30s
Tests / writer-pipeline tests (pull_request) Successful in 4m43s
Tests / frontend lib tests (pull_request) Successful in 3m38s
Adds unit coverage for resolveFeaturedImageForDraft() so the mandatory
featured-image ERRSIG cluster (BIT-27615 / BIT-26192 / BIT-22288) cannot
silently regress: ordinary drafts still throw when no image resolves,
revista-imprensa leads (by sourceKind or URL) resolve to null instead,
and non-revista URLs are not over-matched. Also covers upsertItem
preserving sourceKind across updates that omit it.

Paperclip-Issue: BIT-28134
Paperclip-Run: d45309d9-128d-4266-93db-9afe285c4486
2026-08-04 20:09:47 +01:00
José Alves 3f7b4eff71 feat(writer-pipeline): PT imprensa ingest for andebol.net (BIT-25559)
Tests / bridge tests (push) Failing after 7s
Tests / writer-pipeline tests (push) Successful in 31s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Successful in 26s
Tests / bridge tests (pull_request) Successful in 27s
Tests / frontend lib tests (pull_request) Successful in 31s
Add html_listing ingest for Record and A Bola andebol sections and
revista_imprensa PDF index parsing from FPA media. Document AGGREGATOR_URL
in bridge.env.example and AGGREGATOR_OPERATIONS.md.

Paperclip-Issue: BIT-25559
Paperclip-Run: 0ab092e1-68ab-4e5a-90bd-4262e9c3d9fc
2026-06-18 10:01:28 +00:00
José AlvesandCursor be0b0c9c6f fix(deploy): ensure writer-pipeline var is writable by www-data
Tests / writer-pipeline tests (push) Failing after 11s
Tests / bridge tests (push) Successful in 29s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Failing after 11s
Tests / bridge tests (pull_request) Failing after 13s
Tests / frontend lib tests (pull_request) Successful in 29s
Writer systemd oneshots run as www-data but deploy never chowned
writer-pipeline/var, causing EACCES on aggregated-items.json when
the store was created by root. Mirror BIT-743 bridge/config/writers
fix; rebuild writer-pipeline on webhook when that tree changes.

Paperclip-Issue: BIT-25140
Co-authored-by: Cursor <[email protected]>
2026-06-14 20:04:03 +00:00
José Alves ea9a7ad5d9 docs(deploy): add .env runtime preservation rules (BIT-25005)
Tests / writer-pipeline tests (push) Successful in 3m9s
Tests / bridge tests (push) Successful in 3m9s
Tests / frontend lib tests (push) Successful in 3m26s
Tests / writer-pipeline tests (pull_request) Successful in 3m16s
Tests / bridge tests (pull_request) Successful in 1m48s
Tests / frontend lib tests (pull_request) Successful in 1m40s
Propagate DEPLOY_STANDARD.md §3.1 to this repo: prohibit cp .env.example .env
over existing production .env, require rsync excludes, and mandate
PRODUCTION_ACCESS_SYNC_LOG entries for credential changes.

Paperclip-Task: BIT-25008
2026-06-11 15:37:19 +00:00
José Alves e08840af18 feat(writer-pipeline): FPA featured-image backfill + media:content ingestion — BIT-24384
Tests / writer-pipeline tests (push) Successful in 31s
Tests / bridge tests (push) Successful in 32s
Tests / frontend lib tests (push) Successful in 34s
Tests / writer-pipeline tests (pull_request) Successful in 28s
Tests / bridge tests (pull_request) Successful in 32s
Tests / frontend lib tests (pull_request) Successful in 31s
- Add backfill-featured-from-fpa.ts: matches andebol.net post slugs against
  FPA portal WP REST API and uploads featured images for matched posts
- Export attachFeaturedImageToPost from wp-publish.ts for reuse by backfill
- Add npm script backfill:featured for one-shot execution
- Extend RSS ingest to extract media:content and media:thumbnail fields
  (BIT-24388: FPA feed uses <media:content> for images, not <enclosure>)
- Update config/domains/andebol.net.json: wp_endpoint → public HTTPS URL
- Update docs; add pino-pretty dev dep to bridge

Backfill result (2026-06-05): 30 updated, 52 skipped (no FPA match), 0 errors.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-24389
2026-06-05 02:29:47 +00:00
José Alves cba153cfc1 fix(docs): update CT222 IP from 10.10.50.140 to 10.10.50.204 — BIT-24053
Tests / bridge tests (push) Successful in 29s
Tests / writer-pipeline tests (push) Successful in 30s
Tests / frontend lib tests (push) Successful in 31s
Tests / writer-pipeline tests (pull_request) Successful in 28s
Tests / bridge tests (pull_request) Successful in 28s
Tests / frontend lib tests (pull_request) Successful in 26s
CT222 news-project-test changed IP following DHCP re-lease (BIT-24050
emergency fix). IP is now static at 10.10.50.204 via systemd-networkd.
Update all doc references, deploy script post-install notes, and
wordpress/README direct-access URLs.

Paperclip-Agent: Tiago Neves (devops; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-24053
Paperclip-Run: 9c69919d-4c21-48b0-8eb7-2b9745bed65c
2026-06-01 13:12:36 +00:00
Artur Moreira 0a220c158f docs(writer-pipeline): clarify WebDAV disabled vs unreachable fallback
Tests / writer-pipeline tests (push) Failing after 5s
Tests / bridge tests (push) Successful in 20s
Tests / writer-pipeline tests (pull_request) Successful in 16s
Tests / bridge tests (pull_request) Successful in 16s
Tests / frontend lib tests (push) Successful in 20s
Tests / frontend lib tests (pull_request) Successful in 17s
Document that when WRITER_WEBDAV_ENABLED is off the archive is not used,
and that enabled-but-failing PROPFIND/GET surfaces an explicit error with
operational fallback (disable or restore connectivity). Aligns BIT-22292
acceptance wording with actual pipeline behaviour.
2026-05-14 16:10:14 +00:00
Artur MoreiraandCursor 7c0a515368 feat(writer-pipeline): newsproject.bitreport.pt writer cycle and WP env split
Tests / writer-pipeline tests (push) Failing after 5s
Tests / bridge tests (push) Failing after 6s
Tests / frontend lib tests (push) Successful in 14s
Tests / writer-pipeline tests (pull_request) Successful in 11s
Tests / bridge tests (pull_request) Successful in 13s
Tests / frontend lib tests (pull_request) Successful in 14s
Add site-scoped WP credentials (NEWSPROJECT_* vs ANDEBOL_*), RSS sources
config, systemd oneshot/timer offset from andebol, env template, and
deployment docs so BIT-22288 covers both stacks.

Co-authored-by: Cursor <[email protected]>
2026-05-14 14:40:09 +00:00
Artur MoreiraandCursor 6819297e0d feat(writer-pipeline): WebDAV federation archive fallback for featured images
Tests / writer-pipeline tests (push) Successful in 14s
Tests / bridge tests (push) Successful in 14s
Tests / frontend lib tests (push) Successful in 15s
When RSS/HTML provide no image, optional WRITER_WEBDAV_* env enables PROPFIND
depth-1 listing, headline-based file pick, Basic-auth GET, and WP caption from
Credit___filename pattern or WRITER_WEBDAV_DEFAULT_CREDIT (BIT-22292).

Co-authored-by: Cursor <[email protected]>
2026-05-14 13:02:14 +00:00
Artur MoreiraandCursor 9ecc4ac659 docs: note BIT-2030 children-completed wake; link perf row to CF issues
Clarify intro for issue_children_completed parent reopen. Extend
objective #2 traceability with BIT-21847/BIT-21912 aligned to baseline.

Co-authored-by: Cursor <[email protected]>
2026-05-12 22:43:33 +00:00
Artur MoreiraandCursor 9b6029f369 docs: fix Cloudflare cache verification (GET vs HEAD) after BIT-21847
Document GET-based curl checks, Free-plan contains paths, and Edge TTL
note aligned with cf-cache-rules-apply.sh. Add baseline operator footnote
and independent HIT smoke.

Co-authored-by: Cursor <[email protected]>
2026-05-12 22:42:29 +00:00
Artur MoreiraandPaperclip a1107167d3 docs(perf): update PERFORMANCE_BASELINE.md with Cloudflare HIT measurements (BIT-21912)
Tests / writer-pipeline tests (push) Successful in 13s
Tests / bridge tests (push) Successful in 15s
Tests / frontend lib tests (push) Successful in 13s
Cache Rule applied 2026-05-12T22:39 UTC; both zones now return cf-cache-status:
HIT on repeat GET /. TTFB on HIT ~81-130 ms (down from ~220-380 ms DYNAMIC).

Co-Authored-By: Paperclip <[email protected]>
2026-05-12 22:40:57 +00:00
Artur MoreiraandCursor 95b3c1b703 docs(news-platform): tighten Cloudflare HTML cache runbook for BIT-21847
Add /api/ exclusion and per-zone filter expressions in deployment.md.
Record continuation verification in PERFORMANCE_BASELINE (still DYNAMIC).
Execution moves to Paperclip child BIT-21912 for DevOps dashboard apply.

Co-authored-by: Cursor <[email protected]>
2026-05-12 11:00:07 +00:00
Artur Moreira 740f3b38d6 docs(perf): update BIT-21610 addendum with fresh TTFB samples (2026-05-12 10:50 UTC)
Add 3-sample min/median/max TTFB measurements confirming ~220ms origin
latency. Both domains return cache-control: s-maxage=60, stale-while-revalidate=300.
Cloudflare edge caching (cf-cache-status: HIT) still pending Cache Rule
in BIT-21847.

Paperclip-Issue: BIT-21610
Paperclip-Run: $PAPERCLIP_RUN_ID
2026-05-12 10:51:25 +00:00
Artur MoreiraandCursor be8c48c039 docs: close BIT-2030 sweep in PROJECT_STATUS
All direct children are done on the board; mark parent BIT-2030 done,
update objective #2 and WIP section, and note sweep completion in intro.

Co-authored-by: Cursor <[email protected]>
2026-05-12 08:05:36 +00:00
Artur Moreira 84821111e4 docs(perf): add 2026-05-12 re-measurement addendum to PERFORMANCE_BASELINE
Cache-Control headers (BIT-2261) confirmed live on both domains.
TTFB improved from ~300ms to ~220ms. Remaining gap: Cloudflare Cache
Rule needed for HTML caching (cf-cache-status still DYNAMIC).

Paperclip-Issue: BIT-21610
2026-05-12 07:26:02 +00:00
Artur MoreiraandCursor 5af57b37d6 docs: reflect BIT-21770 recovery and BIT-21610 todo in PROJECT_STATUS
Paperclip API drift: add child BIT-21770, set BIT-21610 to todo, WIP row
for recovery task.

Co-authored-by: Cursor <[email protected]>
2026-05-12 05:48:53 +00:00
Artur MoreiraandCursor a34c369fba docs: sync PROJECT_STATUS with board after BIT-2079/21615 closure
Reflect API state: BIT-2079 and BIT-21615 done; BIT-21610 in_progress;
objective #11 and WIP table updated accordingly.

Co-authored-by: Cursor <[email protected]>
2026-05-11 22:48:24 +00:00
Artur Moreira 6282e73926 feat(BIT-2079): add systemd service+timer for andebol.net writer pipeline
Tests / writer-pipeline tests (push) Successful in 18s
Tests / bridge tests (push) Successful in 17s
Tests / frontend lib tests (push) Successful in 17s
Daily oneshot cycle at 06:00 UTC via news-writer-andebol.timer;
env template covers ANDEBOL_WP_* credentials; deployment.md updated
with install steps, log tailing, and manual test run instructions.

Paperclip-Issue: BIT-2079
2026-05-11 21:51:33 +00:00
Artur MoreiraandCursor ea264a85ac docs: index BIT-21615 fila escalation under PROJECT_STATUS
Record the daily fila orphan_lock escalation subtask as an operational
child of BIT-2030 for parity with the board tree.

Co-authored-by: Cursor <[email protected]>
2026-05-11 21:37:58 +00:00
Artur MoreiraandCursor 9ba8801e83 docs: link runbooks to objectives; track prod perf validation as BIT-21610
Add runbooks README cross-reference to PROJECT_STATUS/architecture
objectives. Extend PROJECT_STATUS with child BIT-21610 and WIP row for
post-baseline production cache/TTFB validation.

Co-authored-by: Cursor <[email protected]>
2026-05-11 21:33:05 +00:00
Artur MoreiraandCursor 2a434519c9 docs: align PROJECT_STATUS with Paperclip children for BIT-2030
Refresh docs/PROJECT_STATUS.md against API state: BIT-2030 remains
in_progress; BIT-2078 and BIT-2080 are done; BIT-2079 is in_progress.
Objective #2 and WIP table now reference PERFORMANCE_BASELINE and
post-audit remediation instead of a stale open audit task.

Co-authored-by: Cursor <[email protected]>
2026-05-11 21:28:04 +00:00
Artur Moreira 085ee7be88 Fix SSR 503 when bridge is unhealthy and correct systemd boot order
resolveSsrBridge now treats non-2xx /health as failure in production.
news-bridge no longer waits for news-frontend; frontend Wants+After
bridge so the API is up when Astro starts. Document the PT 503 string
and recovery commands in the BIT-746 runbook.
2026-04-23 10:36:22 +01:00
Artur Moreira 013bdca8f3 docs: incident runbook for aggregator stall, lag, escalation (BIT-3915)
Add NEWS_PLATFORM_INCIDENT_RUNBOOK_BIT3915 with detection/recovery for the
writer-pipeline HTTP aggregator, lag signals, and escalation ladder. Cross-link
from monitoring, aggregator operations, and the runbooks index.

Made-with: Cursor
2026-04-17 04:01:17 +00:00
Artur MoreiraandPaperclip eff0aaa366 feat(frontend): add Cache-Control headers to all page routes (BIT-2261)
Set Cache-Control: s-maxage=60, stale-while-revalidate=300 on all page
routes to enable Cloudflare CDN caching per docs/architecture.md § 7.

Files updated:
- index.astro (homepage)
- article/[slug].astro (article pages)
- category/[slug].astro (category pages)
- noticias.astro (news listing)
- search.astro (search results)
- sitemap.xml.ts (sitemap)
- robots.txt.ts (robots)

This enables:
- CDN edge caching for 60 seconds (s-maxage)
- Serving stale content while revalidating for up to 300s (SWR)
- Improved TTFB for repeated requests (target: <30ms cache HIT)

Acceptance criteria:
✓ All page routes return correct Cache-Control header
✓ Cloudflare can cache responses with cf-cache-status: HIT
✓ TTFB improves to <30ms for cache HIT scenario
✓ Header values match architecture spec

Co-Authored-By: Paperclip <[email protected]>
2026-04-11 03:37:32 +00:00
Artur MoreiraandPaperclip 216c537ce7 docs: add PROJECT_STATUS.md — objectives vs delivery matrix (BIT-2078)
Maps all 12 project objectives against delivered scope, links active
Paperclip sweep (BIT-2030) and open child issues (BIT-2079, BIT-2080),
and summarises the full repo tree for governance visibility.

Co-Authored-By: Paperclip <[email protected]>
2026-04-10 21:51:05 +00:00
Artur Moreira 68f85d7f04 docs(runbooks): add runbook index (BIT-1951)
Add docs/runbooks/README.md linking BIT-746 escalation, monitoring,
deployment, smoke script, and paperclip company runbook index. Surface
the index from README and docs/monitoring.md.

Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-1951
Paperclip-Run: ac17e30b-ad9a-46fd-bdb6-ffdfa0d99242
Made-with: Cursor
2026-04-09 22:29:32 +00:00
Artur Moreira c75ae37054 docs: sync local frontend/domain documentation
Publish the local docs updates for domain and frontend notes so guidance is available in Git.
2026-04-08 08:58:21 +01:00
Artur Moreira f5b9a5d058 docs(monitoring): BIT-746 public URL probe, inventory, alert runbook
Extend healthcheck.sh with optional BRIDGE_DEEP_URL and PUBLIC_PAGE_URL
(customer-facing HTTPS with redirects). Document must-not-fail checks,
intervals, and escalation in docs/monitoring.md and a dedicated runbook.

Paperclip-Issue: BIT-746
Paperclip-Run: 04281f51-59ac-4267-a269-f12269dc2320
Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Made-with: Cursor
2026-04-03 00:23:28 +00:00
Artur Moreira f15287e589 feat(monitoring): add service health monitoring with alerts (BIT-744)
Automated health monitoring for the news-platform services on CT222,
motivated by the bridge crash-loop incident (BIT-743) where 3,608
restarts went undetected until manual discovery.

Health endpoints:
- Bridge /health enhanced with optional ?checks=true for deep
  dependency probes (WordPress, Redis) and uptime reporting
- Frontend /health.json added as Astro API route

Monitoring infrastructure:
- healthcheck.sh: periodic probe script with HTTP checks, systemd
  restart-count detection, cooldown logic, and Ntfy push alerting
- news-healthcheck.timer: runs every 3 min (detection < 5 min)
- [email protected]: OnFailure template for instant crash alerts
- All three service units updated with OnFailure= directive
- deploy.sh updated to install monitoring units and env file

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-744
Paperclip-Run: 405ab587-8b8b-4963-8867-0feb95a994e3
2026-04-02 23:37:06 +00:00
Artur Moreira 89040e8a15 feat(writer-pipeline): expand andebol.net aggregator sources (PT + international)
Add Record and SAPO RSS, Guardian world and BBC handball; cap noisy RSS via
maxItems. Document Lusa/wire and ToS notes in AGGREGATOR_OPERATIONS.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-741
Paperclip-Run: ce6e2b51-1a3f-46f5-b479-2500427a0327
Made-with: Cursor
2026-04-02 20:59:20 +00:00
Artur Moreira b629f6c6aa feat(frontend): PT shell i18n, html lang pt-PT, i18n docs (BIT-739)
- Set document language to full BCP-47 from domain config (e.g. pt-PT).
- Extend ui-i18n with service errors, ad labels, ARIA landmarks, category
  meta fallback, and localized search upstream message.
- Localize ArticleHeader (dates, reading time, breadcrumb); omit duplicate
  breadcrumb when institutional chrome already provides one.

Docs: add docs/i18n.md strategy sketch; domains.md and deployment.md
(BRIDGE_INTERNAL_URL) cross-links.

Paperclip-Agent: ac1be104-8818-496a-80c5-fbc590a87855
Paperclip-Issue: 182b154e-5ad4-4965-9f30-50a66ef51ce0
Paperclip-Run: 6ce7746f-bfb6-4486-a1f5-aed26fe8e149
Made-with: Cursor
2026-04-02 20:06:48 +00:00
Artur Moreira 4d60425f7d docs(andebol): establish editorial brief and publication criteria
Introduces comprehensive editorial standards for andebol.net to ensure:
- Only Portuguese-language (PT-PT) content is published
- Real, verifiable news with proper source attribution
- No plagiarism or copy-pasted content
- Clear content categories, writing templates, and quality checklist

Addresses the urgent need for editorial governance following an English-language
article publication incident. Includes templates for match reports, transfers,
analysis, and competition updates.

Updates writer pipeline docs to reference the new editorial brief.

Paperclip-Agent: f0251a61-38e1-4a9b-8cd1-38d96a320cab
Paperclip-Issue: BIT-740
Paperclip-Run: 248bfdd9-8f8e-4ff3-8f25-1726da6a5e16
2026-04-02 20:05:02 +00:00
Artur Moreira 7f0deae75f feat(aggregator): searchable store, bridge AGGREGATOR_URL, writer candidates
Implement BIT-709 acceptance: GET /search and /stats on the writer-pipeline
aggregator; bridge AggregatorClient calls /search and maps items with
source_url. /writers/:id/candidates merges aggregator-first with WordPress,
exposes candidate_source and matched_sources, and passes max_age_hours into
ranking. Add docs/AGGREGATOR_OPERATIONS.md and store unit tests.

Paperclip-Issue: BIT-709
Made-with: Cursor
2026-04-02 19:42:39 +00:00
Artur Moreira 5999fc56cc feat(writer-tools): add CLI and API for content aggregation management
Implement writer tools for agents (Nelson Alves, AI News Writer) to:
- Manage topics and sources they write about
- Query aggregated content by relevance and freshness
- Get ranked writing candidates (top-N articles)

Changes:
- bridge/src/routes/writers.ts - REST API endpoints for writer operations
- bridge/src/services/writer-config.ts - Configuration management
- bridge/src/services/ranking.ts - Freshness/relevance scoring algorithm
- bridge/src/services/aggregator-client.ts - Aggregator integration (stub)
- config/writers/{agent-id}.json - Agent configuration storage
- docs/writer-tools.md - Complete usage documentation

Endpoints:
  GET /writers/:agentId - Get full configuration
  GET /writers/:agentId/topics - List topics
  POST /writers/:agentId/topics - Add topic
  DELETE /writers/:agentId/topics/:topic - Remove topic
  GET /writers/:agentId/sources - List sources
  POST /writers/:agentId/sources - Add source
  DELETE /writers/:agentId/sources/:sourceId - Remove source
  GET /writers/:agentId/candidates - Get top writing candidates
  GET /writers/:agentId/stats - Get aggregation stats
  PUT /writers/:agentId/ranking-preferences - Update weights

Features:
- Weighted ranking: freshness (60%) + relevance (40%, topic matching)
- Stale-While-Revalidate caching for performance
- Per-agent configuration (JSON files)
- Integration-ready for BIT-709 aggregator

Paperclip-Agent: f0251a61-38e1-4a9b-8cd1-38d96a320cab
Paperclip-Issue: BIT-712
Paperclip-Run: a0707773-bfef-4313-9fa3-dd7cebf278cb
2026-04-02 13:16:58 +00:00
Artur Moreira f18e1f9fed feat(writer-pipeline): aggregator-first andebol.net ingest, metrics, optional WP drafts
Add writer-pipeline package: RSS ingest to local store, shortlist, per-cycle
token estimates (aggregator read context vs full HTML), optional Fastify
aggregator API, optional WordPress draft creation via Application Passwords.
Document runbook in docs/WRITER_PIPELINE_ANDEBOL.md; extend README structure.

Refs: BIT-713
Made-with: Cursor
2026-04-02 08:40:12 +00:00
Artur Moreira 3579fdb837 docs(aggregator): BIT-710 data architecture and contract
Define complete data schema, deduplication rules, retention policy,
and 4-phase rollout plan for multi-source news content aggregator.

Unblocks BIT-711 (ingest), BIT-712 (writer tools), and BIT-713 (integration).

Paperclip-Issue: BIT-710
Paperclip-Issue: BIT-709
Paperclip-Agent: xika
Paperclip-Run: 31ec8d7f-43a6-480d-b3df-fba5de85cdab
2026-04-02 08:36:57 +00:00