@t2000/engine 1.25.0 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3771,6 +3771,34 @@ var swapQuoteTool = buildTool({
3771
3771
  required: ["from", "to", "amount"]
3772
3772
  },
3773
3773
  isReadOnly: true,
3774
+ // [SPEC 20.2 / D-1 (a) follow-on, 2026-05-10] Quote results MUST NOT be
3775
+ // cross-turn deduped by microcompact. Every call legitimately produces a
3776
+ // new result — pool reserves move per block, slippage windows update, the
3777
+ // best route can shift if liquidity moves, and the result's `discoveredAt`
3778
+ // timestamp is different per call by definition.
3779
+ //
3780
+ // Pre-fix: microcompact's default `cacheable: true` replaced the second
3781
+ // identical-input swap_quote tool_result with a `[Same result as call #N
3782
+ // — swap_quote with identical inputs. Result unchanged.]` placeholder.
3783
+ // The placeholder lied — the route and `discoveredAt` had legitimately
3784
+ // updated. Audric's bundle fast-path (which reads quote results from the
3785
+ // persisted ledger to thread `step.cetusRoute`) lost the fresh route and
3786
+ // had to fall back to whichever earlier same-input call WAS preserved
3787
+ // (the "first-seen" anchor, often >30s old → rejected by audric's
3788
+ // `isCetusRouteFresh` 30s gate → fast path missed → bundle paid full
3789
+ // ~400-500ms `findSwapRoute()` round-trip at confirm time).
3790
+ //
3791
+ // Production smoke trace (2026-05-10, session s_1778362657811_c0ed9009a5fb):
3792
+ // T0 swap_quote(USDC,SUI,0.5) → route X discovered
3793
+ // T0+34s swap_quote(USDC,SUI,0.5) [bundle] → route Y discovered (FRESH)
3794
+ // T0+50s "Confirm" → fast-path walks history → walker sees placeholder
3795
+ // on route Y, falls back
3796
+ // to route X (52s old)
3797
+ // T0+52s prepare → cetusRoute STALE → fallback → no perf win
3798
+ //
3799
+ // With `cacheable: false`: route Y stays as full content in the ledger,
3800
+ // walker finds it (~18s old), passes the freshness gate, fast path fires.
3801
+ cacheable: false,
3774
3802
  async call(input, context) {
3775
3803
  const walletAddress = context.agent ? context.agent.address() : getWalletAddress(context);
3776
3804
  const sink = getTelemetrySink();