Skip to content

Extend IClusteringModel trait with compute_entity_assignments() #71

@rebelmachina

Description

@rebelmachina

Epic: #64 (AffinityEngine)
No dependencies — can be done independently

What

Add a per-entity assignment method to IClusteringModel in crates/arcane-core/src/clustering_model.rs:

fn compute_entity_assignments(
    &self,
    view: &WorldStateView,
) -> std::collections::HashMap<Uuid, Uuid> {
    std::collections::HashMap::new()
}

Key design decisions

  • Default implementation returns empty map — RulesEngine compiles without changes
  • &self not &mut self — matches existing trait constraint
  • Entities not in the map retain current assignment (diff semantic)
  • Exists for testing, benchmarking, and future ClusterManager evolution

Changes

  • crates/arcane-core/src/clustering_model.rs — add method to trait (line ~78)
  • No changes to arcane-rules (default impl covers it)
  • No changes to arcane-infra (ClusterManager continues calling evaluate())

Acceptance criteria

  • Method added with default implementation
  • cargo build --workspace passes
  • cargo test --workspace passes (existing tests unaffected)

Spec

See arcane-engine repo: in_08_05_trait_extension.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions