GatherBite started as a 24-hour build at the SMCS x PEI IT Alliance hackathon during PEI Tech Week. On LinkedIn I described it as "an AI agent that plans a group food order, has another agent independently verify it, and gets the cart ready while leaving the final purchase to you."
Most of that line holds up. The cart part needs an asterisk, and I'll get to it. The git history has the real timeline: a fresh Next.js app at 1:52 p.m. on August 14, a first prototype by 7:27 p.m., a rebuild around Domino's overnight, and the last feature commit at 12:19 p.m. the next day.
Why group orders are harder than they look
Ordering pizza for six people sounds like a chore, not a problem. Then two of them are vegetarian, one is vegan, you have $80, and the store may or may not still be taking orders.
Each one is a hard constraint. GatherBite counts three slices per person, so six people need 18 slices. The vegetarians need six slices from pizzas that are actually vegetarian, and the vegan's slices can't be the same slices the vegetarians are counting on. If you add up compatible pizzas one group at a time, you can count the same pizza twice. So the dietary check runs a small max-flow algorithm (Edmonds-Karp) that gives every slice to at most one group.
A language model is good at proposing an order that fits all that, and bad at confirming one. Nothing stops it from saying the vegetarians are covered when they aren't.
A model shouldn't approve its own work
So the main rule is that the part that proposes an order never approves it. There are three layers.
The Planner is a tool-calling agent (the Vercel AI SDK's ToolLoopAgent)
with exactly two tools. One returns live store, menu, and deal data from
Domino's public ordering endpoints for two stores near Charlottetown. The other
sends a candidate order to verification. Its prompt says outright that its own
prose has no approval authority.
The deterministic checks are plain TypeScript. For each candidate they
produce six results: menu integrity, dietary coverage, serving capacity,
budget, store availability, and delivery serviceability. Each one is PASS,
FAIL, or UNKNOWN, with the facts behind it. No model is involved.
The Verifier is a separate agent run. It never sees the Planner's
reasoning, only the candidate's ID and that evidence bundle. Its answer has to
fit a Zod discriminated union: APPROVE, or REJECT with one of three next
steps (ADAPT_ORDER, TRY_ANOTHER_STORE, TERMINAL), plus exactly one short
reason. Anything else fails the schema and counts as a verifier error, not an
answer.
Then a small guard function runs after the Verifier. If the model says
APPROVE but any of the six checks isn't PASS, the guard throws the approval
out. It can veto an approval. It can't create one or turn a rejection into
one.
One correction to my own README: its diagram puts the deterministic gate after
the Verifier and points at verify.ts, which belongs to the earlier Little
Caesars prototype. In the Domino's path, the checks run before the Verifier and
the guard runs after it.
What each layer catches, and what it doesn't
The best example is a bug fixed in the hackathon's last hours.
A pizza line in a candidate can set cheeseCode: null, which means "no
cheese." Say the Planner marks a cheeseless pizza as protecting a vegan group.
The dietary check looks at the components the pizza has, and with no cheese
there's nothing dairy to flag.
But nothing proved the cheese was actually removed. Domino's live menu lists
cheese as a default on that product. The fix (commit 960414c) makes the
menu-integrity check compare a "removed" component against the product's live
defaults. If the default includes cheese and the candidate says it's gone, menu
integrity comes back UNKNOWN instead of PASS. A test with a vegan group
and a cheeseless pizza checks exactly that.
So the guard blocks the approval even if the model approves. The dietary check alone would have missed it. That's why the layers look at different things.
The layers also miss some things. The dietary data is a hand-transcribed table from Domino's Canada nutrition guide, so it's only as good as that table. "Gluten-friendly" means compatible according to that data, not safe for celiac disease. And because the guard already requires six passes, the Verifier model can't approve anything the checks wouldn't. Its real job is narrower than "independent verification" sounds: it can reject, it picks what happens next, and it writes the reason the user sees.
Failing closed, even when it hurts
UNKNOWN is never treated as a pass. A missing price stays null instead of
becoming 0. That rule shapes the deployed app, and the result isn't
flattering.
The deployed version can't approve an order. The budget check needs an all-in
quote with tax and fees for that exact order, and I never had one. The research
notes from the hackathon show Domino's quote endpoint returning a store
connection error and no amounts. So the code sets price evidence to UNKNOWN
on purpose, the budget check is always UNKNOWN, and the guard blocks every
approval. Delivery has the same problem: the address lookup isn't wired up, so
only carryout can pass the serviceability check.
The Planner also sends the whole live catalogue to the model, and my demo runbook records that prompt at about 41,500 tokens, against a free-tier Groq limit of 8,000 tokens per minute. When I sent the runbook's sample request to the live app on November 8, the Planner failed after about a second and no candidate reached verification. The error is redacted on purpose, so the response doesn't say why.
What you see is a "No verified option yet" card, plus a clearly labelled demo mode that replays a reject-then-approve run from test fixtures. I'd rather show that than an approval built on a guessed price.
The cart asterisk
The code has a full cart pipeline. It verifies the selection again against
fresh live data, runs the cart step, compares the real cart against the
approved order field by field, then verifies the real cart a second time. Only
that path can report PREPARED_AND_VERIFIED. If the cart step claims that
status by itself, the code treats it as a contract violation.
But I couldn't create a real Domino's cart or hand a session over during the hackathon. So production is locked to a "guided handoff": you get the exact store, deals, and pizza setup to copy, and a button that opens Domino's. The before-and-after cart checks are tested against a fake browser driver. They have never run against a real Domino's cart. No code enters payment details or places an order.
Bounded retries
The Planner gets at most two first candidates and one adapted version, and the
adapted one is only allowed after a REJECT with ADAPT_ORDER. Verification
stops after three attempts, two approvals, or a TERMINAL rejection. The
request has a 15-second deadline on the default Groq path. Live data calls
retry once, only for errors that look temporary. A rejection is an answer, not
an error, so it never triggers a retry.
What I'd do differently
- Filter the catalogue in code before the Planner sees it. Sending every product and topping is what blew the token limit.
- Find a real quote source first. Nothing can be approved without one.
- Try a different model for the Verifier. Both agents default to
openai/gpt-oss-120b, so "separate" means separate calls with separate context, not a second opinion. The repo has an eval script for comparing verifier models, but I haven't recorded a result from it. - Find out whether the Verifier model earns its place. The checks could pick the next step themselves. My guess is that the model's value is the plain-language reason, but I'd want to measure that.
How it was built
I used Claude Code as my main coding assistant, working from a design spec and
a task plan that are both in the repo under docs/. I'm writing it up to make
sure I can explain every layer myself.
The source is on GitHub. The hackathon deployment is still up. Expect the "No verified option yet" card, or open the demo.