File size: 3,074 Bytes
6a1e791
1f4f925
 
6a1e791
1f4f925
6a1e791
 
1f4f925
6a1e791
 
1f4f925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: LegalSync — AI-Platform v4
emoji: ⚖️
colorFrom: indigo
colorTo: green
sdk: docker
pinned: false
app_port: 7860
---

# LegalSync · AI-Platform v4 — Workload

**DataRobot + Groq + Chrome Secondary Brain.** A governed, any-HTTP-container
Workload (DataRobot Workload API) exposing the LegalSync reference app.

Live UI: landing page (`/`), interactive API docs (`/docs`), health (`/health`).

## What runs here

- **FastAPI workload** (`workload_app.py`) on port **7860**:
  - `GET /health` — readiness + canary smoke test
  - `POST /api/payments` — OmniPay (stripe / paypal / ach)
  - `POST /api/transcription` — whisper pipeline (DPPA redaction)
  - `POST /api/bond/recommend` — human-in-the-loop
  - `POST /api/discovery/assemble` — Art 39.14 packets
  - `POST /api/llm/chat` — DataRobot LLM Gateway / Groq routing (00-core)
  - `GET /api/mcp/tools` — agentic MCP tool listing (40-agentic-ai)

## Repo layout (v4, deduped)

```
.
├── workload_app.py            # FastAPI entry (Workload API compliant)
├── config/                    # 8 JSONs — SINGLE SOURCE OF TRUTH
├── services/                  # 9 processors + orchestrator agent
├── schemas/                   # 4 JSON schemas
├── api/                       # 3 OpenAPI YAMLs
├── docs/                      # legal (10), compliance (4), runbooks (7), training, marketing
├── scripts/                   # secondary-brain agents + cross-examine gate
├── ai-platform/900-registry/  # 10 YAMLs (providers, models, tools, rollouts, …)
├── datarobot-workload.yaml    # dr CLI rollout (canary_then_progressive)
├── lighthouserc.json          # Lighthouse CI budgets (secondary brain)
└── .github/workflows/         # ci-secondary-brain.yml
```

## Deploy

**Hugging Face (this Space):** Docker SDK — builds `Dockerfile`, serves on 7860.

**Local:**
```bash
pip install -r requirements.txt
uvicorn workload_app:app --host 0.0.0.0 --port 8000
# or
docker compose up --build   # legalsync + lighthouse + prometheus + grafana
```

**DataRobot (Workload API — any HTTP container):**
```bash
export DATAROBOT_API_KEY=... GROQ_API_KEY=...
dr workload create --name legalsync --image legalsync:latest --port 8000
dr workload deploy --config datarobot-workload.yaml
```

> Requirement per docs.datarobot.com: the Workload API works with any container
> that listens on HTTP — deploy agent services, model inference, RAG pipelines,
> MCP servers and custom apps as governed Workloads.

## Quality gate (Secondary Brain)

Primary (build/test) **and** Secondary Brain must pass before production:

- Lighthouse CI — perf ≥ 0.9 · a11y 1.0 · LCP < 2500 · CLS < 0.1 (3 runs)
- Chrome DevTools MCP — console / network / CWV cross-examination
- Gate policy — `both_primary_and_secondary_must_pass` (`rollout_secondary_brain.yaml`)

## Single source of truth

`config/*.json` is authoritative; `docs/legal/*` and schemas *reference* config,
never redefine it (v4 dedupe rule). See `MERGED_TOOLBOX_v4.md` for the platform.