Generalize AI classification from cat-specific to domain-agnostic #100
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fenliu's AI classification pipeline is hard-coded to a single use case: curating real-cat photographs and rejecting posts that use a cat as an excuse to promote something. The vision stage asks "is this a real-cat photograph", the text stage asks "is this cat-as-excuse promotion", and those rules are baked into the hard-coded prompts (
TEXT_PROMPT/VISION_PROMPTinservices/ai_classification.py) and the field names (vision_is_real_cat,text_is_promotional).As a result Fenliu can no longer be pointed at any other curation topic without code changes — it went from a generic curation tool to a cat-specific one.
Findings from exploring the AI classification code:
Cat-specificity lives in a few places, not just the prompts:
TEXT_PROMPT/VISION_PROMPTare module-level constants inservices/ai_classification.py; the classifiers reference them directly.vision_is_real_catis the clearly cat-shaped column (a generic name would bevision_accepted).text_is_promotionalis borderline ("promotion" is one specific rule; full neutrality would betext_flagged).derive_ai_would_reject(text_is_promotional, vision_is_real_cat)is already structurally generic (reject = text-flag OR not-vision-accept; "no image → accept"; "unclassified → None"). The only real policy wrinkle is the "no image → accept" default, which a generic tool might want configurable.vision_categoryis a free string. Only the"promotional"fallback literal is cat-adjacent.Proposed decomposition (natural sub-PR sequence on the collecting branch):
vision_is_real_cat→vision_accepted, optionallytext_is_promotional→text_flagged) + one migration + schema-reconciliation test."promotional"badge fallback, docs.Estimate: ~15–20 files + 1 migration total; the effort concentrates in the settings-page UI (multi-line string inputs on a bool-only form) and pinning down the generic semantics, not the renames themselves.
Plan of attack (approved design in
.superpowers/specs/2026-08-21-generic-ai-classification-design.md):feat/issue-100-ai-prompts— prompts become editableapp_settingsrows (ai_text_prompt/ai_vision_prompt) with settings-page textareas; code appends a pinned JSON output contract (keysis_flagged/is_accepted). Classifier classes/verdicts renamed to neutral semantics. No schema change.feat/issue-100-rename-ai-verdict-columns— one migration renamingposts.text_is_promotional→text_flaggedandposts.vision_is_real_cat→vision_accepted; models + REST schema follow.feat/issue-100-ai-badge-and-docs— neutral badge fallback + docs update.Refs #100
Sub-PR 1 #101 (
feat/issue-100-ai-prompts, Tasks 0–5) merged intofeat/issue-100-generic-ai-classification(71d3bd6). Issues: #100 (this one, Refs only).Includes the ci-watch follow-ups: prompt-injection hardening (nonce-tagged delimiting + fail-closed output validation on both stages), call-site policy-loading tests, and release-notes/CHANGELOG wording fixes.
Next: sub-PR 2
feat/issue-100-rename-ai-verdict-columns.Refs #100
Sub-PR 2 #102 (
feat/issue-100-rename-ai-verdict-columns) merged intofeat/issue-100-generic-ai-classification(7ea648e). Issues: #100 (Refs only).Migration
c4e8a1f3b7d2renamesposts.text_is_promotional→text_flaggedandposts.vision_is_real_cat→vision_acceptedacross models/schemas/pipeline, data-preserving with verified downgrade.Next: sub-PR 3
feat/issue-100-badge-and-docs— neutral badge fallback + docs sweep.Refs #100
Sub-PR 3 #103 (
feat/issue-100-badge-and-docs) merged intofeat/issue-100-generic-ai-classification(513be5c). Issues: #100 (Refs only).Neutral badge fallback (
AI: reject — text), docs sweep to neutral field names, configurable-prompts documentation, stale nightly-batch docs removed.All three sub-PRs merged. Running full DoD against the collecting branch, then the final PR into main (carrying
Closes #100).Refs #100
Final PR #104 merged into
main(53415d0); released as fenliu 3.0.0 (major: breaking posts-API rename of the AI verdict fields).Delivered via three sub-PRs (#101, #102, #103) + review follow-ups on the final PR:
ai_text_prompt/ai_vision_promptwith settings-page textareastext_flagged/vision_accepted(migrationc4e8a1f3b7d2)Closing — all scope from the design spec (
.superpowers/specs/2026-08-21-generic-ai-classification-design.md) shipped.