8000 feat(automations): match trees for conditions by adeelahmad · Pull Request #425 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content 8000

feat(automations): match trees for conditions - #425

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: a workflow's condition, filter and switch nodes could test one thing ({path, op, value}), and there was no shared condition language for the workflow studio's triggers.

After: one condition language, match trees (app/domain/match.py): all, any and not over the same tests the workflow engine already has. match.check names the first problem and where it is (the condition, all.1.not: compare with a number), trees nest at most 6 deep with at most 50 tests, and match.describe reads a tree in words. Condition, filter and switch cases take a tree in config.match as well as one test; graphs saved before run exactly as they did.

How: the leaf tests reuse flow.test, and flow.check_test now builds on a new flow.test_problem, so the leaf rules live in one place. This is the first part of workflow studio module M1 (event contract and stream core); triggers, an automation's If and the event stream build on it next.

Motivation and Context

Workflow studio plan (/mnt/project-files/workflow-studio/plan.md, section 3.6 and brief M1 step 4).

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: first step of M1; merged on green CI.
  • Agents: trees are plain JSON that agents send through the existing workflow API and MCP; the timeline and automation tools come in later M1 PRs.
  • Zero setup: nothing to install or configure.
  • Fewest clicks: n/a, no UI in this step (the studio builder is M11).
  • Configurable: n/a, no new setting.
  • Light: pure Python over values already in memory; caps on depth and size.
  • Private and secure: n/a, no new surface; values are literals, never templates.
  • Cost: no model calls.
  • User decides: defaults unchanged; old graphs run as before.
  • Upgrades: no stored data changes shape; match is an optional new config key.
  • Honest: docs/automations.md labels match trees built and the rest planned.
  • Tests, docs and generated files: tests/domain/test_match.py; docs/automations.md, processing.md, mkdocs nav. No generated files change.
  • Open standards: n/a; no new dependencies.
  • Reported; refine later (more operators, canvas editing of trees) is in docs/automations.md.
  • Reuse: leaf tests are flow.test and the same checks, not a copy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RFQUkVmALkdhRqXY1yFxW5


Generated by Claude Code

One condition language for the workflow studio (docs/automations.md, Match
trees): all, any and not over the workflow engine's tests, with a check that
names the first problem and where it is, depth and size caps, and a reading in
words. Condition, filter and switch nodes take a tree in `match` as well as one
test; graphs saved before run unchanged.

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 3702220 into main Oct 15, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-3p5r9r branch October 15, 2026 17:22
adeelahmad added a commit that referenced this pull request Oct 15, 2026
… in progress (#430)

The stream of activities (#425 to #428) merged: agents read it through
the API, MCP's timeline tool and the assistant. Say so under Automate it,
with automations that act on it labelled in progress, add the open
Settings section (#429) to In progress, and link the automations page
from the docs index.


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
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