8000 feat(automations): checks for automation shapes and an action registry by adeelahmad · Pull Request #427 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(automations): checks for automation shapes and an action registry - #427

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

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-3p5r9r

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: there was no shared definition of what an automation is made of (triggers, joins, an If, approvals policy, the intents its actions make) and no catalog of actions with a notion of how risky each is.

After: app/domain/automation_spec.py defines those shapes with checks that name the first problem in words ("trigger mail: kinds lists the kinds of activity it starts on", "only you can let node n7 run without asking"), and app/domain/actions.py is the one registry of actions. Each action declares its params (a JSON Schema), output and effect (read, self, lens, out), and actions.resolve_risk turns the effect into routine or ask: an out action only runs without asking when the person set that node to auto, a lens change only when it is on the event's own object in the automation's namespaces. One reference action, log_line, writes a line to the run log. Nothing is stored or run yet; the automations module builds on these.

How: plain Python checks in the style of routines._check, reusing schedule.check/zone for cron and time zones, events.expand for kinds and match.check for where and If trees. Third part of workflow studio module M1.

Motivation and Context

Workflow studio plan (/mnt/project-files/workflow-studio/plan.md, sections 3.5, 3.7, 3.8 and M1 steps 3 and 5); differences from the plan are in /mnt/project-files/workflow-studio/m1-notes.md.

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: nothing user-facing yet)

Done questions (AGENTS.md)

  • Goal: the contract's validators and the action registry for M1, merged on green CI.
  • Agents: n/a in this step; the automation API and tools that use these come with the automations module, and actions.catalog() is what agents will read.
  • Zero setup: nothing to install or configure.
  • Fewest clicks: n/a, no UI.
  • Configurable: n/a, no new setting.
  • Light: pure Python checks.
  • Private and secure: auto is refused everywhere except an explicit signed-in path (allow_auto); outbound and cross-person effects ask by default; an effect that can't be worked out counts as out.
  • Cost: no model calls.
  • User decides: consequential actions resolve to ask unless the person picked auto for that node.
  • Upgrades: no stored data.
  • Honest: docs/automations.md labels the checks and registry built, storing and running automations planned.
  • Tests, docs and generated files: tests/domain/test_automation_spec.py (durations, every trigger kind, joins, If, policy, intents, catalog and params, the risk table, perform and dry runs); docs/automations.md § Contract. No generated files change.
  • Open standards: params and outputs are JSON Schema; no new dependencies.
  • Reported; refine later stays in docs/automations.md.
  • Reuse: schedule.check/zone, events.expand, match.check; the style of routines._check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RFQUkVmALkdhRqXY1yFxW5


Generated by Claude Code

Triggers, joins, an If, policy and intents checked with the first
problem in words; the run context's keys; and the registry of actions
with risk worked out from each action's effect, plus log_line.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RFQUkVmALkdhRqXY1yFxW5
@adeelahmad adeelahmad self-assigned this Oct 15, 2026
@adeelahmad
adeelahmad merged commit 7c8a222 into main Oct 15, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-3p5r9r branch October 15, 2026 17:50
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