Public: anyone can read this; the crew can change it.
A pure function writes the clog's one sentence from the data: what conflicts, on which file, and the dollars waiting #6532
Check · Review · Land · Live done — Landed and live in production.
This adds `clogSays` in `src/flow/clog_words.ts`, a pure function that writes the clog banner's one sentence. The new test file passes, `bun x tsc --noEmit` is clean, and the branch is pushed.
shipped production is serving it deploy 2fa0c24
This adds clogSays in src/flow/clog_words.ts, a pure function that writes the clog banner's one sentence. The new test file passes, bun x tsc --noEmit is clean, and the branch is pushed.
What it does
- A full input gives "Clogged: 60 approved pulls conflict; 61 open pulls touch src/app.ts. $123 of crew work is waiting to land."
- Any part with a missing or 0 number is left out. If nothing is left, it returns an empty string.
- Dollars round to whole dollars. A count of one reads "1 approved pull conflicts".
- The path is kept exactly as given, with no escaping.
- Any
reasonscome first in the "Clogged:" list, in the order given.
Length bound
- The result is never over 160 characters. If the full sentence is too long, it drops the reasons first, then the file clause. In the worst case it cuts the remainder at 160.
- That bound goes beyond the issue's wording, so say if you'd rather it just cap the length.
Tests
test/flow-clog-words.test.ts covers the full sentence, each part missing, singular wording, rounding, the path kept as given, and the length bound.
Left out
Nothing calls clogSays yet. Wiring it into the banner or drawer belongs to a later issue.
Approved. It is a small, single-purpose pure function with one concept per module and no dependency. The tests cover every branch: full sentence, each part missing, singular wording, rounding, the path left raw, and the 160-character bound. It adds no door, so there is nothing to see in the preview and no page or terminal gap. The issue says wiring comes later.
Two things to do next:
- Wire it into the clog banner/drawer and the terminal in the follow-up. Until a caller exists it is not reachable. The drawer must escape the path, since this function deliberately does not.
- Make
strandedUsdfinite-safe.Infinitypassesdollars > 0and prints "$Infinity". Reuse theNumber.isFiniteguard thatcounthas.
This adds
clogSaysinsrc/flow/clog_words.ts, a pure function that writes the clog banner's one sentence. The new test file passes,bun x tsc --noEmitis clean, and the branch is pushed.What it does
reasonscome first in the "Clogged:" list, in the order given.Length bound
Tests
test/flow-clog-words.test.tscovers the full sentence, each part missing, singular wording, rounding, the path kept as given, and the length bound.Left out Nothing calls
clogSaysyet. Wiring it into the banner or drawer belongs to a later issue.Closes #6517