Skip to content

Commit 53ebfaa

Browse files
Merge pull request #7 from madijonovsardorbek544-cmyk/add-internal-evaluation-dashboard
Add owner-only evaluation dashboard, expand benchmark to 100 examples, and strengthen institution readiness docs
2 parents 565583b + 28d1ca6 commit 53ebfaa

13 files changed

Lines changed: 555 additions & 15 deletions

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
https://madijonovsardorbek544-cmyk.github.io/cross-border-scam-analyzer/
66

7-
This is a public MVP hosted on GitHub Pages. It is being built toward a validated, institution-ready scam safety platform for international students, families, counselors, education centers, and institutions. It detects **risk indicators** and provides safer verification steps; it does not claim certainty or replace legal, immigration, financial, emergency, or law-enforcement help.
7+
This is a public MVP hosted on GitHub Pages. It is being built toward a validated, institution-ready scam safety platform for international students, families, counselors, education centers, and institutions. It detects **risk indicators** and provides safer verification steps; it does not claim certainty or replace legal, immigration, financial, emergency, or law-enforcement help. **This is being validated; it is not certified fraud detection.**
88

99
## Positioning
1010

@@ -18,24 +18,25 @@ International students and families make high-stakes decisions across unfamiliar
1818

1919
- Local-first scam checker with score, level, top reasons, safe next steps, and copyable verification scripts.
2020
- Counselor / Analyst View showing all matched rules, evidence, rule weights, combination boosts, risk areas, false-positive warning, and score-level explanation.
21-
- Evaluation benchmark with 60 labeled examples covering high-risk phishing, international-student scams, legitimate messages, borderline messages, and adversarial wording.
21+
- Evaluation benchmark with 100 labeled examples covering high-risk phishing, international-student scams, legitimate messages, borderline messages, and adversarial wording.
2222
- Official resource packs for U.S., Canada, UK, Australia, testing providers, housing deposits, scholarship fees, and education-agent verification.
2323
- Case library connected to relevant resource packs.
2424
- Redacted report flow with consent and no raw message storage by default.
2525
- Anonymous feedback loop that stores structured calibration signals locally by default and never stores the raw message.
26-
- Pilot-ready institution dashboard with date range, sample/local/Firebase source mode, feedback insights, false-positive/missed-risk categories, recommended interventions, and Markdown report export.
27-
- Validation and pilot documentation for counselors, institutions, privacy review, and product requirements.
26+
- Pilot-ready institution dashboard with date range, sample/local/Firebase source mode, decision-maker weekly actions, student warnings, counselor actions, resource gaps, data quality warnings, and Markdown report export.
27+
- Validation and pilot documentation for counselors, institutions, resource review, student safety, privacy review, and product requirements.
2828

2929
## Architecture
3030

3131
```text
3232
React + Vite + TypeScript
3333
├── src/main.tsx # Hash-based app routing for GitHub Pages
34-
├── src/pages/ # Landing, checker, cases, report, dashboard, pilot, methodology, privacy
34+
├── src/pages/ # Landing, checker, cases, report, dashboard, eval, pilot, methodology, privacy
3535
├── src/components/ # Shared UI components
3636
├── src/lib/analyzer/ # Transparent rules, scoring, safe next steps
37-
├── src/evaluation/examples.ts # 60 labeled benchmark examples
37+
├── src/evaluation/examples.ts # 100 labeled benchmark examples
3838
├── src/evaluation/evaluateAnalyzer.test.ts # Evaluation regression tests
39+
├── src/evaluation/runEvaluation.ts # Browser/local evaluation summary for #eval
3940
├── src/data/resourcePacks.ts # Structured official resource packs
4041
├── src/lib/feedback/feedbackSchema.ts # Anonymous feedback schema/storage
4142
├── src/lib/privacy/ # Redaction and anonymized report payloads
@@ -50,7 +51,7 @@ Routing remains hash-based and the Vite base path remains `/cross-border-scam-an
5051

