Repository navigation
feat(automations): more operators for conditions - #434
Merged
Merged
Conversation
Match trees gain in, not_in, starts_with, ends_with, matches, between, before, after, within, weekday, time_between and changed. Time and state come from env (now, timezone, state), never from globals. Patterns are refused when they could backtrack without end, read at most 20,000 characters and give up after 50 ms (the regex module's timeout). changed keeps the last value seen per automation, trigger and key in a new automation_state table, tidied hourly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
…rosecond Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
…-li6m25 # Conflicts: # threat-model.yaml
16 of 22 tasks
adeelahmad
added a commit
that referenced
this pull request
Oct 16, 2026
Automations merged (#432 to #464): the stream now holds every kind of activity, the Timeline page reviews it, and automations act on it with triggers, conditions, actions, approvals, limits and budgets, made by agents over MCP and in the assistant or drafted from a sentence. Say so under Automate it, with the studio labelled planned as docs/automations.md does; add the open RSS feeds (#453) and condition operators (#434) to In progress; link the timeline from the docs index. Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
…-li6m25 # Conflicts: # fastapi_backend/app/domain/store.py # threat-model.yaml
…-li6m25 # Conflicts: # threat-model.yaml
# Conflicts: # threat-model.yaml
…checks Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
# Conflicts: # CHANGELOG.md # README.md # threat-model.yaml
Ported from #512 so this PR's upgrade check passes while that lands: the entity-types step re-types weekday Terms as Dates, which the default entity list leaves out, so the check read them as gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
Owner
Author
|
Upgrade from the last release failed on ebd1acb, and the failure doesn't come from this PR. Since #395, the entity-types upgrade step re-types weekday Terms such as Monday as Dates. The default entity list leaves Dates out, so the check counted Friday and Monday as gone. The fix is in #512 and is ported here in 2c6b4fe ( Generated by Claude Code |
# Conflicts: # threat-model.yaml
# Conflicts: # CHANGELOG.md # threat-model.yaml
# Conflicts: # README.md # threat-model.yaml
# Conflicts: # CHANGELOG.md # fastapi_backend/pyproject.toml # threat-model.yaml
The threat model's line on members' patterns moves to its own docs pull request, so this one stops conflicting on threat-model.yaml's hash. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
# Conflicts: # CHANGELOG.md # README.md
# Conflicts: # CHANGELOG.md
This was referenced Oct 18, 2026
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: a condition (a trigger's
where, an automation's If, a condition, filter or switch node's match tree, the timeline'swhere) could only testexists,empty,equals,not_equals,contains,gtandlt.After: match trees also take
in,not_in,starts_with,ends_with,matches,between,before,after,within,weekday,time_betweenandchanged, each checked when saved with the problem in words, and each read back in words bymatch.describe("the subject matches “trip” or “outing”", "now falls on a Saturday or Sunday", "object.state changed for each actor.id").Workflow studio module M5, part 1 of 5 (plan: section 5, M5, items 1 and 6 for the new operators).
How:
app/domain/match.pyowns the new tests. A list passes when one of its items does (ascontainsdoes);not_inwhen none does. Times are ISO times or dates, read inenv["timezone"]when written without a zone;nowcomes fromenv["now"](the clock only when not given), so tests and dry runs fix time.matches: patterns of up to 200 characters, in any case, refused when they repeat a part that repeats itself ((a+)+), repeat alternatives that may start alike ((a|aa)+) or refer back to a group; at most 20,000 characters of input; compiled patterns cached.changed: compares with the last value the same test saw for the same automation and trigger, kept in a newautomation_statetable (kindlast) throughmatch.State(db, automation, alias, dry=False)inenv["state"]; one State per activity, so the If and a node agree;valuemay name a path (actor.id) to keep values apart. Rows expire 30 days after last seen;match.tidyruns hourly from the routine schedule; at most 1000 rows per automation, oldest dropped and counted.docs/requirements.md(make requirementspasses); a line under## UnreleasedinCHANGELOG.md.Defaults taken (reversible): patterns run on the
regexmodule (already installed through fastapi-mail, Apache-2.0, now declared) for its per-match timeout of 50 ms, a hard stop the stdlibrelacks; the parse check still uses Python's own parser.withinis either side of now;before/after/betweenalso takenowand durations (2h,-30m). The first valuechangedsees is no change. The threat model's line on members' patterns comes in its own docs pull request right after this one: here it changed threat-model.yaml's hash, which conflicted with almost every pull request that merged while this one's CI ran.Motivation and Context
Adeel asked for a full workflow studio with conditions joined from any source. This is the condition language it needs: "the sender ends with @stmarys.org", "between 22:00 and 06:00", "the door's state changed".
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
timelinetool'swherenow lists every operator; automations' API and tools take them too.regexwas already a dependency of a dependency).DEFINE ... IF NOT EXISTS; nothing stored changes shape.docs/requirements.md; refine-later items written down.tests/domain/test_match_ops.py,docs/automations.mdOperators; no generated files change).regexis Apache-2.0.regexinstead of a new pattern engine.🤖 Generated with Claude Code
https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
Generated by Claude Code