Iteration 11
Release Date: March 8, 2026
🎯 Overall Summary
Iteration 11 focused on simulation naming, traffic congestion visualization, metrics reporting, authentication hardening, logging improvements, and code quality refactoring. This iteration delivered end-to-end simulation naming (backend persistence, frontend modal, and simulations table display), traffic congestion data overlaid on the route visualization map, a full simulation metrics pipeline (vehicle utilization rate, metrics endpoint, and CSV download), traffic state persistence across simulation runs, and re-enabled router-level API authentication with centralized error-to-HTTP mapping. Key quality improvements include a comprehensive CamelCase-to-snake_case rename, replacement of bare logging imports, structured endpoint and driver-service logging, and a WebSocket router fix enabling live simulation streaming.
🏎️ Velocity
💵 Contractor Estimate
| Artifact Type | Level of Effort | Estimated Price (CAD) |
|---|---|---|
| Simulation Naming & State | Medium (10h) | $220 |
| Metrics & Reporting | Medium (8h) | $176 |
| Authentication & Security | Medium (7h) | $154 |
| Logging & Observability | Medium (6h) | $132 |
| Traffic Persistence & Visualization | Medium (6h) | $132 |
| Code Quality & Refactoring | Low (5h) | $110 |
| Frontend Routing & UX | Low (3h) | $66 |
| Total | 45h | $990 |
Notes:
- The hours listed above represent the time specifically spent on developing the individual software artifacts. They do not reflect the total time our team has committed to Iteration 11.
🔄 Retrospective
What went well
- Stakeholder thinks the app is pretty much done (+1)
- Traffic visualization finally done!
- Task amount slowing down, were almost there!
- TA feedback addressed (back/sim side)
What went wrong
- Some stuff got rolled over to next sprint
- Stakeholder / dispatchers will be unavailable sooner than expected since they are starting the season earlier.
- Meeting with TA and Rigby didn’t happen.
What we can improve on
- Last-minute PRs (+1)
- Getting feedback on design decisions before proceeding with implementation for big tasks
🤝 Individual Contributions
@Ambrose821 - Ambrose McLaughlin [ID: 40239754]
-
Sim: Added vehicle utilization rate reporting in #794
- Added
get_vehicle_utilization_ratio(),increment_vehicle_active_time(), andincrement_vehicle_idle_time()toSimulationReport; utilization = active time ÷ (active + idle time) - Idle time covers any period where a vehicle has no driver assigned or a driver with no tasks; active time covers all other states
- Added metric recording logic in
vehicle.pyand included utilization in the payload emitted bysimulator_controller.py
- Added
-
Backend: Add endpoint to retrieve simulation metrics in #819
- Added a new GET endpoint
/api/v1/simulation/{sim_id}/reportreturning aggregate metrics via a newSimulationReportResponseschema inback/schemas/simulation_report.py - Implemented
get_simulation_reportinSimulationServiceto fetch the latest persisted report metrics with permissions and error handling
- Added a new GET endpoint
-
Frontend: Add metrics download button in #818
- Added a "Report" button to the actions column in the simulations table that calls the new metrics endpoint and downloads the result as a CSV file
- Introduced
GetSimulationReportResponseTypeScript interface intypes.tsto define the expected API response shape
@briantkatch - Brian Tkatch [ID: 40191139]
-
Chore: Delete CDK in #803
- Removed the AWS CDK infrastructure directory; the Ansible-based deployment is now current and includes observability and TLS support
- Eliminates stale cloud configuration that no longer reflected the active deployment strategy
-
Backend: Implement sim naming in BE #773 in #804
- Updated
initialize_simulationto optionally accept a simulation name - Ensured the backend never returns
nullfor a sim name, falling back to a generated name derived from the scenario name
- Updated
-
Backend: Implement traffic persistence #706 in #826
- Added
traffic_csv_data(TEXT, nullable) column tosim_instanceswith migration09bfae8f09b5_add_traffic_csv_data_to_sim_instances.py - Enhanced
TrafficConfigto support template-based (traffic_level) and in-memory (traffic_csv_data) modes;TrafficParsernow acceptsio.StringIOfor in-memory CSV parsing - Added
traffic_config_extractor.pyutility shared byJsonParseStrategyandReplayParser; updatedinitialize_simulation,restore_simulation, andbranch_simulationservices accordingly - 21 tests covering in-memory CSV parsing, traffic config extraction,
ReplayParserrestoration, and service-layer persistence; all 1,259 tests pass
- Added
@Jpuntul - Jutipong Puntuleng [ID: 40080233]
- Frontend: Add traffic congestion data to simulation and route visualization in #733
- Frontend: split route lines into colored sub-features via a
splitByTraffichelper ingeojson-adapters.ts; worst severity wins when ranges overlap (severe > moderate > free_flow); Mapbox layers use data-drivencoalescepaint expressions oncolor/opacityproperties, defaulting to green when no traffic data is present - Traffic colors are trimmed automatically as drivers advance because the existing
turf.jslineSlicecall already trims route features from the driver's current position
- Frontend: split route lines into colored sub-features via a
@mahutt - Thomas Mahut [ID: 40249811]
-
Frontend: Optimistic task state update on assign #709 in #776
- Fixed the multiple in-progress tasks bug:
BatterySwapTask.set_assigned_driverandunassign_drivernow useself.set_stateinstead of directself.state =assignment, ensuringhas_updated = Trueso the diff frame reflects the change - Updated client-side optimistic entity state update to set task state to "assigned" immediately on submit, preventing tasks from briefly showing as "in progress" when the sim is paused
- Introduced a
TaskStateenum
- Fixed the multiple in-progress tasks bug:
-
Frontend: Add sim name to simulations table #775 in #800
- Replaced the
User IDcolumn with aNamecolumn in the simulations table; displays a faded "N/A" when the simulation'snameattribute isnull - Added
nameattribute to theSimulationTypeScript interface definition
- Replaced the
-
Fix: Real time factor to playback speed conversion #815 in #816
- Fixed
SimulationService.get_playback_speedwhich returned the rawreal_time_factorinstead of its inverted value, causing playback speed to appear backwards
- Fixed
-
Frontend: Simulation name modal in #820
- Prompts the user for a simulation name when they first press "Start Simulation"; defaults to the current scenario name and supports pressing Enter to start directly
- Adds a loading state for simulation initialization; updates sim name type and removes the null check in the simulations table
-
Refactor: Update frontend simulation pages routing path #830 in #831
- Updated client-side routing from
simulation/tosimulations/to comply with REST endpoint naming standards - Updated all internal links, redirects, and
useNavigatecalls; no user-facing URL changes
- Updated client-side routing from
-
Docs: Wiki contributions in Repo Wiki
- Updated Deployment Plan and Infrastructure documentation.
- List of Revisions: 1
@MeSumo - Sumer Abd Alla [ID: 40247712]
-
Refactor: Rename files and variables from CamelCase to snake_case in #799
- Renamed sim CamelCase source files such as
SimulatorController,OSRMConnection, andRealTimeDriverto snake_case - Renamed CamelCase variables inside classes to snake_case; fixed all imports, cross-module references, and tests referencing these changes
- Pure style refactor with no behavioral changes, validated by the existing test suite
- Renamed sim CamelCase source files such as
-
Refactor: Replace Bare Logging Imports in #801
- Replaced all
import loggingin thesimandscriptsfolders withfrom grafana_logging.logger import get_logger - Replaced all
logger = logging.getLogger(__name__)withlogger = get_logger(__name__)for consistency with the centralized Grafana logging setup
- Replaced all
-
Docs: Wiki contributions in Repo Wiki
@Michael-Mezzacappa - Michael Mezzacappa [ID: 40263789]
-
Backend: Add logging to driver service #784 in #835
- Added
logger.info()calls inback/services/driver_service.pyforassign_task,unassign_task,reassign_task,batch_assign, andreorder_tasks - Each log entry includes sim ID, driver ID, task ID(s), and requesting user; uses the existing
get_loggerfromgrafana_logging.loggerwith no new dependencies
- Added
-
Backend: Added endpoint logs #785 in #834
- Registered
log_requestfromgrafana_logging/logger.pyas an@app.middleware("http")inmain.py, logging HTTP method, path, status code, and response time for every request - Excludes the
/api/v1/metric/metricsPrometheus scrape endpoint to avoid log noise; does not log request bodies or sensitive headers
- Registered
@Niravanaa - Nirav Patel [ID: 40248940]
-
Backend: Add simpy dependency for simulation support #786 in #791
- Added
simpy>=4.0.0toback/requirements.txtand to[project.dependencies]inback/pyproject.toml
- Added
-
CI: Add check for in-branch merge commits in PRs #790 in #796
- Added a
Check for in-branch merge commitsstep in.github/workflows/branch-naming-check.ymlafterValidate commit messages - For each commit in the PR range (
base.sha..head.sha), counts parents viagit cat-file -p; fails with rebase instructions if any commit has more than one parent - Leverages the existing
fetch-depth: 0checkout configuration — no additional setup required
- Added a
-
Backend: Implement async dependency for raw request body access in #795
- Added
get_raw_bodyasync dependency inback/api/v1/scenarios.py; convertedcreate_scenario,update_scenario, andinitialize_simulationfromasync defto plaindef, injectingraw_body: bytes = Depends(get_raw_body)instead of callingawait request.body()inline - FastAPI now dispatches all three handlers to its thread pool, making the synchronous SQLAlchemy
Sessionsafe under concurrent load
- Added
-
Fix: Improve error handling with logging in simulation endpoints #781 in #793
- Added
get_loggerfromgrafana_logging.loggertoback/api/v1/simulation.py - Replaced all 12 occurrences of
raise HTTPException(status_code=500, detail=str(err))withlogger.exception(...)+ a generic"An unexpected error occurred."detail to avoid leaking internal exception strings
- Added
-
Fix: Add websocket router for simulation streaming in #813
- Added a separate
websocket_routerinback/api/v1/simulation.pyand moved the/stream/{sim_id}WebSocket endpoint onto it - Mounted
simulation_ws_routerinback/main.pywithoutdependencies=[Depends(get_user_id)], consistent with the existingmetrics_routerpattern - No auth coverage lost: the WebSocket endpoint self-authenticates via
get_user_id_over_websocketreading the bearer token from theAuthorizationheader or cookie
- Added a separate
-
Backend: Replace print statements with logging in RealTimeDriver in #828
- Added
import loggingandlogger = logging.getLogger(__name__)toreal_time_driver.py - Replaced
print("Pausing")→logger.info,print("Resuming")→logger.info,print("Specified Sim-time reached")→logger.info,print("Simpy schedule is empty")→logger.warning, config load warning →logger.warning
- Added
-
Fix: Add max seq number retrieval for simulation restoration in #825
- Added
get_max_seq_number()toSimFrameCRUDto query the highest existing sequence number for a given simulation instance - Added
initial_frame_counterparameter toSimulatorController.__init__andSimulator.initialize();restore_simulationnow reads the max persisted seq number and passesmax_seq + 1as the initial frame counter to prevent seq number collisions with historical rows
- Added
@Verdone - Giuliano Verdone [ID: 40252190]
-
Backend: Add centralized error-to-HTTP mapping in #792
- Registered exception handler callbacks in
main.pydeclared in a dedicatedexception_handlers.pymodule, mapping domain exception classes to their appropriate HTTP status codes - Removed the try/except blocks from individual route handlers that existed solely to catch these domain exceptions, eliminating duplication
- Registered exception handler callbacks in
-
Fix: Redirect to original URL intent on auth in #787
- In
authenticated.tsx: unauthenticated access now redirects to/login?next=<pathname+search+hash>usinguseLocationfrom React Router - In
unauthenticated.tsx: after login, readsnextfrom the query string and redirects there; a guard accepts only/-prefixed, non-//-prefixed values, falling back to/otherwise - Redirects use
replace: trueto avoid cluttering browser history; tests updated inauthenticated.test.tsxandunauthenticated.test.tsx
- In
-
Backend: Re-enable router-level VeloSim API auth in #788
- Applied router-level auth at
back/main.pyso every/api/v1route gets an auth check; endpoint-level dependencies inside API files are still present foruser_idinjection metrics_routerremains public and is not grouped withapi_router; added explicit public-endpoint tests inback/tests/test_main_public_endpoints.py- Disabled Loki logging in tests to fix ~2-minute blocking caused by
urllib.request.urlopentiming out on each log call when Loki is not running in the test environment
- Applied router-level auth at
-
Docs: Wiki contributions in Repo Wiki
@vinishamanek - Vinisha Manek [ID: 40229456]
-
Frontend: Persist sidebar state in #805
- Added a
getCookieValuehelper to read values fromdocument.cookie - Updated open state initialization in
SidebarProviderto read the cookie value so the sidebar's open/closed state persists across page refreshes
- Added a
-
Frontend: Transition to resource in selected item bar after assignment in #806
- Added
selectItem(SelectedItemType.Driver, pendingAssignment.driverId)after task assignment confirmation, scrolling to and highlighting the assigned driver's resource card - Merged
confirmUnassignedOnlyintoconfirmAssignment(unassignedOnly = false)to eliminate the near-duplicate method
- Added
@CarciDev - David Carciente [ID: 40247907]
- Sim: Add traffic congestion data to simulation and route visualization in #733
- Sim: introduced
TrafficTripledata model;Route.notify_traffic_changed()rebuilds cached triples by walking all roads and translating per-road geometry indices to route-wide coordinate indices;TrafficController._notify_routes_for_road()bridges road-level events to route visualization with the existing GPS sync delay model - Replaced ratio-based index mapping with geographic
find_nearest_index()to eliminate driver position rubber-banding when traffic changes a road's point count mid-traversal
- Sim: introduced
@cmezzac - Christopher Mezzacappa [ID: 40249451]
📋 What's Changed
- Optimistic task state update on assign #709 by @mahutt in #776
- feat: add simpy dependency for simulation support #786 by @Niravanaa in #791
- feat: add check for in-branch merge commits in PRs #790 by @Niravanaa in #796
- feat: Rename files and variables from CamelCase to snake_case by @MeSumo in #799
- feat: add centralized error-to-HTTP mapping by @Verdone in #792
- Add sim name to simulations table #775 by @mahutt in #800
- fix: redirect to original URL intent on auth by @Verdone in #787
- feat: persist sidebar state by @vinishamanek in #805
- feat: transition to resource in selected item bar after assignment by @vinishamanek in #806
- chore: Delete CDK by @briantkatch in #803
- feat: Implement sim naming in BE #773 by @briantkatch in #804
- feat: re-enable router-level VeloSim API auth by @Verdone in #788
- feat: implement async dependency for raw request body access by @Niravanaa in #795
- feat: Replace Bare Logging Imports by @MeSumo in #801
- fix: add websocket router for simulation streaming by @Niravanaa in #813
- feat: Added vehicle utilization rate reporting by @Ambrose821 in #794
- fix: real time factor to playback speed conversion #815 by @mahutt in #816
- fix: improve error handling with logging in simulation endpoints #781 by @Niravanaa in #793
- feat: simulation name modal by @mahutt in #820
- feat: replace print statements with logging in RealTimeDriver by @Niravanaa in #828
- refactor: update frontend simulation pages routing path #830 by @mahutt in #831
- feat: Add endpoint to retrieve simulation metrics by @Ambrose821 in #819
- feat: Implement traffic persistence #706 by @briantkatch in #826
- feat: Add metrics download button by @Ambrose821 in #818
- feat: add logging to driver service #784 by @Michael-Mezzacappa in #835
- feat: Added endpoint logs #785 by @Michael-Mezzacappa in #834
- fix: add max seq number retrieval for simulation restoration by @Niravanaa in #825
- feat: add traffic congestion data to simulation and route visualizati… by @Jpuntul in #733
Full Changelog: Iteration10...Iteration11