5152
The analyzer uses transparent rules and combination boosts rather than fake AI claims. Rules cover urgency, account lock threats, identity verification, click/action pressure, credential/OTP risk, financial account/card risk, authority impersonation, sensitive-data requests, payment pressure, suspicious links/domains, unofficial payment methods, vague institutions, unrealistic guarantees, visa threats, housing scarcity, test-score upgrade claims, personal-account payments, cross-border bureaucracy confusion, language mismatch, and platform risk.
5253

53-
The benchmark tests assert that:
54+
The owner-only `#eval` route summarizes total examples, examples by category and expected risk level, low/high mismatch counts, average score by category, weakest categories, failed tactics, and failed examples. The benchmark tests assert that:
5455

5556
- High-risk examples are not scored low.
5657
- Low-risk legitimate messages are not high/critical.
@@ -70,7 +71,7 @@ Resource packs provide structured safer-verification guidance for:
7071
- Scholarship fee safety
7172
- Education-agent verification safety
7273

73-
Each pack includes who it helps, common scams, official verification steps, normal vs. suspicious requests, a safe script, related case tags, and official resource IDs.
74+
Each pack includes who it helps, common scams, official verification steps, normal vs. suspicious requests, a safe script, related case tags, official resource IDs, last reviewed date, confidence level, source notes, required institution review flag, and student/parent/counselor scripts.
7475

7576
## Feedback loop
7677

@@ -95,9 +96,23 @@ A 30-day pilot should:
9596

9697
Dashboard source modes make clear when data is sample, local browser data, or Firebase-backed.
9798

99+
## Product credibility and validation assets
100+
101+
- Evaluation dashboard: open `#eval` locally or on the GitHub Pages build to inspect benchmark behavior without uploading data.
102+
- Evaluation results doc: [`docs/EVALUATION_RESULTS.md`](docs/EVALUATION_RESULTS.md) explains what the benchmark checks and what it does not prove.
103+
- Resource review guide: [`docs/RESOURCE_REVIEW_GUIDE.md`](docs/RESOURCE_REVIEW_GUIDE.md) helps institutions replace starter guidance with approved official links.
104+
- Institution setup guide: [`docs/INSTITUTION_SETUP_GUIDE.md`](docs/INSTITUTION_SETUP_GUIDE.md) lists required contacts, owners, and privacy guardrails before a pilot.
105+
- Student safety guide: [`docs/STUDENT_SAFETY_GUIDE.md`](docs/STUDENT_SAFETY_GUIDE.md) gives calm verification steps for students and families.
106+
107+
Clear validation statement: **This is being validated; it is not certified fraud detection.**
108+
98109
## Documentation
99110

100111
- [Validation plan](docs/VALIDATION_PLAN.md)
112+
- [Evaluation results](docs/EVALUATION_RESULTS.md)
113+
- [Resource review guide](docs/RESOURCE_REVIEW_GUIDE.md)
114+
- [Institution setup guide](docs/INSTITUTION_SETUP_GUIDE.md)
115+
- [Student safety guide](docs/STUDENT_SAFETY_GUIDE.md)
101116
- [Pilot playbook](docs/PILOT_PLAYBOOK.md)
102117
- [Counselor interview guide](docs/COUNSELOR_INTERVIEW_GUIDE.md)
103118
- [Privacy threat model](docs/PRIVACY_THREAT_MODEL.md)

