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
- Preserve `hint`, `diagnosticId`, `logPath` when wrapping/rethrowing errors.
70
+
-`--debug` is canonical; `--verbose` is backward-compatible alias.
71
+
- Keep redaction centralized in diagnostics helpers.
72
+
73
+
## Selector System Rules
74
+
- Interaction commands (`click`, `fill`, `get`, `is`) and `wait` accept selectors and `@ref`.
75
+
- Pipeline: **parse -> resolve -> act -> record selectorChain -> heal on replay**.
76
+
- Keep selector parsing/matching in `src/daemon/selectors.ts`.
77
+
- Call `buildSelectorChainForNode` after resolving target nodes.
78
+
- New element-targeting interactions must support selector + `@ref`, record `selectorChain`, and hook replay healing (`healReplayAction` + `collectReplaySelectorCandidates` in `session.ts`).
79
+
- New selector keys remain centralized in `selectors.ts`.
80
+
- New `is` predicates belong in `evaluateIsPredicate`.
81
+
82
+
## Testing Matrix
83
+
- Docs/skills only: no tests required.
84
+
- Non-TS, no behavior impact: no tests unless requested.
85
+
- Any TS change: `pnpm typecheck`.
86
+
- Daemon handler/shared module change: `pnpm test:unit` and `pnpm test:smoke`.
87
+
- iOS runner/Swift change: `pnpm build:xcuitest`.
88
+
- Cross-platform behavior change: run `pnpm test:integration`.
89
+
90
+
## Token Guardrails
91
+
- Do not read unrelated files once owning module is identified.
92
+
- Do not run integration tests by default.
93
+
- Do not inspect both iOS and Android codepaths unless task requires both.
94
+
- Keep PR summaries short and scoped.
95
+
96
+
## Common Mistakes
97
+
- Adding command logic to `src/daemon.ts` instead of handlers.
- Command/device support must come from `src/core/capabilities.ts`.
86
-
- Do not scatter new support checks across handlers.
87
-
88
-
## Selector System Rules
89
-
90
-
- Interaction commands (`click`, `fill`, `get`, `is`) and `wait` accept selectors and `@ref`.
91
-
- Pipeline is: **parse -> resolve -> act -> record selectorChain -> heal on replay**.
92
-
- Keep selector parsing/matching in `src/daemon/selectors.ts`.
93
-
- Call `buildSelectorChainForNode` after resolving an interaction target.
94
-
- New element-targeting interactions must support selector input and `@ref`, record `selectorChain`, and hook replay healing (`healReplayAction` + `collectReplaySelectorCandidates` in `session.ts`).
95
-
- New selector key updates stay centralized in `selectors.ts` (`SelectorKey`, key sets, matcher, token checks).
96
-
- New `is` predicates belong in `evaluateIsPredicate` (`src/daemon/is-predicates.ts`), not handler code.
97
-
98
-
## Testing
99
-
- Unit tests are colocated with source files under `src/**`.
100
-
- Use `__tests__` folders colocated with the related source folder.
101
-
- The `test/**` tree is integration-only (including smoke integration tests).
102
-
- Example: tests for `src/daemon/selectors.ts` go in `src/daemon/__tests__/selectors.test.ts`.
103
-
- Add/extend colocated unit tests in the same PR for touched module logic.
104
-
- Any TS change:
105
-
-`pnpm typecheck`
106
-
- Daemon handler/shared module change:
107
-
-`pnpm test:unit`
108
-
-`pnpm test:smoke`
109
-
- iOS runner/Swift change:
110
-
-`pnpm build:xcuitest`
111
-
112
-
Run integration tests when behavior crosses platform boundaries:
113
-
-`pnpm test:integration`
114
-
115
-
## Measurement
116
-
- Track files touched per fix, cycle time, and iOS/Android regressions.
117
-
118
-
## Local Commands
119
-
120
-
- Run CLI: `pnpm ad <command>`
121
-
- For verification commands, use the **Testing** section above.
122
-
123
127
## Pull Requests
124
-
- Before opening PR: ensure no conflict markers and no unmerged paths.
125
-
- Run required checks for touched scope (at minimum `pnpm typecheck`; plus test commands from **Testing** above).
128
+
- Before opening PR: ensure no conflict markers/unmerged paths.
129
+
- Run required checks for touched scope from **Testing Matrix**.
126
130
- PR body must be short and include:
127
-
-`## Summary` with key behavior changes
131
+
-`## Summary`
128
132
-`## Validation` with exact commands run
129
-
- Call out known gaps or follow-ups explicitly; do not hide failing checks.
133
+
- Call out known gaps/follow-ups explicitly.
134
+
- Include touched-file count and note if scope expanded beyond initial command family.
135
+
136
+
## Priority Order
137
+
- When guidance conflicts, apply in this order: **Hard Rules -> Scope -> Testing Matrix -> style/preferences**.
0 commit comments