Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for SortLedger AI

Inspiration

A contaminated single-stream load and a half-empty bin are different failures that hit the same truck. Above 12% contamination, the MRF triggers load rejection (recoveryEfficiency = 0.35, cutting recyclable recovery to 35%), while even a small stray lithium battery triggers a critical hazard flag and $150 + $18/kg safety surcharge. Meanwhile, collection trucks still drive full loops past bins under a 65% fill line.

What it does

SortLedger AI is a zero-backend deterministic TypeScript web console. It audits 12 material classes (PET, HDPE, Aluminum, Cardboard, Glass, Compost, E-Waste, Battery, Film-Plastic, Styrofoam, Food-Soiled-Paper, Mixed-Trash), flags MRF rejection risk and battery/e-waste hazard surcharges, and optimizes collection routes from bins at or above 65% fill using nearest-neighbor construction followed by bounded 2-opt local improvement. Exports RFC-4180 CSV and JSON ledgers. Built on deterministic sample presets (no server or vision model needed).

How we built it

TypeScript, Vite, SVG canvas maps, and Vitest. npm test passes 25/25 tests across 3 suites (contaminationAuditor.test.ts 9, routeOptimizer.test.ts 9, auditLedger.test.ts 7, 81 assertions total, 456 ms) covering the 12% MRF threshold, battery hazard surcharges, 2-opt improvement steps, Haversine distance, and malformed-number guards.

Challenges we ran into

The initial 8-page PDF deck export uses lightweight 15.8 KB rasters so it opens cleanly in browsers, while the 1200x800 thumbnail and 1280x800 console screenshots provide crisp gallery inspection. Emission estimates use EPA-WARM-inspired class factors and 2.68 kg CO2e per liter of diesel.

Accomplishments that we're proud of

  • 25/25 Vitest tests passing on contamination rules, MRF rejection cliff (35% efficiency above 12%), and 2-opt route length reduction (12-bin preset: 44.27 km static -> 32.00 km smart, saving 12.27 km / 27.7% and 5.15 L diesel).
  • Deterministic 14-truck annual ROI simulator matching code and console byte-for-byte.
  • Narrated 1080p YouTube demo walkthrough: https://www.youtube.com/watch?v=KxDzU-mpCJE

What we learned

Putting the contamination rule, battery hazard ledger, and fill-threshold route optimizer in a single screen connects material recovery loss and wasted truck miles side by side.

What's next for SortLedger AI

Higher-resolution vector slide export and optional sensor/weight telemetry ingestion while keeping the deterministic audit core.

Built With

Share this project:

Updates

Submission history