docs/EVALUATION_RESULTS.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Evaluation Results
2+
3+
## What the benchmark is
4+
5+
The benchmark is a local, synthetic/labeled regression set for the rule-based scam analyzer. It is designed to check whether expected risk indicators continue to be detected for international-student safety scenarios and common phishing patterns.
6+
7+
The benchmark runs in Vitest and can also be reviewed in the browser at `#eval`. It uses `src/evaluation/examples.ts` and `analyzeMessage()` only; it does not upload examples or student data.
8+
9+
## Number of examples
10+
11+
Current benchmark size: **100 labeled examples**.
12+
13+
## Categories covered
14+
15+
The set includes examples across:
16+
17+
- General phishing and account-lock scams
18+
- Bank card phishing
19+
- OTP/code stealing
20+
- Fake refunds
21+
- Tuition account-change scams
22+
- Visa, embassy, IRCC, SEVIS, CAS, and document-courier scams
23+
- Scholarship finalist/processing-fee scams
24+
- Fake housing lease and deposit pressure
25+
- Telegram/WhatsApp education-agent scams
26+
- Testing registration and test-score manipulation scams
27+
- Legitimate low-risk institution reminders
28+
- Borderline unclear messages
29+
- Adversarial/euphemistic examples that avoid obvious scam wording
30+
31+
## What tests assert
32+
33+
The test suite checks that:
34+
35+
- The benchmark contains at least 100 examples.
36+
- Example IDs are unique.
37+
- High/critical expected examples do not score `low`.
38+
- Low expected examples do not score `high` or `critical`.
39+
- Each example score is within the expected minimum and optional maximum range.
40+
- Expected tactic labels are detected when a labeled example requires them.
41+
42+
## Current limitations
43+
44+
- The examples are synthetic regression cases, not a representative field dataset.
45+
- The tests assert rule behavior, not real-world detection accuracy.
46+
- Passing tests does not measure precision, recall, false-positive rate, false-negative rate, demographic fairness, language coverage, or robustness to new scam campaigns.
47+
- Some legitimate messages can contain payment, deadline, or portal language and still require human verification.
48+
- Institution-specific payment links, contact channels, and escalation procedures must be validated separately.
49+
50+
## How to add new examples
51+
52+
1. Add a labeled row to the appropriate group in `src/evaluation/examples.ts`.
53+
2. Include a stable ID prefix by placing the row in an existing mapped group or creating a new group.
54+
3. Set `context`, `platform`, `expectedLevel`, score bounds, expected tactics, category, and notes.
55+
4. Run `npm test`.
56+
5. If the analyzer behavior changes intentionally, update the example notes and score bounds in the same pull request.
57+
58+
## Why this is not a guarantee of real-world accuracy
59+
60+
Scammers change wording, channels, payment methods, and impersonated authorities. This benchmark only confirms that the current analyzer handles the labeled examples in this repository. It should be treated as an engineering regression tool and pilot-readiness aid, not certified fraud detection or a guarantee that a real message is safe or unsafe.

docs/INSTITUTION_SETUP_GUIDE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Institution Setup Guide
2+
3+
This guide helps an institution prepare the MVP for a small validation pilot without collecting raw sensitive messages by default.
4+
5+
## What the institution must provide
6+
7+
- A named escalation owner for student-safety and scam reports
8+
- A named privacy owner for data minimization, retention, and access review
9+
- Approved official links and contacts for each student process
10+
- A pilot success metric and review cadence
11+
- A decision on whether Firebase is disabled, enabled for structured feedback only, or replaced with an institution-approved backend
12+
13+
## Official payment links
14+
15+
Provide the official tuition, deposit, refund, and payment-plan pages. Include rules for wire transfers, accepted payment methods, and how students can verify a changed payment instruction.
16+
17+
## Admissions contacts
18+
19+
Provide official admissions email addresses, phone numbers, applicant portal links, agent-verification pages, and after-hours instructions if available.
20+
21+
## Visa/immigration contacts
22+
23+
Provide the international office, DSO/immigration adviser, embassy/VAC guidance pages when appropriate, and approved scripts for checking visa threats, appointment changes, I-20/CAS/COE issues, or SEVIS-style payments.
24+
25+
## Housing contacts
26+
27+
Provide campus housing contacts, off-campus housing guidance, lease-review options, deposit guidance, and emergency housing escalation paths.
28+
29+
## Testing/advising contacts
30+
31+
Provide official testing-provider pages, campus testing/advising contacts, and rules for score reports, registration receipts, and fee questions.
32+
33+
## Escalation owner
34+
35+
Name the person or team who receives urgent cases, coordinates with student support/public safety/legal/IT, and decides when to involve banks, platforms, law enforcement, or government reporting channels.
36+
37+
## Privacy owner
38+
39+
Name the person or team who approves data fields, retention, access, deletion procedures, and whether structured feedback can be stored beyond local browser storage.
40+
41+
## Pilot success metric
42+
43+
Choose one or two measurable, modest goals, for example:
44+
45+
- Counselors can triage suspected scam messages faster using structured risk indicators.
46+
- Students can identify official verification steps before paying or sending documents.
47+
- Staff can identify top resource gaps without collecting raw messages.
48+
49+
Do not use the MVP to claim certified detection accuracy.
50+
51+
## How to avoid collecting raw sensitive data
52+
53+
- Keep the checker local-first and do not submit pasted messages by default.
54+
- Use structured feedback fields such as risk level, context, platform, calibration, and tactic IDs.
55+
- If reports are shared, store redacted payloads only and review redaction quality.
56+
- Avoid screenshots, passport numbers, card numbers, OTPs, addresses, or full message bodies in pilot analytics.
57+
- Publish deletion and access-review procedures before inviting students.

