Riwaq Control Center

What Riwaq AI OS actually knows right now, read directly from apps/api. Generated 2026-08-05T13:22:31.315195+00:00.

System status

Raw content of CURRENT_STATE.md, from GET /v1/bootstrap.

# Current State

This is the continuously-updated "where are we right now" snapshot — updated after every completed
milestone, per `ENGINEERING_STANDARDS.md`'s milestone discipline. It is distinct from
`PROJECT_STATE.md` (infra-only facts: servers, containers, backups — changes rarely) and from
`REPOSITORY_AUDIT.md` (a periodic, point-in-time deep audit, refreshed at sprint boundaries). See
`DOCUMENT_HIERARCHY.md` for how these three don't overlap.

**This file states only what's true right now — it does not narrate how we got here.** That history
lives in `CHANGELOG.md` (dated entries), `DECISIONS.md` (the reasoning behind each), and `git log`
(the definitive record). Trimmed 2026-08-04 after growing to 206 lines and duplicating `CHANGELOG.md`
— see that file's 2026-08-04 entry for why, and `apps/api/app/services/bootstrap_service.py`, which
serves this file's full content via `GET /v1/bootstrap` on every call: a shorter file means a cheaper
bootstrap for every future session, permanently.

Last updated: 2026-08-05, after Sprint 3 close.

---

## Snapshot

- **Sprints:** Sprint 0 (Engineering Foundation), Sprint 1 (The Company Brain), Sprint 2 (Prove the
  Intelligence Pipeline, End-to-End), and Sprint 3 (Make the Company Brain Visible) all complete.
  Sprint 3 shipped the project's first human-facing capability: **the Control Center is live at
  `https://console.riwaqmart.com`**, rendering real, current system status, knowledge-base
  completeness, and the Sprint 2 intelligence report — the first time anything this project has built
  is visible in a browser rather than only via `curl` or markdown. No Sprint 4 scoped yet.
- **Production infrastructure:** Healthy. Six services now (`postgres`, `n8n`, `caddy`, `dozzle`,
  `api`, `frontend`) — `api` and `frontend` added this sprint, both internal-only on the `riwaq` Docker
  network (no published host ports). All up since the Track A recovery completed 2026-08-04. No data
  loss occurred at any point.
- **Knowledge base:** All 15 `knowledge/*.md` files are schema-compliant (frontmatter validated). 8 are
  `status: verified` (founder-authored governance content); 7 are honestly `status: pending` (real
  business facts not yet collected — blocked on founder time, not fabricated) — and now visible as such
  in the Control Center, not just in the repository.
- **Intelligence pipeline (`intelligence/`):** 1 real report (`market` category), confidence 75,
  sourced and retrieval-verified, on top of 4 pre-existing methodology documents.
- **Knowledge API (`apps/api`):** Implements `knowledge`, `memory`, `intelligence`, and `bootstrap`
  endpoints. **Now deployed persistently** (Sprint 3 M1) — but deliberately **internal-only**: reachable
  from `apps/builder/frontend` over the `riwaq` Docker network, not reachable from the host or the
  public internet, and never added to the Caddyfile. `PARKING_LOT.md`'s "deploy `apps/api`
  persistently" entry is now resolved and should be removed from that file as a follow-up — not done as
  part of this close-out, see `NEXT_TASK.md`.
