railyard/apps/rago/seeds/portfolio/menivor-portfolio.json
caelum0x a126131ed9 feat(consumers): portfolio Rago seeds, the consumer contract fixtures, switch table, key plan and nightly reconciliation (PY1.5)
Railyard side of PY1.5 (dispatch 5.3). Acceptance:
1. tests/contract/consumers/contract.json is the contract PM1.5, PR1.5 and
   the Scribase carve-out test against: env names (RELAY_URL, RELAY_KEY,
   RAGO_URL, RAGO_API_KEY, MINT_URL, MINT_API_KEY, RAILYARD_LIVE), the
   RAILYARD_LIVE switch (default 0), every product's meters and one sample
   event per meter with the <product>:<meter>:<source id> idempotency key.
2. apps/rago/seeds/portfolio/{scribase,menivor,rally}-portfolio.json define
   exactly those meters (valid Rago aggregations, field names where summed)
   under $0 mirror plans; consumers.test.ts checks seeds against the contract.
4. tools/reconcile-portfolio/reconcile.mjs compares each product's own counts
   with Rago's totals per customer, meter and month; on the fixtures the
   difference is 0, and dropped, extra or malformed rows are named (exit 1/2).
5. Nothing switches live in code: docs/CONSUMERS.md gains the Wave P switch
   table. scripts/relay/provision-product-keys.mjs prints names and the box
   steps only (no value is generated, read or printed).
3 (Mint stack, 128 MiB, /metrics scraped): infra-box stacks/mint; Mint's
/metrics handler exists since RY-MT1.
Not in this commit: Mint outbound event webhooks and the paid-event mirror
(see the lane report).

Tests: consumers 3/3, reconcile 2/2, provision 1/1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:57:43 +03:00

133 lines
3.9 KiB
JSON

{
"consumer": "menivor",
"description": "Menivor meters for the Railyard consumer contract (Wave P 5.3). Menivor's own credit packs are the charge of record; this is a $0 usage mirror.",
"currency": "USD",
"billable_metrics": [
{
"name": "Menivor reel rendered",
"code": "menivor.reel.rendered",
"description": "One event per finished reel.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "Menivor preset render",
"code": "menivor.preset.render",
"description": "One event per preset render.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "Menivor character training",
"code": "menivor.lora.train",
"description": "One event per character (LoRA) training run.",
"aggregation_type": "count_agg",
"recurring": false
},
{
"name": "Menivor channel storage (GB)",
"code": "menivor.ott.gb_stored",
"description": "Daily sample of stored channel GB; peak over the period.",
"aggregation_type": "max_agg",
"recurring": false,
"field_name": "gb"
},
{
"name": "Menivor channel minutes delivered",
"code": "menivor.ott.minutes_delivered",
"description": "Minutes of video delivered to viewers.",
"aggregation_type": "sum_agg",
"recurring": false,
"field_name": "minutes"
},
{
"name": "Menivor encode minutes",
"code": "menivor.ott.encode_minutes",
"description": "Minutes of source video encoded.",
"aggregation_type": "sum_agg",
"recurring": false,
"field_name": "minutes"
},
{
"name": "Menivor AI video minutes",
"code": "menivor.ai.minutes",
"description": "Minutes of AI video generated.",
"aggregation_type": "sum_agg",
"recurring": false,
"field_name": "minutes"
}
],
"plans": [
{
"name": "Menivor usage mirror",
"code": "menivor_portfolio_mirror",
"interval": "monthly",
"description": "Zero-priced mirror: records usage for reconciliation, never invoices.",
"amount_cents": 0,
"amount_currency": "USD",
"pay_in_advance": false,
"bill_charges_monthly": true,
"charges": [
{
"billable_metric_code": "menivor.reel.rendered",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.preset.render",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.lora.train",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.ott.gb_stored",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.ott.minutes_delivered",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.ott.encode_minutes",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
},
{
"billable_metric_code": "menivor.ai.minutes",
"charge_model": "standard",
"invoiceable": true,
"properties": {
"amount": "0.0"
}
}
]
}
],
"transaction_id": "<product>:<meter>:<source id> (a repeated transaction_id is a no-op)",
"external_customer_id": "the product's own organization id"
}