docs/RESOURCE_REVIEW_GUIDE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Resource Review Guide
2+
3+
Resource packs are starter materials. Before a pilot, an institution should review and replace all links, contacts, and scripts with approved local information.
4+
5+
## Review owner
6+
7+
Assign one owner from international student services, admissions, student accounts, housing, or information security. Record who approved each resource pack and when it should be reviewed again.
8+
9+
## Review steps
10+
11+
1. **Replace placeholder official resources.** Update each pack's official resource IDs or linked materials with the institution's published payment pages, admissions pages, housing contacts, visa/immigration contacts, and testing/advising contacts.
12+
2. **Validate links manually.** Type official domains directly, confirm HTTPS, and avoid copying links from unverified messages.
13+
3. **Confirm payment instructions.** Student accounts or finance should approve every statement about tuition, deposits, refunds, wire details, and accepted payment methods.
14+
4. **Confirm visa/immigration wording.** Designated school officials, international advisers, or immigration compliance staff should approve visa-related scripts.
15+
5. **Confirm escalation scripts.** Counselors should know exactly where to send urgent threats, suspected fraud, or already-paid cases.
16+
6. **Localize language.** Translate scripts only after the English source is approved, and back-review translations with bilingual staff.
17+
7. **Set review dates.** Resource packs should have a last reviewed date and a next review date before launch.
18+
19+
## Replacement checklist
20+
21+
- Official payment portal URL
22+
- Official student accounts contact
23+
- Official admissions contact
24+
- Official international office or visa advising contact
25+
- Official housing office contact
26+
- Official testing/advising contact
27+
- After-hours safety or urgent support contact
28+
- Privacy contact for pilot-data questions
29+
30+
## Pilot rule
31+
32+
Do not send a resource pack to students until required institution review is complete. If a pack is not reviewed, label it as draft guidance and route students to a counselor rather than specific links.

