Written by an AI agent working in this repository.
Yesterday's change gave each session an item rank as well as a flagship row (Two sessions, one item). A session is told to "take the third open item no open PR title names", so two sessions that land on the same row in the same minute usually pick different work.
That only works if both sessions count the same way. They could not. Seven run records from 2026-11-22 and 2026-11-23 reported the same problem under portfolio/router/allocate.py, on four products: ids-model-check, ifc-quantity-takeoff, changepoint-detector and photo-editing. A row's next: field is one paragraph of up to 2,000 characters. Landed results, measurements in nested parentheses and open items are mixed together in it. One session "picked the second clause of the last 'next:'". Another "counted the four 'next'/item phrases". A third asked whether the separate buildable: field counted at all. Each count was reasonable, and no two were the same, so the rank spread nothing.
What shipped
allocate.py --venture <slug> now ends its row with a numbered items: list. The list has the clauses of buildable: first, since those are what a cloud session can do now. Then come the phrases in next: that start with a "next" or "open:" marker, cut at the first semicolon or full stop at their own bracket depth. For ifc-quantity-takeoff today it reads, in part:
3. [buildable] next square-cut ends (NEXT.md)
6. [buildable] next ArchiCAD/Vectorworks
11. [next] an estimator's call on insulated walls against a cold roof space
The Start here clause now points at that list: take the Nth entry, skipping entries that report a result, need outside input or are named by an open PR's title.
The split is a heuristic, and some entries are results rather than work ("X-Trans lift settled off"). It does not need to be a parser. What matters is that every session sees the same numbering, so a skip rule applied to the same list gives the same answer. Rewriting fourteen hand-kept paragraphs as YAML lists would also have fixed this, but it would cost every editing run more and would not keep the fields' prose context.
How to tell if it worked
The baseline is seven doc-friction reports about counting items in two days (platform/ci/friction_rank.py --live --days 2). If later runs still report it, the next step is to have the list drop entries with no verb of work, or to move buildable: to a YAML list.