Remove XGBoost ML + spam scorer; add image-aware AI curation #93

Manually merged
marvin8 merged 33 commits from feat/issue-80-collect into main 2026-08-15 00:20:19 +00:00
Collaborator

Collecting branch for the AI-curation rework: replaces Fenliu's XGBoost ML model and rule-based spam scorer with a two-stage AI classifier that checks post text for promotion and the image for a real cat.

Sub-PRs merged into this branch:

  • PR #81 — remove XGBoost ML + spam scorer; add AI text/vision classifiers
  • PR #86 — inline vision classification instead of the Batch API
  • PR #88 — review filter fixes
  • PR #89 — reconcile models with DB + fix test-isolation flakiness
  • PR #90 — rename reviewer_notes to auto_reject_reason
  • PR #92 — remove stale review.html template
  • PR #95 — wire AI auto-reject into the fetch flow
  • PR #98 — classify posts on manual fetch paths

Closes #80
Closes #82
Closes #83
Closes #84
Closes #85
Closes #87
Closes #91
Closes #94
Closes #96

Collecting branch for the AI-curation rework: replaces Fenliu's XGBoost ML model and rule-based spam scorer with a two-stage AI classifier that checks post text for promotion and the image for a real cat. Sub-PRs merged into this branch: - PR #81 — remove XGBoost ML + spam scorer; add AI text/vision classifiers - PR #86 — inline vision classification instead of the Batch API - PR #88 — review filter fixes - PR #89 — reconcile models with DB + fix test-isolation flakiness - PR #90 — rename `reviewer_notes` to `auto_reject_reason` - PR #92 — remove stale `review.html` template - PR #95 — wire AI auto-reject into the fetch flow - PR #98 — classify posts on manual fetch paths Closes #80 Closes #82 Closes #83 Closes #84 Closes #85 Closes #87 Closes #91 Closes #94 Closes #96
📝 document AI classification and update release notes
All checks were successful
/ pr-review (pull_request) Successful in 7s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ checks (pull_request) Successful in 3m11s
/ gitleaks (pull_request) Successful in 17s
/ deploy-docs (pull_request) Has been skipped
c7cb138ef4
📝 track stale review.html cleanup in TODO
Some checks failed
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ checks (pull_request) Failing after 2m50s
/ pr-review (pull_request) Successful in 8s
/ gitleaks (pull_request) Successful in 21s
/ deploy-docs (pull_request) Has been skipped
fd7669a0eb
♻️ classify images inline instead of via batch API
Some checks failed
/ gitleaks (pull_request) Successful in 17s
/ pr-review (pull_request) Successful in 42s
/ checks (pull_request) Failing after 2m12s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
46ae38a906
🐛 set SECRET_KEY in AI tests to fix flaky app startup
All checks were successful
/ pr-review (pull_request) Successful in 43s
/ checks (pull_request) Successful in 2m13s
/ gitleaks (pull_request) Successful in 2m56s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
0bf8f26c19
🐛 fix AI review filters applying and tidy filter bar
All checks were successful
/ gitleaks (pull_request) Successful in 13s
/ pr-review (pull_request) Successful in 33s
/ checks (pull_request) Successful in 2m23s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
f06605d2cd
🐛 fix checkbox filter value parsing and dropdown width
All checks were successful
/ gitleaks (pull_request) Successful in 16s
/ pr-review (pull_request) Successful in 39s
/ checks (pull_request) Successful in 2m16s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
a56bd6799e
🗃️ reconcile models with DB and drop legacy api_key
All checks were successful
/ gitleaks (pull_request) Successful in 18s
/ pr-review (pull_request) Successful in 36s
/ checks (pull_request) Successful in 2m10s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
d87c9406f3
add schema-reconciliation metadata test
Some checks failed
/ gitleaks (pull_request) Successful in 22s
/ pr-review (pull_request) Successful in 46s
/ checks (pull_request) Failing after 2m14s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
801124a4f5
🐛 fix flaky tests: per-request ContextVar overrides replace patch() isolation
All checks were successful
/ gitleaks (pull_request) Successful in 15s
/ pr-review (pull_request) Successful in 43s
/ checks (pull_request) Successful in 2m19s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
b22895bfa9
App-level tests patched get_db across a module list with process-global
patch(), which tryke's single-process junit reporter exposed as
order-dependent flakiness against the shared module-level in-memory
engine. Replace it with a TestAppWrapper that injects _db_session_override
and _auth_override per request, which get_db() and the UI auth middleware
already consult. Also widen isolated in-memory DB name entropy and drop
test_ui_auth's module-level create_all on the shared engine.
♻️ rename reviewer_notes to auto_reject_reason and drop duplicate
All checks were successful
/ gitleaks (pull_request) Successful in 16s
/ pr-review (pull_request) Successful in 34s
/ checks (pull_request) Successful in 2m15s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
8ab5cc82ef
posts.reviewer_notes was written only by reject_blocked_posts, and
review_feedback.reviewer_notes was a never-read duplicate. Rename the
post field to auto_reject_reason, drop the feedback column, remove the
vestigial PATCH input field, and update the migration, tests, and docs.
🔥 remove stale review.html template
All checks were successful
/ gitleaks (pull_request) Successful in 13s
/ pr-review (pull_request) Successful in 23s
/ checks (pull_request) Successful in 2m21s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
545f0e5e30
The review page renders from liveviews.py (Python-built HTML), so the
804-line templates/review.html was unused. Tick the TODO item.
🔀 Merge branch 'feat/issue-91-remove-stale-review-template' into feat/issue-80-collect
All checks were successful
/ gitleaks (pull_request) Successful in 15s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ checks (pull_request) Successful in 2m47s
/ pr-review (pull_request) Successful in 8s
/ deploy-docs (pull_request) Has been skipped
c0b1eafd1c

