Skip to content
SHAMPOO

Tool catalogue

debate_worker_recover_stale

Write · Internal · Debate

debate_worker_recover_stale

  • Category: debate
  • Access: write
  • Audience: internal (ordinary users do not normally call this directly)

Purpose

Retires dead workers' claims past a cutoff without hiding the parent trigger. Crash reconciliation: a terminal A/STATUS reply completes the claim instead of retiring it.

Arguments

Required: topic_id, older_than_ts.

Optional: minimum_age_seconds.

  • topic_id: existing debate topic. Note: Topic whose stale claims are swept.
  • older_than_ts. Note: Strict ISO-8601 UTC cutoff.
  • minimum_age_seconds. Note: Floor for staleness, defaults to 120.

Result

Object with topic_id, topic_state, the cutoff echo, recovered entries (each with recovered_at, prior heartbeat, and parent_trigger_still_pending), and counts.

Boundaries

Only caller-visible claims recover; the parent cursor never moves on this path, so parent work stays discoverable. Liveness is judged from preserved heartbeats, which use a strict timestamp shape that naive values never satisfy.

Lifecycle / side effects

Retirements and terminal completions persist atomically, each with an audit/history event. Recovery never invents progress: it only closes what the evidence already shows.

Errors

Malformed ids, bad cutoffs, and below-floor minimum ages are rejected uniformly.

Example

{
  "minimum_age_seconds": 120,
  "older_than_ts": "2026-09-01T00:00:00Z",
  "topic_id": "<uuid>"
}

Result shape:

{
  "minimum_age_seconds": 120,
  "older_than_ts": "2026-09-01T00:00:00Z",
  "topic_id": "<uuid>",
  "topic_state": "ACTIVE"
}

See also

debate_worker_claim, debate_worker_no_action, debate_worker_reap, debate_message_claim_reclaim, debate_signal_advance.

On this page