Repository navigation
feat(automations): routine runs, budget warnings, backups and releases as activities - #449
Merged
Merged
Conversation
…s as activities routine.ran reads routine_run rows that ended by finished_at (new index); budget.warned, backup.finished and lens.release are emitted with keys where budgets.sweep alerts, where a manual or scheduled backup ends and where updates.announce tells people, so each is logged once. They are for admins unless about one namespace. The name cache now keys on the fields asked for. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QewNs6jxSB2vRoag2EvdyX
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.
Description
Before: automations could not react to what Lens itself does.
After: four new activity kinds.
routine.ranis a routine run that ended (done, failed or skipped as over budget), with its status, trigger, action count and cost.budget.warnedis a budget crossing its warning share or its cap.backup.finishedis a backup taken by hand or on the schedule, with its size, whether it was copied to storage, or why it failed.lens.releaseis a newer Lens release. Each is for admins unless it is about one namespace, and each is logged once however often the thing behind it runs (several processes, sweeps, retries).How: a
routine_runssource reads runs that ended byfinished_atover a new index. The other three are logged with a key where they already happen:budgets.sweep,backups.take/run_due,updates.announce, each wrapped so a logging problem never breaks the sweep, backup or announcement. The name lookup cache now keys on the fields asked for, which fixes routine names missing their namespaces when another lookup filled the cache first.Motivation and Context
Workflow Studio M3 (plan section 3): Lens's own happenings as triggers.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_system_activities.py, embedded and SurrealDB server)docs/accordingly. (docs/automations.md,docs/budgets.md,docs/updates.md,docs/database.md;mkdocs build --strictclean)## UnreleasedinCHANGELOG.md. n/a: the title says it.Done questions (AGENTS.md)
IF NOT EXISTS(docs/database.md); safe to run twice.docs/automations.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01QewNs6jxSB2vRoag2EvdyX
Generated by Claude Code