{
  "revision": "dba1be0a40aa45a94ad051997016db3960a90277",
  "files_read": [
    "inference/model.py",
    "inference/config.json",
    "README.md",
    "inference/README.md"
  ],
  "supplied_figure_text": "sources/figure4_description.md",
  "claims": [
    {
      "id": "mode-gates",
      "claim": "Only kv_source_layers create Compressor; only index_source_layers create Indexer.",
      "file": "inference/model.py",
      "symbol": "Attention.__init__",
      "line_start": 653,
      "line_end": 661,
      "evidence_kind": "source_code",
      "visual_element": "Full/Reindex/Reuse source colors and inactive indexer"
    },
    {
      "id": "window",
      "claim": "Each Attention layer computes local window KV and maintains its own ring cache.",
      "file": "inference/model.py",
      "symbol": "Attention._window_kv",
      "line_start": 700,
      "line_end": 720,
      "evidence_kind": "source_code",
      "visual_element": "Four lavender local-window blocks in every mode"
    },
    {
      "id": "query",
      "claim": "Each attention forward computes its own main query.",
      "file": "inference/model.py",
      "symbol": "Attention.forward",
      "line_start": 765,
      "line_end": 774,
      "evidence_kind": "source_code",
      "visual_element": "Blue Main Q and direct query route to Core Attention"
    },
    {
      "id": "reuse-indices",
      "claim": "Non-index-source layers return shared_attn.topk_idxs directly.",
      "file": "inference/model.py",
      "symbol": "Attention._compress_topk_idxs",
      "line_start": 722,
      "line_end": 737,
      "evidence_kind": "source_code",
      "visual_element": "Reuse coral indices, inactive indexer, no indexer packets"
    },
    {
      "id": "share-kv",
      "claim": "Only a KV source produces latent KV; consumers read shared_attn.compress_kv.",
      "file": "inference/model.py",
      "symbol": "Attention._compress_kv",
      "line_start": 739,
      "line_end": 763,
      "evidence_kind": "source_code",
      "visual_element": "Yellow Main KV retained at all twelve positions"
    },
    {
      "id": "indexer-key",
      "claim": "Index-key owners derive K from compressor latent and publish it; all indexers compute their query against shared K.",
      "file": "inference/model.py",
      "symbol": "Indexer.forward",
      "line_start": 527,
      "line_end": 557,
      "evidence_kind": "source_code",
      "visual_element": "Current Indexer Q plus new/shared Indexer K"
    },
    {
      "id": "topk-integers",
      "claim": "Indexer chooses top positions and re-sorts them into position order.",
      "file": "inference/model.py",
      "symbol": "Indexer.forward",
      "line_start": 577,
      "line_end": 580,
      "evidence_kind": "source_code",
      "visual_element": "Three numbered Top-K tiles; no probabilities"
    },
    {
      "id": "logical-concat",
      "claim": "Reference concatenates the window and shared compressed cache, joins sparse indices, and invokes sparse_attn.",
      "file": "inference/model.py",
      "symbol": "Attention.forward",
      "line_start": 774,
      "line_end": 780,
      "evidence_kind": "source_code",
      "visual_element": "Selection/Selected KV/Concatenation are explicitly logical visualizations"
    },
    {
      "id": "runtime",
      "claim": "Shared runtime holds compress_kv, index_k and topk_idxs between layers.",
      "file": "inference/model.py",
      "symbol": "SharedAttentionRuntime",
      "line_start": 1166,
      "line_end": 1176,
      "evidence_kind": "source_code",
      "visual_element": "Separate KV-source and index-source provenance labels"
    },
    {
      "id": "layers",
      "claim": "Production Full layers are 2/8/14/20; index sources include 24, making 24 Reindex and 25 Reuse with source layers 20 and 24.",
      "file": "inference/config.json",
      "symbol": "kv_source_layers / index_source_layers",
      "line_start": 27,
      "line_end": 28,
      "evidence_kind": "production_config",
      "visual_element": "Mode tabs 20/24/25 and matching provenance"
    },
    {
      "id": "scale-window",
      "claim": "Production local window is 128.",
      "file": "inference/config.json",
      "symbol": "window_size",
      "line_start": 26,
      "line_end": 26,
      "evidence_kind": "production_config",
      "visual_element": "Implementation scope note, four local blocks as reduction"
    },
    {
      "id": "scale-topk",
      "claim": "Production index_topk is 512.",
      "file": "inference/config.json",
      "symbol": "index_topk",
      "line_start": 36,
      "line_end": 36,
      "evidence_kind": "production_config",
      "visual_element": "Top-3 is an explicit reduced teaching example"
    },
    {
      "id": "compressor",
      "claim": "Compressor pools groups when ratio > 1; ratio 1 is a plain normalized projection.",
      "file": "inference/model.py",
      "symbol": "Compressor.forward",
      "line_start": 458,
      "line_end": 485,
      "evidence_kind": "source_code",
      "visual_element": "Main KV represents global/cache entries, not fabricated attention weights"
    },
    {
      "id": "three-modes",
      "claim": "CSA2 assigns static Full, Reindex and Reuse modes to share main KV/index K and reuse sparse indices.",
      "file": "README.md",
      "symbol": "Compressed Sparse Attention 2 (CSA2)",
      "line_start": 49,
      "line_end": 49,
      "evidence_kind": "repository_readme",
      "visual_element": "Three mode comparison"
    },
    {
      "id": "figure-topology",
      "claim": "Main Q goes directly to Core Attention; SWA and selected main KV join; only Full/Reindex run Indexer.",
      "file": "../figure4_description.md",
      "symbol": "Figure 4 supplied text",
      "line_start": 8,
      "line_end": 43,
      "evidence_kind": "supplied_figure_text",
      "visual_element": "Stable 12-role layout and mode-specific enabled links"
    }
  ],
  "teaching_assumptions": {
    "selected_positions": {
      "full": [
        0,
        3,
        8
      ],
      "reindex": [
        1,
        4,
        7
      ],
      "reuse": [
        1,
        4,
        7
      ]
    },
    "positions_are_hand_set": true,
    "main_cache_count": 12,
    "local_window_count": 4,
    "selected_count": 3,
    "logical_copy_animation": true
  }
}
