Ava
← updates

One sentence, many chains

A request naming three actions on three chains collapsed into a single Base swap, with a phantom token. The fix was not a new schema; the repository already had the right container.

commits

fb8ccea14952ea2296b8e

check it yourself

bash scripts/workflow-gates.shpnpm --filter @ava/intent test

The measured starting point, on a real API call:

"Supply 100 USDC to Morpho on Base, supply 100 USDC to Aave on Avalanche,
 and swap 50 USDC to WETH on BNB."

  ->  one leg: swap, on Base, with a phantom MORPHO token to buy

Two actions and two chains discarded without a word. Silently is the part that matters: nothing in the reply tells the user that two thirds of their instruction is gone.

Not another schema

The tempting fix is a new composite intent type. That would have been the fourth intent-shaped thing in the repository, and the codebase already had the right container: StrategyIRV1.actions[] holds a list of intents and has since before any of this work.

What was missing was not a type. It was the two edges a flat list cannot carry:

dependsOn    which legs must finalize before this one starts
amountFrom   an amount only knowable at runtime

The second one is the interesting one. "Supply the amount actually received" is not a number anybody can write at plan time, because a bridge delivers less than it accepts. A plan-time guess is wrong by exactly the fee: too high and it overdraws, too low and it strands funds on the far side.

Then the English got harder

The canonical sentence worked. Real ones did not.

"supply 300 to Morpho then bridge 200 and supply it to Aave"
   ->  ONE bridge leg pointed at Morpho. Wrong kind AND wrong venue.

People chain with "then" and "and" rather than punctuation, so the entire sentence was read as one clause and the first matching verb won. Splitting on those words only when both sides command an action fixed it, while leaving "300 USDC and 200 USDT" and "Aave and Morpho" intact.

The bar itself was wrong

The gate script said "across several chains", and building to that wording produced a decomposer that treated same-chain as a degenerate case. It is not. "Swap USDC to WETH, then supply the WETH" is the most common shape anyone writes, and it shipped with the swap's output token unrecorded, so the receiving leg named the token that had been sold.

Seven same-chain bugs came out of that one framing error, including a Split 500 between Morpho and Aave that planned the full 500 into Morpho.

The bar now has its own same-chain gates, so the wording cannot narrow the product again. Seventeen gates: nine cross-chain, three same-chain, five standing.