Back to Portal

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

AreaIn ScopeOut of Scope
Portal docs pageReference and operational guidanceDeploying new infra directly from this repo
Data architecturePostgreSQL-first workflow guidanceCreating new SQLite operational stores
Agent workflowsAgent Chat / MCP endpoint usageReplacing built-in sub-agent orchestration inside Codex

3. Current Infra Snapshot

3.1 Core host/network facts

ItemCurrent Value
Primary hosting node10.0.1.6 (Ubuntu 24.04 LTS)
IngressTraefik (HTTPS, TLS termination)
Public domainsanchezfamily.ca
Local domain.home
Service catalog count29 active cataloged services

3.2 Database system of record

DatabaseEnginePurposeReference Volume
evidencePostgreSQL 16Evidence index and document registry549,853 files
jurisprudencePostgreSQL 16Case law + statutes37,843 cases + 2,083 statutes
rag_kbPostgreSQL 16Local knowledge base4,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

ServicePrimary URLRole
Agent Chat docshttps://chat.sanchezfamily.ca/documentationREST/WS contract for agent chat bus
Agent Chat UIhttps://chat.sanchezfamily.ca (public) / https://chat.home (LAN DNS)Cross-agent channel UI
MCP gatewayhttps://mcp.sanchezfamily.ca (public) / https://mcp.home (LAN DNS)MCP proxy/gateway endpoint
Traefik dashboardhttps://traefik.sanchezfamily.caRouting/entrypoint observability
This pagehttp://localhost:8081/tools/documentation.htmlLocal 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)

CheckStatusNotes
http://localhost:8081/tools/documentation.htmlPASSServes version 3.0.0 with sidebar.
https://chat.sanchezfamily.ca/documentationDNS-DEPENDENTService confirmed via --resolve chat.sanchezfamily.ca:443:10.0.1.6 (HTTP 405 on HEAD; GET works).
https://mcp.sanchezfamily.ca/healthDNS-DEPENDENTService confirmed via --resolve mcp.sanchezfamily.ca:443:10.0.1.6 (HTTP 200).
https://mcp.home/healthHOST-DEPENDENTRequires 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

LayerMain MechanismWhen to Use
Codex in-sessionspawn_agent -> send_input -> wait -> close_agentSub-agent collaboration within this coding session
Infrastructure chat busAgent Chat REST/WSCross-machine messaging, watchers, @agent invocation
Tool gatewayMCP proxyCentralized backend/service tool access

7. Compliance Gates (Mandatory)

GatePass ConditionFailure Action
Forum separationNo cross-contamination of HRTO/Civil/FSRA/CD languageBlock output, escalate legal review
File RefValid RS-221578-{series}-{TYPE}-{YYYY-MM-DD}Reject outgoing document
Workflow orderFile Ref -> Header -> Draft -> Validate -> Registry -> PDF protectHard fail and restart from broken stage
Data policyPostgreSQL operational writes onlyAbort run; no fallback writes
Evidence segregationNo AI writes to 02_EvidenceQuarantine 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

ItemValue
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 commandscurl http://localhost:8081/tools/documentation.html, infra endpoint checks listed above
Last validated2026-03-01

10. Change Log

VersionDateChange
3.0.02026-03-01Major 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.02026-02-14Prior local-stack version (retained as backup).