28 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 ded3c71ed6 fix(writer-pipeline): decode literal \u2013 in revista PDF URLs (BIT-31118)
Tests / writer-pipeline tests (pull_request) Successful in 38s
Tests / bridge tests (pull_request) Successful in 38s
Tests / frontend lib tests (pull_request) Successful in 43s
FPA media embeds Revista-de-Imprensa filenames with a literal JSON \u2013
escape; new URL turned the backslash into /u2013 and the fetch 404'd.
Decode \uXXXX before parsing and accept en-dash / hashed date filenames.

Paperclip-Issue: BIT-31118
Paperclip-ERRSIG: 97ac27c4c5df
Paperclip-ERRCLUSTER: ddda2b9e3d39
Paperclip-Run: 3f65156a-de49-43a1-876d-75f6285b4bc4
2026-10-13 06:19:06 +01:00
tiago-neves c61c19216c fix(writer-pipeline): demote sitemap gateway 502/503/504 to warning
Tests / writer-pipeline tests (pull_request) Successful in 49s
Tests / bridge tests (pull_request) Successful in 50s
Tests / writer-pipeline tests (push) Successful in 56s
Tests / bridge tests (push) Successful in 56s
Tests / frontend lib tests (pull_request) Successful in 1m3s
Tests / frontend lib tests (push) Successful in 1m0s
EHF google-news-sitemap already retries; residual gateway blips (BIT-30847 /
ERRSIG a92b3521aec8) must not open Error Loop tickets. Keep HTTP 500 as error
so broken endpoints like the old /sitemap.xml stay actionable.

Paperclip-Agent: Bug Squasher (urlKey bug-squasher; id 4669adc7-6368-43ef-bf27-5a601a6b7b83)
Paperclip-Issue: BIT-30847
Paperclip-Run: ce265bf3-24dc-4532-b87d-92188cc55399
2026-10-04 06:17:33 +01:00
spark 28a823dfbe Merge branch 'main' into fix/BIT-30583-draft-fetch-retry
Tests / writer-pipeline tests (push) Successful in 54s
Tests / bridge tests (push) Successful in 53s
Tests / writer-pipeline tests (pull_request) Successful in 55s
Tests / frontend lib tests (push) Successful in 1m0s
Tests / bridge tests (pull_request) Successful in 56s
Tests / frontend lib tests (pull_request) Successful in 41s
2026-10-01 07:16:25 +01:00
tiago-neves 9e7bf236eb fix(writer-pipeline): use EHF google-news sitemap (BIT-30741)
Tests / bridge tests (push) Successful in 49s
Tests / writer-pipeline tests (push) Successful in 52s
Tests / bridge tests (pull_request) Successful in 51s
Tests / writer-pipeline tests (pull_request) Successful in 54s
Tests / frontend lib tests (push) Successful in 58s
Tests / frontend lib tests (pull_request) Successful in 39s
Main eurohandball.com/sitemap.xml returns HTTP 500; robots.txt lists
google-news-sitemap.xml which serves news URLs and returns 200.

Paperclip-Issue: BIT-30741
Paperclip-Run: bfd979de-44be-41d4-a5e3-77386b0a89a6
2026-10-01 06:22:01 +01:00
tiago-neves aa19492fe4 fix(writer-pipeline): retry WP draft POSTs and demote transient fetch noise
Tests / writer-pipeline tests (pull_request) Failing after 22s
Tests / bridge tests (pull_request) Successful in 1m26s
Tests / bridge tests (push) Successful in 1m22s
Tests / writer-pipeline tests (push) Successful in 1m26s
Tests / frontend lib tests (pull_request) Successful in 1m32s
Tests / frontend lib tests (push) Successful in 1m30s
ERRSIG f723b02cf00e opened on a one-off undici "draft …: fetch failed" for a
record.pt item. Featured-image GETs already retry (BIT-related 6079046); WP
media/post POSTs did not. Retry network-only on those POSTs and report
remaining per-item draft network misses as warning so Error Loop skips them.

Paperclip-Agent: Bug Squasher (urlKey bug-squasher; id 4669adc7-6368-43ef-bf27-5a601a6b7b83)
Paperclip-Issue: BIT-30583
Paperclip-Run: fb6db8e0-afed-4fc1-8f40-a34ffeee3d27
2026-09-24 06:22:54 +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 60366a95ae fix(writer-pipeline): detect revista leads by URL when sourceKind missing
Tests / bridge tests (push) Successful in 2m6s
Tests / writer-pipeline tests (pull_request) Successful in 2m1s
Tests / writer-pipeline tests (push) Successful in 2m12s
Tests / frontend lib tests (push) Successful in 2m6s
Tests / bridge tests (pull_request) Successful in 43s
Tests / frontend lib tests (pull_request) Successful in 33s
Synthetic /revista-imprensa/ URLs without sourceKind skipped the publisher
image probe and threw Mandatory featured image (ERRSIG 88492922d213).

Paperclip-Issue: BIT-27615
Paperclip-Run: 17d5ee4b-579f-4833-943f-ea9e815e5dec
2026-07-27 06:20:21 +00:00
José AlvesandPaperclip 9b6fbe027c fix(writer-pipeline): allow revista_imprensa drafts without featured image
Tests / bridge tests (push) Successful in 54s
Tests / writer-pipeline tests (push) Successful in 57s
Tests / frontend lib tests (push) Successful in 1m0s
For revista_imprensa items, the synthetic lead URLs (e.g.
/revista-imprensa/DD-MM-YYYY/N) are not real article pages and often
return 404. The publisher homepage may also lack og:image (record.pt
has empty og:image/twitter:image content attributes). Previously this
caused a mandatory featured image error loop.

Changes:
- resolveFeaturedImageForDraft now returns null instead of throwing
  for revista_imprensa items when no image is found from any source
- Added featuredImageFromPageImgs fallback that scrapes <img> tags
  from the publisher homepage when og:image is empty/missing, filtering
  out icons, SVGs, tracking pixels, and small images
- createDraftFromAggregatedItem handles null featured image gracefully,
  creating drafts without featured_media when unavailable

BIT-26192

Co-Authored-By: Paperclip <[email protected]>
2026-07-06 06:21:12 +00:00
José AlvesandCursor 47fcb053da fix(writer): revista_imprensa publisher og:image before WebDAV (BIT-25590)
Tests / bridge tests (push) Successful in 48s
Tests / writer-pipeline tests (push) Successful in 50s
Tests / frontend lib tests (push) Successful in 48s
Tests / writer-pipeline tests (pull_request) Successful in 32s
Tests / bridge tests (pull_request) Failing after 31s
Tests / frontend lib tests (pull_request) Successful in 34s
Synthetic revista lead URLs return 404; probe publisher homepage for og:image
so drafts succeed when the federation WebDAV archive is down or misconfigured.

Co-authored-by: Cursor <[email protected]>
2026-06-19 07:04:52 +00:00
José Alves 7fb7ca272a feat(writer-pipeline): smart featured-image backfill for andebol.net (BIT-25556)
Add backfill-featured-smart.ts: extracts source URLs from post content,
queries FPA WP API for matching featured images, scrapes og:image from
IHF/EHF/Handball-Planet sources, falls back to FPA title search for
Portuguese articles, and finally tries WebDAV archive. More robust than
the slug-only backfill-featured-from-fpa.ts.

All 147 published posts now have featured_media (backfill ran in prior
heartbeat). New npm script backfill:featured-smart for future re-runs.

Paperclip-Issue: BIT-25556
Paperclip-Run: f182fddd-6d43-437a-9d2f-644fd0a76330
2026-06-18 10:46:04 +00:00
José Alves 919153aaf7 fix(frontend): force pt-PT locale and handball-only for andebol.net (BIT-25555)
Tests / frontend lib tests (push) Failing after 9s
Tests / writer-pipeline tests (push) Successful in 26s
Tests / bridge tests (push) Successful in 28s
Tests / bridge tests (pull_request) Failing after 7s
Tests / writer-pipeline tests (pull_request) Successful in 28s
Tests / frontend lib tests (pull_request) Successful in 29s
Root cause: DOMAINS_CONFIG_PATH was missing from the frontend env so
getDomainConfig('andebol.net') fell through to the English fallback.

Fixes applied:
- deploy/systemd/frontend.env.example: add DOMAINS_CONFIG_PATH and
  BRIDGE_INTERNAL_URL so Astro SSR resolves domain JSON on the CT
- bridge/src/lib/request-host.ts: drop X-Site-Host; resolve site domain
  from the HTTP Host header which nginx already preserves ($host)
- frontend/src/lib/bridge.ts: multi-domain SWR cache keys; nginx-routed
  bridge calls via public hostname with BRIDGE_INTERNAL_URL loopback
  override for CT environments where public DNS does not resolve locally
- config/writers/f0251a61: restrict Nelson Alves topics to Andebol only
  (remove Futebol / Desportos — BIT-22288 intent)
- frontend: overhauled article page (hero image, masthead, sidebar,
  share bar), rich related-articles grid, improved LatestGrid institutional
  theme, FpaAgendaSection rewrite, ui-i18n PT strings completed
2026-06-18 10:09:35 +00: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 4238ee0aa3 fix(writer-pipeline): stop eurohandball sitemap timeout error loop (BIT-25342)
Tests / writer-pipeline tests (push) Successful in 1m24s
Tests / bridge tests (push) Successful in 1m40s
Tests / frontend lib tests (push) Successful in 1m34s
Tests / writer-pipeline tests (pull_request) Successful in 1m44s
Tests / bridge tests (pull_request) Successful in 1m13s
Tests / frontend lib tests (pull_request) Successful in 1m45s
Narrow eurohandball pathIncludes to news/match pages, add pageTimeoutMs,
and report per-URL sitemap probe failures as warnings so transient
timeouts do not reopen ERRCLUSTER:97ab5f145754.

Co-authored-by: Cursor <[email protected]>
2026-06-16 17:03:00 +00:00
José AlvesandCursor 6079046c5c fix(writer-pipeline): retry featured-image fetches on transient network errors
Tests / writer-pipeline tests (push) Failing after 55s
Tests / bridge tests (push) Successful in 1m45s
Tests / frontend lib tests (push) Successful in 1m44s
Tests / bridge tests (pull_request) Successful in 1m28s
Tests / frontend lib tests (pull_request) Successful in 1m56s
Tests / writer-pipeline tests (pull_request) Successful in 1m59s
Handball Planet draft publish failed with undici "fetch failed" on a single
cycle; ingest already retries but publish-path HTML/image GETs did not.

Co-authored-by: Cursor <[email protected]>
2026-06-14 19:20:37 +00:00
José AlvesandCursor bcb95f6a0e feat(writer-pipeline): report ingest failures to error hub (BIT-25125)
Tests / writer-pipeline tests (push) Successful in 1m20s
Tests / bridge tests (push) Successful in 1m18s
Tests / frontend lib tests (push) Successful in 1m23s
Tests / writer-pipeline tests (pull_request) Successful in 1m27s
Tests / bridge tests (pull_request) Successful in 1m26s
Tests / frontend lib tests (pull_request) Successful in 1m25s
Wire run-cycle ingest and publish errors to errors.bitreport.pt using the
same reporter as bridge; document ERROR_REPORTING_* in writer env examples.

Paperclip-Agent: Artur Moreira (id ac1be104-8818-496a-80c5-fbc590a87855)
Paperclip-Issue: BIT-25125
Paperclip-Run: 06e3abea-e97b-481b-a1d5-70b286cf8983
Co-authored-by: Cursor <[email protected]>
2026-06-14 17:45:23 +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
spark 0c9e5df61c Merge pull request 'feat(writer-pipeline): newsproject.bitreport.pt writer cycle and WP env split' (#12) from feat/BIT-22288-newsproject-writer into main
Tests / writer-pipeline tests (push) Successful in 13s
Tests / bridge tests (push) Successful in 13s
Tests / frontend lib tests (push) Successful in 14s
Reviewed-on: #12
2026-05-14 19:10:00 +01:00
Artur Moreira 738c1a56d0 fix(writer-pipeline): handle ns0: XML namespace prefix in WebDAV PROPFIND parser (BIT-22306)
Tests / writer-pipeline tests (push) Successful in 14s
Tests / bridge tests (push) Successful in 14s
Tests / frontend lib tests (push) Successful in 15s
Tests / writer-pipeline tests (pull_request) Successful in 11s
Tests / bridge tests (pull_request) Successful in 12s
Tests / frontend lib tests (pull_request) Successful in 13s
Python's xml.etree.ElementTree auto-assigns numeric prefixes like ns0: for
the first namespace it encounters. The PROPFIND regex [a-z]+: did not match
ns0: because of the digit, causing parsePropfindImageHrefs to return empty
on any WebDAV server backed by Python (WsgiDAV, some NextCloud configs).

Change [a-z]+: → [a-z][a-z0-9]*: in all three namespace-tagged element
patterns (response, href, getlastmodified). Test added with a real WsgiDAV
multistatus fixture.

Paperclip-Issue: BIT-22306
2026-05-14 16:33:49 +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 72a5ccd65c feat(writer-pipeline): handball-only shortlist for andebol.net
Tests / writer-pipeline tests (push) Successful in 13s
Tests / bridge tests (push) Successful in 15s
Tests / frontend lib tests (push) Successful in 15s
Tests / writer-pipeline tests (pull_request) Successful in 11s
Tests / bridge tests (pull_request) Successful in 12s
Tests / frontend lib tests (pull_request) Successful in 13s
Disable Record/SAPO/Guardian world feeds that are not handball-scoped
(BIT-22288). Shortlist andebol.net items with topic handball only so new
drafts align with owner editorial rules.

Co-authored-by: Cursor <[email protected]>
2026-05-14 13:05:37 +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 12b76980c6 feat(writer-pipeline): require featured image and credits on WP drafts
Enforce BIT-22288: extract og/twitter images at ingest, RSS image
enclosures, optional HTML refetch before publish, upload to WP media
with caption and alt_text, and set featured_media on draft posts.
Fail closed when no usable image URL exists. Optional ANDEBOL_WP_SITE_DOMAIN
for X-Site-Domain on bridge-hosted WordPress.

Co-authored-by: Cursor <[email protected]>
2026-05-14 12:10:03 +00:00
Maria PapoilaandPaperclip 3d4b129b4c BIT-15752: Add unit tests across writer-pipeline, bridge, and frontend
Tests / writer-pipeline tests (push) Failing after 1s
Tests / bridge tests (push) Failing after 1s
Tests / frontend lib tests (push) Failing after 1s
Tests / writer-pipeline tests (pull_request) Successful in 52s
Tests / bridge tests (pull_request) Successful in 25s
Tests / frontend lib tests (pull_request) Successful in 29s
87 new tests covering previously untested pure functions:
- writer-pipeline: token-metrics, store (canonicalUrl/itemId/upsertItem/shortlist), config-load
- bridge: ranking (freshness/relevance/rank/filter/take_top_n), aggregator-mapper
- frontend/lib: format, ui-i18n, public-origin

Adds test:coverage scripts (node --experimental-test-coverage) and Gitea
CI workflow. writer-pipeline now reports 95.91% line coverage.

Co-Authored-By: Paperclip <[email protected]>
2026-04-29 01:08:41 +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 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 512ab3bca6 feat(writer-pipeline): multi-source ingest (RSS, sitemap, HTML) for BIT-711
- Add ingest-sources with retries, sitemap index/urlset parsing, and HTML meta extraction
- Preserve original article URLs in store; dedupe ids via canonical URL hash
- Extend andebol.net.sources.json: FPA, IHF RSS, Handball Planet, Eurohandball sitemap (filtered)
- Optional shortlist ?topic= query; strip common tracking query params in canonicalUrl
- Add npm test (node:test) for sitemap and html-meta helpers

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-711
Paperclip-Run: 83b79f64-d6b6-4efd-ab06-c5cc7d687169
Made-with: Cursor
2026-04-02 09:09:07 +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