Commit 1bcabae
committed
fix(incremental): round-2 review — terminator mention gate, defense restoration, checkpoint slimming
Second adversarial pass (4 finder angles, ~40 probes) over the previous
fix commit. One shipped-input correctness finding, rest defense-in-depth:
- terminator label mentions: the injection terminator is a synthetic
DEFINITION, so a tail-side `[__aimd_injection_terminator__]` mention
(shortcut/full/image form) resolved against it while the full parse
renders literal text (probe-confirmed by two independent reviewers,
persisting into the settled document). Structural fix over a doc
caveat: frames whose pre-injection tail contains the label take the
full path (tailMentionsTerminator gate); prefix mentions need no check
(unresolved => taint-pinned into the tail; resolved => the real def
wins first-def-wins over the terminator). Arbiter fixtures for all
three reference forms.
- resume-validity now gates the sticky-uninjectable short-circuit too (a
regressed cache boundary must degrade to a fresh walk, never a stale
verdict), and a position-less top-level mdast child makes the plan
uncacheable + restarts fresh (a resumed walk would re-visit it and
duplicate its cached events — unreachable with the shipped chain,
closed structurally).
- G4's straddle scan and the prefix cut give back their round-1 early
breaks: the defensive gate must not share the ordered-children
assumption it exists to catch (the O(top-level) cost is noise); the
injection walk keeps its breaks (event ORDER already assumes document
order there).
- alignPrefixCut's leading-run branch tightened to the probe-verified
model exactly: excess leading text is only accepted with ZERO stripped
slots (hoist merges into a slot whenever one exists).
- MarkdownContent wraps the engine in a throw fence: the scan checkpoint
is advanced in place BEFORE the tail parse, so a mid-frame throw (an
engine bug, or a plugin choking on the synthetic tail shape) used to
leave the ref holding a state whose checkpoint described newer content
— with a tail-repair preprocessor's non-append shapes that could
eventually freeze an unsafe prefix. Now: clear the ref, full-parse the
frame, dev-mode console.error.
- SSR routes through the plain full-parse branch: the engine's scan only
exists to seed the NEXT frame's checkpoint, and a per-request render
has no next frame (was a dead O(document) line-lex per SSR'd message).
- FreezeScanCheckpoint drops its lines array — it retained a full copy
of the document (~2-3x doc size per mounted instance) to answer a
question only ever asked about ONE line: blocker 4's next-line settle.
Candidates now settle eagerly (tri-state on the candidate; only the
newest can be pending), same verdicts, resume≡fresh property intact.
- incrementalParseEnabled JSDoc updated to the v2 gate list (the two
v1-only bullets — cross-chunk and [^ — were the IDE-visible surface);
stale 'caller bypasses' test comment fixed.
Cleared by probe in this round (no action): StrictMode double-invoke /
concurrent abandonment / checkpoint resume idempotence; rolling-line and
countNewlines bound fenceposts vs reference implementations; plan-cache
monotonicity under splice/full alternation and suffix churn; every
terminator/leading-hoist attack shape (setext, lazy continuation, defList
after link-def-last, 1-3-space indents, double tables, growing hoist,
comment+table starts, phantom-suffix interplay); all round-1 deletions
verified consumer-free with equivalent replacement coverage.
810 tests green (unit + browser); typecheck/lint/prettier/build clean.1 parent 3419941 commit 1bcabae
7 files changed
Lines changed: 175 additions & 63 deletions
File tree
- packages/core/src
- components
- incrementalParse
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
467 | 473 | | |
468 | 474 | | |
469 | 475 | | |
| |||
480 | 486 | | |
481 | 487 | | |
482 | 488 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
500 | 530 | | |
501 | 531 | | |
502 | 532 | | |
| |||
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | | - | |
199 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
200 | 208 | | |
201 | 209 | | |
202 | 210 | | |
203 | | - | |
204 | | - | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
209 | 223 | | |
210 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
211 | 227 | | |
212 | 228 | | |
213 | 229 | | |
214 | 230 | | |
215 | | - | |
| 231 | + | |
216 | 232 | | |
217 | 233 | | |
218 | 234 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
Lines changed: 18 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
135 | | - | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | | - | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| |||
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
368 | | - | |
| 369 | + | |
369 | 370 | | |
370 | 371 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
| |||
393 | 392 | | |
394 | 393 | | |
395 | 394 | | |
396 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| |||
484 | 489 | | |
485 | 490 | | |
486 | 491 | | |
487 | | - | |
| 492 | + | |
488 | 493 | | |
489 | 494 | | |
490 | 495 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
551 | 568 | | |
552 | 569 | | |
553 | 570 | | |
| |||
Lines changed: 59 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
110 | 120 | | |
111 | 121 | | |
| 122 | + | |
112 | 123 | | |
113 | 124 | | |
114 | 125 | | |
| |||
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
166 | | - | |
167 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
168 | 190 | | |
169 | 191 | | |
170 | | - | |
| 192 | + | |
171 | 193 | | |
172 | 194 | | |
173 | 195 | | |
| |||
200 | 222 | | |
201 | 223 | | |
202 | 224 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
207 | 244 | | |
208 | 245 | | |
209 | 246 | | |
| |||
342 | 379 | | |
343 | 380 | | |
344 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
345 | 385 | | |
346 | 386 | | |
347 | | - | |
348 | 387 | | |
349 | | - | |
350 | | - | |
| 388 | + | |
351 | 389 | | |
352 | 390 | | |
353 | 391 | | |
| |||
550 | 588 | | |
551 | 589 | | |
552 | 590 | | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
558 | 598 | | |
559 | 599 | | |
560 | 600 | | |
| |||
0 commit comments