You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaces the old QuotaWindow[]-based system with a flat Meter[] model
where each meter is self-describing with kind, unit, period fields, and
status — eliminating per-checker UI switches, checker-level categories,
compound enum window types, and 21 near-duplicate display components.
Backend changes:
- New Meter/MeterCheckResult types in src/types/meter.ts
- Self-registering checker-registry.ts (defineChecker + loadAllCheckers)
- New meter_snapshots table schema (SQLite + PostgreSQL)
- All 22 checkers rewritten to export default defineChecker({...})
- apertis and apertis-coding-plan merged into single apertis checker
- quota-scheduler.ts rewired to use registry + persist to
meter_snapshots
- /v0/management/quotas routes return MeterCheckResult shape
- apertis-coding-plan removed from config schema
Frontend changes:
- New QuotaCheckerInfo type with meters: Meter[] replacing latest:
snapshot[]
- New generic components: BalanceMeterRow, AllowanceMeterRow, MeterValue
- checker-presentation.ts for display names
- Quotas.tsx, CombinedBalancesCard, CompactQuotasCard,
CompactBalancesCard
rewritten to use meters array directly
- Sidebar.tsx updated to derive balance/allowance from meter kinds
- All 21 XxxQuotaDisplay.tsx components deleted
- QuotaHistoryModal, BalanceHistoryModal deleted
- api.ts updated to use new response shape
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,69 @@ On first startup with `ENCRYPTION_KEY` set, existing plaintext values are automa
211
211
212
212
---
213
213
214
+
## Admin CLI Utilities
215
+
216
+
Plexus ships several one-shot CLI subcommands for database maintenance tasks. Pass the subcommand name as the first argument to the binary (or `bun run src/index.ts`).
217
+
218
+
### Rotate Encryption Key (`rekey`)
219
+
220
+
Decrypts all sensitive fields with the current key and re-encrypts them with a new one. Run this before rotating `ENCRYPTION_KEY` in your environment.
One-time ETL that copies historical data from the legacy `quota_snapshots` table into the new `meter_snapshots` table introduced in the quota-tracking overhaul. Run this once after upgrading to a version that includes the new quota system.
DATABASE_URL=sqlite://./data/plexus.db bun run src/index.ts migrate-quota-snapshots
256
+
```
257
+
258
+
`DATABASE_URL` must be set explicitly — there is no default. The command is **idempotent**: rows that already exist in `meter_snapshots` are skipped, so it is safe to run more than once. If `quota_snapshots` does not exist or is empty the command exits cleanly with no changes.
259
+
260
+
**Field mapping summary:**
261
+
262
+
|`quota_snapshots`|`meter_snapshots`| Notes |
263
+
|---|---|---|
264
+
|`provider`|`provider`| direct |
265
+
|`checker_id`|`checker_id`| direct |
266
+
|`group_id`|`group`| renamed |
267
+
|`window_type`|`meter_key`| used as-is |
268
+
|`window_type`|`kind` / `period_*`|`daily`→allowance/day, `monthly`→allowance/month, `balance`→balance, etc. |
269
+
|`description`|`label`| falls back to `window_type` if null |
0 commit comments