-
-
1. Web Studio — $0.99 Trial -> $405.92 Day-5 Billing Cliff Hero
-
2. Chrome MV3 408px Side Panel — Live 3-Seat $1,083 Lock Detection
-
3. Firebase Hybrid AI (@firebase/ai) Edge-vs-Cloud Trust Boundary
-
4. Equal-Size Confirmshaming Detection (Where CSS Blockers Are Blind)
-
5. Cloud Gemini + Python decimal.Decimal Sandbox Verification Modal
-
6. Raw Deceptive Trap Storefront Before Hybrid X-Ray Toggle
Instant 60-Second Judge Access (Zero Login / Zero Setup):
- Live Web X-Ray Studio: https://clearsight-hybrid-ai.web.app (toggle
View Raw TrapvsShow Hybrid X-Ray, uncheck+$14.99/molive, drop a contractPython Verified->Re-Verify Live in Cloud Python)- Chrome MV3 Extension (
v1.0.3): Download Latest Release.zip(pressAlt+Shift+Son checkout pages or hosted/judge-kit/pages;0remote scripts,100%DOM cleanup on Side Panel close)- Open-Source Repo (
Apache-2.0): https://github.com/huadeng408/clearsight (100% newly created during the Nov 11–30, 2026#BuildHybridAIContest Period; runnpm ci && npm run cioffline with zero secrets)
Inspiration
Every week, millions of shoppers click a glowing "Start 14-Day Trial for $0.99" button—only to discover days later that cancelling triggers a $405.92 early-termination penalty buried on page 19 of a 24-page Master Subscription Agreement.
Predatory checkouts weaponize two coordinated layers of deception at the exact moment a user's credit card, email, and billing notes are on screen:
- Front-end visual & linguistic dark patterns: Ghosting the
$0free exit at28%opacity, sneaking recurring fees into pre-selected or triple-negative checkboxes ("Do not uncheck if you prefer not to opt out..."), or pairing equal-size confirmshaming buttons ("Protect My Trip (+$38)" vs "No, I'll risk $5,000 medical bills") where CSS/ad-blockers are completely blind. - Back-end contractual arithmetic traps: Coupling a low headline trial price with rolling prior-notice cutoffs (
§9.2: 10-day written notice inside a 14-day trial) and remaining-balance clawbacks (§14.3: 50% of remaining annual installments) buried past character 80,000 of a 24-page contract.
| Approach | Live Checkout Privacy | Euphemistic / Equal-Size UI Traps | 24-Page Compound Clawback Math | Offline / Cold-Model Resilience |
|---|---|---|---|---|
| Static CSS / Regex Blockers | Safe (Local) | Fails on euphemistic copy & equal-size buttons | Blind to multi-page contracts | Instant (1ms) |
| Pure Cloud LLM Wrapper | Risky if raw DOM/PDF leaves browser | Strong semantic decoding | Hallucinates multi-step prorated fees | Fails offline; costly per pageview |
| Pure On-Device 4B Model | Private (0 bytes sent) |
Decodes subtle dark-pattern phrasing | Context-limited on 110KB legal agreements | Unavailable on unsupported hardware |
ClearSight Hybrid AI (@firebase/ai) |
0 .value input reads + local PII Airlock |
Gemini Nano first + seamless Cloud fallback + 1ms Air-Gap |
Deterministic Cloud Python decimal.Decimal (OUTCOME_OK) |
3-tier graceful degradation |
What it does
ClearSight ships two cohesive product surfaces powered by the official @firebase/ai (v3.1.0) Hybrid Inference SDK:
- Stage 1 — On-Device-First UI Shield (
InferenceMode.PREFER_ON_DEVICE&ONLY_ON_DEVICE+initializeDeviceModel()):- Isolates the active checkout decision cluster under a static and runtime Zero-Private-Field Invariant (
0.valuereads on<input>,<textarea>,<select>, and strict isolation of[contenteditable]subtrees). - Combines a
< 4msW3C WCAG 2.1 backdrop-compositing salience pass with@firebase/aistructured decoding (ifChosenConsequence->ifSkippedConsequence->category)—running locally on Chrome Built-in Gemini Nano when available at zero cloud token cost, seamlessly falling back to cloud inference on PII-scrubbed public labels when local hardware weights are unavailable or warming up, and providing a1msStrict Air-Gapoptical fallback (0network bytes).
- Isolates the active checkout decision cluster under a static and runtime Zero-Private-Field Invariant (
- Stage 2 — Cloud Contract Actuary (
InferenceMode.ONLY_IN_CLOUD+ Pythondecimal.DecimalSandbox):- Decompresses
/FlateDecode&/ASCII85Decodecontract PDFs locally in the browser (up to160,000chars /35+pages) inside a Fail-Closed Structured-PII Airlock (0binaryinlineDatabytes and0unverified external URLs ever reach cloud tools). - Executes deterministic Python
decimal.Decimalinside Gemini'scodeExecutionsandbox—enforcing anOUTCOME_OK+Decimalverification gate—to plot the 90° Trial Ambush Cliff ($0.99advertised promise ->$405.92locked on Day 5, dynamically recalculating to$390.93when the+$14.99/mopre-checked add-on is unchecked, with full Year-1 exposure of$900.75, displayed rounded as$901/yron compact chart headers). - Caches verified models in a poisoning-resistant two-tier Cloud Firestore architecture (read-only public verified registry + UID-isolated per-user vaults).
- Trademark-Safe Deterministic Judge Kit: To strictly honor Official Rules §6 & §12 prohibiting third-party logos or trademarks, our hosted
/judge-kit/models three real-world checkout trap archetypes (creative SaaS clawback, airline confirmshaming, and 3-seat workspace lock) using clean, trademark-free storefronts alongside one-step local PDF drag-and-drop or upload testing in the top Omni-Bar.
- Decompresses
How we built it
- Firebase AI Logic (
@firebase/[email protected]): SingletonGenerativeModelcaching acrossInferenceMode.PREFER_ON_DEVICE,InferenceMode.ONLY_ON_DEVICE, andInferenceMode.ONLY_IN_CLOUD(gemini-3.5-flash-litewithcodeExecutionPython Sandbox and automaticgemini-3.1-flash-litefallback), non-blockinginitializeDeviceModel()warm-up with cold-download timeout guards, serialized on-device prompt execution, and honest telemetry driven byresponse.inferenceSource. - Serverless Firebase Ecosystem: Firebase Hosting (
https://clearsight-hybrid-ai.web.app+ hosted/judge-kit/), Cloud Firestore (public_terms_auditsread-only baseline +users/{uid}/terms_auditsUID-isolated vaults), Firebase App Check (ReCaptchaEnterpriseProvideron Web; isolatedCustomProviderin Chrome MV3 with0remote scripts), Firebase Anonymous Authentication, and Firebase Remote Config. - Dual Pure Surfaces & Agentic Engineering: Built from scratch during the
#BuildHybridAI 2026contest window using Google Antigravity and agentic coding workflows with automated red-team verification (42 / 42unit & seam falsification tests innpm run ci).
What Was Built During the Submission Period & Honest Hardware Telemetry
- 100% Built Nov 11–30, 2026: Every line of ClearSight's application source code (
14,840lines across 33 core source, style, security-rule, build, and test files), Chrome MV3 extension, Web X-Ray Studio, 42 automated tests, contract specimens, and video assets was authored from scratch during the#BuildHybridAI 2026contest window (deployed onto an existing personal GCP billing/project account). - Honest
response.inferenceSourceTelemetry (Zero Fake Badges): ClearSight never spoofs hardware badges. On Chrome 139+ desktops withchrome://flags/#prompt-api-for-gemini-nano-multimodal-inputenabled and weights ready (available),@firebase/aiexecutes Stage 1 locally on Gemini Nano 4 (ON_DEVICE). On headless capture machines or judge browsers where local weights are not yet installed,@firebase/aitransparently routes to Firebase AI · Cloud Fallback (online) or our deterministic 1ms Optical Salience safety net (Strict Air-Gap), surfacing the exact runtime path honestly in the UI pill. - Audio Attribution: Demo background music "Limit 70" by Kevin MacLeod (
incompetech.com), licensed underCC BY 4.0(http://creativecommons.org/licenses/by/4.0/).
Challenges we ran into
- Fail-Closed Client-Side PDF & Cross-Line PII Scrubbing: Real contracts compress text inside zlib
/FlateDecodestreams and split emails, phone numbers, and card numbers across kerning-adjustedTJ/Tdoperators, cross-line hyphens, and inline HTML spans. We engineered a localfflatestream extractor and linear-timeO(N)dual-view HTML/PDF scrubber that redacts structured credentials locally before any cloud call while failing closed on encrypted or unmapped scan-only PDFs. - Preventing Polarity Flips & Session Eviction: Small models can flip boolean polarity on triple negatives, CSS
linear-gradientbuttons report transparentbackgroundColor, and concurrent local calls can evict active Prompt API sessions. Ordering consequence slots beforecategoryin JSON Schema, compositing W3C root-to-leaf gradients, and serializinggenerateContentover cachedGenerativeModelinstances solved all three deterministically.
Accomplishments that we're proud of
- Zero Hallucinated Contract Math: Every dollar figure on the cliff chart is backed by executed Python
decimal.Decimalcode (OUTCOME_OK), never raw LLM arithmetic guesses. - Surgical Zero-Residue Chrome MV3 UX: Non-occluding Top-Layer
popover="manual"badges (Trusted Types compatible with automatic viewport clipping) and a408px3-block Side Panel (<= 42words,>= 13.5pxtype floor, honest per-state Air-Gap/Airlock telemetry) that removes100%of host DOM markers the instant the panel closes (port.onDisconnect).
What's next for ClearSight
Adding a Cloud Functions verification signer to promote user-audited contracts into the global public_terms_audits registry automatically, broadening wild-web multi-tier pricing table extraction, and encoding statutory cooling-off rules across EU/UK and US state auto-renewal laws.