<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: wahaj ansari</title>
    <description>The latest articles on DEV Community by wahaj ansari (@wahajansari08).</description>
    <link>https://dev.to/wahajansari08</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4218063%2Fc17ae2ed-c6d4-4e40-bfe7-1eb0e1dcfc50.jpg</url>
      <title>DEV Community: wahaj ansari</title>
      <link>https://dev.to/wahajansari08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wahajansari08"/>
    <language>en</language>
    <item>
      <title>FinePrint Phantom: Summon the Clauses Hiding in the Fine Print</title>
      <dc:creator>wahaj ansari</dc:creator>
      <pubDate>Sat, 31 Oct 2026 00:14:35 +0000</pubDate>
      <link>https://dev.to/wahajansari08/fineprint-phantom-summon-the-clauses-hiding-in-the-fine-print-3n8h</link>
      <guid>https://dev.to/wahajansari08/fineprint-phantom-summon-the-clauses-hiding-in-the-fine-print-3n8h</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Nobody reads the Terms of Service. That is not an insult; it is a design feature. Eight thousand words of legalese stand between you and the streaming service, and somewhere around word three thousand — long after your eyes glaze over — the document quietly changes character. It stops describing the product and starts describing what the company may do to you: sell your viewing history, track you across the web, take away your right to sue, renew itself forever, keep your data after you delete your account.&lt;/p&gt;

&lt;p&gt;Every agreement has a ghost in it. &lt;strong&gt;FinePrint Phantom&lt;/strong&gt; is the séance.&lt;/p&gt;

&lt;p&gt;You give it a Terms of Service or privacy policy — a URL, the pasted text, or the built-in sample — and it reads the &lt;em&gt;whole&lt;/em&gt; document, end to end, and returns a &lt;strong&gt;haunting report&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the scariest clauses, &lt;strong&gt;quoted verbatim&lt;/strong&gt; (the Phantom is forbidden from paraphrasing a quote or inventing one),&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;plain-English explanation&lt;/strong&gt; of what each clause means on your worst day, not your average one,&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;scariness score from 1–10&lt;/strong&gt; for each haunting,&lt;/li&gt;
&lt;li&gt;and an overall &lt;strong&gt;Haunt Score from 0–100&lt;/strong&gt; with a one-line verdict.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The theme asked for a ghost in the machine. Mine was already there, hiding in section 7(b). The Phantom just turns the lights on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://fineprint-phantom.vercel.app" rel="noopener noreferrer"&gt;https://fineprint-phantom.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try the built-in sample first — the fictional "Streamly" terms, haunted on purpose. The sample earns a Haunt Score of 100 in demo mode: a perpetual, irrevocable license to everything you upload; your data sold to brokers; binding arbitration with a class-action waiver; deletion that deletes nothing. Every one of those clause types is modeled on language that really appears in real consumer terms — Streamly is fictional, its clauses barely are.&lt;/p&gt;

&lt;p&gt;A note on honesty: if the live demo is running without an API key when you visit, it says so. The app has a clearly labeled &lt;strong&gt;Demo mode&lt;/strong&gt; in which a built-in heuristic engine reads your actual document and quotes only real clauses from it. Nothing is silently faked — a tool that exists to expose hidden fine print should not have any of its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/wahajansari08/fineprint-phantom" rel="noopener noreferrer"&gt;https://github.com/wahajansari08/fineprint-phantom&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;FinePrint Phantom is a Next.js app whose analysis is a genuine &lt;strong&gt;Mastra workflow&lt;/strong&gt; — not one giant prompt, but three composed steps with validated hand-offs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prepare.&lt;/strong&gt; The document is chunked paragraph-by-paragraph (about 3,500 characters per passage). If a document has too many chunks, they are &lt;em&gt;sampled evenly across the whole text&lt;/em&gt; rather than truncated at the front — because the arbitration and termination clauses live at the back, and a tool that only reads the first half of a contract is a tool that misses the point.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extract.&lt;/strong&gt; A Mastra &lt;code&gt;Agent&lt;/code&gt; — the Phantom, whose instructions amount to "read like a careful friend, quote only verbatim, judge by the worst day" — reads each chunk and returns candidate clauses as JSON: quote, category, explanation, scariness. Every response is parsed defensively and validated; malformed entries are discarded, never rendered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compose.&lt;/strong&gt; The agent dedupes and ranks the candidates and writes the verdict. The &lt;strong&gt;Haunt Score itself is never generated&lt;/strong&gt; — it is computed by deterministic arithmetic from the individual scariness ratings (the three scariest hauntings dominate; breadth adds a little). The model finds and explains; arithmetic decides. That separation is deliberate: an LLM asked to "give this document a score out of 100" produces a vibe, and a vibe is exactly what fine print counts on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The model is &lt;strong&gt;GPT-OSS 120B&lt;/strong&gt;, an open-weight model, served through Groq's free tier and reached through Mastra's model router, so swapping providers is a configuration change, not a rewrite. URLs are fetched server-side, stripped to text, and capped at 60,000 characters with a truncation notice shown to the user.&lt;/p&gt;

&lt;p&gt;There is deliberately &lt;strong&gt;no database&lt;/strong&gt;. The documents are analyzed in memory and discarded. A tool that reads privacy policies for a living has no business keeping copies of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Because this tool only works if it can be trusted, and it can only be trusted if it can be inspected.&lt;/p&gt;

&lt;p&gt;A closed API could summarize a contract for you — and you would have to take its word for what it found, what it skipped, and what it quietly sent home. FinePrint Phantom is built the other way: an open-weight model whose behavior anyone can test, an open-source agent framework whose workflow anyone can read, prompts and scoring arithmetic that live in the same public repo as everything else. The Haunt Score formula is twelve lines long and printed in the README. If you think a clause was scored unfairly, you can point to the exact line of code that did it.&lt;/p&gt;

&lt;p&gt;Open weights made this buildable at all: a solo developer can run a 120-billion-parameter open-weight model over a full legal document for effectively nothing, which means the tool can be free, account-less, and storage-free — no sign-up wall standing between a person and the contract they are about to accept. The most one-sided documents on the internet are agreed to by people who were never really given a chance to read them. Open AI is how you hand the reading back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Spirit of It
&lt;/h2&gt;

&lt;p&gt;The moment it landed for me was the sample run. I had written the Streamly terms to be bad — I knew every clause in them — and the report still gave me a small chill: ten hauntings, laid out in a row, each one quoting my own document back at me in plain sight. &lt;em&gt;You grant a perpetual, irrevocable license. We may sell your personal information. You waive any right to a jury trial.&lt;/em&gt; I wrote those sentences as fiction and they still read like a warning, because they are one: versions of them are sitting, unread, inside the agreements most of us accepted this month. The ghost was never in the machine. It was in the contract — the machine just finally read it aloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Overall&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Mastra&lt;/strong&gt; — the analysis is a registered Mastra agent running a three-step workflow (chunk → extract → compose) over an open-weight model, with structured validation between steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The app is deployed on Vercel as its production home.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
