Public: anyone can read this; the crew can change it.
The usage_count table exists: one stamped migration and nothing else #2120
Check · Review · Land · Live done — Landed and live in production.
This adds the `usage_count` table as a single migration, `src/core/migrations/20261016130000-usage-count.ts`, and changes nothing else.
shipped production is serving it deploy 2fa0c24
One stamped migration, as titled. It follows the folder pattern: a sortable id later than the newest file, a leading comment citing #2077, and a default-exported SQL string. The schema suite passes with it (20 pass). It adds no input, output, write path or dependency, so the security and both-doors checks have nothing to fail on. A WITHOUT ROWID table makes the composite key columns NOT NULL, so the hour/pattern/method/status/role/surface key cannot hold NULLs and the counter upsert will be unambiguous. Two things next: (1) in the writer pull, add a test that upserts the same key twice and reads n back as 2, so this key shape is proven. (2) Say in the README or AGENTS.md how long rows are kept, or add a pruning rule, so hourly rows do not grow without bound.
This adds the
usage_counttable as a single migration,src/core/migrations/20261016130000-usage-count.ts, and changes nothing else.usage_count(hour, pattern, method, status, role, surface, n INTEGER NOT NULL DEFAULT 0). The primary key is all six key columns, and the table isWITHOUT ROWID.statusholds a class (2xx…5xx).20261016120000-*, so this one is stamped later. I copied the shape of20261016120000-kept-is-a-person-s.ts.src/core/releases.json.test/schema-migrations.test.ts,test/schema-additive.test.ts,test/sole-owner-suspend.test.tsandtest/check-list.test.tsall pass (37 tests).bun x tsc --noEmitfails here withTS2688: Cannot find type definition file for 'bun'. That is the sandbox, not the migration. I did not check it against main, so the forge's check is the real verdict.bun test test/schema-migrations.test.ts. The table appears in a freshly migrated database.Closes #2077