evomimic / map-holons

3 stars 1 forks source link

Implement DeleteHolon dance (undescribed) #75

Closed evomimic closed 3 days ago

evomimic commented 4 months ago

Summary

This enhancement adds the _delete_holon_ dance to the Uniform API. This dance deletes an existing holon from the persistent store. In the absence of descriptors that can specify the DeletionSemantic, this enhancement will adopt Allow as a default policy. When we have RelationshipDescriptors, we can use their properties to drive a richer range of deletion behaviors.

NOTE: This enhancement implements an immediate delete. We may want to consider staging holons for deletion and postponing the actual deletion until commit. This would allow the cascaded effects of the delete to be determined and shared with the agent, leaving them free to cancel the deletion if desired. A staged deletion process would be more consistent with the staged creation process.

Dependencies

None.

Current State:

The holons zome already includes a native delete_holon method in the holon.rs file and a delete_holon_node function generated by the holochain scaffolding tool in holon_node.rs.

Proposal

Native Functionality

_In the holon_error.rs file within the Holons zome:_

    #[error("You must remove related holons from (0} relationship before you can delete this holon."]
    DeletionNotAllowed(String),

In the holon.rs file:

Dance Enhancements

_In the dance_request.rs file:_

_In the holon_dance_adapter.rs file:_

/// *DanceRequest:*
/// - dance_name: "delete_holon"
/// - dance_type: DeleteMethod(HolonId)
/// - request_body: None
///   
///
/// *ResponseBody:*
/// None
///

In the dancer.rs file:

_In the dance_response.rs file:_

Testing Enhancements

_Add a new test_delete_holon.rs file:_

Add a test_delete_holon test step:

_In the test_data_types.rs file:_

_In the dance_fixtures.rs file:_

IGNORE THE FOLLOWING TESTS FOR NOW THEY ONLY APPLY TO BLOCK POLICY _- [ ] Define a new delete_holon_blocked test case. Test that the system blocks deletion of a holon that has any outbound relationships populated.

_In the dance_tests.rs file:_

Definition of Done:

evomimic commented 4 weeks ago

I just edited this issue to change the default DeletionSemantic from Block to Allow. View version history to see prior version of this enhancement.