Repository navigation
feat(automations): checks for automation shapes and an action registry - #427
Merged
Merged
Conversation
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
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.
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.pydefines 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"), andapp/domain/actions.pyis the one registry of actions. Each action declares its params (a JSON Schema), output and effect (read,self,lens,out), andactions.resolve_riskturns the effect into routine or ask: anoutaction only runs without asking when the person set that node toauto, alenschange 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, reusingschedule.check/zonefor cron and time zones,events.expandfor kinds andmatch.checkforwhereand 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
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md. (n/a: nothing user-facing yet)Done questions (AGENTS.md)
actions.catalog()is what agents will read.autois 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 asout.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.schedule.check/zone,events.expand,match.check; the style ofroutines._check.🤖 Generated with Claude Code
https://claude.ai/code/session_01RFQUkVmALkdhRqXY1yFxW5
Generated by Claude Code