feat(view): surface classifier reasoning instead of an 'AI slop' verdict#133
feat(view): surface classifier reasoning instead of an 'AI slop' verdict#133realitymatrix wants to merge 1 commit into
Conversation
…rdict
The /view page asserted a quality judgment ("some form of AI slop ...
you should probably not use it"), but the classifier only sets
isAiRelated on a keyword match and never evaluates quality. Its
reasoning string was computed at ingest and then discarded.
- persist `reasoning` (the model's own explanation) on Post
- analyzePosts now returns { isAiRelated, reasoning }; ingest stores both
- /view shows "Flagged as AI-related" + the model's reasoning, with an
honest fallback for rows analyzed before the field existed
No reporting/appeal flow, per maintainer. `reasoning` is nullable, so
existing rows are unaffected; run `pnpm db:push` to apply the schema.
Closes Hacksore#132
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@realitymatrix is attempting to deploy a commit to the Hacksore's Team Team on Vercel. A member of the Team first needs to authorize it. |
|
Tested this locally end-to-end before handing it over, in case it saves you a review pass. Reproduced the deploy against a throwaway Postgres ( The migration is a safe additive change — the generated DDL is just: ALTER TABLE "Post" ADD COLUMN "reasoning" TEXT;Nullable, no default → metadata-only on Postgres (no table rewrite, no blocking lock); existing rows get
One path I couldn't exercise live: the ingest cron writing a reasoning string from an actual Gemini call (needs your Deploy note: needs Happy to tweak the warning-block copy if you'd word it differently — trivial change. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I was looking at prod logs and saw it's unable to pull in all the changes so I'd say let me get #136 shipped and prod data loading again. Then we can get this deployed, thanks for the help here! |
Fixes #132.
Problem
The
/viewpage renders a quality verdict — "This product is some form of AI slop and you should probably not use it" — wheneverhasAiis true. But the classifier (prompt.txt) only ever setsisAiRelatedon a keyword match; it never assesses quality. Thereasoningit produces (which terms it matched) was logged at ingest and then discarded. So the UI asserted a judgment the model never made — a false positive on legitimate AI products.Change
Surface the model's actual reasoning instead of the verdict (option 1 from the issue; no reports/appeal flow, per your comment):
schema.prisma— addreasoning String?toPost(nullable; existing rows unaffected).ai-analyzer.ts—analyzePostsnow returns{ isAiRelated, reasoning }; the API-error and parse-error fallbacks write an honest "Analysis unavailable…" reason instead of silently implying slop.ingest-posts/route.ts— persist bothhasAiandreasoning.view/[slug]/page.client.tsx— heading becomes "Flagged as AI-related" followed by the model's reasoning, with a neutral fallback for rows analyzed before this field existed.Deploy note
Needs
pnpm db:push(nullable column, non-destructive). Old rows show the fallback copy until re-ingested; new launches get the reasoning immediately.Verification
tsc --noEmit: cleanbiome check src: clean(
next buildnot run here — it evaluates@/app/envat build and needsDATABASE_URL/GEMINI_API_KEY; types and lint are covered above.)