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
@@ -80,29 +67,20 @@ Do not read both iOS and Android paths unless issue is explicitly cross-platform
80
67
81
68
## Selector System Rules
82
69
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
-
93
-
## Testing Strategy
94
-
95
-
### Test placement policy
70
+
- Interaction commands (`click`, `fill`, `get`, `is`) and `wait` accept selectors and `@ref`.
71
+
- Pipeline is: **parse -> resolve -> act -> record selectorChain -> heal on replay**.
72
+
- Keep selector parsing/matching in `src/daemon/selectors.ts`.
73
+
- Call `buildSelectorChainForNode` after resolving an interaction target.
74
+
- New element-targeting interactions must support selector input and `@ref`, record `selectorChain`, and hook replay healing (`healReplayAction` + `collectReplaySelectorCandidates` in `session.ts`).
75
+
- New selector key updates stay centralized in `selectors.ts` (`SelectorKey`, key sets, matcher, token checks).
76
+
- New `is` predicates belong in `evaluateIsPredicate` (`src/daemon/is-predicates.ts`), not handler code.
96
77
78
+
## Testing
97
79
- Unit tests are colocated with source files under `src/**`.
98
80
- Use `__tests__` folders colocated with the related source folder.
99
81
- The `test/**` tree is integration-only (including smoke integration tests).
100
82
- Example: tests for `src/daemon/selectors.ts` go in `src/daemon/__tests__/selectors.test.ts`.
101
-
102
-
Add/extend colocated unit tests in the same PR for touched module logic.
103
-
104
-
### Verification matrix
105
-
83
+
- Add/extend colocated unit tests in the same PR for touched module logic.
106
84
- Any TS change:
107
85
-`pnpm typecheck`
108
86
- Daemon handler/shared module change:
@@ -114,13 +92,9 @@ Add/extend colocated unit tests in the same PR for touched module logic.
114
92
Run integration tests when behavior crosses platform boundaries:
115
93
-`pnpm test:integration`
116
94
117
-
## Productivity Measurement
118
-
95
+
## Measurement
119
96
- Use `docs/daemon-refactor-impact.md`.
120
-
- Track:
121
-
- files touched per fix
122
-
- cycle time
123
-
- iOS/Android regressions
97
+
- Track files touched per fix, cycle time, and iOS/Android regressions.
0 commit comments