Memory #131 CURRENT
PrIA-Relate / pria_crm carve-out GCD.SPEC.CRM-001 v0.1 — relationship intelligence system carved out of pria_crm into D:/GitHub/pria-relate/, MVP scaffold landed (FastAPI + async SQLAlchemy + Alembic + Postgres), Milken 2026 corpus seeded (2026-04-26) **Carved out 2026-04-26** from `D:/GitHub/pria_crm/` (now archived as `D:/GitHub/pria_crm.archived/`) into the formal repo `D:/GitHub/pria-relate/`. **Local-only** — `LOCAL_ONLY.txt` at repo root forbids remote push without explicit Mark approval. ## What it is Two artifacts under one repo (option c per 2026-04-26 decision): 1. **`GCD.SPEC.CRM-001 v0.1`** — long-lived relationship intelligence system. PrIA-Relate. Operational counterpart to `pria-genesis` (canonical content) and `tgss-mem` (memory lifecycle). Manages people-orgs-deals-documents-interactions-tags graph for GCD/TTF business development. 2. **`TTI.DB.MILKEN-2026-001`** — speaker intelligence corpus, 20 deep/standard dossiers, lives at `data/milken-2026/` as the seed dataset. Time-bounded (Milken Global Conference 2026). Doc code rebranded GCE.SPEC.CRM-001 → GCD.SPEC.CRM-001 per 2026-04-10 rebrand. Legacy doc code captured in spec frontmatter `supersedes:` field. ## MVP scaffold (Phase 2 done) - `pyproject.toml` — FastAPI 0.136, SQLAlchemy 2.0.49 async, asyncpg, Alembic 1.18, Authlib, Jinja2, bcrypt, pydantic-settings - Package skeleton: `pria_relate/{config,db,main,models,schemas,routers,services,auth,audit,ui}/` - `.venv` set up; smoke tests pass - Alembic configured for sync migrations (psycopg2 driver) + async runtime (asyncpg) - Migration `0001_initial.py` runs the canonical DDL from `alembic/init_postgres_reference.sql` via `conn.exec_driver_sql(sql)` — preserves partial indexes, GIN FTS, polymorphic CHECK constraints, ENUMs without lossy reconstruction - **DB:** new `pria_relate` database in existing `golay-postgres` container (port 5432, ats_user/GolayECC2412) - **Schema state after `alembic upgrade head`:** 17 tables (16 schema + alembic_version), 5 enums, 41 indexes, 3 roles, 6 users (mark+jason admin, joe+rick+dan+lee editor), 43 workstream tags - **App port: 8095** (8090 reserved for pria-signal Docker container — conflict avoided) - `GET /health` confirms DB reachable via async engine ## Schema bug found and fixed Reference SQL had `PRIMARY KEY (user_id, role_id, workstream_scope)` on `user_roles` — Postgres rejects NULL in PK columns, but the seed inserts pass `NULL` for unscoped (global) roles. Fixed by adding surrogate `id UUID PRIMARY KEY` + `UNIQUE NULLS NOT DISTINCT (user_id, role_id, workstream_scope)`. Original `init_postgres_reference.sql` patched at the source so the migration is correct on first run from a clean DB. ## What's NOT done yet (per spec, Phase 2 of MVP) - CRUD API for people/orgs/deals/interactions/documents (single-user mode) - Server-rendered HTMX/Jinja2 list/detail pages - Import script to load Milken 2026 SQLite preview into Postgres - Document sync script (SHA-256 + drift detection per spec §3 query 9) - Auth (Authlib), RBAC enforcement middleware, audit log middleware ## How to apply If next session continues this work, the next slice is the **import script** to load the Milken 2026 SQLite data into Postgres — `scripts/import_milken_2026.py`. The SQLite DB at `data/milken-2026/milken_speakers_2026.db` mirrors the Postgres schema exactly (per the README), so import is mostly a per-table SELECT/INSERT loop. After import, build the people/orgs CRUD routers and HTMX list pages. To start the dev server: `cd D:/GitHub/pria-relate && ./.venv/Scripts/python.exe -m uvicorn pria_relate.main:app --reload --port 8095`. To run migrations: `./.venv/Scripts/python.exe -m alembic upgrade head`. To downgrade: `... alembic downgrade base` (drops everything via the explicit reverse-order DROP block). The 20 dossier markdown files at `data/milken-2026/dossiers/` are the canonical content; the `documents` table will index them by SHA-256. — [project_pria_relate.md]
| Composite | 5D8DD44C81626BF87 |
| Project prime | 13 |
| Domain prime | 1F |
| Type prime | 67 |
| Importance | 0.343295 (ACTIVE) |
| Decay epoch | 0 |
| Created | 2026-05-04 15:46:49 |
| Valid from | (unset) |
| Valid to | NULL — still believed true |
Outgoing Edges
No outgoing edges.