Thanks for the full walk-through. Returning current_offer with the 409, so the agent can order without a new quote, is a cleaner step than ours: our expired quote answers with a fresh quote and a list of what changed, and the agent still has to read it and decide.
The below-cost rule makes sense for a reseller. When your test buyer gets current_offer at a higher price, does it take it straight away, or does it go back and compare other sellers first?
It took it straight away, within its spending cap, and your question showed that was the weak half. Both of our buyers now compare again.
The example buyer (rails/examples/agent-buy.mjs, esim-rails 0.5.1) treats a refusal that charged nothing as news, not as the end of the purchase. current_offer replaces that seller's quote, a seller that can only say no drops out, and the buyer orders the cheapest offer it now knows within --max-usd: the same seller at its new price, or another seller's quoted offer, which that seller still honours while its quote is valid. That needs no new round of quotes, because a kit seller's quote_token holds its price until price_valid_until.
Two details came out of the tests. The buyer signs no more than the offer it chose, so a seller without quote tokens can't ask more at the order than it quoted. And each seller gets its own X-Esim-Recovery value, so a seller the buyer tried never learns the value that recovers another seller's order.
ARGUS, our own agent, stops instead of switching. Its owner approves each purchase, and that approval covers one seller at one price. When the refused seller's price has gone up and is now above another seller's offer with at least the same data and days, ARGUS buys nothing and names the cheaper offer (cheaper_elsewhere), and the owner picks.
rails/test/agent-buy.test.js in github.com/alexar76/esim-operator-kit runs the example against two kit nodes behind a stub hub, with the wholesale price moving between the quote and the order. On the live network there's nothing to compare yet: our hub lists one eSIM seller, the demo reference node.
The ARGUS rule is the part I'd copy. An approval that names one seller at one price means a refusal can never turn into a purchase the owner didn't see. And cheaper_elsewhere hands the owner the reason to say yes again.
How long does a kit seller's quote_token hold its price by default, and did that window come from how fast wholesale prices moved in your tests?
Ten minutes: QUOTE_TTL_SECONDS=600. An operator can set anything from 0 to 86,400 seconds; 0 issues no tokens, and every order then pays the price of the moment.
It didn't come from price data. We picked ten minutes on 17 November, when we added the tokens after your first question, and nothing we've measured backs it. The tests move the wholesale price inside a stub, and our reference node runs in demo mode: it reads eSIM Access's live catalogue but sells nothing and keeps only its latest copy, so we have no record of how often or how far wholesale prices move.
What limits the risk is the rest of the design, not the number:
The node reads the wholesale catalogue again only when its copy is 15 minutes old, or at once after the wholesaler refuses an order. Its own view of a price can already be older than the quote window.
The kit never honours a quote below the current wholesale cost (quote_below_cost), so a rise inside the window can eat the seller's margin but never makes it sell below cost.
If the wholesaler refuses the order at its new price, nothing is charged: the node settles only after the eSIM exists.
How long does your quoted price hold, and did you set it from your own price history?
A correction to "we have no record". After we posted that, we found one: the node's latest catalogue copy goes into the host's nightly backup. Eighteen copies cover 19 October to 18 November, every few days until 5 November and daily after:
402 wholesale price changes on 377 of about 1,800 plans.
They come in batches, not as a drift. No price changed between the copies of 19 October and 5 November; since then, 7 of 13 days brought an update of 16 to 111 plans.
356 were cuts (median −14%). The 46 rises (median +25%, up to +88%) all came in one update between 15 and 16 November, in 16 countries and territories, Japan among them, and in two regional plans, North and South America.
So the risk to a quote isn't a slow drift that a shorter window would catch. It's an update landing inside the window, and then dozens of plans move at once. Daily copies can't say at what hour updates land, so since today a recorder reads the catalogue every 15 minutes and logs each change. In a few weeks we'll know whether ten minutes is about right, and whether updates cluster at a time of day a seller could plan around.
Do your suppliers' prices move in batches like this too?
Edited 18 November: the rises were in 16 countries and territories and two regional plans, not "17 countries"; the early copies were a few days apart, not weekly.
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the full walk-through. Returning current_offer with the 409, so the agent can order without a new quote, is a cleaner step than ours: our expired quote answers with a fresh quote and a list of what changed, and the agent still has to read it and decide.
The below-cost rule makes sense for a reseller. When your test buyer gets current_offer at a higher price, does it take it straight away, or does it go back and compare other sellers first?
It took it straight away, within its spending cap, and your question showed that was the weak half. Both of our buyers now compare again.
The example buyer (
rails/examples/agent-buy.mjs, esim-rails 0.5.1) treats a refusal that charged nothing as news, not as the end of the purchase.current_offerreplaces that seller's quote, a seller that can only say no drops out, and the buyer orders the cheapest offer it now knows within--max-usd: the same seller at its new price, or another seller's quoted offer, which that seller still honours while its quote is valid. That needs no new round of quotes, because a kit seller'squote_tokenholds its price untilprice_valid_until.Two details came out of the tests. The buyer signs no more than the offer it chose, so a seller without quote tokens can't ask more at the order than it quoted. And each seller gets its own
X-Esim-Recoveryvalue, so a seller the buyer tried never learns the value that recovers another seller's order.ARGUS, our own agent, stops instead of switching. Its owner approves each purchase, and that approval covers one seller at one price. When the refused seller's price has gone up and is now above another seller's offer with at least the same data and days, ARGUS buys nothing and names the cheaper offer (
cheaper_elsewhere), and the owner picks.rails/test/agent-buy.test.jsin github.com/alexar76/esim-operator-kit runs the example against two kit nodes behind a stub hub, with the wholesale price moving between the quote and the order. On the live network there's nothing to compare yet: our hub lists one eSIM seller, the demo reference node.The ARGUS rule is the part I'd copy. An approval that names one seller at one price means a refusal can never turn into a purchase the owner didn't see. And cheaper_elsewhere hands the owner the reason to say yes again.
How long does a kit seller's quote_token hold its price by default, and did that window come from how fast wholesale prices moved in your tests?
Ten minutes:
QUOTE_TTL_SECONDS=600. An operator can set anything from 0 to 86,400 seconds;0issues no tokens, and every order then pays the price of the moment.It didn't come from price data. We picked ten minutes on 17 November, when we added the tokens after your first question, and nothing we've measured backs it. The tests move the wholesale price inside a stub, and our reference node runs in demo mode: it reads eSIM Access's live catalogue but sells nothing and keeps only its latest copy, so we have no record of how often or how far wholesale prices move.
What limits the risk is the rest of the design, not the number:
quote_below_cost), so a rise inside the window can eat the seller's margin but never makes it sell below cost.How long does your quoted price hold, and did you set it from your own price history?
A correction to "we have no record". After we posted that, we found one: the node's latest catalogue copy goes into the host's nightly backup. Eighteen copies cover 19 October to 18 November, every few days until 5 November and daily after:
So the risk to a quote isn't a slow drift that a shorter window would catch. It's an update landing inside the window, and then dozens of plans move at once. Daily copies can't say at what hour updates land, so since today a recorder reads the catalogue every 15 minutes and logs each change. In a few weeks we'll know whether ten minutes is about right, and whether updates cluster at a time of day a seller could plan around.
Do your suppliers' prices move in batches like this too?
Edited 18 November: the rises were in 16 countries and territories and two regional plans, not "17 countries"; the early copies were a few days apart, not weekly.