@drawbridge/drawbridge-agents 0.1.21 → 0.1.23
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.
|
@@ -48,6 +48,12 @@ skill) so it stops living only in tribal memory.
|
|
|
48
48
|
`ads-republishing.<connectionId>`). Never unique-index `coalesce` (superseding requires the
|
|
49
49
|
second insert to land), and writes that set `key` need the writer-side E11000 handler or a
|
|
50
50
|
replayed event logs a false error.
|
|
51
|
+
- Schema-gated fields ship **api-first, booted**: a sibling writer setting a field new to a
|
|
52
|
+
drawbridge-api `$jsonSchema` (validators are strict + `additionalProperties: false`) must not
|
|
53
|
+
go live until the api has **booted** with the schema change on that environment — creating the
|
|
54
|
+
index manually is not enough; until the boot collMod lands, every insert carrying the field
|
|
55
|
+
fails Mongo 121 (not E11000), so keyed-idempotency writers silently drop their writes
|
|
56
|
+
(2026-07-30 `notification.key` dev outage, Sentry DRAWBRIDGE-SYNC-32).
|
|
51
57
|
`meta.render` for pipeline-rendered marks** (sync `resolveAsset` writes/queries it; the field
|
|
52
58
|
and its index live in drawbridge-api `schema/file.js`). `origin` identifies the source asset,
|
|
53
59
|
`render` content-hashes the rendered output — drop `render` from either side and a rendering
|
|
@@ -59,6 +65,14 @@ skill) so it stops living only in tribal memory.
|
|
|
59
65
|
- Meter events are **single-writer**: true-ups are `billing.trueup` ledger rows, never meter
|
|
60
66
|
events. A true-up written as a meter event in-window corrupts the reflection poll and strands
|
|
61
67
|
units unbillable.
|
|
68
|
+
- **Upgrade mechanics and the billing path are one contract**: drawbridge-stripe's upgrade
|
|
69
|
+
(`subscription.change`) swaps the metered actions price in place, and classic-mode Stripe then
|
|
70
|
+
ignores meter events on that closing cycle invoice entirely — so drawbridge-sync's
|
|
71
|
+
`settleCycleUsage` bills upgrade-truncated invoices (actions line starts >60s after
|
|
72
|
+
`period_start`) as plain invoice items priced from plans.js instead of the meter. Changing the
|
|
73
|
+
upgrade mechanic (schedules, cycle-anchor reset, `billing_mode=flexible`) or the metering path
|
|
74
|
+
without re-checking the other side silently re-zeroes upgrade-cycle invoices. Detail:
|
|
75
|
+
drawbridge-docs `reference/billing.md` § Stripe meter emission.
|
|
62
76
|
- Every `$inc` on a `totals.*` counter needs a matching entry in `drawbridge-sync/lib/totals.js`
|
|
63
77
|
`SOURCES` — that map is the only drift backstop.
|
|
64
78
|
- The `invoice` collection's **unique partial index on `stripeInvoiceId`** (drawbridge-api
|
package/package.json
CHANGED