Repository navigation
Commit 0fef406
authored
* fix(ad-script): let .ad scripts carry scroll --until and wait capture flags
#3197 reported three failures; two were one grammar divergence and the third
was guidance that never arrived.
`scroll "<direction>" --until <selector>` and `wait <target> --raw` worked at
the CLI and parse-failed in a `.ad` script: the script grammar had no flag
vocabulary for either command, so the flag tokens fell through as positionals
and the daemon read `--until` as the scroll amount ("scroll amount must be a
number"). The `.ad` parser now reads each command's own declared flags, and the
line writer emits them back, so a recorded hunt replays as the same hunt rather
than as one fixed gesture. `until` is therefore `recorded: true`: the stop
condition IS the step.
The grammar stays narrower than the CLI on purpose. A script line carries only
what the flag declaration marks recorded, so `--pixels` and `--duration-ms` stay
CLI-only, and `wait` reads the long spellings while `-d`/`-s` stay CLI sugar —
admitting them would reclassify data that pre-existing lines wait on
(`wait text -s so funny` once meant the literal text). An admission test pins
both directions of that contract, the one #3197 broke included.
A tokenizer gap hid behind the first two: `--until 'label="x"'`, one argument at
the shell, split into fragments in a script. A token leading with `'` now reads
as the shell reads it. A candidate must close at end of word, so a line that
parsed before keeps its meaning; the writer refuses to emit such a value bare,
which keeps the round trip a fixed point.
The third report, "No replay tests matched for platform ios" with no next step,
is a messaging fix: the run now says how many sources had no `context platform=`
header versus how many declared another platform, and names the remedy. The
suite's failure projection carries a code and a message and no hint, so the
remedy belongs in that sentence; `--platform web` is answered without advising a
header the parser drops (#1900).
Verified on an iPhone 18 Pro simulator: replaying a hand-written `--until`
script, the missing-target case failing as a proper divergence rather than a
crash, and a recording round-trip that wrote and replayed
`scroll "down" --until "label=\"General\""`.
* fix(ad-script): address review — strict shell parity for single quotes, pinned grammar rules
Single-quoted script values now decode exactly what the shell hands over: the
only escape is `\'` (the one deliberate extension, since a shell's single quotes
cannot carry an apostrophe and a `label="don't"` selector has to be writable in
a script), and a backslash keeps its own character instead of collapsing.
- The tokenizer comment states the scoped guarantee: a whole-word quoted run
gains the shell reading (that is the change), a run the shell would not read
as one argument keeps its old bare meaning.
- The admission test now asserts every script token is a long `--` spelling, so
an `-d`/`-s` regression fails there.
- The `wait` long-form-only comment carries the real trade: writer parity, and
realistic short-flag-waited-text versus an almost-impossible literal that
quoting already solves.
- Docs: script flags are declared-and-recorded ones (no contradiction with the
scroll pixel note), single-quote decode rules match the code, and the
discovery counts sentence is scoped to the no-match error as it actually
behaves.
* fix(ad-script): address round-3 review — backslash-run quote closing, single derived source
- `readSingleQuotedReplayToken` closed on a backslash-quote only via skip-2, so a
value ending in a literal backslash pair (`wait 'C:\\temp\\'`) never closed and
fell back to a bare token keeping the quote characters. The scan now counts the
backslash run and honors a closing quote only after an even run, matching the
documented guarantee; the odd run is the `\'` escape. Split into named helpers
(`findSingleQuotedTokenEnd`, `isBackslashEscaped`), which also clears the
complexity finding.
- The admission test derives flag keys from `scriptFlagEntries` alone; the
`scriptFlagKeys` projection it duplicated is gone. Command membership for the
parse guard comes from the derived `SCRIPT_FLAG_COMMANDS`, not a parallel
literal comparison.
- `isDeclarableReplayPlatform` no longer claims a compile pin it does not have:
the exclusions are now a `Record<NonDeclarablePlatform, true>` table, which
fails to compile in BOTH directions when a platform joins or leaves the gap
between `PlatformSelector` and `ReplayTestPlatform` (verified by planting).
- Maestro `convertScrollAction` sets `warnings` unconditionally like its sibling
converters instead of conditionally spreading it.
* docs(replay): fence .ad grammar examples as sh; pin the backslash decode with a real case
The Rspress Shiki bundle has no `ad` grammar, so the two new fences failed
deploy-preview. The page's existing `.ad` example already renders under `sh`;
the grammar section now matches, and no other fence under website/docs names a
language the bundle lacks.
The apostrophe/backslash test gained the case that actually pins the decode
change: `snapshot --scope 'a\\b'` must carry two literal backslashes. Planting
the superseded collapsing decoder fails exactly this assertion and the
even-run-close test; nothing else in the file noticed.
1 parent 715c8e7 commit 0fef406
20 files changed
Lines changed: 883 additions & 25 deletions
File tree
- packages
- ad-script/src
- internal
- __tests__
- command-registry/src
- maestro/src/internal
- replay-test/src/internal
- __tests__
- src
- __tests__/test-utils
- cli/commands/__tests__
- commands
- replay
- schema
- daemon
- __tests__
- replay-runtime
- replay-suite
- handlers/__tests__
- website/docs/docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
Lines changed: 184 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
208 | 392 | | |
209 | 393 | | |
210 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
56 | 176 | | |
57 | 177 | | |
58 | 178 | | |
| |||
264 | 384 | | |
265 | 385 | | |
266 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
267 | 396 | | |
268 | 397 | | |
269 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
270 | 415 | | |
271 | 416 | | |
272 | 417 | | |
| |||
0 commit comments