If you’re literally talking about outcomes of “a” and “b”, then something like this should work:
{{{ [tag[A]get[outcome]join[]splitregexp[b+]] :map[split[]count[]] +[maxall[]] }}}
We join together the outcome strings, then split on any run of b's. This leaves us with a list of runs of a's. We take the length of each run and return the maximum value of all of them.
We could make this slightly more generic, where we don’t know about b, but only not-a with this version:
<$let re="[^a]+">
{{{ [tag[A]get[outcome]join[]splitregexp<re>] :map[split[]count[]] +[maxall[]] }}}
</$let>
But this technique only works if your outcome values are single characters.
For something more generic, I’m sure we could write a procedure that finds the longest contiguous group of a given title in a title-list. But, as big a fan as I am of recursion, I still struggle to turn simple recursive JS functions into TW procedures or functions.
If someone else wants to have a go, here’s a pretty simple JS version:
const maxContiguous = (x, xs, m = 0) =>
xs.length === 0
? m
: x === xs[0]
? maxContiguous (x, xs.slice(1), m + 1)
: Math.max(m, maxContiguous(x, xs.slice(1), 0))
maxContiguous ('a', 'abaabbbabaaaaabaaabaaa') //=> 5