Repository navigation
feat(timeline): a file changed in its source is file.changed, an update linking the asset it was before - #658
Merged
Conversation
…te linking the asset it was before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
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.
Requested by Adeel · project thread
Description
Before: when a watched folder (S3, Drive, a share) found a file it had read before changed in its source, it read it again as a new asset and the timeline said "Office share added “Minutes”" a second time, with nothing linking it to the first.
After: that second arrival is
file.changed, an AS2Update: "Office share updated “Minutes”", withprevious(id,url) pointing at the asset it was before. The earlier asset's ownfile.addedstays as it was.file.changedis a child ofasset.added, so automations and filters on new assets still see it, as they did.How:
sources.poll_watchnow reads therecordingit made last time for each remote file; when a changed file is read into a new recording (and the source isn't a mail, calendar or feed source, which have their own kinds), it setsreplaceson the new recording. Therecordingsactivity source readsreplacesand names such a rowfile.changed, with the file fields offile.addedplusprevious._childtakes the AS2 verb so the kind registers as an Update.Motivation and Context
A refine-later item of the activity stream design (thread above): "A file changed in its source and read again is
asset.addedonce more; linking the new activity to the asset's earlier one as afile.changedUpdate, rather than a second Create, is to come." Reading the change into the same asset, and an activity for a namespace folder's own file changed in place, stay on the refine-later list.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/(timeline-file-changed.md).Done questions (AGENTS.md)
timelineand the assistant;event_kindslistsfile.changedwith its fields and sample.fil 8000 e.changedsits underasset.added.test_a_file_changed_in_its_source_is_file_changed_linked_to_the_asset_it_was_before(unchanged file: nothing new; changed: Update withprevious; the first staysfile.added; still underasset.added); docs, requirements.md, changelog.d.Update._file,_child; no new source.CI on the PR decides the merge.
Generated by Claude Code