<?xml version="1.0" encoding="UTF-8"?><database name="commandrhythm" schema="public" type="PostgreSQL - 18.4 (Ubuntu 18.4-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="quota_id_seq" startValue="1"/>
      <sequence increment="1" name="usage_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="critique_results" remarks="{&quot;what&quot;:&quot;Result of a single critique task: one row per task_id.&quot;,&quot;why&quot;:&quot;Without it, critique outcomes and metadata are lost, preventing audit and retry.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.103110250+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="task_id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique text identifier for a critique task; primary key.&quot;,&quot;why&quot;:&quot;Uniquely identifies each run for updates, retrieval, or deduplication.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.154163147+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="batch_id" nullable="false" remarks="{&quot;what&quot;:&quot;Text identifier grouping multiple tasks submitted together.&quot;,&quot;why&quot;:&quot;Enables managing and tracking a set of tasks as one unit.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.187624157+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="url" nullable="false" remarks="{&quot;what&quot;:&quot;Target web address that was critiqued.&quot;,&quot;why&quot;:&quot;Identifies the resource being evaluated; without it, results are meaningless.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.210738845+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="status" nullable="false" remarks="{&quot;what&quot;:&quot;Integer status code; exact mapping defined in app (e.g., pending, done, error).&quot;,&quot;why&quot;:&quot;Allows filtering incomplete or failed tasks for retry or alerting.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.235908866+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="model" nullable="false" remarks="{&quot;what&quot;:&quot;Name or version of the model that generated the critique.&quot;,&quot;why&quot;:&quot;Distinguishes results by model to compare performance or reproducibility.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.277963585+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="findings" nullable="true" remarks="{&quot;what&quot;:&quot;JSONB payload holding the critique output; schema varies by model.&quot;,&quot;why&quot;:&quot;Preserves the actual critique content in a flexible format for later analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.423916022+00:00&quot;}" size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="tokens" nullable="true" remarks="{&quot;what&quot;:&quot;Number of tokens consumed by the model for this task.&quot;,&quot;why&quot;:&quot;Tracks usage for cost accounting and quota management.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.485651228+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="error" nullable="true" remarks="{&quot;what&quot;:&quot;Error message if the task failed; null on success.&quot;,&quot;why&quot;:&quot;Provides diagnostic info to debug failures without losing the attempt.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.507663521+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="8" name="created_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp when the task was created, in UTC.&quot;,&quot;why&quot;:&quot;Enables time-based ordering, retention, and auditing of task history.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:16.571634445+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="task_id" sequenceNumberInPK="1"/>
         <index name="critique_results_pkey" unique="true">
            <column ascending="true" name="task_id"/>
         </index>
         <index name="idx_critique_batch" unique="false">
            <column ascending="true" name="batch_id"/>
         </index>
      </table>
      <table name="quota" remarks="{&quot;what&quot;:&quot;Snapshot of external service quota limits and usage at a point in time.&quot;,&quot;why&quot;:&quot;Without it, there is no record of quota state to make decisions on.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.293300819+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('quota_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for this quota snapshot row.&quot;,&quot;why&quot;:&quot;Provides a stable key for updates and joins; without it rows are indistinguishable.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.357562115+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="1" name="ts" nullable="false" remarks="{&quot;what&quot;:&quot;UTC timestamp when this quota snapshot was recorded.&quot;,&quot;why&quot;:&quot;Orders snapshots over time; without it you cannot tell which reading is newest.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.384570808+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="'unknown'::text" digits="0" id="2" name="from_service" nullable="false" remarks="{&quot;what&quot;:&quot;Name of the external service this quota applies to, e.g. 'openai'.&quot;,&quot;why&quot;:&quot;Separates quota rows per service; without it metrics from different services mix.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.437972465+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rolling_5h_remaining" nullable="true" remarks="{&quot;what&quot;:&quot;Number of requests/credits left in the rolling 5-hour window.&quot;,&quot;why&quot;:&quot;Shows current headroom; without it you cannot know if a request will be rejected.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.696502543+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="rolling_5h_max" nullable="true" remarks="{&quot;what&quot;:&quot;Maximum requests/credits allowed in the rolling 5-hour window.&quot;,&quot;why&quot;:&quot;Provides the denominator to compute usage ratio; without it remaining is meaningless.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:41.925162883+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="rolling_5h_limited" nullable="true" remarks="{&quot;what&quot;:&quot;True if the rolling 5-hour limit is currently active/enforced.&quot;,&quot;why&quot;:&quot;Distinguishes hard limits from soft warnings; without it you cannot tell if the limit is binding.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.133522460+00:00&quot;}" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="subscription_limit" nullable="true" remarks="{&quot;what&quot;:&quot;Total requests/credits allowed per subscription period.&quot;,&quot;why&quot;:&quot;Defines the cap for the subscription; without it you cannot compute subscription usage.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.170775868+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="subscription_requests" nullable="true" remarks="{&quot;what&quot;:&quot;Number of requests/credits consumed in the current subscription period.&quot;,&quot;why&quot;:&quot;Shows consumption against subscription_limit; without it you cannot know remaining subscription quota.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.192348597+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="8" name="weekly_percent_remaining" nullable="true" remarks="{&quot;what&quot;:&quot;Percentage (0-100) of weekly quota still available.&quot;,&quot;why&quot;:&quot;Gives a quick health check; without it you must compute from raw numbers.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.269587290+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="weekly_remaining_credits" nullable="true" remarks="{&quot;what&quot;:&quot;Remaining weekly credits as a formatted string, e.g. '1,234'.&quot;,&quot;why&quot;:&quot;Preserves exact formatting from the provider; without it you lose the original display value.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.294791885+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="weekly_max_credits" nullable="true" remarks="{&quot;what&quot;:&quot;Maximum weekly credits as a formatted string, e.g. '10,000'.&quot;,&quot;why&quot;:&quot;Provides the weekly cap in the provider's format; without it you cannot compare to remaining.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.372564474+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="raw" nullable="true" remarks="{&quot;what&quot;:&quot;Unmodified JSON payload from the quota API response.&quot;,&quot;why&quot;:&quot;Retains fields not mapped to columns; without it future schema changes lose data.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.888468111+00:00&quot;}" size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="12" name="next_tick_at" nullable="true" remarks="{&quot;what&quot;:&quot;UTC timestamp when the quota window resets next.&quot;,&quot;why&quot;:&quot;Tells when limits will refresh; without it you cannot schedule retries or alerts.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:42.921137177+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="13" name="tick_percent" nullable="true" remarks="{&quot;what&quot;:&quot;Fraction (0-1) of the current quota window that has elapsed.&quot;,&quot;why&quot;:&quot;Allows estimating how much time remains until next_tick_at; without it you cannot predict reset timing.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:43.003121495+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="quota_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="quota_remaining_ts_idx" unique="false">
            <column ascending="true" name="ts"/>
         </index>
         <index name="quota_ts_idx" unique="false">
            <column ascending="false" name="ts"/>
         </index>
      </table>
      <table name="usage" remarks="{&quot;what&quot;:&quot;One row per LLM API request, capturing token counts, latency, and cost.&quot;,&quot;why&quot;:&quot;Without it, no auditable record of model usage or billing exists.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.556986393+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('usage_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Surrogate primary key; unique row identifier.&quot;,&quot;why&quot;:&quot;Without it, rows cannot be uniquely referenced for updates or joins.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.603491711+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="request_id" nullable="false" remarks="{&quot;what&quot;:&quot;UUID of the originating API request, as sent by the client.&quot;,&quot;why&quot;:&quot;Without it, multiple usage rows cannot be correlated to a single logical request.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.644713068+00:00&quot;}" size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="2" name="ts" nullable="false" remarks="{&quot;what&quot;:&quot;UTC timestamp when the usage record was created.&quot;,&quot;why&quot;:&quot;Without it, time-based aggregation and latency analysis are impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.661665941+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="model" nullable="false" remarks="{&quot;what&quot;:&quot;Model identifier string, e.g. 'gpt-4o'.&quot;,&quot;why&quot;:&quot;Without it, cost and performance cannot be attributed to a specific model.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.728484387+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'unknown'::text" digits="0" id="4" name="from_service" nullable="false" remarks="{&quot;what&quot;:&quot;Name of the service that issued the request, defaulting to 'unknown'.&quot;,&quot;why&quot;:&quot;Without it, usage cannot be attributed to the originating service for billing or monitoring.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.780638753+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="stream" nullable="false" remarks="{&quot;what&quot;:&quot;Flag indicating whether the request used streaming response.&quot;,&quot;why&quot;:&quot;Without it, streaming vs non-streaming latency and token behavior cannot be distinguished.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:31.912599859+00:00&quot;}" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="6" name="prompt_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of tokens in the prompt (input) for this request.&quot;,&quot;why&quot;:&quot;Without it, input token consumption and cost cannot be calculated.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.186662228+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="completion_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of tokens in the completion (output) for this request.&quot;,&quot;why&quot;:&quot;Without it, output token consumption and cost cannot be calculated.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.460997852+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="reasoning_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of tokens used for reasoning (e.g., chain-of-thought) if reported.&quot;,&quot;why&quot;:&quot;Without it, reasoning-specific token usage and its cost impact are unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.483777645+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="9" name="cached_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of prompt tokens served from cache, if any.&quot;,&quot;why&quot;:&quot;Without it, cache hit rate and its cost savings cannot be measured.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.506369195+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="ttft_ms" nullable="true" remarks="{&quot;what&quot;:&quot;Time to first token in milliseconds, if measured.&quot;,&quot;why&quot;:&quot;Without it, perceived latency for streaming responses cannot be assessed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.538394595+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="total_ms" nullable="true" remarks="{&quot;what&quot;:&quot;Total request duration in milliseconds, from start to finish.&quot;,&quot;why&quot;:&quot;Without it, end-to-end latency and performance SLAs cannot be evaluated.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.573737289+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="12" name="decode_tok_s" nullable="true" remarks="{&quot;what&quot;:&quot;Average decode speed in tokens per second, if computed.&quot;,&quot;why&quot;:&quot;Without it, generation throughput cannot be compared across models or configurations.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.590364947+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="true" remarks="{&quot;what&quot;:&quot;HTTP status code or internal status of the request, if available.&quot;,&quot;why&quot;:&quot;Without it, failed or partial requests cannot be filtered out of usage analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.622756520+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="14" name="cost_usd" nullable="true" remarks="{&quot;what&quot;:&quot;Monetary cost of the request in US dollars, if calculated.&quot;,&quot;why&quot;:&quot;Without it, total spend and budget tracking are impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.659155122+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="backend" nullable="true" remarks="{&quot;what&quot;:&quot;Identifier of the backend or provider that served the request, if known.&quot;,&quot;why&quot;:&quot;Without it, multi-provider or multi-backend cost and performance cannot be compared.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:26:32.682824643+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="usage_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="usage_model_idx" unique="false">
            <column ascending="true" name="model"/>
            <column ascending="false" name="ts"/>
         </index>
         <index name="usage_ts_idx" unique="false">
            <column ascending="false" name="ts"/>
         </index>
      </table>
   </tables>
</database>
