debate_worker_reap
- Category: debate
- Access: write
- Audience: internal (ordinary users do not normally call this directly)
Purpose
Retires completed worker claims older than a cutoff, leaving history evidence behind. The retention janitor for the claim surface.
Arguments
Required: topic_id, older_than_ts.
-
topic_id: existing debate topic. Note: Topic whose completed claims are swept. -
older_than_ts. Note: Strict ISO-8601 UTC cutoff; only completed claims past it retire.
Result
Object with topic_id, topic_state, reaped entries, and count. Retired claims persist as retired with evidence, never vanish.
Boundaries
Only caller-visible claims in the named topic are eligible; foreign topics answer without disclosure. Active claims are never touched by the reap.
Lifecycle / side effects
Each retirement is a lifecycle transition to retired with an audit/history event. Completion timestamps are kept as evidence.
Errors
Malformed ids or timestamps are rejected; unknown topics answer uniformly. Failures retire nothing.
Example
{
"older_than_ts": "2026-09-01T00:00:00Z",
"topic_id": "<uuid>"
}
Result shape:
{
"count": 0,
"reaped": [],
"topic_id": "<uuid>",
"topic_state": "ACTIVE"
}
See also
debate_worker_claim, debate_worker_no_action, debate_worker_recover_stale, debate_message_claim_reclaim, debate_state.