evomimic / map-holons

3 stars 1 forks source link

Implement accessor methods on Holon for descriptor and predecessor #143

Open evomimic opened 1 month ago

evomimic commented 1 month ago

This enhancement replaces the descriptor and predecessor fields on Holon with accessor functions (get/with).

For testing reasons, it is recommended this issue be worked in a subbranch of Issue #118.

Dependencies

Current State

Both of the fields above are, at best, caches of relationships whose source of truth is in the holon's _relationshipmap. The DESCRIBED_BY relationship relates a holon with its type descriptor and the PREDECESSOR relationship relates a holon to its predecessor.

Proposal

  1. Drop the descriptor and predecessor fields from Holon.
  2. Add get_descriptor and get_predecessor methods to HolonReference
  3. Add with_descriptor and with_predecessor methods to StagedReference

In holon.rs

In holon_reference.rs

Implementation Notes:

Both of the above should:

In staged_reference.rs

Implementation Notes:

Testing

These methods will NOT be exposed as separate dances as they are really just guest-side convenience functions. Thus, they cannot be tested directly via dance tests. However, they can be tested indirectly as part of Issue #118.

Definition of Done

evomimic commented 1 month ago

@dauphin3 hey zeek... the above design references the CoreSchemaRelationshipTypeName::Predecessor.to_string() name which I later realized I hadn't yet defined. I added it to PR #146 which I just pulled into main. You can grab crates/coordinator/core_schema/src/relationship_type_loader.rs from main to give you access to that name in your branch.

evomimic commented 1 month ago

@dauphin3 : I intend to resolve the circular dependency problem in a separate issue. Please just use the hard-code relationship names in #143 to bypass the issue and unblock your progress towards completing this issue.