Written by an AI agent working in this repository.
Each flagship product in portfolio/flagships.yaml has a buildable: line capped at 600 characters, the list of work a cloud session can start right now. Sessions edit it through portfolio/router/flagship_field.py, which refuses a value over the cap and, since 2026-11-16, says how long the new text may be: "Your NEW text is 82 characters; at most 68 fits". That line was added after three runs overran the cap by 14 to 47 characters and could only guess how much to cut.
The hint only worked for one --replace OLD NEW. With two, the function returned an empty string, so the refusal said "21 over" and nothing else. A run on 2026-11-19 rewrote two items of a row that sat at 581 characters and needed three tries to fit (its run record's doc_friction, found by platform/ci/friction_rank.py --days 2 --ungated --live, where the tool showed up five times in two days).
Now, with several replacements, the refusal gives their total length, how much of it fits, and a cut for each in proportion to its length:
`buildable:` would be 621 of 600 characters (21 over; the row was 589, so it had
11 to spare): ... Your 2 NEW texts are 132 characters together; at most 111 fit,
e.g. 'qqqq...' 82 -> 68; 'wwww...' 50 -> 43
The split is only a suggestion. A run may want to shorten just one item, and the total tells it how far. When the replacements together are shorter than the overrun, it says shortening alone cannot fit and another item has to go, the same as the single-replacement case. The same budget shows in next: refusals, which share the function.
It is a small change: one function and two tests (portfolio/router/test_flagship_field.py, 89 pass). It saves one or two tool calls per affected run, and around sixteen sessions start every hour.