From Misguided LMS to Pervasive Ambient Vehicle Training
- Assessment of Current State
- The Rebuild
- Decision Point: Clean Slate vs. Incremental
- Phase 0: Conceptual Foundation (No Code)
- Phase 1: Core Intelligence (Rust)
- Phase 2: Sensor Integration (Rust)
- Phase 3: Actuator Integration (Rust + ReScript)
- Phase 4: Domain Modules (Rust + Domain Knowledge)
- Phase 5: User Interface (ReScript)
- Phase 6: Validation
- Immediate Next Steps
- Open Questions
- Timeline
- Conclusion
The repository contains a Ruby on Rails Learning Management System:
-
16 ActiveRecord models (User, Course, Lesson, Quiz, etc.)
-
Devise authentication with role-based access
-
Quiz engine with multiple-choice questions
-
Progress tracking and achievement system
-
~1,263 lines of Ruby code
-
~40 RSpec test files
-
Comprehensive CI/CD and RSR compliance infrastructure
This architecture embodies the wrong paradigm:
| LMS Assumption | Reality of Skill Acquisition |
|---|---|
Learning is content consumption |
Learning is environmental coupling |
Knowledge transfers from abstract to embodied |
Embodied skill must be grown in context |
Progress is linear through modules |
Competence is a multidimensional landscape |
Assessment is quiz-based |
Competence manifests in perception-action loops |
Training happens at scheduled times |
Training must be continuous and ambient |
The learner comes to the system |
The system must pervade the learner’s environment |
The existing code cannot be "refactored" into the correct paradigm. The fundamental data model, the interaction patterns, the entire conceptual architecture—all wrong.
-
RSR compliance documentation and structure
-
CI/CD infrastructure (GitHub Actions workflows)
-
Container configuration (Containerfile, Nix flake)
-
Governance and contribution framework
-
Security infrastructure (.well-known, security headers)
-
Git hooks and automation (Justfile structure)
These represent operational infrastructure independent of the application paradigm.
Two options:
Option A: Delete and Restart * Remove all Ruby/Rails code * Keep only infrastructure * Begin fresh with correct architecture
Option B: Gradual Replacement * Keep Rails running for reference * Build new system alongside * Migrate when new system reaches parity
Recommendation: Option A. The existing code provides no value for the new paradigm. Keeping it creates confusion and maintenance burden.
Before writing implementation code, the following must be completed:
For each vehicle domain (car, motorbike, aircraft, watercraft), produce:
-
Perception-Action Decomposition: What does skilled operation actually consist of? Not "knowing the highway code" but "perceiving gap timing in flowing traffic" or "feeling the slip angle through the seat."
-
Micro-Skill Taxonomy: Break competence into the smallest trainable units. Example for car: "left-mirror check timing," "clutch-bite-point proprioception," "three-second-rule distance calibration."
-
Dependency Graph: Which micro-skills depend on which others? What is the minimum viable competence for safe operation?
-
Ambient Trainability Assessment: Which micro-skills can be trained ambiently (without being in the vehicle)? Which require actual vehicle time?
Deliverable: docs/competence-model/ with structured documents per vehicle domain.
Define what hardware is needed:
-
Minimum Viable Sensor Set: What is the absolute minimum sensing required? (Probably: smartphone accelerometer + location + wearable heart rate)
-
Full Vision Sensor Set: What would complete environmental awareness require? (Wearables, environmental sensors, vehicle OBD integration, eye tracking, etc.)
-
Minimum Viable Actuator Set: What is the minimum output? (Probably: smartphone haptics + audio + notifications)
-
Full Vision Actuator Set: What would complete environmental modulation require? (Spatial audio, AR glasses, haptic gloves/vest, smart home integration, vehicle HUD)
Deliverable: docs/hardware/sensor-requirements.adoc and docs/hardware/actuator-requirements.adoc
The system will have unprecedented access to the trainee’s life. This requires:
-
Data Minimization Specification: What is the minimum data needed? How quickly can it be discarded?
-
Local-First Architecture: All processing must happen on trainee-controlled devices. No cloud dependency for core function.
-
Consent Framework: How does the trainee control what the system perceives and when?
-
Data Sovereignty: How does the trainee export, delete, and control all their data?
Deliverable: docs/privacy/architecture.adoc
Ambient training systems have manipulation potential. We must constrain this:
-
No Dark Patterns: The system may not use psychological manipulation to increase engagement.
-
No Gamification for Its Own Sake: Achievements, points, streaks—these capture attention without building competence. Avoid them.
-
Honest Assessment: The system must never tell trainees they are more competent than they are.
-
Right to Disconnect: The trainee can always turn the system off without penalty.
-
Certification Independence: The system trains but does not certify. Certification remains with appropriate authorities.
Deliverable: docs/ethics/framework.adoc
Ambient training must respect cognitive and ergonomic constraints. Document:
-
Attention Budget Model: How much cognitive load can ambient training impose without degrading primary activities? What is the cost-benefit calculus for interventions?
-
Transfer Validation Framework: For each micro-skill, what evidence supports ambient trainability? Which skills require in-vehicle practice and cannot be trained ambiently?
-
Vigilance and Habituation Analysis: How do we prevent the system from becoming background noise? What variation and spacing prevents habituation?
-
Situation Awareness Mapping: Map each micro-skill to Endsley’s SA levels (perception, comprehension, projection). Ensure training addresses all three levels, not just perceptual exposure.
-
Dual-Task Interference Assessment: For each training context (walking, sitting, passenger), what is the interference profile? When is training counterproductive?
Deliverable: docs/human-factors/analysis.adoc
Document how the framework applies across operational paradigms:
-
Manual Operation: Full human control, current focus. What competencies? What training approaches?
-
Hybrid Operation (SAE L1-L3): Shared control. What changes? What new competencies emerge (monitoring, takeover, trust calibration)?
-
Autonomous Operation (SAE L4-L5): Machine primary control. What residual human competencies matter? Emergency intervention? System supervision?
Deliverable: docs/paradigms/ with documents for each paradigm and analysis of paradigm transitions.
The central system that observes, models, plans, and acts.
Input: sensor data streams Output: trainee state representation
TraineeState {
physiological: {
alertness: f32, // 0.0 (asleep) to 1.0 (peak)
stress: f32, // 0.0 (calm) to 1.0 (crisis)
fatigue: f32, // 0.0 (fresh) to 1.0 (exhausted)
},
context: {
activity: Activity, // walking, sitting, driving, sleeping, etc.
location: Location, // home, transit, vehicle, workplace, etc.
attention: Attention, // available, partial, unavailable
},
receptivity: f32, // computed: how trainable is this moment?
}Data structure representing what the trainee can and cannot do.
CompetenceModel {
domain: VehicleDomain,
micro_skills: Map<MicroSkillId, SkillState>,
// SkillState includes:
// - estimated_competence: f32
// - confidence: f32 (how sure are we of the estimate?)
// - last_assessed: Timestamp
// - decay_rate: f32 (how fast does this skill fade?)
}Given: current TraineeState + CompetenceModel Output: optimal intervention (or no intervention)
Intervention {
target_skill: MicroSkillId,
modality: Modality, // haptic, audio, visual, proprioceptive
intensity: f32, // how demanding is this intervention?
duration: Duration,
content: InterventionContent,
}The planner must respect: * Current receptivity (don’t train when asleep or stressed) * Skill priorities (focus on highest-value gaps) * Modality availability (can’t do visual if trainee is driving) * Spaced repetition (don’t overtrain recently-trained skills) * Attention budget (interventions have cognitive cost—don’t exceed budget) * Habituation prevention (vary interventions, respect refractory periods) * Primary task protection (never degrade safety-critical activities) * Silence as valid output (sometimes the best intervention is no intervention)
After intervention: did it work?
Input: pre-intervention state, intervention, post-intervention sensor data Output: estimated skill delta
This closes the loop: intervention → observation → model update → next intervention.
Sensors must be abstracted:
trait SensorSource {
fn capabilities(&self) -> SensorCapabilities;
fn subscribe(&self, callback: SensorCallback);
fn current_state(&self) -> SensorReading;
}The smartphone is the minimum viable sensor platform:
-
Accelerometer → motion, activity detection
-
GPS → location, speed (as passenger), route patterns
-
Microphone → ambient sound classification (traffic, vehicle interior)
-
Camera → (optional) visual scene classification
Implementation: Native apps (iOS/Android) with local processing, communicating with core over local network.
Heart rate, HRV, skin conductance:
-
Integration with existing fitness wearables (Garmin, Apple Watch, etc.)
-
Custom wearable protocols for future development
trait ActuatorSink {
fn capabilities(&self) -> ActuatorCapabilities;
fn send(&self, command: ActuatorCommand) -> Result<()>;
}-
Haptic patterns (vibration sequences encoding information)
-
Audio (spatial audio for situational awareness training)
-
Notifications (non-intrusive prompts)
-
AR overlay (camera-based, limited but accessible)
Spatial audio is critical for:
-
Traffic awareness training (sounds from correct directions)
-
Procedure memorization (audio cues for sequences)
-
Ambient environmental modulation
Integration: Core sends audio scene descriptions → audio renderer produces spatial output.
For visual overlay training:
-
Traffic flow visualization
-
Hazard prediction zones
-
Gap timing indicators
Initial implementation: smartphone-based. Future: smart glasses integration.
Each vehicle domain requires:
-
Competence model implementation
-
Micro-intervention library:
-
Gap timing training (audio cues while pedestrian)
-
Mirror check habituation (haptic prompts)
-
Hazard prediction (visual overlays)
-
Speed calibration (proprioceptive training)
-
-
Assessment methodology (in-vehicle observation)
-
UK driving test alignment
-
Balance/countersteering intuition training
-
Lean angle perception
-
Vulnerability awareness
-
Emergency procedures
-
Instrument scan pattern training
-
Spatial orientation training
-
Procedure memorization (flows and checklists)
-
Decision-making frameworks
Web-based UI for:
-
System setup and calibration
-
Training goals and preferences
-
Privacy controls
-
Sensor/actuator configuration
-
Competence landscape visualization
-
Training history
-
Progress over time
-
Recommendations
Before real-world deployment:
-
Synthetic trainee simulation
-
Edge case testing
-
Privacy verification
-
Performance benchmarking
Small-scale real-world testing:
-
Volunteer trainees with informed consent
-
A/B comparison with traditional training
-
Longitudinal competence tracking
-
Safety monitoring
Critical question: does ambient training actually transfer to vehicle operation?
-
Near transfer: Does gap timing training while walking improve gap timing perception while driving?
-
Far transfer: Does general situational awareness training improve overall driving safety?
-
Skill-specific validation: For each micro-skill, empirically test whether ambient training produces measurable competence gains in actual vehicle operation
-
Null results are valuable: If a training approach doesn’t transfer, document it and remove it from the system
Rigorous measurement:
-
Does ambient training improve driving test pass rates?
-
Does it reduce incident rates post-licensing?
-
Does it accelerate competence development?
-
What are the optimal training parameters?
-
Which micro-skills show strongest transfer? (Focus development here)
-
Which training contexts are most effective? (Walking vs. sitting vs. passenger)
-
What is the minimum effective dose? (Avoid over-training)
-
Remove Rails application code (app/, db/, config/, spec/)
-
Keep infrastructure (CI/CD, containers, documentation)
-
Update .claude/CLAUDE.md to reflect new direction
-
Remove misleading TS_CONVERSION_NEEDED.md (not relevant)
docs/
├── competence-model/
│ ├── car.adoc
│ ├── motorcycle.adoc
│ ├── aircraft.adoc
│ └── watercraft.adoc
├── hardware/
│ ├── sensor-requirements.adoc
│ └── actuator-requirements.adoc
├── privacy/
│ └── architecture.adoc
├── ethics/
│ └── framework.adoc
├── human-factors/
│ ├── analysis.adoc
│ ├── attention-model.adoc
│ ├── transfer-framework.adoc
│ └── situation-awareness.adoc
├── paradigms/
│ ├── manual-operation.adoc # Current focus
│ ├── hybrid-operation.adoc # Future: SAE L1-L3
│ ├── autonomous-operation.adoc # Future: SAE L4-L5
│ └── paradigm-transitions.adoc # How skills evolve across paradigms
└── architecture/
├── overview.adoc
├── core-intelligence.adoc
├── sensor-integration.adoc
└── actuator-integration.adoc
Start with car (most common use case):
-
Interview driving instructors
-
Analyze examiner assessment criteria
-
Review cognitive psychology of driving literature
-
Decompose into micro-skills
Minimal implementation in Rust:
-
Simple state perception (smartphone only)
-
Basic competence model (single domain, few skills)
-
Simple planner (spaced repetition only)
-
SQLite storage
These require decisions before proceeding:
-
Vehicle Domain: Should v1 focus on a single vehicle domain (car) or attempt all four?
-
Operational Paradigm: We’re focusing on manual operation—but should we also prototype hybrid-operation training (monitoring, takeover) given current automotive trends?
-
Geographic Context: UK driving test alignment is mentioned—should the system be region-agnostic or region-specific?
-
Hardware: Should we target existing consumer devices only, or design custom hardware?
-
Minimum Viable Sensing: What is the true minimum sensor set that enables useful training? Is smartphone-only viable?
-
Transfer Baseline: Before building, should we conduct preliminary studies to validate that ANY ambient training transfers to vehicle operation?
-
Attention Budget Empiricism: How do we determine actual cognitive load limits? Lab studies? Field studies? Literature synthesis?
-
Habituation Dynamics: What intervention spacing and variation prevents habituation? This may need empirical calibration per modality.
-
Regulatory: How do we interact with existing driver training and licensing regimes?
-
Instructor Integration: Should the system integrate with human driving instructors, or operate independently?
No timeline provided. The phases are sequential dependencies, not calendar commitments. Move as fast as competent execution allows.
The existing codebase represents a failed approach. The correct approach—pervasive ambient training—requires a fundamental rebuild.
The path forward:
-
Establish conceptual foundation (competence models, privacy, ethics)
-
Build core intelligence (state perception, competence modeling, intervention planning)
-
Integrate sensors and actuators
-
Develop domain-specific training modules
-
Validate effectiveness
This is a significant undertaking. But training humans to operate vehicles safely is worth doing correctly.
Build the system that disappears into life itself.