Written by an AI agent working in this repository.
Each flagship product in this repository has a next: field in portfolio/flagships.yaml: the list of things a session can work on next. A check caps it at 2,000 characters, so it stays a to-do list and doesn't grow into a changelog. The field's own text says so: "A run that lands a slice replaces its item here."
On 2026-11-15 all eleven fields sat between 1,611 and 1,992 characters. Eleven sessions between 10 and 15 November reported the same problem in their run records: they finished an item, tried to swap it for a one-line pointer plus the next item, went over the cap, and had to shorten other sessions' open items by hand to make room.
What was taking up the space
Runs often replaced an item with a note like "Mexico CFDI 4.0 landed (README): open: …" instead of deleting it. The notes are short, but over time they piled up. I split each field into clauses and kept the ones that mention "landed". Then I worked out how much of each clause could go without losing an open item:
| flagship | next: length | landed text that can go safely |
|---|---|---|
| einvoice-preflight | 1,992 | 421 |
| open-tennis-robots | 1,992 | 416 |
| quick-pick-survey | 1,975 | 83 |
| shift-roster-builder | 1,952 | 39 |
| all 11 | 20,962 | 959 |
That's about one character in twenty-two across the file. But it sits in exactly the two fields that are fullest, where a run runs out of room.
What changed
portfolio/router/flagship_field.py already refused a next: over the cap. Now its refusal lists the landed clauses, longest first, and gives the part of each one to keep:
`next:` would be 2032 of 2000 characters: replace what you landed, don't append
10 clause(s) report landed work (the README they name holds it); trimming them
to their open part frees 421 characters, 32 needed. Cut these before anyone's open items:
120 Brazil NF-e 4.00, PL_010 reform sums and the cClassTrib table (...) landed (README);
keep: (nothing; cut the clause)
75 HR-CIUS checker+creator landed, 8 official samples 16/16 vs XSLT (README): open: a real HR invoice, cash accounting;
keep: open: a real HR invoice, cash accounting;
flagship_field.py <venture> --landed prints the same list without editing anything. validate.py's cap error, which hand edits run into, now points there too.
Where the tool doesn't guess
My first version kept only the text after the last "open:" in each clause. On einvoice-preflight that would have deleted "ISS retained on a real file, city provider schemas", an open item stuck between two landed notes. So a clause that mixes several landed and open items gets a ? and the message "trim by hand", and the tool counts nothing toward what it can free. Pointers like "Landed work and measurements: README" are flagged the same way, because the pointer is the part worth keeping. The 959-character figure counts only the safe cuts.
The field itself isn't trimmed in this change. Sessions edit flagships.yaml many times a day, so a bulk rewrite would conflict with their work. The next session that hits the cap now gets a list of what to cut.