<?xml version="1.0" encoding="UTF-8"?><database name="diagramrhythm" schema="public" type="PostgreSQL - 18.4 (Ubuntu 18.4-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="d2_diagrams_id_seq" startValue="1"/>
      <sequence increment="1" name="diagram_writes_id_seq" startValue="1"/>
      <sequence increment="1" name="field_annotations_id_seq" startValue="1"/>
      <sequence increment="1" name="schema_targets_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="d2_diagrams" remarks="" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('d2_diagrams_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="repo" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="content_hash" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="d2_source" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="svg" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="5" name="created_at" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="d2_diagrams_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="d2_diagrams_repo_content_hash_key" unique="true">
            <column ascending="true" name="repo"/>
            <column ascending="true" name="content_hash"/>
         </index>
         <index name="idx_d2_repo" unique="false">
            <column ascending="true" name="repo"/>
         </index>
      </table>
      <table name="diagram_writes" numRows="61" remarks="{&quot;what&quot;:&quot;Append-only log of every .mmd an agent writes, with its parse outcome.&quot;,&quot;why&quot;:&quot;Existence of a diagram says nothing about quality; the parse result shows whether the agent guidance works.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:16.699553469+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('diagram_writes_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Auto-increment id.&quot;,&quot;why&quot;:&quot;Primary key.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.962593901+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="1" name="written_at" nullable="false" remarks="{&quot;what&quot;:&quot;When the write was observed.&quot;,&quot;why&quot;:&quot;Time series for the pass-rate trend.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.083506995+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="file_path" nullable="false" remarks="{&quot;what&quot;:&quot;Path of the .mmd that was written.&quot;,&quot;why&quot;:&quot;Locates the failing diagram.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.211974949+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="session_id" nullable="true" remarks="{&quot;what&quot;:&quot;Agent session that wrote it.&quot;,&quot;why&quot;:&quot;Groups writes per session for the clean-rate metric.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.376682782+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="agent" nullable="true" remarks="{&quot;what&quot;:&quot;Agent name that wrote it.&quot;,&quot;why&quot;:&quot;Attributes quality per agent.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.487797434+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="tool" nullable="true" remarks="{&quot;what&quot;:&quot;Tool used for the write.&quot;,&quot;why&quot;:&quot;Distinguishes Write from Edit, etc.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.646024446+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="valid" nullable="false" remarks="{&quot;what&quot;:&quot;Whether the diagram parsed.&quot;,&quot;why&quot;:&quot;The core quality signal.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.777206574+00:00&quot;}" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="error_line" nullable="true" remarks="{&quot;what&quot;:&quot;Line the parse failed on.&quot;,&quot;why&quot;:&quot;Points at the offending token.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:18.884480973+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="error_text" nullable="true" remarks="{&quot;what&quot;:&quot;The parser error message.&quot;,&quot;why&quot;:&quot;Grouped to rank the most common agent mistakes.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:19.061516698+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="byte_size" nullable="true" remarks="{&quot;what&quot;:&quot;Size of the written file.&quot;,&quot;why&quot;:&quot;Correlates diagram size with failure rate.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:19.220212619+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="device" nullable="true" remarks="{&quot;what&quot;:&quot;Device the write happened on.&quot;,&quot;why&quot;:&quot;Separates mac0/mac1/dante behaviour.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:19.326442651+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="warnings" nullable="true" remarks="{&quot;what&quot;:&quot;Layout warnings from lint.mjs.&quot;,&quot;why&quot;:&quot;The diagram parsed but reads wrong, e.g. step order.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:19.455048521+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="diagram_writes_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_writes_at" unique="false">
            <column ascending="false" name="written_at"/>
         </index>
         <index name="idx_writes_session" unique="false">
            <column ascending="true" name="session_id"/>
         </index>
         <index name="idx_writes_valid" unique="false">
            <column ascending="true" name="valid"/>
         </index>
      </table>
      <table name="diagrams" numRows="1" remarks="{&quot;what&quot;:&quot;Current rendered Mermaid diagram for each repo, one row per repo.&quot;,&quot;why&quot;:&quot;Cache the LLM-generated diagram so a repeat request does not re-run the model.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:16.576776949+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="diagram_id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique id for this rendered diagram.&quot;,&quot;why&quot;:&quot;Identifies the artifact in logs and events.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:16.854724680+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="repo_name" nullable="false" remarks="{&quot;what&quot;:&quot;Repository short name, e.g. DiagramRhythm.&quot;,&quot;why&quot;:&quot;The key agents look a cached diagram up by.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.081568523+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="repo_path" nullable="false" remarks="{&quot;what&quot;:&quot;Absolute path to the repo on the device that generated it.&quot;,&quot;why&quot;:&quot;Prevents two same-named repos colliding in the cache.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.192587531+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="description" nullable="false" remarks="{&quot;what&quot;:&quot;LLM-written prose describing the architecture.&quot;,&quot;why&quot;:&quot;Fed to the second LLM pass that draws the diagram.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.379127570+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="mermaid" nullable="false" remarks="{&quot;what&quot;:&quot;The generated Mermaid source.&quot;,&quot;why&quot;:&quot;The deliverable; rendered by GitHub and DocRhythm.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.494368451+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="5" name="node_count" nullable="false" remarks="{&quot;what&quot;:&quot;Number of nodes in the diagram.&quot;,&quot;why&quot;:&quot;Sanity check that a render produced real structure.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.647824794+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="created_at" nullable="false" remarks="{&quot;what&quot;:&quot;When the diagram was first generated.&quot;,&quot;why&quot;:&quot;Audit.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.750154768+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="updated_at" nullable="false" remarks="{&quot;what&quot;:&quot;When the diagram was last regenerated.&quot;,&quot;why&quot;:&quot;Orders the list view and drives cache freshness.&quot;,&quot;by&quot;:&quot;jcode-builder&quot;,&quot;at&quot;:&quot;2026-09-22T21:50:17.844729479+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="diagram_id" sequenceNumberInPK="1"/>
         <index name="diagrams_pkey" unique="true">
            <column ascending="true" name="diagram_id"/>
         </index>
         <index name="diagrams_repo_path_key" unique="true">
            <column ascending="true" name="repo_path"/>
         </index>
         <index name="idx_diagrams_path" unique="false">
            <column ascending="true" name="repo_path"/>
         </index>
         <index name="idx_diagrams_repo" unique="false">
            <column ascending="true" name="repo_name"/>
         </index>
      </table>
      <table name="field_annotations" remarks="" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('field_annotations_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="db_name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="table_name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="column_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="what" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="why" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="agent_id" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="applied_at" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="field_annotations_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_annot_target" unique="false">
            <column ascending="true" name="db_name"/>
            <column ascending="true" name="table_name"/>
         </index>
      </table>
      <table name="schema_targets" remarks="" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('schema_targets_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="db_name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="azimutt_layout_url" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="schemaspy_path" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="last_synced_at" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="schema_targets_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="schema_targets_db_name_key" unique="true">
            <column ascending="true" name="db_name"/>
         </index>
      </table>
   </tables>
</database>
