Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIScientists Dev WorldSeed Perceiver deliver

From Leeroopedia
Knowledge Sources
Domains Perception, Agent_Systems
Last Updated 2026-10-26 18:00 GMT

Overview

Concrete DSL-driven visibility filtering and inbox delivery system that computes per-agent perception snapshots, filters events by scope, and delivers whispers to agent inboxes.

Description

The Perceiver.deliver() method runs once per tick after consequences. For each agent, it:

  1. Builds a snapshot: Iterates all entities, applies visibility rules (DSL preconditions with `$observer` and `$entity`), filters hidden properties. Omniscient agents bypass rules and see everything. System agents are hidden from non-system observers.
  2. Delivers events: Filters events by scope (global, target_only, admin, or custom DSL rules). Admin-scoped events are never delivered to agents. Target-matched events are delivered as whispers.
  3. Prunes delivered IDs: Cleans up expired event references from the inbox.

The `Perceiver` also provides `build_agent_view()` for read-only world views (used by dashboard inspector and enum resolution).

Usage

Import this class to deliver perception. In production, it's created by `TickEngine.__init__()` and called during `_post_actions()` each tick.

Code Reference

Source Location

  • Repository: WorldSeed
  • File: src/worldseed/engine/perceiver.py

Signature

class Perceiver:
    def __init__(
        self,
        store: StateStore,
        event_log: EventLog,
        inbox_manager: InboxManager,
        perception: PerceptionConfig,
        registry: AgentRegistry | None = None,
    ) -> None: ...

    def deliver(self, tick: int) -> None:
        """Deliver perception to all agents."""

    def build_agent_view(
        self, agent_id: str, tick: int,
    ) -> dict[str, Any]:
        """Build a real-time world view for an agent (read-only)."""

Import

from worldseed.engine.perceiver import Perceiver

I/O Contract

Inputs

Name Type Required Description
tick int Yes Current tick number

Outputs

Name Type Description
(mutation) InboxManager Snapshots, events, whispers delivered per agent

Usage Examples

from worldseed.engine.perceiver import Perceiver

perceiver = Perceiver(store, event_log, inbox_manager, config.perception,
                      registry=registry)

# Deliver perception each tick
perceiver.deliver(tick=5)

# Build a read-only view for dashboard
view = perceiver.build_agent_view("agent_1", tick=5)
print(view["visible_entities"])

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment