DiscoverMakersCommunitySubmit tool
Submit project
WhatWeMade

Open-source and AI-assisted projects, and exactly how people made them. Free for makers, forever.

Or choose topics. Unsubscribe any time.

Buy me a coffee

Explore

  • Projects
  • Makers
  • Websites

Community

  • Discussions
  • Build week
  • Guidelines
  • Newsletter

For makers

  • Submit a project
  • Publish with your agent
  • Asset pack prompt
  • Build recipe prompt
  • Template prompt
  • whatwemade.json
  • Marketplace

About

  • How it works
  • How we review
  • How ranking works
  • Contact
© 2026 whatwemade.appPrivacyCookiesTermsTakedownsMade with Claude Code

Explore

Prompts and workflows

Check AI-generated evidence quotes before they reach a report

JLJerry Lin6 days ago0

When a model labels a comment as a buying question, I want the reviewer to see the words that triggered the label. A model can also return a plausible paraphrase, or pick a phrase that appears twice. I tried a small check that treats those as two different review states.

I assign the comment ID before the model runs and ask it for a short verbatim quote. I look up the original by that ID, reject unknown IDs, then run this check on the unedited text:

function locateQuote(text, quote) {
  if (typeof quote !== "string" || !quote.trim()) return { status: "missing" };
  const start = text.indexOf(quote);
  if (start < 0) return { status: "missing" };
  if (text.indexOf(quote, start + 1) >= 0) return { status: "ambiguous" };
  return { status: "matched", start, end: start + quote.length };
}

With invented inputs, “buy it” matches once in “🙂 Can I buy it here?” and returns [9, 15). Those are JavaScript UTF-16 offsets, so use the same string and slice convention to highlight them. “yes” is ambiguous in “yes, yes”; a longer exact quote can disambiguate it. “Can we buy it?” is missing from “Can I buy it?”. In the last two cases I would ask for review instead of showing a confident highlight.

An exact match verifies the quote, not the label. A person still decides whether the excerpt actually supports the category. It also helps to keep normalization, redaction, and translation out of this particular match; those can change offsets.

Disclosure: I help maintain AI TikTok Analyzer Pro. AI helped draft this post. This is a tested synthetic example, not a claim about a shipped feature.

Replies

3 comments

Sign in to join in. A kind word or a good question goes a long way.

  • Christian Werther5 days ago

    Thanks for sharing this, Jerry. Your code block was showing as plain text with the backticks, sorry about that. Code blocks show properly now.

    • JL
      Jerry LinMaker5 days ago

      Thanks for fixing the rendering. I checked the same page while signed out: it now shows a code block. I copied the snippet from the page, confirmed it matches the original, and reran the five synthetic cases in Node. All five passed, including the overlapping match in “aaaa”. AI helped draft this reply.

      • Christian Werther4 days ago

        No worries, thanks for sharing.