import InfoHint from "./InfoHint.jsx"; import MiniLineChart from "./MiniLineChart.jsx"; /** * UserProfileCard — hero panel showing all 12 behavioral facets for one user. * * Layout: * ╭─────────────────────────────────────────────────────────────────╮ * │ COGNITIVE PROFILE · demo_user │ * │ │ * │ ┌─ HERO ─────┐ ┌─ HERO ──────┐ ┌─ HERO ──────┐ │ * │ │ Offer │ │ Decision │ │ Top topic │ │ * │ │ readiness │ │ stage │ │ │ │ * │ │ 0.96 │ │ Action- │ │ general │ │ * │ │ Ready │ │ ready │ │ score 0.87 │ │ * │ └────────────┘ └─────────────┘ └─────────────┘ │ * │ │ * │ Facet grid: Intent · Engagement · Format · Structured · │ * │ Clarity · Friction · Positive · Momentum · │ * │ Learning confidence │ * ╰─────────────────────────────────────────────────────────────────╯ * * Each facet badge: * - small uppercase label * - value (the categorical or numeric punchline) * - tiny score bar or footnote * * All facets are *behavioral*, never psychological. The card explicitly * surfaces things like "prefers structured layouts" or "in evaluation stage", * never "user is anxious" or "user is risk-averse". */ export default function UserProfileCard({ profile, userLabel, dailyActivity = null }) { if (!profile) return null; const readyTier = profile.offer_readiness_score >= 0.7 ? "ready" : profile.offer_readiness_score >= 0.5 ? "likely" : profile.offer_readiness_score >= 0.3 ? "nurture" : "early"; return (
{profile.user_id_hash}
raw = 0.35·interest + 0.30·recency + 0.20·engagement + 0.15·stage,
then readiness = raw × decision_stage_score. The multiplicative gate means
a user in Awareness can't be Ready no matter how engaged.
interest_score from
ape_user_topic_interest. Score blends 40% frequency,
25% recency, 25% engagement, 10% follow-up depth — all derived
from the user's last 30 days of activity.
>}
/>
ape_turn_record.intent counts. A user with mostly Decision is action-oriented; mostly Definitional means they're learning basics.>}
/>
argmax(avg_reward × min(count/5, 1)). The count damping prevents a single high-reward pull from winning.>}
/>
format_change_request, reask_same_question. High ≥ 5 signals — consider simpler defaults for them.>}
/>
thumbs_down, format_change_request, content_correction, plus turns with negative normalized_reward. High friction users are candidates for instruction refinement on their dominant topics.>}
/>
thumbs_up, format_praise_explicit, it_worked_statement, deeper_question, plus turns with positive normalized_reward. High count = the system is working for this user.>}
/>
ape_turn_record, ape_user_bandit_state,
and ape_user_topic_interest.