module

Feed::Judging

The synchronous judging entrypoint.

Given a feed: fetch its candidates, judge them via the feed's backend, write verdicts, and after each write explicitly reconcile the feed's view for that object.

Invariant: a judge pass must not yield to another fiber between candidate selection and its last verdict write. A criteria edit deletes the feed's verdicts (see Feed#before_update); a verdict written after that delete from a stale in-flight pass would survive as apparently current, and candidates with verdicts are never re-judged.

Constants

Log = ::Log.for(self)

Instance methods

backfill(feed : Feed, cursor : Int64 | Nil, limit : Int32, floor_id : Int64 | Nil = nil) : Batch

Judges one batch of a feed's unjudged candidates, newest first.

Writes a verdict only for posts the feed includes. An excluded post therefore stays a candidate. Skipping excluded verdicts keeps the backfill from writing a row for every post the server has ever held, for every feed.

Source
judge(feed : Feed, limit : Int32 | Nil = nil, match_limit : Int32 | Nil = nil) : Int32

Judges a feed's unjudged candidates, most recently arrived first.

limit caps how many candidates are scanned; match_limit stops the scan early once that many matches have been found. A verdict is written for every candidate scanned (included and excluded alike).

Returns the number of candidates scanned.

Source
judge_arrival(object : ActivityPub::Object) : Nil

Judges a single object against every registered feed, writing (or refreshing) each feed's verdict.

Source
rejudge_contents(source : Feed, target : Feed) : Int32

Re-judges the objects a feed currently contains under another feed's criteria, seeding the survivors into the target feed.

Used at the publish transition so editing a feed's criteria no longer discards its accumulated contents.

Returns the number of survivors seeded.

Source

Nested types