fsanyoto commited on
Commit
97a2e92
Β·
verified Β·
1 Parent(s): c4e2214

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
Files changed (3) hide show
  1. RELEASES.json +1 -1
  2. VERSION +1 -1
  3. api/automation_engine.py +37 -4
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "47d05ef",
3
  "releases": [
4
  {
5
  "version": "v14",
 
1
  {
2
+ "current": "0ab7ebe",
3
  "releases": [
4
  {
5
  "version": "v14",
VERSION CHANGED
@@ -1 +1 @@
1
- 47d05ef
 
1
+ 0ab7ebe
api/automation_engine.py CHANGED
@@ -5262,8 +5262,20 @@ def run_plain(rt, defn, username="automation", log=print, step=_no_step, rows=No
5262
  f"{total} records in {table} β€” this run walked the first "
5263
  f"{MAX_FLOW_RECORDS}", counts, ids, {})
5264
  n = len(ids)
5265
- scope = "the trigger's" if rows else "all"
5266
- return ("ok", f"{n} record{'' if n == 1 else 's'} walked in {table} ({scope})",
 
 
 
 
 
 
 
 
 
 
 
 
5267
  counts, ids, {})
5268
 
5269
 
@@ -6650,12 +6662,33 @@ def enrich_selection(rt, table_key, cfg, profile_key, today=None):
6650
 
6651
  view_id = str(cfg.get("fromView") or "").strip()
6652
  if view_id:
6653
- tree, _fields, problem = view_filter(rt, table_key, view_id)
6654
  if problem:
6655
  # β›” REFUSE, do not widen. See the docstring β€” this is the branch where a quiet
6656
  # fallback costs real money.
6657
  return [], f"the enrich step names a view it cannot read β€” {problem}"
6658
- rows = {rid: r for rid, r in rows.items() if lane_match(tree, r)}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6659
 
6660
  sort_field = str(cfg.get("sortField") or DEFAULT_ENRICH_SORT).strip() or DEFAULT_ENRICH_SORT
6661
  newest_first = str(cfg.get("sortDir") or "desc").strip().lower() != "asc"
 
5262
  f"{total} records in {table} β€” this run walked the first "
5263
  f"{MAX_FLOW_RECORDS}", counts, ids, {})
5264
  n = len(ids)
5265
+ # ⭐⭐ 2026-08-07 (owner report) β€” SAY IT IN WORDS A PERSON CAN CHECK.
5266
+ # Owner: *"how come it says that its 51 records walked in ut_beauty_influencer_leads (all)?
5267
+ # wth is even ut_beauty_influencer_leads (all)??"* β€” and both halves of that name were ours:
5268
+ # Β· `ut_beauty_influencer_leads` is the storage KEY. Every other surface in the product
5269
+ # shows the database's LABEL ("Beauty influencer leads"); this one leaked the key.
5270
+ # Β· `(all)` meant "every record, because a manual run has no trigger records to narrow to",
5271
+ # which is unguessable from the word. It reads as a filter nobody chose.
5272
+ # ⚠ THE NUMBER WAS ALWAYS HONEST and is unchanged: a `plain` automation walks its whole
5273
+ # database, and a per-STEP narrowing (an enrich step's `fromView`) is a different count that
5274
+ # this sentence never claimed to report. What was wrong was that nothing said so.
5275
+ label = str((ut_get(rt, table) or {}).get("label") or "").strip() or table
5276
+ scope = ("the records that fired the trigger" if rows
5277
+ else "every record β€” this run was started by hand, so nothing narrowed it")
5278
+ return ("ok", f"{n} record{'' if n == 1 else 's'} walked in {label}: {scope}",
5279
  counts, ids, {})
5280
 
5281
 
 
6662
 
6663
  view_id = str(cfg.get("fromView") or "").strip()
6664
  if view_id:
6665
+ tree, fields, problem = view_filter(rt, table_key, view_id)
6666
  if problem:
6667
  # β›” REFUSE, do not widen. See the docstring β€” this is the branch where a quiet
6668
  # fallback costs real money.
6669
  return [], f"the enrich step names a view it cannot read β€” {problem}"
6670
+ # ⭐⭐ 2026-08-07 (owner report) β€” `filter_eval.matches`, NOT `lane_match`. THIS LINE WAS
6671
+ # A THIRD IMPLEMENTATION OF "does this row match", AND IT SPOKE THE WRONG LANGUAGE.
6672
+ #
6673
+ # `view_filter` returns a SAVED VIEW's filter tree β€” `{"nodes": [{colId, op, value}],
6674
+ # "conj"}` in the GRID's dialect, whose operators are `contains/eq/neq/gt/gte/lt/lte/
6675
+ # isEmpty/isNotEmpty/between/within`. `lane_match` reads an AUTOMATION LANE condition β€”
6676
+ # `{field, op, value}` with `=/!=/>/includes/is_empty/…` β€” and dispatches on
6677
+ # `COND_GROUP_KEYS`. Handed a view tree it found no group key, read `raw.get("field")`,
6678
+ # got `""`, and answered **False for every row**: MEASURED on the owner's own automation,
6679
+ # a view matching exactly one record selected NOTHING, reported NO error, and the run
6680
+ # committed `ok`. *"I just chose the View 'Enrichment test' where there is only 1 manual
6681
+ # record... how come it says 51 records walked?"*
6682
+ #
6683
+ # β›” AND THE RIGHT EVALUATOR WAS ALREADY IN THE FILE. `_row_gate`'s `enters_view` branch
6684
+ # resolves the SAME tree through `harness.filter_eval.matches(tree, row, fields)` and has
6685
+ # always been correct. `_seed_event_state`'s own docstring states the law this line broke:
6686
+ # *"Two implementations of 'does this row match' is how a seed disagrees with the edge it
6687
+ # is supposed to arm."* There were three. Now there are two callers of one function.
6688
+ # ⚠ `fields` is no longer discarded β€” `matches` needs the column TYPES to compare a date
6689
+ # as a date and a number as a number, which is the half `lane_match` could not have had.
6690
+ import harness.filter_eval as filter_eval
6691
+ rows = {rid: r for rid, r in rows.items() if filter_eval.matches(tree, r, fields)}
6692
 
6693
  sort_field = str(cfg.get("sortField") or DEFAULT_ENRICH_SORT).strip() or DEFAULT_ENRICH_SORT
6694
  newest_first = str(cfg.get("sortDir") or "desc").strip().lower() != "asc"