Skip to content

Stop the lint pipeline from reporting issues it re-creates itself - #5788

Draft
jurgenwerk wants to merge 1 commit into
mainfrom
lint-pipeline-whitespace-loop
Draft

Stop the lint pipeline from reporting issues it re-creates itself#5788
jurgenwerk wants to merge 1 commit into
mainfrom
lint-pipeline-whitespace-loop

Conversation

@jurgenwerk

Copy link
Copy Markdown
Contributor

The AI assistant could loop forever on a correctness check it could never satisfy. The realm lint pipeline runs prettier before template-lint, and the two disagree by construction for any text node longer than prettier's 80-column print width:

bot patch (collapse text onto one line)
        │ applies
        ▼
prettier ── wraps the long text node back across indented lines
        │
        ▼
template-lint ── no-whitespace-for-layout flags the wrap (no autofix)
        │
        ▼
checkCorrectness reports errors ──► bot patches again ──► same bytes, same errors

Every "fix" patch applied, was rewrapped to byte-identical content, and produced the same two lint messages — reproduced end to end against a real looping session's file.

Two changes:

  • The template linter in the lint task now runs with no-whitespace-for-layout disabled. Prettier's wrapping is canonical in this pipeline and the whitespace collapses at render, so the rule only ever contradicted the formatter. (Host source already silences this rule inline where it conflicts.)
  • As a generic backstop, PatchCodeTool detects when the lint/format pass reverts an applied patch back to the original content: it skips the no-op save and adds a lint issue saying reformatting-only patches cannot make progress, so the model stops retrying instead of looping.

A lint-endpoint test covers the wrapped-long-text case; other template-lint rules from the extends chain still fire (verified against the pipeline directly).

The realm lint pipeline runs prettier before template-lint. Prettier wraps
text nodes longer than its print width across indented lines, and the
no-whitespace-for-layout rule flags exactly that wrap with no autofix — so
for any over-width text node the pipeline reported an error no edit could
clear, and the AI assistant looped forever re-patching whitespace that the
formatter reverted on every save. The template linter now runs with that
rule disabled; the wrapped whitespace collapses at render, so nothing is
lost by not flagging it.

As a generic backstop, PatchCodeTool now detects when the lint/format pass
reverts an applied patch back to the original file content. It skips the
no-op save and reports alongside the lint issues that reformatting-only
patches cannot make progress, so the model stops retrying.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 0m 7s ⏱️
4 192 tests 4 178 ✅ 14 💤 0 ❌
4 211 runs  4 197 ✅ 14 💤 0 ❌

Results for commit 6eb1dfa.

Realm Server Test Results

    1 files      1 suites   15m 56s ⏱️
2 174 tests 2 174 ✅ 0 💤 0 ❌
2 254 runs  2 254 ✅ 0 💤 0 ❌

Results for commit 6eb1dfa.

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