Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock Platform (in-process)

Deterministic mock app APIs for large-scale agent task evaluation. Everything runs in-process with a single ToolRegistry entry point, a logical Clock (no real sleeps), snapshot-capable InMemoryStateStore, and tools for contacts, messaging, memo access, and admin controls.

Requirements

  • Python 3.11+
  • No network calls; all state is local and JSON-serializable.

Install

python -m pip install -e .

Run the examples

python examples/message_sending.py
python examples/message_memo.py
  • message_sending.py sends "Let us meet up at 3 pm today" to Anders, advances the logical clock by 500ms, and reads back the delivered message.
  • message_memo.py searches for the "Decision" memo, reads its content, and texts it to Anders.

Core concepts

  • ToolRegistry.call(tool_name, args, ctx) -> ToolResult: single entry point with uniform error handling.
  • ToolContext: user_id, trace_id, now_ms (via the logical Clock), plus shared InMemoryStateStore for session isolation.
  • Clock: now_ms() and advance(ms); advancing triggers scheduled events (e.g., message delivery).
  • InMemoryStateStore: per-session state with snapshot() and restore() using deep copies.
  • Seed data: contact Anders (contact_id="anders", e164="+15550001111"); memo "Decision"; admin.reset restores seeds per session.
  • Tools:
    • contacts.search, contacts.get
    • messaging.send_text, messaging.get_message, messaging.list_messages
    • memo.list_memos, memo.search, memo.get_memo
    • admin.reset, admin.set_delivery, admin.set_rule (reserved for fault injection)

The memo mock is content-agnostic; all interpretation is performed by the agent.

Testing

Tests use pytest:

python -m pip install -e ".[dev]"
python -m pytest

About

a mock of MobileSafetyBench

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages