8000 feat(automations): finished runs, deletions and calendar moves as activities by adeelahmad · Pull Request #440 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(automations): finished runs, deletions and calendar moves as activities - #440

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pss8a6
Oct 15, 2026
Merged

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

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: the stream of activities told of new assets only, so an automation couldn't react when an email had been understood, when processing failed, when an asset was deleted or when a calendar event moved.

After: four more kinds.

Kind Source Object adds Example summary
asset.processed jobs the asset's fields, job, steps, batch; tagged with the asset's ten most mentioned entities “School trip on Friday” finished processing (pages, analyze, embed)
asset.failed jobs as above, with step and error Processing “Call with the school” failed at transcribe
asset.deleted log type, id, name, media Sam deleted “Old minutes”
calendar_event.changed log startTime, endTime, location, calendar, before Family calendar moved “Parents' evening” to 2026-10-21 18:00

How: a jobs source reads job by finished_at (indexed), one activity per run, its actor whoever queued it; the id carries the finish time (processed-job-51-1792081450), so a run tried again is a new activity. deletion.delete emits asset.deleted once per asset (key=deleted-<id>), and a failure to log never stops a deletion. When a calendar source reads an event again and its start differs from the one kept on the resource (recording.event), calendar_moved emits calendar_event.changed once per event and new start (key=cal-<uid>-<start>). The jobs source reads several activities at once (get_many, used by the timeline's review marks) in one query.

Workflow studio M2 (content sources), part 2 of 3, after #435. Comments, notes and graph changes come next.

Motivation and Context

Workflow studio plan, module M2 (/mnt/project-files/workflow-studio/briefs/M2.md), items 3, 4 and 7.

Defaults taken (reversible): a run's tags are the asset's ten most mentioned entities; a run for an asset deleted since names it "A deleted asset"; only Google Calendar and iCal moves are noticed (events in a calendar file on storage are read as new files), and a cancelled event isn't an activity yet (both under Refine later).

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 under ## Unreleased in CHANGELOG.md. (n/a: the title says it)

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI. (this part of M2; merged on green)
  • Agents: the kinds show in GET /api/v1/activities and /kinds, and the MCP and assistant timeline and event_kinds tools.
  • Zero setup: nothing to install or set.
  • Fewest clicks and keystrokes: n/a, no UI (the timeline page is M10).
  • Configurable: n/a, no new settings.
  • Light: reads rows already written (an indexed column); one small log row per deletion or move.
  • Private and secure: data stays in the database; titles, errors and places marked untrusted. Threat model: n/a, no new surface.
  • Cost: no model calls.
  • User decides: nothing acts on these yet; defaults unchanged.
  • Upgrades: no stored data changes shape, so no upgrade step.
  • Honest: docs/automations.md labels these built.
  • Tests, docs updated; no API schema change, so no make openapi.
  • Open standards: Activity Streams 2.0 verbs and fields; no new dependencies.
  • Result reported with evidence; "refine later" items written in docs/automations.md.

Tests: tests/domain/test_events_content.py: runs that succeed and fail through jobs.enqueue and the worker (a retry is a new activity, the old id is gone, filters by kind, another namespace sees none, several read at once), a deletion through deletion.delete logged once, and a calendar event read again by sources._ingest a day later.

🤖 Generated with Claude Code

https://claude.ai/code/session_019nbuG2q5wEXeUxWb8vr5HJ


Generated by Claude Code

…ivities

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019nbuG2q5wEXeUxWb8vr5HJ
@adeelahmad
adeelahmad merged commit 1ede23e into main Oct 15, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-pss8a6 branch October 15, 2026 23:22
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