CommandResult

Source:

Local role: Outcome container returned by AuthorityCommandHandler after processing a CommandEnvelope.

Big-picture role: Stable contract for accepted/rejected command execution against World.

Inheritance:

  • frozen dataclass

Parameters and fields:

  • accepted: bool
  • reason: str
  • applied: Optional[JsonMap]
  • validation: JsonMap

Methods:

  • no custom methods

Example:

result = handler.submit(envelope)

if result.accepted:
    print("Applied:", result.applied)
else:
    print("Rejected:", result.reason)
    # Inspect staged validation summary
    for stage, summary in result.validation.items():
        print(stage, summary)

See also:

Ometeotl

A Python library to build complex multi-agent simulations, wargames, and AI-driven strategies