Repository navigation
[bugfix] assets: keep media used by live pinned references listed - #130
Merged
Merged
Conversation
## summary - An asset that a generation config pins directly (no canvas node) vanished from the asset list and was marked unavailable in the reference catalog as soon as another asset named it in provenance.sources, e.g. after a generation result was registered. - `_inventory` now counts active pinned references as current, so the asset stays in "all" / "hidden" and remains selectable; once the reference is removed it is filtered as historical again, as before. - Deletion protection is unchanged; it already read live references. Fixes #120 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #120.
An asset that a generation config pins directly (
binding=pinned, no canvas node) disappeared from the asset list ("all" and "hidden") and becameavailable=falseinreference-catalogonce another asset listed it inprovenance.sources, for example after a generation result was registered. The file and the live reference were still there.Cause:
CreationHistory._inventoryputs everyprovenance.sourcesasset intohistorical, whilecurrentonly counted canvas items, current results, and subject documents. It did not count live pinned references. Bothasset_listandreference_cataloghidehistorical - current.Fix:
_inventorynow adds the assets of active pinned references tocurrent._usage_manyalready treats live references, provenance, and history as dependencies.Test plan
New test
test_asset_used_only_by_an_active_pinned_reference_stays_listed_after_becoming_a_source:provenance.sources;availableandfileAvailableare true, the result survives a fresh store (reopen), and usage still reports it as used;reference.remove, checks it is filtered as before and still protected from deletion.Results:
mainand passes with the fix.tests/test_creation_history_service.py: 17 passed.test_symlinked_content_and_asset_paths_are_rejected_without_external_writes. It fails identically on unmodifiedmainon Windows (symlink permissions).Not covered: this was run on Windows only, not Linux, and there is no browser end-to-end check. The new test makes the asset a source through
asset.writeTextwithpreviousAsset, which writes the sameprovenance.sourcesas a registered result, instead of going throughartifact.publish, which does not run on Windows.Note for review: a canvas-derived pinned reference (with
sourceVersion) that still pins an older node version will now also be listed as hidden, because it is a live reference too. Pure historical versions that nothing references are still filtered.🤖 Generated with Claude Code