Skip to content

51 make everything hashable again#55

Merged
amniskin merged 3 commits into
masterfrom
51-make-everything-hashable-again
Aug 26, 2025
Merged

51 make everything hashable again#55
amniskin merged 3 commits into
masterfrom
51-make-everything-hashable-again

Conversation

@amniskin
Copy link
Copy Markdown
Contributor

Dags and Fndags have content addressed IDs now. Everything is content addressed except for Heads (and Indexes).

Dags are hashable now. To achieve this, we move the dags map insert to commit, and add a `dag_name` property to the `Commit` object. This is a good idea anyway as there is currently no way to really tell which dag was added in a commit (i.e. there's no connection between a dag's commit message and the dag itself -- this fixes that).
@amniskin amniskin requested a review from Copilot August 26, 2025 05:13
@amniskin amniskin linked an issue Aug 26, 2025 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes Dags and FnDags content-addressable by making them hashable, aligning with the goal of having everything be content-addressed except for Heads and Indexes. The changes update the repository structure to properly handle dag naming and references.

  • Removes hash=[] decorators from Dag and FnDag classes to enable content addressing
  • Adds dag_name field to Commit class for tracking dag names in the tree
  • Updates commit and begin operations to properly handle dag references and naming

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/daggerml_cli/repo.py Core changes making Dag/FnDag hashable, adding dag_name to Commit, and updating commit/begin logic
tests/test_repo.py Adds assertion to verify cache_path is not None
tests/test_api.py Adds test assertion for unroll functionality
src/daggerml_cli/api.py Removes commented out debug code

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/daggerml_cli/repo.py
self.user,
message or f"merge {c2.id} with {c1.id}",
created or now(),
created=created or now(),
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

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

The parameter name should be updated to match the keyword argument syntax. Change created or now() to use the created= keyword argument pattern consistently with the function signature.

Copilot uses AI. Check for mistakes.
Comment thread src/daggerml_cli/repo.py
@amniskin amniskin merged commit caf9de9 into master Aug 26, 2025
14 checks passed
@amniskin amniskin deleted the 51-make-everything-hashable-again branch August 26, 2025 05:24
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.

make everything hashable again

2 participants