Code Spotter is an agent service that monitors student activities in coding environments (currently supporting Jupyter Notebooks), detects "stuck" states, and provides timely, non-intrusive interventions.
The project uses Docker Compose for local development orchestration, consisting of the following components:
- Probe: Lightweight collector running alongside user tools (Jupyter), listening to kernel events and sending standardized events.
- Backend: Centralized service that consumes events, maintains user state machines, and triggers interventions.
- Event Bus: Redis (Pub/Sub) as a decoupling layer between Probe and Backend.
- Docker & Docker Compose
- Recommended hardware: 2vCPU / 8GB RAM (Minimum: 4GB RAM on native Linux)
-
Start the service stack:
TEST_MODE=true docker compose up --build
TEST_MODE=trueshortens detection timeouts for quick demonstrations. -
Access the services:
Service URL Description Demo Dashboard http://localhost:8080/demo Real-time event stream + intervention visualization Jupyter Lab http://localhost:8888 Coding environment Intervention Page http://localhost:8080 Intervention messages only -
Verify monitoring: Check the
agent-backendservice logs. When executing code in Jupyter, you should see real-time events.
The project provides two demonstration methods to showcase the complete flow of "stuck" detection and intervention generation.
The fastest way to demonstrate, no Jupyter interaction required:
- Open Demo Dashboard: http://localhost:8080/demo
- Click any trigger button:
- Consecutive Errors (x3) - Simulates 3 consecutive identical errors
- Repeat Execution (x3) - Simulates executing the same code repeatedly
- Error + Idle - Simulates stopping after an error
- Observe the Event Stream on the left and Interventions on the right
Experience the real coding monitoring flow:
- Refresh the Jupyter page: http://localhost:8888
- Open
work/demo.ipynb - Run any cell to start the kernel
- Open Demo Dashboard: http://localhost:8080/demo
- Select "Jupyter (default-session)" in the top-left dropdown
- Return to Jupyter, run the TRIGGER: CONSECUTIVE_ERRORS cell 3 times
- Observe real-time events and intervention messages in the Demo Dashboard
| Stuck Type | Trigger Condition | Intervention Level |
|---|---|---|
| CONSECUTIVE_ERRORS | Same error appears ≥3 times within 2 minutes | warning |
| NO_PROGRESS_EXECUTION | Same code executed ≥3 times without modification | info |
| ERROR_THEN_IDLE | No activity ≥5 minutes after error (TEST_MODE: 10s) | alert |
docs/: Architecture decision records and RFC documents.shared/: Shared Python libraries (event protocol definitions).probe/: Jupyter Probe service (custom Jupyter Docker image).backend/: Agent Core service.web/: Web UI service (intervention display + Demo Dashboard).tests/: MVP acceptance tests.logs/: Runtime logs directory (auto-created, gitignored).notebooks/: Runtime notebooks directory (auto-created by Docker, gitignored).docker-compose.yml: Local development orchestration configuration.