App Icon Coach GPT App

Unified Prefetch Architecture β€” v5.1 Design

The Coach GPT App now runs on a unified prefetch architecture that separates data retrieval, normalization, and semantic report generation across Cloudflare and Railway. This ensures deterministic output, fixed schema contracts, and verifiable data lineage from Intervals.icu.

βš™οΈ Current Operational Pipeline

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        ChatGPT / CLI App     β”‚
β”‚  (Tool invocation layer)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚  HTTPS tool call
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         🌩️ Cloudflare Worker (Edge)          β”‚
β”‚  β€’ Auth + routing proxy                     β”‚
β”‚  β€’ Handles ?start/?end normalization         β”‚
β”‚  β€’ Prefetches Intervals data β†’ JSON context  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        πŸš‰ Railway Backend (FastAPI)           β”‚
β”‚  β€’ Tier-0: Prefetch normalization             β”‚
β”‚     - DataFrame coercion + baseline columns   β”‚
β”‚     - Empty-source detection + AuditHalt      β”‚
β”‚  β€’ Tier-1: Activity & wellness validation     β”‚
β”‚     - moving_time filtering, zero-checks      β”‚
β”‚  β€’ Tier-2: Aggregation + enforcement          β”‚
β”‚     - Totals reconciliation, variance checks  β”‚
β”‚  β€’ Outputs URF v5.1 Semantic JSON             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Intervals.icu API        β”‚
β”‚   (authoritative source)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Cloudflare handles authentication, routing, and optional synthetic testing.
πŸš‰ Railway performs full computation, validation, and serialization.

🧩 Architecture Guarantees

AreaImplementationGuarantee
Prefetch FlowCloudflare normalizes date params and injects optional test payloadsSafe staging tests without real data
Execution ModelPython execution on Railway (FastAPI + Pandas)Deterministic, audited output
Tier-0 ValidationBaseline column checks (`moving_time`, `distance`, etc.)No schema drift or missing fields
Tier-1 AuditFilters invalid / null activities, computes daily summariesEnforced numeric consistency
Tier-2 EnforcementLock totals, enforce logical consistencyNo variance bleed between scopes
SerializationSingle-pass semantic JSON (no float loss)Stable numeric precision
ObservabilityStructured logs at all Tier boundariesTraceable audit chain (light→full→wellness)
Schema VersionURF v5.1 unified contractsCross-version compatibility with GPT tool API

πŸ“¬ Contact

For integration, customization, or coaching inquiries, connect via GitHub link below or DM via Intervals.icu DM and contribute in Intervals.icu Forum.

github.com/revo2wheels

Built with ❀️ for endurance athletes β€” by Clive King.
Powered by Intervals.icu, Cloudflare and the Railway Engine.