8000 feat(timeline): log moves and sensor switches as Move and Update activities by adeelahmad · Pull Request #637 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(timeline): log moves and sensor switches as Move and Update activities - #637

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii
Oct 18, 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: moving an asset to another namespace and pausing or resuming a sensor left no trace on the timeline. An automation could not say "when something arrives from another namespace" or "when the kitchen sensor is paused, tell me", and a person reading the timeline saw the asset reappear as processed in its new namespace with no line saying who moved it.

After: a move is asset.moved, a Move by whoever moved it ("Sam moved “Old minutes” to work"), with the namespaces it left and joined and the collection it is in now, seen in the namespace it is in now. A sensor a person pauses, ignores, resumes or sets back to new is sensor.changed, an Update ("Sam paused Kitchen sensor") with the status it had before, seen in the sensor's namespace, or by admins alone when it has none. Saving the status it already has, or a rename, logs nothing. Both kinds are listed for agents with their fields, and Move joins the Activity Streams verbs an activity may have. Automations trigger on them like any other kind (object.status equals paused).

How: events_content.moved and events_content.sensor_changed write one activity each to the event log, called from the move route after the move is done and from the sensors route when a status change is saved (reading the sensor first, for the status it had). The file.changed Update for a file changed in its source is written down under Refine later: a re-read is asset.added again today, and linking it to the earlier activity is a separate step.

Motivation and Context

Step 8 of the activity stream design (thread above): "Sensor on/off changes and the Update and Move verbs". Follows #570, #622, #627, #631 and #635.

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-verbs.md).

Done questions (AGENTS.md)

  • Goal: moves and sensor switches on the timeline and for automations, as the verbs they are; merged on green CI.
  • Agents: both kinds on GET /api/v1/activities and /activities/kinds, the MCP and assistant timeline, and as automation triggers.
  • Zero setup: logged by the routes that already do the move and the switch; nothing to configure.
  • Fewest clicks: n/a, nothing new to click; the items appear where the timeline already is.
  • Configurable: n/a, no new setting.
  • Light: one event log row per move or switch; no model call.
  • Private and secure: a move is seen where the asset is now, by those who can read it there; a sensor switch follows the sensor's namespace or stays with admins. No new surface for the threat model.
  • Cost: no model call; nothing in the ledger to log.
  • User decides: n/a, nothing acts; the activities record what a person did.
  • Upgrades: two new kinds in the existing event log; nothing stored changes shape, so no migration step.
  • Honest: docs/timeline.md's status table lists the verbs as built; docs/automations.md's kinds table has both rows; the README's built line names them; file.changed is under Refine later, not claimed.
  • Tested and documented: test_timeline_verbs.py (a move seen where it is now and not where it left, the kinds listing; a switch with its before, admins only without a namespace, nothing on the same status or a rename, the namespace's readers once it has one); the kinds' samples validate in test_events_content.py; docs automations.md, sensors.md, timeline.md, requirements.md, changelog.d.
  • Open standards: Activity Streams 2.0 Move and Update; no new dependency.
  • Reported: result goes back in the thread; refine later: file.changed linking a re-read file to its earlier activity.
  • Reuse: events.emit, events_content.actors, render.kind and the kinds registry as they are; no new machinery.

Local CI (ci/local-ci.sh) on this head: running; CI on the PR decides the merge.


Generated by Claude Code

…vities

An asset moved to another namespace is asset.moved, a Move by whoever moved
it, with the namespaces it left and joined and its collection, seen where it
is now. A sensor paused, ignored, resumed or set back to new by a person is
sensor.changed, an Update with the status it had before, seen in its namespace
or by admins when it has none. Move joins the AS2 verbs an activity may have.
Saving a status already set, or a rename, logs nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
@adeelahmad
adeelahmad merged commit e2b2c79 into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-pf8kii branch October 18, 2026 16:55
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