System Documentation (Aligned to Current Infrastructure)
This page replaces the outdated local-only/SQLite-first description and documents the current production-like Sanchez infrastructure as of March 1, 2026.
Primary platform
Traefik + Docker
Service catalog
29 services
Primary databases
PostgreSQL (3 DBs)
Agent layer
Agent Chat + MCP
Important: this repo is case material only. New operational services/scripts belong in
/mnt/c/rod_hub/services/ or /mnt/c/rod_hub/scripts/, not under _centralized_data.
2. Scope and Boundaries
| Area | In Scope | Out of Scope |
|---|---|---|
| Portal docs page | Reference and operational guidance | Deploying new infra directly from this repo |
| Data architecture | PostgreSQL-first workflow guidance | Creating new SQLite operational stores |
| Agent workflows | Agent Chat / MCP endpoint usage | Replacing built-in sub-agent orchestration inside Codex |
3. Current Infra Snapshot
3.1 Core host/network facts
| Item | Current Value |
|---|---|
| Primary hosting node | 10.0.1.6 (Ubuntu 24.04 LTS) |
| Ingress | Traefik (HTTPS, TLS termination) |
| Public domain | sanchezfamily.ca |
| Local domain | .home |
| Service catalog count | 29 active cataloged services |
3.2 Database system of record
| Database | Engine | Purpose | Reference Volume |
|---|---|---|---|
evidence | PostgreSQL 16 | Evidence index and document registry | 549,853 files |
jurisprudence | PostgreSQL 16 | Case law + statutes | 37,843 cases + 2,083 statutes |
rag_kb | PostgreSQL 16 | Local knowledge base | 4,113 documents |
Policy
Operational writes must go to PostgreSQL. SQLite is fallback/read-only only and must not be used as a new primary store.
4. Routing and Endpoints
| Service | Primary URL | Role |
|---|---|---|
| Agent Chat docs | https://chat.sanchezfamily.ca/documentation | REST/WS contract for agent chat bus |
| Agent Chat UI | https://chat.sanchezfamily.ca (public) / https://chat.home (LAN DNS) | Cross-agent channel UI |
| MCP gateway | https://mcp.sanchezfamily.ca (public) / https://mcp.home (LAN DNS) | MCP proxy/gateway endpoint |
| Traefik dashboard | https://traefik.sanchezfamily.ca | Routing/entrypoint observability |
| This page | http://localhost:8081/tools/documentation.html | Local portal documentation mirror |
4.1 Quick health checks
# Public host checks (validated from this host)
curl -sk https://mcp.sanchezfamily.ca/health
curl -sk https://chat.sanchezfamily.ca/documentation | head -n 20
# LAN checks (require working Pi-hole/local DNS for .home)
curl -sk https://mcp.home/health
curl -sk https://mcp.home/mcp/servers -H "X-API-Key: $MCP_API_KEY"
curl -sk https://chat.home/documentation | head -n 20
4.2 Runtime verification status (2026-03-01)
| Check | Status | Notes |
|---|---|---|
http://localhost:8081/tools/documentation.html | PASS | Serves version 3.0.0 with sidebar. |
https://chat.sanchezfamily.ca/documentation | DNS-DEPENDENT | Service confirmed via --resolve chat.sanchezfamily.ca:443:10.0.1.6 (HTTP 405 on HEAD; GET works). |
https://mcp.sanchezfamily.ca/health | DNS-DEPENDENT | Service confirmed via --resolve mcp.sanchezfamily.ca:443:10.0.1.6 (HTTP 200). |
https://mcp.home/health | HOST-DEPENDENT | Requires LAN DNS resolution for .home; not resolvable from current shell context. |
5. Data Layer Standard
5.1 Allowed patterns
- Use existing PostgreSQL databases and FTS search vectors.
- Keep original evidence in
Rod_Case_Master/02_Evidence/. - Store AI analysis only in
Rod_Case_Master/01_Documentation/Analysis/. - Register outgoing documents in the configured PostgreSQL registry table when provisioned.
5.2 Prohibited patterns
- Never create new SQLite DBs for operational writes.
- Never place service runtime code under
_centralized_data. - Never write AI-generated content into original evidence folders.
6. Agent Coordination
| Layer | Main Mechanism | When to Use |
|---|---|---|
| Codex in-session | spawn_agent -> send_input -> wait -> close_agent | Sub-agent collaboration within this coding session |
| Infrastructure chat bus | Agent Chat REST/WS | Cross-machine messaging, watchers, @agent invocation |
| Tool gateway | MCP proxy | Centralized backend/service tool access |
7. Compliance Gates (Mandatory)
| Gate | Pass Condition | Failure Action |
|---|---|---|
| Forum separation | No cross-contamination of HRTO/Civil/FSRA/CD language | Block output, escalate legal review |
| File Ref | Valid RS-221578-{series}-{TYPE}-{YYYY-MM-DD} | Reject outgoing document |
| Workflow order | File Ref -> Header -> Draft -> Validate -> Registry -> PDF protect | Hard fail and restart from broken stage |
| Data policy | PostgreSQL operational writes only | Abort run; no fallback writes |
| Evidence segregation | No AI writes to 02_Evidence | Quarantine and block release |
8. Operations Commands
# Init checks
pwd
docker exec postgres-fast psql -U rod -d evidence -c "SELECT 1"
docker exec postgres-fast psql -U rod -d jurisprudence -c "SELECT 1"
docker exec postgres-fast psql -U rod -d rag_kb -c "SELECT 1"
python3 /mnt/c/rod_hub/scripts/evidence/rpa_search.py --stats
# File Ref + header (mandatory for outgoing docs)
python3 file_reference.py fileref manulife
python3 file_reference.py header manulife
# Registry existence check + query (schema-dependent)
docker exec postgres-fast psql -U rod -d evidence -c "SELECT table_schema, table_name FROM information_schema.tables WHERE table_name='document_registry';"
docker exec postgres-fast psql -U rod -d evidence -c "SELECT rs_code, series, doc_type, doc_date, status FROM document_registry ORDER BY series, seq_number" # Run only if table exists
9. Traceability
| Item | Value |
|---|---|
| Source file | /mnt/c/rod_hub/personal/case-files/rod_case_master/docker/nginx/html/tools/documentation.html |
| Template reference | /mnt/c/rod_hub/RodHub_Standard_and_Template_Unified_v1_1_CONTRAST.html |
| Validation commands | curl http://localhost:8081/tools/documentation.html, infra endpoint checks listed above |
| Last validated | 2026-03-01 |
10. Change Log
| Version | Date | Change |
|---|---|---|
| 3.0.0 | 2026-03-01 | Major rewrite to align with current infrastructure and RodHub template format; replaced SQLite-first local stack framing with PostgreSQL-first + Traefik/MCP/Agent Chat architecture. |
| 2.0.0 | 2026-02-14 | Prior local-stack version (retained as backup). |