- **Control Center (`apps/builder/frontend`):** No longer boilerplate. Containerized, deployed
  internal-only alongside `apps/api`, and reachable by the founder over HTTPS at
  `console.riwaqmart.com` (Caddy, Let's Encrypt cert, same pattern as `automation.riwaqmart.com`). Calls
  `apps/api` directly, server-side — no backend proxy, no new `apps/api` endpoints, no authentication
  (all explicitly deferred, per `SPRINT_3_PLAN.md`'s Non-Goals).
- **Engineering governance:** `FOUNDER_PRINCIPLES.md` and `ENGINEERING_PHILOSOPHY.md` both adopted as
  permanent, cross-sprint documents. Repository simplification is in progress per
  `SIMPLIFICATION_REPORT.md` — Tier 1 complete; Tier 2 items 6 and 11 implemented, the rest parked.

## Open items

See `NEXT_TASK.md` for the single active work item and `PARKING_LOT.md` for deferred ideas with their
promotion triggers — not restated here.

---

## What to read next

`NEXT_TASK.md` for the single active work item. `DOCUMENT_HIERARCHY.md` if you're unsure where
something belongs.

Knowledge base completeness

8 of 15 knowledge domains verified. 7 still pending — real business facts not yet collected, not fabricated.

Intelligence reports

1 report(s), from GET /v1/intelligence.

gcc-ecommerce-h1-2026-divergence

category: marketstatus: draftconfidence: 75

# GCC E-Commerce Diverges in H1 2026: UAE Grows While the Wider Region Contracts

## What happened?

Regional GMV (gross merchandise value) for GCC e-commerce fell 9% year-on-year in the first half of
2026, but the UAE moved against that trend, growing 2% year-on-year over the same period. UAE order
count actually fell 9%, yet average order value rose from $97 to $111 — fewer purchases, but bigger
ones. Mobile orders grew 20.5% year-on-year and now account for 53% of all UAE transactions. By
category, home goods (+18%), food/delivery (+15%), and sports/entertainment (+11%) led growth.
Discount usage is heavy: over 50% of transactions used a coupon, and the average discounted order
value rose from $89 to $122. The underlying research, by Udora (a UAE-based gifting marketplace) and
Admitad, analyzed more than 2.5 million online orders across the GCC. It was reported independently
by Khaleej Times (2026-07-22) and Bazaar Times (2026-07-25), with consistent figures in both.

## Why does it matter?

`knowledge/company.md`'s stated geographic focus is Saudi Arabia, UAE, Qatar, Kuwait, Bahrain, and
Oman, with e-commerce as the primary revenue line. This is direct, current evidence that GCC consumer
behavior is not uniform: the UAE specifically is absorbing a regional pullback by buying less often
(order count -9%) but spending enough more per order ($97 → $111 AOV) that total GMV still grew +2% —
frequency down, total spend up, not a uniform pullback. A commerce strategy built on regional-average
assumptions would miss this; a strategy tuned to UAE-specific behavior (bigger basket sizes, heavy
discount sensitivity, mobile-first, home/food-led category growth) would not.

## Who is affected?

Directly: any future pricing, marketing, and product-sourcing decisions Riwaq Mart makes for the UAE
specifically, and by extension `knowledge/market.md` and `knowledge/pricing.md` (both currently
`status: pending`) once real business operations begin there. Indirectly: Executive (regional
prioritization) and, per `intelligence/README.md`'s customer list, Marketing and Ecommerce
specifically.

## Should Riwaq act, and how urgent?

No immediate action — Riwaq Mart has no live UAE operations yet to adjust (`knowledge/market.md` and
`knowledge/customers.md` are both still `status: pending`, unpopulated pending the founder's
knowledge-intake interviews). This is monitor-and-inform, not act-now: worth surfacing specifically
when the market/pricing knowledge-intake interviews happen, as a real, current data point rather than
a generic assumption about GCC e-commerce. Not urgent.

## Confidence justification

Scored 75 (Trusted industry source) per `intelligence/scoring.md`, not higher: the underlying research
comes from one named, methodologically-described source (Udora + Admitad, 2.5M+ orders analyzed), not
an official government statistical release, so it doesn't clear the 90% "official source" bar. It's
scored above the 50% "needs verification" tier because two independent, reputable regional business
outlets (Khaleej Times, Bazaar Times) reported it days apart with fully consistent figures and no
contradicting numbers found in a broader search — that consistency is corroboration of the reporting,
even though both ultimately cite the same primary research rather than two independent studies. Per
the rubric, 75% clears the bar for triggering a recommendation, but the recommendation above is
deliberately "monitor," not "act," given no live UAE operations exist yet to apply it to.