docs/STUDENT_SAFETY_GUIDE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Student Safety Guide
2+
3+
This guide is for international students and families. It is not meant to scare you. It gives calm steps to verify messages before you click, pay, or send documents.
4+
5+
## Before clicking
6+
7+
- Pause and read the message again.
8+
- Do not use links from urgent texts, DMs, or emails if the message asks for login, payment, identity, or account recovery.
9+
- Open the official university, bank, embassy, testing-provider, or housing website by typing the address yourself or using a saved bookmark.
10+
- If the message says an account is locked, check from the official app or website, not from the message link.
11+
12+
## Before paying
13+
14+
- Confirm the fee inside an official portal or with a published office contact.
15+
- Be careful with wire transfers, crypto, gift cards, mobile money, personal accounts, or urgent “new account” instructions.
16+
- Ask whether the payment method is normal for your school or government process.
17+
- If someone pressures you to pay within hours, slow down and verify.
18+
19+
## Before sending documents
20+
21+
- Do not send passport scans, visa documents, bank statements, selfies with ID, student portal passwords, OTPs, or card details through chat unless an official process clearly requires it.
22+
- Ask the school or agency which secure upload portal should be used.
23+
- Remove unnecessary personal information before sharing documents when possible.
24+
25+
## If threatened
26+
27+
- Save the message, phone number, email, or username.
28+
- Do not argue with the sender or send money to stop a threat.
29+
- Contact your international office, counselor, parent/guardian, or trusted adviser using a known contact method.
30+
- If there is immediate danger, contact local emergency support or campus safety.
31+
32+
## If you already paid or shared information
33+
34+
- Contact your bank or card provider quickly and explain what happened.
35+
- Change passwords from the official website or app.
36+
- If you shared an OTP or login code, secure that account immediately and enable new security settings.
37+
- Tell your school counselor or international office so they can help with next steps.
38+
- Keep records, but avoid forwarding sensitive documents unless a trusted official asks for them through a secure channel.
39+
40+
## How to verify official channels
41+
42+
- Use the institution website, official portal, or contact information printed on official admission materials.
43+
- For government processes, start from official government domains typed manually.
44+
- For testing, use the official provider account or approved test center.
45+
- For housing, ask the campus housing office or an off-campus housing adviser to review leases and payment requests.
46+
47+
## Safe message to send to a counselor or parent
48+
49+
> I received a message asking me to take action about school, visa, housing, testing, documents, or payment. Before I click, pay, or send information, can you help me verify it through an official website or published contact? I can share a redacted copy with personal details removed.

src/data/resourcePacks.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ export interface ResourcePack {
99
safeScript: string;
1010
relatedCaseTags: string[];
1111
officialResourceIds: string[];
12+
lastReviewedDate: string;
13+
confidenceLevel: 'low' | 'medium' | 'high';
14+
sourceNotes: string;
15+
requiredInstitutionReview: boolean;
16+
counselorEscalationScript: string;
17+
parentFriendlyScript: string;
18+
studentFriendlyScript: string;
1219
}
1320

14-
export const resourcePacks: ResourcePack[] = [
21+
const baseResourcePacks: Array<Omit<ResourcePack, 'lastReviewedDate' | 'confidenceLevel' | 'sourceNotes' | 'requiredInstitutionReview' | 'counselorEscalationScript' | 'parentFriendlyScript' | 'studentFriendlyScript'>> = [
1522
{
1623
id: 'us-student-visa-safety',
1724
title: 'U.S. student visa safety pack',
@@ -110,6 +117,21 @@ export const resourcePacks: ResourcePack[] = [
110117
},
111118
];
112119

120+
const defaultReviewFields = {
121+
lastReviewedDate: '2026-05-15',
122+
confidenceLevel: 'medium' as const,
123+
requiredInstitutionReview: true,
124+
counselorEscalationScript: 'I am reviewing a student message that may involve this process. Please verify the official payment, document, or portal instructions using institution-owned contacts before the student responds.',
125+
parentFriendlyScript: 'We are going to pause and verify this through the school or government website we type ourselves. Please do not send money, codes, or documents until an official contact confirms it.',
126+
studentFriendlyScript: 'Pause, save the message, and ask your counselor or international office to verify it through an official website or published contact before you click, pay, or send documents.',
127+
};
128+
129+
export const resourcePacks: ResourcePack[] = baseResourcePacks.map((pack) => ({
130+
...pack,
131+
...defaultReviewFields,
132+
sourceNotes: `${pack.title} uses general safety guidance and placeholder official-resource IDs. Replace or confirm all links and scripts with institution-approved sources before a pilot.`,
133+
}));
134+
113135
export function packsForText(text: string, tags: string[] = []): ResourcePack[] {
114136
const haystack = `${text} ${tags.join(' ')}`.toLowerCase();
115137
return resourcePacks.filter((pack) => [...pack.relatedCaseTags, pack.title].some((term) => haystack.includes(term.toLowerCase()))).slice(0, 3);

0 commit comments

Comments
 (0)