Skip to content

fix(platform): bound template whitespace recovery - #4564

Closed
yannickmonney wants to merge 1 commit into
mainfrom
fix/automation-template-whitespace-scan
Closed

yannickmonney wants to merge 1 commit into
mainfrom
fix/automation-template-whitespace-scan

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Malformed template spans could repeatedly scan the same long whitespace suffix during lexical recovery. When a later delimiter existed, candidate validation could also repeatedly trim that suffix. A reader scoped to each template scan now caches the whitespace interval and supplies the exact trimmed source boundary to the existing parser.

Legacy-first segmentation, complete comments, source/depth/token limits, exact offsets and valid long padding remain covered. This bounds the repeated shared-suffix work; it does not claim a universal latency bound for every possible input.

Validation:

  • Normal Vitest server project: 69 tests passed across tokens, parse and limits, including the existing compatibility fuzz and real-runner boundary cases.
  • Exact-base negative control failed all five new regressions. A cache-only control retaining the old candidate trim failed three, proving that both recovery paths need the fix.
  • Bounded 16/64 failed-span probes with 16 KiB padding fell from 131,824–540,800 whitespace checks to 16,385 in all six samples.
  • Scoped lint, format, manual reference checks and normal commit hooks passed. Independent source review accepted the frozen patch; complete hosted checks remain required before merge.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

This reviewed source is now included in #4565 at 7a526754c1c453e547e6ebb0234bf38c730009e3, together with the other release safety repairs. Independent composition review verified the source blobs are unchanged and the shared coverage register retains every addition.

I am marking this PR as draft to prevent a separate merge and cancelling only its superseded CI runs. The replacement must pass its own seven complete workflows; this PR's checks are retained as historical evidence. This change has not shipped. This PR will be closed as superseded after #4565 merges.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Implemented in #4565, merged as 0ee5fd9656dc12f08976155d956ee76fe39f4ea3, including the reviewed test-instrumentation correction and the parser coverage row. Closing this superseded draft.

@yannickmonney
yannickmonney deleted the fix/automation-template-whitespace-scan branch October 10, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant