diff --git a/examples/circle-e2e.ts b/examples/circle-e2e.ts index 65e3d04..6ffeacd 100644 --- a/examples/circle-e2e.ts +++ b/examples/circle-e2e.ts @@ -464,11 +464,21 @@ async function demoStaleQuoteAdvisory() { } catch (e: any) { console.log(`\n┌─ Scenario 5 result ──────────────────────────────────────`); console.log(`│ ✓ Stale quote detected and recorded.`); - console.log(`│ Capsule: stale_quote → observe (advisory)`); - console.log(`│ Bench Exp D: 96% E2E across 932 Arc tx`); - console.log(`│ Recommendation: reorder workflow to`); - console.log(`│ think → discover → estimate → pay → verify`); - console.log(`│ (PR #3 will implement auto-reorder; PR #2 is detection + audit)`); + console.log(`│ Capsule: stale_quote → observe (advisory)`); + console.log(`│ Bench Exp D: 96% E2E across 932 Arc tx`); + console.log(`│`); + console.log(`│ Repair options (caller decides based on think semantics):`); + console.log(`│`); + console.log(`│ (a) If think is quote-independent (Bench Exp D pattern):`); + console.log(`│ reorder to: think → discover → estimate → pay → verify`); + console.log(`│`); + console.log(`│ (b) If think reads quote.price or quote.expires_at:`); + console.log(`│ split think into pre-quote (selection) +`); + console.log(`│ post-quote (price-check) halves`); + console.log(`│`); + console.log(`│ (c) Request longer quote TTL OR refresh quote before pay`); + console.log(`│`); + console.log(`│ (PR #3 will implement automatic reorder for case (a))`); console.log(`└──────────────────────────────────────────────────────────\n`); } } diff --git a/packages/core/src/engine/seed-genes.ts b/packages/core/src/engine/seed-genes.ts index 73c257f..9babda5 100644 --- a/packages/core/src/engine/seed-genes.ts +++ b/packages/core/src/engine/seed-genes.ts @@ -31,5 +31,5 @@ export const SEED_GENES: Omit[] = [ // it records the failure so an agent's preflight hook can reorder its own workflow // (think → discover → estimate → pay → verify). 48/50 E2E success (96%) across 932 Arc tx. // Strategy 'observe' = capsule-records-only, no provider execution. - { failureCode: 'stale_quote', category: 'service', apiLayer: 'wallets-api', strategy: 'observe', params: { reorder_recommendation: 'think → discover → estimate → pay → verify', bench_validation: 'Exp D: 48/50 success (96% E2E) across 932 Arc Testnet tx' }, successCount: 48, avgRepairMs: 30, platforms: ['circle'], qValue: 0.96, consecutiveFailures: 0 }, + { failureCode: 'stale_quote', category: 'service', apiLayer: 'wallets-api', strategy: 'observe', params: { bench_validation: 'Exp D: 48/50 success (96% E2E) across 932 Arc Testnet tx', reorder_recommendation_when_think_independent: 'think → discover → estimate → pay → verify', alternative_when_think_consumes_quote: 'split think into pre-quote (selection) and post-quote (price-check) halves', additional_options: ['request longer quote TTL from facilitator', 'refresh quote with quick second discover before pay'], caveat: 'late_discover is valid only when think does NOT consume the quote. If think reads quote.price or quote.expires_at, agent must split think or use one of the alternative options.' }, successCount: 48, avgRepairMs: 30, platforms: ['circle'], qValue: 0.96, consecutiveFailures: 0 }, ];