3.8 KiB
3.8 KiB
AI Checkpoint — cg.cx Refinement Pass
Phase
ALL BATCHES COMPLETE. Refinement pass finished. No blockers.
Final State
cargo check --workspace✅ passescargo test --workspace✅ passes (0 tests, all crates compile)- Frontend
npm run build✅ passes - All 10 batches implemented, verified, and merged.
Completed Work Summary
Batch 1 — Security + Stability
- B:
/get_idextended to channels (msg.chat.is_channel()) - C:
/helpHTML parse errors fixed (<arg>→[arg]) - E:
/blacklist_uidand/whitelist_uidrestricted to configured admin groups + admins - I: HEAD requests no longer consume auto-destroy views in
serve_file
Batch 2 — Misc Report Section
- Backend:
POST /api/content/:cxid/reportendpoint added to server reqwestadded tocgcx-server/Cargo.toml- Server seeds web-reporter user (id=0) to satisfy FK constraint
- Frontend: Direct report wired to API; hardcoded
harmfulmeowbotreplaced with dynamicBOT_USERNAME
Batch 3 — Password/Autodestroy + UX
- Homepage password flow fixed:
fetchMetadatanow passes password; 401 handled correctly (needsPassword = trueor "Incorrect password.") - Removed redundant
verifyPasswordcall fromHome.svelte
Batch 4 — Submission/Review Batching + Hardening
- Existing batching logic verified correct
- Fixes applied:
serve_raw_filenow increments views (mirrorsserve_file)- Approval caption truncated to 1024 chars
- Video/audio sent as native
InputMediaVideo/InputMediaAudio
Batch 5 — Review Action Buttons
- Verified:
[ Ban ],[ Blackl. ],[ Ban/BL u. ]present in review keyboard - Verified: handlers for
ban,blk,banblk,approve,ignoreall work with permission checks
Batch 6 — GLOBAL_BAN
- Verified:
GroupsConfig.global_banconfig option present - Verified:
propagate_punishmentchecks flag and propagates to all known chats
Batch 7 — Upload Privacy + Metadata
- Verified:
show_authortoggle in upload options - Verified: metadata bar in
ViewContent.svelteshows date, size, author hyperlink
Batch 8 — Deduplication + Hash Blacklist
- Verified:
plaintext_hashcomputed, dedup lookup works, ref_count incremented - Verified:
HashBlacklistRepoblocks re-uploads withBlockedHasherror
Batch 9 — Username Tracking
- Verified:
UserRepo::ensure_existslogs changes to configurableuname_changes_path
Batch 10 — Homepage Bot Link + Docs
- Q: Bot link reordered between Content ID field and "-- cannibal girls --" subtitle
- Q: Link color changed to
var(--retro-accent)(very dark green) - P:
docs/API.md,docs/COMMANDS.md,docs/MODERATION.md,README.mdall updated
Files Touched in This Pass
crates/cgcx-server/src/main.rs— view increment, report endpoint, web user seedcrates/cgcx-server/Cargo.toml— reqwest dependencycrates/cgcx-bot/src/main.rs— channel support, help escaping, admin-group gates, media types, caption truncationfrontend/src/routes/Home.svelte— password flow, report wiring, bot link reorderfrontend/src/lib/api.js— API_BASE exportdocs/API.md,docs/COMMANDS.md,docs/MODERATION.md,README.md— documentation updates
Known Limitations (Not Fixed in This Pass)
- Zero test coverage across the workspace.
- Memory usage: Forward approval/review decrypts entire files into memory (
decrypt_bytes+InputFile::memory). Large files risk OOM. - TOCTOU race: Concurrent requests to
serve_filecan overserve pastmax_viewsby 1. - Multi-file view counting: Each file request increments
view_count, so multi-file content with lowmax_viewsmay become unavailable before all files are viewed.
Blockers
None.
Next Step
None — refinement pass is complete. Future work (if any) should start from this checkpoint.