Goals and specs

0 — Purpose

P — Principles

A — Axioms

G — Game Theory

F — Functional Requirements

V1 priority

V1 must first demonstrate the system core with a reduced but complete scope: abstract core, canonical serialization, validation, minimal generation, and projection into game theory. The goal is to validate the end-to-end chain before adding mathematical refinements, more sophisticated solvers, or advanced features.

V1 priorities

  1. Abstract core of the model objects.
  2. Canonical JSON + YAML.
  3. Base-level full validation system.
  4. Minimal contextual generation.
  5. Minimal game-theory interface.
  6. Two examples: a simple world and a hierarchical multi-actor case.

Current repository state (June 2026)

The repository now contains a broader functional V1-incremental core spanning model, perception, projection, strategy, and authority/runtime boundaries.

04/25/26 - major architectural overhaul: Local tests reveal the current architecture is too abstract for any practical implementation. It has been decided to :

Implemented and tested now

  1. Core object model in src/ometeotl_core/model/:
    • ModelObject, GenericObject, Actor, Resource, Space, World.
    • WorldModelRegistry and reconstruction helpers.
  2. Spatial structures:
    • SpaceObjectGraph and SpaceObjectMembership.
    • SpaceRelation, SpaceRelationType, and SpaceRelationGraph with canonicalization and relation constraints.
  3. Actor hierarchy and abstraction:
    • Composition modes and explicit component relations on actors.
    • Cycle detection, tree resolution, parent lookup, and abstract hierarchy helpers.
    • Abstract spaces through Space.is_abstract.
  4. Perception layer:
    • Perception, PerceivedSpace, PerceivedMembership, PerceivedRelation, PerceivedComponentLink.
    • Epistemic status validation and deterministic serialization of perceived structures.
  5. Sensor pipeline:
    • CoverageRule and NoiseRule abstractions.
    • TotalCoverageRule and IdentityNoiseRule defaults.
    • Timestamp-aware and deterministic perception id behavior.
  6. Projection and strategy layers:
    • ProjectionAssumption, ProjectedPerceptionChange, ProjectedPerceptionState, ActionProjection, ProjectionBatch.
    • DefaultProjectionTool, Strategy, StrategyNode, StrategyOutcomeBranch, StrategyBuildStep.
    • build_linear_strategy(...) and build_branching_strategy(...) builders driven by projected successor perceptions; projected states carried by StrategyOutcomeBranch, enabling one action to emit distinct outcomes per branch.
  7. Teleology and utility layers:
    • Goal, GoalBuildStep, GoalDecompositionTree.
    • GoalFeasibilityTool, DefaultGoalFeasibilityTool, GoalAdmissibilityChecker.
    • UtilityFunction, UtilityFrame, WeightedSumUtility, LexicographicUtility, StrategyRanker.
  8. Core runtime infrastructure:
    • AuthorityCommandHandler, CommandEnvelope, CommandResult, AuditEntry.
    • RuntimeContext and build_runtime(...).
  9. Validation layer in src/ometeotl_core/validation/:
    • Validation contracts and staged pipeline.
    • Validator families: syntactic, structural, temporal, spatial, admissibility, epistemic, completeness.
    • Policy profiles: observe_only, enforce_structure, enforce_domain.
    • Diagnostics and repair suggestions.
  10. IO layer in src/ometeotl_core/io/:
    • Canonical JSON and YAML world export (world_to_json, world_to_yaml, write_world_json, write_world_yaml).
    • Validated world import (world_from_json, world_from_yaml, WorldImportResult).
    • LLM/SLM view exporter (llm_export.py): world_to_llm_view, actor_to_llm_view, perception_to_llm_view, and ModelObject.to_llm_view() with explicit reality/perception/belief/hypothesis/projection separation.
  11. Generation layer in src/ometeotl_core/generation/:
    • GenerationContext declarative input dataclass with nested child contexts, placement instructions, constraint declarations, and copy_with for rule-safe mutation.
    • ContextualBuilder ABC with concrete builders for all core kinds (world, actor, strategy, goal, perception).
    • Pluggable GenerationRule / GenerationRuleSet / RuleRegistry rule engine with built-in constraint propagation (temporal, spatial, admissibility).
    • LLMGenerationAdapter for optional provider-agnostic LLM-assisted context refinement with fallback.
    • ContextualGenerationPipeline orchestrating rules → build → optional registration → optional validation → GenerationResult.
    • from_context() classmethods on World, Actor, Strategy, and Goal.
    • Four runnable demo scenarios in generation/examples.py.
  12. Spatial foundations layer in src/ometeotl_foundations/spatial/:
    • Coordinate value types: Coordinate2D, Coordinate3D, GeoCoordinate (with range validation), GridCell.
    • Coordinate system vocabulary: CoordinateKind (str enum), CoordinateSystem with to_dict/from_dict, predefined singletons CARTESIAN_2D, CARTESIAN_3D, WGS84, GRID.
    • Structural protocols (runtime_checkable): Geometry, SpatialIndex, SpatialBackend.
    • BoundingBox: pure-Python frozen dataclass implementing Geometry with DE-9IM-correct touches(), contains(), intersects(), distance(), convenience methods (expand, union, from_center, from_point), and to_dict/from_dict round-trip.
    • GeometricSpace[G]: frozen generic dataclass composing a core Space with a concrete geometry; proxy properties (id, kind, is_abstract, dimensions); injected-deserializer from_dict.
    • SpatialExtent[G]: frozen generic dataclass recording an object’s footprint/position within a named coordinate frame; injected-deserializer from_dict.
    • SpatialMap[G]: mutable generic container (CRUD + O(n) spatial queries ids_containing_point, ids_intersecting); subclassable for index-backed overrides.
    • derive_space_relations(): bridge function that derives a SpaceRelationGraph from geometry comparisons (containment → intersection → adjacency, with skip_abstract, adjacency_tolerance, and per-relation-type flags).
  13. Quality gate:
    • Automated tests across tests/ometeotl_core/ and tests/ometeotl_foundations/spatial/.
    • Current baseline: 586 collected tests.

Still incomplete or planned

Current TODO priorities

  1. Implement ometeotl_foundations/networks/ (graph-theory specialization layer).
  2. Implement ometeotl_adapters/spatial_shapely/ (Shapely-backed SpatialBackend + SpatialIndex).
  3. Add a full generation roundtrip integration test covering the complete chain: context → pipeline → generated objects → IO export → to_llm_view() → parse → validate. Add a concrete 2-actor game scenario wiring goals, strategies, and utility ranking end to end.
  4. Extend the game layer beyond the current utility/ranking primitives with solver-facing structures.
  5. Extend examples/ with additional end-to-end demo worlds beyond the existing lab series.

Ometeotl

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