@drawbridge/drawbridge-agents 0.1.26 → 0.1.28
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.
|
@@ -68,12 +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
|
-
-
|
|
72
|
-
(≥0.1.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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.
|
|
78
|
+
- **No Stripe product backs actions (≥0.1.45).** Invoice items carry
|
|
79
|
+
currency/quantity/unit_amount_decimal/tax_behavior/description directly; the account keeps exactly
|
|
80
|
+
one product — the plan product behind `STRIPE_PRICE_*`. Never reintroduce a product-presence guard
|
|
81
|
+
in sync's billing: the old one skipped billing entirely for a productless subscription, which
|
|
82
|
+
would have zeroed every invoice once the products were archived.
|
|
83
|
+
- **The v2 pricing-plan layer (`bpp_*`, billing cadences) is never touched by script.** Canceling a
|
|
84
|
+
billing cadence is terminal and unrecoverable. Dashboard, by hand, only.
|
|
77
85
|
- **A subscription must open with the plan item.** It used to open with the metered actions price
|
|
78
86
|
and attach the plan afterwards with `always_invoice`. With no metered item, Stripe rejects an
|
|
79
87
|
itemless subscription, so the plan goes in at creation — changing the first invoice's shape.
|
|
@@ -131,6 +139,14 @@ skill) so it stops living only in tribal memory.
|
|
|
131
139
|
- The api's `POST /oauth/google/callback` returns `redirectTo` in its 400 body when it read the state
|
|
132
140
|
row before failing, so app-web can keep the resume target across `/auth?error=oauth`. A
|
|
133
141
|
`oauth.state.invalid` failure cannot — that row is what carried the target.
|
|
142
|
+
- Google sign-in NEVER auto-links (`profile/disconnect-google` must stick): the callback signs in
|
|
143
|
+
only on an exact google account row; an email-only match is refused with `code: google.not.linked`
|
|
144
|
+
in the error body, which app-web's `/api/auth/google` maps to `/auth?error=google-not-linked`
|
|
145
|
+
(and `google.already.linked` back to `/account`) — deliberate refusals carry `code` and skip
|
|
146
|
+
Sentry on both sides. Explicit linking runs GET `/oauth/google/link/start` (authenticated); its
|
|
147
|
+
state row carries `data.link` (user id) and the callback's **link-mode result has NO token pair**,
|
|
148
|
+
so the BFF must only (re)write session/refresh/csrf cookies when `result.sessionToken` is present —
|
|
149
|
+
writing them unconditionally signs the user out mid-link.
|
|
134
150
|
|
|
135
151
|
## Reporting (api ↔ app-web)
|
|
136
152
|
|
package/package.json
CHANGED