Spaces:
Sleeping

app / docs /OPERATIONAL_STATE.md
CarlChaaya's picture
Super-squash branch 'main' using huggingface_hub
69d639b
|
Raw History Blame Contribute Delete
4.61 kB

Operational State

Last verified: 2026-05-06 23:46 EEST (+0300).

Runtime

  • Project path: /Users/carlchaaya/Documents/code/FTI AI Factory/fti-opportunity-tracker
  • Dashboard: http://127.0.0.1:8000
  • Current dashboard listener: PID 65531 on 127.0.0.1:8000
  • Mailpit inbox: http://127.0.0.1:8025
  • Mailpit SMTP: localhost:1025
  • Database URL: postgresql+psycopg://fti:fti@localhost:55432/fti_opportunities

Docker's Compose plugin is unavailable on this machine, but the required containers are running manually:

  • fti-opportunity-postgres: host 55432 mapped to container 5432
  • fti-opportunity-mailpit: host 1025 mapped to SMTP and 8025 mapped to web UI

Data State

  • Alembic version: 20260506_0001
  • Sources: 80 total, 24 active, 12 degraded, 44 manual review (manual-review sources are login-walled supplier portals or feeds consolidated under another active source — see seed_sources.py terms_notes)
  • Opportunities: 4,701 total, 198 digital_fit
  • Country split: KSA 2,791 · Qatar 1,013 · Bahrain 430 · UAE 212 · Oman 159 · Kuwait 26
  • Active sources producing data: 20 of 24 (the remaining 4 are KSA_SOUDAH/SPORTS_BOULEVARD/GCC peers retained for visibility)
  • Date coverage: 13 sources at 0% missing closing_date; remaining intentionally-missing categories documented in README

Per-source bespoke wiring

Source ID Tech Notes
KSA_ETIMAD JSON Activity-filtered, paginated, incremental
KSA_INVEST_SAUDI WP REST Investment opportunities (no closing dates by design)
KSA_FURAS ArcGIS Municipal investment proxy
UAE_MOF_DPP Playwright reCAPTCHA Enterprise bypass + 7-page grid pagination
UAE_ESUPPLY2DUBAI HTML Jaggaer multi-tenant covering 10+ Dubai entities
UAE_DIGITAL_DUBAI HTML
UAE_ADGPG Playwright Pre-existing
QAT_QATARENERGY JSON ASMX SOAP-style
QAT_QATARENERGY_LNG Playwright GEP SMART XHR intercept
QAT_QBUSINESSGATE_TENDERS WP REST Dates extracted from rendered HTML body
QAT_ASHGHAL HTML erptenders.aspx
BHR_TENDER_BOARD JSON+HTML covers Bapco/EWA/Mumtalakat too
OMN_ISNAD / OMN_TENDER_BOARD_DASHBOARD HTML new-tenders + in-process
OMN_OIA Playwright OutSystems XHR intercept
OMN_ASYAD HTML
OMN_OMRAN HTML List page + per-tender detail page
KWT_CAPT HTML Pre-existing
KWT_KOC HTML Homepage widgets + /Tenders/Published
KWT_KPC Playwright K-Tendering Jaggaer
KWT_KIPIC WP REST Four custom-post-types
KWT_KUFPEC HTML 3 sub-pages

Verified dashboard routes:

  • /
  • /sources
  • /sources/QAT_QBUSINESSGATE_TENDERS
  • /opportunities/qat_qbusinessgate_tenders_111731140_0e8b738b9dd2d7c8
  • /runs
  • /changes

The manual review form on the sampled opportunity returned 303 and redirected back to the opportunity detail page.

The dashboard freshness fields are visible on:

  • /: top freshness strip with latest successful crawl, latest opportunity check, and latest source content change
  • /: opportunities table Last checked column
  • /sources: source table Latest success and Latest change columns
  • /runs: chronological run history

Alerts

The Mailpit path was tested with a temporary environment override:

env ALERTS_ENABLED=true ALERT_RECIPIENTS=fti-digital@example.local SMTP_HOST=localhost SMTP_PORT=1025 SMTP_USE_TLS=false uv run fti-tracker digest --send-alerts

Result:

  • Alert record: daily_digest, status sent
  • Recipient: fti-digital@example.local
  • Subject: FTI GCC digital-fit opportunity digest
  • Latest sent at: 2026-05-06 15:20:07 UTC
  • Mailpit message count after test: 2

The local .env is configured for Mailpit delivery with:

  • ALERTS_ENABLED=true
  • ALERT_RECIPIENTS=fti-digital@example.local

.env.example remains conservative with alerts disabled by default.

Crawl Cadence

No scheduled jobs are installed. Crawls run on demand via the CLI (uv run fti-tracker crawl ...). The previous LaunchAgent (com.fti.opportunity-tracker) was unloaded and the plist removed on 2026-05-06; scripts/install_launchd.py remains available if a schedule is wanted later.

Verification Commands

uv run pytest
uv run alembic current
docker exec fti-opportunity-postgres psql -U fti -d fti_opportunities -c "select status, count(*) from crawl_runs where started_at >= now() - interval '24 hours' group by status order by status;"
launchctl print gui/501/com.fti.opportunity-tracker

Latest verification result: 10 passed in 0.22s.