evomimic / map-holons

3 stars 1 forks source link

Implement RemoveRelatedHolons Dance #95

Closed evomimic closed 1 month ago

evomimic commented 4 months ago

Summary

This enhancement adds the "_remove_related_holons_" dance to the Uniform API. This dance is a CommandMethod that stages (but does not commit) removal of one or more holons (specified by their HolonReferences) from the specified relationship_name for the specified source holon. As a result of this dance, the editable_collection within the RelationshipTarget for the specified relationship should be modified to reflect the removal of the specified holons.

Dependencies

None

Current State of Native Functionality:

Proposal

For reference, I've included a diagram illustrating the Uniform API architecture.

image

Enhance Native Functionality

_In the stagedreference.rs file:

pub fn remove_related_holons(  
    &mut self,  
    context: &mut HolonsContext,   
    relationship_name: RelationshipName,
    holons: Vec<HolonReference>,  

) -> Result<Self, HolonError>

_HINT: Use the implementation of add_related_holons as a template._

Dance Enhancements

_In the holon_dance_adapter.rs file:_

/// *DanceRequest:*
/// - dance_name: "remove_related_holons"
/// - dance_type: CommandMethod(StagedIndex) -- identifies the holon that is the `source` of the relationship being navigated
/// - request_body:
///     TargetHolons(RelationshipName, Vec<HolonReference>),
///
/// *ResponseBody:*
/// - Index(StagedIndex) -- index for the staged_holon for which related holons were removed
///   
///

In the dancer.rs file:

_In the dance_response.rs file:_

Sweetest Testing Enhancements

_implement a new test_remove_related_holons.rs file:_

_In the test_data_types.rs file:_

_In the dance_fixture.rs file:_

_In the dance_tests.rs file:_

Tryorama Tests

Definition of Done:

evomimic commented 3 months ago

To be complete, we should test that AFTER commit the source holon does NOT have relationships populated for the related holons that were removed. But this requires the get_related_holons dance is which not available until Issue #84 is completed.

nphias commented 1 month ago

tryorama tests left for another issue.. as mutiple api changes .. restructure needed