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>
99 lines
3.0 KiB
JSON
99 lines
3.0 KiB
JSON
{
|
|
"consumer": "rally",
|
|
"description": "Rally meters for the Railyard consumer contract (Wave P 5.3). Rally's own billing is the charge of record; pass-through lines are billed to the customer at cost by Rally. $0 usage mirror here.",
|
|
"currency": "USD",
|
|
"billable_metrics": [
|
|
{
|
|
"name": "Rally email sent",
|
|
"code": "rally.email.sent",
|
|
"description": "One event per email sent from the customer's own mailbox.",
|
|
"aggregation_type": "count_agg",
|
|
"recurring": false
|
|
},
|
|
{
|
|
"name": "Rally lead revealed",
|
|
"code": "rally.lead.revealed",
|
|
"description": "One event per revealed contact.",
|
|
"aggregation_type": "count_agg",
|
|
"recurring": false
|
|
},
|
|
{
|
|
"name": "Rally email verification",
|
|
"code": "rally.verification",
|
|
"description": "One event per verification.",
|
|
"aggregation_type": "count_agg",
|
|
"recurring": false
|
|
},
|
|
{
|
|
"name": "Rally domain bought for a customer",
|
|
"code": "rally.passthrough.domain",
|
|
"description": "One event per domain registration passed through.",
|
|
"aggregation_type": "count_agg",
|
|
"recurring": false
|
|
},
|
|
{
|
|
"name": "Rally mailbox bought for a customer",
|
|
"code": "rally.passthrough.mailbox",
|
|
"description": "One event per mailbox month passed through.",
|
|
"aggregation_type": "count_agg",
|
|
"recurring": false
|
|
}
|
|
],
|
|
"plans": [
|
|
{
|
|
"name": "Rally usage mirror",
|
|
"code": "rally_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": "rally.email.sent",
|
|
"charge_model": "standard",
|
|
"invoiceable": true,
|
|
"properties": {
|
|
"amount": "0.0"
|
|
}
|
|
},
|
|
{
|
|
"billable_metric_code": "rally.lead.revealed",
|
|
"charge_model": "standard",
|
|
"invoiceable": true,
|
|
"properties": {
|
|
"amount": "0.0"
|
|
}
|
|
},
|
|
{
|
|
"billable_metric_code": "rally.verification",
|
|
"charge_model": "standard",
|
|
"invoiceable": true,
|
|
"properties": {
|
|
"amount": "0.0"
|
|
}
|
|
},
|
|
{
|
|
"billable_metric_code": "rally.passthrough.domain",
|
|
"charge_model": "standard",
|
|
"invoiceable": true,
|
|
"properties": {
|
|
"amount": "0.0"
|
|
}
|
|
},
|
|
{
|
|
"billable_metric_code": "rally.passthrough.mailbox",
|
|
"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"
|
|
}
|