| 1 | -- Models at the provider's price; Security and quality with no price of |
| 2 | -- its own. |
| 3 | -- |
| 4 | -- The price book after this migration: |
| 5 | -- |
| 6 | -- - Agent models (`agent_models`): the provider's price, no markup. The |
| 7 | -- version that says so (pv_agent_models_2) took effect on 2026-10-08; |
| 8 | -- if the daily run has not put it in force yet, it is put in force here. |
| 9 | -- A fall, so it applies at once. |
| 10 | -- - The g1t agent rate (`agent_tokens`, `agent_tokens_own`): unchanged. |
| 11 | -- $0.25 per million tokens from 2026-10-22, already announced, for what |
| 12 | -- g1t runs around every model call (the model gateway, secrets, routing, |
| 13 | -- context, pass-through to your own provider), on your own keys too. |
| 14 | -- - Security and quality activation (`security_activation`): $0, in force |
| 15 | -- now. It comes with the g1t plan; its scans stay metered at cost plus |
| 16 | -- 20% (`scan_cpu`, `scan_rows`). A fall, so it applies at once. Billing's |
| 17 | -- daily run ends the activation subscriptions at Stripe and archives |
| 18 | -- the product (features.rs `retire_security_activations`). |
| 19 | -- - Everything else g1t runs stays at cost plus 20%, as it already is. |
| 20 | |
| 21 | -- 1. Models with no markup, in force now. |
| 22 | INSERT OR IGNORE INTO price_changes (id, meter, old_cost_micros, new_cost_micros, markup_percent, old_markup_percent, reason, created_at) |
| 23 | SELECT 'prc_agent_models_at_cost', meter, cost_micros, cost_micros, 0, markup_percent, |
| 24 | 'Lower: models at the provider''s price, with no markup', |
| 25 | strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 26 | FROM prices WHERE meter = 'agent_models' AND markup_percent <> 0; |
| 27 | |
| 28 | UPDATE price_versions SET applied_at = strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 29 | WHERE id = 'pv_agent_models_2' AND applied_at IS NULL; |
| 30 | |
| 31 | UPDATE prices SET markup_percent = 0, updated_at = strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 32 | WHERE meter = 'agent_models' AND markup_percent <> 0; |
| 33 | |
| 34 | -- 2. Security and quality: no price of its own. Anything waiting for it |
| 35 | -- is replaced, as pricing.rs does when a newer decision replaces a |
| 36 | -- waiting version. |
| 37 | UPDATE price_proposals SET status = 'superseded' |
| 38 | WHERE version_id IN (SELECT id FROM price_versions WHERE meter = 'security_activation' AND applied_at IS NULL); |
| 39 | |
| 40 | DELETE FROM price_versions WHERE meter = 'security_activation' AND applied_at IS NULL; |
| 41 | |
| 42 | INSERT OR IGNORE INTO price_changes (id, meter, old_cost_micros, new_cost_micros, markup_percent, reason, created_at) |
| 43 | SELECT 'prc_security_activation_none', meter, cost_micros, 0, 0, |
| 44 | 'Lower: Security and quality comes with the g1t plan, with no monthly price; its scans are charged at cost plus 20%', |
| 45 | strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 46 | FROM prices WHERE meter = 'security_activation' AND cost_micros > 0; |
| 47 | |
| 48 | INSERT OR IGNORE INTO price_versions (id, meter, version, cost_micros, markup_percent, effective_at, reason, created_by, created_at, applied_at) |
| 49 | SELECT 'pv_security_activation_' || (COALESCE(MAX(version), 0) + 1), 'security_activation', COALESCE(MAX(version), 0) + 1, 0, 0, |
| 50 | strftime('%Y-%m-%dT%H:%M:%SZ', 'now'), |
| 51 | 'Security and quality comes with the g1t plan, with no monthly price', 'migration', |
| 52 | strftime('%Y-%m-%dT%H:%M:%SZ', 'now'), strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 53 | FROM price_versions WHERE meter = 'security_activation'; |
| 54 | |
| 55 | UPDATE prices SET cost_micros = 0, markup_percent = 0, updated_at = strftime('%Y-%m-%dT%H:%M:%SZ', 'now') |
| 56 | WHERE meter = 'security_activation' AND cost_micros <> 0; |