Skip to content

API Reference parrot.integrations.devloop.registry

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.devloop.registry

View source

RunRecord registry — memory + Redis mirror (spec §3 Module 7, §7 "Registry keys").

Alias RunRecord

Re-exported from parrot.integrations.devloop.models.RunRecord.

Class RunRegistry

Keys: hash {ns}:runs:{run_id} (field record = RunRecord JSON) and set {ns}:runs:live.

Parameter Type Default Description
redis Any
retention_seconds int
namespace str 'devloop'

Method RunRegistry.save

Save a run record — memory first, then Redis.

Redis errors are logged, never raised: the in-memory copy is authoritative for the running bot (spec §7 "Registry keys").

save(record: RunRecord) -> None

Parameter Type Default Description
record RunRecord The record to persist.

Method RunRegistry.get

Look up a record — memory hit first, else the Redis hash.

get(run_id: str) -> Optional[RunRecord]

Parameter Type Default Description
run_id str The run to look up.

Returns: Optional[RunRecord] — The record, or None if unknown anywhere.

Method RunRegistry.list_for

Return every known record whose requester matches actor.

list_for(actor: str) -> List[RunRecord]

Parameter Type Default Description
actor str A Requester.actor string (e.g. slack:T1:U1).

Returns: List[RunRecord] — Matching records, newest (started_at) first.

Method RunRegistry.live

Return every live (non-terminal) record.

Missing hashes (expired/evicted) are dropped with a warning rather than raising — used by the service's re-attach on start (spec §7 "Re-attach on start", AC13).

live() -> List[RunRecord]

Returns: List[RunRecord] — The live records.

Method RunRegistry.mark_terminal

Remove run_id from the live set and expire its hash.

The in-memory copy is kept (so /devloop status still shows it until the process restarts).

mark_terminal(run_id: str) -> None

Parameter Type Default Description
run_id str The run to mark terminal.

Method RunRegistry.peek

Synchronous, memory-only lookup (FEAT-555 TASK-3204).

Safe to call inside a Slack 3s ack / trigger_id window, where an await on Redis would be too slow or simply unnecessary — the service always save()s to memory first.

peek(run_id: str) -> Optional[RunRecord]

Parameter Type Default Description
run_id str The run to look up.

Returns: Optional[RunRecord] — The record if held in memory, else None (never hits Redis).

Method RunRegistry.all_records

Every record currently held in memory (FEAT-555 TASK-3204).

all_records() -> List[RunRecord]

Returns: List[RunRecord] — All in-memory records, in no particular order.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally