Documentation
¶
Overview ¶
Package review records a person's verdict on the answers the bot composed in shadow mode, which is what stands between shadow mode and posting (spec 0010 D12, spec 0023).
It reads the answers pkg/respond records and owns only the verdicts. Deciding that the answers are worth posting is left to the person reading the tally: nothing here lifts shadow mode (0023 D7).
Index ¶
Constants ¶
const Target = 30
Target is how many reviewed answers to real questions 0010 D12 asks for before shadow mode can be lifted (R-ANS-18).
Variables ¶
var ( // ErrNotReviewable is returned for an answer that cannot take a verdict: // posted, over budget, expired, or not there at all (0023 D3). ErrNotReviewable = errors.NewSentinel("review.not_reviewable", "review: not a reviewable shadow answer") // ErrCitationsUnjudged is returned when an answer with citations is given // no verdict on them (0023 D5). ErrCitationsUnjudged = errors.NewSentinel("review.citations_unjudged", "review: the answer's citations need a verdict") // ErrNoCitations is returned for a citation verdict on an answer that has // none to judge (0023 D5). ErrNoCitations = errors.NewSentinel("review.no_citations", "review: the answer has no citations to judge") )
Functions ¶
Types ¶
type Item ¶
type Item struct {
AnswerID int64
// Question is the question as stored, redacted. Empty, with QuestionExpired
// set, once the question's retention has passed.
Question string
QuestionExpired bool
Posture respond.Posture
Title string
Body string
Cited []answer.Citation
RecordedAt time.Time
// Posted reports whether the answer reached the channel, rather than
// being composed in shadow mode (0025 D8).
Posted bool
}
Item is one answer as the reviewer sees it (0023 D4).
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue walks the reviewable answers, oldest first.
Each Next reads the database afresh rather than a list taken at the start, so an answer serve records mid-review joins the end (0023 D9). Skips live on the Queue and nowhere else: a new run offers them again.
func (*Queue) Exclude ¶
Exclude marks an answer as not counting, for a replayed benchmark or calibration question (0023 D5). It is never offered again.
func (*Queue) Next ¶
Next returns the oldest reviewable answer not skipped in this run, or false when none is waiting.