Onboarding wizard — ingest any staffing CSV in 3 steps

New /onboard page. Client-facing wizard for getting real data into
the system without engineering help.

Flow:
1. Drop a CSV (or click 'Use the sample as my data' — ships a 25-row
   realistic staffing roster under /samples/staffing_roster_sample.csv)
2. Browser parses client-side. Columns auto-typed (text/int/decimal/
   date). PII flagged by name hint AND content regex (emails, phones).
   First rows previewed. Read-only — nothing written yet.
3. Name the dataset (lowercase+underscores). Commit.
4. Post-commit: dataset is live. Shows 4 next steps the operator can
   take (SQL query, vector index, dashboard search, playbook training).

Backend:
- /onboard serves onboard.html
- /samples/*.csv serves CSV files from mcp-server/samples/ with
  filename validation (only [a-zA-Z0-9_-.]+.csv, prevents path traversal)
- /onboard/ingest forwards multipart/form-data to gateway /ingest/file
  preserving the boundary. The generic /api/* passthrough breaks
  multipart because it reads as text and forwards as JSON; this route
  uses arrayBuffer + original Content-Type.

Verified end-to-end: upload sample roster (25 rows, 12 columns) →
parse in browser → show columns + PII flags + preview → commit →
gateway writes Parquet, registers in catalog → immediately queryable:
  SELECT * FROM onboard_demo2 LIMIT 3
  → Sarah Johnson, Forklift Operator, Chicago, IL, 0.92
Round-trip <1 second.

Nav updated on all pages to link Onboard. Shipped with a sample CSV
so the full flow is demonstrable without real client data.

When a real client shows up, same path — they upload their CSV.
No engineering ticket, no code change, no schema pre-definition.

Security: sample filename regex prevents path traversal. CSV parse
is client-side pure JS (no DOM injection). Commit uses existing
/ingest/file validation (schema fingerprint, PII server-side,
content-hash dedup).
This commit is contained in:
root
2026-04-20 18:13:56 -05:00
parent 468798c9ac
commit 23eb04a145
7 changed files with 490 additions and 0 deletions
@@ -0,0 +1,26 @@
worker_id,name,role,city,state,email,phone,skills,certifications,availability,reliability,archetype
W-1001,Sarah Johnson,Forklift Operator,Chicago,IL,sarah.johnson@example.com,(312) 555-0101,pallet jack|hazmat|loading dock,OSHA-10|Forklift,0.92,0.88,reliable
W-1002,Michael Chen,Welder,Toledo,OH,m.chen@example.com,(419) 555-0234,TIG|MIG|blueprint reading|grinder,OSHA-10|AWS D1.1,0.71,0.94,specialist
W-1003,Maria Rodriguez,Warehouse Associate,Chicago,IL,maria.r@example.com,(312) 555-0311,inventory|RF scanner|pick-to-light,OSHA-10,0.85,0.80,reliable
W-1004,David Park,Machine Operator,Detroit,MI,dpark@example.com,(313) 555-0412,CNC|gauge R&R|lean manufacturing,OSHA-10|First Aid,0.60,0.91,specialist
W-1005,Jennifer Lopez,Loader,Chicago,IL,j.lopez@example.com,(312) 555-0501,loading dock|team lead|cold storage,OSHA-10|Forklift,0.95,0.76,communicator
W-1006,Robert Williams,Maintenance Tech,Milwaukee,WI,rwilliams@example.com,(414) 555-0612,electrical|PLC|hydraulics|CMMS,OSHA-10|LOTO,0.45,0.93,specialist
W-1007,Amanda Taylor,Quality Tech,Toledo,OH,a.taylor@example.com,(419) 555-0701,ISO 9001|calibration|root cause analysis,OSHA-10|Six Sigma Green,0.80,0.87,leader
W-1008,Carlos Mendoza,Electrician,Chicago,IL,c.mendoza@example.com,(312) 555-0808,conduit|motor controls|troubleshooting,OSHA-30|NEC,0.88,0.96,specialist
W-1009,Kim Nguyen,Forklift Operator,Detroit,MI,k.nguyen@example.com,(313) 555-0915,pallet jack|shipping|team lead,OSHA-10|Forklift,0.73,0.82,flexible
W-1010,James O'Brien,Welder,Milwaukee,WI,jobrien@example.com,(414) 555-1021,TIG|pipe welding|confined space,OSHA-10|AWS D1.1,0.90,0.79,reliable
W-1011,Priya Patel,Production Worker,Chicago,IL,priya.p@example.com,(312) 555-1118,line work|first article|labeling,OSHA-10,0.66,0.85,reliable
W-1012,Thomas Anderson,Material Handler,Toledo,OH,tanderson@example.com,(419) 555-1225,RF scanner|pallet jack|receiving,OSHA-10|Forklift,0.82,0.77,flexible
W-1013,Lisa Nakamura,Warehouse Associate,Detroit,MI,l.nakamura@example.com,(313) 555-1312,inventory|Excel|packaging,OSHA-10,0.77,0.89,communicator
W-1014,Brandon Moore,Machine Operator,Milwaukee,WI,b.moore@example.com,(414) 555-1405,CNC|SPC|conveyor ops,OSHA-10,0.56,0.94,specialist
W-1015,Emily Zhang,Assembler,Chicago,IL,emily.z@example.com,(312) 555-1502,assembly|gauge R&R|line lead,OSHA-10|Six Sigma Yellow,0.91,0.81,leader
W-1016,Marcus Johnson,Forklift Operator,Toledo,OH,mjohnson@example.com,(419) 555-1609,pallet jack|hazmat|overhead crane,OSHA-10|Forklift|Hazmat,0.68,0.88,reliable
W-1017,Anita Brooks,Line Lead,Detroit,MI,a.brooks@example.com,(313) 555-1715,team lead|training|SPC,OSHA-30|Six Sigma Green,0.52,0.97,leader
W-1018,Dmitri Volkov,Welder,Chicago,IL,d.volkov@example.com,(312) 555-1820,TIG|MIG|blueprint reading,OSHA-10|AWS D1.1|Confined Space,0.84,0.83,specialist
W-1019,Rachel Kim,Loader,Milwaukee,WI,r.kim@example.com,(414) 555-1911,loading dock|first aid|bilingual,OSHA-10|First Aid,0.79,0.84,communicator
W-1020,Samuel Park,Maintenance Tech,Toledo,OH,spark@example.com,(419) 555-2012,electrical|PLC|troubleshooting|CMMS,OSHA-10|LOTO,0.70,0.92,specialist
W-1021,Jordan Williams,Quality Tech,Detroit,MI,j.williams@example.com,(313) 555-2117,ISO 9001|calibration|SPC,OSHA-10|Six Sigma Green,0.83,0.86,leader
W-1022,Natalia Soto,Warehouse Associate,Chicago,IL,n.soto@example.com,(312) 555-2221,RF scanner|inventory|team lead,OSHA-10,0.89,0.90,communicator
W-1023,Henry Chen,Machine Operator,Milwaukee,WI,h.chen@example.com,(414) 555-2318,CNC|conveyor ops|root cause,OSHA-10,0.64,0.93,specialist
W-1024,Ava Martinez,Forklift Operator,Toledo,OH,a.martinez@example.com,(419) 555-2411,pallet jack|bilingual|cold storage,OSHA-10|Forklift,0.87,0.80,flexible
W-1025,Tyler Rodriguez,Production Worker,Chicago,IL,t.rodriguez@example.com,(312) 555-2515,line work|packaging|quality inspection,OSHA-10,0.74,0.86,reliable
1 worker_id name role city state email phone skills certifications availability reliability archetype
2 W-1001 Sarah Johnson Forklift Operator Chicago IL sarah.johnson@example.com (312) 555-0101 pallet jack|hazmat|loading dock OSHA-10|Forklift 0.92 0.88 reliable
3 W-1002 Michael Chen Welder Toledo OH m.chen@example.com (419) 555-0234 TIG|MIG|blueprint reading|grinder OSHA-10|AWS D1.1 0.71 0.94 specialist
4 W-1003 Maria Rodriguez Warehouse Associate Chicago IL maria.r@example.com (312) 555-0311 inventory|RF scanner|pick-to-light OSHA-10 0.85 0.80 reliable
5 W-1004 David Park Machine Operator Detroit MI dpark@example.com (313) 555-0412 CNC|gauge R&R|lean manufacturing OSHA-10|First Aid 0.60 0.91 specialist
6 W-1005 Jennifer Lopez Loader Chicago IL j.lopez@example.com (312) 555-0501 loading dock|team lead|cold storage OSHA-10|Forklift 0.95 0.76 communicator
7 W-1006 Robert Williams Maintenance Tech Milwaukee WI rwilliams@example.com (414) 555-0612 electrical|PLC|hydraulics|CMMS OSHA-10|LOTO 0.45 0.93 specialist
8 W-1007 Amanda Taylor Quality Tech Toledo OH a.taylor@example.com (419) 555-0701 ISO 9001|calibration|root cause analysis OSHA-10|Six Sigma Green 0.80 0.87 leader
9 W-1008 Carlos Mendoza Electrician Chicago IL c.mendoza@example.com (312) 555-0808 conduit|motor controls|troubleshooting OSHA-30|NEC 0.88 0.96 specialist
10 W-1009 Kim Nguyen Forklift Operator Detroit MI k.nguyen@example.com (313) 555-0915 pallet jack|shipping|team lead OSHA-10|Forklift 0.73 0.82 flexible
11 W-1010 James O'Brien Welder Milwaukee WI jobrien@example.com (414) 555-1021 TIG|pipe welding|confined space OSHA-10|AWS D1.1 0.90 0.79 reliable
12 W-1011 Priya Patel Production Worker Chicago IL priya.p@example.com (312) 555-1118 line work|first article|labeling OSHA-10 0.66 0.85 reliable
13 W-1012 Thomas Anderson Material Handler Toledo OH tanderson@example.com (419) 555-1225 RF scanner|pallet jack|receiving OSHA-10|Forklift 0.82 0.77 flexible
14 W-1013 Lisa Nakamura Warehouse Associate Detroit MI l.nakamura@example.com (313) 555-1312 inventory|Excel|packaging OSHA-10 0.77 0.89 communicator
15 W-1014 Brandon Moore Machine Operator Milwaukee WI b.moore@example.com (414) 555-1405 CNC|SPC|conveyor ops OSHA-10 0.56 0.94 specialist
16 W-1015 Emily Zhang Assembler Chicago IL emily.z@example.com (312) 555-1502 assembly|gauge R&R|line lead OSHA-10|Six Sigma Yellow 0.91 0.81 leader
17 W-1016 Marcus Johnson Forklift Operator Toledo OH mjohnson@example.com (419) 555-1609 pallet jack|hazmat|overhead crane OSHA-10|Forklift|Hazmat 0.68 0.88 reliable
18 W-1017 Anita Brooks Line Lead Detroit MI a.brooks@example.com (313) 555-1715 team lead|training|SPC OSHA-30|Six Sigma Green 0.52 0.97 leader
19 W-1018 Dmitri Volkov Welder Chicago IL d.volkov@example.com (312) 555-1820 TIG|MIG|blueprint reading OSHA-10|AWS D1.1|Confined Space 0.84 0.83 specialist
20 W-1019 Rachel Kim Loader Milwaukee WI r.kim@example.com (414) 555-1911 loading dock|first aid|bilingual OSHA-10|First Aid 0.79 0.84 communicator
21 W-1020 Samuel Park Maintenance Tech Toledo OH spark@example.com (419) 555-2012 electrical|PLC|troubleshooting|CMMS OSHA-10|LOTO 0.70 0.92 specialist
22 W-1021 Jordan Williams Quality Tech Detroit MI j.williams@example.com (313) 555-2117 ISO 9001|calibration|SPC OSHA-10|Six Sigma Green 0.83 0.86 leader
23 W-1022 Natalia Soto Warehouse Associate Chicago IL n.soto@example.com (312) 555-2221 RF scanner|inventory|team lead OSHA-10 0.89 0.90 communicator
24 W-1023 Henry Chen Machine Operator Milwaukee WI h.chen@example.com (414) 555-2318 CNC|conveyor ops|root cause OSHA-10 0.64 0.93 specialist
25 W-1024 Ava Martinez Forklift Operator Toledo OH a.martinez@example.com (419) 555-2411 pallet jack|bilingual|cold storage OSHA-10|Forklift 0.87 0.80 flexible
26 W-1025 Tyler Rodriguez Production Worker Chicago IL t.rodriguez@example.com (312) 555-2515 line work|packaging|quality inspection OSHA-10 0.74 0.86 reliable