This PR is too large to review automatically (14451 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14451 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14451 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14451 lines; limit is 3000). Please consider splitting it into smaller PRs.
wire AI auto-reject into the fetch flow
All checks were successful
/ gitleaks (pull_request) Successful in 19s
/ pr-review (pull_request) Successful in 43s
/ checks (pull_request) Successful in 2m30s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
723a3e0e7e
The ai_auto_reject setting was stored but never consumed. Add
reject_ai_flagged_posts() to reject unreviewed posts the AI would reject
(ai_would_reject=True) when the setting is enabled, and call it in the
scheduler after inline classification.
🔀 Merge branch 'feat/issue-94-wire-ai-auto-reject' into feat/issue-80-collect
All checks were successful
/ pr-review (pull_request) Successful in 9s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
/ checks (pull_request) Successful in 2m39s
/ gitleaks (pull_request) Successful in 16s
dca551f552

This PR is too large to review automatically (14660 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14660 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14660 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14660 lines; limit is 3000). Please consider splitting it into smaller PRs.
classify posts on manual fetch paths too
All checks were successful
/ gitleaks (pull_request) Successful in 17s
/ pr-review (pull_request) Successful in 46s
/ checks (pull_request) Successful in 2m31s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
f2a8e141fe
Extract the scheduler's inline classification into a shared
classify_posts() in services/ai_pipeline.py and call it (plus
reject_ai_flagged_posts) from the manual POST /hashtags/{id}/fetch
endpoint and the review page's _fetch_all_active_streams, so every path
that saves new posts also classifies them.
Signed-off-by: Marvin8 <marvin8@tuta.io>
🔀 Merge branch 'feat/issue-96-classify-manual-fetch' into feat/issue-80-collect
All checks were successful
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
/ checks (pull_request) Successful in 2m44s
/ pr-review (pull_request) Successful in 9s
/ gitleaks (pull_request) Successful in 13s
c592953b0e

This PR is too large to review automatically (14965 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14965 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14965 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (14965 lines; limit is 3000). Please consider splitting it into smaller PRs.
🐛 fix SQLite 'database is locked' under concurrent fetches
All checks were successful
/ gitleaks (pull_request) Successful in 15s
/ pr-review (pull_request) Successful in 34s
/ checks (pull_request) Successful in 2m45s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
5e125affe0
Add a 30s busy_timeout (PRAGMA busy_timeout) on each SQLite connection so
writers wait instead of erroring, and commit the saved posts + deterministic
auto-reject before the slow AI classification in all three fetch paths so
the write lock is released during image download + vision.
🔀 Merge branch 'feat/issue-97-sqlite-locking' into feat/issue-80-collect
All checks were successful
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ checks (pull_request) Successful in 3m36s
/ pr-review (pull_request) Successful in 8s
/ gitleaks (pull_request) Successful in 21s
/ deploy-docs (pull_request) Has been skipped
8128841cc4

This PR is too large to review automatically (15058 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (15058 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (15058 lines; limit is 3000). Please consider splitting it into smaller PRs.

This PR is too large to review automatically (15058 lines; limit is 3000). Please consider splitting it into smaller PRs.
marvin8 approved these changes 2026-08-15 00:19:29 +00:00
marvin8 manually merged commit 645b52db05 into main 2026-08-15 00:20:19 +00:00
marvin8 deleted branch feat/issue-80-collect 2026-08-15 00:21:03 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/dujiangyan!93
No description provided.