Inspiration
Sorting recycling at home in Sugar Land is harder than the little triangle on the bottom of a cup makes it look. Drive a few miles down US-59 into Houston and the rules change. Sugar Land takes clean #6 foam at the Fort Bend County Recycling Center on Blume Road. Houston puts #6 foam in the black garbage cart. Yard waste rules differ. Plastic bags jam the sorting machines in both cities, but residents still toss them in.
I built BinCheck because guessing has a physical cost. A half-full bottle is too heavy for the air jet that sorts it. A crushed lithium battery can start a truck fire. I wanted one place where a household can type an item, see the answer for both cities, and see the exact city rule field behind that answer.
Theme fit for Arbiter Hacks
For the Theme track, BinCheck focuses on a real waste problem and measurable evidence. The problem is wish-cycling contamination across Greater Houston. Plastic film jams sorting equipment, liquid-heavy containers miss air jets, lithium batteries create fire risk, and neighboring cities publish different answers for the same carton, cup, or bottle. BinCheck attacks that problem at the moment a resident decides what goes in the cart.
The measurement is deliberately narrow and honest. BinCheck measures agreement with the bundled municipal rules snapshot last checked 2026-10-20, not field accuracy at a real materials recovery facility. The benchmark scores 69 city evaluations, reports agreement on 58 of 58 streams, and validates the barcode math with 3,024 of 3,024 single-digit substitutions and 226 of 245 adjacent transpositions. Every missed transposition is the known GS1 Modulo-10 gap-of-5 blind spot, and the output prints that limitation instead of hiding it.
What it does
BinCheck is a recycling rules engine for Sugar Land and Houston. Type any word, like glass, pizza, battery, or a drink name, and it searches the demo catalog and material categories as you type. Every result leads with a large verdict, Recycle, Trash, Drop-off, Yard waste, or Split it. When the two cities disagree, a banner says so and shows both answers.
Each verdict lists the exact snapshot fields it came from, such as curbsideCartRules.rejectedResins or dropOffCenter.accepts, quoted from the bundled rules file. Each citation is marked as verbatim city text, an applied rule, or an engine estimate.
The workbench adds four heavier tools.
- A contamination calculator that puts up to 5 copies of an item into a cart of up to 40 clean #1 PET bottles and shows how one bad item changes the load.
- A barcode and resin inspector with GS1 check-digit validation and a 0 to 100 risk gauge.
- A batch CSV audit for up to 500 rows and 256 KB, with per-city cart-eligible shares, error rows that are never guessed, and byte-identical CSV or JSON exports.
- A six-profile municipal diff, a five-scenario MRF hazard cascade lab, and a signed JSON, CSV, or Markdown audit with HMAC-SHA-256 and an in-page tamper check.
The app is bilingual in English and Spanish. It works offline. It has a one-page printable kitchen guide in English and Spanish. It has 573 automated tests and 144 documented browser checks.
How I built it
BinCheck is plain JavaScript ES modules, HTML, CSS, and hand-built SVG. No framework, no build step, no API key, no model calls, and no trackers. The page runs under a strict Content-Security-Policy and only loads same-origin files.
The core is a rules engine plus a city snapshot in data/municipal-rules-2026.json, mirrored as an ES module and parity-tested. A separate validator normalizes queries, builds the evidence ladder, and encodes share links. A batch module parses CSV without a library, handles quoted newlines, flags wide rows, and neutralizes spreadsheet formula cells on export. A pure-JavaScript SHA-256 and HMAC module signs audit payloads so the app does not depend on Web Crypto.
The benchmark is built to avoid grading the engine against itself. It first checks that every ground-truth anchor still exists in the rules snapshot, then scores the engine. A tampered-snapshot test proves the anchor guard trips.
The visual system uses large verdict cards, one consistent color and icon per stream, and a print stylesheet that turns the same page into a one-page kitchen guide.
Challenges I ran into
The first challenge was honesty. A rules engine can look perfect if the test cases come from the same person who wrote the rules. I anchored every scored case to a specific field in the city snapshot, kept inferred extensions out of the headline number, and labeled every figure as agreement with the snapshot, not field accuracy at a real facility.
The second was barcode math. GS1 Modulo-10 catches every single-digit error and most adjacent swaps, but it has a known blind spot, two digits that differ by 5. BinCheck catches 226 of 245 transpositions, and every miss is that case. The benchmark prints the limitation instead of hiding it.
The third was bilingual parity. Translation is easy to fake with a half-filled dictionary. I added key-parity tests, Spanish search aliases, localized cascade stages, presets, diff notes, batch tables, and self-test descriptions, while keeping exports and quoted city ordinance text in stable English. A browser audit clicks the toggle, searches in Spanish, checks document.documentElement.lang, and reloads to prove the choice persists.
The fourth was offline. A service worker plus a strict CSP can easily serve a broken cached shell. The audit checks console errors, uncaught exceptions, external requests, and overflow at three viewports.
Accomplishments that I am proud of
- 573 tests pass locally, including planted wrong-answer, tampered-snapshot, and HTML-injection tests.
- 144 browser checks are documented across desktop, tablet, and phone widths.
- The benchmark scores 69 city evaluations with 100 percent routing agreement against the bundled snapshot, 58 of 58 streams, and 3,024 of 3,024 single-digit barcode errors.
- The Spanish build has 588 keys against 588 English keys, with parity guards.
- One page prints as a kitchen guide in either language.
- The whole app runs offline with no dependency and no network calls after first load.
What I learned
Confidence and correctness are different things. BinCheck drops confidence when a barcode fails its check digit or when the inputs contradict each other, but that confidence describes how sure the app is about what the item is, not how sure it is that a city rule is right. I also learned that a city rule is not a vibe. If I cannot point to a field or a quoted line, the answer belongs in the estimate bucket.
What is next
Next I want to load more Texas cities, add a real household pilot with a measured contamination baseline, add a live source refresh with a visible diff when a city page changes, and improve the camera path so a phone can scan a barcode without a third-party library.
AI tools used
I used AI coding assistants while building and reviewing this project. The shipped app makes no model calls and sends no data anywhere.
Honest scope disclosure
The benchmark measures agreement with the bundled municipal rules snapshot, last checked 2026-10-20. It is not field accuracy at a real facility. No household pilot has been run. The four archetype profiles are labeled illustrations, not cities. Cascade downtime and yield figures are planning values, not facility measurements. The audit signature is a self-check integrity tag with a key bundled in the app, not a third-party certificate.
Live app and public source
Try the live app at https://aariv.me/bincheck/. The public repository is https://github.com/draarivpatel-ui/bincheck.
Built With
- css3
- html5
- javascript
- node.js
- recycling
- sustainability
- web