Skip to content

ClusterManager: party_assignments field + set_party_assignments() #114

@rebelmachina

Description

@rebelmachina

Part of epic #112.

Depends on: nothing — standalone change in arcane-infra.

Change

All changes in crates/arcane-infra/src/cluster_manager.rs and src/lib.rs:

1. Add field to ClusterManager:

party_assignments: HashMap<Uuid, Uuid>,  // entity_id → party_id

Initialised to HashMap::new() in all constructors. Default behaviour: all party_id fields remain None — zero behaviour change for existing code.

2. Add method:

pub fn set_party_assignments(&mut self, assignments: HashMap<Uuid, Uuid>)

3. One-line change in run_evaluation_cycle() when building PlayerInfo:

// Before:
party_id: None,
// After:
party_id: self.party_assignments.get(&entity_id).copied(),

4. Export set_party_assignments is automatically available — no lib.rs change needed since ClusterManager is already re-exported.

Acceptance criteria

  • All existing arcane-infra tests pass unchanged
  • Test D: two entities registered under the same party UUID via set_party_assignments appear with matching party_id in the WorldStateView.players seen by the model
  • Entity not in party_assignments has party_id = None in PlayerInfo
  • ClusterManager::with_defaults() and ClusterManager::new() initialise party_assignments as empty (existing behaviour unchanged)
  • cargo test -p arcane-infra passes
  • cargo clippy -- -D warnings passes

Spec

See §4.7, §5.2 in demo_agent_group_behaviour.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