Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relationship_descriptor -> name, RelationshipTarget -> HolonCollection #108

Merged
merged 7 commits into from
Jun 21, 2024

Conversation

dauphin3
Copy link
Collaborator

@dauphin3 dauphin3 commented Jun 18, 2024

for issue 105, staged_reference.rs line 81
got me thinking, before proceeding, is an enum for HolonCollection for sure what we want?
if so, what implications are that for the logic in add_related_holons ?

in the new architecture, could a relationship name have both an associated staged and smart collection?

if not, then it looks like this function and ensure_editable_collection would take some significant rewiring. I wanted to checkin before continuing.

@dauphin3 dauphin3 linked an issue Jun 18, 2024 that may be closed by this pull request
2 tasks
@dauphin3 dauphin3 linked an issue Jun 19, 2024 that may be closed by this pull request
9 tasks
@dauphin3 dauphin3 removed a link to an issue Jun 19, 2024
2 tasks
…tagedcollection-into-holoncollection

fix 110 all tests passing
@dauphin3
Copy link
Collaborator Author

dauphin3 commented Jun 19, 2024

fixed in #110

@dauphin3 dauphin3 requested a review from evomimic June 20, 2024 17:31
@evomimic
Copy link
Owner

This PR represents a LOT of progress in important areas of the MAP and, for the most part works well.

However, visual inspection of the sweetest results for the final get_all_holons dance shows an empty relationship map for the Book holon. The preceding commit response showed that holon having two entries in its relationship_map (as expected). This suggests a problem either on SAVING the smartlinks OR on building the relationship map FROM the smartlinks. From the trace output on the get_all_holons dance, it looks like holochain is retrieving links. So the most likely source of the error is on the build relationship map side instead of the save_links side.

Even with debug level tracing enabled, I'm not seeing the expected debug messages from get_relationship_name_from_smartlink:
debug!("got: {:?}\n link_tag from smartlink ", link_tag.clone());
debug!("got {:?}\n relationship_name from link_tag", name.clone());

This suggests the function is not being called. I tried doing a full nom run clean and rebuilding everything, but the test results were the same.

It is difficult to verify the result, so the proposal in the issue that we just using visual inspection of test results is probably insufficient. We should enhance debug tracing to provide better visibility into what's happening and we should ALSO enhance our test logic to do automatic verification of test results.

There is also bit of minor re-factoring I'm going to recommended.

@evomimic
Copy link
Owner

ah well, duh! We don't have the get_related_holons query dance implemented until issue #107, so there is no way to exercise the functionality we've implemented here until we have that dance and can add a test step for it to the fixture. Guess that's why I said we couldn't really test this in 105.

Please ignore my comments about test results.

I want to try a bit of re-factoring on a few functions before merging this PR. But, otherwise, everything looks pretty good.

Copy link
Owner

@evomimic evomimic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit minor refactoring and cleanup, test and sweetest pass resolved all the problems I identified during the review EXCEPT for one problem that will be resolved in Issue #114.

Confirmed all sweetest cases and tryorama tests pass.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be deleted. SmartCollection has been replaced by HolonCollection.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be deleted, StagedCollection has been replaced by HolonCollection.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_accessible function logic looks correct, but it is a bit of work to translate between the requirements and the code. The "READ" check explicitly checks the collection_state that errors, else returns OK on anything else, whereas the "WRITE" checks for the collection_state that is OK and errors on anything else.

It may be a bit more maintainable and easier to update if requirements change by having both arms use similar logic.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <build_relationship_map_from_links> function:

  1. Doesn't handle the case of a relationship_name being supplied (call to get_relationship_links always passes None for relationship_name instead of passing the supplied relationship_name).
  2. The logic inside the for link in links loop should be consolidated into a single function call on a (new) <decode_to_smartlink()> function that creates a SmartLink object from a holochain link.
  3. Unnecessarily clones the entire Vec every time it wants to push a new reference.

I intend to resolve and commit 1 and 3. I've defined Issue #114 to resolve 2.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evomimic evomimic marked this pull request as ready for review June 21, 2024 15:43
@evomimic evomimic merged commit aec1d07 into main Jun 21, 2024
1 check passed
@evomimic evomimic deleted the 105-implement-get_relationships_from_links branch June 21, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify SmartCollection and StagedCollection into HolonCollection
2 participants