Comfy-Org / Comfy-Org/ComfyUI_frontend
AUDIT-LG: delete LiteGraph trigger/action subsystem (~22 symbols, 1 PR)
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
**Source audit:** `research/architecture/audit-litegraph-pruning.md (cross-repo workspace)` — see appendices **§AUDIT-LG.5 — onTrigger system verdict** and **§AUDIT-LG.7 — synthesis: master verdict table**.
## Verdict
**DELETE-NOW** as one batch PR. AUDIT-LG.5 traced every entry point in the LiteGraph trigger/action subsystem and confirmed:
- Zero external callers of `triggerSlot`, `actionDo`, `node.trigger`, `onAfterExecuteNode`, `doExecute`, or `node.onTrigger` (the method, not the field) outside `src/lib/litegraph/` (`rg -n 'triggerSlot|actionDo|onAfterExecuteNode|node\.onTrigger\b|doExecute' --glob '!**/litegraph/**'` returns nothing).
- The two `LGraphEventMode.ON_TRIGGER` read sites in `LGraphNode.ts:1546` and `:2819` are both inside the dead cluster (`triggerSlot` body, and a `connect()` branch gated by `do_add_triggers_slots` which defaults `false` and is never enabled in `src/` or `browser_tests/`).
- In-source `// @todo Clean up - never implemented` and `// TODO: Remove or reimpl. events` comments at `LGraph.ts:1376` and `LGraphNode.ts:2617`.
## Symbols in this batch (8 surface-table rows + ~14 non-symbol travelers)
The 8 inventoried surfaces from the AUDIT-LG.7 verdict table:
| id | kind | symbol | int | ext_rep | tier |
|---|---|---|---:|---:|---|
| `lgraph_event_mode_on_trigger` | enum_value | `LGraphEventMode.ON_TRIGGER` | 0 | 11 | top-10 |
| `lgraph_on_after_execute_node_dispatch` | method | `LGraph.onAfterExecuteNode` | 0 | 0 | long-tail |
| `lgraph_set_callback` | method | `LGraph.setCallback` | 0 | 0 | long-tail |
| `lgraph_trigger_input` | method | `LGraph.triggerInput` | 0 | 0 | long-tail |
| `lgraphnode_on_action` | field | `LGraphNode.onAction` | 10 | 0 | long-tail |
| `lgraphnode_on_after_execute_node` | method | `LGraphNode.onAfterExecuteNode` | 0 | 0 | long-tail |
| `litegraphglobal_on_trigger` | reexport | `LiteGraph.ON_TRIGGER` | 0 | 11 | top-10 |
| `llink_last_time` | field | `LLink._last_time` | 0 | 0 | long-tail |
Plus the non-symbol travelers (not separately inventoried because they're internal-only or string-literal):
- `LGraphNode.triggerSlot` (LGraphNode.ts:1504)
- `LGraphNode.actionDo` (LGraphNode.ts:1442)
- `LGraphNode.trigger` (LGraphNode.ts:1475)
- `LGraphNode.doExecute` (LGraphNode.ts:1412)
- `LGraphNode.addOnTriggerInput` (LGraphNode.ts:1352)
- `LGraphNode.addOnExecutedOutput` (LGraphNode.ts:1363)
- `LGraphNode.clearTriggeredSlot` (LGraphNode.ts:1568)
- `LGraph._last_trigger_time` (referenced LGraphNode.ts:1485,1530)
- `LiteGraph.EVENT = -1` (slot-type constant)
- `LiteGraph.ACTION = -1` (slot-type constant)
- `LiteGraph.do_add_triggers_slots` (LiteGraphGlobal.ts:250 — default false, never enabled)
- auto-injected `'onTrigger'` input slot string literal
- auto-injected `'onExecuted'` output slot string literal
- the `connect()` `target_slot === LiteGraph.EVENT` branch at `LGraphNode.ts:2816-2821`
See **§AUDIT-LG.5 Per-symbol verdict table** for the full ~22-symbol breakdown with rationale.
## Critical KEEPs (do NOT touch in this PR)
The following share the prefix `onTrigger` but are unrelated and **must be preserved**:
- **`LGraph.onTrigger` field** at `LGraph.ts:340` — the typed graph-mutation event bus dispatched by `LGraph.trigger(action, param)` carrying `node:property:changed`, `node:slot-errors:changed`, `node:slot-links:changed`, `node:slot-label:changed` events. **6 production subscribers** in `useGraphNodeManager.ts`, `useErrorClearingHooks.ts`, `useMinimapGraph.ts` (plus 6 test invocations).
- **`LGraphTriggerEvent` / `LGraphTriggerAction` / `LGraphTriggerHandler` types** in `graphTriggers.ts` — imported by all 3 subscribers above.
- **`'executed'` v2 NodeHandle event** (`extension-api/node.ts:100`) — completely unrelated to LiteGraph trigger plumbing; backend-output arrival event from the v2 extension API. Trigger-cluster deletion does not touch v2 `'executed'`.
## Risk
The two enum/reexport rows (`lgraph_event_mode_on_trigger`, `litegraphglobal_on_trigger`) carry `top-10/11 repos` external counts. **This is rollup imprecision**, not real callers — the external CSV uses a single-pattern lookup that gives every `LGraphEventMode.*` value the same `15/11/top-10` triple. Per-symbol attribution against the touch-points DB is the AUDIT-LG.5 §Open Question 1 prerequisite for landing this PR.
## Action items for whoever picks this up
- [ ] Confirm AUDIT-LG.5 Open Question 1: per-symbol external-attribution sweep for `LiteGraph.EVENT`, `LiteGraph.ACTION`, `LiteGraph.ON_TRIGGER`, `'onTrigger'` / `'onExecuted'` slot-name string literals against `research/touch-points/database.yaml`. Expect zero functional usage.
- [ ] Confirm AUDIT-LG.5 Open Question 4: the `onConnectionsChange` body at `LGraphNode.ts:2620` has no other dependence on the deleted helpers before removing the gated branch.
- [ ] Open one PR. Cluster cannot be partially deleted — every method calls another method in the same set.
- [ ] Verify `pnpm lint && pnpm format:check && pnpm knip` after deletion (per AGENTS.md rule #8).
## Sequencing
Per the framing doc, deletions happen **after Phase B ECS migration lands** (Alex's `#11939` and `#11811`). This is a tracking issue, not a green-light to ship before that gate.
cc @drjkl @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-12223-AUDIT-LG-delete-LiteGraph-trigger-action-subsystem-22-symbols-1-PR-35f6d73d365081b2b6a5fa25658439b8) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.