Inspiration

In growing smart cities, traffic congestion costs billions in lost productivity, increases fuel emissions, and poses a severe threat to human life when ambulances get trapped in gridlock. While computer vision and distributed AI algorithms can optimize signal timings and create dynamic green waves for emergency vehicles, traffic management systems are mission-critical infrastructure.

A single logic flaw, untested timing regression, or exposed credential in production could disrupt physical junctions across an entire city.

For the GitLab Transcend Hackathon, our inspiration was to bridge cutting-edge smart city traffic control with enterprise-grade Supervised Autonomy. We wanted to build a resilient, multi-agent DevSecOps lifecycle around VeloCiTI using the GitLab Duo Agent Platform—ensuring that physical traffic signals are powered only by rigorously reviewed, simulated, and audited code.


What it does

VeloCiTI (Vehicle Location and City Traffic Intelligence) is an autonomous urban traffic coordination platform with an AI-governed development and deployment lifecycle:

  1. Adaptive Traffic Control & Green Corridors: Ingests multi-camera CCTV feeds, tracks vehicle density in real-time, coordinates neighboring junctions to prevent downstream gridlock, and detects ambulances to trigger instant emergency green corridors.
  2. GitLab Duo AI Code Review Agent: Autonomously reviews Merge Requests. It inspects algorithmic diffs against domain-specific traffic safety rules (enforcing anti-starvation bounds $>35\text{s}$, verifying emergency preemption, and ensuring queue spillback safeguards).
  3. Automated Testing Agent: Executes high-speed scenario simulations, testing real-world junction states, signal boundary clamps (10s–40s), and ambulance corridor handoffs across 8 critical test suites.
  4. Security & Secrets Agent: Continuously scans commits and configurations to ensure 0 hardcoded credentials, camera API tokens, or private keys leak into the build.
  5. Staging Health Check & Audit Agent: Packages multi-stage containers, verifies staging deployment health against live AI endpoints (/api/webcam/ai_status), and automatically compiles verified compliance reports (audit_report.md).
  6. Supervised Autonomy: Staging, testing, and reviews are fully autonomous, but final production deployment strictly enforces a human-in-the-loop manual approval gate.

How we built it

We implemented a layered architecture connecting traffic intelligence with GitLab DevSecOps:

  • AI Code Review Workflow: Authored custom Duo agent configurations (.gitlab/duo/code_review_agent.yml and .gitlab/duo/mr_review_flow.yml) with traffic-domain system prompts to catch logical starvation risks before merge.
  • Traffic Simulation & Test Harness: Built Python test suites (tests/test_junction_logic.py, tests/test_ambulance_priority.py) testing dynamic phase transitions, emergency overrides, and anti-starvation mechanisms in sub-0.05s execution loops.
  • Security Audit Engine: Created automated credential pattern scanners (tests/test_security_audit.py) checking source trees for exposed sensitive keys.
  • GitLab CI/CD Pipeline: Designed an end-to-end .gitlab-ci.yml spanning 6 automated stages: review, test, security, build, staging, and audit, followed by a gated deploy_prod manual job.
  • Computer Vision & Tracking Engine: Powered by an ensemble of YOLOv8 vehicle detectors, custom Indian license plate detectors, Sobel character stroke density analysis, and an environmental image restoration pipeline (dehazing, deblurring, gamma correction).
  • Frontend & Backend: Built with Python Flask for standalone edge execution and React (Vite, Tailwind CSS, Lucide Icons) for the live city operations dashboard.

Challenges we ran into

  • Domain-Specific AI Review Prompts: Generic LLM code reviewers often overlook traffic-specific logic traps—such as favoring a main road repeatedly while starving a side road. We had to carefully craft GitLab Duo instructions so the agent understands phase priority matrices and downstream junction capacities.
  • Testing Real-Time Asynchronous Events: Simulating an approaching ambulance interrupting a fixed green phase required designing a deterministic mock engine to evaluate state transitions reliably without needing physical roadside sensors.
  • Cross-Platform Health Verification: Ensuring staging health probes reliably verified AI engine readiness across various host environments without false-positive timeouts.

Accomplishments that we're proud of

  • 100% Pass Rate on Safety Invariants: All 8 traffic safety test suites execute and pass in approximately 0.03 seconds.
  • 0 Leaked Secrets: Automated security scans enforce a clean credential profile across the repository.
  • True Supervised Autonomy: Solved the dilemma of AI safety in critical infrastructure—agents do the heavy lifting of reviews, testing, security, and staging, while human engineers retain ultimate authority over production releases.
  • Automated Audit Artifact Generation: Every pipeline run automatically compiles an executive audit_report.md documenting test results and deployment readiness.

What we learned

  • How to leverage the GitLab Duo Agent Platform to create specialized AI agents tailored to mission-critical, domain-specific engineering challenges.
  • How to structure end-to-end CI/CD pipelines where automated test agents, security scanners, and deployment health checks work in seamless coordination.
  • The vital importance of Supervised Autonomy when deploying autonomous agents to software that interacts with the real physical world.

What's next for VeloCiTi

  • Autonomous Incident Remediation Agent: Extending GitLab Duo agents to monitor production telemetry, automatically detect signal hardware faults or camera dropouts, and submit auto-remediation merge requests.
  • V2X (Vehicle-to-Everything) Communication: Integrating connected vehicle telemetry directly into our multi-junction coordination network.
  • Multi-City Scaling: Packaging VeloCiTI with Kubernetes Helm charts for distributed deployment across municipal traffic command centers.

Built With

Share this project:

Updates

Submission history