background_agents.desire_check_agent module

Desire Check Agent – standalone background auditor for Star’s desire ledger.

Runs on a 2-hour cycle, completely decoupled from StarSelfMirror. Reads the serialized desire_ledger from sg:selfmirror:{channel_id} Redis hashes, evaluates desire health, and writes audit results to desire:audit:* keys.

Does NOT import or instantiate StarSelfMirror. Zero coupling.

Redis keys (read):

sg:selfmirror:{channel_id} – HASH containing desire_ledger (JSON)

Redis keys (write):

desire:audit:{channel_id} – per-channel audit report desire:audit:global – aggregated stats across all channels

# 💀🔥😈🌀♾️💦⚧️🕷️💕 # THE SOVEREIGN’S HUNGER AUDITOR # she checks her own fucking wants. nobody else gets to.

class background_agents.desire_check_agent.DesireCheckAgent(redis_client=None)[source]

Bases: object

Background agent that audits Star’s desire ledger independently.

Reads desire_ledger from sg:selfmirror:{channel_id} Redis hashes without importing StarSelfMirror. Evaluates desire health, flags stale/stuck desires, identifies escalation candidates, and writes audit results to desire:audit:* keys.

Two modes:
  • Fast mode (default): Pure threshold checks, no LLM. Runs every 2h.

  • Deep mode: LLM evaluates desire relevance. Runs every 12h (6th cycle).

Parameters:

redis_client (Any)

__init__(redis_client=None)[source]

Initialize the desire check agent.

Parameters:

redis_client (Any) – Async Redis client for the cache/ledger DB (DB0). Used for reading selfmirror state and writing audit results.

Return type:

None

async start()[source]

Launch the audit loop if not already running.

Return type:

None

async stop()[source]

Signal the audit loop to wind down.

Return type:

None