SCAN PERFORMANCE
AI Bot Pipeline Plan
"Confidence is built, not given."
ObserveTagScoreNarrateRe-plan

AI Bot Pipeline Plan

Coach observations become an auditable SPI score, a SCAN archetype, and a development-first IDP narrative — then feed back into lesson planning. AI observes and narrates · deterministic code scores and rolls up · every score explainable and auditable.

1 What The Pipeline Does

The pipeline turns coach observations — typed notes or sampled video frames — into an auditable SPI score, a SCAN archetype, and a development-first IDP narrative, then feeds the result back into lesson planning. Every system prompt states the source precedence (U.S. Soccer first, then the SCAN Scouting Guide, then SCAN material) and holds a development-first stance.

BotAudienceJob
Scout BotCoachConverts observations into SPI pillar signals, SCAN traits, archetype, and IDP narrative (Individual & Team).
Coach Bot / Practice DesignerCoachGenerates timed sessions mapped to SPI pillars and the Four Moments — the lesson plans and guided questions.
Mentor BotPlayerMulti-turn GROW / LEAD chat coach for confidence and resilience.
Technique CheckBothChecks one technique against the Technical Skills Manual (Preparation → Contact → Follow-Through).
AI Personal TrainerPlayerGenerates weekly individual programs from SPI inputs; credits work to the Leaderboard.

2 The Core Scoring Loop

This is the make-or-break loop. It enforces the separation of concerns: the AI never touches the math.

Coach + ffmpeg
INPUT
Notes and/or a short clip. Video sampled into sparse keyframes (probe → segmentation → frame sampling).
AI
OBSERVE / TAG
Returns ONLY structured JSON: pillar signals, trait signals, growth trend, evidence phrases, moment tags. No math.
Code
SCORE
computeSPI() → points across 5 pillars (132 max), Growth Multiplier (0.95–1.10), archetype from traits. Deterministic.
AI
NARRATE
With scores fixed, writes a warm, development-first IDP narrative that references — never changes — the numbers.
Code
OUTPUT
Scorecard + archetype + IDP narrative, stored against the player (idp_players, keyed by player_email). Auditable.
// AI returns ONLY this shape — no prose, no math, no invented stats.
{
  "player_ref":   { "jersey":7, "color":"navy", "identifiable":true, "confidence":0.0-1.0 },
  "pillar_signals": { "MOVE":0-1, "MASTER":0-1, "THINK":0-1, "LEAD":0-1, "GROW":0-1 },
  "scan_traits":  { "self_belief":0-5, "courage":0-5, "awareness":0-5, "never_quit":0-5 },
  "growth_trend": -1 | 0 | +1,
  "evidence":     [ "short observable phrase", ... ],
  "moment_tags":  [ "AttackOrg" | "Att>Def" | "DefOrg" | "Def>Att", ... ],
  "footage_sufficient": true | false
}
Code owns everything below this line. The model is never asked for a point total, a percentage, or an archetype name — only for what it can observe.

3 Why This Architecture

🔍

Explainable

Each pillar score links to an evidence phrase and a deterministic conversion — a coach can always see why a number is what it is.

🎥

Vision-cautious

On video, the bot judges per-frame whether the target player (jersey + colour) is identifiable, keeps confidence low when frames are few, and says when footage was insufficient. It never guesses attribution.

📐

Framework-aligned

Every system prompt states the precedence — U.S. Soccer first, then SCAN Scouting Guide, then SCAN material — and the development-first stance.

⚙️

Production-mirroring

The browser demo samples video client-side and stubs R2 storage + Batch vision calls, behaving like the production Diagnostics pipeline (Cloudflare R2, Batch API for ~50% cost reduction stacking with prompt caching).

AI tags and classifies. Code does the arithmetic and the roll-up.
Nothing else negotiates this boundary.

4 SCAN AI Coach Diagnostics — Build Sequence

The team-level diagnostic platform: coaches upload footage, the AI analyzes across the Four Game Moments, and the system returns a prioritized, editable coaching action plan. Architecture is resolved — vision-only in v1, Cloudflare R2 for object storage, Batch API for async processing. Layered build pattern: standalone HTML demo → schema → API.

1–2
Probe + segmentation + frame sampling (ffmpeg); storage + worker scaffold
config / sampler / storage / worker. The ingestion foundation of the vision pipeline.
Complete & tested
3
Single-segment vision call with a strict JSON schema
The make-or-break validation of the vision scoring loop — proves the AI returns clean, contract-honoring tags from real frames.
Next target
4
Multi-segment aggregation + multi-angle overlap handling
Independent scoring per segment / angle, then aggregate. Overlap reconciliation across camera angles.
On the horizon
5
Auth hardening
Wire JWKS RSA JWT verifier into coach_sub() in suite-api.php; full Outseta JWT for player-facing tools; CORS locked to SCAN origins.
Open (security)
6
Human review of Mentor Bot distress-redirection language
Required before go-live — the safety-critical review of how Mentor Bot redirects players in distress to trusted adults.
Required pre-launch

Immediate open items

  • Step 3 — single-segment vision call with strict JSON schema (validates the whole vision loop).
  • Wire the JWKS RSA JWT verifier into the coach_sub() stub in suite-api.php.
  • Human review of Mentor Bot's distress-redirection language before go-live.

Deferred to v2

Audio transcriptionv1 is vision-only.
Rubric expansionExtend the U13–U14 rubric to additional age groups (table is already age-group-keyed).
Outseta JWTFull wiring for player-facing tools (currently stubbed).
Lead captureFor the parent-facing SCAN Scout AI chatbot.

5 How The Pipeline Feeds Lesson Planning

The loop closes here: Scout Bot output becomes Coach Bot input.

SignalDrives
Lowest pillarBecomes the next block's focus. If a player or group reads low on MASTER, the Practice Designer weights the next sessions toward technique-under-pressure for that age group.
ArchetypeDrives differentiation. Archetypes flag who needs a confidence-building emphasis vs. a tactical-stretch challenge inside the same session.
Growth trendShapes language. A positive trend tells the coach which brave attempts to keep rewarding in the reflection block.
Guided-question answersBecome scouting evidence. A high-order answer acted out in the game becomes a THINK / LEAD signal; a brave response after a mistake becomes a GROW signal.
The scoreboard never drives this — the development signal does. Players quit when adults prioritize scores over development.
Develop people first. Athletes second.
"Confidence is built, not given." · AI observes and narrates · code scores and rolls up