syntaxai/tdd.md · main · public / sitemap-layers.svg

sitemap-layers.svg 58 lines · 4300 bytes raw
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600" width="1200" height="600">
  <rect width="1200" height="600" fill="#0a0a0a"/>

  <!-- Header -->
  <g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
    <text x="80" y="44" font-size="20" font-weight="600" fill="#909090">/sitemap.xml — feature decomposition</text>
    <text x="80" y="86" font-size="34" font-weight="700" fill="#e8e8e8">One file per SAMA layer. Layer 2 stays empty.</text>
    <text x="80" y="116" font-size="15" fill="#7a7a7a">Three files total — Pure data already exists; Core helper + Entry handler are the only new code.</text>
  </g>

  <!-- Layer 3 · Entry -->
  <rect x="80" y="148" width="1040" height="78" fill="#1a1a1a" stroke="#2a2a2a" stroke-width="1.5" rx="6"/>
  <rect x="80" y="148" width="8" height="78" fill="#c89a3a" rx="3"/>
  <g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
    <text x="116" y="180" font-size="22" font-weight="600" fill="#e8e8e8">Layer 3 · Entry</text>
    <text x="116" y="208" font-size="14" fill="#8a8a8a">HTTP route — reads registries, calls Core helper, returns Response with XML body and Cache-Control</text>
    <text x="1100" y="193" text-anchor="end" font-size="16" font-style="italic" fill="#c89a3a">d21_app.ts → "/sitemap.xml"</text>
  </g>

  <text x="600" y="244" text-anchor="middle" font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace" font-size="13" fill="#6a6a6a">↓ uses</text>

  <!-- Layer 2 · Adapter — INTENTIONALLY EMPTY -->
  <rect x="80" y="251" width="1040" height="78" fill="#0f0f0f" stroke="#1f1f1f" stroke-width="1.5" stroke-dasharray="6 4" rx="6"/>
  <rect x="80" y="251" width="8" height="78" fill="#332218" rx="3"/>
  <g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
    <text x="116" y="283" font-size="22" font-weight="600" fill="#5a5a5a">Layer 2 · Adapter</text>
    <text x="116" y="311" font-size="14" fill="#5a5a5a">— not required — registries are already in-process data; no DB, no network, no filesystem read at request time</text>
    <text x="1100" y="296" text-anchor="end" font-size="16" font-style="italic" fill="#6a6a6a">(empty by design)</text>
  </g>

  <text x="600" y="347" text-anchor="middle" font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace" font-size="13" fill="#6a6a6a">↓ uses</text>

  <!-- Layer 1 · Core -->
  <rect x="80" y="354" width="1040" height="78" fill="#1a1a1a" stroke="#2a2a2a" stroke-width="1.5" rx="6"/>
  <rect x="80" y="354" width="8" height="78" fill="#4a8a8a" rx="3"/>
  <g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
    <text x="116" y="386" font-size="22" font-weight="600" fill="#e8e8e8">Layer 1 · Core</text>
    <text x="116" y="414" font-size="14" fill="#8a8a8a">pure logic — takes Array&lt;{loc, lastmod?}&gt;, XML-escapes, returns sitemaps.org 0.9 urlset string</text>
    <text x="1100" y="399" text-anchor="end" font-size="16" font-style="italic" fill="#4a8a8a">b32_sitemap.ts → renderSitemap()</text>
  </g>

  <text x="600" y="450" text-anchor="middle" font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace" font-size="13" fill="#6a6a6a">↓ uses</text>

  <!-- Layer 0 · Pure -->
  <rect x="80" y="457" width="1040" height="78" fill="#1a1a1a" stroke="#2a2a2a" stroke-width="1.5" rx="6"/>
  <rect x="80" y="457" width="8" height="78" fill="#4a9a5a" rx="3"/>
  <g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
    <text x="116" y="489" font-size="22" font-weight="600" fill="#e8e8e8">Layer 0 · Pure</text>
    <text x="116" y="517" font-size="14" fill="#8a8a8a">existing registries — single source of truth for every indexable URL on the site</text>
    <text x="1100" y="502" text-anchor="end" font-size="16" font-style="italic" fill="#4a9a5a">ALL_POSTS · ALL_SAMA · ALL_GUIDES · BASE_URL</text>
  </g>

  <!-- Caption -->
  <text x="80" y="572" font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace" font-size="13" fill="#6a6a6a">
    The Law (§1.2): imports flow downward only. d21 → b32 → a31. No upward edge, no sideways edge — the verifier rejects either.
  </text>
</svg>