Skip to content

fix: normalize blank runs when stripping legacy managed markers - #678

Merged
0xPlayerOne merged 1 commit into
mainfrom
feat/preserve-policy-doc-sections
Sep 30, 2026
Merged

0xPlayerOne merged 1 commit into
mainfrom
feat/preserve-policy-doc-sections

Conversation

@0xPlayerOne

@0xPlayerOne 0xPlayerOne commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Why

The legacy policy templates carried an unclosed config-aware-policy flag. When the v1.37.0 refresh strips that residue, it removed only the marker line — leaving the blank line it occupied behind, producing double blank lines that oxfmt collapses. Net effect: every pre-block consumer's upgrade PR failed format:check (pi-autosuggestions #81 was the first; the whole pre-block fleet would have hit it).

What

After stripping residue, collapse runs of three or more newlines to one blank line — matching exactly what the format gate enforces. The strip keeps its original line-scoped regex; paired blocks keep their spacing. The migration regression test gains the no-triple-newline invariant.

Validation

  • Full suite 551/551 green (the migration test asserts the invariant).
  • lint / format / type-check clean.

Follow-up to #668 / #667.

The legacy templates carried an unclosed config-aware-policy flag; stripping
it left the blank line it occupied behind, producing double blank lines that
oxfmt collapses — and that collapse failed format:check on every pre-block
consumer's upgrade PR (pi-autosuggestions #81 was the first). After stripping
residue, collapse runs of three or more newlines to one blank line, matching
what the format gate enforces. The strip itself keeps its original
line-scoped regex; paired blocks keep their spacing.
@0xPlayerOne 0xPlayerOne changed the title feat: preserve-policy-doc-sections fix: normalize blank runs when stripping legacy managed markers Sep 30, 2026
@0xPlayerOne
0xPlayerOne marked this pull request as ready for review September 30, 2026 18:58
@0xPlayerOne
0xPlayerOne merged commit acd5afc into main Sep 30, 2026
28 checks passed
@0xPlayerOne
0xPlayerOne deleted the feat/preserve-policy-doc-sections branch September 30, 2026 19:08
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