Inspiration

A useful shopping suggestion is only the first step. Checkout also needs an exact total, an explicit choice and trustworthy evidence of what happened. CartGuard explores that boundary for a small, single-merchant catalog: local AI ranks options, while deterministic controls and PayPal sandbox verification govern checkout.

What it does

Describe a need such as a comfortable headset for long video calls, set a maximum total and quantity, and compare eligible fictional products. Real CPU MiniLM embeddings rank descriptions; a labelled TF-IDF baseline provides a comparison. Code enforces price, quantity and stock independently of relevance.

Review a server-calculated ten-minute quote and approve its exact amount. CartGuard creates a real PayPal sandbox order and opens hosted approval. Return alone never means payment. After capture, a server-side full-order read must match the bound order, CAPTURE intent, quote references, exact USD amount/currency and one final COMPLETED capture before SQLite records PAID and displays the receipt. No real goods or funds are involved.

How we built it

Node.js 24, a local HTTP server, SQLite, Transformers.js 4.3.1 and pinned q8 all-MiniLM-L6-v2 ONNX weights. The four unmodified model assets are bundled with Apache-2.0 attribution and SHA-256 checks. Inference uses local files only, with remote model access disabled and no paid AI endpoint.

PayPal Orders create/capture/status calls run only against the sandbox host. Credentials/tokens stay in server memory; the connection form clears immediately. Exact Host/Origin checks, an HttpOnly session cookie and HMAC CSRF tokens protect mutations. Quote and operation identities persist before provider calls. Unknown outcomes remain unresolved until reconciled; there is no real fulfillment.

What actually worked

Two genuine sandbox captures completed on October 25, 2026. The recorded run is order 3JR416104F576222F, capture 0ND61345NK317822H, USD 69.00. Its receipt survives reload. The earlier completed receipt survived an actual server restart. Failed/expired test orders remain separate and are never presented as successful payments.

On 32 frozen agent-authored synthetic relevance queries, MiniLM top-1 was 30/32 versus 16/32 TF-IDF; nDCG@5 was 0.9707 versus 0.6770. Four additional no-eligible cases passed, with zero tested budget/stock violations. Two relevance disagreements remain documented. These are engineering measurements, not independent user labels or customer impact.

47 automated tests pass, including fixture provider failures, process-exit recovery and database concurrency. These simulated failure tests are separate from actual successful PayPal calls and do not establish provider idempotency retention or production reliability.

Challenges and lessons

Actual testing exposed a Strict-cookie session loss on the hosted approval return. Lax allows the normal top-level return GET while retaining Origin/CSRF checks on mutations. A fresh real checkout then passed.

A clean source extraction also exposed a failed first model download. Bundling the exact licensed assets removed that runtime dependency. The repackaged source was freshly extracted and installed: all 47 tests passed, and real browser-driven inference succeeded without a model download. The bundled-model evaluation preserved the frozen benchmark results.

Keeping relevance, eligibility, consent and payment evidence visible made the implementation easier to inspect. The prototype does not prove real-world suitability, compatibility, fraud reduction, conversion improvement or universal exactly-once processing. There are no customer interviews or human-labelled evaluation results.

Run it and inspect the evidence

The public repository contains the complete runnable source ZIP, a visible MIT license, checksum manifest and judge quickstart. Download and extract the ZIP, then run npm ci --no-fund --no-audit, npm test and npm start in its cartguard-ai folder. Open http://127.0.0.1:8765/ in a desktop browser. Model weights are bundled; npm installation still needs internet. The browser picker rejected a directory upload, so the public repository clearly explains this archive distribution. Its downloaded ZIP matches the independently tested package byte-for-byte.

AI search and quote inspection need no payment account. For independent actual payment testing, connect your own authorized Sandbox app through the local memory-only setup page and use an existing sandbox buyer or the offered official synthetic guest test flow. No credentials, cookies, database, node_modules, private research or account pages are shipped. No paid hosting or live-money transaction is required. Complete instructions and free access will remain available through the stated judging period.

Original work and assistance

The event-local application, synthetic catalog and evaluation were created October 25, 2026. No code was copied from another competition. Pro/agents assisted concept selection, implementation, evaluation labels and documentation under the human's delegation; the human did not personally author or review every artifact. The final supplemental Pro reply failed to load, so the official-source release review was agent-led fallback, not Pro-reviewed. Application code is MIT; model/dependency licenses and attribution are retained. CartGuard is not affiliated with or endorsed by PayPal.

Built With

Share this project:

Updates

Submission history