8000 feat(timeline): a file changed in its source is file.changed, an update linking the asset it was before by adeelahmad · Pull Request #658 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(timeline): a file changed in its source is file.changed, an update linking the asset it was before - #658

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 AS2 Update: "Office share updated “Minutes”", with previous (id, url) pointing at the asset it was before. The earlier asset's own file.added stays as it was. file.changed is a child of asset.added, so automations and filters on new assets still see it, as they did.

How: sources.poll_watch now reads the recording it 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 sets replaces on the new recording. The recordings activity source reads replaces and names such a row file.changed, with the file fields of file.added plus previous. _child takes 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.added once more; linking the new activity to the asset's earlier one as a file.changed Update, 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it as a fragment in changelog.d/ (timeline-file-changed.md).

Done questions (AGENTS.md)

  • Goal: a changed file reads as an update linked to what it was; merged on green CI.
  • Agents: the same activity through the timeline API, MCP timeline and the assistant; event_kinds lists file.changed with its fields and sample.
  • Zero setup: nothing to configure.
  • Fewest clicks: n/a, no new control.
  • Configurable: n/a, no new setting.
  • Light: one more field selected per page; no new query.
  • Private and secure: the activity is seen where the asset is, as before; no new surface.
  • Cost: no model call.
  • User decides: defaults unchanged; triggers on new assets fire as before, since fil 8000 e.changed sits under asset.added.
  • Upgrades: a new optional field on new recordings only; older rows read as before.
  • Honest: docs/automations.md's kinds table and docs/timeline.md say what it is and what is still to come.
  • Tested and documented: pytest test_a_file_changed_in_its_source_is_file_changed_linked_to_the_asset_it_was_before (unchanged file: nothing new; changed: Update with previous; the first stays file.added; still under asset.added); docs, requirements.md, changelog.d.
  • Open standards: AS2 Update.
  • Reported: result goes back in the thread; refine later: reading the change into the same asset; an activity for a namespace folder's file changed in place.
  • Reuse: the recordings source, _file, _child; no new source.

CI on the PR decides the merge.


Generated by Claude Code

…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
@adeelahmad
adeelahmad merged commit e30f227 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-pf8kii branch October 19, 2026 03:16
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

0