<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Cupertino Releases</title>
<link>https://aleahim.com/</link>
<description>What each Cupertino version ships.</description>
<language>en-US</language>
<atom:link href="https://aleahim.com/collections/releases/feed.xml" rel="self" type="application/rss+xml"/>
<item>
<title>Cupertino 1.6: Platform Filters, Apple&apos;s Tutorials, and One Search Engine</title>
<link>https://aleahim.com/blog/cupertino-v1-6-5-tutorials-filters-one-engine/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-6-5-tutorials-filters-one-engine/</guid>
<pubDate>Thu, 19 Nov 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Two releases in two days, platform and UI toolkit filters, 193 tutorial pages, searches that no longer write to your databases, and the first half of moving every read onto one shared engine</description>
<content:encoded><![CDATA[<h1>Cupertino 1.6: Platform Filters, Apple’s Tutorials, and One Search Engine</h1>
<p><a href="https://aleahim.com/blog/cupertino-v1-5-0-five-months-diffed/">Cupertino 1.5.0</a> was about the content: 27,494 new pages and not one lost. The two releases since then, 1.6.0 on 18 November and 1.6.5 on 19 November, are about asking better questions of that content, adding a kind of page the database never had, and fixing the places where a search did something it should not.</p>
<p>The short version: <strong>you can now ask for pages that exist on exactly the platforms you name, or for one UI toolkit. Apple’s tutorials are searchable. A search no longer changes the files it reads. And the code that reads the databases is on its way to becoming one implementation instead of two.</strong></p>
<p>The long version follows, with the numbers, because the numbers are where the mistakes were found.</p>
<figure class="td-chart td-chart-bar" data-td-chart-interactive>
<figcaption class="td-chart-caption">Documentation pages per release</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Documentation pages per release"
>
<desc>bar chart with 3 labels and 1 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="232.5"
  x2="696"
  y2="232.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="236.5"
  text-anchor="end"
>100000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="163"
  x2="696"
  y2="163"
></line>
<text
  class="td-chart-value"
  x="70"
  y="167"
  text-anchor="end"
>200000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="93.5"
  x2="696"
  y2="93.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="97.5"
  text-anchor="end"
>300000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>400000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="165.67"
  y="30.22"
  width="32"
  height="271.78"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="371"
  y="30.22"
  width="32"
  height="271.78"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="576.33"
  y="30.08"
  width="32"
  height="271.92"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="182.67"
  y="324"
  text-anchor="middle"
>1.5.0</text>
<text
  class="td-chart-label"
  x="388"
  y="324"
  text-anchor="middle"
>1.6.0</text>
<text
  class="td-chart-label"
  x="593.33"
  y="324"
  text-anchor="middle"
>1.6.5</text>

<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Pages</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.5.0: 391056</title>
<rect class="td-chart-hit" x="165.67" y="30.22" width="32" height="271.78"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="119.37" y="310" width="124.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="128.37" y="330">1.5.0: 391056</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.6.0: 391056</title>
<rect class="td-chart-hit" x="371" y="30.22" width="32" height="271.78"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="324.7" y="310" width="124.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="333.7" y="330">1.6.0: 391056</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.6.5: 391249</title>
<rect class="td-chart-hit" x="576.33" y="30.08" width="32" height="271.92"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="530.03" y="310" width="124.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="539.03" y="330">1.6.5: 391249</text>
</g>
</g>
</svg>
</div>
</figure>
<p>The page count barely moves. That is the point: 1.6.0 changed what is stored about each page, and 1.6.5 added 193 pages of a new kind. Every one of the 391,056 pages of 1.6.0 is unchanged in 1.6.5, which I checked row by row, and I will show how.</p>
<h2>Filtering by platform: <code>--only</code></h2>
<p>Until 1.6.0 you could say “available since iOS 17” (<code>--min-ios 17.0</code>) or “not after macOS 14” (<code>--max-macos 14.0</code>). You could not say “this exists on iOS and visionOS and nowhere else”. Issue #8 asked for that.</p>
<p>The answer is a new column in schema 20, <code>docs_metadata.platform_scope</code>, a bitmask of the platforms a page’s availability list names:</p>
<table><thead><tr><th>Platform</th><th>Bit</th><th>Value</th></tr></thead><tbody><tr><td>iOS</td><td>0</td><td>1</td></tr><tr><td>macOS</td><td>1</td><td>2</td></tr><tr><td>tvOS</td><td>2</td><td>4</td></tr><tr><td>watchOS</td><td>3</td><td>8</td></tr><tr><td>visionOS</td><td>4</td><td>16</td></tr><tr><td>Mac Catalyst</td><td>5</td><td>32</td></tr></tbody></table>
<p>A page’s scope is the sum of the values of its platforms:</p>
<div class="td-math td-math-display"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 92 25.22" fill="currentColor" aria-hidden="true" style="width:9.2em;height:2.52em;vertical-align:-1.22em"><path d="M3.6 11.72C3.6 11.19 3.3 10.89 3.18 10.77C2.85 10.45 2.46 10.37 2.04 10.29C1.48 10.18 0.81 10.05 0.81 9.47C0.81 9.12 1.07 8.71 1.93 8.71C3.03 8.71 3.08 9.61 3.1 9.92C3.11 10.01 3.22 10.01 3.22 10.01C3.35 10.01 3.35 9.96 3.35 9.77L3.35 8.76C3.35 8.59 3.35 8.52 3.24 8.52C3.19 8.52 3.17 8.52 3.04 8.64C3.01 8.68 2.91 8.77 2.87 8.8C2.49 8.52 2.08 8.52 1.93 8.52C0.71 8.52 0.33 9.19 0.33 9.75C0.33 10.1 0.49 10.38 0.76 10.6C1.08 10.86 1.36 10.92 2.08 11.06C2.3 11.1 3.12 11.26 3.12 11.98C3.12 12.49 2.77 12.89 1.99 12.89C1.15 12.89 0.79 12.32 0.6 11.47C0.57 11.34 0.56 11.3 0.46 11.3C0.33 11.3 0.33 11.37 0.33 11.55L0.33 12.87C0.33 13.04 0.33 13.11 0.44 13.11C0.49 13.11 0.5 13.1 0.69 12.91C0.71 12.89 0.71 12.87 0.89 12.68C1.33 13.1 1.78 13.11 1.99 13.11C3.14 13.11 3.6 12.44 3.6 11.72Z"/><path d="M8.09 11.81C8.09 11.71 7.99 11.71 7.96 11.71C7.87 11.71 7.85 11.75 7.83 11.81C7.54 12.74 6.89 12.86 6.52 12.86C5.99 12.86 5.11 12.43 5.11 10.82C5.11 9.19 5.93 8.77 6.46 8.77C6.55 8.77 7.18 8.78 7.53 9.14C7.12 9.17 7.06 9.47 7.06 9.6C7.06 9.86 7.24 10.06 7.52 10.06C7.78 10.06 7.98 9.89 7.98 9.59C7.98 8.91 7.22 8.52 6.45 8.52C5.2 8.52 4.28 9.6 4.28 10.84C4.28 12.12 5.27 13.11 6.43 13.11C7.77 13.11 8.09 11.91 8.09 11.81Z"/><path d="M13.09 10.86C13.09 9.58 12.09 8.52 10.88 8.52C9.63 8.52 8.66 9.61 8.66 10.86C8.66 12.15 9.7 13.11 10.87 13.11C12.08 13.11 13.09 12.13 13.09 10.86ZM12.26 10.78C12.26 11.14 12.26 11.68 12.04 12.12C11.82 12.57 11.38 12.86 10.88 12.86C10.45 12.86 10.01 12.65 9.74 12.19C9.49 11.75 9.49 11.14 9.49 10.78C9.49 10.39 9.49 9.85 9.73 9.41C10 8.95 10.47 8.74 10.87 8.74C11.31 8.74 11.74 8.96 12 9.39C12.26 9.82 12.26 10.4 12.26 10.78Z"/><path d="M18.59 10.84C18.59 9.57 17.62 8.58 16.5 8.58C15.72 8.58 15.3 9.02 15.1 9.24L15.1 8.58L13.66 8.69L13.66 9C14.37 9 14.44 9.06 14.44 9.5L14.44 14.18C14.44 14.63 14.33 14.63 13.66 14.63L13.66 14.94L14.78 14.91L15.91 14.94L15.91 14.63C15.24 14.63 15.13 14.63 15.13 14.18L15.13 12.5L15.13 12.41C15.18 12.57 15.6 13.11 16.36 13.11C17.55 13.11 18.59 12.13 18.59 10.84ZM17.76 10.84C17.76 12.05 17.06 12.89 16.32 12.89C15.92 12.89 15.54 12.69 15.27 12.28C15.13 12.07 15.13 12.06 15.13 11.86L15.13 9.63C15.42 9.12 15.91 8.83 16.42 8.83C17.15 8.83 17.76 9.71 17.76 10.84Z"/><path d="M23.09 11.81C23.09 11.71 23.01 11.69 22.96 11.69C22.87 11.69 22.85 11.75 22.83 11.83C22.48 12.86 21.58 12.86 21.48 12.86C20.98 12.86 20.58 12.56 20.35 12.19C20.05 11.71 20.05 11.05 20.05 10.69L22.84 10.69C23.06 10.69 23.09 10.69 23.09 10.48C23.09 9.49 22.55 8.52 21.3 8.52C20.14 8.52 19.22 9.55 19.22 10.8C19.22 12.14 20.27 13.11 21.42 13.11C22.64 13.11 23.09 12 23.09 11.81ZM22.43 10.48L20.06 10.48C20.12 8.99 20.96 8.74 21.3 8.74C22.33 8.74 22.43 10.09 22.43 10.48Z"/><path d="M26.7 15.38C26.7 15.35 26.68 15.32 26.66 15.3C25.62 14.52 24.93 12.52 24.93 10.92L24.93 10.08C24.93 8.48 25.62 6.48 26.66 5.7C26.68 5.68 26.7 5.65 26.7 5.62C26.7 5.57 26.65 5.52 26.6 5.52C26.58 5.52 26.56 5.53 26.54 5.54C25.44 6.37 24.39 8.37 24.39 10.08L24.39 10.92C24.39 12.63 25.44 14.63 26.54 15.46C26.56 15.47 26.58 15.48 26.6 15.48C26.65 15.48 26.7 15.43 26.7 15.38Z"/><path d="M33.51 8.03C33.51 7.05 32.52 6.17 31.15 6.17L27.62 6.17L27.62 6.48L27.86 6.48C28.63 6.48 28.65 6.59 28.65 6.95L28.65 12.22C28.65 12.58 28.63 12.69 27.86 12.69L27.62 12.69L27.62 13C27.97 12.97 28.71 12.97 29.09 12.97C29.47 12.97 30.22 12.97 30.57 13L30.57 12.69L30.33 12.69C29.56 12.69 29.54 12.58 29.54 12.22L29.54 9.84L31.23 9.84C32.43 9.84 33.51 9.03 33.51 8.03ZM32.48 8.03C32.48 8.5 32.48 9.58 30.89 9.58L29.51 9.58L29.51 6.88C29.51 6.55 29.53 6.48 30 6.48L30.89 6.48C32.48 6.48 32.48 7.54 32.48 8.03Z"/><path d="M36.96 10.92L36.96 10.08C36.96 8.37 35.91 6.37 34.81 5.54C34.79 5.53 34.77 5.52 34.75 5.52C34.7 5.52 34.65 5.57 34.65 5.62C34.65 5.65 34.67 5.68 34.69 5.7C35.73 6.48 36.42 8.48 36.42 10.08L36.42 10.92C36.42 12.52 35.73 14.52 34.69 15.3C34.67 15.32 34.65 15.35 34.65 15.38C34.65 15.43 34.7 15.48 34.75 15.48C34.77 15.48 34.79 15.47 34.81 15.46C35.91 14.63 36.96 12.63 36.96 10.92Z"/><path d="M47.97 9.53C47.97 9.42 47.88 9.33 47.77 9.33L41.51 9.33C41.4 9.33 41.31 9.42 41.31 9.53C41.31 9.64 41.4 9.73 41.51 9.73L47.77 9.73C47.88 9.73 47.97 9.64 47.97 9.53ZM47.97 11.47C47.97 11.36 47.88 11.27 47.77 11.27L41.51 11.27C41.4 11.27 41.31 11.36 41.31 11.47C41.31 11.58 41.4 11.67 41.51 11.67L47.77 11.67C47.88 11.67 47.97 11.58 47.97 11.47Z"/><path d="M69.34 13.02L68.89 13.02C68.44 14.37 67.23 15.47 65.7 16C65.41 16.09 64.16 16.52 61.51 16.52L53.83 16.52L60.1 8.77C60.23 8.61 60.26 8.56 60.26 8.49C60.26 8.41 60.24 8.4 60.13 8.23L54.27 0.18L61.42 0.18C63.48 0.18 67.63 0.31 68.89 3.68L69.34 3.68L67.79 -0.54L52.82 -0.54C52.33 -0.54 52.32 -0.52 52.32 0.04L58.91 9.1L52.5 17.03C52.35 17.21 52.33 17.24 52.33 17.32C52.33 17.51 52.5 17.51 52.82 17.51L67.79 17.51Z"/><path d="M57.82 22.17C57.82 21.28 57.14 20.59 56.36 20.59C55.81 20.59 55.52 20.9 55.38 21.05L55.38 20.59L54.37 20.67L54.37 20.88C54.87 20.88 54.92 20.92 54.92 21.23L54.92 24.51C54.92 24.82 54.84 24.82 54.37 24.82L54.37 25.04L55.15 25.02L55.95 25.04L55.95 24.82C55.48 24.82 55.4 24.82 55.4 24.51L55.4 23.33L55.4 23.27C55.43 23.38 55.73 23.76 56.26 23.76C57.09 23.76 57.82 23.07 57.82 22.17ZM57.24 22.17C57.24 23.02 56.75 23.61 56.23 23.61C55.95 23.61 55.69 23.47 55.5 23.18C55.4 23.03 55.4 23.02 55.4 22.88L55.4 21.32C55.6 20.97 55.95 20.76 56.3 20.76C56.81 20.76 57.24 21.38 57.24 22.17Z"/><path d="M62.18 23.84C62.18 23.77 62.11 23.7 62.04 23.7L60.68 23.7C59.75 23.7 58.99 22.98 58.92 22.07L62.04 22.07C62.22 22.07 62.22 21.79 62.04 21.79L58.92 21.79C58.99 20.88 59.75 20.16 60.68 20.16L62.04 20.16C62.11 20.16 62.18 20.1 62.18 20.02C62.18 19.94 62.11 19.88 62.04 19.88L60.68 19.88C59.55 19.88 58.63 20.8 58.63 21.93C58.63 23.07 59.55 23.98 60.68 23.98L62.04 23.98C62.11 23.98 62.18 23.92 62.18 23.84Z"/><path d="M67.1 20.2C67.1 19.52 66.41 18.9 65.45 18.9L62.98 18.9L62.98 19.12L63.15 19.12C63.69 19.12 63.7 19.2 63.7 19.45L63.7 23.14C63.7 23.39 63.69 23.47 63.15 23.47L62.98 23.47L62.98 23.68C63.23 23.66 63.74 23.66 64.01 23.66C64.28 23.66 64.8 23.66 65.05 23.68L65.05 23.47L64.88 23.47C64.34 23.47 64.32 23.39 64.32 23.14L64.32 21.47L65.51 21.47C66.35 21.47 67.1 20.9 67.1 20.2ZM66.38 20.2C66.38 20.53 66.38 21.29 65.27 21.29L64.3 21.29L64.3 19.4C64.3 19.17 64.32 19.12 64.65 19.12L65.27 19.12C66.38 19.12 66.38 19.86 66.38 20.2Z"/><path d="M76.53 11.26L76.28 11.26C76.23 11.56 76.16 12 76.06 12.15C75.99 12.23 75.33 12.23 75.11 12.23L73.31 12.23L74.37 11.2C75.93 9.82 76.53 9.28 76.53 8.28C76.53 7.14 75.63 6.34 74.41 6.34C73.28 6.34 72.54 7.26 72.54 8.15C72.54 8.71 73.04 8.71 73.07 8.71C73.24 8.71 73.59 8.59 73.59 8.18C73.59 7.92 73.41 7.66 73.06 7.66C72.98 7.66 72.96 7.66 72.93 7.67C73.16 7.02 73.7 6.65 74.28 6.65C75.19 6.65 75.62 7.46 75.62 8.28C75.62 9.08 75.12 9.87 74.57 10.49L72.65 12.63C72.54 12.74 72.54 12.76 72.54 13L76.25 13Z"/><path d="M82.41 7.86C82.41 6.97 81.73 6.28 80.93 6.28C80.38 6.28 80.08 6.61 79.97 6.73L79.97 4.51L78.96 4.59L78.96 4.81C79.45 4.81 79.51 4.86 79.51 5.2L79.51 9.37L79.68 9.37L79.93 8.94C80.04 9.1 80.33 9.45 80.85 9.45C81.68 9.45 82.41 8.76 82.41 7.86ZM81.83 7.85C81.83 8.11 81.82 8.53 81.61 8.85C81.47 9.06 81.2 9.29 80.82 9.29C80.51 9.29 80.26 9.13 80.09 8.87C79.99 8.72 79.99 8.7 79.99 8.57L79.99 7.13C79.99 7 79.99 6.99 80.07 6.88C80.34 6.49 80.73 6.43 80.89 6.43C81.21 6.43 81.46 6.61 81.63 6.88C81.81 7.17 81.83 7.56 81.83 7.85Z"/><path d="M84.98 11.04C84.98 11.02 84.97 10.99 84.95 10.98C84.23 10.43 83.74 9.03 83.74 7.91L83.74 7.33C83.74 6.21 84.23 4.81 84.95 4.26C84.97 4.25 84.98 4.23 84.98 4.2C84.98 4.17 84.95 4.13 84.91 4.13C84.9 4.13 84.88 4.14 84.87 4.15C84.1 4.73 83.36 6.13 83.36 7.33L83.36 7.91C83.36 9.11 84.1 10.51 84.87 11.09C84.88 11.1 84.9 11.11 84.91 11.11C84.95 11.11 84.98 11.07 84.98 11.04Z"/><path d="M89.03 7.86C89.03 6.97 88.35 6.28 87.56 6.28C87.02 6.28 86.72 6.58 86.58 6.74L86.58 6.28L85.58 6.35L85.58 6.57C86.07 6.57 86.12 6.61 86.12 6.92L86.12 10.2C86.12 10.51 86.05 10.51 85.58 10.51L85.58 10.73L86.36 10.71L87.15 10.73L87.15 10.51C86.68 10.51 86.61 10.51 86.61 10.2L86.61 9.02L86.61 8.96C86.64 9.07 86.93 9.45 87.47 9.45C88.3 9.45 89.03 8.76 89.03 7.86ZM88.45 7.86C88.45 8.71 87.96 9.29 87.44 9.29C87.16 9.29 86.89 9.15 86.7 8.87C86.61 8.72 86.61 8.71 86.61 8.57L86.61 7.01C86.81 6.65 87.15 6.45 87.51 6.45C88.02 6.45 88.45 7.07 88.45 7.86Z"/><path d="M91.29 7.91L91.29 7.33C91.29 6.13 90.55 4.73 89.78 4.15C89.77 4.14 89.76 4.13 89.74 4.13C89.71 4.13 89.67 4.17 89.67 4.2C89.67 4.23 89.69 4.25 89.7 4.26C90.43 4.81 90.91 6.21 90.91 7.33L90.91 7.91C90.91 9.03 90.43 10.43 89.7 10.98C89.69 10.99 89.67 11.02 89.67 11.04C89.67 11.07 89.71 11.11 89.74 11.11C89.76 11.11 89.77 11.1 89.78 11.09C90.55 10.51 91.29 9.11 91.29 7.91Z"/></svg><math class="td-math-a11y" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>scope</mi><mtext>(</mtext><mi>P</mi><mtext>)</mtext><mtext> </mtext><mtext>=</mtext><mtext> </mtext><msub><mrow><mo>∑</mo></mrow><mrow><mrow><mi>p</mi><mtext> </mtext><mo>∈</mo><mtext> </mtext><mi>P</mi></mrow></mrow></msub><mtext> </mtext><msup><mrow><mn>2</mn></mrow><mrow><mrow><mspace width="0.17em"/><mi>b</mi><mtext>(</mtext><mi>p</mi><mtext>)</mtext></mrow></mrow></msup></mrow></math></div>
<p>So a page on iOS and visionOS has scope 1 + 16 = 17, and <code>cupertino search "gesture" --only ios --only visionos</code> keeps the pages whose scope, with the Mac Catalyst bit masked off, equals 17:</p>
<div class="td-math td-math-display"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 82.25 9.4" fill="currentColor" aria-hidden="true" style="width:8.22em;height:0.94em;vertical-align:-0.22em"><path d="M3.6 5.92C3.6 5.39 3.3 5.09 3.18 4.97C2.85 4.65 2.46 4.57 2.04 4.49C1.48 4.38 0.81 4.25 0.81 3.67C0.81 3.32 1.07 2.91 1.93 2.91C3.03 2.91 3.08 3.81 3.1 4.12C3.11 4.21 3.22 4.21 3.22 4.21C3.35 4.21 3.35 4.16 3.35 3.97L3.35 2.96C3.35 2.79 3.35 2.72 3.24 2.72C3.19 2.72 3.17 2.72 3.04 2.84C3.01 2.88 2.91 2.97 2.87 3C2.49 2.72 2.08 2.72 1.93 2.72C0.71 2.72 0.33 3.39 0.33 3.95C0.33 4.3 0.49 4.58 0.76 4.8C1.08 5.06 1.36 5.12 2.08 5.26C2.3 5.3 3.12 5.46 3.12 6.18C3.12 6.69 2.77 7.09 1.99 7.09C1.15 7.09 0.79 6.52 0.6 5.67C0.57 5.54 0.56 5.5 0.46 5.5C0.33 5.5 0.33 5.57 0.33 5.75L0.33 7.07C0.33 7.24 0.33 7.31 0.44 7.31C0.49 7.31 0.5 7.3 0.69 7.11C0.71 7.09 0.71 7.07 0.89 6.88C1.33 7.3 1.78 7.31 1.99 7.31C3.14 7.31 3.6 6.64 3.6 5.92Z"/><path d="M8.09 6.01C8.09 5.91 7.99 5.91 7.96 5.91C7.87 5.91 7.85 5.95 7.83 6.01C7.54 6.94 6.89 7.06 6.52 7.06C5.99 7.06 5.11 6.63 5.11 5.02C5.11 3.39 5.93 2.97 6.46 2.97C6.55 2.97 7.18 2.98 7.53 3.34C7.12 3.37 7.06 3.67 7.06 3.8C7.06 4.06 7.24 4.26 7.52 4.26C7.78 4.26 7.98 4.09 7.98 3.79C7.98 3.11 7.22 2.72 6.45 2.72C5.2 2.72 4.28 3.8 4.28 5.04C4.28 6.32 5.27 7.31 6.43 7.31C7.77 7.31 8.09 6.11 8.09 6.01Z"/><path d="M13.09 5.06C13.09 3.78 12.09 2.72 10.88 2.72C9.63 2.72 8.66 3.81 8.66 5.06C8.66 6.35 9.7 7.31 10.87 7.31C12.08 7.31 13.09 6.33 13.09 5.06ZM12.26 4.98C12.26 5.34 12.26 5.88 12.04 6.32C11.82 6.77 11.38 7.06 10.88 7.06C10.45 7.06 10.01 6.85 9.74 6.39C9.49 5.95 9.49 5.34 9.49 4.98C9.49 4.59 9.49 4.05 9.73 3.61C10 3.15 10.47 2.94 10.87 2.94C11.31 2.94 11.74 3.16 12 3.59C12.26 4.02 12.26 4.6 12.26 4.98Z"/><path d="M18.59 5.04C18.59 3.77 17.62 2.78 16.5 2.78C15.72 2.78 15.3 3.22 15.1 3.44L15.1 2.78L13.66 2.89L13.66 3.2C14.37 3.2 14.44 3.26 14.44 3.7L14.44 8.38C14.44 8.83 14.33 8.83 13.66 8.83L13.66 9.14L14.78 9.11L15.91 9.14L15.91 8.83C15.24 8.83 15.13 8.83 15.13 8.38L15.13 6.7L15.13 6.61C15.18 6.77 15.6 7.31 16.36 7.31C17.55 7.31 18.59 6.33 18.59 5.04ZM17.76 5.04C17.76 6.25 17.06 7.09 16.32 7.09C15.92 7.09 15.54 6.89 15.27 6.48C15.13 6.27 15.13 6.26 15.13 6.06L15.13 3.83C15.42 3.32 15.91 3.03 16.42 3.03C17.15 3.03 17.76 3.91 17.76 5.04Z"/><path d="M23.09 6.01C23.09 5.91 23.01 5.89 22.96 5.89C22.87 5.89 22.85 5.95 22.83 6.03C22.48 7.06 21.58 7.06 21.48 7.06C20.98 7.06 20.58 6.76 20.35 6.39C20.05 5.91 20.05 5.25 20.05 4.89L22.84 4.89C23.06 4.89 23.09 4.89 23.09 4.68C23.09 3.69 22.55 2.72 21.3 2.72C20.14 2.72 19.22 3.75 19.22 5C19.22 6.34 20.27 7.31 21.42 7.31C22.64 7.31 23.09 6.2 23.09 6.01ZM22.43 4.68L20.06 4.68C20.12 3.19 20.96 2.94 21.3 2.94C22.33 2.94 22.43 4.29 22.43 4.68Z"/><path d="M34.83 7.2L34.83 6.89C34.31 6.89 34.06 6.89 34.05 6.59L34.05 4.68C34.05 3.82 34.05 3.51 33.74 3.15C33.6 2.98 33.27 2.78 32.69 2.78C31.85 2.78 31.41 3.38 31.24 3.76C31.1 2.89 30.36 2.78 29.91 2.78C29.18 2.78 28.71 3.21 28.43 3.83L28.43 2.78L27.02 2.89L27.02 3.2C27.72 3.2 27.8 3.27 27.8 3.76L27.8 6.44C27.8 6.89 27.69 6.89 27.02 6.89L27.02 7.2L28.15 7.17L29.27 7.2L29.27 6.89C28.6 6.89 28.49 6.89 28.49 6.44L28.49 4.6C28.49 3.56 29.2 3 29.84 3C30.47 3 30.58 3.54 30.58 4.11L30.58 6.44C30.58 6.89 30.47 6.89 29.8 6.89L29.8 7.2L30.93 7.17L32.05 7.2L32.05 6.89C31.38 6.89 31.27 6.89 31.27 6.44L31.27 4.6C31.27 3.56 31.98 3 32.62 3C33.25 3 33.36 3.54 33.36 4.11L33.36 6.44C33.36 6.89 33.25 6.89 32.58 6.89L32.58 7.2L33.71 7.17Z"/><path d="M39.74 5.06C39.74 3.78 38.74 2.72 37.53 2.72C36.28 2.72 35.31 3.81 35.31 5.06C35.31 6.35 36.35 7.31 37.52 7.31C38.73 7.31 39.74 6.33 39.74 5.06ZM38.91 4.98C38.91 5.34 38.91 5.88 38.69 6.32C38.47 6.77 38.03 7.06 37.53 7.06C37.1 7.06 36.66 6.85 36.39 6.39C36.14 5.95 36.14 5.34 36.14 4.98C36.14 4.59 36.14 4.05 36.38 3.61C36.65 3.15 37.12 2.94 37.52 2.94C37.96 2.94 38.39 3.16 38.65 3.59C38.91 4.02 38.91 4.6 38.91 4.98Z"/><path d="M45.3 7.2L45.3 6.89C44.6 6.89 44.52 6.82 44.52 6.33L44.52 0.26L43.08 0.37L43.08 0.68C43.78 0.68 43.86 0.75 43.86 1.24L43.86 3.4C43.57 3.04 43.14 2.78 42.6 2.78C41.42 2.78 40.37 3.76 40.37 5.05C40.37 6.32 41.35 7.31 42.49 7.31C43.13 7.31 43.58 6.97 43.83 6.65L43.83 7.31ZM43.83 6.02C43.83 6.2 43.83 6.22 43.72 6.39C43.42 6.87 42.97 7.09 42.54 7.09C42.09 7.09 41.73 6.83 41.49 6.45C41.23 6.04 41.2 5.47 41.2 5.06C41.2 4.69 41.22 4.09 41.51 3.64C41.72 3.33 42.1 3 42.64 3C42.99 3 43.41 3.15 43.72 3.6C43.83 3.77 43.83 3.79 43.83 3.97Z"/><path d="M53.48 5.49C53.48 4.67 52.85 3.89 51.81 3.68C52.63 3.41 53.21 2.71 53.21 1.92C53.21 1.1 52.33 0.54 51.37 0.54C50.36 0.54 49.6 1.14 49.6 1.9C49.6 2.23 49.82 2.42 50.11 2.42C50.42 2.42 50.62 2.2 50.62 1.91C50.62 1.41 50.15 1.41 50 1.41C50.31 0.92 50.97 0.79 51.33 0.79C51.74 0.79 52.29 1.01 52.29 1.91C52.29 2.03 52.27 2.61 52.01 3.05C51.71 3.53 51.37 3.56 51.12 3.57C51.04 3.58 50.8 3.6 50.73 3.6C50.65 3.61 50.58 3.62 50.58 3.72C50.58 3.83 50.65 3.83 50.82 3.83L51.26 3.83C52.08 3.83 52.45 4.51 52.45 5.49C52.45 6.85 51.76 7.14 51.32 7.14C50.89 7.14 50.14 6.97 49.79 6.38C50.14 6.43 50.45 6.21 50.45 5.83C50.45 5.47 50.18 5.27 49.89 5.27C49.65 5.27 49.33 5.41 49.33 5.85C49.33 6.76 50.26 7.42 51.35 7.42C52.57 7.42 53.48 6.51 53.48 5.49Z"/><path d="M58.4 5.46L58.15 5.46C58.1 5.76 58.03 6.2 57.93 6.35C57.86 6.43 57.2 6.43 56.98 6.43L55.18 6.43L56.24 5.4C57.8 4.02 58.4 3.48 58.4 2.48C58.4 1.34 57.5 0.54 56.28 0.54C55.15 0.54 54.41 1.46 54.41 2.35C54.41 2.91 54.91 2.91 54.94 2.91C55.11 2.91 55.46 2.79 55.46 2.38C55.46 2.12 55.28 1.86 54.93 1.86C54.85 1.86 54.83 1.86 54.8 1.87C55.03 1.22 55.57 0.85 56.15 0.85C57.06 0.85 57.49 1.66 57.49 2.48C57.49 3.28 56.99 4.07 56.44 4.69L54.52 6.83C54.41 6.94 54.41 6.96 54.41 7.2L58.12 7.2Z"/><path d="M68.91 3.73C68.91 3.62 68.82 3.53 68.71 3.53L62.45 3.53C62.34 3.53 62.25 3.62 62.25 3.73C62.25 3.84 62.34 3.93 62.45 3.93L68.71 3.93C68.82 3.93 68.91 3.84 68.91 3.73ZM68.91 5.67C68.91 5.56 68.82 5.47 68.71 5.47L62.45 5.47C62.34 5.47 62.25 5.56 62.25 5.67C62.25 5.78 62.34 5.87 62.45 5.87L68.71 5.87C68.82 5.87 68.91 5.78 68.91 5.67Z"/><path d="M76.44 7.2L76.44 6.89L76.12 6.89C75.22 6.89 75.19 6.78 75.19 6.41L75.19 0.8C75.19 0.56 75.19 0.54 74.96 0.54C74.34 1.18 73.46 1.18 73.14 1.18L73.14 1.49C73.34 1.49 73.93 1.49 74.45 1.23L74.45 6.41C74.45 6.77 74.42 6.89 73.52 6.89L73.2 6.89L73.2 7.2C73.55 7.17 74.42 7.17 74.82 7.17C75.22 7.17 76.09 7.17 76.44 7.2Z"/><path d="M82.1 0.76L79.67 0.76C78.45 0.76 78.43 0.63 78.39 0.44L78.14 0.44L77.81 2.5L78.06 2.5C78.09 2.34 78.18 1.71 78.31 1.59C78.38 1.53 79.16 1.53 79.29 1.53L81.36 1.53L80.24 3.11C79.34 4.46 79.01 5.85 79.01 6.87C79.01 6.97 79.01 7.42 79.47 7.42C79.93 7.42 79.93 6.97 79.93 6.87L79.93 6.36C79.93 5.81 79.96 5.26 80.04 4.72C80.08 4.49 80.22 3.63 80.66 3.01L82.01 1.11C82.1 0.99 82.1 0.97 82.1 0.76Z"/></svg><math class="td-math-a11y" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mtext>scope mod </mtext><mtext> </mtext><mn>3</mn><mn>2</mn><mtext> </mtext><mtext>=</mtext><mtext> </mtext><mn>1</mn><mn>7</mn></mrow></math></div>
<p>Three decisions in there are worth explaining, because each came from looking at the 1.5.0 database first:</p>
<ul><li><p><strong>iPadOS is iOS.</strong> It is never listed without iOS, so <code>ipados</code> is accepted as a spelling of <code>ios</code> and has no bit of its own.</p></li><li><p><strong>Mac Catalyst is a marker, not a platform of the set.</strong> It sits beside the set and does not break an exact match, so a page on iOS and Mac Catalyst still matches <code>--only ios</code>.</p></li><li><p><strong>No scope is better than a wrong scope.</strong> A list with an entry that is not one of the five platforms (<code>Unsupported OS</code>, Safari, DriverKit), an absent list, and a list of Mac Catalyst alone all store <code>NULL</code>, and a <code>NULL</code> never passes the filter, the same way an absent minimum never passes <code>--min-ios</code>.</p></li></ul>
<p>The MCP <code>search</code> tool takes the same thing as <code>only</code>, a comma separated string.</p>
<h2>Filtering by UI toolkit: <code>--ui</code></h2>
<p>Issue #7 wanted the other axis: show me AppKit, not UIKit. <code>cupertino search "window" --ui appkit</code> now returns pages tagged AppKit. The names are <code>swiftui</code>, <code>uikit</code>, <code>appkit</code>, <code>catalyst</code> and <code>neutral</code>.</p>
<p>The tag is stored too, in <code>docs_metadata.ui_tags</code>, another bitmask (SwiftUI 1, UIKit 2, AppKit 4, Mac Catalyst 8). The framework decides the toolkit, whatever the source. In the 1.5.0 database that gives:</p>
<figure class="td-chart td-chart-bar" data-td-chart-interactive>
<figcaption class="td-chart-caption">Pages tagged by toolkit in the 1.5.0 database</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Pages tagged by toolkit in the 1.5.0 database"
>
<desc>bar chart with 3 labels and 1 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="209.33"
  x2="696"
  y2="209.33"
></line>
<text
  class="td-chart-value"
  x="70"
  y="213.33"
  text-anchor="end"
>5000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="116.67"
  x2="696"
  y2="116.67"
></line>
<text
  class="td-chart-value"
  x="70"
  y="120.67"
  text-anchor="end"
>10000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>15000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="165.67"
  y="132.53"
  width="32"
  height="169.47"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="371"
  y="63.7"
  width="32"
  height="238.3"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="576.33"
  y="42.85"
  width="32"
  height="259.15"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="182.67"
  y="324"
  text-anchor="middle"
>SwiftUI</text>
<text
  class="td-chart-label"
  x="388"
  y="324"
  text-anchor="middle"
>UIKit</text>
<text
  class="td-chart-label"
  x="593.33"
  y="324"
  text-anchor="middle"
>AppKit</text>

<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Pages</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>SwiftUI: 9144</title>
<rect class="td-chart-hit" x="165.67" y="132.53" width="32" height="169.47"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="119.37" y="94.53" width="124.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="128.37" y="114.53">SwiftUI: 9144</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>UIKit: 12858</title>
<rect class="td-chart-hit" x="371" y="63.7" width="32" height="238.3"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="328.8" y="25.7" width="116.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="337.8" y="45.7">UIKit: 12858</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>AppKit: 13983</title>
<rect class="td-chart-hit" x="576.33" y="42.85" width="32" height="259.15"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="530.03" y="4.85" width="124.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="539.03" y="24.85">AppKit: 13983</text>
</g>
</g>
</svg>
</div>
</figure>
<p>The interesting number is one that is not in that chart. If availability alone decided the tag, Mac Catalyst would tag <strong>256,651 pages, 65 percent of the corpus</strong>, and <code>--ui catalyst</code> would return Foundation. So Mac Catalyst is carried only together with a toolkit tag, and a page no rule tags is <code>NULL</code>, which the filter reads as toolkit-neutral. <code>--ui appkit</code> does not return neutral pages; <code>--ui neutral</code> selects them.</p>
<h3>A migration that silently did nothing</h3>
<p>Adding a column to a database that ships to everyone is where this feature nearly shipped broken. The 19 to 20 migration added <code>platform_scope</code> and <code>ui_tags</code> with <code>NULL</code> in every row, which is correct. But <code>cupertino save</code> skips a page whose content hash and metadata stamp are unchanged, and those rows’ stamps were unchanged. On a clone of the 1.5.0 documentation, a full save took 15 minutes, reported <code>indexed: 390925, skipped: 41</code>, and left <strong>0 of 390,925 rows</strong> with a scope or tags. <code>cupertino doctor</code> reported nothing wrong.</p>
<p>The migration now clears every stamp in the same transaction that adds the column. A missing stamp never equals the current one, so the next save rewrites every row. And until it has, <code>cupertino doctor</code> says so: <code>N of N rows not embellished (no metadata stamp)</code>, exit status 1, with the command that fixes it printed.</p>
<h2><code>--swift</code> now means the same thing everywhere</h2>
<p><code>--swift 5.9</code> means “usable with a toolchain of version 5.9”. For packages that is <code>swift-tools-version</code> at most 5.9. For sample code it is the declared language mode or tools version. In both cases a project that declares nothing never passes, the same rule as the documentation. It works in the all-sources search, in the CLI and in MCP, which used to leave packages and samples out when the flag was set, or list them unfiltered.</p>
<p>The comparison is on an integer column, so the order is numeric, not alphabetical: 5.10 is above 5.9.</p>
<h2>The limits of version metadata, measured</h2>
<p>I also wrote down what the version metadata cannot do, with numbers from the 1.5.0 database (#17):</p>
<ul><li><strong>70,113 pages</strong> carry no minimum version on any of the five stored platforms: 61,841 have a list with no version in it, 8,272 have no list at all.</li><li>Borrowing the parent page’s version is not an option. Comparing the iOS minimum of a child with its parent, over 197,073 pairs:</li></ul>
<figure class="td-chart td-chart-pie" data-td-chart-interactive>
<figcaption class="td-chart-caption">Child iOS minimum compared with its parent</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Child iOS minimum compared with its parent"
>
<desc>pie chart with 3 labels and 1 series</desc>
<path class="td-chart-slice td-chart-series-0" d="M 360 172 L 360 56.8 A 115.2 115.2 0 1 1 246.16 189.63 Z"></path>
<path class="td-chart-slice td-chart-series-1" d="M 360 172 L 246.16 189.63 A 115.2 115.2 0 0 1 347.09 57.53 Z"></path>
<path class="td-chart-slice td-chart-series-2" d="M 360 172 L 347.09 57.53 A 115.2 115.2 0 0 1 360 56.8 Z"></path>
<rect
  class="td-chart-series-0"
  x="80"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="348"
  text-anchor="start"
>Equal</text>
<rect
  class="td-chart-series-1"
  x="158.4"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="176.4"
  y="348"
  text-anchor="start"
>Later</text>
<rect
  class="td-chart-series-2"
  x="233.12"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="251.12"
  y="348"
  text-anchor="start"
>Earlier</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Equal: 142986 (72.55%)</title>
<path class="td-chart-hit" d="M 360 172 L 360 56.8 A 115.2 115.2 0 1 1 246.16 189.63 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="304.53" y="171.48" width="198.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="313.53" y="191.48">Equal: 142986 (72.55%)</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>Later: 50566 (25.66%)</title>
<path class="td-chart-hit" d="M 360 172 L 246.16 189.63 A 115.2 115.2 0 0 1 347.09 57.53 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="219.13" y="99.03" width="190.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="228.13" y="119.03">Later: 50566 (25.66%)</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-2" tabindex="0"><title>Earlier: 3521 (1.79%)</title>
<path class="td-chart-hit" d="M 360 172 L 347.09 57.53 A 115.2 115.2 0 0 1 360 56.8 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="261.67" y="76.49" width="190.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="270.67" y="96.49">Earlier: 3521 (1.79%)</text>
</g>
</g>
</svg>
</div>
</figure>
<p>A child is later than its parent in 26 percent of the pairs and earlier in almost 2 percent. A guess from the parent would be wrong in 27 percent of the cases, so the filters guess nothing, and <code>--include-unknown</code> and the option help say so.</p>
<h2>Fewer “unknown” kinds</h2>
<p>A page’s kind (struct, method, property, article) drives ranking: a type ranks above its members. In 1.5.0, <strong>52,941</strong> pages had the kind <code>unknown</code>, and 38,886 in the structured table the ranker reads. Three fixes (#58) brought that down:</p>
<ul><li><p>Apple’s role headings “Enumeration Case” (about 33,000 pages in the C frameworks: kernel, coreservices, iokit, accelerate), “Global Variable”, “Instance Variable” and “Static Property” were not in the kind table. They are now.</p></li><li><p>The web-service and device-management headings (Object, Dictionary, Web Service Endpoint, Property List Key) map to a kind.</p></li><li><p>A page stored as <code>unknown</code> gets its kind again from the role heading in its own markdown, so a rebuild from the same files finally uses the improved tables.</p></li></ul>
<p>Rebuilding from the corpus files of 8 November:</p>
<figure class="td-chart td-chart-bar" data-td-chart-interactive>
<figcaption class="td-chart-caption">Pages with kind unknown, before and after</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Pages with kind unknown, before and after"
>
<desc>bar chart with 2 labels and 2 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="209.33"
  x2="696"
  y2="209.33"
></line>
<text
  class="td-chart-value"
  x="70"
  y="213.33"
  text-anchor="end"
>20000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="116.67"
  x2="696"
  y2="116.67"
></line>
<text
  class="td-chart-value"
  x="70"
  y="120.67"
  text-anchor="end"
>40000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>60000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="200"
  y="56.71"
  width="32"
  height="245.29"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="508"
  y="121.83"
  width="32"
  height="180.17"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="234"
  y="280.59"
  width="32"
  height="21.41"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="542"
  y="286.27"
  width="32"
  height="15.73"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="234"
  y="324"
  text-anchor="middle"
>docs_metadata</text>
<text
  class="td-chart-label"
  x="542"
  y="324"
  text-anchor="middle"
>docs_structured</text>

<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Before</text>
<rect
  class="td-chart-series-1"
  x="163.52"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="181.52"
  y="346"
  text-anchor="start"
>After</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Before, docs_metadata: 52941</title>
<rect class="td-chart-hit" x="200" y="56.71" width="32" height="245.29"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="92.2" y="18.71" width="247.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="101.2" y="38.71">Before, docs_metadata: 52941</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Before, docs_structured: 38886</title>
<rect class="td-chart-hit" x="508" y="121.83" width="32" height="180.17"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="392" y="83.83" width="264" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="401" y="103.83">Before, docs_structured: 38886</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>After, docs_metadata: 4620</title>
<rect class="td-chart-hit" x="234" y="275.3" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="134.4" y="242.59" width="231.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="143.4" y="262.59">After, docs_metadata: 4620</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>After, docs_structured: 3395</title>
<rect class="td-chart-hit" x="542" y="278.13" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="434.2" y="248.27" width="247.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="443.2" y="268.27">After, docs_structured: 3395</text>
</g>
</g>
</svg>
</div>
</figure>
<p>A related fix (#57): an inline reference in Apple’s structured data was written as <code>[doc://com.apple.appkit/documentation/AppKit/NSSearchToolbarItem]</code> where the name belongs. 59,360 pages of the 1.5.0 corpus held that form. The indexer now writes <code>[NSSearchToolbarItem]</code>, so the next save repairs them without a new crawl.</p>
<h2>Long pages were being cut</h2>
<p>The full-text index keeps, for a page typed as a type or a member, its title, abstract, declaration and the first 2,000 characters of its overview. That is right for API reference and wrong for a WWDC session. For a page whose text names no kind, the kind was guessed from its first code block, so a session whose first example looked like <code>struct SomeInternalStruct</code> was indexed as a struct and the rest of its text could not be searched.</p>
<figure class="td-chart td-chart-bar" data-td-chart-interactive>
<figcaption class="td-chart-caption">Long pages that were cut in the 1.5.0 index</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Long pages that were cut in the 1.5.0 index"
>
<desc>bar chart with 3 labels and 2 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="232.5"
  x2="696"
  y2="232.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="236.5"
  text-anchor="end"
>500</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="163"
  x2="696"
  y2="163"
></line>
<text
  class="td-chart-value"
  x="70"
  y="167"
  text-anchor="end"
>1000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="93.5"
  x2="696"
  y2="93.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="97.5"
  text-anchor="end"
>1500</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>2000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="148.67"
  y="77.1"
  width="32"
  height="224.9"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="354"
  y="296.3"
  width="32"
  height="5.7"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="559.33"
  y="251.96"
  width="32"
  height="50.04"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="182.67"
  y="227.22"
  width="32"
  height="74.78"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="388"
  y="296.44"
  width="32"
  height="5.56"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="593.33"
  y="290.32"
  width="32"
  height="11.68"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="182.67"
  y="324"
  text-anchor="middle"
>wwdc</text>
<text
  class="td-chart-label"
  x="388"
  y="324"
  text-anchor="middle"
>swift-book</text>
<text
  class="td-chart-label"
  x="593.33"
  y="324"
  text-anchor="middle"
>swift-org</text>

<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Long</text>
<rect
  class="td-chart-series-1"
  x="153.28"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="171.28"
  y="346"
  text-anchor="start"
>Cut</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Long, wwdc: 1618</title>
<rect class="td-chart-hit" x="148.67" y="77.1" width="32" height="224.9"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="90.07" y="39.1" width="149.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="99.07" y="59.1">Long, wwdc: 1618</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Long, swift-book: 41</title>
<rect class="td-chart-hit" x="354" y="283.15" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="279" y="258.3" width="182" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="288" y="278.3">Long, swift-book: 41</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Long, swift-org: 360</title>
<rect class="td-chart-hit" x="559.33" y="251.96" width="32" height="50.04"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="484.33" y="213.96" width="182" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="493.33" y="233.96">Long, swift-org: 360</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>Cut, wwdc: 538</title>
<rect class="td-chart-hit" x="182.67" y="227.22" width="32" height="74.78"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="132.27" y="189.22" width="132.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="141.27" y="209.22">Cut, wwdc: 538</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>Cut, swift-book: 40</title>
<rect class="td-chart-hit" x="388" y="283.22" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="317.1" y="258.44" width="173.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="326.1" y="278.44">Cut, swift-book: 40</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>Cut, swift-org: 84</title>
<rect class="td-chart-hit" x="593.33" y="280.16" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="526.53" y="252.32" width="165.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="535.53" y="272.32">Cut, swift-org: 84</text>
</g>
</g>
</svg>
</div>
</figure>
<p>538 of 1,618 long WWDC pages. 40 of the 41 Swift book chapters: the chapter “Access Control” had <strong>1,186 of its 34,150 characters</strong> in the index. Sessions, notes, book chapters and swift.org pages are now indexed whole.</p>
<h2>Apple’s tutorials</h2>
<p>This is the new content, and the one that needed a parser.</p>
<p>Apple publishes tutorials on its web site, <code>developer.apple.com/tutorials/swiftui</code> and four more series, that are not in the documentation the database was built from. They are DocC JSON of a different shape. A documentation page keeps its text in <code>primaryContentSections</code>. A tutorial has none, so the existing parser would have kept a title and nothing else.</p>
<p>A tutorial keeps its text in <code>sections</code>: a hero (chapter, estimated time, Xcode requirement, introduction), tasks with numbered steps, and a quiz. Each step names a code file, a picture and a caption, and the files and pictures live in <code>references</code>, by identifier.</p>
<figure class="td-mermaid" data-td-mermaid>
<pre class="mermaid td-mermaid-source">flowchart TB
  A[Series listing] --&gt; B[Tutorials and articles]
  B --&gt; C[JSON per page]
  C --&gt; D[Parser to Markdown]
  D --&gt; E[Merge into corpus]
  E --&gt; F[Rebuild database]
  F --&gt; G[apple-docs tutorials]
</pre>
</figure>
<h3>How do you know the parser keeps everything?</h3>
<p>A converter that “looks right” on three pages is not evidence. So the oracle was built apart from the converter: an independent walker reads the JSON and collects <strong>every string a reader sees</strong>, each text and code run, heading, title, code line of a step’s file, quiz choice, justification and picture description. Every one of them must appear in the markdown. A control test shows the check can fail.</p>
<p>Run on all 178 tutorial and article pages Apple publishes: <strong>178 complete, 0 refused.</strong></p>
<h3>The crawl</h3>
<p>Five series are start pages for the crawl: <code>swiftui</code>, <code>swiftui-concepts</code>, <code>app-dev-training</code>, <code>develop-in-swift</code> and <code>sample-apps</code>. Each is crawled three links deep. Depth two missed the Mac Catalyst tutorials that App Dev Training holds as a sixth series, which is how depth became a setting of the start page.</p>
<figure class="td-chart td-chart-doughnut" data-td-chart-interactive>
<figcaption class="td-chart-caption">The 193 tutorial pages</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="The 193 tutorial pages"
>
<desc>doughnut chart with 3 labels and 1 series</desc>
<path class="td-chart-slice td-chart-series-0" d="M 360 56.8 A 115.2 115.2 0 1 1 305.95 70.26 L 331.9 119.1 A 59.9 59.9 0 1 0 360 112.1 Z"></path>
<path class="td-chart-slice td-chart-series-1" d="M 305.95 70.26 A 115.2 115.2 0 0 1 326.73 61.71 L 342.7 114.65 A 59.9 59.9 0 0 0 331.9 119.1 Z"></path>
<path class="td-chart-slice td-chart-series-2" d="M 326.73 61.71 A 115.2 115.2 0 0 1 360 56.8 L 360 112.1 A 59.9 59.9 0 0 0 342.7 114.65 Z"></path>
<rect
  class="td-chart-series-0"
  x="80"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="348"
  text-anchor="start"
>Tutorials and articles</text>
<rect
  class="td-chart-series-1"
  x="274.88"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="292.88"
  y="348"
  text-anchor="start"
>Series listings</text>
<rect
  class="td-chart-series-2"
  x="419.2"
  y="338"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="437.2"
  y="348"
  text-anchor="start"
>Mac Catalyst tutorials</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Tutorials and articles: 178 (92.23%)</title>
<path class="td-chart-hit" d="M 360 56.8 A 115.2 115.2 0 1 1 305.95 70.26 L 331.9 119.1 A 59.9 59.9 0 1 0 360 112.1 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="224.57" y="218.96" width="313.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="233.57" y="238.96">Tutorials and articles: 178 (92.23%)</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>Series listings: 6 (3.11%)</title>
<path class="td-chart-hit" d="M 305.95 70.26 A 115.2 115.2 0 0 1 326.73 61.71 L 342.7 114.65 A 59.9 59.9 0 0 0 331.9 119.1 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="211.06" y="53.04" width="231.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="220.06" y="73.04">Series listings: 6 (3.11%)</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-2" tabindex="0"><title>Mac Catalyst tutorials: 9 (4.66%)</title>
<path class="td-chart-hit" d="M 326.73 61.71 A 115.2 115.2 0 0 1 360 56.8 L 360 112.1 A 59.9 59.9 0 0 0 342.7 114.65 Z"></path>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="202.92" y="47.39" width="288.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="211.92" y="67.39">Mac Catalyst tutorials: 9 (4.66%)</text>
</g>
</g>
</svg>
</div>
</figure>
<p>Two things went wrong on the way, both worth the telling. The crawler follows links in the rendered page, and a tutorial’s hero offered a project download, a zip, so the crawl tried to fetch zips as pages and logged errors. Fix: the hero names the file and does not link it, and the crawler rejects <code>downloads/</code>, <code>data/</code> and <code>assets/</code> paths. And when the pages were done, the corpus merge <strong>held all 193 of them</strong>: its safety rule says a page is well formed when its address names a documentation page, and a tutorial’s does not. I taught the rule about tutorials, not the other way round, and a dry run then added 193 pages with none held.</p>
<p>A tutorial is addressed as <code>apple-docs://tutorials/&lt;series&gt;/&lt;page&gt;</code>:</p>
<pre><code>$ cupertino read apple-docs://tutorials/swiftui/creating-and-combining-views
---
source: https://developer.apple.com/tutorials/swiftui/creating-and-combining-views
---

# Creating and combining views

**Chapter:** SwiftUI essentials</code></pre>
<h3>Proving I did not change the old pages</h3>
<p>The rebuilt documentation database has 391,249 documents: the 391,056 of 1.6.0 and the 193 tutorials. I compared every old row with its 1.6.0 row, by content hash, kind, framework, language, the minimum and maximum of every platform, scope, UI tags, Swift version and word count: <strong>0 differ, 0 missing.</strong> The 16 WWDC sessions Apple lists that the database lacked (five Meet with Apple sessions and eleven older ones) went in the same way: 1,915 to 1,931 sessions, every existing row unchanged.</p>
<h2>Searches must not write</h2>
<p>This one is the least visible and the one I like most.</p>
<p>The search of all sources, the symbol searches and <code>get-inheritance</code> opened each database through the initializer that writes, and that one sets <code>PRAGMA journal_mode = WAL</code>. The databases ship in rollback mode. So the first all-sources search switched the shipped files to WAL: bytes 18 and 19 of the header changed from 1 to 2, the change counter went up, and a <code>-wal</code> and a <code>-shm</code> file appeared beside the database. Your installed files no longer matched the download, and a server killed with its log open left a log behind. That is what broke <code>cupertino setup</code> over the old databases (#115): setup renamed <code>x.db</code> and extracted a new one, but left the old <code>x.db-wal</code>, and SQLite replayed that log onto the new file.</p>
<p>The read paths now open read-only (#117). A database with an older schema is still migrated in place, as documented; a newer schema and a file with no schema are refused and left alone. Checked with the real binary: after an all-sources search, <code>search-symbols</code> and <code>get-inheritance</code>, the bundled files have the same SHA-256 and no sidecar exists.</p>
<p>The same family: <code>cupertino doctor</code> opens the search database read-only (#47), the release checkpoint reads the first page before asking SQLite to fold its log (#46, because a fresh connection knows nothing of WAL mode), and a second <code>cupertino save</code> no longer doubles the rows of a source (#45).</p>
<h2>Claude Desktop “stopped running”</h2>
<p>A user reported (#93) that Claude Desktop showed “cupertino stopped running” and the first <code>search</code> call failed. My first reading was that the client deferred a large tool schema, so I shrank <code>tools/list</code> from 31,473 to 25,220 bytes, and I said in the changelog that this was a cleanup and not the fix.</p>
<figure class="td-chart td-chart-bar" data-td-chart-interactive>
<figcaption class="td-chart-caption">Size of the tools/list reply in bytes</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 360"
  role="img"
  aria-label="Size of the tools/list reply in bytes"
>
<desc>bar chart with 2 labels and 1 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="232.5"
  x2="696"
  y2="232.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="236.5"
  text-anchor="end"
>10000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="163"
  x2="696"
  y2="163"
></line>
<text
  class="td-chart-value"
  x="70"
  y="167"
  text-anchor="end"
>20000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="93.5"
  x2="696"
  y2="93.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="97.5"
  text-anchor="end"
>30000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>40000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="217"
  y="83.26"
  width="32"
  height="218.74"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="525"
  y="126.72"
  width="32"
  height="175.28"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="234"
  y="324"
  text-anchor="middle"
>1.5.0</text>
<text
  class="td-chart-label"
  x="542"
  y="324"
  text-anchor="middle"
>1.6.0</text>

<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Bytes</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.5.0: 31473</title>
<rect class="td-chart-hit" x="217" y="83.26" width="32" height="218.74"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="174.8" y="45.26" width="116.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="183.8" y="65.26">1.5.0: 31473</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.6.0: 25220</title>
<rect class="td-chart-hit" x="525" y="126.72" width="32" height="175.28"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="482.8" y="88.72" width="116.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="491.8" y="108.72">1.6.0: 25220</text>
</g>
</g>
</svg>
</div>
</figure>
<p>The real cause was my own reaper. Claude Desktop starts two <code>cupertino serve</code> processes within a second, one per client. The startup reaper killed every other <code>serve</code> of the same binary, so the second killed the first while its host was connected; the log shows the reap line one millisecond before the disconnect. A server is now stale only when its host is gone, meaning the kernel re-parented it to launchd (parent PID 1). I also removed the 2,570-byte embedded icon from the <code>initialize</code> reply, which is now 218 bytes, and I say plainly that this is not claimed to be a cause.</p>
<h2>One engine instead of two (#122)</h2>
<p>Cupertino has two implementations of “read these databases and rank the results”: the one in this repository, used by the command line and <code>serve</code>, and <code>CupertinoDataEngine</code>, a separate package that the desktop app uses. Two implementations drift. When I checked, the engine could not open the 1.6.0 databases at all, because its schema numbers were stale (18, 4 and 5 against 20, 6 and 6), and no test in this repository noticed because nothing here called it.</p>
<p>The plan, written down before the code (<code>docs/design/read-through-data-engine.md</code>), is to make the engine the one read implementation and switch every caller to it. 1.6.5 carries the first half.</p>
<figure class="td-mermaid" data-td-mermaid>
<pre class="mermaid td-mermaid-source">flowchart TB
  subgraph Before
    CLI1[CLI and serve] --&gt; SQL1[SearchSQLite read and write]
    APP1[Desktop app] --&gt; ENG1[Engine]
  end
  subgraph After 1.6.5
    CLI2[CLI and serve] --&gt; ENG2[Engine read half]
    CLI2 --&gt; W[Write half]
    APP2[Desktop app] --&gt; ENG2
  end
</pre>
</figure>
<p>The read half of the search, the fused all-sources search and the read half of the sample index moved into the engine as they were, 62 files for the search alone, with only imports changed. The writers stay in cupertino, because they need SwiftSyntax and the engine must not.</p>
<h3>The oracle came first</h3>
<p>Moving code is only safe if you can say what “the same” means. The answer key is the released binary. The comparison script runs the 1.6.0 binary and the candidate against one copy of the same databases, over every query set, in every filter configuration, on all nine databases and on the all-sources search, and compares the printed order and the rank or score of every result <strong>to the last digit</strong>.</p>
<p>Two things the first comparison did not see:</p>
<ol><li><p>The engine’s ranks were all 1.4617 times the binary’s. The order was identical, so an order-only comparison passed. The cause was a different source lookup. The parity tests now compare the rank too, because a factor that scales every rank of a source is invisible to an order-only check.</p></li><li><p>Two results with the same score came out in a different order on each run, because the fused candidates were sorted by score alone, from the values of a dictionary. Equal scores are now ordered by source, then by identifier.</p></li></ol>
<p>Result: 2,310 comparisons between 1.6.0 and a build with the shared code, 0 differ, 0 failed baseline runs, and the control passed. Samples: 28 of 28 queries equal, with and without a platform floor; the first run gave 14 and 12.</p>
<p>The engine used to fuse the per-source lists with a reciprocal rank fusion of its own:</p>
<div class="td-math td-math-display"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 117.1 25.22" fill="currentColor" aria-hidden="true" style="width:11.71em;height:2.52em;vertical-align:-1.22em"><path d="M3.6 11.72C3.6 11.19 3.3 10.89 3.18 10.77C2.85 10.45 2.46 10.37 2.04 10.29C1.48 10.18 0.81 10.05 0.81 9.47C0.81 9.12 1.07 8.71 1.93 8.71C3.03 8.71 3.08 9.61 3.1 9.92C3.11 10.01 3.22 10.01 3.22 10.01C3.35 10.01 3.35 9.96 3.35 9.77L3.35 8.76C3.35 8.59 3.35 8.52 3.24 8.52C3.19 8.52 3.17 8.52 3.04 8.64C3.01 8.68 2.91 8.77 2.87 8.8C2.49 8.52 2.08 8.52 1.93 8.52C0.71 8.52 0.33 9.19 0.33 9.75C0.33 10.1 0.49 10.38 0.76 10.6C1.08 10.86 1.36 10.92 2.08 11.06C2.3 11.1 3.12 11.26 3.12 11.98C3.12 12.49 2.77 12.89 1.99 12.89C1.15 12.89 0.79 12.32 0.6 11.47C0.57 11.34 0.56 11.3 0.46 11.3C0.33 11.3 0.33 11.37 0.33 11.55L0.33 12.87C0.33 13.04 0.33 13.11 0.44 13.11C0.49 13.11 0.5 13.1 0.69 12.91C0.71 12.89 0.71 12.87 0.89 12.68C1.33 13.1 1.78 13.11 1.99 13.11C3.14 13.11 3.6 12.44 3.6 11.72Z"/><path d="M8.09 11.81C8.09 11.71 7.99 11.71 7.96 11.71C7.87 11.71 7.85 11.75 7.83 11.81C7.54 12.74 6.89 12.86 6.52 12.86C5.99 12.86 5.11 12.43 5.11 10.82C5.11 9.19 5.93 8.77 6.46 8.77C6.55 8.77 7.18 8.78 7.53 9.14C7.12 9.17 7.06 9.47 7.06 9.6C7.06 9.86 7.24 10.06 7.52 10.06C7.78 10.06 7.98 9.89 7.98 9.59C7.98 8.91 7.22 8.52 6.45 8.52C5.2 8.52 4.28 9.6 4.28 10.84C4.28 12.12 5.27 13.11 6.43 13.11C7.77 13.11 8.09 11.91 8.09 11.81Z"/><path d="M13.09 10.86C13.09 9.58 12.09 8.52 10.88 8.52C9.63 8.52 8.66 9.61 8.66 10.86C8.66 12.15 9.7 13.11 10.87 13.11C12.08 13.11 13.09 12.13 13.09 10.86ZM12.26 10.78C12.26 11.14 12.26 11.68 12.04 12.12C11.82 12.57 11.38 12.86 10.88 12.86C10.45 12.86 10.01 12.65 9.74 12.19C9.49 11.75 9.49 11.14 9.49 10.78C9.49 10.39 9.49 9.85 9.73 9.41C10 8.95 10.47 8.74 10.87 8.74C11.31 8.74 11.74 8.96 12 9.39C12.26 9.82 12.26 10.4 12.26 10.78Z"/><path d="M17.02 9.19C17.02 8.87 16.71 8.58 16.28 8.58C15.55 8.58 15.19 9.25 15.05 9.68L15.05 8.58L13.66 8.69L13.66 9C14.36 9 14.44 9.07 14.44 9.56L14.44 12.24C14.44 12.69 14.33 12.69 13.66 12.69L13.66 13L14.8 12.97C15.2 12.97 15.67 12.97 16.07 13L16.07 12.69L15.86 12.69C15.12 12.69 15.1 12.58 15.1 12.22L15.1 10.68C15.1 9.69 15.52 8.8 16.28 8.8C16.35 8.8 16.37 8.8 16.39 8.81C16.36 8.82 16.16 8.94 16.16 9.2C16.16 9.48 16.37 9.63 16.59 9.63C16.77 9.63 17.02 9.51 17.02 9.19Z"/><path d="M21.45 11.81C21.45 11.71 21.37 11.69 21.32 11.69C21.23 11.69 21.21 11.75 21.19 11.83C20.84 12.86 19.94 12.86 19.84 12.86C19.34 12.86 18.94 12.56 18.71 12.19C18.41 11.71 18.41 11.05 18.41 10.69L21.2 10.69C21.42 10.69 21.45 10.69 21.45 10.48C21.45 9.49 20.91 8.52 19.66 8.52C18.5 8.52 17.58 9.55 17.58 10.8C17.58 12.14 18.63 13.11 19.78 13.11C21 13.11 21.45 12 21.45 11.81ZM20.79 10.48L18.42 10.48C18.48 8.99 19.32 8.74 19.66 8.74C20.69 8.74 20.79 10.09 20.79 10.48Z"/><path d="M25.06 15.38C25.06 15.35 25.04 15.32 25.02 15.3C23.98 14.52 23.29 12.52 23.29 10.92L23.29 10.08C23.29 8.48 23.98 6.48 25.02 5.7C25.04 5.68 25.06 5.65 25.06 5.62C25.06 5.57 25.01 5.52 24.96 5.52C24.94 5.52 24.92 5.53 24.9 5.54C23.8 6.37 22.75 8.37 22.75 10.08L22.75 10.92C22.75 12.63 23.8 14.63 24.9 15.46C24.92 15.47 24.94 15.48 24.96 15.48C25.01 15.48 25.06 15.43 25.06 15.38Z"/><path d="M30.9 13L30.9 12.69C30.2 12.69 30.12 12.62 30.12 12.13L30.12 6.06L28.68 6.17L28.68 6.48C29.38 6.48 29.46 6.55 29.46 7.04L29.46 9.2C29.17 8.84 28.74 8.58 28.2 8.58C27.02 8.58 25.97 9.56 25.97 10.85C25.97 12.12 26.95 13.11 28.09 13.11C28.73 13.11 29.18 12.77 29.43 12.45L29.43 13.11ZM29.43 11.82C29.43 12 29.43 12.02 29.32 12.19C29.02 12.67 28.57 12.89 28.14 12.89C27.69 12.89 27.33 12.63 27.09 12.25C26.83 11.84 26.8 11.27 26.8 10.86C26.8 10.49 26.82 9.89 27.11 9.44C27.32 9.13 27.7 8.8 28.24 8.8C28.59 8.8 29.01 8.95 29.32 9.4C29.43 9.57 29.43 9.59 29.43 9.77Z"/><path d="M34.07 10.92L34.07 10.08C34.07 8.37 33.02 6.37 31.92 5.54C31.9 5.53 31.88 5.52 31.86 5.52C31.81 5.52 31.76 5.57 31.76 5.62C31.76 5.65 31.78 5.68 31.8 5.7C32.84 6.48 33.53 8.48 33.53 10.08L33.53 10.92C33.53 12.52 32.84 14.52 31.8 15.3C31.78 15.32 31.76 15.35 31.76 15.38C31.76 15.43 31.81 15.48 31.86 15.48C31.88 15.48 31.9 15.47 31.92 15.46C33.02 14.63 34.07 12.63 34.07 10.92Z"/><path d="M45.08 9.53C45.08 9.42 44.99 9.33 44.88 9.33L38.62 9.33C38.51 9.33 38.42 9.42 38.42 9.53C38.42 9.64 38.51 9.73 38.62 9.73L44.88 9.73C44.99 9.73 45.08 9.64 45.08 9.53ZM45.08 11.47C45.08 11.36 44.99 11.27 44.88 11.27L38.62 11.27C38.51 11.27 38.42 11.36 38.42 11.47C38.42 11.58 38.51 11.67 38.62 11.67L44.88 11.67C44.99 11.67 45.08 11.58 45.08 11.47Z"/><path d="M66.45 13.02L66 13.02C65.55 14.37 64.34 15.47 62.81 16C62.52 16.09 61.27 16.52 58.62 16.52L50.94 16.52L57.21 8.77C57.34 8.61 57.37 8.56 57.37 8.49C57.37 8.41 57.35 8.4 57.24 8.23L51.38 0.18L58.53 0.18C60.59 0.18 64.74 0.31 66 3.68L66.45 3.68L64.9 -0.54L49.93 -0.54C49.44 -0.54 49.43 -0.52 49.43 0.04L56.02 9.1L49.61 17.03C49.46 17.21 49.44 17.24 49.44 17.32C49.44 17.51 49.61 17.51 49.93 17.51L64.9 17.51Z"/><path d="M58.7 23.68L58.7 23.47C58.24 23.47 58.21 23.43 58.21 23.16L58.21 20.59L57.23 20.67L57.23 20.88C57.69 20.88 57.75 20.92 57.75 21.27L57.75 23.15C57.75 23.47 57.68 23.47 57.21 23.47L57.21 23.68L57.98 23.66C58.22 23.66 58.47 23.68 58.7 23.68ZM58.32 19.45C58.32 19.27 58.16 19.08 57.95 19.08C57.71 19.08 57.57 19.28 57.57 19.45C57.57 19.64 57.73 19.83 57.94 19.83C58.18 19.83 58.32 19.63 58.32 19.45Z"/><rect x="69.15" y="10.3" width="47.95" height="0.4"/><path d="M94.51 7.3L94.51 7.04L94.25 7.04C93.51 7.04 93.48 6.95 93.48 6.65L93.48 2.05C93.48 1.85 93.48 1.83 93.3 1.83C92.79 2.36 92.07 2.36 91.8 2.36L91.8 2.61C91.97 2.61 92.45 2.61 92.88 2.4L92.88 6.65C92.88 6.94 92.85 7.04 92.12 7.04L91.85 7.04L91.85 7.3C92.14 7.27 92.85 7.27 93.18 7.27C93.51 7.27 94.22 7.27 94.51 7.3Z"/><path d="M75.54 17.8L75.54 17.55C75.24 17.55 75.06 17.55 74.74 17.12L73.7 15.65C73.69 15.63 73.65 15.58 73.65 15.56C73.65 15.52 74.24 15.03 74.32 14.97C74.83 14.55 75.18 14.53 75.35 14.52L75.35 14.27C75.11 14.29 75.01 14.29 74.78 14.29C74.48 14.29 73.97 14.28 73.86 14.27L73.86 14.52C74.01 14.53 74.1 14.62 74.1 14.73C74.1 14.89 73.98 14.99 73.92 15.05L72.76 16.05L72.76 12.11L71.58 12.2L71.58 12.46C72.15 12.46 72.22 12.51 72.22 12.92L72.22 17.18C72.22 17.55 72.13 17.55 71.58 17.55L71.58 17.8L72.47 17.78L73.37 17.8L73.37 17.55C72.82 17.55 72.73 17.55 72.73 17.18L72.73 16.34L73.26 15.89C73.89 16.75 74.24 17.21 74.24 17.36C74.24 17.52 74.1 17.55 73.94 17.55L73.94 17.8L74.83 17.78C75.06 17.78 75.3 17.79 75.54 17.8Z"/><path d="M83.42 15.75C83.42 15.66 83.35 15.59 83.26 15.59L80.85 15.59L80.85 13.19C80.85 13.1 80.78 13.02 80.69 13.02C80.6 13.02 80.53 13.1 80.53 13.19L80.53 15.59L78.12 15.59C78.03 15.59 77.96 15.66 77.96 15.75C77.96 15.84 78.03 15.92 78.12 15.92L80.53 15.92L80.53 18.32C80.53 18.41 80.6 18.48 80.69 18.48C80.78 18.48 80.85 18.41 80.85 18.32L80.85 15.92L83.26 15.92C83.35 15.92 83.42 15.84 83.42 15.75Z"/><path d="M88.69 14.68C88.69 14.42 88.43 14.18 88.08 14.18C87.48 14.18 87.19 14.73 87.07 15.08L87.07 14.18L85.93 14.27L85.93 14.52C86.51 14.52 86.57 14.58 86.57 14.98L86.57 17.18C86.57 17.55 86.48 17.55 85.93 17.55L85.93 17.8L86.87 17.78C87.19 17.78 87.58 17.78 87.91 17.8L87.91 17.55L87.74 17.55C87.13 17.55 87.11 17.46 87.11 17.16L87.11 15.9C87.11 15.09 87.46 14.36 88.08 14.36C88.14 14.36 88.15 14.36 88.17 14.37C88.15 14.38 87.98 14.47 87.98 14.69C87.98 14.92 88.15 15.04 88.33 15.04C88.48 15.04 88.69 14.94 88.69 14.68Z"/><path d="M92.88 17.07L92.88 16.61L92.67 16.61L92.67 17.07C92.67 17.55 92.47 17.6 92.38 17.6C92.11 17.6 92.07 17.23 92.07 17.19L92.07 15.55C92.07 15.2 92.07 14.88 91.78 14.58C91.46 14.26 91.05 14.13 90.66 14.13C89.98 14.13 89.42 14.52 89.42 15.06C89.42 15.3 89.58 15.44 89.79 15.44C90.02 15.44 90.17 15.28 90.17 15.07C90.17 14.97 90.13 14.7 89.75 14.69C89.97 14.4 90.38 14.31 90.64 14.31C91.04 14.31 91.51 14.63 91.51 15.36L91.51 15.66C91.09 15.69 90.52 15.71 90 15.96C89.38 16.24 89.18 16.66 89.18 17.02C89.18 17.69 89.97 17.89 90.49 17.89C91.03 17.89 91.41 17.57 91.57 17.18C91.6 17.51 91.82 17.85 92.21 17.85C92.38 17.85 92.88 17.74 92.88 17.07ZM91.51 16.66C91.51 17.43 90.92 17.71 90.55 17.71C90.15 17.71 89.81 17.43 89.81 17.02C89.81 16.57 90.16 15.89 91.51 15.84Z"/><path d="M97.4 17.8L97.4 17.55C96.98 17.55 96.77 17.55 96.76 17.3L96.76 15.74C96.76 15.03 96.76 14.78 96.51 14.48C96.4 14.34 96.12 14.18 95.65 14.18C95.05 14.18 94.67 14.53 94.44 15.04L94.44 14.18L93.28 14.27L93.28 14.52C93.85 14.52 93.92 14.58 93.92 14.98L93.92 17.18C93.92 17.55 93.83 17.55 93.28 17.55L93.28 17.8L94.21 17.78L95.12 17.8L95.12 17.55C94.57 17.55 94.48 17.55 94.48 17.18L94.48 15.67C94.48 14.82 95.07 14.36 95.59 14.36C96.11 14.36 96.2 14.8 96.2 15.27L96.2 17.18C96.2 17.55 96.11 17.55 95.56 17.55L95.56 17.8L96.49 17.78Z"/><path d="M101.77 17.8L101.77 17.55C101.46 17.55 101.28 17.55 100.97 17.12L99.93 15.65C99.92 15.63 99.88 15.58 99.88 15.56C99.88 15.52 100.46 15.03 100.54 14.97C101.06 14.55 101.41 14.53 101.58 14.52L101.58 14.27C101.34 14.29 101.23 14.29 101 14.29C100.71 14.29 100.2 14.28 100.09 14.27L100.09 14.52C100.24 14.53 100.32 14.62 100.32 14.73C100.32 14.89 100.21 14.99 100.14 15.05L98.99 16.05L98.99 12.11L97.81 12.2L97.81 12.46C98.38 12.46 98.45 12.51 98.45 12.92L98.45 17.18C98.45 17.55 98.36 17.55 97.81 17.55L97.81 17.8L98.7 17.78L99.6 17.8L99.6 17.55C99.05 17.55 98.96 17.55 98.96 17.18L98.96 16.34L99.49 15.89C100.12 16.75 100.46 17.21 100.46 17.36C100.46 17.52 100.32 17.55 100.17 17.55L100.17 17.8L101.05 17.78C101.29 17.78 101.53 17.79 101.77 17.8Z"/><path d="M103.78 19.83L103.78 19.65C103.4 19.65 103.38 19.62 103.38 19.4L103.38 17.29L102.58 17.36L102.58 17.53C102.95 17.53 103 17.57 103 17.85L103 19.39C103 19.65 102.94 19.65 102.55 19.65L102.55 19.83L103.19 19.81C103.39 19.81 103.59 19.82 103.78 19.83ZM103.47 16.36C103.47 16.21 103.33 16.06 103.16 16.06C102.97 16.06 102.85 16.22 102.85 16.36C102.85 16.52 102.98 16.67 103.16 16.67C103.35 16.67 103.47 16.51 103.47 16.36Z"/><path d="M106.68 19.76C106.68 19.73 106.67 19.71 106.65 19.69C105.8 19.05 105.23 17.41 105.23 16.1L105.23 15.41C105.23 14.1 105.8 12.46 106.65 11.82C106.67 11.8 106.68 11.78 106.68 11.75C106.68 11.71 106.64 11.67 106.6 11.67C106.58 11.67 106.57 11.68 106.55 11.69C105.65 12.37 104.79 14.01 104.79 15.41L104.79 16.1C104.79 17.5 105.65 19.14 106.55 19.82C106.57 19.83 106.58 19.84 106.6 19.84C106.64 19.84 106.68 19.8 106.68 19.76Z"/><path d="M111.47 17.8L111.47 17.55C110.9 17.55 110.83 17.49 110.83 17.09L110.83 12.11L109.65 12.2L109.65 12.46C110.23 12.46 110.29 12.51 110.29 12.92L110.29 14.69C110.05 14.39 109.7 14.18 109.26 14.18C108.29 14.18 107.43 14.98 107.43 16.04C107.43 17.08 108.23 17.89 109.17 17.89C109.69 17.89 110.06 17.62 110.27 17.35L110.27 17.89ZM110.27 16.84C110.27 16.98 110.27 17 110.18 17.14C109.93 17.53 109.56 17.71 109.21 17.71C108.84 17.71 108.54 17.5 108.35 17.19C108.13 16.85 108.11 16.39 108.11 16.05C108.11 15.75 108.13 15.25 108.36 14.88C108.54 14.63 108.85 14.36 109.29 14.36C109.58 14.36 109.92 14.48 110.18 14.85C110.27 14.99 110.27 15.01 110.27 15.16Z"/><path d="M114.07 16.1L114.07 15.41C114.07 14.01 113.21 12.37 112.31 11.69C112.29 11.68 112.28 11.67 112.26 11.67C112.22 11.67 112.18 11.71 112.18 11.75C112.18 11.78 112.19 11.8 112.21 11.82C113.06 12.46 113.63 14.1 113.63 15.41L113.63 16.1C113.63 17.41 113.06 19.05 112.21 19.69C112.19 19.71 112.18 19.73 112.18 19.76C112.18 19.8 112.22 19.84 112.26 19.84C112.28 19.84 112.29 19.83 112.31 19.82C113.21 19.14 114.07 17.5 114.07 16.1Z"/></svg><math class="td-math-a11y" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>score</mi><mtext>(</mtext><mi>d</mi><mtext>)</mtext><mtext> </mtext><mtext>=</mtext><mtext> </mtext><msub><mrow><mo>∑</mo></mrow><mrow><mi>i</mi></mrow></msub><mtext> </mtext><mfrac><mrow><mn>1</mn></mrow><mrow><mrow><mi>k</mi><mtext> </mtext><mtext>+</mtext><mtext> </mtext><msub><mrow><mi>rank</mi></mrow><mrow><mi>i</mi></mrow></msub><mtext>(</mtext><mi>d</mi><mtext>)</mtext></mrow></mrow></mfrac></mrow></math></div>
<p>It now builds the same candidate fetchers the binary builds and runs the binary’s <code>SmartQuery</code> with the shipped source weights, so the two cannot differ.</p>
<p>One more detail about “to the last digit”. The ranker applies each boost factor as its own <code>boost *= factor</code>, in a fixed order, because floating-point multiplication is not associative:</p>
<div class="td-math td-math-display"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 168.63 9.4" fill="currentColor" aria-hidden="true" style="width:16.86em;height:0.94em;vertical-align:-0.22em"><path d="M3.32 9.58C3.32 9.55 3.3 9.52 3.28 9.5C2.24 8.72 1.55 6.72 1.55 5.12L1.55 4.28C1.55 2.68 2.24 0.68 3.28 -0.1C3.3 -0.12 3.32 -0.15 3.32 -0.18C3.32 -0.23 3.27 -0.28 3.22 -0.28C3.2 -0.28 3.18 -0.27 3.16 -0.26C2.06 0.57 1.01 2.57 1.01 4.28L1.01 5.12C1.01 6.83 2.06 8.83 3.16 9.66C3.18 9.67 3.2 9.68 3.22 9.68C3.27 9.68 3.32 9.63 3.32 9.58Z"/><path d="M8.72 6.31L8.72 5.75L8.47 5.75L8.47 6.31C8.47 6.89 8.22 6.95 8.11 6.95C7.78 6.95 7.74 6.5 7.74 6.45L7.74 4.45C7.74 4.03 7.74 3.64 7.38 3.27C6.99 2.88 6.49 2.72 6.01 2.72C5.19 2.72 4.5 3.19 4.5 3.85C4.5 4.15 4.7 4.32 4.96 4.32C5.24 4.32 5.42 4.12 5.42 3.86C5.42 3.74 5.37 3.41 4.91 3.4C5.18 3.05 5.67 2.94 5.99 2.94C6.48 2.94 7.05 3.33 7.05 4.22L7.05 4.59C6.54 4.62 5.84 4.65 5.21 4.95C4.46 5.29 4.21 5.81 4.21 6.25C4.21 7.06 5.18 7.31 5.81 7.31C6.47 7.31 6.93 6.91 7.12 6.44C7.16 6.84 7.43 7.26 7.9 7.26C8.11 7.26 8.72 7.12 8.72 6.31ZM7.05 5.8C7.05 6.75 6.33 7.09 5.88 7.09C5.39 7.09 4.98 6.74 4.98 6.24C4.98 5.69 5.4 4.86 7.05 4.8Z"/><path d="M13.03 4.7C13.03 4.41 12.79 4.17 12.5 4.17C12.21 4.17 11.97 4.41 11.97 4.7C11.97 4.99 12.21 5.23 12.5 5.23C12.79 5.23 13.03 4.99 13.03 4.7Z"/><path d="M21.32 5.04C21.32 3.77 20.34 2.78 19.2 2.78C18.42 2.78 17.99 3.25 17.83 3.43L17.83 0.26L16.39 0.37L16.39 0.68C17.09 0.68 17.17 0.75 17.17 1.24L17.17 7.2L17.42 7.2L17.78 6.58C17.93 6.81 18.35 7.31 19.09 7.31C20.28 7.31 21.32 6.33 21.32 5.04ZM20.49 5.03C20.49 5.4 20.47 6 20.18 6.45C19.97 6.76 19.59 7.09 19.05 7.09C18.6 7.09 18.24 6.85 18 6.48C17.86 6.27 17.86 6.24 17.86 6.06L17.86 4C17.86 3.81 17.86 3.8 17.97 3.64C18.36 3.08 18.91 3 19.15 3C19.6 3 19.96 3.26 20.2 3.64C20.46 4.05 20.49 4.62 20.49 5.03Z"/><path d="M24.55 5.12L24.55 4.28C24.55 2.57 23.5 0.57 22.4 -0.26C22.38 -0.27 22.36 -0.28 22.34 -0.28C22.29 -0.28 22.24 -0.23 22.24 -0.18C22.24 -0.15 22.26 -0.12 22.28 -0.1C23.32 0.68 24.01 2.68 24.01 4.28L24.01 5.12C24.01 6.72 23.32 8.72 22.28 9.5C22.26 9.52 22.24 9.55 22.24 9.58C22.24 9.63 22.29 9.68 22.34 9.68C22.36 9.68 22.38 9.67 22.4 9.66C23.5 8.83 24.55 6.83 24.55 5.12Z"/><path d="M29.71 4.7C29.71 4.41 29.47 4.17 29.18 4.17C28.89 4.17 28.65 4.41 28.65 4.7C28.65 4.99 28.89 5.23 29.18 5.23C29.47 5.23 29.71 4.99 29.71 4.7Z"/><path d="M36.94 6.01C36.94 5.91 36.84 5.91 36.81 5.91C36.72 5.91 36.7 5.95 36.68 6.01C36.39 6.94 35.74 7.06 35.37 7.06C34.84 7.06 33.96 6.63 33.96 5.02C33.96 3.39 34.78 2.97 35.31 2.97C35.4 2.97 36.03 2.98 36.38 3.34C35.97 3.37 35.91 3.67 35.91 3.8C35.91 4.06 36.09 4.26 36.37 4.26C36.63 4.26 36.83 4.09 36.83 3.79C36.83 3.11 36.07 2.72 35.3 2.72C34.05 2.72 33.13 3.8 33.13 5.04C33.13 6.32 34.12 7.31 35.28 7.31C36.62 7.31 36.94 6.11 36.94 6.01Z"/><path d="M47.23 5.67C47.23 5.56 47.14 5.47 47.03 5.47L43.83 5.47L44.39 3.93L47.03 3.93C47.14 3.93 47.23 3.84 47.23 3.73C47.23 3.62 47.14 3.53 47.03 3.53L44.54 3.53L45.76 0.17C45.77 0.15 45.78 0.12 45.78 0.1C45.78 -0.01 45.69 -0.1 45.58 -0.1C45.49 -0.1 45.41 -0.05 45.39 0.03L44.11 3.53L40.77 3.53C40.66 3.53 40.57 3.62 40.57 3.73C40.57 3.84 40.66 3.93 40.77 3.93L43.97 3.93L43.41 5.47L40.77 5.47C40.66 5.47 40.57 5.56 40.57 5.67C40.57 5.78 40.66 5.87 40.77 5.87L43.26 5.87L42.04 9.23C42.03 9.25 42.03 9.28 42.03 9.3C42.03 9.41 42.11 9.5 42.23 9.5C42.31 9.5 42.39 9.45 42.41 9.37L43.69 5.87L47.03 5.87C47.14 5.87 47.23 5.78 47.23 5.67Z"/><path d="M55.39 6.31L55.39 5.75L55.14 5.75L55.14 6.31C55.14 6.89 54.89 6.95 54.78 6.95C54.45 6.95 54.41 6.5 54.41 6.45L54.41 4.45C54.41 4.03 54.41 3.64 54.05 3.27C53.66 2.88 53.16 2.72 52.68 2.72C51.86 2.72 51.17 3.19 51.17 3.85C51.17 4.15 51.37 4.32 51.63 4.32C51.91 4.32 52.09 4.12 52.09 3.86C52.09 3.74 52.04 3.41 51.58 3.4C51.85 3.05 52.34 2.94 52.66 2.94C53.15 2.94 53.72 3.33 53.72 4.22L53.72 4.59C53.21 4.62 52.51 4.65 51.88 4.95C51.13 5.29 50.88 5.81 50.88 6.25C50.88 7.06 51.85 7.31 52.48 7.31C53.14 7.31 53.6 6.91 53.79 6.44C53.83 6.84 54.1 7.26 54.57 7.26C54.78 7.26 55.39 7.12 55.39 6.31ZM53.72 5.8C53.72 6.75 53 7.09 52.55 7.09C52.06 7.09 51.65 6.74 51.65 6.24C51.65 5.69 52.07 4.86 53.72 4.8Z"/><path d="M59.71 4.7C59.71 4.41 59.47 4.17 59.18 4.17C58.89 4.17 58.65 4.41 58.65 4.7C58.65 4.99 58.89 5.23 59.18 5.23C59.47 5.23 59.71 4.99 59.71 4.7Z"/><path d="M66.11 9.58C66.11 9.55 66.09 9.52 66.07 9.5C65.03 8.72 64.34 6.72 64.34 5.12L64.34 4.28C64.34 2.68 65.03 0.68 66.07 -0.1C66.09 -0.12 66.11 -0.15 66.11 -0.18C66.11 -0.23 66.06 -0.28 66.01 -0.28C65.99 -0.28 65.97 -0.27 65.95 -0.26C64.85 0.57 63.8 2.57 63.8 4.28L63.8 5.12C63.8 6.83 64.85 8.83 65.95 9.66C65.97 9.67 65.99 9.68 66.01 9.68C66.06 9.68 66.11 9.63 66.11 9.58Z"/><path d="M71.89 5.04C71.89 3.77 70.91 2.78 69.77 2.78C68.99 2.78 68.56 3.25 68.4 3.43L68.4 0.26L66.96 0.37L66.96 0.68C67.66 0.68 67.74 0.75 67.74 1.24L67.74 7.2L67.99 7.2L68.35 6.58C68.5 6.81 68.92 7.31 69.66 7.31C70.85 7.31 71.89 6.33 71.89 5.04ZM71.06 5.03C71.06 5.4 71.04 6 70.75 6.45C70.54 6.76 70.16 7.09 69.62 7.09C69.17 7.09 68.81 6.85 68.57 6.48C68.43 6.27 68.43 6.24 68.43 6.06L68.43 4C68.43 3.81 68.43 3.8 68.54 3.64C68.93 3.08 69.48 3 69.72 3C70.17 3 70.53 3.26 70.77 3.64C71.03 4.05 71.06 4.62 71.06 5.03Z"/><path d="M76.38 4.7C76.38 4.41 76.14 4.17 75.85 4.17C75.56 4.17 75.32 4.41 75.32 4.7C75.32 4.99 75.56 5.23 75.85 5.23C76.14 5.23 76.38 4.99 76.38 4.7Z"/><path d="M83.61 6.01C83.61 5.91 83.51 5.91 83.48 5.91C83.39 5.91 83.37 5.95 83.35 6.01C83.06 6.94 82.41 7.06 82.04 7.06C81.51 7.06 80.63 6.63 80.63 5.02C80.63 3.39 81.45 2.97 81.98 2.97C82.07 2.97 82.7 2.98 83.05 3.34C82.64 3.37 82.58 3.67 82.58 3.8C82.58 4.06 82.76 4.26 83.04 4.26C83.3 4.26 83.5 4.09 83.5 3.79C83.5 3.11 82.74 2.72 81.97 2.72C80.72 2.72 79.8 3.8 79.8 5.04C79.8 6.32 80.79 7.31 81.95 7.31C83.29 7.31 83.61 6.11 83.61 6.01Z"/><path d="M86.78 5.12L86.78 4.28C86.78 2.57 85.73 0.57 84.63 -0.26C84.61 -0.27 84.59 -0.28 84.57 -0.28C84.52 -0.28 84.47 -0.23 84.47 -0.18C84.47 -0.15 84.49 -0.12 84.51 -0.1C85.55 0.68 86.24 2.68 86.24 4.28L86.24 5.12C86.24 6.72 85.55 8.72 84.51 9.5C84.49 9.52 84.47 9.55 84.47 9.58C84.47 9.63 84.52 9.68 84.57 9.68C84.59 9.68 84.61 9.67 84.63 9.66C85.73 8.83 86.78 6.83 86.78 5.12Z"/><path d="M100.26 7.2L100.26 6.89C99.6 6.89 99.56 6.84 99.56 6.45L99.56 2.78L98.16 2.89L98.16 3.2C98.81 3.2 98.9 3.26 98.9 3.75L98.9 6.44C98.9 6.89 98.79 6.89 98.12 6.89L98.12 7.2L99.22 7.17C99.57 7.17 99.92 7.19 100.26 7.2ZM99.71 1.16C99.71 0.89 99.48 0.63 99.18 0.63C98.84 0.63 98.64 0.91 98.64 1.16C98.64 1.43 98.87 1.69 99.17 1.69C99.51 1.69 99.71 1.41 99.71 1.16Z"/><path d="M105.92 7.2L105.92 6.89C105.4 6.89 105.15 6.89 105.14 6.59L105.14 4.68C105.14 3.82 105.14 3.51 104.83 3.15C104.69 2.98 104.36 2.78 103.78 2.78C103.05 2.78 102.58 3.21 102.3 3.83L102.3 2.78L100.89 2.89L100.89 3.2C101.59 3.2 101.67 3.27 101.67 3.76L101.67 6.44C101.67 6.89 101.56 6.89 100.89 6.89L100.89 7.2L102.02 7.17L103.14 7.2L103.14 6.89C102.47 6.89 102.36 6.89 102.36 6.44L102.36 4.6C102.36 3.56 103.07 3 103.71 3C104.34 3 104.45 3.54 104.45 4.11L104.45 6.44C104.45 6.89 104.34 6.89 103.67 6.89L103.67 7.2L104.8 7.17Z"/><path d="M113.02 0.85C113.02 0.48 112.65 0.15 112.12 0.15C111.42 0.15 110.57 0.68 110.57 1.74L110.57 2.89L109.78 2.89L109.78 3.2L110.57 3.2L110.57 6.44C110.57 6.89 110.46 6.89 109.79 6.89L109.79 7.2L110.93 7.17C111.33 7.17 111.8 7.17 112.2 7.2L112.2 6.89L111.99 6.89C111.25 6.89 111.23 6.78 111.23 6.42L111.23 3.2L112.37 3.2L112.37 2.89L111.2 2.89L111.2 1.73C111.2 0.85 111.68 0.37 112.12 0.37C112.15 0.37 112.3 0.37 112.45 0.44C112.33 0.48 112.15 0.61 112.15 0.86C112.15 1.09 112.31 1.29 112.58 1.29C112.87 1.29 113.02 1.09 113.02 0.85Z"/><path d="M115.06 7.2L115.06 6.89C114.39 6.89 114.28 6.89 114.28 6.44L114.28 0.26L112.84 0.37L112.84 0.68C113.54 0.68 113.62 0.75 113.62 1.24L113.62 6.44C113.62 6.89 113.51 6.89 112.84 6.89L112.84 7.2L113.95 7.17Z"/><path d="M120 5.06C120 3.78 119 2.72 117.79 2.72C116.54 2.72 115.57 3.81 115.57 5.06C115.57 6.35 116.61 7.31 117.78 7.31C118.99 7.31 120 6.33 120 5.06ZM119.17 4.98C119.17 5.34 119.17 5.88 118.95 6.32C118.73 6.77 118.29 7.06 117.79 7.06C117.36 7.06 116.92 6.85 116.65 6.39C116.4 5.95 116.4 5.34 116.4 4.98C116.4 4.59 116.4 4.05 116.64 3.61C116.91 3.15 117.38 2.94 117.78 2.94C118.22 2.94 118.65 3.16 118.91 3.59C119.17 4.02 119.17 4.6 119.17 4.98Z"/><path d="M125.12 6.31L125.12 5.75L124.87 5.75L124.87 6.31C124.87 6.89 124.62 6.95 124.51 6.95C124.18 6.95 124.14 6.5 124.14 6.45L124.14 4.45C124.14 4.03 124.14 3.64 123.78 3.27C123.39 2.88 122.89 2.72 122.41 2.72C121.59 2.72 120.9 3.19 120.9 3.85C120.9 4.15 121.1 4.32 121.36 4.32C121.64 4.32 121.82 4.12 121.82 3.86C121.82 3.74 121.77 3.41 121.31 3.4C121.58 3.05 122.07 2.94 122.39 2.94C122.88 2.94 123.45 3.33 123.45 4.22L123.45 4.59C122.94 4.62 122.24 4.65 121.61 4.95C120.86 5.29 120.61 5.81 120.61 6.25C120.61 7.06 121.58 7.31 122.21 7.31C122.87 7.31 123.33 6.91 123.52 6.44C123.56 6.84 123.83 7.26 124.3 7.26C124.51 7.26 125.12 7.12 125.12 6.31ZM123.45 5.8C123.45 6.75 122.73 7.09 122.28 7.09C121.79 7.09 121.38 6.74 121.38 6.24C121.38 5.69 121.8 4.86 123.45 4.8Z"/><path d="M128.61 5.96L128.61 5.39L128.36 5.39L128.36 5.94C128.36 6.68 128.06 7.06 127.69 7.06C127.02 7.06 127.02 6.15 127.02 5.98L127.02 3.2L128.45 3.2L128.45 2.89L127.02 2.89L127.02 1.05L126.77 1.05C126.76 1.87 126.46 2.94 125.48 2.98L125.48 3.2L126.33 3.2L126.33 5.96C126.33 7.19 127.26 7.31 127.62 7.31C128.33 7.31 128.61 6.6 128.61 5.96Z"/><path d="M131.65 7.2L131.65 6.89C130.99 6.89 130.95 6.84 130.95 6.45L130.95 2.78L129.55 2.89L129.55 3.2C130.2 3.2 130.29 3.26 130.29 3.75L130.29 6.44C130.29 6.89 130.18 6.89 129.51 6.89L129.51 7.2L130.61 7.17C130.96 7.17 131.31 7.19 131.65 7.2ZM131.1 1.16C131.1 0.89 130.87 0.63 130.57 0.63C130.23 0.63 130.03 0.91 130.03 1.16C130.03 1.43 130.26 1.69 130.56 1.69C130.9 1.69 131.1 1.41 131.1 1.16Z"/><path d="M137.31 7.2L137.31 6.89C136.79 6.89 136.54 6.89 136.53 6.59L136.53 4.68C136.53 3.82 136.53 3.51 136.22 3.15C136.08 2.98 135.75 2.78 135.17 2.78C134.44 2.78 133.97 3.21 133.69 3.83L133.69 2.78L132.28 2.89L132.28 3.2C132.98 3.2 133.06 3.27 133.06 3.76L133.06 6.44C133.06 6.89 132.95 6.89 132.28 6.89L132.28 7.2L133.41 7.17L134.53 7.2L134.53 6.89C133.86 6.89 133.75 6.89 133.75 6.44L133.75 4.6C133.75 3.56 134.46 3 135.1 3C135.73 3 135.84 3.54 135.84 4.11L135.84 6.44C135.84 6.89 135.73 6.89 135.06 6.89L135.06 7.2L136.19 7.17Z"/><path d="M142.37 3.16C142.37 2.99 142.25 2.67 141.86 2.67C141.66 2.67 141.22 2.73 140.8 3.14C140.38 2.81 139.96 2.78 139.74 2.78C138.81 2.78 138.12 3.47 138.12 4.24C138.12 4.68 138.34 5.06 138.59 5.27C138.46 5.42 138.28 5.75 138.28 6.1C138.28 6.41 138.41 6.79 138.72 6.99C138.12 7.16 137.8 7.59 137.8 7.99C137.8 8.71 138.79 9.26 140.01 9.26C141.19 9.26 142.23 8.75 142.23 7.97C142.23 7.62 142.09 7.11 141.58 6.83C141.05 6.55 140.47 6.55 139.86 6.55C139.61 6.55 139.18 6.55 139.11 6.54C138.79 6.5 138.58 6.19 138.58 5.87C138.58 5.83 138.58 5.6 138.75 5.4C139.14 5.68 139.55 5.71 139.74 5.71C140.67 5.71 141.36 5.02 141.36 4.25C141.36 3.88 141.2 3.51 140.95 3.28C141.31 2.94 141.67 2.89 141.85 2.89C141.85 2.89 141.92 2.89 141.95 2.9C141.84 2.94 141.79 3.05 141.79 3.17C141.79 3.34 141.92 3.46 142.08 3.46C142.18 3.46 142.37 3.39 142.37 3.16ZM140.61 4.24C140.61 4.51 140.6 4.83 140.45 5.08C140.37 5.2 140.14 5.48 139.74 5.48C138.87 5.48 138.87 4.48 138.87 4.25C138.87 3.98 138.88 3.66 139.03 3.41C139.11 3.29 139.34 3.01 139.74 3.01C140.61 3.01 140.61 4.01 140.61 4.24ZM141.71 7.99C141.71 8.53 141 9.03 140.02 9.03C139.01 9.03 138.32 8.52 138.32 7.99C138.32 7.53 138.7 7.16 139.14 7.13L139.73 7.13C140.59 7.13 141.71 7.13 141.71 7.99Z"/><path d="M151.05 5.04C151.05 3.77 150.08 2.78 148.96 2.78C148.18 2.78 147.76 3.22 147.56 3.44L147.56 2.78L146.12 2.89L146.12 3.2C146.83 3.2 146.9 3.26 146.9 3.7L146.9 8.38C146.9 8.83 146.79 8.83 146.12 8.83L146.12 9.14L147.24 9.11L148.37 9.14L148.37 8.83C147.7 8.83 147.59 8.83 147.59 8.38L147.59 6.7L147.59 6.61C147.64 6.77 148.06 7.31 148.82 7.31C150.01 7.31 151.05 6.33 151.05 5.04ZM150.22 5.04C150.22 6.25 149.52 7.09 148.78 7.09C148.38 7.09 148 6.89 147.73 6.48C147.59 6.27 147.59 6.26 147.59 6.06L147.59 3.83C147.88 3.32 148.37 3.03 148.88 3.03C149.61 3.03 150.22 3.91 150.22 5.04Z"/><path d="M156.11 5.06C156.11 3.78 155.11 2.72 153.9 2.72C152.65 2.72 151.68 3.81 151.68 5.06C151.68 6.35 152.72 7.31 153.89 7.31C155.1 7.31 156.11 6.33 156.11 5.06ZM155.28 4.98C155.28 5.34 155.28 5.88 155.06 6.32C154.84 6.77 154.4 7.06 153.9 7.06C153.47 7.06 153.03 6.85 152.76 6.39C152.51 5.95 152.51 5.34 152.51 4.98C152.51 4.59 152.51 4.05 152.75 3.61C153.02 3.15 153.49 2.94 153.89 2.94C154.33 2.94 154.76 3.16 155.02 3.59C155.28 4.02 155.28 4.6 155.28 4.98Z"/><path d="M158.87 7.2L158.87 6.89C158.21 6.89 158.17 6.84 158.17 6.45L158.17 2.78L156.77 2.89L156.77 3.2C157.42 3.2 157.51 3.26 157.51 3.75L157.51 6.44C157.51 6.89 157.4 6.89 156.73 6.89L156.73 7.2L157.83 7.17C158.18 7.17 158.53 7.19 158.87 7.2ZM158.32 1.16C158.32 0.89 158.09 0.63 157.79 0.63C157.45 0.63 157.25 0.91 157.25 1.16C157.25 1.43 157.48 1.69 157.78 1.69C158.12 1.69 158.32 1.41 158.32 1.16Z"/><path d="M164.53 7.2L164.53 6.89C164.01 6.89 163.76 6.89 163.75 6.59L163.75 4.68C163.75 3.82 163.75 3.51 163.44 3.15C163.3 2.98 162.97 2.78 162.39 2.78C161.66 2.78 161.19 3.21 160.91 3.83L160.91 2.78L159.5 2.89L159.5 3.2C160.2 3.2 160.28 3.27 160.28 3.76L160.28 6.44C160.28 6.89 160.17 6.89 159.5 6.89L159.5 7.2L160.63 7.17L161.75 7.2L161.75 6.89C161.08 6.89 160.97 6.89 160.97 6.44L160.97 4.6C160.97 3.56 161.68 3 162.32 3C162.95 3 163.06 3.54 163.06 4.11L163.06 6.44C163.06 6.89 162.95 6.89 162.28 6.89L162.28 7.2L163.41 7.17Z"/><path d="M168.06 5.96L168.06 5.39L167.81 5.39L167.81 5.94C167.81 6.68 167.51 7.06 167.14 7.06C166.47 7.06 166.47 6.15 166.47 5.98L166.47 3.2L167.9 3.2L167.9 2.89L166.47 2.89L166.47 1.05L166.22 1.05C166.21 1.87 165.91 2.94 164.93 2.98L164.93 3.2L165.78 3.2L165.78 5.96C165.78 7.19 166.71 7.31 167.07 7.31C167.78 7.31 168.06 6.6 168.06 5.96Z"/></svg><math class="td-math-a11y" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mtext>(</mtext><mi>a</mi><mtext> </mtext><mo>⋅</mo><mtext> </mtext><mi>b</mi><mtext>)</mtext><mtext> </mtext><mo>⋅</mo><mtext> </mtext><mi>c</mi><mtext> </mtext><mo>≠</mo><mtext> </mtext><mi>a</mi><mtext> </mtext><mo>⋅</mo><mtext> </mtext><mtext>(</mtext><mi>b</mi><mtext> </mtext><mo>⋅</mo><mtext> </mtext><mi>c</mi><mtext>)</mtext><mtext> </mtext><mspace width="1em"/><mtext> </mtext><mtext>in floating point</mtext></mrow></math></div>
<p>so when I split a 750-line search function into small ones, each factor kept its place in the product.</p>
<h3>Is it slower?</h3>
<p>I measured it. <code>scripts/eval/SearchTiming.swift</code> runs the baseline and the candidate alternately, five runs each after a warm-up, over 48 cases, and prints the median of each, the baseline’s own run-to-run spread, and the bound, median plus spread:</p>
<div class="td-math td-math-display"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.06 17.08" fill="currentColor" aria-hidden="true" style="width:4.01em;height:1.71em;vertical-align:-0.22em"><path d="M5.21 12.72C5.21 11.45 4.23 10.46 3.09 10.46C2.31 10.46 1.88 10.93 1.72 11.11L1.72 7.94L0.28 8.05L0.28 8.36C0.98 8.36 1.06 8.43 1.06 8.92L1.06 14.88L1.31 14.88L1.67 14.26C1.82 14.49 2.24 14.99 2.98 14.99C4.17 14.99 5.21 14.01 5.21 12.72ZM4.38 12.71C4.38 13.08 4.36 13.68 4.07 14.13C3.86 14.44 3.48 14.77 2.94 14.77C2.49 14.77 2.13 14.53 1.89 14.16C1.75 13.95 1.75 13.92 1.75 13.74L1.75 11.68C1.75 11.49 1.75 11.48 1.86 11.32C2.25 10.76 2.8 10.68 3.04 10.68C3.49 10.68 3.85 10.94 4.09 11.32C4.35 11.73 4.38 12.3 4.38 12.71Z"/><path d="M15.56 11.41C15.56 11.3 15.47 11.21 15.36 11.21L9.1 11.21C8.99 11.21 8.9 11.3 8.9 11.41C8.9 11.52 8.99 11.61 9.1 11.61L15.36 11.61C15.47 11.61 15.56 11.52 15.56 11.41ZM15.56 13.35C15.56 13.24 15.47 13.15 15.36 13.15L9.1 13.15C8.99 13.15 8.9 13.24 8.9 13.35C8.9 13.46 8.99 13.55 9.1 13.55L15.36 13.55C15.47 13.55 15.56 13.46 15.56 13.35Z"/><path d="M22.22 13.64L22.22 13.07L21.97 13.07L21.97 13.62C21.97 14.36 21.67 14.74 21.3 14.74C20.63 14.74 20.63 13.83 20.63 13.66L20.63 10.88L22.06 10.88L22.06 10.57L20.63 10.57L20.63 8.73L20.38 8.73C20.37 9.55 20.07 10.62 19.09 10.66L19.09 10.88L19.94 10.88L19.94 13.64C19.94 14.87 20.87 14.99 21.23 14.99C21.94 14.99 22.22 14.28 22.22 13.64Z"/><path d="M23.89 3.87L23.76 3.72C23.32 4.09 22.85 4.36 22.39 4.36C22.03 4.36 21.77 4.2 21.45 4.02C21.19 3.87 20.91 3.72 20.55 3.72C20.33 3.72 20.09 3.79 19.89 3.88C19.71 3.97 19.53 4.07 19.38 4.19L18.9 4.59L19.02 4.74C19.46 4.37 19.94 4.1 20.4 4.1C20.76 4.1 21.02 4.26 21.33 4.44C21.6 4.59 21.87 4.74 22.23 4.74C22.46 4.74 22.69 4.67 22.89 4.58C23.07 4.49 23.25 4.39 23.4 4.27Z"/><path d="M33.34 12.38C33.34 12.27 33.25 12.18 33.14 12.18L30.21 12.18L30.21 9.25C30.21 9.14 30.12 9.05 30.01 9.05C29.9 9.05 29.81 9.14 29.81 9.25L29.81 12.18L26.88 12.18C26.77 12.18 26.68 12.27 26.68 12.38C26.68 12.49 26.77 12.58 26.88 12.58L29.81 12.58L29.81 15.51C29.81 15.62 29.9 15.71 30.01 15.71C30.12 15.71 30.21 15.62 30.21 15.51L30.21 12.58L33.14 12.58C33.25 12.58 33.34 12.49 33.34 12.38Z"/><path d="M39.72 13.6C39.72 13.07 39.42 12.77 39.3 12.65C38.97 12.33 38.58 12.25 38.16 12.17C37.6 12.06 36.93 11.93 36.93 11.35C36.93 11 37.19 10.59 38.05 10.59C39.15 10.59 39.2 11.49 39.22 11.8C39.23 11.89 39.34 11.89 39.34 11.89C39.47 11.89 39.47 11.84 39.47 11.65L39.47 10.64C39.47 10.47 39.47 10.4 39.36 10.4C39.31 10.4 39.29 10.4 39.16 10.52C39.13 10.56 39.03 10.65 38.99 10.68C38.61 10.4 38.2 10.4 38.05 10.4C36.83 10.4 36.45 11.07 36.45 11.63C36.45 11.98 36.61 12.26 36.88 12.48C37.2 12.74 37.48 12.8 38.2 12.94C38.42 12.98 39.24 13.14 39.24 13.86C39.24 14.37 38.89 14.77 38.11 14.77C37.27 14.77 36.91 14.2 36.72 13.35C36.69 13.22 36.68 13.18 36.58 13.18C36.45 13.18 36.45 13.25 36.45 13.43L36.45 14.75C36.45 14.92 36.45 14.99 36.56 14.99C36.61 14.99 36.62 14.98 36.81 14.79C36.83 14.77 36.83 14.75 37.01 14.56C37.45 14.98 37.9 14.99 38.11 14.99C39.26 14.99 39.72 14.32 39.72 13.6Z"/></svg><math class="td-math-a11y" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>b</mi><mtext> </mtext><mtext>=</mtext><mtext> </mtext><mover accent="true"><mrow><mi>t</mi></mrow><mo>~</mo></mover><mtext> </mtext><mtext>+</mtext><mtext> </mtext><mi>s</mi></mrow></math></div>
<p>A candidate is a slowdown only if its median exceeds the baseline’s bound. The control times the baseline against itself, which gives the false-alarm rate of the bound, about 4 percent. First result: sum of medians <strong>+0.65 percent</strong> (control -0.15 percent), no slowdown shown. That is a first measurement on 48 cases, not a proof.</p>
<h3>What is not done</h3>
<p>The command line, <code>serve</code>, MCP and the desktop app still read through the old implementation in the shipped binary, with the engine’s code underneath for the parts that moved. Switching the callers, a structural gate that fails the build if one reads around the engine, and a repeat of the speed measurement on a fully configured candidate are open in #122.</p>
<h3>A small thing, quietly</h3>
<p>Part of why I care about the engine: there is a desktop app. It is a native client for browsing the same documentation, Swift Evolution and sample code, on the Mac in SwiftUI and AppKit, and on iPhone and iPad in SwiftUI and UIKit. On the Mac it talks to <code>cupertino serve</code>; on iPhone and iPad it reads the databases itself, through the engine. It is early, it is not released, and I have no date for it. I mention it only because it is the reason the two read paths must not drift apart, and because the code is public if you want to look: <a href="https://codeberg.org/CupertinoHQ/cupertino-desktop">cupertino-desktop</a>.</p>
<h2>How a release gets built</h2>
<p>Both releases went through the same pipeline, and writing down what went wrong is half the value.</p>
<figure class="td-mermaid" data-td-mermaid>
<pre class="mermaid td-mermaid-source">flowchart TB
  A[Crawl] --&gt; B[Merge into corpus]
  B --&gt; C[Rebuild databases]
  C --&gt; D[Compare with last release]
  D --&gt; E[Audits, smoke test, filter oracle]
  E --&gt; F[Zip and deploy]
  F --&gt; G[Sign and notarize]
  G --&gt; H[Publish and tap]
  H --&gt; I[Clean install check]
</pre>
</figure>
<ul><li><p><strong>The bundle step failed its own smoke test</strong>, correctly. The copies of the seven unchanged databases had been switched to WAL by my own test runs, the exact behaviour of #117, and a read-only open of a WAL file with no <code>-shm</code> fails. I converted them back to rollback mode and checked bytes 18 and 19 of every header before the real run.</p></li><li><p><strong>The verification took hours.</strong> The filter oracle replays searches against the stored version metadata, more than 14,000 of them in this run, and passed.</p></li><li><p><strong>A check was skipped, and I say so.</strong> The “values against the raw corpus” oracles skip themselves when the build folder holds no corpus. For 1.6.5 they were skipped, and the row-by-row comparison against 1.6.0 stood in for them.</p></li><li><p><strong>The binary is signed and notarized</strong>, built on the one Mac that has the signing identity, and I checked the published tarball by its checksum, its signature, the notarization assessment, and a clean-folder <code>cupertino setup</code> that then found a tutorial by search and read it.</p></li></ul>
<h2>Upgrade</h2>
<pre><code>brew update
brew upgrade cupertino
cupertino setup</code></pre>
<p><code>cupertino setup</code> downloads the bundle for your version, 838 MB, and moves your old databases aside. Then:</p>
<pre><code>cupertino search "creating and combining views" --source apple-docs
cupertino search "gesture" --only ios --only visionos
cupertino search "window" --ui appkit
cupertino search "actor" --source packages --swift 5.9</code></pre>
<p>What is next: switching every caller to the engine, the gate that keeps it that way, and the open tracker items: #106 (a cut of 8,651 of 16,325 long Apple pages that needs a proper ranking evaluation)and #107 (a swift.org page that is a “Forbidden” error). The full list of changes, every one with its issue number and what was measured, is in the <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/CHANGELOG.md">changelog</a>.</p>]]></content:encoded>
</item>
<item>
<title>Cupertino 1.5.0: Five Months of Apple Documentation, Diffed</title>
<link>https://aleahim.com/blog/cupertino-v1-5-0-five-months-diffed/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-5-0-five-months-diffed/</guid>
<pubDate>Tue, 10 Nov 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>I compared the June and November documentation databases page by page, 27,494 new pages, none lost, 126,695 re-read, a foldable iPhone in the docs, and the two defects the diff found</description>
<content:encoded><![CDATA[<h1>Cupertino 1.5.0: Five Months of Apple Documentation, Diffed</h1>
<p><a href="https://aleahim.com/blog/cupertino-11-release/">In June</a> I diffed Apple’s documentation against the version that had been on everyone’s disk since May, and read the difference like a tea leaf. This time I diffed my own database against itself. The 1.4.0 database holds Apple’s documentation as it was on 2026-06-20. The 1.5.0 database was built on 2026-11-09. Every page has an address, so I matched the two by address, compared the stored content, and counted.</p>
<p>The short version: <strong>363,562 pages became 391,056, and no page was lost.</strong> The longer version has a surprise in it, two defects, and a foldable iPhone.</p>
<h2>What happened to the 363,562 pages</h2>
<p>Of the pages in 1.4.0, 362,474 have the same address in 1.5.0, and 1,088 have an address that differs only in spelling: case, underscores, hyphens, a number prefix. Those are the same pages, so I counted them as neither new nor removed. Removed: zero.</p>
<p>New: 27,494 pages, 7.6 percent more than before. But the new pages are not the main story. Look at what happened to the pages that were already there.</p>
<figure class="td-chart td-chart-bar">
<figcaption class="td-chart-caption">The 363,562 pages of 1.4.0</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 382"
  role="img"
  aria-label="The 363,562 pages of 1.4.0"
>
<desc>bar chart with 5 labels and 1 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="209.33"
  x2="696"
  y2="209.33"
></line>
<text
  class="td-chart-value"
  x="70"
  y="213.33"
  text-anchor="end"
>50000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="116.67"
  x2="696"
  y2="116.67"
></line>
<text
  class="td-chart-value"
  x="70"
  y="120.67"
  text-anchor="end"
>100000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>150000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="124.6"
  y="67.19"
  width="32"
  height="234.81"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="247.8"
  y="113.5"
  width="32"
  height="188.5"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="371"
  y="89.11"
  width="32"
  height="212.89"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="494.2"
  y="266.42"
  width="32"
  height="35.58"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="617.4"
  y="299.98"
  width="32"
  height="2.02"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="141.6"
  y="324"
  text-anchor="middle"
>Re-read</text>
<text
  class="td-chart-label"
  x="264.8"
  y="324"
  text-anchor="middle"
>Changed</text>
<text
  class="td-chart-label"
  x="388"
  y="324"
  text-anchor="middle"
>Unchanged</text>
<text
  class="td-chart-label"
  x="511.2"
  y="324"
  text-anchor="middle"
>Availability</text>
<text
  class="td-chart-label"
  x="634.4"
  y="324"
  text-anchor="middle"
>Respelled</text>
<text
  class="td-chart-label"
  x="388"
  y="368"
  text-anchor="middle"
>Outcome</text>
<text
  class="td-chart-label"
  x="16"
  y="163"
  text-anchor="middle"
  transform="rotate(-90 16 163)"
>Pages</text>
<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>Pages</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Re-read: 126695</title>
<rect class="td-chart-hit" x="124.6" y="67.19" width="32" height="234.81"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="70.1" y="29.19" width="141" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="79.1" y="49.19">Re-read: 126695</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Changed: 101711</title>
<rect class="td-chart-hit" x="247.8" y="113.5" width="32" height="188.5"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="193.3" y="75.5" width="141" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="202.3" y="95.5">Changed: 101711</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Unchanged: 114869</title>
<rect class="td-chart-hit" x="371" y="89.11" width="32" height="212.89"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="308.3" y="51.11" width="157.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="317.3" y="71.11">Unchanged: 114869</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Availability: 19199</title>
<rect class="td-chart-hit" x="494.2" y="266.42" width="32" height="35.58"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="423.3" y="228.42" width="173.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="432.3" y="248.42">Availability: 19199</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Respelled: 1088</title>
<rect class="td-chart-hit" x="617.4" y="284.99" width="32" height="32"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="562.9" y="261.98" width="141" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="571.9" y="281.98">Respelled: 1088</text>
</g>
</g>
</svg>
</div>
</figure>
<p>The labels, in full. Re-read: stored from Apple’s structured data. Changed: the content differs. Unchanged: the same. Availability: only the minimum versions differ. Respelled: the same page under a new spelling of its address.</p>
<p>Only 114,869 pages, about a third, are unchanged. For 126,695 of them the content differs because they were stored in a different way. More on that below.</p>
<h2>Where the 27,494 new pages went</h2>
<p>Three frameworks hold 71 percent of them: <code>coreservices</code> (9,613 pages), <code>iokit</code> (8,147) and <code>applicationservices</code> (1,767). These are older, C-based system frameworks.</p>
<figure class="td-chart td-chart-bar">
<figcaption class="td-chart-caption">New pages by framework</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 382"
  role="img"
  aria-label="New pages by framework"
>
<desc>bar chart with 4 labels and 1 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="246.4"
  x2="696"
  y2="246.4"
></line>
<text
  class="td-chart-value"
  x="70"
  y="250.4"
  text-anchor="end"
>2000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="190.8"
  x2="696"
  y2="190.8"
></line>
<text
  class="td-chart-value"
  x="70"
  y="194.8"
  text-anchor="end"
>4000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="135.2"
  x2="696"
  y2="135.2"
></line>
<text
  class="td-chart-value"
  x="70"
  y="139.2"
  text-anchor="end"
>6000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="79.6"
  x2="696"
  y2="79.6"
></line>
<text
  class="td-chart-value"
  x="70"
  y="83.6"
  text-anchor="end"
>8000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>10000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="140"
  y="34.76"
  width="32"
  height="267.24"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="294"
  y="75.51"
  width="32"
  height="226.49"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="448"
  y="252.88"
  width="32"
  height="49.12"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="602"
  y="80.52"
  width="32"
  height="221.48"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="157"
  y="324"
  text-anchor="middle"
>coreservices</text>
<text
  class="td-chart-label"
  x="311"
  y="324"
  text-anchor="middle"
>iokit</text>
<text
  class="td-chart-label"
  x="465"
  y="324"
  text-anchor="middle"
>applicationservices</text>
<text
  class="td-chart-label"
  x="619"
  y="324"
  text-anchor="middle"
>Others</text>
<text
  class="td-chart-label"
  x="388"
  y="368"
  text-anchor="middle"
>Framework</text>
<text
  class="td-chart-label"
  x="16"
  y="163"
  text-anchor="middle"
  transform="rotate(-90 16 163)"
>New pages</text>
<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>New pages</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>coreservices: 9613</title>
<rect class="td-chart-hit" x="140" y="34.76" width="32" height="267.24"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="73.2" y="310" width="165.6" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="82.2" y="330">coreservices: 9613</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>iokit: 8147</title>
<rect class="td-chart-hit" x="294" y="75.51" width="32" height="226.49"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="255.9" y="37.51" width="108.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="264.9" y="57.51">iokit: 8147</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>applicationservices: 1767</title>
<rect class="td-chart-hit" x="448" y="252.88" width="32" height="49.12"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="352.5" y="214.88" width="223" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="361.5" y="234.88">applicationservices: 1767</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>Others: 7967</title>
<rect class="td-chart-hit" x="602" y="80.52" width="32" height="221.48"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="559.8" y="42.52" width="116.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="568.8" y="62.52">Others: 7967</text>
</g>
</g>
</svg>
</div>
</figure>
<p>Seven frameworks are new in the database: <code>apple-ads-platform-api</code> (755 pages), <code>videodriverkit</code> (563), <code>sirievaluations</code> (144), <code>homeextensions</code> (134), <code>app-store-review-guidelines</code> (129), <code>appletvfeed</code> (77) and <code>visionentitlementservices</code> (36). The database now holds 424 frameworks.</p>
<h2>The real change is how pages are stored</h2>
<p>In 1.4.0 most pages were stored from a scrape of the web page. In 1.5.0, 126,695 of them, 35 percent of the old database, are stored from Apple’s structured data instead. A scrape gives you text with the site’s navigation glued on. The structured data gives you the declaration, the kind of page, the platforms and the real title.</p>
<p>The numbers show it:</p>
<ul><li><p>Titles that still end in the web page’s suffix fell from 129,074 to 2,854.</p></li><li><p>Pages with a declaration went from 293,877 to 374,369.</p></li></ul>
<figure class="td-chart td-chart-bar">
<figcaption class="td-chart-caption">Pages with each field</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 382"
  role="img"
  aria-label="Pages with each field"
>
<desc>bar chart with 4 labels and 2 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="232.5"
  x2="696"
  y2="232.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="236.5"
  text-anchor="end"
>100000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="163"
  x2="696"
  y2="163"
></line>
<text
  class="td-chart-value"
  x="70"
  y="167"
  text-anchor="end"
>200000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="93.5"
  x2="696"
  y2="93.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="97.5"
  text-anchor="end"
>300000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>400000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="123"
  y="187.01"
  width="32"
  height="114.99"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="277"
  y="97.76"
  width="32"
  height="204.24"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="431"
  y="145.99"
  width="32"
  height="156.01"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="585"
  y="210.72"
  width="32"
  height="91.28"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="157"
  y="66.9"
  width="32"
  height="235.1"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="311"
  y="41.81"
  width="32"
  height="260.19"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="465"
  y="44.7"
  width="32"
  height="257.3"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="619"
  y="160.59"
  width="32"
  height="141.41"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="157"
  y="324"
  text-anchor="middle"
>Kind</text>
<text
  class="td-chart-label"
  x="311"
  y="324"
  text-anchor="middle"
>Declaration</text>
<text
  class="td-chart-label"
  x="465"
  y="324"
  text-anchor="middle"
>Platforms</text>
<text
  class="td-chart-label"
  x="619"
  y="324"
  text-anchor="middle"
>Min iOS</text>
<text
  class="td-chart-label"
  x="388"
  y="368"
  text-anchor="middle"
>Field</text>
<text
  class="td-chart-label"
  x="16"
  y="163"
  text-anchor="middle"
  transform="rotate(-90 16 163)"
>Pages</text>
<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>1.4.0</text>
<rect
  class="td-chart-series-1"
  x="152.64"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="170.64"
  y="346"
  text-anchor="start"
>1.5.0</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Kind: 165452</title>
<rect class="td-chart-hit" x="123" y="187.01" width="32" height="114.99"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="52.1" y="149.01" width="173.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="61.1" y="169.01">1.4.0, Kind: 165452</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Declaration: 293877</title>
<rect class="td-chart-hit" x="277" y="97.76" width="32" height="204.24"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="177.4" y="59.76" width="231.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="186.4" y="79.76">1.4.0, Declaration: 293877</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Platforms: 224481</title>
<rect class="td-chart-hit" x="431" y="145.99" width="32" height="156.01"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="339.6" y="107.99" width="214.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="348.6" y="127.99">1.4.0, Platforms: 224481</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Min iOS: 131341</title>
<rect class="td-chart-hit" x="585" y="210.72" width="32" height="91.28"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="501.8" y="172.72" width="198.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="510.8" y="192.72">1.4.0, Min iOS: 131341</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Kind: 338279</title>
<rect class="td-chart-hit" x="157" y="66.9" width="32" height="235.1"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="86.1" y="28.9" width="173.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="95.1" y="48.9">1.5.0, Kind: 338279</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Declaration: 374369</title>
<rect class="td-chart-hit" x="311" y="41.81" width="32" height="260.19"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="211.4" y="310" width="231.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="220.4" y="330">1.5.0, Declaration: 374369</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Platforms: 370217</title>
<rect class="td-chart-hit" x="465" y="44.7" width="32" height="257.3"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="373.6" y="6.7" width="214.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="382.6" y="26.7">1.5.0, Platforms: 370217</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Min iOS: 203464</title>
<rect class="td-chart-hit" x="619" y="160.59" width="32" height="141.41"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="517.6" y="122.59" width="198.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="526.6" y="142.59">1.5.0, Min iOS: 203464</text>
</g>
</g>
</svg>
</div>
</figure>
<p>A filter can only use what a page carries, so a page with a known kind and platforms is a page a filter can use.</p>
<h2>The documentation describes a foldable iPhone</h2>
<p>Search the new database for the word “hinge” and Apple’s own pages answer with <strong>iPhone Duo</strong>.</p>
<p>The overview, “Preparing your app for iPhone Duo”, describes it as a foldable phone with a compact outer display and a large inner display, each with a front camera. The inner camera is hidden when the phone is closed. As it opens, closes, folds partway and rotates, content moves between the displays, and when it is partly folded, views adapt to the folding region. In some poses the navigation bar, toolbar and tab bar sit together, vertically, on the side of the display. The page also says an app built with Xcode 26 or earlier does not extend under the status bar and camera.</p>
<p>All of these pages are in the “new” list of the diff, so none was in the June database. In SwiftUI, UIKit and XCUIAutomation together there are about 180 new pages whose address contains <code>arrangement</code>, <code>hinge</code> or <code>reservedregion</code>. I counted by address, so treat that number as a guide. Of the 206 new SwiftUI pages, 174 start at iOS 27 or later, and of the 266 new UIKit pages, 249 do.</p>
<figure class="td-mermaid" data-td-mermaid>
<pre class="mermaid td-mermaid-source">flowchart LR
  subgraph L[&quot;Layout&quot;]
    direction TB
    r1[&quot;ReservedRegion&lt;br/&gt;SwiftUI and UIKit&quot;] --&gt; a1[&quot;ArrangementView&lt;br/&gt;SwiftUI&quot;]
    r1 --&gt; a2[&quot;UIArrangementViewController&lt;br/&gt;UIKit&quot;]
    a1 --&gt; s1[&quot;OverlayArrangementViewStyle&lt;br/&gt;SplitArrangementViewStyle&quot;]
  end
  subgraph H[&quot;The hinge&quot;]
    direction TB
    h1[&quot;DeviceHinge&lt;br/&gt;DeviceHingeContext&quot;] --&gt;|&quot;tested with&quot;| h2[&quot;XCUIHinge&lt;br/&gt;in your UI tests&quot;]
  end
  subgraph C[&quot;The cameras&quot;]
    direction TB
    c1[&quot;Registering a camera capture&lt;br/&gt;accessory on iPhone Duo&quot;]
    c2[&quot;Choosing a camera by the&lt;br/&gt;direction it faces&quot;]
  end
</pre>
</figure>
<p>Apple describes <code>ArrangementView</code> as a view that lays out a primary and a secondary view by size class, orientation and reserved regions. The overlay style layers the primary view over the secondary one, or places them side by side on a folded display. <code>XCUIHinge</code> is “a reference to the hinge on iPhone Duo”. I have not seen the device. I read the documentation, which is what Cupertino is for.</p>
<h2>What else changed</h2>
<ul><li><p><strong>WWDC session transcripts</strong> are now a ninth database: 1,915 entries across 197 frameworks, with each session’s frameworks and Swift version.</p></li><li><p><strong>The App Review Guidelines</strong> are pages, one for each numbered section.</p></li><li><p><strong>Versions on every result.</strong> Search shows the Swift version of each result and the OS versions it needs. Version filters now work on packages and samples, and a filtered search says how many pages it left out for want of a version.</p></li><li><p><strong>Checks.</strong> There are oracles that re-derive the stored versions from the raw files and compare them row by row, and the release gate runs the search oracle for every source.</p></li><li><p><strong>The release tool</strong> now cuts a release against Codeberg. The old GitHub workflow is gone.</p></li></ul>
<p>The whole corpus refresh is one command, <code>cupertino-rel refresh</code>. It ends with audits, oracles, gates and a smoke test, and only then is anything published.</p>
<figure class="td-mermaid" data-td-mermaid>
<pre class="mermaid td-mermaid-source">flowchart LR
  f1[&quot;Fetch&lt;br/&gt;crawl-frameworks&quot;] --&gt; f2[&quot;Produce&lt;br/&gt;enrichment inputs&quot;] --&gt; f3[&quot;Swift feature&lt;br/&gt;table&quot;] --&gt; f4[&quot;Save the docs&lt;br/&gt;database first&quot;] --&gt; f5[&quot;Save the&lt;br/&gt;other databases&quot;]
  f5 --&gt; f6[&quot;Audit&lt;br/&gt;version coverage&quot;] --&gt; f7[&quot;Oracles&quot;] --&gt; f8[&quot;Gates&quot;] --&gt; f9[&quot;Smoke&quot;] --&gt; f10[&quot;Publish&quot;]
</pre>
</figure>
<h2>What the diff does not prove</h2>
<p>Here is the part I would rather you hear from me.</p>
<p><strong>It proves that no page was lost. It does not prove that no content was lost.</strong> 228,406 pages changed. In 75,445 of them, less than half of the old body lines survive exactly. I read seven of those pages. They showed reformatting: links became bold list items, and the availability text that used to be glued to the abstract moved into its own field. They also showed one real defect. I did not read all 75,445, so “reformatted” is an impression, not a measurement.</p>
<p>The comparison found two defects:</p>
<ul><li><p><strong>Raw references in the text.</strong> Pages whose text contains an inline reference printed as <code>doc://com.apple.appkit/...</code> where the symbol’s name belongs grew from 37,636 to 59,360 pages. That is a regression in the conversion from the structured data. The largest are <code>appkit</code> (5,478 pages), <code>uikit</code> (4,757) and <code>foundation</code> (4,307).</p></li><li><p><strong>Pages without a kind.</strong> 52,777 pages, 13.5 percent, still have no kind. That is down from 198,110, but a kind filter treats them as untyped.</p></li></ul>
<figure class="td-chart td-chart-bar">
<figcaption class="td-chart-caption">Two defects</figcaption>
<div class="td-chart-frame">
<svg
  class="td-chart-svg"
  viewBox="0 0 720 382"
  role="img"
  aria-label="Two defects"
>
<desc>bar chart with 2 labels and 2 series</desc>
<line
  class="td-chart-grid"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<text
  class="td-chart-value"
  x="70"
  y="306"
  text-anchor="end"
>0</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="232.5"
  x2="696"
  y2="232.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="236.5"
  text-anchor="end"
>50000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="163"
  x2="696"
  y2="163"
></line>
<text
  class="td-chart-value"
  x="70"
  y="167"
  text-anchor="end"
>100000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="93.5"
  x2="696"
  y2="93.5"
></line>
<text
  class="td-chart-value"
  x="70"
  y="97.5"
  text-anchor="end"
>150000</text>
<line
  class="td-chart-grid"
  x1="80"
  y1="24"
  x2="696"
  y2="24"
></line>
<text
  class="td-chart-value"
  x="70"
  y="28"
  text-anchor="end"
>200000</text>
<line
  class="td-chart-axis"
  x1="80"
  y1="302"
  x2="696"
  y2="302"
></line>
<line
  class="td-chart-axis"
  x1="80"
  y1="24"
  x2="80"
  y2="302"
></line>
<rect
  class="td-chart-bar td-chart-series-0"
  x="200"
  y="26.63"
  width="32"
  height="275.37"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-0"
  x="508"
  y="249.69"
  width="32"
  height="52.31"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="234"
  y="228.64"
  width="32"
  height="73.36"
  rx="4"
></rect>
<rect
  class="td-chart-bar td-chart-series-1"
  x="542"
  y="219.49"
  width="32"
  height="82.51"
  rx="4"
></rect>
<text
  class="td-chart-label"
  x="234"
  y="324"
  text-anchor="middle"
>Unknown kind</text>
<text
  class="td-chart-label"
  x="542"
  y="324"
  text-anchor="middle"
>Raw doc://</text>
<text
  class="td-chart-label"
  x="388"
  y="368"
  text-anchor="middle"
>Defect</text>
<text
  class="td-chart-label"
  x="16"
  y="163"
  text-anchor="middle"
  transform="rotate(-90 16 163)"
>Pages</text>
<rect
  class="td-chart-series-0"
  x="80"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="98"
  y="346"
  text-anchor="start"
>1.4.0</text>
<rect
  class="td-chart-series-1"
  x="152.64"
  y="336"
  width="12"
  height="12"
  rx="3"
  fill="currentColor"
></rect>
<text
  class="td-chart-legend-text"
  x="170.64"
  y="346"
  text-anchor="start"
>1.5.0</text>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Unknown kind: 198110</title>
<rect class="td-chart-hit" x="200" y="26.63" width="32" height="275.37"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="96.3" y="310" width="239.4" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="105.3" y="330">1.4.0, Unknown kind: 198110</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-0" tabindex="0"><title>1.4.0, Raw doc://: 37636</title>
<rect class="td-chart-hit" x="508" y="249.69" width="32" height="52.31"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="416.6" y="211.69" width="214.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="425.6" y="231.69">1.4.0, Raw doc://: 37636</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Unknown kind: 52777</title>
<rect class="td-chart-hit" x="234" y="228.64" width="32" height="73.36"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="134.4" y="190.64" width="231.2" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="143.4" y="210.64">1.5.0, Unknown kind: 52777</text>
</g>
</g>
<g class="td-chart-mark td-chart-series-1" tabindex="0"><title>1.5.0, Raw doc://: 59360</title>
<rect class="td-chart-hit" x="542" y="219.49" width="32" height="82.51"></rect>
<g class="td-chart-pop">
<rect class="td-chart-pop-box" x="450.6" y="181.49" width="214.8" height="30" rx="6"></rect>
<text class="td-chart-pop-text" x="459.6" y="201.49">1.5.0, Raw doc://: 59360</text>
</g>
</g>
</svg>
</div>
</figure>
<p>Abstract coverage also fell, from 61.4 to 56.6 percent, although 27,494 pages were added. In six samples I read, the old abstract was the page header and navigation run together, so those were not real abstracts, but I did not check that for every page. <code>matter</code> and <code>kernel</code> were almost entirely rewritten, 24,224 of 24,390 and 23,182 of 39,651 pages, so they are the first place to look by hand.</p>
<p>Both have fixes on the development branch, and neither is released yet. The second fix gives a kind to about 33,000 of those 52,777 pages. The diff itself was a one-off script outside the repository, so the numbers above cannot yet be reproduced with a repository tool. If the diff is to be repeated, it should become a <code>cupertino-rel</code> command.</p>
<h2>Update</h2>
<p>Homebrew has 1.5.0:</p>
<pre><code class="language-bash">brew update <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> brew upgrade cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup</code></pre>
<p><code>cupertino setup</code> downloads the matching database bundle, 714 MB. Then ask your agent something that was not in June’s database, for example how an app adapts to a hinge, and see what it finds.</p>
<p>The full diff, framework by framework, with the analysis, is in the repository under <code>docs/diff-2026-06-20-to-2026-11-09</code>.</p>]]></content:encoded>
</item>
<item>
<title>Cupertino moved to Codeberg. Update your Homebrew tap.</title>
<link>https://aleahim.com/blog/cupertino-moved-to-codeberg/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-moved-to-codeberg/</guid>
<pubDate>Wed, 01 Jul 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Cupertino v1.4.2 moves the working Homebrew tap and binary distribution to Codeberg, with setup assets served from Fly.</description>
<content:encoded><![CDATA[<h1>Cupertino moved to Codeberg. Update your Homebrew tap.</h1>
<p>Short version: Cupertino’s working distribution home is now Codeberg.</p>
<p>If you installed Cupertino from the old GitHub tap, <code>brew upgrade</code> can tell you that everything is current while leaving you on <code>1.4.1</code>. That is not the current working release. The current release is <code>1.4.2</code>, and it lives in the new Codeberg tap.</p>
<h2>Update an existing install</h2>
<p>Run this exactly:</p>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew fetch cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
brew uninstall mihaelamj<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino <span class="tok-operator">|</span><span class="tok-operator">|</span> <span class="tok-literal">true</span>
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
brew untap mihaelamj<span class="tok-operator">/</span>tap <span class="tok-operator">|</span><span class="tok-operator">|</span> <span class="tok-literal">true</span>
cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span>version</code></pre>
<p>Expected output:</p>
<pre><code class="language-text"><span class="tok-number">1.4.2</span></code></pre>
<p>Then check your databases:</p>
<pre><code class="language-bash">cupertino doctor</code></pre>
<p>If you need to download the databases again:</p>
<pre><code class="language-bash">cupertino setup</code></pre>
<h2>Fresh install</h2>
<p>For a new Homebrew install:</p>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup</code></pre>
<p>The explicit Codeberg URL matters. If you run only:</p>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap</code></pre>
<p>Homebrew assumes GitHub. That is not where the working tap lives.</p>
<h2>How to tell if you are still on the old path</h2>
<p>Run:</p>
<pre><code class="language-bash">brew info cupertino</code></pre>
<p>If you see this:</p>
<pre><code class="language-text"><span class="tok-type">From</span><span class="tok-operator">:</span> https<span class="tok-operator">:</span><span class="tok-comment">//github.com/mihaelamj/homebrew-tap/...</span>
<span class="tok-type">Tap</span><span class="tok-operator">:</span> mihaelamj<span class="tok-operator">/</span>tap
stable <span class="tok-number">1.4.1</span></code></pre>
<p>you are still looking at the old GitHub tap.</p>
<p>The working tap should resolve to:</p>
<pre><code class="language-text"><span class="tok-type">From</span><span class="tok-operator">:</span> https<span class="tok-operator">:</span><span class="tok-comment">//codeberg.org/CupertinoHQ/homebrew-tap.git/Formula/cupertino.rb</span>
<span class="tok-type">Tap</span><span class="tok-operator">:</span> cupertinohq<span class="tok-operator">/</span>tap
stable <span class="tok-number">1.4.2</span></code></pre>
<h2>What changed in 1.4.2</h2>
<p>This is a distribution hotfix, not a corpus rebuild.</p>
<ul><li><p>Source moved to <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a></p></li><li><p>Homebrew moved to <a href="https://codeberg.org/CupertinoHQ/homebrew-tap">codeberg.org/CupertinoHQ/homebrew-tap</a></p></li><li><p>The Homebrew formula downloads the <code>1.4.2</code> binary from Codeberg packages</p></li><li><p><code>cupertino setup</code> downloads the database bundle from <code>cupertino-assets.fly.dev</code></p></li><li><p>The database bundle is still version <code>1.4.0</code></p></li><li><p>The schema is unchanged</p></li></ul>
<p>That means your existing v1.4.0 databases remain valid. If <code>cupertino doctor</code> says all checks passed, you do not need to download the databases again.</p>
<h2>Why <code>brew upgrade</code> was confusing</h2>
<p>Homebrew compares your installed formula against the tap it knows about. If your machine is still tapped to the old GitHub formula and that formula says <code>1.4.1</code>, Homebrew can report “nothing to upgrade” even though the working Codeberg tap has <code>1.4.2</code>.</p>
<p>The fix is not just <code>brew upgrade</code>. The fix is switching taps.</p>
<h2>The old GitHub setup path is obsolete</h2>
<p>The old GitHub release asset can return 404. Cupertino <code>1.4.2</code> no longer depends on that path for setup.</p>
<p>The current setup path is:</p>
<pre><code class="language-text">https<span class="tok-operator">:</span><span class="tok-comment">//cupertino-assets.fly.dev/releases/v1.4.0/cupertino-databases-v1.4.0.zip</span>
https<span class="tok-operator">:</span><span class="tok-comment">//cupertino-assets.fly.dev/apple-constraints.json</span></code></pre>
<p>I tested the new path end to end: Homebrew installs <code>1.4.2</code>, <code>cupertino setup</code> downloads the bundle, the constraints sidecar downloads, and all 8 databases verify.</p>
<h2>Source installs</h2>
<p>If you build from source, clone the Codeberg repo:</p>
<pre><code class="language-bash">git clone https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">.</span>git
cd cupertino</code></pre>
<p>The old GitHub URLs should be treated as legacy references. Codeberg is the working home now.</p>]]></content:encoded>
</item>
<item>
<title>What Apple Wants You to Build This Summer (You Can Read It in the Docs)</title>
<link>https://aleahim.com/blog/cupertino-11-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-11-release/</guid>
<pubDate>Mon, 22 Jun 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Apple&apos;s new frameworks and sample code read like a brief, and Cupertino v1.4.0 puts the whole signal offline</description>
<content:encoded><![CDATA[<h1>What Apple Wants You to Build This Summer (You Can Read It in the Docs)</h1>
<p>The keynote tells you what Apple announced. The documentation and the sample code tell you what Apple wants you to actually ship. Those are not the same thing, and the second one is far more useful if you are deciding what to build this summer.</p>
<p>So I did the boring, revealing thing: I diffed it. Cupertino just shipped v1.4.0, a full re-crawl of Apple’s developer documentation, and I compared it page by page against the version that has been on everyone’s disk since May. Then I read the diff like a tea leaf.</p>
<p>The answer is not subtle. <strong>Apple wants you to build Apple Intelligence into your app, and it has written you the homework.</strong></p>
<h2>The sample code is the smoking gun</h2>
<p>When Apple wants you to learn an API, it announces it. When Apple wants you to <em>ship</em> something, it gives you sample code you can paste from. So the new sample projects are the clearest signal in the whole corpus, and v1.4.0 added eleven of them. Here is the entire list:</p>
<ul><li><p>App Intents: Integrating Your <strong>Music</strong> App with Apple Intelligence</p></li><li><p>App Intents: Integrating Your <strong>Messaging</strong> App with Apple Intelligence</p></li><li><p>App Intents: Integrating Your <strong>Calendar</strong> App with Apple Intelligence</p></li><li><p>App Intents: Integrating Your <strong>Photo</strong> App with Apple Intelligence</p></li><li><p>FoundationModels: Origami, crafting a dynamic tutorial for Apple Intelligence</p></li><li><p>Evaluations: Book Tracker, using evaluations to evaluate an intelligent feature</p></li><li><p>HealthKit: Tracking heart rate zones for workouts</p></li><li><p>Metal: Training a neural network to render irradiance in real time</p></li><li><p>Metal: Running inline ML operations in a shader with Metal 4</p></li><li><p>DeclaredAgeRange: Implementing age assurance and permissions</p></li><li><p>VisionKit: Structuring recognized text on a document</p></li></ul>
<p>Read the top four again. Apple did not write “an example of App Intents.” It wrote “Integrating <strong>Your</strong> Music App,” “<strong>Your</strong> Messaging App,” “<strong>Your</strong> Calendar App,” “<strong>Your</strong> Photo App.” That is not documentation. That is a brief. Apple has taken the four most common app categories on the platform and handed each one a template for wiring itself into Apple Intelligence through App Intents. If you ship one of those four kinds of app, your summer roadmap is sitting in a sample project with your name on it.</p>
<p>There is not a single exception in the eleven. Every new sample is Apple Intelligence, App Intents, or on-device ML. No new SwiftUI layout sample, no new networking sample, no new Core Data sample. The signal is monochrome.</p>
<h2>The new frameworks are the syllabus</h2>
<p>Sample code shows you the assignments; the new frameworks show you the curriculum. v1.4.0 added <strong>19 frameworks that did not exist in the previous release</strong>, and the cluster tells the same story:</p>
<table><thead><tr><th>Framework</th><th style="text-align:right">Pages</th><th style="text-align:right">Symbols</th></tr></thead><tbody><tr><td>USDKit</td><td style="text-align:right">854</td><td style="text-align:right">806</td></tr><tr><td>ComputeGraph</td><td style="text-align:right">539</td><td style="text-align:right">273</td></tr><tr><td>Core AI</td><td style="text-align:right">308</td><td style="text-align:right">425</td></tr><tr><td>Evaluations</td><td style="text-align:right">172</td><td style="text-align:right">527</td></tr><tr><td>App Intents Testing</td><td style="text-align:right">103</td><td style="text-align:right">363</td></tr><tr><td>Now Playing</td><td style="text-align:right">100</td><td style="text-align:right">318</td></tr><tr><td>Music Understanding</td><td style="text-align:right">94</td><td style="text-align:right">77</td></tr><tr><td>AVSystemRouting</td><td style="text-align:right">92</td><td style="text-align:right">109</td></tr><tr><td>Media Device</td><td style="text-align:right">92</td><td style="text-align:right">148</td></tr><tr><td>Trust Insights</td><td style="text-align:right">85</td><td style="text-align:right">66</td></tr><tr><td>Media Intelligence</td><td style="text-align:right">77</td><td style="text-align:right">100</td></tr><tr><td>Accessory Access</td><td style="text-align:right">63</td><td style="text-align:right">53</td></tr><tr><td>DiskImageKit</td><td style="text-align:right">58</td><td style="text-align:right">87</td></tr><tr><td>Spatial Preview</td><td style="text-align:right">57</td><td style="text-align:right">60</td></tr><tr><td>StateReporting</td><td style="text-align:right">38</td><td style="text-align:right">77</td></tr><tr><td>CrashReportExtension</td><td style="text-align:right">29</td><td style="text-align:right">36</td></tr><tr><td>Media Intents</td><td style="text-align:right">15</td><td style="text-align:right">30</td></tr><tr><td>Suggested Actions</td><td style="text-align:right">9</td><td style="text-align:right">26</td></tr><tr><td>Apple School and Business Manager API</td><td style="text-align:right">3</td><td style="text-align:right">0</td></tr></tbody></table>
<p>Core AI. Evaluations. Media Intelligence. Music Understanding. Trust Insights. Suggested Actions. App Intents Testing. This is the connective tissue around on-device models: the pieces that let your app declare what it can do, feed a model the right context, evaluate what comes back, and route media intelligently. <strong>Evaluations</strong> is the quiet standout. Apple shipping a framework specifically for <em>evaluating</em> an intelligent feature, plus a sample that uses it, is Apple admitting that “add AI” is not a feature, it is an engineering discipline with a test loop. That is the most grown-up thing in the release.</p>
<p>And it is not only the debutants. <code>foundationmodels</code>, the on-device model framework, was not new but it more than doubled in pages (356 to 821) and more than tripled in symbols (406 to 1,383). The framework Apple gave you last year to talk to its models is the one it spent this cycle fleshing out.</p>
<h2>The honest part: most of the bytes are a deeper re-crawl</h2>
<p>I am not going to oversell the numbers, because the headline flatters the truth. The documentation database grew by <strong>+12,057 pages and +67,575 symbols</strong>. But only about <strong>23% of the new pages</strong> come from those 19 new frameworks. The other 77% is a deeper re-crawl of frameworks that already existed. For symbols it is even more lopsided: roughly <strong>95%</strong> of the gain is re-crawled existing frameworks, and the Swift standard library alone accounts for over 40% of it (+27,908 symbols).</p>
<p>So the accurate sentence is: the byte-weight is a fuller pass over everything, and the <em>signal</em> is the 19 new frameworks and eleven new samples on top. Both are true, and a release post that only quoted the big number would be lying by omission.</p>
<p>Where did the existing-framework growth concentrate? Right where you would guess given the theme:</p>
<table><thead><tr><th>Framework</th><th style="text-align:right">old pages</th><th style="text-align:right">new pages</th><th style="text-align:right">delta</th></tr></thead><tbody><tr><td>realitykit</td><td style="text-align:right">4,456</td><td style="text-align:right">6,133</td><td style="text-align:right">+1,677</td></tr><tr><td>appintents</td><td style="text-align:right">3,509</td><td style="text-align:right">4,376</td><td style="text-align:right">+867</td></tr><tr><td>foundation</td><td style="text-align:right">13,649</td><td style="text-align:right">14,282</td><td style="text-align:right">+633</td></tr><tr><td>appkit</td><td style="text-align:right">13,378</td><td style="text-align:right">13,917</td><td style="text-align:right">+539</td></tr><tr><td>foundationmodels</td><td style="text-align:right">356</td><td style="text-align:right">821</td><td style="text-align:right">+465</td></tr><tr><td>swift</td><td style="text-align:right">18,717</td><td style="text-align:right">19,057</td><td style="text-align:right">+340</td></tr><tr><td>metrickit</td><td style="text-align:right">249</td><td style="text-align:right">567</td><td style="text-align:right">+318</td></tr><tr><td>corespotlight</td><td style="text-align:right">403</td><td style="text-align:right">719</td><td style="text-align:right">+316</td></tr><tr><td>swiftui</td><td style="text-align:right">8,679</td><td style="text-align:right">8,938</td><td style="text-align:right">+259</td></tr></tbody></table>
<p>RealityKit and App Intents leading the page growth is the same story from yet another angle: spatial computing and the intent system are both load-bearing for what Apple is asking you to build. No framework shrank in page count and none were removed, so at the framework level v1.4.0 is a clean superset of v1.3.0.</p>
<h2>What did not change, honestly</h2>
<p>A re-crawl is not a magic content generator. Four databases came back byte-for-byte identical to v1.3.0: HIG, Swift Evolution, the Swift book, and the legacy Apple Archive guides. Three of those (HIG, Swift Evolution, the Swift book) were genuinely re-crawled this cycle and simply came back unchanged because Apple had not touched them upstream; the archive corpus was the one source carried over from the previous cycle. I verified “identical” with a content fingerprint over every page, not by trusting file dates. If your work lives in those four, v1.4.0 changes nothing for you, and I would rather say so than pad the release.</p>
<p>The Swift package index (<code>packages.db</code>) is the interesting middle case. The set of 185 packages is unchanged, but 183 were re-fetched from current upstream and re-indexed, so the database now reflects what those packages look like <em>today</em> rather than at the last crawl. That means it is honest rather than purely additive: Vapor lost 1,604 symbols where upstream refactored, while swift-package-manager and swift-async-algorithms each gained a few hundred. Net +2,836 symbols, but the real win is that the package picture is current.</p>
<h2>Why your AI agent needs this, specifically now</h2>
<p>Here is the part that ties the signal back to the tool. If Apple wants you to spend the summer wiring your app into Apple Intelligence, you are going to ask an assistant about Core AI, App Intents Testing, the Evaluations framework, and FoundationModels constantly. And an assistant working from a six-month-old corpus will confidently tell you those frameworks do not exist, because in its world they do not.</p>
<p>That is exactly the failure Cupertino exists to prevent. It puts Apple’s documentation on your machine as a set of local, searchable databases an AI agent can read through MCP, offline, in milliseconds. v1.4.0 is not a flashy release: it does not add a feature or touch a line of the query engine. It does the quieter thing that actually matters for a documentation tool, which is make the corpus match what Apple shipped. The fact that the new frameworks map almost perfectly onto Apple’s summer wishlist is not a coincidence; it is the whole point. Your agent now knows about the assignment.</p>
<h2>Getting v1.4.0</h2>
<p>The binary is signed and notarized and lives on the tap:</p>
<pre><code class="language-bash">brew upgrade cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino<span class="tok-comment"># or: brew tap cupertinohq/tap https://codeberg.org/CupertinoHQ/homebrew-tap.git</span>
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup            <span class="tok-comment"># downloads the v1.4.0 database bundle</span></code></pre>
<p>Same 8 per-source databases as v1.3.0, shipped read-only in rollback-journal mode, same schema (v18, packages on their own v5 track). Nothing in your tooling changes; the corpus underneath it just got current, and it got current in a very specific, very on-message direction.</p>
<p>Build the thing in the sample project. Apple already wrote the brief.</p>]]></content:encoded>
</item>
<item>
<title>cupertino v1.3.0: The Big Refactor</title>
<link>https://aleahim.com/blog/cupertino-v1-3-0-platform-filtering/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-3-0-platform-filtering/</guid>
<pubDate>Sun, 31 May 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>v1.3.0 is the architecture release: eight per-source databases derived from one registry, shipped read-only, with the legacy unified search.db retired for good.</description>
<content:encoded><![CDATA[<h1>cupertino v1.3.0: The Big Refactor</h1>
<p>This release started with a number that looked too small to matter.</p>
<p>Back in v1.2.0 I had added deployment-aware search: ask cupertino for an API and tell it which OS you actually ship, and it filters out the answers that would not compile for you.</p>
<pre><code class="language-bash">cupertino search swiftui <span class="tok-operator">-</span><span class="tok-operator">-</span>source samples <span class="tok-operator">-</span><span class="tok-operator">-</span>m<span class="tok-keyword">in</span><span class="tok-operator">-</span>ios <span class="tok-number">16</span></code></pre>
<p>The flag parsed. The database carried availability metadata. The command looked completely right. And yet, in the dev corpus, <code>--min-ios</code> handed back the same 88 results whether I asked for iOS 13 or iOS 18. A filter that returns the same set for every value is not filtering. It is decoration.</p>
<p>That is the kind of bug that looks like a one-line fix until you ask why it was possible at all.</p>
<p>A filter that does not filter is worse than no filter. It lets an assistant claim it respected your deployment target while quietly handing you an iOS 18 API for an app that still ships iOS 16. That is not an answer. It is a future compile error wearing a green checkmark.</p>
<p>I could have found the missing parameter, threaded it through the one path that dropped it, added a test, and shipped. One path fixed. The reason that path could go missing in the first place: untouched.</p>
<p>So I pulled on it instead.</p>
<h2>The problem under the bug</h2>
<p>cupertino had outgrown the shape it was born in.</p>
<p>Early on, the whole thing fit one mental model: a big Apple documentation index with a few extra sources bolted on. Apple Developer Documentation, the HIG, Apple Archive, Swift Evolution, swift.org, and <em>The Swift Programming Language</em> all lived inside a single SQLite file. Samples and packages had their own databases, but most of the command surface still thought in three buckets:</p>
<ul><li><p><code>search.db</code></p></li><li><p><code>samples.db</code></p></li><li><p><code>packages.db</code></p></li></ul>
<p>That shape was fine when the project was small. It quietly stopped being fine the moment cupertino became a genuine multi-source tool, and the symptoms were everywhere if you knew to look. A platform filter honored in one source and silently dropped in another. A doctor probe pointed at a database filename that a per-source build no longer produced. A release script that knew the names of its databases by heart.</p>
<p>Those were not five unrelated bugs. They were one disease with five rashes. Source identity was scattered across CLI switches, MCP handlers, setup checks, release manifests, and tests, each carrying its own hand-copied list of names. Change the world in one place and the other four kept believing the old map.</p>
<p>The cure was already half-built. The Source Independence Day effort had been pushing toward a single source of truth in code: a registry every part of the system reads from, so adding a content source becomes one composition-root change instead of a scavenger hunt. The code was moving that way. The shipped artifact was not. The bundle users actually installed still wore the old three-bucket shape.</p>
<p>So v1.3.0 became the release that drags the artifact up to meet the architecture.</p>
<p>Not because retiring a database filename is exciting. It is not. Nobody installs cupertino to admire the shape of its SQLite files. It matters because that old shape was a tax. Every new source paid it. Every cross-source feature paid it. v1.3.0 is the refactor that stops collecting it.</p>
<h2>One registry, eight databases</h2>
<p>In v1.3.0 a source is no longer a string in a <code>source</code> column.</p>
<p>It is a registered provider that declares everything about itself: where its data lives, how it fetches, how it reads, how it searches, which metadata it carries, and which filters it can honestly apply. One registry holds them all, and the rest of the system asks the registry instead of remembering.</p>
<p>The release bundle now matches that model exactly. Instead of one giant docs database plus two siblings, v1.3.0 ships eight per-source databases:</p>
<ul><li><p><code>apple-documentation.db</code></p></li><li><p><code>hig.db</code></p></li><li><p><code>apple-archive.db</code></p></li><li><p><code>swift-evolution.db</code></p></li><li><p><code>swift-org.db</code></p></li><li><p><code>swift-book.db</code></p></li><li><p><code>apple-sample-code.db</code></p></li><li><p><code>packages.db</code></p></li></ul>
<p><code>cupertino setup</code> downloads <code>cupertino-databases-v1.3.0.zip</code>, a 742 MB bundle that expands to about 3.9 GB. Most of that is one file: <code>apple-documentation.db</code> weighs 2.6 GB and holds 351,505 documents and 240,543 symbols across 398 frameworks. Next is <code>packages.db</code> at 1.0 GB with 185 packages. The HIG, archive, Swift Evolution, swift.org, and Swift book databases are the small ones, a few megabytes each.</p>
<p>The split is not cosmetic. It changes what can go wrong independently. If the HIG corpus is stale, the HIG database is stale and Apple API search is not dragged down with it. If packages need a schema bump, packages get one without reindexing everything else. And when a new source lands, the release tool derives its database straight from the registry. No human goes hunting for the one more filename list that forgot to grow.</p>
<p>Users never see any of this. The fan-out search surface stays exactly as simple as it was. Underneath, SmartQuery dispatches across the independent source databases and fuses the results with reciprocal rank fusion, so one source can degrade without taking the whole query down with it. That is the trade the refactor buys: invisible to the person typing a query, decisive for the person adding the next source.</p>
<h2>The old public shape had to break</h2>
<p>Some flags described a world that no longer exists, so they had to go.</p>
<p>The legacy <code>--search-db</code> override is gone from all six commands that carried it: <code>search</code>, <code>read</code>, <code>save</code>, <code>doctor</code>, <code>list-frameworks</code>, and <code>inheritance</code>. It made sense when there was one docs database to point at. It is meaningless when every source resolves through the registry to its own file, and keeping it around would only preserve the wrong mental model. Scripts that still pass <code>--search-db</code> now get a clear error instead of a silent misread.</p>
<p>The same honesty went inward. Roughly 230 <code>searchDB</code> and <code>searchDb</code> identifiers across the CLI, services, indexer, and search layers became the generic <code>dbURL</code> and <code>dbPath</code>, because there is no longer a single “the db” to name. The release tool stopped bundling a hardcoded trio of filenames and now asks the production registry for every enabled source’s destination database. And <code>databaseVersion</code> moved to <code>1.3.0</code>, so a v1.3.0 binary pulls the per-source bundle while a v1.2.x binary keeps pulling the old unified one. Upgrades and downgrades both land on a bundle they understand.</p>
<p>The one place the literal <code>search.db</code> name survives is the upgrade shim, which has to recognize a real pre-v1.3.0 file by its old name in order to migrate it. Everywhere else, the old name is finally just history.</p>
<h2>Then SQLite made the refactor earn it</h2>
<p>Splitting the bundle uncovered a second bug, the kind that only appears once you change how the file is born.</p>
<p>The indexers build databases in WAL mode, which is great for local write workloads and awkward for a static read-only artifact. A freshly extracted WAL database usually arrives with no <code>-shm</code> sidecar, and a plain <code>SQLITE_OPEN_READONLY</code> cannot open it without conjuring that shared-memory state first. So a shipped database could be byte-for-byte intact, pass an integrity check, and still refuse to open on a clean install.</p>
<p><code>packages.db</code> made it impossible to ignore. On a fresh setup, package search would report the database as unopenable while the file sat right there, perfectly valid.</p>
<p>v1.3.0 fixes the artifact instead of teaching every reader a workaround. The release tool converts each bundled database to rollback journal mode before zipping, and rollback-mode databases open read-only with no <code>-shm</code> or <code>-wal</code> sidecar required. Then every query, read, and serve path opens through one shared helper, <code>SQLiteSupport.openReadOnly(at:)</code>, using <code>SQLITE_OPEN_READONLY</code>. <code>SELECT</code> works. <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, and any DDL fail with <code>SQLITE_READONLY</code>. The indexer and the setup migrator are the only writers; ordinary search and MCP reads physically cannot mutate the cache they read from.</p>
<p>That is the invariant I want under a local documentation tool. The thing you query is the thing you shipped, and nothing in the read path can quietly rewrite it.</p>
<h2>I did not trust any of this without batteries</h2>
<p>The frightening part of a refactor this wide is never the code you remember touching. It is the assumption asleep in a path you forgot existed.</p>
<p>So v1.3.0 leans on tests that behave more like release audits than unit checks.</p>
<p><code>DatabaseBundleManifestTests</code> proves the bundle is derived from the production registry and excludes the retired <code>search.db</code>. <code>searchDBFlagRejectedEverywhere</code> proves the removed flag errors on every one of the six commands that used to take it. <code>ConvertToRollbackJournalTests</code> reproduces the WAL no-sidecar failure, then proves rollback conversion cures it. <code>SQLiteSupportReadOnlyTests</code> proves the shared helper can read and cannot write. <code>Issue1190PackageQueryReadOnlyOpenTests</code> proves a shipped rollback-mode <code>packages.db</code> answers a query the instant setup finishes.</p>
<p>Then come the snapshot batteries, which run the real CLI against the real shipped databases.</p>
<p><code>ReadOnlyReadBatteryTests</code> drives the actual binary across all eight databases through the read-only path, searching every source and then performing at least twenty reads from each. The assertions check shape, not whether the output was simply long enough to look alive.</p>
<p><code>ExhaustiveEnrichmentBatteryTests</code> covers all 24 enrichments from the project’s enrichment inventory. Sixteen of them are proven end to end through the real CLI: lexical search, AST symbols, generic constraints, framework aliasing, conformances, inheritance, rank fusion, exact-title reranking, deployment floors for every <code>--min</code> platform, structured reads, and code examples. The other eight are internal columns the CLI never surfaces, so they are proven directly against the database with row-count probes rather than pretended through a command that cannot show them. The run writes the actual output into an HTML report, because a feature is not real until the artifact users install can demonstrate it.</p>
<p>That is the whole point of a battery. The local corpus is the product, so the product has to prove itself against the corpus, not against a mock that always agrees.</p>
<h2>One more footgun, while I was in there</h2>
<p>The refactor also exposed a package-fetch default that had quietly stopped making sense.</p>
<p>Before v1.3.0:</p>
<pre><code class="language-bash">cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>source packages</code></pre>
<p>refreshed Swift Package Index metadata and star counts for 10,995 packages and <em>then</em> downloaded the curated archive closure the indexer actually consumes. The metadata refresh can take around four hours without a <code>GITHUB_TOKEN</code>. The archive stage took about 97 seconds for the 185-archive closure on a clean base. The four-hour stage was not the one doing the load-bearing work.</p>
<p>So the default flipped. Now <code>cupertino fetch --source packages</code> just downloads the archives. If you want the metadata refresh, you ask for it:</p>
<pre><code class="language-bash">cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>source packages <span class="tok-operator">-</span><span class="tok-operator">-</span>refresh<span class="tok-operator">-</span>metadata</code></pre>
<p>The old <code>--skip-metadata</code> flag is gone, because skipping metadata is no longer the exception. It is the default.</p>
<h2>The boundary work continues</h2>
<p>v1.3.0 also documents three public Swift packages factored out of cupertino: <code>SwiftMCPCore</code>, <code>SwiftMCPClient</code>, and <code>CupertinoDataKit</code>.</p>
<p><code>CupertinoDataKit</code> is the one that belongs to this release’s theme. It is the public read contract: the documentation and sample-code read protocols plus the value types they return. cupertino re-exports it through <code>SearchModels</code>, so the in-repo names stay put while the boundary becomes something real and external rather than implied.</p>
<p>It is the same move as the database split, applied to code instead of files. Name the boundary out loud. Make the system derive from it. Stop asking every caller to carry the old map in its head.</p>
<h2>Upgrade</h2>
<pre><code class="language-bash">brew upgrade cupertino
cupertino setup</code></pre>
<p><code>setup</code> pulls the v1.3.0 per-source bundle. After that, search, read, and MCP serve all open the shipped databases read-only.</p>
<p>Here is the short version. Source independence has always been a code goal, and it is still a work in progress there. v1.3.0 is the release where it stops being only a code goal and starts being true of the artifact you actually install: eight databases, one registry, nothing in the read path that can rewrite them, and no unified <code>search.db</code> left to leak the old shape back in.</p>
<p>And the ninth database, whenever a new source earns one, is now a registry entry away instead of a refactor. That door is open now. I will walk through it soon.</p>
<p>That is why this one is The Big Refactor.</p>]]></content:encoded>
</item>
<item>
<title>cupertino v1.2.0: lands the right Apple doc 9 times in 10</title>
<link>https://aleahim.com/blog/cupertino-v1-2-0-ironclad/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-2-0-ironclad/</guid>
<pubDate>Thu, 21 May 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Search-quality release. AI coding assistants now land the right Apple documentation page on the first try 9 times out of 10, up from 5 out of 10 in v1.1.0. Cross-validated on three independent corpora; see the correction below. The architecture, and what it still gets wrong, in writing.</description>
<content:encoded><![CDATA[<h1>cupertino v1.2.0: lands the right Apple doc 9 times in 10</h1>
<p><em>Released 2026-05-21.</em></p>
<blockquote><p><strong>Correction, November 14, 2026.</strong> While rebuilding the measurement tool, I recomputed every figure in this post from the audit files. Three statements here were wrong, and one needs a caveat.</p>
<ul><li><p><strong>“Zero regressions” is wrong.</strong> On the second set of 30 queries, the page for <code>Continuation</code> was first in v1.1.0 and is not first in v1.2.0. Across all three sets, three queries rank lower in v1.2.0 (CoreData, Iterator, Continuation). The 31 queries that improved still stand.</p></li><li><p><strong>The second set’s v1.1.0 figure is 21 of 30, not 19 of 30.</strong> The table below has been corrected. The v1.2.0 figure, 28 of 30, was right.</p></li><li><p><strong>The p-values were approximations.</strong> The tool used a normal approximation without a correction for ties. The exact one-sided values are 0.000001 for the 50-query set and 0.011719 for the second set. No conclusion at the 0.05 level changes. The McNemar figure quoted here, p ≤ 1e-5 on the largest set, holds (the exact value is 0.000002).</p></li><li><p><strong>Caveat on “NDCG”.</strong> Where the audit files print NDCG@10 above 1, that number was an unnormalised DCG. This post does not quote it.</p></li></ul>
<p>The headline is unchanged: on 50 canonical queries the right page was first 26 times in v1.1.0 (52%) and 46 times in v1.2.0 (92%). I should have caught these before publishing. Every figure above comes from rerunning the published audits through the new tool, and where an audit did not keep a number I say so instead of guessing.</p></blockquote>
<h2>What you actually get</h2>
<p>If you’ve ever asked an AI coding assistant about a Swift API and watched it confidently invent a method that doesn’t exist (or point you at a deprecated 2017 version), cupertino is what I built for that.</p>
<p>This release: AI assistants using cupertino now land the right Apple documentation page on the first try <strong>9 times out of 10</strong>. Was 5 out of 10 in v1.1.0.</p>
<p>A few concrete cases:</p>
<ul><li><p>Ask about <code>URLSession</code> async/await, get the modern API. Not the completion-handler page from 2017.</p></li><li><p>Ask “what replaced <code>NSURLConnection</code>”, go straight to <code>URLSession</code>.</p></li><li><p>Ask about <code>@Observable</code>, don’t get it fused with the older <code>ObservableObject</code>.</p></li><li><p>Compare Combine and AsyncSequence, get both pages, not a hallucinated synthesis.</p></li></ul>
<p>352,712 indexed Apple documentation pages, zero garbage rows on the merged corpus. Runs locally, no cloud, no subscription, free and open source.</p>
<p>Upgrade is one command:</p>
<pre><code class="language-bash">brew upgrade cupertino <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> cupertino setup</code></pre>
<p>The rest of this post is for the technically curious.</p>
<h2>The measurement</h2>
<p>Rank-1 accuracy on a 50-query canonical-lookup corpus (Swift stdlib types, Foundation, SwiftUI, UIKit, AppKit, Combine, framework roots) went from <strong>52% in v1.1.0</strong> to <strong>92% in v1.2.0</strong>. Cross-validated on two more corpora, 31 queries improved and three ranked lower across 110 paired queries, statistically significant at McNemar p ≤ 1e-5 on the largest corpus.</p>
<table><thead><tr><th>Corpus</th><th style="text-align:right">v1.1.0</th><th style="text-align:right">v1.2.0</th></tr></thead><tbody><tr><td>Canonical lookup (50 queries)</td><td style="text-align:right">26/50 rank-1</td><td style="text-align:right">46/50 rank-1</td></tr><tr><td>Canonical lookup V2 (30 queries, no overlap with the first set)</td><td style="text-align:right">21/30 rank-1</td><td style="text-align:right">28/30 rank-1</td></tr><tr><td>Deprecation pairs (30 modern/legacy triples like <code>URLSession</code> vs <code>NSURLConnection</code>)</td><td style="text-align:right">27/30 prefers modern</td><td style="text-align:right">30/30 prefers modern</td></tr></tbody></table>
<p>Three independent samples, same direction, similar effect size. Not a fluke.</p>
<p>Methodology lives at <code>docs/design/search-quality-eval.md</code>; per-query rank movements live in <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/audits">docs/audits</a>. If a number is wrong in public, an audit markdown is wrong first.</p>
<h2>How it works</h2>
<p>cupertino is the retrieval layer of RAG, nothing else. The AI agent does the generation; cupertino just returns the right Apple page when one is asked for.</p>
<p>The substrate is SQLite FTS5 with field-weighted BM25, populated by an AST extraction pass at index time that pulls symbol signatures, generic constraints, platform availability, and deprecation markers into queryable columns. No embeddings, no vector database, no reranker.</p>
<p>Anthropic’s published RAG recipe (<a href="https://www.anthropic.com/research/contextual-retrieval">Contextual Retrieval</a>, September 2024) keeps a BM25 stage alongside the dense one as the non-optional floor. cupertino takes that floor and runs it without the rest, on a corpus class where that’s enough: identifier-heavy, terminology-precise, Apple API docs.</p>
<h2>What it still gets wrong</h2>
<table><thead><tr><th>Query class</th><th style="text-align:right">Rank-1</th><th>Status</th></tr></thead><tbody><tr><td>Prose / conceptual (“what’s the deal with…”)</td><td style="text-align:right">~27%</td><td>Open: candidate fix in design</td></tr><tr><td>Acronym / synonym (“KVO”, “GCD”, “CALayer”)</td><td style="text-align:right">~18%</td><td>Open: needs a new index pass</td></tr><tr><td>Querying by structural attribute (<code>actor type</code>, <code>initializer</code>, <code>Hashable conformance</code>)</td><td style="text-align:right">P@5 ~0.25</td><td>Open: search path doesn’t consult the symbol metadata table</td></tr></tbody></table>
<p>These were weak in v1.1.0 too. The next release is meant to move them. If it does, the live page will say so. If it doesn’t, the same page will say that, in the same row, without anyone editing copy.</p>
<p>This is not a feature roadmap. It is a list of things the tool does badly, published next to the things it does well.</p>
<h2>Upgrade</h2>
<pre><code class="language-bash">brew upgrade cupertino
cupertino setup</code></pre>
<p><code>cupertino setup</code> pulls the v1.2.0 database bundle from GitHub. If you had v1.1.0 installed locally, the migrator handles the schema bumps idempotently.</p>
<hr>
<p><em>Full release write-up: <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/release-writeup-v1.2.0.md">docs/release-writeup-v1.2.0.md</a>. Source for every measurement: <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/audits">docs/audits/</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v1.1.0: my Apple docs index was 30% lies and I didn&apos;t know</title>
<link>https://aleahim.com/blog/cupertino-v1-1-0-poison-cleanup/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-1-0-poison-cleanup/</guid>
<pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>A 3 a.m. SQL query found one row of HTTP poison in the search index. Pulling on that thread unraveled 13 ways Apple&apos;s CDN lies to crawlers, plus a release bug where the binary cheerfully downgraded every user to the previous bundle.</description>
<content:encoded><![CDATA[<h1>Cupertino v1.1.0: my Apple docs index was 30% lies and I didn’t know</h1>
<p><code>brew upgrade cupertino</code> this week and your local Apple docs database is 7,095 documents richer and zero rows are HTTP error pages pretending to be documentation. You will not notice. Searches feel the same. <code>cupertino doctor</code> was already green. The MCP server returns the same shape.</p>
<p>That gap, between “looks fine” and “actually fine”, is the whole post.</p>
<h2>TL;DR</h2>
<pre><code>brew update
brew upgrade cupertino
cupertino setup     # downloads cupertino-databases-v1.1.0.zip (685 MB)
cupertino doctor    # "Bundled version: 1.1.0", apple-docs: 284,518</code></pre>
<p>Done. The rest is how I found out the index was lying to me.</p>
<h2>The 3 a.m. query</h2>
<p>I was confident about v1.0.2. Audit clean. Bundle rebuilt. Counts verified. Shipped.</p>
<p>Then I ran one more query against the v1.0.2 <code>search.db</code>, the kind you only run when you can’t sleep:</p>
<pre><code class="language-sql"><span class="tok-keyword">SELECT</span> uri, title, abstract, source
<span class="tok-keyword">FROM</span> docs_metadata m <span class="tok-keyword">JOIN</span> docs_structured s <span class="tok-keyword">ON</span> s<span class="tok-operator">.</span>uri <span class="tok-operator">=</span> m<span class="tok-operator">.</span>uri
<span class="tok-keyword">WHERE</span> s<span class="tok-operator">.</span>title <span class="tok-keyword">IN</span> (<span class="tok-string">'Forbidden'</span>, <span class="tok-string">'403 Forbidden'</span>, <span class="tok-string">'404 Not Found'</span>,
                  <span class="tok-string">'Bad Gateway'</span>, <span class="tok-string">'502 Bad Gateway'</span>);</code></pre>
<p>One row came back.</p>
<pre><code>uri:      swift-org://docc_documentation
title:    Forbidden
abstract: You don't have permission to access this resource.
source:   swift-org</code></pre>
<p>That is not Apple’s DocC documentation. That is an HTTP 403 page indexed as canonical content for the DocC URL. Anyone querying cupertino for DocC would get a result with a correct URL, a plausible title, and a body of pure garbage. The worst kind of indexing bug: silent and authoritative.</p>
<p>The mistake was small and embarrassing. My poison scan walked <code>~/.cupertino/docs/</code>. The bundle is built from <strong>six</strong> sibling directories. I had been auditing one out of six.</p>
<pre><code>~/.cupertino/
  docs/             # 412k JSON files
  swift-evolution/  # 483 proposals
  swift-org/        # 196 pages    ← never scanned
  hig/              # 173 pages
  archive/          # 406 legacy guides
  packages/         # README files</code></pre>
<p>Sweeping the full tree turned up six poison files in <code>swift-org/</code>. Five of them had been shipping in every prior release. Nobody had noticed. But the six was the small problem. The big problem: my scanning was wrong, and I had no idea what else was hiding in 412,523 other files.</p>
<h2>The 13 ways Apple’s docs site poisons a crawler</h2>
<p>I rebuilt the audit as a matrix: every pattern, every source, every file. Each row below came from a real failure I had already hit. None of it is theoretical.</p>
<table><thead><tr><th>#</th><th>Pattern</th><th>What it actually is</th></tr></thead><tbody><tr><td>1</td><td>Title <code>403 Forbidden</code>, <code>502 Bad Gateway</code>, <code>404 Not Found</code>, <code>500</code>, <code>503</code>, <code>504</code>, <code>429</code></td><td>Apple’s CDN serves an HTTP error page at status 200, gets indexed as a doc page</td></tr><tr><td>2</td><td>Title bare phrase: <code>Forbidden</code>, <code>Bad Gateway</code></td><td>Same as 1 minus the status code</td></tr><tr><td>3</td><td>Body: <code>Please turn on JavaScript in your browser…</code></td><td>React SPA noscript fallback</td></tr><tr><td>4</td><td>Body: <code>[ Skip Navigation ](#app-main)# An unknown error occurred.</code></td><td>React app’s generic error sub-view rendered as the whole body</td></tr><tr><td>5</td><td>Body contains <code>openresty</code></td><td>Apple’s edge CDN error template</td></tr><tr><td>6</td><td>Body contains <code>&lt;center&gt;nginx</code></td><td>Different nginx error template</td></tr><tr><td>7</td><td>Body: <code>You don't have permission to access this resource</code></td><td>Forbidden as plain prose</td></tr><tr><td>8</td><td>Body: <code>cf-error-code</code> / <code>Cloudflare Ray ID</code></td><td>Cloudflare error page</td></tr><tr><td>9</td><td>Body: <code>Reference&amp;#32;&amp;#35;</code> / <code>Akamai</code> markers</td><td>Akamai edge error</td></tr><tr><td>10</td><td>Body: <code>&lt;Code&gt;NoSuchKey&lt;/Code&gt;</code> / <code>&lt;Code&gt;AccessDenied&lt;/Code&gt;</code></td><td>AWS S3 XML errors for missing assets</td></tr><tr><td>11</td><td>Zero-byte files</td><td>Truncated writes from killed crawls</td></tr><tr><td>12</td><td>Files under 200 bytes</td><td>Almost-empty responses</td></tr><tr><td>13</td><td><code>.json</code> files not starting with <code>{</code> or <code>[</code></td><td>Corrupt JSON, sometimes HTML in disguise</td></tr></tbody></table>
<p>Against every expectation, <code>docs/</code> scanned clean across all 13. Earlier passes had actually stuck. The poison was concentrated in the small directories I had been ignoring.</p>
<p>(Quick footnote, since it cost me an hour. Category 13 is a byte read on 412k files. My first pass shelled out <code>head -c 1</code> per file. Projected wall time: about five hours. Rewriting as a single Python <code>os.walk</code> that stats, opens, and reads one byte inside one process: 41 seconds. The per-file fork was the entire cost.)</p>
<h2>How Apple’s docs site actually poisons your index</h2>
<p>Three failure modes. In the order they fooled me.</p>
<p><strong>Mode 1: the CDN returns an HTML error page at status 200.</strong> Title is <code>403 Forbidden</code>. A five-line title check catches it. Done in PR #289 last release.</p>
<p><strong>Mode 2: the SPA shell.</strong> Apple’s docs site is a client-rendered React app. Fetch without JS and you get a <code>&lt;noscript&gt;</code> blurb that politely asks you to enable JavaScript. v1.0.2 had 1,327 of these. PR #291 filtered them at indexing time, but it was scoped to the apple-docs path, which is exactly why the <code>swift-org</code> <code>Forbidden</code> row strolled past.</p>
<p><strong>Mode 3: the one that ate my Tuesday.</strong> JavaScript runs. The React app boots. The React app’s data API returns 404 for the URL. The React app cheerfully renders its own 404 sub-view as the page body:</p>
<pre><code class="language-html"><span class="tok-operator">&lt;</span><span class="tok-keyword">h1</span><span class="tok-operator">&gt;</span>Apple Developer Documentation<span class="tok-operator">&lt;</span><span class="tok-operator">/</span><span class="tok-keyword">h1</span><span class="tok-operator">&gt;</span>
<span class="tok-operator">&lt;</span><span class="tok-keyword">a</span> <span class="tok-property">href</span><span class="tok-operator">=</span><span class="tok-string">"#app-main"</span><span class="tok-operator">&gt;</span>Skip Navigation<span class="tok-operator">&lt;</span><span class="tok-operator">/</span><span class="tok-keyword">a</span><span class="tok-operator">&gt;</span>
<span class="tok-operator">&lt;</span><span class="tok-keyword">h1</span><span class="tok-operator">&gt;</span>The page you're looking for can't be found.<span class="tok-operator">&lt;</span><span class="tok-operator">/</span><span class="tok-keyword">h1</span><span class="tok-operator">&gt;</span>
<span class="tok-operator">&lt;</span><span class="tok-keyword">input</span> <span class="tok-property">placeholder</span><span class="tok-operator">=</span><span class="tok-string">"Search developer.apple.com"</span><span class="tok-operator">&gt;</span></code></pre>
<p>Title is generic. Body is the app announcing its own failure. No error markers. Status 200. HTML perfectly clean. Every defense I had waved this through, because from the network’s point of view Apple successfully served me a page. The page just happens to be Apple’s React app politely informing the user that the page doesn’t exist.</p>
<h2>The fix that was missing</h2>
<p>PR #432 is small. A substring check on the rendered HTML, before the crawler writes anything:</p>
<pre><code class="language-swift"><span class="tok-keyword">public</span> <span class="tok-keyword">static</span> <span class="tok-keyword">func</span> <span class="tok-function">looksLikeJavaScriptFallback</span>(html<span class="tok-operator">:</span> <span class="tok-type">String</span>) <span class="tok-operator">-</span><span class="tok-operator">&gt;</span> <span class="tok-type">Bool</span> {
    <span class="tok-keyword">if</span> html<span class="tok-operator">.</span><span class="tok-function">contains</span>(<span class="tok-string">"The page you're looking for can't be found"</span>) { <span class="tok-keyword">return</span> <span class="tok-literal">true</span> }
    <span class="tok-keyword">if</span> html<span class="tok-operator">.</span><span class="tok-function">contains</span>(<span class="tok-string">"An unknown error occurred"</span>) { <span class="tok-keyword">return</span> <span class="tok-literal">true</span> }
    <span class="tok-keyword">return</span> <span class="tok-literal">false</span>
}</code></pre>
<p>Both phrases live exclusively inside Apple’s no-content sub-views. Real docs do not quote either sentence. The check runs after WebKit renders, so it sees the same bytes that would have hit disk. If it returns true, the crawler logs a skip and walks away.</p>
<p>Every skip writes one JSONL row to <code>&lt;output&gt;/.cupertino-rejected-urls.jsonl</code>:</p>
<pre><code class="language-json"><span class="tok-operator">{</span><span class="tok-property">"url"</span><span class="tok-operator">:</span><span class="tok-string">"https://developer.apple.com/documentation/.../fetch-apple"</span><span class="tok-operator">,</span>
 <span class="tok-property">"framework"</span><span class="tok-operator">:</span><span class="tok-string">"accountorganizationaldatasharing"</span><span class="tok-operator">,</span>
 <span class="tok-property">"reason"</span><span class="tok-operator">:</span><span class="tok-string">"js_fallback"</span><span class="tok-operator">,</span>
 <span class="tok-property">"timestamp"</span><span class="tok-operator">:</span><span class="tok-string">"2026-05-13T11:53:42Z"</span><span class="tok-operator">}</span></code></pre>
<p>This is the part I think generalizes. Once a poison file lands on disk, every downstream consumer has to re-discover that it’s poison. Catch it at write time and it is nobody’s problem ever again. The JSONL puts the visibility back: <code>jq</code> over it and you have a retry list, a recrawl set, or a bug-report folder.</p>
<p>Targeted recrawl of 51 known-poison URLs from v1.0.2: 48 rejection rows, all correctly tagged <code>js_fallback</code>, zero new files on disk. Pre-fix, the same set wrote 9 poison files in 90 seconds before I killed the run.</p>
<p>One false-positive risk worth naming. Two real Apple symbol pages quote “An unknown error occurred” in their Discussion section (<code>cfnetworkserviceerrorunknown</code>, <code>generalinternalretryableerror</code>). Both are already in the v1.1.0 bundle, but a future recrawl of those exact URLs would currently get rejected. Filed for v1.2: tighten the match so the phrase has to sit in a standalone position (h1, adjacent to Skip Navigation) rather than anywhere in the HTML.</p>
<h2>The reindex</h2>
<p><code>cupertino save --docs --clear</code> on the cleaned corpus:</p>
<pre><code>documents:           285,735       (84.7% of 351,249 source, rest deduped)
frameworks:          420
db size:             2.36 GB
defense trips:       0
errors:              0
warnings:            0
runtime:             9h 39m</code></pre>
<p>The line I care about is <code>defense trips: 0</code>. Across 351,249 indexer reads the indexer-side gate from PR #291 did not fire once. The test wasn’t whether the defense works. The test was whether anything was left for it to filter. Nothing was.</p>
<p>(The 65,514 gap between source files and indexed rows is real deduplication. Apple’s docs ship hash-suffixed variants of overloaded methods (<code>equatable_-3axv1_de895d6c.json</code>) that all point at the same logical URL.)</p>
<h2>The release saga, or: what <code>databaseVersion</code> actually does</h2>
<p>This is the part I’d flag to anyone shipping a similar tool.</p>
<p>v1.1.0 first shipped tagged correctly, binary rebuilt correctly, bundle uploaded to a parallel GitHub release. I ran <code>cupertino setup</code> to test the upgrade. It cheerfully downloaded the <strong>old</strong> v1.0.2 bundle.</p>
<p>The bug was one line in <code>Shared.Constants.swift</code>:</p>
<pre><code class="language-swift"><span class="tok-keyword">public</span> <span class="tok-keyword">static</span> <span class="tok-keyword">let</span> database<span class="tok-type">Version</span> <span class="tok-operator">=</span> <span class="tok-string">"1.0.2"</span></code></pre>
<p><code>cupertino setup</code> builds the download URL from this constant:</p>
<pre><code>{baseURL}/v{databaseVersion}/cupertino-databases-v{databaseVersion}.zip</code></pre>
<p>The release-tooling commit had explicitly not bumped it, with a confident note: “databaseVersion stays at 1.0.2 (no schema/content change).” Schema-wise that was true. Content-wise it was a confident lie. The corpus was the cleanest it had ever been, the bundle was genuinely new, and the binary was politely asking the CDN for last week’s poisoned one.</p>
<p>Fix: one-line change, fix branch, squash-merge, force-move the v1.1.0 tag to the new HEAD. <code>release.yml</code> rebuilds, codesigns, notarizes, and replaces the assets on tag push. Then a Homebrew bump for the new tarball SHA. About 25 minutes of clock time once I noticed. Approximately 25 minutes of dignity, also gone.</p>
<p><strong>The lesson:</strong> when the bundle changes, bump <code>databaseVersion</code>, even if the schema doesn’t. Otherwise your install path silently downgrades users to the previous bundle. No error. Doctor reports green. The binary asked for last week’s bundle, and last week’s bundle is exactly what it got.</p>
<h2>What I’d take with me</h2>
<p><strong>HTTP 200 doesn’t mean “valid content.”</strong> It means the CDN served some bytes. Documentation, error page, noscript fallback, React 404 sub-view: your problem to tell apart. Title checks miss two of three.</p>
<p><strong>Defense gates belong upstream.</strong> Catching poison at write time costs the same as catching it later, and prevents a class of bug instead of detecting one. Append an audit log so you keep the visibility.</p>
<p><strong>Bump <code>databaseVersion</code> when the bundle changes, even if the schema doesn’t.</strong> Then run <code>cupertino setup</code> end-to-end before the release is “shipped.” Trust the binary, not the release notes.</p>
<p>If you want to try it:</p>
<pre><code>brew tap cupertinohq/tap https://codeberg.org/CupertinoHQ/homebrew-tap.git
brew install cupertinohq/tap/cupertino    # or brew upgrade
cupertino setup
cupertino search "your favorite Apple symbol"</code></pre>
<p>Three defense PRs: #289, #291, #432. About 350 lines of Swift including tests. The cleanup itself was one long afternoon of careful greps.</p>]]></content:encoded>
</item>
<item>
<title>Cupertino v1.0.2: the duplicate that `LOWER(uri)` could not see</title>
<link>https://aleahim.com/blog/cupertino-v1-0-2/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-v1-0-2/</guid>
<pubDate>Mon, 11 May 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>A third of the search index was the same Apple page indexed twice. The verification query that &quot;proved&quot; it wasn&apos;t could not have seen the bug. What v1.0.2 ships, and three takeaways from the audit.</description>
<content:encoded><![CDATA[<h1>Cupertino v1.0.2: the duplicate that <code>LOWER(uri)</code> could not see</h1>
<p>A few weeks ago I shipped cupertino v1.0.1 and closed the bug that was supposed to make it impossible for the same Apple page to appear twice in the local search index. The release notes carried a confident sentence: <em>“verified that the shipped v1.0.0 search.db has zero case-axis duplicate pairs.”</em> The query that verified it returned empty across 405,782 rows. Done.</p>
<p>Today I shipped v1.0.2, which removes 128,142 of those rows. They were duplicates. They had been duplicates the whole time. The verification query was structurally incapable of seeing them.</p>
<p>Here is what happened, what v1.0.2 contains, and the three things I took away from the audit.</p>
<h2>What v1.0.2 ships</h2>
<p>Concrete numbers first.</p>
<table><thead><tr><th></th><th style="text-align:right">v1.0.0 / v1.0.1 bundle</th><th style="text-align:right">v1.0.2 bundle</th><th style="text-align:right">delta</th></tr></thead><tbody><tr><td><code>docs_metadata</code> rows</td><td style="text-align:right">405,782</td><td style="text-align:right">277,640</td><td style="text-align:right">−128,142 (−31.6 %)</td></tr><tr><td>Frameworks</td><td style="text-align:right">422</td><td style="text-align:right">402</td><td style="text-align:right">−20</td></tr><tr><td><code>search.db</code> size</td><td style="text-align:right">~3.2 GB</td><td style="text-align:right">~2.4 GB</td><td style="text-align:right">−0.8 GB (−25 %)</td></tr><tr><td>Case-axis duplicate clusters</td><td style="text-align:right">61,257</td><td style="text-align:right">0</td><td style="text-align:right">gone</td></tr></tbody></table>
<p>So a third of the database was the same Apple page indexed twice, once under <code>documentation/Swift/...</code> and once under <code>documentation/swift/...</code>, with slightly different URI hashes so the rows did not look identical to a casual audit.</p>
<p>The fix is one canonicalization call inside <code>URLUtilities.filename(_:)</code>. The bundle is a full reindex of 404,729 JSON pages, 12 hours 36 minutes wall-clock on an M4 Max. The schema version bumps from 12 to 13 so old databases get rejected at open with a “rebuild required” message that points at <code>cupertino setup</code>, which downloads the new clean bundle in seconds.</p>
<p>Two other things ride along in this release:</p>
<ul><li><p><strong>Post-redirect URL canonicalization</strong> (#277), contributed by <a href="https://github.com/Vignesh-Thangamariappan">@Vignesh-Thangamariappan</a> in PR #278. When Apple issues a 301/302 redirect (e.g. <code>professional_video_applications</code> to <code>professional-video-applications</code>), the crawler now files the page under the post-redirect URL instead of the request URL. Five regression tests plus an integration test against a mock redirect server. Thank you, Vignesh. This was a subtle bug to find and a careful PR to author.</p></li><li><p><strong>HTML link augmentation for sparse-references pages</strong> (#203, PR #281). The crawler now unions HTML <code>&lt;a href&gt;</code> links with DocC’s JSON references on pages where the JSON link count is below a configurable threshold. Catches operator overloads, legacy numeric-ID symbols, REST sub-paths, and the handful of frameworks Apple serves only as HTML.</p></li></ul>
<p>Earlier groundwork on <code>#200</code> (case-axis dedup at index time) came from <a href="https://github.com/imwyvern">@imwyvern</a>, who supplied the crawler queue dedup, the dedup helper, and the URI alignment in PR #201. v1.0.2 builds on that work; the change here is finding the layer it missed.</p>
<h2>The bug</h2>
<p>Apple serves the same documentation page under multiple URL casings. The reference graph inside Apple’s DocC JSON is sometimes <code>documentation/Swift/withTaskGroup(of:returning:isolation:body:)</code> and sometimes the all-lowercase variant. Cupertino treats both as crawl targets. Pre-#283, the indexer would also treat them as separate pages, producing two rows in <code>docs_metadata</code>, two rows in <code>docs_fts</code>, two answers in the search results.</p>
<p>Wesley’s PR #201 in v1.0.1 fixed <code>URLUtilities.normalize(_:)</code> to lowercase the path, which was supposed to collapse these at queue time. It did, partially. There was a layer below the queue that #201 did not cover.</p>
<p><code>URLUtilities.filename(from:)</code> is the function that turns a URL into an on-disk filename and, by extension, into the URI key used in <code>docs_metadata</code>. For URLs containing parens or colons (so, any Swift method signature with named parameters), it appends an 8-hex disambiguator hash. That hash was computed from the <em>raw</em> URL string, before the function’s internal lowercasing. So the same Apple page, fetched from two case-variant URLs, produced two different hash suffixes:</p>
<pre><code>documentation/Swift/withTaskGroup(of:returning:isolation:body:)
  -&gt; documentation_swift_withtaskgroup_of_returning_isolation_body_b9f71892

documentation/swift/withtaskgroup(of:returning:isolation:body:)
  -&gt; documentation_swift_withtaskgroup_of_returning_isolation_body_969a5400</code></pre>
<p>Different filename, different URI, two rows in the database, two cards in your search results.</p>
<h2>The verification trap</h2>
<p>This is the part that bothers me.</p>
<p>The v1.0.1 closure of #200 was not careless. It included a verification query, run against the actual shipped DB, with the explicit goal of confirming the bug was gone:</p>
<pre><code class="language-sql"><span class="tok-keyword">SELECT</span> <span class="tok-function">LOWER</span>(uri), <span class="tok-function">COUNT</span>(<span class="tok-operator">*</span>)
  <span class="tok-keyword">FROM</span> docs_metadata
  <span class="tok-keyword">GROUP</span> <span class="tok-keyword">BY</span> <span class="tok-function">LOWER</span>(uri)
  <span class="tok-keyword">HAVING</span> <span class="tok-function">COUNT</span>(<span class="tok-operator">*</span>) <span class="tok-operator">&gt;</span> <span class="tok-number">1</span>;
<span class="tok-comment">-- (returned empty across 405,782 rows)</span></code></pre>
<p>Empty result, ship it. Felt rigorous. Was wrong.</p>
<p>The query is structurally incapable of finding the bug. The URIs in <code>docs_metadata</code> carry an 8-hex suffix that varies per source URL, so the case-variant pair <code>documentation_swift_withtaskgroup_..._b9f71892</code> and <code>documentation_swift_withtaskgroup_..._969a5400</code> lowercase to two <em>different</em> strings. <code>GROUP BY LOWER(uri)</code> cannot collapse them. It returns empty. It will always return empty no matter how broken the dedup is, because the column itself is wrong for the question.</p>
<p>The correct query is on <code>docs_structured.url</code>, which preserves the original Apple URL with its original casing:</p>
<pre><code class="language-sql"><span class="tok-keyword">SELECT</span> <span class="tok-string">'clusters'</span>, <span class="tok-function">COUNT</span>(<span class="tok-operator">*</span>) <span class="tok-keyword">FROM</span> (
  <span class="tok-keyword">SELECT</span> <span class="tok-function">LOWER</span>(url) <span class="tok-keyword">FROM</span> docs_structured
    <span class="tok-keyword">GROUP</span> <span class="tok-keyword">BY</span> <span class="tok-function">LOWER</span>(url) <span class="tok-keyword">HAVING</span> <span class="tok-function">COUNT</span>(<span class="tok-operator">*</span>) <span class="tok-operator">&gt;</span> <span class="tok-number">1</span>
);
<span class="tok-comment">-- clusters | 61257</span></code></pre>
<p>Two columns, two completely different stories. One verification you would write because the index key obviously <em>is</em> the URI. One verification you would write because that is the column a human would look at to spot the duplicate.</p>
<p>This generalizes. The verification query for a data correctness fix has to come from the column where the bug would <em>show up to a reader</em>, not the column the data is <em>keyed by</em>. They look interchangeable until you realize that the key has been transformed by code that may itself be where the bug lives. If you verify in the transformed space, you verify against the same transformation that may be broken.</p>
<p>A simpler version of the same lesson: ask yourself which column a customer would email you about, not which column the code uses as its primary key.</p>
<h2>What I learned</h2>
<p>Three takeaways, in order of how much they cost me.</p>
<h3>1. “Already fixed in vN” claims with a clean test are very compelling and very capable of being wrong.</h3>
<p>I do not think Wesley or I were reckless. The #200 fix was real and good. The verification query passed. The release notes were faithful to what the query said. Everyone behaved sensibly. The query was still the wrong query.</p>
<p>What I want to internalize: in any audit that asserts “we checked the data and it’s clean”, the question is not just “what did the query return”, but “if the bug were present, would this exact query show it”. For data bugs, that means: which column does the bug live in, and is that the column the verifier looked at.</p>
<p>For this PR, I added a docs entry that explicitly names the wrong query and the right query, side by side, as a permanent footnote. Anyone reading the v1.0.0 release notes in five years can follow the link to see why the empty result was misleading.</p>
<h3>2. The migration you built and then deleted is still good engineering.</h3>
<p>I spent a real amount of time on an in-place v12 to v13 migration. The plan was: walk <code>docs_metadata</code>, recompute each URI through the post-#283 helper, group by canonical URI, pick the survivor by latest <code>last_crawled</code>, delete losers, rename survivors across <code>docs_metadata</code> + <code>docs_structured</code> + <code>docs_fts</code> + <code>doc_symbols</code> + <code>doc_imports</code> + <code>doc_code_examples</code>, all in one transaction with FK off. 270 lines of code, nine unit tests, three integration tests against a v12 fixture DB. The unit tests passed. The integration test passed on a 10-row fixture in milliseconds.</p>
<p>Then I ran it against my real 405k-row search.db. First attempt: over an hour, never committed, journal at 314 MB, killed it. Second attempt with prepared-statement reuse: marginally faster, journal at 415 MB at the 1h mark, killed it. Third attempt with <code>PRAGMA journal_mode = MEMORY</code> plus <code>synchronous = OFF</code>: another hour, never observably finished.</p>
<p>Meanwhile, <code>cupertino setup</code> downloads the pre-built v1.0.2 bundle in about thirty seconds. That is the path. Always was. The architecture already had the answer; the migration was solving a problem that did not need to be solved.</p>
<p>I deleted the migration before the tag. All 270 lines, all twelve tests. The CHANGELOG notes the draft existed and was removed, because that fact matters for anyone wondering why the codebase has a v12-to-v13 throw block but no migration body to call. The bug fix lives entirely in <code>URLUtilities.filename(_:)</code>. The data fix lives entirely in the new bundle. The schema bump is a one-line <code>Int32</code> that forces the upgrade path.</p>
<p>What I learned: write the migration code if you have to think through the algorithm, but ship the path that the architecture wants you to ship. The investment was not wasted. It was the thing that forced me to fully understand what the dedup boundary actually looks like across all six tables that hold URIs.</p>
<h3>3. Reindexing 404,729 pages costs you an evening of wall-clock and removes one third of your data.</h3>
<p>The bundle reindex took 12 hours 36 minutes on an M4 Max. I watched a stale-build SwiftPM lock kill three attempts before the fourth one ran clean. I babysat the cupertino-rel binary signing through Apple’s notarization queue. I watched the search.db file grow from 425 MB to 2.41 GB in 27-second progress increments, all night.</p>
<p>The first time I ran <code>cupertino search "withTaskGroup"</code> against the new bundle it returned a single result, lowercase, canonical. The same query against the v1.0.1 bundle returns two: one capital S, one lowercase. That moment is worth twelve hours.</p>
<h2>What also changed in the cupertino skill</h2>
<p>The cupertino skill (the bundle of instructions that ships in <code>skills/cupertino/SKILL.md</code> for LLMs that integrate with cupertino) got a “Two rules” block at the top of its body. The previous version had query strategy + verification guidance scattered throughout. The new version makes the two things that matter the first thing the calling model sees:</p>
<ol><li><p>Any Apple-related question goes through <code>cupertino search</code> first. Do not reach for training-data memory of Apple APIs.</p></li><li><p>After drafting an answer, verify that the code exists on Apple <strong>and</strong> that the pattern is appropriate. Existence catches invented method names. Appropriateness catches deprecated symbols that cupertino indexes alongside current ones (e.g. <code>UIWebView</code> when <code>WKWebView</code> exists).</p></li></ol>
<p>The token cost of doing this is small (about 5 % overhead for cite-as-you-go, a few hundred tokens per verification re-search) and the failure mode it prevents is the most common LLM Apple-API hallucination class.</p>
<h2>Upgrade</h2>
<p>If you already have cupertino installed:</p>
<pre><code class="language-bash">brew update <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> brew upgrade cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup</code></pre>
<p>The first command pulls the new universal binary (signed and notarized via the GitHub Actions release workflow). The second downloads the new database bundle (669 MB compressed, 3.3 GB on disk). Your old v12 search.db will be rejected at open with a “rebuild required” message and replaced.</p>
<p>If you are installing for the first time:</p>
<pre><code class="language-bash">bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<h2>Thanks</h2>
<p>To <a href="https://github.com/Vignesh-Thangamariappan">@Vignesh-Thangamariappan</a> for PR #278 (post-redirect canonicalization, #277). To <a href="https://github.com/imwyvern">@imwyvern</a> for the upstream #200 work that v1.0.2 builds on. To everyone who filed issues against the v1.0.0 corpus and made #283 surface in the first place.</p>
<p>Cupertino is free, open-source, local-first, and built by one person on her own time.</p>
<p><em>Built by <a href="https://aleahim.com">Mihaela</a>. I also work on <a href="https://codeweaver.info/">Codeweaver</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v1.0.0 &quot;First Light&quot;</title>
<link>https://aleahim.com/blog/cupertino-first-light/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-first-light/</guid>
<pubDate>Tue, 05 May 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>First release stable across crawl, index, rank, serve, and distribute. Search that finally returns the right answer, one bundle, MCP spec 2025-11-25.</description>
<content:encoded><![CDATA[<h1>Cupertino v1.0.0 “First Light”</h1>
<p><em>The first release I’d actually call stable. Apple’s documentation, search that doesn’t suck, and an MCP server that an AI agent can read from before it answers.</em></p>
<hr>
<p>If you’ve ever asked an LLM “what does Swift’s <code>Task</code> do?” and got back something about Mach kernel context switches, you’ve met the problem cupertino solves. Models hallucinate Apple APIs because their training data is stale, partial, and weighted toward whatever prose happened to mention a symbol — not toward Apple’s actual documentation. The fix isn’t a bigger model. The fix is making the documentation <strong>available to the model</strong> at inference time, ranked correctly, served over a protocol the model already speaks.</p>
<p>That’s cupertino. <strong>v1.0.0 “First Light”</strong> is the first release I’m willing to call stable across the whole pipeline: crawl, index, rank, serve, distribute. Before today every previous release had at least one of those broken. Today none of them are.</p>
<h2>The headline: search now returns the right answer</h2>
<p>Run this against an installed v1.0:</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino search Task <span class="tok-operator">-</span><span class="tok-operator">-</span>limit <span class="tok-number">3</span>
Searched<span class="tok-operator">:</span> packages, apple<span class="tok-operator">-</span>docs, swift<span class="tok-operator">-</span>evolution

[<span class="tok-number">1</span>] Task <span class="tok-operator">|</span> Apple Developer Documentation  •  source<span class="tok-operator">:</span> apple<span class="tok-operator">-</span>docs  •  score<span class="tok-operator">:</span> <span class="tok-number">0.0492</span>
    apple<span class="tok-operator">-</span>docs<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>swift<span class="tok-operator">/</span>documentation_swift_task
    A unit of asynchronous work<span class="tok-operator">.</span>

[<span class="tok-number">2</span>] task <span class="tok-operator">|</span> Apple Developer Documentation  •  source<span class="tok-operator">:</span> apple<span class="tok-operator">-</span>docs  •  score<span class="tok-operator">:</span> <span class="tok-number">0.0484</span>
    apple<span class="tok-operator">-</span>docs<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>kernel<span class="tok-operator">/</span>documentation_kernel_kernel_resource_sizes_data_t_<span class="tok-number">1586795</span><span class="tok-operator">-</span>task

[<span class="tok-number">3</span>] task  •  source<span class="tok-operator">:</span> apple<span class="tok-operator">-</span>docs  •  score<span class="tok-operator">:</span> <span class="tok-number">0.0476</span>
    apple<span class="tok-operator">-</span>docs<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>foundation<span class="tok-operator">/</span>documentation_foundation_urlprotocol_task</code></pre>
<p>That’s the canonical Swift <code>Task</code> struct at #1, where it belongs. The same binary against the same database before today’s changes returned a Mach kernel C function as the top result. Cupertino’s pre-1.0 ranker — and frankly every documentation search I’ve seen, including Apple’s own — was wrong on common type names. Type “Task”, get a kernel essay. Type “View”, get a DeviceManagement payload schema. Type “Result”, get a Vision associated type.</p>
<p>Multiple compounding bugs caused this. Fixing them was most of what this release is about.</p>
<h3>Reciprocal rank fusion that actually understands the query</h3>
<p>Cupertino’s <code>cupertino search</code> (no <code>--source</code> flag) fans out across every available corpus in parallel — apple-docs, the Apple Archive, HIG, swift-evolution, swift.org, the Swift Book, the curated packages corpus, the Apple sample-code corpus — and fuses the per-source rankings via <strong>reciprocal rank fusion</strong> (Cormack/Clarke/Büttcher, 2009). The math is <code>1 / (k + rank)</code> per source, summed across sources. RRF is the right shape for prose-vague queries where any source might hold the answer (“how do I cancel an async operation”). It is the <em>wrong</em> shape for symbol queries where the answer is unambiguously in apple-docs.</p>
<p>The pre-1.0 default was uniform RRF. Every source’s rank-1 contributed <code>1/61 ≈ 0.0164</code>. Three sources tied at 0.0164 on a query like <code>Task</code>, the alphabetic tiebreak buried apple-docs, and you got “Common Tasks in OS X” from the Apple Archive instead of the Swift <code>Task</code> struct.</p>
<p>v1.0 splits the routing decision by query shape. <strong>Symbol-shaped queries</strong> — single token, ASCII identifier, leading uppercase, the kind of thing a Swift developer types on muscle memory — only fan out across <code>apple-docs + swift-evolution + packages</code>. The four prose-shaped sources don’t even participate in the fusion. Plus an authority weight on RRF: apple-docs gets <code>3.0</code>, swift-evolution and packages <code>1.5</code>, swift.org and the Swift Book <code>1.0</code>, the Apple Archive and HIG <code>0.5</code>. apple-docs’s rank-1 fuses to <code>3.0/61 ≈ 0.0492</code> and beats peer rank-1’s <code>1.0/61 ≈ 0.0164</code> without alphabetic tiebreaks deciding anything.</p>
<p>The <code>Searched:</code> line in the output above is the routing decision made visible. It listed only <code>packages, apple-docs, swift-evolution</code> because <code>Task</code> looks like a symbol. Type <code>cupertino search "swiftui state management"</code> and you’ll see <code>Searched: hig, samples, apple-docs, swift-evolution, packages</code> — five sources, broader fan-out, because the query is prose.</p>
<h3>Inside apple-docs: BM25F, AST symbols, and a ladder of post-rank heuristics</h3>
<p>Per-source ranking inside apple-docs is <strong>field-weighted BM25 (BM25F</strong>, Robertson/Zaragoza/Taylor 2004) over an 8-column FTS5 index — <code>uri</code>, <code>source</code>, <code>framework</code>, <code>language</code>, <code>title</code>, <code>content</code>, <code>summary</code>, <code>symbols</code>. Title gets weight 10×, AST-derived symbols 5×, summary 3×, framework 2×, body and metadata 1×. The <code>symbols</code> column is new in v1.0: it’s populated by a Swift AST extractor that runs over both code blocks AND declaration lines on every page. So a query like <code>Observable</code> ranks the SwiftUI macro page above prose mentions of the word “observable” in unrelated articles.</p>
<p>On top of raw BM25F, there’s a ladder of post-rank heuristics that handle pathological cases the indexer alone can’t fix:</p>
<ul><li><p><strong>Title-suffix awareness.</strong> Apple writes <code>&lt;canonical type name&gt; | Apple Developer Documentation</code> only on the parent landing page of a type. Sub-symbols (properties, methods, nested types) get clean titles. The suffixed page’s raw BM25 is <em>worse</em> because the suffix dilutes title term-frequency over field length, so a 50× boost is applied to suffixed exact-title matches, while clean-titled siblings keep the existing 20×. Flips canonical-vs-sub-symbol order without touching BM25F.</p></li><li><p><strong>Exact-title peer tiebreak.</strong> <code>Result</code> matches three apple-docs pages exactly: Swift’s <code>Result</code> enum, Vision’s <code>VisionRequest.Result</code> associated type, and Installer JS’s runtime <code>Result</code>. All three get the same 50×, so BM25F decides — and BM25F has no opinion. v1.0 adds two orthogonal signals: URI simplicity (<code>documentation_FRAMEWORK_QUERY</code> is the framework’s top-level type page; anything deeper is a sub-symbol) and a small framework-authority map (<code>swift</code> 0.5, <code>swiftui</code> 0.7, <code>foundation</code> 0.7; <code>installer_js</code> and <code>webkitjs</code> mildly demoted). Fires only inside the exact-title branch — does not crowd out framework-specific symbol queries (<code>VisionRequest</code> still resolves to <code>vision/VisionRequest</code>).</p></li><li><p><strong>Force-include canonical type pages past fetchLimit.</strong> Some canonical pages get buried by raw BM25 length-normalization — Foundation <code>URL</code> lands at raw BM25 position 1017, Swift <code>Identifiable</code> at 2577, Foundation <code>Data</code> past 3000 — well past the 1000-row over-fetch the post-rank multipliers operate on. v1.0 hand-fetches <code>apple-docs://FRAMEWORK/documentation_FRAMEWORK_QUERY</code> directly by URI for the top-tier frameworks (swift, swiftui, foundation) and force-prepends them. O(1) per probe via <code>docs_metadata</code>’s primary key.</p></li></ul>
<p>The combined effect: against the v1.0 corpus (405,782 documents across 422 frameworks), <strong>34 of 35 canonical type queries land their canonical apple-docs page at fused #1</strong>. The holdout, <code>Stack</code>, doesn’t have a canonical Swift / SwiftUI / Foundation type — TVML’s Stack is the right answer, and that’s what comes back.</p>
<h3>The packages corpus gets the same treatment</h3>
<p>Same BM25F-buries-the-canonical-repo problem on <code>package_files_fts</code>. Type <code>vapor middleware</code> and pre-1.0 you got <code>apple/swift-openapi-generator</code> because that repo has long prose mentioning Vapor and middleware in the same article; the actual <code>vapor/vapor</code> repo’s README ranked second. Type <code>swift testing</code> and you got <code>pointfreeco/swift-dependencies</code> because that package’s testing article has more keyword density than the actual <code>swiftlang/swift-testing</code> repo.</p>
<p>The fix mirrors the apple-docs canonical force-include. When the query tokens — joined with dashes for multi-word queries, or as single tokens for single-word queries — match an indexed <code>repo</code> name exactly, force-fetch that repo’s top BM25 file and prepend it. Two priority tiers: dashed forms (“swift-testing”) beat single tokens (“swift”) so a multi-word query that has a dashed canonical doesn’t <em>also</em> pull in the broader-corpus repo via the bare token. <code>swift testing</code> resolves to <code>swiftlang/swift-testing</code>, not <code>swiftlang/swift</code>. <code>vapor middleware</code> resolves to <code>vapor/vapor</code> because no <code>vapor-middleware</code> repo exists; the single-token fallback finds <code>vapor</code>.</p>
<p>The probe is bounded — it only fires when there’s an indexed canonical match, so queries that genuinely don’t have a canonical repo (<code>alamofire request</code> against a corpus where Alamofire isn’t indexed; <code>actor isolation</code> which isn’t a repo name at all) fall through to plain BM25 with no overhead.</p>
<h3>A SQL gotcha that cost us ~3 seconds per query</h3>
<p>While testing the canonical force-include, I shipped it with the wrong SQL shape:</p>
<pre><code class="language-sql"><span class="tok-keyword">SELECT</span> <span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span> <span class="tok-keyword">FROM</span> docs_fts f
<span class="tok-keyword">JOIN</span> docs_metadata m <span class="tok-keyword">ON</span> f<span class="tok-operator">.</span>uri <span class="tok-operator">=</span> m<span class="tok-operator">.</span>uri
<span class="tok-keyword">WHERE</span> f<span class="tok-operator">.</span>uri <span class="tok-operator">=</span> <span class="tok-operator">?</span>
<span class="tok-keyword">LIMIT</span> <span class="tok-number">1</span>;</code></pre>
<p><code>docs_fts</code> is an FTS5 virtual table. Its <code>uri</code> column is <em>not</em> a queryable index — FTS5 stores columns inside the inverted index, accessible only through <code>MATCH</code>. SQLite’s planner picked <code>SCAN VIRTUAL TABLE INDEX 0</code> and walked the entire FTS5 index for every probe. About <strong>3.2 seconds per probe</strong> on the 3.4 GB v1.0 search.db. Three probes per search call = 10 seconds of pure overhead before the actual query ran.</p>
<p>The fix is a one-line SQL rewrite — query <code>docs_metadata</code> (whose <code>uri</code> is <code>TEXT PRIMARY KEY</code>) directly, pull title and summary out of <code>json_data</code> via <code>json_extract($.title, $.abstract)</code>, never touch the FTS5 virtual table for this lookup. <strong>5 milliseconds per probe.</strong> Single-process search wall time on the 3.4 GB corpus dropped from ~18 seconds to ~4 seconds.</p>
<p>The same bug was lurking in the older <code>fetchFrameworkRoot</code> helper that’s been there since #81, untimed and presumably contributing to user-visible latency for months. Both are fixed in v1.0.</p>
<h3>Concurrent-search lock contention</h3>
<p>Every <code>Search.Index</code> initialization used to issue an unconditional <code>PRAGMA user_version = N</code> write — even when the version was already correct. SQLite is single-writer. Two parallel <code>cupertino search</code> invocations contended on the open-time write lock, and one would fail with <code>database is locked</code> because SQLite’s default <code>busy_timeout</code> is <code>0</code>.</p>
<p>Fixed two ways: read-then-write (skip the PRAGMA when the version already matches, so the steady-state path does zero writes), and <code>sqlite3_busy_timeout(db, 5000)</code> right after open so any future write contention degrades to a wait-then-succeed instead of an immediate failure. Cupertino’s MCP server can now handle concurrent requests against the same database without flaking.</p>
<h2>Distribution: one bundle, not two</h2>
<p>Pre-1.0 the deployment shape was: <code>search.db</code> and <code>samples.db</code> shipped on <code>mihaelamj/cupertino-docs</code>, while the curated <code>packages.db</code> was scoped for a separate <code>mihaelamj/cupertino-packages</code> companion repo. The split made sense when the packages corpus was a separate-cadence thing. It turned out it isn’t — the same crawl produces all three, on the same schedule, with the same release cycle. Two repos meant two release tags per cut, two sequential downloads on <code>cupertino setup</code>, soft-fail logic when one release lagged the other, and two URL constants in <code>Shared.Constants</code> to keep in sync.</p>
<p>v1.0 collapses everything to one bundle: <code>cupertino-databases-v1.0.0.zip</code> on <code>mihaelamj/cupertino-docs</code>, ~833 MB compressed, contains all three databases. <code>cupertino setup</code> does <strong>one</strong> download + extract + version stamp. The companion repo is deleted; deleting it was the last action before tagging.</p>
<p>The release tooling caught up too. <code>cupertino-rel databases</code> now bundles all three databases into the single zip and uploads to the docs repo. Hard-fails if <code>packages.db</code> is missing under <code>--base-dir</code> unless <code>--allow-missing-packages</code> is passed (lets a release runner publish a partial bundle in genuinely time-sensitive cases without making it the default).</p>
<h2>The schema bump (BREAKING)</h2>
<p>Schema went from 10 → 12 across two intermediate steps. v11 added <code>kind</code> and <code>symbols</code> columns to <code>docs_metadata</code>. v12 added the <code>symbols</code> column to <code>docs_fts</code>. FTS5 doesn’t support <code>ALTER TABLE ADD COLUMN</code>, so v12 is a hard break — existing v10/v11 databases throw on open with a clear error message:</p>
<pre><code>Database schema version 10 requires migration to version 12.
This is a breaking change that adds AST-derived symbols to the FTS index.
Please delete the database and run 'cupertino save' to rebuild:
rm ~/.cupertino/search.db &amp;&amp; cupertino save</code></pre>
<p>Most users won’t see this — they’ll just <code>cupertino setup</code> once and get the v1.0 bundle directly, with <code>setup</code> automatically backing up any pre-existing databases as <code>.backup-&lt;version&gt;-&lt;iso8601&gt;</code> siblings (<code>#249</code>) before extraction overwrites them. The rollback is one rename.</p>
<p>Users who built their own search.db with <code>cupertino save</code> against an older binary need to rebuild, but the docs corpus on disk is unchanged — the same <code>~/.cupertino/docs/</code> produces a v12 search.db without re-crawling.</p>
<h2>MCP protocol upgrade — 2025-11-25</h2>
<p>The Model Context Protocol moved to spec <code>2025-11-25</code>. Cupertino now negotiates that as its preferred version and retains backward-compat for <code>2025-06-18</code> and <code>2024-11-05</code> so older clients keep working through three negotiation hops. The new spec adds <code>Icon</code> to <code>Implementation</code>, so cupertino’s MCP <code>serve</code> advertises a 64×64 PNG via a <code>data:image/png;base64,...</code> URI (embedded as a Swift literal in the binary, no external bundle).</p>
<h2>Crawler hardening</h2>
<p>The crawler took a lot of fire across this release.</p>
<ul><li><p><strong>Per-URL JSON-then-WebView fallback.</strong> <code>cupertino fetch --type docs</code> does one pass through the queue, trying Apple’s JSON API first and falling back to WKWebView when a page has no JSON endpoint. Single-pass, full coverage. (The fallback was already there; the previous “two-pass” orchestration was running the same crawler twice and is now removed.)</p></li><li><p><strong>Auto-resume by default.</strong> If <code>metadata.json</code> has an active session matching the start URL, <code>cupertino fetch</code> picks it up. The previous <code>--resume</code> flag was a log-message switch and is gone.</p></li><li><p><strong>Crash-safe metadata writes.</strong> <code>JSONCoding.encode(_:to:)</code> writes with <code>.atomic</code> (temp + rename), so a kill mid-save can never leave <code>metadata.json</code> corrupt. Mid-save corruption was the one failure mode that could make a multi-day crawl unresumable.</p></li><li><p><strong>Default page cap raised 15,000 → 1,000,000.</strong> Effectively uncapped for full Apple-corpus crawls (~50–80k pages). The old 15k default would silently truncate at ~15–30% coverage.</p></li><li><p><strong>URL canonicalization (case axis).</strong> <code>URLUtilities.normalize</code> now lowercases the URL path. Apple’s docs server is case-insensitive, but the crawler used to treat <code>/documentation/Cinematic/CNAssetInfo</code> and <code>/documentation/cinematic/cnassetinfo</code> as different URLs. Queue inflated ~3× with case duplicates (62% of queue entries on the April 2026 crawl). Fragment + query stripping unchanged.</p></li><li><p><strong>Filename-length cap, queue dedup at enqueue time, autorelease pool around per-page work, full DocC <code>references</code> walk</strong> — the unglamorous fixes that let a multi-day crawl finish without RSS leaks, dropped pages, or queue explosion.</p></li></ul>
<p>A reproducible recrawl pipeline (<code>scripts/recrawl.sh</code>) wraps the whole thing in 10 phases with named markers so you can tail-follow the log and see “phase 5/10 starting” in real time.</p>
<h2>Architecture: the four-package CLI lift</h2>
<p>This is more for contributors than users, but worth flagging. Logic that powered four CLI commands — <code>setup</code>, <code>doctor</code>, <code>save</code>, <code>fetch</code> — moved out of <code>Sources/CLI/Commands/*</code> into four new SPM packages:</p>
<ul><li><p><strong><code>Distribution</code></strong> — the download + extract + version-stamp pipeline (<code>SetupService</code>, <code>ArtifactDownloader</code>, <code>ArtifactExtractor</code>, <code>InstalledVersion</code>).</p></li><li><p><strong><code>Diagnostics</code></strong> — pure-data probes for SQLite + filesystem corpus, used by <code>doctor</code>. Zero external deps.</p></li><li><p><strong><code>Indexer</code></strong> — write-side counterpart to <code>Search</code>. Three indexer services (<code>DocsService</code>, <code>PackagesService</code>, <code>SamplesService</code>) each emit per-stage events. Hosts the preflight pipeline for <code>cupertino save</code> + <code>doctor --save</code>.</p></li><li><p><strong><code>Ingest</code></strong> — package skeleton + <code>Session</code> helpers lifted from <code>FetchCommand</code>. The seven <code>&lt;Type&gt;Pipeline</code> services still live in CLI; lifting them is queued for v1.0.1.</p></li></ul>
<p>The point of the lift is that MCP tooling, future agent-shell adapters, and tests can now drive the pipelines without depending on <code>ArgumentParser</code>. CLI files become thin front-doors that parse flags and render progress.</p>
<h2>What “First Light” means</h2>
<p>The release name is from astronomy. First light is the first time a new telescope is pointed at the sky and an actual image comes back — not a calibration target, not a test pattern, but real data. Everything before is engineering. First light is when the instrument starts being a telescope.</p>
<p>That’s how this release feels. The previous twelve months were engineering — getting the crawler not to leak memory, getting the indexer to handle the field weights, getting the MCP server to negotiate protocols, getting the install to not strand users on stale databases. v1.0.0 is when those parts compose into something that does what it was built to do.</p>
<h2>Try it</h2>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup
cupertino search Task</code></pre>
<p><code>brew install</code> pulls a notarized universal binary (~13 MB). <code>cupertino setup</code> downloads the v1.0.0 database bundle (~833 MB compressed, ~5 GB extracted). <code>cupertino search Task</code> should land the canonical Swift <code>Task</code> struct as result #1.</p>
<p>If you want it as an MCP server for Claude / Cursor / VS Code Copilot / Zed / Windsurf / opencode / Codex, point your client config at <code>cupertino serve</code>. Setup guides for each are in the README.</p>
<h2>What’s next: v1.0.1</h2>
<p>A few items deferred from v1.0.0 that I want to land in a follow-up patch:</p>
<ul><li><p><strong>WKWebView re-crawl on the May 2026 corpus.</strong> The April 2026 corpus shipped with v1.0.0 because rebuilding the schema-12 search.db from on-disk docs doesn’t need a re-crawl. The next release will refresh the corpus content itself and pick up Apple-side documentation edits since April plus pages the JSON API doesn’t expose.</p></li><li><p><strong>Kind-tier ranking.</strong> Roughly 49% of apple-docs rows have <code>kind=unknown</code>. When the crawler-side metadata extraction improves, a <code>kind ∈ {enum, struct, class, protocol}</code> tier slots ahead of the framework-authority tiebreak in HEURISTIC 1. The exact-title peer cluster gets a third orthogonal signal and the few remaining edge cases (<code>Result</code>’s lowercase-property competition, <code>Identifiable</code>’s conformance-page domination) collapse cleanly.</p></li><li><p><strong><code>Ingest</code> sub-PRs 4b–4f.</strong> The seven <code>&lt;Type&gt;Pipeline</code> services still in CLI lift cleanly into the new package once they grow callback-based shapes. Tracked under #247.</p></li></ul>
<p>That’s it. Cupertino v1.0.0 “First Light” is out. Tag, binary, bundle, formula — all live as of today.</p>
<p>Apple’s documentation is now something an AI agent can actually read before it answers.</p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.10: Full Coverage and Community Contributions</title>
<link>https://aleahim.com/blog/cupertino-10-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-10-release/</guid>
<pubDate>Fri, 13 Mar 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>307 frameworks, 302,424 docs, Agent Skills, Claude Code plugin, and the first community PRs.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.10: Full Coverage and Community Contributions</h1>
<p><strong>TL;DR:</strong> All 307 Apple frameworks are now indexed. 302,424 documentation pages searchable. Community contributors added Agent Skill support and a Claude Code plugin. Homebrew resource bundle fix.</p>
<h2>The Completionist Achievement: Unlocked</h2>
<p>I wanted every Apple framework in the index. Not most of them. <em>All</em> of them.</p>
<p>Turns out, the crawler was only finding ~20 frameworks by following links from Apple’s developer homepage. That’s like exploring a library by only reading the “Staff Picks” shelf. The rest of Apple’s documentation was sitting there, patiently waiting to be discovered.</p>
<p>The fix: seed the crawler from Apple’s own <code>technologies.json</code> – their internal index of every framework. Feed that to the BFS crawler, and suddenly the whole library opens up.</p>
<p>But that was just the first of five bugs hiding in the crawl engine:</p>
<table><thead><tr><th>Bug</th><th>What Went Wrong</th><th>Fix</th></tr></thead><tbody><tr><td>Session resume ignored <code>startURL</code></td><td>Resumed any session, even for wrong URLs</td><td>Check URL match before resuming</td></tr><tr><td>BFS-only discovery</td><td>Homepage links only find ~20 frameworks</td><td>Seed from <code>technologies.json</code></td></tr><tr><td>Case-sensitive URL matching</td><td>Apple’s JSON returns mixed-case paths</td><td><code>shouldVisit()</code> now case-insensitive</td></tr><tr><td>0.5s request delay</td><td>Life is short</td><td>Reduced to 0.05s</td></tr><tr><td>Skip without enqueue</td><td>Content-unchanged pages never enqueued their links</td><td>Moved link enqueue before skip check</td></tr></tbody></table>
<p>That last one was sneaky. If a page’s content hadn’t changed since the last crawl, the crawler skipped it – but skipped <em>before</em> adding its child links to the queue. Entire subtrees silently disappeared.</p>
<p>The result: 13 previously missing frameworks crawled and indexed. CoreGraphics, CoreMedia, CoreVideo, CoreText, CoreAudio, dnssd, Hypervisor, IOBluetooth, HIDDriverKit, Matter, OpenGLES, USBDriverKit, and CoreAudioTypes.</p>
<p>Yes, even OpenGLES. Deprecated, but completionism has no room for judgment.</p>
<table><thead><tr><th>Framework</th><th style="text-align:right">Documents</th></tr></thead><tbody><tr><td>Kernel</td><td style="text-align:right">39,396</td></tr><tr><td>Matter</td><td style="text-align:right">24,320</td></tr><tr><td>Swift</td><td style="text-align:right">17,466</td></tr><tr><td>AppKit</td><td style="text-align:right">12,443</td></tr><tr><td>Foundation</td><td style="text-align:right">12,423</td></tr><tr><td>UIKit</td><td style="text-align:right">11,158</td></tr><tr><td>SwiftUI</td><td style="text-align:right">7,062</td></tr><tr><td>IOBluetooth</td><td style="text-align:right">3,895</td></tr><tr><td>CoreGraphics</td><td style="text-align:right">3,500+</td></tr><tr><td>CoreMedia</td><td style="text-align:right">2,800+</td></tr><tr><td>…</td><td style="text-align:right">…</td></tr><tr><td><strong>307 Frameworks</strong></td><td style="text-align:right"><strong>302,424</strong></td></tr></tbody></table>
<p>Your AI agent can now answer questions about Hypervisor’s vCPU mapping <em>and</em> IOBluetooth’s RFCOMM channels. You’re welcome.</p>
<h2>Community Contributions</h2>
<p>This release marks a milestone I’m genuinely excited about: the first external contributions to Cupertino.</p>
<p>Both add new ways to use Apple documentation without running an MCP server. Two contributors saw something they wanted, built it, and sent a PR. That’s the open source dream right there.</p>
<h3>Agent Skill Support (PR #167)</h3>
<p><a href="https://github.com/tijs">Tijs Teulings</a> added support for using Cupertino as a stateless <a href="https://agentskills.io/home">Agent Skill</a>. AI coding agents get direct access to Apple documentation via CLI commands with JSON output – no MCP server process needed.</p>
<p>Install with <a href="https://github.com/numman-ali/openskills">OpenSkills</a>:</p>
<pre><code class="language-bash">npx openskills install mihaelamj<span class="tok-operator">/</span>cupertino</code></pre>
<p>Or manually copy the skill definition to <code>.claude/skills/cupertino/</code>.</p>
<p>No daemon. No stdio pipe. Just <code>cupertino search "SwiftUI" --format json</code> and you’re done.</p>
<h3>Claude Code Plugin (PR #169)</h3>
<p><a href="https://github.com/gpambrozio">Gustavo Ambrozio</a> took Tijs’s skill and leveled it up into a proper Claude Code plugin with marketplace support.</p>
<pre><code class="language-bash">claude <span class="tok-operator">/</span>plug<span class="tok-keyword">in</span> marketplace add https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">.</span>git</code></pre>
<p>The plugin adds a manifest, marketplace metadata, and improved skill descriptions with better trigger phrases. One command to install, zero configuration after that.</p>
<p>Thank you Tijs and Gustavo. It’s a great feeling to see the project grow beyond a single-maintainer effort.</p>
<h2>The Homebrew Symlink Saga</h2>
<p>Here’s a fun one. After the v0.10 release, <code>brew install cupertino</code> worked fine… until you actually ran any command. Instant crash:</p>
<pre><code>Fatal error: could not load resource bundle:
from /opt/homebrew/bin/Cupertino_Resources.bundle</code></pre>
<p>The problem: Homebrew symlinks <em>files</em> from the Cellar to <code>/opt/homebrew/bin/</code>, but not <em>directories</em>. The resource bundle was sitting happily in the Cellar, but <code>Bundle.main.bundleURL</code> (which doesn’t resolve symlinks) was looking in <code>/opt/homebrew/bin/</code> where the symlink lives. Two ships passing in the night.</p>
<p>The fix was two-pronged:</p>
<ol><li><p><strong>Formula</strong>: Added a <code>post_install</code> hook that manually creates the symlink for the resource bundle directory</p></li><li><p><strong>Code</strong>: <code>CupertinoResources.bundle</code> now resolves symlinks via <code>executableURL.resolvingSymlinksInPath()</code> before falling back to <code>Bundle.module</code></p></li></ol>
<p>Belt and suspenders. If you had the crash, <code>brew update &amp;&amp; brew upgrade cupertinohq/tap/cupertino</code> fixes it.</p>
<h2>Search Improvements</h2>
<p>Framework search now includes synonym matching. Because nobody remembers if it’s “CoreGraphics” or “Core Graphics”:</p>
<table><thead><tr><th>You search for</th><th>Finds</th></tr></thead><tbody><tr><td>“Core Graphics”</td><td>coregraphics</td></tr><tr><td>“UIKit”</td><td>uikit</td></tr><tr><td>“SwiftUI”</td><td>swiftui</td></tr><tr><td>“Core Data”</td><td>coredata</td></tr></tbody></table>
<p>Case-insensitive, space-tolerant. Type it however you remember it.</p>
<h2>Install or Update</h2>
<pre><code class="language-bash"><span class="tok-comment"># New install</span>
brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Update existing</span>
brew update <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> brew upgrade cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Or one-line install</span>
bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>Then:</p>
<pre><code class="language-bash">cupertino setup  <span class="tok-comment"># Download databases (~30 seconds)</span>
cupertino serve  <span class="tok-comment"># Start MCP server</span></code></pre>
<h2>Issues and PRs Closed</h2>
<ul><li><p>#159 - Missing framework documentation</p></li><li><p>#160 - Crawler improvements for full coverage</p></li><li><p>#167 - Agent Skill support (<a href="https://github.com/tijs">@tijs</a>)</p></li><li><p>#169 - Claude Code plugin (<a href="https://github.com/gpambrozio">@gpambrozio</a>)</p></li><li><p>#162 - CONTRIBUTING.md (<a href="https://github.com/William-Laverty">@William-Laverty</a>)</p></li><li><p>#133 - README link fix (<a href="https://github.com/lwdupont">@lwdupont</a>)</p></li><li><p>#172 - Crawler session resume and delay fixes</p></li></ul>
<h2>Links</h2>
<ul><li><a href="https://codeberg.org/CupertinoHQ/cupertino">Codeberg Repository</a></li><li><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs">Documentation</a></li><li><a href="https://codeberg.org/CupertinoHQ/cupertino/src/tag/v0.10.0">Tag v0.10.0</a></li></ul>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.9: Multi-Agent Support and MCP Protocol Upgrade</title>
<link>https://aleahim.com/blog/cupertino-09-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-09-release/</guid>
<pubDate>Sun, 25 Jan 2026 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Cupertino now works with OpenAI Codex, Cursor, VS Code Copilot, Zed, Windsurf, and opencode. Plus MCP protocol upgrade to 2025-06-18.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.9: Multi-Agent Support and MCP Protocol Upgrade</h1>
<p><strong>TL;DR:</strong> Cupertino now has setup guides for 8 different AI tools. MCP protocol upgraded to 2025-06-18. Comprehensive documentation for all binaries. No more Node.js in the codebase.</p>
<p>This release focuses on reach. More AI tools can use Cupertino. Better documentation. Cleaner internals.</p>
<h2>Release Summary</h2>
<p>Since v0.8.0, Cupertino has had 5 releases:</p>
<table><thead><tr><th>Version</th><th>Date</th><th>Highlights</th></tr></thead><tbody><tr><td>0.8.1</td><td>2025-12-28</td><td>Installer color fix</td></tr><tr><td>0.8.2</td><td>2025-12-31</td><td>Download progress animation</td></tr><tr><td>0.8.3</td><td>2025-12-31</td><td>Swift-only tests, no Node.js</td></tr><tr><td>0.9.0</td><td>2025-12-31</td><td>MCP protocol 2025-06-18</td></tr><tr><td>0.9.1</td><td>2026-01-25</td><td>Multi-agent docs, binary docs</td></tr></tbody></table>
<h2>Multi-Agent Support (v0.9.1)</h2>
<p>The most requested feature: “How do I use Cupertino with X?”</p>
<p>Cupertino started as a Claude tool. But MCP is an open protocol. Any AI assistant that speaks MCP can use it.</p>
<p>v0.9.1 adds setup guides for 8 AI tools:</p>
<table><thead><tr><th>Tool</th><th>Config Location</th></tr></thead><tbody><tr><td>Claude Desktop</td><td><code>~/Library/Application Support/Claude/claude_desktop_config.json</code></td></tr><tr><td>Claude Code</td><td><code>claude mcp add cupertino</code></td></tr><tr><td>OpenAI Codex</td><td><code>codex mcp add cupertino</code> or <code>~/.codex/config.toml</code></td></tr><tr><td>Cursor</td><td><code>.cursor/mcp.json</code></td></tr><tr><td>VS Code (Copilot)</td><td><code>.vscode/mcp.json</code></td></tr><tr><td>Zed</td><td><code>settings.json</code></td></tr><tr><td>Windsurf</td><td><code>~/.codeium/windsurf/mcp_config.json</code></td></tr><tr><td>opencode</td><td><code>opencode.jsonc</code></td></tr></tbody></table>
<h3>Quick Setup</h3>
<p>For most tools, configuration is a JSON object:</p>
<pre><code class="language-json"><span class="tok-operator">{</span>
  <span class="tok-property">"mcpServers"</span><span class="tok-operator">:</span> <span class="tok-operator">{</span>
    <span class="tok-property">"cupertino"</span><span class="tok-operator">:</span> <span class="tok-operator">{</span>
      <span class="tok-property">"command"</span><span class="tok-operator">:</span> <span class="tok-string">"/opt/homebrew/bin/cupertino"</span><span class="tok-operator">,</span>
      <span class="tok-property">"args"</span><span class="tok-operator">:</span> <span class="tok-operator">[</span><span class="tok-string">"serve"</span><span class="tok-operator">]</span>
    <span class="tok-operator">}</span>
  <span class="tok-operator">}</span>
<span class="tok-operator">}</span></code></pre>
<p>The exact structure varies by tool. Full examples are in the <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/commands/serve/README.md">serve command documentation</a>.</p>
<h3>Dynamic Path Detection</h3>
<p>If you’re not sure where cupertino is installed:</p>
<pre><code class="language-bash">claude mcp add cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span> <span class="tok-property">$</span>(which cupertino)
codex mcp add cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span> <span class="tok-property">$</span>(which cupertino) serve</code></pre>
<p>The <code>$(which cupertino)</code> expands to the actual binary path. Works for Homebrew installs on both Apple Silicon (<code>/opt/homebrew/bin</code>) and Intel (<code>/usr/local/bin</code>).</p>
<h2>MCP Protocol Upgrade (v0.9.0)</h2>
<p>v0.9.0 upgrades the MCP protocol from <code>2024-11-05</code> to <code>2025-06-18</code>.</p>
<p>This matters because newer AI tools expect the newer protocol. Without this upgrade, Cupertino would fail to initialize with clients that only support <code>2025-06-18</code>.</p>
<p>The upgrade includes backward compatibility:</p>
<pre><code class="language-swift"><span class="tok-comment">// Server negotiates with client</span>
<span class="tok-keyword">public</span> <span class="tok-keyword">let</span> <span class="tok-type">MCPProtocolVersion</span> <span class="tok-operator">=</span> <span class="tok-string">"2025-06-18"</span>
<span class="tok-keyword">public</span> <span class="tok-keyword">let</span> <span class="tok-type">MCPProtocolVersionsSupported</span> <span class="tok-operator">=</span> [<span class="tok-string">"2025-06-18"</span>, <span class="tok-string">"2024-11-05"</span>]

<span class="tok-comment">// During initialization, find common version</span>
<span class="tok-keyword">let</span> negotiated<span class="tok-type">Version</span> <span class="tok-operator">=</span> client<span class="tok-type">Versions</span>
    <span class="tok-operator">.</span>first { <span class="tok-type">MCPProtocolVersionsSupported</span><span class="tok-operator">.</span><span class="tok-function">contains</span>($<span class="tok-number">0</span>) }</code></pre>
<p>If a client requests <code>2024-11-05</code>, Cupertino still works. If it requests <code>2025-06-18</code>, that works too. The <code>MCPClient</code> and <code>MockAIAgent</code> also support version fallback when connecting to servers.</p>
<p>Thanks to <a href="https://github.com/erikmackinnon">@erikmackinnon</a> for the contribution (#130).</p>
<h2>Binary Documentation (v0.9.1)</h2>
<p>Cupertino ships 4 executables. Until now, only <code>cupertino</code> had proper documentation.</p>
<p>v0.9.1 adds 48 documentation files covering all binaries:</p>
<h3>cupertino</h3>
<p>The main CLI with 12 commands. Already documented, but now with updated MCP client configuration examples.</p>
<h3>cupertino-tui</h3>
<p>The terminal UI for browsing and selecting packages:</p>
<pre><code class="language-bash">cupertino<span class="tok-operator">-</span>tui
cupertino<span class="tok-operator">-</span>tui <span class="tok-operator">-</span><span class="tok-operator">-</span>version</code></pre>
<p>5 views documented:</p>
<ul><li><p><strong>Dashboard</strong> - Overview and quick actions</p></li><li><p><strong>Packages</strong> - Browse and select Swift packages</p></li><li><p><strong>Archive</strong> - Apple Archive documentation selection</p></li><li><p><strong>Videos</strong> - WWDC video selection</p></li><li><p><strong>Settings</strong> - Configuration options</p></li></ul>
<h3>mock-ai-agent</h3>
<p>A testing tool that simulates MCP client behavior:</p>
<pre><code class="language-bash">mock<span class="tok-operator">-</span>ai<span class="tok-operator">-</span>agent search <span class="tok-string">"SwiftUI navigation"</span>
mock<span class="tok-operator">-</span>ai<span class="tok-operator">-</span>agent list<span class="tok-operator">-</span>tools
mock<span class="tok-operator">-</span>ai<span class="tok-operator">-</span>agent <span class="tok-operator">-</span><span class="tok-operator">-</span>server <span class="tok-operator">/</span>path<span class="tok-operator">/</span>to<span class="tok-operator">/</span>cupertino
mock<span class="tok-operator">-</span>ai<span class="tok-operator">-</span>agent <span class="tok-operator">-</span><span class="tok-operator">-</span>version  <span class="tok-comment"># New in v0.9.1</span></code></pre>
<p>Arguments documented:</p>
<ul><li><p><code>&lt;query&gt;</code> - Search query to execute</p></li><li><p><code>--server</code> - Path to MCP server binary</p></li></ul>
<p>Useful for testing MCP servers without a full AI client.</p>
<h3>cupertino-rel</h3>
<p>The release automation tool (maintainer-only):</p>
<pre><code class="language-bash">cupertino<span class="tok-operator">-</span>rel bump patch          <span class="tok-comment"># Bump version</span>
cupertino<span class="tok-operator">-</span>rel tag <span class="tok-operator">-</span><span class="tok-operator">-</span>version <span class="tok-number">0.9.1</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>push  <span class="tok-comment"># Create and push tag</span>
cupertino<span class="tok-operator">-</span>rel homebrew <span class="tok-operator">-</span><span class="tok-operator">-</span>version <span class="tok-number">0.9.1</span>    <span class="tok-comment"># Update Homebrew formula</span>
cupertino<span class="tok-operator">-</span>rel databases <span class="tok-operator">-</span><span class="tok-operator">-</span>version <span class="tok-number">0.9.1</span>   <span class="tok-comment"># Upload database release</span>
cupertino<span class="tok-operator">-</span>rel docs<span class="tok-operator">-</span>update patch   <span class="tok-comment"># Documentation-only release</span>
cupertino<span class="tok-operator">-</span>rel full <span class="tok-number">0.10.0</span>         <span class="tok-comment"># Complete release workflow</span></code></pre>
<p>6 subcommands with all options documented:</p>
<ul><li><p><code>bump</code> - Update version in all files</p></li><li><p><code>tag</code> - Create and push git tags</p></li><li><p><code>homebrew</code> - Update Homebrew formula</p></li><li><p><code>databases</code> - Upload databases to cupertino-docs</p></li><li><p><code>docs-update</code> - Documentation-only releases</p></li><li><p><code>full</code> - Complete release workflow</p></li></ul>
<h3>Documentation Structure</h3>
<p>The documentation follows the same granular folder structure as the main CLI:</p>
<pre><code>docs/binaries/
├── README.md
├── cupertino-tui/
│   ├── README.md
│   ├── option (--)/
│   │   └── version.md
│   └── view/
│       ├── dashboard.md
│       ├── packages.md
│       ├── archive.md
│       ├── videos.md
│       └── settings.md
├── mock-ai-agent/
│   ├── README.md
│   ├── option (--)/
│   │   ├── server.md
│   │   └── version.md
│   └── argument (&lt;&gt;)/
│       └── query.md
└── cupertino-rel/
    ├── README.md
    ├── option (--)/
    │   └── version.md
    └── subcommand/
        ├── bump/
        ├── tag/
        ├── homebrew/
        ├── databases/
        ├── docs-update/
        └── full/</code></pre>
<h2>No More Node.js (v0.8.3)</h2>
<p>v0.8.3 removed the last Node.js dependency from the codebase.</p>
<p>The MCP integration tests previously used npm packages to simulate client behavior. Now they use <code>cupertino serve</code> directly:</p>
<pre><code class="language-swift"><span class="tok-attribute">@Test</span>(<span class="tok-string">"Initialize handshake with cupertino server"</span>)
<span class="tok-keyword">func</span> <span class="tok-function">cupertinoServerInitialize</span>() <span class="tok-keyword">async</span> <span class="tok-keyword">throws</span> {
    <span class="tok-keyword">let</span> process <span class="tok-operator">=</span> <span class="tok-type">Process</span>()
    process<span class="tok-operator">.</span>executable<span class="tok-type">URL</span> <span class="tok-operator">=</span> <span class="tok-type">URL</span>(file<span class="tok-type">URLWithPath</span><span class="tok-operator">:</span> <span class="tok-string">".build/debug/cupertino"</span>)
    process<span class="tok-operator">.</span>arguments <span class="tok-operator">=</span> [<span class="tok-string">"serve"</span>]

    <span class="tok-keyword">let</span> stdin<span class="tok-type">Pipe</span> <span class="tok-operator">=</span> <span class="tok-type">Pipe</span>()
    <span class="tok-keyword">let</span> stdout<span class="tok-type">Pipe</span> <span class="tok-operator">=</span> <span class="tok-type">Pipe</span>()
    process<span class="tok-operator">.</span>standard<span class="tok-type">Input</span> <span class="tok-operator">=</span> stdin<span class="tok-type">Pipe</span>
    process<span class="tok-operator">.</span>standard<span class="tok-type">Output</span> <span class="tok-operator">=</span> stdout<span class="tok-type">Pipe</span>

    <span class="tok-keyword">try</span> process<span class="tok-operator">.</span><span class="tok-function">run</span>()

    <span class="tok-comment">// Send initialize request (compact JSON + newline)</span>
    <span class="tok-keyword">let</span> init<span class="tok-type">Request</span> <span class="tok-operator">=</span> <span class="tok-string">"""
    {"jsonrpc":"2.0","id":1,"method":"initialize","params":{...}}\n
    """</span>
    stdin<span class="tok-type">Pipe</span><span class="tok-operator">.</span>file<span class="tok-type">HandleForWriting</span><span class="tok-operator">.</span><span class="tok-function">write</span>(<span class="tok-type">Data</span>(init<span class="tok-type">Request</span><span class="tok-operator">.</span>utf<span class="tok-number">8</span>))

    <span class="tok-comment">// Parse and verify response</span>
    <span class="tok-keyword">let</span> response <span class="tok-operator">=</span> <span class="tok-keyword">try</span> <span class="tok-type">JSONDecoder</span>()<span class="tok-operator">.</span><span class="tok-function">decode</span>(<span class="tok-type">JSONRPCResponse</span><span class="tok-operator">.</span><span class="tok-keyword">self</span>, from<span class="tok-operator">:</span> response<span class="tok-type">Data</span>)
    <span class="tok-attribute">#expect</span>(response<span class="tok-operator">.</span>server<span class="tok-type">Info</span><span class="tok-operator">.</span>name <span class="tok-operator">=</span><span class="tok-operator">=</span> <span class="tok-string">"cupertino"</span>)
}</code></pre>
<p>The tests verify:</p>
<ul><li><p>MCP initialize handshake</p></li><li><p><code>tools/list</code> responses</p></li><li><p>Protocol version negotiation</p></li><li><p>Server info and tool registration</p></li></ul>
<p>Swift-only tests. No npm. No node_modules. No package-lock.json.</p>
<p>This is now policy in AGENTS.md: <strong>no Node.js or npm in the Cupertino codebase</strong>.</p>
<h2>Setup Progress Animation (v0.8.2)</h2>
<p>Database downloads are ~400MB. Previously, <code>cupertino setup</code> showed nothing while downloading.</p>
<p>Now you get real-time feedback:</p>
<p><strong>Download progress with bar:</strong></p>
<pre><code>⠹ [████████████░░░░░░░░░░░░░░░░░░] 42% (168MB/400MB)</code></pre>
<p><strong>Extraction spinner:</strong></p>
<pre><code>⠧ Extracting databases...</code></pre>
<p>Implementation details:</p>
<ul><li><p><code>DownloadProgressDelegate</code> implements <code>URLSessionDownloadDelegate</code> for real-time progress</p></li><li><p><code>ExtractionSpinner</code> shows animated feedback during unzip</p></li><li><p>Extended download timeout to 10 minutes for large database files</p></li><li><p>Uses ANSI escape codes for in-place updates</p></li></ul>
<p>Small things that make the tool feel responsive.</p>
<h2>Installer ANSI Fix (v0.8.1)</h2>
<p>The one-line installer had broken ANSI colors:</p>
<p><strong>Before:</strong></p>
<pre><code>\033[32m✓ Installation complete\033[0m</code></pre>
<p><strong>After:</strong></p>
<pre><code>✓ Installation complete  (in green)</code></pre>
<p>Two <code>echo</code> statements were missing the <code>-e</code> flag for escape sequence interpretation. Fixed in #124.</p>
<h2>Database Compatibility</h2>
<p>This release uses the same database schema as v0.8.2. No migration needed.</p>
<p>When you run <code>cupertino setup</code>, it downloads databases from the v0.8.2 release. The CLI version (0.9.1) and database version (0.8.2) are now decoupled.</p>
<table><thead><tr><th>Version Type</th><th>Current</th><th>Purpose</th></tr></thead><tbody><tr><td>CLI version</td><td>0.9.1</td><td>Binary release</td></tr><tr><td>Database version</td><td>0.8.2</td><td>Pre-built database release</td></tr><tr><td>Schema version</td><td>9</td><td>SQLite schema</td></tr></tbody></table>
<p>This means:</p>
<ul><li><p>CLI updates don’t require database re-downloads</p></li><li><p>Database updates don’t require CLI updates</p></li><li><p>Schema changes are tracked separately</p></li></ul>
<h2>Install or Update</h2>
<pre><code class="language-bash"><span class="tok-comment"># New install</span>
brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Update existing</span>
brew update <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> brew upgrade cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Or one-line install</span>
bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>Then:</p>
<pre><code class="language-bash">cupertino setup  <span class="tok-comment"># Download databases (~30 seconds)</span>
cupertino serve  <span class="tok-comment"># Start MCP server</span></code></pre>
<p>Configure your AI tool using the guides above, and you’re ready.</p>
<h2>Issues Closed</h2>
<ul><li><p>#124 - Installer ANSI escape sequences</p></li><li><p>#96 - Setup progress animation</p></li><li><p>#131 - Remove Node.js dependency from MCP integration tests</p></li><li><p>#130 - MCP protocol mismatch (2025-06-18 support)</p></li><li><p>#134 - Better documentation for use with different agents</p></li><li><p>#137 - Documentation improvements: MCP client configs and binary documentation</p></li></ul>
<h2>Links</h2>
<ul><li><a href="https://codeberg.org/CupertinoHQ/cupertino">Codeberg Repository</a></li><li><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs">Documentation</a></li><li><a href="https://codeberg.org/CupertinoHQ/cupertino/src/tag/v0.9.1">Tag v0.9.1</a></li></ul>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.8.0: AST Indexing and a Major Architecture Refactor</title>
<link>https://aleahim.com/blog/cupertino-08-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-08-release/</guid>
<pubDate>Sat, 20 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>SwiftSyntax enables semantic code search. A deep refactoring of the codebase delivers cleaner results and better AI capabilities.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.8.0: AST Indexing and a Major Architecture Refactor</h1>
<p><strong>TL;DR:</strong> SwiftSyntax-based AST indexing. Major codebase refactoring. Cleaner search results. Test suite grew from 93 to 698 tests.</p>
<p>This release is about foundations. Less visible features, more architectural work that makes everything else possible.</p>
<h2>The Big Feature: AST Indexing</h2>
<p>This is issue #81, and it’s been brewing for a while. Sample code search was purely keyword-based - you search “async”, you get files containing “async”. Comments, strings, documentation, actual code - all treated equally.</p>
<p>Now Cupertino extracts structured symbol data from Swift source:</p>
<pre><code class="language-swift"><span class="tok-comment">// SwiftSourceExtractor analyzes this:</span>
<span class="tok-attribute">@MainActor</span>
<span class="tok-keyword">class</span> <span class="tok-type">NetworkManager</span><span class="tok-operator">:</span> <span class="tok-type">ObservableObject</span> {
    <span class="tok-attribute">@Published</span> <span class="tok-keyword">var</span> is<span class="tok-type">Loading</span> <span class="tok-operator">=</span> <span class="tok-literal">false</span>

    <span class="tok-keyword">func</span> <span class="tok-function">fetch</span>() <span class="tok-keyword">async</span> <span class="tok-keyword">throws</span> <span class="tok-operator">-</span><span class="tok-operator">&gt;</span> <span class="tok-type">Data</span> { <span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span> }
}</code></pre>
<p>And extracts:</p>
<table><thead><tr><th>Symbol</th><th>Kind</th><th>Attributes</th></tr></thead><tbody><tr><td><code>NetworkManager</code></td><td>class</td><td><code>@MainActor</code></td></tr><tr><td><code>isLoading</code></td><td>property</td><td><code>@Published</code></td></tr><tr><td><code>fetch()</code></td><td>function</td><td>async, throws</td></tr></tbody></table>
<h3>What This Enables</h3>
<p><strong>Better ranking, not magic.</strong> When you search “@Observable”, plain text search finds every file mentioning “Observable” - comments, strings, documentation, actual declarations. All ranked equally.</p>
<p>With AST indexing, Cupertino knows which results contain actual <code>@Observable</code> class declarations. These get boosted in ranking. The real symbol usages surface first.</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino search <span class="tok-string">"@Observable"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source samples <span class="tok-operator">-</span><span class="tok-operator">-</span>format markdown</code></pre>
<pre><code class="language-markdown">## <span class="tok-type">Projects</span> (<span class="tok-number">5</span> found)

### <span class="tok-number">1.</span> <span class="tok-type">Migrating</span> from the <span class="tok-type">Observable</span> <span class="tok-type">Object</span> protocol to the <span class="tok-type">Observable</span> macro
<span class="tok-operator">-</span> <span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">Frameworks</span><span class="tok-operator">:</span><span class="tok-operator">*</span><span class="tok-operator">*</span> swiftui
<span class="tok-operator">-</span> <span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">Files</span><span class="tok-operator">:</span><span class="tok-operator">*</span><span class="tok-operator">*</span> <span class="tok-number">14</span>

## <span class="tok-type">Matching</span> <span class="tok-type">Files</span>

### <span class="tok-type">Library</span><span class="tok-operator">.</span>swift
<span class="tok-operator">&gt;</span> <span class="tok-attribute">@Observable</span> final <span class="tok-keyword">class</span> <span class="tok-type">Library</span> {
<span class="tok-operator">&gt;</span>     <span class="tok-keyword">var</span> books<span class="tok-operator">:</span> [<span class="tok-type">Book</span>] <span class="tok-operator">=</span> [<span class="tok-type">Book</span>(), <span class="tok-type">Book</span>(), <span class="tok-type">Book</span>()]
<span class="tok-operator">&gt;</span> }

### <span class="tok-type">Book</span><span class="tok-operator">.</span>swift
<span class="tok-operator">&gt;</span> <span class="tok-attribute">@Observable</span> final <span class="tok-keyword">class</span> <span class="tok-type">Book</span><span class="tok-operator">:</span> <span class="tok-type">Identifiable</span> {
<span class="tok-operator">&gt;</span>     <span class="tok-keyword">var</span> title <span class="tok-operator">=</span> <span class="tok-string">"Sample Book Title"</span>
<span class="tok-operator">&gt;</span>     <span class="tok-keyword">let</span> id <span class="tok-operator">=</span> <span class="tok-type">UUID</span>()
<span class="tok-operator">&gt;</span> }</code></pre>
<p>The search still matches text, but files with actual <code>@Observable</code> declarations rank higher than files that just mention the word in comments.</p>
<p><strong>Dedicated semantic tools.</strong> The symbol tables power these MCP tools:</p>
<ul><li><p><code>search_symbols</code> - query by symbol type and attributes</p></li><li><p><code>search_property_wrappers</code> - find <code>@Published</code>, <code>@State</code>, <code>@Binding</code> usage</p></li><li><p><code>search_conformances</code> - find protocol implementations</p></li><li><p><code>search_concurrency</code> - find async/await patterns</p></li></ul>
<p>These query extracted symbol data directly, not text. AI assistants can ask “find all async functions in SwiftUI samples” and get structured results.</p>
<h3>How It Works</h3>
<p>The new <code>ASTIndexer</code> package uses SwiftSyntax to parse Swift files and extract:</p>
<ul><li><p><strong>Symbols</strong>: Classes, structs, enums, actors, protocols, functions</p></li><li><p><strong>Attributes</strong>: <code>@MainActor</code>, <code>@Published</code>, <code>@Observable</code>, etc.</p></li><li><p><strong>Conformances</strong>: Protocol adoptions</p></li><li><p><strong>Modifiers</strong>: async, throws, static, public</p></li></ul>
<p>SwiftSyntax is Apple’s official Swift parser - the same one the compiler uses. No regex hacks, no fragile pattern matching.</p>
<p>The tradeoff? Build times. SwiftSyntax is a beast. First release build takes 10-15 minutes now. But the capability is worth it.</p>
<h2>The Refactoring Story</h2>
<p>This release involved substantial architectural changes that touch almost every part of the codebase. The goal: make search results cleaner and the system more capable.</p>
<h3>Unified Search Service</h3>
<p>Previously, each search source (docs, HIG, samples, videos) had its own formatting logic scattered across the codebase. Now there’s a unified <code>SearchService</code> that handles all sources consistently:</p>
<ul><li><p>Single entry point for all search types</p></li><li><p>Consistent result formatting across sources</p></li><li><p>Shared footer generation with tips and guidance</p></li><li><p>Hierarchical numbering that works across all result types</p></li></ul>
<h3>Package Architecture Cleanup</h3>
<p>The package structure got significant attention:</p>
<ul><li><p>Consolidated duplicate functionality across modules</p></li><li><p>Clearer boundaries between <code>Services</code>, <code>Core</code>, and domain packages</p></li><li><p>Better separation of CLI concerns from library logic</p></li><li><p>Removed dead code paths and unused types</p></li></ul>
<h3>Result Formatter Protocol</h3>
<p>A new <code>ResultFormatter</code> protocol standardizes how search results become output:</p>
<pre><code class="language-swift"><span class="tok-keyword">protocol</span> <span class="tok-type">ResultFormatter</span> {
    <span class="tok-keyword">associatedtype</span> <span class="tok-type">Input</span>
    <span class="tok-keyword">func</span> <span class="tok-function">format</span>(_ result<span class="tok-operator">:</span> <span class="tok-type">Input</span>) <span class="tok-operator">-</span><span class="tok-operator">&gt;</span> <span class="tok-type">String</span>
}</code></pre>
<p>This enabled reusable formatters for different output contexts (CLI text, MCP markdown, JSON) while keeping the core search logic unchanged.</p>
<p>The refactoring wasn’t glamorous work, but it paid off immediately in cleaner search results and faster feature development.</p>
<h2>Smarter Search Output</h2>
<p>Here’s a subtle change that matters more than it sounds: hierarchical result numbering.</p>
<p>Before:</p>
<pre><code>## Apple Documentation
### UIButton
### UIView
### UIControl

## Sample Code
### ButtonStyles
### CustomControls</code></pre>
<p>After:</p>
<pre><code>## 1. Apple Documentation (20)
### 1.1 UIButton
### 1.2 UIView
### 1.3 UIControl

## 2. Sample Code (5)
### 2.1 ButtonStyles
### 2.2 CustomControls</code></pre>
<p>Why does this matter? When Claude is navigating search results, it can now reference specific items: “Looking at result 1.3…” or “Sample 2.1 shows this pattern…”</p>
<p>The count in headers (<code>20</code>, <code>5</code>) also helps the AI understand result distribution. If one source has 50 results and another has 2, that’s useful context.</p>
<p>Small formatting changes, big impact on AI reasoning.</p>
<h2>Display Bugs: Death by a Thousand Cuts</h2>
<p>Sometimes bugs accumulate in strange ways. I noticed search results had weird formatting artifacts:</p>
<ul><li><p><code>Tabbars|AppleDeveloperDocumentation###</code> - trailing garbage</p></li><li><p><code>Tab  bars</code> - double spaces</p></li><li><p><code>Goingfull screen</code> - missing space in HIG titles</p></li><li><p><code>Framework# SwiftUI</code> - inline markdown headers</p></li></ul>
<p>Each individually minor. Together, they made results look unprofessional and confused AI parsing.</p>
<p>The fix was a string extension that cleans display text:</p>
<pre><code class="language-swift"><span class="tok-keyword">var</span> cleaned<span class="tok-type">ForDisplay</span><span class="tok-operator">:</span> <span class="tok-type">String</span> {
    <span class="tok-keyword">var</span> result <span class="tok-operator">=</span> <span class="tok-keyword">self</span>

    <span class="tok-comment">// Remove trailing ###</span>
    <span class="tok-keyword">while</span> result<span class="tok-operator">.</span><span class="tok-function">hasSuffix</span>(<span class="tok-string">"###"</span>) { <span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span> }

    <span class="tok-comment">// Remove |AppleDeveloperDocumentation</span>
    result <span class="tok-operator">=</span> result<span class="tok-operator">.</span><span class="tok-function">replacingOccurrences</span>(of<span class="tok-operator">:</span> <span class="tok-string">"|AppleDeveloperDocumentation"</span>, with<span class="tok-operator">:</span> <span class="tok-string">""</span>)

    <span class="tok-comment">// Fix "Goingfull" -&gt; "Going full"</span>
    result <span class="tok-operator">=</span> result<span class="tok-operator">.</span>adding<span class="tok-type">SpacesToCamelCase</span>

    <span class="tok-comment">// Collapse double spaces</span>
    <span class="tok-keyword">while</span> result<span class="tok-operator">.</span><span class="tok-function">contains</span>(<span class="tok-string">"  "</span>) { <span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span> }

    <span class="tok-keyword">return</span> result
}</code></pre>
<p>Now there are 34 unit tests just for string formatting. Because every edge case that slipped through was a papercut in every search result.</p>
<h2>The Test Suite Story</h2>
<table><thead><tr><th>Metric</th><th>v0.7.0</th><th>v0.8.0</th></tr></thead><tbody><tr><td>Tests</td><td>93</td><td>698</td></tr><tr><td>Suites</td><td>7</td><td>73</td></tr><tr><td>Duration</td><td>~5 min</td><td>~35 sec</td></tr></tbody></table>
<p>That’s not a typo. We went from 93 tests to 698.</p>
<p>Where did they come from?</p>
<ol><li><p><strong>AST Indexer tests</strong> - SwiftSyntax extraction needs thorough testing</p></li><li><p><strong>String formatter tests</strong> - All those display edge cases</p></li><li><p><strong>Service layer tests</strong> - Unified search service coverage</p></li><li><p><strong>Symbol database tests</strong> - Integration tests for code analysis</p></li></ol>
<p>The duration dropped despite 7x more tests because I fixed a race condition in the <code>PriorityPackagesCatalog</code> tests. The old code used <code>defer { Task { await ... } }</code> which created detached async tasks that didn’t complete before the next test ran. State leaked between tests, causing random failures.</p>
<p>The fix was embarrassingly simple: don’t use <code>defer</code> with async cleanup. Just await at the end of the test.</p>
<h2>Doctor Command Gets Smarter</h2>
<p>The <code>cupertino doctor</code> command now diagnoses package-related issues:</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino doctor

Cupertino v<span class="tok-number">0.8.0</span> <span class="tok-operator">-</span> Health Check

Databases<span class="tok-operator">:</span>
  ✅ search<span class="tok-operator">.</span><span class="tok-function">db</span> (<span class="tok-number">2.3</span>GB, <span class="tok-number">302</span>,<span class="tok-number">424</span> docs)
  ✅ sample<span class="tok-operator">.</span><span class="tok-function">db</span> (<span class="tok-number">156</span>MB, <span class="tok-number">606</span> projects)

Package Status<span class="tok-operator">:</span>
  ✅ User selections<span class="tok-operator">:</span> <span class="tok-operator">~</span><span class="tok-operator">/</span><span class="tok-operator">.</span>cupertino<span class="tok-operator">/</span>selected<span class="tok-operator">-</span>packages<span class="tok-operator">.</span><span class="tok-function">json</span> (<span class="tok-number">12</span> packages)
  ✅ Downloaded READMEs<span class="tok-operator">:</span> <span class="tok-number">12</span><span class="tok-operator">/</span><span class="tok-number">12</span>
  ⚠️  Orphaned READMEs<span class="tok-operator">:</span> <span class="tok-number">3</span> (packages no longer selected)

Priority Breakdown<span class="tok-operator">:</span>
  📦 Apple Official<span class="tok-operator">:</span> <span class="tok-number">31</span> packages
  📦 Ecosystem<span class="tok-operator">:</span> <span class="tok-number">5</span> packages

MCP Tools<span class="tok-operator">:</span> <span class="tok-number">8</span> registered
Resources<span class="tok-operator">:</span> <span class="tok-number">3</span> providers active</code></pre>
<p>The “orphaned READMEs” warning catches when you’ve unselected packages but their downloaded docs remain. Helpful for debugging unexpected search results.</p>
<h2>What’s Next</h2>
<p>The semantic tools (<code>search_symbols</code>, <code>search_conformances</code>, etc.) are built. Next steps:</p>
<ol><li><p><strong>Index all sample code</strong> - Run AST extraction across all 606 projects to populate symbol tables</p></li><li><p><strong>Cross-referencing</strong> - Link extracted symbols to their documentation pages</p></li><li><p><strong>Symbol coverage</strong> - Expand extraction to catch more edge cases</p></li></ol>
<p>The infrastructure is in place. Now to fill the database and refine the queries.</p>
<h2>Install or Update</h2>
<pre><code class="language-bash"><span class="tok-comment"># New install</span>
brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Update existing</span>
brew upgrade cupertino

<span class="tok-comment"># Or one-line install</span>
bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>Then:</p>
<pre><code class="language-bash">cupertino setup  <span class="tok-comment"># Download databases (~30 seconds)</span>
cupertino serve  <span class="tok-comment"># Start MCP server</span></code></pre>
<p>Try the improved search:</p>
<pre><code class="language-bash"><span class="tok-comment"># See hierarchical numbering</span>
cupertino search <span class="tok-string">"SwiftUI navigation"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source all

<span class="tok-comment"># Clean HIG results</span>
cupertino search <span class="tok-string">"tab bar"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source hig

<span class="tok-comment"># Check your installation health</span>
cupertino doctor</code></pre>
<hr>
<p><em>Cupertino is an Apple Documentation MCP Server. 302,424 pages of Apple documentation, searchable by AI. Source at <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.7.0: 302K Docs, OS Version Filtering, and Teaching AI to Dig Deeper</title>
<link>https://aleahim.com/blog/cupertino-07-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-07-release/</guid>
<pubDate>Mon, 15 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>The complete Apple documentation crawl is done. Now you can filter by iOS 17+ and Claude finally knows where to look for answers.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.7.0: 302K Docs, OS Version Filtering, and Teaching AI to Dig Deeper</h1>
<p><strong>TL;DR:</strong> Finally crawled all of Apple’s docs. Added OS version filtering. Made AI agents smarter about finding the right documentation.</p>
<p>Four days after v0.5.0, and I’ve shipped two more releases. At this point I’m not sure if this is momentum or obsession. Let’s call it momentum.</p>
<h2>The Numbers</h2>
<table><thead><tr><th>Metric</th><th>v0.5.0</th><th>v0.7.0</th><th>Change</th></tr></thead><tbody><tr><td>Total Documents</td><td>234,331</td><td>302,424</td><td>+29%</td></tr><tr><td>Frameworks</td><td>287</td><td>307</td><td>+20</td></tr><tr><td>Database Size</td><td>~1.9GB</td><td>~2.3GB</td><td>+21%</td></tr></tbody></table>
<p>Three hundred thousand pages. That’s every framework, every class, every method Apple has documented. The crawl ran for almost two weeks total across multiple sessions.</p>
<h3>Top Frameworks by Document Count</h3>
<table><thead><tr><th>Framework</th><th style="text-align:right">Documents</th></tr></thead><tbody><tr><td>Kernel</td><td style="text-align:right">39,396</td></tr><tr><td>Matter</td><td style="text-align:right">24,320</td></tr><tr><td>Swift</td><td style="text-align:right">17,466</td></tr><tr><td>AppKit</td><td style="text-align:right">12,443</td></tr><tr><td>Foundation</td><td style="text-align:right">12,423</td></tr><tr><td>UIKit</td><td style="text-align:right">11,158</td></tr><tr><td>Accelerate</td><td style="text-align:right">9,114</td></tr><tr><td>SwiftUI</td><td style="text-align:right">7,062</td></tr></tbody></table>
<p>Kernel jumped from 25,000 to nearly 40,000 pages. That’s IOKit, BSD interfaces, Mach APIs, driver development - the low-level stuff that’s hardest to find and most valuable when you need it. Matter has 24,000+ docs for smart home development. Accelerate and SIMD documentation is fully indexed now - performance optimization guides that AI models probably didn’t see much of during training.</p>
<h2>The Feature I’ve Been Waiting For: OS Version Filtering</h2>
<p>This was issue #99, and it’s been on my mind since day one. Apple’s documentation includes version information - which iOS/macOS version introduced each API. We now extract this.</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"async"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>m<span class="tok-keyword">in</span><span class="tok-operator">-</span>ios <span class="tok-number">16</span></code></pre>
<p>Or in Claude:</p>
<blockquote><p>“Search for SwiftUI navigation APIs available in iOS 17+”</p></blockquote>
<p>The AI agent can now filter results by platform version. No more suggestions for deprecated iOS 12 APIs when you’re building for iOS 17.</p>
<h3>How It Works</h3>
<p>Different documentation sources need different strategies:</p>
<table><thead><tr><th>Source</th><th>Strategy</th></tr></thead><tbody><tr><td>apple-docs</td><td>Apple’s JSON API + fallbacks</td></tr><tr><td>sample-code</td><td>Derived from framework</td></tr><tr><td>apple-archive</td><td>Derived from framework</td></tr><tr><td>swift-evolution</td><td>Swift version mapping</td></tr><tr><td>swift-book/hig</td><td>Universal (all platforms)</td></tr></tbody></table>
<p>For Apple’s modern docs, there’s a hidden JSON endpoint at <code>/tutorials/data/documentation/</code> that returns structured metadata including availability. For older stuff, we derive from the framework - if it’s UIKit, we know the minimum versions.</p>
<p>The cool part? You can filter by <em>any</em> platform:</p>
<ul><li><p><code>--min-ios 16</code></p></li><li><p><code>--min-macos 14</code></p></li><li><p><code>--min-tvos 17</code></p></li><li><p><code>--min-watchos 10</code></p></li><li><p><code>--min-visionos 1</code></p></li></ul>
<p>visionOS filtering. For when you’re building spatial computing apps and need APIs that actually exist on the platform.</p>
<h2>Teaching AI Where to Look</h2>
<p>Here’s something I discovered while using Cupertino with Claude: the AI doesn’t know what it doesn’t know.</p>
<p>When Claude searches for “CALayer animation”, it gets API reference - classes, methods, properties. Good stuff. But the <em>conceptual</em> documentation - the “why” behind Core Animation - lives in Apple Archive. And Claude had no idea.</p>
<h3>The Problem</h3>
<p>I had added archive support in v0.2.3. Users could search with <code>--source apple-archive</code>. But AI agents don’t read release notes. They read tool descriptions once, then forget. Every search was missing the deep conceptual guides.</p>
<h3>The Solution: Teasers</h3>
<p>Now every search result includes hints from alternate sources:</p>
<pre><code class="language-markdown"># <span class="tok-type">Search</span> <span class="tok-type">Results</span> <span class="tok-keyword">for</span> <span class="tok-string">"CALayer animation"</span>

## <span class="tok-type">Results</span> from apple<span class="tok-operator">-</span><span class="tok-function">docs</span> (<span class="tok-number">5</span> found)

<span class="tok-number">1.</span> <span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">CALayer</span><span class="tok-operator">*</span><span class="tok-operator">*</span> <span class="tok-operator">-</span> <span class="tok-type">The</span> basic object <span class="tok-keyword">for</span> managing and presenting drawable content<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
<span class="tok-number">2.</span> <span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">CABasicAnimation</span><span class="tok-operator">*</span><span class="tok-operator">*</span> <span class="tok-operator">-</span> <span class="tok-type">An</span> animation that applies a single keyframe<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>

<span class="tok-operator">-</span><span class="tok-operator">-</span><span class="tok-operator">-</span>

<span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">Other</span> sources to explore<span class="tok-operator">:</span><span class="tok-operator">*</span><span class="tok-operator">*</span>

<span class="tok-operator">-</span> <span class="tok-operator">*</span><span class="tok-operator">*</span>apple<span class="tok-operator">-</span>archive<span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-operator">:</span> <span class="tok-number">3</span> <span class="tok-function">results</span> (<span class="tok-type">Core</span> <span class="tok-type">Animation</span> <span class="tok-type">Programming</span> <span class="tok-type">Guide</span>, <span class="tok-type">Animation</span> <span class="tok-type">Types</span><span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>)
<span class="tok-operator">-</span> <span class="tok-operator">*</span><span class="tok-operator">*</span>samples<span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-operator">:</span> <span class="tok-number">2</span> <span class="tok-function">results</span> (<span class="tok-type">LayerPlayer</span>, <span class="tok-type">AnimationExplorer</span>)
<span class="tok-operator">-</span> <span class="tok-operator">*</span><span class="tok-operator">*</span>swift<span class="tok-operator">-</span>evolution<span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-operator">:</span> <span class="tok-number">1</span> <span class="tok-function">result</span> (<span class="tok-type">SE</span><span class="tok-number">-0421</span><span class="tok-operator">:</span> <span class="tok-type">Generalize</span> async sequence<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>)

<span class="tok-type">Use</span> `source` parameter to search<span class="tok-operator">:</span> apple<span class="tok-operator">-</span>archive, samples, hig, swift<span class="tok-operator">-</span>evolution<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span></code></pre>
<p>Every search response is now a teaching moment. Claude sees there are archive guides available. It sees sample code exists. It learns <em>in context</em> how to dig deeper.</p>
<h2>Human Interface Guidelines: Design Docs for AI</h2>
<p>Here’s something I didn’t expect to matter as much as it does: HIG support.</p>
<p>Apple’s Human Interface Guidelines aren’t just for designers. When Claude is helping you build a button, a navigation pattern, or a settings screen, it should know Apple’s design recommendations - not just the API.</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"buttons"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source hig</code></pre>
<p>Now when you ask “what’s the recommended button style for destructive actions?”, Claude can actually look it up instead of guessing. Platform-specific guidance for iOS, macOS, watchOS, visionOS - all searchable.</p>
<p>The HIG docs are marked as “universal” for availability - they apply across all OS versions. Design principles don’t deprecate like APIs do.</p>
<h2>One Tool to Rule Them All</h2>
<p>Speaking of simplification - I consolidated the search tools.</p>
<p>Before v0.7.0:</p>
<ul><li><p><code>search_docs</code> - Apple documentation</p></li><li><p><code>search_hig</code> - Human Interface Guidelines</p></li><li><p><code>search_samples</code> - Sample code</p></li><li><p>…and more</p></li></ul>
<p>Now:</p>
<ul><li><p><code>search</code> - Everything, with a <code>source</code> parameter</p></li></ul>
<pre><code class="language-bash"><span class="tok-comment"># CLI</span>
cupertino search <span class="tok-string">"buttons"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source hig
cupertino search <span class="tok-string">"networking"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source samples
cupertino search <span class="tok-string">"actors"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source swift<span class="tok-operator">-</span>evolution
cupertino search <span class="tok-string">"everything"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source all</code></pre>
<p>One tool, eight sources, cleaner mental model. The <code>source</code> parameter accepts:</p>
<ul><li><p><code>apple-docs</code> (default) - API reference</p></li><li><p><code>samples</code> - Working code examples</p></li><li><p><code>hig</code> - Design guidelines</p></li><li><p><code>apple-archive</code> - Legacy conceptual guides</p></li><li><p><code>swift-evolution</code> - Language proposals</p></li><li><p><code>swift-org</code> - Swift.org documentation</p></li><li><p><code>swift-book</code> - The Swift Programming Language</p></li><li><p><code>packages</code> - Swift package docs</p></li><li><p><code>all</code> (searches everything)</p></li></ul>
<p>The <code>all</code> option is surprisingly useful. When you’re not sure where something lives, just search everywhere.</p>
<h2>What I Learned</h2>
<p>Building for AI is different than building for humans.</p>
<p>Humans read documentation. They explore. They remember “oh yeah, there’s an archive section I should check.” AI agents don’t work that way. They have tool descriptions and search results. That’s it.</p>
<p>The best way to teach an AI agent? Put the lesson in every response it sees. Not in documentation it reads once. Not in tool descriptions it might forget. In the actual output, every single time.</p>
<p>That’s why teasers matter. That’s why source-aware messaging matters. Every search result is documentation.</p>
<h2>The Road Ahead</h2>
<p>With 302,424 pages indexed and version filtering working, the foundation is solid. What’s next:</p>
<ol><li><p><strong>Semantic code search</strong> - Search sample code by what it <em>does</em>, not just keywords</p></li><li><p><strong>Framework relationships</strong> - Search UIKit, get relevant Foundation results too</p></li><li><p><strong>Smarter ranking</strong> - Weight results by your target platform</p></li></ol>
<p>The crawl is complete. The curation continues.</p>
<h2>Install or Update</h2>
<pre><code class="language-bash"><span class="tok-comment"># New install</span>
brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Update existing</span>
brew upgrade cupertino

<span class="tok-comment"># Or one-line install</span>
bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>Then:</p>
<pre><code class="language-bash">cupertino setup  <span class="tok-comment"># Download 2.3GB database (~30 seconds)</span>
cupertino serve  <span class="tok-comment"># Start MCP server</span></code></pre>
<p>Try the new features:</p>
<pre><code class="language-bash"><span class="tok-comment"># Filter by OS version</span>
cupertino search <span class="tok-string">"SwiftUI navigation"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>m<span class="tok-keyword">in</span><span class="tok-operator">-</span>ios <span class="tok-number">17</span>

<span class="tok-comment"># Search design guidelines</span>
cupertino search <span class="tok-string">"buttons destructive"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source hig

<span class="tok-comment"># Search legacy conceptual guides</span>
cupertino search <span class="tok-string">"Core Animation"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source apple<span class="tok-operator">-</span>archive

<span class="tok-comment"># Search everything at once</span>
cupertino search <span class="tok-string">"async await"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source all</code></pre>
<hr>
<p><em>Cupertino is an Apple Documentation MCP Server. 302,424 pages of Apple documentation, searchable by AI. Source at <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.5.0: 234K Docs, 287 Frameworks, and the Roadmap Ahead</title>
<link>https://aleahim.com/blog/cupertino-05-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-05-release/</guid>
<pubDate>Thu, 11 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>The biggest documentation update yet - nearly double the docs, plus what&apos;s coming next for the Apple documentation MCP server.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.5.0: 234K Docs, 287 Frameworks, and the Roadmap Ahead</h1>
<p><strong>TL;DR:</strong> Documentation database nearly doubled. New release tooling. A roadmap for what’s next.</p>
<p>Two days after v0.4.0, we’re shipping v0.5.0. Why so fast? Because I finally finished a 5-day deep crawl of Apple’s documentation.</p>
<h2>The Numbers</h2>
<table><thead><tr><th>Metric</th><th>v0.4.0</th><th>v0.5.0</th><th>Change</th></tr></thead><tbody><tr><td>Total Documents</td><td>138,000</td><td>234,331</td><td>+70%</td></tr><tr><td>Frameworks</td><td>263</td><td>287</td><td>+24</td></tr><tr><td>Database Size</td><td>~1.2GB</td><td>~1.9GB</td><td>+58%</td></tr><tr><td>Crawl Time</td><td>20-24 hours</td><td>32-48 hours</td><td>Deeper</td></tr></tbody></table>
<p>The crawl ran for 5 days because I wanted <em>everything</em>. Every framework, every page, every deprecated API. The result: nearly 100,000 more documents than before.</p>
<h3>Top Frameworks by Document Count</h3>
<ol><li><p><strong>Kernel</strong> - 24,747 docs</p></li><li><p><strong>Matter</strong> - 22,013 docs</p></li><li><p><strong>Swift</strong> - 17,466 docs</p></li><li><p><strong>Foundation</strong> - 14,892 docs</p></li><li><p><strong>UIKit</strong> - 12,341 docs</p></li></ol>
<p>Kernel documentation alone has almost 25,000 pages. That’s IOKit, BSD interfaces, Mach APIs - the stuff that’s usually impossible to find.</p>
<h2>What This Means for AI</h2>
<p>When Claude searches Cupertino now, it has access to:</p>
<ul><li><p><strong>Low-level APIs</strong> - Kernel programming, IOKit drivers, Mach ports</p></li><li><p><strong>Hardware interfaces</strong> - Matter protocol (24k+ docs for smart home development)</p></li><li><p><strong>Complete Swift coverage</strong> - Every proposal, every standard library type</p></li><li><p><strong>Obscure frameworks</strong> - The ones you forget exist until you need them</p></li></ul>
<p>This is deterministic access to Apple’s documentation. No hallucination, no guessing from training data. Just the actual docs.</p>
<h2>Why I Built Release Automation</h2>
<p>I remember the release oopsie from v0.4.0 like it was just a few days ago. Wait, it <em>was</em> just a few days ago. 😅 I tagged before committing the version bump, had to delete tags, rebuild everything, update SHA256 checksums twice…</p>
<p>Almost happened again with v0.5.0. Caught it in time, but the close call was enough.</p>
<p>So I finally wrote the automation I’d been putting off. Not because users need it - they don’t. But because <em>I</em> was losing hours to release mechanics instead of building features.</p>
<p>The release process now touches 4 repositories (main repo, cupertino-docs for databases, Homebrew tap, and the blog). Miss one step, wrong order, typo in a version number - and you’re starting over.</p>
<p>Now it’s one command. I run it, go make coffee, come back to a published release. That’s the dream, anyway. We’ll see how v0.6.0 goes.</p>
<h2>The Roadmap</h2>
<p>The current roadmap lives with the <a href="https://codeberg.org/CupertinoHQ/cupertino">Cupertino repository</a>. Here’s what’s coming next, in dependency order:</p>
<h3>Phase 1: Complete the Crawl (#88)</h3>
<p>The crawl is extensive but not complete. Some frameworks have deep hierarchies that weren’t fully traversed. The goal is 100% coverage of Apple’s public documentation.</p>
<p><strong>Status:</strong> In progress. Currently at depth level 8. No idea when it finishes - some frameworks go deep.</p>
<h3>Phase 2: Prune the Database (#87)</h3>
<p>Once we have everything, we need to clean it up. The database has:</p>
<ul><li><p>Duplicate entries (same doc indexed multiple times)</p></li><li><p>Misclassified documents (wrong framework attribution)</p></li><li><p>Orphaned entries from URL changes</p></li></ul>
<p>This is blocked by #88 - no point pruning until the crawl is complete.</p>
<h3>Phase 3: API Version Tracking (#99)</h3>
<p>This is the big one. Apple’s documentation includes version information - which iOS/macOS version introduced each API. We can extract this.</p>
<p>Imagine searching with:</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"async"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>m<span class="tok-keyword">in</span><span class="tok-operator">-</span>os ios<span class="tok-number">16</span></code></pre>
<p>Or having Claude automatically filter out deprecated APIs when you’re targeting iOS 17+.</p>
<p>I’ve been investigating Apple’s <code>/tutorials/data/documentation/</code> endpoint. It returns JSON with version metadata for most frameworks. Some older frameworks (Kernel, IOKit) don’t have it, but the coverage is good.</p>
<p><strong>Status:</strong> Research complete. Implementation pending.</p>
<h3>Phase 4: Version-Filtered Search (#100)</h3>
<p>Once we have version data in the database, we can expose it as a search filter. Both CLI and MCP tool would support filtering by minimum OS version.</p>
<p><strong>Blocked by:</strong> #99 (need the data first)</p>
<h3>Phase 5: Semantic Code Search (#81)</h3>
<p>The end goal: search sample code by what it <em>does</em>, not just by keyword.</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"async image loading with caching"</span></code></pre>
<p>This requires:</p>
<ol><li><p>Complete documentation (#88)</p></li><li><p>Clean database (#87)</p></li><li><p>SwiftSyntax AST indexing of sample code</p></li></ol>
<p>It’s ambitious, but the foundation is being laid with each release.</p>
<h2>Install or Update</h2>
<pre><code class="language-bash"><span class="tok-comment"># New install</span>
brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino

<span class="tok-comment"># Update</span>
brew upgrade cupertino

<span class="tok-comment"># Or instant setup</span>
bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>After installing, databases download automatically:</p>
<pre><code class="language-bash">cupertino setup</code></pre>
<p>Takes about 30 seconds to download the pre-built 1.9GB database.</p>
<h2>The Vision: Human-Curated Developer Docs</h2>
<p>Here’s what I’ve learned: having <em>all</em> the docs isn’t enough. We need them <em>in context</em>.</p>
<p>When you’re building an app targeting iOS 15+, you don’t want to see iOS 12 APIs. When you’re learning Core Animation, you want the conceptual guides from Apple Archive, not just the API reference. When you’re debugging a Matter integration, you need the 22,000 Matter docs filtered to what’s actually relevant.</p>
<p>Raw documentation is noise. Curated documentation is signal.</p>
<p>That’s where Cupertino is heading. Not just “here’s 234,331 docs” but “here’s what you actually need for your specific context.” Version filtering is coming - ask for iOS 16+ APIs only. Source awareness is coming - archive guides surfaced alongside modern reference. Framework relationships are coming - search UIKit and get relevant Foundation results too.</p>
<p>The crawl is the foundation. The curation is the value.</p>
<p>234,331 documents today. Context-aware, version-filtered, human-curated search tomorrow.</p>
<hr>
<p><em>Cupertino is an Apple Documentation MCP Server. Install with <code>brew tap cupertinohq/tap https://codeberg.org/CupertinoHQ/homebrew-tap.git brew install cupertinohq/tap/cupertino</code>. Source at <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.4.0: HIG Support, Framework Aliases, and Release Engineering Lessons</title>
<link>https://aleahim.com/blog/cupertino-04-release/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-04-release/</guid>
<pubDate>Tue, 09 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>New features for Apple documentation search, plus a cautionary tale about release processes and why order matters when tagging.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.4.0: HIG Support, Framework Aliases, and Release Engineering Lessons</h1>
<p><strong>TL;DR:</strong> Human Interface Guidelines support, smarter framework search, and a hard lesson about release engineering.</p>
<p>Why jump from 0.3.4 to 0.4.0? Five issues closed: HIG support (#69), framework aliases (#91, #92), and Swift.org fixes (#93, #94). Enough new functionality to warrant a minor version bump.</p>
<h2>What’s New</h2>
<h3>Human Interface Guidelines Support</h3>
<p>Cupertino can now crawl and index Apple’s Human Interface Guidelines:</p>
<pre><code class="language-bash">cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>type hig</code></pre>
<p>There’s also a new <code>search_hig</code> MCP tool that lets AI agents search design guidelines with platform and category filters. When you ask Claude “what are Apple’s recommendations for buttons?”, it can actually look it up instead of guessing from training data.</p>
<p>Everything available via MCP tools is also available via command line:</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"buttons"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>source hig</code></pre>
<p>This is something people might not realize: you can query Cupertino the same way AI does. Every MCP tool has a CLI equivalent. Want to see exactly what Claude sees when it searches? Run the same query yourself. Useful for testing, debugging, or when you just want quick answers without a conversation.</p>
<h3>Framework Aliases</h3>
<p>Before, searching for “Core Animation” might not find results indexed under “QuartzCore” (the actual import name). Now there are 249 framework aliases in the database:</p>
<ul><li><p><code>QuartzCore</code> ↔ <code>CoreAnimation</code> ↔ <code>Core Animation</code></p></li><li><p><code>CoreGraphics</code> ↔ <code>Quartz2D</code> ↔ <code>Quartz 2D</code></p></li></ul>
<p>Search works regardless of which name variant you use.</p>
<h3>Swift.org Fixes</h3>
<p>The Swift.org crawler was broken. The base URL had changed from <code>docs.swift.org</code> to <code>www.swift.org/documentation/</code>, and the indexer was looking for <code>.md</code> files when the crawler was saving <code>.json</code> files. Fixed.</p>
<h2>Why This Matters</h2>
<p>Here’s a real example from today. I asked Claude about Apple’s Foundation Models framework - the new on-device ML APIs. Claude’s response:</p>
<blockquote><p>“The MCP server pulls the complete Foundation Models sample code documentation - straight from Apple’s current docs. No hallucinated API names!”</p></blockquote>
<p>More examples of documentation you can search:</p>
<ul><li><p><strong>FoundationModels</strong> - Apple’s new on-device ML framework</p></li><li><p><strong>Writing Tools</strong> - System-wide AI writing assistance</p></li><li><p><strong>Genmoji</strong> - Custom emoji generation</p></li><li><p><strong>Image Playground</strong> - On-device image generation</p></li></ul>
<p>This is also why Cupertino needs a human touch - it can’t be fully automated. Someone has to notice when Apple adds new frameworks, when URLs change (like Swift.org did), when documentation structures shift. The crawler is automated, but the awareness isn’t.</p>
<p>That’s the whole point: deterministic, up-to-date docs instead of training data guesses.</p>
<h3>Token Efficiency</h3>
<p>A side benefit: Cupertino is more token-efficient than you’d expect.</p>
<p>Yes, tool results use tokens - documentation goes into context. But:</p>
<ul><li><p><strong>Accurate = fewer turns</strong> - No hallucination means no correction loop</p></li><li><p><strong>Curated content</strong> - Returns exactly what’s needed, not web search noise</p></li><li><p><strong>Local search is free</strong> - No API cost for the search operation itself</p></li><li><p><strong>Truncated summaries</strong> - Results are summarized; full doc only when you call <code>read_document</code></p></li></ul>
<p>So not zero tokens, but more <em>efficient</em> token use. And no external API costs for search.</p>
<h2>The Archive Discovery Problem</h2>
<p>Here’s something interesting I discovered while testing. When Claude searched for “CALayer animation”, it got API reference pages - classes, methods, properties. Claude wanted to dig deeper:</p>
<blockquote><p>“Let me try a more targeted search - something like the layer tree architecture or model/presentation layers that would be covered in the Core Animation Programming Guide.”</p></blockquote>
<p>Then I suggested searching with <code>source: "apple-archive"</code>. Claude’s reaction:</p>
<blockquote><p>“Now THAT’s the difference! When searching with source: apple-archive, we get the Core Animation Programming Guide and the Animation Types and Timing Programming Guide - the real meat.”</p></blockquote>
<p>The conceptual deep-dives that explain <em>why</em> things work the way they do.</p>
<p>Modern Apple docs = API reference (the <em>what</em>)
Archive docs = Conceptual guides (the <em>why</em>)</p>
<p>The problem? AI agents don’t know to search the archive. It’s an opt-in parameter buried in the tool description.</p>
<h3>The Solution: Auto-Surface Archive Teasers</h3>
<p>I’m planning to modify search results to automatically hint at archive content:</p>
<pre><code class="language-markdown"># <span class="tok-type">Search</span> <span class="tok-type">Results</span> <span class="tok-keyword">for</span> <span class="tok-string">"CALayer animation"</span>

## <span class="tok-type">Modern</span> <span class="tok-type">Documentation</span>
[<span class="tok-number">1</span>] <span class="tok-type">CALayer</span> <span class="tok-operator">-</span> <span class="tok-type">API</span> reference<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
[<span class="tok-number">2</span>] <span class="tok-type">CABasicAnimation</span> <span class="tok-operator">-</span> <span class="tok-type">API</span> reference<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>

<span class="tok-operator">-</span><span class="tok-operator">-</span><span class="tok-operator">-</span>

## 📚 <span class="tok-type">Related</span> <span class="tok-type">Archive</span> <span class="tok-type">Guides</span>

<span class="tok-operator">*</span><span class="tok-operator">*</span><span class="tok-type">Core</span> <span class="tok-type">Animation</span> <span class="tok-type">Programming</span> <span class="tok-type">Guide</span><span class="tok-operator">*</span><span class="tok-operator">*</span> <span class="tok-operator">-</span> <span class="tok-type">Layer</span> geometry, animation timing<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>

<span class="tok-operator">&gt;</span> <span class="tok-keyword">For</span> full archive content, search with `source<span class="tok-operator">:</span> <span class="tok-string">"apple-archive"</span>`</code></pre>
<p>This way:</p>
<ul><li><p>Modern docs still come first</p></li><li><p>AI agents always see archive exists</p></li><li><p>They learn how to get more, in context</p></li></ul>
<p>Only show the archive section if there are relevant results. Same principle could apply to sample code, Swift packages, or any other source.</p>
<h2>The Release Process Disaster</h2>
<p>Here’s where it gets interesting. I had all the code ready, all the tests passing, and I was ready to ship.</p>
<p>The process seemed simple:</p>
<ol><li><p>Bump version in <code>Constants.swift</code></p></li><li><p>Update <code>README.md</code> and <code>CHANGELOG.md</code></p></li><li><p>Create git tag</p></li><li><p>Push tag (triggers GitHub Actions build)</p></li><li><p>Upload databases to <code>cupertino-docs</code></p></li><li><p>Update Homebrew formula</p></li></ol>
<p>What could go wrong?</p>
<h3>The Tag Timing Problem</h3>
<p>I merged my feature branch, created the tag, pushed it… and then realized I hadn’t committed the version bump to <code>main</code> yet. The tag pointed to a commit where <code>Constants.swift</code> still said <code>0.3.5</code>.</p>
<p>GitHub Actions dutifully built a beautiful, signed, notarized universal binary… that reported version <code>0.3.5</code>.</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span>version
<span class="tok-number">0.3.5</span></code></pre>
<p>When users ran <code>cupertino setup</code>, it tried to download databases from <code>v0.3.5</code> instead of <code>v0.4.0</code>. Everything was broken.</p>
<h3>The Fix</h3>
<p>I had to:</p>
<ol><li><p>Delete the tag on GitHub</p></li><li><p>Delete the local tag</p></li><li><p>Make sure the version bump commit was pushed to <code>main</code></p></li><li><p>Verify the built binary reports correct version <strong>before</strong> tagging</p></li><li><p>Recreate the tag</p></li><li><p>Wait for GitHub Actions to rebuild</p></li><li><p>Update the Homebrew formula with the new SHA256</p></li></ol>
<h3>The SHA256 Dance</h3>
<p>When I first updated the Homebrew formula, I grabbed the SHA256 from the old (broken) binary. After rebuilding, the checksum changed. Users got:</p>
<pre><code>Error: Formula reports different checksum: cf035352...
SHA-256 checksum of downloaded file: 5c5cf7ab...</code></pre>
<p>Another round of updating the tap.</p>
<h2>The 11-Step Release Process</h2>
<p>After today’s adventures, here’s what the release process actually looks like:</p>
<ol><li><p>Update version in <code>Constants.swift</code>, <code>README.md</code>, <code>CHANGELOG.md</code></p></li><li><p>Commit and push to main</p></li><li><p>Build locally and verify <code>--version</code> matches</p></li><li><p>Create and push tag</p></li><li><p>Wait for GitHub Actions (~5 min)</p></li><li><p>Create GitHub release with notes</p></li><li><p>Build locally and install</p></li><li><p>Upload databases with <code>cupertino release</code></p></li><li><p>Get new SHA256 from release</p></li><li><p>Update Homebrew tap formula</p></li><li><p>Verify on fresh machine</p></li></ol>
<p>That’s 11 steps across 4 repositories. Miss one, and you’re rebuilding everything.</p>
<h2>Time for Automation?</h2>
<p>I’m seriously considering writing a release script. Swift or Bash?</p>
<p>The pragmatic choice is Bash - it’s just orchestrating CLI commands. But I’m a Swift purist. The <code>cupertino release</code> command already handles database uploads with proper GitHub API integration. Extending it to handle the full workflow feels right.</p>
<p>Something like <code>cupertino release --full</code> that:</p>
<ol><li><p>Checks for uncommitted changes</p></li><li><p>Verifies version consistency</p></li><li><p>Builds and validates <code>--version</code></p></li><li><p>Creates and pushes the tag</p></li><li><p>Waits for GitHub Actions</p></li><li><p>Uploads databases</p></li><li><p>Updates the Homebrew tap</p></li></ol>
<p>One command. No mistakes. Written in Swift.</p>
<h2>Lessons Learned</h2>
<ol><li><p><strong>Order matters.</strong> Commit the version bump before creating the tag.</p></li><li><p><strong>Verify before you ship.</strong> Build locally and check <code>--version</code> before tagging.</p></li><li><p><strong>Document your release process.</strong> I now have a detailed <code>DEPLOYMENT.md</code> with warnings.</p></li><li><p><strong>Automate what hurts.</strong> If you make the same mistake twice, write a script.</p></li></ol>
<h2>What’s Next</h2>
<ul><li><p><strong>Enhanced search results</strong> - Auto-surface archive, samples, packages in every search (high priority)</p></li><li><p><strong>Release automation</strong> - <code>cupertino release --full</code> in Swift</p></li><li><p><strong>Fix setup animations</strong> - They’re broken</p></li><li><p><strong>Keep crawling</strong> - Fresh docs matter</p></li></ul>
<p>This release taught me a lot. Not just about release engineering, but about how AI agents actually use documentation. The archive discovery problem was a surprise - valuable content hidden behind an opt-in flag that agents don’t know to use.</p>
<p>Building tools for AI is different. You’re not just building for humans who read documentation. You’re building for agents that learn from tool descriptions and in-context hints.</p>
<p>Key discovery: Claude reads tool descriptions once, but reads search results every time. If you want agents to use a feature, put it in the output - not buried in documentation they’ll forget. Every search result is a teaching moment.</p>
<p>Next up: implementing enhanced search results. Once that ships, every search will auto-surface relevant content from archives, samples, and packages - with the exact commands to dig deeper. No more hidden treasure.</p>
<hr>
<p><em>Cupertino is an Apple Documentation MCP Server. Install with <code>brew tap cupertinohq/tap https://codeberg.org/CupertinoHQ/homebrew-tap.git brew install cupertinohq/tap/cupertino</code>. Check it out at <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a>.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.3.4: One-Line Install &amp; 150K+ Apple Docs</title>
<link>https://aleahim.com/blog/cupertino-one-line-install/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-one-line-install/</guid>
<pubDate>Sat, 06 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>Install Cupertino with a single command - signed, notarized, and ready in seconds. Now with 150,000+ Apple documentation pages.</description>
<content:encoded><![CDATA[<h1>Cupertino v0.3.4: One-Line Install &amp; 150K+ Apple Docs</h1>
<p><strong>TL;DR:</strong> One command installs everything. Homebrew is also available.</p>
<pre><code class="language-bash">bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<h2>What Changed</h2>
<p>In v0.3.0, I introduced <code>cupertino setup</code> to download pre-built databases. But you still had to clone the repo and build from source first. That’s two steps too many.</p>
<p>Now it’s one line:</p>
<pre><code class="language-bash">bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>This:</p>
<ol><li><p>Downloads a pre-built universal binary (arm64 + x86_64)</p></li><li><p>Installs to <code>/usr/local/bin</code></p></li><li><p>Downloads documentation databases (~230 MB)</p></li></ol>
<p>Total time: under a minute.</p>
<h2>Signed and Notarized</h2>
<p>Getting a command-line tool to “just work” on macOS is harder than it sounds. Without proper signing, users see scary “unidentified developer” warnings. Without notarization, Gatekeeper blocks execution entirely.</p>
<p>The release workflow now handles this automatically:</p>
<ol><li><p><strong>GitHub Actions</strong> builds a universal binary (arm64 + x86_64) on every release tag</p></li><li><p><strong>Developer ID signing</strong> with my Apple Developer certificate</p></li><li><p><strong>Apple notarization</strong> submits to Apple’s servers for malware scanning</p></li><li><p><strong>Preserved signatures</strong> using <code>ditto</code> instead of <code>cp</code> to maintain code signing through the install process</p></li></ol>
<p>The result: download, install, run. No security dialogs. No right-click workarounds. No “are you sure?” prompts.</p>
<p>This took several iterations to get right—the signing must happen in CI, notarization requires waiting for Apple’s servers, and even copying the file wrong can strip the signature. But now it’s automated and works every time.</p>
<h2>Homebrew Support</h2>
<p>Prefer Homebrew? Now available:</p>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup</code></pre>
<p>Three lines instead of one, but integrates with your existing Homebrew workflow.</p>
<h2>150,000+ Apple Documentation Pages</h2>
<p>The database has grown significantly:</p>
<table><thead><tr><th>Version</th><th>Documentation Pages</th><th>Sample Projects</th></tr></thead><tbody><tr><td>v0.2.x</td><td>~21,000</td><td>606</td></tr><tr><td>v0.3.0</td><td>~138,000</td><td>606</td></tr><tr><td>v0.3.4</td><td>~150,000+</td><td>606</td></tr></tbody></table>
<p>More coverage means better search results for your AI assistant.</p>
<h2>Demo Video</h2>
<p>Watch the one-line install and Claude Desktop in action:</p>
<p><a href="https://youtu.be/B-mRdainTMA"><img src="https://img.youtube.com/vi/B-mRdainTMA/0.jpg" alt="Demo Video"></a></p>
<h2>Three Install Methods</h2>
<h3>1. One-Line Install (Recommended)</h3>
<pre><code class="language-bash">bash <span class="tok-operator">&lt;</span>(curl <span class="tok-operator">-</span>sSL https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>raw<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>install<span class="tok-operator">.</span>sh)</code></pre>
<p>Downloads binary and databases. Ready in under a minute.</p>
<h3>2. Homebrew</h3>
<pre><code class="language-bash">brew tap cupertinohq<span class="tok-operator">/</span>tap https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>homebrew<span class="tok-operator">-</span>tap<span class="tok-operator">.</span>git
brew install cupertinohq<span class="tok-operator">/</span>tap<span class="tok-operator">/</span>cupertino
cupertino setup</code></pre>
<p>Integrates with Homebrew for updates via <code>brew upgrade cupertino</code>.</p>
<h3>3. Build from Source</h3>
<pre><code class="language-bash">git clone https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">.</span>git
cd cupertino <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> make build <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> su<span class="tok-keyword">do</span> make install
cupertino setup</code></pre>
<p>For those who want to inspect or modify the code.</p>
<h2>What’s Inside</h2>
<p>After installation, you have:</p>
<ul><li><p><code>/usr/local/bin/cupertino</code> - The MCP server binary</p></li><li><p><code>~/.cupertino/search.db</code> - 150K+ documentation pages</p></li><li><p><code>~/.cupertino/samples.db</code> - 606 sample projects, 18K+ source files</p></li></ul>
<p>Start the server and configure Claude Desktop:</p>
<pre><code class="language-bash">cupertino serve</code></pre>
<pre><code class="language-json"><span class="tok-operator">{</span>
  <span class="tok-property">"mcpServers"</span><span class="tok-operator">:</span> <span class="tok-operator">{</span>
    <span class="tok-property">"cupertino"</span><span class="tok-operator">:</span> <span class="tok-operator">{</span>
      <span class="tok-property">"command"</span><span class="tok-operator">:</span> <span class="tok-string">"/usr/local/bin/cupertino"</span>
    <span class="tok-operator">}</span>
  <span class="tok-operator">}</span>
<span class="tok-operator">}</span></code></pre>
<h2>Registry Submissions</h2>
<p>I’ve submitted Cupertino to the major MCP server registries:</p>
<ul><li><p><a href="https://mcpservers.org">mcpservers.org</a></p></li><li><p><a href="https://www.pulsemcp.com/">PulseMCP</a></p></li><li><p><a href="https://github.com/punkpeye/awesome-mcp-servers">awesome-mcp-servers</a></p></li></ul>
<p>These directories help developers discover MCP servers—getting listed would bring more visibility to the Apple developer community.</p>
<h2>Links</h2>
<ul><li><p><strong>Codeberg:</strong> <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a></p></li><li><p><strong>Homebrew Tap:</strong> <a href="https://codeberg.org/CupertinoHQ/homebrew-tap">codeberg.org/CupertinoHQ/homebrew-tap</a></p></li><li><p><strong>Demo Video:</strong> <a href="https://youtu.be/B-mRdainTMA">YouTube</a></p></li></ul>
<hr>
<p><em>The best install experience is no install experience. One line is close enough.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino v0.3.0: From 20 Hours to 30 Seconds</title>
<link>https://aleahim.com/blog/cupertino-instant-setup/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-instant-setup/</guid>
<pubDate>Fri, 05 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>The new setup command downloads pre-built databases instantly - no more crawling Apple&apos;s documentation for hours</description>
<content:encoded><![CDATA[<h1>Cupertino v0.3.0: From 20 Hours to 30 Seconds</h1>
<p><strong>TL;DR:</strong> <code>cupertino setup</code> now downloads pre-built databases in ~30 seconds. No more 20-hour crawls.</p>
<h2>The Problem With v0.2.x</h2>
<p>When I released Cupertino, the setup process looked like this:</p>
<pre><code class="language-bash">cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>type docs <span class="tok-operator">-</span><span class="tok-operator">-</span>max<span class="tok-operator">-</span>pages <span class="tok-number">15000</span>  <span class="tok-comment"># ~20-24 hours</span>
cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>type evolution               <span class="tok-comment"># ~5 minutes</span>
cupertino save                                 <span class="tok-comment"># ~5 minutes</span></code></pre>
<p>Twenty hours. To respect Apple’s servers, the crawler waits 0.5 seconds between requests. 21,000 pages × 0.5s = a very long initial setup.</p>
<p>Users loved the tool but hated the onboarding. Fair.</p>
<h2>The Solution: Pre-built Databases</h2>
<p>Instead of everyone crawling Apple’s documentation independently, I now publish pre-built databases on GitHub Releases. The new setup flow:</p>
<pre><code class="language-bash">cupertino setup   <span class="tok-comment"># ~30 seconds</span>
cupertino serve   <span class="tok-comment"># Start MCP server</span></code></pre>
<p>That’s it. Two commands. Under a minute.</p>
<h2>How It Works</h2>
<h3>For Users</h3>
<p>The <code>setup</code> command downloads a zip file from GitHub Releases containing:</p>
<ul><li><p><code>search.db</code> (~1.1 GB) - 138,000+ documentation pages</p></li><li><p><code>samples.db</code> (~183 MB) - 606 sample projects, 18,000+ source files</p></li></ul>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino setup

📦 Cupertino Setup

⬇️  Downloading Databases<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
   ⠹ [████████████████░░░░░░░░░░░░░░]  <span class="tok-number">53</span><span class="tok-operator">%</span> (<span class="tok-number">121.0</span> MB<span class="tok-operator">/</span><span class="tok-number">228.1</span> MB)
   ✓ <span class="tok-function">Databases</span> (<span class="tok-number">228.1</span> MB)
📂 Extracting databases<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
   ✓ Extracted

✅ Setup complete<span class="tok-operator">!</span>
   Documentation<span class="tok-operator">:</span> <span class="tok-operator">/</span>Users<span class="tok-operator">/</span>you<span class="tok-operator">/</span><span class="tok-operator">.</span>cupertino<span class="tok-operator">/</span>search<span class="tok-operator">.</span>db
   Sample code<span class="tok-operator">:</span>   <span class="tok-operator">/</span>Users<span class="tok-operator">/</span>you<span class="tok-operator">/</span><span class="tok-operator">.</span>cupertino<span class="tok-operator">/</span>samples<span class="tok-operator">.</span>db

💡 Start the server with<span class="tok-operator">:</span> cupertino serve</code></pre>
<p>If databases already exist, it skips the download:</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino setup

📦 Cupertino Setup

✅ Databases already exist
   Documentation<span class="tok-operator">:</span> <span class="tok-operator">/</span>Users<span class="tok-operator">/</span>you<span class="tok-operator">/</span><span class="tok-operator">.</span>cupertino<span class="tok-operator">/</span>search<span class="tok-operator">.</span>db
   Sample code<span class="tok-operator">:</span>   <span class="tok-operator">/</span>Users<span class="tok-operator">/</span>you<span class="tok-operator">/</span><span class="tok-operator">.</span>cupertino<span class="tok-operator">/</span>samples<span class="tok-operator">.</span>db

💡 Use <span class="tok-operator">-</span><span class="tok-operator">-</span>force to overwrite with latest version
💡 Start the server with<span class="tok-operator">:</span> cupertino serve</code></pre>
<h3>For Me (Maintainer)</h3>
<p>A new <code>release</code> command automates publishing:</p>
<pre><code class="language-bash"><span class="tok-property">$</span> cupertino release

📦 Cupertino Release v<span class="tok-number">0.3.0</span>

📊 Database sizes<span class="tok-operator">:</span>
   search<span class="tok-operator">.</span>db<span class="tok-operator">:</span>  <span class="tok-number">1.2</span> GB
   samples<span class="tok-operator">.</span>db<span class="tok-operator">:</span> <span class="tok-number">192.2</span> MB

📁 Creating cupertino<span class="tok-operator">-</span>databases<span class="tok-operator">-</span>v<span class="tok-number">0.3.0.</span>zip<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
   ✓ <span class="tok-function">Created</span> (<span class="tok-number">228.3</span> MB)

🔐 Calculating SHA<span class="tok-number">256...</span>
   <span class="tok-number">17</span>dac<span class="tok-number">4</span>b<span class="tok-number">84</span>adaa<span class="tok-number">04</span>b<span class="tok-number">5</span>f<span class="tok-number">976</span>a<span class="tok-number">7</span>d<span class="tok-number">1</span>b<span class="tok-number">9126630545</span>f<span class="tok-number">0101</span>fe<span class="tok-number">84</span>ca<span class="tok-number">5423163</span>da<span class="tok-number">886386</span>a<span class="tok-number">6</span>

🚀 Creating release v<span class="tok-number">0.3.0...</span>
   ✓ Release created

⬆️  Uploading cupertino<span class="tok-operator">-</span>databases<span class="tok-operator">-</span>v<span class="tok-number">0.3.0.</span>zip<span class="tok-operator">.</span><span class="tok-operator">.</span><span class="tok-operator">.</span>
   ✓ Upload complete

✅ Release v<span class="tok-number">0.3.0</span> published<span class="tok-operator">!</span>
   https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">/</span>src<span class="tok-operator">/</span>branch<span class="tok-operator">/</span>ma<span class="tok-keyword">in</span><span class="tok-operator">/</span>docs<span class="tok-operator">/</span>artifacts</code></pre>
<p>When I refresh the documentation (re-crawl Apple’s docs), I bump the version and run <code>cupertino release</code>. Users get the update with <code>cupertino setup --force</code>.</p>
<h2>Version Parity</h2>
<p>The CLI version matches the database release tag:</p>
<table><thead><tr><th>CLI Version</th><th>Release Tag</th><th>Database</th></tr></thead><tbody><tr><td>0.3.0</td><td>v0.3.0</td><td>cupertino-databases-v0.3.0.zip</td></tr><tr><td>0.4.0</td><td>v0.4.0</td><td>cupertino-databases-v0.4.0.zip</td></tr></tbody></table>
<p>This ensures schema compatibility. If I change the database structure in v0.4.0, users with CLI v0.4.0 will download v0.4.0 databases.</p>
<h2>Three Ways to Set Up Cupertino</h2>
<p>Now you have options:</p>
<h3>1. Instant Setup (Recommended)</h3>
<pre><code class="language-bash">cupertino setup    <span class="tok-comment"># ~30 seconds</span>
cupertino serve</code></pre>
<p>Download pre-built databases. Fastest option.</p>
<h3>2. Build from GitHub</h3>
<pre><code class="language-bash">cupertino save <span class="tok-operator">-</span><span class="tok-operator">-</span>remote    <span class="tok-comment"># ~45 minutes</span>
cupertino serve</code></pre>
<p>Stream documentation from GitHub and build locally. Useful if you want to verify the build process or can’t download the 228MB zip.</p>
<h3>3. Full Crawl (Advanced)</h3>
<pre><code class="language-bash">cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>type docs <span class="tok-operator">-</span><span class="tok-operator">-</span>max<span class="tok-operator">-</span>pages <span class="tok-number">15000</span>    <span class="tok-comment"># ~20-24 hours</span>
cupertino fetch <span class="tok-operator">-</span><span class="tok-operator">-</span>type evolution
cupertino save
cupertino serve</code></pre>
<p>Crawl Apple’s documentation yourself. Only needed if you want to modify the crawler or need documentation not in the pre-built database.</p>
<h2>Compression Matters</h2>
<p>The uncompressed databases total ~1.3 GB. The zip file is 228 MB - about 1/6 the size. SQLite databases compress extremely well because they contain repetitive text data.</p>
<p>This makes the download fast and keeps GitHub Release storage reasonable.</p>
<h2>Database Updates</h2>
<p>I’m actively crawling Apple’s documentation and updating the databases several times a week. Run <code>cupertino setup --force</code> to get the latest version.</p>
<p>The current public material lives with the main Cupertino repository:</p>
<ul><li><p><strong><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/artifacts">Database artifacts</a></strong> - Pre-crawled documentation and database material</p></li><li><p><strong><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/sources/samples">Sample source definitions</a></strong> - Apple sample code source metadata</p></li></ul>
<h2>What’s Next</h2>
<ul><li><p><strong>Automatic updates</strong> - Check for new database versions on startup</p></li><li><p><strong>Delta updates</strong> - Download only changed documents instead of full database</p></li><li><p><strong>More documentation sources</strong> - WWDC transcripts, Apple Tech Notes</p></li></ul>
<h2>Try It</h2>
<pre><code class="language-bash"><span class="tok-comment"># Install</span>
git clone https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino<span class="tok-operator">.</span>git
cd cupertino <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> make build <span class="tok-operator">&amp;</span><span class="tok-operator">&amp;</span> su<span class="tok-keyword">do</span> make install

<span class="tok-comment"># Setup (the new way)</span>
cupertino setup
cupertino serve</code></pre>
<p>Configure Claude Desktop and you’re done. Full Apple documentation access in under a minute.</p>
<h2>Links</h2>
<ul><li><p><strong>Codeberg:</strong> <a href="https://codeberg.org/CupertinoHQ/cupertino">codeberg.org/CupertinoHQ/cupertino</a></p></li><li><p><strong>Tag:</strong> <a href="https://codeberg.org/CupertinoHQ/cupertino/src/tag/v0.3.0">v0.3.0</a></p></li><li><p><strong>Databases:</strong> <a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/artifacts">Cupertino artifacts</a></p></li></ul>
<hr>
<p><em>The best feature is the one that removes friction. Twenty hours of crawling was friction.</em></p>]]></content:encoded>
</item>
<item>
<title>Cupertino: 27 Issues Down, Just Getting Started</title>
<link>https://aleahim.com/blog/cupertino-ecosystem/</link>
<guid isPermaLink="true">https://aleahim.com/blog/cupertino-ecosystem/</guid>
<pubDate>Wed, 03 Dec 2025 00:00:00 +0000</pubDate>
<dc:creator>Mihaela Mihaljević</dc:creator>
<description>From MCP server to a complete Apple documentation ecosystem with pre-crawled docs and 606 sample projects</description>
<content:encoded><![CDATA[<p>I’m currently working on two macOS apps, and I rely heavily on Claude Code to help me ship faster. But here’s the thing—I kept hitting the same wall: hallucinated APIs, outdated patterns, confident suggestions for methods that don’t exist.</p>
<p>I’m not alone. Developers everywhere report the same issues: AI suggesting <code>@ObservableObject</code> and <code>@Published</code> when Apple now recommends <code>@Observable</code>. Xcode 26’s AI integration <a href="https://fline.dev/blog/why-im-not-using-xcode-26s-ai-chat-integration-and-what-could-change-my-mind/">hallucinating 100% of the time</a> when asked about new 2025 frameworks. One developer described fixing AI-generated Swift code as <a href="https://medium.com/@agnislav/one-more-chatgpt-vs-claude-comparison-for-macos-development-8cae53ec7c3e">“whack-a-mole”</a>—fix one obsolete API, another pops up.</p>
<p>That frustration is why I built Cupertino.</p>
<p>In my <a href="https://aleahim.com/blog/cupertino/">previous post</a>, I introduced it—an MCP server that gives Claude offline access to 22,000+ Apple documentation pages. That was version 0.1.x. Since then, things have evolved rapidly: nine releases in 72 hours, two new companion repositories, and a complete ecosystem for AI-assisted Apple development.</p>
<p>I need this tool. I use it every day. And I’m building it in public because I know I’m not the only one frustrated with AI that hallucinates Apple APIs.</p>
<h2>What Changed: v0.1.6 → v0.2.3</h2>
<p>The original Cupertino solved the core problem—searching Apple docs locally. But real-world usage revealed gaps: ranking wasn’t smart enough, storage was bloated, and legacy documentation was missing. Here’s what shipped:</p>
<h3>Intelligent Ranking (v0.2.1)</h3>
<p>The initial BM25 search treated all documents equally. A query for “View” might return some random extension before <code>SwiftUI.View</code> itself. Eight ranking heuristics now prioritize:</p>
<ul><li><p><strong>Core types over extensions</strong> - <code>View</code> ranks above <code>View+Accessibility</code></p></li><li><p><strong>URL depth analysis</strong> - <code>/documentation/swiftui/view</code> beats <code>/documentation/swiftui/view/some/nested/thing</code></p></li><li><p><strong>Title pattern detection</strong> - Exact matches surface first</p></li><li><p><strong>Modern over deprecated</strong> - Current APIs rank higher</p></li></ul>
<p>The result: sub-100ms queries that actually return what you’re looking for.</p>
<h3>Storage Cleanup (v0.1.8, v0.2.0)</h3>
<p>The initial crawl produced ~27GB of data. Most of it was cruft: <code>.git</code> folders from sample code downloads, <code>.DS_Store</code> files, Xcode user data. A new <code>cleanup</code> command reduced storage to 2-3GB—a 90% reduction.</p>
<p>Version 0.2.0 fixed a critical bug where cleanup was accidentally deleting source code instead of just metadata. Now 99.8% of sample ZIPs retain intact source.</p>
<h3>Language Filtering (v0.1.9)</h3>
<p>Not everyone wants Objective-C results. The CLI and MCP tools now accept a <code>language</code> parameter:</p>
<pre><code class="language-bash">cupertino search <span class="tok-string">"NSObject"</span> <span class="tok-operator">-</span><span class="tok-operator">-</span>language swift</code></pre>
<p>Claude can filter too—just ask for “Swift-only results.”</p>
<h3>Apple Archive Support (v0.2.3)</h3>
<p>Apple’s modern documentation is great, but some topics only exist in the legacy archive: Core Animation Programming Guide, Quartz 2D Programming Guide, Core Text Programming Guide. These are still the authoritative sources for low-level graphics work.</p>
<p>Cupertino now crawls <code>developer.apple.com/library/archive/</code> and integrates results with smart ranking that prioritizes modern docs while keeping legacy content searchable.</p>
<h2>The Ecosystem: Three Repositories</h2>
<p>Cupertino grew from one repo to three:</p>
<h3><a href="https://codeberg.org/CupertinoHQ/cupertino">cupertino</a> — The MCP Server</h3>
<p>The main Swift package. Crawls, indexes, and serves documentation via MCP protocol. Install it, point Claude at it, done.</p>
<pre><code class="language-bash"><span class="tok-comment"># Quick setup with Claude Code</span>
claude mcp add cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span>scope user <span class="tok-operator">-</span><span class="tok-operator">-</span> <span class="tok-operator">/</span>usr<span class="tok-operator">/</span><span class="tok-keyword">local</span><span class="tok-operator">/</span>b<span class="tok-keyword">in</span><span class="tok-operator">/</span>cupertino</code></pre>
<h3><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/artifacts">Cupertino database artifacts</a> — Pre-Crawled Documentation</h3>
<p>Don’t want to crawl everything yourself? Install Cupertino and populate the local databases:</p>
<pre><code class="language-bash">cupertino setup</code></pre>
<p>Currently includes:</p>
<table><thead><tr><th>Source</th><th>Content</th><th>Status</th></tr></thead><tbody><tr><td><code>swift-evolution/</code></td><td>All Swift proposals (~400)</td><td>Ready</td></tr><tr><td><code>swift-org/</code></td><td>Swift.org language docs</td><td>Ready</td></tr><tr><td><code>packages/</code></td><td>Swift Package Index metadata</td><td>Ready</td></tr><tr><td><code>docs/</code></td><td>Apple Developer Documentation (13K+ pages)</td><td>WIP - requires manual crawl</td></tr><tr><td><code>archive/</code></td><td>Legacy Apple guides</td><td>WIP - requires manual crawl</td></tr></tbody></table>
<p>Swift Evolution, Swift.org, and package docs are pre-indexed and ready. Apple Developer Documentation and Archive still require running <code>cupertino fetch</code> yourself due to size—but having the infrastructure in place is a start. The tooling exists; full pre-crawled distribution is coming.</p>
<h3><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/sources/samples">Cupertino sample sources</a> — Apple Samples</h3>
<p>This is the fun one. Every official Apple sample code project, cleaned and ready to build:</p>
<ul><li><p><strong>100+ frameworks covered</strong>: SwiftUI, ARKit, RealityKit, Metal, CoreML, Vision, AVFoundation, HealthKit, HomeKit, and more</p></li><li><p><strong>606 projects</strong>: From “Hello World” to complex GPU shaders</p></li><li><p><strong>Build-ready</strong>: No <code>.git</code> folders, no xcuserdata, no cruft</p></li><li><p><strong>MIT Licensed</strong>: Use them however you want</p></li></ul>
<p>When you ask Claude “show me how Apple implements ARKit face tracking,” it can now search actual Apple sample code—not hallucinate an approximation.</p>
<p>Example projects include:</p>
<ul><li><p><code>arkit-*</code> — Augmented reality implementations</p></li><li><p><code>swiftui-*</code> — Modern UI patterns</p></li><li><p><code>metal-*</code> — GPU programming examples</p></li><li><p><code>coreml-*</code> — Machine learning integrations</p></li><li><p><code>avfoundation-*</code> — Video and audio capture</p></li></ul>
<h2>The 72-Hour Sprint</h2>
<p>Nine releases shipped in three days. Here’s the changelog:</p>
<table><thead><tr><th>Version</th><th>Key Changes</th></tr></thead><tbody><tr><td>v0.1.6</td><td>JSON-first crawling, WKWebView memory fixes</td></tr><tr><td>v0.1.7</td><td>Swift Book content retrieval fixes</td></tr><tr><td>v0.1.8</td><td>Cleanup command (27GB → 2-3GB)</td></tr><tr><td>v0.1.9</td><td>Language filtering (Swift/ObjC)</td></tr><tr><td>v0.2.0</td><td>Critical fix: source code retention</td></tr><tr><td>v0.2.1</td><td>Eight ranking heuristics</td></tr><tr><td>v0.2.2</td><td>URL depth analysis, resume fixes</td></tr><tr><td>v0.2.3</td><td>Apple Archive legacy docs</td></tr></tbody></table>
<p>Each release addressed real issues discovered while using Cupertino with Claude Code. Fast iteration, real-world testing.</p>
<h2>Using the Full Ecosystem</h2>
<p>Here’s the quickest path to AI-assisted Apple development with accurate documentation:</p>
<pre><code class="language-bash"><span class="tok-comment"># 1. Build the MCP server</span>
git clone https<span class="tok-operator">:</span><span class="tok-operator">/</span><span class="tok-operator">/</span>codeberg<span class="tok-operator">.</span>org<span class="tok-operator">/</span>CupertinoHQ<span class="tok-operator">/</span>cupertino
cd cupertino
swift build <span class="tok-operator">-</span>c release
su<span class="tok-keyword">do</span> cp <span class="tok-operator">.</span>build<span class="tok-operator">/</span>release<span class="tok-operator">/</span>cupertino <span class="tok-operator">/</span>usr<span class="tok-operator">/</span><span class="tok-keyword">local</span><span class="tok-operator">/</span>b<span class="tok-keyword">in</span><span class="tok-operator">/</span>

<span class="tok-comment"># 2. Download the public database bundle</span>
cupertino setup

<span class="tok-comment"># 3. Configure Claude Code</span>
claude mcp add cupertino <span class="tok-operator">-</span><span class="tok-operator">-</span>scope user <span class="tok-operator">-</span><span class="tok-operator">-</span> <span class="tok-operator">/</span>usr<span class="tok-operator">/</span><span class="tok-keyword">local</span><span class="tok-operator">/</span>b<span class="tok-keyword">in</span><span class="tok-operator">/</span>cupertino</code></pre>
<p>Now when you ask Claude about Apple APIs, it searches 22,000+ pages of real documentation. No hallucinations. No deprecated patterns. Just accurate, current information.</p>
<h2>What’s Next</h2>
<p>The ranking heuristics work well but aren’t perfect. Planned improvements:</p>
<ul><li><p><strong><code>make install</code></strong> — One command to install everything: the MCP server, pre-crawled docs, and sample source material</p></li><li><p><strong>Semantic search</strong> — Embeddings-based similarity for conceptual queries</p></li><li><p><strong>Version awareness</strong> — Filter by iOS/macOS version</p></li><li><p><strong>Cross-reference linking</strong> — “See also” connections between related docs</p></li><li><p><strong>Sample code search</strong> — Full-text search across all 606 projects</p></li></ul>
<h2>Join Me</h2>
<p>If you’re an Apple developer tired of AI hallucinations, give Cupertino a try. If you find bugs or have ideas, open an issue—27 closed so far, plenty more to go.</p>
<p>This isn’t a polished product yet. It’s a tool I’m building because I need it, and I’m sharing it because you might need it too.</p>
<h2>Repositories</h2>
<ul><li><p><a href="https://codeberg.org/CupertinoHQ/cupertino">cupertino</a> — MCP Server (Swift)</p></li><li><p><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/artifacts">Cupertino artifacts</a> — Pre-crawled documentation</p></li><li><p><a href="https://codeberg.org/CupertinoHQ/cupertino/src/branch/main/docs/sources/samples">Cupertino sample sources</a> — Apple sample source metadata</p></li></ul>
<p>No more AI hallucinations about Apple APIs. Just real documentation that compiles.</p>]]></content:encoded>
</item>
</channel>
</rss>
