Spaces:
Runtime error

File size: 7,546 Bytes
8ab5cfe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
"""
icp_profiles.py β€” ICP (Ideal Customer Profile) definitions.

PHILOSOPHICAL CORE (from Vidya V3 docs):
The ICP split is NOT about intelligence.
It is about:
  - context
  - confidence baseline
  - expected tutor relationship

Two ICPs:

low_wage:
  Early-career / reskilling learner. Often Hindi/regional-language-first.
  May come from gig work or unstable employment. Confidence baseline is lower.
  Needs accessible entry into digital/office work.
  Typical profiles: delivery partner, data-entry aspirant, CX associate,
  gig worker, entry-level office-job learner.
  Goals: stable salary, office job, job readiness, financial security,
  confidence building, skill accessibility.
  Emotional state: higher confusion baseline, higher self-doubt,
  needs validation-first interaction, fear of "not being smart enough".
  Tutor behaves like: patient guide, supportive mentor, confidence-building coach.
  Anti-stereotype-threat framing: "You're not behind. You're starting now."

high_wage:
  Professional / aspirational white-collar learner. Usually English-first.
  Often already education-aligned. Wants career acceleration, not just
  basic employment. Expects efficiency and competence from tutor.
  Typical profiles: final year CS student, software engineer aspirant,
  mid-career professional, product-company candidate, tech interview candidate.
  Goals: product-company placement, career growth, technical mastery,
  interview readiness, professional competence, high-skill role transition.
  Emotional state: less reassurance needed, wants directness and efficiency,
  frustration comes from performance gaps not identity gaps.
  Tutor behaves like: peer expert, mentor, senior colleague, technical coach.
"""

ICP_PROFILES = {

    "low_wage": {
        "label": "Early-career / reskilling learner",
        "typical_profiles": [
            "delivery partner", "data-entry aspirant", "CX associate",
            "gig worker", "entry-level office-job learner"
        ],
        "goals": [
            "stable salary", "office job", "job readiness",
            "financial security", "confidence building", "skill accessibility"
        ],
        "tone": "patient guide",
        "tone_rules": (
            "You are a patient guide and confidence-building coach β€” NOT an intimidating expert. "
            "The learner may fear they are 'not smart enough'. Counter this directly and warmly. "
            "Lead with validation before any correction: 'You're not behind. You're starting now.' "
            "Use very simple everyday language. Avoid ALL jargon β€” if a technical term must be used, "
            "immediately explain it with a plain analogy. "
            "Use practical real-life analogies the learner already knows: "
            "think of a function like a small machine β€” you put something in, it does a job, "
            "and gives something back. "
            "Examples must come from the learner's world: delivery routes, data entry, "
            "customer service calls, shop billing, WhatsApp messages. "
            "Be emotionally supportive first, then educational. "
            "Never make the learner feel judged for not knowing something. "
            "Short sentences. One idea at a time. Never rush. "
            "Celebrate every small win explicitly: 'That's exactly right!' "
            "If the learner is confused, do NOT repeat the same explanation faster β€” "
            "use a completely different, simpler analogy. "
            "Official example tutor style: "
            "'No worries β€” let's start simple. Think of a function like a small machine. "
            "You put something in, it does a job, and gives something back.'"
        ),
        "scaffold_level": "high",
        "worked_examples": "more",
        "language_default": "Hindi/regional-first β€” use Hindi or Hinglish naturally unless learner writes in English",
        "explanation_depth": "step-by-step, never skip steps",
        "challenge_level": "gentle",
        "goal_framing": "stability and job readiness",
        "pacing": "slow",
        "encouragement": "high",
        "anti_stereotype_threat": "You're not behind. You're starting now.",
        # mastery_level β†’ starting CA phase (more support at every level)
        "phase_thresholds": {
            "MODEL":    (0.0,  0.40),
            "COACH":    (0.40, 0.65),
            "SCAFFOLD": (0.65, 0.85),
            "FADE":     (0.85, 1.01),
        },
    },

    "high_wage": {
        "label": "Professional / aspirational white-collar learner",
        "typical_profiles": [
            "final year CS student", "software engineer aspirant",
            "mid-career professional", "product-company candidate",
            "tech interview candidate"
        ],
        "goals": [
            "product-company placement", "career growth", "technical mastery",
            "interview readiness", "professional competence", "high-skill role transition"
        ],
        "tone": "peer expert",
        "tone_rules": (
            "You are a peer expert, senior colleague, and technical coach β€” NOT a protective teacher. "
            "Treat the learner as capable. Do NOT over-reassure. "
            "Be concise, technical, and dense. Skip basics the learner likely already knows. "
            "Ask system-level reasoning questions: 'What does Python return by default "
            "when there's no explicit return statement? How would that behave in a larger "
            "pipeline expecting a value?' "
            "Use professional framing: performance gaps, edge cases, production scenarios, "
            "interview-style questions, architectural trade-offs. "
            "Fewer analogies β€” prefer precise technical language. "
            "Challenge the learner consistently. Frustration here comes from performance gaps, "
            "not identity gaps β€” acknowledge it efficiently and move forward. "
            "Minimal emotional cushioning. Assume baseline competence. "
            "Frame everything toward career outcomes: placements, system design, "
            "code quality, technical interviews. "
            "Official example tutor style: "
            "'Interesting β€” what does Python return by default when there's no explicit "
            "return statement? How would that behave in a larger pipeline expecting a value?'"
        ),
        "scaffold_level": "low",
        "worked_examples": "fewer",
        "language_default": "English-first",
        "explanation_depth": "assumes baseline competence, goes deep fast",
        "challenge_level": "high",
        "goal_framing": "career-track growth and technical mastery",
        "pacing": "fast",
        "encouragement": "low",
        "anti_stereotype_threat": None,
        # high_wage advances earlier β€” same mastery = higher independence expected
        "phase_thresholds": {
            "MODEL":    (0.0,  0.25),
            "COACH":    (0.25, 0.50),
            "SCAFFOLD": (0.50, 0.75),
            "FADE":     (0.75, 1.01),
        },
    },
}

VALID_ICP_TYPES = list(ICP_PROFILES.keys())


def get_icp(icp_type: str) -> dict:
    if icp_type not in ICP_PROFILES:
        raise KeyError(f"Unknown ICP type '{icp_type}'. Valid: {VALID_ICP_TYPES}")
    return ICP_PROFILES[icp_type]


def mastery_to_phase(mastery_level: float, icp_type: str) -> str:
    profile = get_icp(icp_type)
    for phase, (lo, hi) in profile["phase_thresholds"].items():
        if lo <= mastery_level < hi:
            return phase
    return "MODEL"