# Sol-37 Service Request Platform

Captured: 2026-08-02

This document records the first implementation pass for the `https://sol.system42.one/services` request-intake platform.

## Scope

- Customer submits a quote/help request from the services page.
- Cloudflare Turnstile verification is required server-side.
- The Worker stores the full request in D1 before acknowledging success.
- The Worker publishes a minimal event to a Queue.
- The Queue consumer signs and POSTs that minimal event to the local bridge at `https://sol.system42.one/api/internal/service-request-notify`.
- The local bridge persists first, then writes `custom_notify.py` history, then attempts desktop popup delivery.
- Documentation email is sent to `davidlones365@mac.com`.
- Local email watch serves as a fallback notification path.
- D1 retention target is 90 days. Local operational stores should follow the same retention policy when cleanup is added.

## Current blockers

- `wrangler whoami` on 2026-08-02 reported no authenticated Cloudflare session, so D1, Queue, Turnstile, and Worker deployment remain account-side pending `wrangler login`.
- Turnstile production site/secret keys are not yet configured.
- Cloudflare Email Routing / SendEmail binding still requires the account-side setup for `system42.one`.

## Local runtime pieces added

- `random/bin/service_request_bridge.py`
- `random/bin/service_request_mailwatch.py`
- `~/.config/systemd/user/service-request-bridge.service`
- `~/.config/systemd/user/service-request-bridge-retry.{service,timer}`
- `~/.config/systemd/user/service-request-mailwatch.service`

## Secrets and environment files

- `~/.config/service-request-bridge.env` should contain the HMAC secret and bridge port.
- `~/.config/solmail.env` should contain the mail credentials used by `solmail.py` for unattended mail fallback monitoring.

## Queue contract

Minimal queue payload:

```json
{
  "requestId": "SR-20260802-ABCDEF1234",
  "firstName": "David",
  "serviceCategory": "Home technology",
  "serviceLocation": "Weatherford",
  "createdAt": "2026-08-02T01:23:45.000Z"
}
```

Signed bridge request headers:

- `X-Sol37-Signature: v1=<hex hmac sha256>`
- `X-Sol37-Timestamp: <ISO-8601 UTC>`
- `X-Sol37-Nonce: <uuid>`

HMAC message format:

```text
<timestamp>\n<nonce>\n<raw-json-body>
```
