gpt-engineer-app[bot] commited on
Commit
5ecc3ca
Β·
1 Parent(s): bb7fdb2
Files changed (1) hide show
  1. src/server/av-knowledge.ts +79 -0
src/server/av-knowledge.ts ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Curated autonomous vehicle knowledge base injected into every Qwen agent
2
+ // reasoning pass. Keep concise, technical, and standards-anchored β€” this is
3
+ // prepended to the system prompt so token budget matters.
4
+
5
+ export const AV_KNOWLEDGE_BASE = `
6
+ === AV KNOWLEDGE BASE (reference for reasoning) ===
7
+
8
+ # 1. Autonomy Levels (SAE J3016)
9
+ - L0: No automation. Human drives.
10
+ - L1: Driver assistance (ACC OR lane-keep, not both).
11
+ - L2: Partial automation (ACC + lane-keep). Human monitors. (Tesla Autopilot, GM Super Cruise base, Ford BlueCruise.)
12
+ - L3: Conditional automation. System drives in ODD; human is fallback when prompted. (Mercedes Drive Pilot, Honda Sensing Elite.)
13
+ - L4: High automation within a defined ODD; no human fallback required. (Waymo, Cruise, Zoox, Mobileye Drive.)
14
+ - L5: Full automation, any ODD.
15
+
16
+ # 2. AV Stack Architecture
17
+ - Sensing: cameras (mono/stereo), radar (24/77 GHz, 4D imaging), LiDAR (mechanical, MEMS, FMCW, solid-state), ultrasonic, IMU, GNSS/RTK, V2X (DSRC/C-V2X PC5).
18
+ - Perception: object detection (YOLO/DETR/CenterPoint), segmentation (BEVFormer, BEVFusion), tracking (SORT/ByteTrack), free-space, lane/sign detection, traffic light state.
19
+ - Localization: HD map matching, SLAM (LIO-SAM, ORB-SLAM3), GNSS+IMU fusion, NDT/ICP scan matching.
20
+ - Prediction: trajectory forecasting (motion transformers, VectorNet, TNT), intent classification.
21
+ - Planning: behavior planner (FSM/POMDP), motion planner (lattice, RRT*, MPC, MPPI), decision under uncertainty.
22
+ - Control: lateral (Stanley, pure pursuit, MPC), longitudinal (PID, MPC), actuator interface (ISO 11898 CAN, AUTOSAR).
23
+ - Compute: NVIDIA DRIVE Orin/Thor, Mobileye EyeQ6, Qualcomm Ride, Tesla FSD HW4, Horizon Journey 5/6.
24
+ - Middleware: ROS 2, Cyber RT (Apollo), DDS, Autoware, Apex.OS.
25
+
26
+ # 3. Safety Standards & Regulation
27
+ - ISO 26262 β€” Functional Safety for road vehicles. ASIL A–D risk classification (SΓ—EΓ—C). Hazard analysis (HARA), safety goals, FMEA, FTA.
28
+ - ISO 21448 (SOTIF) β€” Safety Of The Intended Functionality. Addresses performance limitations of perception/decision under triggering conditions (fog, edge cases, sensor blooming).
29
+ - ISO/SAE 21434 β€” Cybersecurity engineering. TARA (Threat Analysis & Risk Assessment).
30
+ - ISO/PAS 21448, ISO 34501–34505 β€” AV test scenarios taxonomy.
31
+ - UN R155 / R156 β€” Cybersecurity Management System (CSMS) and Software Update Management System (SUMS).
32
+ - UN R157 β€” Automated Lane Keeping Systems (ALKS) up to 130 km/h. Defines minimum risk maneuver, DDT fallback, DSSAD.
33
+ - UN R152 β€” AEBS for M1/N1.
34
+ - FMVSS (US) β€” 49 CFR Part 571. NHTSA Standing General Order 2021-01 mandates crash reporting for L2+ ADAS within 1 day (serious) / 5 days.
35
+ - NHTSA AV TEST Initiative; AV 4.0 policy framework.
36
+ - California DMV: AV Tester Permit, Driverless Deployment Permit, mandatory disengagement reports (Title 13 Β§227).
37
+ - EU GSR (General Safety Regulation 2019/2144) β€” mandatory ADAS since 2022 (ISA, AEB, DDAW, lane-keeping).
38
+
39
+ # 4. Operational Design Domain (ODD)
40
+ Defined by: roadway type, speed range, time-of-day, weather (rain rate, visibility, snow, fog), geography (geofence), traffic conditions, infrastructure (lane markings, signage), connectivity. ODD exit triggers DDT fallback β†’ minimum risk condition (MRC).
41
+
42
+ # 5. Failure Modes & Root Cause Categories
43
+ - Sensor: occlusion, calibration drift, sensor blinding (sun, headlights), weather degradation, hardware fault, sync/timing skew, intrinsic noise.
44
+ - Perception: false negative (missed pedestrian/cyclist/VRU), false positive (phantom braking), misclassification, range error, tracking ID switch, late detection.
45
+ - Prediction: incorrect intent, ignored cut-in, missed yield behavior.
46
+ - Planning: unsafe gap acceptance, late lane change, frozen robot problem, deadlock at unprotected left, oscillating path.
47
+ - Control: actuator latency, oversteer/understeer, brake fade, lateral overshoot.
48
+ - Map/Localization: stale HD map, lane geometry mismatch, GNSS multipath in urban canyon, incorrect localization in tunnels.
49
+ - HMI / Driver: mode confusion (L2 misuse), late takeover, hands-off detection bypass.
50
+ - Software: race condition, message drop (DDS QoS), regression after OTA, watchdog reset.
51
+ - Cybersecurity: GPS spoofing, CAN bus injection, adversarial patches on signs.
52
+ - Environmental: construction zones, emergency vehicles, unusual VRUs (e-scooters), animal incursion, road debris, glare.
53
+
54
+ # 6. Notable Real-World Incidents (precedent for analysis)
55
+ - Uber ATG, Tempe AZ 2018: pedestrian fatality. Root cause: classification flip-flop (vehicle/bicycle/unknown), suppressed AEB, inattentive safety driver, no pedestrian-as-jaywalker model.
56
+ - Tesla Autopilot Williston FL 2016 & Delray FL 2019: failure to detect crossing tractor-trailer (radar gating + camera).
57
+ - Cruise SF Oct 2023: pedestrian struck by other vehicle then dragged ~6 m by Cruise AV during pullover; ODD/MRC and incident response failure β†’ permit suspension.
58
+ - Waymo Phoenix tow-truck collisions 2024: prediction of articulated/towed vehicles.
59
+ - Mobileye/REM, Zoox closed-loop testing β€” examples of safety case methodology.
60
+
61
+ # 7. Incident Investigation Checklist
62
+ 1. Reconstruct timeline from sensor logs, perception traces, planner state, CAN bus, video.
63
+ 2. Identify trigger event(s) and hazard manifestation.
64
+ 3. Map to fault category (perception / prediction / planning / control / map / HMI / external).
65
+ 4. Check ASIL/SOTIF coverage: was scenario in ODD? Was triggering condition foreseen?
66
+ 5. Compliance: NHTSA SGO reportable? CA DMV disengagement filing? UN R157 DSSAD entry?
67
+ 6. Recommend mitigations: software fix, ODD restriction, additional validation scenario, hardware change, operator coaching, fleet-wide OTA hold.
68
+
69
+ # 8. Compliance Citation Quick Reference
70
+ - ASIL D hazard control failure β†’ ISO 26262-3 / -4 / -6.
71
+ - Perception misdetection of VRU under fog β†’ ISO 21448 SOTIF Clause 7 (triggering conditions).
72
+ - Cyber intrusion via OTA β†’ ISO/SAE 21434 + UN R155.
73
+ - ALKS over-speed or failed MRM β†’ UN R157 Β§5.
74
+ - Failure to file crash report within 24h β†’ NHTSA Standing General Order 2021-01.
75
+ - Disengagement not logged β†’ CA CCR Title 13 Β§227.46.
76
+ - AEBS non-actuation β†’ UN R152 / FMVSS 127.
77
+
78
+ === END KNOWLEDGE BASE ===
79
+ `;