You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`src/daemon.ts` (fallback after all handlers return null)
66
75
67
76
## Capability Source Of Truth
68
77
69
78
- Command/device support must come from `src/core/capabilities.ts`.
70
79
- Do not scatter new support checks across handlers.
71
80
81
+
## Selector System Rules
82
+
83
+
All interaction commands (`click`, `fill`, `get`, `is`) and `wait` accept selectors in addition to `@ref`.
84
+
The selector pipeline is: **parse → resolve → act → record selectorChain → heal on replay**.
85
+
86
+
- Selector DSL lives in `src/daemon/selectors.ts`. Do not duplicate parsing/matching logic elsewhere.
87
+
-`buildSelectorChainForNode` generates fallback chains stored in action results. Always call it after resolving a node for an interaction — it powers replay healing.
88
+
- When adding a new interaction command that targets a UI element: support both `@ref` and selector input, record `selectorChain`, and update replay healing (`healReplayAction` + `collectReplaySelectorCandidates` in `session.ts`).
89
+
- When adding a new selector key: update `SelectorKey` type, `ALL_KEYS`/`TEXT_KEYS`/`BOOLEAN_KEYS` sets, `matchesTerm`, and `isSelectorToken` — all in `selectors.ts`.
90
+
- When adding a new `is` predicate: update `IsPredicate` type and `evaluateIsPredicate` in `is-predicates.ts`, not in the handler.
91
+
-`daemon.ts` must stay a thin router. Do not add command logic there — use the appropriate handler module.
92
+
72
93
## Testing Strategy
73
94
74
95
### Test placement policy
75
96
76
97
- Unit tests are colocated with source files under `src/**`.
77
98
- Use `__tests__` folders colocated with the related source folder.
78
99
- The `test/**` tree is integration-only (including smoke integration tests).
79
-
80
-
### Unit tests (default for all refactors, colocated)
0 commit comments