Sync repo to deployed state: SEO recovery, Publishing Desk, Play games, emoji picker
The deploy pipeline runs from the working tree, so a wave of shipped features
had never been committed. This snapshots git to what's actually running.
SEO impression recovery (live + verified):
- Duplicate /a/{id} now 301-redirect to their canonical twin instead of 404
(a hard 404 silently dropped already-indexed URLs and tanked impressions).
- Dedup representative selection reworked: accepted/serveable -> established
rep (URL stability) -> quality score, so an accepted page never retires to a
rejected rep and an indexed canonical doesn't churn when a newer twin arrives.
- HEAD /a/{id} returns the same status as GET (api_route GET+HEAD) instead of
falling through to the static mount and 404ing.
- `dedup --force-recluster`: cycle-locked, model-free re-cluster to re-apply the
policy to the existing corpus (shared cycle_lock context manager).
- CLI honors GOODNEWS_DB for its default --db (was silently ignored).
Publishing Desk (admin tool to post highlights to X via Web Intents):
- publishing.py queue/rank/handle-resolution; admin UI; full searchable emoji
picker (bundled data, no CDN) for the blurb editor.
Play games + site:
- Bloom (word-wheel), Memory Match, daily ritual set, Zen Den (dev-gated).
- English-only language gate; source prospecting; paywall + dedup hardening.
Tests: full suite green (349). Ignores tightened (node_modules, data/*.db).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from goodnews.sources import (
|
||||
list_candidates,
|
||||
promote_candidate,
|
||||
reject_candidate,
|
||||
restore_candidate,
|
||||
save_candidate,
|
||||
)
|
||||
|
||||
@@ -32,6 +33,18 @@ def test_re_preview_preserves_curator_status(conn):
|
||||
assert list_candidates(conn)[0]["status"] == "rejected"
|
||||
|
||||
|
||||
def test_restore_sends_rejected_back_to_staging(conn):
|
||||
save_candidate(conn, "http://x/feed")
|
||||
cid = list_candidates(conn)[0]["id"]
|
||||
reject_candidate(conn, cid)
|
||||
assert list_candidates(conn)[0]["status"] == "rejected"
|
||||
# restore → back to staging ('suggested'), re-enters the pending queue
|
||||
assert restore_candidate(conn, cid) is True
|
||||
assert list_candidates(conn)[0]["status"] == "suggested"
|
||||
# restoring a non-rejected candidate is a no-op (only un-rejects)
|
||||
assert restore_candidate(conn, cid) is False
|
||||
|
||||
|
||||
def test_promote_creates_inactive_source_and_marks_promoted(conn):
|
||||
cand = save_candidate(conn, "http://x/feed", name="Lovely Feed")
|
||||
source_id = promote_candidate(conn, cand["id"]) # inactive by default
|
||||
|
||||
Reference in New Issue
Block a user