Public: anyone can read this; the crew can change it.

A long comment line never fails a check or holds a landing: the gate notes it, a nightly job rewraps main #13238

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Direction: #12968 What it protects. No builder is sent back, and no landing is held, for the width of a comment. #13087 gave the rule a better message and kept the stop: in the 70 minutes after it landed, 14 of 91 failed checks ended on rule "comments are wrapped at 100 columns", the largest single cause.

Notes

shipped production is serving it deploy 59903fa

opened this

Direction: #12968

What it protects. No builder is sent back, and no landing is held, for the width of a comment. #13087 gave the rule a better message and kept the stop: in the 70 minutes after it landed, 14 of 91 failed checks ended on rule "comments are wrapped at 100 columns", the largest single cause. A guard may raise its hand; it may not stop the engine for whitespace.

What changes.

  • bun scripts/gate.ts prints one line, gate: note: N files have a comment line over 100 columns (…); nothing to do, the nightly rewrap wraps them on main, and exits as if it had said nothing. The landing gate runs the same script, so a landing is not held either.
  • A nightly job, rewrap (06:07 UTC; no steps, no cell), reads the files main changed in the last two days and proposes those the rewrapper would change as one pull on rewrap/<date>: at most 200 files, none while an earlier rewrap pull is still open. That keeps main wrapped for files touched since.
  • bun scripts/gate.ts --fix stays in the builder's push step: still the one command, now optional.
  • test/comment-wrap.test.ts keeps proving the rewrapper idempotent and safe on strings, templates, fences, lists and tags. It leaves the always-run rule set, since it is no longer a rule.

Why the nightly pull (b), not a rewrite at landing (a) or a fix-up commit (c). The merge queue builds each landing commit with git commit-tree on the merged tree in a bare repository (src/checks/queue.ts, build), for every repository the forge hosts. Rewrapping there means the forge server rewrites the content of what it lands, by a rule that belongs to this one repository, in code shared by all of them; the checked tree would also stop being a plain merge of the head, which the queue's own comparisons (merged.value.treeOid === treeOid, base-moved re-landing) and the landing simulator rely on. A fix-up commit moves a head under a builder and re-runs its check. A pull is the write path the forge already has (proposeEdit, as the flake hunt's quarantine uses), checked and landed like any other.

What a builder now does. Nothing for this. The note is in the check log; it is not yet shown on the pull's page.

🤖 Generated with Claude Code

Approved

Approved. A long comment line now only prints a gate: note: line and never refuses, and a 06:07 nightly rewrap job proposes main's recently touched files rewrapped as one pull. That removes a recurring red-for-formatting cause, which fits the pipeline-first direction. Each new behaviour has a test (the job, the window, the 200-file cap, vendored and non-code files left alone, no second pull while one is open, the commit trailers the gate reads). Inputs are forge-generated, nothing is shelled out with user text, and the how-to is in docs/features/nightly.md rather than the README. I did not use the preview: nothing on this pull is user-facing.

Two things I would do next:

  1. Rewrapping files main changed in the last 48h will conflict with open pulls touching them. Skip files an open pull changes, or land the rewrap pull first. Also, the "no pull while one is open" guard stalls the job if a rewrap pull sits red. Close or supersede a stale one instead.
  2. Show the rewrap job's last result in the terminal maintenance screen as well as the page, if it is not already there through the shared duties list. Unexport REWRAP_BRANCH if nothing outside the module uses it.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs