syntaxai/tdd.md · main · public / sitemap-flow.svg
<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">data flow — registries → helper → XML response</text>
<text x="80" y="86" font-size="30" font-weight="700" fill="#e8e8e8">A new post = a new sitemap entry. Zero human edit.</text>
<text x="80" y="114" font-size="14" fill="#7a7a7a">Per-request generation. The registries are the source of truth; the sitemap is a projection.</text>
</g>
<!-- Top row: three registry boxes -->
<g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
<!-- ALL_POSTS -->
<rect x="80" y="148" width="340" height="100" fill="#1a1a1a" stroke="#4a9a5a" stroke-width="1.5" rx="6"/>
<text x="100" y="178" font-size="17" font-weight="600" fill="#4a9a5a">a31_blog.ts</text>
<text x="100" y="202" font-size="14" fill="#c8c8c8">ALL_POSTS</text>
<text x="100" y="222" font-size="12" fill="#8a8a8a">{ slug, title, description, date }[]</text>
<text x="100" y="240" font-size="12" fill="#6a6a6a">→ /blog/<slug> with lastmod = date</text>
<!-- ALL_SAMA -->
<rect x="430" y="148" width="340" height="100" fill="#1a1a1a" stroke="#4a9a5a" stroke-width="1.5" rx="6"/>
<text x="450" y="178" font-size="17" font-weight="600" fill="#4a9a5a">a31_sama.ts</text>
<text x="450" y="202" font-size="14" fill="#c8c8c8">ALL_SAMA</text>
<text x="450" y="222" font-size="12" fill="#8a8a8a">{ slug: "sorted" | "architecture" | … }[]</text>
<text x="450" y="240" font-size="12" fill="#6a6a6a">→ /sama/<slug></text>
<!-- STATIC_URLS -->
<rect x="780" y="148" width="340" height="100" fill="#1a1a1a" stroke="#4a9a5a" stroke-width="1.5" rx="6"/>
<text x="800" y="178" font-size="17" font-weight="600" fill="#4a9a5a">b32_sitemap.ts (const)</text>
<text x="800" y="202" font-size="14" fill="#c8c8c8">STATIC_URLS</text>
<text x="800" y="222" font-size="12" fill="#8a8a8a">["/", "/blog", "/sama/v2", "/guides", …]</text>
<text x="800" y="240" font-size="12" fill="#6a6a6a">→ load-bearing fixed routes</text>
</g>
<!-- Arrows down into the helper -->
<g stroke="#4a8a8a" stroke-width="1.5" fill="none">
<path d="M 250 250 L 250 300 L 600 300 L 600 320" />
<path d="M 600 250 L 600 320" />
<path d="M 950 250 L 950 300 L 600 300 L 600 320" />
</g>
<polygon points="595,320 605,320 600,332" fill="#4a8a8a"/>
<!-- Middle: helper box -->
<rect x="240" y="336" width="720" height="92" fill="#1a1a1a" stroke="#4a8a8a" stroke-width="1.5" rx="6"/>
<g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
<text x="600" y="368" text-anchor="middle" font-size="20" font-weight="600" fill="#4a8a8a">b32_sitemap.ts · renderSitemap(urls)</text>
<text x="600" y="392" text-anchor="middle" font-size="13" fill="#8a8a8a">pure · deterministic · no I/O · XML-escapes & and <</text>
<text x="600" y="412" text-anchor="middle" font-size="13" fill="#6a6a6a">sibling test — empty list · single url · with/without lastmod · order preserved · special-char escape</text>
</g>
<!-- Arrow down to response -->
<line x1="600" y1="428" x2="600" y2="456" stroke="#c89a3a" stroke-width="1.5"/>
<polygon points="595,456 605,456 600,468" fill="#c89a3a"/>
<!-- Bottom: response box -->
<rect x="160" y="472" width="880" height="86" fill="#1a1a1a" stroke="#c89a3a" stroke-width="1.5" rx="6"/>
<g font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace">
<text x="180" y="500" font-size="17" font-weight="600" fill="#c89a3a">GET /sitemap.xml → 200 application/xml; charset=utf-8 · Cache-Control: public, max-age=3600</text>
<text x="180" y="524" font-size="13" fill="#c8c8c8"><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></text>
<text x="200" y="542" font-size="13" fill="#8a8a8a"><url><loc>https://tdd.md/blog/sama-v2-workingset-cross-repo-baseline</loc><lastmod>2026-05-27</lastmod></url> …</text>
</g>
<!-- Footer caption -->
<text x="80" y="588" font-family="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace" font-size="12" fill="#6a6a6a">
No static file. No human edit. The next /sitemap.xml fetch after a deploy already lists every new post.
</text>
</svg>