@drawbridge/drawbridge-agents 0.1.50 → 0.1.51

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.
@@ -7,7 +7,7 @@ skill) so it stops living only in tribal memory.
7
7
 
8
8
  ## Shared secrets must match across services
9
9
 
10
- - `OAUTH_TOKEN_HMAC_KEY` must be identical in **drawbridge-api** and **drawbridge-sync** — both
10
+ - `HMAC_OAUTH_TOKEN_KEY` must be identical in **drawbridge-api** and **drawbridge-sync** — both
11
11
  `assertEnv` it at boot. A mismatch silently breaks realtime token verification.
12
12
  - `HMAC_UNSUBSCRIBE_TOKEN_KEY` must be identical in **drawbridge-api** and **drawbridge-sync** —
13
13
  both `assertEnv` it at boot. Sync signs the unsubscribe tokens it builds into notification
@@ -153,17 +153,34 @@ skill) so it stops living only in tribal memory.
153
153
  would have zeroed every invoice once the products were archived.
154
154
  - **The v2 pricing-plan layer (`bpp_*`, billing cadences) is never touched by script.** Canceling a
155
155
  billing cadence is terminal and unrecoverable. Dashboard, by hand, only.
156
- - **The Shopify meter handle is a config contract no code validates** (shopify ↔ Partner
157
- Dashboard ↔ sync/utils). `SHOPIFY_USAGE_ORDERS_EVENT_HANDLE` in `@drawbridge/shopify`
158
- (`drawbridge-orders`) must exactly match — case-sensitive, handle not display name — a usage
159
- meter on the App Pricing plan version each merchant has APPROVED (meters are never
160
- retroactive). A mismatch, a missing meter, or a merchant on a pre-meter plan still 202s every
161
- event, logs it as a plain app event, and bills nothing; no error surfaces anywhere in code
162
- (the 19/99 write-off). Any change to the handle constant, the Partner Dashboard pricing
163
- config, or a plan version requires verifying a fresh order classifies as a billing event in
164
- Dev Dashboard Logs (type "App billing event"). The trace key both sides share is
165
- `billed.transaction` = the event's `reference` = `drawbridge-orders.<orderId>`. Detail:
166
- drawbridge-docs `reference/shopify-app.md` (Billing).
156
+ - **The Shopify meter handle is manifest data, provider-overridable, and sender-verified
157
+ (≥ utils 0.0.151)** (utils ↔ sync ↔ api ↔ Partner Dashboard). The utils shopify manifest
158
+ publishes `events.order.handle` = `slugify('drawbridge-orders')`; the provider row's
159
+ `orderEventHandle` field (admin-editable, `format:'slug'` normalized on save AND read)
160
+ overrides it at mint time. The order hook puts the effective handle on the billing job and
161
+ mints `billed.transaction` = `<handle>.<orderId>` (also the event's `reference` attribute
162
+ the shared trace key). `sendAppEvent` has NO default handle any more, and sync's sender
163
+ REFUSES to send when the job carries none (`shopify.usage.billing.handle.missing`) or when
164
+ the transaction prefix disagrees (`…handle.mismatch`) both before any provider read, both
165
+ page through the abandoned alert. The handle must still exactly match — case-sensitive,
166
+ handle not display name — a usage meter on the plan version each merchant APPROVED: meters
167
+ attach only at approval and are never retroactive, and a pre-meter approval 202s every event
168
+ and bills nothing (the 19/99 write-off; also every pre-2026-09 production approval).
169
+ - **Shopify billing proof comes only from the Partner ledger; absence is never a verdict**
170
+ (utils ↔ sync ↔ api ↔ app-web). No Admin API version materializes a managed-pricing meter
171
+ (measured 2026-09-04), so `connection.source.metered` is a billing-PROOF reference: the
172
+ latest positive `CHARGE_USAGE` charge id from the Partner API (provider row fields
173
+ `partnerOrgId`/`partnerAppId`/`partnerToken`), `null` only from measured unmetered evidence,
174
+ absent = never proven — and every consumer (task card, checklist item, billing Issue,
175
+ presented-error status, admin badges, App Home error row) gates on the explicit null, never
176
+ on silence. Writers: the daily health run, the approval webhook's instant restamp, and the
177
+ reselect flow's stale-null lift (a completed reselect returns a null-stamped store to
178
+ no-verdict — the null described the approval that was just replaced). Charge rows exist only
179
+ at billing boundaries (usage accrues invisibly between them); each row is reconciled once
180
+ against its window's orders — balanced stamps `billed.receipt`, a mismatch pages
181
+ `shopify.usage.reconciliation.mismatch`, and admin-voided orders (`billed.void`, the
182
+ write-off for pre-meter losses) leave both the sums and the dashboard's unreconciled count.
183
+ Detail: drawbridge-docs `reference/shopify-app.md` (Billing).
167
184
  - **A subscription must open with the plan item.** It used to open with the metered actions price
168
185
  and attach the plan afterwards with `always_invoice`. With no metered item, Stripe rejects an
169
186
  itemless subscription, so the plan goes in at creation — changing the first invoice's shape.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {