Validators

The MTR validator codes and what each one checks.

View .md

Every validator rule metro checks before a preview or apply, with severity and the fix. A failing error rule exits 1.

Source

Generated from metro docs validator-reference --markdown in metrocli/metro @146bf3e. Source schemaVersion: metro.docs.validator-reference.v1.

  • schemaVersion: metro.docs.validator-reference.v1

Validator rules

idseveritymessage
MTR-TENANT-001errorChoose exactly one tenant with --sandbox, --prod, or a profile that resolves to one tenant.
MTR-TENANT-002errorBind production approval to the exact reviewed preview hash before apply can proceed.
MTR-TENANT-003errorConfigure the profile with one explicit tenant and a matching tenant-scoped Metronome key environment variable name.
MTR-TENANT-004errorRe-run preview and preflight with the current tenant key or restart approval after confirming the key change.
MTR-ENDPOINT-001errorCite endpoint-matrix and a reviewed endpoint source such as a published Metronome doc or local skill before treating the endpoint as apply evidence.
MTR-ENDPOINT-002errorUse the exact method and path from the local endpoint matrix and cite the reviewed source ID that supports it.
MTR-APIREQ-001errorAdd the required endpoint request field or policy evidence before any preview or future live runner can use this endpoint.
MTR-APIREQ-002errorRemove fields forbidden by the reviewed endpoint contract and use the endpoint-specific workflow shape when the operation needs richer policy evidence.
MTR-APIREQ-003errorRemove API keys, bearer tokens, passwords, and secret-shaped fields. The CLI should reference tenant profiles and env var names, never inline secrets.
MTR-APIREQ-004errorAdjust the request to match the reviewed endpoint contract and required local policy gates before any preview or future apply is considered.
MTR-PKG-001errorProvide packageAlias for package-based workflows.
MTR-PKG-002errorProvide a stable uniquenessKey of 128 characters or fewer.
MTR-PKG-003errorUse the restricted package contract-create shape: customer_id, starting_at, package_alias or package_id, uniqueness_key, and transition only.
MTR-PKG-004errorVerify the package alias resolves to the intended package at the workflow timestamp before previewing package moves or old-version archive.
MTR-PKG-010errorSet creditGrantMode to monthly-drip for 1/12 credit grants or lump-sum only when finance explicitly requires legacy behavior.
MTR-PKG-011errorProvide annualCreditsTotal, fixedProductId, accessCreditTypeId, and commitName for recurring_commits credit modeling.
MTR-PKG-012errorProvide creditAmount (positive integer), trialDurationDays (1-365 integer), rolloverFraction (0 to 1), and accessCreditTypeId. The shape generates commit_duration.unit PERIODS, duration.value as a string, starting_at_offset, and proration automatically.
MTR-PKG-013errorSet noStripeConfirmed: true to confirm this package has no billing_provider and no invoice_amount on the commit - no Stripe invoice will be generated.
MTR-RATE-001errorState the current entitlement evidence and close retired product rates with entitled:false.
MTR-RATE-002errorSet billingFrequency to the frequency required by the shape.
MTR-RATE-003errorClose every affected rate-card entry with entitled:false and price:0 before archiving the product.
MTR-RATE-004errorProvide startingAt as a UTC hour-boundary timestamp.
MTR-RATE-005errorProve the USAGE product pricing and presentation group keys are backed by one compound billable-metric group key, and provide reviewed per-dimension rate rows.
MTR-TIME-001errorUse an ISO timestamp ending in :00:00Z or :00:00.000Z.
MTR-TIME-002errorUse a future UTC hour-boundary timestamp for no-immediate-invoice workflows.
MTR-TIME-004errorArchive an old package version only after the replacement package alias is live and verified by package read-back evidence.
MTR-BILL-001errorAttach or plan a Stripe billing provider config before an invoice-producing workflow.
MTR-BILL-002errorProvide exactly one of deliveryMethodId or deliveryMethod. Use deliveryMethodId for multi-entity Stripe billing, or direct_to_billing_provider for the single-entity shorthand.
MTR-BILL-003errorChoose an existingConfigPolicy such as fail_if_exists or reuse_if_matching before planning attachment.
MTR-BILL-004errorSet the shape-specific Stripe draft behavior field explicitly before preview.
MTR-BILL-005errorSet deliveryMethodScope explicitly. For multi_entity delivery, provide matching deliveryMethodId evidence, targetStripeAccountId, accountBillingProviderReviewed: true, and endpointFieldsReviewed: true.
MTR-SUB-001errorProvide an explicit subscriptions[] plan with subscription_rate, collection schedule, proration, and quantity management mode before preview.
MTR-SUB-002errorMake subscription_rate.billing_frequency match the verified rate-card subscription rate frequency.
MTR-SUB-003errorUse the same SubscriptionProductListItem product_id in the rate-card evidence, subscription_rate, and override specifiers.
MTR-SUB-004errorFor QUANTITY_ONLY provide initialQuantity. For SEAT_BASED direct contracts provide seatConfig.seatGroupKey and seatConfig.initialSeatIds.
MTR-CUSTOM-001errorProvide an existing metronomeCustomerId or explicitly request createMetronomeCustomer with externalCustomerId before preview.
MTR-CUSTOM-002errorUse the local direct enterprise custom-contract shape with contractType direct, explicitStartingAt, and no package fields.
MTR-CUSTOM-003errorProvide explicit rate card, recurring commit, invoice, seat-limit, verification, and remediation terms before preview.
MTR-CUST-001errorProvide companyName, externalCustomerId, primaryIngestAlias, and the full ingestAliases list before planning customer setup.
MTR-CUST-002errorPlan customer lookup by ingest alias, review archived-customer collisions, and choose fail_if_exists or reuse_if_exact_match before customer create.
MTR-CUST-003errorDeclare the hierarchy mode and provide contract-level hierarchy review evidence before previewing non-standalone customer setup.
MTR-CUST-004errorApprove every custom field key for the Metronome customer entity and keep each value within Metronome custom-field limits.
MTR-INV-001warningUse a future UTC hour boundary or explicitly confirm immediate invoice behavior in a later preview/apply workflow.
MTR-INV-002errorOnly void a reviewed invoice after proving invoice status, Stripe payment/refund handling, reconciliation plan, read-back checks, and remediation ownership.
MTR-INV-003errorUse updateEndDate rather than archive for this shape and inspect current invoices before planning the move.
MTR-INV-004errorOnly update DRAFT invoice issue dates after invoice read-back, contract-end evidence, billing-provider review, explicit Stripe behavior, and remediation planning exist.
MTR-INV-005errorRegenerate only a reviewed VOID invoice after proving correction inputs, billing-provider distribution behavior, replacement invoice read-back, and reconciliation/remediation plans.
MTR-PAY-001errorReview that the invoice is FINALIZED, PLG invoicing is enabled, a billing provider is attached, and the customer payment method path is ready before attempting payment.
MTR-PAY-002errorList payment attempts first and prove there is no successful payment, no conflicting in-flight attempt, and a read-back plan before retrying or canceling payment.
MTR-PAY-003errorCancel only a reviewed pending payment attempt and document customer communication, retry/remediation, and payment read-back evidence before future live execution.
MTR-IDEMP-001errorProvide a deterministic contractUniquenessKey of 128 characters or fewer for successor contract creation.
MTR-IDEMP-002errorProvide one stable transaction_id per event and reuse the same transaction_id for retries.
MTR-IDEMP-003errorReview existing objects by stable business key before future create workflows so retries or re-runs do not create duplicate catalog objects.
MTR-VERIFY-001errorProvide read-back verification for each endpoint or business effect that a future apply would change.
MTR-VERIFY-002errorProvide a specific rollbackPlan describing how to recover if the move preview or future apply is wrong.
MTR-VERIFY-003errorProvide a one-customer or one-event canary plan, read-back checks, and resume criteria before bulk execution.
MTR-USAGE-001errorState the invoice period target, finalized-period status, preview-events requirement, and remediation path before any ingest workflow.
MTR-USAGE-002errorProvide customer_id, event_type, timestamp, transaction_id, and required dimensional properties for each usage event.
MTR-USAGE-003errorProvide explicit invoicePeriodTarget, canaryEventCount, and post-ingest read-back plan before bulk ingest.
MTR-CREDIT-001errorProvide accessCreditTypeId for the product or access credit type.
MTR-CREDIT-002errorOmit invoiceSchedule for a pure access grant, or use a fiat credit type such as USD cents for a zero-dollar audit line.
MTR-CREDIT-003errorOmit invoiceSchedule, or set invoiceSchedule.auditLineIntentConfirmed to true and keep unitPriceCents at 0.
MTR-CREDIT-004errorFor paid credit workflows, provide a positive fiat amount in cents. Complimentary grants must use 0 when an audit line is intended.
MTR-CREDIT-005errorApprove every custom field key for the target Metronome object type before including custom_fields in a preview payload.
MTR-CREDIT-006errorState paid_topup_invoice_expected, paymentGateType STRIPE, explicit stripeBehavior, duplicate-name review, read-back checks, and rollback/remediation before preview.
MTR-REPO-001errorExtract reusable logic into tested packages/metro-core modules and leave old one-off or quarantined scripts as evidence only.
MTR-REPO-002errorUse generated artifacts only as evidence with a boundary document; cite current source files for workflow behavior.
MTR-REPO-003errorKeep evidence from a previous (external) billing system historical unless the user explicitly asks for legacy migration work.

Agent notes

  • Prefer --json when scripting parsers; use --markdown when loading context into an agent.
  • Never treat HTML as the source of truth, regenerate from metro docs <ref> --markdown.
  • Live reads/writes still require tenant flags + confirmation tokens.

On this page