Skip to content

Enforce (node_id, artifact_name) uniqueness in published artifacts#307

Open
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
claude/fix-artifact-refresh-AKP5e
Open

Enforce (node_id, artifact_name) uniqueness in published artifacts#307
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
claude/fix-artifact-refresh-AKP5e

Conversation

@Edwardvaneechoud
Copy link
Owner

Summary

This PR ensures that when an artifact with the same name is published from the same node, it replaces the previous version rather than creating a duplicate. This enforces a uniqueness constraint on the combination of node_id and artifact_name.

Changes

  • Modified record_published() method: Added logic to remove any existing artifact with the same name from the same node before recording a new one, ensuring (node_id, artifact_name) uniqueness
  • Added comprehensive test coverage:
    • test_record_published_overwrites_same_name_same_node: Verifies that republishing the same artifact name from the same node overwrites the previous version
    • test_record_published_allows_same_name_different_nodes: Confirms that different nodes can independently publish artifacts with the same name
    • test_record_published_allows_same_name_different_kernels: Confirms that the same node can publish the same artifact name to different kernels

Implementation Details

  • The uniqueness constraint is enforced by filtering out artifacts where both name and kernel_id match before adding the new artifact
  • This approach maintains backward compatibility while preventing accidental duplicates
  • The kernel artifacts cache is automatically updated through the existing mechanism, ensuring consistency across all views of the data

When a node re-runs (e.g., refresh data, collect schema), the
record_published() method was appending to the published list
without checking for existing artifacts with the same name.
This caused duplicate entries to appear in the artifact tracker.

Now record_published() removes any existing artifact with the same
(node_id, kernel_id, artifact_name) before adding the new one,
ensuring uniqueness and preventing duplicate artifacts on refresh.

https://claude.ai/code/session_015b6B5uvhwP1jwC6Uk5ykGH
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.

2 participants