Repository navigation
fix: replace a changed paper-local image instead of refusing the save - #95
Merged
Merged
Conversation
Overwriting a note, or adding the other language's note, re-crops figures under the same label-based filename. Formal Save refused whenever the existing image had other bytes, so the save could only finish after someone moved the old image out by hand. Formal Save now backs up the old image, writes the reviewed new crop, restores the old image if any later step fails, and deletes the backup on success. The save receipt lists each replacement in `replaced_images` with the other notes in the paper folder that also embed it, and the final report mentions those shared images. 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
Vault image names are fixed by figure label (
Figure_1.png), and a paper's notes in both languages share itsimages/folder. When a later save carried a new crop under an existing name, Formal Save refused withexisting paper-local image has different bytes. That happened on:Formal Save now:
replaced_images: [{file, also_embedded_by}].also_embedded_bynames the other.mdfiles directly in the paper folder that embed the image, which is usually the other language's note.SKILL.mdgains one final-report line: when a replaced image is shared with other notes, say that the new crop also shows there.Unchanged:
Evidence
tests/test_image_replacement.py(real Formal Save runs):also_embedded_by;test_visual_asset_bindings.py: the refusal test becomes a backup-then-replace test, plus a test that only sibling notes embedding the image are named (not the target note, nested folders, or unrelated notes).python3 -m pytest -q -n auto: 1734 passed, 1 skipped.python3 -m ruff check skills tests: clean.Merge Danger
.<name>.backupfile inimages/, the same as the existing note backups.🤖 Generated with Claude Code