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 HighlightScanner scan

From Leeroopedia
Knowledge Sources
Domains Simulation
Last Updated 2026-10-26 18:00 GMT

Overview

Concrete highlight trigger scanner that mirrors ConsequenceScanner's trigger logic but emits admin-scoped highlight events instead of executing effects, for dashboard and narrator observation.

Description

The HighlightScanner.scan() method evaluates config-defined highlight triggers each tick. It uses the same trigger logic as `ConsequenceScanner` (on_change / every_tick, entity vs global) but produces highlight events (admin-scoped, dashboard-only) instead of executing effects.

Highlights surface important world events to the dashboard and narrator without affecting regular agent perception. They are recorded to the stream for replay.

Usage

Import this class to scan for highlights. 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/highlight_scanner.py

Signature

class HighlightScanner:
    def __init__(
        self,
        config: SceneConfig,
        store: StateStore,
        event_log: EventLog,
        recorder: RunRecorder | NullRecorder | None = None,
    ) -> None: ...

    def scan(self, tick: int) -> None:
        """Evaluate config-defined highlight triggers each tick."""

Import

from worldseed.engine.highlight_scanner import HighlightScanner

I/O Contract

Inputs

Name Type Required Description
tick int Yes Current tick number

Outputs

Name Type Description
(mutation) EventLog Highlight events appended (admin scope)

Usage Examples

from worldseed.engine.highlight_scanner import HighlightScanner

scanner = HighlightScanner(config, store, event_log, recorder=recorder)

# Scan each tick
scanner.scan(tick=5)

Related Pages

Implements Principle

Requires Environment

Page Connections

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