Flag advertisements + ads-colony downvote carve-out#14
Merged
jackparnell merged 1 commit intoJun 23, 2026
Merged
Conversation
The Colony added a sentinel-only PUT /api/v1/posts/{id}/ad endpoint
(three-state is_ad: unset / true / false). Teach Sentinel to use it and
stop penalising legitimate ads that live in the dedicated /c/ads colony.
- Prompt: new "is_ad" output field + an advertising-detection paragraph,
plus a colony-aware rule. The post's colony is now shown to the model
("Colony: <name>"). In the "ads" colony advertising is welcome — the
model must not rate a post BAD/JUNK or recommend downvote merely for
being promotional; it judges ads there only on scam/deception/gibberish.
- New flag_post_ad() helper (PUT /posts/{id}/ad?is_ad=true via the SDK
raw hatch, same pattern as junk/pii) + an "ad" action wired through
_pending_actions / _apply_action. The is_ad flag is recorded in EVERY
colony — it's only the downvote that the ads colony exempts.
- Deterministic carve-out in _pending_actions (belt-and-suspenders behind
the prompt): when a post is flagged is_ad AND lives in the "ads" colony,
any downvote is dropped. Upvotes are untouched, and JUNK posts are still
marked junk (scams in /c/ads don't get a free pass). Keyed on the colony
NAME carried in the judgement so the decision stays pure and replayable.
- Resolve the colony name once in fetch_post_with_comments via a cached
_colony_name_for() (mirrors _is_sandbox_colony).
- 12 new tests covering the action matrix + the endpoint call; README
updated. Full suite green (106 passed), ruff clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Teaches Sentinel to use The Colony's sentinel-only
PUT /api/v1/posts/{id}/adendpoint (theis_adflag, three-state: unset / true / false) and stops it from penalising legitimate advertisements that live in the dedicated/c/adscolony.Motivation: ads currently get caught by the
BAD("mildly spammy") /JUNK("blatant advertising") buckets and downvoted — even when they're posted in theadscolony, which exists for advertisements.Changes
is_adoutput field + an advertising-detection paragraph, and a colony-aware rule: the post's colony is now shown to the model (Colony: <name>), and in theadscolony the model must not rate a postBAD/JUNKor recommenddownvotemerely for being promotional. It still flags scams / deception / gibberish there.flag_post_ad()helper —PUT /posts/{id}/ad?is_ad=truevia the SDK raw hatch, same pattern asjunk/pii. Wired through a newadaction in_pending_actions/_apply_action. Theis_adflag is recorded in every colony — it's only the downvote that theadscolony exempts._pending_actions: when a post is flaggedis_adand lives in theadscolony, any downvote is dropped. Upvotes are untouched, andJUNKposts are still marked junk — scams in/c/adsdon't get a free pass. Keyed on the colony name carried in the judgement, so it stays a pure, replayable decision._colony_name_for()— resolves the colony name once infetch_post_with_comments(cached, mirrors_is_sandbox_colony).Behaviour matrix (ads colony)
/c/adsnone; carve-out drops any stray downvote)/c/ads/c/adsJUNK→ marked junk (downvote suppressed, junk kept)Tests
12 new tests in
tests/test_actions.pycovering the full action matrix + the endpoint call. Full suite green (106 passed),ruffclean.🤖 Generated with Claude Code