{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200001,
      "id": "title",
      "x": 220,
      "y": 30,
      "width": 760,
      "height": 32,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 2001,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 26,
      "fontFamily": 1,
      "text": "Spectra Cache — SQLite Schema (4 tables)",
      "textAlign": "center",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Spectra Cache — SQLite Schema (4 tables)",
      "lineHeight": 1.25,
      "baseline": 24
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200002,
      "id": "subtitle",
      "x": 220,
      "y": 70,
      "width": 760,
      "height": 24,
      "angle": 0,
      "strokeColor": "#374151",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 2002,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 16,
      "fontFamily": 1,
      "text": "WAL mode · single ~/.cache/spectra/cache.db file · composite PKs make invalidation a no-op",
      "textAlign": "center",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "WAL mode · single ~/.cache/spectra/cache.db file · composite PKs make invalidation a no-op",
      "lineHeight": 1.25,
      "baseline": 16
    },

    {
      "type": "rectangle",
      "version": 1,
      "versionNonce": 200010,
      "id": "tbl-findings",
      "x": 60,
      "y": 130,
      "width": 380,
      "height": 280,
      "angle": 0,
      "strokeColor": "#7C3AED",
      "backgroundColor": "#ede9fe",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-findings"],
      "frameId": null,
      "roundness": { "type": 3 },
      "seed": 2010,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200011,
      "id": "tbl-findings-text",
      "x": 75,
      "y": 145,
      "width": 350,
      "height": 250,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-findings"],
      "frameId": null,
      "roundness": null,
      "seed": 2011,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 14,
      "fontFamily": 3,
      "text": "findings_cache  (Phase 1)\n────────────────────────────────\nPK file_hash        TEXT\nPK dimension        TEXT\nPK model_version    TEXT\nPK prompt_version   TEXT\nPK schema_version   TEXT\n   file_path        TEXT\n   findings_json    TEXT\n   spectra_version  TEXT\n   repo_signature   TEXT\n   computed_at      TIMESTAMP\n\nidx_repo (repo_signature)\nidx_age  (computed_at)",
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "findings_cache  (Phase 1)\n────────────────────────────────\nPK file_hash        TEXT\nPK dimension        TEXT\nPK model_version    TEXT\nPK prompt_version   TEXT\nPK schema_version   TEXT\n   file_path        TEXT\n   findings_json    TEXT\n   spectra_version  TEXT\n   repo_signature   TEXT\n   computed_at      TIMESTAMP\n\nidx_repo (repo_signature)\nidx_age  (computed_at)",
      "lineHeight": 1.3,
      "baseline": 12
    },

    {
      "type": "rectangle",
      "version": 1,
      "versionNonce": 200020,
      "id": "tbl-fullreport",
      "x": 480,
      "y": 130,
      "width": 380,
      "height": 280,
      "angle": 0,
      "strokeColor": "#16a34a",
      "backgroundColor": "#dcfce7",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-fullreport"],
      "frameId": null,
      "roundness": { "type": 3 },
      "seed": 2020,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200021,
      "id": "tbl-fullreport-text",
      "x": 495,
      "y": 145,
      "width": 350,
      "height": 250,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-fullreport"],
      "frameId": null,
      "roundness": null,
      "seed": 2021,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 14,
      "fontFamily": 3,
      "text": "full_report_cache  (Phase 2)\n────────────────────────────────\nPK repo_signature    TEXT\nPK spectra_version   TEXT\nPK model_versions    TEXT\nPK prompt_versions   TEXT\nPK schema_version    TEXT\n   report_json       TEXT\n   computed_at       TIMESTAMP\n\nUsed for: Phase 2 short-circuit\n  Skip Stages 3-5 entirely on a\n  full repo+versions match.",
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "full_report_cache  (Phase 2)\n────────────────────────────────\nPK repo_signature    TEXT\nPK spectra_version   TEXT\nPK model_versions    TEXT\nPK prompt_versions   TEXT\nPK schema_version    TEXT\n   report_json       TEXT\n   computed_at       TIMESTAMP\n\nUsed for: Phase 2 short-circuit\n  Skip Stages 3-5 entirely on a\n  full repo+versions match.",
      "lineHeight": 1.3,
      "baseline": 12
    },

    {
      "type": "rectangle",
      "version": 1,
      "versionNonce": 200030,
      "id": "tbl-batches",
      "x": 60,
      "y": 450,
      "width": 380,
      "height": 280,
      "angle": 0,
      "strokeColor": "#dc2626",
      "backgroundColor": "#fee2e2",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-batches"],
      "frameId": null,
      "roundness": { "type": 3 },
      "seed": 2030,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200031,
      "id": "tbl-batches-text",
      "x": 75,
      "y": 465,
      "width": 350,
      "height": 250,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-batches"],
      "frameId": null,
      "roundness": null,
      "seed": 2031,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 14,
      "fontFamily": 3,
      "text": "findings_batches  (Phase 3)\n────────────────────────────────\nPK batch_id         TEXT\nPK dimension        TEXT\nPK model_version    TEXT\nPK prompt_version   TEXT\nPK schema_version   TEXT\nPK spectra_version  TEXT\n   findings_json    TEXT\n   computed_at      TIMESTAMP\n\nbatch_id =\n  blake2b(sorted file_hashes\n           in this focus_area).\nThe killer feature.",
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "findings_batches  (Phase 3)\n────────────────────────────────\nPK batch_id         TEXT\nPK dimension        TEXT\nPK model_version    TEXT\nPK prompt_version   TEXT\nPK schema_version   TEXT\nPK spectra_version  TEXT\n   findings_json    TEXT\n   computed_at      TIMESTAMP\n\nbatch_id =\n  blake2b(sorted file_hashes\n           in this focus_area).\nThe killer feature.",
      "lineHeight": 1.3,
      "baseline": 12
    },

    {
      "type": "rectangle",
      "version": 1,
      "versionNonce": 200040,
      "id": "tbl-hitlog",
      "x": 480,
      "y": 450,
      "width": 380,
      "height": 280,
      "angle": 0,
      "strokeColor": "#d97706",
      "backgroundColor": "#fef3c7",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-hitlog"],
      "frameId": null,
      "roundness": { "type": 3 },
      "seed": 2040,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200041,
      "id": "tbl-hitlog-text",
      "x": 495,
      "y": 465,
      "width": 350,
      "height": 250,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": ["g-hitlog"],
      "frameId": null,
      "roundness": null,
      "seed": 2041,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 14,
      "fontFamily": 3,
      "text": "hit_log  (Phase 3, append-only)\n────────────────────────────────\n   ts    TIMESTAMP\n   hit   INTEGER  (1 hit, 0 miss)\n\nPhase 4 will add:\n   dimension    TEXT\n   batch_id     TEXT\n\nUsed by:\n  CacheStats.hit_rate_last_100\n  spectra cache stats CLI\n  on_cache_lookup observer hook",
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "hit_log  (Phase 3, append-only)\n────────────────────────────────\n   ts    TIMESTAMP\n   hit   INTEGER  (1 hit, 0 miss)\n\nPhase 4 will add:\n   dimension    TEXT\n   batch_id     TEXT\n\nUsed by:\n  CacheStats.hit_rate_last_100\n  spectra cache stats CLI\n  on_cache_lookup observer hook",
      "lineHeight": 1.3,
      "baseline": 12
    },

    {
      "type": "rectangle",
      "version": 1,
      "versionNonce": 200050,
      "id": "legend-bg",
      "x": 60,
      "y": 770,
      "width": 800,
      "height": 130,
      "angle": 0,
      "strokeColor": "#9ca3af",
      "backgroundColor": "#f9fafb",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "dashed",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": { "type": 3 },
      "seed": 2050,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false
    },
    {
      "type": "text",
      "version": 1,
      "versionNonce": 200051,
      "id": "legend-text",
      "x": 80,
      "y": 785,
      "width": 760,
      "height": 110,
      "angle": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "strokeStyle": "solid",
      "roughness": 0,
      "opacity": 100,
      "groupIds": [],
      "frameId": null,
      "roundness": null,
      "seed": 2051,
      "boundElements": [],
      "updated": 1714377600000,
      "link": null,
      "locked": false,
      "fontSize": 14,
      "fontFamily": 1,
      "text": "Invalidation matrix\n  • --force                       → bypass reads, still writes (whole run)\n  • --no-cache                    → composition root passes cache_port=None (no R/W)\n  • spectra version bump          → row mismatches via spectra_version field (whole repo)\n  • model / prompt / schema bump  → row mismatches via the corresponding key field\n  • file content change           → new blake2b → new file_hash / new batch_id\n  • file deleted                  → repo_signature changes → full_report_cache miss\n  • >N days old                   → lazy GC via Phase 4 'spectra cache prune'",
      "textAlign": "left",
      "verticalAlign": "top",
      "containerId": null,
      "originalText": "Invalidation matrix\n  • --force                       → bypass reads, still writes (whole run)\n  • --no-cache                    → composition root passes cache_port=None (no R/W)\n  • spectra version bump          → row mismatches via spectra_version field (whole repo)\n  • model / prompt / schema bump  → row mismatches via the corresponding key field\n  • file content change           → new blake2b → new file_hash / new batch_id\n  • file deleted                  → repo_signature changes → full_report_cache miss\n  • >N days old                   → lazy GC via Phase 4 'spectra cache prune'",
      "lineHeight": 1.3,
      "baseline": 12
    }
  ],
  "appState": {
    "gridSize": 20,
    "viewBackgroundColor": "#ffffff",
    "name": "spectra-cache-schema",
    "exportBackground": true,
    "exportWithDarkMode": false,
    "exportEmbedScene": true
  },
  "files": {}
}
