@drawbridge/drawbridge-agents 0.1.22 → 0.1.24

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.
@@ -65,6 +65,14 @@ skill) so it stops living only in tribal memory.
65
65
  - Meter events are **single-writer**: true-ups are `billing.trueup` ledger rows, never meter
66
66
  events. A true-up written as a meter event in-window corrupts the reflection poll and strands
67
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.
68
76
  - Every `$inc` on a `totals.*` counter needs a matching entry in `drawbridge-sync/lib/totals.js`
69
77
  `SOURCES` — that map is the only drift backstop.
70
78
  - The `invoice` collection's **unique partial index on `stripeInvoiceId`** (drawbridge-api
@@ -108,6 +116,35 @@ skill) so it stops living only in tribal memory.
108
116
  in the tree. Keep the pins aligned.
109
117
  - Shared packages that wrap a stateful SDK (Sentry, redis, mongodb) must direct-dep it at an
110
118
  exact pin, never a loose peer range (see `sentry-sdk.md`).
119
+ - `@drawbridge/components` `Video` (≥0.0.62) owns the whole pre-playback story; consumers must NOT
120
+ re-add their own poster layer or mount gate. `poster` renders as an SSR placeholder (opt into
121
+ `priority` for fetchpriority=high when it's the LCP element), `defer` gates only the player —
122
+ never the placeholder, so deferring can't blank the box — and the native poster attribute is
123
+ kept so unmounting the placeholder at player-ready isn't frame-timing-critical. `onError` fires
124
+ exactly once, only after the hls→mp4 retry is exhausted. drawbridge-share's gallery carousel
125
+ depends on BOTH callbacks: it advances slides off `onDuration` OR `onError` registering a
126
+ duration — remove or re-fire either and a broken video stalls the whole carousel (share
127
+ `template-subdomain-gallery.js`, components `video.js`).
128
+ - `@drawbridge/components` `Video` ≥0.0.63 mounts a deferred player when the PLACEHOLDER PAINTS,
129
+ not on a timer: video bytes racing the poster on a throttled link is what delays LCP (measured
130
+ 2.8s → 7.5s when mounting at hydration), and a fixed dwell held the poster ~3s even when the
131
+ video was cache-warm.
132
+
133
+ ## Video poster frames (api ↔ sync ↔ share ↔ app-web)
134
+
135
+ - `file.frames[0]` MUST be the `00:00:00` frame — the one playback starts on. drawbridge-api
136
+ stamps `posterTimestamp = '00:00:00'` on upload and refuses to regenerate a timestamp that
137
+ already exists; drawbridge-share's gallery hero renders `frames[0]` (NOT `frames[poster]`, which
138
+ is the user's thumbnail — a 14s thumbnail jumps the instant playback begins). app-web reads
139
+ `frames[poster] || frames[0]`. See `drawbridge-docs/reference/media-assets.md`.
140
+ - The poster's `1080x1920` tier resizes with `fit: 'inside'`, never `cover`: the poster and the
141
+ `<video>` share a box and an `object-fit: cover`, whose crop depends on SOURCE aspect vs box
142
+ aspect — cropping the poster to 9:16 against a natively-shaped video makes the hero visibly jump
143
+ on any viewport wider than 9:16 (desktop). Changing this needs a poster regeneration, not just a
144
+ deploy.
145
+ - The poster worker `$set`s `poster : 0` on every run and APPENDS to `frames[]`. Any script that
146
+ generates a frame must snapshot and restore `poster`/`posterTimestamp`, **including on the
147
+ failure path**, or a retry silently discards the user's thumbnail choice.
111
148
 
112
149
  ## Import surfaces
113
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {