@drawbridge/drawbridge-agents 0.1.28 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@
21
21
  "../drawbridge-docs",
22
22
  "../drawbridge-emails",
23
23
  "../drawbridge-games",
24
+ "../drawbridge-growth",
24
25
  "../drawbridge-mongodb",
25
26
  "../drawbridge-redis",
26
27
  "../drawbridge-share",
@@ -68,13 +68,20 @@ skill) so it stops living only in tribal memory.
68
68
  after it produced five distinct defects, ending in a 60-second line-window overlap that billed
69
69
  one correctly-delivered event twice. Do not reintroduce meter events, and do not "fix" a billing
70
70
  discrepancy by reporting usage to Stripe — corrections are `billing.trueup` ledger rows.
71
- - **`items.actions` is the record of what the customer was SOLD** — `{ limit,
72
- overageCentsPerAction }`, written by drawbridge-stripe (≥0.1.44) at create/upgrade/downgrade and
73
- read by drawbridge-sync at cycle close. plans.js is the default for NEW sales only; editing it
74
- does not reprice existing customers (that is `repriceActionsSnapshot`, explicit and dry-runnable).
75
- Anything adding custom/enterprise pricing must gate the plan-change paths and the reprice script
76
- or negotiated values get silently overwritten. The rate is a NUMBER in cents the string
77
- `'2.5'` shape exists only at the Stripe `unit_amount_decimal` boundary.
71
+ - **`subscription.overrides` is the single home for sold/negotiated terms** —
72
+ `{ actions : { limit, overages }, conversion }`. `overrides.actions` is ALWAYS stamped at sale by
73
+ drawbridge-stripe (≥0.1.46) and re-stamped on plan change; `overrides.conversion` exists only when
74
+ an admin overrides the plan default, and api carries it onto the new document across plan changes.
75
+ Resolution is PER FIELD: `overrides.actions.X` legacy `items.actions.X` (transitional)
76
+ plans.js; conversion resolves ONLY through `conversionRate()` in utils (`overrides.conversion`
77
+ legacy top-level `conversion` plan free; `??` throughout, 0 is a valid override). `overages`
78
+ is a NUMBER in cents per action — the string `'2.5'` shape exists only at the Stripe
79
+ `unit_amount_decimal` boundary. Deleting a key restores plan flow, which is why the admin PUT
80
+ unsets the legacy keys it supersedes. plans.js is the default for NEW sales only; repricing
81
+ existing customers is `repriceActionsSnapshot` (explicit, dry-runnable — and it overwrites
82
+ admin-negotiated actions values, so read the dry run). The legacy keys are copy-only until the
83
+ overrides cleanup release, and sync (reader) deploys before stripe (writer) on any shape change.
84
+ Detail: drawbridge-docs `reference/billing.md`.
78
85
  - **No Stripe product backs actions (≥0.1.45).** Invoice items carry
79
86
  currency/quantity/unit_amount_decimal/tax_behavior/description directly; the account keeps exactly
80
87
  one product — the plan product behind `STRIPE_PRICE_*`. Never reintroduce a product-presence guard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {