CREATE TABLE IF NOT EXISTS agent_compression_lock (
    session_id UUID PRIMARY KEY REFERENCES agent_session(id) ON DELETE CASCADE,
    holder TEXT NOT NULL,
    acquired_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    expires_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_compression_lock_expires
    ON agent_compression_lock(expires_at);
